@univerjs/preset-sheets-conditional-formatting 0.6.10-nightly.202504151606 → 0.6.10-nightly.202504171607
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/umd/index.js +59 -59
- package/package.json +4 -4
package/lib/umd/index.js
CHANGED
|
@@ -7,159 +7,159 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
// @univerjs/sheets-conditional-formatting-ui/index
|
|
10
|
-
(function(K,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],_):(K=typeof globalThis<"u"?globalThis:K||self,_(K.UniverSheetsConditionalFormattingUi={},K.UniverCore,K.UniverSheetsConditionalFormatting,K.UniverSheets,K.UniverUi,K.React,K.React,K.UniverDesign,K.UniverEngineFormula,K.UniverSheetsUi,K.ReactDOM,K.rxjs,K.UniverSheetsFormulaUi,K.UniverEngineRender,K.rxjs.operators))})(this,function(K,_,c,Y,Q,R,V,Z,kt,pe,pr,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=(K,_,c)=>_ in K?mo(K,_,{enumerable:!0,configurable:!0,writable:!0,value:c}):K[_]=c;var xe=(K,_,c)=>yo(K,typeof _!="symbol"?_+"":_,c);const At={type:_.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.ICommandService),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:T}=C,E=u.createCfId(m,T),w={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:w})}},Wt={type:_.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,T=o.createCfId(C,m),E={ranges:n,cfId:T,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},jt={type:_.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:C}=e,m=t.get(c.ConditionalFormattingRuleModel),T=t.get(_.IUniverInstanceService),E=Y.getSheetCommandTarget(T);if(!E)return!1;const{unitId:w,subUnitId:S}=E,I=t.get(_.ICommandService),h=m.createCfId(w,S),i={ranges:n,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:C,config:{min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return I.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:S,rule:i})}},Ht={type:_.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,T=o.createCfId(C,m),E={ranges:n,cfId:T,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},Bt={type:_.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.ICommandService),C=t.get(_.IUniverInstanceService),m=Y.getSheetCommandTarget(C);if(!m)return!1;const{unitId:T,subUnitId:E}=m,w=y.createCfId(T,E);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const I=u;if(I.length!==2||!Array.isArray(I))return!1;S={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:I}}}else{const I=u;if(typeof I!="number")return!1;S={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:I}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:E,rule:S})}},Ft={type:_.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),C=t.get(_.IUniverInstanceService),m=t.get(_.ICommandService),T=Y.getSheetCommandTarget(C);if(!T)return!1;const{unitId:E,subUnitId:w}=T,S=p.createCfId(E,w),I={ranges:n,cfId:S,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:r,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:w,rule:I})}},Gt={type:_.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:T}=C,E=t.get(_.ICommandService),w=y.createCfId(m,T),S={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:r,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:S})}},qt={type:_.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.IUniverInstanceService),p=t.get(_.ICommandService),C=Y.getSheetCommandTarget(y);if(!C)return!1;const{unitId:m,subUnitId:T}=C,E=u.createCfId(m,T),w={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:r}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:w})}},Xt={type:_.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.IUniverInstanceService),y=t.get(_.ICommandService),p=Y.getSheetCommandTarget(u);if(!p)return!1;const{unitId:C,subUnitId:m}=p,T=o.createCfId(C,m),E={ranges:n,cfId:T,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var be=function(){return be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},be.apply(this,arguments)},_n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},Ue=V.forwardRef(function(t,e){var n=t.icon,r=t.id,a=t.className,o=t.extend,u=_n(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),p=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:p.current},be({ref:e,className:y},u),o)});function gr(t,e,n,r,a){return V.createElement(t.tag,be(be({key:e},Rn(t,n,a)),r),(En(t,n).children||[]).map(function(o,u){return gr(o,"".concat(e,"-").concat(t.tag,"-").concat(u),n,void 0,a)}))}function Rn(t,e,n){var r=be({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),t.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function En(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?be(be({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},gt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:Pn}))});gt.displayName="DeleteSingle";var xn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},vr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:xn}))});vr.displayName="IncreaseSingle";var Dn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},vt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:Dn}))});vt.displayName="MoreDownSingle";var Mn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},mr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Xe=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var Yt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Kt(){return br||(br=1,function(t,e){(function(n,r){r(e)})(Vn,function(n){function r(H){return function(se,P,x,M,k,q,j){return H(se,P,j)}}function a(H){return function(se,P,x,M){if(!se||!P||typeof se!="object"||typeof P!="object")return H(se,P,x,M);var k=M.get(se),q=M.get(P);if(k&&q)return k===P&&q===se;M.set(se,P),M.set(P,se);var j=H(se,P,x,M);return M.delete(se),M.delete(P),j}}function o(H,$){var se={};for(var P in H)se[P]=H[P];for(var P in $)se[P]=$[P];return se}function u(H){return H.constructor===Object||H.constructor==null}function y(H){return typeof H.then=="function"}function p(H,$){return H===$||H!==H&&$!==$}var C="[object Arguments]",m="[object Boolean]",T="[object Date]",E="[object RegExp]",w="[object Map]",S="[object Number]",I="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function f(H){var $=H.areArraysEqual,se=H.areDatesEqual,P=H.areMapsEqual,x=H.areObjectsEqual,M=H.areRegExpsEqual,k=H.areSetsEqual,q=H.createIsNestedEqual,j=q(J);function J(X,re,de){if(X===re)return!0;if(!X||!re||typeof X!="object"||typeof re!="object")return X!==X&&re!==re;if(u(X)&&u(re))return x(X,re,j,de);var Le=Array.isArray(X),Se=Array.isArray(re);if(Le||Se)return Le===Se&&$(X,re,j,de);var me=s.call(X);return me!==s.call(re)?!1:me===T?se(X,re,j,de):me===E?M(X,re,j,de):me===w?P(X,re,j,de):me===h?k(X,re,j,de):me===I||me===C?y(X)||y(re)?!1:x(X,re,j,de):me===m||me===S||me===i?p(X.valueOf(),re.valueOf()):!1}return J}function b(H,$,se,P){var x=H.length;if($.length!==x)return!1;for(;x-- >0;)if(!se(H[x],$[x],x,x,H,$,P))return!1;return!0}var l=a(b);function g(H,$){return p(H.valueOf(),$.valueOf())}function d(H,$,se,P){var x=H.size===$.size;if(!x)return!1;if(!H.size)return!0;var M={},k=0;return H.forEach(function(q,j){if(x){var J=!1,X=0;$.forEach(function(re,de){!J&&!M[X]&&(J=se(j,de,k,X,H,$,P)&&se(q,re,j,de,H,$,P))&&(M[X]=!0),X++}),k++,x=J}}),x}var v=a(d),D="_owner",N=Object.prototype.hasOwnProperty;function U(H,$,se,P){var x=Object.keys(H),M=x.length;if(Object.keys($).length!==M)return!1;for(var k;M-- >0;){if(k=x[M],k===D){var q=!!H.$$typeof,j=!!$.$$typeof;if((q||j)&&q!==j)return!1}if(!N.call($,k)||!se(H[k],$[k],k,k,H,$,P))return!1}return!0}var z=a(U);function O(H,$){return H.source===$.source&&H.flags===$.flags}function L(H,$,se,P){var x=H.size===$.size;if(!x)return!1;if(!H.size)return!0;var M={};return H.forEach(function(k,q){if(x){var j=!1,J=0;$.forEach(function(X,re){!j&&!M[J]&&(j=se(k,X,q,re,H,$,P))&&(M[J]=!0),J++}),x=j}}),x}var B=a(L),G=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),ee=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:B,createIsNestedEqual:r}),ie=f(G);function oe(H,$){return ie(H,$,void 0)}var ce=f(o(G,{createIsNestedEqual:function(){return p}}));function W(H,$){return ce(H,$,void 0)}var te=f(ee);function ne(H,$){return te(H,$,new WeakMap)}var le=f(o(ee,{createIsNestedEqual:function(){return p}}));function fe(H,$){return le(H,$,new WeakMap)}function ve(H){return f(o(G,H(G)))}function Te(H){var $=f(o(ee,H(ee)));return function(se,P,x){return x===void 0&&(x=new WeakMap),$(se,P,x)}}n.circularDeepEqual=ne,n.circularShallowEqual=fe,n.createCustomCircularEqual=Te,n.createCustomEqual=ve,n.deepEqual=oe,n.sameValueZeroEqual=p,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function Zt(){if(Sr)return mt.exports;Sr=1;function t(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=t(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=t(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=e,mt.exports.clsx=e,mt.exports}var ae={},$t,Cr;function Un(){return Cr||(Cr=1,$t=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)}),$t}var Tr;function ze(){if(Tr)return ae;Tr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=r,ae.childrenEqual=p,ae.cloneLayout=a,ae.cloneLayoutItem=y,ae.collides=m,ae.compact=T,ae.compactItem=S,ae.compactType=H,ae.correctBounds=I,ae.fastPositionEqual=C,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=i,ae.getLayoutItem=h,ae.getStatics=f,ae.modifyLayout=o,ae.moveElement=b,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=ce,ae.setTopLeft=te,ae.setTransform=W,ae.sortLayoutItems=ne,ae.sortLayoutItemsByColRow=fe,ae.sortLayoutItemsByRowCol=le,ae.synchronizeLayoutWithChildren=ve,ae.validateLayout=Te,ae.withLayoutItem=u;var t=Kt(),e=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let x=0,M;for(let k=0,q=P.length;k<q;k++)M=P[k].y+P[k].h,M>x&&(x=M);return x}function a(P){const x=Array(P.length);for(let M=0,k=P.length;M<k;M++)x[M]=y(P[M]);return x}function o(P,x){const M=Array(P.length);for(let k=0,q=P.length;k<q;k++)x.i===P[k].i?M[k]=x:M[k]=P[k];return M}function u(P,x,M){let k=h(P,x);return k?(k=M(y(k)),P=o(P,k),[P,k]):[P,null]}function y(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function p(P,x){return(0,t.deepEqual)(e.default.Children.map(P,M=>M==null?void 0:M.key),e.default.Children.map(x,M=>M==null?void 0:M.key))&&(0,t.deepEqual)(e.default.Children.map(P,M=>M==null?void 0:M.props["data-grid"]),e.default.Children.map(x,M=>M==null?void 0:M.props["data-grid"]))}ae.fastRGLPropsEqual=Un();function C(P,x){return P.left===x.left&&P.top===x.top&&P.width===x.width&&P.height===x.height}function m(P,x){return!(P.i===x.i||P.x+P.w<=x.x||P.x>=x.x+x.w||P.y+P.h<=x.y||P.y>=x.y+x.h)}function T(P,x,M,k){const q=f(P),j=ne(P,x),J=Array(P.length);for(let X=0,re=j.length;X<re;X++){let de=y(j[X]);de.static||(de=S(q,de,x,M,j,k),q.push(de)),J[P.indexOf(j[X])]=de,de.moved=!1}return J}const E={x:"w",y:"h"};function w(P,x,M,k){const q=E[k];x[k]+=1;const j=P.map(J=>J.i).indexOf(x.i);for(let J=j+1;J<P.length;J++){const X=P[J];if(!X.static){if(X.y>x.y+x.h)break;m(x,X)&&w(P,X,M+x[q],k)}}x[k]=M}function S(P,x,M,k,q,j){const J=M==="vertical",X=M==="horizontal";if(J)for(x.y=Math.min(r(P),x.y);x.y>0&&!i(P,x);)x.y--;else if(X)for(;x.x>0&&!i(P,x);)x.x--;let re;for(;(re=i(P,x))&&!(M===null&&j);)if(X?w(q,x,re.x+re.w,"x"):w(q,x,re.y+re.h,"y"),X&&x.x+x.w>k)for(x.x=k-x.w,x.y++;x.x>0&&!i(P,x);)x.x--;return x.y=Math.max(x.y,0),x.x=Math.max(x.x,0),x}function I(P,x){const M=f(P);for(let k=0,q=P.length;k<q;k++){const j=P[k];if(j.x+j.w>x.cols&&(j.x=x.cols-j.w),j.x<0&&(j.x=0,j.w=x.cols),!j.static)M.push(j);else for(;i(M,j);)j.y++}return P}function h(P,x){for(let M=0,k=P.length;M<k;M++)if(P[M].i===x)return P[M]}function i(P,x){for(let M=0,k=P.length;M<k;M++)if(m(P[M],x))return P[M]}function s(P,x){return P.filter(M=>m(M,x))}function f(P){return P.filter(x=>x.static)}function b(P,x,M,k,q,j,J,X,re){if(x.static&&x.isDraggable!==!0||x.y===k&&x.x===M)return P;`${x.i}${String(M)}${String(k)}${x.x}${x.y}`;const de=x.x,Le=x.y;typeof M=="number"&&(x.x=M),typeof k=="number"&&(x.y=k),x.moved=!0;let Se=ne(P,J);(J==="vertical"&&typeof k=="number"?Le>=k:J==="horizontal"&&typeof M=="number"?de>=M:!1)&&(Se=Se.reverse());const Fe=s(Se,x),zt=Fe.length>0;if(zt&&re)return a(P);if(zt&&j)return`${x.i}`,x.x=de,x.y=Le,x.moved=!1,P;for(let fr=0,vo=Fe.length;fr<vo;fr++){const Ve=Fe[fr];`${x.i}${x.x}${x.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,x,q,J):P=l(P,x,Ve,q,J))}return P}function l(P,x,M,k,q,j){const J=q==="horizontal",X=q==="vertical",re=x.static;if(k){k=!1;const Se={x:J?Math.max(x.x-M.w,0):M.x,y:X?Math.max(x.y-M.h,0):M.y,w:M.w,h:M.h,i:"-1"},me=i(P,Se),Fe=me&&me.y+me.h>x.y,zt=me&&x.x+x.w>me.x;if(me){if(Fe&&X)return b(P,M,void 0,x.y+1,k,re,q);if(Fe&&q==null)return x.y=M.y,M.y=M.y+M.h,P;if(zt&&J)return b(P,x,M.x,void 0,k,re,q)}else return`${M.i}${Se.x}${Se.y}`,b(P,M,J?Se.x:void 0,X?Se.y:void 0,k,re,q)}const de=J?M.x+1:void 0,Le=X?M.y+1:void 0;return de==null&&Le==null?P:b(P,M,J?M.x+1:void 0,X?M.y+1:void 0,k,re,q)}function g(P){return P*100+"%"}const d=(P,x,M,k)=>P+M>k?x:M,v=(P,x,M)=>P<0?x:M,D=P=>Math.max(0,P),N=P=>Math.max(0,P),U=(P,x,M)=>{let{left:k,height:q,width:j}=x;const J=P.top-(q-P.height);return{left:k,width:j,height:v(J,P.height,q),top:N(J)}},z=(P,x,M)=>{let{top:k,left:q,height:j,width:J}=x;return{top:k,height:j,width:d(P.left,P.width,J,M),left:D(q)}},O=(P,x,M)=>{let{top:k,height:q,width:j}=x;const J=P.left-(j-P.width);return{height:q,width:J<0?P.width:d(P.left,P.width,j,M),top:N(k),left:D(J)}},L=(P,x,M)=>{let{top:k,left:q,height:j,width:J}=x;return{width:J,left:q,height:v(k,P.height,j),top:N(k)}},oe={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],z(...arguments))},e:z,se:function(){return L(arguments.length<=0?void 0:arguments[0],z(...arguments))},s:L,sw:function(){return L(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return U(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function ce(P,x,M,k){const q=oe[P];return q?q(x,{...x,...M},k):M}function W(P){let{top:x,left:M,width:k,height:q}=P;const j=`translate(${M}px,${x}px)`;return{transform:j,WebkitTransform:j,MozTransform:j,msTransform:j,OTransform:j,width:`${k}px`,height:`${q}px`,position:"absolute"}}function te(P){let{top:x,left:M,width:k,height:q}=P;return{top:`${x}px`,left:`${M}px`,width:`${k}px`,height:`${q}px`,position:"absolute"}}function ne(P,x){return x==="horizontal"?fe(P):x==="vertical"?le(P):P}function le(P){return P.slice(0).sort(function(x,M){return x.y>M.y||x.y===M.y&&x.x>M.x?1:x.y===M.y&&x.x===M.x?0:-1})}function fe(P){return P.slice(0).sort(function(x,M){return x.x>M.x||x.x===M.x&&x.y>M.y?1:-1})}function ve(P,x,M,k,q){P=P||[];const j=[];e.default.Children.forEach(x,X=>{if((X==null?void 0:X.key)==null)return;const re=h(P,String(X.key)),de=X.props["data-grid"];re&&de==null?j.push(y(re)):de?j.push(y({...de,i:X.key})):j.push(y({w:1,h:1,x:0,y:r(j),i:String(X.key)}))});const J=I(j,{cols:M});return q?J:T(J,k,M)}function Te(P){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const M=["x","y","w","h"];if(!Array.isArray(P))throw new Error(x+" must be an array!");for(let k=0,q=P.length;k<q;k++){const j=P[k];for(let J=0;J<M.length;J++){const X=M[J],re=j[X];if(typeof re!="number"||Number.isNaN(re))throw new Error(`ReactGridLayout: ${x}[${k}].${X} must be a number! Received: ${re} (${typeof re})`)}if(typeof j.i<"u"&&typeof j.i!="string")throw new Error(`ReactGridLayout: ${x}[${k}].i must be a string! Received: ${j.i} (${typeof j.i})`)}}function H(P){const{verticalCompact:x,compactType:M}=P||{};return x===!1?null:M}function $(){}const se=()=>{};return ae.noop=se,ae}var Ie={},wr;function Jt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=e,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:C,cols:m}=u;return(C-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function n(u,y,p,C,m,T){const{margin:E,containerPadding:w,rowHeight:S}=u,I=t(u),h={};return T&&T.resizing?(h.width=Math.round(T.resizing.width),h.height=Math.round(T.resizing.height)):(h.width=e(C,I,E[0]),h.height=e(m,S,E[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+E[1])*p+w[1]),h.left=Math.round((I+E[0])*y+w[0])),h}function r(u,y,p,C,m){const{margin:T,containerPadding:E,cols:w,rowHeight:S,maxRows:I}=u,h=t(u);let i=Math.round((p-E[0])/(h+T[0])),s=Math.round((y-E[1])/(S+T[1]));return i=o(i,0,w-C),s=o(s,0,I-m),{x:i,y:s}}function a(u,y,p,C,m,T){const{margin:E,maxRows:w,cols:S,rowHeight:I}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(I+E[1])),f=o(i,0,S-C),b=o(s,0,w-m);return["sw","w","nw"].indexOf(T)!==-1&&(f=o(i,0,S)),["nw","n","ne"].indexOf(T)!==-1&&(b=o(s,0,w)),{w:f,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return Ie}var Ze={},Qt={exports:{}},er,Ir;function zn(){if(Ir)return er;Ir=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return er=t,er}var tr,_r;function kn(){if(_r)return tr;_r=1;var t=zn();function e(){}function n(){}return n.resetWarningCache=e,tr=function(){function r(u,y,p,C,m,T){if(T!==t){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},tr}var Rr;function Ee(){return Rr||(Rr=1,Qt.exports=kn()()),Qt.exports}var $e={exports:{}},rr={};function Er(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Er(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Or(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Er(t))&&(r&&(r+=" "),r+=e);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var he={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=r,Oe.isFunction=e,Oe.isNum=n;function t(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},xr;function Wn(){if(xr)return Pe;xr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,Pe.default=void 0,Pe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(n(u,t[p])in y)return t[p];return""}function n(o,u){return u?"".concat(u).concat(a(o)):o}function r(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Pe.default=e(),Pe}var Dr;function nr(){if(Dr)return he;Dr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.addClassName=l,he.addEvent=y,he.addUserSelectStyles=f,he.createCSSTransform=S,he.createSVGTransform=I,he.getTouch=i,he.getTouchIdentifier=s,he.getTranslation=h,he.innerHeight=T,he.innerWidth=E,he.matchesSelector=o,he.matchesSelectorAndParentsTo=u,he.offsetXYFromParent=w,he.outerHeight=C,he.outerWidth=m,he.removeClassName=g,he.removeEvent=p,he.removeUserSelectStyles=b;var t=yt(),e=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,D=new WeakMap;return(n=function(N){return N?D:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var D=n(v);if(D&&D.has(d))return D.get(d);var N={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in d)if(z!=="default"&&Object.prototype.hasOwnProperty.call(d,z)){var O=U?Object.getOwnPropertyDescriptor(d,z):null;O&&(O.get||O.set)?Object.defineProperty(N,z,O):N[z]=d[z]}return N.default=d,D&&D.set(d,N),N}let a="";function o(d,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(D){return(0,t.isFunction)(d[D])})),(0,t.isFunction)(d[a])?d[a](v):!1}function u(d,v,D){let N=d;do{if(o(N,v))return!0;if(N===D)return!1;N=N.parentNode}while(N);return!1}function y(d,v,D,N){if(!d)return;const U={capture:!0,...N};d.addEventListener?d.addEventListener(v,D,U):d.attachEvent?d.attachEvent("on"+v,D):d["on"+v]=D}function p(d,v,D,N){if(!d)return;const U={capture:!0,...N};d.removeEventListener?d.removeEventListener(v,D,U):d.detachEvent?d.detachEvent("on"+v,D):d["on"+v]=null}function C(d){let v=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(D.borderTopWidth),v+=(0,t.int)(D.borderBottomWidth),v}function m(d){let v=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(D.borderLeftWidth),v+=(0,t.int)(D.borderRightWidth),v}function T(d){let v=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(D.paddingTop),v-=(0,t.int)(D.paddingBottom),v}function E(d){let v=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(D.paddingLeft),v-=(0,t.int)(D.paddingRight),v}function w(d,v,D){const U=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),z=(d.clientX+v.scrollLeft-U.left)/D,O=(d.clientY+v.scrollTop-U.top)/D;return{x:z,y:O}}function S(d,v){const D=h(d,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:D}}function I(d,v){return h(d,v,"")}function h(d,v,D){let{x:N,y:U}=d,z="translate(".concat(N).concat(D,",").concat(U).concat(D,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+D),L="".concat(typeof v.y=="string"?v.y:v.y+D);z="translate(".concat(O,", ").concat(L,")")+z}return z}function i(d,v){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,D=>v===D.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,D=>v===D.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
10
|
+
(function(K,w){typeof exports=="object"&&typeof module<"u"?w(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],w):(K=typeof globalThis<"u"?globalThis:K||self,w(K.UniverSheetsConditionalFormattingUi={},K.UniverCore,K.UniverSheetsConditionalFormatting,K.UniverSheets,K.UniverUi,K.React,K.React,K.UniverDesign,K.UniverEngineFormula,K.UniverSheetsUi,K.ReactDOM,K.rxjs,K.UniverSheetsFormulaUi,K.UniverEngineRender,K.rxjs.operators))})(this,function(K,w,u,Y,te,_,V,Z,kt,pe,At,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=(K,w,u)=>w in K?mo(K,w,{enumerable:!0,configurable:!0,writable:!0,value:u}):K[w]=u;var xe=(K,w,u)=>yo(K,typeof w!="symbol"?w+"":w,u);const Wt={type:w.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,c=e.get(u.ConditionalFormattingRuleModel),y=e.get(w.ICommandService),h=e.get(w.IUniverInstanceService),T=Y.getSheetCommandTarget(h);if(!T)return!1;const{unitId:m,subUnitId:C}=T,E=c.createCfId(m,C),R={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:R})}},jt={type:w.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,config:r,stopIfTrue:a}=t,o=e.get(u.ConditionalFormattingRuleModel),c=e.get(w.ICommandService),y=e.get(w.IUniverInstanceService),h=Y.getSheetCommandTarget(y);if(!h)return!1;const{unitId:T,subUnitId:m}=h,C=o.createCfId(T,m),E={ranges:n,cfId:C,stopIfTrue:!!a,rule:{type:u.CFRuleType.colorScale,config:r}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:T,subUnitId:m,rule:E})}},Ht={type:w.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:c,isGradient:y,stopIfTrue:h,isShowValue:T}=t,m=e.get(u.ConditionalFormattingRuleModel),C=e.get(w.IUniverInstanceService),E=Y.getSheetCommandTarget(C);if(!E)return!1;const{unitId:R,subUnitId:I}=E,S=e.get(w.ICommandService),p=m.createCfId(R,I),i={ranges:n,cfId:p,stopIfTrue:!!h,rule:{type:u.CFRuleType.dataBar,isShowValue:T,config:{min:r,max:a,nativeColor:o,positiveColor:c,isGradient:y}}};return S.executeCommand(u.AddConditionalRuleMutation.id,{unitId:R,subUnitId:I,rule:i})}},Bt={type:w.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(u.ConditionalFormattingRuleModel),c=e.get(w.ICommandService),y=e.get(w.IUniverInstanceService),h=Y.getSheetCommandTarget(y);if(!h)return!1;const{unitId:T,subUnitId:m}=h,C=o.createCfId(T,m),E={ranges:n,cfId:C,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.duplicateValues,style:r}};return c.executeCommand(u.AddConditionalRuleMutation.id,{unitId:T,subUnitId:m,rule:E})}},Ft={type:w.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:c}=t,y=e.get(u.ConditionalFormattingRuleModel),h=e.get(w.ICommandService),T=e.get(w.IUniverInstanceService),m=Y.getSheetCommandTarget(T);if(!m)return!1;const{unitId:C,subUnitId:E}=m,R=y.createCfId(C,E);let I;if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(o)){const S=c;if(S.length!==2||!Array.isArray(S))return!1;I={ranges:n,cfId:R,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:o,style:r,value:S}}}else{const S=c;if(typeof S!="number")return!1;I={ranges:n,cfId:R,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.number,operator:o,style:r,value:S}}}return h.executeCommand(u.AddConditionalRuleMutation.id,{unitId:C,subUnitId:E,rule:I})}},Gt={type:w.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:c,value:y}=t,h=e.get(u.ConditionalFormattingRuleModel),T=e.get(w.IUniverInstanceService),m=e.get(w.ICommandService),C=Y.getSheetCommandTarget(T);if(!C)return!1;const{unitId:E,subUnitId:R}=C,I=h.createCfId(E,R),S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:o,isBottom:c,style:r,value:y}};return m.executeCommand(u.AddConditionalRuleMutation.id,{unitId:E,subUnitId:R,rule:S})}},qt={type:w.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:c}=t,y=e.get(u.ConditionalFormattingRuleModel),h=e.get(w.IUniverInstanceService),T=Y.getSheetCommandTarget(h);if(!T)return!1;const{unitId:m,subUnitId:C}=T,E=e.get(w.ICommandService),R=y.createCfId(m,C),I={ranges:n,cfId:R,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.text,operator:o,style:r,value:c}};return E.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:I})}},Xt={type:w.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=t,c=e.get(u.ConditionalFormattingRuleModel),y=e.get(w.IUniverInstanceService),h=e.get(w.ICommandService),T=Y.getSheetCommandTarget(y);if(!T)return!1;const{unitId:m,subUnitId:C}=T,E=c.createCfId(m,C),R={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.timePeriod,operator:o,style:r}};return h.executeCommand(u.AddConditionalRuleMutation.id,{unitId:m,subUnitId:C,rule:R})}},Yt={type:w.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:n,style:r,stopIfTrue:a}=t,o=e.get(u.ConditionalFormattingRuleModel),c=e.get(w.IUniverInstanceService),y=e.get(w.ICommandService),h=Y.getSheetCommandTarget(c);if(!h)return!1;const{unitId:T,subUnitId:m}=h,C=o.createCfId(T,m),E={ranges:n,cfId:C,stopIfTrue:!!a,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(u.AddConditionalRuleMutation.id,{unitId:T,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var be=function(){return be=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},be.apply(this,arguments)},_n=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(n[r[a]]=e[r[a]]);return n},Ue=V.forwardRef(function(e,t){var n=e.icon,r=e.id,a=e.className,o=e.extend,c=_n(e,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),h=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:h.current},be({ref:t,className:y},c),o)});function gr(e,t,n,r,a){return V.createElement(e.tag,be(be({key:t},Rn(e,n,a)),r),(En(e,n).children||[]).map(function(o,c){return gr(o,"".concat(t,"-").concat(e.tag,"-").concat(c),n,void 0,a)}))}function Rn(e,t,n){var r=be({},e.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),e.tag==="mask"&&r.id&&(r.id=r.id+t.idSuffix),Object.entries(r).forEach(function(o){var c=o[0],y=o[1];c==="mask"&&typeof y=="string"&&(r[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+t.idSuffix),Object.entries(r).forEach(function(o){var c=o[0],y=o[1];typeof y=="string"&&(r[c]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),r}function En(e,t){var n,r=t.defIds;return!r||r.length===0?e:e.tag==="defs"&&(!((n=e.children)===null||n===void 0)&&n.length)?be(be({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},gt=V.forwardRef(function(e,t){return V.createElement(Ue,Object.assign({},e,{id:"delete-single",ref:t,icon:Pn}))});gt.displayName="DeleteSingle";var xn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},vr=V.forwardRef(function(e,t){return V.createElement(Ue,Object.assign({},e,{id:"increase-single",ref:t,icon:xn}))});vr.displayName="IncreaseSingle";var Dn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},vt=V.forwardRef(function(e,t){return V.createElement(Ue,Object.assign({},e,{id:"more-down-single",ref:t,icon:Dn}))});vt.displayName="MoreDownSingle";var Mn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},mr=V.forwardRef(function(e,t){return V.createElement(Ue,Object.assign({},e,{id:"sequence-single",ref:t,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Xe=V.forwardRef(function(e,t){return V.createElement(Ue,Object.assign({},e,{id:"slash-single",ref:t,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function yr(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return e[r]}})}),n}var Kt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Zt(){return br||(br=1,function(e,t){(function(n,r){r(t)})(Vn,function(n){function r(H){return function(se,P,x,N,k,G,j){return H(se,P,j)}}function a(H){return function(se,P,x,N){if(!se||!P||typeof se!="object"||typeof P!="object")return H(se,P,x,N);var k=N.get(se),G=N.get(P);if(k&&G)return k===P&&G===se;N.set(se,P),N.set(P,se);var j=H(se,P,x,N);return N.delete(se),N.delete(P),j}}function o(H,J){var se={};for(var P in H)se[P]=H[P];for(var P in J)se[P]=J[P];return se}function c(H){return H.constructor===Object||H.constructor==null}function y(H){return typeof H.then=="function"}function h(H,J){return H===J||H!==H&&J!==J}var T="[object Arguments]",m="[object Boolean]",C="[object Date]",E="[object RegExp]",R="[object Map]",I="[object Number]",S="[object Object]",p="[object Set]",i="[object String]",s=Object.prototype.toString;function f(H){var J=H.areArraysEqual,se=H.areDatesEqual,P=H.areMapsEqual,x=H.areObjectsEqual,N=H.areRegExpsEqual,k=H.areSetsEqual,G=H.createIsNestedEqual,j=G(Q);function Q(X,re,de){if(X===re)return!0;if(!X||!re||typeof X!="object"||typeof re!="object")return X!==X&&re!==re;if(c(X)&&c(re))return x(X,re,j,de);var Le=Array.isArray(X),Se=Array.isArray(re);if(Le||Se)return Le===Se&&J(X,re,j,de);var me=s.call(X);return me!==s.call(re)?!1:me===C?se(X,re,j,de):me===E?N(X,re,j,de):me===R?P(X,re,j,de):me===p?k(X,re,j,de):me===S||me===T?y(X)||y(re)?!1:x(X,re,j,de):me===m||me===I||me===i?h(X.valueOf(),re.valueOf()):!1}return Q}function b(H,J,se,P){var x=H.length;if(J.length!==x)return!1;for(;x-- >0;)if(!se(H[x],J[x],x,x,H,J,P))return!1;return!0}var l=a(b);function g(H,J){return h(H.valueOf(),J.valueOf())}function d(H,J,se,P){var x=H.size===J.size;if(!x)return!1;if(!H.size)return!0;var N={},k=0;return H.forEach(function(G,j){if(x){var Q=!1,X=0;J.forEach(function(re,de){!Q&&!N[X]&&(Q=se(j,de,k,X,H,J,P)&&se(G,re,j,de,H,J,P))&&(N[X]=!0),X++}),k++,x=Q}}),x}var v=a(d),D="_owner",M=Object.prototype.hasOwnProperty;function U(H,J,se,P){var x=Object.keys(H),N=x.length;if(Object.keys(J).length!==N)return!1;for(var k;N-- >0;){if(k=x[N],k===D){var G=!!H.$$typeof,j=!!J.$$typeof;if((G||j)&&G!==j)return!1}if(!M.call(J,k)||!se(H[k],J[k],k,k,H,J,P))return!1}return!0}var z=a(U);function O(H,J){return H.source===J.source&&H.flags===J.flags}function L(H,J,se,P){var x=H.size===J.size;if(!x)return!1;if(!H.size)return!0;var N={};return H.forEach(function(k,G){if(x){var j=!1,Q=0;J.forEach(function(X,re){!j&&!N[Q]&&(j=se(k,X,G,re,H,J,P))&&(N[Q]=!0),Q++}),x=j}}),x}var B=a(L),q=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),$=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:B,createIsNestedEqual:r}),ie=f(q);function oe(H,J){return ie(H,J,void 0)}var ce=f(o(q,{createIsNestedEqual:function(){return h}}));function W(H,J){return ce(H,J,void 0)}var ee=f($);function ne(H,J){return ee(H,J,new WeakMap)}var le=f(o($,{createIsNestedEqual:function(){return h}}));function fe(H,J){return le(H,J,new WeakMap)}function ve(H){return f(o(q,H(q)))}function Te(H){var J=f(o($,H($)));return function(se,P,x){return x===void 0&&(x=new WeakMap),J(se,P,x)}}n.circularDeepEqual=ne,n.circularShallowEqual=fe,n.createCustomCircularEqual=Te,n.createCustomEqual=ve,n.deepEqual=oe,n.sameValueZeroEqual=h,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function $t(){if(Sr)return mt.exports;Sr=1;function e(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var c=n.length;for(r=0;r<c;r++)n[r]&&(a=e(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function t(){for(var n,r,a=0,o="",c=arguments.length;a<c;a++)(n=arguments[a])&&(r=e(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=t,mt.exports.clsx=t,mt.exports}var ae={},Jt,Cr;function Un(){return Cr||(Cr=1,Jt=function(t,n,r){return t===n?!0:t.className===n.className&&r(t.style,n.style)&&t.width===n.width&&t.autoSize===n.autoSize&&t.cols===n.cols&&t.draggableCancel===n.draggableCancel&&t.draggableHandle===n.draggableHandle&&r(t.verticalCompact,n.verticalCompact)&&r(t.compactType,n.compactType)&&r(t.layout,n.layout)&&r(t.margin,n.margin)&&r(t.containerPadding,n.containerPadding)&&t.rowHeight===n.rowHeight&&t.maxRows===n.maxRows&&t.isBounded===n.isBounded&&t.isDraggable===n.isDraggable&&t.isResizable===n.isResizable&&t.allowOverlap===n.allowOverlap&&t.preventCollision===n.preventCollision&&t.useCSSTransforms===n.useCSSTransforms&&t.transformScale===n.transformScale&&t.isDroppable===n.isDroppable&&r(t.resizeHandles,n.resizeHandles)&&r(t.resizeHandle,n.resizeHandle)&&t.onLayoutChange===n.onLayoutChange&&t.onDragStart===n.onDragStart&&t.onDrag===n.onDrag&&t.onDragStop===n.onDragStop&&t.onResizeStart===n.onResizeStart&&t.onResize===n.onResize&&t.onResizeStop===n.onResizeStop&&t.onDrop===n.onDrop&&r(t.droppingItem,n.droppingItem)&&r(t.innerRef,n.innerRef)}),Jt}var Tr;function ze(){if(Tr)return ae;Tr=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=r,ae.childrenEqual=h,ae.cloneLayout=a,ae.cloneLayoutItem=y,ae.collides=m,ae.compact=C,ae.compactItem=I,ae.compactType=H,ae.correctBounds=S,ae.fastPositionEqual=T,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=i,ae.getLayoutItem=p,ae.getStatics=f,ae.modifyLayout=o,ae.moveElement=b,ae.moveElementAwayFromCollision=l,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=ce,ae.setTopLeft=ee,ae.setTransform=W,ae.sortLayoutItems=ne,ae.sortLayoutItemsByColRow=fe,ae.sortLayoutItemsByRowCol=le,ae.synchronizeLayoutWithChildren=ve,ae.validateLayout=Te,ae.withLayoutItem=c;var e=Zt(),t=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let x=0,N;for(let k=0,G=P.length;k<G;k++)N=P[k].y+P[k].h,N>x&&(x=N);return x}function a(P){const x=Array(P.length);for(let N=0,k=P.length;N<k;N++)x[N]=y(P[N]);return x}function o(P,x){const N=Array(P.length);for(let k=0,G=P.length;k<G;k++)x.i===P[k].i?N[k]=x:N[k]=P[k];return N}function c(P,x,N){let k=p(P,x);return k?(k=N(y(k)),P=o(P,k),[P,k]):[P,null]}function y(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function h(P,x){return(0,e.deepEqual)(t.default.Children.map(P,N=>N==null?void 0:N.key),t.default.Children.map(x,N=>N==null?void 0:N.key))&&(0,e.deepEqual)(t.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]),t.default.Children.map(x,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Un();function T(P,x){return P.left===x.left&&P.top===x.top&&P.width===x.width&&P.height===x.height}function m(P,x){return!(P.i===x.i||P.x+P.w<=x.x||P.x>=x.x+x.w||P.y+P.h<=x.y||P.y>=x.y+x.h)}function C(P,x,N,k){const G=f(P),j=ne(P,x),Q=Array(P.length);for(let X=0,re=j.length;X<re;X++){let de=y(j[X]);de.static||(de=I(G,de,x,N,j,k),G.push(de)),Q[P.indexOf(j[X])]=de,de.moved=!1}return Q}const E={x:"w",y:"h"};function R(P,x,N,k){const G=E[k];x[k]+=1;const j=P.map(Q=>Q.i).indexOf(x.i);for(let Q=j+1;Q<P.length;Q++){const X=P[Q];if(!X.static){if(X.y>x.y+x.h)break;m(x,X)&&R(P,X,N+x[G],k)}}x[k]=N}function I(P,x,N,k,G,j){const Q=N==="vertical",X=N==="horizontal";if(Q)for(x.y=Math.min(r(P),x.y);x.y>0&&!i(P,x);)x.y--;else if(X)for(;x.x>0&&!i(P,x);)x.x--;let re;for(;(re=i(P,x))&&!(N===null&&j);)if(X?R(G,x,re.x+re.w,"x"):R(G,x,re.y+re.h,"y"),X&&x.x+x.w>k)for(x.x=k-x.w,x.y++;x.x>0&&!i(P,x);)x.x--;return x.y=Math.max(x.y,0),x.x=Math.max(x.x,0),x}function S(P,x){const N=f(P);for(let k=0,G=P.length;k<G;k++){const j=P[k];if(j.x+j.w>x.cols&&(j.x=x.cols-j.w),j.x<0&&(j.x=0,j.w=x.cols),!j.static)N.push(j);else for(;i(N,j);)j.y++}return P}function p(P,x){for(let N=0,k=P.length;N<k;N++)if(P[N].i===x)return P[N]}function i(P,x){for(let N=0,k=P.length;N<k;N++)if(m(P[N],x))return P[N]}function s(P,x){return P.filter(N=>m(N,x))}function f(P){return P.filter(x=>x.static)}function b(P,x,N,k,G,j,Q,X,re){if(x.static&&x.isDraggable!==!0||x.y===k&&x.x===N)return P;`${x.i}${String(N)}${String(k)}${x.x}${x.y}`;const de=x.x,Le=x.y;typeof N=="number"&&(x.x=N),typeof k=="number"&&(x.y=k),x.moved=!0;let Se=ne(P,Q);(Q==="vertical"&&typeof k=="number"?Le>=k:Q==="horizontal"&&typeof N=="number"?de>=N:!1)&&(Se=Se.reverse());const Fe=s(Se,x),zt=Fe.length>0;if(zt&&re)return a(P);if(zt&&j)return`${x.i}`,x.x=de,x.y=Le,x.moved=!1,P;for(let pr=0,vo=Fe.length;pr<vo;pr++){const Ve=Fe[pr];`${x.i}${x.x}${x.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,x,G,Q):P=l(P,x,Ve,G,Q))}return P}function l(P,x,N,k,G,j){const Q=G==="horizontal",X=G==="vertical",re=x.static;if(k){k=!1;const Se={x:Q?Math.max(x.x-N.w,0):N.x,y:X?Math.max(x.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},me=i(P,Se),Fe=me&&me.y+me.h>x.y,zt=me&&x.x+x.w>me.x;if(me){if(Fe&&X)return b(P,N,void 0,x.y+1,k,re,G);if(Fe&&G==null)return x.y=N.y,N.y=N.y+N.h,P;if(zt&&Q)return b(P,x,N.x,void 0,k,re,G)}else return`${N.i}${Se.x}${Se.y}`,b(P,N,Q?Se.x:void 0,X?Se.y:void 0,k,re,G)}const de=Q?N.x+1:void 0,Le=X?N.y+1:void 0;return de==null&&Le==null?P:b(P,N,Q?N.x+1:void 0,X?N.y+1:void 0,k,re,G)}function g(P){return P*100+"%"}const d=(P,x,N,k)=>P+N>k?x:N,v=(P,x,N)=>P<0?x:N,D=P=>Math.max(0,P),M=P=>Math.max(0,P),U=(P,x,N)=>{let{left:k,height:G,width:j}=x;const Q=P.top-(G-P.height);return{left:k,width:j,height:v(Q,P.height,G),top:M(Q)}},z=(P,x,N)=>{let{top:k,left:G,height:j,width:Q}=x;return{top:k,height:j,width:d(P.left,P.width,Q,N),left:D(G)}},O=(P,x,N)=>{let{top:k,height:G,width:j}=x;const Q=P.left-(j-P.width);return{height:G,width:Q<0?P.width:d(P.left,P.width,j,N),top:M(k),left:D(Q)}},L=(P,x,N)=>{let{top:k,left:G,height:j,width:Q}=x;return{width:Q,left:G,height:v(k,P.height,j),top:M(k)}},oe={n:U,ne:function(){return U(arguments.length<=0?void 0:arguments[0],z(...arguments))},e:z,se:function(){return L(arguments.length<=0?void 0:arguments[0],z(...arguments))},s:L,sw:function(){return L(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return U(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function ce(P,x,N,k){const G=oe[P];return G?G(x,{...x,...N},k):N}function W(P){let{top:x,left:N,width:k,height:G}=P;const j=`translate(${N}px,${x}px)`;return{transform:j,WebkitTransform:j,MozTransform:j,msTransform:j,OTransform:j,width:`${k}px`,height:`${G}px`,position:"absolute"}}function ee(P){let{top:x,left:N,width:k,height:G}=P;return{top:`${x}px`,left:`${N}px`,width:`${k}px`,height:`${G}px`,position:"absolute"}}function ne(P,x){return x==="horizontal"?fe(P):x==="vertical"?le(P):P}function le(P){return P.slice(0).sort(function(x,N){return x.y>N.y||x.y===N.y&&x.x>N.x?1:x.y===N.y&&x.x===N.x?0:-1})}function fe(P){return P.slice(0).sort(function(x,N){return x.x>N.x||x.x===N.x&&x.y>N.y?1:-1})}function ve(P,x,N,k,G){P=P||[];const j=[];t.default.Children.forEach(x,X=>{if((X==null?void 0:X.key)==null)return;const re=p(P,String(X.key)),de=X.props["data-grid"];re&&de==null?j.push(y(re)):de?j.push(y({...de,i:X.key})):j.push(y({w:1,h:1,x:0,y:r(j),i:String(X.key)}))});const Q=S(j,{cols:N});return G?Q:C(Q,k,N)}function Te(P){let x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(x+" must be an array!");for(let k=0,G=P.length;k<G;k++){const j=P[k];for(let Q=0;Q<N.length;Q++){const X=N[Q],re=j[X];if(typeof re!="number"||Number.isNaN(re))throw new Error(`ReactGridLayout: ${x}[${k}].${X} must be a number! Received: ${re} (${typeof re})`)}if(typeof j.i<"u"&&typeof j.i!="string")throw new Error(`ReactGridLayout: ${x}[${k}].i must be a string! Received: ${j.i} (${typeof j.i})`)}}function H(P){const{verticalCompact:x,compactType:N}=P||{};return x===!1?null:N}function J(){}const se=()=>{};return ae.noop=se,ae}var Ie={},wr;function Qt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=e,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=t,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function e(c){const{margin:y,containerPadding:h,containerWidth:T,cols:m}=c;return(T-y[0]*(m-1)-h[0]*2)/m}function t(c,y,h){return Number.isFinite(c)?Math.round(y*c+Math.max(0,c-1)*h):c}function n(c,y,h,T,m,C){const{margin:E,containerPadding:R,rowHeight:I}=c,S=e(c),p={};return C&&C.resizing?(p.width=Math.round(C.resizing.width),p.height=Math.round(C.resizing.height)):(p.width=t(T,S,E[0]),p.height=t(m,I,E[1])),C&&C.dragging?(p.top=Math.round(C.dragging.top),p.left=Math.round(C.dragging.left)):C&&C.resizing&&typeof C.resizing.top=="number"&&typeof C.resizing.left=="number"?(p.top=Math.round(C.resizing.top),p.left=Math.round(C.resizing.left)):(p.top=Math.round((I+E[1])*h+R[1]),p.left=Math.round((S+E[0])*y+R[0])),p}function r(c,y,h,T,m){const{margin:C,containerPadding:E,cols:R,rowHeight:I,maxRows:S}=c,p=e(c);let i=Math.round((h-E[0])/(p+C[0])),s=Math.round((y-E[1])/(I+C[1]));return i=o(i,0,R-T),s=o(s,0,S-m),{x:i,y:s}}function a(c,y,h,T,m,C){const{margin:E,maxRows:R,cols:I,rowHeight:S}=c,p=e(c);let i=Math.round((y+E[0])/(p+E[0])),s=Math.round((h+E[1])/(S+E[1])),f=o(i,0,I-T),b=o(s,0,R-m);return["sw","w","nw"].indexOf(C)!==-1&&(f=o(i,0,I)),["nw","n","ne"].indexOf(C)!==-1&&(b=o(s,0,R)),{w:f,h:b}}function o(c,y,h){return Math.max(Math.min(c,h),y)}return Ie}var Ze={},er={exports:{}},tr,Ir;function zn(){if(Ir)return tr;Ir=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return tr=e,tr}var rr,_r;function kn(){if(_r)return rr;_r=1;var e=zn();function t(){}function n(){}return n.resetWarningCache=t,rr=function(){function r(c,y,h,T,m,C){if(C!==e){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:t};return o.PropTypes=o,o},rr}var Rr;function Ee(){return Rr||(Rr=1,er.exports=kn()()),er.exports}var $e={exports:{}},nr={};function Er(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(n=Er(e[t]))&&(r&&(r+=" "),r+=n);else for(t in e)e[t]&&(r&&(r+=" "),r+=t);return r}function Or(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=Er(e))&&(r&&(r+=" "),r+=t);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var he={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=e,Oe.int=r,Oe.isFunction=t,Oe.isNum=n;function e(o,c){for(let y=0,h=o.length;y<h;y++)if(c.apply(c,[o[y],y,o]))return o[y]}function t(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,c,y){if(o[c])return new Error("Invalid prop ".concat(c," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},xr;function Wn(){if(xr)return Pe;xr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,Pe.default=void 0,Pe.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var o;let c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||c in y)return"";for(let h=0;h<e.length;h++)if(n(c,e[h])in y)return e[h];return""}function n(o,c){return c?"".concat(c).concat(a(o)):o}function r(o,c){return c?"-".concat(c.toLowerCase(),"-").concat(o):o}function a(o){let c="",y=!0;for(let h=0;h<o.length;h++)y?(c+=o[h].toUpperCase(),y=!1):o[h]==="-"?y=!0:c+=o[h];return c}return Pe.default=t(),Pe}var Dr;function ar(){if(Dr)return he;Dr=1,Object.defineProperty(he,"__esModule",{value:!0}),he.addClassName=l,he.addEvent=y,he.addUserSelectStyles=f,he.createCSSTransform=I,he.createSVGTransform=S,he.getTouch=i,he.getTouchIdentifier=s,he.getTranslation=p,he.innerHeight=C,he.innerWidth=E,he.matchesSelector=o,he.matchesSelectorAndParentsTo=c,he.offsetXYFromParent=R,he.outerHeight=T,he.outerWidth=m,he.removeClassName=g,he.removeEvent=h,he.removeUserSelectStyles=b;var e=yt(),t=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,D=new WeakMap;return(n=function(M){return M?D:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var D=n(v);if(D&&D.has(d))return D.get(d);var M={},U=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var z in d)if(z!=="default"&&Object.prototype.hasOwnProperty.call(d,z)){var O=U?Object.getOwnPropertyDescriptor(d,z):null;O&&(O.get||O.set)?Object.defineProperty(M,z,O):M[z]=d[z]}return M.default=d,D&&D.set(d,M),M}let a="";function o(d,v){return a||(a=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(D){return(0,e.isFunction)(d[D])})),(0,e.isFunction)(d[a])?d[a](v):!1}function c(d,v,D){let M=d;do{if(o(M,v))return!0;if(M===D)return!1;M=M.parentNode}while(M);return!1}function y(d,v,D,M){if(!d)return;const U={capture:!0,...M};d.addEventListener?d.addEventListener(v,D,U):d.attachEvent?d.attachEvent("on"+v,D):d["on"+v]=D}function h(d,v,D,M){if(!d)return;const U={capture:!0,...M};d.removeEventListener?d.removeEventListener(v,D,U):d.detachEvent?d.detachEvent("on"+v,D):d["on"+v]=null}function T(d){let v=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,e.int)(D.borderTopWidth),v+=(0,e.int)(D.borderBottomWidth),v}function m(d){let v=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,e.int)(D.borderLeftWidth),v+=(0,e.int)(D.borderRightWidth),v}function C(d){let v=d.clientHeight;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,e.int)(D.paddingTop),v-=(0,e.int)(D.paddingBottom),v}function E(d){let v=d.clientWidth;const D=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,e.int)(D.paddingLeft),v-=(0,e.int)(D.paddingRight),v}function R(d,v,D){const U=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),z=(d.clientX+v.scrollLeft-U.left)/D,O=(d.clientY+v.scrollTop-U.top)/D;return{x:z,y:O}}function I(d,v){const D=p(d,v,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:D}}function S(d,v){return p(d,v,"")}function p(d,v,D){let{x:M,y:U}=d,z="translate(".concat(M).concat(D,",").concat(U).concat(D,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+D),L="".concat(typeof v.y=="string"?v.y:v.y+D);z="translate(".concat(O,", ").concat(L,")")+z}return z}function i(d,v){return d.targetTouches&&(0,e.findInArray)(d.targetTouches,D=>v===D.identifier)||d.changedTouches&&(0,e.findInArray)(d.changedTouches,D=>v===D.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
11
11
|
`,v.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
12
|
-
`,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return he}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=p,we.getBoundPosition=n,we.getControlPosition=u,we.snapToGrid=r;var t=yt(),e=nr();function n(T,E,w){if(!T.props.bounds)return[E,w];let{bounds:S}=T.props;S=typeof S=="string"?S:C(S);const I=m(T);if(typeof S=="string"){const{ownerDocument:h}=I,i=h.defaultView;let s;if(S==="parent"?s=I.parentNode:s=h.querySelector(S),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const f=s,b=i.getComputedStyle(I),l=i.getComputedStyle(f);S={left:-I.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-I.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(I)-I.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(I)-I.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(E=Math.min(E,S.right)),(0,t.isNum)(S.bottom)&&(w=Math.min(w,S.bottom)),(0,t.isNum)(S.left)&&(E=Math.max(E,S.left)),(0,t.isNum)(S.top)&&(w=Math.max(w,S.top)),[E,w]}function r(T,E,w){const S=Math.round(E/T[0])*T[0],I=Math.round(w/T[1])*T[1];return[S,I]}function a(T){return T.props.axis==="both"||T.props.axis==="x"}function o(T){return T.props.axis==="both"||T.props.axis==="y"}function u(T,E,w){const S=typeof E=="number"?(0,e.getTouch)(T,E):null;if(typeof E=="number"&&!S)return null;const I=m(w),h=w.props.offsetParent||I.offsetParent||I.ownerDocument.body;return(0,e.offsetXYFromParent)(S||T,h,w.props.scale)}function y(T,E,w){const S=!(0,t.isNum)(T.lastX),I=m(T);return S?{node:I,deltaX:0,deltaY:0,lastX:E,lastY:w,x:E,y:w}:{node:I,deltaX:E-T.lastX,deltaY:w-T.lastY,lastX:T.lastX,lastY:T.lastY,x:E,y:w}}function p(T,E){const w=T.props.scale;return{node:E.node,x:T.state.x+E.deltaX/w,y:T.state.y+E.deltaY/w,deltaX:E.deltaX/w,deltaY:E.deltaY/w,lastX:T.state.x,lastY:T.state.y}}function C(T){return{left:T.left,top:T.top,right:T.right,bottom:T.bottom}}function m(T){const E=T.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=t;function t(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=C(V),e=y(Ee()),n=y(pr),r=nr(),a=Nr(),o=yt(),u=y(Vr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=T(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function T(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=w.mouse,I=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,S.move,this.handleDrag),(0,r.addEvent)(f,S.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,D=b-this.lastY||0;[v,D]=(0,a.snapToGrid)(this.props.grid,v,D),f=this.lastX+v,b=this.lastY+D}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,S.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(S=w.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(S=w.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(S=w.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(S=w.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,w.mouse.move,this.handleDrag),(0,r.removeEvent)(s,w.touch.move,this.handleDrag),(0,r.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=I,m(I,"displayName","DraggableCore"),m(I,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(I,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=E(V),n=m(Ee()),r=m(pr),a=m(An),o=nr(),u=Nr(),y=yt(),p=m(jn()),C=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function T(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(T=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=T(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},w.apply(this,arguments)}function S(s,f,b){return f=I(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function I(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,C.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),S(this,"onDragStart",(b,l)=>{if((0,C.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,C.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:N}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[U,z]=(0,u.getBoundPosition)(this,d.x,d.y);d.x=U,d.y=z,d.slackX=this.state.slackX+(D-d.x),d.slackY=this.state.slackY+(N-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,C.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:N}=this.props.position;d.x=D,d.y=N}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:D,position:N,positionOffset:U,scale:z,...O}=this.props;let L={},B=null;const ee=!!!N||this.state.dragging,ie=N||g,oe={x:(0,u.canDragX)(this)&&ee?this.state.x:ie.x,y:(0,u.canDragY)(this)&&ee?this.state.y:ie.y};this.state.isElementSVG?B=(0,o.createSVGTransform)(oe,U):L=(0,o.createCSSTransform)(oe,U);const ce=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[D]:this.state.dragged});return e.createElement(p.default,w({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:ce,style:{...l.props.style,...L},transform:B}))}}t.default=i,S(i,"displayName","Draggable"),S(i,"propTypes",{...p.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),S(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(rr)),rr}var kr;function ar(){if(kr)return $e.exports;kr=1;const{default:t,DraggableCore:e}=Hn();return $e.exports=t,$e.exports.default=t,$e.exports.DraggableCore=e,$e.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var t=e(V);function e(p){return p&&p.__esModule?p:{default:p}}function n(p,C){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(p);C&&(T=T.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,T)}return m}function r(p){for(var C=1;C<arguments.length;C++){var m=arguments[C]!=null?arguments[C]:{};C%2?n(Object(m),!0).forEach(function(T){a(p,T,m[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(T){Object.defineProperty(p,T,Object.getOwnPropertyDescriptor(m,T))})}return p}function a(p,C,m){return C=o(C),C in p?Object.defineProperty(p,C,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[C]=m,p}function o(p){var C=u(p,"string");return typeof C=="symbol"?C:String(C)}function u(p,C){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var T=m.call(p,C);if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(p)}function y(p,C){return C.style&&p.props.style&&(C.style=r(r({},p.props.style),C.style)),C.className&&p.props.className&&(C.className=p.props.className+" "+C.className),t.default.cloneElement(p,C)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var t=e(Ee());ar();function e(r){return r&&r.__esModule?r:{default:r}}var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var t=u(V),e=ar(),n=Bn(),r=jr(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(o=function(l){return l?f:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function C(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?C(Object(f),!0).forEach(function(b){T(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):C(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function T(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=w(i,"string");return typeof s=="symbol"?s:String(s)}function w(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function S(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,I(i,s)}function I(i,s){return I=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},I(i,s)}var h=function(i){S(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,D=d.maxConstraints,N=d.lockAspectRatio;if(!v&&!D&&!N)return[l,g];if(N){var U=this.props.width/this.props.height,z=l-this.props.width,O=g-this.props.height;Math.abs(z)>Math.abs(O*U)?g=l/U:l=g*U}var L=l,B=g,G=this.slack||[0,0],ee=G[0],ie=G[1];return l+=ee,g+=ie,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),D&&(l=Math.min(D[0],l),g=Math.min(D[1],g)),this.slack=[ee+(L-l),ie+(B-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,D){var N=D.node,U=D.deltaX,z=D.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var B=g[0],G=g[g.length-1],ee=N.getBoundingClientRect();if(d.lastHandleRect!=null){if(G==="w"){var ie=ee.left-d.lastHandleRect.left;U+=ie}if(B==="n"){var oe=ee.top-d.lastHandleRect.top;z+=oe}}d.lastHandleRect=ee,G==="w"&&(U=-U),B==="n"&&(z=-z);var ce=d.props.width+(O?U/d.props.transformScale:0),W=d.props.height+(L?z/d.props.transformScale:0),te=d.runConstraints(ce,W);ce=te[0],W=te[1];var ne=ce!==d.props.width||W!==d.props.height,le=typeof d.props[l]=="function"?d.props[l]:null,fe=l==="onResize"&&!ne;le&&!fe&&(v.persist==null||v.persist(),le(v,{node:N,size:{width:ce,height:W},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",D=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(d,D)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,D=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var N=g.resizeHandles;g.transformScale;var U=p(g,a);return(0,n.cloneElement)(d,m(m({},U),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,N.map(function(z){var O,L=(O=l.handleRefs[z])!=null?O:l.handleRefs[z]=t.createRef();return t.createElement(e.DraggableCore,y({},D,{nodeRef:L,key:"resizableHandle-"+z,onStop:l.resizeHandler("onResizeStop",z),onStart:l.resizeHandler("onResizeStart",z),onDrag:l.resizeHandler("onResize",z)}),l.renderResizeHandle(z,L))}))}))},s}(t.Component);return et.default=h,h.propTypes=r.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var t=y(V),e=o(Ee()),n=o(Br()),r=jr(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(u=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function C(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?C(Object(b),!0).forEach(function(l){T(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):C(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function T(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=w(s,"string");return typeof f=="symbol"?f:String(f)}function w(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function S(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function I(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,f)}var i=function(s){I(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(D,N){var U=N.size;l.props.onResize?(D.persist==null||D.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(D,N)})):l.setState(U)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var D=g.onResizeStart,N=g.onResizeStop,U=g.draggableOpts,z=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,B=g.axis;g.width,g.height;var G=g.resizeHandles,ee=g.style,ie=g.transformScale,oe=S(g,a);return t.createElement(n.default,{axis:B,draggableOpts:U,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:z,onResizeStart:D,onResize:this.onResize,onResizeStop:N,resizeHandles:G,transformScale:ie,width:this.state.width},t.createElement("div",p({},oe,{style:m(m({},ee),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:e.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var t=n(Ee()),e=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return _e.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(o){o.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:r,resizeHandle:a,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(o,u){const y=o[u],p={};e.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(p[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');p[C.key]=!0}})},innerRef:t.default.any},_e}var Yr;function qn(){if(Yr)return Ze;Yr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=p(V),e=p(Ee()),n=ar(),r=Gn(),a=ze(),o=Jt(),u=Xr(),y=p(Zt());function p(w){return w&&w.__esModule?w:{default:w}}function C(w,S,I){return S=m(S),S in w?Object.defineProperty(w,S,{value:I,enumerable:!0,configurable:!0,writable:!0}):w[S]=I,w}function m(w){var S=T(w,"string");return typeof S=="symbol"?S:String(S)}function T(w,S){if(typeof w!="object"||w===null)return w;var I=w[Symbol.toPrimitive];if(I!==void 0){var h=I.call(w,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(w)}let E=class extends t.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",t.default.createRef()),C(this,"onDragStart",(S,I)=>{let{node:h}=I;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const f={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,v=l.left/s,D=g.top/s,N=l.top/s;f.left=d-v+b.scrollLeft,f.top=D-N+b.scrollTop,this.setState({dragging:f});const{x:U,y:z}=(0,o.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return i.call(this,this.props.i,U,z,{e:S,node:h,newPosition:f})}),C(this,"onDrag",(S,I)=>{let{node:h,deltaX:i,deltaY:s}=I;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:d,w:v,h:D,containerWidth:N}=this.props,U=this.getPositionParams();if(g){const{offsetParent:B}=h;if(B){const{margin:G,rowHeight:ee,containerPadding:ie}=this.props,oe=B.clientHeight-(0,o.calcGridItemWHPx)(D,ee,G[1]);b=(0,o.clamp)(b-ie[1],0,oe);const ce=(0,o.calcGridColWidth)(U),W=N-(0,o.calcGridItemWHPx)(v,ce,G[0]);l=(0,o.clamp)(l-ie[0],0,W)}}const z={top:b,left:l};this.setState({dragging:z});const{x:O,y:L}=(0,o.calcXY)(U,b,l,v,D);return f.call(this,d,O,L,{e:S,node:h,newPosition:z})}),C(this,"onDragStop",(S,I)=>{let{node:h}=I;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:b}=this.props,{left:l,top:g}=this.state.dragging,d={top:g,left:l};this.setState({dragging:null});const{x:v,y:D}=(0,o.calcXY)(this.getPositionParams(),g,l,s,f);return i.call(this,b,v,D,{e:S,node:h,newPosition:d})}),C(this,"onResizeStop",(S,I,h)=>this.onResizeHandler(S,I,h,"onResizeStop")),C(this,"onResizeStart",(S,I,h)=>this.onResizeHandler(S,I,h,"onResizeStart")),C(this,"onResize",(S,I,h)=>this.onResizeHandler(S,I,h,"onResize"))}shouldComponentUpdate(S,I){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,I);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:I}=this.props;if(!I)return;const h=this.elementRef.current;if(!h)return;const i=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&I.left!==i.left||I.top!==i.top;if(!s)this.onDragStart(I.e,{node:h,deltaX:I.left,deltaY:I.top});else if(f){const b=I.left-s.left,l=I.top-s.top;this.onDrag(I.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:I,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(S):(s=(0,a.setTopLeft)(S),I&&(s.left=(0,a.perc)(S.left/h),s.width=(0,a.perc)(S.width/h))),s}mixinDraggable(S,I){return t.default.createElement(n.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},S)}curryResizeHandler(S,I){return(h,i)=>I(h,i,S)}mixinResizable(S,I,h){const{cols:i,minW:s,minH:f,maxW:b,maxH:l,transformScale:g,resizeHandles:d,resizeHandle:v}=this.props,D=this.getPositionParams(),N=(0,o.calcGridItemPosition)(D,0,0,i,0).width,U=(0,o.calcGridItemPosition)(D,0,0,s,f),z=(0,o.calcGridItemPosition)(D,0,0,b,l),O=[U.width,U.height],L=[Math.min(z.width,N),Math.min(z.height,1/0)];return t.default.createElement(r.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:I.width,height:I.height,minConstraints:O,maxConstraints:L,onResizeStop:this.curryResizeHandler(I,this.onResizeStop),onResizeStart:this.curryResizeHandler(I,this.onResizeStart),onResize:this.curryResizeHandler(I,this.onResize),transformScale:g,resizeHandles:d,handle:v},S)}onResizeHandler(S,I,h,i){let{node:s,size:f,handle:b}=I;const l=this.props[i];if(!l)return;const{x:g,y:d,i:v,maxH:D,minH:N,containerWidth:U}=this.props,{minW:z,maxW:O}=this.props;let L=f;s&&(L=(0,a.resizeItemInDirection)(b,h,f,U),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:B,h:G}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,d,b);B=(0,o.clamp)(B,Math.max(z,1),O),G=(0,o.clamp)(G,N,D),l.call(this,v,B,G,{e:S,node:s,size:L,handle:b})}render(){const{x:S,y:I,w:h,h:i,isDraggable:s,isResizable:f,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),S,I,h,i,this.state),d=t.default.Children.only(this.props.children);let v=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!b,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,f),v=this.mixinDraggable(v,s),v}};return Ze.default=E,C(E,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(w,S){const I=w[S];if(typeof I!="number")return new Error("minWidth not Number");if(I>w.w||I>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,S){const I=w[S];if(typeof I!="number")return new Error("maxWidth not Number");if(I<w.w||I<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,S){const I=w[S];if(typeof I!="number")return new Error("minHeight not Number");if(I>w.h||I>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,S){const I=w[S];if(typeof I!="number")return new Error("maxHeight not Number");if(I<w.h||I<w.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),C(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Ze}var Kr;function Zr(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=C(V),e=Kt(),n=y(Zt()),r=ze(),a=Jt(),o=y(qn()),u=y(Xr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=T(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function T(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let I=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const D={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:D}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:D,allowOverlap:N,preventCollision:U}=this.props,z=(0,r.getLayoutItem)(v,i);if(!z)return;const O={w:z.w,h:z.h,x:z.x,y:z.y,placeholder:!0,i};v=(0,r.moveElement)(v,z,s,f,!0,U,(0,r.compactType)(this.props),D,N),this.props.onDrag(v,d,z,O,l,g),this.setState({layout:N?v:(0,r.compact)(v,(0,r.compactType)(this.props),D),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:D,preventCollision:N,allowOverlap:U}=this.props,z=(0,r.getLayoutItem)(v,i);if(!z)return;v=(0,r.moveElement)(v,z,s,f,!0,N,(0,r.compactType)(this.props),D,U);const L=U?v:(0,r.compact)(v,(0,r.compactType)(this.props),D);this.props.onDragStop(L,d,z,null,l,g);const{oldLayout:B}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,B)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:D}=this.state,{layout:N}=this.state,{cols:U,preventCollision:z,allowOverlap:O}=this.props;let L=!1,B,G,ee;const[ie,oe]=(0,r.withLayoutItem)(N,i,W=>{let te;return G=W.x,ee=W.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(G=W.x+(W.w-s),s=W.x!==G&&G<0?W.w:s,G=G<0?0:G),["ne","n","nw"].indexOf(v)!==-1&&(ee=W.y+(W.h-f),f=W.y!==ee&&ee<0?W.h:f,ee=ee<0?0:ee),L=!0),z&&!O&&(te=(0,r.getAllCollisions)(N,{...W,w:s,h:f,x:G,y:ee}).filter(le=>le.i!==W.i).length>0,te&&(ee=W.y,f=W.h,G=W.x,s=W.w,L=!1)),W.w=s,W.h=f,W});if(!oe)return;B=ie,L&&(B=(0,r.moveElement)(ie,oe,G,ee,!0,this.props.preventCollision,(0,r.compactType)(this.props),U,O));const ce={w:oe.w,h:oe.h,x:oe.x,y:oe.y,static:!0,i};this.props.onResize(B,D,oe,ce,l,g),this.setState({layout:O?B:(0,r.compact)(B,(0,r.compactType)(this.props),U),activeDrag:ce})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:D,allowOverlap:N}=this.props,U=(0,r.getLayoutItem)(d,i),z=N?d:(0,r.compact)(d,(0,r.compactType)(this.props),D);this.props.onResizeStop(z,v,U,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:z,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(z,O)}),m(this,"onDragOver",i=>{var ie;if(i.preventDefault(),i.stopPropagation(),S&&!((ie=i.nativeEvent.target)!=null&&ie.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:D,transformScale:N}=this.props,U=f==null?void 0:f(i);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const z={...s,...U},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),B=i.clientX-L.left,G=i.clientY-L.top,ee={left:B/N,top:G/N,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:oe,top:ce}=this.state.droppingPosition;(oe!=B||ce!=G)&&this.setState({droppingPosition:ee})}}else{const oe={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:D||b},ce=(0,a.calcXY)(oe,G,B,z.w,z.h);this.setState({droppingDOMNode:t.createElement("div",{key:z.i}),droppingPosition:ee,layout:[...O,{...z,x:ce.x,y:ce.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.fastRGLPropsEqual)(this.props,i,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,e.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:D}=this.props;return t.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:D},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:D,isDraggable:N,isResizable:U,isBounded:z,useCSSTransforms:O,transformScale:L,draggableCancel:B,draggableHandle:G,resizeHandles:ee,resizeHandle:ie}=this.props,{mounted:oe,droppingPosition:ce}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&N,te=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,ne=f.resizeHandles||ee,le=W&&z&&f.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:D,rowHeight:v,cancel:B,handle:G,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:te,isBounded:le,useCSSTransforms:O&&oe,usePercentages:!oe,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?ce:void 0,resizeHandles:ne,resizeHandle:ie},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(w,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=I,m(I,"displayName","ReactGridLayout"),m(I,"propTypes",u.default),m(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:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},De={},$r;function Jr(){if($r)return De;$r=1,Object.defineProperty(De,"__esModule",{value:!0}),De.findOrGenerateResponsiveLayout=r,De.getBreakpointFromWidth=e,De.getColsFromBreakpoint=n,De.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let C=1,m=y.length;C<m;C++){const T=y[C];u>o[T]&&(p=T)}return p}function n(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function r(o,u,y,p,C,m){if(o[y])return(0,t.cloneLayout)(o[y]);let T=o[p];const E=a(u),w=E.slice(E.indexOf(y));for(let S=0,I=w.length;S<I;S++){const h=w[S];if(o[h]){T=o[h];break}}return T=(0,t.cloneLayout)(T||[]),(0,t.compact)((0,t.correctBounds)(T,{cols:C}),m,C)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return De}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=p(V),e=u(Ee()),n=Kt(),r=ze(),a=Jr(),o=u(Zr());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function C(){return C=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},C.apply(this,arguments)}function m(h,i,s){return i=T(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function T(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function S(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let I=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),D={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in D||(D[d]=(0,r.cloneLayout)(this.state.layout));let z=(0,a.findOrGenerateResponsiveLayout)(D,s,g,d,v,l);z=(0,r.synchronizeLayoutWithChildren)(z,this.props.children,v,l,this.props.allowOverlap),D[g]=z,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(z,D),this.setState({breakpoint:g,layout:z,cols:v})}const N=S(this.props.margin,g),U=S(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,N,v,U)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:D,...N}=this.props;return t.createElement(o.default,C({},N,{margin:S(l,this.state.breakpoint),containerPadding:S(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=I,m(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,i){if(w(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(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:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},e.prototype.set=function(n,r){var a=t(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,a=t(r,n);~a&&r.splice(a,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];n.call(r,u[1],u[0])}},e}()}(),or=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Kn=2;function Zn(t,e){var n=!1,r=!1,a=0;function o(){n&&(n=!1,t()),r&&y()}function u(){Yn(o)}function y(){var p=Date.now();if(n){if(p-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(u,e);a=p}return y}var $n=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Zn(this.refresh.bind(this),$n)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!or||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!or||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),tn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Tt},rn=It(0,0,0,0);function wt(t){return parseFloat(t)||0}function nn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,a){var o=t["border-"+a+"-width"];return r+wt(o)},0)}function ta(t){for(var e=["top","right","bottom","left"],n={},r=0,a=e;r<a.length;r++){var o=a[r],u=t["padding-"+o];n[o]=wt(u)}return n}function ra(t){var e=t.getBBox();return It(0,0,e.width,e.height)}function na(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return rn;var r=ke(t).getComputedStyle(t),a=ta(r),o=a.left+a.right,u=a.top+a.bottom,y=wt(r.width),p=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=nn(r,"left","right")+o),Math.round(p+u)!==n&&(p-=nn(r,"top","bottom")+u)),!oa(t)){var C=Math.round(y+o)-e,m=Math.round(p+u)-n;Math.abs(C)!==1&&(y-=C),Math.abs(m)!==1&&(p-=m)}return It(a.left,a.top,y,p)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function oa(t){return t===ke(t).document.documentElement}function ia(t){return or?aa(t)?ra(t):na(t):rn}function sa(t){var e=t.x,n=t.y,r=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return tn(u,{x:e,y:n,width:r,height:a,top:n,right:e+r,bottom:a+n,left:e}),u}function It(t,e,n,r){return{x:t,y:e,width:n,height:r}}var la=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ia(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),ca=function(){function t(e,n){var r=sa(n);tn(this,{target:e,contentRect:r})}return t}(),ua=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new la(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ea.getInstance(),r=new ua(e,n,this);an.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){on.prototype[t]=function(){var e;return(e=an.get(this))[t].apply(e,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var t=u(V),e=a(Ee()),n=a(fa),r=a(Zt());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var S=new WeakMap,I=new WeakMap;return(o=function(h){return h?I:S})(w)}function u(w,S){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var I=o(S);if(I&&I.has(w))return I.get(w);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var f=i?Object.getOwnPropertyDescriptor(w,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=w[s]}return h.default=w,I&&I.set(w,h),h}function y(){return y=Object.assign?Object.assign.bind():function(w){for(var S=1;S<arguments.length;S++){var I=arguments[S];for(var h in I)Object.prototype.hasOwnProperty.call(I,h)&&(w[h]=I[h])}return w},y.apply(this,arguments)}function p(w,S,I){return S=C(S),S in w?Object.defineProperty(w,S,{value:I,enumerable:!0,configurable:!0,writable:!0}):w[S]=I,w}function C(w){var S=m(w,"string");return typeof S=="symbol"?S:String(S)}function m(w,S){if(typeof w!="object"||w===null)return w;var I=w[Symbol.toPrimitive];if(I!==void 0){var h=I.call(w,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(w)}const T="react-grid-layout";function E(w){var S;return S=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,r.default)(this.props.className,T),style:this.props.style,ref:this.elementRef}):t.createElement(w,y({innerRef:this.elementRef},i,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return Ct}var ln;function ha(){return ln||(ln=1,function(t){t.exports=Zr().default,t.exports.utils=ze(),t.exports.calculateUtils=Jt(),t.exports.Responsive=Xn().default,t.exports.Responsive.utils=Jr(),t.exports.WidthProvider=pa().default}(Yt)),Yt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(t,e,n,r)=>{for(var a=r>1?void 0:r?ma(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ba=(t,e)=>(n,r)=>e(n,r,t);let Ae=class extends _.Disposable{constructor(e){super();xe(this,"_initLocal",()=>{});xe(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(e);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),a=e.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,C)=>{const m=C[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const T=o.slice(m.endIndex+1,y.startIndex);T&&u.push(T)}if(n[y.key]&&u.push(n[y.key]),p===C.length-1){const T=o.slice(y.endIndex+1);T&&u.push(T)}}),u}return[]}};Ae=ya([ba(0,_.Inject(_.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const n=V.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((C,m)=>({color:new _.ColorKit(C.color),value:m})),y=u.length-1;return new Array(5).fill("").map((C,m,T)=>m*y/(T.length-1)).map(C=>c.getColorScaleFromValue(u,C))}return null},[e]),r=V.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,C=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return R.jsxs("div",{className:_t.cfPreview,children:[R.jsx("div",{style:{...y,background:C,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),R.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return n&&R.jsx("div",{className:_t.cfPreview,children:n.map((u,y)=>R.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return r&&R.jsx("div",{className:_t.cfPreview,children:r.map((u,y)=>u?R.jsx("img",{style:{height:"100%"},src:u},y):R.jsx(Xe,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:C,bg:m,cl:T}=e.style,E=(u==null?void 0:u.s)===_.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===_.BooleanNumber.TRUE,S=p===_.BooleanNumber.TRUE,I=C===_.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=T==null?void 0:T.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:I?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${E?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return R.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},ge={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap"},Sa=(t,e)=>{const n=t.rule;switch(n.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(n.subType){case c.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case c.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case c.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case c.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=t=>{const{onClick:e}=t,n=Q.useDependency(c.ConditionalFormattingRuleModel),r=Q.useDependency(_.IUniverInstanceService),a=Q.useDependency(Y.SheetsSelectionsService),o=Q.useDependency(_.ICommandService),u=Q.useDependency(_.LocaleService),y=Q.useDependency(_.Injector),p=Q.useDependency(Q.ISidebarService),C=Q.useDependency(Ae),m=Q.useObservable(()=>r.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),T=m.getUnitId(),E=m.getActiveSheet();if(!E)throw new Error("No active sheet found");const w=E.getSheetId(),[S,I]=V.useState([]),[h,i]=V.useState("2"),[s,f]=V.useState(0),[b,l]=V.useState(-1),[g,d]=V.useState(cn),v=V.useRef(null),D=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],N=()=>{const W=n.getSubunitRules(T,w);if(!W||!W.length)return[];if(h==="1"){const te=a.getCurrentLastSelection();if(!te)return[];const ne=te.range;return W.filter(fe=>fe.ranges.some(ve=>_.Rectangle.intersects(ve,ne)))}else if(h==="2")return[...W];return[]},[U,z]=V.useState(N);pe.useHighlightRange(S),V.useEffect(()=>{const W=o.onCommandExecuted(te=>{te.id===Y.SetWorksheetActiveOperation.id&&f(Math.random())});return()=>W.dispose()}),V.useEffect(()=>{z(N)},[h,s,T,w]),V.useEffect(()=>{if(h==="2")return;const W=new Ce.Observable(te=>{const ne=[Y.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],le=o.onCommandExecuted(fe=>{const{id:ve,params:Te}=fe,H=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ve)&&Te.unitId===H&&te.next(null)});return()=>le.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(N)});return()=>{W.unsubscribe()}},[r,h,T,w]),V.useEffect(()=>{const W=n.$ruleChange.subscribe(()=>{f(Math.random())});return()=>W.unsubscribe()},[n]),V.useEffect(()=>{const W=()=>{var fe,ve;const le=Math.max(0,((ve=(fe=v.current)==null?void 0:fe.getBoundingClientRect().width)!=null?ve:0)-8);return cn=le,le},ne=new Ce.Observable(le=>{const fe=p.getContainer();if(fe){let ve=setTimeout(()=>{le.next()},150);const Te=()=>{ve&&clearTimeout(ve),ve=null},H=$=>{$.propertyName==="width"&&(Te(),le.next())};return fe.addEventListener("transitionend",H),()=>{Te(),fe.removeEventListener("transitionend",H)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{d(W())});return()=>{ne.unsubscribe()}},[]);const O=W=>{var le;const te=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(le=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:le.getSheetId();if(!te||!ne)throw new Error("No active sheet found");o.executeCommand(c.DeleteCfCommand.id,{unitId:te,subUnitId:ne,cfId:W.cfId})},L=(W,te)=>{l(te.y)},B=(W,te,ne)=>{var $;l(-1);const le=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),fe=($=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:$.getSheetId();if(!le||!fe)throw new Error("No active sheet found");const ve=se=>{const P=U.length;return Math.min(P-1,Math.max(0,se))},Te=U[ve(te.y)].cfId,H=U[ve(ne.y)].cfId;Te!==H&&o.executeCommand(c.MoveCfCommand.id,{unitId:le,subUnitId:fe,start:{id:Te,type:"self"},end:{id:H,type:ne.y>te.y?"after":"before"}})},G=()=>{t.onCreate()},ee=()=>{h==="2"?o.executeCommand(c.ClearWorksheetCfCommand.id):h==="1"&&U.map(te=>({unitId:T,subUnitId:w,cfId:te.cfId})).forEach(te=>{o.executeCommand(c.DeleteCfCommand.id,te)})},ie=V.useMemo(()=>{const W=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET),te=W.getActiveSheet();return U.filter(ne=>{const le=ne.ranges;return Y.checkRangesEditablePermission(y,W.getUnitId(),te.getSheetId(),le)})},[U]),oe=ie.map((W,te)=>({i:W.cfId,x:0,w:12,y:te,h:1,isResizable:!1})),ce=V.useMemo(()=>{const W=r.getCurrentUnitOfType(_.UniverInstanceType.UNIVER_SHEET),te=W.getActiveSheet();return U.every(ne=>{const le=ne.ranges;return Y.checkRangesEditablePermission(y,W.getUnitId(),te.getSheetId(),le)})},[U]);return R.jsxs("div",{className:ge.cfRuleList,children:[R.jsxs("div",{className:ge.ruleSelector,children:[R.jsx("div",{children:C.tWithReactNode("sheet.cf.panel.managerRuleSelect",R.jsx(Z.Select,{className:ge.select,options:D,value:h,onChange:W=>{i(W)}})).map((W,te)=>R.jsx("span",{children:W},te))}),R.jsxs("div",{className:ge.btnList,children:[R.jsx(Z.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:R.jsx("div",{className:ge.icon,onClick:G,children:R.jsx(vr,{})})}),U.length&&ce?R.jsx(Z.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:R.jsx("div",{className:Z.clsx(ge.gap,ge.icon),onClick:ee,children:R.jsx(gt,{})})}):R.jsx("div",{className:Z.clsx(ge.gap,ge.disabled),children:R.jsx(gt,{})})]})]}),R.jsx("div",{ref:v,className:ge.gridLayoutWrap,children:g?R.jsx(va,{draggableHandle:".draggableHandle",layout:oe,cols:12,rowHeight:60,width:g,margin:[0,10],onDragStop:B,onDragStart:L,children:ie==null?void 0:ie.map((W,te)=>R.jsx("div",{children:R.jsxs("div",{className:Z.clsx(ge.ruleItem,{[ge.active]:b===te}),onMouseMove:()=>{W.ranges!==S&&I(W.ranges)},onMouseLeave:()=>I([]),onClick:()=>{e(W)},children:[R.jsx("div",{className:Z.clsx(ge.draggableHandle,"draggableHandle"),onClick:ne=>ne.stopPropagation(),children:R.jsx(mr,{})}),R.jsxs("div",{className:ge.ruleDescribe,children:[R.jsx("div",{className:ge.ruleType,children:Sa(W,u)}),R.jsx("div",{className:ge.ruleRange,children:W.ranges.map(ne=>kt.serializeRange(ne)).join(",")})]}),R.jsx("div",{className:ge.preview,children:R.jsx(We,{rule:W.rule})}),R.jsx("div",{className:Z.clsx(ge.deleteItem,{[ge.active]:b===te}),onClick:ne=>{ne.stopPropagation(),O(W),I([])},children:R.jsx(gt,{})})]})},`${W.cfId}`))}):null})]})},un={cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Me=t=>{const{color:e,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=t,y=Q.useDependency(Q.ComponentManager),p=V.useMemo(()=>new _.ColorKit(e),[e]),C=y.get(a);return C&&(r?R.jsx(C,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):R.jsx(Z.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Z.ColorPicker,{value:e,onChange:n})}),children:R.jsxs("span",{className:`
|
|
12
|
+
`,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return he}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=h,we.getBoundPosition=n,we.getControlPosition=c,we.snapToGrid=r;var e=yt(),t=ar();function n(C,E,R){if(!C.props.bounds)return[E,R];let{bounds:I}=C.props;I=typeof I=="string"?I:T(I);const S=m(C);if(typeof I=="string"){const{ownerDocument:p}=S,i=p.defaultView;let s;if(I==="parent"?s=S.parentNode:s=p.querySelector(I),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+I+'" could not find an element.');const f=s,b=i.getComputedStyle(S),l=i.getComputedStyle(f);I={left:-S.offsetLeft+(0,e.int)(l.paddingLeft)+(0,e.int)(b.marginLeft),top:-S.offsetTop+(0,e.int)(l.paddingTop)+(0,e.int)(b.marginTop),right:(0,t.innerWidth)(f)-(0,t.outerWidth)(S)-S.offsetLeft+(0,e.int)(l.paddingRight)-(0,e.int)(b.marginRight),bottom:(0,t.innerHeight)(f)-(0,t.outerHeight)(S)-S.offsetTop+(0,e.int)(l.paddingBottom)-(0,e.int)(b.marginBottom)}}return(0,e.isNum)(I.right)&&(E=Math.min(E,I.right)),(0,e.isNum)(I.bottom)&&(R=Math.min(R,I.bottom)),(0,e.isNum)(I.left)&&(E=Math.max(E,I.left)),(0,e.isNum)(I.top)&&(R=Math.max(R,I.top)),[E,R]}function r(C,E,R){const I=Math.round(E/C[0])*C[0],S=Math.round(R/C[1])*C[1];return[I,S]}function a(C){return C.props.axis==="both"||C.props.axis==="x"}function o(C){return C.props.axis==="both"||C.props.axis==="y"}function c(C,E,R){const I=typeof E=="number"?(0,t.getTouch)(C,E):null;if(typeof E=="number"&&!I)return null;const S=m(R),p=R.props.offsetParent||S.offsetParent||S.ownerDocument.body;return(0,t.offsetXYFromParent)(I||C,p,R.props.scale)}function y(C,E,R){const I=!(0,e.isNum)(C.lastX),S=m(C);return I?{node:S,deltaX:0,deltaY:0,lastX:E,lastY:R,x:E,y:R}:{node:S,deltaX:E-C.lastX,deltaY:R-C.lastY,lastX:C.lastX,lastY:C.lastY,x:E,y:R}}function h(C,E){const R=C.props.scale;return{node:E.node,x:C.state.x+E.deltaX/R,y:C.state.y+E.deltaY/R,deltaX:E.deltaX/R,deltaY:E.deltaY/R,lastX:C.state.x,lastY:C.state.y}}function T(C){return{left:C.left,top:C.top,right:C.right,bottom:C.bottom}}function m(C){const E=C.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=e;function e(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var e=T(V),t=y(Ee()),n=y(At),r=ar(),a=Nr(),o=yt(),c=y(Vr());function y(p){return p&&p.__esModule?p:{default:p}}function h(p){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(h=function(f){return f?s:i})(p)}function T(p,i){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var s=h(i);if(s&&s.has(p))return s.get(p);var f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in p)if(l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)){var g=b?Object.getOwnPropertyDescriptor(p,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=p[l]}return f.default=p,s&&s.set(p,f),f}function m(p,i,s){return i=C(i),i in p?Object.defineProperty(p,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):p[i]=s,p}function C(p){var i=E(p,"string");return typeof i=="symbol"?i:String(i)}function E(p,i){if(typeof p!="object"||p===null)return p;var s=p[Symbol.toPrimitive];if(s!==void 0){var f=s.call(p,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(p)}const R={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let I=R.mouse,S=class extends e.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(0,c.default)("DraggableCore: handleDragStart: %j",v),(0,c.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,I.move,this.handleDrag),(0,r.addEvent)(f,I.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);if((0,c.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,D=b-this.lastY||0;[v,D]=(0,a.snapToGrid)(this.props.grid,v,D),f=this.lastX+v,b=this.lastY+D}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,c.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,c.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,I.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,I.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(I=R.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(I=R.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(I=R.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(I=R.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,R.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,R.mouse.move,this.handleDrag),(0,r.removeEvent)(s,R.touch.move,this.handleDrag),(0,r.removeEvent)(s,R.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,R.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,R.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:n.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=S,m(S,"displayName","DraggableCore"),m(S,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(p,i){if(p[i]&&p[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(S,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return h.default}}),e.default=void 0;var t=E(V),n=m(Ee()),r=m(At),a=m(An),o=ar(),c=Nr(),y=yt(),h=m(jn()),T=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function C(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(C=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=C(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function R(){return R=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},R.apply(this,arguments)}function I(s,f,b){return f=S(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function S(s){var f=p(s,"string");return typeof f=="symbol"?f:String(f)}function p(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends t.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,T.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),I(this,"onDragStart",(b,l)=>{if((0,T.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,c.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),I(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,T.default)("Draggable: onDrag: %j",l);const g=(0,c.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:D,y:M}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[U,z]=(0,c.getBoundPosition)(this,d.x,d.y);d.x=U,d.y=z,d.slackX=this.state.slackX+(D-d.x),d.slackY=this.state.slackY+(M-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),I(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,c.createDraggableData)(this,l))===!1)return!1;(0,T.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:D,y:M}=this.props.position;d.x=D,d.y=M}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:D,position:M,positionOffset:U,scale:z,...O}=this.props;let L={},B=null;const $=!!!M||this.state.dragging,ie=M||g,oe={x:(0,c.canDragX)(this)&&$?this.state.x:ie.x,y:(0,c.canDragY)(this)&&$?this.state.y:ie.y};this.state.isElementSVG?B=(0,o.createSVGTransform)(oe,U):L=(0,o.createCSSTransform)(oe,U);const ce=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[D]:this.state.dragged});return t.createElement(h.default,R({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(l),{className:ce,style:{...l.props.style,...L},transform:B}))}}e.default=i,I(i,"displayName","Draggable"),I(i,"propTypes",{...h.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),I(i,"defaultProps",{...h.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(nr)),nr}var kr;function or(){if(kr)return $e.exports;kr=1;const{default:e,DraggableCore:t}=Hn();return $e.exports=e,$e.exports.default=e,$e.exports.DraggableCore=t,$e.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var e=t(V);function t(h){return h&&h.__esModule?h:{default:h}}function n(h,T){var m=Object.keys(h);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(h);T&&(C=C.filter(function(E){return Object.getOwnPropertyDescriptor(h,E).enumerable})),m.push.apply(m,C)}return m}function r(h){for(var T=1;T<arguments.length;T++){var m=arguments[T]!=null?arguments[T]:{};T%2?n(Object(m),!0).forEach(function(C){a(h,C,m[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(C){Object.defineProperty(h,C,Object.getOwnPropertyDescriptor(m,C))})}return h}function a(h,T,m){return T=o(T),T in h?Object.defineProperty(h,T,{value:m,enumerable:!0,configurable:!0,writable:!0}):h[T]=m,h}function o(h){var T=c(h,"string");return typeof T=="symbol"?T:String(T)}function c(h,T){if(typeof h!="object"||h===null)return h;var m=h[Symbol.toPrimitive];if(m!==void 0){var C=m.call(h,T);if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(h)}function y(h,T){return T.style&&h.props.style&&(T.style=r(r({},h.props.style),T.style)),T.className&&h.props.className&&(T.className=h.props.className+" "+T.className),e.default.cloneElement(h,T)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var e=t(Ee());or();function t(r){return r&&r.__esModule?r:{default:r}}var n={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];var y=o[0];if(y.axis==="both"||y.axis==="y"){var h;return(h=e.default.number).isRequired.apply(h,o)}return e.default.number.apply(e.default,o)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];var y=o[0];if(y.axis==="both"||y.axis==="x"){var h;return(h=e.default.number).isRequired.apply(h,o)}return e.default.number.apply(e.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var e=c(V),t=or(),n=Bn(),r=jr(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(o=function(l){return l?f:s})(i)}function c(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function h(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function T(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?T(Object(f),!0).forEach(function(b){C(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):T(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function C(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=R(i,"string");return typeof s=="symbol"?s:String(s)}function R(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function I(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,S(i,s)}function S(i,s){return S=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},S(i,s)}var p=function(i){I(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,D=d.maxConstraints,M=d.lockAspectRatio;if(!v&&!D&&!M)return[l,g];if(M){var U=this.props.width/this.props.height,z=l-this.props.width,O=g-this.props.height;Math.abs(z)>Math.abs(O*U)?g=l/U:l=g*U}var L=l,B=g,q=this.slack||[0,0],$=q[0],ie=q[1];return l+=$,g+=ie,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),D&&(l=Math.min(D[0],l),g=Math.min(D[1],g)),this.slack=[$+(L-l),ie+(B-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,D){var M=D.node,U=D.deltaX,z=D.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var B=g[0],q=g[g.length-1],$=M.getBoundingClientRect();if(d.lastHandleRect!=null){if(q==="w"){var ie=$.left-d.lastHandleRect.left;U+=ie}if(B==="n"){var oe=$.top-d.lastHandleRect.top;z+=oe}}d.lastHandleRect=$,q==="w"&&(U=-U),B==="n"&&(z=-z);var ce=d.props.width+(O?U/d.props.transformScale:0),W=d.props.height+(L?z/d.props.transformScale:0),ee=d.runConstraints(ce,W);ce=ee[0],W=ee[1];var ne=ce!==d.props.width||W!==d.props.height,le=typeof d.props[l]=="function"?d.props[l]:null,fe=l==="onResize"&&!ne;le&&!fe&&(v.persist==null||v.persist(),le(v,{node:M,size:{width:ce,height:W},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",D=m({ref:g},v?{}:{handleAxis:l});return e.cloneElement(d,D)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,D=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var M=g.resizeHandles;g.transformScale;var U=h(g,a);return(0,n.cloneElement)(d,m(m({},U),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,M.map(function(z){var O,L=(O=l.handleRefs[z])!=null?O:l.handleRefs[z]=e.createRef();return e.createElement(t.DraggableCore,y({},D,{nodeRef:L,key:"resizableHandle-"+z,onStop:l.resizeHandler("onResizeStop",z),onStart:l.resizeHandler("onResizeStart",z),onDrag:l.resizeHandler("onResize",z)}),l.renderResizeHandle(z,L))}))}))},s}(e.Component);return et.default=p,p.propTypes=r.resizableProps,p.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var e=y(V),t=o(Ee()),n=o(Br()),r=jr(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function c(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(c=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=c(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function h(){return h=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},h.apply(this,arguments)}function T(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?T(Object(b),!0).forEach(function(l){C(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):T(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function C(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=R(s,"string");return typeof f=="symbol"?f:String(f)}function R(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function I(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function S(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,p(s,f)}function p(s,f){return p=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},p(s,f)}var i=function(s){S(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(D,M){var U=M.size;l.props.onResize?(D.persist==null||D.persist(),l.setState(U,function(){return l.props.onResize&&l.props.onResize(D,M)})):l.setState(U)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var D=g.onResizeStart,M=g.onResizeStop,U=g.draggableOpts,z=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,B=g.axis;g.width,g.height;var q=g.resizeHandles,$=g.style,ie=g.transformScale,oe=I(g,a);return e.createElement(n.default,{axis:B,draggableOpts:U,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:z,onResizeStart:D,onResize:this.onResize,onResizeStop:M,resizeHandles:q,transformScale:ie,width:this.state.width},e.createElement("div",h({},oe,{style:m(m({},$),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(e.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:t.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var e=n(Ee()),t=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return _e.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(o){o.verticalCompact},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(o){var c=o.layout;c!==void 0&&ze().validateLayout(c,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:r,resizeHandle:a,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(o,c){const y=o[c],h={};t.default.Children.forEach(y,function(T){if((T==null?void 0:T.key)!=null){if(h[T.key])throw new Error('Duplicate child key "'+T.key+'" found! This will cause problems in ReactGridLayout.');h[T.key]=!0}})},innerRef:e.default.any},_e}var Yr;function qn(){if(Yr)return Ze;Yr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var e=T(V),t=At,n=T(Ee()),r=or(),a=Gn(),o=ze(),c=Qt(),y=Xr(),h=T($t());function T(I){return I&&I.__esModule?I:{default:I}}function m(I,S,p){return S=C(S),S in I?Object.defineProperty(I,S,{value:p,enumerable:!0,configurable:!0,writable:!0}):I[S]=p,I}function C(I){var S=E(I,"string");return typeof S=="symbol"?S:String(S)}function E(I,S){if(typeof I!="object"||I===null)return I;var p=I[Symbol.toPrimitive];if(p!==void 0){var i=p.call(I,S);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let R=class extends e.default.Component{constructor(){super(...arguments),m(this,"state",{resizing:null,dragging:null,className:""}),m(this,"elementRef",e.default.createRef()),m(this,"onDragStart",(S,p)=>{let{node:i}=p;const{onDragStart:s,transformScale:f}=this.props;if(!s)return;const b={top:0,left:0},{offsetParent:l}=i;if(!l)return;const g=l.getBoundingClientRect(),d=i.getBoundingClientRect(),v=d.left/f,D=g.left/f,M=d.top/f,U=g.top/f;b.left=v-D+l.scrollLeft,b.top=M-U+l.scrollTop,this.setState({dragging:b});const{x:z,y:O}=(0,c.calcXY)(this.getPositionParams(),b.top,b.left,this.props.w,this.props.h);return s.call(this,this.props.i,z,O,{e:S,node:i,newPosition:b})}),m(this,"onDrag",(S,p,i)=>{let{node:s,deltaX:f,deltaY:b}=p;const{onDrag:l}=this.props;if(!l)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let g=this.state.dragging.top+b,d=this.state.dragging.left+f;const{isBounded:v,i:D,w:M,h:U,containerWidth:z}=this.props,O=this.getPositionParams();if(v){const{offsetParent:$}=s;if($){const{margin:ie,rowHeight:oe,containerPadding:ce}=this.props,W=$.clientHeight-(0,c.calcGridItemWHPx)(U,oe,ie[1]);g=(0,c.clamp)(g-ce[1],0,W);const ee=(0,c.calcGridColWidth)(O),ne=z-(0,c.calcGridItemWHPx)(M,ee,ie[0]);d=(0,c.clamp)(d-ce[0],0,ne)}}const L={top:g,left:d};i?this.setState({dragging:L}):(0,t.flushSync)(()=>{this.setState({dragging:L})});const{x:B,y:q}=(0,c.calcXY)(O,g,d,M,U);return l.call(this,D,B,q,{e:S,node:s,newPosition:L})}),m(this,"onDragStop",(S,p)=>{let{node:i}=p;const{onDragStop:s}=this.props;if(!s)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:f,h:b,i:l}=this.props,{left:g,top:d}=this.state.dragging,v={top:d,left:g};this.setState({dragging:null});const{x:D,y:M}=(0,c.calcXY)(this.getPositionParams(),d,g,f,b);return s.call(this,l,D,M,{e:S,node:i,newPosition:v})}),m(this,"onResizeStop",(S,p,i)=>this.onResizeHandler(S,p,i,"onResizeStop")),m(this,"onResizeStart",(S,p,i)=>this.onResizeHandler(S,p,i,"onResizeStart")),m(this,"onResize",(S,p,i)=>this.onResizeHandler(S,p,i,"onResize"))}shouldComponentUpdate(S,p){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const i=(0,c.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),s=(0,c.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,p);return!(0,o.fastPositionEqual)(i,s)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:p}=this.props;if(!p)return;const i=this.elementRef.current;if(!i)return;const s=S.droppingPosition||{left:0,top:0},{dragging:f}=this.state,b=f&&p.left!==s.left||p.top!==s.top;if(!f)this.onDragStart(p.e,{node:i,deltaX:p.left,deltaY:p.top});else if(b){const l=p.left-f.left,g=p.top-f.top;this.onDrag(p.e,{node:i,deltaX:l,deltaY:g},!0)}}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:p,containerWidth:i,useCSSTransforms:s}=this.props;let f;return s?f=(0,o.setTransform)(S):(f=(0,o.setTopLeft)(S),p&&(f.left=(0,o.perc)(S.left/i),f.width=(0,o.perc)(S.width/i))),f}mixinDraggable(S,p){return e.default.createElement(r.DraggableCore,{disabled:!p,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,p){return(i,s)=>p(i,s,S)}mixinResizable(S,p,i){const{cols:s,minW:f,minH:b,maxW:l,maxH:g,transformScale:d,resizeHandles:v,resizeHandle:D}=this.props,M=this.getPositionParams(),U=(0,c.calcGridItemPosition)(M,0,0,s,0).width,z=(0,c.calcGridItemPosition)(M,0,0,f,b),O=(0,c.calcGridItemPosition)(M,0,0,l,g),L=[z.width,z.height],B=[Math.min(O.width,U),Math.min(O.height,1/0)];return e.default.createElement(a.Resizable,{draggableOpts:{disabled:!i},className:i?void 0:"react-resizable-hide",width:p.width,height:p.height,minConstraints:L,maxConstraints:B,onResizeStop:this.curryResizeHandler(p,this.onResizeStop),onResizeStart:this.curryResizeHandler(p,this.onResizeStart),onResize:this.curryResizeHandler(p,this.onResize),transformScale:d,resizeHandles:v,handle:D},S)}onResizeHandler(S,p,i,s){let{node:f,size:b,handle:l}=p;const g=this.props[s];if(!g)return;const{x:d,y:v,i:D,maxH:M,minH:U,containerWidth:z}=this.props,{minW:O,maxW:L}=this.props;let B=b;f&&(B=(0,o.resizeItemInDirection)(l,i,b,z),(0,t.flushSync)(()=>{this.setState({resizing:s==="onResizeStop"?null:B})}));let{w:q,h:$}=(0,c.calcWH)(this.getPositionParams(),B.width,B.height,d,v,l);q=(0,c.clamp)(q,Math.max(O,1),L),$=(0,c.clamp)($,U,M),g.call(this,D,q,$,{e:S,node:f,size:B,handle:l})}render(){const{x:S,y:p,w:i,h:s,isDraggable:f,isResizable:b,droppingPosition:l,useCSSTransforms:g}=this.props,d=(0,c.calcGridItemPosition)(this.getPositionParams(),S,p,i,s,this.state),v=e.default.Children.only(this.props.children);let D=e.default.cloneElement(v,{ref:this.elementRef,className:(0,h.default)("react-grid-item",v.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":f,"react-draggable-dragging":!!this.state.dragging,dropping:!!l,cssTransforms:g}),style:{...this.props.style,...v.props.style,...this.createStyle(d)}});return D=this.mixinResizable(D,d,b),D=this.mixinDraggable(D,f),D}};return Ze.default=R,m(R,"propTypes",{children:n.default.element,cols:n.default.number.isRequired,containerWidth:n.default.number.isRequired,rowHeight:n.default.number.isRequired,margin:n.default.array.isRequired,maxRows:n.default.number.isRequired,containerPadding:n.default.array.isRequired,x:n.default.number.isRequired,y:n.default.number.isRequired,w:n.default.number.isRequired,h:n.default.number.isRequired,minW:function(I,S){const p=I[S];if(typeof p!="number")return new Error("minWidth not Number");if(p>I.w||p>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const p=I[S];if(typeof p!="number")return new Error("maxWidth not Number");if(p<I.w||p<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const p=I[S];if(typeof p!="number")return new Error("minHeight not Number");if(p>I.h||p>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const p=I[S];if(typeof p!="number")return new Error("maxHeight not Number");if(p<I.h||p<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:n.default.string.isRequired,resizeHandles:y.resizeHandleAxesType,resizeHandle:y.resizeHandleType,onDragStop:n.default.func,onDragStart:n.default.func,onDrag:n.default.func,onResizeStop:n.default.func,onResizeStart:n.default.func,onResize:n.default.func,isDraggable:n.default.bool.isRequired,isResizable:n.default.bool.isRequired,isBounded:n.default.bool.isRequired,static:n.default.bool,useCSSTransforms:n.default.bool.isRequired,transformScale:n.default.number,className:n.default.string,handle:n.default.string,cancel:n.default.string,droppingPosition:n.default.shape({e:n.default.object.isRequired,left:n.default.number.isRequired,top:n.default.number.isRequired})}),m(R,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Ze}var Kr;function Zr(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var e=T(V),t=Zt(),n=y($t()),r=ze(),a=Qt(),o=y(qn()),c=y(Xr());function y(p){return p&&p.__esModule?p:{default:p}}function h(p){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(h=function(f){return f?s:i})(p)}function T(p,i){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var s=h(i);if(s&&s.has(p))return s.get(p);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in p)if(l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)){var g=b?Object.getOwnPropertyDescriptor(p,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=p[l]}return f.default=p,s&&s.set(p,f),f}function m(p,i,s){return i=C(i),i in p?Object.defineProperty(p,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):p[i]=s,p}function C(p){var i=E(p,"string");return typeof i=="symbol"?i:String(i)}function E(p,i){if(typeof p!="object"||p===null)return p;var s=p[Symbol.toPrimitive];if(s!==void 0){var f=s.call(p,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(p)}const R="react-grid-layout";let I=!1;try{I=/firefox/i.test(navigator.userAgent)}catch{}let S=class extends e.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const D={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:D}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:D,allowOverlap:M,preventCollision:U}=this.props,z=(0,r.getLayoutItem)(v,i);if(!z)return;const O={w:z.w,h:z.h,x:z.x,y:z.y,placeholder:!0,i};v=(0,r.moveElement)(v,z,s,f,!0,U,(0,r.compactType)(this.props),D,M),this.props.onDrag(v,d,z,O,l,g),this.setState({layout:M?v:(0,r.compact)(v,(0,r.compactType)(this.props),D),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:D,preventCollision:M,allowOverlap:U}=this.props,z=(0,r.getLayoutItem)(v,i);if(!z)return;v=(0,r.moveElement)(v,z,s,f,!0,M,(0,r.compactType)(this.props),D,U);const L=U?v:(0,r.compact)(v,(0,r.compactType)(this.props),D);this.props.onDragStop(L,d,z,null,l,g);const{oldLayout:B}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,B)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:D}=this.state,{layout:M}=this.state,{cols:U,preventCollision:z,allowOverlap:O}=this.props;let L=!1,B,q,$;const[ie,oe]=(0,r.withLayoutItem)(M,i,W=>{let ee;return q=W.x,$=W.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(q=W.x+(W.w-s),s=W.x!==q&&q<0?W.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(v)!==-1&&($=W.y+(W.h-f),f=W.y!==$&&$<0?W.h:f,$=$<0?0:$),L=!0),z&&!O&&(ee=(0,r.getAllCollisions)(M,{...W,w:s,h:f,x:q,y:$}).filter(le=>le.i!==W.i).length>0,ee&&($=W.y,f=W.h,q=W.x,s=W.w,L=!1)),W.w=s,W.h=f,W});if(!oe)return;B=ie,L&&(B=(0,r.moveElement)(ie,oe,q,$,!0,this.props.preventCollision,(0,r.compactType)(this.props),U,O));const ce={w:oe.w,h:oe.h,x:oe.x,y:oe.y,static:!0,i};this.props.onResize(B,D,oe,ce,l,g),this.setState({layout:O?B:(0,r.compact)(B,(0,r.compactType)(this.props),U),activeDrag:ce})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:D,allowOverlap:M}=this.props,U=(0,r.getLayoutItem)(d,i),z=M?d:(0,r.compact)(d,(0,r.compactType)(this.props),D);this.props.onResizeStop(z,v,U,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:z,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(z,O)}),m(this,"onDragOver",i=>{var ie;if(i.preventDefault(),i.stopPropagation(),I&&!((ie=i.nativeEvent.target)!=null&&ie.classList.contains(R)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:D,transformScale:M}=this.props,U=f==null?void 0:f(i);if(U===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const z={...s,...U},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),B=i.clientX-L.left,q=i.clientY-L.top,$={left:B/M,top:q/M,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:oe,top:ce}=this.state.droppingPosition;(oe!=B||ce!=q)&&this.setState({droppingPosition:$})}}else{const oe={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:D||b},ce=(0,a.calcXY)(oe,q,B,z.w,z.h);this.setState({droppingDOMNode:e.createElement("div",{key:z.i}),droppingPosition:$,layout:[...O,{...z,x:ce.x,y:ce.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,t.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.fastRGLPropsEqual)(this.props,i,t.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,t.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:D}=this.props;return e.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:D},e.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:D,isDraggable:M,isResizable:U,isBounded:z,useCSSTransforms:O,transformScale:L,draggableCancel:B,draggableHandle:q,resizeHandles:$,resizeHandle:ie}=this.props,{mounted:oe,droppingPosition:ce}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&M,ee=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&U,ne=f.resizeHandles||$,le=W&&z&&f.isBounded!==!1;return e.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:D,rowHeight:v,cancel:B,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:ee,isBounded:le,useCSSTransforms:O&&oe,usePercentages:!oe,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?ce:void 0,resizeHandles:ne,resizeHandle:ie},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(R,i),g={height:this.containerHeight(),...s};return e.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},e.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=S,m(S,"displayName","ReactGridLayout"),m(S,"propTypes",c.default),m(S,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},De={},$r;function Jr(){if($r)return De;$r=1,Object.defineProperty(De,"__esModule",{value:!0}),De.findOrGenerateResponsiveLayout=r,De.getBreakpointFromWidth=t,De.getColsFromBreakpoint=n,De.sortBreakpoints=a;var e=ze();function t(o,c){const y=a(o);let h=y[0];for(let T=1,m=y.length;T<m;T++){const C=y[T];c>o[C]&&(h=C)}return h}function n(o,c){if(!c[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return c[o]}function r(o,c,y,h,T,m){if(o[y])return(0,e.cloneLayout)(o[y]);let C=o[h];const E=a(c),R=E.slice(E.indexOf(y));for(let I=0,S=R.length;I<S;I++){const p=R[I];if(o[p]){C=o[p];break}}return C=(0,e.cloneLayout)(C||[]),(0,e.compact)((0,e.correctBounds)(C,{cols:T}),m,T)}function a(o){return Object.keys(o).sort(function(y,h){return o[y]-o[h]})}return De}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var e=h(V),t=c(Ee()),n=Zt(),r=ze(),a=Jr(),o=c(Zr());function c(p){return p&&p.__esModule?p:{default:p}}function y(p){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:i})(p)}function h(p,i){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var s=y(i);if(s&&s.has(p))return s.get(p);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in p)if(l!=="default"&&Object.prototype.hasOwnProperty.call(p,l)){var g=b?Object.getOwnPropertyDescriptor(p,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=p[l]}return f.default=p,s&&s.set(p,f),f}function T(){return T=Object.assign?Object.assign.bind():function(p){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(p[f]=s[f])}return p},T.apply(this,arguments)}function m(p,i,s){return i=C(i),i in p?Object.defineProperty(p,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):p[i]=s,p}function C(p){var i=E(p,"string");return typeof i=="symbol"?i:String(i)}function E(p,i){if(typeof p!="object"||p===null)return p;var s=p[Symbol.toPrimitive];if(s!==void 0){var f=s.call(p,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(p)}const R=p=>Object.prototype.toString.call(p);function I(p,i){return p==null?null:Array.isArray(p)?p:p[i]}let S=class extends e.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),D={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in D||(D[d]=(0,r.cloneLayout)(this.state.layout));let z=(0,a.findOrGenerateResponsiveLayout)(D,s,g,d,v,l);z=(0,r.synchronizeLayoutWithChildren)(z,this.props.children,v,l,this.props.allowOverlap),D[g]=z,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(z,D),this.setState({breakpoint:g,layout:z,cols:v})}const M=I(this.props.margin,g),U=I(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,M,v,U)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:D,...M}=this.props;return e.createElement(o.default,T({},M,{margin:I(l,this.state.breakpoint),containerPadding:I(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=S,m(S,"propTypes",{breakpoint:t.default.string,breakpoints:t.default.object,allowOverlap:t.default.bool,cols:t.default.object,margin:t.default.oneOfType([t.default.array,t.default.object]),containerPadding:t.default.oneOfType([t.default.array,t.default.object]),layouts(p,i){if(R(p[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+R(p[i]));Object.keys(p[i]).forEach(s=>{if(!(s in p.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(p.layouts[s],"layouts."+s)})},width:t.default.number.isRequired,onBreakpointChange:t.default.func,onLayoutChange:t.default.func,onWidthChange:t.default.func}),m(S,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function e(t,n){var r=-1;return t.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(n){var r=e(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},t.prototype.set=function(n,r){var a=e(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},t.prototype.delete=function(n){var r=this.__entries__,a=e(r,n);~a&&r.splice(a,1)},t.prototype.has=function(n){return!!~e(this.__entries__,n)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var c=o[a];n.call(r,c[1],c[0])}},t}()}(),ir=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),Kn=2;function Zn(e,t){var n=!1,r=!1,a=0;function o(){n&&(n=!1,e()),r&&y()}function c(){Yn(o)}function y(){var h=Date.now();if(n){if(h-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(c,t);a=h}return y}var $n=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Zn(this.refresh.bind(this),$n)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var n=this.observers_,r=n.indexOf(t);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return t.forEach(function(n){return n.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!ir||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!ir||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var n=t.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),tn=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n++){var a=r[n];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ke=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Tt},rn=It(0,0,0,0);function wt(e){return parseFloat(e)||0}function nn(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.reduce(function(r,a){var o=e["border-"+a+"-width"];return r+wt(o)},0)}function ta(e){for(var t=["top","right","bottom","left"],n={},r=0,a=t;r<a.length;r++){var o=a[r],c=e["padding-"+o];n[o]=wt(c)}return n}function ra(e){var t=e.getBBox();return It(0,0,t.width,t.height)}function na(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return rn;var r=ke(e).getComputedStyle(e),a=ta(r),o=a.left+a.right,c=a.top+a.bottom,y=wt(r.width),h=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==t&&(y-=nn(r,"left","right")+o),Math.round(h+c)!==n&&(h-=nn(r,"top","bottom")+c)),!oa(e)){var T=Math.round(y+o)-t,m=Math.round(h+c)-n;Math.abs(T)!==1&&(y-=T),Math.abs(m)!==1&&(h-=m)}return It(a.left,a.top,y,h)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ke(e).SVGGraphicsElement}:function(e){return e instanceof ke(e).SVGElement&&typeof e.getBBox=="function"}}();function oa(e){return e===ke(e).document.documentElement}function ia(e){return ir?aa(e)?ra(e):na(e):rn}function sa(e){var t=e.x,n=e.y,r=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,c=Object.create(o.prototype);return tn(c,{x:t,y:n,width:r,height:a,top:n,right:t+r,bottom:a+n,left:t}),c}function It(e,t,n,r){return{x:e,y:t,width:n,height:r}}var la=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ia(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ca=function(){function e(t,n){var r=sa(n);tn(this,{target:t,contentRect:r})}return e}(),ua=function(){function e(t,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=n,this.callbackCtx_=r}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)||(n.set(t,new la(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(t)&&(n.delete(t),n.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&t.activeObservations_.push(n)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(t,n,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ea.getInstance(),r=new ua(t,n,this);an.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach(function(e){on.prototype[e]=function(){var t;return(t=an.get(this))[e].apply(t,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var e=c(V),t=a(Ee()),n=a(fa),r=a($t());function a(R){return R&&R.__esModule?R:{default:R}}function o(R){if(typeof WeakMap!="function")return null;var I=new WeakMap,S=new WeakMap;return(o=function(p){return p?S:I})(R)}function c(R,I){if(R&&R.__esModule)return R;if(R===null||typeof R!="object"&&typeof R!="function")return{default:R};var S=o(I);if(S&&S.has(R))return S.get(R);var p={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in R)if(s!=="default"&&Object.prototype.hasOwnProperty.call(R,s)){var f=i?Object.getOwnPropertyDescriptor(R,s):null;f&&(f.get||f.set)?Object.defineProperty(p,s,f):p[s]=R[s]}return p.default=R,S&&S.set(R,p),p}function y(){return y=Object.assign?Object.assign.bind():function(R){for(var I=1;I<arguments.length;I++){var S=arguments[I];for(var p in S)Object.prototype.hasOwnProperty.call(S,p)&&(R[p]=S[p])}return R},y.apply(this,arguments)}function h(R,I,S){return I=T(I),I in R?Object.defineProperty(R,I,{value:S,enumerable:!0,configurable:!0,writable:!0}):R[I]=S,R}function T(R){var I=m(R,"string");return typeof I=="symbol"?I:String(I)}function m(R,I){if(typeof R!="object"||R===null)return R;var S=R[Symbol.toPrimitive];if(S!==void 0){var p=S.call(R,I);if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(I==="string"?String:Number)(R)}const C="react-grid-layout";function E(R){var I;return I=class extends e.Component{constructor(){super(...arguments),h(this,"state",{width:1280}),h(this,"elementRef",e.createRef()),h(this,"mounted",!1),h(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});const p=this.elementRef.current;p instanceof HTMLElement&&this.resizeObserver.observe(p)}componentWillUnmount(){this.mounted=!1;const p=this.elementRef.current;p instanceof HTMLElement&&this.resizeObserver.unobserve(p),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:p,...i}=this.props;return p&&!this.mounted?e.createElement("div",{className:(0,r.default)(this.props.className,C),style:this.props.style,ref:this.elementRef}):e.createElement(R,y({innerRef:this.elementRef},i,this.state))}},h(I,"defaultProps",{measureBeforeMount:!1}),h(I,"propTypes",{measureBeforeMount:t.default.bool}),I}return Ct}var ln;function ha(){return ln||(ln=1,function(e){e.exports=Zr().default,e.exports.utils=ze(),e.exports.calculateUtils=Qt(),e.exports.Responsive=Xn().default,e.exports.Responsive.utils=Jr(),e.exports.WidthProvider=pa().default}(Kt)),Kt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(e,t,n,r)=>{for(var a=r>1?void 0:r?ma(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},ba=(e,t)=>(n,r)=>t(n,r,e);let Ae=class extends w.Disposable{constructor(t){super();xe(this,"_initLocal",()=>{});xe(this,"_findReplaceIndex",t=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(t);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(t);return r});this._localeService=t,this._initLocal()}tWithReactNode(t,...n){const r=this._localeService.getLocales(),a=t.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const c=[];return this._findReplaceIndex(o).forEach((y,h,T)=>{const m=T[h-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const C=o.slice(m.endIndex+1,y.startIndex);C&&c.push(C)}if(n[y.key]&&c.push(n[y.key]),h===T.length-1){const C=o.slice(y.endIndex+1);C&&c.push(C)}}),c}return[]}};Ae=ya([ba(0,w.Inject(w.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=e=>{var a,o;const t=e.rule;if(!t)return null;const n=V.useMemo(()=>{if(t.type===u.CFRuleType.colorScale){const c=t.config.map((T,m)=>({color:new w.ColorKit(T.color),value:m})),y=c.length-1;return new Array(5).fill("").map((T,m,C)=>m*y/(C.length-1)).map(T=>u.getColorScaleFromValue(c,T))}return null},[t]),r=V.useMemo(()=>{if(t.type===u.CFRuleType.iconSet)return t.config.map(c=>{const y=u.iconMap[c.iconType];return y&&y[Number(c.iconId)]})},[t]);switch(t.type){case u.CFRuleType.dataBar:{const{isGradient:c}=t.config,y={width:"50%",height:"100%"},h=c?`linear-gradient(to right, ${t.config.positiveColor||u.defaultDataBarPositiveColor}, rgb(255 255 255))`:t.config.positiveColor,T=c?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor||u.defaultDataBarNativeColor})`:t.config.nativeColor;return _.jsxs("div",{className:_t.cfPreview,children:[_.jsx("div",{style:{...y,background:T,border:`1px solid ${t.config.nativeColor||u.defaultDataBarNativeColor}`}}),_.jsx("div",{style:{...y,background:h,border:`1px solid ${t.config.positiveColor||u.defaultDataBarPositiveColor}`}})]})}case u.CFRuleType.colorScale:return n&&_.jsx("div",{className:_t.cfPreview,children:n.map((c,y)=>_.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:c}},y))});case u.CFRuleType.iconSet:return r&&_.jsx("div",{className:_t.cfPreview,children:r.map((c,y)=>c?_.jsx("img",{style:{height:"100%"},src:c},y):_.jsx(Xe,{},y))});case u.CFRuleType.highlightCell:{const{ul:c,st:y,it:h,bl:T,bg:m,cl:C}=t.style,E=(c==null?void 0:c.s)===w.BooleanNumber.TRUE,R=(y==null?void 0:y.s)===w.BooleanNumber.TRUE,I=h===w.BooleanNumber.TRUE,S=T===w.BooleanNumber.TRUE,p=(a=m==null?void 0:m.rgb)!=null?a:u.DEFAULT_BG_COLOR,i=(o=C==null?void 0:C.rgb)!=null?o:u.DEFAULT_FONT_COLOR,s={fontWeight:S?"bold":void 0,fontStyle:I?"italic":void 0,textDecoration:`${E?"underline":""} ${R?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:p,color:i};return _.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},ge={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap"},Sa=(e,t)=>{const n=e.rule;switch(n.type){case u.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case u.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case u.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case u.CFRuleType.highlightCell:switch(n.subType){case u.CFSubRuleType.average:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,t.t("sheet.cf.subRuleType.average"))}case u.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case u.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case u.CFSubRuleType.number:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case u.CFSubRuleType.text:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case u.CFSubRuleType.timePeriod:{const r=n.operator;return t.t(`sheet.cf.preview.describe.${r}`)}case u.CFSubRuleType.rank:return n.isPercent?n.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):t.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(n.value)):t.t("sheet.cf.preview.describe.topN",String(n.value));case u.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=e=>{const{onClick:t}=e,n=te.useDependency(u.ConditionalFormattingRuleModel),r=te.useDependency(w.IUniverInstanceService),a=te.useDependency(Y.SheetsSelectionsService),o=te.useDependency(w.ICommandService),c=te.useDependency(w.LocaleService),y=te.useDependency(w.Injector),h=te.useDependency(te.ISidebarService),T=te.useDependency(Ae),m=te.useObservable(()=>r.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),C=m.getUnitId(),E=m.getActiveSheet();if(!E)throw new Error("No active sheet found");const R=E.getSheetId(),[I,S]=V.useState([]),[p,i]=V.useState("2"),[s,f]=V.useState(0),[b,l]=V.useState(-1),[g,d]=V.useState(cn),v=V.useRef(null),D=[{label:c.t("sheet.cf.panel.workSheet"),value:"2"},{label:c.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const W=n.getSubunitRules(C,R);if(!W||!W.length)return[];if(p==="1"){const ee=a.getCurrentLastSelection();if(!ee)return[];const ne=ee.range;return W.filter(fe=>fe.ranges.some(ve=>w.Rectangle.intersects(ve,ne)))}else if(p==="2")return[...W];return[]},[U,z]=V.useState(M);pe.useHighlightRange(I),V.useEffect(()=>{const W=o.onCommandExecuted(ee=>{ee.id===Y.SetWorksheetActiveOperation.id&&f(Math.random())});return()=>W.dispose()}),V.useEffect(()=>{z(M)},[p,s,C,R]),V.useEffect(()=>{if(p==="2")return;const W=new Ce.Observable(ee=>{const ne=[Y.SetSelectionsOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],le=o.onCommandExecuted(fe=>{const{id:ve,params:Te}=fe,H=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ve)&&Te.unitId===H&&ee.next(null)});return()=>le.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(M)});return()=>{W.unsubscribe()}},[r,p,C,R]),V.useEffect(()=>{const W=n.$ruleChange.subscribe(()=>{f(Math.random())});return()=>W.unsubscribe()},[n]),V.useEffect(()=>{const W=()=>{var fe,ve;const le=Math.max(0,((ve=(fe=v.current)==null?void 0:fe.getBoundingClientRect().width)!=null?ve:0)-8);return cn=le,le},ne=new Ce.Observable(le=>{const fe=h.getContainer();if(fe){let ve=setTimeout(()=>{le.next()},150);const Te=()=>{ve&&clearTimeout(ve),ve=null},H=J=>{J.propertyName==="width"&&(Te(),le.next())};return fe.addEventListener("transitionend",H),()=>{Te(),fe.removeEventListener("transitionend",H)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{d(W())});return()=>{ne.unsubscribe()}},[]);const O=W=>{var le;const ee=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(le=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:le.getSheetId();if(!ee||!ne)throw new Error("No active sheet found");o.executeCommand(u.DeleteCfCommand.id,{unitId:ee,subUnitId:ne,cfId:W.cfId})},L=(W,ee)=>{l(ee.y)},B=(W,ee,ne)=>{var J;l(-1);const le=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),fe=(J=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:J.getSheetId();if(!le||!fe)throw new Error("No active sheet found");const ve=se=>{const P=U.length;return Math.min(P-1,Math.max(0,se))},Te=U[ve(ee.y)].cfId,H=U[ve(ne.y)].cfId;Te!==H&&o.executeCommand(u.MoveCfCommand.id,{unitId:le,subUnitId:fe,start:{id:Te,type:"self"},end:{id:H,type:ne.y>ee.y?"after":"before"}})},q=()=>{e.onCreate()},$=()=>{p==="2"?o.executeCommand(u.ClearWorksheetCfCommand.id):p==="1"&&U.map(ee=>({unitId:C,subUnitId:R,cfId:ee.cfId})).forEach(ee=>{o.executeCommand(u.DeleteCfCommand.id,ee)})},ie=V.useMemo(()=>{const W=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET),ee=W.getActiveSheet();return U.filter(ne=>{const le=ne.ranges;return Y.checkRangesEditablePermission(y,W.getUnitId(),ee.getSheetId(),le)})},[U]),oe=ie.map((W,ee)=>({i:W.cfId,x:0,w:12,y:ee,h:1,isResizable:!1})),ce=V.useMemo(()=>{const W=r.getCurrentUnitOfType(w.UniverInstanceType.UNIVER_SHEET),ee=W.getActiveSheet();return U.every(ne=>{const le=ne.ranges;return Y.checkRangesEditablePermission(y,W.getUnitId(),ee.getSheetId(),le)})},[U]);return _.jsxs("div",{className:ge.cfRuleList,children:[_.jsxs("div",{className:ge.ruleSelector,children:[_.jsx("div",{children:T.tWithReactNode("sheet.cf.panel.managerRuleSelect",_.jsx(Z.Select,{className:ge.select,options:D,value:p,onChange:W=>{i(W)}})).map((W,ee)=>_.jsx("span",{children:W},ee))}),_.jsxs("div",{className:ge.btnList,children:[_.jsx(Z.Tooltip,{title:c.t("sheet.cf.panel.createRule"),placement:"bottom",children:_.jsx("div",{className:ge.icon,onClick:q,children:_.jsx(vr,{})})}),U.length&&ce?_.jsx(Z.Tooltip,{title:c.t("sheet.cf.panel.clear"),placement:"bottom",children:_.jsx("div",{className:Z.clsx(ge.gap,ge.icon),onClick:$,children:_.jsx(gt,{})})}):_.jsx("div",{className:Z.clsx(ge.gap,ge.disabled),children:_.jsx(gt,{})})]})]}),_.jsx("div",{ref:v,className:ge.gridLayoutWrap,children:g?_.jsx(va,{draggableHandle:".draggableHandle",layout:oe,cols:12,rowHeight:60,width:g,margin:[0,10],onDragStop:B,onDragStart:L,children:ie==null?void 0:ie.map((W,ee)=>_.jsx("div",{children:_.jsxs("div",{className:Z.clsx(ge.ruleItem,{[ge.active]:b===ee}),onMouseMove:()=>{W.ranges!==I&&S(W.ranges)},onMouseLeave:()=>S([]),onClick:()=>{t(W)},children:[_.jsx("div",{className:Z.clsx(ge.draggableHandle,"draggableHandle"),onClick:ne=>ne.stopPropagation(),children:_.jsx(mr,{})}),_.jsxs("div",{className:ge.ruleDescribe,children:[_.jsx("div",{className:ge.ruleType,children:Sa(W,c)}),_.jsx("div",{className:ge.ruleRange,children:W.ranges.map(ne=>kt.serializeRange(ne)).join(",")})]}),_.jsx("div",{className:ge.preview,children:_.jsx(We,{rule:W.rule})}),_.jsx("div",{className:Z.clsx(ge.deleteItem,{[ge.active]:b===ee}),onClick:ne=>{ne.stopPropagation(),O(W),S([])},children:_.jsx(gt,{})})]})},`${W.cfId}`))}):null})]})},un={cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},Me=e=>{const{color:t,onChange:n,disable:r=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:c=!0}=e,y=te.useDependency(te.ComponentManager),h=V.useMemo(()=>new w.ColorKit(t),[t]),T=y.get(a);return T&&(r?_.jsx(T,{className:o,extend:{colorChannel1:h.isValid?t:"rgb(var(--primary-color))"}}):_.jsx(Z.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(Z.ColorPicker,{value:t,onChange:n})}),children:_.jsxs("span",{className:`
|
|
13
13
|
${un.cfColorPickerIcon}
|
|
14
14
|
${o}
|
|
15
|
-
`,children:[
|
|
15
|
+
`,children:[_.jsx(T,{extend:{colorChannel1:h.isValid?t:"rgb(var(--primary-color))"}}),c&&_.jsx(vt,{className:un.iconDropdown})]})}))},F={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfErrorText:"univer-cf-error-text",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),sr=e=>{var I;const{type:t,className:n,onChange:r,id:a,value:o}=e,c=te.useDependency(w.IUniverInstanceService),y=c.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),h=(I=c.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId(),T=V.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=V.useMemo(()=>[u.CFValueType.max,u.CFValueType.min,"none"].includes(t)?{disabled:!0}:[u.CFValueType.percent,u.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]),C=V.useRef(null),[E,R]=V.useState(!1);return te.useSidebarClick(S=>{var i;((i=C.current)==null?void 0:i.isClickOutSide(S))&&R(!1)}),t===u.CFValueType.formula?_.jsx("div",{style:{width:"100%",marginLeft:4},children:_.jsx(Ge.FormulaEditor,{initValue:T,unitId:y,subUnitId:h,isFocus:E,onChange:(S="")=>{r(S||"")},onFocus:()=>R(!0),ref:C})}):_.jsx(Z.InputNumber,{className:n,value:Number(e.value)||0,onChange:S=>e.onChange(S||0),...m})},Ta=e=>{var z;const{interceptorManager:t}=e,n=te.useDependency(w.LocaleService),r=((z=e.rule)==null?void 0:z.type)===u.CFRuleType.colorScale?e.rule:void 0,a=[Ne(u.CFValueType.num,n),Ne(u.CFValueType.percent,n),Ne(u.CFValueType.percentile,n),Ne(u.CFValueType.formula,n)],o=[Ne(u.CFValueType.min,n),...a],c=[Ne("none",n),...a],y=[Ne(u.CFValueType.max,n),...a],[h,T]=V.useState(()=>{var L;const O=u.CFValueType.min;return r&&((L=r.config[0])==null?void 0:L.value.type)||O}),[m,C]=V.useState(()=>{var L;const O="none";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.value.type)||O}),[E,R]=V.useState(()=>{var L;const O=u.CFValueType.max;return r&&((L=r.config[r.config.length-1])==null?void 0:L.value.type)||O}),[I,S]=V.useState(()=>{if(!r)return 10;const L=r.config[0];return(L==null?void 0:L.value.value)===void 0?10:L==null?void 0:L.value.value}),[p,i]=V.useState(()=>{var B;if(!r||r.config.length!==3)return 50;const L=(B=r.config[1])==null?void 0:B.value.value;return L===void 0?50:L}),[s,f]=V.useState(()=>{var B;if(!r)return 90;const L=(B=r.config[r.config.length-1])==null?void 0:B.value.value;return L===void 0?90:L}),[b,l]=V.useState(()=>{var L;const O="#d0d9fb";return r&&((L=r.config[0])==null?void 0:L.color)||O}),[g,d]=V.useState(()=>{var L;const O="#7790f3";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.color)||O}),[v,D]=V.useState(()=>{var L;const O="#2e55ef";return r&&((L=r.config[r.config.length-1])==null?void 0:L.color)||O}),M=V.useMemo(()=>O=>{const{minType:L,medianType:B,maxType:q,minValue:$,medianValue:ie,maxValue:oe,minColor:ce,medianColor:W,maxColor:ee}=O,ne=[];return ne.push({color:ce,value:{type:L,value:$}}),B!=="none"&&ne.push({color:W,value:{type:B,value:ie}}),ne.push({color:ee,value:{type:q,value:oe}}),{config:ne.map((fe,ve)=>({...fe,index:ve})),type:u.CFRuleType.colorScale}},[]);V.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return M({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),[M,h,m,E,I,p,s,b,g,v,t]);const U=O=>{e.onChange(M(O))};return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
16
16
|
${F.cfPreviewWrap}
|
|
17
|
-
`,children:
|
|
17
|
+
`,children:_.jsx(We,{rule:M({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:s,minColor:b,medianColor:g,maxColor:v})})}),_.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:Z.clsx(`
|
|
18
18
|
${A.labelContainer}
|
|
19
19
|
${A.mTSm}
|
|
20
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
20
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(Z.Select,{style:{flexShrink:0},options:o,value:h,onChange:O=>{T(O);const L=u.createDefaultValueByValueType(O,10);S(L),U({minType:O,medianType:m,maxType:E,minValue:L,medianValue:p,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),_.jsx(sr,{id:"min",className:`
|
|
21
21
|
${A.mLXxs}
|
|
22
|
-
`,value:
|
|
22
|
+
`,value:I,type:h,onChange:O=>{S(O),U({minType:h,medianType:m,maxType:E,minValue:O,medianValue:p,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),_.jsx(Me,{className:A.mLXxs,color:b,onChange:O=>{l(O),U({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),_.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.medianValue")}),_.jsxs("div",{className:Z.clsx(`
|
|
23
23
|
${A.labelContainer}
|
|
24
24
|
${A.mTSm}
|
|
25
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
25
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(Z.Select,{style:{flexShrink:0},options:c,value:m,onChange:O=>{C(O);const L=u.createDefaultValueByValueType(O,50);i(L),U({minType:h,medianType:O,maxType:E,minValue:I,medianValue:L,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),_.jsx(sr,{id:"median",className:`
|
|
26
26
|
${A.mLXxs}
|
|
27
|
-
`,value:
|
|
27
|
+
`,value:p,type:m,onChange:O=>{i(O),U({minType:h,medianType:m,maxType:E,minValue:I,medianValue:O,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),m!=="none"&&_.jsx(Me,{className:A.mLXxs,color:g,onChange:O=>{d(O),U({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:s,minColor:b,medianColor:O,maxColor:v})}})]}),_.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:Z.clsx(`
|
|
28
28
|
${A.labelContainer}
|
|
29
29
|
${A.mTSm}
|
|
30
|
-
`,"univer-box-border univer-h-7"),children:[
|
|
30
|
+
`,"univer-box-border univer-h-7"),children:[_.jsx(Z.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{R(O);const L=u.createDefaultValueByValueType(O,90);f(L),U({minType:h,medianType:m,maxType:O,minValue:I,medianValue:p,maxValue:L,minColor:b,medianColor:g,maxColor:v})}}),_.jsx(sr,{id:"max",className:`
|
|
31
31
|
${A.mLXxs}
|
|
32
|
-
`,value:s,type:E,onChange:O=>{f(O),U({minType:
|
|
32
|
+
`,value:s,type:E,onChange:O=>{f(O),U({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),_.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{D(O),U({minType:h,medianType:m,maxType:E,minValue:I,medianValue:p,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),dn=e=>{var S;const{onChange:t,className:n,value:r,type:a,id:o,disabled:c=!1}=e,y=te.useDependency(w.IUniverInstanceService),h=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),T=(S=y.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),m=V.useRef(null),[C,E]=V.useState(!1);te.useSidebarClick(p=>{var s;((s=m.current)==null?void 0:s.isClickOutSide(p))&&E(!1)});const R=V.useRef(r),I=V.useMemo(()=>[u.CFValueType.percentile,u.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===u.CFValueType.formula){const p=String(R.current).startsWith("=")?String(R.current)||"":"=";return _.jsx("div",{style:{width:"100%",marginLeft:12},children:_.jsx(Ge.FormulaEditor,{initValue:p,unitId:h,subUnitId:T,isFocus:C,onChange:(i="")=>{t(i||"")},onFocus:()=>E(!0),ref:m})})}return _.jsx(Z.InputNumber,{className:n,value:Number(r)||0,disabled:c,onChange:p=>{t(p||0)},...I})},wa=e=>{var z;const{interceptorManager:t}=e,n=te.useDependency(w.LocaleService),r=((z=e.rule)==null?void 0:z.type)===u.CFRuleType.dataBar?e.rule:void 0,[a,o]=V.useState(()=>{var L;const O="0";return r?(L=r.config)!=null&&L.isGradient?"1":"0":O}),[c,y]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.positiveColor)||u.defaultDataBarPositiveColor}),[h,T]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.nativeColor)||u.defaultDataBarNativeColor}),m=[je(u.CFValueType.num,n),je(u.CFValueType.percent,n),je(u.CFValueType.percentile,n),je(u.CFValueType.formula,n)],C=[je(u.CFValueType.min,n),...m],E=[je(u.CFValueType.max,n),...m],[R,I]=V.useState(()=>{var L;const O=C[0].value;return r&&((L=r.config)==null?void 0:L.min.type)||O}),[S,p]=V.useState(()=>{var L;const O=E[0].value;return r&&((L=r.config)==null?void 0:L.max.type)||O}),[i,s]=V.useState(()=>{var B;if(!r)return 0;const L=((B=r.config)==null?void 0:B.min)||{};return L.type===u.CFValueType.formula?L.value||"=":L.value||0}),[f,b]=V.useState(()=>{var B;if(!r)return 100;const L=((B=r.config)==null?void 0:B.max)||{};return L.type===u.CFValueType.formula?L.value||"=":L.value===void 0?100:L.value}),[l,g]=V.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),d=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||u.defaultDataBarPositiveColor,nativeColor:O.nativeColor||u.defaultDataBarNativeColor},type:u.CFRuleType.dataBar,isShowValue:O.isShowValue});V.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return d({isGradient:a,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})}}),[a,i,R,f,S,c,h,t,l]);const v=O=>{e.onChange(d(O))},D=O=>{y(O),v({isGradient:a,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:O,nativeColor:h,isShowValue:l})},M=O=>{T(O),v({isGradient:a,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:O,isShowValue:l})},U=O=>m.map(L=>L.value).includes(O);return _.jsxs("div",{children:[_.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
33
33
|
${F.cfPreviewWrap}
|
|
34
|
-
`,children:
|
|
34
|
+
`,children:_.jsx(We,{rule:d({isGradient:a,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})})}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.fillType")}),_.jsxs("div",{className:`
|
|
35
35
|
${A.mTSm}
|
|
36
36
|
${A.mLXxs}
|
|
37
37
|
${A.labelContainer}
|
|
38
|
-
`,children:[
|
|
38
|
+
`,children:[_.jsxs(Z.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})},children:[_.jsx(Z.Radio,{value:"0",children:_.jsx("span",{className:F.text,children:n.t("sheet.cf.panel.pureColor")})}),_.jsx(Z.Radio,{value:"1",children:_.jsx("span",{className:F.text,children:n.t("sheet.cf.panel.gradient")})})]}),_.jsxs("div",{className:`
|
|
39
39
|
${F.utilItem}
|
|
40
40
|
${A.mLXl}
|
|
41
|
-
`,children:[
|
|
41
|
+
`,children:[_.jsx(Z.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),_.jsxs("div",{className:`
|
|
42
42
|
${A.labelContainer}
|
|
43
43
|
${A.mTSm}
|
|
44
44
|
${A.mLXxs}
|
|
45
|
-
`,children:[
|
|
45
|
+
`,children:[_.jsxs("div",{className:`
|
|
46
46
|
${A.labelContainer}
|
|
47
|
-
`,children:[
|
|
47
|
+
`,children:[_.jsx("div",{className:`
|
|
48
48
|
${F.text}
|
|
49
|
-
`,children:n.t("sheet.cf.panel.native")}),
|
|
49
|
+
`,children:n.t("sheet.cf.panel.native")}),_.jsx(Me,{color:h,onChange:M})]}),_.jsxs("div",{className:`
|
|
50
50
|
${A.labelContainer}
|
|
51
51
|
${A.mLSm}
|
|
52
|
-
`,children:[
|
|
52
|
+
`,children:[_.jsx("div",{className:`
|
|
53
53
|
${F.text}
|
|
54
|
-
`,children:n.t("sheet.cf.panel.positive")}),
|
|
54
|
+
`,children:n.t("sheet.cf.panel.positive")}),_.jsx(Me,{color:c,onChange:D})]})]})]}),_.jsxs("div",{children:[_.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),_.jsxs("div",{className:`
|
|
55
55
|
${A.mTSm}
|
|
56
56
|
${A.labelContainer}
|
|
57
|
-
`,children:[
|
|
57
|
+
`,children:[_.jsx(Z.Select,{style:{width:"50%",flexShrink:0},options:C,value:R,onChange:O=>{I(O);const L=u.createDefaultValueByValueType(O,10);s(L),v({isGradient:a,minValue:L,minValueType:O,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})}}),_.jsx(dn,{disabled:!U(R),id:"min",type:R,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:R,maxValue:f,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})}})]}),_.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),_.jsxs("div",{className:`
|
|
58
58
|
${A.mTSm}
|
|
59
59
|
${A.labelContainer}
|
|
60
|
-
`,children:[
|
|
60
|
+
`,children:[_.jsx(Z.Select,{style:{width:"50%",flexShrink:0},options:E,value:S,onChange:O=>{p(O);const L=u.createDefaultValueByValueType(O,90);b(L),v({isGradient:a,minValue:i,minValueType:R,maxValue:L,maxValueType:O,positiveColor:c,nativeColor:h,isShowValue:l})}}),_.jsx(dn,{disabled:!U(S),id:"max",type:S,className:A.mLSm,value:f,onChange:O=>{b(O||0),v({isGradient:a,minValue:i,minValueType:R,maxValue:O||0,maxValueType:S,positiveColor:c,nativeColor:h,isShowValue:l})}})]})]})]})},Re={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Rt=e=>[w.BooleanNumber.FALSE,void 0].includes(e)?w.BooleanNumber.TRUE:w.BooleanNumber.FALSE,Et=e=>e!==w.BooleanNumber.FALSE,lr=e=>{const{style:t,onChange:n,className:r}=e,a=te.useDependency(te.ComponentManager),[o,c]=V.useState(()=>{if(t!=null&&t.bl)return t.bl}),[y,h]=V.useState(()=>{if(t!=null&&t.it)return t.it}),[T,m]=V.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[C,E]=V.useState(()=>{if(t!=null&&t.st)return t.st.s}),[R,I]=V.useState(()=>{var g;const l="#2f56ef";return(g=t==null?void 0:t.cl)!=null&&g.rgb?t.cl.rgb:l}),[S,p]=V.useState(()=>{var g;const l="#e8ecfc";return(g=t==null?void 0:t.bg)!=null&&g.rgb?t.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),f=a.get("UnderlineSingle"),b=a.get("StrikethroughSingle");return V.useEffect(()=>{const l={bl:o,it:y};R!==void 0&&(l.cl={rgb:R}),S!==void 0&&(l.bg={rgb:S}),C!==void 0&&(l.st={s:C}),T!==void 0&&(l.ul={s:T}),n(u.removeUndefinedAttr(l))},[o,y,T,C,R,S]),_.jsxs("div",{className:Z.clsx(Re.cfStyleEdit,r),children:[i&&_.jsx("div",{className:Z.clsx({[Re.isActive]:Et(o||w.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>c(Rt(o)),children:_.jsx(i,{})}),s&&_.jsx("div",{className:Z.clsx({[Re.isActive]:Et(y||w.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>h(Rt(y)),children:_.jsx(s,{})}),f&&_.jsx("div",{className:Z.clsx({[Re.isActive]:Et(T||w.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>m(Rt(T)),children:_.jsx(f,{})}),b&&_.jsx("div",{className:Z.clsx({[Re.isActive]:Et(C||w.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>E(Rt(C)),children:_.jsx(b,{})}),_.jsx(Me,{color:R,onChange:I,iconId:"FontColor"}),_.jsx(Me,{color:S,onChange:p,iconId:"PaintBucket"})]})},Ia=e=>{var b;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(w.LocaleService),o=te.useDependency(w.IUniverInstanceService).getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),c=o.getActiveSheet(),y=((b=e.rule)==null?void 0:b.type)===u.CFRuleType.highlightCell?e.rule:void 0,h=V.useRef(null),[T,m]=V.useState(!1),C=V.useRef(null),[E,R]=V.useState({}),[I,S]=V.useState(()=>(y==null?void 0:y.subType)===u.CFSubRuleType.formula?y.value:"="),[p,i]=V.useState(void 0),s=l=>({style:l.style,value:I,type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula});V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,I,n]),V.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(g,d,v)=>p||I.length===1||!I.startsWith("=")?(i(r.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[p,I]);const f=l=>{t(s(l))};return te.useSidebarClick(l=>{var d;((d=C.current)==null?void 0:d.isClickOutSide(l))&&m(!1)}),_.jsxs("div",{ref:h,children:[_.jsx("div",{className:`
|
|
61
61
|
${A.title}
|
|
62
62
|
${A.mTBase}
|
|
63
|
-
`,children:r.t("sheet.cf.panel.styleRule")}),
|
|
63
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
64
64
|
${A.mTSm}
|
|
65
|
-
`,children:
|
|
65
|
+
`,children:_.jsx(Ge.FormulaEditor,{onChange:l=>{S(l),f({style:E})},onVerify:(l,g)=>{!l||g.length===1?i(r.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:p,onFocus:()=>{m(!0)},isFocus:T,initValue:I,unitId:o.getUnitId(),subUnitId:c==null?void 0:c.getSheetId(),ref:C})}),_.jsx("div",{className:`
|
|
66
66
|
${F.cfPreviewWrap}
|
|
67
|
-
`,children:
|
|
67
|
+
`,children:_.jsx(We,{rule:s({style:E})})}),_.jsx(lr,{style:y==null?void 0:y.style,className:`
|
|
68
68
|
${A.mTSm}
|
|
69
|
-
`,onChange:l=>{
|
|
69
|
+
`,onChange:l=>{R(l),f({style:l})}})]})},Ot=e=>_.jsxs("div",{style:{position:"relative"},children:[_.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:e.errorText}),e.children]}),ue=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),_a=e=>{const{type:t,operator:n,onChange:r,value:a,interceptorManager:o}=e,c=te.useDependency(w.LocaleService),[y,h]=V.useState(()=>typeof a=="number"?a:0),[T,m]=V.useState(""),[C,E]=V.useState(()=>typeof a=="string"?a:""),[R,I]=V.useState(""),[S,p]=V.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=V.useState(""),[f,b]=V.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=V.useState("");switch(V.useEffect(()=>{switch(t){case u.CFSubRuleType.text:{[u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(n)&&r(C);break}case u.CFSubRuleType.number:{[u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(n)&&r(y),[u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(n)&&r([S,f]);break}}},[t]),V.useEffect(()=>{const d=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,D,M)=>{switch(t){case u.CFSubRuleType.text:if([u.CFTextOperator.beginsWith,u.CFTextOperator.containsText,u.CFTextOperator.endsWith,u.CFTextOperator.notEqual,u.CFTextOperator.notContainsText,u.CFTextOperator.equal].includes(n))return C?M(v):(I(c.t("sheet.cf.errorMessage.notBlank")),!1)}return M(v)}});return()=>{d()}},[t,y,C,n]),t){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(n)){const d=v=>{E(v),r(v)};return _.jsx("div",{className:`
|
|
70
70
|
${A.mTSm}
|
|
71
|
-
`,children:
|
|
71
|
+
`,children:_.jsx(Ot,{errorText:R,children:_.jsx(Z.Input,{className:F.width100,value:C,onChange:v=>{I(""),d(v)}})})})}break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(n)){const d=v=>{h(v||0),r(v||0),m("")};return _.jsx("div",{className:`
|
|
72
72
|
${A.mTSm}
|
|
73
|
-
`,children:
|
|
73
|
+
`,children:_.jsx(Ot,{errorText:T,children:_.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:F.width100,value:y,onChange:d})})})}if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(n)){const d=D=>{p(D||0),r([D||0,f]),s("")},v=D=>{b(D||0),r([S,D||0]),g("")};return _.jsxs("div",{className:`
|
|
74
74
|
${A.mTSm}
|
|
75
75
|
${A.labelContainer}
|
|
76
|
-
`,children:[
|
|
76
|
+
`,children:[_.jsx(Ot,{errorText:i,children:_.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:S,onChange:d})}),_.jsx(Ot,{errorText:l,children:_.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
|
|
77
77
|
${A.mLSm}
|
|
78
|
-
`,value:f,onChange:v})})]})}}}return null},fn=(t
|
|
78
|
+
`,value:f,onChange:v})})]})}}}return null},fn=(e,t)=>{switch(e){case u.CFSubRuleType.text:return[ue(u.CFTextOperator.containsText,t),ue(u.CFTextOperator.notContainsText,t),ue(u.CFTextOperator.beginsWith,t),ue(u.CFTextOperator.endsWith,t),ue(u.CFTextOperator.equal,t),ue(u.CFTextOperator.notEqual,t),ue(u.CFTextOperator.containsBlanks,t),ue(u.CFTextOperator.notContainsBlanks,t),ue(u.CFTextOperator.containsErrors,t),ue(u.CFTextOperator.notContainsErrors,t)];case u.CFSubRuleType.number:return[ue(u.CFNumberOperator.between,t),ue(u.CFNumberOperator.notBetween,t),ue(u.CFNumberOperator.equal,t),ue(u.CFNumberOperator.notEqual,t),ue(u.CFNumberOperator.greaterThan,t),ue(u.CFNumberOperator.greaterThanOrEqual,t),ue(u.CFNumberOperator.lessThan,t),ue(u.CFNumberOperator.lessThanOrEqual,t)];case u.CFSubRuleType.timePeriod:return[ue(u.CFTimePeriodOperator.yesterday,t),ue(u.CFTimePeriodOperator.today,t),ue(u.CFTimePeriodOperator.tomorrow,t),ue(u.CFTimePeriodOperator.last7Days,t),ue(u.CFTimePeriodOperator.lastWeek,t),ue(u.CFTimePeriodOperator.thisWeek,t),ue(u.CFTimePeriodOperator.nextWeek,t),ue(u.CFTimePeriodOperator.lastMonth,t),ue(u.CFTimePeriodOperator.thisMonth,t),ue(u.CFTimePeriodOperator.nextMonth,t)]}},pn=e=>{var b;const{interceptorManager:t,onChange:n}=e,r=te.useDependency(w.LocaleService),a=((b=e.rule)==null?void 0:b.type)===u.CFRuleType.highlightCell?e.rule:void 0,[o,c]=V.useState(()=>{const l=u.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:u.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:u.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:u.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:u.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:u.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],h=V.useMemo(()=>fn(o,r),[o]),[T,m]=V.useState(()=>{const l=h?h[0].value:void 0;return a&&a.operator||l}),[C,E]=V.useState(()=>{var d;const l="";return a?(d=a.value)!=null?d:u.createDefaultValue(a.subType,a.operator):l}),[R,I]=V.useState({}),S=V.useMemo(()=>l=>{var g,d,v,D,M,U,z,O,L,B,q,$,ie,oe,ce;switch(l.subType||o){case u.CFSubRuleType.text:{if([u.CFTextOperator.beginsWith,u.CFTextOperator.endsWith,u.CFTextOperator.containsText,u.CFTextOperator.notContainsText,u.CFTextOperator.equal,u.CFTextOperator.notEqual].includes(T))return{type:u.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(d=l.operator)!=null?d:T,style:(v=l.style)!=null?v:R,value:(D=l.value)!=null?D:C};break}case u.CFSubRuleType.number:{if([u.CFNumberOperator.equal,u.CFNumberOperator.notEqual,u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual,u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(T))return{type:u.CFRuleType.highlightCell,subType:(M=l.subType)!=null?M:o,operator:(U=l.operator)!=null?U:T,style:(z=l.style)!=null?z:R,value:(O=l.value)!=null?O:C};if([u.CFNumberOperator.between,u.CFNumberOperator.notBetween].includes(T))return{type:u.CFRuleType.highlightCell,subType:(L=l.subType)!=null?L:o,operator:(B=l.operator)!=null?B:T,style:(q=l.style)!=null?q:R,value:($=l.value)!=null?$:C};break}}return{type:u.CFRuleType.highlightCell,subType:(ie=l.subType)!=null?ie:o,operator:(oe=l.operator)!=null?oe:T,style:(ce=l.style)!=null?ce:R}},[o,T,C,R]);V.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return S({})}}),[S,t]),V.useEffect(()=>{y.some(l=>l.value===o)||c(y[0].value)},[y]);const p=l=>{const g=l,d=fn(g,r),v=d&&d[0].value;c(g),m(v),v&&E(u.createDefaultValue(g,v)),n(S({subType:g,operator:v}))},i=l=>{const g=l;m(g),n(S({operator:g}))},s=l=>{E(l),n(S({value:l}))},f=V.useMemo(()=>`${o}_${T}_${Math.random()}`,[o,T]);return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
79
79
|
${A.title}
|
|
80
80
|
${A.mTBase}
|
|
81
|
-
`,children:r.t("sheet.cf.panel.styleRule")}),
|
|
81
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),_.jsx(Z.Select,{className:`
|
|
82
82
|
${A.mTSm}
|
|
83
83
|
${F.width100}
|
|
84
|
-
`,onChange:
|
|
84
|
+
`,onChange:p,value:o,options:y}),(h==null?void 0:h.length)&&_.jsx(Z.Select,{className:`
|
|
85
85
|
${A.mTSm}
|
|
86
86
|
${F.width100}
|
|
87
|
-
`,onChange:i,value:
|
|
87
|
+
`,onChange:i,value:T||"",options:h}),_.jsx(_a,{value:C,interceptorManager:t,type:o,operator:T,rule:a,onChange:s},f),_.jsx("div",{className:`
|
|
88
88
|
${F.cfPreviewWrap}
|
|
89
|
-
`,children:
|
|
89
|
+
`,children:_.jsx(We,{rule:S({})})}),_.jsx(lr,{style:a==null?void 0:a.style,className:`
|
|
90
90
|
${A.mLXxs}
|
|
91
|
-
`,onChange:l=>{
|
|
91
|
+
`,onChange:l=>{I(l),n(S({style:l}))}})]})},hn=(e,t)=>(u.iconMap[e]||[])[Number(t)]||"",Ra=e=>{var h;const t=te.useDependency(w.IUniverInstanceService),n=t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(h=t.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:h.getSheetId(),a=V.useMemo(()=>e.error?F.errorInput:"",[e.error]),o=V.useRef(null),[c,y]=V.useState(!1);return te.useSidebarClick(T=>{var C;((C=o.current)==null?void 0:C.isClickOutSide(T))&&y(!1)}),_.jsx("div",{className:F.positionRelative,children:e.type!==u.CFValueType.formula?_.jsxs(_.Fragment,{children:[_.jsx(Z.InputNumber,{className:a,value:Number(e.value)||0,onChange:T=>e.onChange(T!=null?T:0)}),e.error&&_.jsx("div",{className:F.errorText,children:e.error})]}):_.jsx("div",{style:{width:"100%"},children:_.jsx(Ge.FormulaEditor,{initValue:String(e.value),unitId:n,subUnitId:r,isFocus:c,onChange:(T="")=>{const m=T||"";e.onChange(m)},onFocus:()=>y(!0),ref:o})})})},gn=(e,t,n)=>({operator:u.CFNumberOperator.greaterThan,value:{type:u.CFValueType.num,value:(n.length-1-t)*10},iconType:e,iconId:String(t)}),Ea=V.forwardRef((e,t)=>{const n=te.useDependency(w.LocaleService),r=a=>{e.onClick(a)};return _.jsx("div",{ref:t,className:F.iconGroupList,children:u.iconGroup.map((a,o)=>_.jsxs("div",{className:F.group,children:[_.jsx("div",{className:F.title,children:n.t(a.title)}),_.jsx("div",{className:F.itemContent,children:a.group.map(c=>_.jsx("div",{className:F.itemWrap,onClick:()=>{r(c.name)},children:_.jsx("div",{className:F.item,children:c.list.map((y,h)=>_.jsx("img",{className:F.icon,src:y},h))})},c.name))})]},o))})}),Oa=e=>{const t=V.useMemo(()=>{const r=[];for(const a in u.iconMap){const o=u.iconMap[a],c=a;o.forEach((y,h)=>{r.push({iconType:c,base64:y,iconId:String(h)})})}return r},[]),n=r=>{e.onClick(r.iconType,r.iconId)};return _.jsxs("div",{className:F.iconItemListWrap,children:[_.jsxs("div",{className:F.none,onClick:()=>n({iconType:u.EMPTY_ICON_TYPE,iconId:""}),children:[_.jsx(Xe,{className:F.icon}),_.jsx("span",{children:"无单元格图标"})]}),_.jsx("div",{className:F.iconItemList,children:t.map(r=>_.jsx("div",{className:F.item,children:_.jsx("img",{onClick:()=>n(r),className:`
|
|
92
92
|
${F.icon}
|
|
93
|
-
`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=
|
|
93
|
+
`,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=e=>{const{onChange:t,configList:n,errorMap:r={}}=e,a=te.useDependency(w.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThan}`),value:u.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${u.CFNumberOperator.greaterThanOrEqual}`),value:u.CFNumberOperator.greaterThanOrEqual}],c=[{label:a.t(`sheet.cf.valueType.${u.CFValueType.num}`),value:u.CFValueType.num},{label:a.t(`sheet.cf.valueType.${u.CFValueType.percent}`),value:u.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${u.CFValueType.percentile}`),value:u.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${u.CFValueType.formula}`),value:u.CFValueType.formula}],y=(C,E)=>{t([String(E),"value","value"],C)},h=(C,E)=>{t([String(E),"operator"],C);const R=u.createDefaultValue(u.CFSubRuleType.number,C);y(R,E)},T=(C,E)=>{t([String(E),"value","type"],C);const R=n[E],I=u.createDefaultValue(u.CFSubRuleType.number,R.operator);y(I,E)};return V.useMemo(()=>n.map((C,E)=>{const R=r[E],I=hn(C.iconType,C.iconId),S=E===n.length-1,p=E===0,i=n[E-1],s=(i==null?void 0:i.value.type)===u.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,f=(b,l)=>{const g={...C,iconId:l,iconType:b};t([String(E)],g)};return _.jsxs("div",{className:`
|
|
94
94
|
${E?A.mTXl:A.mTSm}
|
|
95
|
-
`,children:[
|
|
95
|
+
`,children:[_.jsxs("div",{className:`
|
|
96
96
|
${A.label}
|
|
97
97
|
${F.flex}
|
|
98
|
-
`,children:[
|
|
98
|
+
`,children:[_.jsxs("div",{className:`
|
|
99
99
|
${F.width45}
|
|
100
|
-
`,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),
|
|
100
|
+
`,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),_.jsx("div",{className:`
|
|
101
101
|
${F.width45}
|
|
102
|
-
`,children:
|
|
102
|
+
`,children:_.jsxs(_.Fragment,{children:[!p&&!S&&a.t("sheet.cf.iconSet.rule"),!p&&!S&&_.jsxs("span",{className:F.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${u.getOppositeOperator(i.operator)}`),s,S?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),_.jsxs("div",{className:`
|
|
103
103
|
${F.flex}
|
|
104
104
|
${A.mTSm}
|
|
105
|
-
`,children:[
|
|
105
|
+
`,children:[_.jsx("div",{className:`
|
|
106
106
|
${F.iconWrap}
|
|
107
107
|
${F.width45}
|
|
108
|
-
`,children:
|
|
108
|
+
`,children:_.jsx(Z.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(Oa,{onClick:f,iconId:C.iconId,iconType:C.iconType})}),children:_.jsxs("div",{className:Z.clsx(F.dropdownIcon,"univer-box-border univer-h-7"),children:[I?_.jsx("img",{src:I,className:F.icon}):_.jsx(Xe,{className:F.icon}),_.jsx(vt,{})]})})}),S?_.jsxs("div",{className:`
|
|
109
109
|
${F.width45}
|
|
110
110
|
${A.label}
|
|
111
|
-
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),
|
|
111
|
+
`,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),_.jsxs("span",{className:F.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${u.getOppositeOperator(i.operator)}`),s,S?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):_.jsx(Z.Select,{className:`
|
|
112
112
|
${A.mL0}
|
|
113
113
|
${F.width45}
|
|
114
114
|
${A.mR0}
|
|
115
|
-
`,options:o,value:
|
|
115
|
+
`,options:o,value:C.operator,onChange:b=>{h(b,E)}})]}),S?_.jsx("div",{}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:`
|
|
116
116
|
${A.mTSm}
|
|
117
117
|
${A.label}
|
|
118
118
|
${F.flex}
|
|
119
|
-
`,children:[
|
|
119
|
+
`,children:[_.jsx("div",{className:`
|
|
120
120
|
${F.width45}
|
|
121
|
-
`,children:a.t("sheet.cf.iconSet.type")}),
|
|
121
|
+
`,children:a.t("sheet.cf.iconSet.type")}),_.jsx("div",{className:`
|
|
122
122
|
${F.width45}
|
|
123
|
-
`,children:a.t("sheet.cf.iconSet.value")})]}),
|
|
123
|
+
`,children:a.t("sheet.cf.iconSet.value")})]}),_.jsxs("div",{className:`
|
|
124
124
|
${A.mTSm}
|
|
125
125
|
${F.flex}
|
|
126
|
-
`,children:[
|
|
126
|
+
`,children:[_.jsx(Z.Select,{style:{flexShrink:0},className:`
|
|
127
127
|
${F.width45}
|
|
128
128
|
${A.mL0}
|
|
129
|
-
`,options:
|
|
129
|
+
`,options:c,value:C.value.type,onChange:b=>{T(b,E)}}),_.jsx("div",{className:`
|
|
130
130
|
${A.mL0}
|
|
131
131
|
${F.width45}
|
|
132
|
-
`,children:
|
|
132
|
+
`,children:_.jsx(Ra,{id:E,type:C.value.type,error:R,value:C.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},xa=e=>{var b;const{interceptorManager:t}=e,n=((b=e.rule)==null?void 0:b.type)===u.CFRuleType.iconSet?e.rule:void 0,r=te.useDependency(w.LocaleService),[a,o]=V.useState({}),[c,y]=V.useState(()=>{const l=Object.keys(u.iconMap)[0];if(n&&n.config.length){const g=n.config[0].iconType;if(!n.config.some(v=>v.iconType!==g))return g}return l}),[h,T]=V.useState(()=>{if(n&&n.config.length)return w.Tools.deepClone(n==null?void 0:n.config);const l=u.iconMap[c]||[];return new Array(l.length).fill("").map((g,d,v)=>d===v.length-1?{operator:u.CFNumberOperator.lessThanOrEqual,value:{type:u.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:c,iconId:String(d)}:gn(c,d,v))}),[m,C]=V.useState(()=>n?!!n.isShowValue:!0),E=V.useMemo(()=>{const l=h.map(g=>hn(g.iconType,g.iconId));return _.jsx("div",{className:F.iconWrap,children:l.map((g,d)=>g?_.jsx("img",{className:F.icon,src:g},d):_.jsx(Xe,{className:F.icon},d))})},[h]),R=l=>{if(l.reduce((d,v,D)=>d.preType&&!d.result||l.length-1===D?d:v.value.type===u.CFValueType.formula?{preType:u.CFValueType.formula,result:!1}:d.preType?{result:d.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[u.CFValueType.num,u.CFValueType.percent,u.CFValueType.percentile].includes(l[0].value.type)){const d={};return l.forEach((v,D,M)=>{if(D-1<0||D===M.length-1)return;const z=l[D-1],O=u.getOppositeOperator(z.operator);u.compareWithNumber({operator:O,value:z.value.value},v.value.value)||(d[D]=`${r.t(`sheet.cf.form.${O}`,String(z.value.value))} `)}),d}return{}},I=(l,g)=>{w.get(h,l)!==g&&(w.set(h,l,g),T([...h]),o(R(h)))},S=l=>{y(l);const g=u.iconMap[l]||[],d=new Array(g.length).fill("").map((v,D,M)=>gn(l,D,M));T(d),o(R(d))};V.useEffect(()=>{const l=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:u.CFRuleType.iconSet,isShowValue:m,config:h}}});return()=>{l()}},[m,h,t]),V.useEffect(()=>{const l=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,h,t,a]);const p=()=>{const l=h.map(g=>({...g}));h.forEach((g,d)=>{const v=h.length-1-d,D=l[v];g.iconId=D.iconId,g.iconType=D.iconType}),T([...h])},i=te.useDependency(te.ILayoutService),[s,f]=V.useState();return te.useScrollYOverContainer(s,i.rootContainerElement),_.jsxs("div",{className:F.iconSet,children:[_.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),_.jsx("div",{className:`
|
|
133
133
|
${A.mTSm}
|
|
134
|
-
`,children:
|
|
134
|
+
`,children:_.jsx(Z.Dropdown,{overlay:_.jsx("div",{className:"univer-rounded-lg univer-p-4",children:_.jsx(Ea,{ref:l=>{!s&&l&&f(l)},iconType:c,onClick:S})}),children:_.jsxs("div",{className:Z.clsx(F.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,_.jsx(vt,{})]})})}),_.jsxs("div",{className:`
|
|
135
135
|
${A.mTSm}
|
|
136
136
|
${F.renderConfig}
|
|
137
|
-
`,children:[
|
|
137
|
+
`,children:[_.jsxs("div",{className:F.utilItem,children:[_.jsx(Z.Checkbox,{onChange:p}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),_.jsxs("div",{className:`
|
|
138
138
|
${F.utilItem}
|
|
139
139
|
${A.mLXl}
|
|
140
|
-
`,children:[
|
|
140
|
+
`,children:[_.jsx(Z.Checkbox,{checked:!m,onChange:l=>{C(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),_.jsx(Pa,{errorMap:a,onChange:I,configList:h})]})},Da=e=>{var p;const{onChange:t,interceptorManager:n}=e,r=te.useDependency(w.LocaleService),a=((p=e.rule)==null?void 0:p.type)===u.CFRuleType.highlightCell?e.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[c,y]=V.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case u.CFRuleType.highlightCell:switch(a.subType){case u.CFSubRuleType.average:return[u.CFNumberOperator.greaterThan,u.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[u.CFNumberOperator.lessThan,u.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case u.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[h,T]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case u.CFRuleType.highlightCell:switch(a.subType){case u.CFSubRuleType.rank:return a.value||10}}return 10}),[m,C]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case u.CFRuleType.highlightCell:switch(a.subType){case u.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[E,R]=V.useState({}),I=i=>{const{type:s,isPercent:f,value:b,style:l}=i;if(s==="isNotBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:b,style:l};if(s==="isBottom")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:b,style:l};if(s==="greaterThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.average,operator:u.CFNumberOperator.lessThan,style:l}};V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return I({type:c,isPercent:m,value:h,style:E})}}),[c,m,h,E,n]);const S=i=>{t(I(i))};return _.jsxs("div",{children:[_.jsx("div",{className:`
|
|
141
141
|
${A.title}
|
|
142
142
|
${A.mTBase}
|
|
143
|
-
`,children:r.t("sheet.cf.panel.styleRule")}),
|
|
143
|
+
`,children:r.t("sheet.cf.panel.styleRule")}),_.jsx(Z.Select,{className:`
|
|
144
144
|
${F.width100}
|
|
145
145
|
${A.mTSm}
|
|
146
|
-
`,value:
|
|
146
|
+
`,value:c,options:o,onChange:i=>{y(i),S({type:i,isPercent:m,value:h,style:E})}}),["isNotBottom","isBottom"].includes(c)&&_.jsxs("div",{className:`
|
|
147
147
|
${A.labelContainer}
|
|
148
148
|
${A.mTSm}
|
|
149
|
-
`,children:[
|
|
149
|
+
`,children:[_.jsx(Z.InputNumber,{min:1,max:1e3,value:h,onChange:i=>{const s=i||0;T(s),S({type:c,isPercent:m,value:s,style:E})}}),_.jsxs("div",{className:`
|
|
150
150
|
${A.mLSm}
|
|
151
151
|
${A.labelContainer}
|
|
152
152
|
${F.text}
|
|
153
|
-
`,children:[
|
|
153
|
+
`,children:[_.jsx(Z.Checkbox,{checked:m,onChange:i=>{C(!!i),S({type:c,isPercent:!!i,value:h,style:E})}}),r.t("sheet.cf.valueType.percent")]})]}),_.jsx("div",{className:`
|
|
154
154
|
${F.cfPreviewWrap}
|
|
155
|
-
`,children:
|
|
155
|
+
`,children:_.jsx(We,{rule:I({type:c,isPercent:m,value:h,style:E})})}),_.jsx(lr,{style:a==null?void 0:a.style,className:`
|
|
156
156
|
${A.mTSm}
|
|
157
|
-
`,onChange:i=>{
|
|
157
|
+
`,onChange:i=>{R(i),S({type:c,isPercent:m,value:h,style:i})}})]})},Ma=w.createInterceptorKey("beforeSubmit"),Na=w.createInterceptorKey("submit"),vn=e=>e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=e=>{var t;return(t=e.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:t.getSheetId()},La=e=>{var d,v,D;const t=te.useDependency(w.LocaleService),n=te.useDependency(w.ICommandService),r=te.useDependency(w.IUniverInstanceService),a=te.useDependency(u.ConditionalFormattingRuleModel),o=te.useDependency(Y.SheetsSelectionsService),c=vn(r),y=mn(r),[h,T]=V.useState(void 0),m=V.useRef((v=(d=e.rule)==null?void 0:d.ranges)!=null?v:[]),C=V.useMemo(()=>{var U,z,O;let M=(U=e.rule)==null?void 0:U.ranges;return M!=null&&M.length||(M=(O=(z=o.getCurrentSelections())==null?void 0:z.map(L=>L.range))!=null?O:[]),m.current=M,M!=null&&M.length?M.map(L=>{const B=kt.serializeRange(L);return B==="NaN"?"":B}).filter(L=>!!L).join(","):""},[e.rule]),E=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[R,I]=V.useState(()=>{var z,O;const M=(z=e.rule)==null?void 0:z.rule.type,U=E[0].value;if(!M)return U;switch(M){case u.CFRuleType.highlightCell:{switch((O=e.rule)==null?void 0:O.rule.subType){case u.CFSubRuleType.number:case u.CFSubRuleType.text:case u.CFSubRuleType.duplicateValues:case u.CFSubRuleType.uniqueValues:case u.CFSubRuleType.timePeriod:return"1";case u.CFSubRuleType.average:case u.CFSubRuleType.rank:return"2";case u.CFSubRuleType.formula:return"5"}break}case u.CFRuleType.dataBar:return"3";case u.CFRuleType.colorScale:return"4";case u.CFRuleType.iconSet:return"6"}return U}),S=V.useRef(void 0),p=V.useMemo(()=>new w.InterceptorManager({beforeSubmit:Ma,submit:Na}),[]),i=V.useMemo(()=>{switch(R){case"1":return pn;case"2":return Da;case"3":return wa;case"4":return Ta;case"5":return Ia;case"6":return xa;default:return pn}},[R]);V.useEffect(()=>{const M=n.onCommandExecuted(U=>{if(U.id===Y.RemoveSheetMutation.id){const z=U.params;z.subUnitId===y&&z.unitId===c&&e.onCancel()}U.id===Y.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>M.dispose()},[]);const s=M=>{S.current=M},f=M=>{const U=M.split(",").filter(z=>!!z).map(kt.deserializeRangeWithSheet).map(z=>z.range);m.current=U},b=()=>{if(h)return;const U=(()=>{const O=r.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!O)throw new Error("No active sheet found");return m.current.map(q=>Y.setEndForRange(q,O.getRowCount(),O.getColumnCount())).filter(q=>!(Number.isNaN(q.startRow)||Number.isNaN(q.startColumn)))})();if(p.fetchThroughInterceptors(p.getInterceptPoints().beforeSubmit)(!0,null)){const O=p.fetchThroughInterceptors(p.getInterceptPoints().submit)(null,null);if(O){const L=vn(r),B=mn(r);if(!L||!B)throw new Error("No active sheet found");let q={};e.rule&&e.rule.cfId?(q={...e.rule,ranges:U,rule:O},n.executeCommand(u.SetCfCommand.id,{unitId:L,subUnitId:B,rule:q}),e.onCancel()):(q={cfId:a.createCfId(L,B),ranges:U,rule:O,stopIfTrue:!1},n.executeCommand(u.AddCfCommand.id,{unitId:L,subUnitId:B,rule:q}),e.onCancel())}}},l=()=>{e.onCancel()},g=(M,U)=>{M?U.length<1?T(t.t("sheet.cf.errorMessage.rangeError")):T(void 0):T(t.t("sheet.cf.errorMessage.rangeError"))};return _.jsxs("div",{className:F.cfRuleStyleEditor,children:[_.jsx("div",{className:A.title,children:t.t("sheet.cf.panel.range")}),_.jsxs("div",{className:`
|
|
158
158
|
${A.mTBase}
|
|
159
|
-
`,children:[
|
|
159
|
+
`,children:[_.jsx(Ge.RangeSelector,{unitId:c,subUnitId:y,initialValue:C,onChange:(M,U)=>f(U),onVerify:g}),h&&_.jsx("div",{className:F.cfErrorText,children:h})]}),_.jsx("div",{className:A.title,children:t.t("sheet.cf.panel.styleType")}),_.jsx("div",{className:A.mTBase,children:_.jsx(Z.Select,{className:F.width100,value:R,options:E,onChange:M=>I(M)})}),_.jsx(i,{interceptorManager:p,rule:(D=e.rule)==null?void 0:D.rule,onChange:s}),_.jsxs("div",{className:`
|
|
160
160
|
${A.mTBase}
|
|
161
161
|
${F.btnList}
|
|
162
|
-
`,children:[R.jsx(Z.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),R.jsx(Z.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Va=t=>{const[e,n]=V.useState(t.rule),[r,a]=V.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),n(void 0)},y=p=>{n(p),a(!0)};return R.jsx("div",{className:A.conditionalFormattingWrap,children:r?R.jsx(La,{onCancel:u,rule:e}):R.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ua(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},at=(t,e)=>(n,r)=>e(n,r,t);const Pt="sheet.conditional.formatting.panel";let ot=class extends _.Disposable{constructor(e,n,r,a,o){super();xe(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Pt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:e,key:_.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,_.IUniverInstanceService),at(1,_.Inject(_.Injector)),at(2,_.Inject(Q.ComponentManager)),at(3,_.Inject(Q.ISidebarService)),at(4,_.Inject(_.LocaleService))],ot);var ye=(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))(ye||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:_.CommandType.OPERATION,handler:(t,e)=>{var y;const n=t.get(ot),r=t.get(Y.SheetsSelectionsService),a=t.get(_.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};n.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};n.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};n.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(p);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(c.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(c.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(t,e,n,r)=>{for(var a=r>1?void 0:r?ka(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(n,r)=>e(n,r,t);let lt=class extends _.Disposable{constructor(e,n,r,a,o){super();xe(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,a)=>{const{copyType:o=pe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=n;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,n,r){const a=new _.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:n,cfMap:o}};const u=this._injector.invoke(m=>Y.rangeToDiscreteRange(r,m,e,n));if(!u)return;const{rows:y,cols:p}=u,C=new Set;y.forEach((m,T)=>{p.forEach((E,w)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,n,m,E);S&&(S.forEach(I=>C.add(I.cfId)),a.setValue(T,w,S.map(I=>I.cfId)))})}),C.forEach(m=>{const T=this._conditionalFormattingRuleModel.getRule(e,n,m);T&&(o[m]=T.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(n.copyType===pe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![pe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,pe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,pe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[p,C],mapFunc:m}=pe.virtualizeDiscreteRanges([n.copyRange,e]),T=pe.getRepeatRange(p,C,!0),E={};_.Range.foreach(C,(l,g)=>{const{row:d,col:v}=m(l,g),D=this._conditionalFormattingViewModel.getCellCfs(o,u,d,v);D&&D.forEach(N=>{if(!E[N.cfId]){const U=new _.ObjectMatrix;E[N.cfId]=U;const z=this._conditionalFormattingRuleModel.getRule(o,u,N.cfId);z==null||z.ranges.forEach(O=>{_.Range.foreach(O,(L,B)=>{U.setValue(L,B,1)})})}E[N.cfId].realDeleteValue(d,v)})});const{matrix:w,info:S}=this._copyInfo,I=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=S==null?void 0:S.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...I].find(v=>_.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,I.push(v),h=`${Number(h)+1}`,v}};T.forEach(l=>{w&&w.forValue((g,d,v)=>{const D=_.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:N,col:U}=m(D.startRow,D.startColumn);v.forEach(z=>{if(!E[z]){const O=s(z),L=new _.ObjectMatrix;E[z]=L,O.ranges.forEach(B=>{_.Range.foreach(B,(G,ee)=>{L.setValue(G,ee,1)})})}E[z].setValue(N,U,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:u,cfId:l};f.push({id:c.DeleteConditionalRuleMutation.id,params:v}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(I.some(v=>v.cfId===l)){const v=s(l),D={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.AddConditionalRuleMutation.id,params:D}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,D))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const D={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.SetConditionalRuleMutation.id,params:D}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,D))}}return{redos:f,undos:b}}};lt=Aa([st(0,_.Inject(pe.ISheetClipboardService)),st(1,_.Inject(c.ConditionalFormattingRuleModel)),st(2,_.Inject(_.Injector)),st(3,_.Inject(c.ConditionalFormattingViewModel)),st(4,_.Inject(_.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(t,e,n,r)=>{for(var a=r>1?void 0:r?Wa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},lr=(t,e)=>(n,r)=>e(n,r,t);let ct=class extends _.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===c.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([lr(0,_.Inject(_.LocaleService)),lr(1,_.ICommandService),lr(2,_.Inject(Y.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ha(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},xt=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends _.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const u=p=>{const C=[...o.ranges],m=C.map(E=>Y.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,C))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},w=[{id:c.SetConditionalRuleMutation.id,params:E}],S=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:S}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:E}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:w,undos:S}}},y=[];o.ranges.forEach(p=>{const C=this._refRangeService.registerRefRange(p,u);y.push(()=>C.dispose())}),t.set(e(r,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:u}=r,y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(p==null?void 0:p.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const C=t.get(e(a,o,u.cfId));C&&C();break}case"set":{const C=t.get(e(a,o,u.cfId));C&&C(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(_.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};ut=Ba([xt(0,_.Inject(c.ConditionalFormattingRuleModel)),xt(1,_.Inject(_.IUniverInstanceService)),xt(2,_.Inject(_.Injector)),xt(3,_.Inject(Y.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,n,r)=>{for(var a=r>1?void 0:r?Fa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(n,r)=>e(n,r,t);let dt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();xe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const e=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(pe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:_.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(e);const o=n.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return a.style&&Object.assign(y,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),r(p)},priority:10}))}};dt=Ga([He(0,_.Inject(Y.SheetInterceptorService)),He(1,_.Inject(c.ConditionalFormattingService)),He(2,_.Inject(_.IUniverInstanceService)),He(3,_.Inject(hr.IRenderManagerService)),He(4,_.Inject(c.ConditionalFormattingViewModel)),He(5,_.Inject(c.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",Dt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(t,e,n)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ka=(t,e,n,r)=>{for(var a=r>1?void 0:r?Xa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},cr=(t,e)=>(n,r)=>e(n,r,t),bn=(t,e,n)=>Ya(t,typeof e!="symbol"?e+"":e,n);K.UniverSheetsConditionalFormattingMobileUIPlugin=class extends _.Plugin{constructor(e=Dt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},Dt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},bn(K.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn(K.UniverSheetsConditionalFormattingMobileUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),cr(1,_.Inject(_.Injector)),cr(2,_.Inject(_.ICommandService)),cr(3,_.IConfigService)],K.UniverSheetsConditionalFormattingMobileUIPlugin);var Za=Object.getOwnPropertyDescriptor,$a=(t,e,n,r)=>{for(var a=r>1?void 0:r?Za(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ft=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends _.Disposable{constructor(t,e,n,r,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var w;const C=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(w=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!C||!m)return;const T={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};_.Range.foreach(u,(S,I)=>{const h=_.Rectangle.getPositionRange({startRow:S,startColumn:I,endColumn:I,endRow:S},T),i=_.Rectangle.getPositionRange({startRow:S,startColumn:I,endColumn:I,endRow:S},E),{row:s,col:f}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(C,m,s,f),{row:l,col:g}=p(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(C,m,l,g);d&&d.forEach(v=>{let D=y.get(v.cfId);if(!y.get(v.cfId)){const N=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!N)return;D=new _.ObjectMatrix,N.ranges.forEach(U=>{_.Range.foreach(U,(z,O)=>{D.setValue(z,O,1)})}),y.set(v.cfId,D)}D.realDeleteValue(l,g)}),b&&b.forEach(v=>{let D=y.get(v.cfId);if(!y.get(v.cfId)){const N=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!N)return;D=new _.ObjectMatrix,N.ranges.forEach(U=>{_.Range.foreach(U,(z,O)=>{D.setValue(z,O,1)})}),y.set(v.cfId,D)}D.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const u=(i=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,C=[],m=[];if(!u||!y)return t();const T=pe.virtualizeDiscreteRanges([a,o]),[E,w]=T.ranges,{mapFunc:S}=T,I={row:E.startRow,col:E.startColumn};return pe.getAutoFillRepeatRange(E,w).forEach(b=>{e(I,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:d}};C.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};C.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:C}},r={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===pe.APPLY_TYPE.COPY||u===pe.APPLY_TYPE.ONLY_FORMAT||u===pe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return n(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=$a([ft(0,_.Inject(_.Injector)),ft(1,_.Inject(_.IUniverInstanceService)),ft(2,_.Inject(pe.IAutoFillService)),ft(3,_.Inject(c.ConditionalFormattingRuleModel)),ft(4,_.Inject(c.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ja(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},pt=(t,e)=>(n,r)=>e(n,r,t);K.ConditionalFormattingClearController=class extends _.Disposable{constructor(e,n,r,a,o){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const n=[],r=[],a={redos:n,undos:r};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(S=>S.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const C=y.getUnitId(),m=p.getSheetId(),T=this._conditionalFormattingRuleModel.getSubunitRules(C,m);if(!T||!T.length)return a;const{redos:E,undos:w}=Sn(this._injector,T,u,C,m);n.push(...E),r.push(...w)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const a=[],o=[],u={redos:a,undos:o};if(!r||!r.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!y||!y.length)return u;const{redos:p,undos:C}=Sn(this._injector,y,r,e,n);return a.push(...p),o.push(...C),u}}))}},K.ConditionalFormattingClearController=Qa([pt(0,_.Inject(_.Injector)),pt(1,_.Inject(_.IUniverInstanceService)),pt(2,_.Inject(Y.SheetInterceptorService)),pt(3,_.Inject(Y.SheetsSelectionsService)),pt(4,_.Inject(c.ConditionalFormattingRuleModel))],K.ConditionalFormattingClearController);function Sn(t,e,n,r,a){const o=[],u=[];return e.filter(y=>n.some(p=>y.ranges.some(C=>_.Rectangle.getIntersects(C,p)))).forEach(y=>{const C=new Y.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(C.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:C}}},T=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...T)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},T=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...T)}}),{redos:o,undos:u}}var eo=Object.getOwnPropertyDescriptor,to=(t,e,n,r)=>{for(var a=r>1?void 0:r?eo(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Cn=(t,e)=>(n,r)=>e(n,r,t);let Nt=class extends _.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(_.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var u,y,p;t||n(t);const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=r==null?void 0:r.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(C=>{C.ts&&o.forEach(m=>{var T;(T=C.ts)==null||delete T[m]})}),n(t);{const C={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(T=>{delete C[T]});const m={...t,s:{...C}};return n(m)}}})))}};Nt=to([Cn(0,_.Inject(Y.SheetInterceptorService)),Cn(1,_.Inject(c.ConditionalFormattingService))],Nt);const Tn=[Y.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:ye.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:ye.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:ye.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:ye.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:ye.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:ye.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:ye.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:ye.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:ye.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:ye.clearWorkSheetRules}],ro=t=>{const e=t.get(Y.SheetsSelectionsService),n=t.get(_.ICommandService),r=t.get(_.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(C=>{const m=n.onCommandExecuted(T=>{var I;const{id:E,params:w}=T,S=(I=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();Tn.includes(E)&&w.unitId===S&&C.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var I;const C=((I=e.getCurrentSelections())==null?void 0:I.map(h=>h.range))||[],m=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!m)return;const T=m.getActiveSheet();if(!T)return;const S=(a.getSubunitRules(m.getUnitId(),T.getSheetId())||[]).filter(h=>h.ranges.some(i=>C.some(s=>_.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>Y.checkRangesEditablePermission(t,m.getUnitId(),T.getSheetId(),h));p.next(S)})),u=new Ce.Observable(p=>new Ce.Observable(C=>{const m=n.onCommandExecuted(T=>{var I;const{id:E,params:w}=T,S=(I=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:I.getUnitId();Tn.includes(E)&&w.unitId===S&&C.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const C=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!C)return;const m=C.getActiveSheet();if(!m)return;const T=a.getSubunitRules(C.getUnitId(),m.getSheetId())||[];if(!T.length)return p.next(!1),!1;const E=T.map(w=>w.ranges).every(w=>Y.checkRangesEditablePermission(t,C.getUnitId(),m.getSheetId(),w));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(C=>{const m=ht.find(T=>T.value===ye.clearRangeRules);m&&(m.disabled=!C,p.next(ht))}),u.subscribe(C=>{const m=ht.find(T=>T.value===ye.clearWorkSheetRules);m&&(m.disabled=!C,p.next(ht))}),p.next(ht)});return{id:it.id,type:Q.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:Q.getMenuHiddenObservable(t,_.UniverInstanceType.UNIVER_SHEET),disabled$:pe.getCurrentRangeDisable$(t,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},no={[Q.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(t,e,n,r)=>{for(var a=r>1?void 0:r?ao(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},wn=(t,e)=>(n,r)=>e(n,r,t);let Lt=class extends _.Disposable{constructor(e,n){super();xe(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,_.Inject(_.Injector)),wn(1,Q.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(t,e,n,r)=>{for(var a=r>1?void 0:r?io(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(n,r)=>e(n,r,t);const lo=(t,e)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(e)%n(t),o=r(e)%r(t),u=Math.floor(n(e)/n(t)),y=Math.floor(r(e)/r(t)),p=[],C={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:C,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let T=0;T<y+(o?.1:0);T++){const E=n(t)*m,w=r(t)*T,S={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:w+e.startColumn,endColumn:w+e.startColumn};let I=C;m===u&&a&&(I={...I},I.endRow=I.endRow-(n(t)-a)),T===y&&o&&(I={...I},I.endColumn=I.endColumn-(r(t)-o)),p.push({repeatRelativeRange:I,startRange:S})}return p};let Vt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();xe(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(o,u,y,p,C)=>{const{unitId:m,subUnitId:T}=this._painterConfig,{targetUnitId:E,targetSubUnitId:w}=C,S={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},I={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};_.Range.foreach(y,(h,i)=>{const s=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},S),f=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},I),b=this._conditionalFormattingViewModel.getCellCfs(m,T,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,w,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,w,g.cfId);if(!v)return;d=new _.ObjectMatrix,v.ranges.forEach(D=>{_.Range.foreach(D,(N,U)=>{d.setValue(N,U,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,u,y)=>{var s;const{range:p,unitId:C,subUnitId:m}=this._painterConfig,T=o!==C||m!==u,E=new Map,w=[],S=[];if(!o||!u||!C||!m)return e();const I=(s=this._conditionalFormattingRuleModel.getSubunitRules(C,m))!=null?s:[];I==null||I.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>_.Rectangle.intersects(p,g))){const g=new _.ObjectMatrix;T||b.forEach(d=>{_.Range.foreach(d,(v,D)=>{g.setValue(v,D,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return lo(p,y).forEach(f=>{n(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((f,b)=>{if(T){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:u,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(C,m,b);if(d){const v={unitId:o,subUnitId:u,rule:{..._.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(C,m,b);if(!l)return;const g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:C,subUnitId:m,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:C,subUnitId:m,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:S,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case pe.FormatPainterStatus.INFINITE:case pe.FormatPainterStatus.ONCE:{const C=(u=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),T=this._sheetsSelectionsService.getCurrentLastSelection(),E=T==null?void 0:T.range;C&&m&&E&&(this._painterConfig={unitId:C,subUnitId:m,range:E});break}case pe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?r(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,_.Inject(_.Injector)),Be(1,_.Inject(_.IUniverInstanceService)),Be(2,_.Inject(pe.IFormatPainterService)),Be(3,_.Inject(Y.SheetsSelectionsService)),Be(4,_.Inject(c.ConditionalFormattingRuleModel)),Be(5,_.Inject(c.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(t,e,n,r)=>{for(var a=r>1?void 0:r?co(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ur=(t,e)=>(n,r)=>e(n,r,t);let Ut=class extends _.Disposable{constructor(t,e,n){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),e=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(pe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,T=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(T)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&e(n)})}};Ut=uo([ur(0,_.Inject(c.ConditionalFormattingViewModel)),ur(1,_.IUniverInstanceService),ur(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,go=(t,e,n,r)=>{for(var a=r>1?void 0:r?po(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},dr=(t,e)=>(n,r)=>e(n,r,t),In=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);K.UniverSheetsConditionalFormattingUIPlugin=class extends _.Plugin{constructor(e=Dt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},Dt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand()}onStarting(){_.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[K.ConditionalFormattingClearController],[Vt],[Ut]]),_.touchDependencies(this._injector,[[dt]])}onReady(){_.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){_.touchDependencies(this._injector,[[Mt],[K.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},In(K.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In(K.UniverSheetsConditionalFormattingUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingUIPlugin=go([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),dr(1,_.Inject(_.Injector)),dr(2,_.Inject(_.ICommandService)),dr(3,_.IConfigService)],K.UniverSheetsConditionalFormattingUIPlugin),K.AddAverageCfCommand=At,K.AddColorScaleConditionalRuleCommand=Wt,K.AddDataBarConditionalRuleCommand=jt,K.AddDuplicateValuesCfCommand=Ht,K.AddNumberCfCommand=Bt,K.AddRankCfCommand=Ft,K.AddTextCfCommand=Gt,K.AddTimePeriodCfCommand=qt,K.AddUniqueValuesCfCommand=Xt,K.OpenConditionalFormattingOperator=it,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
162
|
+
`,children:[_.jsx(Z.Button,{onClick:l,children:t.t("sheet.cf.panel.cancel")}),_.jsx(Z.Button,{className:A.mLSm,variant:"primary",onClick:b,children:t.t("sheet.cf.panel.submit")})]})]})},Va=e=>{const[t,n]=V.useState(e.rule),[r,a]=V.useState(!!e.rule),o=()=>{a(!0)},c=()=>{a(!1),n(void 0)},y=h=>{n(h),a(!0)};return _.jsx("div",{className:A.conditionalFormattingWrap,children:r?_.jsx(La,{onCancel:c,rule:t}):_.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(e,t,n,r)=>{for(var a=r>1?void 0:r?Ua(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},at=(e,t)=>(n,r)=>t(n,r,e);const Pt="sheet.conditional.formatting.panel";let ot=class extends w.Disposable{constructor(t,n,r,a,o){super();xe(this,"_sidebarDisposable",null);this._univerInstanceService=t,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(c=>{var y;c||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(c=>{c.id===Pt&&(c.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(t){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:t,key:w.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,w.IUniverInstanceService),at(1,w.Inject(w.Injector)),at(2,w.Inject(te.ComponentManager)),at(3,w.Inject(te.ISidebarService)),at(4,w.Inject(w.LocaleService))],ot);var ye=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(ye||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:w.CommandType.OPERATION,handler:(e,t)=>{var y;const n=e.get(ot),r=e.get(Y.SheetsSelectionsService),a=e.get(w.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(h=>h.range))||[];switch(t.value){case 3:{n.openPanel({...u.createDefaultRule(),ranges:o});break}case 4:{const h={...u.createDefaultRule,ranges:o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.rank}};n.openPanel(h);break}case 5:{const h={...u.createDefaultRule,ranges:o,rule:{type:u.CFRuleType.highlightCell,subType:u.CFSubRuleType.formula,value:"="}};n.openPanel(h);break}case 6:{const h={...u.createDefaultRule,ranges:o,rule:{type:u.CFRuleType.colorScale,config:[]}};n.openPanel(h);break}case 7:{const h={...u.createDefaultRule,ranges:o,rule:{type:u.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(h);break}case 8:{const h={...u.createDefaultRule,ranges:o,rule:{type:u.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(h);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...u.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(u.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(u.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(e,t,n,r)=>{for(var a=r>1?void 0:r?ka(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},st=(e,t)=>(n,r)=>t(n,r,e);let lt=class extends w.Disposable{constructor(t,n,r,a,o){super();xe(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,n,r)=>this._collectConditionalRule(t,n,r),onPasteCells:(t,n,r,a)=>{const{copyType:o=pe.COPY_TYPE.COPY,pasteType:c}=a,{range:y}=t||{},{range:h}=n;return this._generateConditionalFormattingMutations(h,{copyType:o,pasteType:c,copyRange:y})}}))}_collectConditionalRule(t,n,r){const a=new w.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:n,cfMap:o}};const c=this._injector.invoke(m=>Y.rangeToDiscreteRange(r,m,t,n));if(!c)return;const{rows:y,cols:h}=c,T=new Set;y.forEach((m,C)=>{h.forEach((E,R)=>{const I=this._conditionalFormattingViewModel.getCellCfs(t,n,m,E);I&&(I.forEach(S=>T.add(S.cfId)),a.setValue(C,R,I.map(S=>S.cfId)))})}),T.forEach(m=>{const C=this._conditionalFormattingRuleModel.getRule(t,n,m);C&&(o[m]=C.rule)})}_generateConditionalFormattingMutations(t,n){const r=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const c=a.getSheetId();if(n.copyType===pe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![pe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,pe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,pe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[h,T],mapFunc:m}=pe.virtualizeDiscreteRanges([n.copyRange,t]),C=pe.getRepeatRange(h,T,!0),E={};w.Range.foreach(T,(l,g)=>{const{row:d,col:v}=m(l,g),D=this._conditionalFormattingViewModel.getCellCfs(o,c,d,v);D&&D.forEach(M=>{if(!E[M.cfId]){const U=new w.ObjectMatrix;E[M.cfId]=U;const z=this._conditionalFormattingRuleModel.getRule(o,c,M.cfId);z==null||z.ranges.forEach(O=>{w.Range.foreach(O,(L,B)=>{U.setValue(L,B,1)})})}E[M.cfId].realDeleteValue(d,v)})});const{matrix:R,info:I}=this._copyInfo,S=[];let p=this._conditionalFormattingRuleModel.createCfId(o,c);const i={},s=l=>{if(i[l])return i[l];const g=I==null?void 0:I.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,c)||[],...S].find(v=>w.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:p,ranges:[],stopIfTrue:!1};return i[l]=v,S.push(v),p=`${Number(p)+1}`,v}};C.forEach(l=>{R&&R.forValue((g,d,v)=>{const D=w.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:M,col:U}=m(D.startRow,D.startColumn);v.forEach(z=>{if(!E[z]){const O=s(z),L=new w.ObjectMatrix;E[z]=L,O.ranges.forEach(B=>{w.Range.foreach(B,(q,$)=>{L.setValue(q,$,1)})})}E[z].setValue(M,U,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:c,cfId:l};f.push({id:u.DeleteConditionalRuleMutation.id,params:v}),b.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(S.some(v=>v.cfId===l)){const v=s(l),D={unitId:o,subUnitId:c,rule:{...v,ranges:d}};f.push({id:u.AddConditionalRuleMutation.id,params:D}),b.push(u.AddConditionalRuleMutationUndoFactory(this._injector,D))}else{const v=this._conditionalFormattingRuleModel.getRule(o,c,l);if(!v)continue;const D={unitId:o,subUnitId:c,rule:{...v,ranges:d}};f.push({id:u.SetConditionalRuleMutation.id,params:D}),b.push(...u.setConditionalRuleMutationUndoFactory(this._injector,D))}}return{redos:f,undos:b}}};lt=Aa([st(0,w.Inject(pe.ISheetClipboardService)),st(1,w.Inject(u.ConditionalFormattingRuleModel)),st(2,w.Inject(w.Injector)),st(3,w.Inject(u.ConditionalFormattingViewModel)),st(4,w.Inject(w.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(e,t,n,r)=>{for(var a=r>1?void 0:r?Wa(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},cr=(e,t)=>(n,r)=>t(n,r,e);let ct=class extends w.Disposable{constructor(e,t,n){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===u.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},e.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([cr(0,w.Inject(w.LocaleService)),cr(1,w.ICommandService),cr(2,w.Inject(Y.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(e,t,n,r)=>{for(var a=r>1?void 0:r?Ha(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},xt=(e,t)=>(n,r)=>t(n,r,e);let ut=class extends w.Disposable{constructor(e,t,n,r){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const e=new Map,t=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const c=h=>{const T=[...o.ranges],m=T.map(E=>Y.handleDefaultRangeChangeWithEffectRefCommands(E,h)).filter(E=>!!E);if(u.isRangesEqual(m,T))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},R=[{id:u.SetConditionalRuleMutation.id,params:E}],I=u.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:R,undos:I}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},R=[{id:u.DeleteConditionalRuleMutation.id,params:E}],I=u.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:R,undos:I}}},y=[];o.ranges.forEach(h=>{const T=this._refRangeService.registerRefRange(h,c);y.push(()=>T.dispose())}),e.set(t(r,a,o.cfId),()=>y.forEach(h=>h()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:c}=r,y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),h=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(h==null?void 0:h.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const T=e.get(t(a,o,c.cfId));T&&T();break}case"set":{const T=e.get(t(a,o,c.cfId));T&&T(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(w.toDisposable(()=>{e.forEach(r=>{r()}),e.clear()}))}};ut=Ba([xt(0,w.Inject(u.ConditionalFormattingRuleModel)),xt(1,w.Inject(w.IUniverInstanceService)),xt(2,w.Inject(w.Injector)),xt(3,w.Inject(Y.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(e,t,n,r)=>{for(var a=r>1?void 0:r?Fa(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},He=(e,t)=>(n,r)=>t(n,r,e);let dt=class extends w.Disposable{constructor(t,n,r,a,o,c){super();xe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=t,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=c,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const t=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(t))==null||n.with(pe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(t))==null?void 0:r.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(t=>!!t.length),qe.filter(t=>{const n=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?t.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:w.InterceptorEffectEnum.Style,handler:(t,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(t);const o=n.workbook.getStyles(),y={...(typeof(t==null?void 0:t.s)=="string"?o.get(t==null?void 0:t.s):t==null?void 0:t.s)||{}},h={...t,s:y};return a.style&&Object.assign(y,a.style),h.fontRenderExtension||(h.fontRenderExtension={},a.isShowValue!==void 0&&(h.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(h.dataBar=a.dataBar),a.iconSet&&(h.iconSet=a.iconSet,h.fontRenderExtension.leftOffset=u.DEFAULT_PADDING+u.DEFAULT_WIDTH),r(h)},priority:10}))}};dt=Ga([He(0,w.Inject(Y.SheetInterceptorService)),He(1,w.Inject(u.ConditionalFormattingService)),He(2,w.Inject(w.IUniverInstanceService)),He(3,w.Inject(hr.IRenderManagerService)),He(4,w.Inject(u.ConditionalFormattingViewModel)),He(5,w.Inject(u.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",Dt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(e,t,n)=>t in e?qa(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ka=(e,t,n,r)=>{for(var a=r>1?void 0:r?Xa(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},ur=(e,t)=>(n,r)=>t(n,r,e),bn=(e,t,n)=>Ya(e,typeof t!="symbol"?t+"":t,n);K.UniverSheetsConditionalFormattingMobileUIPlugin=class extends w.Plugin{constructor(t=Dt,n,r,a){super(),this._config=t,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...c}=w.merge({},Dt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,c),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,Yt,it].forEach(t=>{this._commandService.registerCommand(t)})}},bn(K.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn(K.UniverSheetsConditionalFormattingMobileUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([w.DependentOn(u.UniverSheetsConditionalFormattingPlugin),ur(1,w.Inject(w.Injector)),ur(2,w.Inject(w.ICommandService)),ur(3,w.IConfigService)],K.UniverSheetsConditionalFormattingMobileUIPlugin);var Za=Object.getOwnPropertyDescriptor,$a=(e,t,n,r)=>{for(var a=r>1?void 0:r?Za(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},ft=(e,t)=>(n,r)=>t(n,r,e);let Mt=class extends w.Disposable{constructor(e,t,n,r,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,c,y,h)=>{var R;const T=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(R=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId();if(!T||!m)return;const C={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};w.Range.foreach(c,(I,S)=>{const p=w.Rectangle.getPositionRange({startRow:I,startColumn:S,endColumn:S,endRow:I},C),i=w.Rectangle.getPositionRange({startRow:I,startColumn:S,endColumn:S,endRow:I},E),{row:s,col:f}=h(p.startRow,p.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(T,m,s,f),{row:l,col:g}=h(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(T,m,l,g);d&&d.forEach(v=>{let D=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(T,m,v.cfId);if(!M)return;D=new w.ObjectMatrix,M.ranges.forEach(U=>{w.Range.foreach(U,(z,O)=>{D.setValue(z,O,1)})}),y.set(v.cfId,D)}D.realDeleteValue(l,g)}),b&&b.forEach(v=>{let D=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(T,m,v.cfId);if(!M)return;D=new w.ObjectMatrix,M.ranges.forEach(U=>{w.Range.foreach(U,(z,O)=>{D.setValue(z,O,1)})}),y.set(v.cfId,D)}D.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const c=(i=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),h=new Map,T=[],m=[];if(!c||!y)return e();const C=pe.virtualizeDiscreteRanges([a,o]),[E,R]=C.ranges,{mapFunc:I}=C,S={row:E.startRow,col:E.startColumn};return pe.getAutoFillRepeatRange(E,R).forEach(b=>{t(S,b.repeatStartCell,b.relativeRange,h,I)}),h.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(c,y,l);if(!g)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:c,subUnitId:y,rule:{...g,ranges:d}};T.push({id:u.SetConditionalRuleMutation.id,params:v}),m.push(...u.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:c,subUnitId:y,cfId:g.cfId};T.push({id:u.DeleteConditionalRuleMutation.id,params:v}),m.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:T}},r={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,c)=>{if(c===pe.APPLY_TYPE.COPY||c===pe.APPLY_TYPE.ONLY_FORMAT||c===pe.APPLY_TYPE.SERIES){const{source:y,target:h}=a;return n(y,h)}return e()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=$a([ft(0,w.Inject(w.Injector)),ft(1,w.Inject(w.IUniverInstanceService)),ft(2,w.Inject(pe.IAutoFillService)),ft(3,w.Inject(u.ConditionalFormattingRuleModel)),ft(4,w.Inject(u.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(e,t,n,r)=>{for(var a=r>1?void 0:r?Ja(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},pt=(e,t)=>(n,r)=>t(n,r,e);K.ConditionalFormattingClearController=class extends w.Disposable{constructor(t,n,r,a,o){super(),this._injector=t,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{var o;const n=[],r=[],a={redos:n,undos:r};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(t.id)){const c=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(I=>I.range);if(!c)return a;const y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),h=y.getActiveSheet();if(!h)return a;const T=y.getUnitId(),m=h.getSheetId(),C=this._conditionalFormattingRuleModel.getSubunitRules(T,m);if(!C||!C.length)return a;const{redos:E,undos:R}=Sn(this._injector,C,c,T,m);n.push(...E),r.push(...R)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:t,subUnitId:n,ranges:r})=>{const a=[],o=[],c={redos:a,undos:o};if(!r||!r.length)return c;const y=this._conditionalFormattingRuleModel.getSubunitRules(t,n);if(!y||!y.length)return c;const{redos:h,undos:T}=Sn(this._injector,y,r,t,n);return a.push(...h),o.push(...T),c}}))}},K.ConditionalFormattingClearController=Qa([pt(0,w.Inject(w.Injector)),pt(1,w.Inject(w.IUniverInstanceService)),pt(2,w.Inject(Y.SheetInterceptorService)),pt(3,w.Inject(Y.SheetsSelectionsService)),pt(4,w.Inject(u.ConditionalFormattingRuleModel))],K.ConditionalFormattingClearController);function Sn(e,t,n,r,a){const o=[],c=[];return t.filter(y=>n.some(h=>y.ranges.some(T=>w.Rectangle.getIntersects(T,h)))).forEach(y=>{const T=new Y.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(T.length){const m={id:u.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:T}}},C=u.setConditionalRuleMutationUndoFactory(e,m.params);o.push(m),c.push(...C)}else{const m={id:u.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},C=u.DeleteConditionalRuleMutationUndoFactory(e,m.params);o.push(m),c.push(...C)}}),{redos:o,undos:c}}var eo=Object.getOwnPropertyDescriptor,to=(e,t,n,r)=>{for(var a=r>1?void 0:r?eo(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},Cn=(e,t)=>(n,r)=>t(n,r,e);let Nt=class extends w.Disposable{constructor(e,t){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(w.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(e,t,n)=>{var c,y,h;e||n(e);const r=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col),a=(c=r==null?void 0:r.style)!=null?c:{},o=Object.keys(a);if(e!=null&&e.p)return(h=(y=e.p.body)==null?void 0:y.textRuns)==null||h.forEach(T=>{T.ts&&o.forEach(m=>{var C;(C=T.ts)==null||delete C[m]})}),n(e);{const T={...(typeof(e==null?void 0:e.s)=="string"?t.workbook.getStyles().get(e.s):e==null?void 0:e.s)||{}};o.forEach(C=>{delete T[C]});const m={...e,s:{...T}};return n(m)}}})))}};Nt=to([Cn(0,w.Inject(Y.SheetInterceptorService)),Cn(1,w.Inject(u.ConditionalFormattingService))],Nt);const Tn=[Y.SetWorksheetActiveOperation.id,u.AddConditionalRuleMutation.id,u.SetConditionalRuleMutation.id,u.DeleteConditionalRuleMutation.id,u.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:ye.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:ye.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:ye.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:ye.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:ye.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:ye.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:ye.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:ye.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:ye.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:ye.clearWorkSheetRules}],ro=e=>{const t=e.get(Y.SheetsSelectionsService),n=e.get(w.ICommandService),r=e.get(w.IUniverInstanceService),a=e.get(u.ConditionalFormattingRuleModel),o=new Ce.Observable(h=>Ce.merge(t.selectionMoveEnd$,t.selectionSet$,new Ce.Observable(T=>{const m=n.onCommandExecuted(C=>{var S;const{id:E,params:R}=C,I=(S=r.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();Tn.includes(E)&&R.unitId===I&&T.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var S;const T=((S=t.getCurrentSelections())==null?void 0:S.map(p=>p.range))||[],m=r.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!m)return;const C=m.getActiveSheet();if(!C)return;const I=(a.getSubunitRules(m.getUnitId(),C.getSheetId())||[]).filter(p=>p.ranges.some(i=>T.some(s=>w.Rectangle.intersects(s,i)))).map(p=>p.ranges).every(p=>Y.checkRangesEditablePermission(e,m.getUnitId(),C.getSheetId(),p));h.next(I)})),c=new Ce.Observable(h=>new Ce.Observable(T=>{const m=n.onCommandExecuted(C=>{var S;const{id:E,params:R}=C,I=(S=r.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getUnitId();Tn.includes(E)&&R.unitId===I&&T.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const T=r.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET);if(!T)return;const m=T.getActiveSheet();if(!m)return;const C=a.getSubunitRules(T.getUnitId(),m.getSheetId())||[];if(!C.length)return h.next(!1),!1;const E=C.map(R=>R.ranges).every(R=>Y.checkRangesEditablePermission(e,T.getUnitId(),m.getSheetId(),R));h.next(E)})),y=new Ce.Observable(h=>{o.subscribe(T=>{const m=ht.find(C=>C.value===ye.clearRangeRules);m&&(m.disabled=!T,h.next(ht))}),c.subscribe(T=>{const m=ht.find(C=>C.value===ye.clearWorkSheetRules);m&&(m.disabled=!T,h.next(ht))}),h.next(ht)});return{id:it.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(e,w.UniverInstanceType.UNIVER_SHEET),disabled$:pe.getCurrentRangeDisable$(e,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},no={[te.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(e,t,n,r)=>{for(var a=r>1?void 0:r?ao(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},wn=(e,t)=>(n,r)=>t(n,r,e);let Lt=class extends w.Disposable{constructor(t,n){super();xe(this,"_sidebarDisposable",null);this._injector=t,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,w.Inject(w.Injector)),wn(1,te.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(e,t,n,r)=>{for(var a=r>1?void 0:r?io(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},Be=(e,t)=>(n,r)=>t(n,r,e);const lo=(e,t)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(t)%n(e),o=r(t)%r(e),c=Math.floor(n(t)/n(e)),y=Math.floor(r(t)/r(e)),h=[],T={startRow:0,endRow:n(e)-1,startColumn:0,endColumn:r(e)-1};if(n(t)===1&&r(t)===1){const m={startRow:t.startRow,endRow:t.startRow,startColumn:t.startColumn,endColumn:t.startColumn};return h.push({repeatRelativeRange:T,startRange:m}),h}for(let m=0;m<c+(a?.1:0);m++)for(let C=0;C<y+(o?.1:0);C++){const E=n(e)*m,R=r(e)*C,I={startRow:E+t.startRow,endRow:E+t.startRow,startColumn:R+t.startColumn,endColumn:R+t.startColumn};let S=T;m===c&&a&&(S={...S},S.endRow=S.endRow-(n(e)-a)),C===y&&o&&(S={...S},S.endColumn=S.endColumn-(r(e)-o)),h.push({repeatRelativeRange:S,startRange:I})}return h};let Vt=class extends w.Disposable{constructor(t,n,r,a,o,c){super();xe(this,"_painterConfig",null);this._injector=t,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=c,this._initFormattingPainter()}_initFormattingPainter(){const t=()=>({redos:[],undos:[]}),n=(o,c,y,h,T)=>{const{unitId:m,subUnitId:C}=this._painterConfig,{targetUnitId:E,targetSubUnitId:R}=T,I={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},S={startRow:c.row,startColumn:c.col,endColumn:c.col,endRow:c.row};w.Range.foreach(y,(p,i)=>{const s=w.Rectangle.getPositionRange({startRow:p,startColumn:i,endColumn:i,endRow:p},I),f=w.Rectangle.getPositionRange({startRow:p,startColumn:i,endColumn:i,endRow:p},S),b=this._conditionalFormattingViewModel.getCellCfs(m,C,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,R,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=h.get(g.cfId);if(!h.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,R,g.cfId);if(!v)return;d=new w.ObjectMatrix,v.ranges.forEach(D=>{w.Range.foreach(D,(M,U)=>{d.setValue(M,U,1)})}),h.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=h.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,c,y)=>{var s;const{range:h,unitId:T,subUnitId:m}=this._painterConfig,C=o!==T||m!==c,E=new Map,R=[],I=[];if(!o||!c||!T||!m)return t();const S=(s=this._conditionalFormattingRuleModel.getSubunitRules(T,m))!=null?s:[];S==null||S.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>w.Rectangle.intersects(h,g))){const g=new w.ObjectMatrix;C||b.forEach(d=>{w.Range.foreach(d,(v,D)=>{g.setValue(v,D,1)})}),E.set(l,g)}});const p={row:h.startRow,col:h.startColumn};return lo(h,y).forEach(f=>{n(p,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:c})}),E.forEach((f,b)=>{if(C){const l=this._conditionalFormattingRuleModel.getRule(o,c,b),g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:c,rule:{...l,ranges:g}};R.push({id:u.SetConditionalRuleMutation.id,params:d}),I.push(...u.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:c,cfId:l.cfId};R.push({id:u.DeleteConditionalRuleMutation.id,params:d}),I.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(T,m,b);if(d){const v={unitId:o,subUnitId:c,rule:{...w.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,c),ranges:g}};R.push({id:u.AddConditionalRuleMutation.id,params:v}),I.push(u.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(T,m,b);if(!l)return;const g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:T,subUnitId:m,rule:{...l,ranges:g}};R.push({id:u.SetConditionalRuleMutation.id,params:d}),I.push(...u.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:T,subUnitId:m,cfId:l.cfId};R.push({id:u.DeleteConditionalRuleMutation.id,params:d}),I.push(...u.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:I,redos:R}},a={id:u.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var c,y,h;switch(o){case pe.FormatPainterStatus.INFINITE:case pe.FormatPainterStatus.ONCE:{const T=(c=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:c.getUnitId(),m=(h=(y=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:h.getSheetId(),C=this._sheetsSelectionsService.getCurrentLastSelection(),E=C==null?void 0:C.range;T&&m&&E&&(this._painterConfig={unitId:T,subUnitId:m,range:E});break}case pe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,c,y)=>this._painterConfig?r(o,c,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,w.Inject(w.Injector)),Be(1,w.Inject(w.IUniverInstanceService)),Be(2,w.Inject(pe.IFormatPainterService)),Be(3,w.Inject(Y.SheetsSelectionsService)),Be(4,w.Inject(u.ConditionalFormattingRuleModel)),Be(5,w.Inject(u.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(e,t,n,r)=>{for(var a=r>1?void 0:r?co(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},dr=(e,t)=>(n,r)=>t(n,r,e);let Ut=class extends w.Disposable{constructor(e,t,n){super(),this._conditionalFormattingViewModel=e,this._univerInstanceService=t,this._renderManagerService=n,this._init()}_init(){const e=this._univerInstanceService.getCurrentUnitForType(w.UniverInstanceType.UNIVER_SHEET),t=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(pe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(c=>{if(c){const y=c.skeleton.rowColumnSegment,h=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*h*9,C=Math.max(u.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(C)}}))};e&&t(e),this._univerInstanceService.getCurrentTypeOfUnit$(w.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&t(n)})}};Ut=uo([dr(0,w.Inject(u.ConditionalFormattingViewModel)),dr(1,w.IUniverInstanceService),dr(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(e,t,n)=>t in e?fo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,go=(e,t,n,r)=>{for(var a=r>1?void 0:r?po(t,n):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(a=c(a)||a);return a},fr=(e,t)=>(n,r)=>t(n,r,e),In=(e,t,n)=>ho(e,typeof t!="symbol"?t+"":t,n);K.UniverSheetsConditionalFormattingUIPlugin=class extends w.Plugin{constructor(t=Dt,n,r,a){super(),this._config=t,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...c}=w.merge({},Dt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,c),this._initCommand()}onStarting(){w.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[K.ConditionalFormattingClearController],[Vt],[Ut]]),w.touchDependencies(this._injector,[[dt]])}onReady(){w.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){w.touchDependencies(this._injector,[[Mt],[K.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,Yt,it].forEach(t=>{this._commandService.registerCommand(t)})}},In(K.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${u.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In(K.UniverSheetsConditionalFormattingUIPlugin,"type",w.UniverInstanceType.UNIVER_SHEET),K.UniverSheetsConditionalFormattingUIPlugin=go([w.DependentOn(u.UniverSheetsConditionalFormattingPlugin),fr(1,w.Inject(w.Injector)),fr(2,w.Inject(w.ICommandService)),fr(3,w.IConfigService)],K.UniverSheetsConditionalFormattingUIPlugin),K.AddAverageCfCommand=Wt,K.AddColorScaleConditionalRuleCommand=jt,K.AddDataBarConditionalRuleCommand=Ht,K.AddDuplicateValuesCfCommand=Bt,K.AddNumberCfCommand=Ft,K.AddRankCfCommand=Gt,K.AddTextCfCommand=qt,K.AddTimePeriodCfCommand=Xt,K.AddUniqueValuesCfCommand=Yt,K.OpenConditionalFormattingOperator=it,Object.defineProperty(K,Symbol.toStringTag,{value:"Module"})});
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
// index
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@univerjs/preset-sheets-conditional-formatting",
|
|
3
|
-
"version": "0.6.10-nightly.
|
|
3
|
+
"version": "0.6.10-nightly.202504171607",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "DreamNum <developer@univer.ai>",
|
|
@@ -57,11 +57,11 @@
|
|
|
57
57
|
"rxjs": ">=7.0.0"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@univerjs/sheets-conditional-formatting": "0.6.10-nightly.
|
|
61
|
-
"@univerjs/sheets-conditional-formatting-ui": "0.6.10-nightly.
|
|
60
|
+
"@univerjs/sheets-conditional-formatting": "0.6.10-nightly.202504171607",
|
|
61
|
+
"@univerjs/sheets-conditional-formatting-ui": "0.6.10-nightly.202504171607"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
-
"@univerjs/core": "0.6.10-nightly.
|
|
64
|
+
"@univerjs/core": "0.6.10-nightly.202504171607",
|
|
65
65
|
"react": "18.3.1",
|
|
66
66
|
"react-dom": "18.3.1",
|
|
67
67
|
"typescript": "^5.8.2",
|