@univerjs/preset-sheets-conditional-formatting 0.6.4 → 0.6.5-nightly.202503131607

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.
Files changed (2) hide show
  1. package/lib/umd/index.js +77 -94
  2. package/package.json +9 -7
package/lib/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @univerjs/sheets-conditional-formatting/index
2
- (function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("rxjs"),require("rxjs/operators"),require("@univerjs/engine-formula"),require("@univerjs/engine-render"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs","rxjs/operators","@univerjs/engine-formula","@univerjs/engine-render","@univerjs/sheets"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverEngineFormula,C.UniverEngineRender,C.UniverSheets))})(this,function(C,u,B,i2,O,Z,A){"use strict";var p0=Object.defineProperty;var A0=(C,u,B)=>u in C?p0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[u]=B;var F=(C,u,B)=>A0(C,typeof u!="symbol"?u+"":u,B);var u2;const h2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var b=(a=>(a.beginsWith="beginsWith",a.endsWith="endsWith",a.containsText="containsText",a.notContainsText="notContainsText",a.equal="equal",a.notEqual="notEqual",a.containsBlanks="containsBlanks",a.notContainsBlanks="notContainsBlanks",a.containsErrors="containsErrors",a.notContainsErrors="notContainsErrors",a))(b||{}),L=(a=>(a.today="today",a.yesterday="yesterday",a.tomorrow="tomorrow",a.last7Days="last7Days",a.thisMonth="thisMonth",a.lastMonth="lastMonth",a.nextMonth="nextMonth",a.thisWeek="thisWeek",a.lastWeek="lastWeek",a.nextWeek="nextWeek",a))(L||{}),E=(a=>(a.greaterThan="greaterThan",a.greaterThanOrEqual="greaterThanOrEqual",a.lessThan="lessThan",a.lessThanOrEqual="lessThanOrEqual",a.notBetween="notBetween",a.between="between",a.equal="equal",a.notEqual="notEqual",a))(E||{}),R=(a=>(a.highlightCell="highlightCell",a.dataBar="dataBar",a.colorScale="colorScale",a.iconSet="iconSet",a))(R||{}),_=(a=>(a.uniqueValues="uniqueValues",a.duplicateValues="duplicateValues",a.rank="rank",a.text="text",a.timePeriod="timePeriod",a.number="number",a.average="average",a.formula="formula",a))(_||{}),x=(a=>(a.num="num",a.min="min",a.max="max",a.percent="percent",a.percentile="percentile",a.formula="formula",a))(x||{});const X2="#fff",Y2="#000000",K2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),J2=(a,r)=>{switch(a){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(r))return"";break}case"number":return["between","notBetween"].includes(r)?[10,100]:10}return""},z2=(a,r)=>{switch(a){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return r!==void 0?r:10}return""},j=(a,r,n)=>{if(!r)return null;const e=r.findIndex(t=>n(t)===a.id);if(e<0)return null;switch(a.type){case"after":return e+1;case"before":return e-1;case"self":return e}},E2=(a,r,n,e)=>{if(!n)return null;const t=j(a,n,e);let i=j(r,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=j(r,n,e)),r.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},g2=(a,r,n,e)=>{if(a.type==="after"&&["after","before"].includes(r.type))return[a,r];const t={...a},i={...r};if(t.type!=="after"){const s=j(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=j(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},p2=(a,r)=>{if(["after","before"].includes(r.type)){if(a.type==="after")return[r,a];if(a.type==="before")return[r,{...a,type:"self"}]}return null},Q2=(a,r)=>a.id===r.id&&a.type===r.type,A2=()=>`${u.Tools.generateRandomId(8)}`;class I{constructor(){F(this,"_model",new Map);F(this,"_ruleChange$",new B.Subject);F(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(r,n){let e=this.getSubunitRules(r,n);if(!e){e=[];let t=this._model.get(r);t||(t=new Map,this._model.set(r,t)),t.set(n,e)}return e}getRule(r,n,e){const t=this.getSubunitRules(r,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(r){return this._model.get(r)||null}getSubunitRules(r,n){var t;return((t=this._model.get(r))==null?void 0:t.get(n))||null}deleteRule(r,n,e){const t=this.getSubunitRules(r,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"delete"}))}}setRule(r,n,e,t){const s=this._ensureList(r,n).find(o=>o.cfId===t);if(s){const o=u.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"set",oldRule:o})}}addRule(r,n,e){const t=this._ensureList(r,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:r,type:"add"})}moveRulePriority(r,n,e,t){const i=this._ensureList(r,n),s=j(e,i,l=>l.cfId),o=j(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const d=i[s];d&&(E2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:d,subUnitId:n,unitId:r,type:"sort"}))}createCfId(r,n){return A2()}deleteUnitId(r){this._model.delete(r)}}const J={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var e0=Object.getOwnPropertyDescriptor,t0=(a,r,n,e)=>{for(var t=e>1?void 0:e?e0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},C2=(a,r)=>(n,e)=>r(n,e,a),T=(a=>(a[a.NOT_REGISTER=1]="NOT_REGISTER",a[a.SUCCESS=2]="SUCCESS",a[a.WAIT=3]="WAIT",a[a.ERROR=4]="ERROR",a))(T||{});const n0=a=>{const r=a&&a[0]&&a[0][0];return(r==null?void 0:r.t)===u.CellValueType.BOOLEAN?r.v===u.BooleanNumber.TRUE||r.v===!0:r?r.v:!1};C.ConditionalFormattingFormulaService=class extends u.Disposable{constructor(n,e,t){super();F(this,"_formulaMap",new Map);F(this,"_result$",new B.Subject);F(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case R.colorScale:return e.config.some(t=>t.value.type===x.formula);case R.dataBar:return[e.config.max,e.config.min].some(t=>t.type===x.formula);case R.iconSet:return e.config.some(t=>t.value.type===x.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===O.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new u.ObjectMatrix(e.unitOtherData[t][i][s]),d=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!d)continue;const l=d.ranges;if(!l)continue;const c=d.result,h=l[0].startRow,g=l[0].startColumn;o.forValue((v,w,p)=>{c.setValue(h+v,g+w,n0(p))}),d.status=2;const m=this._getAllFormulaResultByCfId(t,i,d.cfId).every(v=>v.status===2);this._result$.next({...d,isAllFinished:m})}}})),this._activeDirtyManagerService.register(J.id,{commandId:J.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new u.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),d=this.createCFormulaId(t,i);if(o.getValue(d,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:d,ranges:s,formulaId:l,status:3,result:new u.ObjectMatrix});const c={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(O.SetOtherFormulaMutation.id,c,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(J.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(O.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const d=this.getSubUnitFormulaMap(n,e);if(!d)return{status:1};const l=d.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(d=>d.cfId===t);return o.forEach(d=>{s.deleteValue(d.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${u.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=t0([C2(0,u.Inject(u.ICommandService)),C2(1,u.Inject(O.IActiveDirtyManagerService)),C2(2,u.Inject(I))],C.ConditionalFormattingFormulaService);var N=(a=>(a.preComputingStart="preComputingStart",a.preComputing="preComputing",a.preComputingEnd="preComputingEnd",a.preComputingError="preComputingError",a))(N||{});class a2{constructor(r){F(this,"_cache");F(this,"_preComputingStatus$",new B.BehaviorSubject("preComputingStart"));F(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(i2.distinctUntilChanged()));F(this,"_preComputingCache");F(this,"_rule");this._context=r,this._cache=new u.LRUMap(r.limit),this._rule=r.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(r){this._cache.limit=r}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(r){this._rule=r,this.resetPreComputingCache()}getCell(r,n){const e=this._createKey(r,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(r,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(r,n,this._getContext()),t=this.getPreComputingResult(r,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(r,n,t,this._getContext());return i!==null&&this._setCache(r,n,i),i}setPreComputingCache(r){this._preComputingCache=r}getPreComputingResult(r,n){return this._preComputingCache}_createKey(r,n){return`${r}_${n}`}_setCache(r,n,e){const t=this._createKey(r,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(r=>{r==="preComputingEnd"&&this.clearCache()})}}function z(a,r){return Math.abs(a-r)<Number.EPSILON}const k=a=>[void 0,null].includes(a),V=a=>{var e,t;if(!a)return null;if(a.t===u.CellValueType.BOOLEAN)return a.v===u.BooleanNumber.TRUE?O.BooleanValue.TRUE:O.BooleanValue.FALSE;const r=a.v,n=(t=(e=a.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return k(r)?k(n)?null:n:r},D2=86400;function y2(a,r=!0){if(r&&a>=0){if(a===0)return[1900,1,0];if(a===60)return[1900,2,29];if(a<60)return[1900,a<32?1:2,(a-1)%31+1]}let n=a+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const _2=a=>{let r=a|0;const n=D2*(a-r);let e=Math.floor(n);n-e>.9999&&(e+=1,e===D2&&(e=0,r+=1));const t=e<0?D2+e:e,[i,s,o]=y2(a,!0),d=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,c=Math.floor(t)%60;return u.dayjs(`${i}/${s}/${o} ${d}:${l}:${c}`).valueOf()},Q=(a,r,n)=>{switch(a.type){case x.max:{let e=0;return r.forValue((t,i,s)=>{s>e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.min:{let e;return r.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.percent:{let e,t;r.forValue((o,d,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(a.value)||0,100),0);return{status:T.SUCCESS,result:i*(s/100)+(t||0)}}case x.percentile:{const e=r.toNativeArray().sort((l,c)=>l-c),t=Math.max(Math.min(Number(a.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,d=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:T.SUCCESS,result:d}}case x.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(a.value),d=e.get(C.ConditionalFormattingFormulaService);return d.registerFormulaWithRange(t,i,s,o),d.getFormulaResultWithCoords(t,i,s,o)}case x.num:{const e=Number(a.value);return{status:T.SUCCESS,result:Number.isNaN(e)?0:e}}}},i0=(a,r,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),s=new u.ObjectMatrix;return n.ranges.forEach(o=>{u.Range.foreach(o,(d,l)=>{const c=i.getCellCfs(a,r,d,l);if(c){const h=c.find(g=>g.cfId===n.cfId);h!=null&&h.result&&s.setValue(d,l,h.result)}})}),s},G=(a,r)=>{switch(a.operator){case E.between:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return r>=n&&r<=e}case E.notBetween:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return!(r>=n&&r<=e)}case E.equal:{const n=a.value||0;return z(n,r)}case E.notEqual:{const n=a.value||0;return!z(n,r)}case E.greaterThan:{const n=a.value||0;return r>n}case E.greaterThanOrEqual:{const n=a.value||0;return r>=n}case E.lessThan:{const n=a.value||0;return r<n}case E.lessThanOrEqual:{const n=a.value||0;return r<=n}default:return!1}},M2=a=>{switch(a){case E.greaterThan:return E.lessThanOrEqual;case E.greaterThanOrEqual:return E.lessThan;case E.lessThan:return E.greaterThanOrEqual;case E.lessThanOrEqual:return E.greaterThan}return a},I2=(a,r)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=a.findIndex(i=>i.value>=r),t=e-1;if(e===0)return a[0].color.toRgbString();if(t>=0){const i=a[t],s=a[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),d=n(s.color.toRgb()),l=s.value-i.value,c=(r-i.value)/l,h=["r","g","b","a"].reduce((D,m)=>{const v=o[m];return D[m]=(d[m]-v)*c+v,D},{});return new u.ColorKit(h).toRgbString()}}else return a[a.length-1].color.toRgbString()},r2=(a,r,n)=>a.map(e=>{if(e.startColumn>n||e.startRow>r)return null;const t={...e};return t.endRow=Math.min(t.endRow,r),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function a0(a){let r=0;return new u.ObjectMatrix(a).forValue((n,e,t)=>{r=Math.max(Number.isNaN(r)?0:r,Number(t))}),r}class r0 extends a2{preComputing(r,n,e){const t=e.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.rule.config.every(c=>c.value.type===x.num)&&r2(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=[...t.rule.config].sort((c,h)=>c.index-h.index).map(c=>({value:Q(c.value,s,{...e,cfId:t.cfId}),color:new u.ColorKit(c.color)}));if(!d.some(c=>Z.isObject(c.value)?c.value.status!==T.SUCCESS:!1)){const c=d.map(h=>h.color).reduce((h,g,D)=>(h.result.push({color:g,value:h.sortValue[D]}),h),{result:[],sortValue:d.map(h=>h.value.result).sort((h,g)=>h-g)}).result;this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=t.getCellValue(r,n);if(i.t===u.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return I2(e,s)}}}const R2="sheet-conditional-rule-data-bar",f2="#ffbe38",m2="#abd91a",x2="#000",s0=34;class S2 extends Z.SheetExtension{constructor(){super(...arguments);F(this,"_paddingRightAndLeft",2);F(this,"_paddingTopAndBottom",2);F(this,"uKey",R2);F(this,"Z_INDEX",s0);F(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l&&l.dataBar){const{color:c,value:h,startPoint:g,isGradient:D}=l.dataBar,m=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:v,isMergedMainCell:w,mergeInfo:p,startY:S,endY:y,startX:M,endX:U}=m;if(v||(w&&(S=p.startY,y=p.endY,M=p.startX,U=p.endX),!this.isRenderDiffRangesByCell(p,i)))return;const c2=U-M,w2=y+Z.FIX_ONE_PIXEL_BLUR_OFFSET-S,d2=c2-this._paddingRightAndLeft*2,H2=w2-this._paddingTopAndBottom*2;if(h>0){const K=Math.max(d2*(1-g/100)*h/100,1),P=M+this._paddingRightAndLeft+g/100*d2,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,c),q.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!1,!0,!0,!1),D&&n.stroke()}else{const K=Math.max(d2*g/100*Math.abs(h)/100,1),P=M+this._paddingRightAndLeft+g/100*d2-K,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,"rgb(255 255 255)"),q.addColorStop(1,c),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!0,!1,!1,!0),D&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,d,l,c){const h=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+h,t),n.lineTo(e+i-h,t),d?n.arcTo(e+i,t,e+i,t+h,h):n.lineTo(e+i,t),n.lineTo(e+i,t+s-h),l?n.arcTo(e+i,t+s,e+i-h,t+s,h):n.lineTo(e+i,t+s),n.lineTo(e+h,t+s),c?n.arcTo(e,t+s,e,t+s-h,h):n.lineTo(e,t+s),n.lineTo(e,t+h),o?n.arcTo(e,t,e+h,t,h):n.lineTo(e,t),n.closePath(),n.fill())}}Z.SpreadsheetExtensionRegistry.add(S2);const s2=a=>Math.max(Math.min(100,a),0),l0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class o0 extends a2{preComputing(r,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new u.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(D=>D.type===x.num)&&r2(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{u.Range.foreach(m,(v,w)=>{const p=e.getCellValue(v,w),S=p&&p.v;if(!k(S)&&(p==null?void 0:p.t)===u.CellValueType.NUMBER){const y=Number(S);!Number.isNaN(y)&&o.setValue(v,w,y)}})});const l=Q(i.config.min,o,{...e,cfId:t.cfId}),c=Q(i.config.max,o,{...e,cfId:t.cfId});let h=0,g=0;if(l.status===T.SUCCESS){const D=Number(l.result);h=Number.isNaN(D)?0:D}else{this._preComputingStatus$.next(N.preComputing);return}if(c.status===T.SUCCESS){const D=Number(c.result),m=Number.isNaN(D)?0:D;g=Math.max(m,h),h=Math.min(m,h);let v=50;if(h<0&&g<=0)v=100;else if(h<0&&g>0){const w=Math.abs(g)+Math.abs(h);v=Math.abs(h)/w*100}else h>=0&&g>0&&(v=0);this.setPreComputingCache({min:h,max:g,startPoint:v}),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,c=l.isShowValue,h=l.config.isGradient,g=l0(r,n,t.getCellValue);if(!(g===null||g<i||i===s||s<i)){if(g===0)return{color:x2,startPoint:o,value:0,isGradient:h,isShowValue:c};if(i<0&&s<=0){const D=s-i,m=s2((s-g)/D*100);return m===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-m,isGradient:h,isShowValue:c}}else if(i<0&&s>0)if(g>0){const D=s2(Math.min(g/s,1)*100);return D===0?void 0:{color:l.config.positiveColor||f2,startPoint:o,value:D,isGradient:h,isShowValue:c}}else{const D=s2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return D===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-D,isGradient:h,isShowValue:c}}else if(i>=0&&s>0){const D=s-i,m=0,v=s2((1-(s-g)/D)*100);return v===0?void 0:{color:l.config.positiveColor||f2,startPoint:m,value:v,isGradient:h,isShowValue:c}}}}}class u0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case _.average:{let d=0,l=0;return i.forEach(c=>{u.Range.foreach(c,(h,g)=>{const D=e.getCellValue(h,g),m=V(D||void 0);D&&D.t===u.CellValueType.NUMBER&&m!==void 0&&(d+=Number(m)||0,l++)})}),{value:d/l,type:t.subType}}case _.uniqueValues:case _.duplicateValues:{const d=new Map;return i.forEach(l=>{u.Range.foreach(l,(c,h)=>{const g=e.getCellValue(c,h),D=V(g||void 0);if(D!==void 0){const m=d.get(D);m?d.set(D,m+1):d.set(D,1)}})}),{value:d,type:t.subType}}case _.rank:{let d=[];i.forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=V(m||void 0);m&&m.t===u.CellValueType.NUMBER&&v!==void 0&&d.push(Number(v)||0)})}),d.sort((h,g)=>g-h);const l=e.rule.rule;if(l.isPercent){l.isBottom&&(d=d.toReversed());const h=u.Tools.clamp(l.value,0,100)/100,g=Math.floor(h*d.length),D=u.Tools.clamp(g-1,0,d.length-1);return{value:d[D],type:t.subType}}const c=Math.floor(u.Tools.clamp(l.isBottom?l.value-1:l.value,0,d.length));return l.isBottom?{value:d[d.length-c-1],type:t.subType}:{value:d[Math.max(c-1,0)],type:t.subType}}case _.formula:{const d=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,d.value,e.rule.ranges);const c=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,d.value);return c&&c.status===T.SUCCESS?(this._preComputingStatus$.next(N.preComputingEnd),{value:c.result,type:t.subType}):(this._preComputingStatus$.next(N.preComputing),null)}case _.timePeriod:switch(t.operator){case L.last7Days:return{value:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()},type:t.subType};case L.lastMonth:return{value:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case L.lastWeek:return{value:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case L.nextMonth:return{value:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case L.nextWeek:return{value:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case L.thisMonth:return{value:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()},type:t.subType};case L.thisWeek:return{value:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()},type:t.subType};case L.today:return{value:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()},type:t.subType};case L.tomorrow:return{value:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case L.yesterday:return{value:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(r,n,e,t){const i=t.getCellValue(r,n),s=t.rule.rule;return(()=>{switch(s.subType){case _.number:{const l=i&&Number(i.v),c=(i==null?void 0:i.t)===u.CellValueType.NUMBER,h=s;return c?k(l)||Number.isNaN(l)?void 0:G({operator:h.operator,value:h.value||0},l||0):!![E.notEqual,E.notBetween].includes(h.operator)}case _.text:{const l=s,c=V(i),h=c===null?"":String(c),g=l.value||"";switch(l.operator){case b.beginsWith:return h.startsWith(g);case b.containsBlanks:return/^\s*$/.test(h);case b.notContainsBlanks:return!/^\s*$/.test(h);case b.containsErrors:return O.ERROR_TYPE_SET.has(h);case b.notContainsErrors:return!O.ERROR_TYPE_SET.has(h);case b.containsText:return h.indexOf(g)>-1;case b.notContainsText:return h.indexOf(g)===-1;case b.endsWith:return h.endsWith(g);case b.equal:return h===g;case b.notEqual:return h!==g;default:return!1}}case _.timePeriod:{const l=V(i);if(k(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return;const c=_2(Number(l)),{start:h,end:g}=e.value;return c>=h&&c<=g}case _.average:{const l=i&&i.v,c=Number(l),h=(i==null?void 0:i.t)===u.CellValueType.NUMBER,g=s;if(!h)return E.notEqual===g.operator;if(k(l)||Number.isNaN(c)||!e)return!1;const D=e.value;switch(g.operator){case E.greaterThan:return c>D;case E.greaterThanOrEqual:return c>=D;case E.lessThan:return c<D;case E.lessThanOrEqual:return c<=D;case E.equal:return z(c,D);case E.notEqual:return!z(c,D);default:return!1}}case _.rank:{const l=V(i),c=Number(l);if(k(l)||Number.isNaN(c)||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return!1;const h=e.value;return s.isBottom?c<=h:c>=h}case _.uniqueValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)===1}case _.duplicateValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)!==1}case _.formula:{const l=e==null?void 0:e.value;return l?l.getValue(r,n)===!0:!1}}})()?s.style:{}}}const c0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class d0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.config.every(c=>c.value.type===x.num)&&r2(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=t.config.map(c=>Q(c.value,s,{...e,cfId:e.rule.cfId}));if(!d.some(c=>c.status!==T.SUCCESS)){const c=d.map((h,g)=>({operator:t.config[g].operator,value:Number(h.result)||0})).reduce((h,g,D,m)=>{const v=t.config[D];if(!D||D===m.length-1)h.push({...g,iconId:v.iconId,iconType:v.iconType});else{const w=m[D-1];G(w,g.value)||h.push({...g,iconId:v.iconId,iconType:v.iconType})}return h},[]);this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=c0(r,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let d=0;d<e.length;d++){const l=e[d],c={...l},h={...l},{iconId:g,iconType:D}=l;if(d===0){if(G(l,i))return{iconId:g,iconType:D,isShowValue:o}}else{if(d===e.length-1)return{iconId:g,iconType:D,isShowValue:o};{const m=e[d-1];if(h.operator=M2(m.operator),h.value=m.value,G(c,i)&&G(h,i))return{iconId:g,iconType:D,isShowValue:o}}}}}}var h0=Object.getOwnPropertyDescriptor,g0=(a,r,n,e)=>{for(var t=e>1?void 0:e?h0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},l2=(a,r)=>(n,e)=>r(n,e,a);const o2=50*20*3*3;C.ConditionalFormattingViewModel=class extends u.Disposable{constructor(n,e,t,i){super();F(this,"_calculateUnitManagers",new Map);F(this,"_rTreeManager",new u.RTree);F(this,"_cellCache",new u.LRUMap(o2));F(this,"_markDirty$",new B.Subject);F(this,"markDirty$",this._markDirty$.asObservable());F(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});F(this,"markRuleDirty",(()=>{const n=new B.Subject;return this.disposeWithMe(n.pipe(i2.bufferTime(100),i2.filter(e=>!!e.length),i2.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const d=i.find(l=>l.cfId===s.cfId);d.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var h;const s=(h=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?h:[],o=this._ensureCalculateUnitManager(n,e),d=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(g=>d.has(g.cfId));return l.length?l.map(g=>{const D=o.get(g.cfId);return D?{cfId:g.cfId,result:D.getCell(t,i)}:null}).filter(g=>!!g).map((g,D)=>({...g,priority:D})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===R.highlightCell&&i.rule.subType===_.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,d=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;d.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),d.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(c=>({unitId:e,sheetId:t,id:l.cfId,range:c}))),this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c}))),l.rule.type!==i.rule.type){const c=this._createRuleCalculateUnitInstance(e,t,i);if(!c)return;d.delete(l.cfId),d.set(i.cfId,c)}else{const c=d.get(l.cfId);if(!c)return;c.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:o2,getCellValue:(d,l)=>s.getCellRaw(d,l)||{}};switch(t.rule.type){case R.colorScale:return new r0(o);case R.dataBar:return new o0(o);case R.highlightCell:return new u0(o);case R.iconSet:return new d0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=o2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=g0([l2(0,u.Inject(u.Injector)),l2(1,u.Inject(I)),l2(2,u.Inject(C.ConditionalFormattingFormulaService)),l2(3,u.IUniverInstanceService)],C.ConditionalFormattingViewModel);const f={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},b2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[f.arrow["up-green"],f.arrow["right-gold"],f.arrow["down-red"]]},{name:"3ArrowsGray",list:[f.arrow["up-gray"],f.arrow["right-gray"],f.arrow["down-gray"]]},{name:"4Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"4ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"5Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["right-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"5ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["right-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"3Triangles",list:[f.shape.up,f.shape.cross,f.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"]]},{name:"3Signs",list:[f.shape["roundness-greed"],f.shape["triangle-gold"],f.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[f.shape["indicate-greed"],f.shape["indicate-gold"],f.shape["indicate-red"]]},{name:"4RedToBlack",list:[f.shape["roundness-red"],f.shape["roundness-pink"],f.shape["roundness-gray"],f.shape["roundness-black"]]},{name:"4TrafficLights",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"],f.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[f.feedback.correct,f.feedback.warn,f.feedback.mistake]},{name:"3Symbols2",list:[f.feedback2.correct2,f.feedback2.warn2,f.feedback2.mistake2]},{name:"3Flags",list:[f.flag["flag-green"],f.flag["flag-gold"],f.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Rating",list:[f.signal.signal0,f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Quarters",list:[f.progress.progress100,f.progress.progress75,f.progress.progress50,f.progress.progress25,f.progress.progress0]},{name:"_5Felling",list:[f.feeling.guffaw,f.feeling.smile,f.feeling.noninductive,f.feeling.dissatisfied,f.feeling.impatient]},{name:"5Boxes",list:[f.cell["cell-100"],f.cell["cell-75"],f.cell["cell-50"],f.cell["cell-25"],f.cell["cell-0"]]},{name:"3Stars",list:[f.star.starFull,f.star.starIncomplete,f.star.starEmpty]}]}],e2=b2.reduce((a,r)=>{const{group:n}=r;for(const e of n)a[e.name]=e.list;return a},{});for(const a in e2){const r=e2[a];Object.freeze(r)}const L2="EMPTY_ICON_TYPE",H={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=r;return a.get(I).moveRulePriority(n,e,t,i),!0}},T2=a=>{const{unitId:r,subUnitId:n}=a,e=p2(a.start,a.end);if(!e)return[];const[t,i]=e;return[{id:H.id,params:{unitId:r,subUnitId:n,start:t,end:i}}]},t2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t,cfId:i}=r,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),d=s[o-1];if(o>-1){const l=s[o],c=[{id:n2.id,params:{unitId:e,subUnitId:t,rule:u.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const h=s[0];if(h){const g=g2({id:h.cfId,type:"before"},{id:d.cfId,type:"after"},s,w=>w.cfId);if(!g)return c;const[D,m]=g,v={unitId:e,subUnitId:t,start:D,end:m};c.push({id:H.id,params:v})}}return c}return[]},$={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,cfId:t}=r;return a.get(I).deleteRule(n,e,t),!0}},k2=(a,r)=>({id:$.id,params:{unitId:r.unitId,subUnitId:r.subUnitId,cfId:r.rule.cfId}}),n2={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r;return a.get(I).addRule(n,e,t),!0}},B2={type:u.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(a,r){if(!r)return!1;const{rule:n}=r,e=a.get(u.IUndoRedoService),t=a.get(u.ICommandService),i=a.get(I),s=a.get(u.IUniverInstanceService),o=A.getSheetCommandTarget(s);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=i.createCfId(d,l),h={unitId:d,subUnitId:l,rule:{...n,cfId:n.cfId||c}},g=k2(a,h),D=t.syncExecuteCommand(n2.id,h);return D&&e.pushUndoRedo({unitID:d,redoMutations:[{id:n2.id,params:h}],undoMutations:[g]}),D}},X={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r,i=r.cfId||r.rule.cfId;return a.get(I).setRule(n,e,t,i),!0}},v2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t}=r,i=r.cfId||r.rule.cfId,s=n.getRule(e,t,i);return s?[{id:X.id,params:{unitId:e,subUnitId:t,cfId:i,rule:u.Tools.deepClone(s)}}]:[]},N2={type:u.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(a,r){var v;if(!r)return!1;const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=a.get(A.SheetsSelectionsService),o=A.getSheetCommandTarget(e,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=((v=s.getCurrentSelections())==null?void 0:v.map(w=>w.range))||[],h=n.getSubunitRules(d,l);if(!(h!=null&&h.length)||!c.length)return!1;const g=[],D=[];h.forEach(w=>{const p=new u.ObjectMatrix;w.ranges.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.setValue(M,U,1)})}),c.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.realDeleteValue(M,U)})});const S=A.findAllRectangle(A.createTopMatrixFromMatrix(p));if(S.length){const y={...w,ranges:S},M={unitId:d,subUnitId:l,rule:y},U=v2(a,M);g.push({id:X.id,params:M}),D.push(...U)}else{const y={unitId:d,subUnitId:l,cfId:w.cfId},M=t2(a,y);g.push({id:$.id,params:y}),D.push(...M)}});const m=u.sequenceExecute(g,t).result;return m&&i.pushUndoRedo({unitID:d,redoMutations:g,undoMutations:D}),m}},U2={type:u.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(a,r){const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=A.getSheetCommandTarget(e,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=n.getSubunitRules(o,d);if(!(l!=null&&l.length))return!1;const c=l.map(m=>({cfId:m.cfId,unitId:o,subUnitId:d})),h=c.map(m=>({id:$.id,params:m})),g=c.map(m=>t2(a,m)[0]),D=u.sequenceExecute(h,t).result;return D&&i.pushUndoRedo({unitID:o,redoMutations:h,undoMutations:g}),D}},V2={type:u.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,cfId:r.cfId},l=t2(a,d),c=e.syncExecuteCommand($.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:$.id,params:d}]}),c}},O2={type:u.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=a.get(I),s=A.getSheetCommandTarget(t,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=g2(r.start,r.end,i.getSubunitRules(o,d)||[],v=>v.cfId);if(!l)return!1;const[c,h]=l,g={unitId:o,subUnitId:d,start:c,end:h},D=T2(g),m=e.syncExecuteCommand(H.id,g);return m&&n.pushUndoRedo({unitID:o,redoMutations:[{id:H.id,params:g}],undoMutations:D}),m}},j2={type:u.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,rule:r.rule,cfId:r.cfId},l=v2(a,d),c=e.syncExecuteCommand(X.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:X.id,params:d}]}),c}},C0="ssheets-conditional-formatting.config",$2={};var D0=Object.getOwnPropertyDescriptor,f0=(a,r,n,e)=>{for(var t=e>1?void 0:e?D0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},Y=(a,r)=>(n,e)=>r(n,e,a);C.ConditionalFormattingService=class extends u.Disposable{constructor(r,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=r,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(r,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(r,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(r,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,c)=>{var D;const h=c.rule.type,g=i.find(m=>m.cfId===c.cfId);if(h===R.highlightCell)g.result&&u.Tools.deepMerge(l,{style:g.result});else if(h===R.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(D=l.style)!=null?D:{},bg:{rgb:m}})}else if(h===R.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(h===R.iconSet){const m=g==null?void 0:g.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const r=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:h2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>r(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{if(r.id===A.RemoveSheetCommand.id){const n=r.params,e=n.unitId||m0(this._univerInstanceService),t=n.subUnitId||v0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(d=>{const l={unitId:e,subUnitId:t,cfId:d.cfId};s.push({id:$.id,params:l}),o.push(...t2(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,d])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,d);l==null||l.forEach(c=>s.add(c.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(r.id){case A.SetRangeValuesMutation.id:{const e=r.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new u.ObjectMatrix(s).forValue((l,c,h)=>{h&&Object.keys(h).some(D=>["p","v"].includes(D))&&o.push([l,c])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case A.InsertColMutation.id:case A.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.RemoveRowMutation.id:case A.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=r.params,s=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((c,h)=>{d.push([c,h])}),n(e,o.subUnitId,d).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,c.cfId)})};s(t),s(i);break}case A.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(d=>d.ranges.some(l=>u.Rectangle.intersects(l,e))).forEach(d=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,d.cfId)});break}}}))}},C.ConditionalFormattingService=f0([Y(0,u.Inject(I)),Y(1,u.Inject(u.Injector)),Y(2,u.Inject(u.IUniverInstanceService)),Y(3,u.Inject(u.IResourceManagerService)),Y(4,u.Inject(A.SheetInterceptorService)),Y(5,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const m0=a=>a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),v0=a=>{var r;return(r=a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId()};var F0=Object.getOwnPropertyDescriptor,w0=(a,r,n,e)=>{for(var t=e>1?void 0:e?F0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},F2=(a,r)=>(n,e)=>r(n,e,a);C.UniverSheetsConditionalFormattingPlugin=(u2=class extends u.Plugin{constructor(r=$2,n,e,t){super(),this._config=r,this._injector=n,this._commandService=e,this._configService=t;const{...i}=u.merge({},$2,this._config);this._configService.setConfig(C0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[I],[C.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[B2,N2,U2,V2,O2,j2,n2,$,X,H,J].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService),u.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},F(u2,"pluginName",h2),F(u2,"type",u.UniverInstanceType.UNIVER_SHEET),u2),C.UniverSheetsConditionalFormattingPlugin=w0([F2(1,u.Inject(u.Injector)),F2(2,u.Inject(u.ICommandService)),F2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const P2="sheet-conditional-rule-icon",E0=35,W2=15,q2=2;class Z2 extends Z.SheetExtension{constructor(){super();F(this,"_paddingRightAndLeft",q2);F(this,"_width",W2);F(this,"_imageMap",new Map);F(this,"uKey",P2);F(this,"Z_INDEX",E0);F(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l!=null&&l.iconSet){const{iconType:c,iconId:h}=l.iconSet;if(c===L2)return;const g=this._imageMap.get(this._createKey(c,h));if(!g)return;const D=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:m,isMergedMainCell:v,mergeInfo:w,startY:p,endY:S,startX:y,endX:M}=D;if(m||(v&&(p=w.startY,S=w.endY,y=w.startX,M=w.endX),!this.isRenderDiffRangesByCell(w,i)))return;const U=M-y,c2=S-p;if(this._width>c2||this._width>U+this._paddingRightAndLeft*2)return;const w2=(c2-this._width)/2+p;n.drawImage(g,y+this._paddingRightAndLeft,w2,this._width,this._width)}}),n.restore()}_init(){for(const n in e2)e2[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}Z.SpreadsheetExtensionRegistry.add(Z2);function G2(a){if(typeof a!="object"||a===null)return a;const r={};for(const n in a)if(a.hasOwnProperty(n)){const e=G2(a[n]);e!==void 0&&(r[n]=e)}return r}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>u.isRangesEqual}),C.AddCfCommand=B2,C.AddConditionalRuleMutation=n2,C.AddConditionalRuleMutationUndoFactory=k2,C.CFNumberOperator=E,C.CFRuleType=R,C.CFSubRuleType=_,C.CFTextOperator=b,C.CFTimePeriodOperator=L,C.CFValueType=x,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=o2,C.ClearRangeCfCommand=N2,C.ClearWorksheetCfCommand=U2,C.ConditionalFormattingFormulaMarkDirty=J,C.ConditionalFormattingIcon=Z2,C.ConditionalFormattingRuleModel=I,C.DEFAULT_BG_COLOR=X2,C.DEFAULT_FONT_COLOR=Y2,C.DEFAULT_PADDING=q2,C.DEFAULT_WIDTH=W2,C.DataBar=S2,C.DeleteCfCommand=V2,C.DeleteConditionalRuleMutation=$,C.DeleteConditionalRuleMutationUndoFactory=t2,C.EMPTY_ICON_TYPE=L2,C.FormulaResultStatus=T,C.IconUKey=P2,C.MoveCfCommand=O2,C.MoveConditionalRuleMutation=H,C.MoveConditionalRuleMutationUndoFactory=T2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=h2,C.SetCfCommand=j2,C.SetConditionalRuleMutation=X,C.anchorUndoFactory=p2,C.compareWithNumber=G,C.createCfId=A2,C.createDefaultRule=K2,C.createDefaultValue=J2,C.createDefaultValueByValueType=z2,C.dataBarUKey=R2,C.defaultDataBarNativeColor=m2,C.defaultDataBarPositiveColor=f2,C.defaultPlaceholderColor=x2,C.filterRange=r2,C.findIndexByAnchor=j,C.getCacheStyleMatrix=i0,C.getCellValue=V,C.getColorScaleFromValue=I2,C.getMaxInFormulaResult=a0,C.getOppositeOperator=M2,C.getValueByType=Q,C.iconGroup=b2,C.iconMap=e2,C.isAnchorEqual=Q2,C.isFloatsEqual=z,C.isNullable=k,C.moveByAnchor=E2,C.removeUndefinedAttr=G2,C.serialTimeToTimestamp=_2,C.setConditionalRuleMutationUndoFactory=v2,C.toYMD_1900=y2,C.transformSupportSymmetryAnchor=g2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
2
+ (function(C,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("@univerjs/core"),require("rxjs"),require("rxjs/operators"),require("@univerjs/engine-formula"),require("@univerjs/engine-render"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","rxjs","rxjs/operators","@univerjs/engine-formula","@univerjs/engine-render","@univerjs/sheets"],u):(C=typeof globalThis<"u"?globalThis:C||self,u(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverEngineFormula,C.UniverEngineRender,C.UniverSheets))})(this,function(C,u,B,i2,O,Z,A){"use strict";var p0=Object.defineProperty;var A0=(C,u,B)=>u in C?p0(C,u,{enumerable:!0,configurable:!0,writable:!0,value:B}):C[u]=B;var F=(C,u,B)=>A0(C,typeof u!="symbol"?u+"":u,B);var u2;const h2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var b=(a=>(a.beginsWith="beginsWith",a.endsWith="endsWith",a.containsText="containsText",a.notContainsText="notContainsText",a.equal="equal",a.notEqual="notEqual",a.containsBlanks="containsBlanks",a.notContainsBlanks="notContainsBlanks",a.containsErrors="containsErrors",a.notContainsErrors="notContainsErrors",a))(b||{}),L=(a=>(a.today="today",a.yesterday="yesterday",a.tomorrow="tomorrow",a.last7Days="last7Days",a.thisMonth="thisMonth",a.lastMonth="lastMonth",a.nextMonth="nextMonth",a.thisWeek="thisWeek",a.lastWeek="lastWeek",a.nextWeek="nextWeek",a))(L||{}),E=(a=>(a.greaterThan="greaterThan",a.greaterThanOrEqual="greaterThanOrEqual",a.lessThan="lessThan",a.lessThanOrEqual="lessThanOrEqual",a.notBetween="notBetween",a.between="between",a.equal="equal",a.notEqual="notEqual",a))(E||{}),R=(a=>(a.highlightCell="highlightCell",a.dataBar="dataBar",a.colorScale="colorScale",a.iconSet="iconSet",a))(R||{}),_=(a=>(a.uniqueValues="uniqueValues",a.duplicateValues="duplicateValues",a.rank="rank",a.text="text",a.timePeriod="timePeriod",a.number="number",a.average="average",a.formula="formula",a))(_||{}),x=(a=>(a.num="num",a.min="min",a.max="max",a.percent="percent",a.percentile="percentile",a.formula="formula",a))(x||{});const X2="#fff",Y2="#000000",K2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),J2=(a,r)=>{switch(a){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(r))return"";break}case"number":return["between","notBetween"].includes(r)?[10,100]:10}return""},z2=(a,r)=>{switch(a){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return r!==void 0?r:10}return""},j=(a,r,n)=>{if(!r)return null;const e=r.findIndex(t=>n(t)===a.id);if(e<0)return null;switch(a.type){case"after":return e+1;case"before":return e-1;case"self":return e}},E2=(a,r,n,e)=>{if(!n)return null;const t=j(a,n,e);let i=j(r,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=j(r,n,e)),r.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},g2=(a,r,n,e)=>{if(a.type==="after"&&["after","before"].includes(r.type))return[a,r];const t={...a},i={...r};if(t.type!=="after"){const s=j(t,n,e);if(s===null)return null;if(s-1<0){const o=n[s+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[s-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const s=j(i,n,e);if(s===null)return null;if(s===0)i.type="before";else if(s-1>=0){const o=e(n[s-1]);i.id=o,i.type="after"}else if(s+1<=n.length-1){const o=e(n[s+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},p2=(a,r)=>{if(["after","before"].includes(r.type)){if(a.type==="after")return[r,a];if(a.type==="before")return[r,{...a,type:"self"}]}return null},Q2=(a,r)=>a.id===r.id&&a.type===r.type,A2=()=>`${u.Tools.generateRandomId(8)}`;class I{constructor(){F(this,"_model",new Map);F(this,"_ruleChange$",new B.Subject);F(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(r,n){let e=this.getSubunitRules(r,n);if(!e){e=[];let t=this._model.get(r);t||(t=new Map,this._model.set(r,t)),t.set(n,e)}return e}getRule(r,n,e){const t=this.getSubunitRules(r,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(r){return this._model.get(r)||null}getSubunitRules(r,n){var t;return((t=this._model.get(r))==null?void 0:t.get(n))||null}deleteRule(r,n,e){const t=this.getSubunitRules(r,n);if(t){const i=t.findIndex(o=>o.cfId===e),s=t[i];s&&(t.splice(i,1),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"delete"}))}}setRule(r,n,e,t){const s=this._ensureList(r,n).find(o=>o.cfId===t);if(s){const o=u.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:r,type:"set",oldRule:o})}}addRule(r,n,e){const t=this._ensureList(r,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:r,type:"add"})}moveRulePriority(r,n,e,t){const i=this._ensureList(r,n),s=j(e,i,l=>l.cfId),o=j(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const d=i[s];d&&(E2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:d,subUnitId:n,unitId:r,type:"sort"}))}createCfId(r,n){return A2()}deleteUnitId(r){this._model.delete(r)}}const J={type:u.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var e0=Object.getOwnPropertyDescriptor,t0=(a,r,n,e)=>{for(var t=e>1?void 0:e?e0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},C2=(a,r)=>(n,e)=>r(n,e,a),T=(a=>(a[a.NOT_REGISTER=1]="NOT_REGISTER",a[a.SUCCESS=2]="SUCCESS",a[a.WAIT=3]="WAIT",a[a.ERROR=4]="ERROR",a))(T||{});const n0=a=>{const r=a&&a[0]&&a[0][0];return(r==null?void 0:r.t)===u.CellValueType.BOOLEAN?r.v===u.BooleanNumber.TRUE||r.v===!0:r?r.v:!1};C.ConditionalFormattingFormulaService=class extends u.Disposable{constructor(n,e,t){super();F(this,"_formulaMap",new Map);F(this,"_result$",new B.Subject);F(this,"result$",this._result$.asObservable());this._commandService=n,this._activeDirtyManagerService=e,this._conditionalFormattingRuleModel=t,this._initFormulaCalculationResultChange(),this._initRuleChange()}_initRuleChange(){const n=e=>{switch(e.type){case R.colorScale:return e.config.some(t=>t.value.type===x.formula);case R.dataBar:return[e.config.max,e.config.min].some(t=>t.type===x.formula);case R.iconSet:return e.config.some(t=>t.value.type===x.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:s,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,s.cfId),e.type==="set"&&(n(s.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,s.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===O.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const s in e.unitOtherData[t][i]){const o=new u.ObjectMatrix(e.unitOtherData[t][i][s]),d=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!d)continue;const l=d.ranges;if(!l)continue;const c=d.result,h=l[0].startRow,g=l[0].startColumn;o.forValue((v,w,p)=>{c.setValue(h+v,g+w,n0(p))}),d.status=2;const m=this._getAllFormulaResultByCfId(t,i,d.cfId).every(v=>v.status===2);this._result$.next({...d,isAllFinished:m})}}})),this._activeDirtyManagerService.register(J.id,{commandId:J.id,getDirtyData(n){return{dirtyUnitOtherFormulaMap:n.params}}})}_ensureSubunitFormulaMap(n,e){let t=this._formulaMap.get(n);t||(t=new Map,this._formulaMap.set(n,t));let i=t.get(e);return i||(i=new u.RefAlias([],["formulaId","id"]),t.set(e,i)),i}getSubUnitFormulaMap(n,e){var t;return(t=this._formulaMap.get(n))==null?void 0:t.get(e)}registerFormulaWithRange(n,e,t,i,s=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),d=this.createCFormulaId(t,i);if(o.getValue(d,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:d,ranges:s,formulaId:l,status:3,result:new u.ObjectMatrix});const c={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(O.SetOtherFormulaMutation.id,c,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(J.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const s=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(O.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const d=this.getSubUnitFormulaMap(n,e);if(!d)return{status:1};const l=d.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(s,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return{status:1};const o=s.getValue(this.createCFormulaId(t,i),["id"]);if(!o)return{status:1};if(o.status===2&&o.result)return{result:o.result,status:2}}deleteCache(n,e,t,i){const s=this.getSubUnitFormulaMap(n,e);if(!s)return[];if(i){const o=this.createCFormulaId(t,i);return s.deleteValue(o,["id"]),[]}else{const o=s.getValues().filter(d=>d.cfId===t);return o.forEach(d=>{s.deleteValue(d.formulaId,["formulaId"])}),o}}_getAllFormulaResultByCfId(n,e,t){const i=this.getSubUnitFormulaMap(n,e);return i?i.getValues().filter(o=>o.cfId===t):[]}_createFormulaId(n,e){return`sheet.cf_${n}_${e}_${u.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=t0([C2(0,u.Inject(u.ICommandService)),C2(1,u.Inject(O.IActiveDirtyManagerService)),C2(2,u.Inject(I))],C.ConditionalFormattingFormulaService);var N=(a=>(a.preComputingStart="preComputingStart",a.preComputing="preComputing",a.preComputingEnd="preComputingEnd",a.preComputingError="preComputingError",a))(N||{});class a2{constructor(r){F(this,"_cache");F(this,"_preComputingStatus$",new B.BehaviorSubject("preComputingStart"));F(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(i2.distinctUntilChanged()));F(this,"_preComputingCache");F(this,"_rule");this._context=r,this._cache=new u.LRUMap(r.limit),this._rule=r.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(r){this._cache.limit=r}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(r){this._rule=r,this.resetPreComputingCache()}getCell(r,n){const e=this._createKey(r,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(r,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(r,n,this._getContext()),t=this.getPreComputingResult(r,n),t===null))return this._cache.get(e);if(this._preComputingStatus$.next("preComputingEnd"),this._cache.has(e))return this._cache.get(e);const i=this.getCellResult(r,n,t,this._getContext());return i!==null&&this._setCache(r,n,i),i}setPreComputingCache(r){this._preComputingCache=r}getPreComputingResult(r,n){return this._preComputingCache}_createKey(r,n){return`${r}_${n}`}_setCache(r,n,e){const t=this._createKey(r,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(r=>{r==="preComputingEnd"&&this.clearCache()})}}function z(a,r){return Math.abs(a-r)<Number.EPSILON}const k=a=>[void 0,null].includes(a),V=a=>{var e,t;if(!a)return null;if(a.t===u.CellValueType.BOOLEAN)return a.v===u.BooleanNumber.TRUE?O.BooleanValue.TRUE:O.BooleanValue.FALSE;const r=a.v,n=(t=(e=a.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return k(r)?k(n)?null:n:r},D2=86400;function y2(a,r=!0){if(r&&a>=0){if(a===0)return[1900,1,0];if(a===60)return[1900,2,29];if(a<60)return[1900,a<32?1:2,(a-1)%31+1]}let n=a+68569+2415019;const e=Math.floor(4*n/146097);n=n-Math.floor((146097*e+3)/4);const t=Math.floor(4e3*(n+1)/1461001);n=n-Math.floor(1461*t/4)+31;const i=Math.floor(80*n/2447),s=n-Math.floor(2447*i/80);n=Math.floor(i/11);const o=i+2-12*n;return[100*(e-49)+t+n|0,o|0,s|0]}const _2=a=>{let r=a|0;const n=D2*(a-r);let e=Math.floor(n);n-e>.9999&&(e+=1,e===D2&&(e=0,r+=1));const t=e<0?D2+e:e,[i,s,o]=y2(a,!0),d=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,c=Math.floor(t)%60;return u.dayjs(`${i}/${s}/${o} ${d}:${l}:${c}`).valueOf()},Q=(a,r,n)=>{switch(a.type){case x.max:{let e=0;return r.forValue((t,i,s)=>{s>e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.min:{let e;return r.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:T.SUCCESS,result:e}}case x.percent:{let e,t;r.forValue((o,d,l)=>{(e===void 0||t===void 0)&&(e=l,t=l),l>e&&(e=l),l<t&&(t=l)});const i=(e||0)-(t||0),s=Math.max(Math.min(Number(a.value)||0,100),0);return{status:T.SUCCESS,result:i*(s/100)+(t||0)}}case x.percentile:{const e=r.toNativeArray().sort((l,c)=>l-c),t=Math.max(Math.min(Number(a.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,d=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:T.SUCCESS,result:d}}case x.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(a.value),d=e.get(C.ConditionalFormattingFormulaService);return d.registerFormulaWithRange(t,i,s,o),d.getFormulaResultWithCoords(t,i,s,o)}case x.num:{const e=Number(a.value);return{status:T.SUCCESS,result:Number.isNaN(e)?0:e}}}},i0=(a,r,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),s=new u.ObjectMatrix;return n.ranges.forEach(o=>{u.Range.foreach(o,(d,l)=>{const c=i.getCellCfs(a,r,d,l);if(c){const h=c.find(g=>g.cfId===n.cfId);h!=null&&h.result&&s.setValue(d,l,h.result)}})}),s},G=(a,r)=>{switch(a.operator){case E.between:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return r>=n&&r<=e}case E.notBetween:{if(typeof a.value!="object"||!a.value.length)return;const n=Math.min(...a.value),e=Math.max(...a.value);return!(r>=n&&r<=e)}case E.equal:{const n=a.value||0;return z(n,r)}case E.notEqual:{const n=a.value||0;return!z(n,r)}case E.greaterThan:{const n=a.value||0;return r>n}case E.greaterThanOrEqual:{const n=a.value||0;return r>=n}case E.lessThan:{const n=a.value||0;return r<n}case E.lessThanOrEqual:{const n=a.value||0;return r<=n}default:return!1}},M2=a=>{switch(a){case E.greaterThan:return E.lessThanOrEqual;case E.greaterThanOrEqual:return E.lessThan;case E.lessThan:return E.greaterThanOrEqual;case E.lessThanOrEqual:return E.greaterThan}return a},I2=(a,r)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=a.findIndex(i=>i.value>=r),t=e-1;if(e===0)return a[0].color.toRgbString();if(t>=0){const i=a[t],s=a[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),d=n(s.color.toRgb()),l=s.value-i.value,c=(r-i.value)/l,h=["r","g","b","a"].reduce((D,m)=>{const v=o[m];return D[m]=(d[m]-v)*c+v,D},{});return new u.ColorKit(h).toRgbString()}}else return a[a.length-1].color.toRgbString()},r2=(a,r,n)=>a.map(e=>{if(e.startColumn>n||e.startRow>r)return null;const t={...e};return t.endRow=Math.min(t.endRow,r),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function a0(a){let r=0;return new u.ObjectMatrix(a).forValue((n,e,t)=>{r=Math.max(Number.isNaN(r)?0:r,Number(t))}),r}class r0 extends a2{preComputing(r,n,e){const t=e.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.rule.config.every(c=>c.value.type===x.num)&&r2(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=[...t.rule.config].sort((c,h)=>c.index-h.index).map(c=>({value:Q(c.value,s,{...e,cfId:t.cfId}),color:new u.ColorKit(c.color)}));if(!d.some(c=>Z.isObject(c.value)?c.value.status!==T.SUCCESS:!1)){const c=d.map(h=>h.color).reduce((h,g,D)=>(h.result.push({color:g,value:h.sortValue[D]}),h),{result:[],sortValue:d.map(h=>h.value.result).sort((h,g)=>h-g)}).result;this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=t.getCellValue(r,n);if(i.t===u.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return I2(e,s)}}}const R2="sheet-conditional-rule-data-bar",f2="#ffbe38",m2="#abd91a",x2="#000",s0=34;class S2 extends Z.SheetExtension{constructor(){super(...arguments);F(this,"_paddingRightAndLeft",2);F(this,"_paddingTopAndBottom",2);F(this,"uKey",R2);F(this,"Z_INDEX",s0);F(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l&&l.dataBar){const{color:c,value:h,startPoint:g,isGradient:D}=l.dataBar,m=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:v,isMergedMainCell:w,mergeInfo:p,startY:S,endY:y,startX:M,endX:U}=m;if(v||(w&&(S=p.startY,y=p.endY,M=p.startX,U=p.endX),!this.isRenderDiffRangesByCell(p,i)))return;const c2=U-M,w2=y+Z.FIX_ONE_PIXEL_BLUR_OFFSET-S,d2=c2-this._paddingRightAndLeft*2,H2=w2-this._paddingTopAndBottom*2;if(h>0){const K=Math.max(d2*(1-g/100)*h/100,1),P=M+this._paddingRightAndLeft+g/100*d2,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,c),q.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!1,!0,!0,!1),D&&n.stroke()}else{const K=Math.max(d2*g/100*Math.abs(h)/100,1),P=M+this._paddingRightAndLeft+g/100*d2-K,W=S+this._paddingTopAndBottom;if(D){const q=n.createLinearGradient(P,W,P+K,W);q.addColorStop(0,"rgb(255 255 255)"),q.addColorStop(1,c),n.fillStyle=q,n.strokeStyle=c,n.lineWidth=1}else n.fillStyle=c;this._drawRectWithRoundedCorner(n,P,W,K,H2,!0,!1,!1,!0),D&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,d,l,c){const h=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+h,t),n.lineTo(e+i-h,t),d?n.arcTo(e+i,t,e+i,t+h,h):n.lineTo(e+i,t),n.lineTo(e+i,t+s-h),l?n.arcTo(e+i,t+s,e+i-h,t+s,h):n.lineTo(e+i,t+s),n.lineTo(e+h,t+s),c?n.arcTo(e,t+s,e,t+s-h,h):n.lineTo(e,t+s),n.lineTo(e,t+h),o?n.arcTo(e,t,e+h,t,h):n.lineTo(e,t),n.closePath(),n.fill())}}Z.SpreadsheetExtensionRegistry.add(S2);const s2=a=>Math.max(Math.min(100,a),0),l0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class o0 extends a2{preComputing(r,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new u.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(D=>D.type===x.num)&&r2(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{u.Range.foreach(m,(v,w)=>{const p=e.getCellValue(v,w),S=p&&p.v;if(!k(S)&&(p==null?void 0:p.t)===u.CellValueType.NUMBER){const y=Number(S);!Number.isNaN(y)&&o.setValue(v,w,y)}})});const l=Q(i.config.min,o,{...e,cfId:t.cfId}),c=Q(i.config.max,o,{...e,cfId:t.cfId});let h=0,g=0;if(l.status===T.SUCCESS){const D=Number(l.result);h=Number.isNaN(D)?0:D}else{this._preComputingStatus$.next(N.preComputing);return}if(c.status===T.SUCCESS){const D=Number(c.result),m=Number.isNaN(D)?0:D;g=Math.max(m,h),h=Math.min(m,h);let v=50;if(h<0&&g<=0)v=100;else if(h<0&&g>0){const w=Math.abs(g)+Math.abs(h);v=Math.abs(h)/w*100}else h>=0&&g>0&&(v=0);this.setPreComputingCache({min:h,max:g,startPoint:v}),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,c=l.isShowValue,h=l.config.isGradient,g=l0(r,n,t.getCellValue);if(!(g===null||g<i||i===s||s<i)){if(g===0)return{color:x2,startPoint:o,value:0,isGradient:h,isShowValue:c};if(i<0&&s<=0){const D=s-i,m=s2((s-g)/D*100);return m===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-m,isGradient:h,isShowValue:c}}else if(i<0&&s>0)if(g>0){const D=s2(Math.min(g/s,1)*100);return D===0?void 0:{color:l.config.positiveColor||f2,startPoint:o,value:D,isGradient:h,isShowValue:c}}else{const D=s2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return D===0?void 0:{color:l.config.nativeColor||m2,startPoint:o,value:-D,isGradient:h,isShowValue:c}}else if(i>=0&&s>0){const D=s-i,m=0,v=s2((1-(s-g)/D)*100);return v===0?void 0:{color:l.config.positiveColor||f2,startPoint:m,value:v,isGradient:h,isShowValue:c}}}}}class u0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case _.average:{let d=0,l=0;return i.forEach(c=>{u.Range.foreach(c,(h,g)=>{const D=e.getCellValue(h,g),m=V(D||void 0);D&&D.t===u.CellValueType.NUMBER&&m!==void 0&&(d+=Number(m)||0,l++)})}),{value:d/l,type:t.subType}}case _.uniqueValues:case _.duplicateValues:{const d=new Map;return i.forEach(l=>{u.Range.foreach(l,(c,h)=>{const g=e.getCellValue(c,h),D=V(g||void 0);if(D!==void 0){const m=d.get(D);m?d.set(D,m+1):d.set(D,1)}})}),{value:d,type:t.subType}}case _.rank:{let d=[];i.forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=V(m||void 0);m&&m.t===u.CellValueType.NUMBER&&v!==void 0&&d.push(Number(v)||0)})}),d.sort((h,g)=>g-h);const l=e.rule.rule;if(l.isPercent){l.isBottom&&(d=d.toReversed());const h=u.Tools.clamp(l.value,0,100)/100,g=Math.floor(h*d.length),D=u.Tools.clamp(g-1,0,d.length-1);return{value:d[D],type:t.subType}}const c=Math.floor(u.Tools.clamp(l.isBottom?l.value-1:l.value,0,d.length));return l.isBottom?{value:d[d.length-c-1],type:t.subType}:{value:d[Math.max(c-1,0)],type:t.subType}}case _.formula:{const d=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,d.value,e.rule.ranges);const c=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,d.value);return c&&c.status===T.SUCCESS?(this._preComputingStatus$.next(N.preComputingEnd),{value:c.result,type:t.subType}):(this._preComputingStatus$.next(N.preComputing),null)}case _.timePeriod:switch(t.operator){case L.last7Days:return{value:{start:u.dayjs().subtract(7,"day").valueOf(),end:u.dayjs().valueOf()},type:t.subType};case L.lastMonth:return{value:{start:u.dayjs().startOf("month").subtract(1,"month").valueOf(),end:u.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case L.lastWeek:return{value:{start:u.dayjs().startOf("week").subtract(1,"week").valueOf(),end:u.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case L.nextMonth:return{value:{start:u.dayjs().startOf("month").add(1,"month").valueOf(),end:u.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case L.nextWeek:return{value:{start:u.dayjs().startOf("week").add(1,"week").valueOf(),end:u.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case L.thisMonth:return{value:{start:u.dayjs().startOf("month").valueOf(),end:u.dayjs().endOf("month").valueOf()},type:t.subType};case L.thisWeek:return{value:{start:u.dayjs().startOf("week").valueOf(),end:u.dayjs().endOf("week").valueOf()},type:t.subType};case L.today:return{value:{start:u.dayjs().startOf("day").valueOf(),end:u.dayjs().endOf("day").valueOf()},type:t.subType};case L.tomorrow:return{value:{start:u.dayjs().startOf("day").add(1,"day").valueOf(),end:u.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case L.yesterday:return{value:{start:u.dayjs().startOf("day").subtract(1,"day").valueOf(),end:u.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(r,n,e,t){const i=t.getCellValue(r,n),s=t.rule.rule;return(()=>{switch(s.subType){case _.number:{const l=i&&Number(i.v),c=(i==null?void 0:i.t)===u.CellValueType.NUMBER,h=s;return c?k(l)||Number.isNaN(l)?void 0:G({operator:h.operator,value:h.value||0},l||0):!![E.notEqual,E.notBetween].includes(h.operator)}case _.text:{const l=s,c=V(i),h=c===null?"":String(c),g=l.value||"";switch(l.operator){case b.beginsWith:return h.startsWith(g);case b.containsBlanks:return/^\s*$/.test(h);case b.notContainsBlanks:return!/^\s*$/.test(h);case b.containsErrors:return O.ERROR_TYPE_SET.has(h);case b.notContainsErrors:return!O.ERROR_TYPE_SET.has(h);case b.containsText:return h.indexOf(g)>-1;case b.notContainsText:return h.indexOf(g)===-1;case b.endsWith:return h.endsWith(g);case b.equal:return h===g;case b.notEqual:return h!==g;default:return!1}}case _.timePeriod:{const l=V(i);if(k(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return;const c=_2(Number(l)),{start:h,end:g}=e.value;return c>=h&&c<=g}case _.average:{const l=i&&i.v,c=Number(l),h=(i==null?void 0:i.t)===u.CellValueType.NUMBER,g=s;if(!h)return E.notEqual===g.operator;if(k(l)||Number.isNaN(c)||!e)return!1;const D=e.value;switch(g.operator){case E.greaterThan:return c>D;case E.greaterThanOrEqual:return c>=D;case E.lessThan:return c<D;case E.lessThanOrEqual:return c<=D;case E.equal:return z(c,D);case E.notEqual:return!z(c,D);default:return!1}}case _.rank:{const l=V(i),c=Number(l);if(k(l)||Number.isNaN(c)||(i==null?void 0:i.t)!==u.CellValueType.NUMBER||!e)return!1;const h=e.value;return s.isBottom?c<=h:c>=h}case _.uniqueValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)===1}case _.duplicateValues:{const l=V(i);return k(l)||!e?!1:e.value.get(l)!==1}case _.formula:{const l=e==null?void 0:e.value;return l?l.getValue(r,n)===!0:!1}}})()?s.style:{}}}const c0=(a,r,n)=>{const e=n(a,r);if(e&&e.t===u.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class d0 extends a2{preComputing(r,n,e){const t=e.rule.rule,i=e.worksheet,s=new u.ObjectMatrix;!t.config.every(c=>c.value.type===x.num)&&r2(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(h=>{u.Range.foreach(h,(g,D)=>{const m=e.getCellValue(g,D),v=m&&m.v;if(!k(v)&&(m==null?void 0:m.t)===u.CellValueType.NUMBER){const w=Number(v);!Number.isNaN(w)&&s.setValue(g,D,w)}})});const d=t.config.map(c=>Q(c.value,s,{...e,cfId:e.rule.cfId}));if(!d.some(c=>c.status!==T.SUCCESS)){const c=d.map((h,g)=>({operator:t.config[g].operator,value:Number(h.result)||0})).reduce((h,g,D,m)=>{const v=t.config[D];if(!D||D===m.length-1)h.push({...g,iconId:v.iconId,iconType:v.iconType});else{const w=m[D-1];G(w,g.value)||h.push({...g,iconId:v.iconId,iconType:v.iconType})}return h},[]);this.setPreComputingCache(c),this._preComputingStatus$.next(N.preComputingEnd);return}this._preComputingStatus$.next(N.preComputing)}getCellResult(r,n,e,t){if(!e)return null;const i=c0(r,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let d=0;d<e.length;d++){const l=e[d],c={...l},h={...l},{iconId:g,iconType:D}=l;if(d===0){if(G(l,i))return{iconId:g,iconType:D,isShowValue:o}}else{if(d===e.length-1)return{iconId:g,iconType:D,isShowValue:o};{const m=e[d-1];if(h.operator=M2(m.operator),h.value=m.value,G(c,i)&&G(h,i))return{iconId:g,iconType:D,isShowValue:o}}}}}}var h0=Object.getOwnPropertyDescriptor,g0=(a,r,n,e)=>{for(var t=e>1?void 0:e?h0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},l2=(a,r)=>(n,e)=>r(n,e,a);const o2=50*20*3*3;C.ConditionalFormattingViewModel=class extends u.Disposable{constructor(n,e,t,i){super();F(this,"_calculateUnitManagers",new Map);F(this,"_rTreeManager",new u.RTree);F(this,"_cellCache",new u.LRUMap(o2));F(this,"_markDirty$",new B.Subject);F(this,"markDirty$",this._markDirty$.asObservable());F(this,"_markRuleDirtyAtOnce",(n,e,t,i=!0)=>{if(this._cellCache.clear(),i){const o=this._ensureCalculateUnitManager(n,e).get(t);o&&o.resetPreComputingCache()}this._markDirty$.next({unitId:n,subUnitId:e,cfId:t})});F(this,"markRuleDirty",(()=>{const n=new B.Subject;return this.disposeWithMe(n.pipe(i2.bufferTime(100),i2.filter(e=>!!e.length),i2.map(e=>{const t=new Set,i=[];return e.forEach(s=>{const o=`${s.unitId}_${s.subUnitId}_${s.cfId}`;if(t.has(o)){if(s.isNeedResetPreComputingCache){const d=i.find(l=>l.cfId===s.cfId);d.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...s})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,s=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:s})}})());this._injector=n,this._conditionalFormattingRuleModel=e,this._conditionalFormattingFormulaService=t,this._univerInstanceService=i,this._initRuleListener(),this._handleCustomFormulasSeparately(),this._initCFFormulaListener()}_initCFFormulaListener(){this.disposeWithMe(this._conditionalFormattingFormulaService.result$.subscribe(({unitId:n,subUnitId:e,cfId:t,isAllFinished:i})=>{i&&this._markRuleDirtyAtOnce(n,e,t,i)}))}getCellCfs(n,e,t,i){const s=this._createCacheKey(n,e,t,i);if(this._cellCache.has(s))return this._cellCache.get(s);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(s,o),o}_getCellCfs(n,e,t,i){var h;const s=(h=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?h:[],o=this._ensureCalculateUnitManager(n,e),d=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(g=>d.has(g.cfId));return l.length?l.map(g=>{const D=o.get(g.cfId);return D?{cfId:g.cfId,result:D.getCell(t,i)}:null}).filter(g=>!!g).map((g,D)=>({...g,priority:D})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===R.highlightCell&&i.rule.subType===_.formula&&this._conditionalFormattingFormulaService.deleteCache(e,t,i.cfId)}}))}_initRuleListener(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:e,subUnitId:t,rule:i}=n,{cfId:s,ranges:o}=i,d=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;d.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),d.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(c=>({unitId:e,sheetId:t,id:l.cfId,range:c}))),this._rTreeManager.bulkInsert(o.map(c=>({unitId:e,sheetId:t,id:s,range:c}))),l.rule.type!==i.rule.type){const c=this._createRuleCalculateUnitInstance(e,t,i);if(!c)return;d.delete(l.cfId),d.set(i.cfId,c)}else{const c=d.get(l.cfId);if(!c)return;c.updateRule(i)}}}}))}_ensureCalculateUnitManager(n,e){let t=this._calculateUnitManagers.get(n);t||(t=new Map,this._calculateUnitManagers.set(n,t));let i=t.get(e);return i||(i=new Map,t.set(e,i)),i}_createRuleCalculateUnitInstance(n,e,t){const i=this._univerInstanceService.getUnit(n),s=i==null?void 0:i.getSheetBySheetId(e);if(!i||!s)return;const o={workbook:i,worksheet:s,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:o2,getCellValue:(d,l)=>s.getCellRaw(d,l)||{}};switch(t.rule.type){case R.colorScale:return new r0(o);case R.dataBar:return new o0(o);case R.highlightCell:return new u0(o);case R.iconSet:return new d0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=o2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=g0([l2(0,u.Inject(u.Injector)),l2(1,u.Inject(I)),l2(2,u.Inject(C.ConditionalFormattingFormulaService)),l2(3,u.IUniverInstanceService)],C.ConditionalFormattingViewModel);const f={feedback:{mistake:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.87359%206.87332C6.6146%207.13231%206.6146%207.55221%206.87359%207.8112L9.062%209.99961L6.87356%2012.188C6.61457%2012.447%206.61457%2012.8669%206.87356%2013.1259C7.13255%2013.3849%207.55245%2013.3849%207.81144%2013.1259L9.99987%2010.9375L12.1882%2013.1258C12.4472%2013.3848%2012.8671%2013.3848%2013.1261%2013.1258C13.3851%2012.8669%2013.3851%2012.447%2013.1261%2012.188L10.9378%209.99961L13.1261%207.81127C13.3851%207.55228%2013.3851%207.13238%2013.1261%206.87339C12.8671%206.61441%2012.4472%206.61441%2012.1882%206.87339L9.99987%209.06173L7.81147%206.87332C7.55248%206.61433%207.13257%206.61433%206.87359%206.87332Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Cpath%20d%3D%22M9.16817%206.67735C9.16646%206.61745%209.1656%206.5875%209.16653%206.56236C9.18103%206.16817%209.49136%205.84883%209.88497%205.82306C9.91008%205.82141%209.94004%205.82141%209.99996%205.82141V5.82141C10.0599%205.82141%2010.0899%205.82141%2010.115%205.82306C10.5086%205.84883%2010.8189%206.16817%2010.8334%206.56236C10.8343%206.5875%2010.8335%206.61745%2010.8318%206.67735L10.7043%2011.131C10.6934%2011.5121%2010.3812%2011.8154%209.99995%2011.8154V11.8154C9.61866%2011.8154%209.30655%2011.5121%209.29564%2011.131L9.16817%206.67735Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3Crect%20x%3D%229.31488%22%20y%3D%2212.8086%22%20width%3D%221.37006%22%20height%3D%221.37006%22%20rx%3D%220.685032%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M17.037%2010C17.037%2013.8865%2013.8864%2017.0371%209.99999%2017.0371C6.11354%2017.0371%202.96295%2013.8865%202.96295%2010C2.96295%206.1136%206.11354%202.96301%209.99999%202.96301C13.8864%202.96301%2017.037%206.1136%2017.037%2010Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3Cpath%20d%3D%22M13.9239%207.17477C13.6638%206.91472%2013.2422%206.91472%2012.9821%207.17477L8.74433%2011.4126L7.01786%209.6861C6.75781%209.42606%206.33619%209.42606%206.07614%209.6861C5.81609%209.94615%205.81609%2010.3678%206.07614%2010.6278L8.27349%2012.8252C8.53354%2013.0852%208.95516%2013.0852%209.21521%2012.8252L9.2195%2012.8209L13.9239%208.1165C14.1839%207.85645%2014.1839%207.43482%2013.9239%207.17477Z%22%20fill%3D%22%23FFFFFF%22%2F%3E%0A%3C%2Fsvg%3E%0A"},star:{starEmpty:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",starIncomplete:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_177)%22%3E%0A%3Cmask%20id%3D%22mask0_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%2210%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20x%3D%2210.3704%22%20y%3D%220.37037%22%20width%3D%229.25926%22%20height%3D%2219.2593%22%20fill%3D%22%23C4C4C4%22%20stroke%3D%22%23F7D564%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask0_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23fff%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3Cmask%20id%3D%22mask1_613_177%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2210%22%20height%3D%2220%22%3E%0A%3Crect%20width%3D%2210%22%20height%3D%2220%22%20fill%3D%22%23C4C4C4%22%2F%3E%0A%3C%2Fmask%3E%0A%3Cg%20mask%3D%22url(%23mask1_613_177)%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.845%207.0699%2012.2165%207.33978%2012.642%207.36863L16.2361%207.61233C16.5692%207.63492%2016.7047%208.05202%2016.4485%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.2149%2011.2859%2013.3189%2011.6996L14.1978%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6417%2015.5971L10.5908%2013.6817C10.2295%2013.4549%209.77039%2013.4549%209.40918%2013.6817L6.35822%2015.5971C6.07547%2015.7746%205.72066%2015.5168%205.80211%2015.1931L6.68098%2011.6996C6.78504%2011.2859%206.64316%2010.8493%206.31586%2010.5758L3.55139%208.26607C3.29519%208.05202%203.43072%207.63492%203.7638%207.61233L7.35793%207.36863C7.78346%207.33978%208.15491%207.0699%208.31385%206.67412L9.65627%203.3312C9.78068%203.0214%2010.2192%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fg%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_177%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A",starFull:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.3437%203.3312L11.6861%206.67412C11.8451%207.0699%2012.2165%207.33978%2012.6421%207.36863L16.2362%207.61233C16.5693%207.63492%2016.7048%208.05202%2016.4486%208.26608L13.6841%2010.5758C13.3568%2010.8493%2013.215%2011.2859%2013.319%2011.6996L14.1979%2015.1931C14.2793%2015.5168%2013.9245%2015.7746%2013.6418%2015.5971L10.5908%2013.6817C10.2296%2013.4549%209.77045%2013.4549%209.40924%2013.6817L6.35828%2015.5971C6.07553%2015.7746%205.72072%2015.5168%205.80217%2015.1931L6.68105%2011.6996C6.7851%2011.2859%206.64322%2010.8493%206.31592%2010.5758L3.55145%208.26607C3.29525%208.05202%203.43078%207.63492%203.76386%207.61233L7.358%207.36863C7.78352%207.33978%208.15498%207.0699%208.31391%206.67412L9.65633%203.3312C9.78074%203.0214%2010.2193%203.0214%2010.3437%203.3312Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%23FFBD37%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A"},progress:{progress0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M16.2963%209.99991C16.2963%209.17307%2016.1335%208.35432%2015.8171%207.59042C15.5006%206.82652%2015.0369%206.13242%2014.4522%205.54776C13.8675%204.96309%2013.1734%204.49931%2012.4095%204.18289C11.6456%203.86647%2010.8269%203.70361%2010%203.70361L10%209.99991H16.2963Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M10%2016.2962C11.6699%2016.2962%2013.2714%2015.6328%2014.4522%2014.4521C15.633%2013.2713%2016.2963%2011.6698%2016.2963%209.99991C16.2963%208.33003%2015.633%206.72854%2014.4522%205.54776C13.2714%204.36697%2011.6699%203.70361%2010%203.70361L10%209.99991L10%2016.2962Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Cpath%20d%3D%22M3.70374%209.99991C3.70374%2011.2452%204.07301%2012.4625%204.76485%2013.4979C5.4567%2014.5334%206.44005%2015.3404%207.59054%2015.8169C8.74104%2016.2935%2010.007%2016.4182%2011.2284%2016.1752C12.4497%2015.9323%2013.5716%2015.3326%2014.4522%2014.4521C15.3327%2013.5715%2015.9324%2012.4496%2016.1753%2011.2283C16.4183%2010.0069%2016.2936%208.74092%2015.8171%207.59042C15.3405%206.43992%2014.5335%205.45658%2013.4981%204.76473C12.4626%204.07288%2011.2453%203.70361%2010%203.70361L10%209.99991L3.70374%209.99991Z%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A",progress100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99993%22%20r%3D%226.66667%22%20stroke%3D%22%237A7A7A%22%20stroke-width%3D%220.740741%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%229.99991%22%20r%3D%226.2963%22%20fill%3D%22%237A7A7A%22%2F%3E%0A%3C%2Fsvg%3E%0A"},signal:{signal0:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal25:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal50:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal75:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93921%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70435%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A",signal100:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%2214.4764%22%20y%3D%222.98926%22%20width%3D%222.3%22%20height%3D%2214.0597%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%2210.7255%22%20y%3D%225.93933%22%20width%3D%222.3%22%20height%3D%2211.1096%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%226.97455%22%20y%3D%229.70447%22%20width%3D%222.3%22%20height%3D%227.3443%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3Crect%20x%3D%223.22363%22%20y%3D%2213.3302%22%20width%3D%222.3%22%20height%3D%223.71851%22%20rx%3D%220.5%22%20fill%3D%22%230493EE%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feeling:{guffaw:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M16.887%2010C16.887%2013.8037%2013.8036%2016.8871%209.99999%2016.8871C6.19638%2016.8871%203.11295%2013.8037%203.11295%2010C3.11295%206.19644%206.19638%203.11301%209.99999%203.11301C13.8036%203.11301%2016.887%206.19644%2016.887%2010Z%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M12.5355%2013.5821C13.0482%2013.1841%2013.3951%2012.6107%2013.5405%2012.0327C13.5934%2011.8226%2013.5051%2011.6349%2013.3518%2011.5331C13.2036%2011.4346%2013.0031%2011.4203%2012.8265%2011.5131C11.0615%2012.4407%208.94609%2012.4427%207.1828%2011.513C7.00629%2011.4199%206.80602%2011.4343%206.65798%2011.5329C6.50518%2011.6346%206.41701%2011.8217%206.46844%2012.0312C6.61029%2012.609%206.95079%2013.1833%207.46449%2013.5821C8.14361%2014.1093%209.05608%2014.3999%2010%2014.3999C10.9439%2014.3999%2011.8564%2014.1093%2012.5355%2013.5821Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A",smile:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2011.8518C7.03705%2011.8518%207.77779%2013.7037%2010%2013.7037C12.2222%2013.7037%2012.963%2011.8518%2012.963%2011.8518%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",noninductive:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.9259%22%20width%3D%221.48148%22%20height%3D%221.11111%22%20rx%3D%220.555556%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2012.5927C7.03705%2012.5927%208.14816%2012.5927%2010.3704%2012.5927C12.5926%2012.5927%2012.963%2012.5927%2012.963%2012.5927%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",dissatisfied:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.03705%2013.7037C7.03705%2013.7037%207.77779%2011.8519%2010%2011.8519C12.2222%2011.8519%2012.963%2013.7037%2012.963%2013.7037%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.962963%22%20stroke-linecap%3D%22round%22%2F%3E%0A%3C%2Fsvg%3E%0A",impatient:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%229.99999%22%20cy%3D%2210%22%20r%3D%226.88704%22%20fill%3D%22%23FFBD37%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.3%22%2F%3E%0A%3Crect%20x%3D%227.40741%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Crect%20x%3D%2211.1111%22%20y%3D%227.40735%22%20width%3D%221.48148%22%20height%3D%221.48148%22%20rx%3D%220.740741%22%20fill%3D%22%238F5F00%22%2F%3E%0A%3Cpath%20d%3D%22M7.47573%2011.731C6.96306%2012.129%206.61613%2012.7024%206.47071%2013.2804C6.41784%2013.4905%206.50617%2013.6782%206.65942%2013.78C6.80761%2013.8785%207.00813%2013.8928%207.18477%2013.8C8.9498%2012.8724%2011.0652%2012.8704%2012.8285%2013.8002C13.005%2013.8932%2013.2052%2013.8788%2013.3533%2013.7802C13.5061%2013.6785%2013.5942%2013.4914%2013.5428%2013.2819C13.401%2012.7041%2013.0605%2012.1298%2012.5468%2011.731C11.8676%2011.2038%2010.9552%2010.9132%2010.0112%2010.9132C9.06732%2010.9132%208.15485%2011.2038%207.47573%2011.731Z%22%20fill%3D%22white%22%20stroke%3D%22%238F5F00%22%20stroke-width%3D%220.4%22%2F%3E%0A%3C%2Fsvg%3E%0A"},arrow:JSON.parse('{"down-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","down-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M8.90467%203.99244C8.84611%204.1338%208.84611%204.31301%208.84611%204.67143V13.716L5.92068%2010.7906C5.66724%2010.5371%205.54052%2010.4104%205.39916%2010.3519C5.21067%2010.2738%204.9989%2010.2738%204.81041%2010.3519C4.66905%2010.4104%204.54233%2010.5371%204.28889%2010.7906C4.03545%2011.044%203.90873%2011.1707%203.85018%2011.3121C3.77211%2011.5006%203.77211%2011.7124%203.85018%2011.9008C3.90873%2012.0422%204.03545%2012.1689%204.28889%2012.4224L9.03476%2017.1682C9.07839%2017.2127%209.12737%2017.2617%209.18231%2017.3166L9.18239%2017.3167L9.18241%2017.3167C9.40545%2017.5398%209.53035%2017.6647%209.65346%2017.7313C9.67085%2017.7408%209.6882%2017.7492%209.70577%2017.7564C9.89425%2017.8345%2010.106%2017.8345%2010.2945%2017.7564C10.4359%2017.6979%2010.5626%2017.5712%2010.816%2017.3177C10.8986%2017.2352%2010.9677%2017.1661%2011.0253%2017.1056L15.7095%2012.4214L15.7095%2012.4213C15.963%2012.1679%2016.0897%2012.0412%2016.1482%2011.8998C16.2263%2011.7114%2016.2263%2011.4996%2016.1482%2011.3111C16.0897%2011.1697%2015.963%2011.043%2015.7095%2010.7896C15.4561%2010.5361%2015.3294%2010.4094%2015.188%2010.3509C14.9995%2010.2728%2014.7878%2010.2728%2014.5993%2010.3509C14.4579%2010.4094%2014.3312%2010.5361%2014.0778%2010.7896L14.0777%2010.7896L11.1538%2013.7135V4.67142C11.1538%204.31301%2011.1538%204.1338%2011.0953%203.99244C11.0172%203.80395%2010.8674%203.6542%2010.6789%203.57613C10.5376%203.51758%2010.3584%203.51758%209.99996%203.51758C9.64154%203.51758%209.46233%203.51758%209.32097%203.57613C9.13249%203.6542%208.98274%203.80395%208.90467%203.99244Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","right-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M3.32508%2011.7609C3.46644%2011.8194%203.64565%2011.8194%204.00407%2011.8194H13.049L10.1235%2014.745C9.87002%2014.9984%209.7433%2015.1251%209.68475%2015.2665C9.60668%2015.455%209.60668%2015.6668%209.68475%2015.8552C9.7433%2015.9966%209.87002%2016.1233%2010.1235%2016.3768C10.3769%2016.6302%2010.5036%2016.7569%2010.645%2016.8155C10.8335%2016.8935%2011.0452%2016.8935%2011.2337%2016.8155C11.3751%2016.7569%2011.5018%2016.6302%2011.7552%2016.3768L16.5105%2011.6215C16.5524%2011.5803%2016.5983%2011.5344%2016.6493%2011.4834L16.6495%2011.4831C16.8561%2011.2765%2016.9785%2011.1542%2017.0484%2011.0394C17.0648%2011.0128%2017.0782%2010.9866%2017.0893%2010.9599C17.1674%2010.7714%2017.1674%2010.5596%2017.0893%2010.3711C17.0308%2010.2298%2016.904%2010.1031%2016.6506%209.84962C16.5685%209.76752%2016.4997%209.69872%2016.4394%209.64123L11.7542%204.95601C11.5007%204.70257%2011.374%204.57585%2011.2327%204.5173C11.0442%204.43923%2010.8324%204.43923%2010.6439%204.5173C10.5026%204.57585%2010.3758%204.70257%2010.1224%204.95601L10.1224%204.95601C9.86895%205.20945%209.74223%205.33617%209.68368%205.47753C9.60561%205.66601%209.60561%205.87779%209.68368%206.06627C9.74223%206.20764%209.86895%206.33436%2010.1224%206.5878L13.0463%209.51175H4.00407C3.64565%209.51175%203.46644%209.51175%203.32508%209.5703C3.1366%209.64837%202.98685%209.79812%202.90877%209.98661C2.85022%2010.128%202.85022%2010.3072%202.85022%2010.6656C2.85022%2011.024%202.85022%2011.2032%202.90877%2011.3446C2.98685%2011.5331%203.1366%2011.6828%203.32508%2011.7609Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","up-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M11.0936%2017.3406C11.1522%2017.1992%2011.1522%2017.02%2011.1522%2016.6616V7.61701L14.0776%2010.5424C14.3311%2010.7959%2014.4578%2010.9226%2014.5991%2010.9811C14.7876%2011.0592%2014.9994%2011.0592%2015.1879%2010.9811C15.3292%2010.9226%2015.456%2010.7959%2015.7094%2010.5424C15.9628%2010.289%2016.0896%2010.1623%2016.1481%2010.0209C16.2262%209.83243%2016.2262%209.62066%2016.1481%209.43217C16.0896%209.29081%2015.9628%209.16409%2015.7094%208.91065L10.9645%204.16576C10.9207%204.12105%2010.8714%204.07178%2010.8161%204.01648L10.8159%204.0163C10.5916%203.792%2010.4666%203.66696%2010.3428%203.60058C10.3261%203.59154%2010.3094%203.58358%2010.2925%203.57658C10.104%203.49851%209.89226%203.49851%209.70378%203.57658C9.56242%203.63514%209.4357%203.76186%209.18226%204.0153C9.09955%204.09801%209.03034%204.16722%208.97258%204.22785L4.28878%208.91166C4.03534%209.1651%203.90862%209.29182%203.85006%209.43318C3.77199%209.62166%203.77199%209.83344%203.85006%2010.0219C3.90862%2010.1633%204.03534%2010.29%204.28878%2010.5434C4.54221%2010.7969%204.66893%2010.9236%204.8103%2010.9822C4.99878%2011.0602%205.21056%2011.0602%205.39904%2010.9822C5.5404%2010.9236%205.66712%2010.7969%205.92056%2010.5434L5.92056%2010.5434L8.84449%207.61951V16.6616C8.84449%2017.02%208.84449%2017.1992%208.90305%2017.3406C8.98112%2017.5291%209.13087%2017.6788%209.31935%2017.7569C9.46072%2017.8154%209.63992%2017.8154%209.99834%2017.8154C10.3568%2017.8154%2010.536%2017.8154%2010.6773%2017.7569C10.8658%2017.6788%2011.0156%2017.5291%2011.0936%2017.3406Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndDown-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.5062%206.72126C4.56476%206.86262%204.69148%206.98934%204.94492%207.24278L11.3404%2013.6382L7.20313%2013.6382C6.84471%2013.6382%206.66551%2013.6382%206.52414%2013.6968C6.33566%2013.7749%206.18591%2013.9246%206.10784%2014.1131C6.04928%2014.2545%206.04928%2014.4337%206.04928%2014.7921C6.04928%2015.1505%206.04928%2015.3297%206.10784%2015.4711C6.18591%2015.6596%206.33566%2015.8093%206.52414%2015.8874C6.66551%2015.9459%206.84471%2015.9459%207.20313%2015.9459L13.9194%2015.9459C13.9805%2015.9465%2014.0484%2015.9465%2014.1243%2015.9465H14.1243C14.4353%2015.9465%2014.6114%2015.9465%2014.7449%2015.9082C14.7659%2015.9023%2014.7859%2015.8954%2014.8052%2015.8874C14.9937%2015.8093%2015.1434%2015.6596%2015.2215%2015.4711C15.2801%2015.3297%2015.2801%2015.1505%2015.2801%2014.7921C15.2801%2014.6767%2015.2801%2014.5799%2015.2781%2014.497L15.2781%207.86957C15.2781%207.51115%2015.2781%207.33194%2015.2195%207.19058C15.1415%207.0021%2014.9917%206.85235%2014.8032%206.77428C14.6619%206.71572%2014.4827%206.71572%2014.1243%206.71572C13.7658%206.71572%2013.5866%206.71572%2013.4453%206.77428C13.2568%206.85235%2013.107%207.0021%2013.029%207.19058C12.9704%207.33194%2012.9704%207.51115%2012.9704%207.86957L12.9704%2012.0047L6.5767%205.61099C6.32326%205.35755%206.19654%205.23083%206.05518%205.17228C5.8667%205.09421%205.65492%205.09421%205.46644%205.17228C5.32508%205.23083%205.19836%205.35755%204.94492%205.61099C4.69148%205.86443%204.56476%205.99115%204.5062%206.13251C4.42813%206.32099%204.42813%206.53277%204.5062%206.72126Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","rightAndUp-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M6.05431%2016.1597C6.19567%2016.1012%206.32239%2015.9745%206.57583%2015.721L12.9712%209.32568L12.9712%2013.4626C12.9712%2013.821%2012.9712%2014.0002%2013.0297%2014.1416C13.1078%2014.3301%2013.2576%2014.4798%2013.446%2014.5579C13.5874%2014.6164%2013.7666%2014.6164%2014.125%2014.6164C14.4834%2014.6164%2014.6626%2014.6164%2014.804%2014.5579C14.9925%2014.4798%2015.1422%2014.3301%2015.2203%2014.1416C15.2789%2014.0002%2015.2789%2013.821%2015.2789%2013.4626L15.2789%206.75233C15.2795%206.68972%2015.2795%206.62004%2015.2795%206.54182L15.2795%206.54157C15.2795%206.22585%2015.2795%206.04918%2015.2395%205.91495C15.2339%205.89605%2015.2276%205.878%2015.2203%205.86053C15.1422%205.67204%2014.9925%205.52229%2014.804%205.44422C14.6626%205.38567%2014.4834%205.38567%2014.125%205.38567L14.125%205.38567C14.0075%205.38567%2013.9093%205.38567%2013.8254%205.38773L7.20256%205.38773C6.84414%205.38773%206.66493%205.38773%206.52357%205.44628C6.33509%205.52436%206.18534%205.6741%206.10727%205.86259C6.04871%206.00395%206.04871%206.18315%206.04871%206.54156V6.54157L6.04871%206.54159C6.04871%206.9%206.04871%207.0792%206.10727%207.22056C6.18534%207.40905%206.33509%207.55879%206.52357%207.63687C6.66493%207.69542%206.84414%207.69542%207.20256%207.69542H11.3379L4.94405%2014.0892C4.69061%2014.3427%204.56389%2014.4694%204.50533%2014.6108C4.42726%2014.7992%204.42726%2015.011%204.50533%2015.1995C4.56389%2015.3409%204.69061%2015.4676%204.94405%2015.721C5.19749%2015.9745%205.32421%2016.1012%205.46557%2016.1597C5.65405%2016.2378%205.86583%2016.2378%206.05431%2016.1597Z%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A"}'),shape:{cross:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%223.70374%22%20y%3D%228.14795%22%20width%3D%2212.5926%22%20height%3D%223.7037%22%20rx%3D%220.740741%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",up:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M9.44533%205.81157C9.74012%205.47858%2010.2598%205.47858%2010.5546%205.81157L16.2868%2012.2867C16.71%2012.7647%2016.3706%2013.5184%2015.7322%2013.5184H4.26776C3.62933%2013.5184%203.28995%2012.7647%203.71313%2012.2867L9.44533%205.81157Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A",down:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M10.5547%2014.1884C10.2599%2014.5214%209.74019%2014.5214%209.4454%2014.1884L3.71321%207.71335C3.29002%207.23532%203.6294%206.48161%204.26784%206.48161L15.7322%206.48161C16.3707%206.48161%2016.7101%207.23532%2016.2869%207.71335L10.5547%2014.1884Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","rhomboid-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M2.1415%2011.1984C1.8412%2010.9074%201.8412%2010.4256%202.1415%2010.1346L9.48467%203.01785C9.77196%202.73942%2010.2284%202.73942%2010.5157%203.01786L17.8586%2010.1346C18.1589%2010.4256%2018.1589%2010.9074%2017.8586%2011.1984L10.5157%2018.3151C10.2284%2018.5936%209.77196%2018.5936%209.48467%2018.3152L2.1415%2011.1984Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-pink":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23FB9D9D%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-gray":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22%23999999%22%2F%3E%0A%3C%2Fsvg%3E%0A","roundness-black":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210.6664%22%20r%3D%227.03704%22%20fill%3D%22black%22%2F%3E%0A%3C%2Fsvg%3E%0A","triangle-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_237)%22%3E%0A%3Cpath%20d%3D%22M9.32308%204.41301C9.58368%203.82623%2010.4164%203.82623%2010.677%204.413L15.9526%2016.2917C16.1701%2016.7815%2015.8115%2017.3331%2015.2756%2017.3331H4.72454C4.18858%2017.3331%203.83002%2016.7815%204.04756%2016.2917L9.32308%204.41301Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_237%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A","indicate-greed":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","indicate-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%222.76941%22%20y%3D%222.76941%22%20width%3D%2214.4612%22%20height%3D%2214.4612%22%20rx%3D%223%22%20fill%3D%22black%22%2F%3E%0A%3Ccircle%20cx%3D%2210%22%20cy%3D%2210%22%20r%3D%224.5%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},feedback2:{mistake2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M4.12194%206.33702C4.1805%206.47839%204.30722%206.6051%204.56066%206.85854L8.36822%2010.6661L4.56062%2014.4737C4.30718%2014.7272%204.18046%2014.8539%204.12191%2014.9952C4.04384%2015.1837%204.04384%2015.3955%204.12191%2015.584C4.18046%2015.7253%204.30718%2015.8521%204.56062%2016.1055C4.81406%2016.3589%204.94078%2016.4857%205.08214%2016.5442C5.27062%2016.6223%205.4824%2016.6223%205.67089%2016.5442C5.81225%2016.4857%205.93897%2016.3589%206.19241%2016.1055L10%2012.2979L13.8074%2016.1053C14.0609%2016.3588%2014.1876%2016.4855%2014.329%2016.544C14.5174%2016.6221%2014.7292%2016.6221%2014.9177%2016.544C15.0591%2016.4855%2015.1858%2016.3588%2015.4392%2016.1053L15.4392%2016.1053C15.6927%2015.8519%2015.8194%2015.7252%2015.8779%2015.5838C15.956%2015.3953%2015.956%2015.1835%2015.8779%2014.9951C15.8194%2014.8537%2015.6927%2014.727%2015.4392%2014.4735L15.4392%2014.4735L11.6318%2010.6661L15.4392%206.85872C15.6926%206.60528%2015.8193%206.47856%2015.8779%206.3372C15.956%206.14871%2015.956%205.93694%2015.8779%205.74845C15.8193%205.60709%2015.6926%205.48037%2015.4392%205.22693C15.1857%204.97349%2015.059%204.84677%2014.9177%204.78822C14.7292%204.71015%2014.5174%204.71015%2014.3289%204.78822C14.1876%204.84677%2014.0608%204.97349%2013.8074%205.22693L10%209.03433L6.19244%205.22676C5.939%204.97332%205.81228%204.8466%205.67092%204.78805C5.48244%204.70997%205.27066%204.70997%205.08218%204.78805C4.94082%204.8466%204.8141%204.97332%204.56066%205.22676L4.56066%205.22676C4.30722%205.4802%204.1805%205.60692%204.12194%205.74828C4.04387%205.93676%204.04387%206.14854%204.12194%206.33702Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A",warn2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20d%3D%22M8.49778%205.00963C8.48513%204.56774%208.47881%204.3468%208.56086%204.17746C8.63301%204.02856%208.75124%203.90689%208.89802%203.83052C9.06494%203.74365%209.28597%203.74365%209.72805%203.74365H10.272C10.714%203.74365%2010.9351%203.74365%2011.102%203.83052C11.2488%203.9069%2011.367%204.02856%2011.4392%204.17746C11.5212%204.3468%2011.5149%204.56775%2011.5022%205.00964L11.2644%2013.3173C11.2524%2013.737%2011.2464%2013.9468%2011.1609%2014.1065C11.0857%2014.2471%2010.9687%2014.3609%2010.826%2014.432C10.6639%2014.5129%2010.454%2014.5129%2010.0342%2014.5129H9.96582C9.54601%2014.5129%209.33611%2014.5129%209.17397%2014.432C9.0313%2014.3609%208.91426%2014.2471%208.83904%2014.1065C8.75357%2013.9468%208.74756%2013.737%208.73555%2013.3173L8.49778%205.00963Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3Crect%20x%3D%228.76917%22%20y%3D%2215.2817%22%20width%3D%222.46154%22%20height%3D%222.46154%22%20rx%3D%220.769231%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A",correct2:"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cg%20clip-path%3D%22url(%23clip0_613_248)%22%3E%0A%3Cpath%20d%3D%22M15.689%205.69723C15.5476%205.75578%2015.4209%205.8825%2015.1675%206.13594L7.82436%2013.4791L4.83279%2010.4875C4.57935%2010.2341%204.45263%2010.1073%204.31127%2010.0488C4.12278%209.97071%203.91101%209.97071%203.72252%2010.0488C3.58116%2010.1073%203.45444%2010.2341%203.201%2010.4875C2.94756%2010.7409%202.82084%2010.8676%202.76229%2011.009C2.68422%2011.1975%202.68422%2011.4093%202.76229%2011.5978C2.82084%2011.7391%202.94756%2011.8658%203.201%2012.1193L7.0085%2015.9268C7.26194%2016.1802%207.38866%2016.3069%207.53002%2016.3655C7.7185%2016.4436%207.93028%2016.4436%208.11876%2016.3655C8.26013%2016.3069%208.38685%2016.1802%208.64028%2015.9268C8.66387%2015.9032%208.68636%2015.8807%208.7078%2015.8592L16.7993%207.76772C17.0527%207.51428%2017.1794%207.38756%2017.238%207.2462C17.3161%207.05772%2017.3161%206.84594%2017.238%206.65746C17.1794%206.5161%2017.0527%206.38938%2016.7993%206.13594C16.5458%205.8825%2016.4191%205.75578%2016.2777%205.69723C16.0893%205.61915%2015.8775%205.61915%2015.689%205.69723Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fg%3E%0A%3Cdefs%3E%0A%3CclipPath%20id%3D%22clip0_613_248%22%3E%0A%3Crect%20width%3D%2220%22%20height%3D%2220%22%20fill%3D%22white%22%20transform%3D%22translate(0%200.666504)%22%2F%3E%0A%3C%2FclipPath%3E%0A%3C%2Fdefs%3E%0A%3C%2Fsvg%3E%0A"},flag:{"flag-green":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%2359D01E%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-gold":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FFBD37%22%2F%3E%0A%3C%2Fsvg%3E%0A","flag-red":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2221%22%20viewBox%3D%220%200%2020%2021%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M15.4274%204.74935C14.0982%205.1012%2013.1363%205.13675%2012.3604%205.03379C11.5776%204.93009%2010.9487%204.68342%2010.2456%204.40416L10.2246%204.39527C9.53411%204.1212%208.76945%203.8175%207.81312%203.69157C6.84279%203.56268%205.71016%203.61898%204.24802%204.0049C4.09343%204.04217%203.95538%204.13393%203.85649%204.26515C3.7576%204.39636%203.70374%204.55925%203.70374%204.72712V17.3197C3.70374%2017.5162%203.79534%2017.7046%203.92654%2017.8435C4.05773%2017.9824%204.25893%2018.0605%204.44448%2018.0605C4.63002%2018.0605%204.84911%2017.9824%204.98031%2017.8435C5.11151%2017.7046%205.18522%2017.5162%205.18522%2017.3197V14.9123V12.5049C6.24649%2012.2738%206.97081%2012.2605%207.63962%2012.3486C8.42246%2012.4523%209.05139%2012.699%209.75448%2012.9782L9.77546%2012.9871C10.466%2013.2612%2011.2306%2013.5649%2012.1869%2013.6908C13.1601%2013.8197%2014.2976%2013.7627%2015.7667%2013.3738C15.8866%2013.3421%2016.0727%2013.2135%2016.1483%2013.111C16.2238%2013.0084%2016.2963%2012.8204%2016.2963%2012.6553V5.46787C16.2963%205.35535%2016.2721%205.24432%2016.2255%205.1432C16.1788%205.04208%2016.1111%204.95353%2016.0274%204.88428C15.9436%204.81502%2015.846%204.76688%2015.7421%204.7435C15.6382%204.72012%2015.494%204.73173%2015.4274%204.74935Z%22%20fill%3D%22%23FE4B4B%22%2F%3E%0A%3C%2Fsvg%3E%0A"},cell:{"cell-0":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-25":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%224.00098%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-50":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-75":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211%22%20y%3D%2211.001%22%20width%3D%225%22%20height%3D%225%22%20rx%3D%221%22%20fill%3D%22%23E5E5E5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A","cell-100":"data:image/svg+xml;charset=utf-8,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20viewBox%3D%220%200%2020%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%2211.251%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%224.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3Crect%20x%3D%2211.25%22%20y%3D%224.25098%22%20width%3D%224.5%22%20height%3D%224.5%22%20rx%3D%220.75%22%20fill%3D%22%230493EE%22%20stroke%3D%22%230493EE%22%20stroke-width%3D%220.5%22%2F%3E%0A%3C%2Fsvg%3E%0A"}},b2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[f.arrow["up-green"],f.arrow["right-gold"],f.arrow["down-red"]]},{name:"3ArrowsGray",list:[f.arrow["up-gray"],f.arrow["right-gray"],f.arrow["down-gray"]]},{name:"4Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"4ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"5Arrows",list:[f.arrow["up-green"],f.arrow["rightAndUp-gold"],f.arrow["right-gold"],f.arrow["rightAndDown-gold"],f.arrow["down-red"]]},{name:"5ArrowsGray",list:[f.arrow["up-gray"],f.arrow["rightAndUp-gray"],f.arrow["right-gray"],f.arrow["rightAndDown-gray"],f.arrow["down-gray"]]},{name:"3Triangles",list:[f.shape.up,f.shape.cross,f.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"]]},{name:"3Signs",list:[f.shape["roundness-greed"],f.shape["triangle-gold"],f.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[f.shape["indicate-greed"],f.shape["indicate-gold"],f.shape["indicate-red"]]},{name:"4RedToBlack",list:[f.shape["roundness-red"],f.shape["roundness-pink"],f.shape["roundness-gray"],f.shape["roundness-black"]]},{name:"4TrafficLights",list:[f.shape["roundness-greed"],f.shape["roundness-gold"],f.shape["roundness-red"],f.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[f.feedback.correct,f.feedback.warn,f.feedback.mistake]},{name:"3Symbols2",list:[f.feedback2.correct2,f.feedback2.warn2,f.feedback2.mistake2]},{name:"3Flags",list:[f.flag["flag-green"],f.flag["flag-gold"],f.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Rating",list:[f.signal.signal0,f.signal.signal25,f.signal.signal50,f.signal.signal75,f.signal.signal100]},{name:"5Quarters",list:[f.progress.progress100,f.progress.progress75,f.progress.progress50,f.progress.progress25,f.progress.progress0]},{name:"_5Felling",list:[f.feeling.guffaw,f.feeling.smile,f.feeling.noninductive,f.feeling.dissatisfied,f.feeling.impatient]},{name:"5Boxes",list:[f.cell["cell-100"],f.cell["cell-75"],f.cell["cell-50"],f.cell["cell-25"],f.cell["cell-0"]]},{name:"3Stars",list:[f.star.starFull,f.star.starIncomplete,f.star.starEmpty]}]}],e2=b2.reduce((a,r)=>{const{group:n}=r;for(const e of n)a[e.name]=e.list;return a},{});for(const a in e2){const r=e2[a];Object.freeze(r)}const L2="EMPTY_ICON_TYPE",H={type:u.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=r;return a.get(I).moveRulePriority(n,e,t,i),!0}},T2=a=>{const{unitId:r,subUnitId:n}=a,e=p2(a.start,a.end);if(!e)return[];const[t,i]=e;return[{id:H.id,params:{unitId:r,subUnitId:n,start:t,end:i}}]},t2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t,cfId:i}=r,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),d=s[o-1];if(o>-1){const l=s[o],c=[{id:n2.id,params:{unitId:e,subUnitId:t,rule:u.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const h=s[0];if(h){const g=g2({id:h.cfId,type:"before"},{id:d.cfId,type:"after"},s,w=>w.cfId);if(!g)return c;const[D,m]=g,v={unitId:e,subUnitId:t,start:D,end:m};c.push({id:H.id,params:v})}}return c}return[]},$={type:u.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,cfId:t}=r;return a.get(I).deleteRule(n,e,t),!0}},k2=(a,r)=>({id:$.id,params:{unitId:r.unitId,subUnitId:r.subUnitId,cfId:r.rule.cfId}}),n2={type:u.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r;return a.get(I).addRule(n,e,t),!0}},B2={type:u.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(a,r){if(!r)return!1;const{rule:n}=r,e=a.get(u.IUndoRedoService),t=a.get(u.ICommandService),i=a.get(I),s=a.get(u.IUniverInstanceService),o=A.getSheetCommandTarget(s,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=i.createCfId(d,l),h={unitId:d,subUnitId:l,rule:{...n,cfId:n.cfId||c}},g=k2(a,h),D=t.syncExecuteCommand(n2.id,h);return D&&e.pushUndoRedo({unitID:d,redoMutations:[{id:n2.id,params:h}],undoMutations:[g]}),D}},X={type:u.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(a,r){if(!r)return!1;const{unitId:n,subUnitId:e,rule:t}=r,i=r.cfId||r.rule.cfId;return a.get(I).setRule(n,e,t,i),!0}},v2=(a,r)=>{const n=a.get(I),{unitId:e,subUnitId:t}=r,i=r.cfId||r.rule.cfId,s=n.getRule(e,t,i);return s?[{id:X.id,params:{unitId:e,subUnitId:t,cfId:i,rule:u.Tools.deepClone(s)}}]:[]},N2={type:u.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(a,r){var v;if(!r)return!1;const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=a.get(A.SheetsSelectionsService),o=A.getSheetCommandTarget(e,r);if(!o)return!1;const{unitId:d,subUnitId:l}=o,c=((v=s.getCurrentSelections())==null?void 0:v.map(w=>w.range))||[],h=n.getSubunitRules(d,l);if(!(h!=null&&h.length)||!c.length)return!1;const g=[],D=[];h.forEach(w=>{const p=new u.ObjectMatrix;w.ranges.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.setValue(M,U,1)})}),c.forEach(y=>{u.Range.foreach(y,(M,U)=>{p.realDeleteValue(M,U)})});const S=A.findAllRectangle(A.createTopMatrixFromMatrix(p));if(S.length){const y={...w,ranges:S},M={unitId:d,subUnitId:l,rule:y},U=v2(a,M);g.push({id:X.id,params:M}),D.push(...U)}else{const y={unitId:d,subUnitId:l,cfId:w.cfId},M=t2(a,y);g.push({id:$.id,params:y}),D.push(...M)}});const m=u.sequenceExecute(g,t).result;return m&&i.pushUndoRedo({unitID:d,redoMutations:g,undoMutations:D}),m}},U2={type:u.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(a,r){const n=a.get(I),e=a.get(u.IUniverInstanceService),t=a.get(u.ICommandService),i=a.get(u.IUndoRedoService),s=A.getSheetCommandTarget(e,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=n.getSubunitRules(o,d);if(!(l!=null&&l.length))return!1;const c=l.map(m=>({cfId:m.cfId,unitId:o,subUnitId:d})),h=c.map(m=>({id:$.id,params:m})),g=c.map(m=>t2(a,m)[0]),D=u.sequenceExecute(h,t).result;return D&&i.pushUndoRedo({unitID:o,redoMutations:h,undoMutations:g}),D}},V2={type:u.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,cfId:r.cfId},l=t2(a,d),c=e.syncExecuteCommand($.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:$.id,params:d}]}),c}},O2={type:u.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=a.get(I),s=A.getSheetCommandTarget(t,r);if(!s)return!1;const{unitId:o,subUnitId:d}=s,l=g2(r.start,r.end,i.getSubunitRules(o,d)||[],v=>v.cfId);if(!l)return!1;const[c,h]=l,g={unitId:o,subUnitId:d,start:c,end:h},D=T2(g),m=e.syncExecuteCommand(H.id,g);return m&&n.pushUndoRedo({unitID:o,redoMutations:[{id:H.id,params:g}],undoMutations:D}),m}},j2={type:u.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(a,r){if(!r)return!1;const n=a.get(u.IUndoRedoService),e=a.get(u.ICommandService),t=a.get(u.IUniverInstanceService),i=A.getSheetCommandTarget(t,r);if(!i)return!1;const{unitId:s,subUnitId:o}=i,d={unitId:s,subUnitId:o,rule:r.rule,cfId:r.cfId},l=v2(a,d),c=e.syncExecuteCommand(X.id,d);return c&&n.pushUndoRedo({unitID:s,undoMutations:l,redoMutations:[{id:X.id,params:d}]}),c}},C0="ssheets-conditional-formatting.config",$2={};var D0=Object.getOwnPropertyDescriptor,f0=(a,r,n,e)=>{for(var t=e>1?void 0:e?D0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},Y=(a,r)=>(n,e)=>r(n,e,a);C.ConditionalFormattingService=class extends u.Disposable{constructor(r,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=r,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=s,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(r,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(r,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(r,n,l.cfId)).filter(l=>!!l).reverse(),o=s.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&s.splice(o+1),s.reduce((l,c)=>{var D;const h=c.rule.type,g=i.find(m=>m.cfId===c.cfId);if(h===R.highlightCell)g.result&&u.Tools.deepMerge(l,{style:g.result});else if(h===R.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(D=l.style)!=null?D:{},bg:{rgb:m}})}else if(h===R.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(h===R.iconSet){const m=g==null?void 0:g.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const r=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((s,o)=>{i[o]=s}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:h2,businesses:[u.UniverInstanceType.UNIVER_SHEET],toJson:e=>r(e),parseJson:e=>n(e),onUnLoad:e=>{this._conditionalFormattingRuleModel.deleteUnitId(e)},onLoad:(e,t)=>{Object.keys(t).forEach(i=>{[...t[i]].reverse().forEach(o=>{this._conditionalFormattingRuleModel.addRule(e,i,o)})})}}))}_initSheetChange(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:r=>{if(r.id===A.RemoveSheetCommand.id){const n=r.params,e=n.unitId||m0(this._univerInstanceService),t=n.subUnitId||v0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const s=[],o=[];return i.forEach(d=>{const l={unitId:e,subUnitId:t,cfId:d.cfId};s.push({id:$.id,params:l}),o.push(...t2(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(r=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,d])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,d);l==null||l.forEach(c=>s.add(c.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(r.id){case A.SetRangeValuesMutation.id:{const e=r.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new u.ObjectMatrix(s).forValue((l,c,h)=>{h&&Object.keys(h).some(D=>["p","v"].includes(D))&&o.push([l,c])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case A.InsertColMutation.id:case A.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.RemoveRowMutation.id:case A.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(c=>u.Rectangle.intersects(c,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case A.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=r.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),d={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(c=>c.ranges.some(h=>u.Rectangle.intersects(h,d))).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,c.cfId)});break}case A.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=r.params,s=o=>{const d=[];new u.ObjectMatrix(o.value).forValue((c,h)=>{d.push([c,h])}),n(e,o.subUnitId,d).forEach(c=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,c.cfId)})};s(t),s(i);break}case A.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=r.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(d=>d.ranges.some(l=>u.Rectangle.intersects(l,e))).forEach(d=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,d.cfId)});break}}}))}},C.ConditionalFormattingService=f0([Y(0,u.Inject(I)),Y(1,u.Inject(u.Injector)),Y(2,u.Inject(u.IUniverInstanceService)),Y(3,u.Inject(u.IResourceManagerService)),Y(4,u.Inject(A.SheetInterceptorService)),Y(5,u.Inject(u.ICommandService))],C.ConditionalFormattingService);const m0=a=>a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getUnitId(),v0=a=>{var r;return(r=a.getCurrentUnitForType(u.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:r.getSheetId()};var F0=Object.getOwnPropertyDescriptor,w0=(a,r,n,e)=>{for(var t=e>1?void 0:e?F0(r,n):r,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=s(t)||t);return t},F2=(a,r)=>(n,e)=>r(n,e,a);C.UniverSheetsConditionalFormattingPlugin=(u2=class extends u.Plugin{constructor(r=$2,n,e,t){super(),this._config=r,this._injector=n,this._commandService=e,this._configService=t;const{...i}=u.merge({},$2,this._config);this._configService.setConfig(C0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[I],[C.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[B2,N2,U2,V2,O2,j2,n2,$,X,H,J].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(C.ConditionalFormattingService),u.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},F(u2,"pluginName",h2),F(u2,"type",u.UniverInstanceType.UNIVER_SHEET),u2),C.UniverSheetsConditionalFormattingPlugin=w0([F2(1,u.Inject(u.Injector)),F2(2,u.Inject(u.ICommandService)),F2(3,u.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const P2="sheet-conditional-rule-icon",E0=35,W2=15,q2=2;class Z2 extends Z.SheetExtension{constructor(){super();F(this,"_paddingRightAndLeft",q2);F(this,"_width",W2);F(this,"_imageMap",new Map);F(this,"uKey",P2);F(this,"Z_INDEX",E0);F(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),u.Range.foreach(t.rowColumnSegment,(o,d)=>{if(!s.getRowVisible(o)||!s.getColVisible(d))return;const l=s.getCell(o,d);if(l!=null&&l.iconSet){const{iconType:c,iconId:h}=l.iconSet;if(c===L2)return;const g=this._imageMap.get(this._createKey(c,h));if(!g)return;const D=t.getCellWithCoordByIndex(o,d,!1);let{isMerged:m,isMergedMainCell:v,mergeInfo:w,startY:p,endY:S,startX:y,endX:M}=D;if(m||(v&&(p=w.startY,S=w.endY,y=w.startX,M=w.endX),!this.isRenderDiffRangesByCell(w,i)))return;const U=M-y,c2=S-p;if(this._width>c2||this._width>U+this._paddingRightAndLeft*2)return;const w2=(c2-this._width)/2+p;n.drawImage(g,y+this._paddingRightAndLeft,w2,this._width,this._width)}}),n.restore()}_init(){for(const n in e2)e2[n].forEach((t,i)=>{const s=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(s,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}Z.SpreadsheetExtensionRegistry.add(Z2);function G2(a){if(typeof a!="object"||a===null)return a;const r={};for(const n in a)if(a.hasOwnProperty(n)){const e=G2(a[n]);e!==void 0&&(r[n]=e)}return r}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>u.isRangesEqual}),C.AddCfCommand=B2,C.AddConditionalRuleMutation=n2,C.AddConditionalRuleMutationUndoFactory=k2,C.CFNumberOperator=E,C.CFRuleType=R,C.CFSubRuleType=_,C.CFTextOperator=b,C.CFTimePeriodOperator=L,C.CFValueType=x,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=o2,C.ClearRangeCfCommand=N2,C.ClearWorksheetCfCommand=U2,C.ConditionalFormattingFormulaMarkDirty=J,C.ConditionalFormattingIcon=Z2,C.ConditionalFormattingRuleModel=I,C.DEFAULT_BG_COLOR=X2,C.DEFAULT_FONT_COLOR=Y2,C.DEFAULT_PADDING=q2,C.DEFAULT_WIDTH=W2,C.DataBar=S2,C.DeleteCfCommand=V2,C.DeleteConditionalRuleMutation=$,C.DeleteConditionalRuleMutationUndoFactory=t2,C.EMPTY_ICON_TYPE=L2,C.FormulaResultStatus=T,C.IconUKey=P2,C.MoveCfCommand=O2,C.MoveConditionalRuleMutation=H,C.MoveConditionalRuleMutationUndoFactory=T2,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=h2,C.SetCfCommand=j2,C.SetConditionalRuleMutation=X,C.anchorUndoFactory=p2,C.compareWithNumber=G,C.createCfId=A2,C.createDefaultRule=K2,C.createDefaultValue=J2,C.createDefaultValueByValueType=z2,C.dataBarUKey=R2,C.defaultDataBarNativeColor=m2,C.defaultDataBarPositiveColor=f2,C.defaultPlaceholderColor=x2,C.filterRange=r2,C.findIndexByAnchor=j,C.getCacheStyleMatrix=i0,C.getCellValue=V,C.getColorScaleFromValue=I2,C.getMaxInFormulaResult=a0,C.getOppositeOperator=M2,C.getValueByType=Q,C.iconGroup=b2,C.iconMap=e2,C.isAnchorEqual=Q2,C.isFloatsEqual=z,C.isNullable=k,C.moveByAnchor=E2,C.removeUndefinedAttr=G2,C.serialTimeToTimestamp=_2,C.setConditionalRuleMutationUndoFactory=v2,C.toYMD_1900=y2,C.transformSupportSymmetryAnchor=g2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
3
3
 
4
4
 
5
5
  // @univerjs/sheets-conditional-formatting/facade
@@ -7,176 +7,159 @@
7
7
 
8
8
 
9
9
  // @univerjs/sheets-conditional-formatting-ui/index
10
- (function($,_){typeof exports=="object"&&typeof module<"u"?_(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],_):($=typeof globalThis<"u"?globalThis:$||self,_($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,_,c,Y,te,R,V,ee,kt,fe,pr,Ce,Ge,hr,qe){"use strict";var mo=Object.defineProperty;var yo=($,_,c)=>_ in $?mo($,_,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[_]=c;var De=($,_,c)=>yo($,typeof _!="symbol"?_+"":_,c);const At={type:_.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.ICommandService),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Wt={type:_.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,config:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},jt={type:_.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:C}=e,m=t.get(c.ConditionalFormattingRuleModel),w=t.get(_.IUniverInstanceService),E=Y.getSheetCommandTarget(w);if(!E)return!1;const{unitId:I,subUnitId:S}=E,T=t.get(_.ICommandService),h=m.createCfId(I,S),i={ranges:n,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:C,config:{min:r,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return T.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:S,rule:i})}},Ht={type:_.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.ICommandService),y=t.get(_.IUniverInstanceService),p=Y.getSheetCommandTarget(y);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:r}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},Bt={type:_.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.ICommandService),C=t.get(_.IUniverInstanceService),m=Y.getSheetCommandTarget(C);if(!m)return!1;const{unitId:w,subUnitId:E}=m,I=y.createCfId(w,E);let S;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const T=u;if(T.length!==2||!Array.isArray(T))return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}else{const T=u;if(typeof T!="number")return!1;S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:r,value:T}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:E,rule:S})}},Ft={type:_.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=e,p=t.get(c.ConditionalFormattingRuleModel),C=t.get(_.IUniverInstanceService),m=t.get(_.ICommandService),w=Y.getSheetCommandTarget(C);if(!w)return!1;const{unitId:E,subUnitId:I}=w,S=p.createCfId(E,I),T={ranges:n,cfId:S,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:r,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:E,subUnitId:I,rule:T})}},Gt={type:_.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o,value:u}=e,y=t.get(c.ConditionalFormattingRuleModel),p=t.get(_.IUniverInstanceService),C=Y.getSheetCommandTarget(p);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=t.get(_.ICommandService),I=y.createCfId(m,w),S={ranges:n,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:r,value:u}};return E.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:S})}},qt={type:_.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a,operator:o}=e,u=t.get(c.ConditionalFormattingRuleModel),y=t.get(_.IUniverInstanceService),p=t.get(_.ICommandService),C=Y.getSheetCommandTarget(y);if(!C)return!1;const{unitId:m,subUnitId:w}=C,E=u.createCfId(m,w),I={ranges:n,cfId:E,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:r}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:w,rule:I})}},Xt={type:_.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:n,style:r,stopIfTrue:a}=e,o=t.get(c.ConditionalFormattingRuleModel),u=t.get(_.IUniverInstanceService),y=t.get(_.ICommandService),p=Y.getSheetCommandTarget(u);if(!p)return!1;const{unitId:C,subUnitId:m}=p,w=o.createCfId(C,m),E={ranges:n,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:r}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:C,subUnitId:m,rule:E})}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var be=function(){return be=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++){e=arguments[n];for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&(t[a]=e[a])}return t},be.apply(this,arguments)},_n=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,r=Object.getOwnPropertySymbols(t);a<r.length;a++)e.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(t,r[a])&&(n[r[a]]=t[r[a]]);return n},Ue=V.forwardRef(function(t,e){var n=t.icon,r=t.id,a=t.className,o=t.extend,u=_n(t,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(r," ").concat(a||"").trim(),p=V.useRef("_".concat(On()));return gr(n,"".concat(r),{defIds:n.defIds,idSuffix:p.current},be({ref:e,className:y},u),o)});function gr(t,e,n,r,a){return V.createElement(t.tag,be(be({key:e},Rn(t,n,a)),r),(En(t,n).children||[]).map(function(o,u){return gr(o,"".concat(e,"-").concat(t.tag,"-").concat(u),n,void 0,a)}))}function Rn(t,e,n){var r=be({},t.attrs);n!=null&&n.colorChannel1&&r.fill==="colorChannel1"&&(r.fill=n.colorChannel1),t.tag==="mask"&&r.id&&(r.id=r.id+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];u==="mask"&&typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))});var a=e.defIds;return!a||a.length===0||(t.tag==="use"&&r["xlink:href"]&&(r["xlink:href"]=r["xlink:href"]+e.idSuffix),Object.entries(r).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(r[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),r}function En(t,e){var n,r=e.defIds;return!r||r.length===0?t:t.tag==="defs"&&(!((n=t.children)===null||n===void 0)&&n.length)?be(be({},t),{children:t.children.map(function(a){return typeof a.attrs.id=="string"&&r&&r.indexOf(a.attrs.id)>-1?be(be({},a),{attrs:be(be({},a.attrs),{id:a.attrs.id+e.idSuffix})}):a})}):t}function On(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var Pn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},gt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:Pn}))});gt.displayName="DeleteSingle";var Dn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},vr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Dn}))});vr.displayName="IncreaseSingle";var xn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},vt=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:xn}))});vt.displayName="MoreDownSingle";var Mn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},mr=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Mn}))});mr.displayName="SequenceSingle";var Nn={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},Xe=V.forwardRef(function(t,e){return V.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:Nn}))});Xe.displayName="SlashSingle";function Ln(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function yr(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var a=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,a.get?a:{enumerable:!0,get:function(){return t[r]}})}),n}var Yt={exports:{}},Ye={},Ke={exports:{}},Vn=Ke.exports,br;function Kt(){return br||(br=1,function(t,e){(function(n,r){r(e)})(Vn,function(n){function r(j){return function(se,P,D,N,k,X,H){return j(se,P,H)}}function a(j){return function(se,P,D,N){if(!se||!P||typeof se!="object"||typeof P!="object")return j(se,P,D,N);var k=N.get(se),X=N.get(P);if(k&&X)return k===P&&X===se;N.set(se,P),N.set(P,se);var H=j(se,P,D,N);return N.delete(se),N.delete(P),H}}function o(j,Q){var se={};for(var P in j)se[P]=j[P];for(var P in Q)se[P]=Q[P];return se}function u(j){return j.constructor===Object||j.constructor==null}function y(j){return typeof j.then=="function"}function p(j,Q){return j===Q||j!==j&&Q!==Q}var C="[object Arguments]",m="[object Boolean]",w="[object Date]",E="[object RegExp]",I="[object Map]",S="[object Number]",T="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function f(j){var Q=j.areArraysEqual,se=j.areDatesEqual,P=j.areMapsEqual,D=j.areObjectsEqual,N=j.areRegExpsEqual,k=j.areSetsEqual,X=j.createIsNestedEqual,H=X(Z);function Z(K,re,de){if(K===re)return!0;if(!K||!re||typeof K!="object"||typeof re!="object")return K!==K&&re!==re;if(u(K)&&u(re))return D(K,re,H,de);var Le=Array.isArray(K),Se=Array.isArray(re);if(Le||Se)return Le===Se&&Q(K,re,H,de);var ve=s.call(K);return ve!==s.call(re)?!1:ve===w?se(K,re,H,de):ve===E?N(K,re,H,de):ve===I?P(K,re,H,de):ve===h?k(K,re,H,de):ve===T||ve===C?y(K)||y(re)?!1:D(K,re,H,de):ve===m||ve===S||ve===i?p(K.valueOf(),re.valueOf()):!1}return Z}function b(j,Q,se,P){var D=j.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!se(j[D],Q[D],D,D,j,Q,P))return!1;return!0}var l=a(b);function g(j,Q){return p(j.valueOf(),Q.valueOf())}function d(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={},k=0;return j.forEach(function(X,H){if(D){var Z=!1,K=0;Q.forEach(function(re,de){!Z&&!N[K]&&(Z=se(H,de,k,K,j,Q,P)&&se(X,re,H,de,j,Q,P))&&(N[K]=!0),K++}),k++,D=Z}}),D}var v=a(d),x="_owner",M=Object.prototype.hasOwnProperty;function z(j,Q,se,P){var D=Object.keys(j),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===x){var X=!!j.$$typeof,H=!!Q.$$typeof;if((X||H)&&X!==H)return!1}if(!M.call(Q,k)||!se(j[k],Q[k],k,k,j,Q,P))return!1}return!0}var U=a(z);function O(j,Q){return j.source===Q.source&&j.flags===Q.flags}function L(j,Q,se,P){var D=j.size===Q.size;if(!D)return!1;if(!j.size)return!0;var N={};return j.forEach(function(k,X){if(D){var H=!1,Z=0;Q.forEach(function(K,re){!H&&!N[Z]&&(H=se(k,K,X,re,j,Q,P))&&(N[Z]=!0),Z++}),D=H}}),D}var F=a(L),q=Object.freeze({areArraysEqual:b,areDatesEqual:g,areMapsEqual:d,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:L,createIsNestedEqual:r}),J=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:U,areRegExpsEqual:O,areSetsEqual:F,createIsNestedEqual:r}),le=f(q);function ae(j,Q){return le(j,Q,void 0)}var B=f(o(q,{createIsNestedEqual:function(){return p}}));function W(j,Q){return B(j,Q,void 0)}var ne=f(J);function ie(j,Q){return ne(j,Q,new WeakMap)}var ue=f(o(J,{createIsNestedEqual:function(){return p}}));function ge(j,Q){return ue(j,Q,new WeakMap)}function ye(j){return f(o(q,j(q)))}function Te(j){var Q=f(o(J,j(J)));return function(se,P,D){return D===void 0&&(D=new WeakMap),Q(se,P,D)}}n.circularDeepEqual=ie,n.circularShallowEqual=ge,n.createCustomCircularEqual=Te,n.createCustomEqual=ye,n.deepEqual=ae,n.sameValueZeroEqual=p,n.shallowEqual=W,Object.defineProperty(n,"__esModule",{value:!0})})}(Ke,Ke.exports)),Ke.exports}var mt={exports:{}},Sr;function Zt(){if(Sr)return mt.exports;Sr=1;function t(n){var r,a,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var u=n.length;for(r=0;r<u;r++)n[r]&&(a=t(n[r]))&&(o&&(o+=" "),o+=a)}else for(a in n)n[a]&&(o&&(o+=" "),o+=a);return o}function e(){for(var n,r,a=0,o="",u=arguments.length;a<u;a++)(n=arguments[a])&&(r=t(n))&&(o&&(o+=" "),o+=r);return o}return mt.exports=e,mt.exports.clsx=e,mt.exports}var oe={},$t,Cr;function Un(){return Cr||(Cr=1,$t=function(e,n,r){return e===n?!0:e.className===n.className&&r(e.style,n.style)&&e.width===n.width&&e.autoSize===n.autoSize&&e.cols===n.cols&&e.draggableCancel===n.draggableCancel&&e.draggableHandle===n.draggableHandle&&r(e.verticalCompact,n.verticalCompact)&&r(e.compactType,n.compactType)&&r(e.layout,n.layout)&&r(e.margin,n.margin)&&r(e.containerPadding,n.containerPadding)&&e.rowHeight===n.rowHeight&&e.maxRows===n.maxRows&&e.isBounded===n.isBounded&&e.isDraggable===n.isDraggable&&e.isResizable===n.isResizable&&e.allowOverlap===n.allowOverlap&&e.preventCollision===n.preventCollision&&e.useCSSTransforms===n.useCSSTransforms&&e.transformScale===n.transformScale&&e.isDroppable===n.isDroppable&&r(e.resizeHandles,n.resizeHandles)&&r(e.resizeHandle,n.resizeHandle)&&e.onLayoutChange===n.onLayoutChange&&e.onDragStart===n.onDragStart&&e.onDrag===n.onDrag&&e.onDragStop===n.onDragStop&&e.onResizeStart===n.onResizeStart&&e.onResize===n.onResize&&e.onResizeStop===n.onResizeStop&&e.onDrop===n.onDrop&&r(e.droppingItem,n.droppingItem)&&r(e.innerRef,n.innerRef)}),$t}var Tr;function ze(){if(Tr)return oe;Tr=1,Object.defineProperty(oe,"__esModule",{value:!0}),oe.bottom=r,oe.childrenEqual=p,oe.cloneLayout=a,oe.cloneLayoutItem=y,oe.collides=m,oe.compact=w,oe.compactItem=S,oe.compactType=j,oe.correctBounds=T,oe.fastPositionEqual=C,oe.fastRGLPropsEqual=void 0,oe.getAllCollisions=s,oe.getFirstCollision=i,oe.getLayoutItem=h,oe.getStatics=f,oe.modifyLayout=o,oe.moveElement=b,oe.moveElementAwayFromCollision=l,oe.noop=void 0,oe.perc=g,oe.resizeItemInDirection=B,oe.setTopLeft=ne,oe.setTransform=W,oe.sortLayoutItems=ie,oe.sortLayoutItemsByColRow=ge,oe.sortLayoutItemsByRowCol=ue,oe.synchronizeLayoutWithChildren=ye,oe.validateLayout=Te,oe.withLayoutItem=u;var t=Kt(),e=n(V);function n(P){return P&&P.__esModule?P:{default:P}}function r(P){let D=0,N;for(let k=0,X=P.length;k<X;k++)N=P[k].y+P[k].h,N>D&&(D=N);return D}function a(P){const D=Array(P.length);for(let N=0,k=P.length;N<k;N++)D[N]=y(P[N]);return D}function o(P,D){const N=Array(P.length);for(let k=0,X=P.length;k<X;k++)D.i===P[k].i?N[k]=D:N[k]=P[k];return N}function u(P,D,N){let k=h(P,D);return k?(k=N(y(k)),P=o(P,k),[P,k]):[P,null]}function y(P){return{w:P.w,h:P.h,x:P.x,y:P.y,i:P.i,minW:P.minW,maxW:P.maxW,minH:P.minH,maxH:P.maxH,moved:!!P.moved,static:!!P.static,isDraggable:P.isDraggable,isResizable:P.isResizable,resizeHandles:P.resizeHandles,isBounded:P.isBounded}}function p(P,D){return(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.key),e.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}oe.fastRGLPropsEqual=Un();function C(P,D){return P.left===D.left&&P.top===D.top&&P.width===D.width&&P.height===D.height}function m(P,D){return!(P.i===D.i||P.x+P.w<=D.x||P.x>=D.x+D.w||P.y+P.h<=D.y||P.y>=D.y+D.h)}function w(P,D,N,k){const X=f(P),H=ie(P,D),Z=Array(P.length);for(let K=0,re=H.length;K<re;K++){let de=y(H[K]);de.static||(de=S(X,de,D,N,H,k),X.push(de)),Z[P.indexOf(H[K])]=de,de.moved=!1}return Z}const E={x:"w",y:"h"};function I(P,D,N,k){const X=E[k];D[k]+=1;const H=P.map(Z=>Z.i).indexOf(D.i);for(let Z=H+1;Z<P.length;Z++){const K=P[Z];if(!K.static){if(K.y>D.y+D.h)break;m(D,K)&&I(P,K,N+D[X],k)}}D[k]=N}function S(P,D,N,k,X,H){const Z=N==="vertical",K=N==="horizontal";if(Z)for(D.y=Math.min(r(P),D.y);D.y>0&&!i(P,D);)D.y--;else if(K)for(;D.x>0&&!i(P,D);)D.x--;let re;for(;(re=i(P,D))&&!(N===null&&H);)if(K?I(X,D,re.x+re.w,"x"):I(X,D,re.y+re.h,"y"),K&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(P,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function T(P,D){const N=f(P);for(let k=0,X=P.length;k<X;k++){const H=P[k];if(H.x+H.w>D.cols&&(H.x=D.cols-H.w),H.x<0&&(H.x=0,H.w=D.cols),!H.static)N.push(H);else for(;i(N,H);)H.y++}return P}function h(P,D){for(let N=0,k=P.length;N<k;N++)if(P[N].i===D)return P[N]}function i(P,D){for(let N=0,k=P.length;N<k;N++)if(m(P[N],D))return P[N]}function s(P,D){return P.filter(N=>m(N,D))}function f(P){return P.filter(D=>D.static)}function b(P,D,N,k,X,H,Z,K,re){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return P;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let Se=ie(P,Z);(Z==="vertical"&&typeof k=="number"?Le>=k:Z==="horizontal"&&typeof N=="number"?de>=N:!1)&&(Se=Se.reverse());const Fe=s(Se,D),zt=Fe.length>0;if(zt&&re)return a(P);if(zt&&H)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,P;for(let fr=0,vo=Fe.length;fr<vo;fr++){const Ve=Fe[fr];`${D.i}${D.x}${D.y}${Ve.i}${Ve.x}${Ve.y}`,!Ve.moved&&(Ve.static?P=l(P,Ve,D,X,Z):P=l(P,D,Ve,X,Z))}return P}function l(P,D,N,k,X,H){const Z=X==="horizontal",K=X==="vertical",re=D.static;if(k){k=!1;const Se={x:Z?Math.max(D.x-N.w,0):N.x,y:K?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(P,Se),Fe=ve&&ve.y+ve.h>D.y,zt=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&K)return b(P,N,void 0,D.y+1,k,re,X);if(Fe&&X==null)return D.y=N.y,N.y=N.y+N.h,P;if(zt&&Z)return b(P,D,N.x,void 0,k,re,X)}else return`${N.i}${Se.x}${Se.y}`,b(P,N,Z?Se.x:void 0,K?Se.y:void 0,k,re,X)}const de=Z?N.x+1:void 0,Le=K?N.y+1:void 0;return de==null&&Le==null?P:b(P,N,Z?N.x+1:void 0,K?N.y+1:void 0,k,re,X)}function g(P){return P*100+"%"}const d=(P,D,N,k)=>P+N>k?D:N,v=(P,D,N)=>P<0?D:N,x=P=>Math.max(0,P),M=P=>Math.max(0,P),z=(P,D,N)=>{let{left:k,height:X,width:H}=D;const Z=P.top-(X-P.height);return{left:k,width:H,height:v(Z,P.height,X),top:M(Z)}},U=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{top:k,height:H,width:d(P.left,P.width,Z,N),left:x(X)}},O=(P,D,N)=>{let{top:k,height:X,width:H}=D;const Z=P.left-(H-P.width);return{height:X,width:Z<0?P.width:d(P.left,P.width,H,N),top:M(k),left:x(Z)}},L=(P,D,N)=>{let{top:k,left:X,height:H,width:Z}=D;return{width:Z,left:X,height:v(k,P.height,H),top:M(k)}},ae={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return L(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:L,sw:function(){return L(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return z(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function B(P,D,N,k){const X=ae[P];return X?X(D,{...D,...N},k):N}function W(P){let{top:D,left:N,width:k,height:X}=P;const H=`translate(${N}px,${D}px)`;return{transform:H,WebkitTransform:H,MozTransform:H,msTransform:H,OTransform:H,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ne(P){let{top:D,left:N,width:k,height:X}=P;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${X}px`,position:"absolute"}}function ie(P,D){return D==="horizontal"?ge(P):D==="vertical"?ue(P):P}function ue(P){return P.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(P){return P.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(P,D,N,k,X){P=P||[];const H=[];e.default.Children.forEach(D,K=>{if((K==null?void 0:K.key)==null)return;const re=h(P,String(K.key)),de=K.props["data-grid"];re&&de==null?H.push(y(re)):de?H.push(y({...de,i:K.key})):H.push(y({w:1,h:1,x:0,y:r(H),i:String(K.key)}))});const Z=T(H,{cols:N});return X?Z:w(Z,k,N)}function Te(P){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(P))throw new Error(D+" must be an array!");for(let k=0,X=P.length;k<X;k++){const H=P[k];for(let Z=0;Z<N.length;Z++)if(typeof H[N[Z]]!="number")throw new Error("ReactGridLayout: "+D+"["+k+"]."+N[Z]+" must be a number!")}}function j(P){const{verticalCompact:D,compactType:N}=P||{};return D===!1?null:N}function Q(){}const se=()=>{};return oe.noop=se,oe}var Ie={},wr;function Jt(){if(wr)return Ie;wr=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=n,Ie.calcGridItemWHPx=e,Ie.calcWH=a,Ie.calcXY=r,Ie.clamp=o;function t(u){const{margin:y,containerPadding:p,containerWidth:C,cols:m}=u;return(C-y[0]*(m-1)-p[0]*2)/m}function e(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function n(u,y,p,C,m,w){const{margin:E,containerPadding:I,rowHeight:S}=u,T=t(u),h={};return w&&w.resizing?(h.width=Math.round(w.resizing.width),h.height=Math.round(w.resizing.height)):(h.width=e(C,T,E[0]),h.height=e(m,S,E[1])),w&&w.dragging?(h.top=Math.round(w.dragging.top),h.left=Math.round(w.dragging.left)):w&&w.resizing&&typeof w.resizing.top=="number"&&typeof w.resizing.left=="number"?(h.top=Math.round(w.resizing.top),h.left=Math.round(w.resizing.left)):(h.top=Math.round((S+E[1])*p+I[1]),h.left=Math.round((T+E[0])*y+I[0])),h}function r(u,y,p,C,m){const{margin:w,cols:E,rowHeight:I,maxRows:S}=u,T=t(u);let h=Math.round((p-w[0])/(T+w[0])),i=Math.round((y-w[1])/(I+w[1]));return h=o(h,0,E-C),i=o(i,0,S-m),{x:h,y:i}}function a(u,y,p,C,m,w){const{margin:E,maxRows:I,cols:S,rowHeight:T}=u,h=t(u);let i=Math.round((y+E[0])/(h+E[0])),s=Math.round((p+E[1])/(T+E[1])),f=o(i,0,S-C),b=o(s,0,I-m);return["sw","w","nw"].indexOf(w)!==-1&&(f=o(i,0,S)),["nw","n","ne"].indexOf(w)!==-1&&(b=o(s,0,I)),{w:f,h:b}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return Ie}var Ze={},Qt={exports:{}},er,Ir;function zn(){if(Ir)return er;Ir=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return er=t,er}var tr,_r;function kn(){if(_r)return tr;_r=1;var t=zn();function e(){}function n(){}return n.resetWarningCache=e,tr=function(){function r(u,y,p,C,m,w){if(w!==t){var E=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw E.name="Invariant Violation",E}}r.isRequired=r;function a(){return r}var o={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:a,element:r,elementType:r,instanceOf:a,node:r,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},tr}var Rr;function Ee(){return Rr||(Rr=1,Qt.exports=kn()()),Qt.exports}var $e={exports:{}},rr={};function Er(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=Er(t[e]))&&(r&&(r+=" "),r+=n);else for(e in t)t[e]&&(r&&(r+=" "),r+=e);return r}function Or(){for(var t,e,n=0,r="";n<arguments.length;)(t=arguments[n++])&&(e=Er(t))&&(r&&(r+=" "),r+=e);return r}const An=yr(Object.freeze(Object.defineProperty({__proto__:null,clsx:Or,default:Or},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},Pr;function yt(){if(Pr)return Oe;Pr=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=t,Oe.int=r,Oe.isFunction=e,Oe.isNum=n;function t(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function r(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Pe={},Dr;function Wn(){if(Dr)return Pe;Dr=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.browserPrefixToKey=n,Pe.browserPrefixToStyle=r,Pe.default=void 0,Pe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<t.length;p++)if(n(u,t[p])in y)return t[p];return""}function n(o,u){return u?"".concat(u).concat(a(o)):o}function r(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Pe.default=e(),Pe}var xr;function nr(){if(xr)return pe;xr=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=f,pe.createCSSTransform=S,pe.createSVGTransform=T,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=w,pe.innerWidth=E,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=I,pe.outerHeight=C,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=b;var t=yt(),e=r(Wn());function n(d){if(typeof WeakMap!="function")return null;var v=new WeakMap,x=new WeakMap;return(n=function(M){return M?x:v})(d)}function r(d,v){if(d&&d.__esModule)return d;if(d===null||typeof d!="object"&&typeof d!="function")return{default:d};var x=n(v);if(x&&x.has(d))return x.get(d);var M={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in d)if(U!=="default"&&Object.prototype.hasOwnProperty.call(d,U)){var O=z?Object.getOwnPropertyDescriptor(d,U):null;O&&(O.get||O.set)?Object.defineProperty(M,U,O):M[U]=d[U]}return M.default=d,x&&x.set(d,M),M}let a="";function o(d,v){return a||(a=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(x){return(0,t.isFunction)(d[x])})),(0,t.isFunction)(d[a])?d[a](v):!1}function u(d,v,x){let M=d;do{if(o(M,v))return!0;if(M===x)return!1;M=M.parentNode}while(M);return!1}function y(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.addEventListener?d.addEventListener(v,x,z):d.attachEvent?d.attachEvent("on"+v,x):d["on"+v]=x}function p(d,v,x,M){if(!d)return;const z={capture:!0,...M};d.removeEventListener?d.removeEventListener(v,x,z):d.detachEvent?d.detachEvent("on"+v,x):d["on"+v]=null}function C(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderTopWidth),v+=(0,t.int)(x.borderBottomWidth),v}function m(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v+=(0,t.int)(x.borderLeftWidth),v+=(0,t.int)(x.borderRightWidth),v}function w(d){let v=d.clientHeight;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingTop),v-=(0,t.int)(x.paddingBottom),v}function E(d){let v=d.clientWidth;const x=d.ownerDocument.defaultView.getComputedStyle(d);return v-=(0,t.int)(x.paddingLeft),v-=(0,t.int)(x.paddingRight),v}function I(d,v,x){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),U=(d.clientX+v.scrollLeft-z.left)/x,O=(d.clientY+v.scrollTop-z.top)/x;return{x:U,y:O}}function S(d,v){const x=h(d,v,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:x}}function T(d,v){return h(d,v,"")}function h(d,v,x){let{x:M,y:z}=d,U="translate(".concat(M).concat(x,",").concat(z).concat(x,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+x),L="".concat(typeof v.y=="string"?v.y:v.y+x);U="translate(".concat(O,", ").concat(L,")")+U}return U}function i(d,v){return d.targetTouches&&(0,t.findInArray)(d.targetTouches,x=>v===x.identifier)||d.changedTouches&&(0,t.findInArray)(d.changedTouches,x=>v===x.identifier)}function s(d){if(d.targetTouches&&d.targetTouches[0])return d.targetTouches[0].identifier;if(d.changedTouches&&d.changedTouches[0])return d.changedTouches[0].identifier}function f(d){if(!d)return;let v=d.getElementById("react-draggable-style-el");v||(v=d.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
10
+ (function(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(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;}
11
11
  `,v.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
12
- `,d.getElementsByTagName("head")[0].appendChild(v)),d.body&&l(d.body,"react-draggable-transparent-selection")}function b(d){if(d)try{if(d.body&&g(d.body,"react-draggable-transparent-selection"),d.selection)d.selection.empty();else{const v=(d.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(d,v){d.classList?d.classList.add(v):d.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(d.className+=" ".concat(v))}function g(d,v){d.classList?d.classList.remove(v):d.className=d.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var we={},Mr;function Nr(){if(Mr)return we;Mr=1,Object.defineProperty(we,"__esModule",{value:!0}),we.canDragX=a,we.canDragY=o,we.createCoreData=y,we.createDraggableData=p,we.getBoundPosition=n,we.getControlPosition=u,we.snapToGrid=r;var t=yt(),e=nr();function n(w,E,I){if(!w.props.bounds)return[E,I];let{bounds:S}=w.props;S=typeof S=="string"?S:C(S);const T=m(w);if(typeof S=="string"){const{ownerDocument:h}=T,i=h.defaultView;let s;if(S==="parent"?s=T.parentNode:s=h.querySelector(S),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+S+'" could not find an element.');const f=s,b=i.getComputedStyle(T),l=i.getComputedStyle(f);S={left:-T.offsetLeft+(0,t.int)(l.paddingLeft)+(0,t.int)(b.marginLeft),top:-T.offsetTop+(0,t.int)(l.paddingTop)+(0,t.int)(b.marginTop),right:(0,e.innerWidth)(f)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(l.paddingRight)-(0,t.int)(b.marginRight),bottom:(0,e.innerHeight)(f)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(l.paddingBottom)-(0,t.int)(b.marginBottom)}}return(0,t.isNum)(S.right)&&(E=Math.min(E,S.right)),(0,t.isNum)(S.bottom)&&(I=Math.min(I,S.bottom)),(0,t.isNum)(S.left)&&(E=Math.max(E,S.left)),(0,t.isNum)(S.top)&&(I=Math.max(I,S.top)),[E,I]}function r(w,E,I){const S=Math.round(E/w[0])*w[0],T=Math.round(I/w[1])*w[1];return[S,T]}function a(w){return w.props.axis==="both"||w.props.axis==="x"}function o(w){return w.props.axis==="both"||w.props.axis==="y"}function u(w,E,I){const S=typeof E=="number"?(0,e.getTouch)(w,E):null;if(typeof E=="number"&&!S)return null;const T=m(I),h=I.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(S||w,h,I.props.scale)}function y(w,E,I){const S=!(0,t.isNum)(w.lastX),T=m(w);return S?{node:T,deltaX:0,deltaY:0,lastX:E,lastY:I,x:E,y:I}:{node:T,deltaX:E-w.lastX,deltaY:I-w.lastY,lastX:w.lastX,lastY:w.lastY,x:E,y:I}}function p(w,E){const I=w.props.scale;return{node:E.node,x:w.state.x+E.deltaX/I,y:w.state.y+E.deltaY/I,deltaX:E.deltaX/I,deltaY:E.deltaY/I,lastX:w.state.x,lastY:w.state.y}}function C(w){return{left:w.left,top:w.top,right:w.right,bottom:w.bottom}}function m(w){const E=w.findDOMNode();if(!E)throw new Error("<DraggableCore>: Unmounted during event!");return E}return we}var Je={},bt={},Lr;function Vr(){if(Lr)return bt;Lr=1,Object.defineProperty(bt,"__esModule",{value:!0}),bt.default=t;function t(){}return bt}var Ur;function jn(){if(Ur)return Je;Ur=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=C(V),e=y(Ee()),n=y(pr),r=nr(),a=Nr(),o=yt(),u=y(Vr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let S=I.mouse,T=class extends t.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:f}=s;if(this.props.disabled||!(i.target instanceof f.defaultView.Node)||this.props.handle&&!(0,r.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,r.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const b=(0,r.getTouchIdentifier)(i);this.touchIdentifier=b;const l=(0,a.getControlPosition)(i,b,this);if(l==null)return;const{x:g,y:d}=l,v=(0,a.createCoreData)(this,g,d);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,r.addUserSelectStyles)(f),this.dragging=!0,this.lastX=g,this.lastY=d,(0,r.addEvent)(f,S.move,this.handleDrag),(0,r.addEvent)(f,S.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let d=f-this.lastX,v=b-this.lastY;if([d,v]=(0,a.snapToGrid)(this.props.grid,d,v),!d&&!v)return;f=this.lastX+d,b=this.lastY+v}const l=(0,a.createCoreData)(this,f,b);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=f,this.lastY=b}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:f,y:b}=s;if(Array.isArray(this.props.grid)){let v=f-this.lastX||0,x=b-this.lastY||0;[v,x]=(0,a.snapToGrid)(this.props.grid,v,x),f=this.lastX+v,b=this.lastY+x}const l=(0,a.createCoreData)(this,f,b);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const d=this.findDOMNode();d&&this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(d.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,d&&((0,u.default)("DraggableCore: Removing handlers"),(0,r.removeEvent)(d.ownerDocument,S.move,this.handleDrag),(0,r.removeEvent)(d.ownerDocument,S.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(S=I.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(S=I.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(S=I.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(S=I.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,r.addEvent)(i,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,r.removeEvent)(s,I.mouse.move,this.handleDrag),(0,r.removeEvent)(s,I.touch.move,this.handleDrag),(0,r.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,r.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,r.removeEvent)(i,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,r.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Je.default=T,m(T,"displayName","DraggableCore"),m(T,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(T,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Je}var zr;function Hn(){return zr||(zr=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=E(V),n=m(Ee()),r=m(pr),a=m(An),o=nr(),u=Nr(),y=yt(),p=m(jn()),C=m(Vr());function m(s){return s&&s.__esModule?s:{default:s}}function w(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(w=function(l){return l?b:f})(s)}function E(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=w(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},I.apply(this,arguments)}function S(s,f,b){return f=T(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function T(s){var f=h(s,"string");return typeof f=="symbol"?f:String(f)}function h(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}class i extends e.Component{static getDerivedStateFromProps(f,b){let{position:l}=f,{prevPropsPosition:g}=b;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,C.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(f){super(f),S(this,"onDragStart",(b,l)=>{if((0,C.default)("Draggable: onDragStart: %j",l),this.props.onStart(b,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),S(this,"onDrag",(b,l)=>{if(!this.state.dragging)return!1;(0,C.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),d={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x,y:M}=d;d.x+=this.state.slackX,d.y+=this.state.slackY;const[z,U]=(0,u.getBoundPosition)(this,d.x,d.y);d.x=z,d.y=U,d.slackX=this.state.slackX+(x-d.x),d.slackY=this.state.slackY+(M-d.y),g.x=d.x,g.y=d.y,g.deltaX=d.x-this.state.x,g.deltaY=d.y-this.state.y}if(this.props.onDrag(b,g)===!1)return!1;this.setState(d)}),S(this,"onDragStop",(b,l)=>{if(!this.state.dragging||this.props.onStop(b,(0,u.createDraggableData)(this,l))===!1)return!1;(0,C.default)("Draggable: onDragStop: %j",l);const d={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x,y:M}=this.props.position;d.x=x,d.y=M}this.setState(d)}),this.state={dragging:!1,dragged:!1,x:f.position?f.position.x:f.defaultPosition.x,y:f.position?f.position.y:f.defaultPosition.y,prevPropsPosition:{...f.position},slackX:0,slackY:0,isElementSVG:!1},f.position&&!(f.onDrag||f.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var f,b;return(f=(b=this.props)===null||b===void 0||(b=b.nodeRef)===null||b===void 0?void 0:b.current)!==null&&f!==void 0?f:r.default.findDOMNode(this)}render(){const{axis:f,bounds:b,children:l,defaultPosition:g,defaultClassName:d,defaultClassNameDragging:v,defaultClassNameDragged:x,position:M,positionOffset:z,scale:U,...O}=this.props;let L={},F=null;const J=!!!M||this.state.dragging,le=M||g,ae={x:(0,u.canDragX)(this)&&J?this.state.x:le.x,y:(0,u.canDragY)(this)&&J?this.state.y:le.y};this.state.isElementSVG?F=(0,o.createSVGTransform)(ae,z):L=(0,o.createCSSTransform)(ae,z);const B=(0,a.default)(l.props.className||"",d,{[v]:this.state.dragging,[x]:this.state.dragged});return e.createElement(p.default,I({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(l),{className:B,style:{...l.props.style,...L},transform:F}))}}t.default=i,S(i,"displayName","Draggable"),S(i,"propTypes",{...p.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),S(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(rr)),rr}var kr;function ar(){if(kr)return $e.exports;kr=1;const{default:t,DraggableCore:e}=Hn();return $e.exports=t,$e.exports.default=t,$e.exports.DraggableCore=e,$e.exports}var Qe={exports:{}},et={},St={},Ar;function Bn(){if(Ar)return St;Ar=1,St.__esModule=!0,St.cloneElement=y;var t=e(V);function e(p){return p&&p.__esModule?p:{default:p}}function n(p,C){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(p);C&&(w=w.filter(function(E){return Object.getOwnPropertyDescriptor(p,E).enumerable})),m.push.apply(m,w)}return m}function r(p){for(var C=1;C<arguments.length;C++){var m=arguments[C]!=null?arguments[C]:{};C%2?n(Object(m),!0).forEach(function(w){a(p,w,m[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):n(Object(m)).forEach(function(w){Object.defineProperty(p,w,Object.getOwnPropertyDescriptor(m,w))})}return p}function a(p,C,m){return C=o(C),C in p?Object.defineProperty(p,C,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[C]=m,p}function o(p){var C=u(p,"string");return typeof C=="symbol"?C:String(C)}function u(p,C){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var w=m.call(p,C);if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(p)}function y(p,C){return C.style&&p.props.style&&(C.style=r(r({},p.props.style),C.style)),C.className&&p.props.className&&(C.className=p.props.className+" "+C.className),t.default.cloneElement(p,C)}return St}var tt={},Wr;function jr(){if(Wr)return tt;Wr=1,tt.__esModule=!0,tt.resizableProps=void 0;var t=e(Ee());ar();function e(r){return r&&r.__esModule?r:{default:r}}var n={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=t.default.number).isRequired.apply(p,o)}return t.default.number.apply(t.default,o)}};return tt.resizableProps=n,tt}var Hr;function Br(){if(Hr)return et;Hr=1,et.__esModule=!0,et.default=void 0;var t=u(V),e=ar(),n=Bn(),r=jr(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,f=new WeakMap;return(o=function(l){return l?f:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var f=o(s);if(f&&f.has(i))return f.get(i);var b={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var d=l?Object.getOwnPropertyDescriptor(i,g):null;d&&(d.get||d.set)?Object.defineProperty(b,g,d):b[g]=i[g]}return b.default=i,f&&f.set(i,b),b}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var f=arguments[s];for(var b in f)Object.prototype.hasOwnProperty.call(f,b)&&(i[b]=f[b])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var f={},b=Object.keys(i),l,g;for(g=0;g<b.length;g++)l=b[g],!(s.indexOf(l)>=0)&&(f[l]=i[l]);return f}function C(i,s){var f=Object.keys(i);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(i);s&&(b=b.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),f.push.apply(f,b)}return f}function m(i){for(var s=1;s<arguments.length;s++){var f=arguments[s]!=null?arguments[s]:{};s%2?C(Object(f),!0).forEach(function(b){w(i,b,f[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(f)):C(Object(f)).forEach(function(b){Object.defineProperty(i,b,Object.getOwnPropertyDescriptor(f,b))})}return i}function w(i,s,f){return s=E(s),s in i?Object.defineProperty(i,s,{value:f,enumerable:!0,configurable:!0,writable:!0}):i[s]=f,i}function E(i){var s=I(i,"string");return typeof s=="symbol"?s:String(s)}function I(i,s){if(typeof i!="object"||i===null)return i;var f=i[Symbol.toPrimitive];if(f!==void 0){var b=f.call(i,s);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function S(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,T(i,s)}function T(i,s){return T=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(b,l){return b.__proto__=l,b},T(i,s)}var h=function(i){S(s,i);function s(){for(var b,l=arguments.length,g=new Array(l),d=0;d<l;d++)g[d]=arguments[d];return b=i.call.apply(i,[this].concat(g))||this,b.handleRefs={},b.lastHandleRect=null,b.slack=null,b}var f=s.prototype;return f.componentWillUnmount=function(){this.resetData()},f.resetData=function(){this.lastHandleRect=this.slack=null},f.runConstraints=function(l,g){var d=this.props,v=d.minConstraints,x=d.maxConstraints,M=d.lockAspectRatio;if(!v&&!x&&!M)return[l,g];if(M){var z=this.props.width/this.props.height,U=l-this.props.width,O=g-this.props.height;Math.abs(U)>Math.abs(O*z)?g=l/z:l=g*z}var L=l,F=g,q=this.slack||[0,0],J=q[0],le=q[1];return l+=J,g+=le,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),x&&(l=Math.min(x[0],l),g=Math.min(x[1],g)),this.slack=[J+(L-l),le+(F-g)],[l,g]},f.resizeHandler=function(l,g){var d=this;return function(v,x){var M=x.node,z=x.deltaX,U=x.deltaY;l==="onResizeStart"&&d.resetData();var O=(d.props.axis==="both"||d.props.axis==="x")&&g!=="n"&&g!=="s",L=(d.props.axis==="both"||d.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!L)){var F=g[0],q=g[g.length-1],J=M.getBoundingClientRect();if(d.lastHandleRect!=null){if(q==="w"){var le=J.left-d.lastHandleRect.left;z+=le}if(F==="n"){var ae=J.top-d.lastHandleRect.top;U+=ae}}d.lastHandleRect=J,q==="w"&&(z=-z),F==="n"&&(U=-U);var B=d.props.width+(O?z/d.props.transformScale:0),W=d.props.height+(L?U/d.props.transformScale:0),ne=d.runConstraints(B,W);B=ne[0],W=ne[1];var ie=B!==d.props.width||W!==d.props.height,ue=typeof d.props[l]=="function"?d.props[l]:null,ge=l==="onResize"&&!ie;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:M,size:{width:B,height:W},handle:g})),l==="onResizeStop"&&d.resetData()}}},f.renderResizeHandle=function(l,g){var d=this.props.handle;if(!d)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof d=="function")return d(l,g);var v=typeof d.type=="string",x=m({ref:g},v?{}:{handleAxis:l});return t.cloneElement(d,x)},f.render=function(){var l=this,g=this.props,d=g.children,v=g.className,x=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var M=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,n.cloneElement)(d,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(d.props.children,M.map(function(U){var O,L=(O=l.handleRefs[U])!=null?O:l.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,y({},x,{nodeRef:L,key:"resizableHandle-"+U,onStop:l.resizeHandler("onResizeStop",U),onStart:l.resizeHandler("onResizeStart",U),onDrag:l.resizeHandler("onResize",U)}),l.renderResizeHandle(U,L))}))}))},s}(t.Component);return et.default=h,h.propTypes=r.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},et}var rt={},Fr;function Fn(){if(Fr)return rt;Fr=1,rt.__esModule=!0,rt.default=void 0;var t=y(V),e=o(Ee()),n=o(Br()),r=jr(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var f=new WeakMap,b=new WeakMap;return(u=function(g){return g?b:f})(s)}function y(s,f){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var b=u(f);if(b&&b.has(s))return b.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var d in s)if(d!=="default"&&Object.prototype.hasOwnProperty.call(s,d)){var v=g?Object.getOwnPropertyDescriptor(s,d):null;v&&(v.get||v.set)?Object.defineProperty(l,d,v):l[d]=s[d]}return l.default=s,b&&b.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var f=1;f<arguments.length;f++){var b=arguments[f];for(var l in b)Object.prototype.hasOwnProperty.call(b,l)&&(s[l]=b[l])}return s},p.apply(this,arguments)}function C(s,f){var b=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);f&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),b.push.apply(b,l)}return b}function m(s){for(var f=1;f<arguments.length;f++){var b=arguments[f]!=null?arguments[f]:{};f%2?C(Object(b),!0).forEach(function(l){w(s,l,b[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(b)):C(Object(b)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(b,l))})}return s}function w(s,f,b){return f=E(f),f in s?Object.defineProperty(s,f,{value:b,enumerable:!0,configurable:!0,writable:!0}):s[f]=b,s}function E(s){var f=I(s,"string");return typeof f=="symbol"?f:String(f)}function I(s,f){if(typeof s!="object"||s===null)return s;var b=s[Symbol.toPrimitive];if(b!==void 0){var l=b.call(s,f);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(s)}function S(s,f){if(s==null)return{};var b={},l=Object.keys(s),g,d;for(d=0;d<l.length;d++)g=l[d],!(f.indexOf(g)>=0)&&(b[g]=s[g]);return b}function T(s,f){s.prototype=Object.create(f.prototype),s.prototype.constructor=s,h(s,f)}function h(s,f){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,f)}var i=function(s){T(f,s);function f(){for(var l,g=arguments.length,d=new Array(g),v=0;v<g;v++)d[v]=arguments[v];return l=s.call.apply(s,[this].concat(d))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(x,M){var z=M.size;l.props.onResize?(x.persist==null||x.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(x,M)})):l.setState(z)},l}f.getDerivedStateFromProps=function(g,d){return d.propsWidth!==g.width||d.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var b=f.prototype;return b.render=function(){var g=this.props,d=g.handle,v=g.handleSize;g.onResize;var x=g.onResizeStart,M=g.onResizeStop,z=g.draggableOpts,U=g.minConstraints,O=g.maxConstraints,L=g.lockAspectRatio,F=g.axis;g.width,g.height;var q=g.resizeHandles,J=g.style,le=g.transformScale,ae=S(g,a);return t.createElement(n.default,{axis:F,draggableOpts:z,handle:d,handleSize:v,height:this.state.height,lockAspectRatio:L,maxConstraints:O,minConstraints:U,onResizeStart:x,onResize:this.onResize,onResizeStop:M,resizeHandles:q,transformScale:le,width:this.state.width},t.createElement("div",p({},ae,{style:m(m({},J),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},f}(t.Component);return rt.default=i,i.propTypes=m(m({},r.resizableProps),{},{children:e.default.element}),rt}var Gr;function Gn(){return Gr||(Gr=1,Qe.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Qe.exports.Resizable=Br().default,Qe.exports.ResizableBox=Fn().default),Qe.exports}var _e={},qr;function Xr(){if(qr)return _e;qr=1,Object.defineProperty(_e,"__esModule",{value:!0}),_e.resizeHandleType=_e.resizeHandleAxesType=_e.default=void 0;var t=n(Ee()),e=n(V);function n(o){return o&&o.__esModule?o:{default:o}}const r=_e.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=_e.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return _e.default={className:t.default.string,style:t.default.object,width:t.default.number,autoSize:t.default.bool,cols:t.default.number,draggableCancel:t.default.string,draggableHandle:t.default.string,verticalCompact:function(o){o.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:r,resizeHandle:a,onLayoutChange:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onDragStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,onResizeStop:t.default.func,onDrop:t.default.func,droppingItem:t.default.shape({i:t.default.string.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired}),children:function(o,u){const y=o[u],p={};e.default.Children.forEach(y,function(C){if((C==null?void 0:C.key)!=null){if(p[C.key])throw new Error('Duplicate child key "'+C.key+'" found! This will cause problems in ReactGridLayout.');p[C.key]=!0}})},innerRef:t.default.any},_e}var Yr;function qn(){if(Yr)return Ze;Yr=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var t=p(V),e=p(Ee()),n=ar(),r=Gn(),a=ze(),o=Jt(),u=Xr(),y=p(Zt());function p(I){return I&&I.__esModule?I:{default:I}}function C(I,S,T){return S=m(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function m(I){var S=w(I,"string");return typeof S=="symbol"?S:String(S)}function w(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}let E=class extends t.default.Component{constructor(){super(...arguments),C(this,"state",{resizing:null,dragging:null,className:""}),C(this,"elementRef",t.default.createRef()),C(this,"onDragStart",(S,T)=>{let{node:h}=T;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const f={top:0,left:0},{offsetParent:b}=h;if(!b)return;const l=b.getBoundingClientRect(),g=h.getBoundingClientRect(),d=g.left/s,v=l.left/s,x=g.top/s,M=l.top/s;f.left=d-v+b.scrollLeft,f.top=x-M+b.scrollTop,this.setState({dragging:f});const{x:z,y:U}=(0,o.calcXY)(this.getPositionParams(),f.top,f.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,U,{e:S,node:h,newPosition:f})}),C(this,"onDrag",(S,T)=>{let{node:h,deltaX:i,deltaY:s}=T;const{onDrag:f}=this.props;if(!f)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let b=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:d,w:v,h:x,containerWidth:M}=this.props,z=this.getPositionParams();if(g){const{offsetParent:q}=h;if(q){const{margin:J,rowHeight:le,containerPadding:ae}=this.props,B=q.clientHeight-(0,o.calcGridItemWHPx)(x,le,J[1]);b=(0,o.clamp)(b-ae[1],0,B);const W=(0,o.calcGridColWidth)(z),ne=M-(0,o.calcGridItemWHPx)(v,W,J[0]);l=(0,o.clamp)(l-ae[0],0,ne)}}const U={top:b,left:l};this.setState({dragging:U});const{containerPadding:O}=this.props,{x:L,y:F}=(0,o.calcXY)(z,b-O[1],l-O[0],v,x);return f.call(this,d,L,F,{e:S,node:h,newPosition:U})}),C(this,"onDragStop",(S,T)=>{let{node:h}=T;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:f,i:b,containerPadding:l}=this.props,{left:g,top:d}=this.state.dragging,v={top:d,left:g};this.setState({dragging:null});const{x,y:M}=(0,o.calcXY)(this.getPositionParams(),d-l[1],g-l[0],s,f);return i.call(this,b,x,M,{e:S,node:h,newPosition:v})}),C(this,"onResizeStop",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStop")),C(this,"onResizeStart",(S,T,h)=>this.onResizeHandler(S,T,h,"onResizeStart")),C(this,"onResize",(S,T,h)=>this.onResizeHandler(S,T,h,"onResize"))}shouldComponentUpdate(S,T){if(this.props.children!==S.children||this.props.droppingPosition!==S.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(S),S.x,S.y,S.w,S.h,T);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==S.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(S){this.moveDroppingItem(S)}moveDroppingItem(S){const{droppingPosition:T}=this.props;if(!T)return;const h=this.elementRef.current;if(!h)return;const i=S.droppingPosition||{left:0,top:0},{dragging:s}=this.state,f=s&&T.left!==i.left||T.top!==i.top;if(!s)this.onDragStart(T.e,{node:h,deltaX:T.left,deltaY:T.top});else if(f){const b=T.left-s.left,l=T.top-s.top;this.onDrag(T.e,{node:h,deltaX:b,deltaY:l})}}getPositionParams(){let S=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:S.cols,containerPadding:S.containerPadding,containerWidth:S.containerWidth,margin:S.margin,maxRows:S.maxRows,rowHeight:S.rowHeight}}createStyle(S){const{usePercentages:T,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(S):(s=(0,a.setTopLeft)(S),T&&(s.left=(0,a.perc)(S.left/h),s.width=(0,a.perc)(S.width/h))),s}mixinDraggable(S,T){return t.default.createElement(n.DraggableCore,{disabled:!T,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},S)}curryResizeHandler(S,T){return(h,i)=>T(h,i,S)}mixinResizable(S,T,h){const{cols:i,minW:s,minH:f,maxW:b,maxH:l,transformScale:g,resizeHandles:d,resizeHandle:v}=this.props,x=this.getPositionParams(),M=(0,o.calcGridItemPosition)(x,0,0,i,0).width,z=(0,o.calcGridItemPosition)(x,0,0,s,f),U=(0,o.calcGridItemPosition)(x,0,0,b,l),O=[z.width,z.height],L=[Math.min(U.width,M),Math.min(U.height,1/0)];return t.default.createElement(r.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:T.width,height:T.height,minConstraints:O,maxConstraints:L,onResizeStop:this.curryResizeHandler(T,this.onResizeStop),onResizeStart:this.curryResizeHandler(T,this.onResizeStart),onResize:this.curryResizeHandler(T,this.onResize),transformScale:g,resizeHandles:d,handle:v},S)}onResizeHandler(S,T,h,i){let{node:s,size:f,handle:b}=T;const l=this.props[i];if(!l)return;const{x:g,y:d,i:v,maxH:x,minH:M,containerWidth:z}=this.props,{minW:U,maxW:O}=this.props;let L=f;s&&(L=(0,a.resizeItemInDirection)(b,h,f,z),this.setState({resizing:i==="onResizeStop"?null:L}));let{w:F,h:q}=(0,o.calcWH)(this.getPositionParams(),L.width,L.height,g,d,b);F=(0,o.clamp)(F,Math.max(U,1),O),q=(0,o.clamp)(q,M,x),l.call(this,v,F,q,{e:S,node:s,size:L,handle:b})}render(){const{x:S,y:T,w:h,h:i,isDraggable:s,isResizable:f,droppingPosition:b,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),S,T,h,i,this.state),d=t.default.Children.only(this.props.children);let v=t.default.cloneElement(d,{ref:this.elementRef,className:(0,y.default)("react-grid-item",d.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!b,cssTransforms:l}),style:{...this.props.style,...d.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,f),v=this.mixinDraggable(v,s),v}};return Ze.default=E,C(E,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minWidth not Number");if(T>I.w||T>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxWidth not Number");if(T<I.w||T<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("minHeight not Number");if(T>I.h||T>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,S){const T=I[S];if(typeof T!="number")return new Error("maxHeight not Number");if(T<I.h||T<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),C(E,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Ze}var Kr;function Zr(){if(Kr)return Ye;Kr=1,Object.defineProperty(Ye,"__esModule",{value:!0}),Ye.default=void 0;var t=C(V),e=Kt(),n=y(Zt()),r=ze(),a=Jt(),o=y(qn()),u=y(Xr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(f){return f?s:i})(h)}function C(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I="react-grid-layout";let S=!1;try{S=/firefox/i.test(navigator.userAgent)}catch{}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,r.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,r.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);if(!v)return;const x={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,r.cloneLayoutItem)(v),oldLayout:d,activeDrag:x}),this.props.onDragStart(d,v,v,null,l,g)}),m(this,"onDrag",(i,s,f,b)=>{let{e:l,node:g}=b;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,allowOverlap:M,preventCollision:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;const O={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i};v=(0,r.moveElement)(v,U,s,f,!0,z,(0,r.compactType)(this.props),x,M),this.props.onDrag(v,d,U,O,l,g),this.setState({layout:M?v:(0,r.compact)(v,(0,r.compactType)(this.props),x),activeDrag:O})}),m(this,"onDragStop",(i,s,f,b)=>{let{e:l,node:g}=b;if(!this.state.activeDrag)return;const{oldDragItem:d}=this.state;let{layout:v}=this.state;const{cols:x,preventCollision:M,allowOverlap:z}=this.props,U=(0,r.getLayoutItem)(v,i);if(!U)return;v=(0,r.moveElement)(v,U,s,f,!0,M,(0,r.compactType)(this.props),x,z);const L=z?v:(0,r.compact)(v,(0,r.compactType)(this.props),x);this.props.onDragStop(L,d,U,null,l,g);const{oldLayout:F}=this.state;this.setState({activeDrag:null,layout:L,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(L,F)}),m(this,"onResizeStart",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d}=this.state,v=(0,r.getLayoutItem)(d,i);v&&(this.setState({oldResizeItem:(0,r.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(d,v,v,null,l,g))}),m(this,"onResize",(i,s,f,b)=>{let{e:l,node:g,size:d,handle:v}=b;const{oldResizeItem:x}=this.state,{layout:M}=this.state,{cols:z,preventCollision:U,allowOverlap:O}=this.props;let L=!1,F,q,J;const[le,ae]=(0,r.withLayoutItem)(M,i,W=>{let ne;return q=W.x,J=W.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(q=W.x+(W.w-s),s=W.x!==q&&q<0?W.w:s,q=q<0?0:q),["ne","n","nw"].indexOf(v)!==-1&&(J=W.y+(W.h-f),f=W.y!==J&&J<0?W.h:f,J=J<0?0:J),L=!0),U&&!O&&(ne=(0,r.getAllCollisions)(M,{...W,w:s,h:f,x:q,y:J}).filter(ue=>ue.i!==W.i).length>0,ne&&(J=W.y,f=W.h,q=W.x,s=W.w,L=!1)),W.w=s,W.h=f,W});if(!ae)return;F=le,L&&(F=(0,r.moveElement)(le,ae,q,J,!0,this.props.preventCollision,(0,r.compactType)(this.props),z,O));const B={w:ae.w,h:ae.h,x:ae.x,y:ae.y,static:!0,i};this.props.onResize(F,x,ae,B,l,g),this.setState({layout:O?F:(0,r.compact)(F,(0,r.compactType)(this.props),z),activeDrag:B})}),m(this,"onResizeStop",(i,s,f,b)=>{let{e:l,node:g}=b;const{layout:d,oldResizeItem:v}=this.state,{cols:x,allowOverlap:M}=this.props,z=(0,r.getLayoutItem)(d,i),U=M?d:(0,r.compact)(d,(0,r.compactType)(this.props),x);this.props.onResizeStop(U,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,O)}),m(this,"onDragOver",i=>{var le;if(i.preventDefault(),i.stopPropagation(),S&&!((le=i.nativeEvent.target)!=null&&le.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:f,margin:b,cols:l,rowHeight:g,maxRows:d,width:v,containerPadding:x,transformScale:M}=this.props,z=f==null?void 0:f(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...z},{layout:O}=this.state,L=i.currentTarget.getBoundingClientRect(),F=i.clientX-L.left,q=i.clientY-L.top,J={left:F/M,top:q/M,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ae,top:B}=this.state.droppingPosition;(ae!=F||B!=q)&&this.setState({droppingPosition:J})}}else{const ae={cols:l,margin:b,maxRows:d,rowHeight:g,containerWidth:v,containerPadding:x||b},B=(0,a.calcXY)(ae,q,F,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:J,layout:[...O,{...U,x:B.x,y:B.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:f}=this.state,b=(0,r.compact)(f.filter(l=>l.i!==i.i),(0,r.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:b,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:f}=this.state,b=f.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(f,b,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let f;return s.activeDrag?null:(!(0,e.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?f=i.layout:(0,r.childrenEqual)(i.children,s.children)||(f=s.layout),f?{layout:(0,r.synchronizeLayoutWithChildren)(f,i.children,i.cols,(0,r.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,r.fastRGLPropsEqual)(this.props,i,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const f=this.state.layout,b=s.layout;this.onLayoutMaybeChanged(f,b)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,r.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,e.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:f,margin:b,containerPadding:l,rowHeight:g,maxRows:d,useCSSTransforms:v,transformScale:x}=this.props;return t.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:f,margin:b,containerPadding:l||b,maxRows:d,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:x},t.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const f=(0,r.getLayoutItem)(this.state.layout,String(i.key));if(!f)return null;const{width:b,cols:l,margin:g,containerPadding:d,rowHeight:v,maxRows:x,isDraggable:M,isResizable:z,isBounded:U,useCSSTransforms:O,transformScale:L,draggableCancel:F,draggableHandle:q,resizeHandles:J,resizeHandle:le}=this.props,{mounted:ae,droppingPosition:B}=this.state,W=typeof f.isDraggable=="boolean"?f.isDraggable:!f.static&&M,ne=typeof f.isResizable=="boolean"?f.isResizable:!f.static&&z,ie=f.resizeHandles||J,ue=W&&U&&f.isBounded!==!1;return t.createElement(o.default,{containerWidth:b,cols:l,margin:g,containerPadding:d||g,maxRows:x,rowHeight:v,cancel:F,handle:q,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:W,isResizable:ne,isBounded:ue,useCSSTransforms:O&&ae,usePercentages:!ae,transformScale:L,w:f.w,h:f.h,x:f.x,y:f.y,i:f.i,minH:f.minH,minW:f.minW,maxH:f.maxH,maxW:f.maxW,static:f.static,droppingPosition:s?B:void 0,resizeHandles:ie,resizeHandle:le},i)}render(){const{className:i,style:s,isDroppable:f,innerRef:b}=this.props,l=(0,n.default)(I,i),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:b,className:l,style:g,onDrop:f?this.onDrop:r.noop,onDragLeave:f?this.onDragLeave:r.noop,onDragEnter:f?this.onDragEnter:r.noop,onDragOver:f?this.onDragOver:r.noop},t.Children.map(this.props.children,d=>this.processGridItem(d)),f&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ye.default=T,m(T,"displayName","ReactGridLayout"),m(T,"propTypes",u.default),m(T,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:r.noop,onDragStart:r.noop,onDrag:r.noop,onDragStop:r.noop,onResizeStart:r.noop,onResize:r.noop,onResizeStop:r.noop,onDrop:r.noop,onDropDragOver:r.noop}),Ye}var nt={},xe={},$r;function Jr(){if($r)return xe;$r=1,Object.defineProperty(xe,"__esModule",{value:!0}),xe.findOrGenerateResponsiveLayout=r,xe.getBreakpointFromWidth=e,xe.getColsFromBreakpoint=n,xe.sortBreakpoints=a;var t=ze();function e(o,u){const y=a(o);let p=y[0];for(let C=1,m=y.length;C<m;C++){const w=y[C];u>o[w]&&(p=w)}return p}function n(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function r(o,u,y,p,C,m){if(o[y])return(0,t.cloneLayout)(o[y]);let w=o[p];const E=a(u),I=E.slice(E.indexOf(y));for(let S=0,T=I.length;S<T;S++){const h=I[S];if(o[h]){w=o[h];break}}return w=(0,t.cloneLayout)(w||[]),(0,t.compact)((0,t.correctBounds)(w,{cols:C}),m,C)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return xe}var Qr;function Xn(){if(Qr)return nt;Qr=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=p(V),e=u(Ee()),n=Kt(),r=ze(),a=Jr(),o=u(Zr());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(f){return f?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(i);if(s&&s.has(h))return s.get(h);var f={__proto__:null},b=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=b?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(f,l,g):f[l]=h[l]}return f.default=h,s&&s.set(h,f),f}function C(){return C=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var f in s)Object.prototype.hasOwnProperty.call(s,f)&&(h[f]=s[f])}return h},C.apply(this,arguments)}function m(h,i,s){return i=w(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function w(h){var i=E(h,"string");return typeof i=="symbol"?i:String(i)}function E(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var f=s.call(h,i);if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function S(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let T=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:f,cols:b}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,b),d=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(f,s,l,l,g,d),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,n.deepEqual)(i.layouts,s.layouts)){const{breakpoint:f,cols:b}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,f,f,b,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,n.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,n.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:f,layouts:b,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),d=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,f),x={...b};if(d!==g||i.breakpoints!==s||i.cols!==f){d in x||(x[d]=(0,r.cloneLayout)(this.state.layout));let U=(0,a.findOrGenerateResponsiveLayout)(x,s,g,d,v,l);U=(0,r.synchronizeLayoutWithChildren)(U,this.props.children,v,l,this.props.allowOverlap),x[g]=U,this.props.onLayoutChange(U,x),this.props.onBreakpointChange(g,v),this.setState({breakpoint:g,layout:U,cols:v})}const M=S(this.props.margin,g),z=S(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,M,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:f,layouts:b,margin:l,containerPadding:g,onBreakpointChange:d,onLayoutChange:v,onWidthChange:x,...M}=this.props;return t.createElement(o.default,C({},M,{margin:S(l,this.state.breakpoint),containerPadding:S(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return nt.default=T,m(T,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,i){if(I(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,r.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(T,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:r.noop,onLayoutChange:r.noop,onWidthChange:r.noop}),nt}var Ct={},en=function(){if(typeof Map<"u")return Map;function t(e,n){var r=-1;return e.some(function(a,o){return a[0]===n?(r=o,!0):!1}),r}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(n){var r=t(this.__entries__,n),a=this.__entries__[r];return a&&a[1]},e.prototype.set=function(n,r){var a=t(this.__entries__,n);~a?this.__entries__[a][1]=r:this.__entries__.push([n,r])},e.prototype.delete=function(n){var r=this.__entries__,a=t(r,n);~a&&r.splice(a,1)},e.prototype.has=function(n){return!!~t(this.__entries__,n)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(n,r){r===void 0&&(r=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];n.call(r,u[1],u[0])}},e}()}(),or=typeof window<"u"&&typeof document<"u"&&window.document===document,Tt=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),Yn=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Tt):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),Kn=2;function Zn(t,e){var n=!1,r=!1,a=0;function o(){n&&(n=!1,t()),r&&y()}function u(){Yn(o)}function y(){var p=Date.now();if(n){if(p-a<Kn)return;r=!0}else n=!0,r=!1,setTimeout(u,e);a=p}return y}var $n=20,Jn=["top","right","bottom","left","width","height","size","weight"],Qn=typeof MutationObserver<"u",ea=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=Zn(this.refresh.bind(this),$n)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var n=this.observers_,r=n.indexOf(e);~r&&n.splice(r,1),!n.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(n){return n.gatherActive(),n.hasActive()});return e.forEach(function(n){return n.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!or||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),Qn?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){!or||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var n=e.propertyName,r=n===void 0?"":n,a=Jn.some(function(o){return!!~r.indexOf(o)});a&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),tn=function(t,e){for(var n=0,r=Object.keys(e);n<r.length;n++){var a=r[n];Object.defineProperty(t,a,{value:e[a],enumerable:!1,writable:!1,configurable:!0})}return t},ke=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Tt},rn=It(0,0,0,0);function wt(t){return parseFloat(t)||0}function nn(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return e.reduce(function(r,a){var o=t["border-"+a+"-width"];return r+wt(o)},0)}function ta(t){for(var e=["top","right","bottom","left"],n={},r=0,a=e;r<a.length;r++){var o=a[r],u=t["padding-"+o];n[o]=wt(u)}return n}function ra(t){var e=t.getBBox();return It(0,0,e.width,e.height)}function na(t){var e=t.clientWidth,n=t.clientHeight;if(!e&&!n)return rn;var r=ke(t).getComputedStyle(t),a=ta(r),o=a.left+a.right,u=a.top+a.bottom,y=wt(r.width),p=wt(r.height);if(r.boxSizing==="border-box"&&(Math.round(y+o)!==e&&(y-=nn(r,"left","right")+o),Math.round(p+u)!==n&&(p-=nn(r,"top","bottom")+u)),!oa(t)){var C=Math.round(y+o)-e,m=Math.round(p+u)-n;Math.abs(C)!==1&&(y-=C),Math.abs(m)!==1&&(p-=m)}return It(a.left,a.top,y,p)}var aa=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ke(t).SVGGraphicsElement}:function(t){return t instanceof ke(t).SVGElement&&typeof t.getBBox=="function"}}();function oa(t){return t===ke(t).document.documentElement}function ia(t){return or?aa(t)?ra(t):na(t):rn}function sa(t){var e=t.x,n=t.y,r=t.width,a=t.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return tn(u,{x:e,y:n,width:r,height:a,top:n,right:e+r,bottom:a+n,left:e}),u}function It(t,e,n,r){return{x:t,y:e,width:n,height:r}}var la=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=It(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=ia(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},t.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e},t}(),ca=function(){function t(e,n){var r=sa(n);tn(this,{target:e,contentRect:r})}return t}(),ua=function(){function t(e,n,r){if(this.activeObservations_=[],this.observations_=new en,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)||(n.set(e,new la(e)),this.controller_.addObserver(this),this.controller_.refresh())}},t.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ke(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var n=this.observations_;n.has(e)&&(n.delete(e),n.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(n){n.isActive()&&e.activeObservations_.push(n)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,n=this.activeObservations_.map(function(r){return new ca(r.target,r.broadcastRect())});this.callback_.call(e,n,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),an=typeof WeakMap<"u"?new WeakMap:new en,on=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=ea.getInstance(),r=new ua(e,n,this);an.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){on.prototype[t]=function(){var e;return(e=an.get(this))[t].apply(e,arguments)}});var da=function(){return typeof Tt.ResizeObserver<"u"?Tt.ResizeObserver:on}();const fa=yr(Object.freeze(Object.defineProperty({__proto__:null,default:da},Symbol.toStringTag,{value:"Module"})));var sn;function pa(){if(sn)return Ct;sn=1,Object.defineProperty(Ct,"__esModule",{value:!0}),Ct.default=E;var t=u(V),e=a(Ee()),n=a(fa),r=a(Zt());function a(I){return I&&I.__esModule?I:{default:I}}function o(I){if(typeof WeakMap!="function")return null;var S=new WeakMap,T=new WeakMap;return(o=function(h){return h?T:S})(I)}function u(I,S){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var T=o(S);if(T&&T.has(I))return T.get(I);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var f=i?Object.getOwnPropertyDescriptor(I,s):null;f&&(f.get||f.set)?Object.defineProperty(h,s,f):h[s]=I[s]}return h.default=I,T&&T.set(I,h),h}function y(){return y=Object.assign?Object.assign.bind():function(I){for(var S=1;S<arguments.length;S++){var T=arguments[S];for(var h in T)Object.prototype.hasOwnProperty.call(T,h)&&(I[h]=T[h])}return I},y.apply(this,arguments)}function p(I,S,T){return S=C(S),S in I?Object.defineProperty(I,S,{value:T,enumerable:!0,configurable:!0,writable:!0}):I[S]=T,I}function C(I){var S=m(I,"string");return typeof S=="symbol"?S:String(S)}function m(I,S){if(typeof I!="object"||I===null)return I;var T=I[Symbol.toPrimitive];if(T!==void 0){var h=T.call(I,S);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(S==="string"?String:Number)(I)}const w="react-grid-layout";function E(I){var S;return S=class extends t.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",t.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new n.default(i=>{if(this.elementRef.current instanceof HTMLElement){const f=i[0].contentRect.width;this.setState({width:f})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,r.default)(this.props.className,w),style:this.props.style,ref:this.elementRef}):t.createElement(I,y({innerRef:this.elementRef},i,this.state))}},p(S,"defaultProps",{measureBeforeMount:!1}),p(S,"propTypes",{measureBeforeMount:e.default.bool}),S}return Ct}var ln;function ha(){return ln||(ln=1,function(t){t.exports=Zr().default,t.exports.utils=ze(),t.exports.calculateUtils=Jt(),t.exports.Responsive=Xn().default,t.exports.Responsive.utils=Jr(),t.exports.WidthProvider=pa().default}(Yt)),Yt.exports}var ga=ha();const va=Ln(ga);var ma=Object.getOwnPropertyDescriptor,ya=(t,e,n,r)=>{for(var a=r>1?void 0:r?ma(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ba=(t,e)=>(n,r)=>e(n,r,t);let Ae=class extends _.Disposable{constructor(e){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",e=>{const n=/\{([^}]+)?\}/g,r=[];let a=n.exec(e);for(;a;)r.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=n.exec(e);return r});this._localeService=e,this._initLocal()}tWithReactNode(e,...n){const r=this._localeService.getLocales(),a=e.split("."),o=r&&this._localeService.resolveKeyPath(r,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,C)=>{const m=C[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const w=o.slice(m.endIndex+1,y.startIndex);w&&u.push(w)}if(n[y.key]&&u.push(n[y.key]),p===C.length-1){const w=o.slice(y.endIndex+1);w&&u.push(w)}}),u}return[]}};Ae=ya([ba(0,_.Inject(_.LocaleService))],Ae);const _t={cfPreview:"univer-cf-preview"},We=t=>{var a,o;const e=t.rule;if(!e)return null;const n=V.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const u=e.config.map((C,m)=>({color:new _.ColorKit(C.color),value:m})),y=u.length-1;return new Array(5).fill("").map((C,m,w)=>m*y/(w.length-1)).map(C=>c.getColorScaleFromValue(u,C))}return null},[e]),r=V.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:u}=e.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,C=u?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return R.jsxs("div",{className:_t.cfPreview,children:[R.jsx("div",{style:{...y,background:C,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),R.jsx("div",{style:{...y,background:p,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return n&&R.jsx("div",{className:_t.cfPreview,children:n.map((u,y)=>R.jsx("div",{style:{width:`${100/n.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return r&&R.jsx("div",{className:_t.cfPreview,children:r.map((u,y)=>u?R.jsx("img",{style:{height:"100%"},src:u},y):R.jsx(Xe,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:C,bg:m,cl:w}=e.style,E=(u==null?void 0:u.s)===_.BooleanNumber.TRUE,I=(y==null?void 0:y.s)===_.BooleanNumber.TRUE,S=p===_.BooleanNumber.TRUE,T=C===_.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=w==null?void 0:w.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:T?"bold":void 0,fontStyle:S?"italic":void 0,textDecoration:`${E?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return R.jsx("div",{style:s,className:_t.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap"},Sa=(t,e)=>{const n=t.rule;switch(n.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(n.subType){case c.CFSubRuleType.average:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,...Array.isArray(n.value)?n.value.map(a=>String(a)):[String(n.value||"")])}case c.CFSubRuleType.text:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`,n.value||"")}case c.CFSubRuleType.timePeriod:{const r=n.operator;return e.t(`sheet.cf.preview.describe.${r}`)}case c.CFSubRuleType.rank:return n.isPercent?n.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(n.value)):e.t("sheet.cf.preview.describe.topNPercent",String(n.value)):n.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(n.value)):e.t("sheet.cf.preview.describe.topN",String(n.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let cn=0;const Ca=t=>{const{onClick:e}=t,n=te.useDependency(c.ConditionalFormattingRuleModel),r=te.useDependency(_.IUniverInstanceService),a=te.useDependency(Y.SheetsSelectionsService),o=te.useDependency(_.ICommandService),u=te.useDependency(_.LocaleService),y=te.useDependency(_.Injector),p=te.useDependency(Ae),C=te.useObservable(()=>r.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=C.getUnitId(),w=C.getActiveSheet();if(!w)throw new Error("No active sheet found");const E=w.getSheetId(),[I,S]=V.useState([]),[T,h]=V.useState("2"),[i,s]=V.useState(0),[f,b]=V.useState(-1),[l,g]=V.useState(cn),d=V.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],x=()=>{const B=n.getSubunitRules(m,E);if(!B||!B.length)return[];if(T==="1"){const W=a.getCurrentLastSelection();if(!W)return[];const ne=W.range;return B.filter(ue=>ue.ranges.some(ge=>_.Rectangle.intersects(ge,ne)))}else if(T==="2")return[...B];return[]},[M,z]=V.useState(x);fe.useHighlightRange(I),V.useEffect(()=>{const B=o.onCommandExecuted(W=>{W.id===Y.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>B.dispose()}),V.useEffect(()=>{z(x)},[T,i,m,E]),V.useEffect(()=>{if(T==="2")return;const B=new Ce.Observable(W=>{const ne=[Y.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ie=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();ne.includes(ge)&&ye.unitId===Te&&W.next(null)});return()=>ie.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(x)});return()=>{B.unsubscribe()}},[r,T,m,E]),V.useEffect(()=>{const B=n.$ruleChange.subscribe(()=>{s(Math.random())});return()=>B.unsubscribe()},[n]),V.useEffect(()=>{const B=()=>{var ue;const ie=Math.max(0,(((ue=d.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return cn=ie,ie},ne=new Ce.Observable(ie=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{ie.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=j=>{j.propertyName==="width"&&(ye(),ie.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(B())});return()=>{ne.unsubscribe()}},[]);const U=B=>{var ie;const W=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ne=(ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:ie.getSheetId();if(!W||!ne)throw new Error("No active sheet found");o.executeCommand(c.DeleteCfCommand.id,{unitId:W,subUnitId:ne,cfId:B.cfId})},O=(B,W)=>{b(W.y)},L=(B,W,ne)=>{var j;b(-1);const ie=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(j=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:j.getSheetId();if(!ie||!ue)throw new Error("No active sheet found");const ge=Q=>{const se=M.length;return Math.min(se-1,Math.max(0,Q))},ye=M[ge(W.y)].cfId,Te=M[ge(ne.y)].cfId;ye!==Te&&o.executeCommand(c.MoveCfCommand.id,{unitId:ie,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:ne.y>W.y?"after":"before"}})},F=()=>{t.onCreate()},q=()=>{T==="2"?o.executeCommand(c.ClearWorksheetCfCommand.id):T==="1"&&M.map(W=>({unitId:m,subUnitId:E,cfId:W.cfId})).forEach(W=>{o.executeCommand(c.DeleteCfCommand.id,W)})},J=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.filter(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]),le=J.map((B,W)=>({i:B.cfId,x:0,w:12,y:W,h:1,isResizable:!1})),ae=V.useMemo(()=>{const B=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),W=B.getActiveSheet();return M.every(ne=>{const ie=ne.ranges;return Y.checkRangesEditablePermission(y,B.getUnitId(),W.getSheetId(),ie)})},[M]);return R.jsxs("div",{className:he.cfRuleList,children:[R.jsxs("div",{className:he.ruleSelector,children:[R.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",R.jsx(ee.Select,{className:he.select,options:v,value:T,onChange:B=>{h(B)}})).map((B,W)=>R.jsx("span",{children:B},W))}),R.jsxs("div",{className:he.btnList,children:[R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:R.jsx("div",{className:`
13
- ${he.icon}
14
- `,onClick:F,children:R.jsx(vr,{})})}),M.length&&ae?R.jsx(ee.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:R.jsx("div",{className:`
15
- ${he.gap}
16
- ${he.icon}
17
- `,onClick:q,children:R.jsx(gt,{})})}):R.jsx("div",{className:`
18
- ${he.gap}
19
- ${he.disabled}
20
- `,children:R.jsx(gt,{})})]})]}),R.jsx("div",{ref:d,className:he.gridLayoutWrap,children:l?R.jsx(va,{onDragStop:L,onDragStart:O,layout:le,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:J==null?void 0:J.map((B,W)=>R.jsx("div",{children:R.jsxs("div",{onMouseMove:()=>{B.ranges!==I&&S(B.ranges)},onMouseLeave:()=>S([]),onClick:()=>{e(B)},className:`
21
- ${he.ruleItem}
22
- ${f===W?he.active:""}
23
- `,children:[R.jsx("div",{className:`
24
- ${he.draggableHandle}
25
- draggableHandle
26
- `,onClick:ne=>ne.stopPropagation(),children:R.jsx(mr,{})}),R.jsxs("div",{className:he.ruleDescribe,children:[R.jsx("div",{className:he.ruleType,children:Sa(B,u)}),R.jsx("div",{className:he.ruleRange,children:B.ranges.map(ne=>kt.serializeRange(ne)).join(",")})]}),R.jsx("div",{className:he.preview,children:R.jsx(We,{rule:B.rule})}),R.jsx("div",{className:`
27
- ${he.deleteItem}
28
- ${f===W?he.active:""}
29
- `,onClick:ne=>{ne.stopPropagation(),U(B),S([])},children:R.jsx(gt,{})})]})},`${B.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=te.useDependency(te.ComponentManager),p=V.useMemo(()=>new _.ColorKit(e),[e]),C=y.get(a);return C&&(r?R.jsx(C,{className:o,extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}):R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(ee.ColorPicker,{value:e,onChange:n})}),children:R.jsxs("span",{className:`
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:`
30
13
  ${un.cfColorPickerIcon}
31
14
  ${o}
32
- `,children:[R.jsx(C,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&R.jsx(vt,{className:un.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfErrorText:"univer-cf-error-text",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),ir=t=>{var S;const{type:e,className:n,onChange:r,id:a,value:o}=t,u=te.useDependency(_.IUniverInstanceService),y=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(S=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),C=V.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=V.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(e)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),w=V.useRef({}),[E,I]=V.useState(!1);return te.useSidebarClick(T=>{var i;const h=(i=w.current)==null?void 0:i.handleOutClick;h&&h(T,()=>I(!1))}),e===c.CFValueType.formula?R.jsx("div",{style:{width:"100%",marginLeft:4},children:R.jsx(Ge.FormulaEditor,{initValue:C,unitId:y,subUnitId:p,isFocus:E,onChange:(T="")=>{r(T||"")},onFocus:()=>I(!0),actions:w.current})}):R.jsx(ee.InputNumber,{className:n,value:Number(t.value)||0,onChange:T=>t.onChange(T||0),...m})},Ta=t=>{var U;const{interceptorManager:e}=t,n=te.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,n),Ne(c.CFValueType.percent,n),Ne(c.CFValueType.percentile,n),Ne(c.CFValueType.formula,n)],o=[Ne(c.CFValueType.min,n),...a],u=[Ne("none",n),...a],y=[Ne(c.CFValueType.max,n),...a],[p,C]=V.useState(()=>{var L;const O=c.CFValueType.min;return r&&((L=r.config[0])==null?void 0:L.value.type)||O}),[m,w]=V.useState(()=>{var L;const O="none";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.value.type)||O}),[E,I]=V.useState(()=>{var L;const O=c.CFValueType.max;return r&&((L=r.config[r.config.length-1])==null?void 0:L.value.type)||O}),[S,T]=V.useState(()=>{if(!r)return 10;const L=r.config[0];return(L==null?void 0:L.value.value)===void 0?10:L==null?void 0:L.value.value}),[h,i]=V.useState(()=>{var F;if(!r||r.config.length!==3)return 50;const L=(F=r.config[1])==null?void 0:F.value.value;return L===void 0?50:L}),[s,f]=V.useState(()=>{var F;if(!r)return 90;const L=(F=r.config[r.config.length-1])==null?void 0:F.value.value;return L===void 0?90:L}),[b,l]=V.useState(()=>{var L;const O="#d0d9fb";return r&&((L=r.config[0])==null?void 0:L.color)||O}),[g,d]=V.useState(()=>{var L;const O="#7790f3";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.color)||O}),[v,x]=V.useState(()=>{var L;const O="#2e55ef";return r&&((L=r.config[r.config.length-1])==null?void 0:L.color)||O}),M=V.useMemo(()=>O=>{const{minType:L,medianType:F,maxType:q,minValue:J,medianValue:le,maxValue:ae,minColor:B,medianColor:W,maxColor:ne}=O,ie=[];return ie.push({color:B,value:{type:L,value:J}}),F!=="none"&&ie.push({color:W,value:{type:F,value:le}}),ie.push({color:ne,value:{type:q,value:ae}}),{config:ie.map((ge,ye)=>({...ge,index:ye})),type:c.CFRuleType.colorScale}},[]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),[M,p,m,E,S,h,s,b,g,v,e]);const z=O=>{t.onChange(M(O))};return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
33
- ${G.cfPreviewWrap}
34
- `,children:R.jsx(We,{rule:M({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})})}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:ee.clsx(`
15
+ `,children:[R.jsx(C,{extend:{colorChannel1:p.isValid?e:"rgb(var(--primary-color))"}}),u&&R.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=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),ir=t=>{var S;const{type:e,className:n,onChange:r,id:a,value:o}=t,u=Q.useDependency(_.IUniverInstanceService),y=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(S=u.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:S.getSheetId(),C=V.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=V.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(e)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(e)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[e]),T=V.useRef({}),[E,w]=V.useState(!1);return Q.useSidebarClick(I=>{var i;const h=(i=T.current)==null?void 0:i.handleOutClick;h&&h(I,()=>w(!1))}),e===c.CFValueType.formula?R.jsx("div",{style:{width:"100%",marginLeft:4},children:R.jsx(Ge.FormulaEditor,{initValue:C,unitId:y,subUnitId:p,isFocus:E,onChange:(I="")=>{r(I||"")},onFocus:()=>w(!0),actions:T.current})}):R.jsx(Z.InputNumber,{className:n,value:Number(t.value)||0,onChange:I=>t.onChange(I||0),...m})},Ta=t=>{var z;const{interceptorManager:e}=t,n=Q.useDependency(_.LocaleService),r=((z=t.rule)==null?void 0:z.type)===c.CFRuleType.colorScale?t.rule:void 0,a=[Ne(c.CFValueType.num,n),Ne(c.CFValueType.percent,n),Ne(c.CFValueType.percentile,n),Ne(c.CFValueType.formula,n)],o=[Ne(c.CFValueType.min,n),...a],u=[Ne("none",n),...a],y=[Ne(c.CFValueType.max,n),...a],[p,C]=V.useState(()=>{var L;const O=c.CFValueType.min;return r&&((L=r.config[0])==null?void 0:L.value.type)||O}),[m,T]=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,w]=V.useState(()=>{var L;const O=c.CFValueType.max;return r&&((L=r.config[r.config.length-1])==null?void 0:L.value.type)||O}),[S,I]=V.useState(()=>{if(!r)return 10;const L=r.config[0];return(L==null?void 0:L.value.value)===void 0?10:L==null?void 0:L.value.value}),[h,i]=V.useState(()=>{var B;if(!r||r.config.length!==3)return 50;const L=(B=r.config[1])==null?void 0:B.value.value;return L===void 0?50:L}),[s,f]=V.useState(()=>{var B;if(!r)return 90;const L=(B=r.config[r.config.length-1])==null?void 0:B.value.value;return L===void 0?90:L}),[b,l]=V.useState(()=>{var L;const O="#d0d9fb";return r&&((L=r.config[0])==null?void 0:L.color)||O}),[g,d]=V.useState(()=>{var L;const O="#7790f3";return!r||r.config.length!==3?O:((L=r.config[1])==null?void 0:L.color)||O}),[v,D]=V.useState(()=>{var L;const O="#2e55ef";return r&&((L=r.config[r.config.length-1])==null?void 0:L.color)||O}),N=V.useMemo(()=>O=>{const{minType:L,medianType:B,maxType:G,minValue:ee,medianValue:ie,maxValue:oe,minColor:ce,medianColor:W,maxColor:te}=O,ne=[];return ne.push({color:ce,value:{type:L,value:ee}}),B!=="none"&&ne.push({color:W,value:{type:B,value:ie}}),ne.push({color:te,value:{type:G,value:oe}}),{config:ne.map((fe,ve)=>({...fe,index:ve})),type:c.CFRuleType.colorScale}},[]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return N({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),[N,p,m,E,S,h,s,b,g,v,e]);const U=O=>{t.onChange(N(O))};return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
16
+ ${F.cfPreviewWrap}
17
+ `,children:R.jsx(We,{rule:N({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})})}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:Z.clsx(`
35
18
  ${A.labelContainer}
36
19
  ${A.mTSm}
37
- `,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{C(O);const L=c.createDefaultValueByValueType(O,10);T(L),z({minType:O,medianType:m,maxType:E,minValue:L,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"min",className:`
20
+ `,"univer-box-border univer-h-7"),children:[R.jsx(Z.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{C(O);const L=c.createDefaultValueByValueType(O,10);I(L),U({minType:O,medianType:m,maxType:E,minValue:L,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"min",className:`
38
21
  ${A.mLXxs}
39
- `,value:S,type:p,onChange:O=>{T(O),z({minType:p,medianType:m,maxType:E,minValue:O,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:b,onChange:O=>{l(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.medianValue")}),R.jsxs("div",{className:ee.clsx(`
22
+ `,value:S,type:p,onChange:O=>{I(O),U({minType:p,medianType:m,maxType:E,minValue:O,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:b,onChange:O=>{l(O),U({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.medianValue")}),R.jsxs("div",{className:Z.clsx(`
40
23
  ${A.labelContainer}
41
24
  ${A.mTSm}
42
- `,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:u,value:m,onChange:O=>{w(O);const L=c.createDefaultValueByValueType(O,50);i(L),z({minType:p,medianType:O,maxType:E,minValue:S,medianValue:L,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"median",className:`
25
+ `,"univer-box-border univer-h-7"),children:[R.jsx(Z.Select,{style:{flexShrink:0},options:u,value:m,onChange:O=>{T(O);const L=c.createDefaultValueByValueType(O,50);i(L),U({minType:p,medianType:O,maxType:E,minValue:S,medianValue:L,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"median",className:`
43
26
  ${A.mLXxs}
44
- `,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:O,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),m!=="none"&&R.jsx(Me,{className:A.mLXxs,color:g,onChange:O=>{d(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:O,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:ee.clsx(`
27
+ `,value:h,type:m,onChange:O=>{i(O),U({minType:p,medianType:m,maxType:E,minValue:S,medianValue:O,maxValue:s,minColor:b,medianColor:g,maxColor:v})}}),m!=="none"&&R.jsx(Me,{className:A.mLXxs,color:g,onChange:O=>{d(O),U({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:O,maxColor:v})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:Z.clsx(`
45
28
  ${A.labelContainer}
46
29
  ${A.mTSm}
47
- `,"univer-box-border univer-h-7"),children:[R.jsx(ee.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{I(O);const L=c.createDefaultValueByValueType(O,90);f(L),z({minType:p,medianType:m,maxType:O,minValue:S,medianValue:h,maxValue:L,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"max",className:`
30
+ `,"univer-box-border univer-h-7"),children:[R.jsx(Z.Select,{style:{flexShrink:0},options:y,value:E,onChange:O=>{w(O);const L=c.createDefaultValueByValueType(O,90);f(L),U({minType:p,medianType:m,maxType:O,minValue:S,medianValue:h,maxValue:L,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(ir,{id:"max",className:`
48
31
  ${A.mLXxs}
49
- `,value:s,type:E,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{x(O),z({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),dn=t=>{var T;const{onChange:e,className:n,value:r,type:a,id:o,disabled:u=!1}=t,y=te.useDependency(_.IUniverInstanceService),p=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),C=(T=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:T.getSheetId(),m=V.useRef({}),[w,E]=V.useState(!1);te.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>E(!1))});const I=V.useRef(r),S=V.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===c.CFValueType.formula){const h=String(I.current).startsWith("=")?String(I.current)||"":"=";return R.jsx("div",{style:{width:"100%",marginLeft:12},children:R.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:C,isFocus:w,onChange:(i="")=>{e(i||"")},onFocus:()=>E(!0),actions:m.current})})}return R.jsx(ee.InputNumber,{className:n,value:Number(r)||0,disabled:u,onChange:h=>{e(h||0)},...S})},wa=t=>{var U;const{interceptorManager:e}=t,n=te.useDependency(_.LocaleService),r=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=V.useState(()=>{var L;const O="0";return r?(L=r.config)!=null&&L.isGradient?"1":"0":O}),[u,y]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,C]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,n),je(c.CFValueType.percent,n),je(c.CFValueType.percentile,n),je(c.CFValueType.formula,n)],w=[je(c.CFValueType.min,n),...m],E=[je(c.CFValueType.max,n),...m],[I,S]=V.useState(()=>{var L;const O=w[0].value;return r&&((L=r.config)==null?void 0:L.min.type)||O}),[T,h]=V.useState(()=>{var L;const O=E[0].value;return r&&((L=r.config)==null?void 0:L.max.type)||O}),[i,s]=V.useState(()=>{var F;if(!r)return 0;const L=((F=r.config)==null?void 0:F.min)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value||0}),[f,b]=V.useState(()=>{var F;if(!r)return 100;const L=((F=r.config)==null?void 0:F.max)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value===void 0?100:L.value}),[l,g]=V.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),d=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||c.defaultDataBarPositiveColor,nativeColor:O.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:O.isShowValue});V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,I,f,T,u,p,e,l]);const v=O=>{t.onChange(d(O))},x=O=>{y(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:O,nativeColor:p,isShowValue:l})},M=O=>{C(O),v({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>m.map(L=>L.value).includes(O);return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
50
- ${G.cfPreviewWrap}
51
- `,children:R.jsx(We,{rule:d({isGradient:a,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})})}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.fillType")}),R.jsxs("div",{className:`
32
+ `,value:s,type:E,onChange:O=>{f(O),U({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:O,minColor:b,medianColor:g,maxColor:v})}}),R.jsx(Me,{className:A.mLXxs,color:v,onChange:O=>{D(O),U({minType:p,medianType:m,maxType:E,minValue:S,medianValue:h,maxValue:s,minColor:b,medianColor:g,maxColor:O})}})]})]})},je=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),dn=t=>{var I;const{onChange:e,className:n,value:r,type:a,id:o,disabled:u=!1}=t,y=Q.useDependency(_.IUniverInstanceService),p=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),C=(I=y.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId(),m=V.useRef({}),[T,E]=V.useState(!1);Q.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>E(!1))});const w=V.useRef(r),S=V.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===c.CFValueType.formula){const h=String(w.current).startsWith("=")?String(w.current)||"":"=";return R.jsx("div",{style:{width:"100%",marginLeft:12},children:R.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:C,isFocus:T,onChange:(i="")=>{e(i||"")},onFocus:()=>E(!0),actions:m.current})})}return R.jsx(Z.InputNumber,{className:n,value:Number(r)||0,disabled:u,onChange:h=>{e(h||0)},...S})},wa=t=>{var z;const{interceptorManager:e}=t,n=Q.useDependency(_.LocaleService),r=((z=t.rule)==null?void 0:z.type)===c.CFRuleType.dataBar?t.rule:void 0,[a,o]=V.useState(()=>{var L;const O="0";return r?(L=r.config)!=null&&L.isGradient?"1":"0":O}),[u,y]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,C]=V.useState(()=>{var O;return r&&((O=r.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,n),je(c.CFValueType.percent,n),je(c.CFValueType.percentile,n),je(c.CFValueType.formula,n)],T=[je(c.CFValueType.min,n),...m],E=[je(c.CFValueType.max,n),...m],[w,S]=V.useState(()=>{var L;const O=T[0].value;return r&&((L=r.config)==null?void 0:L.min.type)||O}),[I,h]=V.useState(()=>{var L;const O=E[0].value;return r&&((L=r.config)==null?void 0:L.max.type)||O}),[i,s]=V.useState(()=>{var B;if(!r)return 0;const L=((B=r.config)==null?void 0:B.min)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value||0}),[f,b]=V.useState(()=>{var B;if(!r)return 100;const L=((B=r.config)==null?void 0:B.max)||{};return L.type===c.CFValueType.formula?L.value||"=":L.value===void 0?100:L.value}),[l,g]=V.useState(()=>r?r.isShowValue===void 0?!0:!!r.isShowValue:!0),d=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||c.defaultDataBarPositiveColor,nativeColor:O.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:O.isShowValue});V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return d({isGradient:a,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,w,f,I,u,p,e,l]);const v=O=>{t.onChange(d(O))},D=O=>{y(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:O,nativeColor:p,isShowValue:l})},N=O=>{C(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:O,isShowValue:l})},U=O=>m.map(L=>L.value).includes(O);return R.jsxs("div",{children:[R.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
33
+ ${F.cfPreviewWrap}
34
+ `,children:R.jsx(We,{rule:d({isGradient:a,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})})}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.fillType")}),R.jsxs("div",{className:`
52
35
  ${A.mTSm}
53
36
  ${A.mLXxs}
54
37
  ${A.labelContainer}
55
- `,children:[R.jsxs(ee.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})},children:[R.jsx(ee.Radio,{value:"0",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.pureColor")})}),R.jsx(ee.Radio,{value:"1",children:R.jsx("span",{className:G.text,children:n.t("sheet.cf.panel.gradient")})})]}),R.jsxs("div",{className:`
56
- ${G.utilItem}
38
+ `,children:[R.jsxs(Z.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})},children:[R.jsx(Z.Radio,{value:"0",children:R.jsx("span",{className:F.text,children:n.t("sheet.cf.panel.pureColor")})}),R.jsx(Z.Radio,{value:"1",children:R.jsx("span",{className:F.text,children:n.t("sheet.cf.panel.gradient")})})]}),R.jsxs("div",{className:`
39
+ ${F.utilItem}
57
40
  ${A.mLXl}
58
- `,children:[R.jsx(ee.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),R.jsxs("div",{className:`
41
+ `,children:[R.jsx(Z.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:!O})}}),n.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.panel.colorSet")}),R.jsxs("div",{className:`
59
42
  ${A.labelContainer}
60
43
  ${A.mTSm}
61
44
  ${A.mLXxs}
62
45
  `,children:[R.jsxs("div",{className:`
63
46
  ${A.labelContainer}
64
47
  `,children:[R.jsx("div",{className:`
65
- ${G.text}
66
- `,children:n.t("sheet.cf.panel.native")}),R.jsx(Me,{color:p,onChange:M})]}),R.jsxs("div",{className:`
48
+ ${F.text}
49
+ `,children:n.t("sheet.cf.panel.native")}),R.jsx(Me,{color:p,onChange:N})]}),R.jsxs("div",{className:`
67
50
  ${A.labelContainer}
68
51
  ${A.mLSm}
69
52
  `,children:[R.jsx("div",{className:`
70
- ${G.text}
71
- `,children:n.t("sheet.cf.panel.positive")}),R.jsx(Me,{color:u,onChange:x})]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:`
53
+ ${F.text}
54
+ `,children:n.t("sheet.cf.panel.positive")}),R.jsx(Me,{color:u,onChange:D})]})]})]}),R.jsxs("div",{children:[R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.min")}),R.jsxs("div",{className:`
72
55
  ${A.mTSm}
73
56
  ${A.labelContainer}
74
- `,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:w,value:I,onChange:O=>{S(O);const L=c.createDefaultValueByValueType(O,10);s(L),v({isGradient:a,minValue:L,minValueType:O,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(I),id:"min",type:I,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:I,maxValue:f,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:`
57
+ `,children:[R.jsx(Z.Select,{style:{width:"50%",flexShrink:0},options:T,value:w,onChange:O=>{S(O);const L=c.createDefaultValueByValueType(O,10);s(L),v({isGradient:a,minValue:L,minValueType:O,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!U(w),id:"min",type:w,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:w,maxValue:f,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),R.jsx("div",{className:A.label,children:n.t("sheet.cf.valueType.max")}),R.jsxs("div",{className:`
75
58
  ${A.mTSm}
76
59
  ${A.labelContainer}
77
- `,children:[R.jsx(ee.Select,{style:{width:"50%",flexShrink:0},options:E,value:T,onChange:O=>{h(O);const L=c.createDefaultValueByValueType(O,90);b(L),v({isGradient:a,minValue:i,minValueType:I,maxValue:L,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!z(T),id:"max",type:T,className:A.mLSm,value:f,onChange:O=>{b(O||0),v({isGradient:a,minValue:i,minValueType:I,maxValue:O||0,maxValueType:T,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})},Re={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Rt=t=>[_.BooleanNumber.FALSE,void 0].includes(t)?_.BooleanNumber.TRUE:_.BooleanNumber.FALSE,Et=t=>t!==_.BooleanNumber.FALSE,sr=t=>{const{style:e,onChange:n,className:r}=t,a=te.useDependency(te.ComponentManager),[o,u]=V.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=V.useState(()=>{if(e!=null&&e.it)return e.it}),[C,m]=V.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[w,E]=V.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,S]=V.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[T,h]=V.useState(()=>{var g;const l="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),f=a.get("UnderlineSingle"),b=a.get("StrikethroughSingle");return V.useEffect(()=>{const l={bl:o,it:y};I!==void 0&&(l.cl={rgb:I}),T!==void 0&&(l.bg={rgb:T}),w!==void 0&&(l.st={s:w}),C!==void 0&&(l.ul={s:C}),n(c.removeUndefinedAttr(l))},[o,y,C,w,I,T]),R.jsxs("div",{className:ee.clsx(Re.cfStyleEdit,r),children:[i&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(o||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>u(Rt(o)),children:R.jsx(i,{})}),s&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(y||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>p(Rt(y)),children:R.jsx(s,{})}),f&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(C||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>m(Rt(C)),children:R.jsx(f,{})}),b&&R.jsx("div",{className:ee.clsx({[Re.isActive]:Et(w||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>E(Rt(w)),children:R.jsx(b,{})}),R.jsx(Me,{color:I,onChange:S,iconId:"FontColor"}),R.jsx(Me,{color:T,onChange:h,iconId:"PaintBucket"})]})},Ia=t=>{var b;const{onChange:e,interceptorManager:n}=t,r=te.useDependency(_.LocaleService),o=te.useDependency(_.IUniverInstanceService).getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=V.useRef(null),[C,m]=V.useState(!1),w=V.useRef({}),[E,I]=V.useState({}),[S,T]=V.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=V.useState(void 0),s=l=>({style:l.style,value:S,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,S,n]),V.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(g,d,v)=>h||S.length===1||!S.startsWith("=")?(i(r.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,S]);const f=l=>{e(s(l))};return te.useSidebarClick(l=>{var d;const g=(d=w.current)==null?void 0:d.handleOutClick;g&&g(l,()=>m(!1))}),R.jsxs("div",{ref:p,children:[R.jsx("div",{className:`
60
+ `,children:[R.jsx(Z.Select,{style:{width:"50%",flexShrink:0},options:E,value:I,onChange:O=>{h(O);const L=c.createDefaultValueByValueType(O,90);b(L),v({isGradient:a,minValue:i,minValueType:w,maxValue:L,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),R.jsx(dn,{disabled:!U(I),id:"max",type:I,className:A.mLSm,value:f,onChange:O=>{b(O||0),v({isGradient:a,minValue:i,minValueType:w,maxValue:O||0,maxValueType:I,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})},Re={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Rt=t=>[_.BooleanNumber.FALSE,void 0].includes(t)?_.BooleanNumber.TRUE:_.BooleanNumber.FALSE,Et=t=>t!==_.BooleanNumber.FALSE,sr=t=>{const{style:e,onChange:n,className:r}=t,a=Q.useDependency(Q.ComponentManager),[o,u]=V.useState(()=>{if(e!=null&&e.bl)return e.bl}),[y,p]=V.useState(()=>{if(e!=null&&e.it)return e.it}),[C,m]=V.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[T,E]=V.useState(()=>{if(e!=null&&e.st)return e.st.s}),[w,S]=V.useState(()=>{var g;const l="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:l}),[I,h]=V.useState(()=>{var g;const l="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),f=a.get("UnderlineSingle"),b=a.get("StrikethroughSingle");return V.useEffect(()=>{const l={bl:o,it:y};w!==void 0&&(l.cl={rgb:w}),I!==void 0&&(l.bg={rgb:I}),T!==void 0&&(l.st={s:T}),C!==void 0&&(l.ul={s:C}),n(c.removeUndefinedAttr(l))},[o,y,C,T,w,I]),R.jsxs("div",{className:Z.clsx(Re.cfStyleEdit,r),children:[i&&R.jsx("div",{className:Z.clsx({[Re.isActive]:Et(o||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>u(Rt(o)),children:R.jsx(i,{})}),s&&R.jsx("div",{className:Z.clsx({[Re.isActive]:Et(y||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>p(Rt(y)),children:R.jsx(s,{})}),f&&R.jsx("div",{className:Z.clsx({[Re.isActive]:Et(C||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>m(Rt(C)),children:R.jsx(f,{})}),b&&R.jsx("div",{className:Z.clsx({[Re.isActive]:Et(T||_.BooleanNumber.FALSE)},Re.buttonItem),onClick:()=>E(Rt(T)),children:R.jsx(b,{})}),R.jsx(Me,{color:w,onChange:S,iconId:"FontColor"}),R.jsx(Me,{color:I,onChange:h,iconId:"PaintBucket"})]})},Ia=t=>{var b;const{onChange:e,interceptorManager:n}=t,r=Q.useDependency(_.LocaleService),o=Q.useDependency(_.IUniverInstanceService).getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,p=V.useRef(null),[C,m]=V.useState(!1),T=V.useRef({}),[E,w]=V.useState({}),[S,I]=V.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=V.useState(void 0),s=l=>({style:l.style,value:S,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return s({style:E})}}),[E,S,n]),V.useEffect(()=>n.intercept(n.getInterceptPoints().beforeSubmit,{handler:(g,d,v)=>h||S.length===1||!S.startsWith("=")?(i(r.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,S]);const f=l=>{e(s(l))};return Q.useSidebarClick(l=>{var d;const g=(d=T.current)==null?void 0:d.handleOutClick;g&&g(l,()=>m(!1))}),R.jsxs("div",{ref:p,children:[R.jsx("div",{className:`
78
61
  ${A.title}
79
62
  ${A.mTBase}
80
63
  `,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
81
64
  ${A.mTSm}
82
- `,children:R.jsx(Ge.FormulaEditor,{onChange:l=>{T(l),f({style:E})},onVerify:(l,g)=>{!l||g.length===1?i(r.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:w.current,isFocus:C,initValue:S,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),R.jsx("div",{className:`
83
- ${G.cfPreviewWrap}
65
+ `,children:R.jsx(Ge.FormulaEditor,{onChange:l=>{I(l),f({style:E})},onVerify:(l,g)=>{!l||g.length===1?i(r.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:T.current,isFocus:C,initValue:S,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),R.jsx("div",{className:`
66
+ ${F.cfPreviewWrap}
84
67
  `,children:R.jsx(We,{rule:s({style:E})})}),R.jsx(sr,{style:y==null?void 0:y.style,className:`
85
68
  ${A.mTSm}
86
- `,onChange:l=>{I(l),f({style:l})}})]})},Ot=t=>R.jsxs("div",{style:{position:"relative"},children:[R.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ce=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),_a=t=>{const{type:e,operator:n,onChange:r,value:a,interceptorManager:o}=t,u=te.useDependency(_.LocaleService),[y,p]=V.useState(()=>typeof a=="number"?a:0),[C,m]=V.useState(""),[w,E]=V.useState(()=>typeof a=="string"?a:""),[I,S]=V.useState(""),[T,h]=V.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=V.useState(""),[f,b]=V.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=V.useState("");switch(V.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)&&r(w);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)&&r(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)&&r([T,f]);break}}},[e]),V.useEffect(()=>{const d=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,x,M)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(n))return w?M(v):(S(u.t("sheet.cf.errorMessage.notBlank")),!1)}return M(v)}});return()=>{d()}},[e,y,w,n]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)){const d=v=>{E(v),r(v)};return R.jsx("div",{className:`
69
+ `,onChange:l=>{w(l),f({style:l})}})]})},Ot=t=>R.jsxs("div",{style:{position:"relative"},children:[R.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),ue=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),_a=t=>{const{type:e,operator:n,onChange:r,value:a,interceptorManager:o}=t,u=Q.useDependency(_.LocaleService),[y,p]=V.useState(()=>typeof a=="number"?a:0),[C,m]=V.useState(""),[T,E]=V.useState(()=>typeof a=="string"?a:""),[w,S]=V.useState(""),[I,h]=V.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=V.useState(""),[f,b]=V.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=V.useState("");switch(V.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)&&r(T);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)&&r(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)&&r([I,f]);break}}},[e]),V.useEffect(()=>{const d=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,D,N)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(n))return T?N(v):(S(u.t("sheet.cf.errorMessage.notBlank")),!1)}return N(v)}});return()=>{d()}},[e,y,T,n]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(n)){const d=v=>{E(v),r(v)};return R.jsx("div",{className:`
87
70
  ${A.mTSm}
88
- `,children:R.jsx(Ot,{errorText:I,children:R.jsx(ee.Input,{className:G.width100,value:w,onChange:v=>{S(""),d(v)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)){const d=v=>{p(v||0),r(v||0),m("")};return R.jsx("div",{className:`
71
+ `,children:R.jsx(Ot,{errorText:w,children:R.jsx(Z.Input,{className:F.width100,value:T,onChange:v=>{S(""),d(v)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(n)){const d=v=>{p(v||0),r(v||0),m("")};return R.jsx("div",{className:`
89
72
  ${A.mTSm}
90
- `,children:R.jsx(Ot,{errorText:C,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:d})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)){const d=x=>{h(x||0),r([x||0,f]),s("")},v=x=>{b(x||0),r([T,x||0]),g("")};return R.jsxs("div",{className:`
73
+ `,children:R.jsx(Ot,{errorText:C,children:R.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:F.width100,value:y,onChange:d})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(n)){const d=D=>{h(D||0),r([D||0,f]),s("")},v=D=>{b(D||0),r([I,D||0]),g("")};return R.jsxs("div",{className:`
91
74
  ${A.mTSm}
92
75
  ${A.labelContainer}
93
- `,children:[R.jsx(Ot,{errorText:i,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:T,onChange:d})}),R.jsx(Ot,{errorText:l,children:R.jsx(ee.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
76
+ `,children:[R.jsx(Ot,{errorText:i,children:R.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:I,onChange:d})}),R.jsx(Ot,{errorText:l,children:R.jsx(Z.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
94
77
  ${A.mLSm}
95
- `,value:f,onChange:v})})]})}}}return null},fn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ce(c.CFTextOperator.containsText,e),ce(c.CFTextOperator.notContainsText,e),ce(c.CFTextOperator.beginsWith,e),ce(c.CFTextOperator.endsWith,e),ce(c.CFTextOperator.equal,e),ce(c.CFTextOperator.notEqual,e),ce(c.CFTextOperator.containsBlanks,e),ce(c.CFTextOperator.notContainsBlanks,e),ce(c.CFTextOperator.containsErrors,e),ce(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ce(c.CFNumberOperator.between,e),ce(c.CFNumberOperator.notBetween,e),ce(c.CFNumberOperator.equal,e),ce(c.CFNumberOperator.notEqual,e),ce(c.CFNumberOperator.greaterThan,e),ce(c.CFNumberOperator.greaterThanOrEqual,e),ce(c.CFNumberOperator.lessThan,e),ce(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ce(c.CFTimePeriodOperator.yesterday,e),ce(c.CFTimePeriodOperator.today,e),ce(c.CFTimePeriodOperator.tomorrow,e),ce(c.CFTimePeriodOperator.last7Days,e),ce(c.CFTimePeriodOperator.lastWeek,e),ce(c.CFTimePeriodOperator.thisWeek,e),ce(c.CFTimePeriodOperator.nextWeek,e),ce(c.CFTimePeriodOperator.lastMonth,e),ce(c.CFTimePeriodOperator.thisMonth,e),ce(c.CFTimePeriodOperator.nextMonth,e)]}},pn=t=>{var b;const{interceptorManager:e,onChange:n}=t,r=te.useDependency(_.LocaleService),a=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=V.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],p=V.useMemo(()=>fn(o,r),[o]),[C,m]=V.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[w,E]=V.useState(()=>{var d;const l="";return a?(d=a.value)!=null?d:c.createDefaultValue(a.subType,a.operator):l}),[I,S]=V.useState({}),T=V.useMemo(()=>l=>{var g,d,v,x,M,z,U,O,L,F,q,J,le,ae,B;switch(l.subType||o){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(d=l.operator)!=null?d:C,style:(v=l.style)!=null?v:I,value:(x=l.value)!=null?x:w};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(M=l.subType)!=null?M:o,operator:(z=l.operator)!=null?z:C,style:(U=l.style)!=null?U:I,value:(O=l.value)!=null?O:w};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(C))return{type:c.CFRuleType.highlightCell,subType:(L=l.subType)!=null?L:o,operator:(F=l.operator)!=null?F:C,style:(q=l.style)!=null?q:I,value:(J=l.value)!=null?J:w};break}}return{type:c.CFRuleType.highlightCell,subType:(le=l.subType)!=null?le:o,operator:(ae=l.operator)!=null?ae:C,style:(B=l.style)!=null?B:I}},[o,C,w,I]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return T({})}}),[T,e]),V.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,d=fn(g,r),v=d&&d[0].value;u(g),m(v),v&&E(c.createDefaultValue(g,v)),n(T({subType:g,operator:v}))},i=l=>{const g=l;m(g),n(T({operator:g}))},s=l=>{E(l),n(T({value:l}))},f=V.useMemo(()=>`${o}_${C}_${Math.random()}`,[o,C]);return R.jsxs("div",{children:[R.jsx("div",{className:`
78
+ `,value:f,onChange:v})})]})}}}return null},fn=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[ue(c.CFTextOperator.containsText,e),ue(c.CFTextOperator.notContainsText,e),ue(c.CFTextOperator.beginsWith,e),ue(c.CFTextOperator.endsWith,e),ue(c.CFTextOperator.equal,e),ue(c.CFTextOperator.notEqual,e),ue(c.CFTextOperator.containsBlanks,e),ue(c.CFTextOperator.notContainsBlanks,e),ue(c.CFTextOperator.containsErrors,e),ue(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[ue(c.CFNumberOperator.between,e),ue(c.CFNumberOperator.notBetween,e),ue(c.CFNumberOperator.equal,e),ue(c.CFNumberOperator.notEqual,e),ue(c.CFNumberOperator.greaterThan,e),ue(c.CFNumberOperator.greaterThanOrEqual,e),ue(c.CFNumberOperator.lessThan,e),ue(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[ue(c.CFTimePeriodOperator.yesterday,e),ue(c.CFTimePeriodOperator.today,e),ue(c.CFTimePeriodOperator.tomorrow,e),ue(c.CFTimePeriodOperator.last7Days,e),ue(c.CFTimePeriodOperator.lastWeek,e),ue(c.CFTimePeriodOperator.thisWeek,e),ue(c.CFTimePeriodOperator.nextWeek,e),ue(c.CFTimePeriodOperator.lastMonth,e),ue(c.CFTimePeriodOperator.thisMonth,e),ue(c.CFTimePeriodOperator.nextMonth,e)]}},pn=t=>{var b;const{interceptorManager:e,onChange:n}=t,r=Q.useDependency(_.LocaleService),a=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.highlightCell?t.rule:void 0,[o,u]=V.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:r.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:r.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:r.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:r.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:r.t("sheet.cf.subRuleType.uniqueValues")}],p=V.useMemo(()=>fn(o,r),[o]),[C,m]=V.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[T,E]=V.useState(()=>{var d;const l="";return a?(d=a.value)!=null?d:c.createDefaultValue(a.subType,a.operator):l}),[w,S]=V.useState({}),I=V.useMemo(()=>l=>{var g,d,v,D,N,U,z,O,L,B,G,ee,ie,oe,ce;switch(l.subType||o){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(d=l.operator)!=null?d:C,style:(v=l.style)!=null?v:w,value:(D=l.value)!=null?D:T};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(C))return{type:c.CFRuleType.highlightCell,subType:(N=l.subType)!=null?N:o,operator:(U=l.operator)!=null?U:C,style:(z=l.style)!=null?z:w,value:(O=l.value)!=null?O:T};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(C))return{type:c.CFRuleType.highlightCell,subType:(L=l.subType)!=null?L:o,operator:(B=l.operator)!=null?B:C,style:(G=l.style)!=null?G:w,value:(ee=l.value)!=null?ee:T};break}}return{type:c.CFRuleType.highlightCell,subType:(ie=l.subType)!=null?ie:o,operator:(oe=l.operator)!=null?oe:C,style:(ce=l.style)!=null?ce:w}},[o,C,T,w]);V.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return I({})}}),[I,e]),V.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,d=fn(g,r),v=d&&d[0].value;u(g),m(v),v&&E(c.createDefaultValue(g,v)),n(I({subType:g,operator:v}))},i=l=>{const g=l;m(g),n(I({operator:g}))},s=l=>{E(l),n(I({value:l}))},f=V.useMemo(()=>`${o}_${C}_${Math.random()}`,[o,C]);return R.jsxs("div",{children:[R.jsx("div",{className:`
96
79
  ${A.title}
97
80
  ${A.mTBase}
98
- `,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
81
+ `,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(Z.Select,{className:`
99
82
  ${A.mTSm}
100
- ${G.width100}
101
- `,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&R.jsx(ee.Select,{className:`
83
+ ${F.width100}
84
+ `,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&R.jsx(Z.Select,{className:`
102
85
  ${A.mTSm}
103
- ${G.width100}
104
- `,onChange:i,value:C||"",options:p}),R.jsx(_a,{value:w,interceptorManager:e,type:o,operator:C,rule:a,onChange:s},f),R.jsx("div",{className:`
105
- ${G.cfPreviewWrap}
106
- `,children:R.jsx(We,{rule:T({})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
86
+ ${F.width100}
87
+ `,onChange:i,value:C||"",options:p}),R.jsx(_a,{value:T,interceptorManager:e,type:o,operator:C,rule:a,onChange:s},f),R.jsx("div",{className:`
88
+ ${F.cfPreviewWrap}
89
+ `,children:R.jsx(We,{rule:I({})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
107
90
  ${A.mLXxs}
108
- `,onChange:l=>{S(l),n(T({style:l}))}})]})},hn=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Ra=t=>{var p;const e=te.useDependency(_.IUniverInstanceService),n=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(p=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=V.useMemo(()=>t.error?G.errorInput:"",[t.error]),o=V.useRef({}),[u,y]=V.useState(!1);return te.useSidebarClick(C=>{var w;const m=(w=o.current)==null?void 0:w.handleOutClick;m&&m(C,()=>y(!1))}),R.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?R.jsxs(R.Fragment,{children:[R.jsx(ee.InputNumber,{className:a,value:Number(t.value)||0,onChange:C=>t.onChange(C!=null?C:0)}),t.error&&R.jsx("div",{className:G.errorText,children:t.error})]}):R.jsx("div",{style:{width:"100%"},children:R.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:u,onChange:(C="")=>{const m=C||"";t.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},gn=(t,e,n)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),Ea=V.forwardRef((t,e)=>{const n=te.useDependency(_.LocaleService),r=a=>{t.onClick(a)};return R.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>R.jsxs("div",{className:G.group,children:[R.jsx("div",{className:G.title,children:n.t(a.title)}),R.jsx("div",{className:G.itemContent,children:a.group.map(u=>R.jsx("div",{className:G.itemWrap,onClick:()=>{r(u.name)},children:R.jsx("div",{className:G.item,children:u.list.map((y,p)=>R.jsx("img",{className:G.icon,src:y},p))})},u.name))})]},o))})}),Oa=t=>{const e=V.useMemo(()=>{const r=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{r.push({iconType:u,base64:y,iconId:String(p)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return R.jsxs("div",{className:G.iconItemListWrap,children:[R.jsxs("div",{className:G.none,onClick:()=>n({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[R.jsx(Xe,{className:G.icon}),R.jsx("span",{children:"无单元格图标"})]}),R.jsx("div",{className:G.iconItemList,children:e.map(r=>R.jsx("div",{className:G.item,children:R.jsx("img",{onClick:()=>n(r),className:`
109
- ${G.icon}
110
- `,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,a=te.useDependency(_.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:a.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],y=(w,E)=>{e([String(E),"value","value"],w)},p=(w,E)=>{e([String(E),"operator"],w);const I=c.createDefaultValue(c.CFSubRuleType.number,w);y(I,E)},C=(w,E)=>{e([String(E),"value","type"],w);const I=n[E],S=c.createDefaultValue(c.CFSubRuleType.number,I.operator);y(S,E)};return V.useMemo(()=>n.map((w,E)=>{const I=r[E],S=hn(w.iconType,w.iconId),T=E===n.length-1,h=E===0,i=n[E-1],s=(i==null?void 0:i.value.type)===c.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,f=(b,l)=>{const g={...w,iconId:l,iconType:b};e([String(E)],g)};return R.jsxs("div",{className:`
91
+ `,onChange:l=>{S(l),n(I({style:l}))}})]})},hn=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Ra=t=>{var p;const e=Q.useDependency(_.IUniverInstanceService),n=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),r=(p=e.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=V.useMemo(()=>t.error?F.errorInput:"",[t.error]),o=V.useRef({}),[u,y]=V.useState(!1);return Q.useSidebarClick(C=>{var T;const m=(T=o.current)==null?void 0:T.handleOutClick;m&&m(C,()=>y(!1))}),R.jsx("div",{className:F.positionRelative,children:t.type!==c.CFValueType.formula?R.jsxs(R.Fragment,{children:[R.jsx(Z.InputNumber,{className:a,value:Number(t.value)||0,onChange:C=>t.onChange(C!=null?C:0)}),t.error&&R.jsx("div",{className:F.errorText,children:t.error})]}):R.jsx("div",{style:{width:"100%"},children:R.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:n,subUnitId:r,isFocus:u,onChange:(C="")=>{const m=C||"";t.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},gn=(t,e,n)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(n.length-1-e)*10},iconType:t,iconId:String(e)}),Ea=V.forwardRef((t,e)=>{const n=Q.useDependency(_.LocaleService),r=a=>{t.onClick(a)};return R.jsx("div",{ref:e,className:F.iconGroupList,children:c.iconGroup.map((a,o)=>R.jsxs("div",{className:F.group,children:[R.jsx("div",{className:F.title,children:n.t(a.title)}),R.jsx("div",{className:F.itemContent,children:a.group.map(u=>R.jsx("div",{className:F.itemWrap,onClick:()=>{r(u.name)},children:R.jsx("div",{className:F.item,children:u.list.map((y,p)=>R.jsx("img",{className:F.icon,src:y},p))})},u.name))})]},o))})}),Oa=t=>{const e=V.useMemo(()=>{const r=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{r.push({iconType:u,base64:y,iconId:String(p)})})}return r},[]),n=r=>{t.onClick(r.iconType,r.iconId)};return R.jsxs("div",{className:F.iconItemListWrap,children:[R.jsxs("div",{className:F.none,onClick:()=>n({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[R.jsx(Xe,{className:F.icon}),R.jsx("span",{children:"无单元格图标"})]}),R.jsx("div",{className:F.iconItemList,children:e.map(r=>R.jsx("div",{className:F.item,children:R.jsx("img",{onClick:()=>n(r),className:`
92
+ ${F.icon}
93
+ `,src:r.base64})},`${r.iconType}_${r.iconId}`))})]})},Pa=t=>{const{onChange:e,configList:n,errorMap:r={}}=t,a=Q.useDependency(_.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:a.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],y=(T,E)=>{e([String(E),"value","value"],T)},p=(T,E)=>{e([String(E),"operator"],T);const w=c.createDefaultValue(c.CFSubRuleType.number,T);y(w,E)},C=(T,E)=>{e([String(E),"value","type"],T);const w=n[E],S=c.createDefaultValue(c.CFSubRuleType.number,w.operator);y(S,E)};return V.useMemo(()=>n.map((T,E)=>{const w=r[E],S=hn(T.iconType,T.iconId),I=E===n.length-1,h=E===0,i=n[E-1],s=(i==null?void 0:i.value.type)===c.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,f=(b,l)=>{const g={...T,iconId:l,iconType:b};e([String(E)],g)};return R.jsxs("div",{className:`
111
94
  ${E?A.mTXl:A.mTSm}
112
95
  `,children:[R.jsxs("div",{className:`
113
96
  ${A.label}
114
- ${G.flex}
97
+ ${F.flex}
115
98
  `,children:[R.jsxs("div",{className:`
116
- ${G.width45}
99
+ ${F.width45}
117
100
  `,children:[a.t("sheet.cf.iconSet.icon"),E+1]}),R.jsx("div",{className:`
118
- ${G.width45}
119
- `,children:R.jsxs(R.Fragment,{children:[!h&&!T&&a.t("sheet.cf.iconSet.rule"),!h&&!T&&R.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),R.jsxs("div",{className:`
120
- ${G.flex}
101
+ ${F.width45}
102
+ `,children:R.jsxs(R.Fragment,{children:[!h&&!I&&a.t("sheet.cf.iconSet.rule"),!h&&!I&&R.jsxs("span",{className:F.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,I?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),R.jsxs("div",{className:`
103
+ ${F.flex}
121
104
  ${A.mTSm}
122
105
  `,children:[R.jsx("div",{className:`
123
- ${G.iconWrap}
124
- ${G.width45}
125
- `,children:R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Oa,{onClick:f,iconId:w.iconId,iconType:w.iconType})}),children:R.jsxs("div",{className:ee.clsx(G.dropdownIcon,"univer-box-border univer-h-7"),children:[S?R.jsx("img",{src:S,className:G.icon}):R.jsx(Xe,{className:G.icon}),R.jsx(vt,{})]})})}),T?R.jsxs("div",{className:`
126
- ${G.width45}
106
+ ${F.iconWrap}
107
+ ${F.width45}
108
+ `,children:R.jsx(Z.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Oa,{onClick:f,iconId:T.iconId,iconType:T.iconType})}),children:R.jsxs("div",{className:Z.clsx(F.dropdownIcon,"univer-box-border univer-h-7"),children:[S?R.jsx("img",{src:S,className:F.icon}):R.jsx(Xe,{className:F.icon}),R.jsx(vt,{})]})})}),I?R.jsxs("div",{className:`
109
+ ${F.width45}
127
110
  ${A.label}
128
- `,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),R.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,T?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):R.jsx(ee.Select,{className:`
111
+ `,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),R.jsxs("span",{className:F.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,I?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):R.jsx(Z.Select,{className:`
129
112
  ${A.mL0}
130
- ${G.width45}
113
+ ${F.width45}
131
114
  ${A.mR0}
132
- `,options:o,value:w.operator,onChange:b=>{p(b,E)}})]}),T?R.jsx("div",{}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:`
115
+ `,options:o,value:T.operator,onChange:b=>{p(b,E)}})]}),I?R.jsx("div",{}):R.jsxs(R.Fragment,{children:[R.jsxs("div",{className:`
133
116
  ${A.mTSm}
134
117
  ${A.label}
135
- ${G.flex}
118
+ ${F.flex}
136
119
  `,children:[R.jsx("div",{className:`
137
- ${G.width45}
120
+ ${F.width45}
138
121
  `,children:a.t("sheet.cf.iconSet.type")}),R.jsx("div",{className:`
139
- ${G.width45}
122
+ ${F.width45}
140
123
  `,children:a.t("sheet.cf.iconSet.value")})]}),R.jsxs("div",{className:`
141
124
  ${A.mTSm}
142
- ${G.flex}
143
- `,children:[R.jsx(ee.Select,{style:{flexShrink:0},className:`
144
- ${G.width45}
125
+ ${F.flex}
126
+ `,children:[R.jsx(Z.Select,{style:{flexShrink:0},className:`
127
+ ${F.width45}
145
128
  ${A.mL0}
146
- `,options:u,value:w.value.type,onChange:b=>{C(b,E)}}),R.jsx("div",{className:`
129
+ `,options:u,value:T.value.type,onChange:b=>{C(b,E)}}),R.jsx("div",{className:`
147
130
  ${A.mL0}
148
- ${G.width45}
149
- `,children:R.jsx(Ra,{id:E,type:w.value.type,error:I,value:w.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},Da=t=>{var b;const{interceptorManager:e}=t,n=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.iconSet?t.rule:void 0,r=te.useDependency(_.LocaleService),[a,o]=V.useState({}),[u,y]=V.useState(()=>{const l=Object.keys(c.iconMap)[0];if(n&&n.config.length){const g=n.config[0].iconType;if(!n.config.some(v=>v.iconType!==g))return g}return l}),[p,C]=V.useState(()=>{if(n&&n.config.length)return _.Tools.deepClone(n==null?void 0:n.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,d,v)=>d===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(d)}:gn(u,d,v))}),[m,w]=V.useState(()=>n?!!n.isShowValue:!0),E=V.useMemo(()=>{const l=p.map(g=>hn(g.iconType,g.iconId));return R.jsx("div",{className:G.iconWrap,children:l.map((g,d)=>g?R.jsx("img",{className:G.icon,src:g},d):R.jsx(Xe,{className:G.icon},d))})},[p]),I=l=>{if(l.reduce((d,v,x)=>d.preType&&!d.result||l.length-1===x?d:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:d.preType?{result:d.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(l[0].value.type)){const d={};return l.forEach((v,x,M)=>{if(x-1<0||x===M.length-1)return;const U=l[x-1],O=c.getOppositeOperator(U.operator);c.compareWithNumber({operator:O,value:U.value.value},v.value.value)||(d[x]=`${r.t(`sheet.cf.form.${O}`,String(U.value.value))} `)}),d}return{}},S=(l,g)=>{_.get(p,l)!==g&&(_.set(p,l,g),C([...p]),o(I(p)))},T=l=>{y(l);const g=c.iconMap[l]||[],d=new Array(g.length).fill("").map((v,x,M)=>gn(l,x,M));C(d),o(I(d))};V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,e]),V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,p,e,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,d)=>{const v=p.length-1-d,x=l[v];g.iconId=x.iconId,g.iconType=x.iconType}),C([...p])},i=te.useDependency(te.ILayoutService),[s,f]=V.useState();return te.useScrollYOverContainer(s,i.rootContainerElement),R.jsxs("div",{className:G.iconSet,children:[R.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
131
+ ${F.width45}
132
+ `,children:R.jsx(Ra,{id:E,type:T.value.type,error:w,value:T.value.value||"",onChange:b=>y(b,E)})})]})]})]},E)}),[n,r])},xa=t=>{var b;const{interceptorManager:e}=t,n=((b=t.rule)==null?void 0:b.type)===c.CFRuleType.iconSet?t.rule:void 0,r=Q.useDependency(_.LocaleService),[a,o]=V.useState({}),[u,y]=V.useState(()=>{const l=Object.keys(c.iconMap)[0];if(n&&n.config.length){const g=n.config[0].iconType;if(!n.config.some(v=>v.iconType!==g))return g}return l}),[p,C]=V.useState(()=>{if(n&&n.config.length)return _.Tools.deepClone(n==null?void 0:n.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,d,v)=>d===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(d)}:gn(u,d,v))}),[m,T]=V.useState(()=>n?!!n.isShowValue:!0),E=V.useMemo(()=>{const l=p.map(g=>hn(g.iconType,g.iconId));return R.jsx("div",{className:F.iconWrap,children:l.map((g,d)=>g?R.jsx("img",{className:F.icon,src:g},d):R.jsx(Xe,{className:F.icon},d))})},[p]),w=l=>{if(l.reduce((d,v,D)=>d.preType&&!d.result||l.length-1===D?d:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:d.preType?{result:d.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(l[0].value.type)){const d={};return l.forEach((v,D,N)=>{if(D-1<0||D===N.length-1)return;const z=l[D-1],O=c.getOppositeOperator(z.operator);c.compareWithNumber({operator:O,value:z.value.value},v.value.value)||(d[D]=`${r.t(`sheet.cf.form.${O}`,String(z.value.value))} `)}),d}return{}},S=(l,g)=>{_.get(p,l)!==g&&(_.set(p,l,g),C([...p]),o(w(p)))},I=l=>{y(l);const g=c.iconMap[l]||[],d=new Array(g.length).fill("").map((v,D,N)=>gn(l,D,N));C(d),o(w(d))};V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,e]),V.useEffect(()=>{const l=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,p,e,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,d)=>{const v=p.length-1-d,D=l[v];g.iconId=D.iconId,g.iconType=D.iconType}),C([...p])},i=Q.useDependency(Q.ILayoutService),[s,f]=V.useState();return Q.useScrollYOverContainer(s,i.rootContainerElement),R.jsxs("div",{className:F.iconSet,children:[R.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),R.jsx("div",{className:`
150
133
  ${A.mTSm}
151
- `,children:R.jsx(ee.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Ea,{ref:l=>{!s&&l&&f(l)},iconType:u,onClick:T})}),children:R.jsxs("div",{className:ee.clsx(G.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,R.jsx(vt,{})]})})}),R.jsxs("div",{className:`
134
+ `,children:R.jsx(Z.Dropdown,{overlay:R.jsx("div",{className:"univer-rounded-lg univer-p-4",children:R.jsx(Ea,{ref:l=>{!s&&l&&f(l)},iconType:u,onClick:I})}),children:R.jsxs("div",{className:Z.clsx(F.dropdownIcon,"univer-box-border univer-h-7 univer-w-auto"),children:[E,R.jsx(vt,{})]})})}),R.jsxs("div",{className:`
152
135
  ${A.mTSm}
153
- ${G.renderConfig}
154
- `,children:[R.jsxs("div",{className:G.utilItem,children:[R.jsx(ee.Checkbox,{onChange:h}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),R.jsxs("div",{className:`
155
- ${G.utilItem}
136
+ ${F.renderConfig}
137
+ `,children:[R.jsxs("div",{className:F.utilItem,children:[R.jsx(Z.Checkbox,{onChange:h}),r.t("sheet.cf.iconSet.reverseIconOrder")]}),R.jsxs("div",{className:`
138
+ ${F.utilItem}
156
139
  ${A.mLXl}
157
- `,children:[R.jsx(ee.Checkbox,{checked:!m,onChange:l=>{w(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),R.jsx(Pa,{errorMap:a,onChange:S,configList:p})]})},xa=t=>{var h;const{onChange:e,interceptorManager:n}=t,r=te.useDependency(_.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,y]=V.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case c.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[p,C]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.value||10}}return 10}),[m,w]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[E,I]=V.useState({}),S=i=>{const{type:s,isPercent:f,value:b,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:b,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:b,style:l};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:l}};V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return S({type:u,isPercent:m,value:p,style:E})}}),[u,m,p,E,n]);const T=i=>{e(S(i))};return R.jsxs("div",{children:[R.jsx("div",{className:`
140
+ `,children:[R.jsx(Z.Checkbox,{checked:!m,onChange:l=>{T(!l)}}),r.t("sheet.cf.iconSet.onlyShowIcon")]})]}),R.jsx(Pa,{errorMap:a,onChange:S,configList:p})]})},Da=t=>{var h;const{onChange:e,interceptorManager:n}=t,r=Q.useDependency(_.LocaleService),a=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,o=[{label:r.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:r.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:r.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:r.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,y]=V.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case c.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[p,C]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.value||10}}return 10}),[m,T]=V.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[E,w]=V.useState({}),S=i=>{const{type:s,isPercent:f,value:b,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!1,value:b,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:f,isBottom:!0,value:b,style:l};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:l}};V.useEffect(()=>n.intercept(n.getInterceptPoints().submit,{handler(){return S({type:u,isPercent:m,value:p,style:E})}}),[u,m,p,E,n]);const I=i=>{e(S(i))};return R.jsxs("div",{children:[R.jsx("div",{className:`
158
141
  ${A.title}
159
142
  ${A.mTBase}
160
- `,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(ee.Select,{className:`
161
- ${G.width100}
143
+ `,children:r.t("sheet.cf.panel.styleRule")}),R.jsx(Z.Select,{className:`
144
+ ${F.width100}
162
145
  ${A.mTSm}
163
- `,value:u,options:o,onChange:i=>{y(i),T({type:i,isPercent:m,value:p,style:E})}}),["isNotBottom","isBottom"].includes(u)&&R.jsxs("div",{className:`
146
+ `,value:u,options:o,onChange:i=>{y(i),I({type:i,isPercent:m,value:p,style:E})}}),["isNotBottom","isBottom"].includes(u)&&R.jsxs("div",{className:`
164
147
  ${A.labelContainer}
165
148
  ${A.mTSm}
166
- `,children:[R.jsx(ee.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;C(s),T({type:u,isPercent:m,value:s,style:E})}}),R.jsxs("div",{className:`
149
+ `,children:[R.jsx(Z.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;C(s),I({type:u,isPercent:m,value:s,style:E})}}),R.jsxs("div",{className:`
167
150
  ${A.mLSm}
168
151
  ${A.labelContainer}
169
- ${G.text}
170
- `,children:[R.jsx(ee.Checkbox,{checked:m,onChange:i=>{w(!!i),T({type:u,isPercent:!!i,value:p,style:E})}}),r.t("sheet.cf.valueType.percent")]})]}),R.jsx("div",{className:`
171
- ${G.cfPreviewWrap}
152
+ ${F.text}
153
+ `,children:[R.jsx(Z.Checkbox,{checked:m,onChange:i=>{T(!!i),I({type:u,isPercent:!!i,value:p,style:E})}}),r.t("sheet.cf.valueType.percent")]})]}),R.jsx("div",{className:`
154
+ ${F.cfPreviewWrap}
172
155
  `,children:R.jsx(We,{rule:S({type:u,isPercent:m,value:p,style:E})})}),R.jsx(sr,{style:a==null?void 0:a.style,className:`
173
156
  ${A.mTSm}
174
- `,onChange:i=>{I(i),T({type:u,isPercent:m,value:p,style:i})}})]})},Ma=_.createInterceptorKey("beforeSubmit"),Na=_.createInterceptorKey("submit"),vn=t=>t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=t=>{var e;return(e=t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},La=t=>{var d,v,x;const e=te.useDependency(_.LocaleService),n=te.useDependency(_.ICommandService),r=te.useDependency(_.IUniverInstanceService),a=te.useDependency(c.ConditionalFormattingRuleModel),o=te.useDependency(Y.SheetsSelectionsService),u=vn(r),y=mn(r),[p,C]=V.useState(void 0),m=V.useRef((v=(d=t.rule)==null?void 0:d.ranges)!=null?v:[]),w=V.useMemo(()=>{var z,U,O;let M=(z=t.rule)==null?void 0:z.ranges;return M!=null&&M.length||(M=(O=(U=o.getCurrentSelections())==null?void 0:U.map(L=>L.range))!=null?O:[]),m.current=M,M!=null&&M.length?M.map(L=>{const F=kt.serializeRange(L);return F==="NaN"?"":F}).filter(L=>!!L).join(","):""},[t.rule]),E=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[I,S]=V.useState(()=>{var U,O;const M=(U=t.rule)==null?void 0:U.rule.type,z=E[0].value;if(!M)return z;switch(M){case c.CFRuleType.highlightCell:{switch((O=t.rule)==null?void 0:O.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return z}),T=V.useRef(void 0),h=V.useMemo(()=>new _.InterceptorManager({beforeSubmit:Ma,submit:Na}),[]),i=V.useMemo(()=>{switch(I){case"1":return pn;case"2":return xa;case"3":return wa;case"4":return Ta;case"5":return Ia;case"6":return Da;default:return pn}},[I]);V.useEffect(()=>{const M=n.onCommandExecuted(z=>{if(z.id===Y.RemoveSheetMutation.id){const U=z.params;U.subUnitId===y&&U.unitId===u&&t.onCancel()}z.id===Y.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>M.dispose()},[]);const s=M=>{T.current=M},f=M=>{const z=M.split(",").filter(U=>!!U).map(kt.deserializeRangeWithSheet).map(U=>U.range);m.current=z},b=()=>{if(p)return;const z=(()=>{const O=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!O)throw new Error("No active sheet found");return m.current.map(q=>Y.setEndForRange(q,O.getRowCount(),O.getColumnCount())).filter(q=>!(Number.isNaN(q.startRow)||Number.isNaN(q.startColumn)))})();if(h.fetchThroughInterceptors(h.getInterceptPoints().beforeSubmit)(!0,null)){const O=h.fetchThroughInterceptors(h.getInterceptPoints().submit)(null,null);if(O){const L=vn(r),F=mn(r);if(!L||!F)throw new Error("No active sheet found");let q={};t.rule&&t.rule.cfId?(q={...t.rule,ranges:z,rule:O},n.executeCommand(c.SetCfCommand.id,{unitId:L,subUnitId:F,rule:q}),t.onCancel()):(q={cfId:a.createCfId(L,F),ranges:z,rule:O,stopIfTrue:!1},n.executeCommand(c.AddCfCommand.id,{unitId:L,subUnitId:F,rule:q}),t.onCancel())}}},l=()=>{t.onCancel()},g=(M,z)=>{M?z.length<1?C(e.t("sheet.cf.errorMessage.rangeError")):C(void 0):C(e.t("sheet.cf.errorMessage.rangeError"))};return R.jsxs("div",{className:G.cfRuleStyleEditor,children:[R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),R.jsxs("div",{className:`
157
+ `,onChange:i=>{w(i),I({type:u,isPercent:m,value:p,style:i})}})]})},Ma=_.createInterceptorKey("beforeSubmit"),Na=_.createInterceptorKey("submit"),vn=t=>t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),mn=t=>{var e;return(e=t.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},La=t=>{var d,v,D;const e=Q.useDependency(_.LocaleService),n=Q.useDependency(_.ICommandService),r=Q.useDependency(_.IUniverInstanceService),a=Q.useDependency(c.ConditionalFormattingRuleModel),o=Q.useDependency(Y.SheetsSelectionsService),u=vn(r),y=mn(r),[p,C]=V.useState(void 0),m=V.useRef((v=(d=t.rule)==null?void 0:d.ranges)!=null?v:[]),T=V.useMemo(()=>{var U,z,O;let N=(U=t.rule)==null?void 0:U.ranges;return N!=null&&N.length||(N=(O=(z=o.getCurrentSelections())==null?void 0:z.map(L=>L.range))!=null?O:[]),m.current=N,N!=null&&N.length?N.map(L=>{const B=kt.serializeRange(L);return B==="NaN"?"":B}).filter(L=>!!L).join(","):""},[t.rule]),E=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[w,S]=V.useState(()=>{var z,O;const N=(z=t.rule)==null?void 0:z.rule.type,U=E[0].value;if(!N)return U;switch(N){case c.CFRuleType.highlightCell:{switch((O=t.rule)==null?void 0:O.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return U}),I=V.useRef(void 0),h=V.useMemo(()=>new _.InterceptorManager({beforeSubmit:Ma,submit:Na}),[]),i=V.useMemo(()=>{switch(w){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}},[w]);V.useEffect(()=>{const N=n.onCommandExecuted(U=>{if(U.id===Y.RemoveSheetMutation.id){const z=U.params;z.subUnitId===y&&z.unitId===u&&t.onCancel()}U.id===Y.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>N.dispose()},[]);const s=N=>{I.current=N},f=N=>{const U=N.split(",").filter(z=>!!z).map(kt.deserializeRangeWithSheet).map(z=>z.range);m.current=U},b=()=>{if(p)return;const U=(()=>{const O=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!O)throw new Error("No active sheet found");return m.current.map(G=>Y.setEndForRange(G,O.getRowCount(),O.getColumnCount())).filter(G=>!(Number.isNaN(G.startRow)||Number.isNaN(G.startColumn)))})();if(h.fetchThroughInterceptors(h.getInterceptPoints().beforeSubmit)(!0,null)){const O=h.fetchThroughInterceptors(h.getInterceptPoints().submit)(null,null);if(O){const L=vn(r),B=mn(r);if(!L||!B)throw new Error("No active sheet found");let G={};t.rule&&t.rule.cfId?(G={...t.rule,ranges:U,rule:O},n.executeCommand(c.SetCfCommand.id,{unitId:L,subUnitId:B,rule:G}),t.onCancel()):(G={cfId:a.createCfId(L,B),ranges:U,rule:O,stopIfTrue:!1},n.executeCommand(c.AddCfCommand.id,{unitId:L,subUnitId:B,rule:G}),t.onCancel())}}},l=()=>{t.onCancel()},g=(N,U)=>{N?U.length<1?C(e.t("sheet.cf.errorMessage.rangeError")):C(void 0):C(e.t("sheet.cf.errorMessage.rangeError"))};return R.jsxs("div",{className:F.cfRuleStyleEditor,children:[R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),R.jsxs("div",{className:`
175
158
  ${A.mTBase}
176
- `,children:[R.jsx(Ge.RangeSelector,{unitId:u,subUnitId:y,initialValue:w,onChange:(M,z)=>f(z),onVerify:g}),p&&R.jsx("div",{className:G.cfErrorText,children:p})]}),R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),R.jsx("div",{className:A.mTBase,children:R.jsx(ee.Select,{className:G.width100,value:I,options:E,onChange:M=>S(M)})}),R.jsx(i,{interceptorManager:h,rule:(x=t.rule)==null?void 0:x.rule,onChange:s}),R.jsxs("div",{className:`
159
+ `,children:[R.jsx(Ge.RangeSelector,{unitId:u,subUnitId:y,initialValue:T,onChange:(N,U)=>f(U),onVerify:g}),p&&R.jsx("div",{className:F.cfErrorText,children:p})]}),R.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),R.jsx("div",{className:A.mTBase,children:R.jsx(Z.Select,{className:F.width100,value:w,options:E,onChange:N=>S(N)})}),R.jsx(i,{interceptorManager:h,rule:(D=t.rule)==null?void 0:D.rule,onChange:s}),R.jsxs("div",{className:`
177
160
  ${A.mTBase}
178
- ${G.btnList}
179
- `,children:[R.jsx(ee.Button,{size:"small",onClick:l,children:e.t("sheet.cf.panel.cancel")}),R.jsx(ee.Button,{className:A.mLSm,size:"small",type:"primary",onClick:b,children:e.t("sheet.cf.panel.submit")})]})]})},Va=t=>{const[e,n]=V.useState(t.rule),[r,a]=V.useState(!!t.rule),o=()=>{a(!0)},u=()=>{a(!1),n(void 0)},y=p=>{n(p),a(!0)};return R.jsx("div",{className:A.conditionalFormattingWrap,children:r?R.jsx(La,{onCancel:u,rule:e}):R.jsx(Ca,{onClick:y,onCreate:o})})};var Ua=Object.getOwnPropertyDescriptor,za=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ua(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},at=(t,e)=>(n,r)=>e(n,r,t);const Pt="sheet.conditional.formatting.panel";let ot=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=n,this._componentManager=r,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Pt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const n={id:Pt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Pt,rule:e,key:_.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(n)}_initPanel(){this._componentManager.register(Pt,Va)}};ot=za([at(0,_.IUniverInstanceService),at(1,_.Inject(_.Injector)),at(2,_.Inject(te.ComponentManager)),at(3,_.Inject(te.ISidebarService)),at(4,_.Inject(_.LocaleService))],ot);var me=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(me||{});const it={id:"sheet.operation.open.conditional.formatting.panel",type:_.CommandType.OPERATION,handler:(t,e)=>{var y;const n=t.get(ot),r=t.get(Y.SheetsSelectionsService),a=t.get(_.ICommandService),o=((y=r.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(e.value){case 3:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};n.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};n.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};n.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};n.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};n.openPanel(p);break}case 2:{n.openPanel();break}case 1:{n.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(c.ClearRangeCfCommand.id,{ranges:o});break}case 10:{a.executeCommand(c.ClearWorksheetCfCommand.id);break}}return!0}};var ka=Object.getOwnPropertyDescriptor,Aa=(t,e,n,r)=>{for(var a=r>1?void 0:r?ka(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},st=(t,e)=>(n,r)=>e(n,r,t);let lt=class extends _.Disposable{constructor(e,n,r,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=n,this._injector=r,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,n,r)=>this._collectConditionalRule(e,n,r),onPasteCells:(e,n,r,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=e||{},{range:p}=n;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(e,n,r){const a=new _.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:e,subUnitId:n,cfMap:o}};const u=this._injector.invoke(m=>Y.rangeToDiscreteRange(r,m,e,n));if(!u)return;const{rows:y,cols:p}=u,C=new Set;y.forEach((m,w)=>{p.forEach((E,I)=>{const S=this._conditionalFormattingViewModel.getCellCfs(e,n,m,E);S&&(S.forEach(T=>C.add(T.cfId)),a.setValue(w,I,S.map(T=>T.cfId)))})}),C.forEach(m=>{const w=this._conditionalFormattingRuleModel.getRule(e,n,m);w&&(o[m]=w.rule)})}_generateConditionalFormattingMutations(e,n){const r=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),a=r.getActiveSheet(),o=r.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(n.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!n.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(n.pasteType))return{redos:[],undos:[]};const{ranges:[p,C],mapFunc:m}=fe.virtualizeDiscreteRanges([n.copyRange,e]),w=fe.getRepeatRange(p,C,!0),E={};_.Range.foreach(C,(l,g)=>{const{row:d,col:v}=m(l,g),x=this._conditionalFormattingViewModel.getCellCfs(o,u,d,v);x&&x.forEach(M=>{if(!E[M.cfId]){const z=new _.ObjectMatrix;E[M.cfId]=z;const U=this._conditionalFormattingRuleModel.getRule(o,u,M.cfId);U==null||U.ranges.forEach(O=>{_.Range.foreach(O,(L,F)=>{z.setValue(L,F,1)})})}E[M.cfId].realDeleteValue(d,v)})});const{matrix:I,info:S}=this._copyInfo,T=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=S==null?void 0:S.cfMap[l],d=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...T].find(v=>_.Tools.diffValue(v.rule,g));if(d)return i[l]=d,d;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,T.push(v),h=`${Number(h)+1}`,v}};w.forEach(l=>{I&&I.forValue((g,d,v)=>{const x=_.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:d,endColumn:d},l.startRange),{row:M,col:z}=m(x.startRow,x.startColumn);v.forEach(U=>{if(!E[U]){const O=s(U),L=new _.ObjectMatrix;E[U]=L,O.ranges.forEach(F=>{_.Range.foreach(F,(q,J)=>{L.setValue(q,J,1)})})}E[U].setValue(M,z,1)})})});const f=[],b=[];for(const l in E){const g=E[l],d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(g));if(!d.length){const v={unitId:o,subUnitId:u,cfId:l};f.push({id:c.DeleteConditionalRuleMutation.id,params:v}),b.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(T.some(v=>v.cfId===l)){const v=s(l),x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.AddConditionalRuleMutation.id,params:x}),b.push(c.AddConditionalRuleMutationUndoFactory(this._injector,x))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const x={unitId:o,subUnitId:u,rule:{...v,ranges:d}};f.push({id:c.SetConditionalRuleMutation.id,params:x}),b.push(...c.setConditionalRuleMutationUndoFactory(this._injector,x))}}return{redos:f,undos:b}}};lt=Aa([st(0,_.Inject(fe.ISheetClipboardService)),st(1,_.Inject(c.ConditionalFormattingRuleModel)),st(2,_.Inject(_.Injector)),st(3,_.Inject(c.ConditionalFormattingViewModel)),st(4,_.Inject(_.IUniverInstanceService))],lt);var Wa=Object.getOwnPropertyDescriptor,ja=(t,e,n,r)=>{for(var a=r>1?void 0:r?Wa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},lr=(t,e)=>(n,r)=>e(n,r,t);let ct=class extends _.Disposable{constructor(t,e,n){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=n,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===c.AddCfCommand.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[Y.WorkbookEditablePermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint],worksheetTypes:[Y.WorksheetEditPermission,Y.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ct=ja([lr(0,_.Inject(_.LocaleService)),lr(1,_.ICommandService),lr(2,_.Inject(Y.SheetPermissionCheckController))],ct);var Ha=Object.getOwnPropertyDescriptor,Ba=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ha(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Dt=(t,e)=>(n,r)=>e(n,r,t);let ut=class extends _.Disposable{constructor(t,e,n,r){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=n,this._refRangeService=r,this._initRefRange()}_initRefRange(){const t=new Map,e=(r,a,o)=>`${r}_${a}_${o}`,n=(r,a,o)=>{const u=p=>{const C=[...o.ranges],m=C.map(E=>Y.handleDefaultRangeChangeWithEffectRefCommands(E,p)).filter(E=>!!E);if(c.isRangesEqual(m,C))return{redos:[],undos:[]};if(m.length){const E={unitId:r,subUnitId:a,rule:{...o,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:E}],S=c.setConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}else{const E={unitId:r,subUnitId:a,cfId:o.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:E}],S=c.DeleteConditionalRuleMutationUndoFactory(this._injector,E);return{redos:I,undos:S}}},y=[];o.ranges.forEach(p=>{const C=this._refRangeService.registerRefRange(p,u);y.push(()=>C.dispose())}),t.set(e(r,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(r=>{const{unitId:a,subUnitId:o,rule:u}=r,y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(r.unitId!==y.getUnitId()||r.subUnitId!==(p==null?void 0:p.getSheetId())))switch(r.type){case"add":{n(r.unitId,r.subUnitId,r.rule);break}case"delete":{const C=t.get(e(a,o,u.cfId));C&&C();break}case"set":{const C=t.get(e(a,o,u.cfId));C&&C(),n(r.unitId,r.subUnitId,r.rule)}}})),this.disposeWithMe(_.toDisposable(()=>{t.forEach(r=>{r()}),t.clear()}))}};ut=Ba([Dt(0,_.Inject(c.ConditionalFormattingRuleModel)),Dt(1,_.Inject(_.IUniverInstanceService)),Dt(2,_.Inject(_.Injector)),Dt(3,_.Inject(Y.RefRangeService))],ut);var Fa=Object.getOwnPropertyDescriptor,Ga=(t,e,n,r)=>{for(var a=r>1?void 0:r?Fa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},He=(t,e)=>(n,r)=>e(n,r,t);let dt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=n,this._univerInstanceService=r,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var n,r,a;const e=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId();(n=this._renderManagerService.getRenderById(e))==null||n.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(r=this._renderManagerService.getRenderById(e))==null?void 0:r.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const n=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!n)return!1;const r=n.getActiveSheet();return r?e.filter(a=>a.unitId===n.getUnitId()&&a.subUnitId===r.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(Y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:_.InterceptorEffectEnum.Style,handler:(e,n,r)=>{const a=this._conditionalFormattingService.composeStyle(n.unitId,n.subUnitId,n.row,n.col);if(!a)return r(e);const o=n.workbook.getStyles(),y={...(typeof(e==null?void 0:e.s)=="string"?o.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},p={...e,s:y};return a.style&&Object.assign(y,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),r(p)},priority:10}))}};dt=Ga([He(0,_.Inject(Y.SheetInterceptorService)),He(1,_.Inject(c.ConditionalFormattingService)),He(2,_.Inject(_.IUniverInstanceService)),He(3,_.Inject(hr.IRenderManagerService)),He(4,_.Inject(c.ConditionalFormattingViewModel)),He(5,_.Inject(c.ConditionalFormattingRuleModel))],dt);const yn="sheets-conditional-formatting-ui.config",xt={};var qa=Object.defineProperty,Xa=Object.getOwnPropertyDescriptor,Ya=(t,e,n)=>e in t?qa(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Ka=(t,e,n,r)=>{for(var a=r>1?void 0:r?Xa(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},cr=(t,e)=>(n,r)=>e(n,r,t),bn=(t,e,n)=>Ya(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand(),this._injector.add([dt]),this._injector.add([ut]),this._injector.add([lt]),this._injector.add([ct]),this._injector.add([Ae])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),bn($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=Ka([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),cr(1,_.Inject(_.Injector)),cr(2,_.Inject(_.ICommandService)),cr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var Za=Object.getOwnPropertyDescriptor,$a=(t,e,n,r)=>{for(var a=r>1?void 0:r?Za(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ft=(t,e)=>(n,r)=>e(n,r,t);let Mt=class extends _.Disposable{constructor(t,e,n,r,a){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=n,this._conditionalFormattingRuleModel=r,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(a,o,u,y,p)=>{var I;const C=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!C||!m)return;const w={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},E={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};_.Range.foreach(u,(S,T)=>{const h=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},w),i=_.Rectangle.getPositionRange({startRow:S,startColumn:T,endColumn:T,endRow:S},E),{row:s,col:f}=p(h.startRow,h.startColumn),b=this._conditionalFormattingViewModel.getCellCfs(C,m,s,f),{row:l,col:g}=p(i.startRow,i.startColumn),d=this._conditionalFormattingViewModel.getCellCfs(C,m,l,g);d&&d.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.realDeleteValue(l,g)}),b&&b.forEach(v=>{let x=y.get(v.cfId);if(!y.get(v.cfId)){const M=this._conditionalFormattingRuleModel.getRule(C,m,v.cfId);if(!M)return;x=new _.ObjectMatrix,M.ranges.forEach(z=>{_.Range.foreach(z,(U,O)=>{x.setValue(U,O,1)})}),y.set(v.cfId,x)}x.setValue(l,g,1)})})},n=(a,o)=>{var i,s,f;const u=(i=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(f=(s=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:f.getSheetId(),p=new Map,C=[],m=[];if(!u||!y)return t();const w=fe.virtualizeDiscreteRanges([a,o]),[E,I]=w.ranges,{mapFunc:S}=w,T={row:E.startRow,col:E.startColumn};return fe.getAutoFillRepeatRange(E,I).forEach(b=>{e(T,b.repeatStartCell,b.relativeRange,p,S)}),p.forEach((b,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const d=Y.findAllRectangle(Y.createTopMatrixFromMatrix(b));if(d.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:d}};C.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};C.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:C}},r={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return n(y,p)}return t()}};this.disposeWithMe(this._autoFillService.addHook(r))}};Mt=$a([ft(0,_.Inject(_.Injector)),ft(1,_.Inject(_.IUniverInstanceService)),ft(2,_.Inject(fe.IAutoFillService)),ft(3,_.Inject(c.ConditionalFormattingRuleModel)),ft(4,_.Inject(c.ConditionalFormattingViewModel))],Mt);var Ja=Object.getOwnPropertyDescriptor,Qa=(t,e,n,r)=>{for(var a=r>1?void 0:r?Ja(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},pt=(t,e)=>(n,r)=>e(n,r,t);$.ConditionalFormattingClearController=class extends _.Disposable{constructor(e,n,r,a,o){super(),this._injector=e,this._univerInstanceService=n,this._sheetInterceptorService=r,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var o;const n=[],r=[],a={redos:n,undos:r};if([Y.ClearSelectionFormatCommand.id,Y.ClearSelectionAllCommand.id].includes(e.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(S=>S.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const C=y.getUnitId(),m=p.getSheetId(),w=this._conditionalFormattingRuleModel.getSubunitRules(C,m);if(!w||!w.length)return a;const{redos:E,undos:I}=Sn(this._injector,w,u,C,m);n.push(...E),r.push(...I)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:n,ranges:r})=>{const a=[],o=[],u={redos:a,undos:o};if(!r||!r.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(e,n);if(!y||!y.length)return u;const{redos:p,undos:C}=Sn(this._injector,y,r,e,n);return a.push(...p),o.push(...C),u}}))}},$.ConditionalFormattingClearController=Qa([pt(0,_.Inject(_.Injector)),pt(1,_.Inject(_.IUniverInstanceService)),pt(2,_.Inject(Y.SheetInterceptorService)),pt(3,_.Inject(Y.SheetsSelectionsService)),pt(4,_.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Sn(t,e,n,r,a){const o=[],u=[];return e.filter(y=>n.some(p=>y.ranges.some(C=>_.Rectangle.getIntersects(C,p)))).forEach(y=>{const C=new Y.RangeMergeUtil().add(...y.ranges).subtract(...n).merge();if(C.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,rule:{...y,ranges:C}}},w=c.setConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:r,subUnitId:a,cfId:y.cfId}},w=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);o.push(m),u.push(...w)}}),{redos:o,undos:u}}var eo=Object.getOwnPropertyDescriptor,to=(t,e,n,r)=>{for(var a=r>1?void 0:r?eo(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Cn=(t,e)=>(n,r)=>e(n,r,t);let Nt=class extends _.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(_.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(Y.AFTER_CELL_EDIT,{handler:(t,e,n)=>{var u,y,p;t||n(t);const r=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),a=(u=r==null?void 0:r.style)!=null?u:{},o=Object.keys(a);if(t!=null&&t.p)return(p=(y=t.p.body)==null?void 0:y.textRuns)==null||p.forEach(C=>{C.ts&&o.forEach(m=>{var w;(w=C.ts)==null||delete w[m]})}),n(t);{const C={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};o.forEach(w=>{delete C[w]});const m={...t,s:{...C}};return n(m)}}})))}};Nt=to([Cn(0,_.Inject(Y.SheetInterceptorService)),Cn(1,_.Inject(c.ConditionalFormattingService))],Nt);const Tn=[Y.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],ht=[{label:{name:"sheet.cf.ruleType.highlightCell",selectable:!1},value:me.highlightCell},{label:{name:"sheet.cf.panel.rankAndAverage",selectable:!1},value:me.rank},{label:{name:"sheet.cf.ruleType.formula",selectable:!1},value:me.formula},{label:{name:"sheet.cf.ruleType.colorScale",selectable:!1},value:me.colorScale},{label:{name:"sheet.cf.ruleType.dataBar",selectable:!1},value:me.dataBar},{label:{name:"sheet.cf.ruleType.iconSet",selectable:!1},value:me.icon},{label:{name:"sheet.cf.menu.manageConditionalFormatting",selectable:!1},value:me.viewRule},{label:{name:"sheet.cf.menu.createConditionalFormatting",selectable:!1},value:me.createRule},{label:{name:"sheet.cf.menu.clearRangeRules",selectable:!1},value:me.clearRangeRules,disabled:!1},{label:{name:"sheet.cf.menu.clearWorkSheetRules",selectable:!1},value:me.clearWorkSheetRules}],ro=t=>{const e=t.get(Y.SheetsSelectionsService),n=t.get(_.ICommandService),r=t.get(_.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(e.selectionMoveEnd$,e.selectionSet$,new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var T;const C=((T=e.getCurrentSelections())==null?void 0:T.map(h=>h.range))||[],m=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!m)return;const w=m.getActiveSheet();if(!w)return;const S=(a.getSubunitRules(m.getUnitId(),w.getSheetId())||[]).filter(h=>h.ranges.some(i=>C.some(s=>_.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>Y.checkRangesEditablePermission(t,m.getUnitId(),w.getSheetId(),h));p.next(S)})),u=new Ce.Observable(p=>new Ce.Observable(C=>{const m=n.onCommandExecuted(w=>{var T;const{id:E,params:I}=w,S=(T=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:T.getUnitId();Tn.includes(E)&&I.unitId===S&&C.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const C=r.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET);if(!C)return;const m=C.getActiveSheet();if(!m)return;const w=a.getSubunitRules(C.getUnitId(),m.getSheetId())||[];if(!w.length)return p.next(!1),!1;const E=w.map(I=>I.ranges).every(I=>Y.checkRangesEditablePermission(t,C.getUnitId(),m.getSheetId(),I));p.next(E)})),y=new Ce.Observable(p=>{o.subscribe(C=>{const m=ht.find(w=>w.value===me.clearRangeRules);m&&(m.disabled=!C,p.next(ht))}),u.subscribe(C=>{const m=ht.find(w=>w.value===me.clearWorkSheetRules);m&&(m.disabled=!C,p.next(ht))}),p.next(ht)});return{id:it.id,type:te.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:te.getMenuHiddenObservable(t,_.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(t,{workbookTypes:[Y.WorkbookEditablePermission],worksheetTypes:[Y.WorksheetSetCellStylePermission,Y.WorksheetEditPermission],rangeTypes:[Y.RangeProtectionPermissionEditPoint]})}},no={[te.RibbonStartGroup.FORMULAS_INSERT]:{[it.id]:{order:0,menuItemFactory:ro}}};var ao=Object.getOwnPropertyDescriptor,oo=(t,e,n,r)=>{for(var a=r>1?void 0:r?ao(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},wn=(t,e)=>(n,r)=>e(n,r,t);let Lt=class extends _.Disposable{constructor(e,n){super();De(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=n,this._menuManagerService.mergeMenu(no)}};Lt=oo([wn(0,_.Inject(_.Injector)),wn(1,te.IMenuManagerService)],Lt);var io=Object.getOwnPropertyDescriptor,so=(t,e,n,r)=>{for(var a=r>1?void 0:r?io(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},Be=(t,e)=>(n,r)=>e(n,r,t);const lo=(t,e)=>{const n=m=>m.endRow-m.startRow+1,r=m=>m.endColumn-m.startColumn+1,a=n(e)%n(t),o=r(e)%r(t),u=Math.floor(n(e)/n(t)),y=Math.floor(r(e)/r(t)),p=[],C={startRow:0,endRow:n(t)-1,startColumn:0,endColumn:r(t)-1};if(n(e)===1&&r(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return p.push({repeatRelativeRange:C,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let w=0;w<y+(o?.1:0);w++){const E=n(t)*m,I=r(t)*w,S={startRow:E+e.startRow,endRow:E+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let T=C;m===u&&a&&(T={...T},T.endRow=T.endRow-(n(t)-a)),w===y&&o&&(T={...T},T.endColumn=T.endColumn-(r(t)-o)),p.push({repeatRelativeRange:T,startRange:S})}return p};let Vt=class extends _.Disposable{constructor(e,n,r,a,o,u){super();De(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=n,this._formatPainterService=r,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),n=(o,u,y,p,C)=>{const{unitId:m,subUnitId:w}=this._painterConfig,{targetUnitId:E,targetSubUnitId:I}=C,S={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},T={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};_.Range.foreach(y,(h,i)=>{const s=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},S),f=_.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},T),b=this._conditionalFormattingViewModel.getCellCfs(m,w,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(E,I,f.startRow,f.startColumn);l&&l.forEach(g=>{let d=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(E,I,g.cfId);if(!v)return;d=new _.ObjectMatrix,v.ranges.forEach(x=>{_.Range.foreach(x,(M,z)=>{d.setValue(M,z,1)})}),p.set(g.cfId,d)}d.realDeleteValue(f.startRow,f.startColumn)}),b&&b.forEach(g=>{const d=p.get(g.cfId);d&&d.setValue(f.startRow,f.startColumn,1)})})},r=(o,u,y)=>{var s;const{range:p,unitId:C,subUnitId:m}=this._painterConfig,w=o!==C||m!==u,E=new Map,I=[],S=[];if(!o||!u||!C||!m)return e();const T=(s=this._conditionalFormattingRuleModel.getSubunitRules(C,m))!=null?s:[];T==null||T.forEach(f=>{const{ranges:b,cfId:l}=f;if(b.some(g=>_.Rectangle.intersects(p,g))){const g=new _.ObjectMatrix;w||b.forEach(d=>{_.Range.foreach(d,(v,x)=>{g.setValue(v,x,1)})}),E.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return lo(p,y).forEach(f=>{n(h,{row:f.startRange.startRow,col:f.startRange.startColumn},f.repeatRelativeRange,E,{targetUnitId:o,targetSubUnitId:u})}),E.forEach((f,b)=>{if(w){const l=this._conditionalFormattingRuleModel.getRule(o,u,b),g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(l)if(g.length){const d={unitId:o,subUnitId:u,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:o,subUnitId:u,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}else if(g.length){const d=this._conditionalFormattingRuleModel.getRule(C,m,b);if(d){const v={unitId:o,subUnitId:u,rule:{..._.Tools.deepClone(d),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:v}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(C,m,b);if(!l)return;const g=Y.findAllRectangle(Y.createTopMatrixFromMatrix(f));if(g.length){const d={unitId:C,subUnitId:m,rule:{...l,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:d}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,d))}else{const d={unitId:C,subUnitId:m,cfId:l.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:d}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,d))}}}),{undos:S,redos:I}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const C=(u=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),w=this._sheetsSelectionsService.getCurrentLastSelection(),E=w==null?void 0:w.range;C&&m&&E&&(this._painterConfig={unitId:C,subUnitId:m,range:E});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?r(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Vt=so([Be(0,_.Inject(_.Injector)),Be(1,_.Inject(_.IUniverInstanceService)),Be(2,_.Inject(fe.IFormatPainterService)),Be(3,_.Inject(Y.SheetsSelectionsService)),Be(4,_.Inject(c.ConditionalFormattingRuleModel)),Be(5,_.Inject(c.ConditionalFormattingViewModel))],Vt);var co=Object.getOwnPropertyDescriptor,uo=(t,e,n,r)=>{for(var a=r>1?void 0:r?co(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},ur=(t,e)=>(n,r)=>e(n,r,t);let Ut=class extends _.Disposable{constructor(t,e,n){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=n,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(_.UniverInstanceType.UNIVER_SHEET),e=n=>{const r=n.getUnitId(),a=this._renderManagerService.getRenderById(r);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,w=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(w)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(_.UniverInstanceType.UNIVER_SHEET).subscribe(n=>{n&&e(n)})}};Ut=uo([ur(0,_.Inject(c.ConditionalFormattingViewModel)),ur(1,_.IUniverInstanceService),ur(2,hr.IRenderManagerService)],Ut);var fo=Object.defineProperty,po=Object.getOwnPropertyDescriptor,ho=(t,e,n)=>e in t?fo(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,go=(t,e,n,r)=>{for(var a=r>1?void 0:r?po(e,n):e,o=t.length-1,u;o>=0;o--)(u=t[o])&&(a=u(a)||a);return a},dr=(t,e)=>(n,r)=>e(n,r,t),In=(t,e,n)=>ho(t,typeof e!="symbol"?e+"":e,n);$.UniverSheetsConditionalFormattingUIPlugin=class extends _.Plugin{constructor(e=xt,n,r,a){super(),this._config=e,this._injector=n,this._commandService=r,this._configService=a;const{menu:o,...u}=_.merge({},xt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(yn,u),this._initCommand()}onStarting(){_.registerDependencies(this._injector,[[dt],[ut],[lt],[Mt],[ct],[ot],[Lt],[Ae],[Nt],[$.ConditionalFormattingClearController],[Vt],[Ut]]),_.touchDependencies(this._injector,[[dt]])}onReady(){_.touchDependencies(this._injector,[[Lt],[ot]])}onRendered(){_.touchDependencies(this._injector,[[Mt],[$.ConditionalFormattingClearController],[lt],[Nt],[Ae],[Vt],[ct],[ut],[Ut]])}_initCommand(){[At,Wt,jt,Ht,Bt,Ft,Gt,qt,Xt,it].forEach(e=>{this._commandService.registerCommand(e)})}},In($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),In($.UniverSheetsConditionalFormattingUIPlugin,"type",_.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=go([_.DependentOn(c.UniverSheetsConditionalFormattingPlugin),dr(1,_.Inject(_.Injector)),dr(2,_.Inject(_.ICommandService)),dr(3,_.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=At,$.AddColorScaleConditionalRuleCommand=Wt,$.AddDataBarConditionalRuleCommand=jt,$.AddDuplicateValuesCfCommand=Ht,$.AddNumberCfCommand=Bt,$.AddRankCfCommand=Ft,$.AddTextCfCommand=Gt,$.AddTimePeriodCfCommand=qt,$.AddUniqueValuesCfCommand=Xt,$.OpenConditionalFormattingOperator=it,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
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"})});
180
163
 
181
164
 
182
165
  // index