@univerjs/preset-sheets-conditional-formatting 0.6.2 → 0.6.3-nightly.202503051607
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 +68 -68
- package/package.json +5 -5
package/lib/umd/index.js
CHANGED
|
@@ -3,33 +3,33 @@
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
// @univerjs/sheets-conditional-formatting/facade
|
|
6
|
-
(function(l,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets/facade"],u):(l=typeof globalThis<"u"?globalThis:l||self,u(l.UniverSheetsConditionalFormattingFacade={},l.UniverCore,l.UniverSheetsConditionalFormatting,l.UniverSheetsFacade))})(this,function(l,u,r,C){"use strict";var w=Object.defineProperty;var R=(l,u,r)=>u in l?w(l,u,{enumerable:!0,configurable:!0,writable:!0,value:r}):l[u]=r;var _=(l,u,r)=>R(l,typeof u!="symbol"?u+"":u,r);class o{constructor(e={}){_(this,"_rule",{});this._rule=e,this._ensureAttr(this._rule,["rule"])}get _ruleConfig(){return this._rule.rule||null}_getDefaultConfig(e=r.CFRuleType.highlightCell){switch(e){case r.CFRuleType.colorScale:return{type:e,config:[{index:0,color:new u.ColorKit("").toRgbString(),value:{type:r.CFValueType.min}},{index:0,color:new u.ColorKit("green").toRgbString(),value:{type:r.CFValueType.max}}]};case r.CFRuleType.dataBar:return{type:e,isShowValue:!0,config:{min:{type:r.CFValueType.min},max:{type:r.CFValueType.max},positiveColor:new u.ColorKit("green").toRgbString(),nativeColor:new u.ColorKit("").toRgbString(),isGradient:!1}};case r.CFRuleType.highlightCell:return{type:e,subType:r.CFSubRuleType.text,operator:r.CFTextOperator.containsText,value:"abc",style:{}};case r.CFRuleType.iconSet:return{type:e,isShowValue:!0,config:[{operator:r.CFNumberOperator.greaterThanOrEqual,value:{type:r.CFValueType.min},iconType:r.EMPTY_ICON_TYPE,iconId:""},{operator:r.CFNumberOperator.greaterThanOrEqual,value:{type:r.CFValueType.percentile,value:.5},iconType:r.EMPTY_ICON_TYPE,iconId:""},{operator:r.CFNumberOperator.lessThanOrEqual,value:{type:r.CFValueType.max},iconType:r.EMPTY_ICON_TYPE,iconId:""}]}}}_ensureAttr(e,t){return t.reduce((i,s)=>(i[s]||(i[s]={}),i[s]),e),e}build(){var i;this._rule.cfId||(this._rule.cfId=r.createCfId()),this._rule.ranges||(this._rule.ranges=[]),this._rule.stopIfTrue===void 0&&(this._rule.stopIfTrue=!1),(i=this._rule.rule)!=null&&i.type||(this._rule.rule.type=r.CFRuleType.highlightCell,this._ensureAttr(this._rule,["rule","style"]));const e=this._getDefaultConfig(this._rule.rule.type);return{...this._rule,rule:{...e,...this._rule.rule}}}copy(){return new o(u.Tools.deepClone(this._rule))}getRanges(){return this._rule.ranges||[]}getIconMap(){return r.iconMap}createCfId(){return r.createCfId()}setRanges(e){return this._rule.ranges=e,this}}class n extends o{constructor(e={}){super(e),this._ensureAttr(this._rule,["rule","style"])}copy(){return new n(u.Tools.deepClone(this._rule))}setAverage(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.average,t.operator=e,this}setUniqueValues(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.uniqueValues,this}setDuplicateValues(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.duplicateValues,this}setRank(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.rank,t.isBottom=e.isBottom,t.isPercent=e.isPercent,t.value=e.value,this}setBackground(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell)if(e){this._ensureAttr(this._ruleConfig,["style","bg"]);const i=new u.ColorKit(e);this._ruleConfig.style.bg.rgb=i.toRgbString()}else delete this._ruleConfig.style.bg;return this}setBold(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.bl=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setFontColor(e){var t;if(((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell)if(e){const i=new u.ColorKit(e);this._ensureAttr(this._ruleConfig,["style","cl"]),this._ruleConfig.style.cl.rgb=i.toRgbString()}else delete this._ruleConfig.style.cl;return this}setItalic(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.it=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setStrikethrough(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","st"]),this._ruleConfig.style.st.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setUnderline(e){var t;return((t=this._ruleConfig)==null?void 0:t.type)===r.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","ul"]),this._ruleConfig.style.ul.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}whenCellEmpty(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.text,e.value="",e.operator=r.CFTextOperator.equal,this}whenCellNotEmpty(){const e=this._ruleConfig;return e.type=r.CFRuleType.highlightCell,e.subType=r.CFSubRuleType.text,e.value="",e.operator=r.CFTextOperator.notEqual,this}whenDate(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.timePeriod,t.operator=e,this}whenFormulaSatisfied(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.formula,t.value=e,this}whenNumberBetween(e,t){const i=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=r.CFRuleType.highlightCell,h.subType=r.CFSubRuleType.number,h.value=[i,s],h.operator=r.CFNumberOperator.between,this}whenNumberEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.equal,this}whenNumberGreaterThan(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.greaterThan,this}whenNumberGreaterThanOrEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.greaterThanOrEqual,this}whenNumberLessThan(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.lessThan,this}whenNumberLessThanOrEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.lessThanOrEqual,this}whenNumberNotBetween(e,t){const i=Math.min(e,t),s=Math.max(e,t),h=this._ruleConfig;return h.type=r.CFRuleType.highlightCell,h.subType=r.CFSubRuleType.number,h.value=[i,s],h.operator=r.CFNumberOperator.notBetween,this}whenNumberNotEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.number,t.value=e,t.operator=r.CFNumberOperator.notEqual,this}whenTextContains(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.containsText,this}whenTextDoesNotContain(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.notContainsText,this}whenTextEndsWith(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.endsWith,this}whenTextEqualTo(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.equal,this}whenTextStartsWith(e){const t=this._ruleConfig;return t.type=r.CFRuleType.highlightCell,t.subType=r.CFSubRuleType.text,t.value=e,t.operator=r.CFTextOperator.beginsWith,this}}class a extends o{copy(){return new a(u.Tools.deepClone(this._rule))}setDataBar(e){const t=this._ruleConfig;return t.type=r.CFRuleType.dataBar,t.isShowValue=!!e.isShowValue,t.config={min:e.min,max:e.max,positiveColor:e.positiveColor,nativeColor:e.nativeColor,isGradient:!!e.isGradient},this}}class g extends o{copy(){return new g(u.Tools.deepClone(this._rule))}setColorScale(e){const t=this._ruleConfig;return t.type=r.CFRuleType.colorScale,t.config=e,this}}class y extends o{copy(){return new y(u.Tools.deepClone(this._rule))}setIconSet(e){const t=this._ruleConfig;return t.type=r.CFRuleType.iconSet,t.config=e.iconConfigs,t.isShowValue=e.isShowValue,this}}class p{constructor(e={}){this._initConfig=e}build(){return new o(this._initConfig).build()}setAverage(e){return new n(this._initConfig).setAverage(e)}setUniqueValues(){return new n(this._initConfig).setUniqueValues()}setDuplicateValues(){return new n(this._initConfig).setDuplicateValues()}setRank(e){return new n(this._initConfig).setRank(e)}setIconSet(e){return new y(this._initConfig).setIconSet(e)}setColorScale(e){return new g(this._initConfig).setColorScale(e)}setDataBar(e){return new a(this._initConfig).setDataBar(e)}setBackground(e){return new n(this._initConfig).setBackground(e)}setBold(e){return new n(this._initConfig).setBold(e)}setFontColor(e){return new n(this._initConfig).setFontColor(e)}setItalic(e){return new n(this._initConfig).setItalic(e)}setStrikethrough(e){return new n(this._initConfig).setStrikethrough(e)}setUnderline(e){return new n(this._initConfig).setUnderline(e)}whenCellEmpty(){return new n(this._initConfig).whenCellEmpty()}whenCellNotEmpty(){return new n(this._initConfig).whenCellNotEmpty()}whenDate(e){return new n(this._initConfig).whenDate(e)}whenFormulaSatisfied(e){return new n(this._initConfig).whenFormulaSatisfied(e)}whenNumberBetween(e,t){return new n(this._initConfig).whenNumberBetween(e,t)}whenNumberEqualTo(e){return new n(this._initConfig).whenNumberEqualTo(e)}whenNumberGreaterThan(e){return new n(this._initConfig).whenNumberGreaterThan(e)}whenNumberGreaterThanOrEqualTo(e){return new n(this._initConfig).whenNumberGreaterThanOrEqualTo(e)}whenNumberLessThan(e){return new n(this._initConfig).whenNumberLessThan(e)}whenNumberLessThanOrEqualTo(e){return new n(this._initConfig).whenNumberLessThanOrEqualTo(e)}whenNumberNotBetween(e,t){return new n(this._initConfig).whenNumberNotBetween(e,t)}whenNumberNotEqualTo(e){return new n(this._initConfig).whenNumberNotEqualTo(e)}whenTextContains(e){return new n(this._initConfig).whenTextContains(e)}whenTextDoesNotContain(e){return new n(this._initConfig).whenTextDoesNotContain(e)}whenTextEndsWith(e){return new n(this._initConfig).whenTextEndsWith(e)}whenTextEqualTo(e){return new n(this._initConfig).whenTextEqualTo(e)}whenTextStartsWith(e){return new n(this._initConfig).whenTextStartsWith(e)}}class f extends C.FRange{_getConditionalFormattingRuleModel(){return this._injector.get(r.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]].filter(t=>t.ranges.some(i=>u.Rectangle.intersects(i,this._range)))}createConditionalFormattingRule(){return new p({ranges:[this._range]})}addConditionalFormattingRule(e){const t={rule:e,unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(r.AddConditionalRuleMutation.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(r.DeleteConditionalRuleMutation.id,t),this}moveConditionalFormattingRule(e,t,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:i}};return this._commandService.syncExecuteCommand(r.MoveConditionalRuleMutation.id,s),this}setConditionalFormattingRule(e,t){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:t,cfId:e};return this._commandService.syncExecuteCommand(r.SetConditionalRuleMutation.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]};return this._commandService.syncExecuteCommand(r.ClearRangeCfCommand.id,e),this}}C.FRange.extend(f);class c extends C.FWorkbook{newColor(){return new u.ColorBuilder}}C.FWorkbook.extend(c);class b extends C.FWorksheet{_getConditionalFormattingRuleModel(){return this._injector.get(r.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]]}createConditionalFormattingRule(){return new p}newConditionalFormattingRule(){return new p}addConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:e};return this._commandService.syncExecuteCommand(r.AddCfCommand.id,t),this}deleteConditionalFormattingRule(e){const t={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(r.DeleteCfCommand.id,t),this}moveConditionalFormattingRule(e,t,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:t,type:i}};return this._commandService.syncExecuteCommand(r.MoveCfCommand.id,s),this}setConditionalFormattingRule(e,t){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e,rule:t};return this._commandService.syncExecuteCommand(r.SetCfCommand.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(r.ClearWorksheetCfCommand.id,e),this}}C.FWorksheet.extend(b),l.FConditionalFormattingBuilder=p,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
6
|
+
(function(l,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets/facade"),require("@univerjs/core/facade")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets/facade","@univerjs/core/facade"],u):(l=typeof globalThis<"u"?globalThis:l||self,u(l.UniverSheetsConditionalFormattingFacade={},l.UniverCore,l.UniverSheetsConditionalFormatting,l.UniverSheetsFacade,l.UniverCoreFacade))})(this,function(l,u,t,C,y){"use strict";var R=Object.defineProperty;var m=(l,u,t)=>u in l?R(l,u,{enumerable:!0,configurable:!0,writable:!0,value:t}):l[u]=t;var T=(l,u,t)=>m(l,typeof u!="symbol"?u+"":u,t);class o{constructor(e={}){T(this,"_rule",{});this._rule=e,this._ensureAttr(this._rule,["rule"])}get _ruleConfig(){return this._rule.rule||null}_getDefaultConfig(e=t.CFRuleType.highlightCell){switch(e){case t.CFRuleType.colorScale:return{type:e,config:[{index:0,color:new u.ColorKit("").toRgbString(),value:{type:t.CFValueType.min}},{index:0,color:new u.ColorKit("green").toRgbString(),value:{type:t.CFValueType.max}}]};case t.CFRuleType.dataBar:return{type:e,isShowValue:!0,config:{min:{type:t.CFValueType.min},max:{type:t.CFValueType.max},positiveColor:new u.ColorKit("green").toRgbString(),nativeColor:new u.ColorKit("").toRgbString(),isGradient:!1}};case t.CFRuleType.highlightCell:return{type:e,subType:t.CFSubRuleType.text,operator:t.CFTextOperator.containsText,value:"abc",style:{}};case t.CFRuleType.iconSet:return{type:e,isShowValue:!0,config:[{operator:t.CFNumberOperator.greaterThanOrEqual,value:{type:t.CFValueType.min},iconType:t.EMPTY_ICON_TYPE,iconId:""},{operator:t.CFNumberOperator.greaterThanOrEqual,value:{type:t.CFValueType.percentile,value:.5},iconType:t.EMPTY_ICON_TYPE,iconId:""},{operator:t.CFNumberOperator.lessThanOrEqual,value:{type:t.CFValueType.max},iconType:t.EMPTY_ICON_TYPE,iconId:""}]}}}_ensureAttr(e,r){return r.reduce((i,s)=>(i[s]||(i[s]={}),i[s]),e),e}build(){var i;this._rule.cfId||(this._rule.cfId=t.createCfId()),this._rule.ranges||(this._rule.ranges=[]),this._rule.stopIfTrue===void 0&&(this._rule.stopIfTrue=!1),(i=this._rule.rule)!=null&&i.type||(this._rule.rule.type=t.CFRuleType.highlightCell,this._ensureAttr(this._rule,["rule","style"]));const e=this._getDefaultConfig(this._rule.rule.type);return{...this._rule,rule:{...e,...this._rule.rule}}}copy(){const e=u.Tools.deepClone(this._rule);return e.cfId&&(e.cfId=t.createCfId()),new o(e)}getRanges(){return this._rule.ranges||[]}getIconMap(){return t.iconMap}createCfId(){return t.createCfId()}setRanges(e){return this._rule.ranges=e,this}}class n extends o{constructor(e={}){super(e),this._ensureAttr(this._rule,["rule","style"])}copy(){const e=u.Tools.deepClone(this._rule);return e.cfId&&(e.cfId=t.createCfId()),new n(e)}setAverage(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.average,r.operator=e,this}setUniqueValues(){const e=this._ruleConfig;return e.type=t.CFRuleType.highlightCell,e.subType=t.CFSubRuleType.uniqueValues,this}setDuplicateValues(){const e=this._ruleConfig;return e.type=t.CFRuleType.highlightCell,e.subType=t.CFSubRuleType.duplicateValues,this}setRank(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.rank,r.isBottom=e.isBottom,r.isPercent=e.isPercent,r.value=e.value,this}setBackground(e){var r;if(((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell)if(e){this._ensureAttr(this._ruleConfig,["style","bg"]);const i=new u.ColorKit(e);this._ruleConfig.style.bg.rgb=i.toRgbString()}else delete this._ruleConfig.style.bg;return this}setBold(e){var r;return((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.bl=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setFontColor(e){var r;if(((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell)if(e){const i=new u.ColorKit(e);this._ensureAttr(this._ruleConfig,["style","cl"]),this._ruleConfig.style.cl.rgb=i.toRgbString()}else delete this._ruleConfig.style.cl;return this}setItalic(e){var r;return((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style"]),this._ruleConfig.style.it=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setStrikethrough(e){var r;return((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","st"]),this._ruleConfig.style.st.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}setUnderline(e){var r;return((r=this._ruleConfig)==null?void 0:r.type)===t.CFRuleType.highlightCell&&(this._ensureAttr(this._ruleConfig,["style","ul"]),this._ruleConfig.style.ul.s=e?u.BooleanNumber.TRUE:u.BooleanNumber.FALSE),this}whenCellEmpty(){const e=this._ruleConfig;return e.type=t.CFRuleType.highlightCell,e.subType=t.CFSubRuleType.text,e.value="",e.operator=t.CFTextOperator.equal,this}whenCellNotEmpty(){const e=this._ruleConfig;return e.type=t.CFRuleType.highlightCell,e.subType=t.CFSubRuleType.text,e.value="",e.operator=t.CFTextOperator.notEqual,this}whenDate(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.timePeriod,r.operator=e,this}whenFormulaSatisfied(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.formula,r.value=e,this}whenNumberBetween(e,r){const i=Math.min(e,r),s=Math.max(e,r),h=this._ruleConfig;return h.type=t.CFRuleType.highlightCell,h.subType=t.CFSubRuleType.number,h.value=[i,s],h.operator=t.CFNumberOperator.between,this}whenNumberEqualTo(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.equal,this}whenNumberGreaterThan(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.greaterThan,this}whenNumberGreaterThanOrEqualTo(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.greaterThanOrEqual,this}whenNumberLessThan(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.lessThan,this}whenNumberLessThanOrEqualTo(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.lessThanOrEqual,this}whenNumberNotBetween(e,r){const i=Math.min(e,r),s=Math.max(e,r),h=this._ruleConfig;return h.type=t.CFRuleType.highlightCell,h.subType=t.CFSubRuleType.number,h.value=[i,s],h.operator=t.CFNumberOperator.notBetween,this}whenNumberNotEqualTo(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.number,r.value=e,r.operator=t.CFNumberOperator.notEqual,this}whenTextContains(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.text,r.value=e,r.operator=t.CFTextOperator.containsText,this}whenTextDoesNotContain(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.text,r.value=e,r.operator=t.CFTextOperator.notContainsText,this}whenTextEndsWith(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.text,r.value=e,r.operator=t.CFTextOperator.endsWith,this}whenTextEqualTo(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.text,r.value=e,r.operator=t.CFTextOperator.equal,this}whenTextStartsWith(e){const r=this._ruleConfig;return r.type=t.CFRuleType.highlightCell,r.subType=t.CFSubRuleType.text,r.value=e,r.operator=t.CFTextOperator.beginsWith,this}}class f extends o{copy(){const e=u.Tools.deepClone(this._rule);return e.cfId&&(e.cfId=t.createCfId()),new f(e)}setDataBar(e){const r=this._ruleConfig;return r.type=t.CFRuleType.dataBar,r.isShowValue=!!e.isShowValue,r.config={min:e.min,max:e.max,positiveColor:e.positiveColor,nativeColor:e.nativeColor,isGradient:!!e.isGradient},this}}class c extends o{copy(){const e=u.Tools.deepClone(this._rule);return e.cfId&&(e.cfId=t.createCfId()),new c(e)}setColorScale(e){const r=this._ruleConfig;return r.type=t.CFRuleType.colorScale,r.config=e,this}}class g extends o{copy(){const e=u.Tools.deepClone(this._rule);return e.cfId&&(e.cfId=t.createCfId()),new g(e)}setIconSet(e){const r=this._ruleConfig;return r.type=t.CFRuleType.iconSet,r.config=e.iconConfigs,r.isShowValue=e.isShowValue,this}}class p{constructor(e={}){this._initConfig=e}build(){return new o(this._initConfig).build()}setAverage(e){return new n(this._initConfig).setAverage(e)}setUniqueValues(){return new n(this._initConfig).setUniqueValues()}setDuplicateValues(){return new n(this._initConfig).setDuplicateValues()}setRank(e){return new n(this._initConfig).setRank(e)}getIconMap(){return t.iconMap}setIconSet(e){return new g(this._initConfig).setIconSet(e)}setColorScale(e){return new c(this._initConfig).setColorScale(e)}setDataBar(e){return new f(this._initConfig).setDataBar(e)}setBackground(e){return new n(this._initConfig).setBackground(e)}setBold(e){return new n(this._initConfig).setBold(e)}setFontColor(e){return new n(this._initConfig).setFontColor(e)}setItalic(e){return new n(this._initConfig).setItalic(e)}setStrikethrough(e){return new n(this._initConfig).setStrikethrough(e)}setUnderline(e){return new n(this._initConfig).setUnderline(e)}whenCellEmpty(){return new n(this._initConfig).whenCellEmpty()}whenCellNotEmpty(){return new n(this._initConfig).whenCellNotEmpty()}whenDate(e){return new n(this._initConfig).whenDate(e)}whenFormulaSatisfied(e){return new n(this._initConfig).whenFormulaSatisfied(e)}whenNumberBetween(e,r){return new n(this._initConfig).whenNumberBetween(e,r)}whenNumberEqualTo(e){return new n(this._initConfig).whenNumberEqualTo(e)}whenNumberGreaterThan(e){return new n(this._initConfig).whenNumberGreaterThan(e)}whenNumberGreaterThanOrEqualTo(e){return new n(this._initConfig).whenNumberGreaterThanOrEqualTo(e)}whenNumberLessThan(e){return new n(this._initConfig).whenNumberLessThan(e)}whenNumberLessThanOrEqualTo(e){return new n(this._initConfig).whenNumberLessThanOrEqualTo(e)}whenNumberNotBetween(e,r){return new n(this._initConfig).whenNumberNotBetween(e,r)}whenNumberNotEqualTo(e){return new n(this._initConfig).whenNumberNotEqualTo(e)}whenTextContains(e){return new n(this._initConfig).whenTextContains(e)}whenTextDoesNotContain(e){return new n(this._initConfig).whenTextDoesNotContain(e)}whenTextEndsWith(e){return new n(this._initConfig).whenTextEndsWith(e)}whenTextEqualTo(e){return new n(this._initConfig).whenTextEqualTo(e)}whenTextStartsWith(e){return new n(this._initConfig).whenTextStartsWith(e)}}class _ extends C.FRange{_getConditionalFormattingRuleModel(){return this._injector.get(t.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]].filter(r=>r.ranges.some(i=>u.Rectangle.intersects(i,this._range)))}createConditionalFormattingRule(){return new p({ranges:[this._range]})}addConditionalFormattingRule(e){const r={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:e};return this._commandService.syncExecuteCommand(t.AddCfCommand.id,r),this}deleteConditionalFormattingRule(e){const r={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(t.DeleteCfCommand.id,r),this}moveConditionalFormattingRule(e,r,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:r,type:i}};return this._commandService.syncExecuteCommand(t.MoveCfCommand.id,s),this}setConditionalFormattingRule(e,r){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:r,cfId:e};return this._commandService.syncExecuteCommand(t.SetCfCommand.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),ranges:[this._range]};return this._commandService.syncExecuteCommand(t.ClearRangeCfCommand.id,e),this}}C.FRange.extend(_);class w extends C.FWorkbook{newColor(){return new u.ColorBuilder}}C.FWorkbook.extend(w);class b extends C.FWorksheet{_getConditionalFormattingRuleModel(){return this._injector.get(t.ConditionalFormattingRuleModel)}getConditionalFormattingRules(){return[...this._getConditionalFormattingRuleModel().getSubunitRules(this._workbook.getUnitId(),this._worksheet.getSheetId())||[]]}createConditionalFormattingRule(){return new p}newConditionalFormattingRule(){return new p}addConditionalFormattingRule(e){const r={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),rule:e};return this._commandService.syncExecuteCommand(t.AddCfCommand.id,r),this}deleteConditionalFormattingRule(e){const r={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e};return this._commandService.syncExecuteCommand(t.DeleteCfCommand.id,r),this}moveConditionalFormattingRule(e,r,i="after"){const s={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),start:{id:e,type:"self"},end:{id:r,type:i}};return this._commandService.syncExecuteCommand(t.MoveCfCommand.id,s),this}setConditionalFormattingRule(e,r){const i={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId(),cfId:e,rule:r};return this._commandService.syncExecuteCommand(t.SetCfCommand.id,i),this}clearConditionalFormatRules(){const e={unitId:this._workbook.getUnitId(),subUnitId:this._worksheet.getSheetId()};return this._commandService.syncExecuteCommand(t.ClearWorksheetCfCommand.id,e),this}}C.FWorksheet.extend(b);class d{get ConditionFormatNumberOperatorEnum(){return t.CFNumberOperator}get ConditionFormatTimePeriodOperatorEnum(){return t.CFTimePeriodOperator}}y.FEnum.extend(d),l.FConditionalFormattingBuilder=p,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
10
|
-
(function($,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],_):($=typeof globalThis<"u"?globalThis:$||self,_($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,_,c,Y,te,R,V,ee,kt,fe,pr,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=($,_,c)=>_ in $?mo($,_,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[_]=c;var De=($,_,c)=>yo($,typeof _!="symbol"?_+"":_,c);const At={type:_.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.ICommandService),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Wt={type:_.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},jt={type:_.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:C}=e,m=t.get(c.ConditionalFormattingRuleModel),w=t.get(_.IUniverInstanceService),E=Y.getSheetCommandTarget(w);if(!E)return!1;const{unitId:I,subUnitId:S}=E,T=t.get(_.ICommandService),h=m.createCfId(I,S),i={ranges:n,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:C,config:{min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return T.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:S,rule:i})}},Ht={type:_.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},Bt={type:_.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.ICommandService),C=t.get(_.IUniverInstanceService),m=Y.getSheetCommandTarget(C);if(!m)return!1;const{unitId:w,subUnitId:E}=m,I=y.createCfId(w,E);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const T=u;if(T.length!==2||!Array.isArray(T))return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=u;if(typeof T!="number")return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:E,rule:S})}},Ft={type:_.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),C=t.get(_.IUniverInstanceService),m=t.get(_.ICommandService),w=Y.getSheetCommandTarget(C);if(!w)return!1;const{unitId:E,subUnitId:I}=w,S=p.createCfId(E,I),T={ranges:n,cfId:S,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:r,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:I,rule:T})}},Gt={type:_.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=t.get(_.ICommandService),I=y.createCfId(m,w),S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:r,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:S})}},qt={type:_.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.IUniverInstanceService),p=t.get(_.ICommandService),C=Y.getSheetCommandTarget(y);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:r}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Xt={type:_.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.IUniverInstanceService),y=t.get(_.ICommandService),p=Y.getSheetCommandTarget(u);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",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 be=function(){return be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},be.apply(this,arguments)},_n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},Ue=V.forwardRef(function(t,e){var n=t.icon,r=t.id,a=t.className,o=t.extend,u=_n(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),p=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:p.current},be({ref:e,className:y},u),o)});function gr(t,e,n,r,a){return V.createElement(t.tag,be(be({key:e},Rn(t,n,a)),r),(En(t,n).children||[]).map(function(o,u){return gr(o,"".concat(e,"-").concat(t.tag,"-").concat(u),n,void 0,a)}))}function Rn(t,e,n){var r=be({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),t.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function En(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?be(be({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={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"}}]},gt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:Pn}))});gt.displayName="DeleteSingle";var Dn={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=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Dn}))});vr.displayName="IncreaseSingle";var xn={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"}}]},vt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:xn}))});vt.displayName="MoreDownSingle";var Mn={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"}}]}]},mr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={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"}}]}]},Xe=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var Yt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Kt(){return br||(br=1,function(t,e){(function(n,r){r(e)})(Vn,function(n){function r(j){return function(se,P,D,N,k,X,H){return j(se,P,H)}}function a(j){return function(se,P,D,N){if(!se||!P||typeof se!="object"||typeof P!="object")return j(se,P,D,N);var k=N.get(se),X=N.get(P);if(k&&X)return k===P&&X===se;N.set(se,P),N.set(P,se);var H=j(se,P,D,N);return N.delete(se),N.delete(P),H}}function o(j,Q){var se={};for(var P in j)se[P]=j[P];for(var P in Q)se[P]=Q[P];return se}function u(j){return j.constructor===Object||j.constructor==null}function y(j){return typeof j.then=="function"}function p(j,Q){return j===Q||j!==j&&Q!==Q}var C="[object Arguments]",m="[object Boolean]",w="[object Date]",E="[object RegExp]",I="[object Map]",S="[object Number]",T="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function f(j){var Q=j.areArraysEqual,se=j.areDatesEqual,P=j.areMapsEqual,D=j.areObjectsEqual,N=j.areRegExpsEqual,k=j.areSetsEqual,X=j.createIsNestedEqual,H=X(Z);function Z(K,re,de){if(K===re)return!0;if(!K||!re||typeof K!="object"||typeof re!="object")return K!==K&&re!==re;if(u(K)&&u(re))return D(K,re,H,de);var Le=Array.isArray(K),Se=Array.isArray(re);if(Le||Se)return Le===Se&&Q(K,re,H,de);var ve=s.call(K);return ve!==s.call(re)?!1:ve===w?se(K,re,H,de):ve===E?N(K,re,H,de):ve===I?P(K,re,H,de):ve===h?k(K,re,H,de):ve===T||ve===C?y(K)||y(re)?!1:D(K,re,H,de):ve===m||ve===S||ve===i?p(K.valueOf(),re.valueOf()):!1}return Z}function b(j,Q,se,P){var D=j.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!se(j[D],Q[D],D,D,j,Q,P))return!1;return!0}var l=a(b);function g(j,Q){return p(j.valueOf(),Q.valueOf())}function d(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={},k=0;return j.forEach(function(X,H){if(D){var Z=!1,K=0;Q.forEach(function(re,de){!Z&&!N[K]&&(Z=se(H,de,k,K,j,Q,P)&&se(X,re,H,de,j,Q,P))&&(N[K]=!0),K++}),k++,D=Z}}),D}var v=a(d),x="_owner",M=Object.prototype.hasOwnProperty;function z(j,Q,se,P){var D=Object.keys(j),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===x){var X=!!j.$$typeof,H=!!Q.$$typeof;if((X||H)&&X!==H)return!1}if(!M.call(Q,k)||!se(j[k],Q[k],k,k,j,Q,P))return!1}return!0}var U=a(z);function O(j,Q){return j.source===Q.source&&j.flags===Q.flags}function L(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={};return j.forEach(function(k,X){if(D){var H=!1,Z=0;Q.forEach(function(K,re){!H&&!N[Z]&&(H=se(k,K,X,re,j,Q,P))&&(N[Z]=!0),Z++}),D=H}}),D}var F=a(L),q=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),J=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:F,createIsNestedEqual:r}),le=f(q);function ae(j,Q){return le(j,Q,void 0)}var B=f(o(q,{createIsNestedEqual:function(){return p}}));function W(j,Q){return B(j,Q,void 0)}var ne=f(J);function ie(j,Q){return ne(j,Q,new WeakMap)}var ue=f(o(J,{createIsNestedEqual:function(){return p}}));function ge(j,Q){return ue(j,Q,new WeakMap)}function ye(j){return f(o(q,j(q)))}function Te(j){var Q=f(o(J,j(J)));return function(se,P,D){return D===void 0&&(D=new WeakMap),Q(se,P,D)}}n.circularDeepEqual=ie,n.circularShallowEqual=ge,n.createCustomCircularEqual=Te,n.createCustomEqual=ye,n.deepEqual=ae,n.sameValueZeroEqual=p,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function Zt(){if(Sr)return mt.exports;Sr=1;function t(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=t(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=t(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=e,mt.exports.clsx=e,mt.exports}var oe={},$t,Cr;function Un(){return Cr||(Cr=1,$t=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)}),$t}var Tr;function ze(){if(Tr)return oe;Tr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.bottom=r,oe.childrenEqual=p,oe.cloneLayout=a,oe.cloneLayoutItem=y,oe.collides=m,oe.compact=w,oe.compactItem=S,oe.compactType=j,oe.correctBounds=T,oe.fastPositionEqual=C,oe.fastRGLPropsEqual=void 0,oe.getAllCollisions=s,oe.getFirstCollision=i,oe.getLayoutItem=h,oe.getStatics=f,oe.modifyLayout=o,oe.moveElement=b,oe.moveElementAwayFromCollision=l,oe.noop=void 0,oe.perc=g,oe.resizeItemInDirection=B,oe.setTopLeft=ne,oe.setTransform=W,oe.sortLayoutItems=ie,oe.sortLayoutItemsByColRow=ge,oe.sortLayoutItemsByRowCol=ue,oe.synchronizeLayoutWithChildren=ye,oe.validateLayout=Te,oe.withLayoutItem=u;var t=Kt(),e=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let D=0,N;for(let k=0,X=P.length;k<X;k++)N=P[k].y+P[k].h,N>D&&(D=N);return D}function a(P){const D=Array(P.length);for(let N=0,k=P.length;N<k;N++)D[N]=y(P[N]);return D}function o(P,D){const N=Array(P.length);for(let k=0,X=P.length;k<X;k++)D.i===P[k].i?N[k]=D:N[k]=P[k];return N}function u(P,D,N){let k=h(P,D);return k?(k=N(y(k)),P=o(P,k),[P,k]):[P,null]}function y(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function p(P,D){return(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.key),e.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}oe.fastRGLPropsEqual=Un();function C(P,D){return P.left===D.left&&P.top===D.top&&P.width===D.width&&P.height===D.height}function m(P,D){return!(P.i===D.i||P.x+P.w<=D.x||P.x>=D.x+D.w||P.y+P.h<=D.y||P.y>=D.y+D.h)}function w(P,D,N,k){const X=f(P),H=ie(P,D),Z=Array(P.length);for(let K=0,re=H.length;K<re;K++){let de=y(H[K]);de.static||(de=S(X,de,D,N,H,k),X.push(de)),Z[P.indexOf(H[K])]=de,de.moved=!1}return Z}const E={x:"w",y:"h"};function I(P,D,N,k){const X=E[k];D[k]+=1;const H=P.map(Z=>Z.i).indexOf(D.i);for(let Z=H+1;Z<P.length;Z++){const K=P[Z];if(!K.static){if(K.y>D.y+D.h)break;m(D,K)&&I(P,K,N+D[X],k)}}D[k]=N}function S(P,D,N,k,X,H){const Z=N==="vertical",K=N==="horizontal";if(Z)for(D.y=Math.min(r(P),D.y);D.y>0&&!i(P,D);)D.y--;else if(K)for(;D.x>0&&!i(P,D);)D.x--;let re;for(;(re=i(P,D))&&!(N===null&&H);)if(K?I(X,D,re.x+re.w,"x"):I(X,D,re.y+re.h,"y"),K&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(P,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function T(P,D){const N=f(P);for(let k=0,X=P.length;k<X;k++){const H=P[k];if(H.x+H.w>D.cols&&(H.x=D.cols-H.w),H.x<0&&(H.x=0,H.w=D.cols),!H.static)N.push(H);else for(;i(N,H);)H.y++}return P}function h(P,D){for(let N=0,k=P.length;N<k;N++)if(P[N].i===D)return P[N]}function i(P,D){for(let N=0,k=P.length;N<k;N++)if(m(P[N],D))return P[N]}function s(P,D){return P.filter(N=>m(N,D))}function f(P){return P.filter(D=>D.static)}function b(P,D,N,k,X,H,Z,K,re){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return P;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let Se=ie(P,Z);(Z==="vertical"&&typeof k=="number"?Le>=k:Z==="horizontal"&&typeof N=="number"?de>=N:!1)&&(Se=Se.reverse());const Fe=s(Se,D),zt=Fe.length>0;if(zt&&re)return a(P);if(zt&&H)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,P;for(let fr=0,vo=Fe.length;fr<vo;fr++){const Ve=Fe[fr];`${D.i}${D.x}${D.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,D,X,Z):P=l(P,D,Ve,X,Z))}return P}function l(P,D,N,k,X,H){const Z=X==="horizontal",K=X==="vertical",re=D.static;if(k){k=!1;const Se={x:Z?Math.max(D.x-N.w,0):N.x,y:K?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(P,Se),Fe=ve&&ve.y+ve.h>D.y,zt=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&K)return b(P,N,void 0,D.y+1,k,re,X);if(Fe&&X==null)return D.y=N.y,N.y=N.y+N.h,P;if(zt&&Z)return b(P,D,N.x,void 0,k,re,X)}else return`${N.i}${Se.x}${Se.y}`,b(P,N,Z?Se.x:void 0,K?Se.y:void 0,k,re,X)}const de=Z?N.x+1:void 0,Le=K?N.y+1:void 0;return de==null&&Le==null?P:b(P,N,Z?N.x+1:void 0,K?N.y+1:void 0,k,re,X)}function g(P){return P*100+"%"}const d=(P,D,N,k)=>P+N>k?D:N,v=(P,D,N)=>P<0?D:N,x=P=>Math.max(0,P),M=P=>Math.max(0,P),z=(P,D,N)=>{let{left:k,height:X,width:H}=D;const Z=P.top-(X-P.height);return{left:k,width:H,height:v(Z,P.height,X),top:M(Z)}},U=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{top:k,height:H,width:d(P.left,P.width,Z,N),left:x(X)}},O=(P,D,N)=>{let{top:k,height:X,width:H}=D;const Z=P.left-(H-P.width);return{height:X,width:Z<0?P.width:d(P.left,P.width,H,N),top:M(k),left:x(Z)}},L=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{width:Z,left:X,height:v(k,P.height,H),top:M(k)}},ae={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return L(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:L,sw:function(){return L(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return z(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function B(P,D,N,k){const X=ae[P];return X?X(D,{...D,...N},k):N}function W(P){let{top:D,left:N,width:k,height:X}=P;const H=`translate(${N}px,${D}px)`;return{transform:H,WebkitTransform:H,MozTransform:H,msTransform:H,OTransform:H,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ne(P){let{top:D,left:N,width:k,height:X}=P;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ie(P,D){return D==="horizontal"?ge(P):D==="vertical"?ue(P):P}function ue(P){return P.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(P){return P.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(P,D,N,k,X){P=P||[];const H=[];e.default.Children.forEach(D,K=>{if((K==null?void 0:K.key)==null)return;const re=h(P,String(K.key)),de=K.props["data-grid"];re&&de==null?H.push(y(re)):de?H.push(y({...de,i:K.key})):H.push(y({w:1,h:1,x:0,y:r(H),i:String(K.key)}))});const Z=T(H,{cols:N});return X?Z:w(Z,k,N)}function Te(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(D+" must be an array!");for(let k=0,X=P.length;k<X;k++){const H=P[k];for(let Z=0;Z<N.length;Z++)if(typeof H[N[Z]]!="number")throw new Error("ReactGridLayout: "+D+"["+k+"]."+N[Z]+" must be a number!")}}function j(P){const{verticalCompact:D,compactType:N}=P||{};return D===!1?null:N}function Q(){}const se=()=>{};return oe.noop=se,oe}var Ie={},wr;function Jt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=e,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:C,cols:m}=u;return(C-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function n(u,y,p,C,m,w){const{margin:E,containerPadding:I,rowHeight:S}=u,T=t(u),h={};return w&&w.resizing?(h.width=Math.round(w.resizing.width),h.height=Math.round(w.resizing.height)):(h.width=e(C,T,E[0]),h.height=e(m,S,E[1])),w&&w.dragging?(h.top=Math.round(w.dragging.top),h.left=Math.round(w.dragging.left)):w&&w.resizing&&typeof w.resizing.top=="number"&&typeof w.resizing.left=="number"?(h.top=Math.round(w.resizing.top),h.left=Math.round(w.resizing.left)):(h.top=Math.round((S+E[1])*p+I[1]),h.left=Math.round((T+E[0])*y+I[0])),h}function r(u,y,p,C,m){const{margin:w,cols:E,rowHeight:I,maxRows:S}=u,T=t(u);let h=Math.round((p-w[0])/(T+w[0])),i=Math.round((y-w[1])/(I+w[1]));return h=o(h,0,E-C),i=o(i,0,S-m),{x:h,y:i}}function a(u,y,p,C,m,w){const{margin:E,maxRows:I,cols:S,rowHeight:T}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(T+E[1])),f=o(i,0,S-C),b=o(s,0,I-m);return["sw","w","nw"].indexOf(w)!==-1&&(f=o(i,0,S)),["nw","n","ne"].indexOf(w)!==-1&&(b=o(s,0,I)),{w:f,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return Ie}var Ze={},Qt={exports:{}},er,Ir;function zn(){if(Ir)return er;Ir=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return er=t,er}var tr,_r;function kn(){if(_r)return tr;_r=1;var t=zn();function e(){}function n(){}return n.resetWarningCache=e,tr=function(){function r(u,y,p,C,m,w){if(w!==t){var E=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 E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},tr}var Rr;function Ee(){return Rr||(Rr=1,Qt.exports=kn()()),Qt.exports}var $e={exports:{}},rr={};function Er(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Er(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Or(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Er(t))&&(r&&(r+=" "),r+=e);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=r,Oe.isFunction=e,Oe.isNum=n;function t(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},Dr;function Wn(){if(Dr)return Pe;Dr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,Pe.default=void 0,Pe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(n(u,t[p])in y)return t[p];return""}function n(o,u){return u?"".concat(u).concat(a(o)):o}function r(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Pe.default=e(),Pe}var xr;function nr(){if(xr)return pe;xr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=f,pe.createCSSTransform=S,pe.createSVGTransform=T,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=w,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=I,pe.outerHeight=C,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=b;var t=yt(),e=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(n=function(M){return M?x:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var x=n(v);if(x&&x.has(d))return x.get(d);var M={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in d)if(U!=="default"&&Object.prototype.hasOwnProperty.call(d,U)){var O=z?Object.getOwnPropertyDescriptor(d,U):null;O&&(O.get||O.set)?Object.defineProperty(M,U,O):M[U]=d[U]}return M.default=d,x&&x.set(d,M),M}let a="";function o(d,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(x){return(0,t.isFunction)(d[x])})),(0,t.isFunction)(d[a])?d[a](v):!1}function u(d,v,x){let M=d;do{if(o(M,v))return!0;if(M===x)return!1;M=M.parentNode}while(M);return!1}function y(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.addEventListener?d.addEventListener(v,x,z):d.attachEvent?d.attachEvent("on"+v,x):d["on"+v]=x}function p(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.removeEventListener?d.removeEventListener(v,x,z):d.detachEvent?d.detachEvent("on"+v,x):d["on"+v]=null}function C(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderTopWidth),v+=(0,t.int)(x.borderBottomWidth),v}function m(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderLeftWidth),v+=(0,t.int)(x.borderRightWidth),v}function w(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingTop),v-=(0,t.int)(x.paddingBottom),v}function E(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingLeft),v-=(0,t.int)(x.paddingRight),v}function I(d,v,x){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),U=(d.clientX+v.scrollLeft-z.left)/x,O=(d.clientY+v.scrollTop-z.top)/x;return{x:U,y:O}}function S(d,v){const x=h(d,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:x}}function T(d,v){return h(d,v,"")}function h(d,v,x){let{x:M,y:z}=d,U="translate(".concat(M).concat(x,",").concat(z).concat(x,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+x),L="".concat(typeof v.y=="string"?v.y:v.y+x);U="translate(".concat(O,", ").concat(L,")")+U}return U}function i(d,v){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,x=>v===x.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,x=>v===x.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
10
|
+
(function($,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],_):($=typeof globalThis<"u"?globalThis:$||self,_($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,_,c,K,re,R,V,ee,kt,fe,pr,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=($,_,c)=>_ in $?mo($,_,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[_]=c;var De=($,_,c)=>yo($,typeof _!="symbol"?_+"":_,c);const At={type:_.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.ICommandService),p=t.get(_.IUniverInstanceService),C=K.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Wt={type:_.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=K.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},jt={type:_.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:C}=e,m=t.get(c.ConditionalFormattingRuleModel),w=t.get(_.IUniverInstanceService),E=K.getSheetCommandTarget(w);if(!E)return!1;const{unitId:I,subUnitId:S}=E,T=t.get(_.ICommandService),h=m.createCfId(I,S),i={ranges:n,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:C,config:{min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return T.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:S,rule:i})}},Ht={type:_.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=K.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},Bt={type:_.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.ICommandService),C=t.get(_.IUniverInstanceService),m=K.getSheetCommandTarget(C);if(!m)return!1;const{unitId:w,subUnitId:E}=m,I=y.createCfId(w,E);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const T=u;if(T.length!==2||!Array.isArray(T))return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=u;if(typeof T!="number")return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:E,rule:S})}},Ft={type:_.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),C=t.get(_.IUniverInstanceService),m=t.get(_.ICommandService),w=K.getSheetCommandTarget(C);if(!w)return!1;const{unitId:E,subUnitId:I}=w,S=p.createCfId(E,I),T={ranges:n,cfId:S,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:r,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:I,rule:T})}},Gt={type:_.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.IUniverInstanceService),C=K.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=t.get(_.ICommandService),I=y.createCfId(m,w),S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:r,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:S})}},qt={type:_.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.IUniverInstanceService),p=t.get(_.ICommandService),C=K.getSheetCommandTarget(y);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:r}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Xt={type:_.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.IUniverInstanceService),y=t.get(_.ICommandService),p=K.getSheetCommandTarget(u);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",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 be=function(){return be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},be.apply(this,arguments)},_n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},Ue=V.forwardRef(function(t,e){var n=t.icon,r=t.id,a=t.className,o=t.extend,u=_n(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),p=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:p.current},be({ref:e,className:y},u),o)});function gr(t,e,n,r,a){return V.createElement(t.tag,be(be({key:e},Rn(t,n,a)),r),(En(t,n).children||[]).map(function(o,u){return gr(o,"".concat(e,"-").concat(t.tag,"-").concat(u),n,void 0,a)}))}function Rn(t,e,n){var r=be({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),t.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function En(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?be(be({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={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"}}]},gt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:Pn}))});gt.displayName="DeleteSingle";var Dn={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=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Dn}))});vr.displayName="IncreaseSingle";var xn={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"}}]},vt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:xn}))});vt.displayName="MoreDownSingle";var Mn={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"}}]}]},mr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={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"}}]}]},Xe=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var Yt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Kt(){return br||(br=1,function(t,e){(function(n,r){r(e)})(Vn,function(n){function r(H){return function(se,P,D,N,k,X,W){return H(se,P,W)}}function a(H){return function(se,P,D,N){if(!se||!P||typeof se!="object"||typeof P!="object")return H(se,P,D,N);var k=N.get(se),X=N.get(P);if(k&&X)return k===P&&X===se;N.set(se,P),N.set(P,se);var W=H(se,P,D,N);return N.delete(se),N.delete(P),W}}function o(H,Q){var se={};for(var P in H)se[P]=H[P];for(var P in Q)se[P]=Q[P];return se}function u(H){return H.constructor===Object||H.constructor==null}function y(H){return typeof H.then=="function"}function p(H,Q){return H===Q||H!==H&&Q!==Q}var C="[object Arguments]",m="[object Boolean]",w="[object Date]",E="[object RegExp]",I="[object Map]",S="[object Number]",T="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function f(H){var Q=H.areArraysEqual,se=H.areDatesEqual,P=H.areMapsEqual,D=H.areObjectsEqual,N=H.areRegExpsEqual,k=H.areSetsEqual,X=H.createIsNestedEqual,W=X(Z);function Z(Y,te,de){if(Y===te)return!0;if(!Y||!te||typeof Y!="object"||typeof te!="object")return Y!==Y&&te!==te;if(u(Y)&&u(te))return D(Y,te,W,de);var Le=Array.isArray(Y),Se=Array.isArray(te);if(Le||Se)return Le===Se&&Q(Y,te,W,de);var ve=s.call(Y);return ve!==s.call(te)?!1:ve===w?se(Y,te,W,de):ve===E?N(Y,te,W,de):ve===I?P(Y,te,W,de):ve===h?k(Y,te,W,de):ve===T||ve===C?y(Y)||y(te)?!1:D(Y,te,W,de):ve===m||ve===S||ve===i?p(Y.valueOf(),te.valueOf()):!1}return Z}function b(H,Q,se,P){var D=H.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!se(H[D],Q[D],D,D,H,Q,P))return!1;return!0}var l=a(b);function g(H,Q){return p(H.valueOf(),Q.valueOf())}function d(H,Q,se,P){var D=H.size===Q.size;if(!D)return!1;if(!H.size)return!0;var N={},k=0;return H.forEach(function(X,W){if(D){var Z=!1,Y=0;Q.forEach(function(te,de){!Z&&!N[Y]&&(Z=se(W,de,k,Y,H,Q,P)&&se(X,te,W,de,H,Q,P))&&(N[Y]=!0),Y++}),k++,D=Z}}),D}var v=a(d),x="_owner",M=Object.prototype.hasOwnProperty;function z(H,Q,se,P){var D=Object.keys(H),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===x){var X=!!H.$$typeof,W=!!Q.$$typeof;if((X||W)&&X!==W)return!1}if(!M.call(Q,k)||!se(H[k],Q[k],k,k,H,Q,P))return!1}return!0}var U=a(z);function O(H,Q){return H.source===Q.source&&H.flags===Q.flags}function L(H,Q,se,P){var D=H.size===Q.size;if(!D)return!1;if(!H.size)return!0;var N={};return H.forEach(function(k,X){if(D){var W=!1,Z=0;Q.forEach(function(Y,te){!W&&!N[Z]&&(W=se(k,Y,X,te,H,Q,P))&&(N[Z]=!0),Z++}),D=W}}),D}var B=a(L),q=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),J=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:B,createIsNestedEqual:r}),le=f(q);function oe(H,Q){return le(H,Q,void 0)}var F=f(o(q,{createIsNestedEqual:function(){return p}}));function j(H,Q){return F(H,Q,void 0)}var ne=f(J);function ie(H,Q){return ne(H,Q,new WeakMap)}var ue=f(o(J,{createIsNestedEqual:function(){return p}}));function ge(H,Q){return ue(H,Q,new WeakMap)}function ye(H){return f(o(q,H(q)))}function Te(H){var Q=f(o(J,H(J)));return function(se,P,D){return D===void 0&&(D=new WeakMap),Q(se,P,D)}}n.circularDeepEqual=ie,n.circularShallowEqual=ge,n.createCustomCircularEqual=Te,n.createCustomEqual=ye,n.deepEqual=oe,n.sameValueZeroEqual=p,n.shallowEqual=j,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function $t(){if(Sr)return mt.exports;Sr=1;function t(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=t(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=t(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=e,mt.exports.clsx=e,mt.exports}var ae={},Zt,Cr;function Un(){return Cr||(Cr=1,Zt=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)}),Zt}var Tr;function ze(){if(Tr)return ae;Tr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=r,ae.childrenEqual=p,ae.cloneLayout=a,ae.cloneLayoutItem=y,ae.collides=m,ae.compact=w,ae.compactItem=S,ae.compactType=H,ae.correctBounds=T,ae.fastPositionEqual=C,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=i,ae.getLayoutItem=h,ae.getStatics=f,ae.modifyLayout=o,ae.moveElement=b,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=F,ae.setTopLeft=ne,ae.setTransform=j,ae.sortLayoutItems=ie,ae.sortLayoutItemsByColRow=ge,ae.sortLayoutItemsByRowCol=ue,ae.synchronizeLayoutWithChildren=ye,ae.validateLayout=Te,ae.withLayoutItem=u;var t=Kt(),e=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let D=0,N;for(let k=0,X=P.length;k<X;k++)N=P[k].y+P[k].h,N>D&&(D=N);return D}function a(P){const D=Array(P.length);for(let N=0,k=P.length;N<k;N++)D[N]=y(P[N]);return D}function o(P,D){const N=Array(P.length);for(let k=0,X=P.length;k<X;k++)D.i===P[k].i?N[k]=D:N[k]=P[k];return N}function u(P,D,N){let k=h(P,D);return k?(k=N(y(k)),P=o(P,k),[P,k]):[P,null]}function y(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function p(P,D){return(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.key),e.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Un();function C(P,D){return P.left===D.left&&P.top===D.top&&P.width===D.width&&P.height===D.height}function m(P,D){return!(P.i===D.i||P.x+P.w<=D.x||P.x>=D.x+D.w||P.y+P.h<=D.y||P.y>=D.y+D.h)}function w(P,D,N,k){const X=f(P),W=ie(P,D),Z=Array(P.length);for(let Y=0,te=W.length;Y<te;Y++){let de=y(W[Y]);de.static||(de=S(X,de,D,N,W,k),X.push(de)),Z[P.indexOf(W[Y])]=de,de.moved=!1}return Z}const E={x:"w",y:"h"};function I(P,D,N,k){const X=E[k];D[k]+=1;const W=P.map(Z=>Z.i).indexOf(D.i);for(let Z=W+1;Z<P.length;Z++){const Y=P[Z];if(!Y.static){if(Y.y>D.y+D.h)break;m(D,Y)&&I(P,Y,N+D[X],k)}}D[k]=N}function S(P,D,N,k,X,W){const Z=N==="vertical",Y=N==="horizontal";if(Z)for(D.y=Math.min(r(P),D.y);D.y>0&&!i(P,D);)D.y--;else if(Y)for(;D.x>0&&!i(P,D);)D.x--;let te;for(;(te=i(P,D))&&!(N===null&&W);)if(Y?I(X,D,te.x+te.w,"x"):I(X,D,te.y+te.h,"y"),Y&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(P,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function T(P,D){const N=f(P);for(let k=0,X=P.length;k<X;k++){const W=P[k];if(W.x+W.w>D.cols&&(W.x=D.cols-W.w),W.x<0&&(W.x=0,W.w=D.cols),!W.static)N.push(W);else for(;i(N,W);)W.y++}return P}function h(P,D){for(let N=0,k=P.length;N<k;N++)if(P[N].i===D)return P[N]}function i(P,D){for(let N=0,k=P.length;N<k;N++)if(m(P[N],D))return P[N]}function s(P,D){return P.filter(N=>m(N,D))}function f(P){return P.filter(D=>D.static)}function b(P,D,N,k,X,W,Z,Y,te){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return P;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let Se=ie(P,Z);(Z==="vertical"&&typeof k=="number"?Le>=k:Z==="horizontal"&&typeof N=="number"?de>=N:!1)&&(Se=Se.reverse());const Fe=s(Se,D),zt=Fe.length>0;if(zt&&te)return a(P);if(zt&&W)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,P;for(let fr=0,vo=Fe.length;fr<vo;fr++){const Ve=Fe[fr];`${D.i}${D.x}${D.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,D,X,Z):P=l(P,D,Ve,X,Z))}return P}function l(P,D,N,k,X,W){const Z=X==="horizontal",Y=X==="vertical",te=D.static;if(k){k=!1;const Se={x:Z?Math.max(D.x-N.w,0):N.x,y:Y?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(P,Se),Fe=ve&&ve.y+ve.h>D.y,zt=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&Y)return b(P,N,void 0,D.y+1,k,te,X);if(Fe&&X==null)return D.y=N.y,N.y=N.y+N.h,P;if(zt&&Z)return b(P,D,N.x,void 0,k,te,X)}else return`${N.i}${Se.x}${Se.y}`,b(P,N,Z?Se.x:void 0,Y?Se.y:void 0,k,te,X)}const de=Z?N.x+1:void 0,Le=Y?N.y+1:void 0;return de==null&&Le==null?P:b(P,N,Z?N.x+1:void 0,Y?N.y+1:void 0,k,te,X)}function g(P){return P*100+"%"}const d=(P,D,N,k)=>P+N>k?D:N,v=(P,D,N)=>P<0?D:N,x=P=>Math.max(0,P),M=P=>Math.max(0,P),z=(P,D,N)=>{let{left:k,height:X,width:W}=D;const Z=P.top-(X-P.height);return{left:k,width:W,height:v(Z,P.height,X),top:M(Z)}},U=(P,D,N)=>{let{top:k,left:X,height:W,width:Z}=D;return{top:k,height:W,width:d(P.left,P.width,Z,N),left:x(X)}},O=(P,D,N)=>{let{top:k,height:X,width:W}=D;const Z=P.left-(W-P.width);return{height:X,width:Z<0?P.width:d(P.left,P.width,W,N),top:M(k),left:x(Z)}},L=(P,D,N)=>{let{top:k,left:X,height:W,width:Z}=D;return{width:Z,left:X,height:v(k,P.height,W),top:M(k)}},oe={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return L(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:L,sw:function(){return L(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return z(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function F(P,D,N,k){const X=oe[P];return X?X(D,{...D,...N},k):N}function j(P){let{top:D,left:N,width:k,height:X}=P;const W=`translate(${N}px,${D}px)`;return{transform:W,WebkitTransform:W,MozTransform:W,msTransform:W,OTransform:W,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ne(P){let{top:D,left:N,width:k,height:X}=P;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ie(P,D){return D==="horizontal"?ge(P):D==="vertical"?ue(P):P}function ue(P){return P.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(P){return P.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(P,D,N,k,X){P=P||[];const W=[];e.default.Children.forEach(D,Y=>{if((Y==null?void 0:Y.key)==null)return;const te=h(P,String(Y.key)),de=Y.props["data-grid"];te&&de==null?W.push(y(te)):de?W.push(y({...de,i:Y.key})):W.push(y({w:1,h:1,x:0,y:r(W),i:String(Y.key)}))});const Z=T(W,{cols:N});return X?Z:w(Z,k,N)}function Te(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(D+" must be an array!");for(let k=0,X=P.length;k<X;k++){const W=P[k];for(let Z=0;Z<N.length;Z++){const Y=N[Z],te=W[Y];if(typeof te!="number"||Number.isNaN(te))throw new Error(`ReactGridLayout: ${D}[${k}].${Y} must be a number! Received: ${te} (${typeof te})`)}if(typeof W.i<"u"&&typeof W.i!="string")throw new Error(`ReactGridLayout: ${D}[${k}].i must be a string! Received: ${W.i} (${typeof W.i})`)}}function H(P){const{verticalCompact:D,compactType:N}=P||{};return D===!1?null:N}function Q(){}const se=()=>{};return ae.noop=se,ae}var Ie={},wr;function Jt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=e,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:C,cols:m}=u;return(C-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function n(u,y,p,C,m,w){const{margin:E,containerPadding:I,rowHeight:S}=u,T=t(u),h={};return w&&w.resizing?(h.width=Math.round(w.resizing.width),h.height=Math.round(w.resizing.height)):(h.width=e(C,T,E[0]),h.height=e(m,S,E[1])),w&&w.dragging?(h.top=Math.round(w.dragging.top),h.left=Math.round(w.dragging.left)):w&&w.resizing&&typeof w.resizing.top=="number"&&typeof w.resizing.left=="number"?(h.top=Math.round(w.resizing.top),h.left=Math.round(w.resizing.left)):(h.top=Math.round((S+E[1])*p+I[1]),h.left=Math.round((T+E[0])*y+I[0])),h}function r(u,y,p,C,m){const{margin:w,containerPadding:E,cols:I,rowHeight:S,maxRows:T}=u,h=t(u);let i=Math.round((p-E[0])/(h+w[0])),s=Math.round((y-E[1])/(S+w[1]));return i=o(i,0,I-C),s=o(s,0,T-m),{x:i,y:s}}function a(u,y,p,C,m,w){const{margin:E,maxRows:I,cols:S,rowHeight:T}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(T+E[1])),f=o(i,0,S-C),b=o(s,0,I-m);return["sw","w","nw"].indexOf(w)!==-1&&(f=o(i,0,S)),["nw","n","ne"].indexOf(w)!==-1&&(b=o(s,0,I)),{w:f,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return Ie}var $e={},Qt={exports:{}},er,Ir;function zn(){if(Ir)return er;Ir=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return er=t,er}var tr,_r;function kn(){if(_r)return tr;_r=1;var t=zn();function e(){}function n(){}return n.resetWarningCache=e,tr=function(){function r(u,y,p,C,m,w){if(w!==t){var E=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 E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},tr}var Rr;function Ee(){return Rr||(Rr=1,Qt.exports=kn()()),Qt.exports}var Ze={exports:{}},rr={};function Er(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Er(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Or(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Er(t))&&(r&&(r+=" "),r+=e);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=r,Oe.isFunction=e,Oe.isNum=n;function t(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},Dr;function Wn(){if(Dr)return Pe;Dr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,Pe.default=void 0,Pe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(n(u,t[p])in y)return t[p];return""}function n(o,u){return u?"".concat(u).concat(a(o)):o}function r(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Pe.default=e(),Pe}var xr;function nr(){if(xr)return pe;xr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=f,pe.createCSSTransform=S,pe.createSVGTransform=T,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=w,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=I,pe.outerHeight=C,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=b;var t=yt(),e=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(n=function(M){return M?x:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var x=n(v);if(x&&x.has(d))return x.get(d);var M={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in d)if(U!=="default"&&Object.prototype.hasOwnProperty.call(d,U)){var O=z?Object.getOwnPropertyDescriptor(d,U):null;O&&(O.get||O.set)?Object.defineProperty(M,U,O):M[U]=d[U]}return M.default=d,x&&x.set(d,M),M}let a="";function o(d,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(x){return(0,t.isFunction)(d[x])})),(0,t.isFunction)(d[a])?d[a](v):!1}function u(d,v,x){let M=d;do{if(o(M,v))return!0;if(M===x)return!1;M=M.parentNode}while(M);return!1}function y(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.addEventListener?d.addEventListener(v,x,z):d.attachEvent?d.attachEvent("on"+v,x):d["on"+v]=x}function p(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.removeEventListener?d.removeEventListener(v,x,z):d.detachEvent?d.detachEvent("on"+v,x):d["on"+v]=null}function C(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderTopWidth),v+=(0,t.int)(x.borderBottomWidth),v}function m(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderLeftWidth),v+=(0,t.int)(x.borderRightWidth),v}function w(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingTop),v-=(0,t.int)(x.paddingBottom),v}function E(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingLeft),v-=(0,t.int)(x.paddingRight),v}function I(d,v,x){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),U=(d.clientX+v.scrollLeft-z.left)/x,O=(d.clientY+v.scrollTop-z.top)/x;return{x:U,y:O}}function S(d,v){const x=h(d,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:x}}function T(d,v){return h(d,v,"")}function h(d,v,x){let{x:M,y:z}=d,U="translate(".concat(M).concat(x,",").concat(z).concat(x,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+x),L="".concat(typeof v.y=="string"?v.y:v.y+x);U="translate(".concat(O,", ").concat(L,")")+U}return U}function i(d,v){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,x=>v===x.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,x=>v===x.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
11
11
|
`,v.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
12
|
-
`,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=p,we.getBoundPosition=n,we.getControlPosition=u,we.snapToGrid=r;var t=yt(),e=nr();function n(w,E,I){if(!w.props.bounds)return[E,I];let{bounds:S}=w.props;S=typeof S=="string"?S:C(S);const T=m(w);if(typeof S=="string"){const{ownerDocument:h}=T,i=h.defaultView;let s;if(S==="parent"?s=T.parentNode:s=h.querySelector(S),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const f=s,b=i.getComputedStyle(T),l=i.getComputedStyle(f);S={left:-T.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-T.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(E=Math.min(E,S.right)),(0,t.isNum)(S.bottom)&&(I=Math.min(I,S.bottom)),(0,t.isNum)(S.left)&&(E=Math.max(E,S.left)),(0,t.isNum)(S.top)&&(I=Math.max(I,S.top)),[E,I]}function r(w,E,I){const S=Math.round(E/w[0])*w[0],T=Math.round(I/w[1])*w[1];return[S,T]}function a(w){return w.props.axis==="both"||w.props.axis==="x"}function o(w){return w.props.axis==="both"||w.props.axis==="y"}function u(w,E,I){const S=typeof E=="number"?(0,e.getTouch)(w,E):null;if(typeof E=="number"&&!S)return null;const T=m(I),h=I.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(S||w,h,I.props.scale)}function y(w,E,I){const S=!(0,t.isNum)(w.lastX),T=m(w);return S?{node:T,deltaX:0,deltaY:0,lastX:E,lastY:I,x:E,y:I}:{node:T,deltaX:E-w.lastX,deltaY:I-w.lastY,lastX:w.lastX,lastY:w.lastY,x:E,y:I}}function p(w,E){const I=w.props.scale;return{node:E.node,x:w.state.x+E.deltaX/I,y:w.state.y+E.deltaY/I,deltaX:E.deltaX/I,deltaY:E.deltaY/I,lastX:w.state.x,lastY:w.state.y}}function C(w){return{left:w.left,top:w.top,right:w.right,bottom:w.bottom}}function m(w){const E=w.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=t;function t(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=C(V),e=y(Ee()),n=y(pr),r=nr(),a=Nr(),o=yt(),u=y(Vr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=I.mouse,T=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,S.move,this.handleDrag),(0,r.addEvent)(f,S.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,x=b-this.lastY||0;[v,x]=(0,a.snapToGrid)(this.props.grid,v,x),f=this.lastX+v,b=this.lastY+x}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,S.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(S=I.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(S=I.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(S=I.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(S=I.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,I.mouse.move,this.handleDrag),(0,r.removeEvent)(s,I.touch.move,this.handleDrag),(0,r.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=T,m(T,"displayName","DraggableCore"),m(T,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(T,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=E(V),n=m(Ee()),r=m(pr),a=m(An),o=nr(),u=Nr(),y=yt(),p=m(jn()),C=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function w(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(w=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=w(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},I.apply(this,arguments)}function S(s,f,b){return f=T(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function T(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,C.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),S(this,"onDragStart",(b,l)=>{if((0,C.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,C.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:M}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[z,U]=(0,u.getBoundPosition)(this,d.x,d.y);d.x=z,d.y=U,d.slackX=this.state.slackX+(x-d.x),d.slackY=this.state.slackY+(M-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,C.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:M}=this.props.position;d.x=x,d.y=M}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.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 f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:x,position:M,positionOffset:z,scale:U,...O}=this.props;let L={},F=null;const J=!!!M||this.state.dragging,le=M||g,ae={x:(0,u.canDragX)(this)&&J?this.state.x:le.x,y:(0,u.canDragY)(this)&&J?this.state.y:le.y};this.state.isElementSVG?F=(0,o.createSVGTransform)(ae,z):L=(0,o.createCSSTransform)(ae,z);const B=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[x]:this.state.dragged});return e.createElement(p.default,I({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:B,style:{...l.props.style,...L},transform:F}))}}t.default=i,S(i,"displayName","Draggable"),S(i,"propTypes",{...p.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:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),S(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(rr)),rr}var kr;function ar(){if(kr)return $e.exports;kr=1;const{default:t,DraggableCore:e}=Hn();return $e.exports=t,$e.exports.default=t,$e.exports.DraggableCore=e,$e.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var t=e(V);function e(p){return p&&p.__esModule?p:{default:p}}function n(p,C){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);C&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,w)}return m}function r(p){for(var C=1;C<arguments.length;C++){var m=arguments[C]!=null?arguments[C]:{};C%2?n(Object(m),!0).forEach(function(w){a(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function a(p,C,m){return C=o(C),C in p?Object.defineProperty(p,C,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[C]=m,p}function o(p){var C=u(p,"string");return typeof C=="symbol"?C:String(C)}function u(p,C){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var w=m.call(p,C);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(p)}function y(p,C){return C.style&&p.props.style&&(C.style=r(r({},p.props.style),C.style)),C.className&&p.props.className&&(C.className=p.props.className+" "+C.className),t.default.cloneElement(p,C)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var t=e(Ee());ar();function e(r){return r&&r.__esModule?r:{default:r}}var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var t=u(V),e=ar(),n=Bn(),r=jr(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(o=function(l){return l?f:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function C(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?C(Object(f),!0).forEach(function(b){w(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):C(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function w(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=I(i,"string");return typeof s=="symbol"?s:String(s)}function I(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function S(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,T(i,s)}function T(i,s){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},T(i,s)}var h=function(i){S(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,x=d.maxConstraints,M=d.lockAspectRatio;if(!v&&!x&&!M)return[l,g];if(M){var z=this.props.width/this.props.height,U=l-this.props.width,O=g-this.props.height;Math.abs(U)>Math.abs(O*z)?g=l/z:l=g*z}var L=l,F=g,q=this.slack||[0,0],J=q[0],le=q[1];return l+=J,g+=le,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),x&&(l=Math.min(x[0],l),g=Math.min(x[1],g)),this.slack=[J+(L-l),le+(F-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,x){var M=x.node,z=x.deltaX,U=x.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var F=g[0],q=g[g.length-1],J=M.getBoundingClientRect();if(d.lastHandleRect!=null){if(q==="w"){var le=J.left-d.lastHandleRect.left;z+=le}if(F==="n"){var ae=J.top-d.lastHandleRect.top;U+=ae}}d.lastHandleRect=J,q==="w"&&(z=-z),F==="n"&&(U=-U);var B=d.props.width+(O?z/d.props.transformScale:0),W=d.props.height+(L?U/d.props.transformScale:0),ne=d.runConstraints(B,W);B=ne[0],W=ne[1];var ie=B!==d.props.width||W!==d.props.height,ue=typeof d.props[l]=="function"?d.props[l]:null,ge=l==="onResize"&&!ie;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:M,size:{width:B,height:W},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",x=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(d,x)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,x=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var M=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,n.cloneElement)(d,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,M.map(function(U){var O,L=(O=l.handleRefs[U])!=null?O:l.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,y({},x,{nodeRef:L,key:"resizableHandle-"+U,onStop:l.resizeHandler("onResizeStop",U),onStart:l.resizeHandler("onResizeStart",U),onDrag:l.resizeHandler("onResize",U)}),l.renderResizeHandle(U,L))}))}))},s}(t.Component);return et.default=h,h.propTypes=r.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var t=y(V),e=o(Ee()),n=o(Br()),r=jr(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(u=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function C(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?C(Object(b),!0).forEach(function(l){w(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):C(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function w(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function S(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function T(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,f)}var i=function(s){T(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(x,M){var z=M.size;l.props.onResize?(x.persist==null||x.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(x,M)})):l.setState(z)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var x=g.onResizeStart,M=g.onResizeStop,z=g.draggableOpts,U=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,F=g.axis;g.width,g.height;var q=g.resizeHandles,J=g.style,le=g.transformScale,ae=S(g,a);return t.createElement(n.default,{axis:F,draggableOpts:z,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:U,onResizeStart:x,onResize:this.onResize,onResizeStop:M,resizeHandles:q,transformScale:le,width:this.state.width},t.createElement("div",p({},ae,{style:m(m({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:e.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var t=n(Ee()),e=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return _e.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(o){o.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:r,resizeHandle:a,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(o,u){const y=o[u],p={};e.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(p[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');p[C.key]=!0}})},innerRef:t.default.any},_e}var Yr;function qn(){if(Yr)return Ze;Yr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=p(V),e=p(Ee()),n=ar(),r=Gn(),a=ze(),o=Jt(),u=Xr(),y=p(Zt());function p(I){return I&&I.__esModule?I:{default:I}}function C(I,S,T){return S=m(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function m(I){var S=w(I,"string");return typeof S=="symbol"?S:String(S)}function w(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let E=class extends t.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",t.default.createRef()),C(this,"onDragStart",(S,T)=>{let{node:h}=T;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const f={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,v=l.left/s,x=g.top/s,M=l.top/s;f.left=d-v+b.scrollLeft,f.top=x-M+b.scrollTop,this.setState({dragging:f});const{x:z,y:U}=(0,o.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,U,{e:S,node:h,newPosition:f})}),C(this,"onDrag",(S,T)=>{let{node:h,deltaX:i,deltaY:s}=T;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:d,w:v,h:x,containerWidth:M}=this.props,z=this.getPositionParams();if(g){const{offsetParent:q}=h;if(q){const{margin:J,rowHeight:le,containerPadding:ae}=this.props,B=q.clientHeight-(0,o.calcGridItemWHPx)(x,le,J[1]);b=(0,o.clamp)(b-ae[1],0,B);const W=(0,o.calcGridColWidth)(z),ne=M-(0,o.calcGridItemWHPx)(v,W,J[0]);l=(0,o.clamp)(l-ae[0],0,ne)}}const U={top:b,left:l};this.setState({dragging:U});const{containerPadding:O}=this.props,{x:L,y:F}=(0,o.calcXY)(z,b-O[1],l-O[0],v,x);return f.call(this,d,L,F,{e:S,node:h,newPosition:U})}),C(this,"onDragStop",(S,T)=>{let{node:h}=T;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:b,containerPadding:l}=this.props,{left:g,top:d}=this.state.dragging,v={top:d,left:g};this.setState({dragging:null});const{x,y:M}=(0,o.calcXY)(this.getPositionParams(),d-l[1],g-l[0],s,f);return i.call(this,b,x,M,{e:S,node:h,newPosition:v})}),C(this,"onResizeStop",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStop")),C(this,"onResizeStart",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStart")),C(this,"onResize",(S,T,h)=>this.onResizeHandler(S,T,h,"onResize"))}shouldComponentUpdate(S,T){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,T);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:T}=this.props;if(!T)return;const h=this.elementRef.current;if(!h)return;const i=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&T.left!==i.left||T.top!==i.top;if(!s)this.onDragStart(T.e,{node:h,deltaX:T.left,deltaY:T.top});else if(f){const b=T.left-s.left,l=T.top-s.top;this.onDrag(T.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:S.cols,containerPadding:S.containerPadding,containerWidth:S.containerWidth,margin:S.margin,maxRows:S.maxRows,rowHeight:S.rowHeight}}createStyle(S){const{usePercentages:T,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(S):(s=(0,a.setTopLeft)(S),T&&(s.left=(0,a.perc)(S.left/h),s.width=(0,a.perc)(S.width/h))),s}mixinDraggable(S,T){return t.default.createElement(n.DraggableCore,{disabled:!T,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},S)}curryResizeHandler(S,T){return(h,i)=>T(h,i,S)}mixinResizable(S,T,h){const{cols:i,minW:s,minH:f,maxW:b,maxH:l,transformScale:g,resizeHandles:d,resizeHandle:v}=this.props,x=this.getPositionParams(),M=(0,o.calcGridItemPosition)(x,0,0,i,0).width,z=(0,o.calcGridItemPosition)(x,0,0,s,f),U=(0,o.calcGridItemPosition)(x,0,0,b,l),O=[z.width,z.height],L=[Math.min(U.width,M),Math.min(U.height,1/0)];return t.default.createElement(r.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:T.width,height:T.height,minConstraints:O,maxConstraints:L,onResizeStop:this.curryResizeHandler(T,this.onResizeStop),onResizeStart:this.curryResizeHandler(T,this.onResizeStart),onResize:this.curryResizeHandler(T,this.onResize),transformScale:g,resizeHandles:d,handle:v},S)}onResizeHandler(S,T,h,i){let{node:s,size:f,handle:b}=T;const l=this.props[i];if(!l)return;const{x:g,y:d,i:v,maxH:x,minH:M,containerWidth:z}=this.props,{minW:U,maxW:O}=this.props;let L=f;s&&(L=(0,a.resizeItemInDirection)(b,h,f,z),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:F,h:q}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,d,b);F=(0,o.clamp)(F,Math.max(U,1),O),q=(0,o.clamp)(q,M,x),l.call(this,v,F,q,{e:S,node:s,size:L,handle:b})}render(){const{x:S,y:T,w:h,h:i,isDraggable:s,isResizable:f,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),S,T,h,i,this.state),d=t.default.Children.only(this.props.children);let v=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!b,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,f),v=this.mixinDraggable(v,s),v}};return Ze.default=E,C(E,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minWidth not Number");if(T>I.w||T>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxWidth not Number");if(T<I.w||T<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minHeight not Number");if(T>I.h||T>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxHeight not Number");if(T<I.h||T<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),C(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Ze}var Kr;function Zr(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=C(V),e=Kt(),n=y(Zt()),r=ze(),a=Jt(),o=y(qn()),u=y(Xr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const x={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:x}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,allowOverlap:M,preventCollision:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;const O={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i};v=(0,r.moveElement)(v,U,s,f,!0,z,(0,r.compactType)(this.props),x,M),this.props.onDrag(v,d,U,O,l,g),this.setState({layout:M?v:(0,r.compact)(v,(0,r.compactType)(this.props),x),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,preventCollision:M,allowOverlap:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;v=(0,r.moveElement)(v,U,s,f,!0,M,(0,r.compactType)(this.props),x,z);const L=z?v:(0,r.compact)(v,(0,r.compactType)(this.props),x);this.props.onDragStop(L,d,U,null,l,g);const{oldLayout:F}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,F)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:x}=this.state,{layout:M}=this.state,{cols:z,preventCollision:U,allowOverlap:O}=this.props;let L=!1,F,q,J;const[le,ae]=(0,r.withLayoutItem)(M,i,W=>{let ne;return q=W.x,J=W.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(q=W.x+(W.w-s),s=W.x!==q&&q<0?W.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(v)!==-1&&(J=W.y+(W.h-f),f=W.y!==J&&J<0?W.h:f,J=J<0?0:J),L=!0),U&&!O&&(ne=(0,r.getAllCollisions)(M,{...W,w:s,h:f,x:q,y:J}).filter(ue=>ue.i!==W.i).length>0,ne&&(J=W.y,f=W.h,q=W.x,s=W.w,L=!1)),W.w=s,W.h=f,W});if(!ae)return;F=le,L&&(F=(0,r.moveElement)(le,ae,q,J,!0,this.props.preventCollision,(0,r.compactType)(this.props),z,O));const B={w:ae.w,h:ae.h,x:ae.x,y:ae.y,static:!0,i};this.props.onResize(F,x,ae,B,l,g),this.setState({layout:O?F:(0,r.compact)(F,(0,r.compactType)(this.props),z),activeDrag:B})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:x,allowOverlap:M}=this.props,z=(0,r.getLayoutItem)(d,i),U=M?d:(0,r.compact)(d,(0,r.compactType)(this.props),x);this.props.onResizeStop(U,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,O)}),m(this,"onDragOver",i=>{var le;if(i.preventDefault(),i.stopPropagation(),S&&!((le=i.nativeEvent.target)!=null&&le.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:x,transformScale:M}=this.props,z=f==null?void 0:f(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...z},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),F=i.clientX-L.left,q=i.clientY-L.top,J={left:F/M,top:q/M,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ae,top:B}=this.state.droppingPosition;(ae!=F||B!=q)&&this.setState({droppingPosition:J})}}else{const ae={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:x||b},B=(0,a.calcXY)(ae,q,F,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:J,layout:[...O,{...U,x:B.x,y:B.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.fastRGLPropsEqual)(this.props,i,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,e.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:x}=this.props;return t.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:x},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:x,isDraggable:M,isResizable:z,isBounded:U,useCSSTransforms:O,transformScale:L,draggableCancel:F,draggableHandle:q,resizeHandles:J,resizeHandle:le}=this.props,{mounted:ae,droppingPosition:B}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&M,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&z,ie=f.resizeHandles||J,ue=W&&U&&f.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:x,rowHeight:v,cancel:F,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:ne,isBounded:ue,useCSSTransforms:O&&ae,usePercentages:!ae,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?B:void 0,resizeHandles:ie,resizeHandle:le},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(I,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=T,m(T,"displayName","ReactGridLayout"),m(T,"propTypes",u.default),m(T,"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:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},xe={},$r;function Jr(){if($r)return xe;$r=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.findOrGenerateResponsiveLayout=r,xe.getBreakpointFromWidth=e,xe.getColsFromBreakpoint=n,xe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let C=1,m=y.length;C<m;C++){const w=y[C];u>o[w]&&(p=w)}return p}function n(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function r(o,u,y,p,C,m){if(o[y])return(0,t.cloneLayout)(o[y]);let w=o[p];const E=a(u),I=E.slice(E.indexOf(y));for(let S=0,T=I.length;S<T;S++){const h=I[S];if(o[h]){w=o[h];break}}return w=(0,t.cloneLayout)(w||[]),(0,t.compact)((0,t.correctBounds)(w,{cols:C}),m,C)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return xe}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=p(V),e=u(Ee()),n=Kt(),r=ze(),a=Jr(),o=u(Zr());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function C(){return C=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},C.apply(this,arguments)}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function S(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),x={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in x||(x[d]=(0,r.cloneLayout)(this.state.layout));let U=(0,a.findOrGenerateResponsiveLayout)(x,s,g,d,v,l);U=(0,r.synchronizeLayoutWithChildren)(U,this.props.children,v,l,this.props.allowOverlap),x[g]=U,this.props.onLayoutChange(U,x),this.props.onBreakpointChange(g,v),this.setState({breakpoint:g,layout:U,cols:v})}const M=S(this.props.margin,g),z=S(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,M,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:x,...M}=this.props;return t.createElement(o.default,C({},M,{margin:S(l,this.state.breakpoint),containerPadding:S(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=T,m(T,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,i){if(I(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(T,"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:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},e.prototype.set=function(n,r){var a=t(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,a=t(r,n);~a&&r.splice(a,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];n.call(r,u[1],u[0])}},e}()}(),or=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=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")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Kn=2;function Zn(t,e){var n=!1,r=!1,a=0;function o(){n&&(n=!1,t()),r&&y()}function u(){Yn(o)}function y(){var p=Date.now();if(n){if(p-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(u,e);a=p}return y}var $n=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Zn(this.refresh.bind(this),$n)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!or||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(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)},t.prototype.disconnect_=function(){!or||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),tn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Tt},rn=It(0,0,0,0);function wt(t){return parseFloat(t)||0}function nn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,a){var o=t["border-"+a+"-width"];return r+wt(o)},0)}function ta(t){for(var e=["top","right","bottom","left"],n={},r=0,a=e;r<a.length;r++){var o=a[r],u=t["padding-"+o];n[o]=wt(u)}return n}function ra(t){var e=t.getBBox();return It(0,0,e.width,e.height)}function na(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return rn;var r=ke(t).getComputedStyle(t),a=ta(r),o=a.left+a.right,u=a.top+a.bottom,y=wt(r.width),p=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=nn(r,"left","right")+o),Math.round(p+u)!==n&&(p-=nn(r,"top","bottom")+u)),!oa(t)){var C=Math.round(y+o)-e,m=Math.round(p+u)-n;Math.abs(C)!==1&&(y-=C),Math.abs(m)!==1&&(p-=m)}return It(a.left,a.top,y,p)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function oa(t){return t===ke(t).document.documentElement}function ia(t){return or?aa(t)?ra(t):na(t):rn}function sa(t){var e=t.x,n=t.y,r=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return tn(u,{x:e,y:n,width:r,height:a,top:n,right:e+r,bottom:a+n,left:e}),u}function It(t,e,n,r){return{x:t,y:e,width:n,height:r}}var la=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ia(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),ca=function(){function t(e,n){var r=sa(n);tn(this,{target:e,contentRect:r})}return t}(),ua=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new la(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=function(){function t(e){if(!(this instanceof t))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=ea.getInstance(),r=new ua(e,n,this);an.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){on.prototype[t]=function(){var e;return(e=an.get(this))[t].apply(e,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var t=u(V),e=a(Ee()),n=a(fa),r=a(Zt());function a(I){return I&&I.__esModule?I:{default:I}}function o(I){if(typeof WeakMap!="function")return null;var S=new WeakMap,T=new WeakMap;return(o=function(h){return h?T:S})(I)}function u(I,S){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var T=o(S);if(T&&T.has(I))return T.get(I);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=i?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,T&&T.set(I,h),h}function y(){return y=Object.assign?Object.assign.bind():function(I){for(var S=1;S<arguments.length;S++){var T=arguments[S];for(var h in T)Object.prototype.hasOwnProperty.call(T,h)&&(I[h]=T[h])}return I},y.apply(this,arguments)}function p(I,S,T){return S=C(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function C(I){var S=m(I,"string");return typeof S=="symbol"?S:String(S)}function m(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}const w="react-grid-layout";function E(I){var S;return S=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,r.default)(this.props.className,w),style:this.props.style,ref:this.elementRef}):t.createElement(I,y({innerRef:this.elementRef},i,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return Ct}var ln;function ha(){return ln||(ln=1,function(t){t.exports=Zr().default,t.exports.utils=ze(),t.exports.calculateUtils=Jt(),t.exports.Responsive=Xn().default,t.exports.Responsive.utils=Jr(),t.exports.WidthProvider=pa().default}(Yt)),Yt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(t,e,n,r)=>{for(var a=r>1?void 0:r?ma(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ba=(t,e)=>(n,r)=>e(n,r,t);let Ae=class extends _.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(e);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),a=e.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,C)=>{const m=C[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const w=o.slice(m.endIndex+1,y.startIndex);w&&u.push(w)}if(n[y.key]&&u.push(n[y.key]),p===C.length-1){const w=o.slice(y.endIndex+1);w&&u.push(w)}}),u}return[]}};Ae=ya([ba(0,_.Inject(_.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const n=V.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((C,m)=>({color:new _.ColorKit(C.color),value:m})),y=u.length-1;return new Array(5).fill("").map((C,m,w)=>m*y/(w.length-1)).map(C=>c.getColorScaleFromValue(u,C))}return null},[e]),r=V.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,C=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return R.jsxs("div",{className:_t.cfPreview,children:[R.jsx("div",{style:{...y,background:C,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),R.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return n&&R.jsx("div",{className:_t.cfPreview,children:n.map((u,y)=>R.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return r&&R.jsx("div",{className:_t.cfPreview,children:r.map((u,y)=>u?R.jsx("img",{style:{height:"100%"},src:u},y):R.jsx(Xe,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:C,bg:m,cl:w}=e.style,E=(u==null?void 0:u.s)===_.BooleanNumber.TRUE,I=(y==null?void 0:y.s)===_.BooleanNumber.TRUE,S=p===_.BooleanNumber.TRUE,T=C===_.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=w==null?void 0:w.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:T?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${E?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return R.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",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"},Sa=(t,e)=>{const n=t.rule;switch(n.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(n.subType){case c.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case c.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case c.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case c.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=t=>{const{onClick:e}=t,n=te.useDependency(c.ConditionalFormattingRuleModel),r=te.useDependency(_.IUniverInstanceService),a=te.useDependency(Y.SheetsSelectionsService),o=te.useDependency(_.ICommandService),u=te.useDependency(_.LocaleService),y=te.useDependency(_.Injector),p=te.useDependency(Ae),C=te.useObservable(()=>r.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=C.getUnitId(),w=C.getActiveSheet();if(!w)throw new Error("No active sheet found");const E=w.getSheetId(),[I,S]=V.useState([]),[T,h]=V.useState("2"),[i,s]=V.useState(0),[f,b]=V.useState(-1),[l,g]=V.useState(cn),d=V.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],x=()=>{const B=n.getSubunitRules(m,E);if(!B||!B.length)return[];if(T==="1"){const W=a.getCurrentLastSelection();if(!W)return[];const ne=W.range;return B.filter(ue=>ue.ranges.some(ge=>_.Rectangle.intersects(ge,ne)))}else if(T==="2")return[...B];return[]},[M,z]=V.useState(x);fe.useHighlightRange(I),V.useEffect(()=>{const B=o.onCommandExecuted(W=>{W.id===Y.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>B.dispose()}),V.useEffect(()=>{z(x)},[T,i,m,E]),V.useEffect(()=>{if(T==="2")return;const B=new Ce.Observable(W=>{const ne=[Y.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ge)&&ye.unitId===Te&&W.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(x)});return()=>{B.unsubscribe()}},[r,T,m,E]),V.useEffect(()=>{const B=n.$ruleChange.subscribe(()=>{s(Math.random())});return()=>B.unsubscribe()},[n]),V.useEffect(()=>{const B=()=>{var ue;const ie=Math.max(0,(((ue=d.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return cn=ie,ie},ne=new Ce.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{ie.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=j=>{j.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(B())});return()=>{ne.unsubscribe()}},[]);const U=B=>{var ie;const W=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!W||!ne)throw new Error("No active sheet found");o.executeCommand(c.DeleteCfCommand.id,{unitId:W,subUnitId:ne,cfId:B.cfId})},O=(B,W)=>{b(W.y)},L=(B,W,ne)=>{var j;b(-1);const ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(j=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:j.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const ge=Q=>{const se=M.length;return Math.min(se-1,Math.max(0,Q))},ye=M[ge(W.y)].cfId,Te=M[ge(ne.y)].cfId;ye!==Te&&o.executeCommand(c.MoveCfCommand.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:ne.y>W.y?"after":"before"}})},F=()=>{t.onCreate()},q=()=>{T==="2"?o.executeCommand(c.ClearWorksheetCfCommand.id):T==="1"&&M.map(W=>({unitId:m,subUnitId:E,cfId:W.cfId})).forEach(W=>{o.executeCommand(c.DeleteCfCommand.id,W)})},J=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.filter(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]),le=J.map((B,W)=>({i:B.cfId,x:0,w:12,y:W,h:1,isResizable:!1})),ae=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.every(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]);return R.jsxs("div",{className:he.cfRuleList,children:[R.jsxs("div",{className:he.ruleSelector,children:[R.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",R.jsx(ee.Select,{className:he.select,options:v,value:T,onChange:B=>{h(B)}})).map((B,W)=>R.jsx("span",{children:B},W))}),R.jsxs("div",{className:he.btnList,children:[R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:R.jsx("div",{className:`
|
|
12
|
+
`,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=p,we.getBoundPosition=n,we.getControlPosition=u,we.snapToGrid=r;var t=yt(),e=nr();function n(w,E,I){if(!w.props.bounds)return[E,I];let{bounds:S}=w.props;S=typeof S=="string"?S:C(S);const T=m(w);if(typeof S=="string"){const{ownerDocument:h}=T,i=h.defaultView;let s;if(S==="parent"?s=T.parentNode:s=h.querySelector(S),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const f=s,b=i.getComputedStyle(T),l=i.getComputedStyle(f);S={left:-T.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-T.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(E=Math.min(E,S.right)),(0,t.isNum)(S.bottom)&&(I=Math.min(I,S.bottom)),(0,t.isNum)(S.left)&&(E=Math.max(E,S.left)),(0,t.isNum)(S.top)&&(I=Math.max(I,S.top)),[E,I]}function r(w,E,I){const S=Math.round(E/w[0])*w[0],T=Math.round(I/w[1])*w[1];return[S,T]}function a(w){return w.props.axis==="both"||w.props.axis==="x"}function o(w){return w.props.axis==="both"||w.props.axis==="y"}function u(w,E,I){const S=typeof E=="number"?(0,e.getTouch)(w,E):null;if(typeof E=="number"&&!S)return null;const T=m(I),h=I.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(S||w,h,I.props.scale)}function y(w,E,I){const S=!(0,t.isNum)(w.lastX),T=m(w);return S?{node:T,deltaX:0,deltaY:0,lastX:E,lastY:I,x:E,y:I}:{node:T,deltaX:E-w.lastX,deltaY:I-w.lastY,lastX:w.lastX,lastY:w.lastY,x:E,y:I}}function p(w,E){const I=w.props.scale;return{node:E.node,x:w.state.x+E.deltaX/I,y:w.state.y+E.deltaY/I,deltaX:E.deltaX/I,deltaY:E.deltaY/I,lastX:w.state.x,lastY:w.state.y}}function C(w){return{left:w.left,top:w.top,right:w.right,bottom:w.bottom}}function m(w){const E=w.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=t;function t(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=C(V),e=y(Ee()),n=y(pr),r=nr(),a=Nr(),o=yt(),u=y(Vr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=I.mouse,T=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,S.move,this.handleDrag),(0,r.addEvent)(f,S.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,x=b-this.lastY||0;[v,x]=(0,a.snapToGrid)(this.props.grid,v,x),f=this.lastX+v,b=this.lastY+x}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,S.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(S=I.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(S=I.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(S=I.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(S=I.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,I.mouse.move,this.handleDrag),(0,r.removeEvent)(s,I.touch.move,this.handleDrag),(0,r.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=T,m(T,"displayName","DraggableCore"),m(T,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(T,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=E(V),n=m(Ee()),r=m(pr),a=m(An),o=nr(),u=Nr(),y=yt(),p=m(jn()),C=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function w(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(w=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=w(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},I.apply(this,arguments)}function S(s,f,b){return f=T(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function T(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,C.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),S(this,"onDragStart",(b,l)=>{if((0,C.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,C.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:M}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[z,U]=(0,u.getBoundPosition)(this,d.x,d.y);d.x=z,d.y=U,d.slackX=this.state.slackX+(x-d.x),d.slackY=this.state.slackY+(M-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,C.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:M}=this.props.position;d.x=x,d.y=M}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.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 f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:x,position:M,positionOffset:z,scale:U,...O}=this.props;let L={},B=null;const J=!!!M||this.state.dragging,le=M||g,oe={x:(0,u.canDragX)(this)&&J?this.state.x:le.x,y:(0,u.canDragY)(this)&&J?this.state.y:le.y};this.state.isElementSVG?B=(0,o.createSVGTransform)(oe,z):L=(0,o.createCSSTransform)(oe,z);const F=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[x]:this.state.dragged});return e.createElement(p.default,I({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:F,style:{...l.props.style,...L},transform:B}))}}t.default=i,S(i,"displayName","Draggable"),S(i,"propTypes",{...p.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:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),S(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(rr)),rr}var kr;function ar(){if(kr)return Ze.exports;kr=1;const{default:t,DraggableCore:e}=Hn();return Ze.exports=t,Ze.exports.default=t,Ze.exports.DraggableCore=e,Ze.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var t=e(V);function e(p){return p&&p.__esModule?p:{default:p}}function n(p,C){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);C&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,w)}return m}function r(p){for(var C=1;C<arguments.length;C++){var m=arguments[C]!=null?arguments[C]:{};C%2?n(Object(m),!0).forEach(function(w){a(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function a(p,C,m){return C=o(C),C in p?Object.defineProperty(p,C,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[C]=m,p}function o(p){var C=u(p,"string");return typeof C=="symbol"?C:String(C)}function u(p,C){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var w=m.call(p,C);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(p)}function y(p,C){return C.style&&p.props.style&&(C.style=r(r({},p.props.style),C.style)),C.className&&p.props.className&&(C.className=p.props.className+" "+C.className),t.default.cloneElement(p,C)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var t=e(Ee());ar();function e(r){return r&&r.__esModule?r:{default:r}}var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var t=u(V),e=ar(),n=Bn(),r=jr(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(o=function(l){return l?f:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function C(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?C(Object(f),!0).forEach(function(b){w(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):C(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function w(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=I(i,"string");return typeof s=="symbol"?s:String(s)}function I(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function S(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,T(i,s)}function T(i,s){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},T(i,s)}var h=function(i){S(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,x=d.maxConstraints,M=d.lockAspectRatio;if(!v&&!x&&!M)return[l,g];if(M){var z=this.props.width/this.props.height,U=l-this.props.width,O=g-this.props.height;Math.abs(U)>Math.abs(O*z)?g=l/z:l=g*z}var L=l,B=g,q=this.slack||[0,0],J=q[0],le=q[1];return l+=J,g+=le,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),x&&(l=Math.min(x[0],l),g=Math.min(x[1],g)),this.slack=[J+(L-l),le+(B-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,x){var M=x.node,z=x.deltaX,U=x.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var B=g[0],q=g[g.length-1],J=M.getBoundingClientRect();if(d.lastHandleRect!=null){if(q==="w"){var le=J.left-d.lastHandleRect.left;z+=le}if(B==="n"){var oe=J.top-d.lastHandleRect.top;U+=oe}}d.lastHandleRect=J,q==="w"&&(z=-z),B==="n"&&(U=-U);var F=d.props.width+(O?z/d.props.transformScale:0),j=d.props.height+(L?U/d.props.transformScale:0),ne=d.runConstraints(F,j);F=ne[0],j=ne[1];var ie=F!==d.props.width||j!==d.props.height,ue=typeof d.props[l]=="function"?d.props[l]:null,ge=l==="onResize"&&!ie;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:M,size:{width:F,height:j},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",x=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(d,x)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,x=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var M=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,n.cloneElement)(d,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,M.map(function(U){var O,L=(O=l.handleRefs[U])!=null?O:l.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,y({},x,{nodeRef:L,key:"resizableHandle-"+U,onStop:l.resizeHandler("onResizeStop",U),onStart:l.resizeHandler("onResizeStart",U),onDrag:l.resizeHandler("onResize",U)}),l.renderResizeHandle(U,L))}))}))},s}(t.Component);return et.default=h,h.propTypes=r.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var t=y(V),e=o(Ee()),n=o(Br()),r=jr(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(u=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function C(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?C(Object(b),!0).forEach(function(l){w(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):C(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function w(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function S(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function T(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,f)}var i=function(s){T(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(x,M){var z=M.size;l.props.onResize?(x.persist==null||x.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(x,M)})):l.setState(z)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var x=g.onResizeStart,M=g.onResizeStop,z=g.draggableOpts,U=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,B=g.axis;g.width,g.height;var q=g.resizeHandles,J=g.style,le=g.transformScale,oe=S(g,a);return t.createElement(n.default,{axis:B,draggableOpts:z,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:U,onResizeStart:x,onResize:this.onResize,onResizeStop:M,resizeHandles:q,transformScale:le,width:this.state.width},t.createElement("div",p({},oe,{style:m(m({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:e.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var t=n(Ee()),e=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return _e.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(o){o.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:r,resizeHandle:a,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(o,u){const y=o[u],p={};e.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(p[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');p[C.key]=!0}})},innerRef:t.default.any},_e}var Yr;function qn(){if(Yr)return $e;Yr=1,Object.defineProperty($e,"__esModule",{value:!0}),$e.default=void 0;var t=p(V),e=p(Ee()),n=ar(),r=Gn(),a=ze(),o=Jt(),u=Xr(),y=p($t());function p(I){return I&&I.__esModule?I:{default:I}}function C(I,S,T){return S=m(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function m(I){var S=w(I,"string");return typeof S=="symbol"?S:String(S)}function w(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let E=class extends t.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",t.default.createRef()),C(this,"onDragStart",(S,T)=>{let{node:h}=T;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const f={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,v=l.left/s,x=g.top/s,M=l.top/s;f.left=d-v+b.scrollLeft,f.top=x-M+b.scrollTop,this.setState({dragging:f});const{x:z,y:U}=(0,o.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,U,{e:S,node:h,newPosition:f})}),C(this,"onDrag",(S,T)=>{let{node:h,deltaX:i,deltaY:s}=T;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:d,w:v,h:x,containerWidth:M}=this.props,z=this.getPositionParams();if(g){const{offsetParent:B}=h;if(B){const{margin:q,rowHeight:J,containerPadding:le}=this.props,oe=B.clientHeight-(0,o.calcGridItemWHPx)(x,J,q[1]);b=(0,o.clamp)(b-le[1],0,oe);const F=(0,o.calcGridColWidth)(z),j=M-(0,o.calcGridItemWHPx)(v,F,q[0]);l=(0,o.clamp)(l-le[0],0,j)}}const U={top:b,left:l};this.setState({dragging:U});const{x:O,y:L}=(0,o.calcXY)(z,b,l,v,x);return f.call(this,d,O,L,{e:S,node:h,newPosition:U})}),C(this,"onDragStop",(S,T)=>{let{node:h}=T;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:b}=this.props,{left:l,top:g}=this.state.dragging,d={top:g,left:l};this.setState({dragging:null});const{x:v,y:x}=(0,o.calcXY)(this.getPositionParams(),g,l,s,f);return i.call(this,b,v,x,{e:S,node:h,newPosition:d})}),C(this,"onResizeStop",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStop")),C(this,"onResizeStart",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStart")),C(this,"onResize",(S,T,h)=>this.onResizeHandler(S,T,h,"onResize"))}shouldComponentUpdate(S,T){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,T);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:T}=this.props;if(!T)return;const h=this.elementRef.current;if(!h)return;const i=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&T.left!==i.left||T.top!==i.top;if(!s)this.onDragStart(T.e,{node:h,deltaX:T.left,deltaY:T.top});else if(f){const b=T.left-s.left,l=T.top-s.top;this.onDrag(T.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:S.cols,containerPadding:S.containerPadding,containerWidth:S.containerWidth,margin:S.margin,maxRows:S.maxRows,rowHeight:S.rowHeight}}createStyle(S){const{usePercentages:T,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(S):(s=(0,a.setTopLeft)(S),T&&(s.left=(0,a.perc)(S.left/h),s.width=(0,a.perc)(S.width/h))),s}mixinDraggable(S,T){return t.default.createElement(n.DraggableCore,{disabled:!T,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},S)}curryResizeHandler(S,T){return(h,i)=>T(h,i,S)}mixinResizable(S,T,h){const{cols:i,minW:s,minH:f,maxW:b,maxH:l,transformScale:g,resizeHandles:d,resizeHandle:v}=this.props,x=this.getPositionParams(),M=(0,o.calcGridItemPosition)(x,0,0,i,0).width,z=(0,o.calcGridItemPosition)(x,0,0,s,f),U=(0,o.calcGridItemPosition)(x,0,0,b,l),O=[z.width,z.height],L=[Math.min(U.width,M),Math.min(U.height,1/0)];return t.default.createElement(r.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:T.width,height:T.height,minConstraints:O,maxConstraints:L,onResizeStop:this.curryResizeHandler(T,this.onResizeStop),onResizeStart:this.curryResizeHandler(T,this.onResizeStart),onResize:this.curryResizeHandler(T,this.onResize),transformScale:g,resizeHandles:d,handle:v},S)}onResizeHandler(S,T,h,i){let{node:s,size:f,handle:b}=T;const l=this.props[i];if(!l)return;const{x:g,y:d,i:v,maxH:x,minH:M,containerWidth:z}=this.props,{minW:U,maxW:O}=this.props;let L=f;s&&(L=(0,a.resizeItemInDirection)(b,h,f,z),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:B,h:q}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,d,b);B=(0,o.clamp)(B,Math.max(U,1),O),q=(0,o.clamp)(q,M,x),l.call(this,v,B,q,{e:S,node:s,size:L,handle:b})}render(){const{x:S,y:T,w:h,h:i,isDraggable:s,isResizable:f,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),S,T,h,i,this.state),d=t.default.Children.only(this.props.children);let v=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!b,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,f),v=this.mixinDraggable(v,s),v}};return $e.default=E,C(E,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minWidth not Number");if(T>I.w||T>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxWidth not Number");if(T<I.w||T<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minHeight not Number");if(T>I.h||T>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxHeight not Number");if(T<I.h||T<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),C(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),$e}var Kr;function $r(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=C(V),e=Kt(),n=y($t()),r=ze(),a=Jt(),o=y(qn()),u=y(Xr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const x={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:x}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,allowOverlap:M,preventCollision:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;const O={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i};v=(0,r.moveElement)(v,U,s,f,!0,z,(0,r.compactType)(this.props),x,M),this.props.onDrag(v,d,U,O,l,g),this.setState({layout:M?v:(0,r.compact)(v,(0,r.compactType)(this.props),x),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,preventCollision:M,allowOverlap:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;v=(0,r.moveElement)(v,U,s,f,!0,M,(0,r.compactType)(this.props),x,z);const L=z?v:(0,r.compact)(v,(0,r.compactType)(this.props),x);this.props.onDragStop(L,d,U,null,l,g);const{oldLayout:B}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,B)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:x}=this.state,{layout:M}=this.state,{cols:z,preventCollision:U,allowOverlap:O}=this.props;let L=!1,B,q,J;const[le,oe]=(0,r.withLayoutItem)(M,i,j=>{let ne;return q=j.x,J=j.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(q=j.x+(j.w-s),s=j.x!==q&&q<0?j.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(v)!==-1&&(J=j.y+(j.h-f),f=j.y!==J&&J<0?j.h:f,J=J<0?0:J),L=!0),U&&!O&&(ne=(0,r.getAllCollisions)(M,{...j,w:s,h:f,x:q,y:J}).filter(ue=>ue.i!==j.i).length>0,ne&&(J=j.y,f=j.h,q=j.x,s=j.w,L=!1)),j.w=s,j.h=f,j});if(!oe)return;B=le,L&&(B=(0,r.moveElement)(le,oe,q,J,!0,this.props.preventCollision,(0,r.compactType)(this.props),z,O));const F={w:oe.w,h:oe.h,x:oe.x,y:oe.y,static:!0,i};this.props.onResize(B,x,oe,F,l,g),this.setState({layout:O?B:(0,r.compact)(B,(0,r.compactType)(this.props),z),activeDrag:F})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:x,allowOverlap:M}=this.props,z=(0,r.getLayoutItem)(d,i),U=M?d:(0,r.compact)(d,(0,r.compactType)(this.props),x);this.props.onResizeStop(U,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,O)}),m(this,"onDragOver",i=>{var le;if(i.preventDefault(),i.stopPropagation(),S&&!((le=i.nativeEvent.target)!=null&&le.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:x,transformScale:M}=this.props,z=f==null?void 0:f(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...z},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),B=i.clientX-L.left,q=i.clientY-L.top,J={left:B/M,top:q/M,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:oe,top:F}=this.state.droppingPosition;(oe!=B||F!=q)&&this.setState({droppingPosition:J})}}else{const oe={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:x||b},F=(0,a.calcXY)(oe,q,B,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:J,layout:[...O,{...U,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.fastRGLPropsEqual)(this.props,i,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,e.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:x}=this.props;return t.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:x},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:x,isDraggable:M,isResizable:z,isBounded:U,useCSSTransforms:O,transformScale:L,draggableCancel:B,draggableHandle:q,resizeHandles:J,resizeHandle:le}=this.props,{mounted:oe,droppingPosition:F}=this.state,j=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&M,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&z,ie=f.resizeHandles||J,ue=j&&U&&f.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:x,rowHeight:v,cancel:B,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:j,isResizable:ne,isBounded:ue,useCSSTransforms:O&&oe,usePercentages:!oe,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?F:void 0,resizeHandles:ie,resizeHandle:le},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(I,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=T,m(T,"displayName","ReactGridLayout"),m(T,"propTypes",u.default),m(T,"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:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},xe={},Zr;function Jr(){if(Zr)return xe;Zr=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.findOrGenerateResponsiveLayout=r,xe.getBreakpointFromWidth=e,xe.getColsFromBreakpoint=n,xe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let C=1,m=y.length;C<m;C++){const w=y[C];u>o[w]&&(p=w)}return p}function n(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function r(o,u,y,p,C,m){if(o[y])return(0,t.cloneLayout)(o[y]);let w=o[p];const E=a(u),I=E.slice(E.indexOf(y));for(let S=0,T=I.length;S<T;S++){const h=I[S];if(o[h]){w=o[h];break}}return w=(0,t.cloneLayout)(w||[]),(0,t.compact)((0,t.correctBounds)(w,{cols:C}),m,C)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return xe}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=p(V),e=u(Ee()),n=Kt(),r=ze(),a=Jr(),o=u($r());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function C(){return C=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},C.apply(this,arguments)}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function S(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),x={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in x||(x[d]=(0,r.cloneLayout)(this.state.layout));let U=(0,a.findOrGenerateResponsiveLayout)(x,s,g,d,v,l);U=(0,r.synchronizeLayoutWithChildren)(U,this.props.children,v,l,this.props.allowOverlap),x[g]=U,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(U,x),this.setState({breakpoint:g,layout:U,cols:v})}const M=S(this.props.margin,g),z=S(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,M,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:x,...M}=this.props;return t.createElement(o.default,C({},M,{margin:S(l,this.state.breakpoint),containerPadding:S(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=T,m(T,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,i){if(I(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(T,"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:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},e.prototype.set=function(n,r){var a=t(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,a=t(r,n);~a&&r.splice(a,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];n.call(r,u[1],u[0])}},e}()}(),or=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=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")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Kn=2;function $n(t,e){var n=!1,r=!1,a=0;function o(){n&&(n=!1,t()),r&&y()}function u(){Yn(o)}function y(){var p=Date.now();if(n){if(p-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(u,e);a=p}return y}var Zn=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=$n(this.refresh.bind(this),Zn)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!or||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(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)},t.prototype.disconnect_=function(){!or||!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)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),tn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Tt},rn=It(0,0,0,0);function wt(t){return parseFloat(t)||0}function nn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,a){var o=t["border-"+a+"-width"];return r+wt(o)},0)}function ta(t){for(var e=["top","right","bottom","left"],n={},r=0,a=e;r<a.length;r++){var o=a[r],u=t["padding-"+o];n[o]=wt(u)}return n}function ra(t){var e=t.getBBox();return It(0,0,e.width,e.height)}function na(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return rn;var r=ke(t).getComputedStyle(t),a=ta(r),o=a.left+a.right,u=a.top+a.bottom,y=wt(r.width),p=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=nn(r,"left","right")+o),Math.round(p+u)!==n&&(p-=nn(r,"top","bottom")+u)),!oa(t)){var C=Math.round(y+o)-e,m=Math.round(p+u)-n;Math.abs(C)!==1&&(y-=C),Math.abs(m)!==1&&(p-=m)}return It(a.left,a.top,y,p)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function oa(t){return t===ke(t).document.documentElement}function ia(t){return or?aa(t)?ra(t):na(t):rn}function sa(t){var e=t.x,n=t.y,r=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return tn(u,{x:e,y:n,width:r,height:a,top:n,right:e+r,bottom:a+n,left:e}),u}function It(t,e,n,r){return{x:t,y:e,width:n,height:r}}var la=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ia(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),ca=function(){function t(e,n){var r=sa(n);tn(this,{target:e,contentRect:r})}return t}(),ua=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new la(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=function(){function t(e){if(!(this instanceof t))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=ea.getInstance(),r=new ua(e,n,this);an.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){on.prototype[t]=function(){var e;return(e=an.get(this))[t].apply(e,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var t=u(V),e=a(Ee()),n=a(fa),r=a($t());function a(I){return I&&I.__esModule?I:{default:I}}function o(I){if(typeof WeakMap!="function")return null;var S=new WeakMap,T=new WeakMap;return(o=function(h){return h?T:S})(I)}function u(I,S){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var T=o(S);if(T&&T.has(I))return T.get(I);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=i?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,T&&T.set(I,h),h}function y(){return y=Object.assign?Object.assign.bind():function(I){for(var S=1;S<arguments.length;S++){var T=arguments[S];for(var h in T)Object.prototype.hasOwnProperty.call(T,h)&&(I[h]=T[h])}return I},y.apply(this,arguments)}function p(I,S,T){return S=C(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function C(I){var S=m(I,"string");return typeof S=="symbol"?S:String(S)}function m(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}const w="react-grid-layout";function E(I){var S;return S=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,r.default)(this.props.className,w),style:this.props.style,ref:this.elementRef}):t.createElement(I,y({innerRef:this.elementRef},i,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return Ct}var ln;function ha(){return ln||(ln=1,function(t){t.exports=$r().default,t.exports.utils=ze(),t.exports.calculateUtils=Jt(),t.exports.Responsive=Xn().default,t.exports.Responsive.utils=Jr(),t.exports.WidthProvider=pa().default}(Yt)),Yt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(t,e,n,r)=>{for(var a=r>1?void 0:r?ma(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ba=(t,e)=>(n,r)=>e(n,r,t);let Ae=class extends _.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(e);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),a=e.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,C)=>{const m=C[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const w=o.slice(m.endIndex+1,y.startIndex);w&&u.push(w)}if(n[y.key]&&u.push(n[y.key]),p===C.length-1){const w=o.slice(y.endIndex+1);w&&u.push(w)}}),u}return[]}};Ae=ya([ba(0,_.Inject(_.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const n=V.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((C,m)=>({color:new _.ColorKit(C.color),value:m})),y=u.length-1;return new Array(5).fill("").map((C,m,w)=>m*y/(w.length-1)).map(C=>c.getColorScaleFromValue(u,C))}return null},[e]),r=V.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,C=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return R.jsxs("div",{className:_t.cfPreview,children:[R.jsx("div",{style:{...y,background:C,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),R.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return n&&R.jsx("div",{className:_t.cfPreview,children:n.map((u,y)=>R.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return r&&R.jsx("div",{className:_t.cfPreview,children:r.map((u,y)=>u?R.jsx("img",{style:{height:"100%"},src:u},y):R.jsx(Xe,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:C,bg:m,cl:w}=e.style,E=(u==null?void 0:u.s)===_.BooleanNumber.TRUE,I=(y==null?void 0:y.s)===_.BooleanNumber.TRUE,S=p===_.BooleanNumber.TRUE,T=C===_.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=w==null?void 0:w.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:T?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${E?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return R.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",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"},Sa=(t,e)=>{const n=t.rule;switch(n.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(n.subType){case c.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case c.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case c.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case c.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=t=>{const{onClick:e}=t,n=re.useDependency(c.ConditionalFormattingRuleModel),r=re.useDependency(_.IUniverInstanceService),a=re.useDependency(K.SheetsSelectionsService),o=re.useDependency(_.ICommandService),u=re.useDependency(_.LocaleService),y=re.useDependency(_.Injector),p=re.useDependency(Ae),C=re.useObservable(()=>r.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=C.getUnitId(),w=C.getActiveSheet();if(!w)throw new Error("No active sheet found");const E=w.getSheetId(),[I,S]=V.useState([]),[T,h]=V.useState("2"),[i,s]=V.useState(0),[f,b]=V.useState(-1),[l,g]=V.useState(cn),d=V.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],x=()=>{const F=n.getSubunitRules(m,E);if(!F||!F.length)return[];if(T==="1"){const j=a.getCurrentLastSelection();if(!j)return[];const ne=j.range;return F.filter(ue=>ue.ranges.some(ge=>_.Rectangle.intersects(ge,ne)))}else if(T==="2")return[...F];return[]},[M,z]=V.useState(x);fe.useHighlightRange(I),V.useEffect(()=>{const F=o.onCommandExecuted(j=>{j.id===K.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),V.useEffect(()=>{z(x)},[T,i,m,E]),V.useEffect(()=>{if(T==="2")return;const F=new Ce.Observable(j=>{const ne=[K.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ge)&&ye.unitId===Te&&j.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(x)});return()=>{F.unsubscribe()}},[r,T,m,E]),V.useEffect(()=>{const F=n.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[n]),V.useEffect(()=>{const F=()=>{var ue;const ie=Math.max(0,(((ue=d.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return cn=ie,ie},ne=new Ce.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{ie.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=H=>{H.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(F())});return()=>{ne.unsubscribe()}},[]);const U=F=>{var ie;const j=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!j||!ne)throw new Error("No active sheet found");o.executeCommand(c.DeleteCfCommand.id,{unitId:j,subUnitId:ne,cfId:F.cfId})},O=(F,j)=>{b(j.y)},L=(F,j,ne)=>{var H;b(-1);const ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(H=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:H.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const ge=Q=>{const se=M.length;return Math.min(se-1,Math.max(0,Q))},ye=M[ge(j.y)].cfId,Te=M[ge(ne.y)].cfId;ye!==Te&&o.executeCommand(c.MoveCfCommand.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:ne.y>j.y?"after":"before"}})},B=()=>{t.onCreate()},q=()=>{T==="2"?o.executeCommand(c.ClearWorksheetCfCommand.id):T==="1"&&M.map(j=>({unitId:m,subUnitId:E,cfId:j.cfId})).forEach(j=>{o.executeCommand(c.DeleteCfCommand.id,j)})},J=V.useMemo(()=>{const F=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),j=F.getActiveSheet();return M.filter(ne=>{const ie=ne.ranges;return K.checkRangesEditablePermission(y,F.getUnitId(),j.getSheetId(),ie)})},[M]),le=J.map((F,j)=>({i:F.cfId,x:0,w:12,y:j,h:1,isResizable:!1})),oe=V.useMemo(()=>{const F=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),j=F.getActiveSheet();return M.every(ne=>{const ie=ne.ranges;return K.checkRangesEditablePermission(y,F.getUnitId(),j.getSheetId(),ie)})},[M]);return R.jsxs("div",{className:he.cfRuleList,children:[R.jsxs("div",{className:he.ruleSelector,children:[R.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",R.jsx(ee.Select,{className:he.select,options:v,value:T,onChange:F=>{h(F)}})).map((F,j)=>R.jsx("span",{children:F},j))}),R.jsxs("div",{className:he.btnList,children:[R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:R.jsx("div",{className:`
|
|
13
13
|
${he.icon}
|
|
14
|
-
`,onClick:
|
|
14
|
+
`,onClick:B,children:R.jsx(vr,{})})}),M.length&&oe?R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:R.jsx("div",{className:`
|
|
15
15
|
${he.gap}
|
|
16
16
|
${he.icon}
|
|
17
17
|
`,onClick:q,children:R.jsx(gt,{})})}):R.jsx("div",{className:`
|
|
18
18
|
${he.gap}
|
|
19
19
|
${he.disabled}
|
|
20
|
-
`,children:R.jsx(gt,{})})]})]}),R.jsx("div",{ref:d,className:he.gridLayoutWrap,children:l?R.jsx(va,{onDragStop:L,onDragStart:O,layout:le,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:J==null?void 0:J.map((
|
|
20
|
+
`,children:R.jsx(gt,{})})]})]}),R.jsx("div",{ref:d,className:he.gridLayoutWrap,children:l?R.jsx(va,{onDragStop:L,onDragStart:O,layout:le,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:J==null?void 0:J.map((F,j)=>R.jsx("div",{children:R.jsxs("div",{onMouseMove:()=>{F.ranges!==I&&S(F.ranges)},onMouseLeave:()=>S([]),onClick:()=>{e(F)},className:`
|
|
21
21
|
${he.ruleItem}
|
|
22
|
-
${f===
|
|
22
|
+
${f===j?he.active:""}
|
|
23
23
|
`,children:[R.jsx("div",{className:`
|
|
24
24
|
${he.draggableHandle}
|
|
25
25
|
draggableHandle
|
|
26
|
-
`,onClick:ne=>ne.stopPropagation(),children:R.jsx(mr,{})}),R.jsxs("div",{className:he.ruleDescribe,children:[R.jsx("div",{className:he.ruleType,children:Sa(
|
|
26
|
+
`,onClick:ne=>ne.stopPropagation(),children:R.jsx(mr,{})}),R.jsxs("div",{className:he.ruleDescribe,children:[R.jsx("div",{className:he.ruleType,children:Sa(F,u)}),R.jsx("div",{className:he.ruleRange,children:F.ranges.map(ne=>kt.serializeRange(ne)).join(",")})]}),R.jsx("div",{className:he.preview,children:R.jsx(We,{rule:F.rule})}),R.jsx("div",{className:`
|
|
27
27
|
${he.deleteItem}
|
|
28
|
-
${f===
|
|
29
|
-
`,onClick:ne=>{ne.stopPropagation(),U(
|
|
28
|
+
${f===j?he.active:""}
|
|
29
|
+
`,onClick:ne=>{ne.stopPropagation(),U(F),S([])},children:R.jsx(gt,{})})]})},`${F.cfId}`))}):null})]})},un={cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Me=t=>{const{color:e,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=t,y=re.useDependency(re.ComponentManager),p=V.useMemo(()=>new _.ColorKit(e),[e]),C=y.get(a);return C&&(r?R.jsx(C,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(ee.ColorPicker,{value:e,onChange:n})}),children:R.jsxs("span",{className:`
|
|
30
30
|
${un.cfColorPickerIcon}
|
|
31
31
|
${o}
|
|
32
|
-
`,children:[R.jsx(C,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&R.jsx(vt,{className:un.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfErrorText:"univer-cf-error-text",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"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),ir=t=>{var S;const{type:e,className:n,onChange:r,id:a,value:o}=t,u=
|
|
32
|
+
`,children:[R.jsx(C,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&R.jsx(vt,{className:un.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfErrorText:"univer-cf-error-text",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"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),ir=t=>{var S;const{type:e,className:n,onChange:r,id:a,value:o}=t,u=re.useDependency(_.IUniverInstanceService),y=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(S=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),C=V.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=V.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(e)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),w=V.useRef({}),[E,I]=V.useState(!1);return re.useSidebarClick(T=>{var i;const h=(i=w.current)==null?void 0:i.handleOutClick;h&&h(T,()=>I(!1))}),e===c.CFValueType.formula?R.jsx("div",{style:{width:"100%",marginLeft:4},children:R.jsx(Ge.FormulaEditor,{initValue:C,unitId:y,subUnitId:p,isFocus:E,onChange:(T="")=>{r(T||"")},onFocus:()=>I(!0),actions:w.current})}):R.jsx(ee.InputNumber,{className:n,value:Number(t.value)||0,onChange:T=>t.onChange(T||0),...m})},Ta=t=>{var U;const{interceptorManager:e}=t,n=re.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,n),Ne(c.CFValueType.percent,n),Ne(c.CFValueType.percentile,n),Ne(c.CFValueType.formula,n)],o=[Ne(c.CFValueType.min,n),...a],u=[Ne("none",n),...a],y=[Ne(c.CFValueType.max,n),...a],[p,C]=V.useState(()=>{var L;const O=c.CFValueType.min;return r&&((L=r.config[0])==null?void 0:L.value.type)||O}),[m,w]=V.useState(()=>{var L;const O="none";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.value.type)||O}),[E,I]=V.useState(()=>{var L;const O=c.CFValueType.max;return r&&((L=r.config[r.config.length-1])==null?void 0:L.value.type)||O}),[S,T]=V.useState(()=>{if(!r)return 10;const L=r.config[0];return(L==null?void 0:L.value.value)===void 0?10:L==null?void 0:L.value.value}),[h,i]=V.useState(()=>{var B;if(!r||r.config.length!==3)return 50;const L=(B=r.config[1])==null?void 0:B.value.value;return L===void 0?50:L}),[s,f]=V.useState(()=>{var B;if(!r)return 90;const L=(B=r.config[r.config.length-1])==null?void 0:B.value.value;return L===void 0?90:L}),[b,l]=V.useState(()=>{var L;const O="#d0d9fb";return r&&((L=r.config[0])==null?void 0:L.color)||O}),[g,d]=V.useState(()=>{var L;const O="#7790f3";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.color)||O}),[v,x]=V.useState(()=>{var L;const O="#2e55ef";return r&&((L=r.config[r.config.length-1])==null?void 0:L.color)||O}),M=V.useMemo(()=>O=>{const{minType:L,medianType:B,maxType:q,minValue:J,medianValue:le,maxValue:oe,minColor:F,medianColor:j,maxColor:ne}=O,ie=[];return ie.push({color:F,value:{type:L,value:J}}),B!=="none"&&ie.push({color:j,value:{type:B,value:le}}),ie.push({color:ne,value:{type:q,value:oe}}),{config:ie.map((ge,ye)=>({...ge,index:ye})),type:c.CFRuleType.colorScale}},[]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),[M,p,m,E,S,h,s,b,g,v,e]);const z=O=>{t.onChange(M(O))};return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
33
33
|
${G.cfPreviewWrap}
|
|
34
34
|
`,children:R.jsx(We,{rule:M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})})}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:ee.clsx(`
|
|
35
35
|
${A.labelContainer}
|
|
@@ -46,35 +46,35 @@
|
|
|
46
46
|
${A.mTSm}
|
|
47
47
|
`,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{I(O);const L=c.createDefaultValueByValueType(O,90);f(L),z({minType:p,medianType:m,maxType:O,minValue:S,medianValue:h,maxValue:L,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"max",className:`
|
|
48
48
|
${A.mLXxs}
|
|
49
|
-
`,value:s,type:E,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{x(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),dn=t=>{var T;const{onChange:e,className:n,value:r,type:a,id:o,disabled:u=!1}=t,y=
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
${A.labelContainer}
|
|
55
|
-
`,children:[R.jsxs(ee.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})},children:[R.jsx(ee.Radio,{value:"0",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.pureColor")})}),R.jsx(ee.Radio,{value:"1",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.gradient")})})]}),R.jsxs("div",{className:`
|
|
56
|
-
${G.utilItem}
|
|
57
|
-
${A.mLXl}
|
|
58
|
-
`,children:[R.jsx(ee.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),R.jsxs("div",{className:`
|
|
59
|
-
${A.labelContainer}
|
|
60
|
-
${A.mTSm}
|
|
61
|
-
${A.mLXxs}
|
|
62
|
-
`,children:[R.jsxs("div",{className:`
|
|
49
|
+
`,value:s,type:E,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{x(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),dn=t=>{var T;const{onChange:e,className:n,value:r,type:a,id:o,disabled:u=!1}=t,y=re.useDependency(_.IUniverInstanceService),p=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),C=(T=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId(),m=V.useRef({}),[w,E]=V.useState(!1);re.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>E(!1))});const I=V.useRef(r),S=V.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===c.CFValueType.formula){const h=String(I.current).startsWith("=")?String(I.current)||"":"=";return R.jsx("div",{style:{width:"100%",marginLeft:12},children:R.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:C,isFocus:w,onChange:(i="")=>{e(i||"")},onFocus:()=>E(!0),actions:m.current})})}return R.jsx(ee.InputNumber,{className:n,value:Number(r)||0,disabled:u,onChange:h=>{e(h||0)},...S})},wa=t=>{var U;const{interceptorManager:e}=t,n=re.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=V.useState(()=>{var L;const O="0";return r?(L=r.config)!=null&&L.isGradient?"1":"0":O}),[u,y]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,C]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,n),je(c.CFValueType.percent,n),je(c.CFValueType.percentile,n),je(c.CFValueType.formula,n)],w=[je(c.CFValueType.min,n),...m],E=[je(c.CFValueType.max,n),...m],[I,S]=V.useState(()=>{var L;const O=w[0].value;return r&&((L=r.config)==null?void 0:L.min.type)||O}),[T,h]=V.useState(()=>{var L;const O=E[0].value;return r&&((L=r.config)==null?void 0:L.max.type)||O}),[i,s]=V.useState(()=>{var B;if(!r)return 0;const L=((B=r.config)==null?void 0:B.min)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value||0}),[f,b]=V.useState(()=>{var B;if(!r)return 100;const L=((B=r.config)==null?void 0:B.max)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value===void 0?100:L.value}),[l,g]=V.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),d=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||c.defaultDataBarPositiveColor,nativeColor:O.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:O.isShowValue});V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,I,f,T,u,p,e,l]);const v=O=>{t.onChange(d(O))},x=O=>{y(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:O,nativeColor:p,isShowValue:l})},M=O=>{C(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>m.map(L=>L.value).includes(O);return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
50
|
+
${G.cfPreviewWrap}
|
|
51
|
+
`,children:R.jsx(We,{rule:d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})})}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.fillType")}),R.jsxs("div",{className:`
|
|
52
|
+
${A.mTSm}
|
|
53
|
+
${A.mLXxs}
|
|
63
54
|
${A.labelContainer}
|
|
64
|
-
`,children:[R.jsx("div",{className:`
|
|
65
|
-
${G.
|
|
66
|
-
|
|
55
|
+
`,children:[R.jsxs(ee.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})},children:[R.jsx(ee.Radio,{value:"0",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.pureColor")})}),R.jsx(ee.Radio,{value:"1",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.gradient")})})]}),R.jsxs("div",{className:`
|
|
56
|
+
${G.utilItem}
|
|
57
|
+
${A.mLXl}
|
|
58
|
+
`,children:[R.jsx(ee.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),R.jsxs("div",{className:`
|
|
67
59
|
${A.labelContainer}
|
|
68
|
-
${A.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
60
|
+
${A.mTSm}
|
|
61
|
+
${A.mLXxs}
|
|
62
|
+
`,children:[R.jsxs("div",{className:`
|
|
63
|
+
${A.labelContainer}
|
|
64
|
+
`,children:[R.jsx("div",{className:`
|
|
65
|
+
${G.text}
|
|
66
|
+
`,children:n.t("sheet.cf.panel.native")}),R.jsx(Me,{color:p,onChange:M})]}),R.jsxs("div",{className:`
|
|
67
|
+
${A.labelContainer}
|
|
68
|
+
${A.mLSm}
|
|
69
|
+
`,children:[R.jsx("div",{className:`
|
|
70
|
+
${G.text}
|
|
71
|
+
`,children:n.t("sheet.cf.panel.positive")}),R.jsx(Me,{color:u,onChange:x})]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:`
|
|
72
|
+
${A.mTSm}
|
|
73
|
+
${A.labelContainer}
|
|
74
|
+
`,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:w,value:I,onChange:O=>{S(O);const L=c.createDefaultValueByValueType(O,10);s(L),v({isGradient:a,minValue:L,minValueType:O,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(I),id:"min",type:I,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:`
|
|
75
|
+
${A.mTSm}
|
|
76
|
+
${A.labelContainer}
|
|
77
|
+
`,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:E,value:T,onChange:O=>{h(O);const L=c.createDefaultValueByValueType(O,90);b(L),v({isGradient:a,minValue:i,minValueType:I,maxValue:L,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(T),id:"max",type:T,className:A.mLSm,value:f,onChange:O=>{b(O||0),v({isGradient:a,minValue:i,minValueType:I,maxValue:O||0,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})},Re={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Rt=t=>[_.BooleanNumber.FALSE,void 0].includes(t)?_.BooleanNumber.TRUE:_.BooleanNumber.FALSE,Et=t=>t!==_.BooleanNumber.FALSE,sr=t=>{const{style:e,onChange:n,className:r}=t,a=re.useDependency(re.ComponentManager),[o,u]=V.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=V.useState(()=>{if(e!=null&&e.it)return e.it}),[C,m]=V.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[w,E]=V.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,S]=V.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[T,h]=V.useState(()=>{var g;const l="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),f=a.get("UnderlineSingle"),b=a.get("StrikethroughSingle");return V.useEffect(()=>{const l={bl:o,it:y};I!==void 0&&(l.cl={rgb:I}),T!==void 0&&(l.bg={rgb:T}),w!==void 0&&(l.st={s:w}),C!==void 0&&(l.ul={s:C}),n(c.removeUndefinedAttr(l))},[o,y,C,w,I,T]),R.jsxs("div",{className:ee.clsx(Re.cfStyleEdit,r),children:[i&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(o||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>u(Rt(o)),children:R.jsx(i,{})}),s&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(y||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>p(Rt(y)),children:R.jsx(s,{})}),f&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(C||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>m(Rt(C)),children:R.jsx(f,{})}),b&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(w||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>E(Rt(w)),children:R.jsx(b,{})}),R.jsx(Me,{color:I,onChange:S,iconId:"FontColor"}),R.jsx(Me,{color:T,onChange:h,iconId:"PaintBucket"})]})},Ia=t=>{var b;const{onChange:e,interceptorManager:n}=t,r=re.useDependency(_.LocaleService),o=re.useDependency(_.IUniverInstanceService).getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=V.useRef(null),[C,m]=V.useState(!1),w=V.useRef({}),[E,I]=V.useState({}),[S,T]=V.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=V.useState(void 0),s=l=>({style:l.style,value:S,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,S,n]),V.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(g,d,v)=>h||S.length===1||!S.startsWith("=")?(i(r.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,S]);const f=l=>{e(s(l))};return re.useSidebarClick(l=>{var d;const g=(d=w.current)==null?void 0:d.handleOutClick;g&&g(l,()=>m(!1))}),R.jsxs("div",{ref:p,children:[R.jsx("div",{className:`
|
|
78
78
|
${A.title}
|
|
79
79
|
${A.mTBase}
|
|
80
80
|
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
@@ -83,31 +83,31 @@
|
|
|
83
83
|
${G.cfPreviewWrap}
|
|
84
84
|
`,children:R.jsx(We,{rule:s({style:E})})}),R.jsx(sr,{style:y==null?void 0:y.style,className:`
|
|
85
85
|
${A.mTSm}
|
|
86
|
-
`,onChange:l=>{I(l),f({style:l})}})]})},Ot=t=>R.jsxs("div",{style:{position:"relative"},children:[R.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ce=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),_a=t=>{const{type:e,operator:n,onChange:r,value:a,interceptorManager:o}=t,u=
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
86
|
+
`,onChange:l=>{I(l),f({style:l})}})]})},Ot=t=>R.jsxs("div",{style:{position:"relative"},children:[R.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ce=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),_a=t=>{const{type:e,operator:n,onChange:r,value:a,interceptorManager:o}=t,u=re.useDependency(_.LocaleService),[y,p]=V.useState(()=>typeof a=="number"?a:0),[C,m]=V.useState(""),[w,E]=V.useState(()=>typeof a=="string"?a:""),[I,S]=V.useState(""),[T,h]=V.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=V.useState(""),[f,b]=V.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=V.useState("");switch(V.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)&&r(w);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)&&r(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)&&r([T,f]);break}}},[e]),V.useEffect(()=>{const d=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,x,M)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(n))return w?M(v):(S(u.t("sheet.cf.errorMessage.notBlank")),!1)}return M(v)}});return()=>{d()}},[e,y,w,n]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)){const d=v=>{E(v),r(v)};return R.jsx("div",{className:`
|
|
87
|
+
${A.mTSm}
|
|
88
|
+
`,children:R.jsx(Ot,{errorText:I,children:R.jsx(ee.Input,{className:G.width100,value:w,onChange:v=>{S(""),d(v)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)){const d=v=>{p(v||0),r(v||0),m("")};return R.jsx("div",{className:`
|
|
89
|
+
${A.mTSm}
|
|
90
|
+
`,children:R.jsx(Ot,{errorText:C,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:d})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)){const d=x=>{h(x||0),r([x||0,f]),s("")},v=x=>{b(x||0),r([T,x||0]),g("")};return R.jsxs("div",{className:`
|
|
91
|
+
${A.mTSm}
|
|
92
|
+
${A.labelContainer}
|
|
93
|
+
`,children:[R.jsx(Ot,{errorText:i,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:T,onChange:d})}),R.jsx(Ot,{errorText:l,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
94
94
|
${A.mLSm}
|
|
95
|
-
`,value:f,onChange:v})})]})}}}return null},fn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ce(c.CFTextOperator.containsText,e),ce(c.CFTextOperator.notContainsText,e),ce(c.CFTextOperator.beginsWith,e),ce(c.CFTextOperator.endsWith,e),ce(c.CFTextOperator.equal,e),ce(c.CFTextOperator.notEqual,e),ce(c.CFTextOperator.containsBlanks,e),ce(c.CFTextOperator.notContainsBlanks,e),ce(c.CFTextOperator.containsErrors,e),ce(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ce(c.CFNumberOperator.between,e),ce(c.CFNumberOperator.notBetween,e),ce(c.CFNumberOperator.equal,e),ce(c.CFNumberOperator.notEqual,e),ce(c.CFNumberOperator.greaterThan,e),ce(c.CFNumberOperator.greaterThanOrEqual,e),ce(c.CFNumberOperator.lessThan,e),ce(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ce(c.CFTimePeriodOperator.yesterday,e),ce(c.CFTimePeriodOperator.today,e),ce(c.CFTimePeriodOperator.tomorrow,e),ce(c.CFTimePeriodOperator.last7Days,e),ce(c.CFTimePeriodOperator.lastWeek,e),ce(c.CFTimePeriodOperator.thisWeek,e),ce(c.CFTimePeriodOperator.nextWeek,e),ce(c.CFTimePeriodOperator.lastMonth,e),ce(c.CFTimePeriodOperator.thisMonth,e),ce(c.CFTimePeriodOperator.nextMonth,e)]}},pn=t=>{var b;const{interceptorManager:e,onChange:n}=t,r=
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
`,value:f,onChange:v})})]})}}}return null},fn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ce(c.CFTextOperator.containsText,e),ce(c.CFTextOperator.notContainsText,e),ce(c.CFTextOperator.beginsWith,e),ce(c.CFTextOperator.endsWith,e),ce(c.CFTextOperator.equal,e),ce(c.CFTextOperator.notEqual,e),ce(c.CFTextOperator.containsBlanks,e),ce(c.CFTextOperator.notContainsBlanks,e),ce(c.CFTextOperator.containsErrors,e),ce(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ce(c.CFNumberOperator.between,e),ce(c.CFNumberOperator.notBetween,e),ce(c.CFNumberOperator.equal,e),ce(c.CFNumberOperator.notEqual,e),ce(c.CFNumberOperator.greaterThan,e),ce(c.CFNumberOperator.greaterThanOrEqual,e),ce(c.CFNumberOperator.lessThan,e),ce(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ce(c.CFTimePeriodOperator.yesterday,e),ce(c.CFTimePeriodOperator.today,e),ce(c.CFTimePeriodOperator.tomorrow,e),ce(c.CFTimePeriodOperator.last7Days,e),ce(c.CFTimePeriodOperator.lastWeek,e),ce(c.CFTimePeriodOperator.thisWeek,e),ce(c.CFTimePeriodOperator.nextWeek,e),ce(c.CFTimePeriodOperator.lastMonth,e),ce(c.CFTimePeriodOperator.thisMonth,e),ce(c.CFTimePeriodOperator.nextMonth,e)]}},pn=t=>{var b;const{interceptorManager:e,onChange:n}=t,r=re.useDependency(_.LocaleService),a=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=V.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],p=V.useMemo(()=>fn(o,r),[o]),[C,m]=V.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[w,E]=V.useState(()=>{var d;const l="";return a?(d=a.value)!=null?d:c.createDefaultValue(a.subType,a.operator):l}),[I,S]=V.useState({}),T=V.useMemo(()=>l=>{var g,d,v,x,M,z,U,O,L,B,q,J,le,oe,F;switch(l.subType||o){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(d=l.operator)!=null?d:C,style:(v=l.style)!=null?v:I,value:(x=l.value)!=null?x:w};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(M=l.subType)!=null?M:o,operator:(z=l.operator)!=null?z:C,style:(U=l.style)!=null?U:I,value:(O=l.value)!=null?O:w};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(C))return{type:c.CFRuleType.highlightCell,subType:(L=l.subType)!=null?L:o,operator:(B=l.operator)!=null?B:C,style:(q=l.style)!=null?q:I,value:(J=l.value)!=null?J:w};break}}return{type:c.CFRuleType.highlightCell,subType:(le=l.subType)!=null?le:o,operator:(oe=l.operator)!=null?oe:C,style:(F=l.style)!=null?F:I}},[o,C,w,I]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return T({})}}),[T,e]),V.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,d=fn(g,r),v=d&&d[0].value;u(g),m(v),v&&E(c.createDefaultValue(g,v)),n(T({subType:g,operator:v}))},i=l=>{const g=l;m(g),n(T({operator:g}))},s=l=>{E(l),n(T({value:l}))},f=V.useMemo(()=>`${o}_${C}_${Math.random()}`,[o,C]);return R.jsxs("div",{children:[R.jsx("div",{className:`
|
|
96
|
+
${A.title}
|
|
97
|
+
${A.mTBase}
|
|
98
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
|
|
99
99
|
${A.mTSm}
|
|
100
100
|
${G.width100}
|
|
101
101
|
`,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&R.jsx(ee.Select,{className:`
|
|
102
102
|
${A.mTSm}
|
|
103
103
|
${G.width100}
|
|
104
104
|
`,onChange:i,value:C||"",options:p}),R.jsx(_a,{value:w,interceptorManager:e,type:o,operator:C,rule:a,onChange:s},f),R.jsx("div",{className:`
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
${G.cfPreviewWrap}
|
|
106
|
+
`,children:R.jsx(We,{rule:T({})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
|
|
107
107
|
${A.mLXxs}
|
|
108
|
-
`,onChange:l=>{S(l),n(T({style:l}))}})]})},hn=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Ra=t=>{var p;const e=
|
|
108
|
+
`,onChange:l=>{S(l),n(T({style:l}))}})]})},hn=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Ra=t=>{var p;const e=re.useDependency(_.IUniverInstanceService),n=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(p=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=V.useMemo(()=>t.error?G.errorInput:"",[t.error]),o=V.useRef({}),[u,y]=V.useState(!1);return re.useSidebarClick(C=>{var w;const m=(w=o.current)==null?void 0:w.handleOutClick;m&&m(C,()=>y(!1))}),R.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?R.jsxs(R.Fragment,{children:[R.jsx(ee.InputNumber,{className:a,value:Number(t.value)||0,onChange:C=>t.onChange(C!=null?C:0)}),t.error&&R.jsx("div",{className:G.errorText,children:t.error})]}):R.jsx("div",{style:{width:"100%"},children:R.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:u,onChange:(C="")=>{const m=C||"";t.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},gn=(t,e,n)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),Ea=V.forwardRef((t,e)=>{const n=re.useDependency(_.LocaleService),r=a=>{t.onClick(a)};return R.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>R.jsxs("div",{className:G.group,children:[R.jsx("div",{className:G.title,children:n.t(a.title)}),R.jsx("div",{className:G.itemContent,children:a.group.map(u=>R.jsx("div",{className:G.itemWrap,onClick:()=>{r(u.name)},children:R.jsx("div",{className:G.item,children:u.list.map((y,p)=>R.jsx("img",{className:G.icon,src:y},p))})},u.name))})]},o))})}),Oa=t=>{const e=V.useMemo(()=>{const r=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{r.push({iconType:u,base64:y,iconId:String(p)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return R.jsxs("div",{className:G.iconItemListWrap,children:[R.jsxs("div",{className:G.none,onClick:()=>n({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[R.jsx(Xe,{className:G.icon}),R.jsx("span",{children:"无单元格图标"})]}),R.jsx("div",{className:G.iconItemList,children:e.map(r=>R.jsx("div",{className:G.item,children:R.jsx("img",{onClick:()=>n(r),className:`
|
|
109
109
|
${G.icon}
|
|
110
|
-
`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,a=
|
|
110
|
+
`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,a=re.useDependency(_.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:a.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],y=(w,E)=>{e([String(E),"value","value"],w)},p=(w,E)=>{e([String(E),"operator"],w);const I=c.createDefaultValue(c.CFSubRuleType.number,w);y(I,E)},C=(w,E)=>{e([String(E),"value","type"],w);const I=n[E],S=c.createDefaultValue(c.CFSubRuleType.number,I.operator);y(S,E)};return V.useMemo(()=>n.map((w,E)=>{const I=r[E],S=hn(w.iconType,w.iconId),T=E===n.length-1,h=E===0,i=n[E-1],s=(i==null?void 0:i.value.type)===c.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,f=(b,l)=>{const g={...w,iconId:l,iconType:b};e([String(E)],g)};return R.jsxs("div",{className:`
|
|
111
111
|
${E?A.mTXl:A.mTSm}
|
|
112
112
|
`,children:[R.jsxs("div",{className:`
|
|
113
113
|
${A.label}
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
`,options:u,value:w.value.type,onChange:b=>{C(b,E)}}),R.jsx("div",{className:`
|
|
147
147
|
${A.mL0}
|
|
148
148
|
${G.width45}
|
|
149
|
-
`,children:R.jsx(Ra,{id:E,type:w.value.type,error:I,value:w.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},Da=t=>{var b;const{interceptorManager:e}=t,n=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.iconSet?t.rule:void 0,r=
|
|
149
|
+
`,children:R.jsx(Ra,{id:E,type:w.value.type,error:I,value:w.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},Da=t=>{var b;const{interceptorManager:e}=t,n=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.iconSet?t.rule:void 0,r=re.useDependency(_.LocaleService),[a,o]=V.useState({}),[u,y]=V.useState(()=>{const l=Object.keys(c.iconMap)[0];if(n&&n.config.length){const g=n.config[0].iconType;if(!n.config.some(v=>v.iconType!==g))return g}return l}),[p,C]=V.useState(()=>{if(n&&n.config.length)return _.Tools.deepClone(n==null?void 0:n.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,d,v)=>d===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(d)}:gn(u,d,v))}),[m,w]=V.useState(()=>n?!!n.isShowValue:!0),E=V.useMemo(()=>{const l=p.map(g=>hn(g.iconType,g.iconId));return R.jsx("div",{className:G.iconWrap,children:l.map((g,d)=>g?R.jsx("img",{className:G.icon,src:g},d):R.jsx(Xe,{className:G.icon},d))})},[p]),I=l=>{if(l.reduce((d,v,x)=>d.preType&&!d.result||l.length-1===x?d:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:d.preType?{result:d.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(l[0].value.type)){const d={};return l.forEach((v,x,M)=>{if(x-1<0||x===M.length-1)return;const U=l[x-1],O=c.getOppositeOperator(U.operator);c.compareWithNumber({operator:O,value:U.value.value},v.value.value)||(d[x]=`${r.t(`sheet.cf.form.${O}`,String(U.value.value))} `)}),d}return{}},S=(l,g)=>{_.get(p,l)!==g&&(_.set(p,l,g),C([...p]),o(I(p)))},T=l=>{y(l);const g=c.iconMap[l]||[],d=new Array(g.length).fill("").map((v,x,M)=>gn(l,x,M));C(d),o(I(d))};V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,e]),V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,p,e,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,d)=>{const v=p.length-1-d,x=l[v];g.iconId=x.iconId,g.iconType=x.iconType}),C([...p])},i=re.useDependency(re.ILayoutService),[s,f]=V.useState();return re.useScrollYOverContainer(s,i.rootContainerElement),R.jsxs("div",{className:G.iconSet,children:[R.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
|
|
150
150
|
${A.mTSm}
|
|
151
151
|
`,children:R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Ea,{ref:l=>{!s&&l&&f(l)},iconType:u,onClick:T})}),children:R.jsxs("div",{className:ee.clsx(G.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,R.jsx(vt,{})]})})}),R.jsxs("div",{className:`
|
|
152
152
|
${A.mTSm}
|
|
@@ -154,29 +154,29 @@
|
|
|
154
154
|
`,children:[R.jsxs("div",{className:G.utilItem,children:[R.jsx(ee.Checkbox,{onChange:h}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),R.jsxs("div",{className:`
|
|
155
155
|
${G.utilItem}
|
|
156
156
|
${A.mLXl}
|
|
157
|
-
`,children:[R.jsx(ee.Checkbox,{checked:!m,onChange:l=>{w(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),R.jsx(Pa,{errorMap:a,onChange:S,configList:p})]})},xa=t=>{var h;const{onChange:e,interceptorManager:n}=t,r=
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
`,children:[R.jsx(ee.Checkbox,{checked:!m,onChange:l=>{w(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),R.jsx(Pa,{errorMap:a,onChange:S,configList:p})]})},xa=t=>{var h;const{onChange:e,interceptorManager:n}=t,r=re.useDependency(_.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.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"}],[u,y]=V.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case c.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[p,C]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.value||10}}return 10}),[m,w]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[E,I]=V.useState({}),S=i=>{const{type:s,isPercent:f,value:b,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:b,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:b,style:l};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:l}};V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return S({type:u,isPercent:m,value:p,style:E})}}),[u,m,p,E,n]);const T=i=>{e(S(i))};return R.jsxs("div",{children:[R.jsx("div",{className:`
|
|
158
|
+
${A.title}
|
|
159
|
+
${A.mTBase}
|
|
160
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
|
|
161
161
|
${G.width100}
|
|
162
162
|
${A.mTSm}
|
|
163
163
|
`,value:u,options:o,onChange:i=>{y(i),T({type:i,isPercent:m,value:p,style:E})}}),["isNotBottom","isBottom"].includes(u)&&R.jsxs("div",{className:`
|
|
164
|
-
${A.labelContainer}
|
|
165
|
-
${A.mTSm}
|
|
166
|
-
`,children:[R.jsx(ee.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;C(s),T({type:u,isPercent:m,value:s,style:E})}}),R.jsxs("div",{className:`
|
|
167
|
-
${A.mLSm}
|
|
168
164
|
${A.labelContainer}
|
|
169
|
-
${
|
|
170
|
-
`,children:[R.jsx(ee.
|
|
171
|
-
|
|
172
|
-
|
|
165
|
+
${A.mTSm}
|
|
166
|
+
`,children:[R.jsx(ee.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;C(s),T({type:u,isPercent:m,value:s,style:E})}}),R.jsxs("div",{className:`
|
|
167
|
+
${A.mLSm}
|
|
168
|
+
${A.labelContainer}
|
|
169
|
+
${G.text}
|
|
170
|
+
`,children:[R.jsx(ee.Checkbox,{checked:m,onChange:i=>{w(!!i),T({type:u,isPercent:!!i,value:p,style:E})}}),r.t("sheet.cf.valueType.percent")]})]}),R.jsx("div",{className:`
|
|
171
|
+
${G.cfPreviewWrap}
|
|
172
|
+
`,children:R.jsx(We,{rule:S({type:u,isPercent:m,value:p,style:E})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
|
|
173
173
|
${A.mTSm}
|
|
174
|
-
`,onChange:i=>{I(i),T({type:u,isPercent:m,value:p,style:i})}})]})},Ma=_.createInterceptorKey("beforeSubmit"),Na=_.createInterceptorKey("submit"),vn=t=>t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=t=>{var e;return(e=t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},La=t=>{var d,v,x;const e=
|
|
174
|
+
`,onChange:i=>{I(i),T({type:u,isPercent:m,value:p,style:i})}})]})},Ma=_.createInterceptorKey("beforeSubmit"),Na=_.createInterceptorKey("submit"),vn=t=>t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=t=>{var e;return(e=t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},La=t=>{var d,v,x;const e=re.useDependency(_.LocaleService),n=re.useDependency(_.ICommandService),r=re.useDependency(_.IUniverInstanceService),a=re.useDependency(c.ConditionalFormattingRuleModel),o=re.useDependency(K.SheetsSelectionsService),u=vn(r),y=mn(r),[p,C]=V.useState(void 0),m=V.useRef((v=(d=t.rule)==null?void 0:d.ranges)!=null?v:[]),w=V.useMemo(()=>{var z,U,O;let M=(z=t.rule)==null?void 0:z.ranges;return M!=null&&M.length||(M=(O=(U=o.getCurrentSelections())==null?void 0:U.map(L=>L.range))!=null?O:[]),m.current=M,M!=null&&M.length?M.map(L=>{const B=kt.serializeRange(L);return B==="NaN"?"":B}).filter(L=>!!L).join(","):""},[t.rule]),E=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[I,S]=V.useState(()=>{var U,O;const M=(U=t.rule)==null?void 0:U.rule.type,z=E[0].value;if(!M)return z;switch(M){case c.CFRuleType.highlightCell:{switch((O=t.rule)==null?void 0:O.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return z}),T=V.useRef(void 0),h=V.useMemo(()=>new _.InterceptorManager({beforeSubmit:Ma,submit:Na}),[]),i=V.useMemo(()=>{switch(I){case"1":return pn;case"2":return xa;case"3":return wa;case"4":return Ta;case"5":return Ia;case"6":return Da;default:return pn}},[I]);V.useEffect(()=>{const M=n.onCommandExecuted(z=>{if(z.id===K.RemoveSheetMutation.id){const U=z.params;U.subUnitId===y&&U.unitId===u&&t.onCancel()}z.id===K.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>M.dispose()},[]);const s=M=>{T.current=M},f=M=>{const z=M.split(",").filter(U=>!!U).map(kt.deserializeRangeWithSheet).map(U=>U.range);m.current=z},b=()=>{if(p)return;const z=(()=>{const O=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!O)throw new Error("No active sheet found");return m.current.map(q=>K.setEndForRange(q,O.getRowCount(),O.getColumnCount())).filter(q=>!(Number.isNaN(q.startRow)||Number.isNaN(q.startColumn)))})();if(h.fetchThroughInterceptors(h.getInterceptPoints().beforeSubmit)(!0,null)){const O=h.fetchThroughInterceptors(h.getInterceptPoints().submit)(null,null);if(O){const L=vn(r),B=mn(r);if(!L||!B)throw new Error("No active sheet found");let q={};t.rule&&t.rule.cfId?(q={...t.rule,ranges:z,rule:O},n.executeCommand(c.SetCfCommand.id,{unitId:L,subUnitId:B,rule:q}),t.onCancel()):(q={cfId:a.createCfId(L,B),ranges:z,rule:O,stopIfTrue:!1},n.executeCommand(c.AddCfCommand.id,{unitId:L,subUnitId:B,rule:q}),t.onCancel())}}},l=()=>{t.onCancel()},g=(M,z)=>{M?z.length<1?C(e.t("sheet.cf.errorMessage.rangeError")):C(void 0):C(e.t("sheet.cf.errorMessage.rangeError"))};return R.jsxs("div",{className:G.cfRuleStyleEditor,children:[R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),R.jsxs("div",{className:`
|
|
175
175
|
${A.mTBase}
|
|
176
176
|
`,children:[R.jsx(Ge.RangeSelector,{unitId:u,subUnitId:y,initialValue:w,onChange:(M,z)=>f(z),onVerify:g}),p&&R.jsx("div",{className:G.cfErrorText,children:p})]}),R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),R.jsx("div",{className:A.mTBase,children:R.jsx(ee.Select,{className:G.width100,value:I,options:E,onChange:M=>S(M)})}),R.jsx(i,{interceptorManager:h,rule:(x=t.rule)==null?void 0:x.rule,onChange:s}),R.jsxs("div",{className:`
|
|
177
177
|
${A.mTBase}
|
|
178
178
|
${G.btnList}
|
|
179
|
-
`,children:[R.jsx(ee.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),R.jsx(ee.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Va=t=>{const[e,n]=V.useState(t.rule),[r,a]=V.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),n(void 0)},y=p=>{n(p),a(!0)};return R.jsx("div",{className:A.conditionalFormattingWrap,children:r?R.jsx(La,{onCancel:u,rule:e}):R.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ua(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},at=(t,e)=>(n,r)=>e(n,r,t);const Pt="sheet.conditional.formatting.panel";let ot=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Pt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:e,key:_.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,_.IUniverInstanceService),at(1,_.Inject(_.Injector)),at(2,_.Inject(te.ComponentManager)),at(3,_.Inject(te.ISidebarService)),at(4,_.Inject(_.LocaleService))],ot);var me=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(me||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:_.CommandType.OPERATION,handler:(t,e)=>{var y;const n=t.get(ot),r=t.get(Y.SheetsSelectionsService),a=t.get(_.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};n.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};n.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};n.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(p);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(c.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(c.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(t,e,n,r)=>{for(var a=r>1?void 0:r?ka(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(n,r)=>e(n,r,t);let lt=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=n;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,n,r){const a=new _.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:n,cfMap:o}};const u=this._injector.invoke(m=>Y.rangeToDiscreteRange(r,m,e,n));if(!u)return;const{rows:y,cols:p}=u,C=new Set;y.forEach((m,w)=>{p.forEach((E,I)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,n,m,E);S&&(S.forEach(T=>C.add(T.cfId)),a.setValue(w,I,S.map(T=>T.cfId)))})}),C.forEach(m=>{const w=this._conditionalFormattingRuleModel.getRule(e,n,m);w&&(o[m]=w.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(n.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[p,C],mapFunc:m}=fe.virtualizeDiscreteRanges([n.copyRange,e]),w=fe.getRepeatRange(p,C,!0),E={};_.Range.foreach(C,(l,g)=>{const{row:d,col:v}=m(l,g),x=this._conditionalFormattingViewModel.getCellCfs(o,u,d,v);x&&x.forEach(M=>{if(!E[M.cfId]){const z=new _.ObjectMatrix;E[M.cfId]=z;const U=this._conditionalFormattingRuleModel.getRule(o,u,M.cfId);U==null||U.ranges.forEach(O=>{_.Range.foreach(O,(L,F)=>{z.setValue(L,F,1)})})}E[M.cfId].realDeleteValue(d,v)})});const{matrix:I,info:S}=this._copyInfo,T=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=S==null?void 0:S.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...T].find(v=>_.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,T.push(v),h=`${Number(h)+1}`,v}};w.forEach(l=>{I&&I.forValue((g,d,v)=>{const x=_.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:M,col:z}=m(x.startRow,x.startColumn);v.forEach(U=>{if(!E[U]){const O=s(U),L=new _.ObjectMatrix;E[U]=L,O.ranges.forEach(F=>{_.Range.foreach(F,(q,J)=>{L.setValue(q,J,1)})})}E[U].setValue(M,z,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:u,cfId:l};f.push({id:c.DeleteConditionalRuleMutation.id,params:v}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(T.some(v=>v.cfId===l)){const v=s(l),x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.AddConditionalRuleMutation.id,params:x}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,x))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.SetConditionalRuleMutation.id,params:x}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,x))}}return{redos:f,undos:b}}};lt=Aa([st(0,_.Inject(fe.ISheetClipboardService)),st(1,_.Inject(c.ConditionalFormattingRuleModel)),st(2,_.Inject(_.Injector)),st(3,_.Inject(c.ConditionalFormattingViewModel)),st(4,_.Inject(_.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(t,e,n,r)=>{for(var a=r>1?void 0:r?Wa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},lr=(t,e)=>(n,r)=>e(n,r,t);let ct=class extends _.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===c.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([lr(0,_.Inject(_.LocaleService)),lr(1,_.ICommandService),lr(2,_.Inject(Y.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ha(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Dt=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends _.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const u=p=>{const C=[...o.ranges],m=C.map(E=>Y.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,C))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:E}],S=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:E}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}},y=[];o.ranges.forEach(p=>{const C=this._refRangeService.registerRefRange(p,u);y.push(()=>C.dispose())}),t.set(e(r,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:u}=r,y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(p==null?void 0:p.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const C=t.get(e(a,o,u.cfId));C&&C();break}case"set":{const C=t.get(e(a,o,u.cfId));C&&C(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(_.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};ut=Ba([Dt(0,_.Inject(c.ConditionalFormattingRuleModel)),Dt(1,_.Inject(_.IUniverInstanceService)),Dt(2,_.Inject(_.Injector)),Dt(3,_.Inject(Y.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,n,r)=>{for(var a=r>1?void 0:r?Fa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(n,r)=>e(n,r,t);let dt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const e=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:_.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(e);const o=n.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return a.style&&Object.assign(y,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),r(p)},priority:10}))}};dt=Ga([He(0,_.Inject(Y.SheetInterceptorService)),He(1,_.Inject(c.ConditionalFormattingService)),He(2,_.Inject(_.IUniverInstanceService)),He(3,_.Inject(hr.IRenderManagerService)),He(4,_.Inject(c.ConditionalFormattingViewModel)),He(5,_.Inject(c.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",xt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(t,e,n)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ka=(t,e,n,r)=>{for(var a=r>1?void 0:r?Xa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},cr=(t,e)=>(n,r)=>e(n,r,t),bn=(t,e,n)=>Ya(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),cr(1,_.Inject(_.Injector)),cr(2,_.Inject(_.ICommandService)),cr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var Za=Object.getOwnPropertyDescriptor,$a=(t,e,n,r)=>{for(var a=r>1?void 0:r?Za(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ft=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends _.Disposable{constructor(t,e,n,r,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var I;const C=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!C||!m)return;const w={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};_.Range.foreach(u,(S,T)=>{const h=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},w),i=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},E),{row:s,col:f}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(C,m,s,f),{row:l,col:g}=p(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(C,m,l,g);d&&d.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.realDeleteValue(l,g)}),b&&b.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const u=(i=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,C=[],m=[];if(!u||!y)return t();const w=fe.virtualizeDiscreteRanges([a,o]),[E,I]=w.ranges,{mapFunc:S}=w,T={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,I).forEach(b=>{e(T,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:d}};C.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};C.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:C}},r={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return n(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=$a([ft(0,_.Inject(_.Injector)),ft(1,_.Inject(_.IUniverInstanceService)),ft(2,_.Inject(fe.IAutoFillService)),ft(3,_.Inject(c.ConditionalFormattingRuleModel)),ft(4,_.Inject(c.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ja(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},pt=(t,e)=>(n,r)=>e(n,r,t);$.ConditionalFormattingClearController=class extends _.Disposable{constructor(e,n,r,a,o){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const n=[],r=[],a={redos:n,undos:r};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(S=>S.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const C=y.getUnitId(),m=p.getSheetId(),w=this._conditionalFormattingRuleModel.getSubunitRules(C,m);if(!w||!w.length)return a;const{redos:E,undos:I}=Sn(this._injector,w,u,C,m);n.push(...E),r.push(...I)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const a=[],o=[],u={redos:a,undos:o};if(!r||!r.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!y||!y.length)return u;const{redos:p,undos:C}=Sn(this._injector,y,r,e,n);return a.push(...p),o.push(...C),u}}))}},$.ConditionalFormattingClearController=Qa([pt(0,_.Inject(_.Injector)),pt(1,_.Inject(_.IUniverInstanceService)),pt(2,_.Inject(Y.SheetInterceptorService)),pt(3,_.Inject(Y.SheetsSelectionsService)),pt(4,_.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Sn(t,e,n,r,a){const o=[],u=[];return e.filter(y=>n.some(p=>y.ranges.some(C=>_.Rectangle.getIntersects(C,p)))).forEach(y=>{const C=new Y.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(C.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:C}}},w=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},w=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}}),{redos:o,undos:u}}var eo=Object.getOwnPropertyDescriptor,to=(t,e,n,r)=>{for(var a=r>1?void 0:r?eo(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Cn=(t,e)=>(n,r)=>e(n,r,t);let Nt=class extends _.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(_.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var u,y,p;t||n(t);const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=r==null?void 0:r.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(C=>{C.ts&&o.forEach(m=>{var w;(w=C.ts)==null||delete w[m]})}),n(t);{const C={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(w=>{delete C[w]});const m={...t,s:{...C}};return n(m)}}})))}};Nt=to([Cn(0,_.Inject(Y.SheetInterceptorService)),Cn(1,_.Inject(c.ConditionalFormattingService))],Nt);const Tn=[Y.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:me.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:me.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:me.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:me.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:me.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:me.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:me.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:me.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:me.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:me.clearWorkSheetRules}],ro=t=>{const e=t.get(Y.SheetsSelectionsService),n=t.get(_.ICommandService),r=t.get(_.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var T;const C=((T=e.getCurrentSelections())==null?void 0:T.map(h=>h.range))||[],m=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!m)return;const w=m.getActiveSheet();if(!w)return;const S=(a.getSubunitRules(m.getUnitId(),w.getSheetId())||[]).filter(h=>h.ranges.some(i=>C.some(s=>_.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>Y.checkRangesEditablePermission(t,m.getUnitId(),w.getSheetId(),h));p.next(S)})),u=new Ce.Observable(p=>new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const C=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!C)return;const m=C.getActiveSheet();if(!m)return;const w=a.getSubunitRules(C.getUnitId(),m.getSheetId())||[];if(!w.length)return p.next(!1),!1;const E=w.map(I=>I.ranges).every(I=>Y.checkRangesEditablePermission(t,C.getUnitId(),m.getSheetId(),I));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(C=>{const m=ht.find(w=>w.value===me.clearRangeRules);m&&(m.disabled=!C,p.next(ht))}),u.subscribe(C=>{const m=ht.find(w=>w.value===me.clearWorkSheetRules);m&&(m.disabled=!C,p.next(ht))}),p.next(ht)});return{id:it.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(t,_.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},no={[te.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(t,e,n,r)=>{for(var a=r>1?void 0:r?ao(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},wn=(t,e)=>(n,r)=>e(n,r,t);let Lt=class extends _.Disposable{constructor(e,n){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,_.Inject(_.Injector)),wn(1,te.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(t,e,n,r)=>{for(var a=r>1?void 0:r?io(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(n,r)=>e(n,r,t);const lo=(t,e)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(e)%n(t),o=r(e)%r(t),u=Math.floor(n(e)/n(t)),y=Math.floor(r(e)/r(t)),p=[],C={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:C,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let w=0;w<y+(o?.1:0);w++){const E=n(t)*m,I=r(t)*w,S={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let T=C;m===u&&a&&(T={...T},T.endRow=T.endRow-(n(t)-a)),w===y&&o&&(T={...T},T.endColumn=T.endColumn-(r(t)-o)),p.push({repeatRelativeRange:T,startRange:S})}return p};let Vt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(o,u,y,p,C)=>{const{unitId:m,subUnitId:w}=this._painterConfig,{targetUnitId:E,targetSubUnitId:I}=C,S={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},T={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};_.Range.foreach(y,(h,i)=>{const s=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},S),f=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},T),b=this._conditionalFormattingViewModel.getCellCfs(m,w,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,I,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,I,g.cfId);if(!v)return;d=new _.ObjectMatrix,v.ranges.forEach(x=>{_.Range.foreach(x,(M,z)=>{d.setValue(M,z,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,u,y)=>{var s;const{range:p,unitId:C,subUnitId:m}=this._painterConfig,w=o!==C||m!==u,E=new Map,I=[],S=[];if(!o||!u||!C||!m)return e();const T=(s=this._conditionalFormattingRuleModel.getSubunitRules(C,m))!=null?s:[];T==null||T.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>_.Rectangle.intersects(p,g))){const g=new _.ObjectMatrix;w||b.forEach(d=>{_.Range.foreach(d,(v,x)=>{g.setValue(v,x,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return lo(p,y).forEach(f=>{n(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((f,b)=>{if(w){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:u,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:u,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(C,m,b);if(d){const v={unitId:o,subUnitId:u,rule:{..._.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:v}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(C,m,b);if(!l)return;const g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:C,subUnitId:m,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:C,subUnitId:m,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:S,redos:I}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const C=(u=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),w=this._sheetsSelectionsService.getCurrentLastSelection(),E=w==null?void 0:w.range;C&&m&&E&&(this._painterConfig={unitId:C,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?r(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,_.Inject(_.Injector)),Be(1,_.Inject(_.IUniverInstanceService)),Be(2,_.Inject(fe.IFormatPainterService)),Be(3,_.Inject(Y.SheetsSelectionsService)),Be(4,_.Inject(c.ConditionalFormattingRuleModel)),Be(5,_.Inject(c.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(t,e,n,r)=>{for(var a=r>1?void 0:r?co(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ur=(t,e)=>(n,r)=>e(n,r,t);let Ut=class extends _.Disposable{constructor(t,e,n){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),e=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,w=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(w)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&e(n)})}};Ut=uo([ur(0,_.Inject(c.ConditionalFormattingViewModel)),ur(1,_.IUniverInstanceService),ur(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,go=(t,e,n,r)=>{for(var a=r>1?void 0:r?po(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},dr=(t,e)=>(n,r)=>e(n,r,t),In=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand()}onStarting(){_.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[$.ConditionalFormattingClearController],[Vt],[Ut]]),_.touchDependencies(this._injector,[[dt]])}onReady(){_.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){_.touchDependencies(this._injector,[[Mt],[$.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},In($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In($.UniverSheetsConditionalFormattingUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=go([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),dr(1,_.Inject(_.Injector)),dr(2,_.Inject(_.ICommandService)),dr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=At,$.AddColorScaleConditionalRuleCommand=Wt,$.AddDataBarConditionalRuleCommand=jt,$.AddDuplicateValuesCfCommand=Ht,$.AddNumberCfCommand=Bt,$.AddRankCfCommand=Ft,$.AddTextCfCommand=Gt,$.AddTimePeriodCfCommand=qt,$.AddUniqueValuesCfCommand=Xt,$.OpenConditionalFormattingOperator=it,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
179
|
+
`,children:[R.jsx(ee.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),R.jsx(ee.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Va=t=>{const[e,n]=V.useState(t.rule),[r,a]=V.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),n(void 0)},y=p=>{n(p),a(!0)};return R.jsx("div",{className:A.conditionalFormattingWrap,children:r?R.jsx(La,{onCancel:u,rule:e}):R.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ua(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},at=(t,e)=>(n,r)=>e(n,r,t);const Pt="sheet.conditional.formatting.panel";let ot=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Pt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:e,key:_.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,_.IUniverInstanceService),at(1,_.Inject(_.Injector)),at(2,_.Inject(re.ComponentManager)),at(3,_.Inject(re.ISidebarService)),at(4,_.Inject(_.LocaleService))],ot);var me=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(me||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:_.CommandType.OPERATION,handler:(t,e)=>{var y;const n=t.get(ot),r=t.get(K.SheetsSelectionsService),a=t.get(_.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};n.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};n.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};n.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(p);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(c.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(c.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(t,e,n,r)=>{for(var a=r>1?void 0:r?ka(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(n,r)=>e(n,r,t);let lt=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=n;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,n,r){const a=new _.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:n,cfMap:o}};const u=this._injector.invoke(m=>K.rangeToDiscreteRange(r,m,e,n));if(!u)return;const{rows:y,cols:p}=u,C=new Set;y.forEach((m,w)=>{p.forEach((E,I)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,n,m,E);S&&(S.forEach(T=>C.add(T.cfId)),a.setValue(w,I,S.map(T=>T.cfId)))})}),C.forEach(m=>{const w=this._conditionalFormattingRuleModel.getRule(e,n,m);w&&(o[m]=w.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(n.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[p,C],mapFunc:m}=fe.virtualizeDiscreteRanges([n.copyRange,e]),w=fe.getRepeatRange(p,C,!0),E={};_.Range.foreach(C,(l,g)=>{const{row:d,col:v}=m(l,g),x=this._conditionalFormattingViewModel.getCellCfs(o,u,d,v);x&&x.forEach(M=>{if(!E[M.cfId]){const z=new _.ObjectMatrix;E[M.cfId]=z;const U=this._conditionalFormattingRuleModel.getRule(o,u,M.cfId);U==null||U.ranges.forEach(O=>{_.Range.foreach(O,(L,B)=>{z.setValue(L,B,1)})})}E[M.cfId].realDeleteValue(d,v)})});const{matrix:I,info:S}=this._copyInfo,T=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=S==null?void 0:S.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...T].find(v=>_.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,T.push(v),h=`${Number(h)+1}`,v}};w.forEach(l=>{I&&I.forValue((g,d,v)=>{const x=_.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:M,col:z}=m(x.startRow,x.startColumn);v.forEach(U=>{if(!E[U]){const O=s(U),L=new _.ObjectMatrix;E[U]=L,O.ranges.forEach(B=>{_.Range.foreach(B,(q,J)=>{L.setValue(q,J,1)})})}E[U].setValue(M,z,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=K.findAllRectangle(K.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:u,cfId:l};f.push({id:c.DeleteConditionalRuleMutation.id,params:v}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(T.some(v=>v.cfId===l)){const v=s(l),x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.AddConditionalRuleMutation.id,params:x}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,x))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.SetConditionalRuleMutation.id,params:x}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,x))}}return{redos:f,undos:b}}};lt=Aa([st(0,_.Inject(fe.ISheetClipboardService)),st(1,_.Inject(c.ConditionalFormattingRuleModel)),st(2,_.Inject(_.Injector)),st(3,_.Inject(c.ConditionalFormattingViewModel)),st(4,_.Inject(_.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(t,e,n,r)=>{for(var a=r>1?void 0:r?Wa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},lr=(t,e)=>(n,r)=>e(n,r,t);let ct=class extends _.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===c.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[K.WorkbookEditablePermission],rangeTypes:[K.RangeProtectionPermissionEditPoint],worksheetTypes:[K.WorksheetEditPermission,K.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([lr(0,_.Inject(_.LocaleService)),lr(1,_.ICommandService),lr(2,_.Inject(K.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ha(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Dt=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends _.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const u=p=>{const C=[...o.ranges],m=C.map(E=>K.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,C))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:E}],S=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:E}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}},y=[];o.ranges.forEach(p=>{const C=this._refRangeService.registerRefRange(p,u);y.push(()=>C.dispose())}),t.set(e(r,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:u}=r,y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(p==null?void 0:p.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const C=t.get(e(a,o,u.cfId));C&&C();break}case"set":{const C=t.get(e(a,o,u.cfId));C&&C(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(_.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};ut=Ba([Dt(0,_.Inject(c.ConditionalFormattingRuleModel)),Dt(1,_.Inject(_.IUniverInstanceService)),Dt(2,_.Inject(_.Injector)),Dt(3,_.Inject(K.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,n,r)=>{for(var a=r>1?void 0:r?Fa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(n,r)=>e(n,r,t);let dt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const e=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(K.INTERCEPTOR_POINT.CELL_CONTENT,{effect:_.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(e);const o=n.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return a.style&&Object.assign(y,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),r(p)},priority:10}))}};dt=Ga([He(0,_.Inject(K.SheetInterceptorService)),He(1,_.Inject(c.ConditionalFormattingService)),He(2,_.Inject(_.IUniverInstanceService)),He(3,_.Inject(hr.IRenderManagerService)),He(4,_.Inject(c.ConditionalFormattingViewModel)),He(5,_.Inject(c.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",xt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(t,e,n)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ka=(t,e,n,r)=>{for(var a=r>1?void 0:r?Xa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},cr=(t,e)=>(n,r)=>e(n,r,t),bn=(t,e,n)=>Ya(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),cr(1,_.Inject(_.Injector)),cr(2,_.Inject(_.ICommandService)),cr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var $a=Object.getOwnPropertyDescriptor,Za=(t,e,n,r)=>{for(var a=r>1?void 0:r?$a(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ft=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends _.Disposable{constructor(t,e,n,r,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var I;const C=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!C||!m)return;const w={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};_.Range.foreach(u,(S,T)=>{const h=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},w),i=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},E),{row:s,col:f}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(C,m,s,f),{row:l,col:g}=p(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(C,m,l,g);d&&d.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.realDeleteValue(l,g)}),b&&b.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const u=(i=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,C=[],m=[];if(!u||!y)return t();const w=fe.virtualizeDiscreteRanges([a,o]),[E,I]=w.ranges,{mapFunc:S}=w,T={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,I).forEach(b=>{e(T,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const d=K.findAllRectangle(K.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:d}};C.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};C.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:C}},r={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return n(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=Za([ft(0,_.Inject(_.Injector)),ft(1,_.Inject(_.IUniverInstanceService)),ft(2,_.Inject(fe.IAutoFillService)),ft(3,_.Inject(c.ConditionalFormattingRuleModel)),ft(4,_.Inject(c.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ja(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},pt=(t,e)=>(n,r)=>e(n,r,t);$.ConditionalFormattingClearController=class extends _.Disposable{constructor(e,n,r,a,o){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const n=[],r=[],a={redos:n,undos:r};if([K.ClearSelectionFormatCommand.id,K.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(S=>S.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const C=y.getUnitId(),m=p.getSheetId(),w=this._conditionalFormattingRuleModel.getSubunitRules(C,m);if(!w||!w.length)return a;const{redos:E,undos:I}=Sn(this._injector,w,u,C,m);n.push(...E),r.push(...I)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const a=[],o=[],u={redos:a,undos:o};if(!r||!r.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!y||!y.length)return u;const{redos:p,undos:C}=Sn(this._injector,y,r,e,n);return a.push(...p),o.push(...C),u}}))}},$.ConditionalFormattingClearController=Qa([pt(0,_.Inject(_.Injector)),pt(1,_.Inject(_.IUniverInstanceService)),pt(2,_.Inject(K.SheetInterceptorService)),pt(3,_.Inject(K.SheetsSelectionsService)),pt(4,_.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Sn(t,e,n,r,a){const o=[],u=[];return e.filter(y=>n.some(p=>y.ranges.some(C=>_.Rectangle.getIntersects(C,p)))).forEach(y=>{const C=new K.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(C.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:C}}},w=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},w=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}}),{redos:o,undos:u}}var eo=Object.getOwnPropertyDescriptor,to=(t,e,n,r)=>{for(var a=r>1?void 0:r?eo(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Cn=(t,e)=>(n,r)=>e(n,r,t);let Nt=class extends _.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(_.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(K.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var u,y,p;t||n(t);const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=r==null?void 0:r.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(C=>{C.ts&&o.forEach(m=>{var w;(w=C.ts)==null||delete w[m]})}),n(t);{const C={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(w=>{delete C[w]});const m={...t,s:{...C}};return n(m)}}})))}};Nt=to([Cn(0,_.Inject(K.SheetInterceptorService)),Cn(1,_.Inject(c.ConditionalFormattingService))],Nt);const Tn=[K.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:me.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:me.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:me.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:me.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:me.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:me.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:me.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:me.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:me.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:me.clearWorkSheetRules}],ro=t=>{const e=t.get(K.SheetsSelectionsService),n=t.get(_.ICommandService),r=t.get(_.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var T;const C=((T=e.getCurrentSelections())==null?void 0:T.map(h=>h.range))||[],m=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!m)return;const w=m.getActiveSheet();if(!w)return;const S=(a.getSubunitRules(m.getUnitId(),w.getSheetId())||[]).filter(h=>h.ranges.some(i=>C.some(s=>_.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>K.checkRangesEditablePermission(t,m.getUnitId(),w.getSheetId(),h));p.next(S)})),u=new Ce.Observable(p=>new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const C=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!C)return;const m=C.getActiveSheet();if(!m)return;const w=a.getSubunitRules(C.getUnitId(),m.getSheetId())||[];if(!w.length)return p.next(!1),!1;const E=w.map(I=>I.ranges).every(I=>K.checkRangesEditablePermission(t,C.getUnitId(),m.getSheetId(),I));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(C=>{const m=ht.find(w=>w.value===me.clearRangeRules);m&&(m.disabled=!C,p.next(ht))}),u.subscribe(C=>{const m=ht.find(w=>w.value===me.clearWorkSheetRules);m&&(m.disabled=!C,p.next(ht))}),p.next(ht)});return{id:it.id,type:re.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:re.getMenuHiddenObservable(t,_.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[K.WorkbookEditablePermission],worksheetTypes:[K.WorksheetSetCellStylePermission,K.WorksheetEditPermission],rangeTypes:[K.RangeProtectionPermissionEditPoint]})}},no={[re.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(t,e,n,r)=>{for(var a=r>1?void 0:r?ao(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},wn=(t,e)=>(n,r)=>e(n,r,t);let Lt=class extends _.Disposable{constructor(e,n){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,_.Inject(_.Injector)),wn(1,re.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(t,e,n,r)=>{for(var a=r>1?void 0:r?io(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(n,r)=>e(n,r,t);const lo=(t,e)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(e)%n(t),o=r(e)%r(t),u=Math.floor(n(e)/n(t)),y=Math.floor(r(e)/r(t)),p=[],C={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:C,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let w=0;w<y+(o?.1:0);w++){const E=n(t)*m,I=r(t)*w,S={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let T=C;m===u&&a&&(T={...T},T.endRow=T.endRow-(n(t)-a)),w===y&&o&&(T={...T},T.endColumn=T.endColumn-(r(t)-o)),p.push({repeatRelativeRange:T,startRange:S})}return p};let Vt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(o,u,y,p,C)=>{const{unitId:m,subUnitId:w}=this._painterConfig,{targetUnitId:E,targetSubUnitId:I}=C,S={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},T={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};_.Range.foreach(y,(h,i)=>{const s=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},S),f=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},T),b=this._conditionalFormattingViewModel.getCellCfs(m,w,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,I,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,I,g.cfId);if(!v)return;d=new _.ObjectMatrix,v.ranges.forEach(x=>{_.Range.foreach(x,(M,z)=>{d.setValue(M,z,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,u,y)=>{var s;const{range:p,unitId:C,subUnitId:m}=this._painterConfig,w=o!==C||m!==u,E=new Map,I=[],S=[];if(!o||!u||!C||!m)return e();const T=(s=this._conditionalFormattingRuleModel.getSubunitRules(C,m))!=null?s:[];T==null||T.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>_.Rectangle.intersects(p,g))){const g=new _.ObjectMatrix;w||b.forEach(d=>{_.Range.foreach(d,(v,x)=>{g.setValue(v,x,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return lo(p,y).forEach(f=>{n(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((f,b)=>{if(w){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),g=K.findAllRectangle(K.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:u,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:u,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(C,m,b);if(d){const v={unitId:o,subUnitId:u,rule:{..._.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:v}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(C,m,b);if(!l)return;const g=K.findAllRectangle(K.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:C,subUnitId:m,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:C,subUnitId:m,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:S,redos:I}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const C=(u=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),w=this._sheetsSelectionsService.getCurrentLastSelection(),E=w==null?void 0:w.range;C&&m&&E&&(this._painterConfig={unitId:C,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?r(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,_.Inject(_.Injector)),Be(1,_.Inject(_.IUniverInstanceService)),Be(2,_.Inject(fe.IFormatPainterService)),Be(3,_.Inject(K.SheetsSelectionsService)),Be(4,_.Inject(c.ConditionalFormattingRuleModel)),Be(5,_.Inject(c.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(t,e,n,r)=>{for(var a=r>1?void 0:r?co(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ur=(t,e)=>(n,r)=>e(n,r,t);let Ut=class extends _.Disposable{constructor(t,e,n){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),e=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,w=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(w)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&e(n)})}};Ut=uo([ur(0,_.Inject(c.ConditionalFormattingViewModel)),ur(1,_.IUniverInstanceService),ur(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,go=(t,e,n,r)=>{for(var a=r>1?void 0:r?po(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},dr=(t,e)=>(n,r)=>e(n,r,t),In=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand()}onStarting(){_.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[$.ConditionalFormattingClearController],[Vt],[Ut]]),_.touchDependencies(this._injector,[[dt]])}onReady(){_.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){_.touchDependencies(this._injector,[[Mt],[$.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},In($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In($.UniverSheetsConditionalFormattingUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=go([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),dr(1,_.Inject(_.Injector)),dr(2,_.Inject(_.ICommandService)),dr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=At,$.AddColorScaleConditionalRuleCommand=Wt,$.AddDataBarConditionalRuleCommand=jt,$.AddDuplicateValuesCfCommand=Ht,$.AddNumberCfCommand=Bt,$.AddRankCfCommand=Ft,$.AddTextCfCommand=Gt,$.AddTimePeriodCfCommand=qt,$.AddUniqueValuesCfCommand=Xt,$.OpenConditionalFormattingOperator=it,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
180
180
|
|
|
181
181
|
|
|
182
182
|
// index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-sheets-conditional-formatting",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3-nightly.202503051607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -57,13 +57,13 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs/sheets-conditional-formatting": "0.6.
|
|
61
|
-
"@univerjs/sheets-conditional-formatting-ui": "0.6.
|
|
60
|
+
"@univerjs/sheets-conditional-formatting": "0.6.3-nightly.202503051607",
|
|
61
|
+
"@univerjs/sheets-conditional-formatting-ui": "0.6.3-nightly.202503051607"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@univerjs/core": "0.6.
|
|
64
|
+
"@univerjs/core": "0.6.3-nightly.202503051607",
|
|
65
65
|
"typescript": "^5.7.3",
|
|
66
|
-
"@univerjs-infra/shared": "0.6.
|
|
66
|
+
"@univerjs-infra/shared": "0.6.3"
|
|
67
67
|
},
|
|
68
68
|
"scripts": {
|
|
69
69
|
"prebuild:preset": "tsx prepare.ts",
|