@univerjs/sheets-conditional-formatting-ui 0.6.0-alpha.0 → 0.6.0-experimental.20250212-dbe9830
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/index.js +62 -62
- package/lib/es/index.js +392 -390
- package/lib/types/components/color-picker/index.d.ts +1 -1
- package/lib/types/index.d.ts +1 -1
- package/lib/types/locale/zh-CN.d.ts +1 -1
- package/lib/umd/index.js +52 -52
- package/package.json +14 -14
- package/LICENSE +0 -176
package/lib/cjs/index.js
CHANGED
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
"use strict";var jr=Object.defineProperty;var Lr=(t,e,r)=>e in t?jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _e=(t,e,r)=>Lr(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const y=require("@univerjs/core"),c=require("@univerjs/sheets-conditional-formatting"),X=require("@univerjs/sheets"),me=require("@univerjs/ui"),x=require("react/jsx-runtime"),N=require("react"),re=require("@univerjs/design"),rn=require("@univerjs/engine-formula"),ce=require("@univerjs/sheets-ui"),lr=require("react-dom"),be=require("rxjs"),ft=require("@univerjs/sheets-formula-ui"),ur=require("@univerjs/engine-render"),it=require("rxjs/operators"),an={type:y.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,u=t.get(c.ConditionalFormattingRuleModel),C=t.get(y.ICommandService),p=t.get(y.IUniverInstanceService),R=X.getSheetCommandTarget(p);if(!R)return!1;const{unitId:v,subUnitId:T}=R,_=u.createCfId(v,T),I={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:i,style:n}};return C.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:I})}},pt={type:y.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(y.IUndoRedoService),o=t.get(y.ICommandService),i=t.get(c.ConditionalFormattingRuleModel),u=t.get(y.IUniverInstanceService),C=X.getSheetCommandTarget(u);if(!C)return!1;const{unitId:p,subUnitId:R}=C,v=i.createCfId(p,R),T={unitId:p,subUnitId:R,rule:{...r,cfId:r.cfId||v}},_=c.AddConditionalRuleMutationUndoFactory(t,T),I=o.syncExecuteCommand(c.AddConditionalRuleMutation.id,T);return I&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:T}],undoMutations:[_]}),I}},sn={type:y.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(y.ICommandService),C=t.get(y.IUniverInstanceService),p=X.getSheetCommandTarget(C);if(!p)return!1;const{unitId:R,subUnitId:v}=p,T=i.createCfId(R,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:v,rule:_})}},ln={type:y.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:u,isGradient:C,stopIfTrue:p,isShowValue:R}=e,v=t.get(c.ConditionalFormattingRuleModel),T=t.get(y.IUniverInstanceService),_=X.getSheetCommandTarget(T);if(!_)return!1;const{unitId:I,subUnitId:S}=_,w=t.get(y.ICommandService),h=v.createCfId(I,S),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:R,config:{min:n,max:o,nativeColor:i,positiveColor:u,isGradient:C}}};return w.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:S,rule:a})}},un={type:y.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(y.ICommandService),C=t.get(y.IUniverInstanceService),p=X.getSheetCommandTarget(C);if(!p)return!1;const{unitId:R,subUnitId:v}=p,T=i.createCfId(R,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:v,rule:_})}},cn={type:y.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:u}=e,C=t.get(c.ConditionalFormattingRuleModel),p=t.get(y.ICommandService),R=t.get(y.IUniverInstanceService),v=X.getSheetCommandTarget(R);if(!v)return!1;const{unitId:T,subUnitId:_}=v,I=C.createCfId(T,_);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(i)){const w=u;if(w.length!==2||!Array.isArray(w))return!1;S={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}else{const w=u;if(typeof w!="number")return!1;S={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:w}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:_,rule:S})}},dn={type:y.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:u,value:C}=e,p=t.get(c.ConditionalFormattingRuleModel),R=t.get(y.IUniverInstanceService),v=t.get(y.ICommandService),T=X.getSheetCommandTarget(R);if(!T)return!1;const{unitId:_,subUnitId:I}=T,S=p.createCfId(_,I),w={ranges:r,cfId:S,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:i,isBottom:u,style:n,value:C}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:I,rule:w})}},fn={type:y.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:u}=e,C=t.get(c.ConditionalFormattingRuleModel),p=t.get(y.IUniverInstanceService),R=X.getSheetCommandTarget(p);if(!R)return!1;const{unitId:v,subUnitId:T}=R,_=t.get(y.ICommandService),I=C.createCfId(v,T),S={ranges:r,cfId:I,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:i,style:n,value:u}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:S})}},pn={type:y.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,u=t.get(c.ConditionalFormattingRuleModel),C=t.get(y.IUniverInstanceService),p=t.get(y.ICommandService),R=X.getSheetCommandTarget(C);if(!R)return!1;const{unitId:v,subUnitId:T}=R,_=u.createCfId(v,T),I={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:T,rule:I})}},hn={type:y.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(y.IUniverInstanceService),C=t.get(y.ICommandService),p=X.getSheetCommandTarget(u);if(!p)return!1;const{unitId:R,subUnitId:v}=p,T=i.createCfId(R,v),_={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return C.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:v,rule:_})}},Vt={type:y.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(y.IUniverInstanceService),o=t.get(y.ICommandService),i=t.get(y.IUndoRedoService),u=t.get(X.SheetsSelectionsService),C=X.getSheetCommandTarget(n,e);if(!C)return!1;const{unitId:p,subUnitId:R}=C,v=((w=u.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],T=r.getSubunitRules(p,R);if(!(T!=null&&T.length)||!v.length)return!1;const _=[],I=[];T.forEach(h=>{const a=new y.ObjectMatrix;h.ranges.forEach(d=>{y.Range.foreach(d,(b,l)=>{a.setValue(b,l,1)})}),v.forEach(d=>{y.Range.foreach(d,(b,l)=>{a.realDeleteValue(b,l)})});const s=X.findAllRectangle(X.createTopMatrixFromMatrix(a));if(s.length){const d={...h,ranges:s},b={unitId:p,subUnitId:R,rule:d},l=c.setConditionalRuleMutationUndoFactory(t,b);_.push({id:c.SetConditionalRuleMutation.id,params:b}),I.push(...l)}else{const d={unitId:p,subUnitId:R,cfId:h.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),I.push(...b)}});const S=y.sequenceExecute(_,o).result;return S&&i.pushUndoRedo({unitID:p,redoMutations:_,undoMutations:I}),S}},ht={type:y.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(y.IUniverInstanceService),o=t.get(y.ICommandService),i=t.get(y.IUndoRedoService),u=X.getSheetCommandTarget(n,e);if(!u)return!1;const{unitId:C,subUnitId:p}=u,R=r.getSubunitRules(C,p);if(!(R!=null&&R.length))return!1;const v=R.map(S=>({cfId:S.cfId,unitId:C,subUnitId:p})),T=v.map(S=>({id:c.DeleteConditionalRuleMutation.id,params:S})),_=v.map(S=>c.DeleteConditionalRuleMutationUndoFactory(t,S)[0]),I=y.sequenceExecute(T,o).result;return I&&i.pushUndoRedo({unitID:C,redoMutations:T,undoMutations:_}),I}},at={type:y.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(y.IUndoRedoService),n=t.get(y.ICommandService),o=t.get(y.IUniverInstanceService),i=X.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:C}=i,p={unitId:u,subUnitId:C,cfId:e.cfId},R=c.DeleteConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),v}},$t={type:y.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(y.IUndoRedoService),n=t.get(y.ICommandService),o=t.get(y.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),u=X.getSheetCommandTarget(o,e);if(!u)return!1;const{unitId:C,subUnitId:p}=u,R=c.transformSupportSymmetryAnchor(e.start,e.end,i.getSubunitRules(C,p)||[],w=>w.cfId);if(!R)return!1;const[v,T]=R,_={unitId:C,subUnitId:p,start:v,end:T},I=c.MoveConditionalRuleMutationUndoFactory(_),S=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return S&&r.pushUndoRedo({unitID:C,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:I}),S}},zt={type:y.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(y.IUndoRedoService),n=t.get(y.ICommandService),o=t.get(y.IUniverInstanceService),i=X.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:C}=i,p={unitId:u,subUnitId:C,rule:e.rule},R=c.setConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:u,undoMutations:R,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),v}},Ur="univer-conditional-formatting-wrap",Vr="univer-cf-rule-item",$r="univer-preview",zr="univer-create-rule",Ar="univer-button",qr="univer-title",Wr="univer-label",Hr="univer-label-container",kr="univer-input-width",Br="univer-m-t-base",Gr="univer-m-t-sm",Xr="univer-m-t-xl",Yr="univer-m-l-sm",Kr="univer-m-l-xl",Zr="univer-m-l-xxs",Jr="univer-m-l-0",Qr="univer-m-r-0",$={conditionalFormattingWrap:Ur,cfRuleItem:Vr,preview:$r,createRule:zr,button:Ar,title:qr,label:Wr,labelContainer:Hr,inputWidth:kr,mTBase:Br,mTSm:Gr,mTXl:Xr,mLSm:Yr,mLXl:Kr,mLXxs:Zr,mL0:Jr,mR0:Qr};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},eo=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 o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},Ae=N.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,u=eo(t,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=N.useRef("_".concat(ro()));return cr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:C},u),i)});function cr(t,e,r,n,o){return N.createElement(t.tag,Ce(Ce({key:e},to(t,r,o)),n),(no(t,r).children||[]).map(function(i,u){return cr(i,"".concat(e,"-").concat(t.tag,"-").concat(u),r,void 0,o)}))}function to(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var u=i[0],C=i[1];typeof C=="string"&&(n[u]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function no(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)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function ro(){return Math.random().toString(36).substring(2,8)}Ae.displayName="UniverIcon";var oo={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"}}]},Ot=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"delete-single",ref:e,icon:oo}))});Ot.displayName="DeleteSingle";var io={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"}}]},dr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"increase-single",ref:e,icon:io}))});dr.displayName="IncreaseSingle";var ao={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"}}]},At=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"more-down-single",ref:e,icon:ao}))});At.displayName="MoreDownSingle";var so={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"}}]}]},fr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"sequence-single",ref:e,icon:so}))});fr.displayName="SequenceSingle";var lo={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"}}]}]},mt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"slash-single",ref:e,icon:lo}))});mt.displayName="SlashSingle";function uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(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 o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var kt={exports:{}},He={},ot={exports:{}},co=ot.exports,bn;function mn(){return bn||(bn=1,function(t,e){(function(r,n){n(e)})(co,function(r){function n(q){return function(ae,O,P,D,V,Y,W){return q(ae,O,W)}}function o(q){return function(ae,O,P,D){if(!ae||!O||typeof ae!="object"||typeof O!="object")return q(ae,O,P,D);var V=D.get(ae),Y=D.get(O);if(V&&Y)return V===O&&Y===ae;D.set(ae,O),D.set(O,ae);var W=q(ae,O,P,D);return D.delete(ae),D.delete(O),W}}function i(q,J){var ae={};for(var O in q)ae[O]=q[O];for(var O in J)ae[O]=J[O];return ae}function u(q){return q.constructor===Object||q.constructor==null}function C(q){return typeof q.then=="function"}function p(q,J){return q===J||q!==q&&J!==J}var R="[object Arguments]",v="[object Boolean]",T="[object Date]",_="[object RegExp]",I="[object Map]",S="[object Number]",w="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function d(q){var J=q.areArraysEqual,ae=q.areDatesEqual,O=q.areMapsEqual,P=q.areObjectsEqual,D=q.areRegExpsEqual,V=q.areSetsEqual,Y=q.createIsNestedEqual,W=Y(Z);function Z(K,ee,ue){if(K===ee)return!0;if(!K||!ee||typeof K!="object"||typeof ee!="object")return K!==K&&ee!==ee;if(u(K)&&u(ee))return P(K,ee,W,ue);var Pe=Array.isArray(K),ye=Array.isArray(ee);if(Pe||ye)return Pe===ye&&J(K,ee,W,ue);var he=s.call(K);return he!==s.call(ee)?!1:he===T?ae(K,ee,W,ue):he===_?D(K,ee,W,ue):he===I?O(K,ee,W,ue):he===h?V(K,ee,W,ue):he===w||he===R?C(K)||C(ee)?!1:P(K,ee,W,ue):he===v||he===S||he===a?p(K.valueOf(),ee.valueOf()):!1}return Z}function b(q,J,ae,O){var P=q.length;if(J.length!==P)return!1;for(;P-- >0;)if(!ae(q[P],J[P],P,P,q,J,O))return!1;return!0}var l=o(b);function m(q,J){return p(q.valueOf(),J.valueOf())}function f(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={},V=0;return q.forEach(function(Y,W){if(P){var Z=!1,K=0;J.forEach(function(ee,ue){!Z&&!D[K]&&(Z=ae(W,ue,V,K,q,J,O)&&ae(Y,ee,W,ue,q,J,O))&&(D[K]=!0),K++}),V++,P=Z}}),P}var g=o(f),M="_owner",j=Object.prototype.hasOwnProperty;function U(q,J,ae,O){var P=Object.keys(q),D=P.length;if(Object.keys(J).length!==D)return!1;for(var V;D-- >0;){if(V=P[D],V===M){var Y=!!q.$$typeof,W=!!J.$$typeof;if((Y||W)&&Y!==W)return!1}if(!j.call(J,V)||!ae(q[V],J[V],V,V,q,J,O))return!1}return!0}var L=o(U);function E(q,J){return q.source===J.source&&q.flags===J.flags}function F(q,J,ae,O){var P=q.size===J.size;if(!P)return!1;if(!q.size)return!0;var D={};return q.forEach(function(V,Y){if(P){var W=!1,Z=0;J.forEach(function(K,ee){!W&&!D[Z]&&(W=ae(V,K,Y,ee,q,J,O))&&(D[Z]=!0),Z++}),P=W}}),P}var z=o(F),B=Object.freeze({areArraysEqual:b,areDatesEqual:m,areMapsEqual:f,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:F,createIsNestedEqual:n}),G=Object.freeze({areArraysEqual:l,areDatesEqual:m,areMapsEqual:g,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:z,createIsNestedEqual:n}),te=d(B);function Q(q,J){return te(q,J,void 0)}var H=d(i(B,{createIsNestedEqual:function(){return p}}));function A(q,J){return H(q,J,void 0)}var ne=d(G);function oe(q,J){return ne(q,J,new WeakMap)}var se=d(i(G,{createIsNestedEqual:function(){return p}}));function fe(q,J){return se(q,J,new WeakMap)}function ge(q){return d(i(B,q(B)))}function Se(q){var J=d(i(G,q(G)));return function(ae,O,P){return P===void 0&&(P=new WeakMap),J(ae,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=fe,r.createCustomCircularEqual=Se,r.createCustomEqual=ge,r.deepEqual=Q,r.sameValueZeroEqual=p,r.shallowEqual=A,Object.defineProperty(r,"__esModule",{value:!0})})}(ot,ot.exports)),ot.exports}var yt={exports:{}},Rn;function gn(){if(Rn)return yt.exports;Rn=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",u=arguments.length;o<u;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return yt.exports=e,yt.exports.clsx=e,yt.exports}var ie={},Bt,Tn;function fo(){return Tn||(Tn=1,Bt=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)}),Bt}var In;function qe(){if(In)return ie;In=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=o,ie.cloneLayoutItem=C,ie.collides=v,ie.compact=T,ie.compactItem=S,ie.compactType=q,ie.correctBounds=w,ie.fastPositionEqual=R,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=a,ie.getLayoutItem=h,ie.getStatics=d,ie.modifyLayout=i,ie.moveElement=b,ie.moveElementAwayFromCollision=l,ie.noop=void 0,ie.perc=m,ie.resizeItemInDirection=H,ie.setTopLeft=ne,ie.setTransform=A,ie.sortLayoutItems=oe,ie.sortLayoutItemsByColRow=fe,ie.sortLayoutItemsByRowCol=se,ie.synchronizeLayoutWithChildren=ge,ie.validateLayout=Se,ie.withLayoutItem=u;var t=mn(),e=r(N);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,D;for(let V=0,Y=O.length;V<Y;V++)D=O[V].y+O[V].h,D>P&&(P=D);return P}function o(O){const P=Array(O.length);for(let D=0,V=O.length;D<V;D++)P[D]=C(O[D]);return P}function i(O,P){const D=Array(O.length);for(let V=0,Y=O.length;V<Y;V++)P.i===O[V].i?D[V]=P:D[V]=O[V];return D}function u(O,P,D){let V=h(O,P);return V?(V=D(C(V)),O=i(O,V),[O,V]):[O,null]}function C(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.key),e.default.Children.map(P,D=>D==null?void 0:D.key))&&(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.props["data-grid"]),e.default.Children.map(P,D=>D==null?void 0:D.props["data-grid"]))}ie.fastRGLPropsEqual=fo();function R(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function v(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function T(O,P,D,V){const Y=d(O),W=oe(O,P),Z=Array(O.length);for(let K=0,ee=W.length;K<ee;K++){let ue=C(W[K]);ue.static||(ue=S(Y,ue,P,D,W,V),Y.push(ue)),Z[O.indexOf(W[K])]=ue,ue.moved=!1}return Z}const _={x:"w",y:"h"};function I(O,P,D,V){const Y=_[V];P[V]+=1;const W=O.map(Z=>Z.i).indexOf(P.i);for(let Z=W+1;Z<O.length;Z++){const K=O[Z];if(!K.static){if(K.y>P.y+P.h)break;v(P,K)&&I(O,K,D+P[Y],V)}}P[V]=D}function S(O,P,D,V,Y,W){const Z=D==="vertical",K=D==="horizontal";if(Z)for(P.y=Math.min(n(O),P.y);P.y>0&&!a(O,P);)P.y--;else if(K)for(;P.x>0&&!a(O,P);)P.x--;let ee;for(;(ee=a(O,P))&&!(D===null&&W);)if(K?I(Y,P,ee.x+ee.w,"x"):I(Y,P,ee.y+ee.h,"y"),K&&P.x+P.w>V)for(P.x=V-P.w,P.y++;P.x>0&&!a(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const D=d(O);for(let V=0,Y=O.length;V<Y;V++){const W=O[V];if(W.x+W.w>P.cols&&(W.x=P.cols-W.w),W.x<0&&(W.x=0,W.w=P.cols),!W.static)D.push(W);else for(;a(D,W);)W.y++}return O}function h(O,P){for(let D=0,V=O.length;D<V;D++)if(O[D].i===P)return O[D]}function a(O,P){for(let D=0,V=O.length;D<V;D++)if(v(O[D],P))return O[D]}function s(O,P){return O.filter(D=>v(D,P))}function d(O){return O.filter(P=>P.static)}function b(O,P,D,V,Y,W,Z,K,ee){if(P.static&&P.isDraggable!==!0||P.y===V&&P.x===D)return O;`${P.i}${String(D)}${String(V)}${P.x}${P.y}`;const ue=P.x,Pe=P.y;typeof D=="number"&&(P.x=D),typeof V=="number"&&(P.y=V),P.moved=!0;let ye=oe(O,Z);(Z==="vertical"&&typeof V=="number"?Pe>=V:Z==="horizontal"&&typeof D=="number"?ue>=D:!1)&&(ye=ye.reverse());const je=s(ye,P),vt=je.length>0;if(vt&&ee)return o(O);if(vt&&W)return`${P.i}`,P.x=ue,P.y=Pe,P.moved=!1,O;for(let Ht=0,Nr=je.length;Ht<Nr;Ht++){const Me=je[Ht];`${P.i}${P.x}${P.y}${Me.i}${Me.x}${Me.y}`,!Me.moved&&(Me.static?O=l(O,Me,P,Y,Z):O=l(O,P,Me,Y,Z))}return O}function l(O,P,D,V,Y,W){const Z=Y==="horizontal",K=Y==="vertical",ee=P.static;if(V){V=!1;const ye={x:Z?Math.max(P.x-D.w,0):D.x,y:K?Math.max(P.y-D.h,0):D.y,w:D.w,h:D.h,i:"-1"},he=a(O,ye),je=he&&he.y+he.h>P.y,vt=he&&P.x+P.w>he.x;if(he){if(je&&K)return b(O,D,void 0,P.y+1,V,ee,Y);if(je&&Y==null)return P.y=D.y,D.y=D.y+D.h,O;if(vt&&Z)return b(O,P,D.x,void 0,V,ee,Y)}else return`${D.i}${ye.x}${ye.y}`,b(O,D,Z?ye.x:void 0,K?ye.y:void 0,V,ee,Y)}const ue=Z?D.x+1:void 0,Pe=K?D.y+1:void 0;return ue==null&&Pe==null?O:b(O,D,Z?D.x+1:void 0,K?D.y+1:void 0,V,ee,Y)}function m(O){return O*100+"%"}const f=(O,P,D,V)=>O+D>V?P:D,g=(O,P,D)=>O<0?P:D,M=O=>Math.max(0,O),j=O=>Math.max(0,O),U=(O,P,D)=>{let{left:V,height:Y,width:W}=P;const Z=O.top-(Y-O.height);return{left:V,width:W,height:g(Z,O.height,Y),top:j(Z)}},L=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{top:V,height:W,width:f(O.left,O.width,Z,D),left:M(Y)}},E=(O,P,D)=>{let{top:V,height:Y,width:W}=P;const Z=O.left-(W-O.width);return{height:Y,width:Z<0?O.width:f(O.left,O.width,W,D),top:j(V),left:M(Z)}},F=(O,P,D)=>{let{top:V,left:Y,height:W,width:Z}=P;return{width:Z,left:Y,height:g(V,O.height,W),top:j(V)}},Q={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return F(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:F,sw:function(){return F(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function H(O,P,D,V){const Y=Q[O];return Y?Y(P,{...P,...D},V):D}function A(O){let{top:P,left:D,width:V,height:Y}=O;const W=`translate(${D}px,${P}px)`;return{transform:W,WebkitTransform:W,MozTransform:W,msTransform:W,OTransform:W,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function ne(O){let{top:P,left:D,width:V,height:Y}=O;return{top:`${P}px`,left:`${D}px`,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?fe(O):P==="vertical"?se(O):O}function se(O){return O.slice(0).sort(function(P,D){return P.y>D.y||P.y===D.y&&P.x>D.x?1:P.y===D.y&&P.x===D.x?0:-1})}function fe(O){return O.slice(0).sort(function(P,D){return P.x>D.x||P.x===D.x&&P.y>D.y?1:-1})}function ge(O,P,D,V,Y){O=O||[];const W=[];e.default.Children.forEach(P,K=>{if((K==null?void 0:K.key)==null)return;const ee=h(O,String(K.key)),ue=K.props["data-grid"];ee&&ue==null?W.push(C(ee)):ue?W.push(C({...ue,i:K.key})):W.push(C({w:1,h:1,x:0,y:n(W),i:String(K.key)}))});const Z=w(W,{cols:D});return Y?Z:T(Z,V,D)}function Se(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const D=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let V=0,Y=O.length;V<Y;V++){const W=O[V];for(let Z=0;Z<D.length;Z++)if(typeof W[D[Z]]!="number")throw new Error("ReactGridLayout: "+P+"["+V+"]."+D[Z]+" must be a number!")}}function q(O){const{verticalCompact:P,compactType:D}=O||{};return P===!1?null:D}function J(){}const ae=()=>{};return ie.noop=ae,ie}var Te={},wn;function vn(){if(wn)return Te;wn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(u){const{margin:C,containerPadding:p,containerWidth:R,cols:v}=u;return(R-C[0]*(v-1)-p[0]*2)/v}function e(u,C,p){return Number.isFinite(u)?Math.round(C*u+Math.max(0,u-1)*p):u}function r(u,C,p,R,v,T){const{margin:_,containerPadding:I,rowHeight:S}=u,w=t(u),h={};return T&&T.resizing?(h.width=Math.round(T.resizing.width),h.height=Math.round(T.resizing.height)):(h.width=e(R,w,_[0]),h.height=e(v,S,_[1])),T&&T.dragging?(h.top=Math.round(T.dragging.top),h.left=Math.round(T.dragging.left)):T&&T.resizing&&typeof T.resizing.top=="number"&&typeof T.resizing.left=="number"?(h.top=Math.round(T.resizing.top),h.left=Math.round(T.resizing.left)):(h.top=Math.round((S+_[1])*p+I[1]),h.left=Math.round((w+_[0])*C+I[0])),h}function n(u,C,p,R,v){const{margin:T,cols:_,rowHeight:I,maxRows:S}=u,w=t(u);let h=Math.round((p-T[0])/(w+T[0])),a=Math.round((C-T[1])/(I+T[1]));return h=i(h,0,_-R),a=i(a,0,S-v),{x:h,y:a}}function o(u,C,p,R,v,T){const{margin:_,maxRows:I,cols:S,rowHeight:w}=u,h=t(u);let a=Math.round((C+_[0])/(h+_[0])),s=Math.round((p+_[1])/(w+_[1])),d=i(a,0,S-R),b=i(s,0,I-v);return["sw","w","nw"].indexOf(T)!==-1&&(d=i(a,0,S)),["nw","n","ne"].indexOf(T)!==-1&&(b=i(s,0,I)),{w:d,h:b}}function i(u,C,p){return Math.max(Math.min(u,p),C)}return Te}var ke={},Gt={exports:{}},Xt,_n;function po(){if(_n)return Xt;_n=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xt=t,Xt}var Yt,xn;function ho(){if(xn)return Yt;xn=1;var t=po();function e(){}function r(){}return r.resetWarningCache=e,Yt=function(){function n(u,C,p,R,v,T){if(T!==t){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 o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Yt}var En;function Oe(){return En||(En=1,Gt.exports=ho()()),Gt.exports}var Be={exports:{}},Kt={};function hr(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=hr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function On(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=hr(t))&&(n&&(n+=" "),n+=e);return n}const mo=Object.freeze(Object.defineProperty({__proto__:null,clsx:On,default:On},Symbol.toStringTag,{value:"Module"})),go=pr(mo);var de={},xe={},Pn;function qt(){if(Pn)return xe;Pn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.dontSetMe=o,xe.findInArray=t,xe.int=n,xe.isFunction=e,xe.isNum=r;function t(i,u){for(let C=0,p=i.length;C<p;C++)if(u.apply(u,[i[C],C,i]))return i[C]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,u,C){if(i[u])return new Error("Invalid prop ".concat(u," passed to ").concat(C," - do not set this, set it on the child."))}return xe}var Ee={},Mn;function vo(){if(Mn)return Ee;Mn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const C=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.style;if(!C||u in C)return"";for(let p=0;p<t.length;p++)if(r(u,t[p])in C)return t[p];return""}function r(i,u){return u?"".concat(u).concat(o(i)):i}function n(i,u){return u?"-".concat(u.toLowerCase(),"-").concat(i):i}function o(i){let u="",C=!0;for(let p=0;p<i.length;p++)C?(u+=i[p].toUpperCase(),C=!1):i[p]==="-"?C=!0:u+=i[p];return u}return Ee.default=e(),Ee}var Fn;function yn(){if(Fn)return de;Fn=1,Object.defineProperty(de,"__esModule",{value:!0}),de.addClassName=l,de.addEvent=C,de.addUserSelectStyles=d,de.createCSSTransform=S,de.createSVGTransform=w,de.getTouch=a,de.getTouchIdentifier=s,de.getTranslation=h,de.innerHeight=T,de.innerWidth=_,de.matchesSelector=i,de.matchesSelectorAndParentsTo=u,de.offsetXYFromParent=I,de.outerHeight=R,de.outerWidth=v,de.removeClassName=m,de.removeEvent=p,de.removeUserSelectStyles=b;var t=qt(),e=n(vo());function r(f){if(typeof WeakMap!="function")return null;var g=new WeakMap,M=new WeakMap;return(r=function(j){return j?M:g})(f)}function n(f,g){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var M=r(g);if(M&&M.has(f))return M.get(f);var j={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in f)if(L!=="default"&&Object.prototype.hasOwnProperty.call(f,L)){var E=U?Object.getOwnPropertyDescriptor(f,L):null;E&&(E.get||E.set)?Object.defineProperty(j,L,E):j[L]=f[L]}return j.default=f,M&&M.set(f,j),j}let o="";function i(f,g){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(f[M])})),(0,t.isFunction)(f[o])?f[o](g):!1}function u(f,g,M){let j=f;do{if(i(j,g))return!0;if(j===M)return!1;j=j.parentNode}while(j);return!1}function C(f,g,M,j){if(!f)return;const U={capture:!0,...j};f.addEventListener?f.addEventListener(g,M,U):f.attachEvent?f.attachEvent("on"+g,M):f["on"+g]=M}function p(f,g,M,j){if(!f)return;const U={capture:!0,...j};f.removeEventListener?f.removeEventListener(g,M,U):f.detachEvent?f.detachEvent("on"+g,M):f["on"+g]=null}function R(f){let g=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(M.borderTopWidth),g+=(0,t.int)(M.borderBottomWidth),g}function v(f){let g=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(M.borderLeftWidth),g+=(0,t.int)(M.borderRightWidth),g}function T(f){let g=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(M.paddingTop),g-=(0,t.int)(M.paddingBottom),g}function _(f){let g=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(M.paddingLeft),g-=(0,t.int)(M.paddingRight),g}function I(f,g,M){const U=g===g.ownerDocument.body?{left:0,top:0}:g.getBoundingClientRect(),L=(f.clientX+g.scrollLeft-U.left)/M,E=(f.clientY+g.scrollTop-U.top)/M;return{x:L,y:E}}function S(f,g){const M=h(f,g,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(f,g){return h(f,g,"")}function h(f,g,M){let{x:j,y:U}=f,L="translate(".concat(j).concat(M,",").concat(U).concat(M,")");if(g){const E="".concat(typeof g.x=="string"?g.x:g.x+M),F="".concat(typeof g.y=="string"?g.y:g.y+M);L="translate(".concat(E,", ").concat(F,")")+L}return L}function a(f,g){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,M=>g===M.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,M=>g===M.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 g=f.getElementById("react-draggable-style-el");g||(g=f.createElement("style"),g.type="text/css",g.id="react-draggable-style-el",g.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
1
|
+
"use strict";var jr=Object.defineProperty;var Lr=(t,e,r)=>e in t?jr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _e=(t,e,r)=>Lr(t,typeof e!="symbol"?e+"":e,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("@univerjs/core"),c=require("@univerjs/sheets-conditional-formatting"),G=require("@univerjs/sheets"),te=require("@univerjs/ui"),x=require("react/jsx-runtime"),N=require("react"),oe=require("@univerjs/design"),rn=require("@univerjs/engine-formula"),de=require("@univerjs/sheets-ui"),lr=require("react-dom"),be=require("rxjs"),ft=require("@univerjs/sheets-formula-ui"),ur=require("@univerjs/engine-render"),it=require("rxjs/operators"),an={type:w.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(w.ICommandService),p=t.get(w.IUniverInstanceService),b=G.getSheetCommandTarget(p);if(!b)return!1;const{unitId:v,subUnitId:R}=b,_=u.createCfId(v,R),T={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:i,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:T})}},pt={type:w.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(w.IUndoRedoService),o=t.get(w.ICommandService),i=t.get(c.ConditionalFormattingRuleModel),u=t.get(w.IUniverInstanceService),y=G.getSheetCommandTarget(u);if(!y)return!1;const{unitId:p,subUnitId:b}=y,v=i.createCfId(p,b),R={unitId:p,subUnitId:b,rule:{...r,cfId:r.cfId||v}},_=c.AddConditionalRuleMutationUndoFactory(t,R),T=o.syncExecuteCommand(c.AddConditionalRuleMutation.id,R);return T&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:R}],undoMutations:[_]}),T}},sn={type:w.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(w.ICommandService),y=t.get(w.IUniverInstanceService),p=G.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:v}=p,R=i.createCfId(b,v),_={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:v,rule:_})}},ln={type:w.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:o,nativeColor:i,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:b}=e,v=t.get(c.ConditionalFormattingRuleModel),R=t.get(w.IUniverInstanceService),_=G.getSheetCommandTarget(R);if(!_)return!1;const{unitId:T,subUnitId:C}=_,I=t.get(w.ICommandService),h=v.createCfId(T,C),a={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:o,nativeColor:i,positiveColor:u,isGradient:y}}};return I.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:C,rule:a})}},un={type:w.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(w.ICommandService),y=t.get(w.IUniverInstanceService),p=G.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:v}=p,R=i.createCfId(b,v),_={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:v,rule:_})}},cn={type:w.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(w.ICommandService),b=t.get(w.IUniverInstanceService),v=G.getSheetCommandTarget(b);if(!v)return!1;const{unitId:R,subUnitId:_}=v,T=y.createCfId(R,_);let C;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(i)){const I=u;if(I.length!==2||!Array.isArray(I))return!1;C={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:I}}}else{const I=u;if(typeof I!="number")return!1;C={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:i,style:n,value:I}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:R,subUnitId:_,rule:C})}},dn={type:w.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,isPercent:i,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),b=t.get(w.IUniverInstanceService),v=t.get(w.ICommandService),R=G.getSheetCommandTarget(b);if(!R)return!1;const{unitId:_,subUnitId:T}=R,C=p.createCfId(_,T),I={ranges:r,cfId:C,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:i,isBottom:u,style:n,value:y}};return v.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:T,rule:I})}},fn={type:w.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(w.IUniverInstanceService),b=G.getSheetCommandTarget(p);if(!b)return!1;const{unitId:v,subUnitId:R}=b,_=t.get(w.ICommandService),T=y.createCfId(v,R),C={ranges:r,cfId:T,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:i,style:n,value:u}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:C})}},pn={type:w.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o,operator:i}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(w.IUniverInstanceService),p=t.get(w.ICommandService),b=G.getSheetCommandTarget(y);if(!b)return!1;const{unitId:v,subUnitId:R}=b,_=u.createCfId(v,R),T={ranges:r,cfId:_,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:i,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:v,subUnitId:R,rule:T})}},hn={type:w.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:o}=e,i=t.get(c.ConditionalFormattingRuleModel),u=t.get(w.IUniverInstanceService),y=t.get(w.ICommandService),p=G.getSheetCommandTarget(u);if(!p)return!1;const{unitId:b,subUnitId:v}=p,R=i.createCfId(b,v),_={ranges:r,cfId:R,stopIfTrue:!!o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:v,rule:_})}},Vt={type:w.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var I;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(w.IUniverInstanceService),o=t.get(w.ICommandService),i=t.get(w.IUndoRedoService),u=t.get(G.SheetsSelectionsService),y=G.getSheetCommandTarget(n,e);if(!y)return!1;const{unitId:p,subUnitId:b}=y,v=((I=u.getCurrentSelections())==null?void 0:I.map(h=>h.range))||[],R=r.getSubunitRules(p,b);if(!(R!=null&&R.length)||!v.length)return!1;const _=[],T=[];R.forEach(h=>{const a=new w.ObjectMatrix;h.ranges.forEach(d=>{w.Range.foreach(d,(S,l)=>{a.setValue(S,l,1)})}),v.forEach(d=>{w.Range.foreach(d,(S,l)=>{a.realDeleteValue(S,l)})});const s=G.findAllRectangle(G.createTopMatrixFromMatrix(a));if(s.length){const d={...h,ranges:s},S={unitId:p,subUnitId:b,rule:d},l=c.setConditionalRuleMutationUndoFactory(t,S);_.push({id:c.SetConditionalRuleMutation.id,params:S}),T.push(...l)}else{const d={unitId:p,subUnitId:b,cfId:h.cfId},S=c.DeleteConditionalRuleMutationUndoFactory(t,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),T.push(...S)}});const C=w.sequenceExecute(_,o).result;return C&&i.pushUndoRedo({unitID:p,redoMutations:_,undoMutations:T}),C}},ht={type:w.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(w.IUniverInstanceService),o=t.get(w.ICommandService),i=t.get(w.IUndoRedoService),u=G.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 v=b.map(C=>({cfId:C.cfId,unitId:y,subUnitId:p})),R=v.map(C=>({id:c.DeleteConditionalRuleMutation.id,params:C})),_=v.map(C=>c.DeleteConditionalRuleMutationUndoFactory(t,C)[0]),T=w.sequenceExecute(R,o).result;return T&&i.pushUndoRedo({unitID:y,redoMutations:R,undoMutations:_}),T}},at={type:w.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:y}=i,p={unitId:u,subUnitId:y,cfId:e.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),v}},$t={type:w.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),u=G.getSheetCommandTarget(o,e);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=c.transformSupportSymmetryAnchor(e.start,e.end,i.getSubunitRules(y,p)||[],I=>I.cfId);if(!b)return!1;const[v,R]=b,_={unitId:y,subUnitId:p,start:v,end:R},T=c.MoveConditionalRuleMutationUndoFactory(_),C=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return C&&r.pushUndoRedo({unitID:y,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:T}),C}},zt={type:w.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(w.IUndoRedoService),n=t.get(w.ICommandService),o=t.get(w.IUniverInstanceService),i=G.getSheetCommandTarget(o,e);if(!i)return!1;const{unitId:u,subUnitId:y}=i,p={unitId:u,subUnitId:y,rule:e.rule},b=c.setConditionalRuleMutationUndoFactory(t,p),v=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return v&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),v}},Ur="univer-conditional-formatting-wrap",Vr="univer-cf-rule-item",$r="univer-preview",zr="univer-create-rule",Ar="univer-button",qr="univer-title",Wr="univer-label",Hr="univer-label-container",kr="univer-input-width",Br="univer-m-t-base",Gr="univer-m-t-sm",Xr="univer-m-t-xl",Yr="univer-m-l-sm",Kr="univer-m-l-xl",Zr="univer-m-l-xxs",Jr="univer-m-l-0",Qr="univer-m-r-0",$={conditionalFormattingWrap:Ur,cfRuleItem:Vr,preview:$r,createRule:zr,button:Ar,title:qr,label:Wr,labelContainer:Hr,inputWidth:kr,mTBase:Br,mTSm:Gr,mTXl:Xr,mLSm:Yr,mLXl:Kr,mLXxs:Zr,mL0:Jr,mR0:Qr};var Ce=function(){return Ce=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])}return t},Ce.apply(this,arguments)},eo=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 o=0,n=Object.getOwnPropertySymbols(t);o<n.length;o++)e.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(t,n[o])&&(r[n[o]]=t[n[o]]);return r},Ae=N.forwardRef(function(t,e){var r=t.icon,n=t.id,o=t.className,i=t.extend,u=eo(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),p=N.useRef("_".concat(ro()));return cr(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Ce({ref:e,className:y},u),i)});function cr(t,e,r,n,o){return N.createElement(t.tag,Ce(Ce({key:e},to(t,r,o)),n),(no(t,r).children||[]).map(function(i,u){return cr(i,"".concat(e,"-").concat(t.tag,"-").concat(u),r,void 0,o)}))}function to(t,e,r){var n=Ce({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var o=e.defIds;return!o||o.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(i){var u=i[0],y=i[1];typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function no(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)?Ce(Ce({},t),{children:t.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?Ce(Ce({},o),{attrs:Ce(Ce({},o.attrs),{id:o.attrs.id+e.idSuffix})}):o})}):t}function ro(){return Math.random().toString(36).substring(2,8)}Ae.displayName="UniverIcon";var oo={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"}}]},Ot=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"delete-single",ref:e,icon:oo}))});Ot.displayName="DeleteSingle";var io={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"}}]},dr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"increase-single",ref:e,icon:io}))});dr.displayName="IncreaseSingle";var ao={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"}}]},At=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"more-down-single",ref:e,icon:ao}))});At.displayName="MoreDownSingle";var so={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"}}]}]},fr=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"sequence-single",ref:e,icon:so}))});fr.displayName="SequenceSingle";var lo={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"}}]}]},mt=N.forwardRef(function(t,e){return N.createElement(Ae,Object.assign({},t,{id:"slash-single",ref:e,icon:lo}))});mt.displayName="SlashSingle";function uo(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function pr(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 o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}),r}var kt={exports:{}},He={},ot={exports:{}},co=ot.exports,bn;function mn(){return bn||(bn=1,function(t,e){(function(r,n){n(e)})(co,function(r){function n(W){return function(se,O,P,D,V,Y,A){return W(se,O,A)}}function o(W){return function(se,O,P,D){if(!se||!O||typeof se!="object"||typeof O!="object")return W(se,O,P,D);var V=D.get(se),Y=D.get(O);if(V&&Y)return V===O&&Y===se;D.set(se,O),D.set(O,se);var A=W(se,O,P,D);return D.delete(se),D.delete(O),A}}function i(W,J){var se={};for(var O in W)se[O]=W[O];for(var O in J)se[O]=J[O];return se}function u(W){return W.constructor===Object||W.constructor==null}function y(W){return typeof W.then=="function"}function p(W,J){return W===J||W!==W&&J!==J}var b="[object Arguments]",v="[object Boolean]",R="[object Date]",_="[object RegExp]",T="[object Map]",C="[object Number]",I="[object Object]",h="[object Set]",a="[object String]",s=Object.prototype.toString;function d(W){var J=W.areArraysEqual,se=W.areDatesEqual,O=W.areMapsEqual,P=W.areObjectsEqual,D=W.areRegExpsEqual,V=W.areSetsEqual,Y=W.createIsNestedEqual,A=Y(Z);function Z(K,ee,ce){if(K===ee)return!0;if(!K||!ee||typeof K!="object"||typeof ee!="object")return K!==K&&ee!==ee;if(u(K)&&u(ee))return P(K,ee,A,ce);var Pe=Array.isArray(K),ye=Array.isArray(ee);if(Pe||ye)return Pe===ye&&J(K,ee,A,ce);var me=s.call(K);return me!==s.call(ee)?!1:me===R?se(K,ee,A,ce):me===_?D(K,ee,A,ce):me===T?O(K,ee,A,ce):me===h?V(K,ee,A,ce):me===I||me===b?y(K)||y(ee)?!1:P(K,ee,A,ce):me===v||me===C||me===a?p(K.valueOf(),ee.valueOf()):!1}return Z}function S(W,J,se,O){var P=W.length;if(J.length!==P)return!1;for(;P-- >0;)if(!se(W[P],J[P],P,P,W,J,O))return!1;return!0}var l=o(S);function m(W,J){return p(W.valueOf(),J.valueOf())}function f(W,J,se,O){var P=W.size===J.size;if(!P)return!1;if(!W.size)return!0;var D={},V=0;return W.forEach(function(Y,A){if(P){var Z=!1,K=0;J.forEach(function(ee,ce){!Z&&!D[K]&&(Z=se(A,ce,V,K,W,J,O)&&se(Y,ee,A,ce,W,J,O))&&(D[K]=!0),K++}),V++,P=Z}}),P}var g=o(f),M="_owner",j=Object.prototype.hasOwnProperty;function U(W,J,se,O){var P=Object.keys(W),D=P.length;if(Object.keys(J).length!==D)return!1;for(var V;D-- >0;){if(V=P[D],V===M){var Y=!!W.$$typeof,A=!!J.$$typeof;if((Y||A)&&Y!==A)return!1}if(!j.call(J,V)||!se(W[V],J[V],V,V,W,J,O))return!1}return!0}var L=o(U);function E(W,J){return W.source===J.source&&W.flags===J.flags}function F(W,J,se,O){var P=W.size===J.size;if(!P)return!1;if(!W.size)return!0;var D={};return W.forEach(function(V,Y){if(P){var A=!1,Z=0;J.forEach(function(K,ee){!A&&!D[Z]&&(A=se(V,K,Y,ee,W,J,O))&&(D[Z]=!0),Z++}),P=A}}),P}var z=o(F),B=Object.freeze({areArraysEqual:S,areDatesEqual:m,areMapsEqual:f,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:F,createIsNestedEqual:n}),X=Object.freeze({areArraysEqual:l,areDatesEqual:m,areMapsEqual:g,areObjectsEqual:L,areRegExpsEqual:E,areSetsEqual:z,createIsNestedEqual:n}),ne=d(B);function Q(W,J){return ne(W,J,void 0)}var H=d(i(B,{createIsNestedEqual:function(){return p}}));function q(W,J){return H(W,J,void 0)}var re=d(X);function ie(W,J){return re(W,J,new WeakMap)}var le=d(i(X,{createIsNestedEqual:function(){return p}}));function pe(W,J){return le(W,J,new WeakMap)}function ge(W){return d(i(B,W(B)))}function Se(W){var J=d(i(X,W(X)));return function(se,O,P){return P===void 0&&(P=new WeakMap),J(se,O,P)}}r.circularDeepEqual=ie,r.circularShallowEqual=pe,r.createCustomCircularEqual=Se,r.createCustomEqual=ge,r.deepEqual=Q,r.sameValueZeroEqual=p,r.shallowEqual=q,Object.defineProperty(r,"__esModule",{value:!0})})}(ot,ot.exports)),ot.exports}var yt={exports:{}},Rn;function gn(){if(Rn)return yt.exports;Rn=1;function t(r){var n,o,i="";if(typeof r=="string"||typeof r=="number")i+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(o=t(r[n]))&&(i&&(i+=" "),i+=o)}else for(o in r)r[o]&&(i&&(i+=" "),i+=o);return i}function e(){for(var r,n,o=0,i="",u=arguments.length;o<u;o++)(r=arguments[o])&&(n=t(r))&&(i&&(i+=" "),i+=n);return i}return yt.exports=e,yt.exports.clsx=e,yt.exports}var ae={},Bt,Tn;function fo(){return Tn||(Tn=1,Bt=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)}),Bt}var In;function qe(){if(In)return ae;In=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=p,ae.cloneLayout=o,ae.cloneLayoutItem=y,ae.collides=v,ae.compact=R,ae.compactItem=C,ae.compactType=W,ae.correctBounds=I,ae.fastPositionEqual=b,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=a,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=i,ae.moveElement=S,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=m,ae.resizeItemInDirection=H,ae.setTopLeft=re,ae.setTransform=q,ae.sortLayoutItems=ie,ae.sortLayoutItemsByColRow=pe,ae.sortLayoutItemsByRowCol=le,ae.synchronizeLayoutWithChildren=ge,ae.validateLayout=Se,ae.withLayoutItem=u;var t=mn(),e=r(N);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,D;for(let V=0,Y=O.length;V<Y;V++)D=O[V].y+O[V].h,D>P&&(P=D);return P}function o(O){const P=Array(O.length);for(let D=0,V=O.length;D<V;D++)P[D]=y(O[D]);return P}function i(O,P){const D=Array(O.length);for(let V=0,Y=O.length;V<Y;V++)P.i===O[V].i?D[V]=P:D[V]=O[V];return D}function u(O,P,D){let V=h(O,P);return V?(V=D(y(V)),O=i(O,V),[O,V]):[O,null]}function y(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function p(O,P){return(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.key),e.default.Children.map(P,D=>D==null?void 0:D.key))&&(0,t.deepEqual)(e.default.Children.map(O,D=>D==null?void 0:D.props["data-grid"]),e.default.Children.map(P,D=>D==null?void 0:D.props["data-grid"]))}ae.fastRGLPropsEqual=fo();function b(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function v(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function R(O,P,D,V){const Y=d(O),A=ie(O,P),Z=Array(O.length);for(let K=0,ee=A.length;K<ee;K++){let ce=y(A[K]);ce.static||(ce=C(Y,ce,P,D,A,V),Y.push(ce)),Z[O.indexOf(A[K])]=ce,ce.moved=!1}return Z}const _={x:"w",y:"h"};function T(O,P,D,V){const Y=_[V];P[V]+=1;const A=O.map(Z=>Z.i).indexOf(P.i);for(let Z=A+1;Z<O.length;Z++){const K=O[Z];if(!K.static){if(K.y>P.y+P.h)break;v(P,K)&&T(O,K,D+P[Y],V)}}P[V]=D}function C(O,P,D,V,Y,A){const Z=D==="vertical",K=D==="horizontal";if(Z)for(P.y=Math.min(n(O),P.y);P.y>0&&!a(O,P);)P.y--;else if(K)for(;P.x>0&&!a(O,P);)P.x--;let ee;for(;(ee=a(O,P))&&!(D===null&&A);)if(K?T(Y,P,ee.x+ee.w,"x"):T(Y,P,ee.y+ee.h,"y"),K&&P.x+P.w>V)for(P.x=V-P.w,P.y++;P.x>0&&!a(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function I(O,P){const D=d(O);for(let V=0,Y=O.length;V<Y;V++){const A=O[V];if(A.x+A.w>P.cols&&(A.x=P.cols-A.w),A.x<0&&(A.x=0,A.w=P.cols),!A.static)D.push(A);else for(;a(D,A);)A.y++}return O}function h(O,P){for(let D=0,V=O.length;D<V;D++)if(O[D].i===P)return O[D]}function a(O,P){for(let D=0,V=O.length;D<V;D++)if(v(O[D],P))return O[D]}function s(O,P){return O.filter(D=>v(D,P))}function d(O){return O.filter(P=>P.static)}function S(O,P,D,V,Y,A,Z,K,ee){if(P.static&&P.isDraggable!==!0||P.y===V&&P.x===D)return O;`${P.i}${String(D)}${String(V)}${P.x}${P.y}`;const ce=P.x,Pe=P.y;typeof D=="number"&&(P.x=D),typeof V=="number"&&(P.y=V),P.moved=!0;let ye=ie(O,Z);(Z==="vertical"&&typeof V=="number"?Pe>=V:Z==="horizontal"&&typeof D=="number"?ce>=D:!1)&&(ye=ye.reverse());const je=s(ye,P),vt=je.length>0;if(vt&&ee)return o(O);if(vt&&A)return`${P.i}`,P.x=ce,P.y=Pe,P.moved=!1,O;for(let Ht=0,Nr=je.length;Ht<Nr;Ht++){const Me=je[Ht];`${P.i}${P.x}${P.y}${Me.i}${Me.x}${Me.y}`,!Me.moved&&(Me.static?O=l(O,Me,P,Y,Z):O=l(O,P,Me,Y,Z))}return O}function l(O,P,D,V,Y,A){const Z=Y==="horizontal",K=Y==="vertical",ee=P.static;if(V){V=!1;const ye={x:Z?Math.max(P.x-D.w,0):D.x,y:K?Math.max(P.y-D.h,0):D.y,w:D.w,h:D.h,i:"-1"},me=a(O,ye),je=me&&me.y+me.h>P.y,vt=me&&P.x+P.w>me.x;if(me){if(je&&K)return S(O,D,void 0,P.y+1,V,ee,Y);if(je&&Y==null)return P.y=D.y,D.y=D.y+D.h,O;if(vt&&Z)return S(O,P,D.x,void 0,V,ee,Y)}else return`${D.i}${ye.x}${ye.y}`,S(O,D,Z?ye.x:void 0,K?ye.y:void 0,V,ee,Y)}const ce=Z?D.x+1:void 0,Pe=K?D.y+1:void 0;return ce==null&&Pe==null?O:S(O,D,Z?D.x+1:void 0,K?D.y+1:void 0,V,ee,Y)}function m(O){return O*100+"%"}const f=(O,P,D,V)=>O+D>V?P:D,g=(O,P,D)=>O<0?P:D,M=O=>Math.max(0,O),j=O=>Math.max(0,O),U=(O,P,D)=>{let{left:V,height:Y,width:A}=P;const Z=O.top-(Y-O.height);return{left:V,width:A,height:g(Z,O.height,Y),top:j(Z)}},L=(O,P,D)=>{let{top:V,left:Y,height:A,width:Z}=P;return{top:V,height:A,width:f(O.left,O.width,Z,D),left:M(Y)}},E=(O,P,D)=>{let{top:V,height:Y,width:A}=P;const Z=O.left-(A-O.width);return{height:Y,width:Z<0?O.width:f(O.left,O.width,A,D),top:j(V),left:M(Z)}},F=(O,P,D)=>{let{top:V,left:Y,height:A,width:Z}=P;return{width:Z,left:Y,height:g(V,O.height,A),top:j(V)}},Q={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],L(...arguments))},e:L,se:function(){return F(arguments.length<=0?void 0:arguments[0],L(...arguments))},s:F,sw:function(){return F(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return U(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function H(O,P,D,V){const Y=Q[O];return Y?Y(P,{...P,...D},V):D}function q(O){let{top:P,left:D,width:V,height:Y}=O;const A=`translate(${D}px,${P}px)`;return{transform:A,WebkitTransform:A,MozTransform:A,msTransform:A,OTransform:A,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function re(O){let{top:P,left:D,width:V,height:Y}=O;return{top:`${P}px`,left:`${D}px`,width:`${V}px`,height:`${Y}px`,position:"absolute"}}function ie(O,P){return P==="horizontal"?pe(O):P==="vertical"?le(O):O}function le(O){return O.slice(0).sort(function(P,D){return P.y>D.y||P.y===D.y&&P.x>D.x?1:P.y===D.y&&P.x===D.x?0:-1})}function pe(O){return O.slice(0).sort(function(P,D){return P.x>D.x||P.x===D.x&&P.y>D.y?1:-1})}function ge(O,P,D,V,Y){O=O||[];const A=[];e.default.Children.forEach(P,K=>{if((K==null?void 0:K.key)==null)return;const ee=h(O,String(K.key)),ce=K.props["data-grid"];ee&&ce==null?A.push(y(ee)):ce?A.push(y({...ce,i:K.key})):A.push(y({w:1,h:1,x:0,y:n(A),i:String(K.key)}))});const Z=I(A,{cols:D});return Y?Z:R(Z,V,D)}function Se(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const D=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let V=0,Y=O.length;V<Y;V++){const A=O[V];for(let Z=0;Z<D.length;Z++){const K=D[Z],ee=A[K];if(typeof ee!="number"||Number.isNaN(ee))throw new Error(`ReactGridLayout: ${P}[${V}].${K} must be a number! Received: ${ee} (${typeof ee})`)}if(typeof A.i<"u"&&typeof A.i!="string")throw new Error(`ReactGridLayout: ${P}[${V}].i must be a string! Received: ${A.i} (${typeof A.i})`)}}function W(O){const{verticalCompact:P,compactType:D}=O||{};return P===!1?null:D}function J(){}const se=()=>{};return ae.noop=se,ae}var Te={},wn;function vn(){if(wn)return Te;wn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.calcGridColWidth=t,Te.calcGridItemPosition=r,Te.calcGridItemWHPx=e,Te.calcWH=o,Te.calcXY=n,Te.clamp=i;function t(u){const{margin:y,containerPadding:p,containerWidth:b,cols:v}=u;return(b-y[0]*(v-1)-p[0]*2)/v}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,v,R){const{margin:_,containerPadding:T,rowHeight:C}=u,I=t(u),h={};return R&&R.resizing?(h.width=Math.round(R.resizing.width),h.height=Math.round(R.resizing.height)):(h.width=e(b,I,_[0]),h.height=e(v,C,_[1])),R&&R.dragging?(h.top=Math.round(R.dragging.top),h.left=Math.round(R.dragging.left)):R&&R.resizing&&typeof R.resizing.top=="number"&&typeof R.resizing.left=="number"?(h.top=Math.round(R.resizing.top),h.left=Math.round(R.resizing.left)):(h.top=Math.round((C+_[1])*p+T[1]),h.left=Math.round((I+_[0])*y+T[0])),h}function n(u,y,p,b,v){const{margin:R,containerPadding:_,cols:T,rowHeight:C,maxRows:I}=u,h=t(u);let a=Math.round((p-_[0])/(h+R[0])),s=Math.round((y-_[1])/(C+R[1]));return a=i(a,0,T-b),s=i(s,0,I-v),{x:a,y:s}}function o(u,y,p,b,v,R){const{margin:_,maxRows:T,cols:C,rowHeight:I}=u,h=t(u);let a=Math.round((y+_[0])/(h+_[0])),s=Math.round((p+_[1])/(I+_[1])),d=i(a,0,C-b),S=i(s,0,T-v);return["sw","w","nw"].indexOf(R)!==-1&&(d=i(a,0,C)),["nw","n","ne"].indexOf(R)!==-1&&(S=i(s,0,T)),{w:d,h:S}}function i(u,y,p){return Math.max(Math.min(u,p),y)}return Te}var ke={},Gt={exports:{}},Xt,_n;function po(){if(_n)return Xt;_n=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Xt=t,Xt}var Yt,xn;function ho(){if(xn)return Yt;xn=1;var t=po();function e(){}function r(){}return r.resetWarningCache=e,Yt=function(){function n(u,y,p,b,v,R){if(R!==t){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 o(){return n}var i={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:o,element:n,elementType:n,instanceOf:o,node:n,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:r,resetWarningCache:e};return i.PropTypes=i,i},Yt}var En;function Oe(){return En||(En=1,Gt.exports=ho()()),Gt.exports}var Be={exports:{}},Kt={};function hr(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=hr(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function On(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=hr(t))&&(n&&(n+=" "),n+=e);return n}const mo=Object.freeze(Object.defineProperty({__proto__:null,clsx:On,default:On},Symbol.toStringTag,{value:"Module"})),go=pr(mo);var fe={},xe={},Pn;function qt(){if(Pn)return xe;Pn=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.dontSetMe=o,xe.findInArray=t,xe.int=n,xe.isFunction=e,xe.isNum=r;function t(i,u){for(let y=0,p=i.length;y<p;y++)if(u.apply(u,[i[y],y,i]))return i[y]}function e(i){return typeof i=="function"||Object.prototype.toString.call(i)==="[object Function]"}function r(i){return typeof i=="number"&&!isNaN(i)}function n(i){return parseInt(i,10)}function o(i,u,y){if(i[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return xe}var Ee={},Mn;function vo(){if(Mn)return Ee;Mn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.browserPrefixToKey=r,Ee.browserPrefixToStyle=n,Ee.default=void 0,Ee.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var i;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(i=window.document)===null||i===void 0||(i=i.documentElement)===null||i===void 0?void 0:i.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(i,u){return u?"".concat(u).concat(o(i)):i}function n(i,u){return u?"-".concat(u.toLowerCase(),"-").concat(i):i}function o(i){let u="",y=!0;for(let p=0;p<i.length;p++)y?(u+=i[p].toUpperCase(),y=!1):i[p]==="-"?y=!0:u+=i[p];return u}return Ee.default=e(),Ee}var Fn;function yn(){if(Fn)return fe;Fn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=l,fe.addEvent=y,fe.addUserSelectStyles=d,fe.createCSSTransform=C,fe.createSVGTransform=I,fe.getTouch=a,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=R,fe.innerWidth=_,fe.matchesSelector=i,fe.matchesSelectorAndParentsTo=u,fe.offsetXYFromParent=T,fe.outerHeight=b,fe.outerWidth=v,fe.removeClassName=m,fe.removeEvent=p,fe.removeUserSelectStyles=S;var t=qt(),e=n(vo());function r(f){if(typeof WeakMap!="function")return null;var g=new WeakMap,M=new WeakMap;return(r=function(j){return j?M:g})(f)}function n(f,g){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var M=r(g);if(M&&M.has(f))return M.get(f);var j={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var L in f)if(L!=="default"&&Object.prototype.hasOwnProperty.call(f,L)){var E=U?Object.getOwnPropertyDescriptor(f,L):null;E&&(E.get||E.set)?Object.defineProperty(j,L,E):j[L]=f[L]}return j.default=f,M&&M.set(f,j),j}let o="";function i(f,g){return o||(o=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(f[M])})),(0,t.isFunction)(f[o])?f[o](g):!1}function u(f,g,M){let j=f;do{if(i(j,g))return!0;if(j===M)return!1;j=j.parentNode}while(j);return!1}function y(f,g,M,j){if(!f)return;const U={capture:!0,...j};f.addEventListener?f.addEventListener(g,M,U):f.attachEvent?f.attachEvent("on"+g,M):f["on"+g]=M}function p(f,g,M,j){if(!f)return;const U={capture:!0,...j};f.removeEventListener?f.removeEventListener(g,M,U):f.detachEvent?f.detachEvent("on"+g,M):f["on"+g]=null}function b(f){let g=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(M.borderTopWidth),g+=(0,t.int)(M.borderBottomWidth),g}function v(f){let g=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g+=(0,t.int)(M.borderLeftWidth),g+=(0,t.int)(M.borderRightWidth),g}function R(f){let g=f.clientHeight;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(M.paddingTop),g-=(0,t.int)(M.paddingBottom),g}function _(f){let g=f.clientWidth;const M=f.ownerDocument.defaultView.getComputedStyle(f);return g-=(0,t.int)(M.paddingLeft),g-=(0,t.int)(M.paddingRight),g}function T(f,g,M){const U=g===g.ownerDocument.body?{left:0,top:0}:g.getBoundingClientRect(),L=(f.clientX+g.scrollLeft-U.left)/M,E=(f.clientY+g.scrollTop-U.top)/M;return{x:L,y:E}}function C(f,g){const M=h(f,g,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function I(f,g){return h(f,g,"")}function h(f,g,M){let{x:j,y:U}=f,L="translate(".concat(j).concat(M,",").concat(U).concat(M,")");if(g){const E="".concat(typeof g.x=="string"?g.x:g.x+M),F="".concat(typeof g.y=="string"?g.y:g.y+M);L="translate(".concat(E,", ").concat(F,")")+L}return L}function a(f,g){return f.targetTouches&&(0,t.findInArray)(f.targetTouches,M=>g===M.identifier)||f.changedTouches&&(0,t.findInArray)(f.changedTouches,M=>g===M.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 g=f.getElementById("react-draggable-style-el");g||(g=f.createElement("style"),g.type="text/css",g.id="react-draggable-style-el",g.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
2
2
|
`,g.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
3
|
-
`,f.getElementsByTagName("head")[0].appendChild(g)),f.body&&l(f.body,"react-draggable-transparent-selection")}function b(f){if(f)try{if(f.body&&m(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const g=(f.defaultView||window).getSelection();g&&g.type!=="Caret"&&g.removeAllRanges()}}catch{}}function l(f,g){f.classList?f.classList.add(g):f.className.match(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)")))||(f.className+=" ".concat(g))}function m(f,g){f.classList?f.classList.remove(g):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)"),"g"),"")}return de}var Re={},Dn;function mr(){if(Dn)return Re;Dn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=C,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=u,Re.snapToGrid=n;var t=qt(),e=yn();function r(T,_,I){if(!T.props.bounds)return[_,I];let{bounds:S}=T.props;S=typeof S=="string"?S:R(S);const w=v(T);if(typeof S=="string"){const{ownerDocument:h}=w,a=h.defaultView;let s;if(S==="parent"?s=w.parentNode:s=h.querySelector(S),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const d=s,b=a.getComputedStyle(w),l=a.getComputedStyle(d);S={left:-w.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-w.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(_=Math.min(_,S.right)),(0,t.isNum)(S.bottom)&&(I=Math.min(I,S.bottom)),(0,t.isNum)(S.left)&&(_=Math.max(_,S.left)),(0,t.isNum)(S.top)&&(I=Math.max(I,S.top)),[_,I]}function n(T,_,I){const S=Math.round(_/T[0])*T[0],w=Math.round(I/T[1])*T[1];return[S,w]}function o(T){return T.props.axis==="both"||T.props.axis==="x"}function i(T){return T.props.axis==="both"||T.props.axis==="y"}function u(T,_,I){const S=typeof _=="number"?(0,e.getTouch)(T,_):null;if(typeof _=="number"&&!S)return null;const w=v(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(S||T,h,I.props.scale)}function C(T,_,I){const S=!(0,t.isNum)(T.lastX),w=v(T);return S?{node:w,deltaX:0,deltaY:0,lastX:_,lastY:I,x:_,y:I}:{node:w,deltaX:_-T.lastX,deltaY:I-T.lastY,lastX:T.lastX,lastY:T.lastY,x:_,y:I}}function p(T,_){const I=T.props.scale;return{node:_.node,x:T.state.x+_.deltaX/I,y:T.state.y+_.deltaY/I,deltaX:_.deltaX/I,deltaY:_.deltaY/I,lastX:T.state.x,lastY:T.state.y}}function R(T){return{left:T.left,top:T.top,right:T.right,bottom:T.bottom}}function v(T){const _=T.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Re}var Ge={},Ct={},Nn;function gr(){if(Nn)return Ct;Nn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=t;function t(){}return Ct}var jn;function yo(){if(jn)return Ge;jn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=void 0;var t=R(N),e=C(Oe()),r=C(lr),n=yn(),o=mr(),i=qt(),u=C(gr());function C(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var d={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=b?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=I.mouse,w=class extends t.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.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||!(a.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const b=(0,n.getTouchIdentifier)(a);this.touchIdentifier=b;const l=(0,o.getControlPosition)(a,b,this);if(l==null)return;const{x:m,y:f}=l,g=(0,o.createCoreData)(this,m,f);(0,u.default)("DraggableCore: handleDragStart: %j",g),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(a,g)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=m,this.lastY=f,(0,n.addEvent)(d,S.move,this.handleDrag),(0,n.addEvent)(d,S.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:b}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,g=b-this.lastY;if([f,g]=(0,o.snapToGrid)(this.props.grid,f,g),!f&&!g)return;d=this.lastX+f,b=this.lastY+g}const l=(0,o.createCoreData)(this,d,b);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(a,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(g)}return}this.lastX=d,this.lastY=b}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:b}=s;if(Array.isArray(this.props.grid)){let g=d-this.lastX||0,M=b-this.lastY||0;[g,M]=(0,o.snapToGrid)(this.props.grid,g,M),d=this.lastX+g,b=this.lastY+M}const l=(0,o.createCoreData)(this,d,b);if(this.props.onStop(a,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,S.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,S.stop,this.handleDragStop))}),v(this,"onMouseDown",a=>(S=I.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(S=I.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(S=I.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(S=I.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.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 Ge.default=w,v(w,"displayName","DraggableCore"),v(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].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:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),v(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ge}var Ln;function Co(){return Ln||(Ln=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=_(N),r=v(Oe()),n=v(lr),o=v(go),i=yn(),u=mr(),C=qt(),p=v(yo()),R=v(gr());function v(s){return s&&s.__esModule?s:{default:s}}function T(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,b=new WeakMap;return(T=function(l){return l?b:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=T(d);if(b&&b.has(s))return b.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):l[f]=s[f]}return l.default=s,b&&b.set(s,l),l}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var b=arguments[d];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},I.apply(this,arguments)}function S(s,d,b){return d=w(d),d in s?Object.defineProperty(s,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[d]=b,s}function w(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 b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,d||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(d,b){let{position:l}=d,{prevPropsPosition:m}=b;return l&&(!m||l.x!==m.x||l.y!==m.y)?((0,R.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:m}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),S(this,"onDragStart",(b,l)=>{if((0,R.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,R.default)("Draggable: onDrag: %j",l);const m=(0,u.createDraggableData)(this,l),f={x:m.x,y:m.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:j}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[U,L]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=U,f.y=L,f.slackX=this.state.slackX+(M-f.x),f.slackY=this.state.slackY+(j-f.y),m.x=f.x,m.y=f.y,m.deltaX=f.x-this.state.x,m.deltaY=f.y-this.state.y}if(this.props.onDrag(b,m)===!1)return!1;this.setState(f)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,R.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:j}=this.props.position;f.x=M,f.y=j}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,b;return(d=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:b,children:l,defaultPosition:m,defaultClassName:f,defaultClassNameDragging:g,defaultClassNameDragged:M,position:j,positionOffset:U,scale:L,...E}=this.props;let F={},z=null;const G=!!!j||this.state.dragging,te=j||m,Q={x:(0,u.canDragX)(this)&&G?this.state.x:te.x,y:(0,u.canDragY)(this)&&G?this.state.y:te.y};this.state.isElementSVG?z=(0,i.createSVGTransform)(Q,U):F=(0,i.createCSSTransform)(Q,U);const H=(0,o.default)(l.props.className||"",f,{[g]:this.state.dragging,[M]:this.state.dragged});return e.createElement(p.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:H,style:{...l.props.style,...F},transform:z}))}}t.default=a,S(a,"displayName","Draggable"),S(a,"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:C.dontSetMe,style:C.dontSetMe,transform:C.dontSetMe}),S(a,"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})}(Kt)),Kt}var Un;function Cn(){if(Un)return Be.exports;Un=1;const{default:t,DraggableCore:e}=Co();return Be.exports=t,Be.exports.default=t,Be.exports.DraggableCore=e,Be.exports}var Xe={exports:{}},Ye={},St={},Vn;function So(){if(Vn)return St;Vn=1,St.__esModule=!0,St.cloneElement=C;var t=e(N);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,R){var v=Object.keys(p);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(p);R&&(T=T.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),v.push.apply(v,T)}return v}function n(p){for(var R=1;R<arguments.length;R++){var v=arguments[R]!=null?arguments[R]:{};R%2?r(Object(v),!0).forEach(function(T){o(p,T,v[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(v)):r(Object(v)).forEach(function(T){Object.defineProperty(p,T,Object.getOwnPropertyDescriptor(v,T))})}return p}function o(p,R,v){return R=i(R),R in p?Object.defineProperty(p,R,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[R]=v,p}function i(p){var R=u(p,"string");return typeof R=="symbol"?R:String(R)}function u(p,R){if(typeof p!="object"||p===null)return p;var v=p[Symbol.toPrimitive];if(v!==void 0){var T=v.call(p,R||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(p)}function C(p,R){return R.style&&p.props.style&&(R.style=n(n({},p.props.style),R.style)),R.className&&p.props.className&&(R.className=p.props.className+" "+R.className),t.default.cloneElement(p,R)}return St}var Ke={},$n;function vr(){if($n)return Ke;$n=1,Ke.__esModule=!0,Ke.resizableProps=void 0;var t=e(Oe());Cn();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 o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var C=i[0];if(C.axis==="both"||C.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},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 o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var C=i[0];if(C.axis==="both"||C.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ke.resizableProps=r,Ke}var zn;function yr(){if(zn)return Ye;zn=1,Ye.__esModule=!0,Ye.default=void 0;var t=u(N),e=Cn(),r=So(),n=vr(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(i=function(l){return l?d:s})(a)}function u(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var d=i(s);if(d&&d.has(a))return d.get(a);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in a)if(m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)){var f=l?Object.getOwnPropertyDescriptor(a,m):null;f&&(f.get||f.set)?Object.defineProperty(b,m,f):b[m]=a[m]}return b.default=a,d&&d.set(a,b),b}function C(){return C=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var b in d)Object.prototype.hasOwnProperty.call(d,b)&&(a[b]=d[b])}return a},C.apply(this,arguments)}function p(a,s){if(a==null)return{};var d={},b=Object.keys(a),l,m;for(m=0;m<b.length;m++)l=b[m],!(s.indexOf(l)>=0)&&(d[l]=a[l]);return d}function R(a,s){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(a);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),d.push.apply(d,b)}return d}function v(a){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?R(Object(d),!0).forEach(function(b){T(a,b,d[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):R(Object(d)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(d,b))})}return a}function T(a,s,d){return s=_(s),s in a?Object.defineProperty(a,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[s]=d,a}function _(a){var s=I(a,"string");return typeof s=="symbol"?s:String(s)}function I(a,s){if(typeof a!="object"||a===null)return a;var d=a[Symbol.toPrimitive];if(d!==void 0){var b=d.call(a,s||"default");if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function S(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,w(a,s)}function w(a,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},w(a,s)}var h=function(a){S(s,a);function s(){for(var b,l=arguments.length,m=new Array(l),f=0;f<l;f++)m[f]=arguments[f];return b=a.call.apply(a,[this].concat(m))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,m){var f=this.props,g=f.minConstraints,M=f.maxConstraints,j=f.lockAspectRatio;if(!g&&!M&&!j)return[l,m];if(j){var U=this.props.width/this.props.height,L=l-this.props.width,E=m-this.props.height;Math.abs(L)>Math.abs(E*U)?m=l/U:l=m*U}var F=l,z=m,B=this.slack||[0,0],G=B[0],te=B[1];return l+=G,m+=te,g&&(l=Math.max(g[0],l),m=Math.max(g[1],m)),M&&(l=Math.min(M[0],l),m=Math.min(M[1],m)),this.slack=[G+(F-l),te+(z-m)],[l,m]},d.resizeHandler=function(l,m){var f=this;return function(g,M){var j=M.node,U=M.deltaX,L=M.deltaY;l==="onResizeStart"&&f.resetData();var E=(f.props.axis==="both"||f.props.axis==="x")&&m!=="n"&&m!=="s",F=(f.props.axis==="both"||f.props.axis==="y")&&m!=="e"&&m!=="w";if(!(!E&&!F)){var z=m[0],B=m[m.length-1],G=j.getBoundingClientRect();if(f.lastHandleRect!=null){if(B==="w"){var te=G.left-f.lastHandleRect.left;U+=te}if(z==="n"){var Q=G.top-f.lastHandleRect.top;L+=Q}}f.lastHandleRect=G,B==="w"&&(U=-U),z==="n"&&(L=-L);var H=f.props.width+(E?U/f.props.transformScale:0),A=f.props.height+(F?L/f.props.transformScale:0),ne=f.runConstraints(H,A);H=ne[0],A=ne[1];var oe=H!==f.props.width||A!==f.props.height,se=typeof f.props[l]=="function"?f.props[l]:null,fe=l==="onResize"&&!oe;se&&!fe&&(g.persist==null||g.persist(),se(g,{node:j,size:{width:H,height:A},handle:m})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,m){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:m});if(typeof f=="function")return f(l,m);var g=typeof f.type=="string",M=v({ref:m},g?{}:{handleAxis:l});return t.cloneElement(f,M)},d.render=function(){var l=this,m=this.props,f=m.children,g=m.className,M=m.draggableOpts;m.width,m.height,m.handle,m.handleSize,m.lockAspectRatio,m.axis,m.minConstraints,m.maxConstraints,m.onResize,m.onResizeStop,m.onResizeStart;var j=m.resizeHandles;m.transformScale;var U=p(m,o);return(0,r.cloneElement)(f,v(v({},U),{},{className:(g?g+" ":"")+"react-resizable",children:[].concat(f.props.children,j.map(function(L){var E,F=(E=l.handleRefs[L])!=null?E:l.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,C({},M,{nodeRef:F,key:"resizableHandle-"+L,onStop:l.resizeHandler("onResizeStop",L),onStart:l.resizeHandler("onResizeStart",L),onDrag:l.resizeHandler("onResize",L)}),l.renderResizeHandle(L,F))}))}))},s}(t.Component);return Ye.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},Ye}var Ze={},An;function bo(){if(An)return Ze;An=1,Ze.__esModule=!0,Ze.default=void 0;var t=C(N),e=i(Oe()),r=i(yr()),n=vr(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,b=new WeakMap;return(u=function(m){return m?b:d})(s)}function C(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(d);if(b&&b.has(s))return b.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):l[f]=s[f]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var b=arguments[d];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function R(s,d){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(m){return Object.getOwnPropertyDescriptor(s,m).enumerable})),b.push.apply(b,l)}return b}function v(s){for(var d=1;d<arguments.length;d++){var b=arguments[d]!=null?arguments[d]:{};d%2?R(Object(b),!0).forEach(function(l){T(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):R(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function T(s,d,b){return d=_(d),d in s?Object.defineProperty(s,d,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[d]=b,s}function _(s){var d=I(s,"string");return typeof d=="symbol"?d:String(d)}function I(s,d){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,d||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function S(s,d){if(s==null)return{};var b={},l=Object.keys(s),m,f;for(f=0;f<l.length;f++)m=l[f],!(d.indexOf(m)>=0)&&(b[m]=s[m]);return b}function w(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,m){return l.__proto__=m,l},h(s,d)}var a=function(s){w(d,s);function d(){for(var l,m=arguments.length,f=new Array(m),g=0;g<m;g++)f[g]=arguments[g];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(M,j){var U=j.size;l.props.onResize?(M.persist==null||M.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(M,j)})):l.setState(U)},l}d.getDerivedStateFromProps=function(m,f){return f.propsWidth!==m.width||f.propsHeight!==m.height?{width:m.width,height:m.height,propsWidth:m.width,propsHeight:m.height}:null};var b=d.prototype;return b.render=function(){var m=this.props,f=m.handle,g=m.handleSize;m.onResize;var M=m.onResizeStart,j=m.onResizeStop,U=m.draggableOpts,L=m.minConstraints,E=m.maxConstraints,F=m.lockAspectRatio,z=m.axis;m.width,m.height;var B=m.resizeHandles,G=m.style,te=m.transformScale,Q=S(m,o);return t.createElement(r.default,{axis:z,draggableOpts:U,handle:f,handleSize:g,height:this.state.height,lockAspectRatio:F,maxConstraints:E,minConstraints:L,onResizeStart:M,onResize:this.onResize,onResizeStop:j,resizeHandles:B,transformScale:te,width:this.state.width},t.createElement("div",p({},Q,{style:v(v({},G),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return Ze.default=a,a.propTypes=v(v({},n.resizableProps),{},{children:e.default.element}),Ze}var qn;function Ro(){return qn||(qn=1,Xe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Xe.exports.Resizable=yr().default,Xe.exports.ResizableBox=bo().default),Xe.exports}var Ie={},Wn;function Cr(){if(Wn)return Ie;Wn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.resizeHandleType=Ie.resizeHandleAxesType=Ie.default=void 0;var t=r(Oe()),e=r(N);function r(i){return i&&i.__esModule?i:{default:i}}const n=Ie.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Ie.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Ie.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(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var u=i.layout;u!==void 0&&qe().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:o,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(i,u){const C=i[u],p={};e.default.Children.forEach(C,function(R){if((R==null?void 0:R.key)!=null){if(p[R.key])throw new Error('Duplicate child key "'+R.key+'" found! This will cause problems in ReactGridLayout.');p[R.key]=!0}})},innerRef:t.default.any},Ie}var Hn;function To(){if(Hn)return ke;Hn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=void 0;var t=p(N),e=p(Oe()),r=Cn(),n=Ro(),o=qe(),i=vn(),u=Cr(),C=p(gn());function p(I){return I&&I.__esModule?I:{default:I}}function R(I,S,w){return S=v(S),S in I?Object.defineProperty(I,S,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[S]=w,I}function v(I){var S=T(I,"string");return typeof S=="symbol"?S:String(S)}function T(I,S){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,S||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let _=class extends t.default.Component{constructor(){super(...arguments),R(this,"state",{resizing:null,dragging:null,className:""}),R(this,"elementRef",t.default.createRef()),R(this,"onDragStart",(S,w)=>{let{node:h}=w;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const d={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),m=h.getBoundingClientRect(),f=m.left/s,g=l.left/s,M=m.top/s,j=l.top/s;d.left=f-g+b.scrollLeft,d.top=M-j+b.scrollTop,this.setState({dragging:d});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:S,node:h,newPosition:d})}),R(this,"onDrag",(S,w)=>{let{node:h,deltaX:a,deltaY:s}=w;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+a;const{isBounded:m,i:f,w:g,h:M,containerWidth:j}=this.props,U=this.getPositionParams();if(m){const{offsetParent:B}=h;if(B){const{margin:G,rowHeight:te,containerPadding:Q}=this.props,H=B.clientHeight-(0,i.calcGridItemWHPx)(M,te,G[1]);b=(0,i.clamp)(b-Q[1],0,H);const A=(0,i.calcGridColWidth)(U),ne=j-(0,i.calcGridItemWHPx)(g,A,G[0]);l=(0,i.clamp)(l-Q[0],0,ne)}}const L={top:b,left:l};this.setState({dragging:L});const{containerPadding:E}=this.props,{x:F,y:z}=(0,i.calcXY)(U,b-E[1],l-E[0],g,M);return d.call(this,f,F,z,{e:S,node:h,newPosition:L})}),R(this,"onDragStop",(S,w)=>{let{node:h}=w;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:b,containerPadding:l}=this.props,{left:m,top:f}=this.state.dragging,g={top:f,left:m};this.setState({dragging:null});const{x:M,y:j}=(0,i.calcXY)(this.getPositionParams(),f-l[1],m-l[0],s,d);return a.call(this,b,M,j,{e:S,node:h,newPosition:g})}),R(this,"onResizeStop",(S,w,h)=>this.onResizeHandler(S,w,h,"onResizeStop")),R(this,"onResizeStart",(S,w,h)=>this.onResizeHandler(S,w,h,"onResizeStart")),R(this,"onResize",(S,w,h)=>this.onResizeHandler(S,w,h,"onResize"))}shouldComponentUpdate(S,w){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,w);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const a=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&w.left!==a.left||w.top!==a.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(d){const b=w.left-s.left,l=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:S.cols,containerPadding:S.containerPadding,containerWidth:S.containerWidth,margin:S.margin,maxRows:S.maxRows,rowHeight:S.rowHeight}}createStyle(S){const{usePercentages:w,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(S):(s=(0,o.setTopLeft)(S),w&&(s.left=(0,o.perc)(S.left/h),s.width=(0,o.perc)(S.width/h))),s}mixinDraggable(S,w){return t.default.createElement(r.DraggableCore,{disabled:!w,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},S)}curryResizeHandler(S,w){return(h,a)=>w(h,a,S)}mixinResizable(S,w,h){const{cols:a,minW:s,minH:d,maxW:b,maxH:l,transformScale:m,resizeHandles:f,resizeHandle:g}=this.props,M=this.getPositionParams(),j=(0,i.calcGridItemPosition)(M,0,0,a,0).width,U=(0,i.calcGridItemPosition)(M,0,0,s,d),L=(0,i.calcGridItemPosition)(M,0,0,b,l),E=[U.width,U.height],F=[Math.min(L.width,j),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:F,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:m,resizeHandles:f,handle:g},S)}onResizeHandler(S,w,h,a){let{node:s,size:d,handle:b}=w;const l=this.props[a];if(!l)return;const{x:m,y:f,i:g,maxH:M,minH:j,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let F=d;s&&(F=(0,o.resizeItemInDirection)(b,h,d,U),this.setState({resizing:a==="onResizeStop"?null:F}));let{w:z,h:B}=(0,i.calcWH)(this.getPositionParams(),F.width,F.height,m,f,b);z=(0,i.clamp)(z,Math.max(L,1),E),B=(0,i.clamp)(B,j,M),l.call(this,g,z,B,{e:S,node:s,size:F,handle:b})}render(){const{x:S,y:w,w:h,h:a,isDraggable:s,isResizable:d,droppingPosition:b,useCSSTransforms:l}=this.props,m=(0,i.calcGridItemPosition)(this.getPositionParams(),S,w,h,a,this.state),f=t.default.Children.only(this.props.children);let g=t.default.cloneElement(f,{ref:this.elementRef,className:(0,C.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:!!b,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(m)}});return g=this.mixinResizable(g,m,d),g=this.mixinDraggable(g,s),g}};return ke.default=_,R(_,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,S){const w=I[S];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const w=I[S];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const w=I[S];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const w=I[S];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),R(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),ke}var kn;function Sr(){if(kn)return He;kn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0;var t=R(N),e=mn(),r=C(gn()),n=qe(),o=vn(),i=C(To()),u=C(Cr());function C(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function R(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);if(s&&s.has(h))return s.get(h);var d={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=b?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),v(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:[]}),v(this,"dragEnterCounter",0),v(this,"onDragStart",(a,s,d,b)=>{let{e:l,node:m}=b;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);if(!g)return;const M={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(g),oldLayout:f,activeDrag:M}),this.props.onDragStart(f,g,g,null,l,m)}),v(this,"onDrag",(a,s,d,b)=>{let{e:l,node:m}=b;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:M,allowOverlap:j,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};g=(0,n.moveElement)(g,L,s,d,!0,U,(0,n.compactType)(this.props),M,j),this.props.onDrag(g,f,L,E,l,m),this.setState({layout:j?g:(0,n.compact)(g,(0,n.compactType)(this.props),M),activeDrag:E})}),v(this,"onDragStop",(a,s,d,b)=>{let{e:l,node:m}=b;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:M,preventCollision:j,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;g=(0,n.moveElement)(g,L,s,d,!0,j,(0,n.compactType)(this.props),M,U);const F=U?g:(0,n.compact)(g,(0,n.compactType)(this.props),M);this.props.onDragStop(F,f,L,null,l,m);const{oldLayout:z}=this.state;this.setState({activeDrag:null,layout:F,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(F,z)}),v(this,"onResizeStart",(a,s,d,b)=>{let{e:l,node:m}=b;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);g&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(g),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,g,g,null,l,m))}),v(this,"onResize",(a,s,d,b)=>{let{e:l,node:m,size:f,handle:g}=b;const{oldResizeItem:M}=this.state,{layout:j}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let F=!1,z,B,G;const[te,Q]=(0,n.withLayoutItem)(j,a,A=>{let ne;return B=A.x,G=A.y,["sw","w","nw","n","ne"].indexOf(g)!==-1&&(["sw","nw","w"].indexOf(g)!==-1&&(B=A.x+(A.w-s),s=A.x!==B&&B<0?A.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(g)!==-1&&(G=A.y+(A.h-d),d=A.y!==G&&G<0?A.h:d,G=G<0?0:G),F=!0),L&&!E&&(ne=(0,n.getAllCollisions)(j,{...A,w:s,h:d,x:B,y:G}).filter(se=>se.i!==A.i).length>0,ne&&(G=A.y,d=A.h,B=A.x,s=A.w,F=!1)),A.w=s,A.h=d,A});if(!Q)return;z=te,F&&(z=(0,n.moveElement)(te,Q,B,G,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const H={w:Q.w,h:Q.h,x:Q.x,y:Q.y,static:!0,i:a};this.props.onResize(z,M,Q,H,l,m),this.setState({layout:E?z:(0,n.compact)(z,(0,n.compactType)(this.props),U),activeDrag:H})}),v(this,"onResizeStop",(a,s,d,b)=>{let{e:l,node:m}=b;const{layout:f,oldResizeItem:g}=this.state,{cols:M,allowOverlap:j}=this.props,U=(0,n.getLayoutItem)(f,a),L=j?f:(0,n.compact)(f,(0,n.compactType)(this.props),M);this.props.onResizeStop(L,g,U,null,l,m);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),v(this,"onDragOver",a=>{var te;if(a.preventDefault(),a.stopPropagation(),S&&!((te=a.nativeEvent.target)!=null&&te.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:d,margin:b,cols:l,rowHeight:m,maxRows:f,width:g,containerPadding:M,transformScale:j}=this.props,U=d==null?void 0:d(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,F=a.currentTarget.getBoundingClientRect(),z=a.clientX-F.left,B=a.clientY-F.top,G={left:z/j,top:B/j,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:Q,top:H}=this.state.droppingPosition;(Q!=z||H!=B)&&this.setState({droppingPosition:G})}}else{const Q={cols:l,margin:b,maxRows:f,rowHeight:m,containerWidth:g,containerPadding:M||b},H=(0,o.calcXY)(Q,B,z,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:G,layout:[...E,{...L,x:H.x,y:H.y,static:!1,isDraggable:!0}]})}}),v(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:d}=this.state,b=(0,n.compact)(d.filter(l=>l.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),v(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),v(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),v(this,"onDrop",a=>{a.preventDefault(),a.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,b=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,b,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?d=a.layout:(0,n.childrenEqual)(a.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const d=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(d,b)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:d,margin:b,containerPadding:l,rowHeight:m,maxRows:f,useCSSTransforms:g,transformScale:M}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:b,containerPadding:l||b,maxRows:f,rowHeight:m,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:g,transformScale:M},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!d)return null;const{width:b,cols:l,margin:m,containerPadding:f,rowHeight:g,maxRows:M,isDraggable:j,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:F,draggableCancel:z,draggableHandle:B,resizeHandles:G,resizeHandle:te}=this.props,{mounted:Q,droppingPosition:H}=this.state,A=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&j,ne=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&U,oe=d.resizeHandles||G,se=A&&L&&d.isBounded!==!1;return t.createElement(i.default,{containerWidth:b,cols:l,margin:m,containerPadding:f||m,maxRows:M,rowHeight:g,cancel:z,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:A,isResizable:ne,isBounded:se,useCSSTransforms:E&&Q,usePercentages:!Q,transformScale:F,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?H:void 0,resizeHandles:oe,resizeHandle:te},a)}render(){const{className:a,style:s,isDroppable:d,innerRef:b}=this.props,l=(0,r.default)(I,a),m={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:m,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 He.default=w,v(w,"displayName","ReactGridLayout"),v(w,"propTypes",u.default),v(w,"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}),He}var Je={},Fe={},Bn;function br(){if(Bn)return Fe;Bn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.findOrGenerateResponsiveLayout=n,Fe.getBreakpointFromWidth=e,Fe.getColsFromBreakpoint=r,Fe.sortBreakpoints=o;var t=qe();function e(i,u){const C=o(i);let p=C[0];for(let R=1,v=C.length;R<v;R++){const T=C[R];u>i[T]&&(p=T)}return p}function r(i,u){if(!u[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return u[i]}function n(i,u,C,p,R,v){if(i[C])return(0,t.cloneLayout)(i[C]);let T=i[p];const _=o(u),I=_.slice(_.indexOf(C));for(let S=0,w=I.length;S<w;S++){const h=I[S];if(i[h]){T=i[h];break}}return T=(0,t.cloneLayout)(T||[]),(0,t.compact)((0,t.correctBounds)(T,{cols:R}),v,R)}function o(i){return Object.keys(i).sort(function(C,p){return i[C]-i[p]})}return Fe}var Gn;function Io(){if(Gn)return Je;Gn=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=p(N),e=u(Oe()),r=mn(),n=qe(),o=br(),i=u(Sr());function u(h){return h&&h.__esModule?h:{default:h}}function C(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(C=function(d){return d?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=C(a);if(s&&s.has(h))return s.get(h);var d={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var m=b?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function R(){return R=Object.assign?Object.assign.bind():function(h){for(var a=1;a<arguments.length;a++){var s=arguments[a];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},R.apply(this,arguments)}function v(h,a,s){return a=T(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function T(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function S(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let w=class extends t.Component{constructor(){super(...arguments),v(this,"state",this.generateInitialState()),v(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:d,cols:b}=this.props,l=(0,o.getBreakpointFromWidth)(s,a),m=(0,o.getColsFromBreakpoint)(l,b),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(d,s,l,l,m,f),breakpoint:l,cols:m}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:d,cols:b}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,d,d,b,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:d,layouts:b,compactType:l}=this.props,m=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,g=(0,o.getColsFromBreakpoint)(m,d),M={...b};if(f!==m||a.breakpoints!==s||a.cols!==d){f in M||(M[f]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(M,s,m,f,g,l);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,g,l,this.props.allowOverlap),M[m]=L,this.props.onLayoutChange(L,M),this.props.onBreakpointChange(m,g),this.setState({breakpoint:m,layout:L,cols:g})}const j=S(this.props.margin,m),U=S(this.props.containerPadding,m);this.props.onWidthChange(this.props.width,j,g,U)}render(){const{breakpoint:a,breakpoints:s,cols:d,layouts:b,margin:l,containerPadding:m,onBreakpointChange:f,onLayoutChange:g,onWidthChange:M,...j}=this.props;return t.createElement(i.default,R({},j,{margin:S(l,this.state.breakpoint),containerPadding:S(m,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Je.default=w,v(w,"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,a){if(I(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[a]));Object.keys(h[a]).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}),v(w,"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}),Je}var bt={},Rr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!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),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,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 o=0,i=this.__entries__;o<i.length;o++){var u=i[o];r.call(n,u[1],u[0])}},e}()}(),on=typeof window<"u"&&typeof document<"u"&&window.document===document,Pt=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")()}(),wo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Pt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),_o=2;function xo(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&C()}function u(){wo(i)}function C(){var p=Date.now();if(r){if(p-o<_o)return;n=!0}else r=!0,n=!1,setTimeout(u,e);o=p}return C}var Eo=20,Oo=["top","right","bottom","left","width","height","size","weight"],Po=typeof MutationObserver<"u",Mo=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xo(this.refresh.bind(this),Eo)}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(){!on||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Po?(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(){!on||!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,o=Oo.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Tr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},$e=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Pt},Ir=Wt(0,0,0,0);function Mt(t){return parseFloat(t)||0}function Xn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+Mt(i)},0)}function Fo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],u=t["padding-"+i];r[i]=Mt(u)}return r}function Do(t){var e=t.getBBox();return Wt(0,0,e.width,e.height)}function No(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return Ir;var n=$e(t).getComputedStyle(t),o=Fo(n),i=o.left+o.right,u=o.top+o.bottom,C=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(C+i)!==e&&(C-=Xn(n,"left","right")+i),Math.round(p+u)!==r&&(p-=Xn(n,"top","bottom")+u)),!Lo(t)){var R=Math.round(C+i)-e,v=Math.round(p+u)-r;Math.abs(R)!==1&&(C-=R),Math.abs(v)!==1&&(p-=v)}return Wt(o.left,o.top,C,p)}var jo=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof $e(t).SVGGraphicsElement}:function(t){return t instanceof $e(t).SVGElement&&typeof t.getBBox=="function"}}();function Lo(t){return t===$e(t).document.documentElement}function Uo(t){return on?jo(t)?Do(t):No(t):Ir}function Vo(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(i.prototype);return Tr(u,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),u}function Wt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var $o=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Wt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Uo(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}(),zo=function(){function t(e,r){var n=Vo(r);Tr(this,{target:e,contentRect:n})}return t}(),Ao=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new Rr,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 $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new $o(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 $e(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 zo(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}(),wr=typeof WeakMap<"u"?new WeakMap:new Rr,_r=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=Mo.getInstance(),n=new Ao(e,r,this);wr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){_r.prototype[t]=function(){var e;return(e=wr.get(this))[t].apply(e,arguments)}});var qo=function(){return typeof Pt.ResizeObserver<"u"?Pt.ResizeObserver:_r}();const Wo=Object.freeze(Object.defineProperty({__proto__:null,default:qo},Symbol.toStringTag,{value:"Module"})),Ho=pr(Wo);var Yn;function ko(){if(Yn)return bt;Yn=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=_;var t=u(N),e=o(Oe()),r=o(Ho),n=o(gn());function o(I){return I&&I.__esModule?I:{default:I}}function i(I){if(typeof WeakMap!="function")return null;var S=new WeakMap,w=new WeakMap;return(i=function(h){return h?w: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 w=i(S);if(w&&w.has(I))return w.get(I);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var d=a?Object.getOwnPropertyDescriptor(I,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function C(){return C=Object.assign?Object.assign.bind():function(I){for(var S=1;S<arguments.length;S++){var w=arguments[S];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},C.apply(this,arguments)}function p(I,S,w){return S=R(S),S in I?Object.defineProperty(I,S,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[S]=w,I}function R(I){var S=v(I,"string");return typeof S=="symbol"?S:String(S)}function v(I,S){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,S||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}const T="react-grid-layout";function _(I){var S;return S=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(a=>{if(this.elementRef.current instanceof HTMLElement){const d=a[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,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,T),style:this.props.style,ref:this.elementRef}):t.createElement(I,C({innerRef:this.elementRef},a,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return bt}var Kn;function Bo(){return Kn||(Kn=1,function(t){t.exports=Sr().default,t.exports.utils=qe(),t.exports.calculateUtils=vn(),t.exports.Responsive=Io().default,t.exports.Responsive.utils=br(),t.exports.WidthProvider=ko().default}(kt)),kt.exports}var Go=Bo();const Xo=uo(Go);var Yo=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,Zo=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ko(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Yo(e,r,o),o},Jo=(t,e)=>(r,n)=>e(r,n,t);let ze=class extends y.Disposable{constructor(e){super();_e(this,"_initLocal",()=>{});_e(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const u=[];return this._findReplaceIndex(i).forEach((C,p,R)=>{const v=R[p-1]||{startIndex:0,endIndex:-1};if(v.endIndex+1<C.startIndex){const T=i.slice(v.endIndex+1,C.startIndex);T&&u.push(T)}if(r[C.key]&&u.push(r[C.key]),p===R.length-1){const T=i.slice(C.endIndex+1);T&&u.push(T)}}),u}return[]}};ze=Zo([Jo(0,y.Inject(y.LocaleService))],ze);const Qo="univer-cf-preview",Rt={cfPreview:Qo},We=t=>{var o,i;const e=t.rule;if(!e)return null;const r=N.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((R,v)=>({color:new y.ColorKit(R.color),value:v})),C=u.length-1;return new Array(5).fill("").map((R,v,T)=>v*C/(T.length-1)).map(R=>c.getColorScaleFromValue(u,R))}return null},[e]),n=N.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const C=c.iconMap[u.iconType];return C&&C[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,C={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,R=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return x.jsxs("div",{className:Rt.cfPreview,children:[x.jsx("div",{style:{...C,background:R,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),x.jsx("div",{style:{...C,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&x.jsx("div",{className:Rt.cfPreview,children:r.map((u,C)=>x.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},C))});case c.CFRuleType.iconSet:return n&&x.jsx("div",{className:Rt.cfPreview,children:n.map((u,C)=>u?x.jsx("img",{style:{height:"100%"},src:u},C):x.jsx(mt,{},C))});case c.CFRuleType.highlightCell:{const{ul:u,st:C,it:p,bl:R,bg:v,cl:T}=e.style,_=(u==null?void 0:u.s)===y.BooleanNumber.TRUE,I=(C==null?void 0:C.s)===y.BooleanNumber.TRUE,S=p===y.BooleanNumber.TRUE,w=R===y.BooleanNumber.TRUE,h=(o=v==null?void 0:v.rgb)!=null?o:c.DEFAULT_BG_COLOR,a=(i=T==null?void 0:T.rgb)!=null?i:c.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${_?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return x.jsx("div",{style:s,className:Rt.cfPreview,children:"123"})}}return null},ei="univer-cf-rule-list",ti="univer-rule-selector",ni="univer-select",ri="univer-select-selector",oi="univer-select-selection-item",ii="univer-select-selection-search-input",ai="univer-btn-list",si="univer-gap",li="univer-icon",ui="univer-disabled",ci="univer-rule-item",di="univer-rule-describe",fi="univer-rule-type",pi="univer-rule-range",hi="univer-active",mi="univer-draggableHandle",gi="univer-delete-item",vi="univer-grid-layout-wrap",yi="univer-react-grid-item",pe={cfRuleList:ei,ruleSelector:ti,select:ni,selectSelector:ri,selectSelectionItem:oi,selectSelectionSearchInput:ii,btnList:ai,gap:si,icon:li,disabled:ui,ruleItem:ci,ruleDescribe:di,ruleType:fi,ruleRange:pi,active:hi,draggableHandle:mi,deleteItem:gi,gridLayoutWrap:vi,reactGridItem:yi},Ci=(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(o=>String(o)):[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 Zn=0;const Si=t=>{const{onClick:e}=t,r=y.useDependency(c.ConditionalFormattingRuleModel),n=y.useDependency(y.IUniverInstanceService),o=y.useDependency(X.SheetsSelectionsService),i=y.useDependency(y.ICommandService),u=y.useDependency(y.LocaleService),C=y.useDependency(y.Injector),p=y.useDependency(ze),R=me.useObservable(()=>n.getCurrentTypeOfUnit$(y.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),v=R.getUnitId(),T=R.getActiveSheet();if(!T)throw new Error("No active sheet found");const _=T.getSheetId(),[I,S]=N.useState([]),[w,h]=N.useState("2"),[a,s]=N.useState(0),[d,b]=N.useState(-1),[l,m]=N.useState(Zn),f=N.useRef(null),g=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const H=r.getSubunitRules(v,_);if(!H||!H.length)return[];if(w==="1"){const A=o.getCurrentLastSelection();if(!A)return[];const ne=A.range;return H.filter(se=>se.ranges.some(fe=>y.Rectangle.intersects(fe,ne)))}else if(w==="2")return[...H];return[]},[j,U]=N.useState(M);ce.useHighlightRange(I),N.useEffect(()=>{const H=i.onCommandExecuted(A=>{A.id===X.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>H.dispose()}),N.useEffect(()=>{U(M)},[w,a,v,_]),N.useEffect(()=>{if(w==="2")return;const H=new be.Observable(A=>{const ne=[X.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],oe=i.onCommandExecuted(se=>{const{id:fe,params:ge}=se,Se=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(fe)&&ge.unitId===Se&&A.next(null)});return()=>oe.dispose()}).pipe(be.debounceTime(16)).subscribe(()=>{U(M)});return()=>{H.unsubscribe()}},[n,w,v,_]),N.useEffect(()=>{const H=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>H.unsubscribe()},[r]),N.useEffect(()=>{const H=()=>{var se;const oe=Math.max(0,(((se=f.current)==null?void 0:se.getBoundingClientRect().width)||0)-8);return Zn=oe,oe},ne=new be.Observable(oe=>{const se=document.querySelector(".univer-sidebar");if(se){let fe=setTimeout(()=>{oe.next()},150);const ge=()=>{fe&&clearTimeout(fe),fe=null},Se=q=>{q.propertyName==="width"&&(ge(),oe.next())};return se.addEventListener("transitionend",Se),()=>{ge(),se.removeEventListener("transitionend",Se)}}}).pipe(be.debounceTime(16)).subscribe(()=>{m(H())});return()=>{ne.unsubscribe()}},[]);const L=H=>{var oe;const A=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(oe=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!A||!ne)throw new Error("No active sheet found");i.executeCommand(at.id,{unitId:A,subUnitId:ne,cfId:H.cfId})},E=(H,A)=>{b(A.y)},F=(H,A,ne)=>{var q;b(-1);const oe=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getUnitId(),se=(q=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:q.getSheetId();if(!oe||!se)throw new Error("No active sheet found");const fe=J=>{const ae=j.length;return Math.min(ae-1,Math.max(0,J))},ge=j[fe(A.y)].cfId,Se=j[fe(ne.y)].cfId;ge!==Se&&i.executeCommand($t.id,{unitId:oe,subUnitId:se,start:{id:ge,type:"self"},end:{id:Se,type:ne.y>A.y?"after":"before"}})},z=()=>{t.onCreate()},B=()=>{w==="2"?i.executeCommand(ht.id):w==="1"&&j.map(A=>({unitId:v,subUnitId:_,cfId:A.cfId})).forEach(A=>{i.executeCommand(at.id,A)})},G=N.useMemo(()=>{const H=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.filter(ne=>{const oe=ne.ranges;return X.checkRangesEditablePermission(C,H.getUnitId(),A.getSheetId(),oe)})},[j]),te=G.map((H,A)=>({i:H.cfId,x:0,w:12,y:A,h:1,isResizable:!1})),Q=N.useMemo(()=>{const H=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),A=H.getActiveSheet();return j.every(ne=>{const oe=ne.ranges;return X.checkRangesEditablePermission(C,H.getUnitId(),A.getSheetId(),oe)})},[j]);return x.jsxs("div",{className:pe.cfRuleList,children:[x.jsxs("div",{className:pe.ruleSelector,children:[x.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",x.jsx(re.Select,{className:pe.select,options:g,value:w,onChange:H=>{h(H)}})).map((H,A)=>x.jsx("span",{children:H},A))}),x.jsxs("div",{className:pe.btnList,children:[x.jsx(re.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:x.jsx("div",{className:`
|
|
4
|
-
${
|
|
5
|
-
`,onClick:z,children:x.jsx(dr,{})})}),j.length&&Q?x.jsx(
|
|
6
|
-
${
|
|
7
|
-
${
|
|
3
|
+
`,f.getElementsByTagName("head")[0].appendChild(g)),f.body&&l(f.body,"react-draggable-transparent-selection")}function S(f){if(f)try{if(f.body&&m(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const g=(f.defaultView||window).getSelection();g&&g.type!=="Caret"&&g.removeAllRanges()}}catch{}}function l(f,g){f.classList?f.classList.add(g):f.className.match(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)")))||(f.className+=" ".concat(g))}function m(f,g){f.classList?f.classList.remove(g):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(g,"(?!\\S)"),"g"),"")}return fe}var Re={},Dn;function mr(){if(Dn)return Re;Dn=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.canDragX=o,Re.canDragY=i,Re.createCoreData=y,Re.createDraggableData=p,Re.getBoundPosition=r,Re.getControlPosition=u,Re.snapToGrid=n;var t=qt(),e=yn();function r(R,_,T){if(!R.props.bounds)return[_,T];let{bounds:C}=R.props;C=typeof C=="string"?C:b(C);const I=v(R);if(typeof C=="string"){const{ownerDocument:h}=I,a=h.defaultView;let s;if(C==="parent"?s=I.parentNode:s=h.querySelector(C),!(s instanceof a.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const d=s,S=a.getComputedStyle(I),l=a.getComputedStyle(d);C={left:-I.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(S.marginLeft),top:-I.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(S.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(I)-I.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(S.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(I)-I.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(S.marginBottom)}}return(0,t.isNum)(C.right)&&(_=Math.min(_,C.right)),(0,t.isNum)(C.bottom)&&(T=Math.min(T,C.bottom)),(0,t.isNum)(C.left)&&(_=Math.max(_,C.left)),(0,t.isNum)(C.top)&&(T=Math.max(T,C.top)),[_,T]}function n(R,_,T){const C=Math.round(_/R[0])*R[0],I=Math.round(T/R[1])*R[1];return[C,I]}function o(R){return R.props.axis==="both"||R.props.axis==="x"}function i(R){return R.props.axis==="both"||R.props.axis==="y"}function u(R,_,T){const C=typeof _=="number"?(0,e.getTouch)(R,_):null;if(typeof _=="number"&&!C)return null;const I=v(T),h=T.props.offsetParent||I.offsetParent||I.ownerDocument.body;return(0,e.offsetXYFromParent)(C||R,h,T.props.scale)}function y(R,_,T){const C=!(0,t.isNum)(R.lastX),I=v(R);return C?{node:I,deltaX:0,deltaY:0,lastX:_,lastY:T,x:_,y:T}:{node:I,deltaX:_-R.lastX,deltaY:T-R.lastY,lastX:R.lastX,lastY:R.lastY,x:_,y:T}}function p(R,_){const T=R.props.scale;return{node:_.node,x:R.state.x+_.deltaX/T,y:R.state.y+_.deltaY/T,deltaX:_.deltaX/T,deltaY:_.deltaY/T,lastX:R.state.x,lastY:R.state.y}}function b(R){return{left:R.left,top:R.top,right:R.right,bottom:R.bottom}}function v(R){const _=R.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Re}var Ge={},Ct={},Nn;function gr(){if(Nn)return Ct;Nn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=t;function t(){}return Ct}var jn;function yo(){if(jn)return Ge;jn=1,Object.defineProperty(Ge,"__esModule",{value:!0}),Ge.default=void 0;var t=b(N),e=y(Oe()),r=y(lr),n=yn(),o=mr(),i=qt(),u=y(gr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function b(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);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 m=S?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=T.mouse,I=class extends t.Component{constructor(){super(...arguments),v(this,"dragging",!1),v(this,"lastX",NaN),v(this,"lastY",NaN),v(this,"touchIdentifier",null),v(this,"mounted",!1),v(this,"handleDragStart",a=>{if(this.props.onMouseDown(a),!this.props.allowAnyClick&&typeof a.button=="number"&&a.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||!(a.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(a.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(a.target,this.props.cancel,s))return;a.type==="touchstart"&&a.preventDefault();const S=(0,n.getTouchIdentifier)(a);this.touchIdentifier=S;const l=(0,o.getControlPosition)(a,S,this);if(l==null)return;const{x:m,y:f}=l,g=(0,o.createCoreData)(this,m,f);(0,u.default)("DraggableCore: handleDragStart: %j",g),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(a,g)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=m,this.lastY=f,(0,n.addEvent)(d,C.move,this.handleDrag),(0,n.addEvent)(d,C.stop,this.handleDragStop))}),v(this,"handleDrag",a=>{const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,g=S-this.lastY;if([f,g]=(0,o.snapToGrid)(this.props.grid,f,g),!f&&!g)return;d=this.lastX+f,S=this.lastY+g}const l=(0,o.createCoreData)(this,d,S);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(a,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const g=document.createEvent("MouseEvents");g.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(g)}return}this.lastX=d,this.lastY=S}),v(this,"handleDragStop",a=>{if(!this.dragging)return;const s=(0,o.getControlPosition)(a,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let g=d-this.lastX||0,M=S-this.lastY||0;[g,M]=(0,o.snapToGrid)(this.props.grid,g,M),d=this.lastX+g,S=this.lastY+M}const l=(0,o.createCoreData)(this,d,S);if(this.props.onStop(a,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))}),v(this,"onMouseDown",a=>(C=T.mouse,this.handleDragStart(a))),v(this,"onMouseUp",a=>(C=T.mouse,this.handleDragStop(a))),v(this,"onTouchStart",a=>(C=T.touch,this.handleDragStart(a))),v(this,"onTouchEnd",a=>(C=T.touch,this.handleDragStop(a)))}componentDidMount(){this.mounted=!0;const a=this.findDOMNode();a&&(0,n.addEvent)(a,T.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const a=this.findDOMNode();if(a){const{ownerDocument:s}=a;(0,n.removeEvent)(s,T.mouse.move,this.handleDrag),(0,n.removeEvent)(s,T.touch.move,this.handleDrag),(0,n.removeEvent)(s,T.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,T.touch.stop,this.handleDragStop),(0,n.removeEvent)(a,T.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var a,s;return(a=this.props)!==null&&a!==void 0&&a.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 Ge.default=I,v(I,"displayName","DraggableCore"),v(I,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,a){if(h[a]&&h[a].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:i.dontSetMe,style:i.dontSetMe,transform:i.dontSetMe}),v(I,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Ge}var Ln;function Co(){return Ln||(Ln=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=_(N),r=v(Oe()),n=v(lr),o=v(go),i=yn(),u=mr(),y=qt(),p=v(yo()),b=v(gr());function v(s){return s&&s.__esModule?s:{default:s}}function R(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(R=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=R(d);if(S&&S.has(s))return S.get(s);var l={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function T(){return T=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},T.apply(this,arguments)}function C(s,d,S){return d=I(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function I(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||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class a extends e.Component{static getDerivedStateFromProps(d,S){let{position:l}=d,{prevPropsPosition:m}=S;return l&&(!m||l.x!==m.x||l.y!==m.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:m}),{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 m=(0,u.createDraggableData)(this,l),f={x:m.x,y:m.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:j}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[U,L]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=U,f.y=L,f.slackX=this.state.slackX+(M-f.x),f.slackY=this.state.slackY+(j-f.y),m.x=f.x,m.y=f.y,m.deltaX=f.x-this.state.x,m.deltaY=f.y-this.state.y}if(this.props.onDrag(S,m)===!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:M,y:j}=this.props.position;f.x=M,f.y=j}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:m,defaultClassName:f,defaultClassNameDragging:g,defaultClassNameDragged:M,position:j,positionOffset:U,scale:L,...E}=this.props;let F={},z=null;const X=!!!j||this.state.dragging,ne=j||m,Q={x:(0,u.canDragX)(this)&&X?this.state.x:ne.x,y:(0,u.canDragY)(this)&&X?this.state.y:ne.y};this.state.isElementSVG?z=(0,i.createSVGTransform)(Q,U):F=(0,i.createCSSTransform)(Q,U);const H=(0,o.default)(l.props.className||"",f,{[g]:this.state.dragging,[M]:this.state.dragged});return e.createElement(p.default,T({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:H,style:{...l.props.style,...F},transform:z}))}}t.default=a,C(a,"displayName","Draggable"),C(a,"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(a,"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})}(Kt)),Kt}var Un;function Cn(){if(Un)return Be.exports;Un=1;const{default:t,DraggableCore:e}=Co();return Be.exports=t,Be.exports.default=t,Be.exports.DraggableCore=e,Be.exports}var Xe={exports:{}},Ye={},St={},Vn;function So(){if(Vn)return St;Vn=1,St.__esModule=!0,St.cloneElement=y;var t=e(N);function e(p){return p&&p.__esModule?p:{default:p}}function r(p,b){var v=Object.keys(p);if(Object.getOwnPropertySymbols){var R=Object.getOwnPropertySymbols(p);b&&(R=R.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),v.push.apply(v,R)}return v}function n(p){for(var b=1;b<arguments.length;b++){var v=arguments[b]!=null?arguments[b]:{};b%2?r(Object(v),!0).forEach(function(R){o(p,R,v[R])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(v)):r(Object(v)).forEach(function(R){Object.defineProperty(p,R,Object.getOwnPropertyDescriptor(v,R))})}return p}function o(p,b,v){return b=i(b),b in p?Object.defineProperty(p,b,{value:v,enumerable:!0,configurable:!0,writable:!0}):p[b]=v,p}function i(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 v=p[Symbol.toPrimitive];if(v!==void 0){var R=v.call(p,b||"default");if(typeof R!="object")return R;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 St}var Ke={},$n;function vr(){if($n)return Ke;$n=1,Ke.__esModule=!0,Ke.resizableProps=void 0;var t=e(Oe());Cn();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 o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var y=i[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)},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 o=arguments.length,i=new Array(o),u=0;u<o;u++)i[u]=arguments[u];var y=i[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,i)}return t.default.number.apply(t.default,i)}};return Ke.resizableProps=r,Ke}var zn;function yr(){if(zn)return Ye;zn=1,Ye.__esModule=!0,Ye.default=void 0;var t=u(N),e=Cn(),r=So(),n=vr(),o=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function i(a){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(i=function(l){return l?d:s})(a)}function u(a,s){if(a&&a.__esModule)return a;if(a===null||typeof a!="object"&&typeof a!="function")return{default:a};var d=i(s);if(d&&d.has(a))return d.get(a);var S={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var m in a)if(m!=="default"&&Object.prototype.hasOwnProperty.call(a,m)){var f=l?Object.getOwnPropertyDescriptor(a,m):null;f&&(f.get||f.set)?Object.defineProperty(S,m,f):S[m]=a[m]}return S.default=a,d&&d.set(a,S),S}function y(){return y=Object.assign?Object.assign.bind():function(a){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(a[S]=d[S])}return a},y.apply(this,arguments)}function p(a,s){if(a==null)return{};var d={},S=Object.keys(a),l,m;for(m=0;m<S.length;m++)l=S[m],!(s.indexOf(l)>=0)&&(d[l]=a[l]);return d}function b(a,s){var d=Object.keys(a);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(a);s&&(S=S.filter(function(l){return Object.getOwnPropertyDescriptor(a,l).enumerable})),d.push.apply(d,S)}return d}function v(a){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(S){R(a,S,d[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(S){Object.defineProperty(a,S,Object.getOwnPropertyDescriptor(d,S))})}return a}function R(a,s,d){return s=_(s),s in a?Object.defineProperty(a,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):a[s]=d,a}function _(a){var s=T(a,"string");return typeof s=="symbol"?s:String(s)}function T(a,s){if(typeof a!="object"||a===null)return a;var d=a[Symbol.toPrimitive];if(d!==void 0){var S=d.call(a,s||"default");if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(a)}function C(a,s){a.prototype=Object.create(s.prototype),a.prototype.constructor=a,I(a,s)}function I(a,s){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,l){return S.__proto__=l,S},I(a,s)}var h=function(a){C(s,a);function s(){for(var S,l=arguments.length,m=new Array(l),f=0;f<l;f++)m[f]=arguments[f];return S=a.call.apply(a,[this].concat(m))||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,m){var f=this.props,g=f.minConstraints,M=f.maxConstraints,j=f.lockAspectRatio;if(!g&&!M&&!j)return[l,m];if(j){var U=this.props.width/this.props.height,L=l-this.props.width,E=m-this.props.height;Math.abs(L)>Math.abs(E*U)?m=l/U:l=m*U}var F=l,z=m,B=this.slack||[0,0],X=B[0],ne=B[1];return l+=X,m+=ne,g&&(l=Math.max(g[0],l),m=Math.max(g[1],m)),M&&(l=Math.min(M[0],l),m=Math.min(M[1],m)),this.slack=[X+(F-l),ne+(z-m)],[l,m]},d.resizeHandler=function(l,m){var f=this;return function(g,M){var j=M.node,U=M.deltaX,L=M.deltaY;l==="onResizeStart"&&f.resetData();var E=(f.props.axis==="both"||f.props.axis==="x")&&m!=="n"&&m!=="s",F=(f.props.axis==="both"||f.props.axis==="y")&&m!=="e"&&m!=="w";if(!(!E&&!F)){var z=m[0],B=m[m.length-1],X=j.getBoundingClientRect();if(f.lastHandleRect!=null){if(B==="w"){var ne=X.left-f.lastHandleRect.left;U+=ne}if(z==="n"){var Q=X.top-f.lastHandleRect.top;L+=Q}}f.lastHandleRect=X,B==="w"&&(U=-U),z==="n"&&(L=-L);var H=f.props.width+(E?U/f.props.transformScale:0),q=f.props.height+(F?L/f.props.transformScale:0),re=f.runConstraints(H,q);H=re[0],q=re[1];var ie=H!==f.props.width||q!==f.props.height,le=typeof f.props[l]=="function"?f.props[l]:null,pe=l==="onResize"&&!ie;le&&!pe&&(g.persist==null||g.persist(),le(g,{node:j,size:{width:H,height:q},handle:m})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,m){var f=this.props.handle;if(!f)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:m});if(typeof f=="function")return f(l,m);var g=typeof f.type=="string",M=v({ref:m},g?{}:{handleAxis:l});return t.cloneElement(f,M)},d.render=function(){var l=this,m=this.props,f=m.children,g=m.className,M=m.draggableOpts;m.width,m.height,m.handle,m.handleSize,m.lockAspectRatio,m.axis,m.minConstraints,m.maxConstraints,m.onResize,m.onResizeStop,m.onResizeStart;var j=m.resizeHandles;m.transformScale;var U=p(m,o);return(0,r.cloneElement)(f,v(v({},U),{},{className:(g?g+" ":"")+"react-resizable",children:[].concat(f.props.children,j.map(function(L){var E,F=(E=l.handleRefs[L])!=null?E:l.handleRefs[L]=t.createRef();return t.createElement(e.DraggableCore,y({},M,{nodeRef:F,key:"resizableHandle-"+L,onStop:l.resizeHandler("onResizeStop",L),onStart:l.resizeHandler("onResizeStart",L),onDrag:l.resizeHandler("onResize",L)}),l.renderResizeHandle(L,F))}))}))},s}(t.Component);return Ye.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},Ye}var Ze={},An;function bo(){if(An)return Ze;An=1,Ze.__esModule=!0,Ze.default=void 0;var t=y(N),e=i(Oe()),r=i(yr()),n=vr(),o=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function i(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(m){return m?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={},m=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var g=m?Object.getOwnPropertyDescriptor(s,f):null;g&&(g.get||g.set)?Object.defineProperty(l,f,g):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(m){return Object.getOwnPropertyDescriptor(s,m).enumerable})),S.push.apply(S,l)}return S}function v(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){R(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 R(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=T(s,"string");return typeof d=="symbol"?d:String(d)}function T(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||"default");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),m,f;for(f=0;f<l.length;f++)m=l[f],!(d.indexOf(m)>=0)&&(S[m]=s[m]);return S}function I(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,m){return l.__proto__=m,l},h(s,d)}var a=function(s){I(d,s);function d(){for(var l,m=arguments.length,f=new Array(m),g=0;g<m;g++)f[g]=arguments[g];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(M,j){var U=j.size;l.props.onResize?(M.persist==null||M.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(M,j)})):l.setState(U)},l}d.getDerivedStateFromProps=function(m,f){return f.propsWidth!==m.width||f.propsHeight!==m.height?{width:m.width,height:m.height,propsWidth:m.width,propsHeight:m.height}:null};var S=d.prototype;return S.render=function(){var m=this.props,f=m.handle,g=m.handleSize;m.onResize;var M=m.onResizeStart,j=m.onResizeStop,U=m.draggableOpts,L=m.minConstraints,E=m.maxConstraints,F=m.lockAspectRatio,z=m.axis;m.width,m.height;var B=m.resizeHandles,X=m.style,ne=m.transformScale,Q=C(m,o);return t.createElement(r.default,{axis:z,draggableOpts:U,handle:f,handleSize:g,height:this.state.height,lockAspectRatio:F,maxConstraints:E,minConstraints:L,onResizeStart:M,onResize:this.onResize,onResizeStop:j,resizeHandles:B,transformScale:ne,width:this.state.width},t.createElement("div",p({},Q,{style:v(v({},X),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return Ze.default=a,a.propTypes=v(v({},n.resizableProps),{},{children:e.default.element}),Ze}var qn;function Ro(){return qn||(qn=1,Xe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Xe.exports.Resizable=yr().default,Xe.exports.ResizableBox=bo().default),Xe.exports}var Ie={},Wn;function Cr(){if(Wn)return Ie;Wn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.resizeHandleType=Ie.resizeHandleAxesType=Ie.default=void 0;var t=r(Oe()),e=r(N);function r(i){return i&&i.__esModule?i:{default:i}}const n=Ie.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),o=Ie.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return Ie.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(i){i.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(i){var u=i.layout;u!==void 0&&qe().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:o,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(i,u){const y=i[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},Ie}var Hn;function To(){if(Hn)return ke;Hn=1,Object.defineProperty(ke,"__esModule",{value:!0}),ke.default=void 0;var t=p(N),e=p(Oe()),r=Cn(),n=Ro(),o=qe(),i=vn(),u=Cr(),y=p(gn());function p(T){return T&&T.__esModule?T:{default:T}}function b(T,C,I){return C=v(C),C in T?Object.defineProperty(T,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):T[C]=I,T}function v(T){var C=R(T,"string");return typeof C=="symbol"?C:String(C)}function R(T,C){if(typeof T!="object"||T===null)return T;var I=T[Symbol.toPrimitive];if(I!==void 0){var h=I.call(T,C||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(T)}let _=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,I)=>{let{node:h}=I;const{onDragStart:a,transformScale:s}=this.props;if(!a)return;const d={top:0,left:0},{offsetParent:S}=h;if(!S)return;const l=S.getBoundingClientRect(),m=h.getBoundingClientRect(),f=m.left/s,g=l.left/s,M=m.top/s,j=l.top/s;d.left=f-g+S.scrollLeft,d.top=M-j+S.scrollTop,this.setState({dragging:d});const{x:U,y:L}=(0,i.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return a.call(this,this.props.i,U,L,{e:C,node:h,newPosition:d})}),b(this,"onDrag",(C,I)=>{let{node:h,deltaX:a,deltaY:s}=I;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+a;const{isBounded:m,i:f,w:g,h:M,containerWidth:j}=this.props,U=this.getPositionParams();if(m){const{offsetParent:z}=h;if(z){const{margin:B,rowHeight:X,containerPadding:ne}=this.props,Q=z.clientHeight-(0,i.calcGridItemWHPx)(M,X,B[1]);S=(0,i.clamp)(S-ne[1],0,Q);const H=(0,i.calcGridColWidth)(U),q=j-(0,i.calcGridItemWHPx)(g,H,B[0]);l=(0,i.clamp)(l-ne[0],0,q)}}const L={top:S,left:l};this.setState({dragging:L});const{x:E,y:F}=(0,i.calcXY)(U,S,l,g,M);return d.call(this,f,E,F,{e:C,node:h,newPosition:L})}),b(this,"onDragStop",(C,I)=>{let{node:h}=I;const{onDragStop:a}=this.props;if(!a)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:S}=this.props,{left:l,top:m}=this.state.dragging,f={top:m,left:l};this.setState({dragging:null});const{x:g,y:M}=(0,i.calcXY)(this.getPositionParams(),m,l,s,d);return a.call(this,S,g,M,{e:C,node:h,newPosition:f})}),b(this,"onResizeStop",(C,I,h)=>this.onResizeHandler(C,I,h,"onResizeStop")),b(this,"onResizeStart",(C,I,h)=>this.onResizeHandler(C,I,h,"onResizeStart")),b(this,"onResize",(C,I,h)=>this.onResizeHandler(C,I,h,"onResize"))}shouldComponentUpdate(C,I){if(this.props.children!==C.children||this.props.droppingPosition!==C.droppingPosition)return!0;const h=(0,i.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),a=(0,i.calcGridItemPosition)(this.getPositionParams(C),C.x,C.y,C.w,C.h,I);return!(0,o.fastPositionEqual)(h,a)||this.props.useCSSTransforms!==C.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(C){this.moveDroppingItem(C)}moveDroppingItem(C){const{droppingPosition:I}=this.props;if(!I)return;const h=this.elementRef.current;if(!h)return;const a=C.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&I.left!==a.left||I.top!==a.top;if(!s)this.onDragStart(I.e,{node:h,deltaX:I.left,deltaY:I.top});else if(d){const S=I.left-s.left,l=I.top-s.top;this.onDrag(I.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:I,containerWidth:h,useCSSTransforms:a}=this.props;let s;return a?s=(0,o.setTransform)(C):(s=(0,o.setTopLeft)(C),I&&(s.left=(0,o.perc)(C.left/h),s.width=(0,o.perc)(C.width/h))),s}mixinDraggable(C,I){return t.default.createElement(r.DraggableCore,{disabled:!I,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,I){return(h,a)=>I(h,a,C)}mixinResizable(C,I,h){const{cols:a,minW:s,minH:d,maxW:S,maxH:l,transformScale:m,resizeHandles:f,resizeHandle:g}=this.props,M=this.getPositionParams(),j=(0,i.calcGridItemPosition)(M,0,0,a,0).width,U=(0,i.calcGridItemPosition)(M,0,0,s,d),L=(0,i.calcGridItemPosition)(M,0,0,S,l),E=[U.width,U.height],F=[Math.min(L.width,j),Math.min(L.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:I.width,height:I.height,minConstraints:E,maxConstraints:F,onResizeStop:this.curryResizeHandler(I,this.onResizeStop),onResizeStart:this.curryResizeHandler(I,this.onResizeStart),onResize:this.curryResizeHandler(I,this.onResize),transformScale:m,resizeHandles:f,handle:g},C)}onResizeHandler(C,I,h,a){let{node:s,size:d,handle:S}=I;const l=this.props[a];if(!l)return;const{x:m,y:f,i:g,maxH:M,minH:j,containerWidth:U}=this.props,{minW:L,maxW:E}=this.props;let F=d;s&&(F=(0,o.resizeItemInDirection)(S,h,d,U),this.setState({resizing:a==="onResizeStop"?null:F}));let{w:z,h:B}=(0,i.calcWH)(this.getPositionParams(),F.width,F.height,m,f,S);z=(0,i.clamp)(z,Math.max(L,1),E),B=(0,i.clamp)(B,j,M),l.call(this,g,z,B,{e:C,node:s,size:F,handle:S})}render(){const{x:C,y:I,w:h,h:a,isDraggable:s,isResizable:d,droppingPosition:S,useCSSTransforms:l}=this.props,m=(0,i.calcGridItemPosition)(this.getPositionParams(),C,I,h,a,this.state),f=t.default.Children.only(this.props.children);let g=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(m)}});return g=this.mixinResizable(g,m,d),g=this.mixinDraggable(g,s),g}};return ke.default=_,b(_,"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(T,C){const I=T[C];if(typeof I!="number")return new Error("minWidth not Number");if(I>T.w||I>T.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(T,C){const I=T[C];if(typeof I!="number")return new Error("maxWidth not Number");if(I<T.w||I<T.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(T,C){const I=T[C];if(typeof I!="number")return new Error("minHeight not Number");if(I>T.h||I>T.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(T,C){const I=T[C];if(typeof I!="number")return new Error("maxHeight not Number");if(I<T.h||I<T.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(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),ke}var kn;function Sr(){if(kn)return He;kn=1,Object.defineProperty(He,"__esModule",{value:!0}),He.default=void 0;var t=b(N),e=mn(),r=y(gn()),n=qe(),o=vn(),i=y(To()),u=y(Cr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:a})(h)}function b(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(a);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 m=S?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T="react-grid-layout";let C=!1;try{C=/firefox/i.test(navigator.userAgent)}catch{}let I=class extends t.Component{constructor(){super(...arguments),v(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:[]}),v(this,"dragEnterCounter",0),v(this,"onDragStart",(a,s,d,S)=>{let{e:l,node:m}=S;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);if(!g)return;const M={w:g.w,h:g.h,x:g.x,y:g.y,placeholder:!0,i:a};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(g),oldLayout:f,activeDrag:M}),this.props.onDragStart(f,g,g,null,l,m)}),v(this,"onDrag",(a,s,d,S)=>{let{e:l,node:m}=S;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:M,allowOverlap:j,preventCollision:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;const E={w:L.w,h:L.h,x:L.x,y:L.y,placeholder:!0,i:a};g=(0,n.moveElement)(g,L,s,d,!0,U,(0,n.compactType)(this.props),M,j),this.props.onDrag(g,f,L,E,l,m),this.setState({layout:j?g:(0,n.compact)(g,(0,n.compactType)(this.props),M),activeDrag:E})}),v(this,"onDragStop",(a,s,d,S)=>{let{e:l,node:m}=S;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:g}=this.state;const{cols:M,preventCollision:j,allowOverlap:U}=this.props,L=(0,n.getLayoutItem)(g,a);if(!L)return;g=(0,n.moveElement)(g,L,s,d,!0,j,(0,n.compactType)(this.props),M,U);const F=U?g:(0,n.compact)(g,(0,n.compactType)(this.props),M);this.props.onDragStop(F,f,L,null,l,m);const{oldLayout:z}=this.state;this.setState({activeDrag:null,layout:F,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(F,z)}),v(this,"onResizeStart",(a,s,d,S)=>{let{e:l,node:m}=S;const{layout:f}=this.state,g=(0,n.getLayoutItem)(f,a);g&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(g),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,g,g,null,l,m))}),v(this,"onResize",(a,s,d,S)=>{let{e:l,node:m,size:f,handle:g}=S;const{oldResizeItem:M}=this.state,{layout:j}=this.state,{cols:U,preventCollision:L,allowOverlap:E}=this.props;let F=!1,z,B,X;const[ne,Q]=(0,n.withLayoutItem)(j,a,q=>{let re;return B=q.x,X=q.y,["sw","w","nw","n","ne"].indexOf(g)!==-1&&(["sw","nw","w"].indexOf(g)!==-1&&(B=q.x+(q.w-s),s=q.x!==B&&B<0?q.w:s,B=B<0?0:B),["ne","n","nw"].indexOf(g)!==-1&&(X=q.y+(q.h-d),d=q.y!==X&&X<0?q.h:d,X=X<0?0:X),F=!0),L&&!E&&(re=(0,n.getAllCollisions)(j,{...q,w:s,h:d,x:B,y:X}).filter(le=>le.i!==q.i).length>0,re&&(X=q.y,d=q.h,B=q.x,s=q.w,F=!1)),q.w=s,q.h=d,q});if(!Q)return;z=ne,F&&(z=(0,n.moveElement)(ne,Q,B,X,!0,this.props.preventCollision,(0,n.compactType)(this.props),U,E));const H={w:Q.w,h:Q.h,x:Q.x,y:Q.y,static:!0,i:a};this.props.onResize(z,M,Q,H,l,m),this.setState({layout:E?z:(0,n.compact)(z,(0,n.compactType)(this.props),U),activeDrag:H})}),v(this,"onResizeStop",(a,s,d,S)=>{let{e:l,node:m}=S;const{layout:f,oldResizeItem:g}=this.state,{cols:M,allowOverlap:j}=this.props,U=(0,n.getLayoutItem)(f,a),L=j?f:(0,n.compact)(f,(0,n.compactType)(this.props),M);this.props.onResizeStop(L,g,U,null,l,m);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:L,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(L,E)}),v(this,"onDragOver",a=>{var ne;if(a.preventDefault(),a.stopPropagation(),C&&!((ne=a.nativeEvent.target)!=null&&ne.classList.contains(T)))return!1;const{droppingItem:s,onDropDragOver:d,margin:S,cols:l,rowHeight:m,maxRows:f,width:g,containerPadding:M,transformScale:j}=this.props,U=d==null?void 0:d(a);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const L={...s,...U},{layout:E}=this.state,F=a.currentTarget.getBoundingClientRect(),z=a.clientX-F.left,B=a.clientY-F.top,X={left:z/j,top:B/j,e:a};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:Q,top:H}=this.state.droppingPosition;(Q!=z||H!=B)&&this.setState({droppingPosition:X})}}else{const Q={cols:l,margin:S,maxRows:f,rowHeight:m,containerWidth:g,containerPadding:M||S},H=(0,o.calcXY)(Q,B,z,L.w,L.h);this.setState({droppingDOMNode:t.createElement("div",{key:L.i}),droppingPosition:X,layout:[...E,{...L,x:H.x,y:H.y,static:!1,isDraggable:!0}]})}}),v(this,"removeDroppingPlaceholder",()=>{const{droppingItem:a,cols:s}=this.props,{layout:d}=this.state,S=(0,n.compact)(d.filter(l=>l.i!==a.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:S,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),v(this,"onDragLeave",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),v(this,"onDragEnter",a=>{a.preventDefault(),a.stopPropagation(),this.dragEnterCounter++}),v(this,"onDrop",a=>{a.preventDefault(),a.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,a)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(a,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(a.layout,s.propsLayout)||a.compactType!==s.compactType?d=a.layout:(0,n.childrenEqual)(a.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,a.children,a.cols,(0,n.compactType)(a),a.allowOverlap),compactType:a.compactType,children:a.children,propsLayout:a.layout}:null)}shouldComponentUpdate(a,s){return this.props.children!==a.children||!(0,n.fastRGLPropsEqual)(this.props,a,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(a,s){if(!this.state.activeDrag){const d=this.state.layout,S=s.layout;this.onLayoutMaybeChanged(d,S)}}containerHeight(){if(!this.props.autoSize)return;const a=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return a*this.props.rowHeight+(a-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(a,s){s||(s=this.state.layout),(0,e.deepEqual)(s,a)||this.props.onLayoutChange(a)}placeholder(){const{activeDrag:a}=this.state;if(!a)return null;const{width:s,cols:d,margin:S,containerPadding:l,rowHeight:m,maxRows:f,useCSSTransforms:g,transformScale:M}=this.props;return t.createElement(i.default,{w:a.w,h:a.h,x:a.x,y:a.y,i:a.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:S,containerPadding:l||S,maxRows:f,rowHeight:m,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:g,transformScale:M},t.createElement("div",null))}processGridItem(a,s){if(!a||!a.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(a.key));if(!d)return null;const{width:S,cols:l,margin:m,containerPadding:f,rowHeight:g,maxRows:M,isDraggable:j,isResizable:U,isBounded:L,useCSSTransforms:E,transformScale:F,draggableCancel:z,draggableHandle:B,resizeHandles:X,resizeHandle:ne}=this.props,{mounted:Q,droppingPosition:H}=this.state,q=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&j,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&U,ie=d.resizeHandles||X,le=q&&L&&d.isBounded!==!1;return t.createElement(i.default,{containerWidth:S,cols:l,margin:m,containerPadding:f||m,maxRows:M,rowHeight:g,cancel:z,handle:B,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:q,isResizable:re,isBounded:le,useCSSTransforms:E&&Q,usePercentages:!Q,transformScale:F,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?H:void 0,resizeHandles:ie,resizeHandle:ne},a)}render(){const{className:a,style:s,isDroppable:d,innerRef:S}=this.props,l=(0,r.default)(T,a),m={height:this.containerHeight(),...s};return t.createElement("div",{ref:S,className:l,style:m,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 He.default=I,v(I,"displayName","ReactGridLayout"),v(I,"propTypes",u.default),v(I,"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}),He}var Je={},Fe={},Bn;function br(){if(Bn)return Fe;Bn=1,Object.defineProperty(Fe,"__esModule",{value:!0}),Fe.findOrGenerateResponsiveLayout=n,Fe.getBreakpointFromWidth=e,Fe.getColsFromBreakpoint=r,Fe.sortBreakpoints=o;var t=qe();function e(i,u){const y=o(i);let p=y[0];for(let b=1,v=y.length;b<v;b++){const R=y[b];u>i[R]&&(p=R)}return p}function r(i,u){if(!u[i])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+i+" is missing!");return u[i]}function n(i,u,y,p,b,v){if(i[y])return(0,t.cloneLayout)(i[y]);let R=i[p];const _=o(u),T=_.slice(_.indexOf(y));for(let C=0,I=T.length;C<I;C++){const h=T[C];if(i[h]){R=i[h];break}}return R=(0,t.cloneLayout)(R||[]),(0,t.compact)((0,t.correctBounds)(R,{cols:b}),v,b)}function o(i){return Object.keys(i).sort(function(y,p){return i[y]-i[p]})}return Fe}var Gn;function Io(){if(Gn)return Je;Gn=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=p(N),e=u(Oe()),r=mn(),n=qe(),o=br(),i=u(Sr());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var a=new WeakMap,s=new WeakMap;return(y=function(d){return d?s:a})(h)}function p(h,a){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(a);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 m=S?Object.getOwnPropertyDescriptor(h,l):null;m&&(m.get||m.set)?Object.defineProperty(d,l,m):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 a=1;a<arguments.length;a++){var s=arguments[a];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function v(h,a,s){return a=R(a),a in h?Object.defineProperty(h,a,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[a]=s,h}function R(h){var a=_(h,"string");return typeof a=="symbol"?a:String(a)}function _(h,a){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,a||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(h)}const T=h=>Object.prototype.toString.call(h);function C(h,a){return h==null?null:Array.isArray(h)?h:h[a]}let I=class extends t.Component{constructor(){super(...arguments),v(this,"state",this.generateInitialState()),v(this,"onLayoutChange",a=>{this.props.onLayoutChange(a,{...this.props.layouts,[this.state.breakpoint]:a})})}generateInitialState(){const{width:a,breakpoints:s,layouts:d,cols:S}=this.props,l=(0,o.getBreakpointFromWidth)(s,a),m=(0,o.getColsFromBreakpoint)(l,S),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,o.findOrGenerateResponsiveLayout)(d,s,l,l,m,f),breakpoint:l,cols:m}}static getDerivedStateFromProps(a,s){if(!(0,r.deepEqual)(a.layouts,s.layouts)){const{breakpoint:d,cols:S}=s;return{layout:(0,o.findOrGenerateResponsiveLayout)(a.layouts,a.breakpoints,d,d,S,a.compactType),layouts:a.layouts}}return null}componentDidUpdate(a){(this.props.width!=a.width||this.props.breakpoint!==a.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,a.breakpoints)||!(0,r.deepEqual)(this.props.cols,a.cols))&&this.onWidthChange(a)}onWidthChange(a){const{breakpoints:s,cols:d,layouts:S,compactType:l}=this.props,m=this.props.breakpoint||(0,o.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,g=(0,o.getColsFromBreakpoint)(m,d),M={...S};if(f!==m||a.breakpoints!==s||a.cols!==d){f in M||(M[f]=(0,n.cloneLayout)(this.state.layout));let L=(0,o.findOrGenerateResponsiveLayout)(M,s,m,f,g,l);L=(0,n.synchronizeLayoutWithChildren)(L,this.props.children,g,l,this.props.allowOverlap),M[m]=L,this.props.onBreakpointChange(m,g),this.props.onLayoutChange(L,M),this.setState({breakpoint:m,layout:L,cols:g})}const j=C(this.props.margin,m),U=C(this.props.containerPadding,m);this.props.onWidthChange(this.props.width,j,g,U)}render(){const{breakpoint:a,breakpoints:s,cols:d,layouts:S,margin:l,containerPadding:m,onBreakpointChange:f,onLayoutChange:g,onWidthChange:M,...j}=this.props;return t.createElement(i.default,b({},j,{margin:C(l,this.state.breakpoint),containerPadding:C(m,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return Je.default=I,v(I,"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,a){if(T(h[a])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+T(h[a]));Object.keys(h[a]).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}),v(I,"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}),Je}var bt={},Rr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(o,i){return o[0]===r?(n=i,!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),o=this.__entries__[n];return o&&o[1]},e.prototype.set=function(r,n){var o=t(this.__entries__,r);~o?this.__entries__[o][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,o=t(n,r);~o&&n.splice(o,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 o=0,i=this.__entries__;o<i.length;o++){var u=i[o];r.call(n,u[1],u[0])}},e}()}(),on=typeof window<"u"&&typeof document<"u"&&window.document===document,Pt=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")()}(),wo=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Pt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),_o=2;function xo(t,e){var r=!1,n=!1,o=0;function i(){r&&(r=!1,t()),n&&y()}function u(){wo(i)}function y(){var p=Date.now();if(r){if(p-o<_o)return;n=!0}else r=!0,n=!1,setTimeout(u,e);o=p}return y}var Eo=20,Oo=["top","right","bottom","left","width","height","size","weight"],Po=typeof MutationObserver<"u",Mo=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=xo(this.refresh.bind(this),Eo)}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(){!on||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Po?(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(){!on||!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,o=Oo.some(function(i){return!!~n.indexOf(i)});o&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),Tr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var o=n[r];Object.defineProperty(t,o,{value:e[o],enumerable:!1,writable:!1,configurable:!0})}return t},$e=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Pt},Ir=Wt(0,0,0,0);function Mt(t){return parseFloat(t)||0}function Xn(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,o){var i=t["border-"+o+"-width"];return n+Mt(i)},0)}function Fo(t){for(var e=["top","right","bottom","left"],r={},n=0,o=e;n<o.length;n++){var i=o[n],u=t["padding-"+i];r[i]=Mt(u)}return r}function Do(t){var e=t.getBBox();return Wt(0,0,e.width,e.height)}function No(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return Ir;var n=$e(t).getComputedStyle(t),o=Fo(n),i=o.left+o.right,u=o.top+o.bottom,y=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+i)!==e&&(y-=Xn(n,"left","right")+i),Math.round(p+u)!==r&&(p-=Xn(n,"top","bottom")+u)),!Lo(t)){var b=Math.round(y+i)-e,v=Math.round(p+u)-r;Math.abs(b)!==1&&(y-=b),Math.abs(v)!==1&&(p-=v)}return Wt(o.left,o.top,y,p)}var jo=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof $e(t).SVGGraphicsElement}:function(t){return t instanceof $e(t).SVGElement&&typeof t.getBBox=="function"}}();function Lo(t){return t===$e(t).document.documentElement}function Uo(t){return on?jo(t)?Do(t):No(t):Ir}function Vo(t){var e=t.x,r=t.y,n=t.width,o=t.height,i=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(i.prototype);return Tr(u,{x:e,y:r,width:n,height:o,top:r,right:e+n,bottom:o+r,left:e}),u}function Wt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var $o=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Wt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Uo(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}(),zo=function(){function t(e,r){var n=Vo(r);Tr(this,{target:e,contentRect:n})}return t}(),Ao=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new Rr,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 $e(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new $o(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 $e(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 zo(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}(),wr=typeof WeakMap<"u"?new WeakMap:new Rr,_r=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=Mo.getInstance(),n=new Ao(e,r,this);wr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){_r.prototype[t]=function(){var e;return(e=wr.get(this))[t].apply(e,arguments)}});var qo=function(){return typeof Pt.ResizeObserver<"u"?Pt.ResizeObserver:_r}();const Wo=Object.freeze(Object.defineProperty({__proto__:null,default:qo},Symbol.toStringTag,{value:"Module"})),Ho=pr(Wo);var Yn;function ko(){if(Yn)return bt;Yn=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=_;var t=u(N),e=o(Oe()),r=o(Ho),n=o(gn());function o(T){return T&&T.__esModule?T:{default:T}}function i(T){if(typeof WeakMap!="function")return null;var C=new WeakMap,I=new WeakMap;return(i=function(h){return h?I:C})(T)}function u(T,C){if(T&&T.__esModule)return T;if(T===null||typeof T!="object"&&typeof T!="function")return{default:T};var I=i(C);if(I&&I.has(T))return I.get(T);var h={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in T)if(s!=="default"&&Object.prototype.hasOwnProperty.call(T,s)){var d=a?Object.getOwnPropertyDescriptor(T,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=T[s]}return h.default=T,I&&I.set(T,h),h}function y(){return y=Object.assign?Object.assign.bind():function(T){for(var C=1;C<arguments.length;C++){var I=arguments[C];for(var h in I)Object.prototype.hasOwnProperty.call(I,h)&&(T[h]=I[h])}return T},y.apply(this,arguments)}function p(T,C,I){return C=b(C),C in T?Object.defineProperty(T,C,{value:I,enumerable:!0,configurable:!0,writable:!0}):T[C]=I,T}function b(T){var C=v(T,"string");return typeof C=="symbol"?C:String(C)}function v(T,C){if(typeof T!="object"||T===null)return T;var I=T[Symbol.toPrimitive];if(I!==void 0){var h=I.call(T,C||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(T)}const R="react-grid-layout";function _(T){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(a=>{if(this.elementRef.current instanceof HTMLElement){const d=a[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,...a}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,R),style:this.props.style,ref:this.elementRef}):t.createElement(T,y({innerRef:this.elementRef},a,this.state))}},p(C,"defaultProps",{measureBeforeMount:!1}),p(C,"propTypes",{measureBeforeMount:e.default.bool}),C}return bt}var Kn;function Bo(){return Kn||(Kn=1,function(t){t.exports=Sr().default,t.exports.utils=qe(),t.exports.calculateUtils=vn(),t.exports.Responsive=Io().default,t.exports.Responsive.utils=br(),t.exports.WidthProvider=ko().default}(kt)),kt.exports}var Go=Bo();const Xo=uo(Go);var Yo=Object.defineProperty,Ko=Object.getOwnPropertyDescriptor,Zo=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ko(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Yo(e,r,o),o},Jo=(t,e)=>(r,n)=>e(r,n,t);let ze=class extends w.Disposable{constructor(e){super();_e(this,"_initLocal",()=>{});_e(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let o=r.exec(e);for(;o;)n.push({startIndex:o.index,key:Number(o[1]),endIndex:o.index+o[0].length-1}),o=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),o=e.split("."),i=n&&this._localeService.resolveKeyPath(n,o);if(typeof i=="string"){const u=[];return this._findReplaceIndex(i).forEach((y,p,b)=>{const v=b[p-1]||{startIndex:0,endIndex:-1};if(v.endIndex+1<y.startIndex){const R=i.slice(v.endIndex+1,y.startIndex);R&&u.push(R)}if(r[y.key]&&u.push(r[y.key]),p===b.length-1){const R=i.slice(y.endIndex+1);R&&u.push(R)}}),u}return[]}};ze=Zo([Jo(0,w.Inject(w.LocaleService))],ze);const Qo="univer-cf-preview",Rt={cfPreview:Qo},We=t=>{var o,i;const e=t.rule;if(!e)return null;const r=N.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((b,v)=>({color:new w.ColorKit(b.color),value:v})),y=u.length-1;return new Array(5).fill("").map((b,v,R)=>v*y/(R.length-1)).map(b=>c.getColorScaleFromValue(u,b))}return null},[e]),n=N.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 x.jsxs("div",{className:Rt.cfPreview,children:[x.jsx("div",{style:{...y,background:b,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),x.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&x.jsx("div",{className:Rt.cfPreview,children:r.map((u,y)=>x.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return n&&x.jsx("div",{className:Rt.cfPreview,children:n.map((u,y)=>u?x.jsx("img",{style:{height:"100%"},src:u},y):x.jsx(mt,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:b,bg:v,cl:R}=e.style,_=(u==null?void 0:u.s)===w.BooleanNumber.TRUE,T=(y==null?void 0:y.s)===w.BooleanNumber.TRUE,C=p===w.BooleanNumber.TRUE,I=b===w.BooleanNumber.TRUE,h=(o=v==null?void 0:v.rgb)!=null?o:c.DEFAULT_BG_COLOR,a=(i=R==null?void 0:R.rgb)!=null?i:c.DEFAULT_FONT_COLOR,s={fontWeight:I?"bold":void 0,fontStyle:C?"italic":void 0,textDecoration:`${_?"underline":""} ${T?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:a};return x.jsx("div",{style:s,className:Rt.cfPreview,children:"123"})}}return null},ei="univer-cf-rule-list",ti="univer-rule-selector",ni="univer-select",ri="univer-select-selector",oi="univer-select-selection-item",ii="univer-select-selection-search-input",ai="univer-btn-list",si="univer-gap",li="univer-icon",ui="univer-disabled",ci="univer-rule-item",di="univer-rule-describe",fi="univer-rule-type",pi="univer-rule-range",hi="univer-active",mi="univer-draggableHandle",gi="univer-delete-item",vi="univer-grid-layout-wrap",yi="univer-react-grid-item",he={cfRuleList:ei,ruleSelector:ti,select:ni,selectSelector:ri,selectSelectionItem:oi,selectSelectionSearchInput:ii,btnList:ai,gap:si,icon:li,disabled:ui,ruleItem:ci,ruleDescribe:di,ruleType:fi,ruleRange:pi,active:hi,draggableHandle:mi,deleteItem:gi,gridLayoutWrap:vi,reactGridItem:yi},Ci=(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(o=>String(o)):[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 Zn=0;const Si=t=>{const{onClick:e}=t,r=te.useDependency(c.ConditionalFormattingRuleModel),n=te.useDependency(w.IUniverInstanceService),o=te.useDependency(G.SheetsSelectionsService),i=te.useDependency(w.ICommandService),u=te.useDependency(w.LocaleService),y=te.useDependency(w.Injector),p=te.useDependency(ze),b=te.useObservable(()=>n.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),v=b.getUnitId(),R=b.getActiveSheet();if(!R)throw new Error("No active sheet found");const _=R.getSheetId(),[T,C]=N.useState([]),[I,h]=N.useState("2"),[a,s]=N.useState(0),[d,S]=N.useState(-1),[l,m]=N.useState(Zn),f=N.useRef(null),g=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const H=r.getSubunitRules(v,_);if(!H||!H.length)return[];if(I==="1"){const q=o.getCurrentLastSelection();if(!q)return[];const re=q.range;return H.filter(le=>le.ranges.some(pe=>w.Rectangle.intersects(pe,re)))}else if(I==="2")return[...H];return[]},[j,U]=N.useState(M);de.useHighlightRange(T),N.useEffect(()=>{const H=i.onCommandExecuted(q=>{q.id===G.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>H.dispose()}),N.useEffect(()=>{U(M)},[I,a,v,_]),N.useEffect(()=>{if(I==="2")return;const H=new be.Observable(q=>{const re=[G.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=i.onCommandExecuted(le=>{const{id:pe,params:ge}=le,Se=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(pe)&&ge.unitId===Se&&q.next(null)});return()=>ie.dispose()}).pipe(be.debounceTime(16)).subscribe(()=>{U(M)});return()=>{H.unsubscribe()}},[n,I,v,_]),N.useEffect(()=>{const H=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>H.unsubscribe()},[r]),N.useEffect(()=>{const H=()=>{var le;const ie=Math.max(0,(((le=f.current)==null?void 0:le.getBoundingClientRect().width)||0)-8);return Zn=ie,ie},re=new be.Observable(ie=>{const le=document.querySelector(".univer-sidebar");if(le){let pe=setTimeout(()=>{ie.next()},150);const ge=()=>{pe&&clearTimeout(pe),pe=null},Se=W=>{W.propertyName==="width"&&(ge(),ie.next())};return le.addEventListener("transitionend",Se),()=>{ge(),le.removeEventListener("transitionend",Se)}}}).pipe(be.debounceTime(16)).subscribe(()=>{m(H())});return()=>{re.unsubscribe()}},[]);const L=H=>{var ie;const q=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(ie=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!q||!re)throw new Error("No active sheet found");i.executeCommand(at.id,{unitId:q,subUnitId:re,cfId:H.cfId})},E=(H,q)=>{S(q.y)},F=(H,q,re)=>{var W;S(-1);const ie=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),le=(W=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:W.getSheetId();if(!ie||!le)throw new Error("No active sheet found");const pe=J=>{const se=j.length;return Math.min(se-1,Math.max(0,J))},ge=j[pe(q.y)].cfId,Se=j[pe(re.y)].cfId;ge!==Se&&i.executeCommand($t.id,{unitId:ie,subUnitId:le,start:{id:ge,type:"self"},end:{id:Se,type:re.y>q.y?"after":"before"}})},z=()=>{t.onCreate()},B=()=>{I==="2"?i.executeCommand(ht.id):I==="1"&&j.map(q=>({unitId:v,subUnitId:_,cfId:q.cfId})).forEach(q=>{i.executeCommand(at.id,q)})},X=N.useMemo(()=>{const H=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),q=H.getActiveSheet();return j.filter(re=>{const ie=re.ranges;return G.checkRangesEditablePermission(y,H.getUnitId(),q.getSheetId(),ie)})},[j]),ne=X.map((H,q)=>({i:H.cfId,x:0,w:12,y:q,h:1,isResizable:!1})),Q=N.useMemo(()=>{const H=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),q=H.getActiveSheet();return j.every(re=>{const ie=re.ranges;return G.checkRangesEditablePermission(y,H.getUnitId(),q.getSheetId(),ie)})},[j]);return x.jsxs("div",{className:he.cfRuleList,children:[x.jsxs("div",{className:he.ruleSelector,children:[x.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",x.jsx(oe.Select,{className:he.select,options:g,value:I,onChange:H=>{h(H)}})).map((H,q)=>x.jsx("span",{children:H},q))}),x.jsxs("div",{className:he.btnList,children:[x.jsx(oe.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:x.jsx("div",{className:`
|
|
4
|
+
${he.icon}
|
|
5
|
+
`,onClick:z,children:x.jsx(dr,{})})}),j.length&&Q?x.jsx(oe.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:x.jsx("div",{className:`
|
|
6
|
+
${he.gap}
|
|
7
|
+
${he.icon}
|
|
8
8
|
`,onClick:B,children:x.jsx(Ot,{})})}):x.jsx("div",{className:`
|
|
9
|
-
${
|
|
10
|
-
${
|
|
11
|
-
`,children:x.jsx(Ot,{})})]})]}),x.jsx("div",{ref:f,className:
|
|
12
|
-
${
|
|
13
|
-
${d===
|
|
9
|
+
${he.gap}
|
|
10
|
+
${he.disabled}
|
|
11
|
+
`,children:x.jsx(Ot,{})})]})]}),x.jsx("div",{ref:f,className:he.gridLayoutWrap,children:l?x.jsx(Xo,{onDragStop:F,onDragStart:E,layout:ne,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:X==null?void 0:X.map((H,q)=>x.jsx("div",{children:x.jsxs("div",{onMouseMove:()=>{H.ranges!==T&&C(H.ranges)},onMouseLeave:()=>C([]),onClick:()=>{e(H)},className:`
|
|
12
|
+
${he.ruleItem}
|
|
13
|
+
${d===q?he.active:""}
|
|
14
14
|
`,children:[x.jsx("div",{className:`
|
|
15
|
-
${
|
|
15
|
+
${he.draggableHandle}
|
|
16
16
|
draggableHandle
|
|
17
|
-
`,onClick:
|
|
18
|
-
${
|
|
19
|
-
${d===
|
|
20
|
-
`,onClick:
|
|
17
|
+
`,onClick:re=>re.stopPropagation(),children:x.jsx(fr,{})}),x.jsxs("div",{className:he.ruleDescribe,children:[x.jsx("div",{className:he.ruleType,children:Ci(H,u)}),x.jsx("div",{className:he.ruleRange,children:H.ranges.map(re=>rn.serializeRange(re)).join(",")})]}),x.jsx("div",{className:he.preview,children:x.jsx(We,{rule:H.rule})}),x.jsx("div",{className:`
|
|
18
|
+
${he.deleteItem}
|
|
19
|
+
${d===q?he.active:""}
|
|
20
|
+
`,onClick:re=>{re.stopPropagation(),L(H),C([])},children:x.jsx(Ot,{})})]})},`${H.cfId}`))}):null})]})},bi="univer-cf-color-picker",Ri="univer-cf-color-picker-icon",Ti="univer-icon-dropdown",Zt={cfColorPicker:bi,cfColorPickerIcon:Ri,iconDropdown:Ti},Ne=t=>{const{color:e,onChange:r,disable:n=!1,iconId:o="PaintBucket",className:i,isNeedDropdownIcon:u=!0}=t,y=te.useDependency(te.ComponentManager),p=N.useMemo(()=>new w.ColorKit(e),[e]),b=y.get(o);return b&&(n?x.jsx(b,{className:i,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):x.jsx(oe.DropdownLegacy,{overlay:x.jsx("div",{className:`
|
|
21
21
|
${Zt.cfColorPicker}
|
|
22
|
-
`,children:x.jsx(
|
|
22
|
+
`,children:x.jsx(oe.ColorPicker,{value:e,onChange:r})}),children:x.jsxs("span",{className:`
|
|
23
23
|
${Zt.cfColorPickerIcon}
|
|
24
24
|
${i}
|
|
25
|
-
`,children:[x.jsx(
|
|
25
|
+
`,children:[x.jsx(b,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&x.jsx(At,{className:Zt.iconDropdown})]})}))},Ii="univer-cf-rule-style-editor",wi="univer-cf-preview-wrap",_i="univer-text",xi="univer-position-relative",Ei="univer-btn-list",Oi="univer-util-item",Pi="univer-icon-set",Mi="univer-render-config",Fi="univer-flex",Di="univer-width45",Ni="univer-icon-wrap",ji="univer-icon",Li="univer-dropdown-icon",Ui="univer-error-input",Vi="univer-error-text",$i="univer-icon-group-list",zi="univer-title",Ai="univer-group",qi="univer-item-content",Wi="univer-item-wrap",Hi="univer-item",ki="univer-icon-item-list-wrap",Bi="univer-none",Gi="univer-icon-item-list",Xi="univer-width100",Yi="univer-stress",k={cfRuleStyleEditor:Ii,cfPreviewWrap:wi,text:_i,positionRelative:xi,btnList:Ei,utilItem:Oi,iconSet:Pi,renderConfig:Mi,flex:Fi,width45:Di,iconWrap:Ni,icon:ji,dropdownIcon:Li,errorInput:Ui,errorText:Vi,iconGroupList:$i,title:zi,group:Ai,itemContent:qi,itemWrap:Wi,item:Hi,iconItemListWrap:ki,none:Bi,iconItemList:Gi,width100:Xi,stress:Yi},De=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Jt=t=>{var C;const{type:e,className:r,onChange:n,id:o,value:i}=t,u=te.useDependency(w.IUniverInstanceService),y=u.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(C=u.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:C.getSheetId(),b=N.useMemo(()=>String(i).startsWith("=")?String(i):"=",[i]),v=N.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]),R=N.useRef({}),[_,T]=N.useState(!1);return te.useSidebarClick(I=>{var a;const h=(a=R.current)==null?void 0:a.handleOutClick;h&&h(I,()=>T(!1))}),e===c.CFValueType.formula?x.jsx("div",{style:{width:"100%",marginLeft:4},children:x.jsx(ft.FormulaEditor,{initValue:b,unitId:y,subUnitId:p,isFocus:_,onChange:(I="")=>{n(I||"")},onFocus:()=>T(!0),actions:R.current})}):x.jsx(oe.InputNumber,{className:r,value:Number(t.value)||0,onChange:I=>t.onChange(I||0),...v})},Ki=t=>{var L;const{interceptorManager:e}=t,r=te.useDependency(w.LocaleService),n=((L=t.rule)==null?void 0:L.type)===c.CFRuleType.colorScale?t.rule:void 0,o=[De(c.CFValueType.num,r),De(c.CFValueType.percent,r),De(c.CFValueType.percentile,r),De(c.CFValueType.formula,r)],i=[De(c.CFValueType.min,r),...o],u=[De("none",r),...o],y=[De(c.CFValueType.max,r),...o],[p,b]=N.useState(()=>{var F;const E=c.CFValueType.min;return n&&((F=n.config[0])==null?void 0:F.value.type)||E}),[v,R]=N.useState(()=>{var F;const E="none";return!n||n.config.length!==3?E:((F=n.config[1])==null?void 0:F.value.type)||E}),[_,T]=N.useState(()=>{var F;const E=c.CFValueType.max;return n&&((F=n.config[n.config.length-1])==null?void 0:F.value.type)||E}),[C,I]=N.useState(()=>{if(!n)return 10;const F=n.config[0];return(F==null?void 0:F.value.value)===void 0?10:F==null?void 0:F.value.value}),[h,a]=N.useState(()=>{var z;if(!n||n.config.length!==3)return 50;const F=(z=n.config[1])==null?void 0:z.value.value;return F===void 0?50:F}),[s,d]=N.useState(()=>{var z;if(!n)return 90;const F=(z=n.config[n.config.length-1])==null?void 0:z.value.value;return F===void 0?90:F}),[S,l]=N.useState(()=>{var F;const E="#d0d9fb";return n&&((F=n.config[0])==null?void 0:F.color)||E}),[m,f]=N.useState(()=>{var F;const E="#7790f3";return!n||n.config.length!==3?E:((F=n.config[1])==null?void 0:F.color)||E}),[g,M]=N.useState(()=>{var F;const E="#2e55ef";return n&&((F=n.config[n.config.length-1])==null?void 0:F.color)||E}),j=N.useMemo(()=>E=>{const{minType:F,medianType:z,maxType:B,minValue:X,medianValue:ne,maxValue:Q,minColor:H,medianColor:q,maxColor:re}=E,ie=[];return ie.push({color:H,value:{type:F,value:X}}),z!=="none"&&ie.push({color:q,value:{type:z,value:ne}}),ie.push({color:re,value:{type:B,value:Q}}),{config:ie.map((pe,ge)=>({...pe,index:ge})),type:c.CFRuleType.colorScale}},[]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return j({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:m,maxColor:g})}}),[j,p,v,_,C,h,s,S,m,g,e]);const U=E=>{t.onChange(j(E))};return x.jsxs("div",{children:[x.jsx("div",{className:$.title,children:r.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
|
|
26
26
|
${k.cfPreviewWrap}
|
|
27
|
-
`,children:x.jsx(We,{rule:j({minType:p,medianType:v,maxType:_,minValue:
|
|
27
|
+
`,children:x.jsx(We,{rule:j({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:m,maxColor:g})})}),x.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.min")}),x.jsxs("div",{className:`
|
|
28
28
|
${$.labelContainer}
|
|
29
29
|
${$.mTSm}
|
|
30
|
-
`,children:[x.jsx(
|
|
30
|
+
`,children:[x.jsx(oe.Select,{style:{flexShrink:0},options:i,value:p,onChange:E=>{b(E);const F=c.createDefaultValueByValueType(E,10);I(F),U({minType:E,medianType:v,maxType:_,minValue:F,medianValue:h,maxValue:s,minColor:S,medianColor:m,maxColor:g})}}),x.jsx(Jt,{id:"min",className:`
|
|
31
31
|
${$.mLXxs}
|
|
32
|
-
`,value:
|
|
32
|
+
`,value:C,type:p,onChange:E=>{I(E),U({minType:p,medianType:v,maxType:_,minValue:E,medianValue:h,maxValue:s,minColor:S,medianColor:m,maxColor:g})}}),x.jsx(Ne,{className:$.mLXxs,color:S,onChange:E=>{l(E),U({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:E,medianColor:m,maxColor:g})}})]}),x.jsx("div",{className:$.label,children:r.t("sheet.cf.panel.medianValue")}),x.jsxs("div",{className:`
|
|
33
33
|
${$.labelContainer}
|
|
34
34
|
${$.mTSm}
|
|
35
|
-
`,children:[x.jsx(
|
|
35
|
+
`,children:[x.jsx(oe.Select,{style:{flexShrink:0},options:u,value:v,onChange:E=>{R(E);const F=c.createDefaultValueByValueType(E,50);a(F),U({minType:p,medianType:E,maxType:_,minValue:C,medianValue:F,maxValue:s,minColor:S,medianColor:m,maxColor:g})}}),x.jsx(Jt,{id:"median",className:`
|
|
36
36
|
${$.mLXxs}
|
|
37
|
-
`,value:h,type:v,onChange:E=>{a(E),U({minType:p,medianType:v,maxType:_,minValue:
|
|
37
|
+
`,value:h,type:v,onChange:E=>{a(E),U({minType:p,medianType:v,maxType:_,minValue:C,medianValue:E,maxValue:s,minColor:S,medianColor:m,maxColor:g})}}),v!=="none"&&x.jsx(Ne,{className:$.mLXxs,color:m,onChange:E=>{f(E),U({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:E,maxColor:g})}})]}),x.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.max")}),x.jsxs("div",{className:`
|
|
38
38
|
${$.labelContainer}
|
|
39
39
|
${$.mTSm}
|
|
40
|
-
`,children:[x.jsx(
|
|
40
|
+
`,children:[x.jsx(oe.Select,{style:{flexShrink:0},options:y,value:_,onChange:E=>{T(E);const F=c.createDefaultValueByValueType(E,90);d(F),U({minType:p,medianType:v,maxType:E,minValue:C,medianValue:h,maxValue:F,minColor:S,medianColor:m,maxColor:g})}}),x.jsx(Jt,{id:"max",className:`
|
|
41
41
|
${$.mLXxs}
|
|
42
|
-
`,value:s,type:_,onChange:E=>{d(E),U({minType:p,medianType:v,maxType:_,minValue:
|
|
42
|
+
`,value:s,type:_,onChange:E=>{d(E),U({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:E,minColor:S,medianColor:m,maxColor:g})}}),x.jsx(Ne,{className:$.mLXxs,color:g,onChange:E=>{M(E),U({minType:p,medianType:v,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:m,maxColor:E})}})]})]})},Le=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Jn=t=>{var I;const{onChange:e,className:r,value:n,type:o,id:i,disabled:u=!1}=t,y=te.useDependency(w.IUniverInstanceService),p=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),b=(I=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId(),v=N.useRef({}),[R,_]=N.useState(!1);te.useSidebarClick(h=>{var s;const a=(s=v.current)==null?void 0:s.handleOutClick;a&&a(h,()=>_(!1))});const T=N.useRef(n),C=N.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(o)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[o]);if(o===c.CFValueType.formula){const h=String(T.current).startsWith("=")?String(T.current)||"":"=";return x.jsx("div",{style:{width:"100%",marginLeft:12},children:x.jsx(ft.FormulaEditor,{initValue:h,unitId:p,subUnitId:b,isFocus:R,onChange:(a="")=>{e(a||"")},onFocus:()=>_(!0),actions:v.current})})}return x.jsx(oe.InputNumber,{className:r,value:Number(n)||0,disabled:u,onChange:h=>{e(h||0)},...C})},Zi=t=>{var L;const{interceptorManager:e}=t,r=te.useDependency(w.LocaleService),n=((L=t.rule)==null?void 0:L.type)===c.CFRuleType.dataBar?t.rule:void 0,[o,i]=N.useState(()=>{var F;const E="0";return n?(F=n.config)!=null&&F.isGradient?"1":"0":E}),[u,y]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||c.defaultDataBarPositiveColor}),[p,b]=N.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||c.defaultDataBarNativeColor}),v=[Le(c.CFValueType.num,r),Le(c.CFValueType.percent,r),Le(c.CFValueType.percentile,r),Le(c.CFValueType.formula,r)],R=[Le(c.CFValueType.min,r),...v],_=[Le(c.CFValueType.max,r),...v],[T,C]=N.useState(()=>{var F;const E=R[0].value;return n&&((F=n.config)==null?void 0:F.min.type)||E}),[I,h]=N.useState(()=>{var F;const E=_[0].value;return n&&((F=n.config)==null?void 0:F.max.type)||E}),[a,s]=N.useState(()=>{var z;if(!n)return 0;const F=((z=n.config)==null?void 0:z.min)||{};return F.type===c.CFValueType.formula?F.value||"=":F.value||0}),[d,S]=N.useState(()=>{var z;if(!n)return 100;const F=((z=n.config)==null?void 0:z.max)||{};return F.type===c.CFValueType.formula?F.value||"=":F.value===void 0?100:F.value}),[l,m]=N.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||c.defaultDataBarPositiveColor,nativeColor:E.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:E.isShowValue});N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return f({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}}),[o,a,T,d,I,u,p,e,l]);const g=E=>{t.onChange(f(E))},M=E=>{y(E),g({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:E,nativeColor:p,isShowValue:l})},j=E=>{b(E),g({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:E,isShowValue:l})},U=E=>v.map(F=>F.value).includes(E);return x.jsxs("div",{children:[x.jsx("div",{className:$.title,children:r.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
|
|
43
43
|
${k.cfPreviewWrap}
|
|
44
|
-
`,children:x.jsx(We,{rule:f({isGradient:o,minValue:a,minValueType:
|
|
44
|
+
`,children:x.jsx(We,{rule:f({isGradient:o,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})})}),x.jsxs("div",{children:[x.jsx("div",{className:$.label,children:r.t("sheet.cf.panel.fillType")}),x.jsxs("div",{className:`
|
|
45
45
|
${$.mTSm}
|
|
46
46
|
${$.mLXxs}
|
|
47
47
|
${$.labelContainer}
|
|
48
|
-
`,children:[x.jsxs(
|
|
48
|
+
`,children:[x.jsxs(oe.RadioGroup,{value:o,onChange:E=>{i(E),g({isGradient:E,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})},children:[x.jsx(oe.Radio,{value:"0",children:x.jsx("span",{className:k.text,children:r.t("sheet.cf.panel.pureColor")})}),x.jsx(oe.Radio,{value:"1",children:x.jsx("span",{className:k.text,children:r.t("sheet.cf.panel.gradient")})})]}),x.jsxs("div",{className:`
|
|
49
49
|
${k.utilItem}
|
|
50
50
|
${$.mLXl}
|
|
51
|
-
`,children:[x.jsx(
|
|
51
|
+
`,children:[x.jsx(oe.Checkbox,{checked:!l,onChange:E=>{m(!E),g({isGradient:E,minValue:a,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:!E})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),x.jsxs("div",{children:[x.jsx("div",{className:$.label,children:r.t("sheet.cf.panel.colorSet")}),x.jsxs("div",{className:`
|
|
52
52
|
${$.labelContainer}
|
|
53
53
|
${$.mTSm}
|
|
54
54
|
${$.mLXxs}
|
|
@@ -64,46 +64,46 @@
|
|
|
64
64
|
`,children:r.t("sheet.cf.panel.positive")}),x.jsx(Ne,{color:u,onChange:M})]})]})]}),x.jsxs("div",{children:[x.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.min")}),x.jsxs("div",{className:`
|
|
65
65
|
${$.mTSm}
|
|
66
66
|
${$.labelContainer}
|
|
67
|
-
`,children:[x.jsx(
|
|
67
|
+
`,children:[x.jsx(oe.Select,{style:{width:"50%",flexShrink:0},options:R,value:T,onChange:E=>{C(E);const F=c.createDefaultValueByValueType(E,10);s(F),g({isGradient:o,minValue:F,minValueType:E,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}}),x.jsx(Jn,{disabled:!U(T),id:"min",type:T,className:$.mLSm,value:a,onChange:E=>{s(E||0),g({isGradient:o,minValue:E||0,minValueType:T,maxValue:d,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),x.jsx("div",{className:$.label,children:r.t("sheet.cf.valueType.max")}),x.jsxs("div",{className:`
|
|
68
68
|
${$.mTSm}
|
|
69
69
|
${$.labelContainer}
|
|
70
|
-
`,children:[x.jsx(
|
|
70
|
+
`,children:[x.jsx(oe.Select,{style:{width:"50%",flexShrink:0},options:_,value:I,onChange:E=>{h(E);const F=c.createDefaultValueByValueType(E,90);S(F),g({isGradient:o,minValue:a,minValueType:T,maxValue:F,maxValueType:E,positiveColor:u,nativeColor:p,isShowValue:l})}}),x.jsx(Jn,{disabled:!U(I),id:"max",type:I,className:$.mLSm,value:d,onChange:E=>{S(E||0),g({isGradient:o,minValue:a,minValueType:T,maxValue:E||0,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})};function xr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e<o;e++)t[e]&&(r=xr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Tt(){for(var t,e,r=0,n="",o=arguments.length;r<o;r++)(t=arguments[r])&&(e=xr(t))&&(n&&(n+=" "),n+=e);return n}const Ji="univer-cf-style-edit",Qi="univer-button-item",ea="univer-isActive",we={cfStyleEdit:Ji,buttonItem:Qi,isActive:ea},It=t=>[w.BooleanNumber.FALSE,void 0].includes(t)?w.BooleanNumber.TRUE:w.BooleanNumber.FALSE,wt=t=>t!==w.BooleanNumber.FALSE,Sn=t=>{const{style:e,onChange:r,className:n}=t,o=te.useDependency(te.ComponentManager),[i,u]=N.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=N.useState(()=>{if(e!=null&&e.it)return e.it}),[b,v]=N.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[R,_]=N.useState(()=>{if(e!=null&&e.st)return e.st.s}),[T,C]=N.useState(()=>{var m;const l="#2f56ef";return(m=e==null?void 0:e.cl)!=null&&m.rgb?e.cl.rgb:l}),[I,h]=N.useState(()=>{var m;const l="#e8ecfc";return(m=e==null?void 0:e.bg)!=null&&m.rgb?e.bg.rgb:l}),a=o.get("BoldSingle"),s=o.get("ItalicSingle"),d=o.get("UnderlineSingle"),S=o.get("StrikethroughSingle");return N.useEffect(()=>{const l={bl:i,it:y};T!==void 0&&(l.cl={rgb:T}),I!==void 0&&(l.bg={rgb:I}),R!==void 0&&(l.st={s:R}),b!==void 0&&(l.ul={s:b}),r(c.removeUndefinedAttr(l))},[i,y,b,R,T,I]),x.jsxs("div",{className:`
|
|
71
71
|
${we.cfStyleEdit}
|
|
72
72
|
${n}
|
|
73
|
-
`,children:[a&&x.jsx("div",{className:Tt({[we.isActive]:wt(i||
|
|
73
|
+
`,children:[a&&x.jsx("div",{className:Tt({[we.isActive]:wt(i||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>u(It(i)),children:x.jsx(a,{})}),s&&x.jsx("div",{className:Tt({[we.isActive]:wt(y||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>p(It(y)),children:x.jsx(s,{})}),d&&x.jsx("div",{className:Tt({[we.isActive]:wt(b||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>v(It(b)),children:x.jsx(d,{})}),S&&x.jsx("div",{className:Tt({[we.isActive]:wt(R||w.BooleanNumber.FALSE)},we.buttonItem),onClick:()=>_(It(R)),children:x.jsx(S,{})}),x.jsx(Ne,{color:T,onChange:C,iconId:"FontColor"}),x.jsx(Ne,{color:I,onChange:h,iconId:"PaintBucket"})]})},ta=t=>{var S;const{onChange:e,interceptorManager:r}=t,n=te.useDependency(w.LocaleService),i=te.useDependency(w.IUniverInstanceService).getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),u=i.getActiveSheet(),y=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=N.useRef(null),[b,v]=N.useState(!1),R=N.useRef({}),[_,T]=N.useState({}),[C,I]=N.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,a]=N.useState(void 0),s=l=>({style:l.style,value:C,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});N.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:_,formula:C})}}),[_,C,r]),N.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(m,f,g)=>h||C.length===1||!C.startsWith("=")?(a(n.t("sheet.cf.errorMessage.formulaError")),!1):g(m)}),[h,C]);const d=l=>{e(s(l))};return te.useSidebarClick(l=>{var f;const m=(f=R.current)==null?void 0:f.handleOutClick;m&&m(l,()=>v(!1))}),x.jsxs("div",{ref:p,children:[x.jsx("div",{className:`
|
|
74
74
|
${$.title}
|
|
75
75
|
${$.mTBase}
|
|
76
76
|
`,children:n.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
|
|
77
77
|
${$.mTSm}
|
|
78
|
-
`,children:x.jsx(ft.FormulaEditor,{onChange:l=>{
|
|
78
|
+
`,children:x.jsx(ft.FormulaEditor,{onChange:l=>{I(l),d({style:_,formula:l})},onVerify:(l,m)=>{!l||m.length===1?a(n.t("sheet.cf.errorMessage.formulaError")):a(void 0)},errorText:h,onFocus:()=>{v(!0)},actions:R.current,isFocus:b,initValue:C,unitId:i.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),x.jsx("div",{className:`
|
|
79
79
|
${k.cfPreviewWrap}
|
|
80
|
-
`,children:x.jsx(We,{rule:s({style:_,formula:
|
|
80
|
+
`,children:x.jsx(We,{rule:s({style:_,formula:C})})}),x.jsx(Sn,{style:y==null?void 0:y.style,className:`
|
|
81
81
|
${$.mTSm}
|
|
82
|
-
`,onChange:l=>{
|
|
82
|
+
`,onChange:l=>{T(l),d({style:l,formula:C})}})]})},_t=t=>x.jsxs("div",{style:{position:"relative"},children:[x.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ue=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),na=t=>{const{type:e,operator:r,onChange:n,value:o,interceptorManager:i}=t,u=te.useDependency(w.LocaleService),[y,p]=N.useState(()=>typeof o=="number"?o:0),[b,v]=N.useState(""),[R,_]=N.useState(()=>typeof o=="string"?o:""),[T,C]=N.useState(""),[I,h]=N.useState(()=>Array.isArray(o)?o[0]===void 0?0:o[0]:0),[a,s]=N.useState(""),[d,S]=N.useState(()=>Array.isArray(o)?o[1]===void 0?100:o[1]:100),[l,m]=N.useState("");switch(N.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(R);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([I,d]);break}}},[e]),N.useEffect(()=>{const f=i.intercept(i.getInterceptPoints().beforeSubmit,{handler:(g,M,j)=>{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 R?j(g):(C(u.t("sheet.cf.errorMessage.notBlank")),!1)}return j(g)}});return()=>{f()}},[e,y,R,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=g=>{_(g),n(g)};return x.jsx("div",{className:`
|
|
83
83
|
${$.mTSm}
|
|
84
|
-
`,children:x.jsx(_t,{errorText:
|
|
84
|
+
`,children:x.jsx(_t,{errorText:T,children:x.jsx(oe.Input,{className:k.width100,value:R,onChange:g=>{C(""),f(g)}})})})}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=g=>{p(g||0),n(g||0),v("")};return x.jsx("div",{className:`
|
|
85
85
|
${$.mTSm}
|
|
86
|
-
`,children:x.jsx(_t,{errorText:
|
|
86
|
+
`,children:x.jsx(_t,{errorText:b,children:x.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:k.width100,value:y,onChange:f})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)){const f=M=>{h(M||0),n([M||0,d]),s("")},g=M=>{S(M||0),n([I,M||0]),m("")};return x.jsxs("div",{className:`
|
|
87
87
|
${$.mTSm}
|
|
88
88
|
${$.labelContainer}
|
|
89
|
-
`,children:[x.jsx(_t,{errorText:a,children:x.jsx(
|
|
89
|
+
`,children:[x.jsx(_t,{errorText:a,children:x.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:I,onChange:f})}),x.jsx(_t,{errorText:l,children:x.jsx(oe.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
90
90
|
${$.mLSm}
|
|
91
|
-
`,value:d,onChange:g})})]})}}}return null},Qn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[
|
|
91
|
+
`,value:d,onChange:g})})]})}}}return null},Qn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ue(c.CFTextOperator.containsText,e),ue(c.CFTextOperator.notContainsText,e),ue(c.CFTextOperator.beginsWith,e),ue(c.CFTextOperator.endsWith,e),ue(c.CFTextOperator.equal,e),ue(c.CFTextOperator.notEqual,e),ue(c.CFTextOperator.containsBlanks,e),ue(c.CFTextOperator.notContainsBlanks,e),ue(c.CFTextOperator.containsErrors,e),ue(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ue(c.CFNumberOperator.between,e),ue(c.CFNumberOperator.notBetween,e),ue(c.CFNumberOperator.equal,e),ue(c.CFNumberOperator.notEqual,e),ue(c.CFNumberOperator.greaterThan,e),ue(c.CFNumberOperator.greaterThanOrEqual,e),ue(c.CFNumberOperator.lessThan,e),ue(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ue(c.CFTimePeriodOperator.yesterday,e),ue(c.CFTimePeriodOperator.today,e),ue(c.CFTimePeriodOperator.tomorrow,e),ue(c.CFTimePeriodOperator.last7Days,e),ue(c.CFTimePeriodOperator.lastWeek,e),ue(c.CFTimePeriodOperator.thisWeek,e),ue(c.CFTimePeriodOperator.nextWeek,e),ue(c.CFTimePeriodOperator.lastMonth,e),ue(c.CFTimePeriodOperator.thisMonth,e),ue(c.CFTimePeriodOperator.nextMonth,e)]}},er=t=>{var S;const{interceptorManager:e,onChange:r}=t,n=te.useDependency(w.LocaleService),o=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?t.rule:void 0,[i,u]=N.useState(()=>{const l=c.CFSubRuleType.text;return o&&o.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=N.useMemo(()=>Qn(i,n),[i]),[b,v]=N.useState(()=>{const l=p?p[0].value:void 0;return o&&o.operator||l}),[R,_]=N.useState(()=>{var f;const l="";return o?(f=o.value)!=null?f:c.createDefaultValue(o.subType,o.operator):l}),[T,C]=N.useState({}),I=N.useMemo(()=>l=>{var m,f,g,M,j,U,L,E,F,z,B,X,ne,Q,H;switch(l.subType||i){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:(m=l.subType)!=null?m:i,operator:(f=l.operator)!=null?f:b,style:(g=l.style)!=null?g:T,value:(M=l.value)!=null?M:R};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:(j=l.subType)!=null?j:i,operator:(U=l.operator)!=null?U:b,style:(L=l.style)!=null?L:T,value:(E=l.value)!=null?E:R};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(b))return{type:c.CFRuleType.highlightCell,subType:(F=l.subType)!=null?F:i,operator:(z=l.operator)!=null?z:b,style:(B=l.style)!=null?B:T,value:(X=l.value)!=null?X:R};break}}return{type:c.CFRuleType.highlightCell,subType:(ne=l.subType)!=null?ne:i,operator:(Q=l.operator)!=null?Q:b,style:(H=l.style)!=null?H:T}},[i,b,R,T]);N.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return I({})}}),[I,e]),N.useEffect(()=>{y.some(l=>l.value===i)||u(y[0].value)},[y]);const h=l=>{const m=l,f=Qn(m,n),g=f&&f[0].value;u(m),v(g),g&&_(c.createDefaultValue(m,g)),r(I({subType:m,operator:g}))},a=l=>{const m=l;v(m),r(I({operator:m}))},s=l=>{_(l),r(I({value:l}))},d=N.useMemo(()=>`${i}_${b}_${Math.random()}`,[i,b]);return x.jsxs("div",{children:[x.jsx("div",{className:`
|
|
92
92
|
${$.title}
|
|
93
93
|
${$.mTBase}
|
|
94
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(
|
|
94
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(oe.Select,{className:`
|
|
95
95
|
${$.mTSm}
|
|
96
96
|
${k.width100}
|
|
97
|
-
`,onChange:h,value:i,options:
|
|
97
|
+
`,onChange:h,value:i,options:y}),(p==null?void 0:p.length)&&x.jsx(oe.Select,{className:`
|
|
98
98
|
${$.mTSm}
|
|
99
99
|
${k.width100}
|
|
100
|
-
`,onChange:a,value:
|
|
100
|
+
`,onChange:a,value:b||"",options:p}),x.jsx(na,{value:R,interceptorManager:e,type:i,operator:b,rule:o,onChange:s},d),x.jsx("div",{className:`
|
|
101
101
|
${k.cfPreviewWrap}
|
|
102
|
-
`,children:x.jsx(We,{rule:
|
|
102
|
+
`,children:x.jsx(We,{rule:I({})})}),x.jsx(Sn,{style:o==null?void 0:o.style,className:`
|
|
103
103
|
${$.mLXxs}
|
|
104
|
-
`,onChange:l=>{
|
|
104
|
+
`,onChange:l=>{C(l),r(I({style:l}))}})]})},Er=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",ra=t=>{var p;const e=te.useDependency(w.IUniverInstanceService),r=e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),o=N.useMemo(()=>t.error?k.errorInput:"",[t.error]),i=N.useRef({}),[u,y]=N.useState(!1);return te.useSidebarClick(b=>{var R;const v=(R=i.current)==null?void 0:R.handleOutClick;v&&v(b,()=>y(!1))}),x.jsx("div",{className:k.positionRelative,children:t.type!==c.CFValueType.formula?x.jsxs(x.Fragment,{children:[x.jsx(oe.InputNumber,{className:o,value:Number(t.value)||0,onChange:b=>t.onChange(b!=null?b:0)}),t.error&&x.jsx("div",{className:k.errorText,children:t.error})]}):x.jsx("div",{style:{width:"100%"},children:x.jsx(ft.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:u,onChange:(b="")=>{const v=b||"";t.onChange(v)},onFocus:()=>y(!0),actions:i.current})})})},tr=(t,e,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),oa=N.forwardRef((t,e)=>{const r=te.useDependency(w.LocaleService),n=o=>{t.onClick(o)};return x.jsx("div",{ref:e,className:k.iconGroupList,children:c.iconGroup.map((o,i)=>x.jsxs("div",{className:k.group,children:[x.jsx("div",{className:k.title,children:r.t(o.title)}),x.jsx("div",{className:k.itemContent,children:o.group.map(u=>x.jsx("div",{className:k.itemWrap,onClick:()=>{n(u.name)},children:x.jsx("div",{className:k.item,children:u.list.map((y,p)=>x.jsx("img",{className:k.icon,src:y},p))})},u.name))})]},i))})}),ia=t=>{const e=N.useMemo(()=>{const n=[];for(const o in c.iconMap){const i=c.iconMap[o],u=o;i.forEach((y,p)=>{n.push({iconType:u,base64:y,iconId:String(p)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return x.jsxs("div",{className:k.iconItemListWrap,children:[x.jsxs("div",{className:k.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[x.jsx(mt,{className:k.icon}),x.jsx("span",{children:"无单元格图标"})]}),x.jsx("div",{className:k.iconItemList,children:e.map(n=>x.jsx("div",{className:k.item,children:x.jsx("img",{onClick:()=>r(n),className:`
|
|
105
105
|
${k.icon}
|
|
106
|
-
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},aa=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=
|
|
106
|
+
`,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},aa=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,o=te.useDependency(w.LocaleService),i=[{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:o.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:o.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:o.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:o.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],y=(R,_)=>{e([String(_),"value","value"],R)},p=(R,_)=>{e([String(_),"operator"],R);const T=c.createDefaultValue(c.CFSubRuleType.number,R);y(T,_)},b=(R,_)=>{e([String(_),"value","type"],R);const T=r[_],C=c.createDefaultValue(c.CFSubRuleType.number,T.operator);y(C,_)};return N.useMemo(()=>r.map((R,_)=>{const T=n[_],C=Er(R.iconType,R.iconId),I=_===r.length-1,h=_===0,a=r[_-1],s=(a==null?void 0:a.value.type)===c.CFValueType.formula?o.t("sheet.cf.valueType.formula"):a==null?void 0:a.value.value,d=(S,l)=>{const m={...R,iconId:l,iconType:S};e([String(_)],m)};return x.jsxs("div",{className:`
|
|
107
107
|
${_?$.mTXl:$.mTSm}
|
|
108
108
|
`,children:[x.jsxs("div",{className:`
|
|
109
109
|
${$.label}
|
|
@@ -112,20 +112,20 @@
|
|
|
112
112
|
${k.width45}
|
|
113
113
|
`,children:[o.t("sheet.cf.iconSet.icon"),_+1]}),x.jsx("div",{className:`
|
|
114
114
|
${k.width45}
|
|
115
|
-
`,children:x.jsxs(x.Fragment,{children:[!h&&!
|
|
115
|
+
`,children:x.jsxs(x.Fragment,{children:[!h&&!I&&o.t("sheet.cf.iconSet.rule"),!h&&!I&&x.jsxs("span",{className:k.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${c.getOppositeOperator(a.operator)}`),s,I?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),x.jsxs("div",{className:`
|
|
116
116
|
${k.flex}
|
|
117
117
|
${$.mTSm}
|
|
118
118
|
`,children:[x.jsx("div",{className:`
|
|
119
119
|
${k.iconWrap}
|
|
120
120
|
${k.width45}
|
|
121
|
-
`,children:x.jsx(
|
|
121
|
+
`,children:x.jsx(oe.DropdownLegacy,{overlay:x.jsx(ia,{onClick:d,iconId:R.iconId,iconType:R.iconType}),children:x.jsxs("div",{className:k.dropdownIcon,children:[C?x.jsx("img",{src:C,className:k.icon}):x.jsx(mt,{className:k.icon}),x.jsx(At,{})]})})}),I?x.jsxs("div",{className:`
|
|
122
122
|
${k.width45}
|
|
123
123
|
${$.label}
|
|
124
|
-
`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),x.jsxs("span",{className:k.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${c.getOppositeOperator(a.operator)}`),s,
|
|
124
|
+
`,style:{marginTop:0},children:[o.t("sheet.cf.iconSet.rule"),x.jsxs("span",{className:k.stress,children:["(",o.t("sheet.cf.iconSet.when"),o.t(`sheet.cf.symbol.${c.getOppositeOperator(a.operator)}`),s,I?"":` ${o.t("sheet.cf.iconSet.and")} `,")"]})]}):x.jsx(oe.Select,{className:`
|
|
125
125
|
${$.mL0}
|
|
126
126
|
${k.width45}
|
|
127
127
|
${$.mR0}
|
|
128
|
-
`,options:i,value:
|
|
128
|
+
`,options:i,value:R.operator,onChange:S=>{p(S,_)}})]}),I?x.jsx("div",{}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:`
|
|
129
129
|
${$.mTSm}
|
|
130
130
|
${$.label}
|
|
131
131
|
${k.flex}
|
|
@@ -136,40 +136,40 @@
|
|
|
136
136
|
`,children:o.t("sheet.cf.iconSet.value")})]}),x.jsxs("div",{className:`
|
|
137
137
|
${$.mTSm}
|
|
138
138
|
${k.flex}
|
|
139
|
-
`,children:[x.jsx(
|
|
139
|
+
`,children:[x.jsx(oe.Select,{style:{flexShrink:0},className:`
|
|
140
140
|
${k.width45}
|
|
141
141
|
${$.mL0}
|
|
142
|
-
`,options:u,value:
|
|
142
|
+
`,options:u,value:R.value.type,onChange:S=>{b(S,_)}}),x.jsx("div",{className:`
|
|
143
143
|
${$.mL0}
|
|
144
144
|
${k.width45}
|
|
145
|
-
`,children:x.jsx(ra,{id:_,type:
|
|
145
|
+
`,children:x.jsx(ra,{id:_,type:R.value.type,error:T,value:R.value.value||"",onChange:S=>y(S,_)})})]})]})]},_)}),[r,n])},sa=t=>{var S;const{interceptorManager:e}=t,r=((S=t.rule)==null?void 0:S.type)===c.CFRuleType.iconSet?t.rule:void 0,n=te.useDependency(w.LocaleService),[o,i]=N.useState({}),[u,y]=N.useState(()=>{const l=Object.keys(c.iconMap)[0];if(r&&r.config.length){const m=r.config[0].iconType;if(!r.config.some(g=>g.iconType!==m))return m}return l}),[p,b]=N.useState(()=>{if(r&&r.config.length)return w.Tools.deepClone(r==null?void 0:r.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((m,f,g)=>f===g.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(f)}:tr(u,f,g))}),[v,R]=N.useState(()=>r?!!r.isShowValue:!0),_=N.useMemo(()=>{const l=p.map(m=>Er(m.iconType,m.iconId));return x.jsx("div",{className:k.iconWrap,children:l.map((m,f)=>m?x.jsx("img",{className:k.icon,src:m},f):x.jsx(mt,{className:k.icon},f))})},[p]),T=l=>{if(l.reduce((f,g,M)=>f.preType&&!f.result||l.length-1===M?f:g.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:f.preType?{result:f.preType===g.value.type,preType:g.value.type}:{result:!0,preType:g.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((g,M,j)=>{if(M-1<0||M===j.length-1)return;const L=l[M-1],E=c.getOppositeOperator(L.operator);c.compareWithNumber({operator:E,value:L.value.value},g.value.value)||(f[M]=`${n.t(`sheet.cf.form.${E}`,String(L.value.value))} `)}),f}return{}},C=(l,m)=>{w.get(p,l)!==m&&(w.set(p,l,m),b([...p]),i(T(p)))},I=l=>{y(l);const m=c.iconMap[l]||[],f=new Array(m.length).fill("").map((g,M,j)=>tr(l,M,j));b(f),i(T(f))};N.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:v,config:p}}});return()=>{l()}},[v,p,e]),N.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(o).length===0}});return()=>{l()}},[v,p,e,o]);const h=()=>{const l=p.map(m=>({...m}));p.forEach((m,f)=>{const g=p.length-1-f,M=l[g];m.iconId=M.iconId,m.iconType=M.iconType}),b([...p])},a=te.useDependency(te.ILayoutService),[s,d]=N.useState();return te.useScrollYOverContainer(s,a.rootContainerElement),x.jsxs("div",{className:k.iconSet,children:[x.jsx("div",{className:$.title,children:n.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
|
|
146
146
|
${$.mTSm}
|
|
147
|
-
`,children:x.jsx(
|
|
147
|
+
`,children:x.jsx(oe.DropdownLegacy,{placement:"bottomLeft",overlay:x.jsx(oa,{ref:l=>{!s&&l&&d(l)},iconType:u,onClick:I}),children:x.jsxs("div",{className:k.dropdownIcon,style:{width:"unset"},children:[_,x.jsx(At,{})]})})}),x.jsxs("div",{className:`
|
|
148
148
|
${$.mTSm}
|
|
149
149
|
${k.renderConfig}
|
|
150
|
-
`,children:[x.jsxs("div",{className:k.utilItem,children:[x.jsx(
|
|
150
|
+
`,children:[x.jsxs("div",{className:k.utilItem,children:[x.jsx(oe.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),x.jsxs("div",{className:`
|
|
151
151
|
${k.utilItem}
|
|
152
152
|
${$.mLXl}
|
|
153
|
-
`,children:[x.jsx(
|
|
153
|
+
`,children:[x.jsx(oe.Checkbox,{checked:!v,onChange:l=>{R(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),x.jsx(aa,{errorMap:o,onChange:C,configList:p})]})},la=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=te.useDependency(w.LocaleService),o=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,i=[{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]=N.useState(()=>{const a=i[0].value,s=o==null?void 0:o.type;if(!o)return a;switch(s){case c.CFRuleType.highlightCell:switch(o.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(o.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(o.operator)?"lessThanAverage":a;case c.CFSubRuleType.rank:return o.isBottom?"isBottom":"isNotBottom"}}return a}),[p,b]=N.useState(()=>{const s=o==null?void 0:o.type;if(!o)return 10;switch(s){case c.CFRuleType.highlightCell:switch(o.subType){case c.CFSubRuleType.rank:return o.value||10}}return 10}),[v,R]=N.useState(()=>{const s=o==null?void 0:o.type;if(!o)return!1;switch(s){case c.CFRuleType.highlightCell:switch(o.subType){case c.CFSubRuleType.rank:return o.isPercent||!1}}return!1}),[_,T]=N.useState({}),C=a=>{const{type:s,isPercent:d,value:S,style:l}=a;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}};N.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return C({type:u,isPercent:v,value:p,style:_})}}),[u,v,p,_,r]);const I=a=>{e(C(a))};return x.jsxs("div",{children:[x.jsx("div",{className:`
|
|
154
154
|
${$.title}
|
|
155
155
|
${$.mTBase}
|
|
156
|
-
`,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(
|
|
156
|
+
`,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(oe.Select,{className:`
|
|
157
157
|
${k.width100}
|
|
158
158
|
${$.mTSm}
|
|
159
|
-
`,value:u,options:i,onChange:a=>{
|
|
159
|
+
`,value:u,options:i,onChange:a=>{y(a),I({type:a,isPercent:v,value:p,style:_})}}),["isNotBottom","isBottom"].includes(u)&&x.jsxs("div",{className:`
|
|
160
160
|
${$.labelContainer}
|
|
161
161
|
${$.mTSm}
|
|
162
|
-
`,children:[x.jsx(
|
|
162
|
+
`,children:[x.jsx(oe.InputNumber,{min:1,max:1e3,value:p,onChange:a=>{const s=a||0;b(s),I({type:u,isPercent:v,value:s,style:_})}}),x.jsxs("div",{className:`
|
|
163
163
|
${$.mLSm}
|
|
164
164
|
${$.labelContainer}
|
|
165
165
|
${k.text}
|
|
166
|
-
`,children:[x.jsx(
|
|
166
|
+
`,children:[x.jsx(oe.Checkbox,{checked:v,onChange:a=>{R(!!a),I({type:u,isPercent:!!a,value:p,style:_})}}),n.t("sheet.cf.valueType.percent")]})]}),x.jsx("div",{className:`
|
|
167
167
|
${k.cfPreviewWrap}
|
|
168
|
-
`,children:x.jsx(We,{rule:
|
|
168
|
+
`,children:x.jsx(We,{rule:C({type:u,isPercent:v,value:p,style:_})})}),x.jsx(Sn,{style:o==null?void 0:o.style,className:`
|
|
169
169
|
${$.mTSm}
|
|
170
|
-
`,onChange:a=>{
|
|
170
|
+
`,onChange:a=>{T(a),I({type:u,isPercent:v,value:p,style:a})}})]})},ua=w.createInterceptorKey("beforeSubmit"),ca=w.createInterceptorKey("submit"),nr=t=>t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),rr=t=>{var e;return(e=t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},da=t=>{var j,U,L;const e=te.useDependency(w.LocaleService),r=te.useDependency(w.ICommandService),n=te.useDependency(w.IUniverInstanceService),o=te.useDependency(c.ConditionalFormattingRuleModel),i=te.useDependency(G.SheetsSelectionsService),u=nr(n),y=rr(n),[p,b]=N.useState(!0),v=N.useRef({}),[R,_]=N.useState(void 0),T=N.useRef((U=(j=t.rule)==null?void 0:j.ranges)!=null?U:[]),C=N.useMemo(()=>{var F,z,B;let E=(F=t.rule)==null?void 0:F.ranges;return E!=null&&E.length||(E=(B=(z=i.getCurrentSelections())==null?void 0:z.map(X=>X.range))!=null?B:[]),T.current=E,E!=null&&E.length?E.map(X=>{const ne=rn.serializeRange(X);return ne==="NaN"?"":ne}).filter(X=>!!X).join(","):""},[t.rule]),I=[{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,a]=N.useState(()=>{var z,B;const E=(z=t.rule)==null?void 0:z.rule.type,F=I[0].value;if(!E)return F;switch(E){case c.CFRuleType.highlightCell:{switch((B=t.rule)==null?void 0:B.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 F}),s=N.useRef(void 0),d=N.useMemo(()=>new w.InterceptorManager({beforeSubmit:ua,submit:ca}),[]),S=N.useMemo(()=>{switch(h){case"1":return er;case"2":return la;case"3":return Zi;case"4":return Ki;case"5":return ta;case"6":return sa;default:return er}},[h]);N.useEffect(()=>{const E=r.onCommandExecuted(F=>{if(F.id===G.RemoveSheetMutation.id){const z=F.params;z.subUnitId===y&&z.unitId===u&&t.onCancel()}F.id===G.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>E.dispose()},[]);const l=E=>{s.current=E},m=E=>{const F=E.split(",").filter(z=>!!z).map(rn.deserializeRangeWithSheet).map(z=>z.range);T.current=F},f=()=>{if(R)return;const F=(()=>{const B=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!B)throw new Error("No active sheet found");return T.current.map(Q=>G.setEndForRange(Q,B.getRowCount(),B.getColumnCount())).filter(Q=>!(Number.isNaN(Q.startRow)||Number.isNaN(Q.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const B=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(B){const X=nr(n),ne=rr(n);if(!X||!ne)throw new Error("No active sheet found");let Q={};t.rule&&t.rule.cfId?(Q={...t.rule,ranges:F,rule:B},r.executeCommand(zt.id,{unitId:X,subUnitId:ne,rule:Q}),t.onCancel()):(Q={cfId:o.createCfId(X,ne),ranges:F,rule:B,stopIfTrue:!1},r.executeCommand(pt.id,{unitId:X,subUnitId:ne,rule:Q}),t.onCancel())}}},g=()=>{t.onCancel()},M=(E,F)=>{E?F.length<1?_(e.t("sheet.cf.errorMessage.rangeError")):_(void 0):_(e.t("sheet.cf.errorMessage.rangeError"))};return te.useSidebarClick(E=>{var z;const F=(z=v.current)==null?void 0:z.handleOutClick;F&&F(E,()=>b(!1))}),x.jsxs("div",{className:k.cfRuleStyleEditor,children:[x.jsx("div",{className:$.title,children:e.t("sheet.cf.panel.range")}),x.jsx("div",{className:`
|
|
171
171
|
${$.mTBase}
|
|
172
|
-
`,children:x.jsx(ft.RangeSelector,{unitId:u,errorText:
|
|
172
|
+
`,children:x.jsx(ft.RangeSelector,{unitId:u,errorText:R,subUnitId:y,initValue:C,onChange:m,onVerify:M,onFocus:()=>b(!0),isFocus:p,actions:v.current})}),x.jsx("div",{className:$.title,children:e.t("sheet.cf.panel.styleType")}),x.jsx("div",{className:$.mTBase,children:x.jsx(oe.Select,{className:k.width100,value:h,options:I,onChange:E=>a(E)})}),x.jsx(S,{interceptorManager:d,rule:(L=t.rule)==null?void 0:L.rule,onChange:l}),x.jsxs("div",{className:`
|
|
173
173
|
${$.mTBase}
|
|
174
174
|
${k.btnList}
|
|
175
|
-
`,children:[x.jsx(re.Button,{size:"small",onClick:g,children:e.t("sheet.cf.panel.cancel")}),x.jsx(re.Button,{className:$.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},fa=t=>{const[e,r]=N.useState(t.rule),[n,o]=N.useState(!!t.rule),i=()=>{o(!0)},u=()=>{o(!1),r(void 0)},C=p=>{r(p),o(!0)};return x.jsx("div",{className:$.conditionalFormattingWrap,children:n?x.jsx(da,{onCancel:u,rule:e}):x.jsx(Si,{onClick:C,onCreate:i})})};var pa=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var o=n>1?void 0:n?ha(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&pa(e,r,o),o},Qe=(t,e)=>(r,n)=>e(r,n,t);const xt="sheet.conditional.formatting.panel";let st=class extends y.Disposable{constructor(e,r,n,o,i){super();_e(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(y.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var C;u||(C=this._sidebarDisposable)==null||C.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===xt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:xt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:xt,rule:e,key:y.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(xt,fa)}};st=ma([Qe(0,y.IUniverInstanceService),Qe(1,y.Inject(y.Injector)),Qe(2,y.Inject(me.ComponentManager)),Qe(3,y.Inject(me.ISidebarService)),Qe(4,y.Inject(y.LocaleService))],st);var ve=(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))(ve||{});const gt={id:"sheet.operation.open.conditional.formatting.panel",type:y.CommandType.OPERATION,handler:(t,e)=>{var C;const r=t.get(st),n=t.get(X.SheetsSelectionsService),o=t.get(y.ICommandService),i=((C=n.getCurrentSelections())==null?void 0:C.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 4:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(Vt.id,{ranges:i});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var ga=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var o=n>1?void 0:n?va(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&ga(e,r,o),o},et=(t,e)=>(r,n)=>e(r,n,t);let lt=class extends y.Disposable{constructor(e,r,n,o,i){super();_e(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,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,o)=>{const{copyType:i=ce.COPY_TYPE.COPY,pasteType:u}=o,{range:C}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:u,copyRange:C})}}))}_collectConditionalRule(e,r,n){const o=new y.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const u=this._injector.invoke(v=>ce.rangeToDiscreteRange(n,v,e,r));if(!u)return;const{rows:C,cols:p}=u,R=new Set;C.forEach((v,T)=>{p.forEach((_,I)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,r,v,_);S&&(S.forEach(w=>R.add(w.cfId)),o.setValue(T,I,S.map(w=>w.cfId)))})}),R.forEach(v=>{const T=this._conditionalFormattingRuleModel.getRule(e,r,v);T&&(i[v]=T.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const u=o.getSheetId();if(r.copyType===ce.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,ce.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,ce.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,R],mapFunc:v}=ce.virtualizeDiscreteRanges([r.copyRange,e]),T=ce.getRepeatRange(p,R,!0),_={};y.Range.foreach(R,(l,m)=>{const{row:f,col:g}=v(l,m),M=this._conditionalFormattingViewModel.getCellCfs(i,u,f,g);M&&M.forEach(j=>{if(!_[j.cfId]){const U=new y.ObjectMatrix;_[j.cfId]=U;const L=this._conditionalFormattingRuleModel.getRule(i,u,j.cfId);L==null||L.ranges.forEach(E=>{y.Range.foreach(E,(F,z)=>{U.setValue(F,z,1)})})}_[j.cfId].realDeleteValue(f,g)})});const{matrix:I,info:S}=this._copyInfo,w=[];let h=this._conditionalFormattingRuleModel.createCfId(i,u);const a={},s=l=>{if(a[l])return a[l];const m=S==null?void 0:S.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(i,u)||[],...w].find(g=>y.Tools.diffValue(g.rule,m));if(f)return a[l]=f,f;{const g={rule:m,cfId:h,ranges:[],stopIfTrue:!1};return a[l]=g,w.push(g),h=`${Number(h)+1}`,g}};T.forEach(l=>{I&&I.forValue((m,f,g)=>{const M=y.Rectangle.getPositionRange({startRow:m,endRow:m,startColumn:f,endColumn:f},l.startRange),{row:j,col:U}=v(M.startRow,M.startColumn);g.forEach(L=>{if(!_[L]){const E=s(L),F=new y.ObjectMatrix;_[L]=F,E.ranges.forEach(z=>{y.Range.foreach(z,(B,G)=>{F.setValue(B,G,1)})})}_[L].setValue(j,U,1)})})});const d=[],b=[];for(const l in _){const m=_[l],f=X.findAllRectangle(X.createTopMatrixFromMatrix(m));if(!f.length){const g={unitId:i,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:g}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}if(w.some(g=>g.cfId===l)){const g=s(l),M={unitId:i,subUnitId:u,rule:{...g,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:M}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,M))}else{const g=this._conditionalFormattingRuleModel.getRule(i,u,l);if(!g)continue;const M={unitId:i,subUnitId:u,rule:{...g,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:M}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,M))}}return{redos:d,undos:b}}};lt=ya([et(0,y.Inject(ce.ISheetClipboardService)),et(1,y.Inject(c.ConditionalFormattingRuleModel)),et(2,y.Inject(y.Injector)),et(3,y.Inject(c.ConditionalFormattingViewModel)),et(4,y.Inject(y.IUniverInstanceService))],lt);var Ca=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var o=n>1?void 0:n?Sa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ca(e,r,o),o},Qt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends y.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===pt.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[X.WorkbookEditablePermission],rangeTypes:[X.RangeProtectionPermissionEditPoint],worksheetTypes:[X.WorksheetEditPermission,X.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ut=ba([Qt(0,y.Inject(y.LocaleService)),Qt(1,y.ICommandService),Qt(2,y.Inject(X.SheetPermissionCheckController))],ut);var Ra=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ra(e,r,o),o},Et=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends y.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,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const u=p=>{const R=[...i.ranges],v=R.map(_=>X.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(c.isRangesEqual(v,R))return{redos:[],undos:[]};if(v.length){const _={unitId:n,subUnitId:o,rule:{...i,ranges:v}},I=[{id:c.SetConditionalRuleMutation.id,params:_}],S=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:S}}else{const _={unitId:n,subUnitId:o,cfId:i.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:_}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:S}}},C=[];i.ranges.forEach(p=>{const R=this._refRangeService.registerRefRange(p,u);C.push(()=>R.dispose())}),t.set(e(n,o,i.cfId),()=>C.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:u}=n,C=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),p=C.getActiveSheet();if(!(n.unitId!==C.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 R=t.get(e(o,i,u.cfId));R&&R();break}case"set":{const R=t.get(e(o,i,u.cfId));R&&R(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(y.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ct=Ia([Et(0,y.Inject(c.ConditionalFormattingRuleModel)),Et(1,y.Inject(y.IUniverInstanceService)),Et(2,y.Inject(y.Injector)),Et(3,y.Inject(X.RefRangeService))],ct);var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?_a(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&wa(e,r,o),o},Ue=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends y.Disposable{constructor(e,r,n,o,i,u){super();_e(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(ce.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(be.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(it.bufferTime(16),it.filter(e=>!!e.length),it.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(X.INTERCEPTOR_POINT.CELL_CONTENT,{effect:y.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),C={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:C};return o.style&&Object.assign(C,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};dt=xa([Ue(0,y.Inject(X.SheetInterceptorService)),Ue(1,y.Inject(c.ConditionalFormattingService)),Ue(2,y.Inject(y.IUniverInstanceService)),Ue(3,y.Inject(ur.IRenderManagerService)),Ue(4,y.Inject(c.ConditionalFormattingViewModel)),Ue(5,y.Inject(c.ConditionalFormattingRuleModel))],dt);const Or="sheets-conditional-formatting-ui.config",Ft={};var Pr=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Oa=(t,e,r)=>e in t?Pr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ea(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Pr(e,r,o),o},en=(t,e)=>(r,n)=>e(r,n,t),Mr=(t,e,r)=>Oa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends y.Plugin{constructor(e=Ft,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...u}=y.merge({},Ft,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ct]),this._injector.add([lt]),this._injector.add([ut]),this._injector.add([ze])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,zt,$t,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",y.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=Pa([y.DependentOn(c.UniverSheetsConditionalFormattingPlugin),en(1,y.Inject(y.Injector)),en(2,y.Inject(y.ICommandService)),en(3,y.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var Ma=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Da=(t,e,r,n)=>{for(var o=n>1?void 0:n?Fa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ma(e,r,o),o},tt=(t,e)=>(r,n)=>e(r,n,t);let Dt=class extends y.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,u,C,p)=>{var I;const R=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=(I=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!R||!v)return;const T={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},_={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};y.Range.foreach(u,(S,w)=>{const h=y.Rectangle.getPositionRange({startRow:S,startColumn:w,endColumn:w,endRow:S},T),a=y.Rectangle.getPositionRange({startRow:S,startColumn:w,endColumn:w,endRow:S},_),{row:s,col:d}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(R,v,s,d),{row:l,col:m}=p(a.startRow,a.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(R,v,l,m);f&&f.forEach(g=>{let M=C.get(g.cfId);if(!C.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,v,g.cfId);if(!j)return;M=new y.ObjectMatrix,j.ranges.forEach(U=>{y.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),C.set(g.cfId,M)}M.realDeleteValue(l,m)}),b&&b.forEach(g=>{let M=C.get(g.cfId);if(!C.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(R,v,g.cfId);if(!j)return;M=new y.ObjectMatrix,j.ranges.forEach(U=>{y.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),C.set(g.cfId,M)}M.setValue(l,m,1)})})},r=(o,i)=>{var a,s,d;const u=(a=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),C=(d=(s=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,R=[],v=[];if(!u||!C)return t();const T=ce.virtualizeDiscreteRanges([o,i]),[_,I]=T.ranges,{mapFunc:S}=T,w={row:_.startRow,col:_.startColumn};return ce.getAutoFillRepeatRange(_,I).forEach(b=>{e(w,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const m=this._conditionalFormattingRuleModel.getRule(u,C,l);if(!m)return;const f=X.findAllRectangle(X.createTopMatrixFromMatrix(b));if(f.length){const g={unitId:u,subUnitId:C,rule:{...m,ranges:f}};R.push({id:c.SetConditionalRuleMutation.id,params:g}),v.push(...c.setConditionalRuleMutationUndoFactory(this._injector,g))}else{const g={unitId:u,subUnitId:C,cfId:m.cfId};R.push({id:c.DeleteConditionalRuleMutation.id,params:g}),v.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}}),{undos:v,redos:R}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,u)=>{if(u===ce.APPLY_TYPE.COPY||u===ce.APPLY_TYPE.ONLY_FORMAT||u===ce.APPLY_TYPE.SERIES){const{source:C,target:p}=o;return r(C,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Dt=Da([tt(0,y.Inject(y.Injector)),tt(1,y.Inject(y.IUniverInstanceService)),tt(2,y.Inject(ce.IAutoFillService)),tt(3,y.Inject(c.ConditionalFormattingRuleModel)),tt(4,y.Inject(c.ConditionalFormattingViewModel))],Dt);var Na=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,La=(t,e,r,n)=>{for(var o=n>1?void 0:n?ja(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Na(e,r,o),o},nt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends y.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([X.ClearSelectionFormatCommand.id,X.ClearSelectionAllCommand.id].includes(e.id)){const u=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(S=>S.range);if(!u)return o;const C=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),p=C.getActiveSheet();if(!p)return o;const R=C.getUnitId(),v=p.getSheetId(),T=this._conditionalFormattingRuleModel.getSubunitRules(R,v);if(!T||!T.length)return o;const{redos:_,undos:I}=or(this._injector,T,u,R,v);r.push(..._),n.push(...I)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],u={redos:o,undos:i};if(!n||!n.length)return u;const C=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!C||!C.length)return u;const{redos:p,undos:R}=or(this._injector,C,n,e,r);return o.push(...p),i.push(...R),u}}))}};exports.ConditionalFormattingClearController=La([nt(0,y.Inject(y.Injector)),nt(1,y.Inject(y.IUniverInstanceService)),nt(2,y.Inject(X.SheetInterceptorService)),nt(3,y.Inject(X.SheetsSelectionsService)),nt(4,y.Inject(c.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function or(t,e,r,n,o){const i=[],u=[];return e.filter(C=>r.some(p=>C.ranges.some(R=>y.Rectangle.getIntersects(R,p)))).forEach(C=>{const R=new X.RangeMergeUtil().add(...C.ranges).subtract(...r).merge();if(R.length){const v={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...C,ranges:R}}},T=c.setConditionalRuleMutationUndoFactory(t,v.params);i.push(v),u.push(...T)}else{const v={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:C.cfId}},T=c.DeleteConditionalRuleMutationUndoFactory(t,v.params);i.push(v),u.push(...T)}}),{redos:i,undos:u}}var Ua=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,$a=(t,e,r,n)=>{for(var o=n>1?void 0:n?Va(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ua(e,r,o),o},ir=(t,e)=>(r,n)=>e(r,n,t);let Nt=class extends y.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(y.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(X.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var u,C,p;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),o=(u=n==null?void 0:n.style)!=null?u:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(C=t.p.body)==null?void 0:C.textRuns)==null||p.forEach(R=>{R.ts&&i.forEach(v=>{var T;(T=R.ts)==null||delete T[v]})}),r(t);{const R={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(T=>{delete R[T]});const v={...t,s:{...R}};return r(v)}}})))}};Nt=$a([ir(0,y.Inject(X.SheetInterceptorService)),ir(1,y.Inject(c.ConditionalFormattingService))],Nt);const ar=[X.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],rt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],za=t=>{const e=t.get(X.SheetsSelectionsService),r=t.get(y.ICommandService),n=t.get(y.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),i=new be.Observable(p=>be.merge(e.selectionMoveEnd$,e.selectionSet$,new be.Observable(R=>{const v=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,S=(w=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();ar.includes(_)&&I.unitId===S&&R.next(null)});return()=>v.dispose()})).pipe(it.debounceTime(16)).subscribe(()=>{var w;const R=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],v=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET);if(!v)return;const T=v.getActiveSheet();if(!T)return;const S=(o.getSubunitRules(v.getUnitId(),T.getSheetId())||[]).filter(h=>h.ranges.some(a=>R.some(s=>y.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>X.checkRangesEditablePermission(t,v.getUnitId(),T.getSheetId(),h));p.next(S)})),u=new be.Observable(p=>new be.Observable(R=>{const v=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,S=(w=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();ar.includes(_)&&I.unitId===S&&R.next(null)});return()=>v.dispose()}).pipe(it.debounceTime(16)).subscribe(()=>{const R=n.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET);if(!R)return;const v=R.getActiveSheet();if(!v)return;const T=o.getSubunitRules(R.getUnitId(),v.getSheetId())||[];if(!T.length)return p.next(!1),!1;const _=T.map(I=>I.ranges).every(I=>X.checkRangesEditablePermission(t,R.getUnitId(),v.getSheetId(),I));p.next(_)})),C=new be.Observable(p=>{i.subscribe(R=>{const v=rt.find(T=>T.value===ve.clearRangeRules);v&&(v.disabled=!R,p.next(rt))}),u.subscribe(R=>{const v=rt.find(T=>T.value===ve.clearWorkSheetRules);v&&(v.disabled=!R,p.next(rt))}),p.next(rt)});return{id:gt.id,type:me.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:C,hidden$:me.getMenuHiddenObservable(t,y.UniverInstanceType.UNIVER_SHEET),disabled$:ce.getCurrentRangeDisable$(t,{workbookTypes:[X.WorkbookEditablePermission],worksheetTypes:[X.WorksheetSetCellStylePermission,X.WorksheetEditPermission],rangeTypes:[X.RangeProtectionPermissionEditPoint]})}},Aa={[me.RibbonStartGroup.FORMULAS_INSERT]:{[gt.id]:{order:0,menuItemFactory:za}}};var qa=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Ha=(t,e,r,n)=>{for(var o=n>1?void 0:n?Wa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&qa(e,r,o),o},sr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends y.Disposable{constructor(e,r){super();_e(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Aa)}};jt=Ha([sr(0,y.Inject(y.Injector)),sr(1,me.IMenuManagerService)],jt);var ka=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,Ga=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ba(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&ka(e,r,o),o},Ve=(t,e)=>(r,n)=>e(r,n,t);const Xa=(t,e)=>{const r=v=>v.endRow-v.startRow+1,n=v=>v.endColumn-v.startColumn+1,o=r(e)%r(t),i=n(e)%n(t),u=Math.floor(r(e)/r(t)),C=Math.floor(n(e)/n(t)),p=[],R={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const v={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:R,startRange:v}),p}for(let v=0;v<u+(o?.1:0);v++)for(let T=0;T<C+(i?.1:0);T++){const _=r(t)*v,I=n(t)*T,S={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=R;v===u&&o&&(w={...w},w.endRow=w.endRow-(r(t)-o)),T===C&&i&&(w={...w},w.endColumn=w.endColumn-(n(t)-i)),p.push({repeatRelativeRange:w,startRange:S})}return p};let Lt=class extends y.Disposable{constructor(e,r,n,o,i,u){super();_e(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,u,C,p,R)=>{const{unitId:v,subUnitId:T}=this._painterConfig,{targetUnitId:_,targetSubUnitId:I}=R,S={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},w={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};y.Range.foreach(C,(h,a)=>{const s=y.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},S),d=y.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},w),b=this._conditionalFormattingViewModel.getCellCfs(v,T,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,I,d.startRow,d.startColumn);l&&l.forEach(m=>{let f=p.get(m.cfId);if(!p.get(m.cfId)){const g=this._conditionalFormattingRuleModel.getRule(_,I,m.cfId);if(!g)return;f=new y.ObjectMatrix,g.ranges.forEach(M=>{y.Range.foreach(M,(j,U)=>{f.setValue(j,U,1)})}),p.set(m.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),b&&b.forEach(m=>{const f=p.get(m.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(i,u,C)=>{var s;const{range:p,unitId:R,subUnitId:v}=this._painterConfig,T=i!==R||v!==u,_=new Map,I=[],S=[];if(!i||!u||!R||!v)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(R,v))!=null?s:[];w==null||w.forEach(d=>{const{ranges:b,cfId:l}=d;if(b.some(m=>y.Rectangle.intersects(p,m))){const m=new y.ObjectMatrix;T||b.forEach(f=>{y.Range.foreach(f,(g,M)=>{m.setValue(g,M,1)})}),_.set(l,m)}});const h={row:p.startRow,col:p.startColumn};return Xa(p,C).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:i,targetSubUnitId:u})}),_.forEach((d,b)=>{if(T){const l=this._conditionalFormattingRuleModel.getRule(i,u,b),m=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(l)if(m.length){const f={unitId:i,subUnitId:u,rule:{...l,ranges:m}};I.push({id:c.SetConditionalRuleMutation.id,params:f}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:i,subUnitId:u,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:f}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(m.length){const f=this._conditionalFormattingRuleModel.getRule(R,v,b);if(f){const g={unitId:i,subUnitId:u,rule:{...y.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(i,u),ranges:m}};I.push({id:c.AddConditionalRuleMutation.id,params:g}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,g))}}}else{const l=this._conditionalFormattingRuleModel.getRule(R,v,b);if(!l)return;const m=X.findAllRectangle(X.createTopMatrixFromMatrix(d));if(m.length){const f={unitId:R,subUnitId:v,rule:{...l,ranges:m}};I.push({id:c.SetConditionalRuleMutation.id,params:f}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:R,subUnitId:v,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:f}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:S,redos:I}},o={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var u,C,p;switch(i){case ce.FormatPainterStatus.INFINITE:case ce.FormatPainterStatus.ONCE:{const R=(u=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),v=(p=(C=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET))==null?void 0:C.getActiveSheet())==null?void 0:p.getSheetId(),T=this._sheetsSelectionsService.getCurrentLastSelection(),_=T==null?void 0:T.range;R&&v&&_&&(this._painterConfig={unitId:R,subUnitId:v,range:_});break}case ce.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,u,C)=>this._painterConfig?n(i,u,C):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Lt=Ga([Ve(0,y.Inject(y.Injector)),Ve(1,y.Inject(y.IUniverInstanceService)),Ve(2,y.Inject(ce.IFormatPainterService)),Ve(3,y.Inject(X.SheetsSelectionsService)),Ve(4,y.Inject(c.ConditionalFormattingRuleModel)),Ve(5,y.Inject(c.ConditionalFormattingViewModel))],Lt);var Ya=Object.defineProperty,Ka=Object.getOwnPropertyDescriptor,Za=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ka(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ya(e,r,o),o},tn=(t,e)=>(r,n)=>e(r,n,t);let Ut=class extends y.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(y.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(ce.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(u=>{if(u){const C=u.skeleton.rowColumnSegment,p=C.endColumn-C.startColumn+1,v=(C.endRow-C.startRow+1)*p*9,T=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,v);this._conditionalFormattingViewModel.setCacheLength(T)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(y.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ut=Za([tn(0,y.Inject(c.ConditionalFormattingViewModel)),tn(1,y.IUniverInstanceService),tn(2,ur.IRenderManagerService)],Ut);var Fr=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r)=>e in t?Fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,es=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ja(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Fr(e,r,o),o},nn=(t,e)=>(r,n)=>e(r,n,t),Dr=(t,e,r)=>Qa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends y.Plugin{constructor(e=Ft,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...u}=y.merge({},Ft,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,u),this._initCommand()}onStarting(){y.registerDependencies(this._injector,[[dt],[ct],[lt],[Dt],[ut],[st],[jt],[ze],[Nt],[exports.ConditionalFormattingClearController],[Lt],[Ut]]),y.touchDependencies(this._injector,[[dt]])}onReady(){y.touchDependencies(this._injector,[[jt],[st]])}onRendered(){y.touchDependencies(this._injector,[[Dt],[exports.ConditionalFormattingClearController],[lt],[Nt],[ze],[Lt],[ut],[ct],[Ut]])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,zt,$t,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Dr(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Dr(exports.UniverSheetsConditionalFormattingUIPlugin,"type",y.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=es([y.DependentOn(c.UniverSheetsConditionalFormattingPlugin),nn(1,y.Inject(y.Injector)),nn(2,y.Inject(y.ICommandService)),nn(3,y.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=an;exports.AddCfCommand=pt;exports.AddColorScaleConditionalRuleCommand=sn;exports.AddDataBarConditionalRuleCommand=ln;exports.AddDuplicateValuesCfCommand=un;exports.AddNumberCfCommand=cn;exports.AddRankCfCommand=dn;exports.AddTextCfCommand=fn;exports.AddTimePeriodCfCommand=pn;exports.AddUniqueValuesCfCommand=hn;exports.ClearRangeCfCommand=Vt;exports.ClearWorksheetCfCommand=ht;exports.DeleteCfCommand=at;exports.MoveCfCommand=$t;exports.OpenConditionalFormattingOperator=gt;exports.SetCfCommand=zt;
|
|
175
|
+
`,children:[x.jsx(oe.Button,{size:"small",onClick:g,children:e.t("sheet.cf.panel.cancel")}),x.jsx(oe.Button,{className:$.mLSm,size:"small",type:"primary",onClick:f,children:e.t("sheet.cf.panel.submit")})]})]})},fa=t=>{const[e,r]=N.useState(t.rule),[n,o]=N.useState(!!t.rule),i=()=>{o(!0)},u=()=>{o(!1),r(void 0)},y=p=>{r(p),o(!0)};return x.jsx("div",{className:$.conditionalFormattingWrap,children:n?x.jsx(da,{onCancel:u,rule:e}):x.jsx(Si,{onClick:y,onCreate:i})})};var pa=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,ma=(t,e,r,n)=>{for(var o=n>1?void 0:n?ha(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&pa(e,r,o),o},Qe=(t,e)=>(r,n)=>e(r,n,t);const xt="sheet.conditional.formatting.panel";let st=class extends w.Disposable{constructor(e,r,n,o,i){super();_e(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=o,this._localeService=i,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===xt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:xt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:xt,rule:e,key:w.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(xt,fa)}};st=ma([Qe(0,w.IUniverInstanceService),Qe(1,w.Inject(w.Injector)),Qe(2,w.Inject(te.ComponentManager)),Qe(3,w.Inject(te.ISidebarService)),Qe(4,w.Inject(w.LocaleService))],st);var ve=(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))(ve||{});const gt={id:"sheet.operation.open.conditional.formatting.panel",type:w.CommandType.OPERATION,handler:(t,e)=>{var y;const r=t.get(st),n=t.get(G.SheetsSelectionsService),o=t.get(w.ICommandService),i=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 4:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:i,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:i});break}case 9:{o.executeCommand(Vt.id,{ranges:i});break}case 10:{o.executeCommand(ht.id);break}}return!0}};var ga=Object.defineProperty,va=Object.getOwnPropertyDescriptor,ya=(t,e,r,n)=>{for(var o=n>1?void 0:n?va(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&ga(e,r,o),o},et=(t,e)=>(r,n)=>e(r,n,t);let lt=class extends w.Disposable{constructor(e,r,n,o,i){super();_e(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=o,this._univerInstanceService=i,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,o)=>{const{copyType:i=de.COPY_TYPE.COPY,pasteType:u}=o,{range:y}=e||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:i,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,r,n){const o=new w.ObjectMatrix,i={};this._copyInfo={matrix:o,info:{unitId:e,subUnitId:r,cfMap:i}};const u=this._injector.invoke(v=>de.rangeToDiscreteRange(n,v,e,r));if(!u)return;const{rows:y,cols:p}=u,b=new Set;y.forEach((v,R)=>{p.forEach((_,T)=>{const C=this._conditionalFormattingViewModel.getCellCfs(e,r,v,_);C&&(C.forEach(I=>b.add(I.cfId)),o.setValue(R,T,C.map(I=>I.cfId)))})}),b.forEach(v=>{const R=this._conditionalFormattingRuleModel.getRule(e,r,v);R&&(i[v]=R.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),o=n.getActiveSheet(),i=n.getUnitId();if(!o)return{redos:[],undos:[]};const u=o.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,b],mapFunc:v}=de.virtualizeDiscreteRanges([r.copyRange,e]),R=de.getRepeatRange(p,b,!0),_={};w.Range.foreach(b,(l,m)=>{const{row:f,col:g}=v(l,m),M=this._conditionalFormattingViewModel.getCellCfs(i,u,f,g);M&&M.forEach(j=>{if(!_[j.cfId]){const U=new w.ObjectMatrix;_[j.cfId]=U;const L=this._conditionalFormattingRuleModel.getRule(i,u,j.cfId);L==null||L.ranges.forEach(E=>{w.Range.foreach(E,(F,z)=>{U.setValue(F,z,1)})})}_[j.cfId].realDeleteValue(f,g)})});const{matrix:T,info:C}=this._copyInfo,I=[];let h=this._conditionalFormattingRuleModel.createCfId(i,u);const a={},s=l=>{if(a[l])return a[l];const m=C==null?void 0:C.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(i,u)||[],...I].find(g=>w.Tools.diffValue(g.rule,m));if(f)return a[l]=f,f;{const g={rule:m,cfId:h,ranges:[],stopIfTrue:!1};return a[l]=g,I.push(g),h=`${Number(h)+1}`,g}};R.forEach(l=>{T&&T.forValue((m,f,g)=>{const M=w.Rectangle.getPositionRange({startRow:m,endRow:m,startColumn:f,endColumn:f},l.startRange),{row:j,col:U}=v(M.startRow,M.startColumn);g.forEach(L=>{if(!_[L]){const E=s(L),F=new w.ObjectMatrix;_[L]=F,E.ranges.forEach(z=>{w.Range.foreach(z,(B,X)=>{F.setValue(B,X,1)})})}_[L].setValue(j,U,1)})})});const d=[],S=[];for(const l in _){const m=_[l],f=G.findAllRectangle(G.createTopMatrixFromMatrix(m));if(!f.length){const g={unitId:i,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:g}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}if(I.some(g=>g.cfId===l)){const g=s(l),M={unitId:i,subUnitId:u,rule:{...g,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:M}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,M))}else{const g=this._conditionalFormattingRuleModel.getRule(i,u,l);if(!g)continue;const M={unitId:i,subUnitId:u,rule:{...g,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:M}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,M))}}return{redos:d,undos:S}}};lt=ya([et(0,w.Inject(de.ISheetClipboardService)),et(1,w.Inject(c.ConditionalFormattingRuleModel)),et(2,w.Inject(w.Injector)),et(3,w.Inject(c.ConditionalFormattingViewModel)),et(4,w.Inject(w.IUniverInstanceService))],lt);var Ca=Object.defineProperty,Sa=Object.getOwnPropertyDescriptor,ba=(t,e,r,n)=>{for(var o=n>1?void 0:n?Sa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ca(e,r,o),o},Qt=(t,e)=>(r,n)=>e(r,n,t);let ut=class extends w.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===pt.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[G.WorkbookEditablePermission],rangeTypes:[G.RangeProtectionPermissionEditPoint],worksheetTypes:[G.WorksheetEditPermission,G.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ut=ba([Qt(0,w.Inject(w.LocaleService)),Qt(1,w.ICommandService),Qt(2,w.Inject(G.SheetPermissionCheckController))],ut);var Ra=Object.defineProperty,Ta=Object.getOwnPropertyDescriptor,Ia=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ta(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ra(e,r,o),o},Et=(t,e)=>(r,n)=>e(r,n,t);let ct=class extends w.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,o,i)=>`${n}_${o}_${i}`,r=(n,o,i)=>{const u=p=>{const b=[...i.ranges],v=b.map(_=>G.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(c.isRangesEqual(v,b))return{redos:[],undos:[]};if(v.length){const _={unitId:n,subUnitId:o,rule:{...i,ranges:v}},T=[{id:c.SetConditionalRuleMutation.id,params:_}],C=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:T,undos:C}}else{const _={unitId:n,subUnitId:o,cfId:i.cfId},T=[{id:c.DeleteConditionalRuleMutation.id,params:_}],C=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:T,undos:C}}},y=[];i.ranges.forEach(p=>{const b=this._refRangeService.registerRefRange(p,u);y.push(()=>b.dispose())}),t.set(e(n,o,i.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:o,subUnitId:i,rule:u}=n,y=this._univerInstanceService.getCurrentUnitForType(w.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(o,i,u.cfId));b&&b();break}case"set":{const b=t.get(e(o,i,u.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(w.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ct=Ia([Et(0,w.Inject(c.ConditionalFormattingRuleModel)),Et(1,w.Inject(w.IUniverInstanceService)),Et(2,w.Inject(w.Injector)),Et(3,w.Inject(G.RefRangeService))],ct);var wa=Object.defineProperty,_a=Object.getOwnPropertyDescriptor,xa=(t,e,r,n)=>{for(var o=n>1?void 0:n?_a(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&wa(e,r,o),o},Ue=(t,e)=>(r,n)=>e(r,n,t);let dt=class extends w.Disposable{constructor(e,r,n,o,i,u){super();_e(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=o,this._conditionalFormattingViewModel=i,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,o;const e=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(o=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||o.makeDirty()}_initSkeleton(){this.disposeWithMe(be.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(it.bufferTime(16),it.filter(e=>!!e.length),it.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(o=>o.unitId===r.getUnitId()&&o.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(G.INTERCEPTOR_POINT.CELL_CONTENT,{effect:w.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const o=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!o)return n(e);const i=r.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?i.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return o.style&&Object.assign(y,o.style),p.fontRenderExtension||(p.fontRenderExtension={},o.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!o.isShowValue)),o.dataBar&&(p.dataBar=o.dataBar),o.iconSet&&(p.iconSet=o.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};dt=xa([Ue(0,w.Inject(G.SheetInterceptorService)),Ue(1,w.Inject(c.ConditionalFormattingService)),Ue(2,w.Inject(w.IUniverInstanceService)),Ue(3,w.Inject(ur.IRenderManagerService)),Ue(4,w.Inject(c.ConditionalFormattingViewModel)),Ue(5,w.Inject(c.ConditionalFormattingRuleModel))],dt);const Or="sheets-conditional-formatting-ui.config",Ft={};var Pr=Object.defineProperty,Ea=Object.getOwnPropertyDescriptor,Oa=(t,e,r)=>e in t?Pr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Pa=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ea(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Pr(e,r,o),o},en=(t,e)=>(r,n)=>e(r,n,t),Mr=(t,e,r)=>Oa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingMobileUIPlugin=class extends w.Plugin{constructor(e=Ft,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...u}=w.merge({},Ft,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ct]),this._injector.add([lt]),this._injector.add([ut]),this._injector.add([ze])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,zt,$t,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`);Mr(exports.UniverSheetsConditionalFormattingMobileUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingMobileUIPlugin=Pa([w.DependentOn(c.UniverSheetsConditionalFormattingPlugin),en(1,w.Inject(w.Injector)),en(2,w.Inject(w.ICommandService)),en(3,w.IConfigService)],exports.UniverSheetsConditionalFormattingMobileUIPlugin);var Ma=Object.defineProperty,Fa=Object.getOwnPropertyDescriptor,Da=(t,e,r,n)=>{for(var o=n>1?void 0:n?Fa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ma(e,r,o),o},tt=(t,e)=>(r,n)=>e(r,n,t);let Dt=class extends w.Disposable{constructor(t,e,r,n,o){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=o,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(o,i,u,y,p)=>{var T;const b=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),v=(T=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId();if(!b||!v)return;const R={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},_={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row};w.Range.foreach(u,(C,I)=>{const h=w.Rectangle.getPositionRange({startRow:C,startColumn:I,endColumn:I,endRow:C},R),a=w.Rectangle.getPositionRange({startRow:C,startColumn:I,endColumn:I,endRow:C},_),{row:s,col:d}=p(h.startRow,h.startColumn),S=this._conditionalFormattingViewModel.getCellCfs(b,v,s,d),{row:l,col:m}=p(a.startRow,a.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(b,v,l,m);f&&f.forEach(g=>{let M=y.get(g.cfId);if(!y.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(b,v,g.cfId);if(!j)return;M=new w.ObjectMatrix,j.ranges.forEach(U=>{w.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),y.set(g.cfId,M)}M.realDeleteValue(l,m)}),S&&S.forEach(g=>{let M=y.get(g.cfId);if(!y.get(g.cfId)){const j=this._conditionalFormattingRuleModel.getRule(b,v,g.cfId);if(!j)return;M=new w.ObjectMatrix,j.ranges.forEach(U=>{w.Range.foreach(U,(L,E)=>{M.setValue(L,E,1)})}),y.set(g.cfId,M)}M.setValue(l,m,1)})})},r=(o,i)=>{var a,s,d;const u=(a=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:a.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,b=[],v=[];if(!u||!y)return t();const R=de.virtualizeDiscreteRanges([o,i]),[_,T]=R.ranges,{mapFunc:C}=R,I={row:_.startRow,col:_.startColumn};return de.getAutoFillRepeatRange(_,T).forEach(S=>{e(I,S.repeatStartCell,S.relativeRange,p,C)}),p.forEach((S,l)=>{const m=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!m)return;const f=G.findAllRectangle(G.createTopMatrixFromMatrix(S));if(f.length){const g={unitId:u,subUnitId:y,rule:{...m,ranges:f}};b.push({id:c.SetConditionalRuleMutation.id,params:g}),v.push(...c.setConditionalRuleMutationUndoFactory(this._injector,g))}else{const g={unitId:u,subUnitId:y,cfId:m.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:g}),v.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,g))}}),{undos:v,redos:b}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(o,i,u)=>{if(u===de.APPLY_TYPE.COPY||u===de.APPLY_TYPE.ONLY_FORMAT||u===de.APPLY_TYPE.SERIES){const{source:y,target:p}=o;return r(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Dt=Da([tt(0,w.Inject(w.Injector)),tt(1,w.Inject(w.IUniverInstanceService)),tt(2,w.Inject(de.IAutoFillService)),tt(3,w.Inject(c.ConditionalFormattingRuleModel)),tt(4,w.Inject(c.ConditionalFormattingViewModel))],Dt);var Na=Object.defineProperty,ja=Object.getOwnPropertyDescriptor,La=(t,e,r,n)=>{for(var o=n>1?void 0:n?ja(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Na(e,r,o),o},nt=(t,e)=>(r,n)=>e(r,n,t);exports.ConditionalFormattingClearController=class extends w.Disposable{constructor(e,r,n,o,i){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=o,this._conditionalFormattingRuleModel=i,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var i;const r=[],n=[],o={redos:r,undos:n};if([G.ClearSelectionFormatCommand.id,G.ClearSelectionAllCommand.id].includes(e.id)){const u=(i=this._selectionManagerService.getCurrentSelections())==null?void 0:i.map(C=>C.range);if(!u)return o;const y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return o;const b=y.getUnitId(),v=p.getSheetId(),R=this._conditionalFormattingRuleModel.getSubunitRules(b,v);if(!R||!R.length)return o;const{redos:_,undos:T}=or(this._injector,R,u,b,v);r.push(..._),n.push(...T)}return o}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const o=[],i=[],u={redos:o,undos:i};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 o.push(...p),i.push(...b),u}}))}};exports.ConditionalFormattingClearController=La([nt(0,w.Inject(w.Injector)),nt(1,w.Inject(w.IUniverInstanceService)),nt(2,w.Inject(G.SheetInterceptorService)),nt(3,w.Inject(G.SheetsSelectionsService)),nt(4,w.Inject(c.ConditionalFormattingRuleModel))],exports.ConditionalFormattingClearController);function or(t,e,r,n,o){const i=[],u=[];return e.filter(y=>r.some(p=>y.ranges.some(b=>w.Rectangle.getIntersects(b,p)))).forEach(y=>{const b=new G.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(b.length){const v={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,rule:{...y,ranges:b}}},R=c.setConditionalRuleMutationUndoFactory(t,v.params);i.push(v),u.push(...R)}else{const v={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:o,cfId:y.cfId}},R=c.DeleteConditionalRuleMutationUndoFactory(t,v.params);i.push(v),u.push(...R)}}),{redos:i,undos:u}}var Ua=Object.defineProperty,Va=Object.getOwnPropertyDescriptor,$a=(t,e,r,n)=>{for(var o=n>1?void 0:n?Va(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ua(e,r,o),o},ir=(t,e)=>(r,n)=>e(r,n,t);let Nt=class extends w.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(w.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(G.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),o=(u=n==null?void 0:n.style)!=null?u:{},i=Object.keys(o);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(b=>{b.ts&&i.forEach(v=>{var R;(R=b.ts)==null||delete R[v]})}),r(t);{const b={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};i.forEach(R=>{delete b[R]});const v={...t,s:{...b}};return r(v)}}})))}};Nt=$a([ir(0,w.Inject(G.SheetInterceptorService)),ir(1,w.Inject(c.ConditionalFormattingService))],Nt);const ar=[G.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],rt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],za=t=>{const e=t.get(G.SheetsSelectionsService),r=t.get(w.ICommandService),n=t.get(w.IUniverInstanceService),o=t.get(c.ConditionalFormattingRuleModel),i=new be.Observable(p=>be.merge(e.selectionMoveEnd$,e.selectionSet$,new be.Observable(b=>{const v=r.onCommandExecuted(R=>{var I;const{id:_,params:T}=R,C=(I=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();ar.includes(_)&&T.unitId===C&&b.next(null)});return()=>v.dispose()})).pipe(it.debounceTime(16)).subscribe(()=>{var I;const b=((I=e.getCurrentSelections())==null?void 0:I.map(h=>h.range))||[],v=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!v)return;const R=v.getActiveSheet();if(!R)return;const C=(o.getSubunitRules(v.getUnitId(),R.getSheetId())||[]).filter(h=>h.ranges.some(a=>b.some(s=>w.Rectangle.intersects(s,a)))).map(h=>h.ranges).every(h=>G.checkRangesEditablePermission(t,v.getUnitId(),R.getSheetId(),h));p.next(C)})),u=new be.Observable(p=>new be.Observable(b=>{const v=r.onCommandExecuted(R=>{var I;const{id:_,params:T}=R,C=(I=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();ar.includes(_)&&T.unitId===C&&b.next(null)});return()=>v.dispose()}).pipe(it.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!b)return;const v=b.getActiveSheet();if(!v)return;const R=o.getSubunitRules(b.getUnitId(),v.getSheetId())||[];if(!R.length)return p.next(!1),!1;const _=R.map(T=>T.ranges).every(T=>G.checkRangesEditablePermission(t,b.getUnitId(),v.getSheetId(),T));p.next(_)})),y=new be.Observable(p=>{i.subscribe(b=>{const v=rt.find(R=>R.value===ve.clearRangeRules);v&&(v.disabled=!b,p.next(rt))}),u.subscribe(b=>{const v=rt.find(R=>R.value===ve.clearWorkSheetRules);v&&(v.disabled=!b,p.next(rt))}),p.next(rt)});return{id:gt.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(t,w.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[G.WorkbookEditablePermission],worksheetTypes:[G.WorksheetSetCellStylePermission,G.WorksheetEditPermission],rangeTypes:[G.RangeProtectionPermissionEditPoint]})}},Aa={[te.RibbonStartGroup.FORMULAS_INSERT]:{[gt.id]:{order:0,menuItemFactory:za}}};var qa=Object.defineProperty,Wa=Object.getOwnPropertyDescriptor,Ha=(t,e,r,n)=>{for(var o=n>1?void 0:n?Wa(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&qa(e,r,o),o},sr=(t,e)=>(r,n)=>e(r,n,t);let jt=class extends w.Disposable{constructor(e,r){super();_e(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(Aa)}};jt=Ha([sr(0,w.Inject(w.Injector)),sr(1,te.IMenuManagerService)],jt);var ka=Object.defineProperty,Ba=Object.getOwnPropertyDescriptor,Ga=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ba(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&ka(e,r,o),o},Ve=(t,e)=>(r,n)=>e(r,n,t);const Xa=(t,e)=>{const r=v=>v.endRow-v.startRow+1,n=v=>v.endColumn-v.startColumn+1,o=r(e)%r(t),i=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 v={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:b,startRange:v}),p}for(let v=0;v<u+(o?.1:0);v++)for(let R=0;R<y+(i?.1:0);R++){const _=r(t)*v,T=n(t)*R,C={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:T+e.startColumn,endColumn:T+e.startColumn};let I=b;v===u&&o&&(I={...I},I.endRow=I.endRow-(r(t)-o)),R===y&&i&&(I={...I},I.endColumn=I.endColumn-(n(t)-i)),p.push({repeatRelativeRange:I,startRange:C})}return p};let Lt=class extends w.Disposable{constructor(e,r,n,o,i,u){super();_e(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=o,this._conditionalFormattingRuleModel=i,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(i,u,y,p,b)=>{const{unitId:v,subUnitId:R}=this._painterConfig,{targetUnitId:_,targetSubUnitId:T}=b,C={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},I={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};w.Range.foreach(y,(h,a)=>{const s=w.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},C),d=w.Rectangle.getPositionRange({startRow:h,startColumn:a,endColumn:a,endRow:h},I),S=this._conditionalFormattingViewModel.getCellCfs(v,R,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,T,d.startRow,d.startColumn);l&&l.forEach(m=>{let f=p.get(m.cfId);if(!p.get(m.cfId)){const g=this._conditionalFormattingRuleModel.getRule(_,T,m.cfId);if(!g)return;f=new w.ObjectMatrix,g.ranges.forEach(M=>{w.Range.foreach(M,(j,U)=>{f.setValue(j,U,1)})}),p.set(m.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),S&&S.forEach(m=>{const f=p.get(m.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(i,u,y)=>{var s;const{range:p,unitId:b,subUnitId:v}=this._painterConfig,R=i!==b||v!==u,_=new Map,T=[],C=[];if(!i||!u||!b||!v)return e();const I=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,v))!=null?s:[];I==null||I.forEach(d=>{const{ranges:S,cfId:l}=d;if(S.some(m=>w.Rectangle.intersects(p,m))){const m=new w.ObjectMatrix;R||S.forEach(f=>{w.Range.foreach(f,(g,M)=>{m.setValue(g,M,1)})}),_.set(l,m)}});const h={row:p.startRow,col:p.startColumn};return Xa(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:i,targetSubUnitId:u})}),_.forEach((d,S)=>{if(R){const l=this._conditionalFormattingRuleModel.getRule(i,u,S),m=G.findAllRectangle(G.createTopMatrixFromMatrix(d));if(l)if(m.length){const f={unitId:i,subUnitId:u,rule:{...l,ranges:m}};T.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:i,subUnitId:u,cfId:l.cfId};T.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(m.length){const f=this._conditionalFormattingRuleModel.getRule(b,v,S);if(f){const g={unitId:i,subUnitId:u,rule:{...w.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(i,u),ranges:m}};T.push({id:c.AddConditionalRuleMutation.id,params:g}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,g))}}}else{const l=this._conditionalFormattingRuleModel.getRule(b,v,S);if(!l)return;const m=G.findAllRectangle(G.createTopMatrixFromMatrix(d));if(m.length){const f={unitId:b,subUnitId:v,rule:{...l,ranges:m}};T.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:b,subUnitId:v,cfId:l.cfId};T.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:C,redos:T}},o={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:i=>{var u,y,p;switch(i){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const b=(u=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),v=(p=(y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),R=this._sheetsSelectionsService.getCurrentLastSelection(),_=R==null?void 0:R.range;b&&v&&_&&(this._painterConfig={unitId:b,subUnitId:v,range:_});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(i,u,y)=>this._painterConfig?n(i,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(o)}};Lt=Ga([Ve(0,w.Inject(w.Injector)),Ve(1,w.Inject(w.IUniverInstanceService)),Ve(2,w.Inject(de.IFormatPainterService)),Ve(3,w.Inject(G.SheetsSelectionsService)),Ve(4,w.Inject(c.ConditionalFormattingRuleModel)),Ve(5,w.Inject(c.ConditionalFormattingViewModel))],Lt);var Ya=Object.defineProperty,Ka=Object.getOwnPropertyDescriptor,Za=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ka(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Ya(e,r,o),o},tn=(t,e)=>(r,n)=>e(r,n,t);let Ut=class extends w.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),o=this._renderManagerService.getRenderById(n);if(!o)return;const i=o.with(de.SheetSkeletonManagerService);this.disposeWithMe(i.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,v=(y.endRow-y.startRow+1)*p*9,R=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,v);this._conditionalFormattingViewModel.setCacheLength(R)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ut=Za([tn(0,w.Inject(c.ConditionalFormattingViewModel)),tn(1,w.IUniverInstanceService),tn(2,ur.IRenderManagerService)],Ut);var Fr=Object.defineProperty,Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,r)=>e in t?Fr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,es=(t,e,r,n)=>{for(var o=n>1?void 0:n?Ja(e,r):e,i=t.length-1,u;i>=0;i--)(u=t[i])&&(o=(n?u(e,r,o):u(o))||o);return n&&o&&Fr(e,r,o),o},nn=(t,e)=>(r,n)=>e(r,n,t),Dr=(t,e,r)=>Qa(t,typeof e!="symbol"?e+"":e,r);exports.UniverSheetsConditionalFormattingUIPlugin=class extends w.Plugin{constructor(e=Ft,r,n,o){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=o;const{menu:i,...u}=w.merge({},Ft,this._config);i&&this._configService.setConfig("menu",i,{merge:!0}),this._configService.setConfig(Or,u),this._initCommand()}onStarting(){w.registerDependencies(this._injector,[[dt],[ct],[lt],[Dt],[ut],[st],[jt],[ze],[Nt],[exports.ConditionalFormattingClearController],[Lt],[Ut]]),w.touchDependencies(this._injector,[[dt]])}onReady(){w.touchDependencies(this._injector,[[jt],[st]])}onRendered(){w.touchDependencies(this._injector,[[Dt],[exports.ConditionalFormattingClearController],[lt],[Nt],[ze],[Lt],[ut],[ct],[Ut]])}_initCommand(){[an,sn,ln,un,cn,dn,fn,pn,hn,gt,at,zt,$t,pt,Vt,ht].forEach(e=>{this._commandService.registerCommand(e)})}};Dr(exports.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`);Dr(exports.UniverSheetsConditionalFormattingUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET);exports.UniverSheetsConditionalFormattingUIPlugin=es([w.DependentOn(c.UniverSheetsConditionalFormattingPlugin),nn(1,w.Inject(w.Injector)),nn(2,w.Inject(w.ICommandService)),nn(3,w.IConfigService)],exports.UniverSheetsConditionalFormattingUIPlugin);exports.AddAverageCfCommand=an;exports.AddCfCommand=pt;exports.AddColorScaleConditionalRuleCommand=sn;exports.AddDataBarConditionalRuleCommand=ln;exports.AddDuplicateValuesCfCommand=un;exports.AddNumberCfCommand=cn;exports.AddRankCfCommand=dn;exports.AddTextCfCommand=fn;exports.AddTimePeriodCfCommand=pn;exports.AddUniqueValuesCfCommand=hn;exports.ClearRangeCfCommand=Vt;exports.ClearWorksheetCfCommand=ht;exports.DeleteCfCommand=at;exports.MoveCfCommand=$t;exports.OpenConditionalFormattingOperator=gt;exports.SetCfCommand=zt;
|