@univerjs/preset-sheets-conditional-formatting 0.6.0-nightly.202502140800 → 0.6.1-nightly.202502231605
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/index.css +1 -1
- package/lib/umd/index.js +76 -78
- package/package.json +5 -5
package/lib/umd/index.js
CHANGED
|
@@ -7,181 +7,179 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
10
|
-
(function($,T){typeof exports=="object"&&typeof module<"u"?T(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"],T):($=typeof globalThis<"u"?globalThis:$||self,T($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,T,c,q,ee,E,L,ae,Gt,fe,Tn,Ce,Ge,In,qe){"use strict";var Ro=Object.defineProperty;var _o=($,T,c)=>T in $?Ro($,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[T]=c;var De=($,T,c)=>_o($,typeof T!="symbol"?T+"":T,c);const qt={type:T.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=t,u=e.get(c.ConditionalFormattingRuleModel),y=e.get(T.ICommandService),p=e.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=u.createCfId(m,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},Xe={type:T.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:r}=t,n=e.get(T.IUndoRedoService),a=e.get(T.ICommandService),o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.IUniverInstanceService),y=q.getSheetCommandTarget(u);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=o.createCfId(p,b),I={unitId:p,subUnitId:b,rule:{...r,cfId:r.cfId||m}},_=c.AddConditionalRuleMutationUndoFactory(e,I),w=a.syncExecuteCommand(c.AddConditionalRuleMutation.id,I);return w&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:I}],undoMutations:[_]}),w}},Xt={type:T.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,config:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.ICommandService),y=e.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Yt={type:T.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:b}=t,m=e.get(c.ConditionalFormattingRuleModel),I=e.get(T.IUniverInstanceService),_=q.getSheetCommandTarget(I);if(!_)return!1;const{unitId:w,subUnitId:C}=_,R=e.get(T.ICommandService),h=m.createCfId(w,C),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return R.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:C,rule:i})}},Kt={type:T.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.ICommandService),y=e.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},$t={type:T.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=t,y=e.get(c.ConditionalFormattingRuleModel),p=e.get(T.ICommandService),b=e.get(T.IUniverInstanceService),m=q.getSheetCommandTarget(b);if(!m)return!1;const{unitId:I,subUnitId:_}=m,w=y.createCfId(I,_);let C;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const R=u;if(R.length!==2||!Array.isArray(R))return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}else{const R=u;if(typeof R!="number")return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:_,rule:C})}},Zt={type:T.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=t,p=e.get(c.ConditionalFormattingRuleModel),b=e.get(T.IUniverInstanceService),m=e.get(T.ICommandService),I=q.getSheetCommandTarget(b);if(!I)return!1;const{unitId:_,subUnitId:w}=I,C=p.createCfId(_,w),R={ranges:r,cfId:C,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:n,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:w,rule:R})}},Jt={type:T.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=t,y=e.get(c.ConditionalFormattingRuleModel),p=e.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=e.get(T.ICommandService),w=y.createCfId(m,I),C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:n,value:u}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:C})}},Qt={type:T.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=t,u=e.get(c.ConditionalFormattingRuleModel),y=e.get(T.IUniverInstanceService),p=e.get(T.ICommandService),b=q.getSheetCommandTarget(y);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=u.createCfId(m,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},en={type:T.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.IUniverInstanceService),y=e.get(T.ICommandService),p=q.getSheetCommandTarget(u);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},yt={type:T.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var R;if(!t)return!1;const r=e.get(c.ConditionalFormattingRuleModel),n=e.get(T.IUniverInstanceService),a=e.get(T.ICommandService),o=e.get(T.IUndoRedoService),u=e.get(q.SheetsSelectionsService),y=q.getSheetCommandTarget(n,t);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=((R=u.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],I=r.getSubunitRules(p,b);if(!(I!=null&&I.length)||!m.length)return!1;const _=[],w=[];I.forEach(h=>{const i=new T.ObjectMatrix;h.ranges.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.setValue(S,l,1)})}),m.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.realDeleteValue(S,l)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},S={unitId:p,subUnitId:b,rule:d},l=c.setConditionalRuleMutationUndoFactory(e,S);_.push({id:c.SetConditionalRuleMutation.id,params:S}),w.push(...l)}else{const d={unitId:p,subUnitId:b,cfId:h.cfId},S=c.DeleteConditionalRuleMutationUndoFactory(e,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),w.push(...S)}});const C=T.sequenceExecute(_,a).result;return C&&o.pushUndoRedo({unitID:p,redoMutations:_,undoMutations:w}),C}},Ye={type:T.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const r=e.get(c.ConditionalFormattingRuleModel),n=e.get(T.IUniverInstanceService),a=e.get(T.ICommandService),o=e.get(T.IUndoRedoService),u=q.getSheetCommandTarget(n,t);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=r.getSubunitRules(y,p);if(!(b!=null&&b.length))return!1;const m=b.map(C=>({cfId:C.cfId,unitId:y,subUnitId:p})),I=m.map(C=>({id:c.DeleteConditionalRuleMutation.id,params:C})),_=m.map(C=>c.DeleteConditionalRuleMutationUndoFactory(e,C)[0]),w=T.sequenceExecute(I,a).result;return w&&o.pushUndoRedo({unitID:y,redoMutations:I,undoMutations:_}),w}},Ke={type:T.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,cfId:t.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(e,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},St={type:T.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=e.get(c.ConditionalFormattingRuleModel),u=q.getSheetCommandTarget(a,t);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=c.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(y,p)||[],R=>R.cfId);if(!b)return!1;const[m,I]=b,_={unitId:y,subUnitId:p,start:m,end:I},w=c.MoveConditionalRuleMutationUndoFactory(_),C=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return C&&r.pushUndoRedo({unitID:y,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:w}),C}},bt={type:T.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,rule:t.rule},b=c.setConditionalRuleMutationUndoFactory(e,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}},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 Se=function(){return Se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Se.apply(this,arguments)},Nr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},Ve=L.forwardRef(function(e,t){var r=e.icon,n=e.id,a=e.className,o=e.extend,u=Nr(e,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),p=L.useRef("_".concat(Vr()));return wn(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:t,className:y},u),o)});function wn(e,t,r,n,a){return L.createElement(e.tag,Se(Se({key:t},Lr(e,r,a)),n),(Ur(e,r).children||[]).map(function(o,u){return wn(o,"".concat(t,"-").concat(e.tag,"-").concat(u),r,void 0,a)}))}function Lr(e,t,r){var n=Se({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Ur(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?Se(Se({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.indexOf(a.attrs.id)>-1?Se(Se({},a),{attrs:Se(Se({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Vr(){return Math.random().toString(36).substring(2,8)}Ve.displayName="UniverIcon";var zr={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"}}]},Ct=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"delete-single",ref:t,icon:zr}))});Ct.displayName="DeleteSingle";var kr={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"}}]},Rn=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"increase-single",ref:t,icon:kr}))});Rn.displayName="IncreaseSingle";var Ar={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"}}]},Tt=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ar}))});Tt.displayName="MoreDownSingle";var Wr={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"}}]}]},_n=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"sequence-single",ref:t,icon:Wr}))});_n.displayName="SequenceSingle";var jr={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"}}]}]},$e=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"slash-single",ref:t,icon:jr}))});$e.displayName="SlashSingle";function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function En(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),r}var tn={exports:{}},Ze={},Je={exports:{}},Br=Je.exports,On;function nn(){return On||(On=1,function(e,t){(function(r,n){n(t)})(Br,function(r){function n(B){return function(le,M,D,N,k,K,j){return B(le,M,j)}}function a(B){return function(le,M,D,N){if(!le||!M||typeof le!="object"||typeof M!="object")return B(le,M,D,N);var k=N.get(le),K=N.get(M);if(k&&K)return k===M&&K===le;N.set(le,M),N.set(M,le);var j=B(le,M,D,N);return N.delete(le),N.delete(M),j}}function o(B,Q){var le={};for(var M in B)le[M]=B[M];for(var M in Q)le[M]=Q[M];return le}function u(B){return B.constructor===Object||B.constructor==null}function y(B){return typeof B.then=="function"}function p(B,Q){return B===Q||B!==B&&Q!==Q}var b="[object Arguments]",m="[object Boolean]",I="[object Date]",_="[object RegExp]",w="[object Map]",C="[object Number]",R="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(B){var Q=B.areArraysEqual,le=B.areDatesEqual,M=B.areMapsEqual,D=B.areObjectsEqual,N=B.areRegExpsEqual,k=B.areSetsEqual,K=B.createIsNestedEqual,j=K(J);function J(Z,ne,de){if(Z===ne)return!0;if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return Z!==Z&&ne!==ne;if(u(Z)&&u(ne))return D(Z,ne,j,de);var Le=Array.isArray(Z),be=Array.isArray(ne);if(Le||be)return Le===be&&Q(Z,ne,j,de);var ve=s.call(Z);return ve!==s.call(ne)?!1:ve===I?le(Z,ne,j,de):ve===_?N(Z,ne,j,de):ve===w?M(Z,ne,j,de):ve===h?k(Z,ne,j,de):ve===R||ve===b?y(Z)||y(ne)?!1:D(Z,ne,j,de):ve===m||ve===C||ve===i?p(Z.valueOf(),ne.valueOf()):!1}return J}function S(B,Q,le,M){var D=B.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!le(B[D],Q[D],D,D,B,Q,M))return!1;return!0}var l=a(S);function g(B,Q){return p(B.valueOf(),Q.valueOf())}function f(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={},k=0;return B.forEach(function(K,j){if(D){var J=!1,Z=0;Q.forEach(function(ne,de){!J&&!N[Z]&&(J=le(j,de,k,Z,B,Q,M)&&le(K,ne,j,de,B,Q,M))&&(N[Z]=!0),Z++}),k++,D=J}}),D}var v=a(f),P="_owner",U=Object.prototype.hasOwnProperty;function z(B,Q,le,M){var D=Object.keys(B),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===P){var K=!!B.$$typeof,j=!!Q.$$typeof;if((K||j)&&K!==j)return!1}if(!U.call(Q,k)||!le(B[k],Q[k],k,k,B,Q,M))return!1}return!0}var V=a(z);function O(B,Q){return B.source===Q.source&&B.flags===Q.flags}function x(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={};return B.forEach(function(k,K){if(D){var j=!1,J=0;Q.forEach(function(Z,ne){!j&&!N[J]&&(j=le(k,Z,K,ne,B,Q,M))&&(N[J]=!0),J++}),D=j}}),D}var W=a(x),X=Object.freeze({areArraysEqual:S,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:x,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:V,areRegExpsEqual:O,areSetsEqual:W,createIsNestedEqual:n}),re=d(X);function te(B,Q){return re(B,Q,void 0)}var F=d(o(X,{createIsNestedEqual:function(){return p}}));function H(B,Q){return F(B,Q,void 0)}var oe=d(Y);function se(B,Q){return oe(B,Q,new WeakMap)}var ue=d(o(Y,{createIsNestedEqual:function(){return p}}));function ge(B,Q){return ue(B,Q,new WeakMap)}function ye(B){return d(o(X,B(X)))}function Te(B){var Q=d(o(Y,B(Y)));return function(le,M,D){return D===void 0&&(D=new WeakMap),Q(le,M,D)}}r.circularDeepEqual=se,r.circularShallowEqual=ge,r.createCustomCircularEqual=Te,r.createCustomEqual=ye,r.deepEqual=te,r.sameValueZeroEqual=p,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Je,Je.exports)),Je.exports}var It={exports:{}},Mn;function rn(){if(Mn)return It.exports;Mn=1;function e(r){var n,a,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(a=e(r[n]))&&(o&&(o+=" "),o+=a)}else for(a in r)r[a]&&(o&&(o+=" "),o+=a);return o}function t(){for(var r,n,a=0,o="",u=arguments.length;a<u;a++)(r=arguments[a])&&(n=e(r))&&(o&&(o+=" "),o+=n);return o}return It.exports=t,It.exports.clsx=t,It.exports}var ie={},an,Dn;function Fr(){return Dn||(Dn=1,an=function(t,r,n){return t===r?!0:t.className===r.className&&n(t.style,r.style)&&t.width===r.width&&t.autoSize===r.autoSize&&t.cols===r.cols&&t.draggableCancel===r.draggableCancel&&t.draggableHandle===r.draggableHandle&&n(t.verticalCompact,r.verticalCompact)&&n(t.compactType,r.compactType)&&n(t.layout,r.layout)&&n(t.margin,r.margin)&&n(t.containerPadding,r.containerPadding)&&t.rowHeight===r.rowHeight&&t.maxRows===r.maxRows&&t.isBounded===r.isBounded&&t.isDraggable===r.isDraggable&&t.isResizable===r.isResizable&&t.allowOverlap===r.allowOverlap&&t.preventCollision===r.preventCollision&&t.useCSSTransforms===r.useCSSTransforms&&t.transformScale===r.transformScale&&t.isDroppable===r.isDroppable&&n(t.resizeHandles,r.resizeHandles)&&n(t.resizeHandle,r.resizeHandle)&&t.onLayoutChange===r.onLayoutChange&&t.onDragStart===r.onDragStart&&t.onDrag===r.onDrag&&t.onDragStop===r.onDragStop&&t.onResizeStart===r.onResizeStart&&t.onResize===r.onResize&&t.onResizeStop===r.onResizeStop&&t.onDrop===r.onDrop&&n(t.droppingItem,r.droppingItem)&&n(t.innerRef,r.innerRef)}),an}var Pn;function ze(){if(Pn)return ie;Pn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=a,ie.cloneLayoutItem=y,ie.collides=m,ie.compact=I,ie.compactItem=C,ie.compactType=B,ie.correctBounds=R,ie.fastPositionEqual=b,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=i,ie.getLayoutItem=h,ie.getStatics=d,ie.modifyLayout=o,ie.moveElement=S,ie.moveElementAwayFromCollision=l,ie.noop=void 0,ie.perc=g,ie.resizeItemInDirection=F,ie.setTopLeft=oe,ie.setTransform=H,ie.sortLayoutItems=se,ie.sortLayoutItemsByColRow=ge,ie.sortLayoutItemsByRowCol=ue,ie.synchronizeLayoutWithChildren=ye,ie.validateLayout=Te,ie.withLayoutItem=u;var e=nn(),t=r(L);function r(M){return M&&M.__esModule?M:{default:M}}function n(M){let D=0,N;for(let k=0,K=M.length;k<K;k++)N=M[k].y+M[k].h,N>D&&(D=N);return D}function a(M){const D=Array(M.length);for(let N=0,k=M.length;N<k;N++)D[N]=y(M[N]);return D}function o(M,D){const N=Array(M.length);for(let k=0,K=M.length;k<K;k++)D.i===M[k].i?N[k]=D:N[k]=M[k];return N}function u(M,D,N){let k=h(M,D);return k?(k=N(y(k)),M=o(M,k),[M,k]):[M,null]}function y(M){return{w:M.w,h:M.h,x:M.x,y:M.y,i:M.i,minW:M.minW,maxW:M.maxW,minH:M.minH,maxH:M.maxH,moved:!!M.moved,static:!!M.static,isDraggable:M.isDraggable,isResizable:M.isResizable,resizeHandles:M.resizeHandles,isBounded:M.isBounded}}function p(M,D){return(0,e.deepEqual)(t.default.Children.map(M,N=>N==null?void 0:N.key),t.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,e.deepEqual)(t.default.Children.map(M,N=>N==null?void 0:N.props["data-grid"]),t.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}ie.fastRGLPropsEqual=Fr();function b(M,D){return M.left===D.left&&M.top===D.top&&M.width===D.width&&M.height===D.height}function m(M,D){return!(M.i===D.i||M.x+M.w<=D.x||M.x>=D.x+D.w||M.y+M.h<=D.y||M.y>=D.y+D.h)}function I(M,D,N,k){const K=d(M),j=se(M,D),J=Array(M.length);for(let Z=0,ne=j.length;Z<ne;Z++){let de=y(j[Z]);de.static||(de=C(K,de,D,N,j,k),K.push(de)),J[M.indexOf(j[Z])]=de,de.moved=!1}return J}const _={x:"w",y:"h"};function w(M,D,N,k){const K=_[k];D[k]+=1;const j=M.map(J=>J.i).indexOf(D.i);for(let J=j+1;J<M.length;J++){const Z=M[J];if(!Z.static){if(Z.y>D.y+D.h)break;m(D,Z)&&w(M,Z,N+D[K],k)}}D[k]=N}function C(M,D,N,k,K,j){const J=N==="vertical",Z=N==="horizontal";if(J)for(D.y=Math.min(n(M),D.y);D.y>0&&!i(M,D);)D.y--;else if(Z)for(;D.x>0&&!i(M,D);)D.x--;let ne;for(;(ne=i(M,D))&&!(N===null&&j);)if(Z?w(K,D,ne.x+ne.w,"x"):w(K,D,ne.y+ne.h,"y"),Z&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(M,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function R(M,D){const N=d(M);for(let k=0,K=M.length;k<K;k++){const j=M[k];if(j.x+j.w>D.cols&&(j.x=D.cols-j.w),j.x<0&&(j.x=0,j.w=D.cols),!j.static)N.push(j);else for(;i(N,j);)j.y++}return M}function h(M,D){for(let N=0,k=M.length;N<k;N++)if(M[N].i===D)return M[N]}function i(M,D){for(let N=0,k=M.length;N<k;N++)if(m(M[N],D))return M[N]}function s(M,D){return M.filter(N=>m(N,D))}function d(M){return M.filter(D=>D.static)}function S(M,D,N,k,K,j,J,Z,ne){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return M;`${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 be=se(M,J);(J==="vertical"&&typeof k=="number"?Le>=k:J==="horizontal"&&typeof N=="number"?de>=N:!1)&&(be=be.reverse());const Fe=s(be,D),Ft=Fe.length>0;if(Ft&&ne)return a(M);if(Ft&&j)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,M;for(let Cn=0,wo=Fe.length;Cn<wo;Cn++){const Ue=Fe[Cn];`${D.i}${D.x}${D.y}${Ue.i}${Ue.x}${Ue.y}`,!Ue.moved&&(Ue.static?M=l(M,Ue,D,K,J):M=l(M,D,Ue,K,J))}return M}function l(M,D,N,k,K,j){const J=K==="horizontal",Z=K==="vertical",ne=D.static;if(k){k=!1;const be={x:J?Math.max(D.x-N.w,0):N.x,y:Z?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(M,be),Fe=ve&&ve.y+ve.h>D.y,Ft=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&Z)return S(M,N,void 0,D.y+1,k,ne,K);if(Fe&&K==null)return D.y=N.y,N.y=N.y+N.h,M;if(Ft&&J)return S(M,D,N.x,void 0,k,ne,K)}else return`${N.i}${be.x}${be.y}`,S(M,N,J?be.x:void 0,Z?be.y:void 0,k,ne,K)}const de=J?N.x+1:void 0,Le=Z?N.y+1:void 0;return de==null&&Le==null?M:S(M,N,J?N.x+1:void 0,Z?N.y+1:void 0,k,ne,K)}function g(M){return M*100+"%"}const f=(M,D,N,k)=>M+N>k?D:N,v=(M,D,N)=>M<0?D:N,P=M=>Math.max(0,M),U=M=>Math.max(0,M),z=(M,D,N)=>{let{left:k,height:K,width:j}=D;const J=M.top-(K-M.height);return{left:k,width:j,height:v(J,M.height,K),top:U(J)}},V=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{top:k,height:j,width:f(M.left,M.width,J,N),left:P(K)}},O=(M,D,N)=>{let{top:k,height:K,width:j}=D;const J=M.left-(j-M.width);return{height:K,width:J<0?M.width:f(M.left,M.width,j,N),top:U(k),left:P(J)}},x=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{width:J,left:K,height:v(k,M.height,j),top:U(k)}},te={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],V(...arguments))},e:V,se:function(){return x(arguments.length<=0?void 0:arguments[0],V(...arguments))},s:x,sw:function(){return x(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(M,D,N,k){const K=te[M];return K?K(D,{...D,...N},k):N}function H(M){let{top:D,left:N,width:k,height:K}=M;const j=`translate(${N}px,${D}px)`;return{transform:j,WebkitTransform:j,MozTransform:j,msTransform:j,OTransform:j,width:`${k}px`,height:`${K}px`,position:"absolute"}}function oe(M){let{top:D,left:N,width:k,height:K}=M;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${K}px`,position:"absolute"}}function se(M,D){return D==="horizontal"?ge(M):D==="vertical"?ue(M):M}function ue(M){return M.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(M){return M.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(M,D,N,k,K){M=M||[];const j=[];t.default.Children.forEach(D,Z=>{if((Z==null?void 0:Z.key)==null)return;const ne=h(M,String(Z.key)),de=Z.props["data-grid"];ne&&de==null?j.push(y(ne)):de?j.push(y({...de,i:Z.key})):j.push(y({w:1,h:1,x:0,y:n(j),i:String(Z.key)}))});const J=R(j,{cols:N});return K?J:I(J,k,N)}function Te(M){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(M))throw new Error(D+" must be an array!");for(let k=0,K=M.length;k<K;k++){const j=M[k];for(let J=0;J<N.length;J++){const Z=N[J],ne=j[Z];if(typeof ne!="number"||Number.isNaN(ne))throw new Error(`ReactGridLayout: ${D}[${k}].${Z} must be a number! Received: ${ne} (${typeof ne})`)}if(typeof j.i<"u"&&typeof j.i!="string")throw new Error(`ReactGridLayout: ${D}[${k}].i must be a string! Received: ${j.i} (${typeof j.i})`)}}function B(M){const{verticalCompact:D,compactType:N}=M||{};return D===!1?null:N}function Q(){}const le=()=>{};return ie.noop=le,ie}var we={},xn;function on(){if(xn)return we;xn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.calcGridColWidth=e,we.calcGridItemPosition=r,we.calcGridItemWHPx=t,we.calcWH=a,we.calcXY=n,we.clamp=o;function e(u){const{margin:y,containerPadding:p,containerWidth:b,cols:m}=u;return(b-y[0]*(m-1)-p[0]*2)/m}function t(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function r(u,y,p,b,m,I){const{margin:_,containerPadding:w,rowHeight:C}=u,R=e(u),h={};return I&&I.resizing?(h.width=Math.round(I.resizing.width),h.height=Math.round(I.resizing.height)):(h.width=t(b,R,_[0]),h.height=t(m,C,_[1])),I&&I.dragging?(h.top=Math.round(I.dragging.top),h.left=Math.round(I.dragging.left)):I&&I.resizing&&typeof I.resizing.top=="number"&&typeof I.resizing.left=="number"?(h.top=Math.round(I.resizing.top),h.left=Math.round(I.resizing.left)):(h.top=Math.round((C+_[1])*p+w[1]),h.left=Math.round((R+_[0])*y+w[0])),h}function n(u,y,p,b,m){const{margin:I,containerPadding:_,cols:w,rowHeight:C,maxRows:R}=u,h=e(u);let i=Math.round((p-_[0])/(h+I[0])),s=Math.round((y-_[1])/(C+I[1]));return i=o(i,0,w-b),s=o(s,0,R-m),{x:i,y:s}}function a(u,y,p,b,m,I){const{margin:_,maxRows:w,cols:C,rowHeight:R}=u,h=e(u);let i=Math.round((y+_[0])/(h+_[0])),s=Math.round((p+_[1])/(R+_[1])),d=o(i,0,C-b),S=o(s,0,w-m);return["sw","w","nw"].indexOf(I)!==-1&&(d=o(i,0,C)),["nw","n","ne"].indexOf(I)!==-1&&(S=o(s,0,w)),{w:d,h:S}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return we}var Qe={},sn={exports:{}},ln,Nn;function Gr(){if(Nn)return ln;Nn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ln=e,ln}var cn,Ln;function qr(){if(Ln)return cn;Ln=1;var e=Gr();function t(){}function r(){}return r.resetWarningCache=t,cn=function(){function n(u,y,p,b,m,I){if(I!==e){var _=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 _.name="Invariant Violation",_}}n.isRequired=n;function a(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o},cn}var Un;function Ee(){return Un||(Un=1,sn.exports=qr()()),sn.exports}var et={exports:{}},un={};function Vn(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Vn(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function zn(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Vn(e))&&(n&&(n+=" "),n+=t);return n}const Xr=En(Object.freeze(Object.defineProperty({__proto__:null,clsx:zn,default:zn},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},kn;function wt(){if(kn)return Oe;kn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=e,Oe.int=n,Oe.isFunction=t,Oe.isNum=r;function e(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function t(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function r(o){return typeof o=="number"&&!isNaN(o)}function n(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 Me={},An;function Yr(){if(An)return Me;An=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.browserPrefixToKey=r,Me.browserPrefixToStyle=n,Me.default=void 0,Me.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){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<e.length;p++)if(r(u,e[p])in y)return e[p];return""}function r(o,u){return u?"".concat(u).concat(a(o)):o}function n(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 Me.default=t(),Me}var Wn;function dn(){if(Wn)return pe;Wn=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=d,pe.createCSSTransform=C,pe.createSVGTransform=R,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=I,pe.innerWidth=_,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=w,pe.outerHeight=b,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=S;var e=wt(),t=n(Yr());function r(f){if(typeof WeakMap!="function")return null;var v=new WeakMap,P=new WeakMap;return(r=function(U){return U?P:v})(f)}function n(f,v){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var P=r(v);if(P&&P.has(f))return P.get(f);var U={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in f)if(V!=="default"&&Object.prototype.hasOwnProperty.call(f,V)){var O=z?Object.getOwnPropertyDescriptor(f,V):null;O&&(O.get||O.set)?Object.defineProperty(U,V,O):U[V]=f[V]}return U.default=f,P&&P.set(f,U),U}let a="";function o(f,v){return a||(a=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(f[P])})),(0,e.isFunction)(f[a])?f[a](v):!1}function u(f,v,P){let U=f;do{if(o(U,v))return!0;if(U===P)return!1;U=U.parentNode}while(U);return!1}function y(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.addEventListener?f.addEventListener(v,P,z):f.attachEvent?f.attachEvent("on"+v,P):f["on"+v]=P}function p(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.removeEventListener?f.removeEventListener(v,P,z):f.detachEvent?f.detachEvent("on"+v,P):f["on"+v]=null}function b(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,e.int)(P.borderTopWidth),v+=(0,e.int)(P.borderBottomWidth),v}function m(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,e.int)(P.borderLeftWidth),v+=(0,e.int)(P.borderRightWidth),v}function I(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,e.int)(P.paddingTop),v-=(0,e.int)(P.paddingBottom),v}function _(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,e.int)(P.paddingLeft),v-=(0,e.int)(P.paddingRight),v}function w(f,v,P){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),V=(f.clientX+v.scrollLeft-z.left)/P,O=(f.clientY+v.scrollTop-z.top)/P;return{x:V,y:O}}function C(f,v){const P=h(f,v,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function R(f,v){return h(f,v,"")}function h(f,v,P){let{x:U,y:z}=f,V="translate(".concat(U).concat(P,",").concat(z).concat(P,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+P),x="".concat(typeof v.y=="string"?v.y:v.y+P);V="translate(".concat(O,", ").concat(x,")")+V}return V}function i(f,v){return f.targetTouches&&(0,e.findInArray)(f.targetTouches,P=>v===P.identifier)||f.changedTouches&&(0,e.findInArray)(f.changedTouches,P=>v===P.identifier)}function s(f){if(f.targetTouches&&f.targetTouches[0])return f.targetTouches[0].identifier;if(f.changedTouches&&f.changedTouches[0])return f.changedTouches[0].identifier}function d(f){if(!f)return;let v=f.getElementById("react-draggable-style-el");v||(v=f.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
10
|
+
(function($,T){typeof exports=="object"&&typeof module<"u"?T(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"],T):($=typeof globalThis<"u"?globalThis:$||self,T($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,T,c,q,ee,_,L,re,Gt,fe,Cn,Ce,Ge,Tn,qe){"use strict";var Ro=Object.defineProperty;var _o=($,T,c)=>T in $?Ro($,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[T]=c;var De=($,T,c)=>_o($,typeof T!="symbol"?T+"":T,c);const qt={type:T.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(T.ICommandService),p=t.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,E=u.createCfId(m,I),w={ranges:r,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},Xe={type:T.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(T.IUndoRedoService),a=t.get(T.ICommandService),o=t.get(c.ConditionalFormattingRuleModel),u=t.get(T.IUniverInstanceService),y=q.getSheetCommandTarget(u);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=o.createCfId(p,b),I={unitId:p,subUnitId:b,rule:{...r,cfId:r.cfId||m}},E=c.AddConditionalRuleMutationUndoFactory(t,I),w=a.syncExecuteCommand(c.AddConditionalRuleMutation.id,I);return w&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:I}],undoMutations:[E]}),w}},Xt={type:T.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(T.ICommandService),y=t.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:E})}},Yt={type:T.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:b}=e,m=t.get(c.ConditionalFormattingRuleModel),I=t.get(T.IUniverInstanceService),E=q.getSheetCommandTarget(I);if(!E)return!1;const{unitId:w,subUnitId:C}=E,R=t.get(T.ICommandService),h=m.createCfId(w,C),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return R.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:C,rule:i})}},Kt={type:T.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(T.ICommandService),y=t.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:E})}},$t={type:T.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(T.ICommandService),b=t.get(T.IUniverInstanceService),m=q.getSheetCommandTarget(b);if(!m)return!1;const{unitId:I,subUnitId:E}=m,w=y.createCfId(I,E);let C;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const R=u;if(R.length!==2||!Array.isArray(R))return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}else{const R=u;if(typeof R!="number")return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:E,rule:C})}},Zt={type:T.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),b=t.get(T.IUniverInstanceService),m=t.get(T.ICommandService),I=q.getSheetCommandTarget(b);if(!I)return!1;const{unitId:E,subUnitId:w}=I,C=p.createCfId(E,w),R={ranges:r,cfId:C,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:n,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:w,rule:R})}},Jt={type:T.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,E=t.get(T.ICommandService),w=y.createCfId(m,I),C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:n,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:C})}},Qt={type:T.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(T.IUniverInstanceService),p=t.get(T.ICommandService),b=q.getSheetCommandTarget(y);if(!b)return!1;const{unitId:m,subUnitId:I}=b,E=u.createCfId(m,I),w={ranges:r,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},en={type:T.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(T.IUniverInstanceService),y=t.get(T.ICommandService),p=q.getSheetCommandTarget(u);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),E={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:E})}},yt={type:T.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var R;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(T.IUniverInstanceService),a=t.get(T.ICommandService),o=t.get(T.IUndoRedoService),u=t.get(q.SheetsSelectionsService),y=q.getSheetCommandTarget(n,e);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=((R=u.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],I=r.getSubunitRules(p,b);if(!(I!=null&&I.length)||!m.length)return!1;const E=[],w=[];I.forEach(h=>{const i=new T.ObjectMatrix;h.ranges.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.setValue(S,l,1)})}),m.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.realDeleteValue(S,l)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},S={unitId:p,subUnitId:b,rule:d},l=c.setConditionalRuleMutationUndoFactory(t,S);E.push({id:c.SetConditionalRuleMutation.id,params:S}),w.push(...l)}else{const d={unitId:p,subUnitId:b,cfId:h.cfId},S=c.DeleteConditionalRuleMutationUndoFactory(t,d);E.push({id:c.DeleteConditionalRuleMutation.id,params:d}),w.push(...S)}});const C=T.sequenceExecute(E,a).result;return C&&o.pushUndoRedo({unitID:p,redoMutations:E,undoMutations:w}),C}},Ye={type:T.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(T.IUniverInstanceService),a=t.get(T.ICommandService),o=t.get(T.IUndoRedoService),u=q.getSheetCommandTarget(n,e);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=r.getSubunitRules(y,p);if(!(b!=null&&b.length))return!1;const m=b.map(C=>({cfId:C.cfId,unitId:y,subUnitId:p})),I=m.map(C=>({id:c.DeleteConditionalRuleMutation.id,params:C})),E=m.map(C=>c.DeleteConditionalRuleMutationUndoFactory(t,C)[0]),w=T.sequenceExecute(I,a).result;return w&&o.pushUndoRedo({unitID:y,redoMutations:I,undoMutations:E}),w}},Ke={type:T.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,cfId:e.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},St={type:T.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),u=q.getSheetCommandTarget(a,e);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=c.transformSupportSymmetryAnchor(e.start,e.end,o.getSubunitRules(y,p)||[],R=>R.cfId);if(!b)return!1;const[m,I]=b,E={unitId:y,subUnitId:p,start:m,end:I},w=c.MoveConditionalRuleMutationUndoFactory(E),C=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,E);return C&&r.pushUndoRedo({unitID:y,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:E}],undoMutations:w}),C}},bt={type:T.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(T.IUndoRedoService),n=t.get(T.ICommandService),a=t.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,e);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,rule:e.rule},b=c.setConditionalRuleMutationUndoFactory(t,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}},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 Se=function(){return Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},Se.apply(this,arguments)},Nr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(r[n[a]]=t[n[a]]);return r},Ve=L.forwardRef(function(t,e){var r=t.icon,n=t.id,a=t.className,o=t.extend,u=Nr(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),p=L.useRef("_".concat(Vr()));return In(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:e,className:y},u),o)});function In(t,e,r,n,a){return L.createElement(t.tag,Se(Se({key:e},Lr(t,r,a)),n),(Ur(t,r).children||[]).map(function(o,u){return In(o,"".concat(e,"-").concat(t.tag,"-").concat(u),r,void 0,a)}))}function Lr(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),t.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Ur(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Se(Se({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.indexOf(a.attrs.id)>-1?Se(Se({},a),{attrs:Se(Se({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function Vr(){return Math.random().toString(36).substring(2,8)}Ve.displayName="UniverIcon";var zr={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"}}]},Ct=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"delete-single",ref:e,icon:zr}))});Ct.displayName="DeleteSingle";var kr={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"}}]},wn=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"increase-single",ref:e,icon:kr}))});wn.displayName="IncreaseSingle";var Ar={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"}}]},Tt=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"more-down-single",ref:e,icon:Ar}))});Tt.displayName="MoreDownSingle";var Wr={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"}}]}]},Rn=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"sequence-single",ref:e,icon:Wr}))});Rn.displayName="SequenceSingle";var jr={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"}}]}]},$e=L.forwardRef(function(t,e){return L.createElement(Ve,Object.assign({},t,{id:"slash-single",ref:e,icon:jr}))});$e.displayName="SlashSingle";function Hr(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _n(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var a=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return t[n]}})}),r}var tn={exports:{}},Ze={},Je={exports:{}},Br=Je.exports,En;function nn(){return En||(En=1,function(t,e){(function(r,n){n(e)})(Br,function(r){function n(B){return function(le,M,D,N,k,K,j){return B(le,M,j)}}function a(B){return function(le,M,D,N){if(!le||!M||typeof le!="object"||typeof M!="object")return B(le,M,D,N);var k=N.get(le),K=N.get(M);if(k&&K)return k===M&&K===le;N.set(le,M),N.set(M,le);var j=B(le,M,D,N);return N.delete(le),N.delete(M),j}}function o(B,Q){var le={};for(var M in B)le[M]=B[M];for(var M in Q)le[M]=Q[M];return le}function u(B){return B.constructor===Object||B.constructor==null}function y(B){return typeof B.then=="function"}function p(B,Q){return B===Q||B!==B&&Q!==Q}var b="[object Arguments]",m="[object Boolean]",I="[object Date]",E="[object RegExp]",w="[object Map]",C="[object Number]",R="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(B){var Q=B.areArraysEqual,le=B.areDatesEqual,M=B.areMapsEqual,D=B.areObjectsEqual,N=B.areRegExpsEqual,k=B.areSetsEqual,K=B.createIsNestedEqual,j=K(J);function J(Z,ne,de){if(Z===ne)return!0;if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return Z!==Z&&ne!==ne;if(u(Z)&&u(ne))return D(Z,ne,j,de);var Le=Array.isArray(Z),be=Array.isArray(ne);if(Le||be)return Le===be&&Q(Z,ne,j,de);var ve=s.call(Z);return ve!==s.call(ne)?!1:ve===I?le(Z,ne,j,de):ve===E?N(Z,ne,j,de):ve===w?M(Z,ne,j,de):ve===h?k(Z,ne,j,de):ve===R||ve===b?y(Z)||y(ne)?!1:D(Z,ne,j,de):ve===m||ve===C||ve===i?p(Z.valueOf(),ne.valueOf()):!1}return J}function S(B,Q,le,M){var D=B.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!le(B[D],Q[D],D,D,B,Q,M))return!1;return!0}var l=a(S);function g(B,Q){return p(B.valueOf(),Q.valueOf())}function f(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={},k=0;return B.forEach(function(K,j){if(D){var J=!1,Z=0;Q.forEach(function(ne,de){!J&&!N[Z]&&(J=le(j,de,k,Z,B,Q,M)&&le(K,ne,j,de,B,Q,M))&&(N[Z]=!0),Z++}),k++,D=J}}),D}var v=a(f),P="_owner",U=Object.prototype.hasOwnProperty;function z(B,Q,le,M){var D=Object.keys(B),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===P){var K=!!B.$$typeof,j=!!Q.$$typeof;if((K||j)&&K!==j)return!1}if(!U.call(Q,k)||!le(B[k],Q[k],k,k,B,Q,M))return!1}return!0}var V=a(z);function O(B,Q){return B.source===Q.source&&B.flags===Q.flags}function x(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={};return B.forEach(function(k,K){if(D){var j=!1,J=0;Q.forEach(function(Z,ne){!j&&!N[J]&&(j=le(k,Z,K,ne,B,Q,M))&&(N[J]=!0),J++}),D=j}}),D}var W=a(x),X=Object.freeze({areArraysEqual:S,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:x,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:V,areRegExpsEqual:O,areSetsEqual:W,createIsNestedEqual:n}),ae=d(X);function te(B,Q){return ae(B,Q,void 0)}var F=d(o(X,{createIsNestedEqual:function(){return p}}));function H(B,Q){return F(B,Q,void 0)}var oe=d(Y);function se(B,Q){return oe(B,Q,new WeakMap)}var ue=d(o(Y,{createIsNestedEqual:function(){return p}}));function ge(B,Q){return ue(B,Q,new WeakMap)}function ye(B){return d(o(X,B(X)))}function Te(B){var Q=d(o(Y,B(Y)));return function(le,M,D){return D===void 0&&(D=new WeakMap),Q(le,M,D)}}r.circularDeepEqual=se,r.circularShallowEqual=ge,r.createCustomCircularEqual=Te,r.createCustomEqual=ye,r.deepEqual=te,r.sameValueZeroEqual=p,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Je,Je.exports)),Je.exports}var It={exports:{}},On;function rn(){if(On)return It.exports;On=1;function t(r){var n,a,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(a=t(r[n]))&&(o&&(o+=" "),o+=a)}else for(a in r)r[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var r,n,a=0,o="",u=arguments.length;a<u;a++)(r=arguments[a])&&(n=t(r))&&(o&&(o+=" "),o+=n);return o}return It.exports=e,It.exports.clsx=e,It.exports}var ie={},an,Mn;function Fr(){return Mn||(Mn=1,an=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),an}var Dn;function ze(){if(Dn)return ie;Dn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=a,ie.cloneLayoutItem=y,ie.collides=m,ie.compact=I,ie.compactItem=C,ie.compactType=B,ie.correctBounds=R,ie.fastPositionEqual=b,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=i,ie.getLayoutItem=h,ie.getStatics=d,ie.modifyLayout=o,ie.moveElement=S,ie.moveElementAwayFromCollision=l,ie.noop=void 0,ie.perc=g,ie.resizeItemInDirection=F,ie.setTopLeft=oe,ie.setTransform=H,ie.sortLayoutItems=se,ie.sortLayoutItemsByColRow=ge,ie.sortLayoutItemsByRowCol=ue,ie.synchronizeLayoutWithChildren=ye,ie.validateLayout=Te,ie.withLayoutItem=u;var t=nn(),e=r(L);function r(M){return M&&M.__esModule?M:{default:M}}function n(M){let D=0,N;for(let k=0,K=M.length;k<K;k++)N=M[k].y+M[k].h,N>D&&(D=N);return D}function a(M){const D=Array(M.length);for(let N=0,k=M.length;N<k;N++)D[N]=y(M[N]);return D}function o(M,D){const N=Array(M.length);for(let k=0,K=M.length;k<K;k++)D.i===M[k].i?N[k]=D:N[k]=M[k];return N}function u(M,D,N){let k=h(M,D);return k?(k=N(y(k)),M=o(M,k),[M,k]):[M,null]}function y(M){return{w:M.w,h:M.h,x:M.x,y:M.y,i:M.i,minW:M.minW,maxW:M.maxW,minH:M.minH,maxH:M.maxH,moved:!!M.moved,static:!!M.static,isDraggable:M.isDraggable,isResizable:M.isResizable,resizeHandles:M.resizeHandles,isBounded:M.isBounded}}function p(M,D){return(0,t.deepEqual)(e.default.Children.map(M,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(M,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}ie.fastRGLPropsEqual=Fr();function b(M,D){return M.left===D.left&&M.top===D.top&&M.width===D.width&&M.height===D.height}function m(M,D){return!(M.i===D.i||M.x+M.w<=D.x||M.x>=D.x+D.w||M.y+M.h<=D.y||M.y>=D.y+D.h)}function I(M,D,N,k){const K=d(M),j=se(M,D),J=Array(M.length);for(let Z=0,ne=j.length;Z<ne;Z++){let de=y(j[Z]);de.static||(de=C(K,de,D,N,j,k),K.push(de)),J[M.indexOf(j[Z])]=de,de.moved=!1}return J}const E={x:"w",y:"h"};function w(M,D,N,k){const K=E[k];D[k]+=1;const j=M.map(J=>J.i).indexOf(D.i);for(let J=j+1;J<M.length;J++){const Z=M[J];if(!Z.static){if(Z.y>D.y+D.h)break;m(D,Z)&&w(M,Z,N+D[K],k)}}D[k]=N}function C(M,D,N,k,K,j){const J=N==="vertical",Z=N==="horizontal";if(J)for(D.y=Math.min(n(M),D.y);D.y>0&&!i(M,D);)D.y--;else if(Z)for(;D.x>0&&!i(M,D);)D.x--;let ne;for(;(ne=i(M,D))&&!(N===null&&j);)if(Z?w(K,D,ne.x+ne.w,"x"):w(K,D,ne.y+ne.h,"y"),Z&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(M,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function R(M,D){const N=d(M);for(let k=0,K=M.length;k<K;k++){const j=M[k];if(j.x+j.w>D.cols&&(j.x=D.cols-j.w),j.x<0&&(j.x=0,j.w=D.cols),!j.static)N.push(j);else for(;i(N,j);)j.y++}return M}function h(M,D){for(let N=0,k=M.length;N<k;N++)if(M[N].i===D)return M[N]}function i(M,D){for(let N=0,k=M.length;N<k;N++)if(m(M[N],D))return M[N]}function s(M,D){return M.filter(N=>m(N,D))}function d(M){return M.filter(D=>D.static)}function S(M,D,N,k,K,j,J,Z,ne){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return M;`${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 be=se(M,J);(J==="vertical"&&typeof k=="number"?Le>=k:J==="horizontal"&&typeof N=="number"?de>=N:!1)&&(be=be.reverse());const Fe=s(be,D),Ft=Fe.length>0;if(Ft&&ne)return a(M);if(Ft&&j)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,M;for(let bn=0,wo=Fe.length;bn<wo;bn++){const Ue=Fe[bn];`${D.i}${D.x}${D.y}${Ue.i}${Ue.x}${Ue.y}`,!Ue.moved&&(Ue.static?M=l(M,Ue,D,K,J):M=l(M,D,Ue,K,J))}return M}function l(M,D,N,k,K,j){const J=K==="horizontal",Z=K==="vertical",ne=D.static;if(k){k=!1;const be={x:J?Math.max(D.x-N.w,0):N.x,y:Z?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(M,be),Fe=ve&&ve.y+ve.h>D.y,Ft=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&Z)return S(M,N,void 0,D.y+1,k,ne,K);if(Fe&&K==null)return D.y=N.y,N.y=N.y+N.h,M;if(Ft&&J)return S(M,D,N.x,void 0,k,ne,K)}else return`${N.i}${be.x}${be.y}`,S(M,N,J?be.x:void 0,Z?be.y:void 0,k,ne,K)}const de=J?N.x+1:void 0,Le=Z?N.y+1:void 0;return de==null&&Le==null?M:S(M,N,J?N.x+1:void 0,Z?N.y+1:void 0,k,ne,K)}function g(M){return M*100+"%"}const f=(M,D,N,k)=>M+N>k?D:N,v=(M,D,N)=>M<0?D:N,P=M=>Math.max(0,M),U=M=>Math.max(0,M),z=(M,D,N)=>{let{left:k,height:K,width:j}=D;const J=M.top-(K-M.height);return{left:k,width:j,height:v(J,M.height,K),top:U(J)}},V=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{top:k,height:j,width:f(M.left,M.width,J,N),left:P(K)}},O=(M,D,N)=>{let{top:k,height:K,width:j}=D;const J=M.left-(j-M.width);return{height:K,width:J<0?M.width:f(M.left,M.width,j,N),top:U(k),left:P(J)}},x=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{width:J,left:K,height:v(k,M.height,j),top:U(k)}},te={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],V(...arguments))},e:V,se:function(){return x(arguments.length<=0?void 0:arguments[0],V(...arguments))},s:x,sw:function(){return x(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(M,D,N,k){const K=te[M];return K?K(D,{...D,...N},k):N}function H(M){let{top:D,left:N,width:k,height:K}=M;const j=`translate(${N}px,${D}px)`;return{transform:j,WebkitTransform:j,MozTransform:j,msTransform:j,OTransform:j,width:`${k}px`,height:`${K}px`,position:"absolute"}}function oe(M){let{top:D,left:N,width:k,height:K}=M;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${K}px`,position:"absolute"}}function se(M,D){return D==="horizontal"?ge(M):D==="vertical"?ue(M):M}function ue(M){return M.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(M){return M.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(M,D,N,k,K){M=M||[];const j=[];e.default.Children.forEach(D,Z=>{if((Z==null?void 0:Z.key)==null)return;const ne=h(M,String(Z.key)),de=Z.props["data-grid"];ne&&de==null?j.push(y(ne)):de?j.push(y({...de,i:Z.key})):j.push(y({w:1,h:1,x:0,y:n(j),i:String(Z.key)}))});const J=R(j,{cols:N});return K?J:I(J,k,N)}function Te(M){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(M))throw new Error(D+" must be an array!");for(let k=0,K=M.length;k<K;k++){const j=M[k];for(let J=0;J<N.length;J++){const Z=N[J],ne=j[Z];if(typeof ne!="number"||Number.isNaN(ne))throw new Error(`ReactGridLayout: ${D}[${k}].${Z} must be a number! Received: ${ne} (${typeof ne})`)}if(typeof j.i<"u"&&typeof j.i!="string")throw new Error(`ReactGridLayout: ${D}[${k}].i must be a string! Received: ${j.i} (${typeof j.i})`)}}function B(M){const{verticalCompact:D,compactType:N}=M||{};return D===!1?null:N}function Q(){}const le=()=>{};return ie.noop=le,ie}var we={},Pn;function on(){if(Pn)return we;Pn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.calcGridColWidth=t,we.calcGridItemPosition=r,we.calcGridItemWHPx=e,we.calcWH=a,we.calcXY=n,we.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:b,cols:m}=u;return(b-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 r(u,y,p,b,m,I){const{margin:E,containerPadding:w,rowHeight:C}=u,R=t(u),h={};return I&&I.resizing?(h.width=Math.round(I.resizing.width),h.height=Math.round(I.resizing.height)):(h.width=e(b,R,E[0]),h.height=e(m,C,E[1])),I&&I.dragging?(h.top=Math.round(I.dragging.top),h.left=Math.round(I.dragging.left)):I&&I.resizing&&typeof I.resizing.top=="number"&&typeof I.resizing.left=="number"?(h.top=Math.round(I.resizing.top),h.left=Math.round(I.resizing.left)):(h.top=Math.round((C+E[1])*p+w[1]),h.left=Math.round((R+E[0])*y+w[0])),h}function n(u,y,p,b,m){const{margin:I,containerPadding:E,cols:w,rowHeight:C,maxRows:R}=u,h=t(u);let i=Math.round((p-E[0])/(h+I[0])),s=Math.round((y-E[1])/(C+I[1]));return i=o(i,0,w-b),s=o(s,0,R-m),{x:i,y:s}}function a(u,y,p,b,m,I){const{margin:E,maxRows:w,cols:C,rowHeight:R}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(R+E[1])),d=o(i,0,C-b),S=o(s,0,w-m);return["sw","w","nw"].indexOf(I)!==-1&&(d=o(i,0,C)),["nw","n","ne"].indexOf(I)!==-1&&(S=o(s,0,w)),{w:d,h:S}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return we}var Qe={},sn={exports:{}},ln,xn;function Gr(){if(xn)return ln;xn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ln=t,ln}var cn,Nn;function qr(){if(Nn)return cn;Nn=1;var t=Gr();function e(){}function r(){}return r.resetWarningCache=e,cn=function(){function n(u,y,p,b,m,I){if(I!==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}}n.isRequired=n;function a(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:e};return o.PropTypes=o,o},cn}var Ln;function Ee(){return Ln||(Ln=1,sn.exports=qr()()),sn.exports}var et={exports:{}},un={};function Un(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Un(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Vn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Un(t))&&(n&&(n+=" "),n+=e);return n}const Xr=_n(Object.freeze(Object.defineProperty({__proto__:null,clsx:Vn,default:Vn},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},zn;function wt(){if(zn)return Oe;zn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=n,Oe.isFunction=e,Oe.isNum=r;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 r(o){return typeof o=="number"&&!isNaN(o)}function n(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 Me={},kn;function Yr(){if(kn)return Me;kn=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.browserPrefixToKey=r,Me.browserPrefixToStyle=n,Me.default=void 0,Me.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(r(u,t[p])in y)return t[p];return""}function r(o,u){return u?"".concat(u).concat(a(o)):o}function n(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 Me.default=e(),Me}var An;function dn(){if(An)return pe;An=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=d,pe.createCSSTransform=C,pe.createSVGTransform=R,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=I,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=w,pe.outerHeight=b,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=S;var t=wt(),e=n(Yr());function r(f){if(typeof WeakMap!="function")return null;var v=new WeakMap,P=new WeakMap;return(r=function(U){return U?P:v})(f)}function n(f,v){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var P=r(v);if(P&&P.has(f))return P.get(f);var U={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in f)if(V!=="default"&&Object.prototype.hasOwnProperty.call(f,V)){var O=z?Object.getOwnPropertyDescriptor(f,V):null;O&&(O.get||O.set)?Object.defineProperty(U,V,O):U[V]=f[V]}return U.default=f,P&&P.set(f,U),U}let a="";function o(f,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,t.isFunction)(f[P])})),(0,t.isFunction)(f[a])?f[a](v):!1}function u(f,v,P){let U=f;do{if(o(U,v))return!0;if(U===P)return!1;U=U.parentNode}while(U);return!1}function y(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.addEventListener?f.addEventListener(v,P,z):f.attachEvent?f.attachEvent("on"+v,P):f["on"+v]=P}function p(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.removeEventListener?f.removeEventListener(v,P,z):f.detachEvent?f.detachEvent("on"+v,P):f["on"+v]=null}function b(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(P.borderTopWidth),v+=(0,t.int)(P.borderBottomWidth),v}function m(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,t.int)(P.borderLeftWidth),v+=(0,t.int)(P.borderRightWidth),v}function I(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(P.paddingTop),v-=(0,t.int)(P.paddingBottom),v}function E(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,t.int)(P.paddingLeft),v-=(0,t.int)(P.paddingRight),v}function w(f,v,P){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),V=(f.clientX+v.scrollLeft-z.left)/P,O=(f.clientY+v.scrollTop-z.top)/P;return{x:V,y:O}}function C(f,v){const P=h(f,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:P}}function R(f,v){return h(f,v,"")}function h(f,v,P){let{x:U,y:z}=f,V="translate(".concat(U).concat(P,",").concat(z).concat(P,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+P),x="".concat(typeof v.y=="string"?v.y:v.y+P);V="translate(".concat(O,", ").concat(x,")")+V}return V}function i(f,v){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,P=>v===P.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,P=>v===P.identifier)}function s(f){if(f.targetTouches&&f.targetTouches[0])return f.targetTouches[0].identifier;if(f.changedTouches&&f.changedTouches[0])return f.changedTouches[0].identifier}function d(f){if(!f)return;let v=f.getElementById("react-draggable-style-el");v||(v=f.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
|
-
`,f.getElementsByTagName("head")[0].appendChild(v)),f.body&&l(f.body,"react-draggable-transparent-selection")}function S(f){if(f)try{if(f.body&&g(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const v=(f.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(f,v){f.classList?f.classList.add(v):f.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(f.className+=" ".concat(v))}function g(f,v){f.classList?f.classList.remove(v):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var Ie={},jn;function Hn(){if(jn)return Ie;jn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=a,Ie.canDragY=o,Ie.createCoreData=y,Ie.createDraggableData=p,Ie.getBoundPosition=r,Ie.getControlPosition=u,Ie.snapToGrid=n;var e=wt(),t=dn();function r(I,_,w){if(!I.props.bounds)return[_,w];let{bounds:C}=I.props;C=typeof C=="string"?C:b(C);const R=m(I);if(typeof C=="string"){const{ownerDocument:h}=R,i=h.defaultView;let s;if(C==="parent"?s=R.parentNode:s=h.querySelector(C),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const d=s,S=i.getComputedStyle(R),l=i.getComputedStyle(d);C={left:-R.offsetLeft+(0,e.int)(l.paddingLeft)+(0,e.int)(S.marginLeft),top:-R.offsetTop+(0,e.int)(l.paddingTop)+(0,e.int)(S.marginTop),right:(0,t.innerWidth)(d)-(0,t.outerWidth)(R)-R.offsetLeft+(0,e.int)(l.paddingRight)-(0,e.int)(S.marginRight),bottom:(0,t.innerHeight)(d)-(0,t.outerHeight)(R)-R.offsetTop+(0,e.int)(l.paddingBottom)-(0,e.int)(S.marginBottom)}}return(0,e.isNum)(C.right)&&(_=Math.min(_,C.right)),(0,e.isNum)(C.bottom)&&(w=Math.min(w,C.bottom)),(0,e.isNum)(C.left)&&(_=Math.max(_,C.left)),(0,e.isNum)(C.top)&&(w=Math.max(w,C.top)),[_,w]}function n(I,_,w){const C=Math.round(_/I[0])*I[0],R=Math.round(w/I[1])*I[1];return[C,R]}function a(I){return I.props.axis==="both"||I.props.axis==="x"}function o(I){return I.props.axis==="both"||I.props.axis==="y"}function u(I,_,w){const C=typeof _=="number"?(0,t.getTouch)(I,_):null;if(typeof _=="number"&&!C)return null;const R=m(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,t.offsetXYFromParent)(C||I,h,w.props.scale)}function y(I,_,w){const C=!(0,e.isNum)(I.lastX),R=m(I);return C?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:w,x:_,y:w}:{node:R,deltaX:_-I.lastX,deltaY:w-I.lastY,lastX:I.lastX,lastY:I.lastY,x:_,y:w}}function p(I,_){const w=I.props.scale;return{node:_.node,x:I.state.x+_.deltaX/w,y:I.state.y+_.deltaY/w,deltaX:_.deltaX/w,deltaY:_.deltaY/w,lastX:I.state.x,lastY:I.state.y}}function b(I){return{left:I.left,top:I.top,right:I.right,bottom:I.bottom}}function m(I){const _=I.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Ie}var tt={},Rt={},Bn;function Fn(){if(Bn)return Rt;Bn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=e;function e(){}return Rt}var Gn;function Kr(){if(Gn)return tt;Gn=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var e=b(L),t=y(Ee()),r=y(Tn),n=dn(),a=Hn(),o=wt(),u=y(Fn());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(d){return d?s:i})(h)}function b(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 d={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=w.mouse,R=class extends e.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:d}=s;if(this.props.disabled||!(i.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const S=(0,n.getTouchIdentifier)(i);this.touchIdentifier=S;const l=(0,a.getControlPosition)(i,S,this);if(l==null)return;const{x:g,y:f}=l,v=(0,a.createCoreData)(this,g,f);(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,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=f,(0,n.addEvent)(d,C.move,this.handleDrag),(0,n.addEvent)(d,C.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,v=S-this.lastY;if([f,v]=(0,a.snapToGrid)(this.props.grid,f,v),!f&&!v)return;d=this.lastX+f,S=this.lastY+v}const l=(0,a.createCoreData)(this,d,S);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=d,this.lastY=S}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let v=d-this.lastX||0,P=S-this.lastY||0;[v,P]=(0,a.snapToGrid)(this.props.grid,v,P),d=this.lastX+v,S=this.lastY+P}const l=(0,a.createCoreData)(this,d,S);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,u.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,C.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,C.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(C=w.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(C=w.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(C=w.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(C=w.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,n.addEvent)(i,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(i,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.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:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return tt.default=R,m(R,"displayName","DraggableCore"),m(R,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.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:t.default.arrayOf(t.default.number),handle:t.default.string,cancel: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,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),tt}var qn;function $r(){return qn||(qn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),e.default=void 0;var t=_(L),r=m(Ee()),n=m(Tn),a=m(Xr),o=dn(),u=Hn(),y=wt(),p=m(Kr()),b=m(Fn());function m(s){return s&&s.__esModule?s:{default:s}}function I(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(I=function(l){return l?S:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=I(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},w.apply(this,arguments)}function C(s,d,S){return d=R(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function R(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class i extends t.Component{static getDerivedStateFromProps(d,S){let{position:l}=d,{prevPropsPosition:g}=S;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),C(this,"onDragStart",(S,l)=>{if((0,b.default)("Draggable: onDragStart: %j",l),this.props.onStart(S,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(S,l)=>{if(!this.state.dragging)return!1;(0,b.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),f={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:U}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[z,V]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=z,f.y=V,f.slackX=this.state.slackX+(P-f.x),f.slackY=this.state.slackY+(U-f.y),g.x=f.x,g.y=f.y,g.deltaX=f.x-this.state.x,g.deltaY=f.y-this.state.y}if(this.props.onDrag(S,g)===!1)return!1;this.setState(f)}),C(this,"onDragStop",(S,l)=>{if(!this.state.dragging||this.props.onStop(S,(0,u.createDraggableData)(this,l))===!1)return!1;(0,b.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:U}=this.props.position;f.x=P,f.y=U}this.setState(f)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.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 d,S;return(d=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:S,children:l,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:v,defaultClassNameDragged:P,position:U,positionOffset:z,scale:V,...O}=this.props;let x={},W=null;const Y=!!!U||this.state.dragging,re=U||g,te={x:(0,u.canDragX)(this)&&Y?this.state.x:re.x,y:(0,u.canDragY)(this)&&Y?this.state.y:re.y};this.state.isElementSVG?W=(0,o.createSVGTransform)(te,z):x=(0,o.createCSSTransform)(te,z);const F=(0,a.default)(l.props.className||"",f,{[v]:this.state.dragging,[P]:this.state.dragged});return t.createElement(p.default,w({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(l),{className:F,style:{...l.props.style,...x},transform:W}))}}e.default=i,C(i,"displayName","Draggable"),C(i,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),C(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})}(un)),un}var Xn;function fn(){if(Xn)return et.exports;Xn=1;const{default:e,DraggableCore:t}=$r();return et.exports=e,et.exports.default=e,et.exports.DraggableCore=t,et.exports}var nt={exports:{}},rt={},_t={},Yn;function Zr(){if(Yn)return _t;Yn=1,_t.__esModule=!0,_t.cloneElement=y;var e=t(L);function t(p){return p&&p.__esModule?p:{default:p}}function r(p,b){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(p);b&&(I=I.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),m.push.apply(m,I)}return m}function n(p){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?r(Object(m),!0).forEach(function(I){a(p,I,m[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(I){Object.defineProperty(p,I,Object.getOwnPropertyDescriptor(m,I))})}return p}function a(p,b,m){return b=o(b),b in p?Object.defineProperty(p,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[b]=m,p}function o(p){var b=u(p,"string");return typeof b=="symbol"?b:String(b)}function u(p,b){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var I=m.call(p,b);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(p)}function y(p,b){return b.style&&p.props.style&&(b.style=n(n({},p.props.style),b.style)),b.className&&p.props.className&&(b.className=p.props.className+" "+b.className),e.default.cloneElement(p,b)}return _t}var at={},Kn;function $n(){if(Kn)return at;Kn=1,at.__esModule=!0,at.resizableProps=void 0;var e=t(Ee());fn();function t(n){return n&&n.__esModule?n:{default:n}}var r={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle: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}),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=e.default.number).isRequired.apply(p,o)}return e.default.number.apply(e.default,o)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.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=e.default.number).isRequired.apply(p,o)}return e.default.number.apply(e.default,o)}};return at.resizableProps=r,at}var Zn;function Jn(){if(Zn)return rt;Zn=1,rt.__esModule=!0,rt.default=void 0;var e=u(L),t=fn(),r=Zr(),n=$n(),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,d=new WeakMap;return(o=function(l){return l?d: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 d=o(s);if(d&&d.has(i))return d.get(i);var S={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var f=l?Object.getOwnPropertyDescriptor(i,g):null;f&&(f.get||f.set)?Object.defineProperty(S,g,f):S[g]=i[g]}return S.default=i,d&&d.set(i,S),S}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(i[S]=d[S])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},S=Object.keys(i),l,g;for(g=0;g<S.length;g++)l=S[g],!(s.indexOf(l)>=0)&&(d[l]=i[l]);return d}function b(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(i);s&&(S=S.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),d.push.apply(d,S)}return d}function m(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(S){I(i,S,d[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(S){Object.defineProperty(i,S,Object.getOwnPropertyDescriptor(d,S))})}return i}function I(i,s,d){return s=_(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function _(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 d=i[Symbol.toPrimitive];if(d!==void 0){var S=d.call(i,s);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function C(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,R(i,s)}function R(i,s){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,l){return S.__proto__=l,S},R(i,s)}var h=function(i){C(s,i);function s(){for(var S,l=arguments.length,g=new Array(l),f=0;f<l;f++)g[f]=arguments[f];return S=i.call.apply(i,[this].concat(g))||this,S.handleRefs={},S.lastHandleRect=null,S.slack=null,S}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,g){var f=this.props,v=f.minConstraints,P=f.maxConstraints,U=f.lockAspectRatio;if(!v&&!P&&!U)return[l,g];if(U){var z=this.props.width/this.props.height,V=l-this.props.width,O=g-this.props.height;Math.abs(V)>Math.abs(O*z)?g=l/z:l=g*z}var x=l,W=g,X=this.slack||[0,0],Y=X[0],re=X[1];return l+=Y,g+=re,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),P&&(l=Math.min(P[0],l),g=Math.min(P[1],g)),this.slack=[Y+(x-l),re+(W-g)],[l,g]},d.resizeHandler=function(l,g){var f=this;return function(v,P){var U=P.node,z=P.deltaX,V=P.deltaY;l==="onResizeStart"&&f.resetData();var O=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",x=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!x)){var W=g[0],X=g[g.length-1],Y=U.getBoundingClientRect();if(f.lastHandleRect!=null){if(X==="w"){var re=Y.left-f.lastHandleRect.left;z+=re}if(W==="n"){var te=Y.top-f.lastHandleRect.top;V+=te}}f.lastHandleRect=Y,X==="w"&&(z=-z),W==="n"&&(V=-V);var F=f.props.width+(O?z/f.props.transformScale:0),H=f.props.height+(x?V/f.props.transformScale:0),oe=f.runConstraints(F,H);F=oe[0],H=oe[1];var se=F!==f.props.width||H!==f.props.height,ue=typeof f.props[l]=="function"?f.props[l]:null,ge=l==="onResize"&&!se;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:U,size:{width:F,height:H},handle:g})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,g){var f=this.props.handle;if(!f)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof f=="function")return f(l,g);var v=typeof f.type=="string",P=m({ref:g},v?{}:{handleAxis:l});return e.cloneElement(f,P)},d.render=function(){var l=this,g=this.props,f=g.children,v=g.className,P=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 U=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,r.cloneElement)(f,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(f.props.children,U.map(function(V){var O,x=(O=l.handleRefs[V])!=null?O:l.handleRefs[V]=e.createRef();return e.createElement(t.DraggableCore,y({},P,{nodeRef:x,key:"resizableHandle-"+V,onStop:l.resizeHandler("onResizeStop",V),onStart:l.resizeHandler("onResizeStart",V),onDrag:l.resizeHandler("onResize",V)}),l.renderResizeHandle(V,x))}))}))},s}(e.Component);return rt.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},rt}var ot={},Qn;function Jr(){if(Qn)return ot;Qn=1,ot.__esModule=!0,ot.default=void 0;var e=y(L),t=o(Ee()),r=o(Jn()),n=$n(),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 d=new WeakMap,S=new WeakMap;return(u=function(g){return g?S:d})(s)}function y(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=u(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},p.apply(this,arguments)}function b(s,d){var S=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),S.push.apply(S,l)}return S}function m(s){for(var d=1;d<arguments.length;d++){var S=arguments[d]!=null?arguments[d]:{};d%2?b(Object(S),!0).forEach(function(l){I(s,l,S[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(S)):b(Object(S)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(S,l))})}return s}function I(s,d,S){return d=_(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function _(s){var d=w(s,"string");return typeof d=="symbol"?d:String(d)}function w(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function C(s,d){if(s==null)return{};var S={},l=Object.keys(s),g,f;for(f=0;f<l.length;f++)g=l[f],!(d.indexOf(g)>=0)&&(S[g]=s[g]);return S}function R(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,d)}var i=function(s){R(d,s);function d(){for(var l,g=arguments.length,f=new Array(g),v=0;v<g;v++)f[v]=arguments[v];return l=s.call.apply(s,[this].concat(f))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(P,U){var z=U.size;l.props.onResize?(P.persist==null||P.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(P,U)})):l.setState(z)},l}d.getDerivedStateFromProps=function(g,f){return f.propsWidth!==g.width||f.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var S=d.prototype;return S.render=function(){var g=this.props,f=g.handle,v=g.handleSize;g.onResize;var P=g.onResizeStart,U=g.onResizeStop,z=g.draggableOpts,V=g.minConstraints,O=g.maxConstraints,x=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,re=g.transformScale,te=C(g,a);return e.createElement(r.default,{axis:W,draggableOpts:z,handle:f,handleSize:v,height:this.state.height,lockAspectRatio:x,maxConstraints:O,minConstraints:V,onResizeStart:P,onResize:this.onResize,onResizeStop:U,resizeHandles:X,transformScale:re,width:this.state.width},e.createElement("div",p({},te,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(e.Component);return ot.default=i,i.propTypes=m(m({},n.resizableProps),{},{children:t.default.element}),ot}var er;function Qr(){return er||(er=1,nt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},nt.exports.Resizable=Jn().default,nt.exports.ResizableBox=Jr().default),nt.exports}var Re={},tr;function nr(){if(tr)return Re;tr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.resizeHandleType=Re.resizeHandleAxesType=Re.default=void 0;var e=r(Ee()),t=r(L);function r(o){return o&&o.__esModule?o:{default:o}}const n=Re.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=Re.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return Re.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(o){o.verticalCompact},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:n,resizeHandle:a,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(o,u){const y=o[u],p={};t.default.Children.forEach(y,function(b){if((b==null?void 0:b.key)!=null){if(p[b.key])throw new Error('Duplicate child key "'+b.key+'" found! This will cause problems in ReactGridLayout.');p[b.key]=!0}})},innerRef:e.default.any},Re}var rr;function ea(){if(rr)return Qe;rr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var e=p(L),t=p(Ee()),r=fn(),n=Qr(),a=ze(),o=on(),u=nr(),y=p(rn());function p(w){return w&&w.__esModule?w:{default:w}}function b(w,C,R){return C=m(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function m(w){var C=I(w,"string");return typeof C=="symbol"?C:String(C)}function I(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}let _=class extends e.default.Component{constructor(){super(...arguments),b(this,"state",{resizing:null,dragging:null,className:""}),b(this,"elementRef",e.default.createRef()),b(this,"onDragStart",(C,R)=>{let{node:h}=R;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:S}=h;if(!S)return;const l=S.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,v=l.left/s,P=g.top/s,U=l.top/s;d.left=f-v+S.scrollLeft,d.top=P-U+S.scrollTop,this.setState({dragging:d});const{x:z,y:V}=(0,o.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,V,{e:C,node:h,newPosition:d})}),b(this,"onDrag",(C,R)=>{let{node:h,deltaX:i,deltaY:s}=R;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:f,w:v,h:P,containerWidth:U}=this.props,z=this.getPositionParams();if(g){const{offsetParent:W}=h;if(W){const{margin:X,rowHeight:Y,containerPadding:re}=this.props,te=W.clientHeight-(0,o.calcGridItemWHPx)(P,Y,X[1]);S=(0,o.clamp)(S-re[1],0,te);const F=(0,o.calcGridColWidth)(z),H=U-(0,o.calcGridItemWHPx)(v,F,X[0]);l=(0,o.clamp)(l-re[0],0,H)}}const V={top:S,left:l};this.setState({dragging:V});const{x:O,y:x}=(0,o.calcXY)(z,S,l,v,P);return d.call(this,f,O,x,{e:C,node:h,newPosition:V})}),b(this,"onDragStop",(C,R)=>{let{node:h}=R;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:S}=this.props,{left:l,top:g}=this.state.dragging,f={top:g,left:l};this.setState({dragging:null});const{x:v,y:P}=(0,o.calcXY)(this.getPositionParams(),g,l,s,d);return i.call(this,S,v,P,{e:C,node:h,newPosition:f})}),b(this,"onResizeStop",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStop")),b(this,"onResizeStart",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStart")),b(this,"onResize",(C,R,h)=>this.onResizeHandler(C,R,h,"onResize"))}shouldComponentUpdate(C,R){if(this.props.children!==C.children||this.props.droppingPosition!==C.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(C),C.x,C.y,C.w,C.h,R);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==C.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(C){this.moveDroppingItem(C)}moveDroppingItem(C){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const i=C.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&R.left!==i.left||R.top!==i.top;if(!s)this.onDragStart(R.e,{node:h,deltaX:R.left,deltaY:R.top});else if(d){const S=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:S,deltaY:l})}}getPositionParams(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:C.cols,containerPadding:C.containerPadding,containerWidth:C.containerWidth,margin:C.margin,maxRows:C.maxRows,rowHeight:C.rowHeight}}createStyle(C){const{usePercentages:R,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(C):(s=(0,a.setTopLeft)(C),R&&(s.left=(0,a.perc)(C.left/h),s.width=(0,a.perc)(C.width/h))),s}mixinDraggable(C,R){return e.default.createElement(r.DraggableCore,{disabled:!R,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},C)}curryResizeHandler(C,R){return(h,i)=>R(h,i,C)}mixinResizable(C,R,h){const{cols:i,minW:s,minH:d,maxW:S,maxH:l,transformScale:g,resizeHandles:f,resizeHandle:v}=this.props,P=this.getPositionParams(),U=(0,o.calcGridItemPosition)(P,0,0,i,0).width,z=(0,o.calcGridItemPosition)(P,0,0,s,d),V=(0,o.calcGridItemPosition)(P,0,0,S,l),O=[z.width,z.height],x=[Math.min(V.width,U),Math.min(V.height,1/0)];return e.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:R.width,height:R.height,minConstraints:O,maxConstraints:x,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:g,resizeHandles:f,handle:v},C)}onResizeHandler(C,R,h,i){let{node:s,size:d,handle:S}=R;const l=this.props[i];if(!l)return;const{x:g,y:f,i:v,maxH:P,minH:U,containerWidth:z}=this.props,{minW:V,maxW:O}=this.props;let x=d;s&&(x=(0,a.resizeItemInDirection)(S,h,d,z),this.setState({resizing:i==="onResizeStop"?null:x}));let{w:W,h:X}=(0,o.calcWH)(this.getPositionParams(),x.width,x.height,g,f,S);W=(0,o.clamp)(W,Math.max(V,1),O),X=(0,o.clamp)(X,U,P),l.call(this,v,W,X,{e:C,node:s,size:x,handle:S})}render(){const{x:C,y:R,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:S,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),C,R,h,i,this.state),f=e.default.Children.only(this.props.children);let v=e.default.cloneElement(f,{ref:this.elementRef,className:(0,y.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!S,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,d),v=this.mixinDraggable(v,s),v}};return Qe.default=_,b(_,"propTypes",{children:t.default.element,cols:t.default.number.isRequired,containerWidth:t.default.number.isRequired,rowHeight:t.default.number.isRequired,margin:t.default.array.isRequired,maxRows:t.default.number.isRequired,containerPadding:t.default.array.isRequired,x:t.default.number.isRequired,y:t.default.number.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired,minW:function(w,C){const R=w[C];if(typeof R!="number")return new Error("minWidth not Number");if(R>w.w||R>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxWidth not Number");if(R<w.w||R<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("minHeight not Number");if(R>w.h||R>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxHeight not Number");if(R<w.h||R<w.minH)return new Error("maxHeight smaller than item height/minHeight")},i:t.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,isDraggable:t.default.bool.isRequired,isResizable:t.default.bool.isRequired,isBounded:t.default.bool.isRequired,static:t.default.bool,useCSSTransforms:t.default.bool.isRequired,transformScale:t.default.number,className:t.default.string,handle:t.default.string,cancel:t.default.string,droppingPosition:t.default.shape({e:t.default.object.isRequired,left:t.default.number.isRequired,top:t.default.number.isRequired})}),b(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Qe}var ar;function or(){if(ar)return Ze;ar=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var e=b(L),t=nn(),r=y(rn()),n=ze(),a=on(),o=y(ea()),u=y(nr());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(d){return d?s:i})(h)}function b(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 d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w="react-grid-layout";let C=!1;try{C=/firefox/i.test(navigator.userAgent)}catch{}let R=class extends e.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.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,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);if(!v)return;const P={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(v),oldLayout:f,activeDrag:P}),this.props.onDragStart(f,v,v,null,l,g)}),m(this,"onDrag",(i,s,d,S)=>{let{e:l,node:g}=S;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,allowOverlap:U,preventCollision:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;const O={w:V.w,h:V.h,x:V.x,y:V.y,placeholder:!0,i};v=(0,n.moveElement)(v,V,s,d,!0,z,(0,n.compactType)(this.props),P,U),this.props.onDrag(v,f,V,O,l,g),this.setState({layout:U?v:(0,n.compact)(v,(0,n.compactType)(this.props),P),activeDrag:O})}),m(this,"onDragStop",(i,s,d,S)=>{let{e:l,node:g}=S;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,preventCollision:U,allowOverlap:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;v=(0,n.moveElement)(v,V,s,d,!0,U,(0,n.compactType)(this.props),P,z);const x=z?v:(0,n.compact)(v,(0,n.compactType)(this.props),P);this.props.onDragStop(x,f,V,null,l,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:x,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(x,W)}),m(this,"onResizeStart",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);v&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,v,v,null,l,g))}),m(this,"onResize",(i,s,d,S)=>{let{e:l,node:g,size:f,handle:v}=S;const{oldResizeItem:P}=this.state,{layout:U}=this.state,{cols:z,preventCollision:V,allowOverlap:O}=this.props;let x=!1,W,X,Y;const[re,te]=(0,n.withLayoutItem)(U,i,H=>{let oe;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(v)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),x=!0),V&&!O&&(oe=(0,n.getAllCollisions)(U,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,oe&&(Y=H.y,d=H.h,X=H.x,s=H.w,x=!1)),H.w=s,H.h=d,H});if(!te)return;W=re,x&&(W=(0,n.moveElement)(re,te,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),z,O));const F={w:te.w,h:te.h,x:te.x,y:te.y,static:!0,i};this.props.onResize(W,P,te,F,l,g),this.setState({layout:O?W:(0,n.compact)(W,(0,n.compactType)(this.props),z),activeDrag:F})}),m(this,"onResizeStop",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f,oldResizeItem:v}=this.state,{cols:P,allowOverlap:U}=this.props,z=(0,n.getLayoutItem)(f,i),V=U?f:(0,n.compact)(f,(0,n.compactType)(this.props),P);this.props.onResizeStop(V,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:V,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(V,O)}),m(this,"onDragOver",i=>{var re;if(i.preventDefault(),i.stopPropagation(),C&&!((re=i.nativeEvent.target)!=null&&re.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:d,margin:S,cols:l,rowHeight:g,maxRows:f,width:v,containerPadding:P,transformScale:U}=this.props,z=d==null?void 0:d(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const V={...s,...z},{layout:O}=this.state,x=i.currentTarget.getBoundingClientRect(),W=i.clientX-x.left,X=i.clientY-x.top,Y={left:W/U,top:X/U,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:te,top:F}=this.state.droppingPosition;(te!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const te={cols:l,margin:S,maxRows:f,rowHeight:g,containerWidth:v,containerPadding:P||S},F=(0,a.calcXY)(te,X,W,V.w,V.h);this.setState({droppingDOMNode:e.createElement("div",{key:V.i}),droppingPosition:Y,layout:[...O,{...V,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,S=(0,n.compact)(d.filter(l=>l.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:S,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:d}=this.state,S=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,S,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let d;return s.activeDrag?null:(!(0,t.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?d=i.layout:(0,n.childrenEqual)(i.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,i.children,i.cols,(0,n.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,n.fastRGLPropsEqual)(this.props,i,t.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const d=this.state.layout,S=s.layout;this.onLayoutMaybeChanged(d,S)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,n.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,t.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:d,margin:S,containerPadding:l,rowHeight:g,maxRows:f,useCSSTransforms:v,transformScale:P}=this.props;return e.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:d,margin:S,containerPadding:l||S,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:P},e.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(i.key));if(!d)return null;const{width:S,cols:l,margin:g,containerPadding:f,rowHeight:v,maxRows:P,isDraggable:U,isResizable:z,isBounded:V,useCSSTransforms:O,transformScale:x,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:re}=this.props,{mounted:te,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&U,oe=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&z,se=d.resizeHandles||Y,ue=H&&V&&d.isBounded!==!1;return e.createElement(o.default,{containerWidth:S,cols:l,margin:g,containerPadding:f||g,maxRows:P,rowHeight:v,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:oe,isBounded:ue,useCSSTransforms:O&&te,usePercentages:!te,transformScale:x,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:se,resizeHandle:re},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:S}=this.props,l=(0,r.default)(w,i),g={height:this.containerHeight(),...s};return e.createElement("div",{ref:S,className:l,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},e.Children.map(this.props.children,f=>this.processGridItem(f)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ze.default=R,m(R,"displayName","ReactGridLayout"),m(R,"propTypes",u.default),m(R,"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:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Ze}var it={},Pe={},ir;function sr(){if(ir)return Pe;ir=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.findOrGenerateResponsiveLayout=n,Pe.getBreakpointFromWidth=t,Pe.getColsFromBreakpoint=r,Pe.sortBreakpoints=a;var e=ze();function t(o,u){const y=a(o);let p=y[0];for(let b=1,m=y.length;b<m;b++){const I=y[b];u>o[I]&&(p=I)}return p}function r(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function n(o,u,y,p,b,m){if(o[y])return(0,e.cloneLayout)(o[y]);let I=o[p];const _=a(u),w=_.slice(_.indexOf(y));for(let C=0,R=w.length;C<R;C++){const h=w[C];if(o[h]){I=o[h];break}}return I=(0,e.cloneLayout)(I||[]),(0,e.compact)((0,e.correctBounds)(I,{cols:b}),m,b)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return Pe}var lr;function ta(){if(lr)return it;lr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var e=p(L),t=u(Ee()),r=nn(),n=ze(),a=sr(),o=u(or());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(d){return d?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 d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function b(){return b=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function C(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let R=class extends e.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:d,cols:S}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,S),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(d,s,l,l,g,f),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,r.deepEqual)(i.layouts,s.layouts)){const{breakpoint:d,cols:S}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,S,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,r.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:d,layouts:S,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,d),P={...S};if(f!==g||i.breakpoints!==s||i.cols!==d){f in P||(P[f]=(0,n.cloneLayout)(this.state.layout));let V=(0,a.findOrGenerateResponsiveLayout)(P,s,g,f,v,l);V=(0,n.synchronizeLayoutWithChildren)(V,this.props.children,v,l,this.props.allowOverlap),P[g]=V,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(V,P),this.setState({breakpoint:g,layout:V,cols:v})}const U=C(this.props.margin,g),z=C(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,U,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:S,margin:l,containerPadding:g,onBreakpointChange:f,onLayoutChange:v,onWidthChange:P,...U}=this.props;return e.createElement(o.default,b({},U,{margin:C(l,this.state.breakpoint),containerPadding:C(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return it.default=R,m(R,"propTypes",{breakpoint:t.default.string,breakpoints:t.default.object,allowOverlap:t.default.bool,cols:t.default.object,margin:t.default.oneOfType([t.default.array,t.default.object]),containerPadding:t.default.oneOfType([t.default.array,t.default.object]),layouts(h,i){if(w(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(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,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:t.default.number.isRequired,onBreakpointChange:t.default.func,onLayoutChange:t.default.func,onWidthChange:t.default.func}),m(R,"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:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),it}var Et={},cr=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(a,o){return a[0]===r?(n=o,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},t.prototype.set=function(r,n){var a=e(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,a=e(n,r);~a&&n.splice(a,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];r.call(n,u[1],u[0])}},t}()}(),pn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=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")()}(),na=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ra=2;function aa(e,t){var r=!1,n=!1,a=0;function o(){r&&(r=!1,e()),n&&y()}function u(){na(o)}function y(){var p=Date.now();if(r){if(p-a<ra)return;n=!0}else r=!0,n=!1,setTimeout(u,t);a=p}return y}var oa=20,ia=["top","right","bottom","left","width","height","size","weight"],sa=typeof MutationObserver<"u",la=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=aa(this.refresh.bind(this),oa)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!pn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!pn||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,a=ia.some(function(o){return!!~n.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),ur=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var a=n[r];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ke=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ot},dr=Dt(0,0,0,0);function Mt(e){return parseFloat(e)||0}function fr(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,a){var o=e["border-"+a+"-width"];return n+Mt(o)},0)}function ca(e){for(var t=["top","right","bottom","left"],r={},n=0,a=t;n<a.length;n++){var o=a[n],u=e["padding-"+o];r[o]=Mt(u)}return r}function ua(e){var t=e.getBBox();return Dt(0,0,t.width,t.height)}function da(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return dr;var n=ke(e).getComputedStyle(e),a=ca(n),o=a.left+a.right,u=a.top+a.bottom,y=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+o)!==t&&(y-=fr(n,"left","right")+o),Math.round(p+u)!==r&&(p-=fr(n,"top","bottom")+u)),!pa(e)){var b=Math.round(y+o)-t,m=Math.round(p+u)-r;Math.abs(b)!==1&&(y-=b),Math.abs(m)!==1&&(p-=m)}return Dt(a.left,a.top,y,p)}var fa=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ke(e).SVGGraphicsElement}:function(e){return e instanceof ke(e).SVGElement&&typeof e.getBBox=="function"}}();function pa(e){return e===ke(e).document.documentElement}function ha(e){return pn?fa(e)?ua(e):da(e):dr}function ga(e){var t=e.x,r=e.y,n=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return ur(u,{x:t,y:r,width:n,height:a,top:r,right:t+n,bottom:a+r,left:t}),u}function Dt(e,t,r,n){return{x:e,y:t,width:r,height:n}}var va=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dt(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ha(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ma=function(){function e(t,r){var n=ga(r);ur(this,{target:t,contentRect:n})}return e}(),ya=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new cr,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new va(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new ma(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),pr=typeof WeakMap<"u"?new WeakMap:new cr,hr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=la.getInstance(),n=new ya(t,r,this);pr.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){hr.prototype[e]=function(){var t;return(t=pr.get(this))[e].apply(t,arguments)}});var Sa=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:hr}();const ba=En(Object.freeze(Object.defineProperty({__proto__:null,default:Sa},Symbol.toStringTag,{value:"Module"})));var gr;function Ca(){if(gr)return Et;gr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=_;var e=u(L),t=a(Ee()),r=a(ba),n=a(rn());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(o=function(h){return h?R:C})(w)}function u(w,C){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=o(C);if(R&&R.has(w))return R.get(w);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var d=i?Object.getOwnPropertyDescriptor(w,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=w[s]}return h.default=w,R&&R.set(w,h),h}function y(){return y=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},y.apply(this,arguments)}function p(w,C,R){return C=b(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function b(w){var C=m(w,"string");return typeof C=="symbol"?C:String(C)}function m(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}const I="react-grid-layout";function _(w){var C;return C=class extends e.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",e.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(i=>{if(this.elementRef.current instanceof HTMLElement){const d=i[0].contentRect.width;this.setState({width:d})}});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?e.createElement("div",{className:(0,n.default)(this.props.className,I),style:this.props.style,ref:this.elementRef}):e.createElement(w,y({innerRef:this.elementRef},i,this.state))}},p(C,"defaultProps",{measureBeforeMount:!1}),p(C,"propTypes",{measureBeforeMount:t.default.bool}),C}return Et}var vr;function Ta(){return vr||(vr=1,function(e){e.exports=or().default,e.exports.utils=ze(),e.exports.calculateUtils=on(),e.exports.Responsive=ta().default,e.exports.Responsive.utils=sr(),e.exports.WidthProvider=Ca().default}(tn)),tn.exports}var Ia=Ta();const wa=Hr(Ia);var Ra=Object.getOwnPropertyDescriptor,_a=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ra(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Ea=(e,t)=>(r,n)=>t(r,n,e);let Ae=class extends T.Disposable{constructor(t){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",t=>{const r=/\{([^}]+)?\}/g,n=[];let a=r.exec(t);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=r.exec(t);return n});this._localeService=t,this._initLocal()}tWithReactNode(t,...r){const n=this._localeService.getLocales(),a=t.split("."),o=n&&this._localeService.resolveKeyPath(n,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,b)=>{const m=b[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const I=o.slice(m.endIndex+1,y.startIndex);I&&u.push(I)}if(r[y.key]&&u.push(r[y.key]),p===b.length-1){const I=o.slice(y.endIndex+1);I&&u.push(I)}}),u}return[]}};Ae=_a([Ea(0,T.Inject(T.LocaleService))],Ae);const Pt={cfPreview:"univer-cf-preview"},We=e=>{var a,o;const t=e.rule;if(!t)return null;const r=L.useMemo(()=>{if(t.type===c.CFRuleType.colorScale){const u=t.config.map((b,m)=>({color:new T.ColorKit(b.color),value:m})),y=u.length-1;return new Array(5).fill("").map((b,m,I)=>m*y/(I.length-1)).map(b=>c.getColorScaleFromValue(u,b))}return null},[t]),n=L.useMemo(()=>{if(t.type===c.CFRuleType.iconSet)return t.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[t]);switch(t.type){case c.CFRuleType.dataBar:{const{isGradient:u}=t.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${t.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:t.config.positiveColor,b=u?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor||c.defaultDataBarNativeColor})`:t.config.nativeColor;return E.jsxs("div",{className:Pt.cfPreview,children:[E.jsx("div",{style:{...y,background:b,border:`1px solid ${t.config.nativeColor||c.defaultDataBarNativeColor}`}}),E.jsx("div",{style:{...y,background:p,border:`1px solid ${t.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&E.jsx("div",{className:Pt.cfPreview,children:r.map((u,y)=>E.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return n&&E.jsx("div",{className:Pt.cfPreview,children:n.map((u,y)=>u?E.jsx("img",{style:{height:"100%"},src:u},y):E.jsx($e,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:b,bg:m,cl:I}=t.style,_=(u==null?void 0:u.s)===T.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===T.BooleanNumber.TRUE,C=p===T.BooleanNumber.TRUE,R=b===T.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=I==null?void 0:I.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:R?"bold":void 0,fontStyle:C?"italic":void 0,textDecoration:`${_?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return E.jsx("div",{style:s,className:Pt.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"},Oa=(e,t)=>{const r=e.rule;switch(r.type){case c.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,t.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(a=>String(a)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):t.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(r.value)):t.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let mr=0;const Ma=e=>{const{onClick:t}=e,r=ee.useDependency(c.ConditionalFormattingRuleModel),n=ee.useDependency(T.IUniverInstanceService),a=ee.useDependency(q.SheetsSelectionsService),o=ee.useDependency(T.ICommandService),u=ee.useDependency(T.LocaleService),y=ee.useDependency(T.Injector),p=ee.useDependency(Ae),b=ee.useObservable(()=>n.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=b.getUnitId(),I=b.getActiveSheet();if(!I)throw new Error("No active sheet found");const _=I.getSheetId(),[w,C]=L.useState([]),[R,h]=L.useState("2"),[i,s]=L.useState(0),[d,S]=L.useState(-1),[l,g]=L.useState(mr),f=L.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],P=()=>{const F=r.getSubunitRules(m,_);if(!F||!F.length)return[];if(R==="1"){const H=a.getCurrentLastSelection();if(!H)return[];const oe=H.range;return F.filter(ue=>ue.ranges.some(ge=>T.Rectangle.intersects(ge,oe)))}else if(R==="2")return[...F];return[]},[U,z]=L.useState(P);fe.useHighlightRange(w),L.useEffect(()=>{const F=o.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),L.useEffect(()=>{z(P)},[R,i,m,_]),L.useEffect(()=>{if(R==="2")return;const F=new Ce.Observable(H=>{const oe=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],se=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();oe.includes(ge)&&ye.unitId===Te&&H.next(null)});return()=>se.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(P)});return()=>{F.unsubscribe()}},[n,R,m,_]),L.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),L.useEffect(()=>{const F=()=>{var ue;const se=Math.max(0,(((ue=f.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return mr=se,se},oe=new Ce.Observable(se=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{se.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=B=>{B.propertyName==="width"&&(ye(),se.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(F())});return()=>{oe.unsubscribe()}},[]);const V=F=>{var se;const H=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),oe=(se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:se.getSheetId();if(!H||!oe)throw new Error("No active sheet found");o.executeCommand(Ke.id,{unitId:H,subUnitId:oe,cfId:F.cfId})},O=(F,H)=>{S(H.y)},x=(F,H,oe)=>{var B;S(-1);const se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(B=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:B.getSheetId();if(!se||!ue)throw new Error("No active sheet found");const ge=Q=>{const le=U.length;return Math.min(le-1,Math.max(0,Q))},ye=U[ge(H.y)].cfId,Te=U[ge(oe.y)].cfId;ye!==Te&&o.executeCommand(St.id,{unitId:se,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:oe.y>H.y?"after":"before"}})},W=()=>{e.onCreate()},X=()=>{R==="2"?o.executeCommand(Ye.id):R==="1"&&U.map(H=>({unitId:m,subUnitId:_,cfId:H.cfId})).forEach(H=>{o.executeCommand(Ke.id,H)})},Y=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.filter(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]),re=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),te=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.every(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]);return E.jsxs("div",{className:he.cfRuleList,children:[E.jsxs("div",{className:he.ruleSelector,children:[E.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",E.jsx(ae.Select,{className:he.select,options:v,value:R,onChange:F=>{h(F)}})).map((F,H)=>E.jsx("span",{children:F},H))}),E.jsxs("div",{className:he.btnList,children:[E.jsx(ae.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:E.jsx("div",{className:`
|
|
12
|
+
`,f.getElementsByTagName("head")[0].appendChild(v)),f.body&&l(f.body,"react-draggable-transparent-selection")}function S(f){if(f)try{if(f.body&&g(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const v=(f.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(f,v){f.classList?f.classList.add(v):f.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(f.className+=" ".concat(v))}function g(f,v){f.classList?f.classList.remove(v):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var Ie={},Wn;function jn(){if(Wn)return Ie;Wn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=a,Ie.canDragY=o,Ie.createCoreData=y,Ie.createDraggableData=p,Ie.getBoundPosition=r,Ie.getControlPosition=u,Ie.snapToGrid=n;var t=wt(),e=dn();function r(I,E,w){if(!I.props.bounds)return[E,w];let{bounds:C}=I.props;C=typeof C=="string"?C:b(C);const R=m(I);if(typeof C=="string"){const{ownerDocument:h}=R,i=h.defaultView;let s;if(C==="parent"?s=R.parentNode:s=h.querySelector(C),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const d=s,S=i.getComputedStyle(R),l=i.getComputedStyle(d);C={left:-R.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(S.marginLeft),top:-R.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(S.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(S.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(R)-R.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(S.marginBottom)}}return(0,t.isNum)(C.right)&&(E=Math.min(E,C.right)),(0,t.isNum)(C.bottom)&&(w=Math.min(w,C.bottom)),(0,t.isNum)(C.left)&&(E=Math.max(E,C.left)),(0,t.isNum)(C.top)&&(w=Math.max(w,C.top)),[E,w]}function n(I,E,w){const C=Math.round(E/I[0])*I[0],R=Math.round(w/I[1])*I[1];return[C,R]}function a(I){return I.props.axis==="both"||I.props.axis==="x"}function o(I){return I.props.axis==="both"||I.props.axis==="y"}function u(I,E,w){const C=typeof E=="number"?(0,e.getTouch)(I,E):null;if(typeof E=="number"&&!C)return null;const R=m(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(C||I,h,w.props.scale)}function y(I,E,w){const C=!(0,t.isNum)(I.lastX),R=m(I);return C?{node:R,deltaX:0,deltaY:0,lastX:E,lastY:w,x:E,y:w}:{node:R,deltaX:E-I.lastX,deltaY:w-I.lastY,lastX:I.lastX,lastY:I.lastY,x:E,y:w}}function p(I,E){const w=I.props.scale;return{node:E.node,x:I.state.x+E.deltaX/w,y:I.state.y+E.deltaY/w,deltaX:E.deltaX/w,deltaY:E.deltaY/w,lastX:I.state.x,lastY:I.state.y}}function b(I){return{left:I.left,top:I.top,right:I.right,bottom:I.bottom}}function m(I){const E=I.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return Ie}var tt={},Rt={},Hn;function Bn(){if(Hn)return Rt;Hn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=t;function t(){}return Rt}var Fn;function Kr(){if(Fn)return tt;Fn=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var t=b(L),e=y(Ee()),r=y(Cn),n=dn(),a=jn(),o=wt(),u=y(Bn());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(d){return d?s:i})(h)}function b(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 d={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(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 d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=w.mouse,R=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:d}=s;if(this.props.disabled||!(i.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const S=(0,n.getTouchIdentifier)(i);this.touchIdentifier=S;const l=(0,a.getControlPosition)(i,S,this);if(l==null)return;const{x:g,y:f}=l,v=(0,a.createCoreData)(this,g,f);(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,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=f,(0,n.addEvent)(d,C.move,this.handleDrag),(0,n.addEvent)(d,C.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,v=S-this.lastY;if([f,v]=(0,a.snapToGrid)(this.props.grid,f,v),!f&&!v)return;d=this.lastX+f,S=this.lastY+v}const l=(0,a.createCoreData)(this,d,S);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=d,this.lastY=S}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let v=d-this.lastX||0,P=S-this.lastY||0;[v,P]=(0,a.snapToGrid)(this.props.grid,v,P),d=this.lastX+v,S=this.lastY+P}const l=(0,a.createCoreData)(this,d,S);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,u.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,C.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,C.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(C=w.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(C=w.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(C=w.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(C=w.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,n.addEvent)(i,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(i,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.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:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return tt.default=R,m(R,"displayName","DraggableCore"),m(R,"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(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),tt}var Gn;function $r(){return Gn||(Gn=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(L),r=m(Ee()),n=m(Cn),a=m(Xr),o=dn(),u=jn(),y=wt(),p=m(Kr()),b=m(Bn());function m(s){return s&&s.__esModule?s:{default:s}}function I(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(I=function(l){return l?S:d})(s)}function E(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=I(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},w.apply(this,arguments)}function C(s,d,S){return d=R(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function R(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(d,S){let{position:l}=d,{prevPropsPosition:g}=S;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),C(this,"onDragStart",(S,l)=>{if((0,b.default)("Draggable: onDragStart: %j",l),this.props.onStart(S,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(S,l)=>{if(!this.state.dragging)return!1;(0,b.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),f={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:U}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[z,V]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=z,f.y=V,f.slackX=this.state.slackX+(P-f.x),f.slackY=this.state.slackY+(U-f.y),g.x=f.x,g.y=f.y,g.deltaX=f.x-this.state.x,g.deltaY=f.y-this.state.y}if(this.props.onDrag(S,g)===!1)return!1;this.setState(f)}),C(this,"onDragStop",(S,l)=>{if(!this.state.dragging||this.props.onStop(S,(0,u.createDraggableData)(this,l))===!1)return!1;(0,b.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:U}=this.props.position;f.x=P,f.y=U}this.setState(f)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.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 d,S;return(d=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:S,children:l,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:v,defaultClassNameDragged:P,position:U,positionOffset:z,scale:V,...O}=this.props;let x={},W=null;const Y=!!!U||this.state.dragging,ae=U||g,te={x:(0,u.canDragX)(this)&&Y?this.state.x:ae.x,y:(0,u.canDragY)(this)&&Y?this.state.y:ae.y};this.state.isElementSVG?W=(0,o.createSVGTransform)(te,z):x=(0,o.createCSSTransform)(te,z);const F=(0,a.default)(l.props.className||"",f,{[v]:this.state.dragging,[P]:this.state.dragged});return e.createElement(p.default,w({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:F,style:{...l.props.style,...x},transform:W}))}}t.default=i,C(i,"displayName","Draggable"),C(i,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),C(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})}(un)),un}var qn;function fn(){if(qn)return et.exports;qn=1;const{default:t,DraggableCore:e}=$r();return et.exports=t,et.exports.default=t,et.exports.DraggableCore=e,et.exports}var nt={exports:{}},rt={},_t={},Xn;function Zr(){if(Xn)return _t;Xn=1,_t.__esModule=!0,_t.cloneElement=y;var t=e(L);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,b){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(p);b&&(I=I.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,I)}return m}function n(p){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?r(Object(m),!0).forEach(function(I){a(p,I,m[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(I){Object.defineProperty(p,I,Object.getOwnPropertyDescriptor(m,I))})}return p}function a(p,b,m){return b=o(b),b in p?Object.defineProperty(p,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[b]=m,p}function o(p){var b=u(p,"string");return typeof b=="symbol"?b:String(b)}function u(p,b){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var I=m.call(p,b);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(p)}function y(p,b){return b.style&&p.props.style&&(b.style=n(n({},p.props.style),b.style)),b.className&&p.props.className&&(b.className=p.props.className+" "+b.className),t.default.cloneElement(p,b)}return _t}var at={},Yn;function Kn(){if(Yn)return at;Yn=1,at.__esModule=!0,at.resizableProps=void 0;var t=e(Ee());fn();function e(n){return n&&n.__esModule?n:{default:n}}var r={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 at.resizableProps=r,at}var $n;function Zn(){if($n)return rt;$n=1,rt.__esModule=!0,rt.default=void 0;var t=u(L),e=fn(),r=Zr(),n=Kn(),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,d=new WeakMap;return(o=function(l){return l?d: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 d=o(s);if(d&&d.has(i))return d.get(i);var S={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var f=l?Object.getOwnPropertyDescriptor(i,g):null;f&&(f.get||f.set)?Object.defineProperty(S,g,f):S[g]=i[g]}return S.default=i,d&&d.set(i,S),S}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(i[S]=d[S])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},S=Object.keys(i),l,g;for(g=0;g<S.length;g++)l=S[g],!(s.indexOf(l)>=0)&&(d[l]=i[l]);return d}function b(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(i);s&&(S=S.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),d.push.apply(d,S)}return d}function m(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(S){I(i,S,d[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(S){Object.defineProperty(i,S,Object.getOwnPropertyDescriptor(d,S))})}return i}function I(i,s,d){return s=E(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function E(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 d=i[Symbol.toPrimitive];if(d!==void 0){var S=d.call(i,s);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function C(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,R(i,s)}function R(i,s){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,l){return S.__proto__=l,S},R(i,s)}var h=function(i){C(s,i);function s(){for(var S,l=arguments.length,g=new Array(l),f=0;f<l;f++)g[f]=arguments[f];return S=i.call.apply(i,[this].concat(g))||this,S.handleRefs={},S.lastHandleRect=null,S.slack=null,S}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,g){var f=this.props,v=f.minConstraints,P=f.maxConstraints,U=f.lockAspectRatio;if(!v&&!P&&!U)return[l,g];if(U){var z=this.props.width/this.props.height,V=l-this.props.width,O=g-this.props.height;Math.abs(V)>Math.abs(O*z)?g=l/z:l=g*z}var x=l,W=g,X=this.slack||[0,0],Y=X[0],ae=X[1];return l+=Y,g+=ae,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),P&&(l=Math.min(P[0],l),g=Math.min(P[1],g)),this.slack=[Y+(x-l),ae+(W-g)],[l,g]},d.resizeHandler=function(l,g){var f=this;return function(v,P){var U=P.node,z=P.deltaX,V=P.deltaY;l==="onResizeStart"&&f.resetData();var O=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",x=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!x)){var W=g[0],X=g[g.length-1],Y=U.getBoundingClientRect();if(f.lastHandleRect!=null){if(X==="w"){var ae=Y.left-f.lastHandleRect.left;z+=ae}if(W==="n"){var te=Y.top-f.lastHandleRect.top;V+=te}}f.lastHandleRect=Y,X==="w"&&(z=-z),W==="n"&&(V=-V);var F=f.props.width+(O?z/f.props.transformScale:0),H=f.props.height+(x?V/f.props.transformScale:0),oe=f.runConstraints(F,H);F=oe[0],H=oe[1];var se=F!==f.props.width||H!==f.props.height,ue=typeof f.props[l]=="function"?f.props[l]:null,ge=l==="onResize"&&!se;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:U,size:{width:F,height:H},handle:g})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,g){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof f=="function")return f(l,g);var v=typeof f.type=="string",P=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(f,P)},d.render=function(){var l=this,g=this.props,f=g.children,v=g.className,P=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 U=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,r.cloneElement)(f,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(f.props.children,U.map(function(V){var O,x=(O=l.handleRefs[V])!=null?O:l.handleRefs[V]=t.createRef();return t.createElement(e.DraggableCore,y({},P,{nodeRef:x,key:"resizableHandle-"+V,onStop:l.resizeHandler("onResizeStop",V),onStart:l.resizeHandler("onResizeStart",V),onDrag:l.resizeHandler("onResize",V)}),l.renderResizeHandle(V,x))}))}))},s}(t.Component);return rt.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},rt}var ot={},Jn;function Jr(){if(Jn)return ot;Jn=1,ot.__esModule=!0,ot.default=void 0;var t=y(L),e=o(Ee()),r=o(Zn()),n=Kn(),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 d=new WeakMap,S=new WeakMap;return(u=function(g){return g?S:d})(s)}function y(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=u(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},p.apply(this,arguments)}function b(s,d){var S=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),S.push.apply(S,l)}return S}function m(s){for(var d=1;d<arguments.length;d++){var S=arguments[d]!=null?arguments[d]:{};d%2?b(Object(S),!0).forEach(function(l){I(s,l,S[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(S)):b(Object(S)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(S,l))})}return s}function I(s,d,S){return d=E(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function E(s){var d=w(s,"string");return typeof d=="symbol"?d:String(d)}function w(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function C(s,d){if(s==null)return{};var S={},l=Object.keys(s),g,f;for(f=0;f<l.length;f++)g=l[f],!(d.indexOf(g)>=0)&&(S[g]=s[g]);return S}function R(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,d)}var i=function(s){R(d,s);function d(){for(var l,g=arguments.length,f=new Array(g),v=0;v<g;v++)f[v]=arguments[v];return l=s.call.apply(s,[this].concat(f))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(P,U){var z=U.size;l.props.onResize?(P.persist==null||P.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(P,U)})):l.setState(z)},l}d.getDerivedStateFromProps=function(g,f){return f.propsWidth!==g.width||f.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var S=d.prototype;return S.render=function(){var g=this.props,f=g.handle,v=g.handleSize;g.onResize;var P=g.onResizeStart,U=g.onResizeStop,z=g.draggableOpts,V=g.minConstraints,O=g.maxConstraints,x=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,ae=g.transformScale,te=C(g,a);return t.createElement(r.default,{axis:W,draggableOpts:z,handle:f,handleSize:v,height:this.state.height,lockAspectRatio:x,maxConstraints:O,minConstraints:V,onResizeStart:P,onResize:this.onResize,onResizeStop:U,resizeHandles:X,transformScale:ae,width:this.state.width},t.createElement("div",p({},te,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return ot.default=i,i.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),ot}var Qn;function Qr(){return Qn||(Qn=1,nt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},nt.exports.Resizable=Zn().default,nt.exports.ResizableBox=Jr().default),nt.exports}var Re={},er;function tr(){if(er)return Re;er=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.resizeHandleType=Re.resizeHandleAxesType=Re.default=void 0;var t=r(Ee()),e=r(L);function r(o){return o&&o.__esModule?o:{default:o}}const n=Re.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=Re.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Re.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:n,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(b){if((b==null?void 0:b.key)!=null){if(p[b.key])throw new Error('Duplicate child key "'+b.key+'" found! This will cause problems in ReactGridLayout.');p[b.key]=!0}})},innerRef:t.default.any},Re}var nr;function ea(){if(nr)return Qe;nr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var t=p(L),e=p(Ee()),r=fn(),n=Qr(),a=ze(),o=on(),u=tr(),y=p(rn());function p(w){return w&&w.__esModule?w:{default:w}}function b(w,C,R){return C=m(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function m(w){var C=I(w,"string");return typeof C=="symbol"?C:String(C)}function I(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}let E=class extends t.default.Component{constructor(){super(...arguments),b(this,"state",{resizing:null,dragging:null,className:""}),b(this,"elementRef",t.default.createRef()),b(this,"onDragStart",(C,R)=>{let{node:h}=R;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:S}=h;if(!S)return;const l=S.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,v=l.left/s,P=g.top/s,U=l.top/s;d.left=f-v+S.scrollLeft,d.top=P-U+S.scrollTop,this.setState({dragging:d});const{x:z,y:V}=(0,o.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,V,{e:C,node:h,newPosition:d})}),b(this,"onDrag",(C,R)=>{let{node:h,deltaX:i,deltaY:s}=R;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:f,w:v,h:P,containerWidth:U}=this.props,z=this.getPositionParams();if(g){const{offsetParent:W}=h;if(W){const{margin:X,rowHeight:Y,containerPadding:ae}=this.props,te=W.clientHeight-(0,o.calcGridItemWHPx)(P,Y,X[1]);S=(0,o.clamp)(S-ae[1],0,te);const F=(0,o.calcGridColWidth)(z),H=U-(0,o.calcGridItemWHPx)(v,F,X[0]);l=(0,o.clamp)(l-ae[0],0,H)}}const V={top:S,left:l};this.setState({dragging:V});const{x:O,y:x}=(0,o.calcXY)(z,S,l,v,P);return d.call(this,f,O,x,{e:C,node:h,newPosition:V})}),b(this,"onDragStop",(C,R)=>{let{node:h}=R;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:S}=this.props,{left:l,top:g}=this.state.dragging,f={top:g,left:l};this.setState({dragging:null});const{x:v,y:P}=(0,o.calcXY)(this.getPositionParams(),g,l,s,d);return i.call(this,S,v,P,{e:C,node:h,newPosition:f})}),b(this,"onResizeStop",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStop")),b(this,"onResizeStart",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStart")),b(this,"onResize",(C,R,h)=>this.onResizeHandler(C,R,h,"onResize"))}shouldComponentUpdate(C,R){if(this.props.children!==C.children||this.props.droppingPosition!==C.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(C),C.x,C.y,C.w,C.h,R);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==C.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(C){this.moveDroppingItem(C)}moveDroppingItem(C){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const i=C.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&R.left!==i.left||R.top!==i.top;if(!s)this.onDragStart(R.e,{node:h,deltaX:R.left,deltaY:R.top});else if(d){const S=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:S,deltaY:l})}}getPositionParams(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:C.cols,containerPadding:C.containerPadding,containerWidth:C.containerWidth,margin:C.margin,maxRows:C.maxRows,rowHeight:C.rowHeight}}createStyle(C){const{usePercentages:R,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(C):(s=(0,a.setTopLeft)(C),R&&(s.left=(0,a.perc)(C.left/h),s.width=(0,a.perc)(C.width/h))),s}mixinDraggable(C,R){return t.default.createElement(r.DraggableCore,{disabled:!R,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},C)}curryResizeHandler(C,R){return(h,i)=>R(h,i,C)}mixinResizable(C,R,h){const{cols:i,minW:s,minH:d,maxW:S,maxH:l,transformScale:g,resizeHandles:f,resizeHandle:v}=this.props,P=this.getPositionParams(),U=(0,o.calcGridItemPosition)(P,0,0,i,0).width,z=(0,o.calcGridItemPosition)(P,0,0,s,d),V=(0,o.calcGridItemPosition)(P,0,0,S,l),O=[z.width,z.height],x=[Math.min(V.width,U),Math.min(V.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:R.width,height:R.height,minConstraints:O,maxConstraints:x,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:g,resizeHandles:f,handle:v},C)}onResizeHandler(C,R,h,i){let{node:s,size:d,handle:S}=R;const l=this.props[i];if(!l)return;const{x:g,y:f,i:v,maxH:P,minH:U,containerWidth:z}=this.props,{minW:V,maxW:O}=this.props;let x=d;s&&(x=(0,a.resizeItemInDirection)(S,h,d,z),this.setState({resizing:i==="onResizeStop"?null:x}));let{w:W,h:X}=(0,o.calcWH)(this.getPositionParams(),x.width,x.height,g,f,S);W=(0,o.clamp)(W,Math.max(V,1),O),X=(0,o.clamp)(X,U,P),l.call(this,v,W,X,{e:C,node:s,size:x,handle:S})}render(){const{x:C,y:R,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:S,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),C,R,h,i,this.state),f=t.default.Children.only(this.props.children);let v=t.default.cloneElement(f,{ref:this.elementRef,className:(0,y.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!S,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,d),v=this.mixinDraggable(v,s),v}};return Qe.default=E,b(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(w,C){const R=w[C];if(typeof R!="number")return new Error("minWidth not Number");if(R>w.w||R>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxWidth not Number");if(R<w.w||R<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("minHeight not Number");if(R>w.h||R>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxHeight not Number");if(R<w.h||R<w.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})}),b(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Qe}var rr;function ar(){if(rr)return Ze;rr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=b(L),e=nn(),r=y(rn()),n=ze(),a=on(),o=y(ea()),u=y(tr());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(d){return d?s:i})(h)}function b(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 d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(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 d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w="react-grid-layout";let C=!1;try{C=/firefox/i.test(navigator.userAgent)}catch{}let R=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.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,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);if(!v)return;const P={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(v),oldLayout:f,activeDrag:P}),this.props.onDragStart(f,v,v,null,l,g)}),m(this,"onDrag",(i,s,d,S)=>{let{e:l,node:g}=S;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,allowOverlap:U,preventCollision:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;const O={w:V.w,h:V.h,x:V.x,y:V.y,placeholder:!0,i};v=(0,n.moveElement)(v,V,s,d,!0,z,(0,n.compactType)(this.props),P,U),this.props.onDrag(v,f,V,O,l,g),this.setState({layout:U?v:(0,n.compact)(v,(0,n.compactType)(this.props),P),activeDrag:O})}),m(this,"onDragStop",(i,s,d,S)=>{let{e:l,node:g}=S;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,preventCollision:U,allowOverlap:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;v=(0,n.moveElement)(v,V,s,d,!0,U,(0,n.compactType)(this.props),P,z);const x=z?v:(0,n.compact)(v,(0,n.compactType)(this.props),P);this.props.onDragStop(x,f,V,null,l,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:x,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(x,W)}),m(this,"onResizeStart",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);v&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,v,v,null,l,g))}),m(this,"onResize",(i,s,d,S)=>{let{e:l,node:g,size:f,handle:v}=S;const{oldResizeItem:P}=this.state,{layout:U}=this.state,{cols:z,preventCollision:V,allowOverlap:O}=this.props;let x=!1,W,X,Y;const[ae,te]=(0,n.withLayoutItem)(U,i,H=>{let oe;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(v)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),x=!0),V&&!O&&(oe=(0,n.getAllCollisions)(U,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,oe&&(Y=H.y,d=H.h,X=H.x,s=H.w,x=!1)),H.w=s,H.h=d,H});if(!te)return;W=ae,x&&(W=(0,n.moveElement)(ae,te,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),z,O));const F={w:te.w,h:te.h,x:te.x,y:te.y,static:!0,i};this.props.onResize(W,P,te,F,l,g),this.setState({layout:O?W:(0,n.compact)(W,(0,n.compactType)(this.props),z),activeDrag:F})}),m(this,"onResizeStop",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f,oldResizeItem:v}=this.state,{cols:P,allowOverlap:U}=this.props,z=(0,n.getLayoutItem)(f,i),V=U?f:(0,n.compact)(f,(0,n.compactType)(this.props),P);this.props.onResizeStop(V,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:V,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(V,O)}),m(this,"onDragOver",i=>{var ae;if(i.preventDefault(),i.stopPropagation(),C&&!((ae=i.nativeEvent.target)!=null&&ae.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:d,margin:S,cols:l,rowHeight:g,maxRows:f,width:v,containerPadding:P,transformScale:U}=this.props,z=d==null?void 0:d(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const V={...s,...z},{layout:O}=this.state,x=i.currentTarget.getBoundingClientRect(),W=i.clientX-x.left,X=i.clientY-x.top,Y={left:W/U,top:X/U,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:te,top:F}=this.state.droppingPosition;(te!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const te={cols:l,margin:S,maxRows:f,rowHeight:g,containerWidth:v,containerPadding:P||S},F=(0,a.calcXY)(te,X,W,V.w,V.h);this.setState({droppingDOMNode:t.createElement("div",{key:V.i}),droppingPosition:Y,layout:[...O,{...V,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,S=(0,n.compact)(d.filter(l=>l.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:S,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:d}=this.state,S=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,S,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?d=i.layout:(0,n.childrenEqual)(i.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,i.children,i.cols,(0,n.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,n.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 d=this.state.layout,S=s.layout;this.onLayoutMaybeChanged(d,S)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,n.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:d,margin:S,containerPadding:l,rowHeight:g,maxRows:f,useCSSTransforms:v,transformScale:P}=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:d,margin:S,containerPadding:l||S,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:P},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(i.key));if(!d)return null;const{width:S,cols:l,margin:g,containerPadding:f,rowHeight:v,maxRows:P,isDraggable:U,isResizable:z,isBounded:V,useCSSTransforms:O,transformScale:x,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:ae}=this.props,{mounted:te,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&U,oe=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&z,se=d.resizeHandles||Y,ue=H&&V&&d.isBounded!==!1;return t.createElement(o.default,{containerWidth:S,cols:l,margin:g,containerPadding:f||g,maxRows:P,rowHeight:v,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:oe,isBounded:ue,useCSSTransforms:O&&te,usePercentages:!te,transformScale:x,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:se,resizeHandle:ae},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:S}=this.props,l=(0,r.default)(w,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:S,className:l,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},t.Children.map(this.props.children,f=>this.processGridItem(f)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ze.default=R,m(R,"displayName","ReactGridLayout"),m(R,"propTypes",u.default),m(R,"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:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Ze}var it={},Pe={},or;function ir(){if(or)return Pe;or=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.findOrGenerateResponsiveLayout=n,Pe.getBreakpointFromWidth=e,Pe.getColsFromBreakpoint=r,Pe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let b=1,m=y.length;b<m;b++){const I=y[b];u>o[I]&&(p=I)}return p}function r(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function n(o,u,y,p,b,m){if(o[y])return(0,t.cloneLayout)(o[y]);let I=o[p];const E=a(u),w=E.slice(E.indexOf(y));for(let C=0,R=w.length;C<R;C++){const h=w[C];if(o[h]){I=o[h];break}}return I=(0,t.cloneLayout)(I||[]),(0,t.compact)((0,t.correctBounds)(I,{cols:b}),m,b)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return Pe}var sr;function ta(){if(sr)return it;sr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var t=p(L),e=u(Ee()),r=nn(),n=ze(),a=ir(),o=u(ar());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(d){return d?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 d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function b(){return b=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(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 d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function C(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let R=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:d,cols:S}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,S),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(d,s,l,l,g,f),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,r.deepEqual)(i.layouts,s.layouts)){const{breakpoint:d,cols:S}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,S,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,r.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:d,layouts:S,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,d),P={...S};if(f!==g||i.breakpoints!==s||i.cols!==d){f in P||(P[f]=(0,n.cloneLayout)(this.state.layout));let V=(0,a.findOrGenerateResponsiveLayout)(P,s,g,f,v,l);V=(0,n.synchronizeLayoutWithChildren)(V,this.props.children,v,l,this.props.allowOverlap),P[g]=V,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(V,P),this.setState({breakpoint:g,layout:V,cols:v})}const U=C(this.props.margin,g),z=C(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,U,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:S,margin:l,containerPadding:g,onBreakpointChange:f,onLayoutChange:v,onWidthChange:P,...U}=this.props;return t.createElement(o.default,b({},U,{margin:C(l,this.state.breakpoint),containerPadding:C(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return it.default=R,m(R,"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(w(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(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,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(R,"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:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),it}var Et={},lr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(a,o){return a[0]===r?(n=o,!0):!1}),n}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(r){var n=t(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},e.prototype.set=function(r,n){var a=t(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,a=t(n,r);~a&&n.splice(a,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];r.call(n,u[1],u[0])}},e}()}(),pn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=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")()}(),na=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),ra=2;function aa(t,e){var r=!1,n=!1,a=0;function o(){r&&(r=!1,t()),n&&y()}function u(){na(o)}function y(){var p=Date.now();if(r){if(p-a<ra)return;n=!0}else r=!0,n=!1,setTimeout(u,e);a=p}return y}var oa=20,ia=["top","right","bottom","left","width","height","size","weight"],sa=typeof MutationObserver<"u",la=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=aa(this.refresh.bind(this),oa)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.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(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!pn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sa?(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(){!pn||!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 r=e.propertyName,n=r===void 0?"":r,a=ia.some(function(o){return!!~n.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),cr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var a=n[r];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||Ot},ur=Dt(0,0,0,0);function Mt(t){return parseFloat(t)||0}function dr(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,a){var o=t["border-"+a+"-width"];return n+Mt(o)},0)}function ca(t){for(var e=["top","right","bottom","left"],r={},n=0,a=e;n<a.length;n++){var o=a[n],u=t["padding-"+o];r[o]=Mt(u)}return r}function ua(t){var e=t.getBBox();return Dt(0,0,e.width,e.height)}function da(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return ur;var n=ke(t).getComputedStyle(t),a=ca(n),o=a.left+a.right,u=a.top+a.bottom,y=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=dr(n,"left","right")+o),Math.round(p+u)!==r&&(p-=dr(n,"top","bottom")+u)),!pa(t)){var b=Math.round(y+o)-e,m=Math.round(p+u)-r;Math.abs(b)!==1&&(y-=b),Math.abs(m)!==1&&(p-=m)}return Dt(a.left,a.top,y,p)}var fa=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 pa(t){return t===ke(t).document.documentElement}function ha(t){return pn?fa(t)?ua(t):da(t):ur}function ga(t){var e=t.x,r=t.y,n=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return cr(u,{x:e,y:r,width:n,height:a,top:r,right:e+n,bottom:a+r,left:e}),u}function Dt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var va=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ha(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}(),ma=function(){function t(e,r){var n=ga(r);cr(this,{target:e,contentRect:n})}return t}(),ya=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new lr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}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 r=this.observations_;r.has(e)||(r.set(e,new va(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 r=this.observations_;r.has(e)&&(r.delete(e),r.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(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new ma(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),fr=typeof WeakMap<"u"?new WeakMap:new lr,pr=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 r=la.getInstance(),n=new ya(e,r,this);fr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){pr.prototype[t]=function(){var e;return(e=fr.get(this))[t].apply(e,arguments)}});var Sa=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:pr}();const ba=_n(Object.freeze(Object.defineProperty({__proto__:null,default:Sa},Symbol.toStringTag,{value:"Module"})));var hr;function Ca(){if(hr)return Et;hr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=E;var t=u(L),e=a(Ee()),r=a(ba),n=a(rn());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(o=function(h){return h?R:C})(w)}function u(w,C){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=o(C);if(R&&R.has(w))return R.get(w);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var d=i?Object.getOwnPropertyDescriptor(w,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=w[s]}return h.default=w,R&&R.set(w,h),h}function y(){return y=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},y.apply(this,arguments)}function p(w,C,R){return C=b(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function b(w){var C=m(w,"string");return typeof C=="symbol"?C:String(C)}function m(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}const I="react-grid-layout";function E(w){var C;return C=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 r.default(i=>{if(this.elementRef.current instanceof HTMLElement){const d=i[0].contentRect.width;this.setState({width:d})}});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,n.default)(this.props.className,I),style:this.props.style,ref:this.elementRef}):t.createElement(w,y({innerRef:this.elementRef},i,this.state))}},p(C,"defaultProps",{measureBeforeMount:!1}),p(C,"propTypes",{measureBeforeMount:e.default.bool}),C}return Et}var gr;function Ta(){return gr||(gr=1,function(t){t.exports=ar().default,t.exports.utils=ze(),t.exports.calculateUtils=on(),t.exports.Responsive=ta().default,t.exports.Responsive.utils=ir(),t.exports.WidthProvider=Ca().default}(tn)),tn.exports}var Ia=Ta();const wa=Hr(Ia);var Ra=Object.getOwnPropertyDescriptor,_a=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ra(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Ea=(t,e)=>(r,n)=>e(r,n,t);let Ae=class extends T.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let a=r.exec(e);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),a=e.split("."),o=n&&this._localeService.resolveKeyPath(n,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,b)=>{const m=b[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const I=o.slice(m.endIndex+1,y.startIndex);I&&u.push(I)}if(r[y.key]&&u.push(r[y.key]),p===b.length-1){const I=o.slice(y.endIndex+1);I&&u.push(I)}}),u}return[]}};Ae=_a([Ea(0,T.Inject(T.LocaleService))],Ae);const Pt={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const r=L.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((b,m)=>({color:new T.ColorKit(b.color),value:m})),y=u.length-1;return new Array(5).fill("").map((b,m,I)=>m*y/(I.length-1)).map(b=>c.getColorScaleFromValue(u,b))}return null},[e]),n=L.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,b=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return _.jsxs("div",{className:Pt.cfPreview,children:[_.jsx("div",{style:{...y,background:b,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&_.jsx("div",{className:Pt.cfPreview,children:r.map((u,y)=>_.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return n&&_.jsx("div",{className:Pt.cfPreview,children:n.map((u,y)=>u?_.jsx("img",{style:{height:"100%"},src:u},y):_.jsx($e,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:b,bg:m,cl:I}=e.style,E=(u==null?void 0:u.s)===T.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===T.BooleanNumber.TRUE,C=p===T.BooleanNumber.TRUE,R=b===T.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=I==null?void 0:I.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:R?"bold":void 0,fontStyle:C?"italic":void 0,textDecoration:`${E?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return _.jsx("div",{style:s,className:Pt.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"},Oa=(t,e)=>{const r=t.rule;switch(r.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(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,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 n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(a=>String(a)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let vr=0;const Ma=t=>{const{onClick:e}=t,r=ee.useDependency(c.ConditionalFormattingRuleModel),n=ee.useDependency(T.IUniverInstanceService),a=ee.useDependency(q.SheetsSelectionsService),o=ee.useDependency(T.ICommandService),u=ee.useDependency(T.LocaleService),y=ee.useDependency(T.Injector),p=ee.useDependency(Ae),b=ee.useObservable(()=>n.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=b.getUnitId(),I=b.getActiveSheet();if(!I)throw new Error("No active sheet found");const E=I.getSheetId(),[w,C]=L.useState([]),[R,h]=L.useState("2"),[i,s]=L.useState(0),[d,S]=L.useState(-1),[l,g]=L.useState(vr),f=L.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],P=()=>{const F=r.getSubunitRules(m,E);if(!F||!F.length)return[];if(R==="1"){const H=a.getCurrentLastSelection();if(!H)return[];const oe=H.range;return F.filter(ue=>ue.ranges.some(ge=>T.Rectangle.intersects(ge,oe)))}else if(R==="2")return[...F];return[]},[U,z]=L.useState(P);fe.useHighlightRange(w),L.useEffect(()=>{const F=o.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),L.useEffect(()=>{z(P)},[R,i,m,E]),L.useEffect(()=>{if(R==="2")return;const F=new Ce.Observable(H=>{const oe=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],se=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();oe.includes(ge)&&ye.unitId===Te&&H.next(null)});return()=>se.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(P)});return()=>{F.unsubscribe()}},[n,R,m,E]),L.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),L.useEffect(()=>{const F=()=>{var ue;const se=Math.max(0,(((ue=f.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return vr=se,se},oe=new Ce.Observable(se=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{se.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=B=>{B.propertyName==="width"&&(ye(),se.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(F())});return()=>{oe.unsubscribe()}},[]);const V=F=>{var se;const H=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),oe=(se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:se.getSheetId();if(!H||!oe)throw new Error("No active sheet found");o.executeCommand(Ke.id,{unitId:H,subUnitId:oe,cfId:F.cfId})},O=(F,H)=>{S(H.y)},x=(F,H,oe)=>{var B;S(-1);const se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(B=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:B.getSheetId();if(!se||!ue)throw new Error("No active sheet found");const ge=Q=>{const le=U.length;return Math.min(le-1,Math.max(0,Q))},ye=U[ge(H.y)].cfId,Te=U[ge(oe.y)].cfId;ye!==Te&&o.executeCommand(St.id,{unitId:se,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:oe.y>H.y?"after":"before"}})},W=()=>{t.onCreate()},X=()=>{R==="2"?o.executeCommand(Ye.id):R==="1"&&U.map(H=>({unitId:m,subUnitId:E,cfId:H.cfId})).forEach(H=>{o.executeCommand(Ke.id,H)})},Y=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.filter(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]),ae=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),te=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.every(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]);return _.jsxs("div",{className:he.cfRuleList,children:[_.jsxs("div",{className:he.ruleSelector,children:[_.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(re.Select,{className:he.select,options:v,value:R,onChange:F=>{h(F)}})).map((F,H)=>_.jsx("span",{children:F},H))}),_.jsxs("div",{className:he.btnList,children:[_.jsx(re.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:`
|
|
13
13
|
${he.icon}
|
|
14
|
-
`,onClick:W,children:
|
|
14
|
+
`,onClick:W,children:_.jsx(wn,{})})}),U.length&&te?_.jsx(re.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:_.jsx("div",{className:`
|
|
15
15
|
${he.gap}
|
|
16
16
|
${he.icon}
|
|
17
|
-
`,onClick:X,children:
|
|
17
|
+
`,onClick:X,children:_.jsx(Ct,{})})}):_.jsx("div",{className:`
|
|
18
18
|
${he.gap}
|
|
19
19
|
${he.disabled}
|
|
20
|
-
`,children:
|
|
20
|
+
`,children:_.jsx(Ct,{})})]})]}),_.jsx("div",{ref:f,className:he.gridLayoutWrap,children:l?_.jsx(wa,{onDragStop:x,onDragStart:O,layout:ae,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:Y==null?void 0:Y.map((F,H)=>_.jsx("div",{children:_.jsxs("div",{onMouseMove:()=>{F.ranges!==w&&C(F.ranges)},onMouseLeave:()=>C([]),onClick:()=>{e(F)},className:`
|
|
21
21
|
${he.ruleItem}
|
|
22
22
|
${d===H?he.active:""}
|
|
23
|
-
`,children:[
|
|
23
|
+
`,children:[_.jsx("div",{className:`
|
|
24
24
|
${he.draggableHandle}
|
|
25
25
|
draggableHandle
|
|
26
|
-
`,onClick:oe=>oe.stopPropagation(),children:
|
|
26
|
+
`,onClick:oe=>oe.stopPropagation(),children:_.jsx(Rn,{})}),_.jsxs("div",{className:he.ruleDescribe,children:[_.jsx("div",{className:he.ruleType,children:Oa(F,u)}),_.jsx("div",{className:he.ruleRange,children:F.ranges.map(oe=>Gt.serializeRange(oe)).join(",")})]}),_.jsx("div",{className:he.preview,children:_.jsx(We,{rule:F.rule})}),_.jsx("div",{className:`
|
|
27
27
|
${he.deleteItem}
|
|
28
28
|
${d===H?he.active:""}
|
|
29
|
-
`,onClick:oe=>{oe.stopPropagation(),V(F),C([])},children:
|
|
30
|
-
${
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
${
|
|
34
|
-
`,children:
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
${A.mTSm}
|
|
39
|
-
`,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{b(O);const x=c.createDefaultValueByValueType(O,10);R(x),z({minType:O,medianType:m,maxType:_,minValue:x,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"min",className:`
|
|
29
|
+
`,onClick:oe=>{oe.stopPropagation(),V(F),C([])},children:_.jsx(Ct,{})})]})},`${F.cfId}`))}):null})]})},mr={cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},xe=t=>{const{color:e,onChange:r,disable:n=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=t,y=ee.useDependency(ee.ComponentManager),p=L.useMemo(()=>new T.ColorKit(e),[e]),b=y.get(a);return b&&(n?_.jsx(b,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):_.jsx(re.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(re.ColorPicker,{value:e,onChange:r})}),children:_.jsxs("span",{className:`
|
|
30
|
+
${mr.cfColorPickerIcon}
|
|
31
|
+
${o}
|
|
32
|
+
`,children:[_.jsx(b,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&_.jsx(Tt,{className:mr.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),hn=t=>{var C;const{type:e,className:r,onChange:n,id:a,value:o}=t,u=ee.useDependency(T.IUniverInstanceService),y=u.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(C=u.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:C.getSheetId(),b=L.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=L.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]),I=L.useRef({}),[E,w]=L.useState(!1);return ee.useSidebarClick(R=>{var i;const h=(i=I.current)==null?void 0:i.handleOutClick;h&&h(R,()=>w(!1))}),e===c.CFValueType.formula?_.jsx("div",{style:{width:"100%",marginLeft:4},children:_.jsx(Ge.FormulaEditor,{initValue:b,unitId:y,subUnitId:p,isFocus:E,onChange:(R="")=>{n(R||"")},onFocus:()=>w(!0),actions:I.current})}):_.jsx(re.InputNumber,{className:r,value:Number(t.value)||0,onChange:R=>t.onChange(R||0),...m})},Da=t=>{var V;const{interceptorManager:e}=t,r=ee.useDependency(T.LocaleService),n=((V=t.rule)==null?void 0:V.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,r),Ne(c.CFValueType.percent,r),Ne(c.CFValueType.percentile,r),Ne(c.CFValueType.formula,r)],o=[Ne(c.CFValueType.min,r),...a],u=[Ne("none",r),...a],y=[Ne(c.CFValueType.max,r),...a],[p,b]=L.useState(()=>{var x;const O=c.CFValueType.min;return n&&((x=n.config[0])==null?void 0:x.value.type)||O}),[m,I]=L.useState(()=>{var x;const O="none";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.value.type)||O}),[E,w]=L.useState(()=>{var x;const O=c.CFValueType.max;return n&&((x=n.config[n.config.length-1])==null?void 0:x.value.type)||O}),[C,R]=L.useState(()=>{if(!n)return 10;const x=n.config[0];return(x==null?void 0:x.value.value)===void 0?10:x==null?void 0:x.value.value}),[h,i]=L.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const x=(W=n.config[1])==null?void 0:W.value.value;return x===void 0?50:x}),[s,d]=L.useState(()=>{var W;if(!n)return 90;const x=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return x===void 0?90:x}),[S,l]=L.useState(()=>{var x;const O="#d0d9fb";return n&&((x=n.config[0])==null?void 0:x.color)||O}),[g,f]=L.useState(()=>{var x;const O="#7790f3";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.color)||O}),[v,P]=L.useState(()=>{var x;const O="#2e55ef";return n&&((x=n.config[n.config.length-1])==null?void 0:x.color)||O}),U=L.useMemo(()=>O=>{const{minType:x,medianType:W,maxType:X,minValue:Y,medianValue:ae,maxValue:te,minColor:F,medianColor:H,maxColor:oe}=O,se=[];return se.push({color:F,value:{type:x,value:Y}}),W!=="none"&&se.push({color:H,value:{type:W,value:ae}}),se.push({color:oe,value:{type:X,value:te}}),{config:se.map((ge,ye)=>({...ge,index:ye})),type:c.CFRuleType.colorScale}},[]);L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return U({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),[U,p,m,E,C,h,s,S,g,v,e]);const z=O=>{t.onChange(U(O))};return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
33
|
+
${G.cfPreviewWrap}
|
|
34
|
+
`,children:_.jsx(We,{rule:U({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})})}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:re.clsx(`
|
|
35
|
+
${A.labelContainer}
|
|
36
|
+
${A.mTSm}
|
|
37
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(re.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{b(O);const x=c.createDefaultValueByValueType(O,10);R(x),z({minType:O,medianType:m,maxType:E,minValue:x,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),_.jsx(hn,{id:"min",className:`
|
|
40
38
|
${A.mLXxs}
|
|
41
|
-
`,value:C,type:p,onChange:O=>{R(O),z({minType:p,medianType:m,maxType:
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
`,value:C,type:p,onChange:O=>{R(O),z({minType:p,medianType:m,maxType:E,minValue:O,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),_.jsx(xe,{className:A.mLXxs,color:S,onChange:O=>{l(O),z({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.medianValue")}),_.jsxs("div",{className:re.clsx(`
|
|
40
|
+
${A.labelContainer}
|
|
41
|
+
${A.mTSm}
|
|
42
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(re.Select,{style:{flexShrink:0},options:u,value:m,onChange:O=>{I(O);const x=c.createDefaultValueByValueType(O,50);i(x),z({minType:p,medianType:O,maxType:E,minValue:C,medianValue:x,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),_.jsx(hn,{id:"median",className:`
|
|
45
43
|
${A.mLXxs}
|
|
46
|
-
`,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
44
|
+
`,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:E,minValue:C,medianValue:O,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),m!=="none"&&_.jsx(xe,{className:A.mLXxs,color:g,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:O,maxColor:v})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:re.clsx(`
|
|
45
|
+
${A.labelContainer}
|
|
46
|
+
${A.mTSm}
|
|
47
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(re.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{w(O);const x=c.createDefaultValueByValueType(O,90);d(x),z({minType:p,medianType:m,maxType:O,minValue:C,medianValue:h,maxValue:x,minColor:S,medianColor:g,maxColor:v})}}),_.jsx(hn,{id:"max",className:`
|
|
50
48
|
${A.mLXxs}
|
|
51
|
-
`,value:s,type:
|
|
49
|
+
`,value:s,type:E,onChange:O=>{d(O),z({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:O,minColor:S,medianColor:g,maxColor:v})}}),_.jsx(xe,{className:A.mLXxs,color:v,onChange:O=>{P(O),z({minType:p,medianType:m,maxType:E,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),yr=t=>{var R;const{onChange:e,className:r,value:n,type:a,id:o,disabled:u=!1}=t,y=ee.useDependency(T.IUniverInstanceService),p=y.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),b=(R=y.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId(),m=L.useRef({}),[I,E]=L.useState(!1);ee.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>E(!1))});const w=L.useRef(n),C=L.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(w.current).startsWith("=")?String(w.current)||"":"=";return _.jsx("div",{style:{width:"100%",marginLeft:12},children:_.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:b,isFocus:I,onChange:(i="")=>{e(i||"")},onFocus:()=>E(!0),actions:m.current})})}return _.jsx(re.InputNumber,{className:r,value:Number(n)||0,disabled:u,onChange:h=>{e(h||0)},...C})},Pa=t=>{var V;const{interceptorManager:e}=t,r=ee.useDependency(T.LocaleService),n=((V=t.rule)==null?void 0:V.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=L.useState(()=>{var x;const O="0";return n?(x=n.config)!=null&&x.isGradient?"1":"0":O}),[u,y]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,b]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,r),je(c.CFValueType.percent,r),je(c.CFValueType.percentile,r),je(c.CFValueType.formula,r)],I=[je(c.CFValueType.min,r),...m],E=[je(c.CFValueType.max,r),...m],[w,C]=L.useState(()=>{var x;const O=I[0].value;return n&&((x=n.config)==null?void 0:x.min.type)||O}),[R,h]=L.useState(()=>{var x;const O=E[0].value;return n&&((x=n.config)==null?void 0:x.max.type)||O}),[i,s]=L.useState(()=>{var W;if(!n)return 0;const x=((W=n.config)==null?void 0:W.min)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value||0}),[d,S]=L.useState(()=>{var W;if(!n)return 100;const x=((W=n.config)==null?void 0:W.max)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value===void 0?100:x.value}),[l,g]=L.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=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});L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,w,d,R,u,p,e,l]);const v=O=>{t.onChange(f(O))},P=O=>{y(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:O,nativeColor:p,isShowValue:l})},U=O=>{b(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>m.map(x=>x.value).includes(O);return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
52
50
|
${G.cfPreviewWrap}
|
|
53
|
-
`,children:
|
|
51
|
+
`,children:_.jsx(We,{rule:f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})})}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.fillType")}),_.jsxs("div",{className:`
|
|
54
52
|
${A.mTSm}
|
|
55
53
|
${A.mLXxs}
|
|
56
54
|
${A.labelContainer}
|
|
57
|
-
`,children:[
|
|
55
|
+
`,children:[_.jsxs(re.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})},children:[_.jsx(re.Radio,{value:"0",children:_.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.pureColor")})}),_.jsx(re.Radio,{value:"1",children:_.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.gradient")})})]}),_.jsxs("div",{className:`
|
|
58
56
|
${G.utilItem}
|
|
59
57
|
${A.mLXl}
|
|
60
|
-
`,children:[
|
|
58
|
+
`,children:[_.jsx(re.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:!O})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.colorSet")}),_.jsxs("div",{className:`
|
|
61
59
|
${A.labelContainer}
|
|
62
60
|
${A.mTSm}
|
|
63
61
|
${A.mLXxs}
|
|
64
|
-
`,children:[
|
|
62
|
+
`,children:[_.jsxs("div",{className:`
|
|
65
63
|
${A.labelContainer}
|
|
66
|
-
`,children:[
|
|
64
|
+
`,children:[_.jsx("div",{className:`
|
|
67
65
|
${G.text}
|
|
68
|
-
`,children:r.t("sheet.cf.panel.native")}),
|
|
66
|
+
`,children:r.t("sheet.cf.panel.native")}),_.jsx(xe,{color:p,onChange:U})]}),_.jsxs("div",{className:`
|
|
69
67
|
${A.labelContainer}
|
|
70
68
|
${A.mLSm}
|
|
71
|
-
`,children:[
|
|
69
|
+
`,children:[_.jsx("div",{className:`
|
|
72
70
|
${G.text}
|
|
73
|
-
`,children:r.t("sheet.cf.panel.positive")}),
|
|
71
|
+
`,children:r.t("sheet.cf.panel.positive")}),_.jsx(xe,{color:u,onChange:P})]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
74
72
|
${A.mTSm}
|
|
75
73
|
${A.labelContainer}
|
|
76
|
-
`,children:[
|
|
74
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:I,value:w,onChange:O=>{C(O);const x=c.createDefaultValueByValueType(O,10);s(x),v({isGradient:a,minValue:x,minValueType:O,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),_.jsx(yr,{disabled:!z(w),id:"min",type:w,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),_.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
77
75
|
${A.mTSm}
|
|
78
76
|
${A.labelContainer}
|
|
79
|
-
`,children:[
|
|
77
|
+
`,children:[_.jsx(re.Select,{style:{width:"50%",flexShrink:0},options:E,value:R,onChange:O=>{h(O);const x=c.createDefaultValueByValueType(O,90);S(x),v({isGradient:a,minValue:i,minValueType:w,maxValue:x,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),_.jsx(yr,{disabled:!z(R),id:"max",type:R,className:A.mLSm,value:d,onChange:O=>{S(O||0),v({isGradient:a,minValue:i,minValueType:w,maxValue:O||0,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})};function Sr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(r=Sr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function xt(){for(var t,e,r=0,n="",a=arguments.length;r<a;r++)(t=arguments[r])&&(e=Sr(t))&&(n&&(n+=" "),n+=e);return n}const _e={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Nt=t=>[T.BooleanNumber.FALSE,void 0].includes(t)?T.BooleanNumber.TRUE:T.BooleanNumber.FALSE,Lt=t=>t!==T.BooleanNumber.FALSE,gn=t=>{const{style:e,onChange:r,className:n}=t,a=ee.useDependency(ee.ComponentManager),[o,u]=L.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=L.useState(()=>{if(e!=null&&e.it)return e.it}),[b,m]=L.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[I,E]=L.useState(()=>{if(e!=null&&e.st)return e.st.s}),[w,C]=L.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[R,h]=L.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"),d=a.get("UnderlineSingle"),S=a.get("StrikethroughSingle");return L.useEffect(()=>{const l={bl:o,it:y};w!==void 0&&(l.cl={rgb:w}),R!==void 0&&(l.bg={rgb:R}),I!==void 0&&(l.st={s:I}),b!==void 0&&(l.ul={s:b}),r(c.removeUndefinedAttr(l))},[o,y,b,I,w,R]),_.jsxs("div",{className:`
|
|
80
78
|
${_e.cfStyleEdit}
|
|
81
79
|
${n}
|
|
82
|
-
`,children:[i&&
|
|
80
|
+
`,children:[i&&_.jsx("div",{className:xt({[_e.isActive]:Lt(o||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>u(Nt(o)),children:_.jsx(i,{})}),s&&_.jsx("div",{className:xt({[_e.isActive]:Lt(y||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>p(Nt(y)),children:_.jsx(s,{})}),d&&_.jsx("div",{className:xt({[_e.isActive]:Lt(b||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>m(Nt(b)),children:_.jsx(d,{})}),S&&_.jsx("div",{className:xt({[_e.isActive]:Lt(I||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>E(Nt(I)),children:_.jsx(S,{})}),_.jsx(xe,{color:w,onChange:C,iconId:"FontColor"}),_.jsx(xe,{color:R,onChange:h,iconId:"PaintBucket"})]})},xa=t=>{var S;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(T.LocaleService),o=ee.useDependency(T.IUniverInstanceService).getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=L.useRef(null),[b,m]=L.useState(!1),I=L.useRef({}),[E,w]=L.useState({}),[C,R]=L.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=L.useState(void 0),s=l=>({style:l.style,value:C,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,C,r]),L.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,f,v)=>h||C.length===1||!C.startsWith("=")?(i(n.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,C]);const d=l=>{e(s(l))};return ee.useSidebarClick(l=>{var f;const g=(f=I.current)==null?void 0:f.handleOutClick;g&&g(l,()=>m(!1))}),_.jsxs("div",{ref:p,children:[_.jsx("div",{className:`
|
|
83
81
|
${A.title}
|
|
84
82
|
${A.mTBase}
|
|
85
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
83
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
86
84
|
${A.mTSm}
|
|
87
|
-
`,children:
|
|
85
|
+
`,children:_.jsx(Ge.FormulaEditor,{onChange:l=>{R(l),d({style:E})},onVerify:(l,g)=>{!l||g.length===1?i(n.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:I.current,isFocus:b,initValue:C,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),_.jsx("div",{className:`
|
|
88
86
|
${G.cfPreviewWrap}
|
|
89
|
-
`,children:
|
|
87
|
+
`,children:_.jsx(We,{rule:s({style:E})})}),_.jsx(gn,{style:y==null?void 0:y.style,className:`
|
|
90
88
|
${A.mTSm}
|
|
91
|
-
`,onChange:l=>{w(l),d({style:l})}})]})},Ut=
|
|
89
|
+
`,onChange:l=>{w(l),d({style:l})}})]})},Ut=t=>_.jsxs("div",{style:{position:"relative"},children:[_.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}),Na=t=>{const{type:e,operator:r,onChange:n,value:a,interceptorManager:o}=t,u=ee.useDependency(T.LocaleService),[y,p]=L.useState(()=>typeof a=="number"?a:0),[b,m]=L.useState(""),[I,E]=L.useState(()=>typeof a=="string"?a:""),[w,C]=L.useState(""),[R,h]=L.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=L.useState(""),[d,S]=L.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=L.useState("");switch(L.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(r)&&n(I);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)&&n(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)&&n([R,d]);break}}},[e]),L.useEffect(()=>{const f=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,P,U)=>{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(r))return I?U(v):(C(u.t("sheet.cf.errorMessage.notBlank")),!1)}return U(v)}});return()=>{f()}},[e,y,I,r]),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(r)){const f=v=>{E(v),n(v)};return _.jsx("div",{className:`
|
|
92
90
|
${A.mTSm}
|
|
93
|
-
`,children:
|
|
91
|
+
`,children:_.jsx(Ut,{errorText:w,children:_.jsx(re.Input,{className:G.width100,value:I,onChange:v=>{C(""),f(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(r)){const f=v=>{p(v||0),n(v||0),m("")};return _.jsx("div",{className:`
|
|
94
92
|
${A.mTSm}
|
|
95
|
-
`,children:
|
|
93
|
+
`,children:_.jsx(Ut,{errorText:b,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:f})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)){const f=P=>{h(P||0),n([P||0,d]),s("")},v=P=>{S(P||0),n([R,P||0]),g("")};return _.jsxs("div",{className:`
|
|
96
94
|
${A.mTSm}
|
|
97
95
|
${A.labelContainer}
|
|
98
|
-
`,children:[
|
|
96
|
+
`,children:[_.jsx(Ut,{errorText:i,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:R,onChange:f})}),_.jsx(Ut,{errorText:l,children:_.jsx(re.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
99
97
|
${A.mLSm}
|
|
100
|
-
`,value:d,onChange:v})})]})}}}return null},br=(e
|
|
98
|
+
`,value:d,onChange:v})})]})}}}return null},br=(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)]}},Cr=t=>{var S;const{interceptorManager:e,onChange:r}=t,n=ee.useDependency(T.LocaleService),a=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=L.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=L.useMemo(()=>br(o,n),[o]),[b,m]=L.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[I,E]=L.useState(()=>{var f;const l="";return a?(f=a.value)!=null?f:c.createDefaultValue(a.subType,a.operator):l}),[w,C]=L.useState({}),R=L.useMemo(()=>l=>{var g,f,v,P,U,z,V,O,x,W,X,Y,ae,te,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(b))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(f=l.operator)!=null?f:b,style:(v=l.style)!=null?v:w,value:(P=l.value)!=null?P:I};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(b))return{type:c.CFRuleType.highlightCell,subType:(U=l.subType)!=null?U:o,operator:(z=l.operator)!=null?z:b,style:(V=l.style)!=null?V:w,value:(O=l.value)!=null?O:I};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(b))return{type:c.CFRuleType.highlightCell,subType:(x=l.subType)!=null?x:o,operator:(W=l.operator)!=null?W:b,style:(X=l.style)!=null?X:w,value:(Y=l.value)!=null?Y:I};break}}return{type:c.CFRuleType.highlightCell,subType:(ae=l.subType)!=null?ae:o,operator:(te=l.operator)!=null?te:b,style:(F=l.style)!=null?F:w}},[o,b,I,w]);L.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return R({})}}),[R,e]),L.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,f=br(g,n),v=f&&f[0].value;u(g),m(v),v&&E(c.createDefaultValue(g,v)),r(R({subType:g,operator:v}))},i=l=>{const g=l;m(g),r(R({operator:g}))},s=l=>{E(l),r(R({value:l}))},d=L.useMemo(()=>`${o}_${b}_${Math.random()}`,[o,b]);return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
101
99
|
${A.title}
|
|
102
100
|
${A.mTBase}
|
|
103
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
101
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(re.Select,{className:`
|
|
104
102
|
${A.mTSm}
|
|
105
103
|
${G.width100}
|
|
106
|
-
`,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&
|
|
104
|
+
`,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&_.jsx(re.Select,{className:`
|
|
107
105
|
${A.mTSm}
|
|
108
106
|
${G.width100}
|
|
109
|
-
`,onChange:i,value:b||"",options:p}),
|
|
107
|
+
`,onChange:i,value:b||"",options:p}),_.jsx(Na,{value:I,interceptorManager:e,type:o,operator:b,rule:a,onChange:s},d),_.jsx("div",{className:`
|
|
110
108
|
${G.cfPreviewWrap}
|
|
111
|
-
`,children:
|
|
109
|
+
`,children:_.jsx(We,{rule:R({})})}),_.jsx(gn,{style:a==null?void 0:a.style,className:`
|
|
112
110
|
${A.mLXxs}
|
|
113
|
-
`,onChange:l=>{C(l),r(R({style:l}))}})]})},Tr=(e
|
|
111
|
+
`,onChange:l=>{C(l),r(R({style:l}))}})]})},Tr=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",La=t=>{var p;const e=ee.useDependency(T.IUniverInstanceService),r=e.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=L.useMemo(()=>t.error?G.errorInput:"",[t.error]),o=L.useRef({}),[u,y]=L.useState(!1);return ee.useSidebarClick(b=>{var I;const m=(I=o.current)==null?void 0:I.handleOutClick;m&&m(b,()=>y(!1))}),_.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?_.jsxs(_.Fragment,{children:[_.jsx(re.InputNumber,{className:a,value:Number(t.value)||0,onChange:b=>t.onChange(b!=null?b:0)}),t.error&&_.jsx("div",{className:G.errorText,children:t.error})]}):_.jsx("div",{style:{width:"100%"},children:_.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:u,onChange:(b="")=>{const m=b||"";t.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},Ir=(t,e,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Ua=L.forwardRef((t,e)=>{const r=ee.useDependency(T.LocaleService),n=a=>{t.onClick(a)};return _.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>_.jsxs("div",{className:G.group,children:[_.jsx("div",{className:G.title,children:r.t(a.title)}),_.jsx("div",{className:G.itemContent,children:a.group.map(u=>_.jsx("div",{className:G.itemWrap,onClick:()=>{n(u.name)},children:_.jsx("div",{className:G.item,children:u.list.map((y,p)=>_.jsx("img",{className:G.icon,src:y},p))})},u.name))})]},o))})}),Va=t=>{const e=L.useMemo(()=>{const n=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{n.push({iconType:u,base64:y,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return _.jsxs("div",{className:G.iconItemListWrap,children:[_.jsxs("div",{className:G.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[_.jsx($e,{className:G.icon}),_.jsx("span",{children:"无单元格图标"})]}),_.jsx("div",{className:G.iconItemList,children:e.map(n=>_.jsx("div",{className:G.item,children:_.jsx("img",{onClick:()=>r(n),className:`
|
|
114
112
|
${G.icon}
|
|
115
|
-
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},za=
|
|
116
|
-
${
|
|
117
|
-
`,children:[
|
|
113
|
+
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},za=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,a=ee.useDependency(T.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=(I,E)=>{e([String(E),"value","value"],I)},p=(I,E)=>{e([String(E),"operator"],I);const w=c.createDefaultValue(c.CFSubRuleType.number,I);y(w,E)},b=(I,E)=>{e([String(E),"value","type"],I);const w=r[E],C=c.createDefaultValue(c.CFSubRuleType.number,w.operator);y(C,E)};return L.useMemo(()=>r.map((I,E)=>{const w=n[E],C=Tr(I.iconType,I.iconId),R=E===r.length-1,h=E===0,i=r[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,d=(S,l)=>{const g={...I,iconId:l,iconType:S};e([String(E)],g)};return _.jsxs("div",{className:`
|
|
114
|
+
${E?A.mTXl:A.mTSm}
|
|
115
|
+
`,children:[_.jsxs("div",{className:`
|
|
118
116
|
${A.label}
|
|
119
117
|
${G.flex}
|
|
120
|
-
`,children:[
|
|
118
|
+
`,children:[_.jsxs("div",{className:`
|
|
121
119
|
${G.width45}
|
|
122
|
-
`,children:[a.t("sheet.cf.iconSet.icon"),
|
|
120
|
+
`,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),_.jsx("div",{className:`
|
|
123
121
|
${G.width45}
|
|
124
|
-
`,children:
|
|
122
|
+
`,children:_.jsxs(_.Fragment,{children:[!h&&!R&&a.t("sheet.cf.iconSet.rule"),!h&&!R&&_.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),_.jsxs("div",{className:`
|
|
125
123
|
${G.flex}
|
|
126
124
|
${A.mTSm}
|
|
127
|
-
`,children:[
|
|
125
|
+
`,children:[_.jsx("div",{className:`
|
|
128
126
|
${G.iconWrap}
|
|
129
127
|
${G.width45}
|
|
130
|
-
`,children:
|
|
128
|
+
`,children:_.jsx(re.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(Va,{onClick:d,iconId:I.iconId,iconType:I.iconType})}),children:_.jsxs("div",{className:re.clsx(G.dropdownIcon,"univer-box-border univer-h-7"),children:[C?_.jsx("img",{src:C,className:G.icon}):_.jsx($e,{className:G.icon}),_.jsx(Tt,{})]})})}),R?_.jsxs("div",{className:`
|
|
131
129
|
${G.width45}
|
|
132
130
|
${A.label}
|
|
133
|
-
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),
|
|
131
|
+
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),_.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):_.jsx(re.Select,{className:`
|
|
134
132
|
${A.mL0}
|
|
135
133
|
${G.width45}
|
|
136
134
|
${A.mR0}
|
|
137
|
-
`,options:o,value:I.operator,onChange:S=>{p(S,
|
|
135
|
+
`,options:o,value:I.operator,onChange:S=>{p(S,E)}})]}),R?_.jsx("div",{}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:`
|
|
138
136
|
${A.mTSm}
|
|
139
137
|
${A.label}
|
|
140
138
|
${G.flex}
|
|
141
|
-
`,children:[
|
|
139
|
+
`,children:[_.jsx("div",{className:`
|
|
142
140
|
${G.width45}
|
|
143
|
-
`,children:a.t("sheet.cf.iconSet.type")}),
|
|
141
|
+
`,children:a.t("sheet.cf.iconSet.type")}),_.jsx("div",{className:`
|
|
144
142
|
${G.width45}
|
|
145
|
-
`,children:a.t("sheet.cf.iconSet.value")})]}),
|
|
143
|
+
`,children:a.t("sheet.cf.iconSet.value")})]}),_.jsxs("div",{className:`
|
|
146
144
|
${A.mTSm}
|
|
147
145
|
${G.flex}
|
|
148
|
-
`,children:[
|
|
146
|
+
`,children:[_.jsx(re.Select,{style:{flexShrink:0},className:`
|
|
149
147
|
${G.width45}
|
|
150
148
|
${A.mL0}
|
|
151
|
-
`,options:u,value:I.value.type,onChange:S=>{b(S,
|
|
149
|
+
`,options:u,value:I.value.type,onChange:S=>{b(S,E)}}),_.jsx("div",{className:`
|
|
152
150
|
${A.mL0}
|
|
153
151
|
${G.width45}
|
|
154
|
-
`,children:
|
|
152
|
+
`,children:_.jsx(La,{id:E,type:I.value.type,error:w,value:I.value.value||"",onChange:S=>y(S,E)})})]})]})]},E)}),[r,n])},ka=t=>{var S;const{interceptorManager:e}=t,r=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.iconSet?t.rule:void 0,n=ee.useDependency(T.LocaleService),[a,o]=L.useState({}),[u,y]=L.useState(()=>{const l=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(v=>v.iconType!==g))return g}return l}),[p,b]=L.useState(()=>{if(r&&r.config.length)return T.Tools.deepClone(r==null?void 0:r.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,f,v)=>f===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(f)}:Ir(u,f,v))}),[m,I]=L.useState(()=>r?!!r.isShowValue:!0),E=L.useMemo(()=>{const l=p.map(g=>Tr(g.iconType,g.iconId));return _.jsx("div",{className:G.iconWrap,children:l.map((g,f)=>g?_.jsx("img",{className:G.icon,src:g},f):_.jsx($e,{className:G.icon},f))})},[p]),w=l=>{if(l.reduce((f,v,P)=>f.preType&&!f.result||l.length-1===P?f:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:f.preType?{result:f.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 f={};return l.forEach((v,P,U)=>{if(P-1<0||P===U.length-1)return;const V=l[P-1],O=c.getOppositeOperator(V.operator);c.compareWithNumber({operator:O,value:V.value.value},v.value.value)||(f[P]=`${n.t(`sheet.cf.form.${O}`,String(V.value.value))} `)}),f}return{}},C=(l,g)=>{T.get(p,l)!==g&&(T.set(p,l,g),b([...p]),o(w(p)))},R=l=>{y(l);const g=c.iconMap[l]||[],f=new Array(g.length).fill("").map((v,P,U)=>Ir(l,P,U));b(f),o(w(f))};L.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,e]),L.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,f)=>{const v=p.length-1-f,P=l[v];g.iconId=P.iconId,g.iconType=P.iconType}),b([...p])},i=ee.useDependency(ee.ILayoutService),[s,d]=L.useState();return ee.useScrollYOverContainer(s,i.rootContainerElement),_.jsxs("div",{className:G.iconSet,children:[_.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
155
153
|
${A.mTSm}
|
|
156
|
-
`,children:
|
|
154
|
+
`,children:_.jsx(re.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(Ua,{ref:l=>{!s&&l&&d(l)},iconType:u,onClick:R})}),children:_.jsxs("div",{className:re.clsx(G.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,_.jsx(Tt,{})]})})}),_.jsxs("div",{className:`
|
|
157
155
|
${A.mTSm}
|
|
158
156
|
${G.renderConfig}
|
|
159
|
-
`,children:[
|
|
157
|
+
`,children:[_.jsxs("div",{className:G.utilItem,children:[_.jsx(re.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),_.jsxs("div",{className:`
|
|
160
158
|
${G.utilItem}
|
|
161
159
|
${A.mLXl}
|
|
162
|
-
`,children:[
|
|
160
|
+
`,children:[_.jsx(re.Checkbox,{checked:!m,onChange:l=>{I(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),_.jsx(za,{errorMap:a,onChange:C,configList:p})]})},Aa=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=ee.useDependency(T.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,o=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,y]=L.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,b]=L.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,I]=L.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,w]=L.useState({}),C=i=>{const{type:s,isPercent:d,value:S,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:S,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:S,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}};L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return C({type:u,isPercent:m,value:p,style:E})}}),[u,m,p,E,r]);const R=i=>{e(C(i))};return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
163
161
|
${A.title}
|
|
164
162
|
${A.mTBase}
|
|
165
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),
|
|
163
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),_.jsx(re.Select,{className:`
|
|
166
164
|
${G.width100}
|
|
167
165
|
${A.mTSm}
|
|
168
|
-
`,value:u,options:o,onChange:i=>{y(i),R({type:i,isPercent:m,value:p,style:
|
|
166
|
+
`,value:u,options:o,onChange:i=>{y(i),R({type:i,isPercent:m,value:p,style:E})}}),["isNotBottom","isBottom"].includes(u)&&_.jsxs("div",{className:`
|
|
169
167
|
${A.labelContainer}
|
|
170
168
|
${A.mTSm}
|
|
171
|
-
`,children:[
|
|
169
|
+
`,children:[_.jsx(re.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;b(s),R({type:u,isPercent:m,value:s,style:E})}}),_.jsxs("div",{className:`
|
|
172
170
|
${A.mLSm}
|
|
173
171
|
${A.labelContainer}
|
|
174
172
|
${G.text}
|
|
175
|
-
`,children:[
|
|
173
|
+
`,children:[_.jsx(re.Checkbox,{checked:m,onChange:i=>{I(!!i),R({type:u,isPercent:!!i,value:p,style:E})}}),n.t("sheet.cf.valueType.percent")]})]}),_.jsx("div",{className:`
|
|
176
174
|
${G.cfPreviewWrap}
|
|
177
|
-
`,children:
|
|
175
|
+
`,children:_.jsx(We,{rule:C({type:u,isPercent:m,value:p,style:E})})}),_.jsx(gn,{style:a==null?void 0:a.style,className:`
|
|
178
176
|
${A.mTSm}
|
|
179
|
-
`,onChange:i=>{w(i),R({type:u,isPercent:m,value:p,style:i})}})]})},Wa=T.createInterceptorKey("beforeSubmit"),ja=T.createInterceptorKey("submit"),wr=
|
|
177
|
+
`,onChange:i=>{w(i),R({type:u,isPercent:m,value:p,style:i})}})]})},Wa=T.createInterceptorKey("beforeSubmit"),ja=T.createInterceptorKey("submit"),wr=t=>t.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),Rr=t=>{var e;return(e=t.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Ha=t=>{var U,z,V;const e=ee.useDependency(T.LocaleService),r=ee.useDependency(T.ICommandService),n=ee.useDependency(T.IUniverInstanceService),a=ee.useDependency(c.ConditionalFormattingRuleModel),o=ee.useDependency(q.SheetsSelectionsService),u=wr(n),y=Rr(n),[p,b]=L.useState(!0),m=L.useRef({}),[I,E]=L.useState(void 0),w=L.useRef((z=(U=t.rule)==null?void 0:U.ranges)!=null?z:[]),C=L.useMemo(()=>{var x,W,X;let O=(x=t.rule)==null?void 0:x.ranges;return O!=null&&O.length||(O=(X=(W=o.getCurrentSelections())==null?void 0:W.map(Y=>Y.range))!=null?X:[]),w.current=O,O!=null&&O.length?O.map(Y=>{const ae=Gt.serializeRange(Y);return ae==="NaN"?"":ae}).filter(Y=>!!Y).join(","):""},[t.rule]),R=[{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"}],[h,i]=L.useState(()=>{var W,X;const O=(W=t.rule)==null?void 0:W.rule.type,x=R[0].value;if(!O)return x;switch(O){case c.CFRuleType.highlightCell:{switch((X=t.rule)==null?void 0:X.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 x}),s=L.useRef(void 0),d=L.useMemo(()=>new T.InterceptorManager({beforeSubmit:Wa,submit:ja}),[]),S=L.useMemo(()=>{switch(h){case"1":return Cr;case"2":return Aa;case"3":return Pa;case"4":return Da;case"5":return xa;case"6":return ka;default:return Cr}},[h]);L.useEffect(()=>{const O=r.onCommandExecuted(x=>{if(x.id===q.RemoveSheetMutation.id){const W=x.params;W.subUnitId===y&&W.unitId===u&&t.onCancel()}x.id===q.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>O.dispose()},[]);const l=O=>{s.current=O},g=O=>{const x=O.split(",").filter(W=>!!W).map(Gt.deserializeRangeWithSheet).map(W=>W.range);w.current=x},f=()=>{if(I)return;const x=(()=>{const X=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!X)throw new Error("No active sheet found");return w.current.map(te=>q.setEndForRange(te,X.getRowCount(),X.getColumnCount())).filter(te=>!(Number.isNaN(te.startRow)||Number.isNaN(te.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const X=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(X){const Y=wr(n),ae=Rr(n);if(!Y||!ae)throw new Error("No active sheet found");let te={};t.rule&&t.rule.cfId?(te={...t.rule,ranges:x,rule:X},r.executeCommand(bt.id,{unitId:Y,subUnitId:ae,rule:te}),t.onCancel()):(te={cfId:a.createCfId(Y,ae),ranges:x,rule:X,stopIfTrue:!1},r.executeCommand(Xe.id,{unitId:Y,subUnitId:ae,rule:te}),t.onCancel())}}},v=()=>{t.onCancel()},P=(O,x)=>{O?x.length<1?E(e.t("sheet.cf.errorMessage.rangeError")):E(void 0):E(e.t("sheet.cf.errorMessage.rangeError"))};return ee.useSidebarClick(O=>{var W;const x=(W=m.current)==null?void 0:W.handleOutClick;x&&x(O,()=>b(!1))}),_.jsxs("div",{className:G.cfRuleStyleEditor,children:[_.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),_.jsx("div",{className:`
|
|
180
178
|
${A.mTBase}
|
|
181
|
-
`,children:
|
|
179
|
+
`,children:_.jsx(Ge.RangeSelector,{unitId:u,errorText:I,subUnitId:y,initValue:C,onChange:g,onVerify:P,onFocus:()=>b(!0),isFocus:p,actions:m.current})}),_.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),_.jsx("div",{className:A.mTBase,children:_.jsx(re.Select,{className:G.width100,value:h,options:R,onChange:O=>i(O)})}),_.jsx(S,{interceptorManager:d,rule:(V=t.rule)==null?void 0:V.rule,onChange:l}),_.jsxs("div",{className:`
|
|
182
180
|
${A.mTBase}
|
|
183
181
|
${G.btnList}
|
|
184
|
-
`,children:[E.jsx(ae.Button,{size:"small",onClick:v,children:t.t("sheet.cf.panel.cancel")}),E.jsx(ae.Button,{className:A.mLSm,size:"small",type:"primary",onClick:f,children:t.t("sheet.cf.panel.submit")})]})]})},Ba=e=>{const[t,r]=L.useState(e.rule),[n,a]=L.useState(!!e.rule),o=()=>{a(!0)},u=()=>{a(!1),r(void 0)},y=p=>{r(p),a(!0)};return E.jsx("div",{className:A.conditionalFormattingWrap,children:n?E.jsx(Ha,{onCancel:u,rule:t}):E.jsx(Ma,{onClick:y,onCreate:o})})};var Fa=Object.getOwnPropertyDescriptor,Ga=(e,t,r,n)=>{for(var a=n>1?void 0:n?Fa(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},st=(e,t)=>(r,n)=>t(r,n,e);const Vt="sheet.conditional.formatting.panel";let lt=class extends T.Disposable{constructor(t,r,n,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=t,this._injector=r,this._componentManager=n,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Vt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(t){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:t,key:T.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ba)}};lt=Ga([st(0,T.IUniverInstanceService),st(1,T.Inject(T.Injector)),st(2,T.Inject(ee.ComponentManager)),st(3,T.Inject(ee.ISidebarService)),st(4,T.Inject(T.LocaleService))],lt);var me=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(me||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:T.CommandType.OPERATION,handler:(e,t)=>{var y;const r=e.get(lt),n=e.get(q.SheetsSelectionsService),a=e.get(T.ICommandService),o=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(t.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(yt.id,{ranges:o});break}case 10:{a.executeCommand(Ye.id);break}}return!0}};var qa=Object.getOwnPropertyDescriptor,Xa=(e,t,r,n)=>{for(var a=n>1?void 0:n?qa(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},ut=(e,t)=>(r,n)=>t(r,n,e);let dt=class extends T.Disposable{constructor(t,r,n,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,r,n)=>this._collectConditionalRule(t,r,n),onPasteCells:(t,r,n,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=t||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(t,r,n){const a=new T.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:r,cfMap:o}};const u=this._injector.invoke(m=>fe.rangeToDiscreteRange(n,m,t,r));if(!u)return;const{rows:y,cols:p}=u,b=new Set;y.forEach((m,I)=>{p.forEach((_,w)=>{const C=this._conditionalFormattingViewModel.getCellCfs(t,r,m,_);C&&(C.forEach(R=>b.add(R.cfId)),a.setValue(I,w,C.map(R=>R.cfId)))})}),b.forEach(m=>{const I=this._conditionalFormattingRuleModel.getRule(t,r,m);I&&(o[m]=I.rule)})}_generateConditionalFormattingMutations(t,r){const n=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),o=n.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(r.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.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(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,b],mapFunc:m}=fe.virtualizeDiscreteRanges([r.copyRange,t]),I=fe.getRepeatRange(p,b,!0),_={};T.Range.foreach(b,(l,g)=>{const{row:f,col:v}=m(l,g),P=this._conditionalFormattingViewModel.getCellCfs(o,u,f,v);P&&P.forEach(U=>{if(!_[U.cfId]){const z=new T.ObjectMatrix;_[U.cfId]=z;const V=this._conditionalFormattingRuleModel.getRule(o,u,U.cfId);V==null||V.ranges.forEach(O=>{T.Range.foreach(O,(x,W)=>{z.setValue(x,W,1)})})}_[U.cfId].realDeleteValue(f,v)})});const{matrix:w,info:C}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=C==null?void 0:C.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...R].find(v=>T.Tools.diffValue(v.rule,g));if(f)return i[l]=f,f;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,R.push(v),h=`${Number(h)+1}`,v}};I.forEach(l=>{w&&w.forValue((g,f,v)=>{const P=T.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:f,endColumn:f},l.startRange),{row:U,col:z}=m(P.startRow,P.startColumn);v.forEach(V=>{if(!_[V]){const O=s(V),x=new T.ObjectMatrix;_[V]=x,O.ranges.forEach(W=>{T.Range.foreach(W,(X,Y)=>{x.setValue(X,Y,1)})})}_[V].setValue(U,z,1)})})});const d=[],S=[];for(const l in _){const g=_[l],f=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!f.length){const v={unitId:o,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:v}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(R.some(v=>v.cfId===l)){const v=s(l),P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:P}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,P))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:P}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,P))}}return{redos:d,undos:S}}};dt=Xa([ut(0,T.Inject(fe.ISheetClipboardService)),ut(1,T.Inject(c.ConditionalFormattingRuleModel)),ut(2,T.Inject(T.Injector)),ut(3,T.Inject(c.ConditionalFormattingViewModel)),ut(4,T.Inject(T.IUniverInstanceService))],dt);var Ya=Object.getOwnPropertyDescriptor,Ka=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ya(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},mn=(e,t)=>(r,n)=>t(r,n,e);let ft=class extends T.Disposable{constructor(e,t,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},e.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ft=Ka([mn(0,T.Inject(T.LocaleService)),mn(1,T.ICommandService),mn(2,T.Inject(q.SheetPermissionCheckController))],ft);var $a=Object.getOwnPropertyDescriptor,Za=(e,t,r,n)=>{for(var a=n>1?void 0:n?$a(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},zt=(e,t)=>(r,n)=>t(r,n,e);let pt=class extends T.Disposable{constructor(e,t,r,n){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const e=new Map,t=(n,a,o)=>`${n}_${a}_${o}`,r=(n,a,o)=>{const u=p=>{const b=[...o.ranges],m=b.map(_=>q.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(c.isRangesEqual(m,b))return{redos:[],undos:[]};if(m.length){const _={unitId:n,subUnitId:a,rule:{...o,ranges:m}},w=[{id:c.SetConditionalRuleMutation.id,params:_}],C=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:C}}else{const _={unitId:n,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:_}],C=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:C}}},y=[];o.ranges.forEach(p=>{const b=this._refRangeService.registerRefRange(p,u);y.push(()=>b.dispose())}),e.set(t(n,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:o,rule:u}=n,y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const b=e.get(t(a,o,u.cfId));b&&b();break}case"set":{const b=e.get(t(a,o,u.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(T.toDisposable(()=>{e.forEach(n=>{n()}),e.clear()}))}};pt=Za([zt(0,T.Inject(c.ConditionalFormattingRuleModel)),zt(1,T.Inject(T.IUniverInstanceService)),zt(2,T.Inject(T.Injector)),zt(3,T.Inject(q.RefRangeService))],pt);var Ja=Object.getOwnPropertyDescriptor,Qa=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ja(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},He=(e,t)=>(r,n)=>t(r,n,e);let ht=class extends T.Disposable{constructor(t,r,n,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=t,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,a;const t=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(t))==null||r.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(t=>!!t.length),qe.filter(t=>{const r=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?t.filter(a=>a.unitId===r.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:T.InterceptorEffectEnum.Style,handler:(t,r,n)=>{const a=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!a)return n(t);const o=r.workbook.getStyles(),y={...(typeof(t==null?void 0:t.s)=="string"?o.get(t==null?void 0:t.s):t==null?void 0:t.s)||{}},p={...t,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),n(p)},priority:10}))}};ht=Qa([He(0,T.Inject(q.SheetInterceptorService)),He(1,T.Inject(c.ConditionalFormattingService)),He(2,T.Inject(T.IUniverInstanceService)),He(3,T.Inject(In.IRenderManagerService)),He(4,T.Inject(c.ConditionalFormattingViewModel)),He(5,T.Inject(c.ConditionalFormattingRuleModel))],ht);const _r="sheets-conditional-formatting-ui.config",kt={};var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,no=(e,t,r)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ro=(e,t,r,n)=>{for(var a=n>1?void 0:n?to(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},yn=(e,t)=>(r,n)=>t(r,n,e),Er=(e,t,r)=>no(e,typeof t!="symbol"?t+"":t,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends T.Plugin{constructor(t=kt,r,n,a){super(),this._config=t,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand(),this._injector.add([ht]),this._injector.add([pt]),this._injector.add([dt]),this._injector.add([ft]),this._injector.add([Ae])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(t=>{this._commandService.registerCommand(t)})}},Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=ro([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),yn(1,T.Inject(T.Injector)),yn(2,T.Inject(T.ICommandService)),yn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var ao=Object.getOwnPropertyDescriptor,oo=(e,t,r,n)=>{for(var a=n>1?void 0:n?ao(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},gt=(e,t)=>(r,n)=>t(r,n,e);let At=class extends T.Disposable{constructor(e,t,r,n,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,u,y,p)=>{var w;const b=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(w=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!b||!m)return;const I={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},_={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};T.Range.foreach(u,(C,R)=>{const h=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},I),i=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},_),{row:s,col:d}=p(h.startRow,h.startColumn),S=this._conditionalFormattingViewModel.getCellCfs(b,m,s,d),{row:l,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(b,m,l,g);f&&f.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.realDeleteValue(l,g)}),S&&S.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.setValue(l,g,1)})})},r=(a,o)=>{var i,s,d;const u=(i=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,b=[],m=[];if(!u||!y)return e();const I=fe.virtualizeDiscreteRanges([a,o]),[_,w]=I.ranges,{mapFunc:C}=I,R={row:_.startRow,col:_.startColumn};return fe.getAutoFillRepeatRange(_,w).forEach(S=>{t(R,S.repeatStartCell,S.relativeRange,p,C)}),p.forEach((S,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const f=q.findAllRectangle(q.createTopMatrixFromMatrix(S));if(f.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:f}};b.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:b}},n={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 r(y,p)}return e()}};this.disposeWithMe(this._autoFillService.addHook(n))}};At=oo([gt(0,T.Inject(T.Injector)),gt(1,T.Inject(T.IUniverInstanceService)),gt(2,T.Inject(fe.IAutoFillService)),gt(3,T.Inject(c.ConditionalFormattingRuleModel)),gt(4,T.Inject(c.ConditionalFormattingViewModel))],At);var io=Object.getOwnPropertyDescriptor,so=(e,t,r,n)=>{for(var a=n>1?void 0:n?io(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},vt=(e,t)=>(r,n)=>t(r,n,e);$.ConditionalFormattingClearController=class extends T.Disposable{constructor(t,r,n,a,o){super(),this._injector=t,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{var o;const r=[],n=[],a={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(t.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(C=>C.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const b=y.getUnitId(),m=p.getSheetId(),I=this._conditionalFormattingRuleModel.getSubunitRules(b,m);if(!I||!I.length)return a;const{redos:_,undos:w}=Or(this._injector,I,u,b,m);r.push(..._),n.push(...w)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:t,subUnitId:r,ranges:n})=>{const a=[],o=[],u={redos:a,undos:o};if(!n||!n.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(t,r);if(!y||!y.length)return u;const{redos:p,undos:b}=Or(this._injector,y,n,t,r);return a.push(...p),o.push(...b),u}}))}},$.ConditionalFormattingClearController=so([vt(0,T.Inject(T.Injector)),vt(1,T.Inject(T.IUniverInstanceService)),vt(2,T.Inject(q.SheetInterceptorService)),vt(3,T.Inject(q.SheetsSelectionsService)),vt(4,T.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Or(e,t,r,n,a){const o=[],u=[];return t.filter(y=>r.some(p=>y.ranges.some(b=>T.Rectangle.getIntersects(b,p)))).forEach(y=>{const b=new q.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(b.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...y,ranges:b}}},I=c.setConditionalRuleMutationUndoFactory(e,m.params);o.push(m),u.push(...I)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:y.cfId}},I=c.DeleteConditionalRuleMutationUndoFactory(e,m.params);o.push(m),u.push(...I)}}),{redos:o,undos:u}}var lo=Object.getOwnPropertyDescriptor,co=(e,t,r,n)=>{for(var a=n>1?void 0:n?lo(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Mr=(e,t)=>(r,n)=>t(r,n,e);let Wt=class extends T.Disposable{constructor(e,t){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(T.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(e,t,r)=>{var u,y,p;e||r(e);const n=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col),a=(u=n==null?void 0:n.style)!=null?u:{},o=Object.keys(a);if(e!=null&&e.p)return(p=(y=e.p.body)==null?void 0:y.textRuns)==null||p.forEach(b=>{b.ts&&o.forEach(m=>{var I;(I=b.ts)==null||delete I[m]})}),r(e);{const b={...(typeof(e==null?void 0:e.s)=="string"?t.workbook.getStyles().get(e.s):e==null?void 0:e.s)||{}};o.forEach(I=>{delete b[I]});const m={...e,s:{...b}};return r(m)}}})))}};Wt=co([Mr(0,T.Inject(q.SheetInterceptorService)),Mr(1,T.Inject(c.ConditionalFormattingService))],Wt);const Dr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],mt=[{label:"sheet.cf.ruleType.highlightCell",value:me.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:me.rank},{label:"sheet.cf.ruleType.formula",value:me.formula},{label:"sheet.cf.ruleType.colorScale",value:me.colorScale},{label:"sheet.cf.ruleType.dataBar",value:me.dataBar},{label:"sheet.cf.ruleType.iconSet",value:me.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:me.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:me.createRule},{label:"sheet.cf.menu.clearRangeRules",value:me.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:me.clearWorkSheetRules}],uo=e=>{const t=e.get(q.SheetsSelectionsService),r=e.get(T.ICommandService),n=e.get(T.IUniverInstanceService),a=e.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(t.selectionMoveEnd$,t.selectionSet$,new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===C&&b.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var R;const b=((R=t.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],m=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!m)return;const I=m.getActiveSheet();if(!I)return;const C=(a.getSubunitRules(m.getUnitId(),I.getSheetId())||[]).filter(h=>h.ranges.some(i=>b.some(s=>T.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(e,m.getUnitId(),I.getSheetId(),h));p.next(C)})),u=new Ce.Observable(p=>new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===C&&b.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!b)return;const m=b.getActiveSheet();if(!m)return;const I=a.getSubunitRules(b.getUnitId(),m.getSheetId())||[];if(!I.length)return p.next(!1),!1;const _=I.map(w=>w.ranges).every(w=>q.checkRangesEditablePermission(e,b.getUnitId(),m.getSheetId(),w));p.next(_)})),y=new Ce.Observable(p=>{o.subscribe(b=>{const m=mt.find(I=>I.value===me.clearRangeRules);m&&(m.disabled=!b,p.next(mt))}),u.subscribe(b=>{const m=mt.find(I=>I.value===me.clearWorkSheetRules);m&&(m.disabled=!b,p.next(mt))}),p.next(mt)});return{id:ct.id,type:ee.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ee.getMenuHiddenObservable(e,T.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(e,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},fo={[ee.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:uo}}};var po=Object.getOwnPropertyDescriptor,ho=(e,t,r,n)=>{for(var a=n>1?void 0:n?po(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Pr=(e,t)=>(r,n)=>t(r,n,e);let jt=class extends T.Disposable{constructor(t,r){super();De(this,"_sidebarDisposable",null);this._injector=t,this._menuManagerService=r,this._menuManagerService.mergeMenu(fo)}};jt=ho([Pr(0,T.Inject(T.Injector)),Pr(1,ee.IMenuManagerService)],jt);var go=Object.getOwnPropertyDescriptor,vo=(e,t,r,n)=>{for(var a=n>1?void 0:n?go(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Be=(e,t)=>(r,n)=>t(r,n,e);const mo=(e,t)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,a=r(t)%r(e),o=n(t)%n(e),u=Math.floor(r(t)/r(e)),y=Math.floor(n(t)/n(e)),p=[],b={startRow:0,endRow:r(e)-1,startColumn:0,endColumn:n(e)-1};if(r(t)===1&&n(t)===1){const m={startRow:t.startRow,endRow:t.startRow,startColumn:t.startColumn,endColumn:t.startColumn};return p.push({repeatRelativeRange:b,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let I=0;I<y+(o?.1:0);I++){const _=r(e)*m,w=n(e)*I,C={startRow:_+t.startRow,endRow:_+t.startRow,startColumn:w+t.startColumn,endColumn:w+t.startColumn};let R=b;m===u&&a&&(R={...R},R.endRow=R.endRow-(r(e)-a)),I===y&&o&&(R={...R},R.endColumn=R.endColumn-(n(e)-o)),p.push({repeatRelativeRange:R,startRange:C})}return p};let Ht=class extends T.Disposable{constructor(t,r,n,a,o,u){super();De(this,"_painterConfig",null);this._injector=t,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const t=()=>({redos:[],undos:[]}),r=(o,u,y,p,b)=>{const{unitId:m,subUnitId:I}=this._painterConfig,{targetUnitId:_,targetSubUnitId:w}=b,C={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},R={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};T.Range.foreach(y,(h,i)=>{const s=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},C),d=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},R),S=this._conditionalFormattingViewModel.getCellCfs(m,I,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,w,d.startRow,d.startColumn);l&&l.forEach(g=>{let f=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(_,w,g.cfId);if(!v)return;f=new T.ObjectMatrix,v.ranges.forEach(P=>{T.Range.foreach(P,(U,z)=>{f.setValue(U,z,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),S&&S.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(o,u,y)=>{var s;const{range:p,unitId:b,subUnitId:m}=this._painterConfig,I=o!==b||m!==u,_=new Map,w=[],C=[];if(!o||!u||!b||!m)return t();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,m))!=null?s:[];R==null||R.forEach(d=>{const{ranges:S,cfId:l}=d;if(S.some(g=>T.Rectangle.intersects(p,g))){const g=new T.ObjectMatrix;I||S.forEach(f=>{T.Range.foreach(f,(v,P)=>{g.setValue(v,P,1)})}),_.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return mo(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:o,targetSubUnitId:u})}),_.forEach((d,S)=>{if(I){const l=this._conditionalFormattingRuleModel.getRule(o,u,S),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(l)if(g.length){const f={unitId:o,subUnitId:u,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(b,m,S);if(f){const v={unitId:o,subUnitId:u,rule:{...T.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(b,m,S);if(!l)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:b,subUnitId:m,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:b,subUnitId:m,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:C,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const b=(u=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),I=this._sheetsSelectionsService.getCurrentLastSelection(),_=I==null?void 0:I.range;b&&m&&_&&(this._painterConfig={unitId:b,subUnitId:m,range:_});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?n(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Ht=vo([Be(0,T.Inject(T.Injector)),Be(1,T.Inject(T.IUniverInstanceService)),Be(2,T.Inject(fe.IFormatPainterService)),Be(3,T.Inject(q.SheetsSelectionsService)),Be(4,T.Inject(c.ConditionalFormattingRuleModel)),Be(5,T.Inject(c.ConditionalFormattingViewModel))],Ht);var yo=Object.getOwnPropertyDescriptor,So=(e,t,r,n)=>{for(var a=n>1?void 0:n?yo(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Sn=(e,t)=>(r,n)=>t(r,n,e);let Bt=class extends T.Disposable{constructor(e,t,r){super(),this._conditionalFormattingViewModel=e,this._univerInstanceService=t,this._renderManagerService=r,this._init()}_init(){const e=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),t=r=>{const n=r.getUnitId(),a=this._renderManagerService.getRenderById(n);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,I=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(I)}}))};e&&t(e),this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&t(r)})}};Bt=So([Sn(0,T.Inject(c.ConditionalFormattingViewModel)),Sn(1,T.IUniverInstanceService),Sn(2,In.IRenderManagerService)],Bt);var bo=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,To=(e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Io=(e,t,r,n)=>{for(var a=n>1?void 0:n?Co(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},bn=(e,t)=>(r,n)=>t(r,n,e),xr=(e,t,r)=>To(e,typeof t!="symbol"?t+"":t,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends T.Plugin{constructor(t=kt,r,n,a){super(),this._config=t,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand()}onStarting(){T.registerDependencies(this._injector,[[ht],[pt],[dt],[At],[ft],[lt],[jt],[Ae],[Wt],[$.ConditionalFormattingClearController],[Ht],[Bt]]),T.touchDependencies(this._injector,[[ht]])}onReady(){T.touchDependencies(this._injector,[[jt],[lt]])}onRendered(){T.touchDependencies(this._injector,[[At],[$.ConditionalFormattingClearController],[dt],[Wt],[Ae],[Ht],[ft],[pt],[Bt]])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(t=>{this._commandService.registerCommand(t)})}},xr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),xr($.UniverSheetsConditionalFormattingUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Io([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),bn(1,T.Inject(T.Injector)),bn(2,T.Inject(T.ICommandService)),bn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=qt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Xt,$.AddDataBarConditionalRuleCommand=Yt,$.AddDuplicateValuesCfCommand=Kt,$.AddNumberCfCommand=$t,$.AddRankCfCommand=Zt,$.AddTextCfCommand=Jt,$.AddTimePeriodCfCommand=Qt,$.AddUniqueValuesCfCommand=en,$.ClearRangeCfCommand=yt,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=St,$.OpenConditionalFormattingOperator=ct,$.SetCfCommand=bt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
182
|
+
`,children:[_.jsx(re.Button,{size:"small",onClick:v,children:e.t("sheet.cf.panel.cancel")}),_.jsx(re.Button,{className:A.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},Ba=t=>{const[e,r]=L.useState(t.rule),[n,a]=L.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),r(void 0)},y=p=>{r(p),a(!0)};return _.jsx("div",{className:A.conditionalFormattingWrap,children:n?_.jsx(Ha,{onCancel:u,rule:e}):_.jsx(Ma,{onClick:y,onCreate:o})})};var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,r,n)=>{for(var a=n>1?void 0:n?Fa(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let lt=class extends T.Disposable{constructor(e,r,n,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Vt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:e,key:T.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ba)}};lt=Ga([st(0,T.IUniverInstanceService),st(1,T.Inject(T.Injector)),st(2,T.Inject(ee.ComponentManager)),st(3,T.Inject(ee.ISidebarService)),st(4,T.Inject(T.LocaleService))],lt);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 ct={id:"sheet.operation.open.conditional.formatting.panel",type:T.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(lt),n=t.get(q.SheetsSelectionsService),a=t.get(T.ICommandService),o=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(yt.id,{ranges:o});break}case 10:{a.executeCommand(Ye.id);break}}return!0}};var qa=Object.getOwnPropertyDescriptor,Xa=(t,e,r,n)=>{for(var a=n>1?void 0:n?qa(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ut=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends T.Disposable{constructor(e,r,n,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,r,n){const a=new T.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:r,cfMap:o}};const u=this._injector.invoke(m=>fe.rangeToDiscreteRange(n,m,e,r));if(!u)return;const{rows:y,cols:p}=u,b=new Set;y.forEach((m,I)=>{p.forEach((E,w)=>{const C=this._conditionalFormattingViewModel.getCellCfs(e,r,m,E);C&&(C.forEach(R=>b.add(R.cfId)),a.setValue(I,w,C.map(R=>R.cfId)))})}),b.forEach(m=>{const I=this._conditionalFormattingRuleModel.getRule(e,r,m);I&&(o[m]=I.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),o=n.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(r.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.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(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,b],mapFunc:m}=fe.virtualizeDiscreteRanges([r.copyRange,e]),I=fe.getRepeatRange(p,b,!0),E={};T.Range.foreach(b,(l,g)=>{const{row:f,col:v}=m(l,g),P=this._conditionalFormattingViewModel.getCellCfs(o,u,f,v);P&&P.forEach(U=>{if(!E[U.cfId]){const z=new T.ObjectMatrix;E[U.cfId]=z;const V=this._conditionalFormattingRuleModel.getRule(o,u,U.cfId);V==null||V.ranges.forEach(O=>{T.Range.foreach(O,(x,W)=>{z.setValue(x,W,1)})})}E[U.cfId].realDeleteValue(f,v)})});const{matrix:w,info:C}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=C==null?void 0:C.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...R].find(v=>T.Tools.diffValue(v.rule,g));if(f)return i[l]=f,f;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,R.push(v),h=`${Number(h)+1}`,v}};I.forEach(l=>{w&&w.forValue((g,f,v)=>{const P=T.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:f,endColumn:f},l.startRange),{row:U,col:z}=m(P.startRow,P.startColumn);v.forEach(V=>{if(!E[V]){const O=s(V),x=new T.ObjectMatrix;E[V]=x,O.ranges.forEach(W=>{T.Range.foreach(W,(X,Y)=>{x.setValue(X,Y,1)})})}E[V].setValue(U,z,1)})})});const d=[],S=[];for(const l in E){const g=E[l],f=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!f.length){const v={unitId:o,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:v}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(R.some(v=>v.cfId===l)){const v=s(l),P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:P}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,P))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:P}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,P))}}return{redos:d,undos:S}}};dt=Xa([ut(0,T.Inject(fe.ISheetClipboardService)),ut(1,T.Inject(c.ConditionalFormattingRuleModel)),ut(2,T.Inject(T.Injector)),ut(3,T.Inject(c.ConditionalFormattingViewModel)),ut(4,T.Inject(T.IUniverInstanceService))],dt);var Ya=Object.getOwnPropertyDescriptor,Ka=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ya(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},vn=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends T.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ft=Ka([vn(0,T.Inject(T.LocaleService)),vn(1,T.ICommandService),vn(2,T.Inject(q.SheetPermissionCheckController))],ft);var $a=Object.getOwnPropertyDescriptor,Za=(t,e,r,n)=>{for(var a=n>1?void 0:n?$a(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},zt=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends T.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,a,o)=>`${n}_${a}_${o}`,r=(n,a,o)=>{const u=p=>{const b=[...o.ranges],m=b.map(E=>q.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,b))return{redos:[],undos:[]};if(m.length){const E={unitId:n,subUnitId:a,rule:{...o,ranges:m}},w=[{id:c.SetConditionalRuleMutation.id,params:E}],C=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:C}}else{const E={unitId:n,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:E}],C=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:C}}},y=[];o.ranges.forEach(p=>{const b=this._refRangeService.registerRefRange(p,u);y.push(()=>b.dispose())}),t.set(e(n,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:o,rule:u}=n,y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const b=t.get(e(a,o,u.cfId));b&&b();break}case"set":{const b=t.get(e(a,o,u.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(T.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};pt=Za([zt(0,T.Inject(c.ConditionalFormattingRuleModel)),zt(1,T.Inject(T.IUniverInstanceService)),zt(2,T.Inject(T.Injector)),zt(3,T.Inject(q.RefRangeService))],pt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r,n)=>{for(var a=n>1?void 0:n?Ja(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends T.Disposable{constructor(e,r,n,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,a;const e=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.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 r=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(a=>a.unitId===r.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:T.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const a=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!a)return n(e);const o=r.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),n(p)},priority:10}))}};ht=Qa([He(0,T.Inject(q.SheetInterceptorService)),He(1,T.Inject(c.ConditionalFormattingService)),He(2,T.Inject(T.IUniverInstanceService)),He(3,T.Inject(Tn.IRenderManagerService)),He(4,T.Inject(c.ConditionalFormattingViewModel)),He(5,T.Inject(c.ConditionalFormattingRuleModel))],ht);const _r="sheets-conditional-formatting-ui.config",kt={};var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,no=(t,e,r)=>e in t?eo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ro=(t,e,r,n)=>{for(var a=n>1?void 0:n?to(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},mn=(t,e)=>(r,n)=>e(r,n,t),Er=(t,e,r)=>no(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends T.Plugin{constructor(e=kt,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand(),this._injector.add([ht]),this._injector.add([pt]),this._injector.add([dt]),this._injector.add([ft]),this._injector.add([Ae])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=ro([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),mn(1,T.Inject(T.Injector)),mn(2,T.Inject(T.ICommandService)),mn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var ao=Object.getOwnPropertyDescriptor,oo=(t,e,r,n)=>{for(var a=n>1?void 0:n?ao(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},gt=(t,e)=>(r,n)=>e(r,n,t);let At=class extends T.Disposable{constructor(t,e,r,n,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var w;const b=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(w=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!b||!m)return;const I={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};T.Range.foreach(u,(C,R)=>{const h=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},I),i=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},E),{row:s,col:d}=p(h.startRow,h.startColumn),S=this._conditionalFormattingViewModel.getCellCfs(b,m,s,d),{row:l,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(b,m,l,g);f&&f.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.realDeleteValue(l,g)}),S&&S.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.setValue(l,g,1)})})},r=(a,o)=>{var i,s,d;const u=(i=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,b=[],m=[];if(!u||!y)return t();const I=fe.virtualizeDiscreteRanges([a,o]),[E,w]=I.ranges,{mapFunc:C}=I,R={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,w).forEach(S=>{e(R,S.repeatStartCell,S.relativeRange,p,C)}),p.forEach((S,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const f=q.findAllRectangle(q.createTopMatrixFromMatrix(S));if(f.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:f}};b.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:b}},n={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 r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};At=oo([gt(0,T.Inject(T.Injector)),gt(1,T.Inject(T.IUniverInstanceService)),gt(2,T.Inject(fe.IAutoFillService)),gt(3,T.Inject(c.ConditionalFormattingRuleModel)),gt(4,T.Inject(c.ConditionalFormattingViewModel))],At);var io=Object.getOwnPropertyDescriptor,so=(t,e,r,n)=>{for(var a=n>1?void 0:n?io(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},vt=(t,e)=>(r,n)=>e(r,n,t);$.ConditionalFormattingClearController=class extends T.Disposable{constructor(e,r,n,a,o){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const r=[],n=[],a={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(C=>C.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const b=y.getUnitId(),m=p.getSheetId(),I=this._conditionalFormattingRuleModel.getSubunitRules(b,m);if(!I||!I.length)return a;const{redos:E,undos:w}=Or(this._injector,I,u,b,m);r.push(...E),n.push(...w)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const a=[],o=[],u={redos:a,undos:o};if(!n||!n.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!y||!y.length)return u;const{redos:p,undos:b}=Or(this._injector,y,n,e,r);return a.push(...p),o.push(...b),u}}))}},$.ConditionalFormattingClearController=so([vt(0,T.Inject(T.Injector)),vt(1,T.Inject(T.IUniverInstanceService)),vt(2,T.Inject(q.SheetInterceptorService)),vt(3,T.Inject(q.SheetsSelectionsService)),vt(4,T.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Or(t,e,r,n,a){const o=[],u=[];return e.filter(y=>r.some(p=>y.ranges.some(b=>T.Rectangle.getIntersects(b,p)))).forEach(y=>{const b=new q.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(b.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...y,ranges:b}}},I=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...I)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:y.cfId}},I=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...I)}}),{redos:o,undos:u}}var lo=Object.getOwnPropertyDescriptor,co=(t,e,r,n)=>{for(var a=n>1?void 0:n?lo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Mr=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends T.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(T.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var u,y,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=n==null?void 0:n.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(b=>{b.ts&&o.forEach(m=>{var I;(I=b.ts)==null||delete I[m]})}),r(t);{const b={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(I=>{delete b[I]});const m={...t,s:{...b}};return r(m)}}})))}};Wt=co([Mr(0,T.Inject(q.SheetInterceptorService)),Mr(1,T.Inject(c.ConditionalFormattingService))],Wt);const Dr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],mt=[{label:"sheet.cf.ruleType.highlightCell",value:me.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:me.rank},{label:"sheet.cf.ruleType.formula",value:me.formula},{label:"sheet.cf.ruleType.colorScale",value:me.colorScale},{label:"sheet.cf.ruleType.dataBar",value:me.dataBar},{label:"sheet.cf.ruleType.iconSet",value:me.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:me.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:me.createRule},{label:"sheet.cf.menu.clearRangeRules",value:me.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:me.clearWorkSheetRules}],uo=t=>{const e=t.get(q.SheetsSelectionsService),r=t.get(T.ICommandService),n=t.get(T.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:E,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(E)&&w.unitId===C&&b.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var R;const b=((R=e.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],m=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!m)return;const I=m.getActiveSheet();if(!I)return;const C=(a.getSubunitRules(m.getUnitId(),I.getSheetId())||[]).filter(h=>h.ranges.some(i=>b.some(s=>T.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(t,m.getUnitId(),I.getSheetId(),h));p.next(C)})),u=new Ce.Observable(p=>new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:E,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(E)&&w.unitId===C&&b.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!b)return;const m=b.getActiveSheet();if(!m)return;const I=a.getSubunitRules(b.getUnitId(),m.getSheetId())||[];if(!I.length)return p.next(!1),!1;const E=I.map(w=>w.ranges).every(w=>q.checkRangesEditablePermission(t,b.getUnitId(),m.getSheetId(),w));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(b=>{const m=mt.find(I=>I.value===me.clearRangeRules);m&&(m.disabled=!b,p.next(mt))}),u.subscribe(b=>{const m=mt.find(I=>I.value===me.clearWorkSheetRules);m&&(m.disabled=!b,p.next(mt))}),p.next(mt)});return{id:ct.id,type:ee.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ee.getMenuHiddenObservable(t,T.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},fo={[ee.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:uo}}};var po=Object.getOwnPropertyDescriptor,ho=(t,e,r,n)=>{for(var a=n>1?void 0:n?po(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Pr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends T.Disposable{constructor(e,r){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(fo)}};jt=ho([Pr(0,T.Inject(T.Injector)),Pr(1,ee.IMenuManagerService)],jt);var go=Object.getOwnPropertyDescriptor,vo=(t,e,r,n)=>{for(var a=n>1?void 0:n?go(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(r,n)=>e(r,n,t);const mo=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,a=r(e)%r(t),o=n(e)%n(t),u=Math.floor(r(e)/r(t)),y=Math.floor(n(e)/n(t)),p=[],b={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:b,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let I=0;I<y+(o?.1:0);I++){const E=r(t)*m,w=n(t)*I,C={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:w+e.startColumn,endColumn:w+e.startColumn};let R=b;m===u&&a&&(R={...R},R.endRow=R.endRow-(r(t)-a)),I===y&&o&&(R={...R},R.endColumn=R.endColumn-(n(t)-o)),p.push({repeatRelativeRange:R,startRange:C})}return p};let Ht=class extends T.Disposable{constructor(e,r,n,a,o,u){super();De(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(o,u,y,p,b)=>{const{unitId:m,subUnitId:I}=this._painterConfig,{targetUnitId:E,targetSubUnitId:w}=b,C={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},R={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};T.Range.foreach(y,(h,i)=>{const s=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},C),d=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},R),S=this._conditionalFormattingViewModel.getCellCfs(m,I,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,w,d.startRow,d.startColumn);l&&l.forEach(g=>{let f=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,w,g.cfId);if(!v)return;f=new T.ObjectMatrix,v.ranges.forEach(P=>{T.Range.foreach(P,(U,z)=>{f.setValue(U,z,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),S&&S.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(o,u,y)=>{var s;const{range:p,unitId:b,subUnitId:m}=this._painterConfig,I=o!==b||m!==u,E=new Map,w=[],C=[];if(!o||!u||!b||!m)return e();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,m))!=null?s:[];R==null||R.forEach(d=>{const{ranges:S,cfId:l}=d;if(S.some(g=>T.Rectangle.intersects(p,g))){const g=new T.ObjectMatrix;I||S.forEach(f=>{T.Range.foreach(f,(v,P)=>{g.setValue(v,P,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return mo(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((d,S)=>{if(I){const l=this._conditionalFormattingRuleModel.getRule(o,u,S),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(l)if(g.length){const f={unitId:o,subUnitId:u,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(b,m,S);if(f){const v={unitId:o,subUnitId:u,rule:{...T.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(b,m,S);if(!l)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:b,subUnitId:m,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:b,subUnitId:m,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:C,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const b=(u=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),I=this._sheetsSelectionsService.getCurrentLastSelection(),E=I==null?void 0:I.range;b&&m&&E&&(this._painterConfig={unitId:b,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?n(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Ht=vo([Be(0,T.Inject(T.Injector)),Be(1,T.Inject(T.IUniverInstanceService)),Be(2,T.Inject(fe.IFormatPainterService)),Be(3,T.Inject(q.SheetsSelectionsService)),Be(4,T.Inject(c.ConditionalFormattingRuleModel)),Be(5,T.Inject(c.ConditionalFormattingViewModel))],Ht);var yo=Object.getOwnPropertyDescriptor,So=(t,e,r,n)=>{for(var a=n>1?void 0:n?yo(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},yn=(t,e)=>(r,n)=>e(r,n,t);let Bt=class extends T.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),a=this._renderManagerService.getRenderById(n);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,I=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(I)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Bt=So([yn(0,T.Inject(c.ConditionalFormattingViewModel)),yn(1,T.IUniverInstanceService),yn(2,Tn.IRenderManagerService)],Bt);var bo=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,To=(t,e,r)=>e in t?bo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Io=(t,e,r,n)=>{for(var a=n>1?void 0:n?Co(e,r):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Sn=(t,e)=>(r,n)=>e(r,n,t),xr=(t,e,r)=>To(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends T.Plugin{constructor(e=kt,r,n,a){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand()}onStarting(){T.registerDependencies(this._injector,[[ht],[pt],[dt],[At],[ft],[lt],[jt],[Ae],[Wt],[$.ConditionalFormattingClearController],[Ht],[Bt]]),T.touchDependencies(this._injector,[[ht]])}onReady(){T.touchDependencies(this._injector,[[jt],[lt]])}onRendered(){T.touchDependencies(this._injector,[[At],[$.ConditionalFormattingClearController],[dt],[Wt],[Ae],[Ht],[ft],[pt],[Bt]])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},xr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),xr($.UniverSheetsConditionalFormattingUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Io([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),Sn(1,T.Inject(T.Injector)),Sn(2,T.Inject(T.ICommandService)),Sn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=qt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Xt,$.AddDataBarConditionalRuleCommand=Yt,$.AddDuplicateValuesCfCommand=Kt,$.AddNumberCfCommand=$t,$.AddRankCfCommand=Zt,$.AddTextCfCommand=Jt,$.AddTimePeriodCfCommand=Qt,$.AddUniqueValuesCfCommand=en,$.ClearRangeCfCommand=yt,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=St,$.OpenConditionalFormattingOperator=ct,$.SetCfCommand=bt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
|
|
185
183
|
|
|
186
184
|
|
|
187
185
|
// index
|