@univerjs/preset-sheets-conditional-formatting 0.5.5 → 0.6.0-nightly.202502131606

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 +108 -117
  2. package/package.json +5 -5
package/lib/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @univerjs/sheets-conditional-formatting/index
2
- (function(C,c){typeof exports=="object"&&typeof module<"u"?c(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"],c):(C=typeof globalThis<"u"?globalThis:C||self,c(C.UniverSheetsConditionalFormatting={},C.UniverCore,C.rxjs,C.rxjs.operators,C.UniverEngineFormula,C.UniverEngineRender,C.UniverSheets))})(this,function(C,c,L,J,U,W,S){"use strict";var M0=Object.defineProperty;var x0=(C,c,L)=>c in C?M0(C,c,{enumerable:!0,configurable:!0,writable:!0,value:L}):C[c]=L;var w=(C,c,L)=>x0(C,typeof c!="symbol"?c+"":c,L);var r2;const u2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var M=(s=>(s.beginsWith="beginsWith",s.endsWith="endsWith",s.containsText="containsText",s.notContainsText="notContainsText",s.equal="equal",s.notEqual="notEqual",s.containsBlanks="containsBlanks",s.notContainsBlanks="notContainsBlanks",s.containsErrors="containsErrors",s.notContainsErrors="notContainsErrors",s))(M||{}),x=(s=>(s.today="today",s.yesterday="yesterday",s.tomorrow="tomorrow",s.last7Days="last7Days",s.thisMonth="thisMonth",s.lastMonth="lastMonth",s.nextMonth="nextMonth",s.thisWeek="thisWeek",s.lastWeek="lastWeek",s.nextWeek="nextWeek",s))(x||{}),v=(s=>(s.greaterThan="greaterThan",s.greaterThanOrEqual="greaterThanOrEqual",s.lessThan="lessThan",s.lessThanOrEqual="lessThanOrEqual",s.notBetween="notBetween",s.between="between",s.equal="equal",s.notEqual="notEqual",s))(v||{}),_=(s=>(s.highlightCell="highlightCell",s.dataBar="dataBar",s.colorScale="colorScale",s.iconSet="iconSet",s))(_||{}),p=(s=>(s.uniqueValues="uniqueValues",s.duplicateValues="duplicateValues",s.rank="rank",s.text="text",s.timePeriod="timePeriod",s.number="number",s.average="average",s.formula="formula",s))(p||{}),y=(s=>(s.num="num",s.min="min",s.max="max",s.percent="percent",s.percentile="percentile",s.formula="formula",s))(y||{});const O2="#fff",j2="#000000",P2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),$2=(s,a)=>{switch(s){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(a))return"";break}case"number":return["between","notBetween"].includes(a)?[10,100]:10}return""},W2=(s,a)=>{switch(s){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return a!==void 0?a:10}return""},V=(s,a,n)=>{if(!a)return null;const e=a.findIndex(t=>n(t)===s.id);if(e<0)return null;switch(s.type){case"after":return e+1;case"before":return e-1;case"self":return e}},F2=(s,a,n,e)=>{if(!n)return null;const t=V(s,n,e);let i=V(a,n,e);if(t===null||i===null||t===i)return;const r=n.splice(t,1)[0];switch(t<i&&(i=V(a,n,e)),a.type){case"before":{n.splice(i+1,0,r);break}case"self":case"after":{n.splice(i,0,r);break}}},w2=(s,a,n,e)=>{if(s.type==="after"&&["after","before"].includes(a.type))return[s,a];const t={...s},i={...a};if(t.type!=="after"){const r=V(t,n,e);if(r===null)return null;if(r-1<0){const o=n[r+1];if(o)t.id=e(o),t.type="before";else return null}else{const o=e(n[r-1]);t.id=o,t.type="after"}}if(!["after","before"].includes(i.type)){const r=V(i,n,e);if(r===null)return null;if(r===0)i.type="before";else if(r-1>=0){const o=e(n[r-1]);i.id=o,i.type="after"}else if(r+1<=n.length-1){const o=e(n[r+1]);i.id=o,i.type="before"}else return null}return t.id===i.id&&t.type===i.type?null:[t,i]},v2=(s,a)=>{if(["after","before"].includes(a.type)){if(s.type==="after")return[a,s];if(s.type==="before")return[a,{...s,type:"self"}]}return null},q2=(s,a)=>s.id===a.id&&s.type===a.type,E2=()=>`${c.Tools.generateRandomId(8)}`;class b{constructor(){w(this,"_model",new Map);w(this,"_ruleChange$",new L.Subject);w(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(a,n){let e=this.getSubunitRules(a,n);if(!e){e=[];let t=this._model.get(a);t||(t=new Map,this._model.set(a,t)),t.set(n,e)}return e}getRule(a,n,e){const t=this.getSubunitRules(a,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(a){return this._model.get(a)||null}getSubunitRules(a,n){var t;return((t=this._model.get(a))==null?void 0:t.get(n))||null}deleteRule(a,n,e){const t=this.getSubunitRules(a,n);if(t){const i=t.findIndex(o=>o.cfId===e),r=t[i];r&&(t.splice(i,1),this._ruleChange$.next({rule:r,subUnitId:n,unitId:a,type:"delete"}))}}setRule(a,n,e,t){const r=this._ensureList(a,n).find(o=>o.cfId===t);if(r){const o=c.Tools.deepClone(r);Object.assign(r,e),this._ruleChange$.next({rule:r,subUnitId:n,unitId:a,type:"set",oldRule:o})}}addRule(a,n,e){const t=this._ensureList(a,n);t.find(r=>r.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:a,type:"add"})}moveRulePriority(a,n,e,t){const i=this._ensureList(a,n),r=V(e,i,l=>l.cfId),o=V(t,i,l=>l.cfId);if(o===null||r===null||o===r)return;const h=i[r];h&&(F2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:h,subUnitId:n,unitId:a,type:"sort"}))}createCfId(a,n){return E2()}deleteUnitId(a){this._model.delete(a)}}const H={type:c.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var Z2=Object.defineProperty,G2=Object.getOwnPropertyDescriptor,H2=(s,a,n,e)=>{for(var t=e>1?void 0:e?G2(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&Z2(a,n,t),t},c2=(s,a)=>(n,e)=>a(n,e,s),R=(s=>(s[s.NOT_REGISTER=1]="NOT_REGISTER",s[s.SUCCESS=2]="SUCCESS",s[s.WAIT=3]="WAIT",s[s.ERROR=4]="ERROR",s))(R||{});const X2=s=>{const a=s&&s[0]&&s[0][0];return(a==null?void 0:a.t)===c.CellValueType.BOOLEAN?a.v===c.BooleanNumber.TRUE||a.v===!0:a?a.v:!1};C.ConditionalFormattingFormulaService=class extends c.Disposable{constructor(n,e,t){super();w(this,"_formulaMap",new Map);w(this,"_result$",new L.Subject);w(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 _.colorScale:return e.config.some(t=>t.value.type===y.formula);case _.dataBar:return[e.config.max,e.config.min].some(t=>t.type===y.formula);case _.iconSet:return e.config.some(t=>t.value.type===y.formula)}};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(e=>{const{unitId:t,subUnitId:i,rule:r,oldRule:o}=e;e.type==="delete"&&this._removeFormulaByCfId(t,i,r.cfId),e.type==="set"&&(n(r.rule)||o&&n(o.rule))&&this._removeFormulaByCfId(t,i,r.cfId)}))}_initFormulaCalculationResultChange(){this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===U.SetFormulaCalculationResultMutation.id){const e=n.params;for(const t in e.unitOtherData)for(const i in e.unitOtherData[t])for(const r in e.unitOtherData[t][i]){const o=new c.ObjectMatrix(e.unitOtherData[t][i][r]),h=this._ensureSubunitFormulaMap(t,i).getValue(r,["formulaId"]);if(!h)continue;const l=h.ranges;if(!l)continue;const u=h.result,d=l[0].startRow,g=l[0].startColumn;o.forValue((F,E,A)=>{u.setValue(d+F,g+E,X2(A))}),h.status=2;const m=this._getAllFormulaResultByCfId(t,i,h.cfId).every(F=>F.status===2);this._result$.next({...h,isAllFinished:m})}}})),this._activeDirtyManagerService.register(H.id,{commandId:H.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 c.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,r=[{startRow:0,endRow:0,startColumn:0,endColumn:0}]){const o=this._ensureSubunitFormulaMap(n,e),h=this.createCFormulaId(t,i);if(o.getValue(h,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:h,ranges:r,formulaId:l,status:3,result:new c.ObjectMatrix});const u={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:r}}};this._commandService.executeCommand(U.SetOtherFormulaMutation.id,u,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(H.id,{[n]:{[e]:{[l]:!0}}},{onlyLocal:!0})})}_removeFormulaByCfId(n,e,t){const r=this.deleteCache(n,e,t).map(o=>o.formulaId);this._commandService.executeCommand(U.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:r},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,r=0,o=0){const h=this.getSubUnitFormulaMap(n,e);if(!h)return{status:1};const l=h.getValue(this.createCFormulaId(t,i),["id"]);return l?l.status===2&&l.result?{result:l.result.getValue(r,o),status:2}:l.status===3?{status:3}:{status:4}:{status:1}}getFormulaMatrix(n,e,t,i){const r=this.getSubUnitFormulaMap(n,e);if(!r)return{status:1};const o=r.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 r=this.getSubUnitFormulaMap(n,e);if(!r)return[];if(i){const o=this.createCFormulaId(t,i);return r.deleteValue(o,["id"]),[]}else{const o=r.getValues().filter(h=>h.cfId===t);return o.forEach(h=>{r.deleteValue(h.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}_${c.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},C.ConditionalFormattingFormulaService=H2([c2(0,c.Inject(c.ICommandService)),c2(1,c.Inject(U.IActiveDirtyManagerService)),c2(2,c.Inject(b))],C.ConditionalFormattingFormulaService);var T=(s=>(s.preComputingStart="preComputingStart",s.preComputing="preComputing",s.preComputingEnd="preComputingEnd",s.preComputingError="preComputingError",s))(T||{});class z{constructor(a){w(this,"_cache");w(this,"_preComputingStatus$",new L.BehaviorSubject("preComputingStart"));w(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(J.distinctUntilChanged()));w(this,"_preComputingCache");w(this,"_rule");this._context=a,this._cache=new c.LRUMap(a.limit),this._rule=a.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(a){this._cache.limit=a}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(a){this._rule=a,this.resetPreComputingCache()}getCell(a,n){const e=this._createKey(a,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(a,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(a,n,this._getContext()),t=this.getPreComputingResult(a,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(a,n,t,this._getContext());return i!==null&&this._setCache(a,n,i),i}setPreComputingCache(a){this._preComputingCache=a}getPreComputingResult(a,n){return this._preComputingCache}_createKey(a,n){return`${a}_${n}`}_setCache(a,n,e){const t=this._createKey(a,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(a=>{a==="preComputingEnd"&&this.clearCache()})}}function X(s,a){return Math.abs(s-a)<Number.EPSILON}const I=s=>[void 0,null].includes(s),k=s=>{var e,t;if(!s)return null;if(s.t===c.CellValueType.BOOLEAN)return s.v===c.BooleanNumber.TRUE?U.BooleanValue.TRUE:U.BooleanValue.FALSE;const a=s.v,n=(t=(e=s.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return I(a)?I(n)?null:n:a},d2=86400;function p2(s,a=!0){if(a&&s>=0){if(s===0)return[1900,1,0];if(s===60)return[1900,2,29];if(s<60)return[1900,s<32?1:2,(s-1)%31+1]}let n=s+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),r=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,r|0]}const A2=s=>{let a=s|0;const n=d2*(s-a);let e=Math.floor(n);n-e>.9999&&(e+=1,e===d2&&(e=0,a+=1));const t=e<0?d2+e:e,[i,r,o]=p2(s,!0),h=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,u=Math.floor(t)%60;return c.dayjs(`${i}/${r}/${o} ${h}:${l}:${u}`).valueOf()},Y=(s,a,n)=>{switch(s.type){case y.max:{let e=0;return a.forValue((t,i,r)=>{r>e&&(e=r)}),{status:R.SUCCESS,result:e}}case y.min:{let e;return a.forValue((t,i,r)=>{e===void 0&&(e=r),r<e&&(e=r)}),{status:R.SUCCESS,result:e}}case y.percent:{let e,t;a.forValue((o,h,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),r=Math.max(Math.min(Number(s.value)||0,100),0);return{status:R.SUCCESS,result:i*(r/100)+(t||0)}}case y.percentile:{const e=a.toNativeArray().sort((l,u)=>l-u),t=Math.max(Math.min(Number(s.value)||0,100),0),i=(e.length-1)*t/100,r=Math.floor(i),o=i-r,h=e[r]+(e[Math.min(r+1,e.length-1)]-e[r])*o;return{status:R.SUCCESS,result:h}}case y.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:r}=n,o=String(s.value),h=e.get(C.ConditionalFormattingFormulaService);return h.registerFormulaWithRange(t,i,r,o),h.getFormulaResultWithCoords(t,i,r,o)}case y.num:{const e=Number(s.value);return{status:R.SUCCESS,result:Number.isNaN(e)?0:e}}}},Y2=(s,a,n,e)=>{const{accessor:t}=e,i=t.get(C.ConditionalFormattingViewModel),r=new c.ObjectMatrix;return n.ranges.forEach(o=>{c.Range.foreach(o,(h,l)=>{const u=i.getCellCfs(s,a,h,l);if(u){const d=u.find(g=>g.cfId===n.cfId);d!=null&&d.result&&r.setValue(h,l,d.result)}})}),r},q=(s,a)=>{switch(s.operator){case v.between:{if(typeof s.value!="object"||!s.value.length)return;const n=Math.min(...s.value),e=Math.max(...s.value);return a>=n&&a<=e}case v.notBetween:{if(typeof s.value!="object"||!s.value.length)return;const n=Math.min(...s.value),e=Math.max(...s.value);return!(a>=n&&a<=e)}case v.equal:{const n=s.value||0;return X(n,a)}case v.notEqual:{const n=s.value||0;return!X(n,a)}case v.greaterThan:{const n=s.value||0;return a>n}case v.greaterThanOrEqual:{const n=s.value||0;return a>=n}case v.lessThan:{const n=s.value||0;return a<n}case v.lessThanOrEqual:{const n=s.value||0;return a<=n}default:return!1}},_2=s=>{switch(s){case v.greaterThan:return v.lessThanOrEqual;case v.greaterThanOrEqual:return v.lessThan;case v.lessThan:return v.greaterThanOrEqual;case v.lessThanOrEqual:return v.greaterThan}return s},y2=(s,a)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=s.findIndex(i=>i.value>=a),t=e-1;if(e===0)return s[0].color.toRgbString();if(t>=0){const i=s[t],r=s[e];if(i.color.isValid&&r.color.isValid){const o=n(i.color.toRgb()),h=n(r.color.toRgb()),l=r.value-i.value,u=(a-i.value)/l,d=["r","g","b","a"].reduce((f,m)=>{const F=o[m];return f[m]=(h[m]-F)*u+F,f},{});return new c.ColorKit(d).toRgbString()}}else return s[s.length-1].color.toRgbString()},Q=(s,a,n)=>s.map(e=>{if(e.startColumn>n||e.startRow>a)return null;const t={...e};return t.endRow=Math.min(t.endRow,a),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function K2(s){let a=0;return new c.ObjectMatrix(s).forValue((n,e,t)=>{a=Math.max(Number.isNaN(a)?0:a,Number(t))}),a}class J2 extends z{preComputing(a,n,e){const t=e.rule,i=e.worksheet,r=new c.ObjectMatrix;!t.rule.config.every(u=>u.value.type===y.num)&&Q(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(g,f)=>{const m=e.getCellValue(g,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&r.setValue(g,f,E)}})});const h=[...t.rule.config].sort((u,d)=>u.index-d.index).map(u=>({value:Y(u.value,r,{...e,cfId:t.cfId}),color:new c.ColorKit(u.color)}));if(!h.some(u=>W.isObject(u.value)?u.value.status!==R.SUCCESS:!1)){const u=h.map(d=>d.color).reduce((d,g,f)=>(d.result.push({color:g,value:d.sortValue[f]}),d),{result:[],sortValue:h.map(d=>d.value.result).sort((d,g)=>d-g)}).result;this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t.getCellValue(a,n);if(i.t===c.CellValueType.NUMBER){const r=Number(i.v);if(!Number.isNaN(r))return y2(e,r)}}}const M2="sheet-conditional-rule-data-bar",h2="#ffbe38",g2="#abd91a",x2="#000",z2=34;class R2 extends W.SheetExtension{constructor(){super(...arguments);w(this,"_paddingRightAndLeft",2);w(this,"_paddingTopAndBottom",2);w(this,"uKey",M2);w(this,"Z_INDEX",z2);w(this,"_radius",1)}draw(n,e,t,i){const{worksheet:r}=t;if(!r)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!r.getRowVisible(o)||!r.getColVisible(h))return;const l=r.getCell(o,h);if(l&&l.dataBar){const{color:u,value:d,startPoint:g,isGradient:f}=l.dataBar,m=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:F,isMergedMainCell:E,mergeInfo:A,startY:B,endY:N,startX:O,endX:a2}=m;if(F||(E&&(B=A.startY,N=A.endY,O=A.startX,a2=A.endX),!this.isRenderDiffRangesByCell(A,i)))return;const l2=a2-O,m2=N+W.FIX_ONE_PIXEL_BLUR_OFFSET-B,o2=l2-this._paddingRightAndLeft*2,V2=m2-this._paddingTopAndBottom*2;if(d>0){const G=Math.max(o2*(1-g/100)*d/100,1),j=O+this._paddingRightAndLeft+g/100*o2,P=B+this._paddingTopAndBottom;if(f){const $=n.createLinearGradient(j,P,j+G,P);$.addColorStop(0,u),$.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=$,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,P,G,V2,!1,!0,!0,!1),f&&n.stroke()}else{const G=Math.max(o2*g/100*Math.abs(d)/100,1),j=O+this._paddingRightAndLeft+g/100*o2-G,P=B+this._paddingTopAndBottom;if(f){const $=n.createLinearGradient(j,P,j+G,P);$.addColorStop(0,"rgb(255 255 255)"),$.addColorStop(1,u),n.fillStyle=$,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,P,G,V2,!0,!1,!1,!0),f&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,r,o,h,l,u){const d=this._radius;!r||!i||(n.beginPath(),n.moveTo(e+d,t),n.lineTo(e+i-d,t),h?n.arcTo(e+i,t,e+i,t+d,d):n.lineTo(e+i,t),n.lineTo(e+i,t+r-d),l?n.arcTo(e+i,t+r,e+i-d,t+r,d):n.lineTo(e+i,t+r),n.lineTo(e+d,t+r),u?n.arcTo(e,t+r,e,t+r-d,d):n.lineTo(e,t+r),n.lineTo(e,t+d),o?n.arcTo(e,t,e+d,t,d):n.lineTo(e,t),n.closePath(),n.fill())}}W.SpreadsheetExtensionRegistry.add(R2);const e2=s=>Math.max(Math.min(100,s),0),Q2=(s,a,n)=>{const e=n(s,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class e0 extends z{preComputing(a,n,e){const t=e.rule,i=t.rule,r=e.worksheet,o=new c.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(f=>f.type===y.num)&&Q(t.ranges,r.getMaxRows()-1,r.getMaxColumns()-1).forEach(m=>{c.Range.foreach(m,(F,E)=>{const A=e.getCellValue(F,E),B=A&&A.v;if(!I(B)&&(A==null?void 0:A.t)===c.CellValueType.NUMBER){const N=Number(B);!Number.isNaN(N)&&o.setValue(F,E,N)}})});const l=Y(i.config.min,o,{...e,cfId:t.cfId}),u=Y(i.config.max,o,{...e,cfId:t.cfId});let d=0,g=0;if(l.status===R.SUCCESS){const f=Number(l.result);d=Number.isNaN(f)?0:f}else{this._preComputingStatus$.next(T.preComputing);return}if(u.status===R.SUCCESS){const f=Number(u.result),m=Number.isNaN(f)?0:f;g=Math.max(m,d),d=Math.min(m,d);let F=50;if(d<0&&g<=0)F=100;else if(d<0&&g>0){const E=Math.abs(g)+Math.abs(d);F=Math.abs(d)/E*100}else d>=0&&g>0&&(F=0);this.setPreComputingCache({min:d,max:g,startPoint:F}),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){const{min:i,max:r,startPoint:o}=e,l=t.rule.rule,u=l.isShowValue,d=l.config.isGradient,g=Q2(a,n,t.getCellValue);if(!(g===null||g<i||i===r||r<i)){if(g===0)return{color:x2,startPoint:o,value:0,isGradient:d,isShowValue:u};if(i<0&&r<=0){const f=r-i,m=e2((r-g)/f*100);return m===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-m,isGradient:d,isShowValue:u}}else if(i<0&&r>0)if(g>0){const f=e2(Math.min(g/r,1)*100);return f===0?void 0:{color:l.config.positiveColor||h2,startPoint:o,value:f,isGradient:d,isShowValue:u}}else{const f=e2(Math.min(Math.abs(g)/Math.abs(i),1)*100);return f===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-f,isGradient:d,isShowValue:u}}else if(i>=0&&r>0){const f=r-i,m=0,F=e2((1-(r-g)/f)*100);return F===0?void 0:{color:l.config.positiveColor||h2,startPoint:m,value:F,isGradient:d,isShowValue:u}}}}}class t0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case p.average:{let h=0,l=0;return i.forEach(u=>{c.Range.foreach(u,(d,g)=>{const f=e.getCellValue(d,g),m=k(f||void 0);f&&f.t===c.CellValueType.NUMBER&&m!==void 0&&(h+=Number(m)||0,l++)})}),{value:h/l,type:t.subType}}case p.uniqueValues:case p.duplicateValues:{const h=new Map;return i.forEach(l=>{c.Range.foreach(l,(u,d)=>{const g=e.getCellValue(u,d),f=k(g||void 0);if(f!==void 0){const m=h.get(f);m?h.set(f,m+1):h.set(f,1)}})}),{value:h,type:t.subType}}case p.rank:{const h=[];i.forEach(d=>{c.Range.foreach(d,(g,f)=>{const m=e.getCellValue(g,f),F=k(m||void 0);m&&m.t===c.CellValueType.NUMBER&&F!==void 0&&h.push(Number(F)||0)})}),h.sort((d,g)=>g-d);const l=e.rule.rule,u=l.isPercent?Math.floor(Math.max(Math.min(l.value,100),0)/100*h.length):Math.floor(Math.max(Math.min(l.isBottom?l.value-1:l.value,h.length),0));return l.isBottom?{value:h[h.length-u-1],type:t.subType}:{value:h[Math.max(u-1,0)],type:t.subType}}case p.formula:{const h=t,l=e.accessor.get(C.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,h.value,e.rule.ranges);const u=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,h.value);return u&&u.status===R.SUCCESS?(this._preComputingStatus$.next(T.preComputingEnd),{value:u.result,type:t.subType}):(this._preComputingStatus$.next(T.preComputing),null)}case p.timePeriod:switch(t.operator){case x.last7Days:return{value:{start:c.dayjs().subtract(7,"day").valueOf(),end:c.dayjs().valueOf()},type:t.subType};case x.lastMonth:return{value:{start:c.dayjs().startOf("month").subtract(1,"month").valueOf(),end:c.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case x.lastWeek:return{value:{start:c.dayjs().startOf("week").subtract(1,"week").valueOf(),end:c.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case x.nextMonth:return{value:{start:c.dayjs().startOf("month").add(1,"month").valueOf(),end:c.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case x.nextWeek:return{value:{start:c.dayjs().startOf("week").add(1,"week").valueOf(),end:c.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case x.thisMonth:return{value:{start:c.dayjs().startOf("month").valueOf(),end:c.dayjs().endOf("month").valueOf()},type:t.subType};case x.thisWeek:return{value:{start:c.dayjs().startOf("week").valueOf(),end:c.dayjs().endOf("week").valueOf()},type:t.subType};case x.today:return{value:{start:c.dayjs().startOf("day").valueOf(),end:c.dayjs().endOf("day").valueOf()},type:t.subType};case x.tomorrow:return{value:{start:c.dayjs().startOf("day").add(1,"day").valueOf(),end:c.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case x.yesterday:return{value:{start:c.dayjs().startOf("day").subtract(1,"day").valueOf(),end:c.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(a,n,e,t){const i=t.getCellValue(a,n),r=t.rule.rule;return(()=>{switch(r.subType){case p.number:{const l=i&&Number(i.v);if(I(l)||Number.isNaN(l)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER)return;const u=r;return q({operator:u.operator,value:u.value||0},l||0)}case p.text:{const l=r,u=k(i),d=u===null?"":String(u),g=l.value||"";switch(l.operator){case M.beginsWith:return d.startsWith(g);case M.containsBlanks:return/^\s*$/.test(d);case M.notContainsBlanks:return!/^\s*$/.test(d);case M.containsErrors:return U.ERROR_TYPE_SET.has(d);case M.notContainsErrors:return!U.ERROR_TYPE_SET.has(d);case M.containsText:return d.indexOf(g)>-1;case M.notContainsText:return d.indexOf(g)===-1;case M.endsWith:return d.endsWith(g);case M.equal:return d===g;case M.notEqual:return d!==g;default:return!1}}case p.timePeriod:{const l=k(i);if(I(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return;const u=A2(Number(l)),{start:d,end:g}=e.value;return u>=d&&u<=g}case p.average:{const l=i&&i.v,u=Number(l);if(I(l)||Number.isNaN(u)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return!1;const d=r,g=e.value;switch(d.operator){case v.greaterThan:return u>g;case v.greaterThanOrEqual:return u>=g;case v.lessThan:return u<g;case v.lessThanOrEqual:return u<=g;case v.equal:return X(u,g);case v.notEqual:return!X(u,g);default:return!1}}case p.rank:{const l=k(i),u=Number(l);if(I(l)||Number.isNaN(u)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return!1;const d=e.value;return r.isBottom?u<=d:u>=d}case p.uniqueValues:{const l=k(i);return I(l)||!e?!1:e.value.get(l)===1}case p.duplicateValues:{const l=k(i);return I(l)||!e?!1:e.value.get(l)!==1}case p.formula:{const l=e==null?void 0:e.value;return l?l.getValue(a,n)===!0:!1}}})()?r.style:{}}}const n0=(s,a,n)=>{const e=n(s,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class i0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.worksheet,r=new c.ObjectMatrix;!t.config.every(u=>u.value.type===y.num)&&Q(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(g,f)=>{const m=e.getCellValue(g,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&r.setValue(g,f,E)}})});const h=t.config.map(u=>Y(u.value,r,{...e,cfId:e.rule.cfId}));if(!h.some(u=>u.status!==R.SUCCESS)){const u=h.map((d,g)=>({operator:t.config[g].operator,value:Number(d.result)||0})).reduce((d,g,f,m)=>{const F=t.config[f];if(!f||f===m.length-1)d.push({...g,iconId:F.iconId,iconType:F.iconType});else{const E=m[f-1];q(E,g.value)||d.push({...g,iconId:F.iconId,iconType:F.iconType})}return d},[]);this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=n0(a,n,t.getCellValue);if(i===null)return;const r=t.rule.rule,o=r.isShowValue===void 0?!0:!!r.isShowValue;for(let h=0;h<e.length;h++){const l=e[h],u={...l},d={...l},{iconId:g,iconType:f}=l;if(h===0){if(q(l,i))return{iconId:g,iconType:f,isShowValue:o}}else{if(h===e.length-1)return{iconId:g,iconType:f,isShowValue:o};{const m=e[h-1];if(d.operator=_2(m.operator),d.value=m.value,q(u,i)&&q(d,i))return{iconId:g,iconType:f,isShowValue:o}}}}}}var s0=Object.defineProperty,r0=Object.getOwnPropertyDescriptor,a0=(s,a,n,e)=>{for(var t=e>1?void 0:e?r0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&s0(a,n,t),t},t2=(s,a)=>(n,e)=>a(n,e,s);const n2=50*20*3*3;C.ConditionalFormattingViewModel=class extends c.Disposable{constructor(n,e,t,i){super();w(this,"_calculateUnitManagers",new Map);w(this,"_rTreeManager",new c.RTree);w(this,"_cellCache",new c.LRUMap(n2));w(this,"_markDirty$",new L.Subject);w(this,"markDirty$",this._markDirty$.asObservable());w(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})});w(this,"markRuleDirty",(()=>{const n=new L.Subject;return this.disposeWithMe(n.pipe(J.bufferTime(100),J.filter(e=>!!e.length),J.map(e=>{const t=new Set,i=[];return e.forEach(r=>{const o=`${r.unitId}_${r.subUnitId}_${r.cfId}`;if(t.has(o)){if(r.isNeedResetPreComputingCache){const h=i.find(l=>l.cfId===r.cfId);h.isNeedResetPreComputingCache=!0}return}t.add(o),i.push({...r})}),i})).subscribe(e=>{e.forEach(t=>{this._markRuleDirtyAtOnce(t.unitId,t.subUnitId,t.cfId,t.isNeedResetPreComputingCache)})})),(e,t,i,r=!0)=>{n.next({unitId:e,subUnitId:t,cfId:i,isNeedResetPreComputingCache:r})}})());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 r=this._createCacheKey(n,e,t,i);if(this._cellCache.has(r))return this._cellCache.get(r);const o=this._getCellCfs(n,e,t,i);return o.length&&this._cellCache.set(r,o),o}_getCellCfs(n,e,t,i){var d;const r=(d=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?d:[],o=this._ensureCalculateUnitManager(n,e),h=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=r.filter(g=>h.has(g.cfId));return l.length?l.map(g=>{const f=o.get(g.cfId);return f?{cfId:g.cfId,result:f.getCell(t,i)}:null}).filter(g=>!!g).map((g,f)=>({...g,priority:f})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===_.highlightCell&&i.rule.subType===p.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:r,ranges:o}=i,h=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,r),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:r,range:u})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;h.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:r,range:l}))),h.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(u=>({unitId:e,sheetId:t,id:l.cfId,range:u}))),this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:r,range:u}))),l.rule.type!==i.rule.type){const u=this._createRuleCalculateUnitInstance(e,t,i);if(!u)return;h.delete(l.cfId),h.set(i.cfId,u)}else{const u=h.get(l.cfId);if(!u)return;u.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),r=i==null?void 0:i.getSheetBySheetId(e);if(!i||!r)return;const o={workbook:i,worksheet:r,unitId:n,subUnitId:e,accessor:this._injector,rule:t,limit:n2,getCellValue:(h,l)=>r.getCellRaw(h,l)||{}};switch(t.rule.type){case _.colorScale:return new J2(o);case _.dataBar:return new e0(o);case _.highlightCell:return new t0(o);case _.iconSet:return new i0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=n2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},C.ConditionalFormattingViewModel=a0([t2(0,c.Inject(c.Injector)),t2(1,c.Inject(b)),t2(2,c.Inject(C.ConditionalFormattingFormulaService)),t2(3,c.IUniverInstanceService)],C.ConditionalFormattingViewModel);const l0={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"},o0={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"},u0={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"},c0={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"},d0={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"},h0=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"}'),D={feedback:l0,star:o0,progress:u0,signal:c0,feeling:d0,arrow:h0,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","rhomboid-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%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%23FFBD37%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"}},I2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[D.arrow["up-green"],D.arrow["right-gold"],D.arrow["down-red"]]},{name:"3ArrowsGray",list:[D.arrow["up-gray"],D.arrow["right-gray"],D.arrow["down-gray"]]},{name:"4Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"4ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"5Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["right-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"5ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["right-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"3Triangles",list:[D.shape.up,D.shape.cross,D.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"]]},{name:"3Signs",list:[D.shape["roundness-greed"],D.shape["triangle-gold"],D.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[D.shape["indicate-greed"],D.shape["indicate-gold"],D.shape["indicate-red"]]},{name:"4RedToBlack",list:[D.shape["roundness-red"],D.shape["roundness-pink"],D.shape["roundness-gray"],D.shape["roundness-black"]]},{name:"4TrafficLights",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"],D.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[D.feedback.correct,D.feedback.warn,D.feedback.mistake]},{name:"3Symbols2",list:[D.feedback2.correct2,D.feedback2.warn2,D.feedback2.mistake2]},{name:"3Flags",list:[D.flag["flag-green"],D.flag["flag-gold"],D.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Rating",list:[D.signal.signal0,D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Quarters",list:[D.progress.progress100,D.progress.progress75,D.progress.progress50,D.progress.progress25,D.progress.progress0]},{name:"_5Felling",list:[D.feeling.guffaw,D.feeling.smile,D.feeling.noninductive,D.feeling.dissatisfied,D.feeling.impatient]},{name:"5Boxes",list:[D.cell["cell-100"],D.cell["cell-75"],D.cell["cell-50"],D.cell["cell-25"],D.cell["cell-0"]]},{name:"3Stars",list:[D.star.starFull,D.star.starIncomplete,D.star.starEmpty]}]}],K=I2.reduce((s,a)=>{const{group:n}=a;for(const e of n)s[e.name]=e.list;return s},{});for(const s in K){const a=K[s];Object.freeze(a)}const S2="EMPTY_ICON_TYPE",i2={type:c.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=a;return s.get(b).moveRulePriority(n,e,t,i),!0}},g0=s=>{const{unitId:a,subUnitId:n}=s,e=v2(s.start,s.end);if(!e)return[];const[t,i]=e;return[{id:i2.id,params:{unitId:a,subUnitId:n,start:t,end:i}}]},b2=(s,a)=>{const n=s.get(b),{unitId:e,subUnitId:t,cfId:i}=a,r=[...n.getSubunitRules(e,t)||[]],o=r.findIndex(l=>l.cfId===i),h=r[o-1];if(o>-1){const l=r[o],u=[{id:C2.id,params:{unitId:e,subUnitId:t,rule:c.Tools.deepClone(l)}}];if(r.splice(o,1),o!==0){const d=r[0];if(d){const g=w2({id:d.cfId,type:"before"},{id:h.cfId,type:"after"},r,E=>E.cfId);if(!g)return u;const[f,m]=g,F={unitId:e,subUnitId:t,start:f,end:m};u.push({id:i2.id,params:F})}}return u}return[]},s2={type:c.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,cfId:t}=a;return s.get(b).deleteRule(n,e,t),!0}},C0=(s,a)=>({id:s2.id,params:{unitId:a.unitId,subUnitId:a.subUnitId,cfId:a.rule.cfId}}),C2={type:c.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a;return s.get(b).addRule(n,e,t),!0}},D2={type:c.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(s,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a,i=a.cfId||a.rule.cfId;return s.get(b).setRule(n,e,t,i),!0}},D0=(s,a)=>{const n=s.get(b),{unitId:e,subUnitId:t}=a,i=a.cfId||a.rule.cfId,r=n.getRule(e,t,i);return r?[{id:D2.id,params:{unitId:e,subUnitId:t,cfId:i,rule:c.Tools.deepClone(r)}}]:[]},f0="ssheets-conditional-formatting.config",L2={};var m0=Object.defineProperty,F0=Object.getOwnPropertyDescriptor,w0=(s,a,n,e)=>{for(var t=e>1?void 0:e?F0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&m0(a,n,t),t},Z=(s,a)=>(n,e)=>a(n,e,s);C.ConditionalFormattingService=class extends c.Disposable{constructor(a,n,e,t,i,r){super(),this._conditionalFormattingRuleModel=a,this._injector=n,this._univerInstanceService=e,this._resourceManagerService=t,this._sheetInterceptorService=i,this._commandService=r,this._initCellChange(),this._initSnapshot(),this._initSheetChange()}get _conditionalFormattingViewModelV2(){return this._injector.get(C.ConditionalFormattingViewModel)}composeStyle(a,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(a,n,e,t);if(i&&(i!=null&&i.length)){const r=i.map(l=>this._conditionalFormattingRuleModel.getRule(a,n,l.cfId)).filter(l=>!!l).reverse(),o=r.findIndex(l=>l==null?void 0:l.stopIfTrue);return o>-1&&r.splice(o+1),r.reduce((l,u)=>{var f;const d=u.rule.type,g=i.find(m=>m.cfId===u.cfId);if(d===_.highlightCell)g.result&&c.Tools.deepMerge(l,{style:g.result});else if(d===_.colorScale){const m=g==null?void 0:g.result;m&&typeof m=="string"&&(l.style={...(f=l.style)!=null?f:{},bg:{rgb:m}})}else if(d===_.dataBar){const m=g==null?void 0:g.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(d===_.iconSet){const m=g==null?void 0:g.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const a=e=>{const t=this._conditionalFormattingRuleModel.getUnitRules(e),i={};return t?(t.forEach((r,o)=>{i[o]=r}),JSON.stringify(i)):""},n=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:u2,businesses:[c.UniverInstanceType.UNIVER_SHEET],toJson:e=>a(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:a=>{if(a.id===S.RemoveSheetCommand.id){const n=a.params,e=n.unitId||v0(this._univerInstanceService),t=n.subUnitId||E0(this._univerInstanceService);if(!t)return{redos:[],undos:[]};const i=this._conditionalFormattingRuleModel.getSubunitRules(e,t);if(!i)return{redos:[],undos:[]};const r=[],o=[];return i.forEach(h=>{const l={unitId:e,subUnitId:t,cfId:h.cfId};r.push({id:s2.id,params:l}),o.push(...b2(this._injector,l))}),{redos:r,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{const n=(e,t,i)=>{const r=new Set;return i.forEach(([o,h])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,h);l==null||l.forEach(u=>r.add(u.cfId))}),[...r].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(a.id){case S.SetRangeValuesMutation.id:{const e=a.params,{subUnitId:t,unitId:i,cellValue:r}=e,o=[];new c.ObjectMatrix(r).forValue((l,u,d)=>{d&&Object.keys(d).some(f=>["p","v"].includes(f))&&o.push([l,u])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case S.InsertColMutation.id:case S.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};r&&r.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.RemoveRowMutation.id:case S.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};r&&r.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:r}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,r),h={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,r,u.cfId)});break}case S.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:r}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,r),h={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,r,u.cfId)});break}case S.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=a.params,r=o=>{const h=[];new c.ObjectMatrix(o.value).forValue((u,d)=>{h.push([u,d])}),n(e,o.subUnitId,h).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,u.cfId)})};r(t),r(i);break}case S.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,r=this._conditionalFormattingRuleModel.getSubunitRules(t,i);r&&r.filter(h=>h.ranges.some(l=>c.Rectangle.intersects(l,e))).forEach(h=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,h.cfId)});break}}}))}},C.ConditionalFormattingService=w0([Z(0,c.Inject(b)),Z(1,c.Inject(c.Injector)),Z(2,c.Inject(c.IUniverInstanceService)),Z(3,c.Inject(c.IResourceManagerService)),Z(4,c.Inject(S.SheetInterceptorService)),Z(5,c.Inject(c.ICommandService))],C.ConditionalFormattingService);const v0=s=>s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId(),E0=s=>{var a;return(a=s.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:a.getSheetId()};var p0=Object.defineProperty,A0=Object.getOwnPropertyDescriptor,_0=(s,a,n,e)=>{for(var t=e>1?void 0:e?A0(a,n):a,i=s.length-1,r;i>=0;i--)(r=s[i])&&(t=(e?r(a,n,t):r(t))||t);return e&&t&&p0(a,n,t),t},f2=(s,a)=>(n,e)=>a(n,e,s);C.UniverSheetsConditionalFormattingPlugin=(r2=class extends c.Plugin{constructor(a=L2,n,e,t){super(),this._config=a,this._injector=n,this._commandService=e,this._configService=t;const{...i}=c.merge({},L2,this._config);this._configService.setConfig(f0,i),[[C.ConditionalFormattingService],[C.ConditionalFormattingFormulaService],[b],[C.ConditionalFormattingViewModel]].forEach(r=>{this._injector.add(r)}),[C2,s2,D2,i2,H].forEach(r=>{this._commandService.registerCommand(r)})}onStarting(){this._injector.get(C.ConditionalFormattingService),c.touchDependencies(this._injector,[[C.ConditionalFormattingService],[C.ConditionalFormattingViewModel]])}},w(r2,"pluginName",u2),w(r2,"type",c.UniverInstanceType.UNIVER_SHEET),r2),C.UniverSheetsConditionalFormattingPlugin=_0([f2(1,c.Inject(c.Injector)),f2(2,c.Inject(c.ICommandService)),f2(3,c.IConfigService)],C.UniverSheetsConditionalFormattingPlugin);const T2="sheet-conditional-rule-icon",y0=35,B2=15,k2=2;class N2 extends W.SheetExtension{constructor(){super();w(this,"_paddingRightAndLeft",k2);w(this,"_width",B2);w(this,"_imageMap",new Map);w(this,"uKey",T2);w(this,"Z_INDEX",y0);w(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:r}=t;if(!r)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!r.getRowVisible(o)||!r.getColVisible(h))return;const l=r.getCell(o,h);if(l!=null&&l.iconSet){const{iconType:u,iconId:d}=l.iconSet;if(u===S2)return;const g=this._imageMap.get(this._createKey(u,d));if(!g)return;const f=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:m,isMergedMainCell:F,mergeInfo:E,startY:A,endY:B,startX:N,endX:O}=f;if(m||(F&&(A=E.startY,B=E.endY,N=E.startX,O=E.endX),!this.isRenderDiffRangesByCell(E,i)))return;const a2=O-N,l2=B-A;if(this._width>l2||this._width>a2+this._paddingRightAndLeft*2)return;const m2=(l2-this._width)/2+A;n.drawImage(g,N+this._paddingRightAndLeft,m2,this._width,this._width)}}),n.restore()}_init(){for(const n in K)K[n].forEach((t,i)=>{const r=this._createKey(n,String(i)),o=new Image;o.onload=()=>{this._imageMap.set(r,o)},o.src=t})}_createKey(n,e){return`${n}_${e}`}}W.SpreadsheetExtensionRegistry.add(N2);function U2(s){if(typeof s!="object"||s===null)return s;const a={};for(const n in s)if(s.hasOwnProperty(n)){const e=U2(s[n]);e!==void 0&&(a[n]=e)}return a}Object.defineProperty(C,"isRangesEqual",{enumerable:!0,get:()=>c.isRangesEqual}),C.AddConditionalRuleMutation=C2,C.AddConditionalRuleMutationUndoFactory=C0,C.CFNumberOperator=v,C.CFRuleType=_,C.CFSubRuleType=p,C.CFTextOperator=M,C.CFTimePeriodOperator=x,C.CFValueType=y,C.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=n2,C.ConditionalFormattingFormulaMarkDirty=H,C.ConditionalFormattingIcon=N2,C.ConditionalFormattingRuleModel=b,C.DEFAULT_BG_COLOR=O2,C.DEFAULT_FONT_COLOR=j2,C.DEFAULT_PADDING=k2,C.DEFAULT_WIDTH=B2,C.DataBar=R2,C.DeleteConditionalRuleMutation=s2,C.DeleteConditionalRuleMutationUndoFactory=b2,C.EMPTY_ICON_TYPE=S2,C.FormulaResultStatus=R,C.IconUKey=T2,C.MoveConditionalRuleMutation=i2,C.MoveConditionalRuleMutationUndoFactory=g0,C.SHEET_CONDITIONAL_FORMATTING_PLUGIN=u2,C.SetConditionalRuleMutation=D2,C.anchorUndoFactory=v2,C.compareWithNumber=q,C.createCfId=E2,C.createDefaultRule=P2,C.createDefaultValue=$2,C.createDefaultValueByValueType=W2,C.dataBarUKey=M2,C.defaultDataBarNativeColor=g2,C.defaultDataBarPositiveColor=h2,C.defaultPlaceholderColor=x2,C.filterRange=Q,C.findIndexByAnchor=V,C.getCacheStyleMatrix=Y2,C.getCellValue=k,C.getColorScaleFromValue=y2,C.getMaxInFormulaResult=K2,C.getOppositeOperator=_2,C.getValueByType=Y,C.iconGroup=I2,C.iconMap=K,C.isAnchorEqual=q2,C.isFloatsEqual=X,C.isNullable=I,C.moveByAnchor=F2,C.removeUndefinedAttr=U2,C.serialTimeToTimestamp=A2,C.setConditionalRuleMutationUndoFactory=D0,C.toYMD_1900=p2,C.transformSupportSymmetryAnchor=w2,Object.defineProperty(C,Symbol.toStringTag,{value:"Module"})});
2
+ (function(g,c){typeof exports=="object"&&typeof module<"u"?c(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"],c):(g=typeof globalThis<"u"?globalThis:g||self,c(g.UniverSheetsConditionalFormatting={},g.UniverCore,g.rxjs,g.rxjs.operators,g.UniverEngineFormula,g.UniverEngineRender,g.UniverSheets))})(this,function(g,c,L,J,U,W,S){"use strict";var f0=Object.defineProperty;var m0=(g,c,L)=>c in g?f0(g,c,{enumerable:!0,configurable:!0,writable:!0,value:L}):g[c]=L;var w=(g,c,L)=>m0(g,typeof c!="symbol"?c+"":c,L);var s2;const u2="SHEET_CONDITIONAL_FORMATTING_PLUGIN";var M=(r=>(r.beginsWith="beginsWith",r.endsWith="endsWith",r.containsText="containsText",r.notContainsText="notContainsText",r.equal="equal",r.notEqual="notEqual",r.containsBlanks="containsBlanks",r.notContainsBlanks="notContainsBlanks",r.containsErrors="containsErrors",r.notContainsErrors="notContainsErrors",r))(M||{}),x=(r=>(r.today="today",r.yesterday="yesterday",r.tomorrow="tomorrow",r.last7Days="last7Days",r.thisMonth="thisMonth",r.lastMonth="lastMonth",r.nextMonth="nextMonth",r.thisWeek="thisWeek",r.lastWeek="lastWeek",r.nextWeek="nextWeek",r))(x||{}),v=(r=>(r.greaterThan="greaterThan",r.greaterThanOrEqual="greaterThanOrEqual",r.lessThan="lessThan",r.lessThanOrEqual="lessThanOrEqual",r.notBetween="notBetween",r.between="between",r.equal="equal",r.notEqual="notEqual",r))(v||{}),_=(r=>(r.highlightCell="highlightCell",r.dataBar="dataBar",r.colorScale="colorScale",r.iconSet="iconSet",r))(_||{}),p=(r=>(r.uniqueValues="uniqueValues",r.duplicateValues="duplicateValues",r.rank="rank",r.text="text",r.timePeriod="timePeriod",r.number="number",r.average="average",r.formula="formula",r))(p||{}),y=(r=>(r.num="num",r.min="min",r.max="max",r.percent="percent",r.percentile="percentile",r.formula="formula",r))(y||{});const O2="#fff",j2="#000000",$2=()=>({cfId:void 0,ranges:[],stopIfTrue:!1,rule:{type:"highlightCell",subType:"text",operator:"containsText"}}),P2=(r,a)=>{switch(r){case"text":{if(["beginsWith","containsText","endsWith","equal","notContainsText","notEqual"].includes(a))return"";break}case"number":return["between","notBetween"].includes(a)?[10,100]:10}return""},W2=(r,a)=>{switch(r){case"formula":return"=";case"max":case"min":return"";case"percent":case"percentile":case"num":return a!==void 0?a:10}return""},V=(r,a,n)=>{if(!a)return null;const e=a.findIndex(t=>n(t)===r.id);if(e<0)return null;switch(r.type){case"after":return e+1;case"before":return e-1;case"self":return e}},F2=(r,a,n,e)=>{if(!n)return null;const t=V(r,n,e);let i=V(a,n,e);if(t===null||i===null||t===i)return;const s=n.splice(t,1)[0];switch(t<i&&(i=V(a,n,e)),a.type){case"before":{n.splice(i+1,0,s);break}case"self":case"after":{n.splice(i,0,s);break}}},w2=(r,a,n,e)=>{if(r.type==="after"&&["after","before"].includes(a.type))return[r,a];const t={...r},i={...a};if(t.type!=="after"){const s=V(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=V(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]},v2=(r,a)=>{if(["after","before"].includes(a.type)){if(r.type==="after")return[a,r];if(r.type==="before")return[a,{...r,type:"self"}]}return null},q2=(r,a)=>r.id===a.id&&r.type===a.type,E2=()=>`${c.Tools.generateRandomId(8)}`;class b{constructor(){w(this,"_model",new Map);w(this,"_ruleChange$",new L.Subject);w(this,"$ruleChange",this._ruleChange$.asObservable())}_ensureList(a,n){let e=this.getSubunitRules(a,n);if(!e){e=[];let t=this._model.get(a);t||(t=new Map,this._model.set(a,t)),t.set(n,e)}return e}getRule(a,n,e){const t=this.getSubunitRules(a,n);return t?t.find(i=>i.cfId===e):null}getUnitRules(a){return this._model.get(a)||null}getSubunitRules(a,n){var t;return((t=this._model.get(a))==null?void 0:t.get(n))||null}deleteRule(a,n,e){const t=this.getSubunitRules(a,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:a,type:"delete"}))}}setRule(a,n,e,t){const s=this._ensureList(a,n).find(o=>o.cfId===t);if(s){const o=c.Tools.deepClone(s);Object.assign(s,e),this._ruleChange$.next({rule:s,subUnitId:n,unitId:a,type:"set",oldRule:o})}}addRule(a,n,e){const t=this._ensureList(a,n);t.find(s=>s.cfId===e.cfId)||t.unshift(e),this._ruleChange$.next({rule:e,subUnitId:n,unitId:a,type:"add"})}moveRulePriority(a,n,e,t){const i=this._ensureList(a,n),s=V(e,i,l=>l.cfId),o=V(t,i,l=>l.cfId);if(o===null||s===null||o===s)return;const h=i[s];h&&(F2(e,t,i,l=>l.cfId),this._ruleChange$.next({rule:h,subUnitId:n,unitId:a,type:"sort"}))}createCfId(a,n){return E2()}deleteUnitId(a){this._model.delete(a)}}const H={type:c.CommandType.MUTATION,id:"sheet.mutation.conditional-formatting-formula-mark-dirty",handler(){return!0}};var Z2=Object.getOwnPropertyDescriptor,G2=(r,a,n,e)=>{for(var t=e>1?void 0:e?Z2(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},c2=(r,a)=>(n,e)=>a(n,e,r),R=(r=>(r[r.NOT_REGISTER=1]="NOT_REGISTER",r[r.SUCCESS=2]="SUCCESS",r[r.WAIT=3]="WAIT",r[r.ERROR=4]="ERROR",r))(R||{});const H2=r=>{const a=r&&r[0]&&r[0][0];return(a==null?void 0:a.t)===c.CellValueType.BOOLEAN?a.v===c.BooleanNumber.TRUE||a.v===!0:a?a.v:!1};g.ConditionalFormattingFormulaService=class extends c.Disposable{constructor(n,e,t){super();w(this,"_formulaMap",new Map);w(this,"_result$",new L.Subject);w(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 _.colorScale:return e.config.some(t=>t.value.type===y.formula);case _.dataBar:return[e.config.max,e.config.min].some(t=>t.type===y.formula);case _.iconSet:return e.config.some(t=>t.value.type===y.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===U.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 c.ObjectMatrix(e.unitOtherData[t][i][s]),h=this._ensureSubunitFormulaMap(t,i).getValue(s,["formulaId"]);if(!h)continue;const l=h.ranges;if(!l)continue;const u=h.result,d=l[0].startRow,C=l[0].startColumn;o.forValue((F,E,A)=>{u.setValue(d+F,C+E,H2(A))}),h.status=2;const m=this._getAllFormulaResultByCfId(t,i,h.cfId).every(F=>F.status===2);this._result$.next({...h,isAllFinished:m})}}})),this._activeDirtyManagerService.register(H.id,{commandId:H.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 c.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),h=this.createCFormulaId(t,i);if(o.getValue(h,["id"]))return;const l=this._createFormulaId(n,e);o.addValue({formulaText:i,unitId:n,subUnitId:e,cfId:t,id:h,ranges:s,formulaId:l,status:3,result:new c.ObjectMatrix});const u={unitId:n,subUnitId:e,formulaMap:{[l]:{f:i,ranges:s}}};this._commandService.executeCommand(U.SetOtherFormulaMutation.id,u,{onlyLocal:!0}).then(()=>{this._commandService.executeCommand(H.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(U.RemoveOtherFormulaMutation.id,{unitId:n,subUnitId:e,formulaIdList:s},{onlyLocal:!0})}getFormulaResultWithCoords(n,e,t,i,s=0,o=0){const h=this.getSubUnitFormulaMap(n,e);if(!h)return{status:1};const l=h.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(h=>h.cfId===t);return o.forEach(h=>{s.deleteValue(h.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}_${c.Tools.generateRandomId(8)}`}createCFormulaId(n,e){return`${n}_${e}`}},g.ConditionalFormattingFormulaService=G2([c2(0,c.Inject(c.ICommandService)),c2(1,c.Inject(U.IActiveDirtyManagerService)),c2(2,c.Inject(b))],g.ConditionalFormattingFormulaService);var T=(r=>(r.preComputingStart="preComputingStart",r.preComputing="preComputing",r.preComputingEnd="preComputingEnd",r.preComputingError="preComputingError",r))(T||{});class z{constructor(a){w(this,"_cache");w(this,"_preComputingStatus$",new L.BehaviorSubject("preComputingStart"));w(this,"preComputingStatus$",this._preComputingStatus$.asObservable().pipe(J.distinctUntilChanged()));w(this,"_preComputingCache");w(this,"_rule");this._context=a,this._cache=new c.LRUMap(a.limit),this._rule=a.rule,this._preComputingCache=null,this._initClearCacheListener()}setCacheLength(a){this._cache.limit=a}clearCache(){this._cache.clear()}resetPreComputingCache(){this._preComputingStatus$.next("preComputingStart"),this._preComputingCache=null}updateRule(a){this._rule=a,this.resetPreComputingCache()}getCell(a,n){const e=this._createKey(a,n);if(this._preComputingStatus$.getValue()==="preComputing")return this._cache.get(e);let t=this.getPreComputingResult(a,n);if(t===null&&(this._preComputingStatus$.next("preComputingStart"),this.preComputing(a,n,this._getContext()),t=this.getPreComputingResult(a,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(a,n,t,this._getContext());return i!==null&&this._setCache(a,n,i),i}setPreComputingCache(a){this._preComputingCache=a}getPreComputingResult(a,n){return this._preComputingCache}_createKey(a,n){return`${a}_${n}`}_setCache(a,n,e){const t=this._createKey(a,n);this._cache.set(t,e)}_getContext(){return{...this._context,rule:this._rule}}_initClearCacheListener(){this.preComputingStatus$.subscribe(a=>{a==="preComputingEnd"&&this.clearCache()})}}function X(r,a){return Math.abs(r-a)<Number.EPSILON}const I=r=>[void 0,null].includes(r),B=r=>{var e,t;if(!r)return null;if(r.t===c.CellValueType.BOOLEAN)return r.v===c.BooleanNumber.TRUE?U.BooleanValue.TRUE:U.BooleanValue.FALSE;const a=r.v,n=(t=(e=r.p)==null?void 0:e.body)==null?void 0:t.dataStream.replace(/\r\n$/,"");return I(a)?I(n)?null:n:a},d2=86400;function p2(r,a=!0){if(a&&r>=0){if(r===0)return[1900,1,0];if(r===60)return[1900,2,29];if(r<60)return[1900,r<32?1:2,(r-1)%31+1]}let n=r+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 A2=r=>{let a=r|0;const n=d2*(r-a);let e=Math.floor(n);n-e>.9999&&(e+=1,e===d2&&(e=0,a+=1));const t=e<0?d2+e:e,[i,s,o]=p2(r,!0),h=Math.floor(t/60/60)%60,l=Math.floor(t/60)%60,u=Math.floor(t)%60;return c.dayjs(`${i}/${s}/${o} ${h}:${l}:${u}`).valueOf()},Y=(r,a,n)=>{switch(r.type){case y.max:{let e=0;return a.forValue((t,i,s)=>{s>e&&(e=s)}),{status:R.SUCCESS,result:e}}case y.min:{let e;return a.forValue((t,i,s)=>{e===void 0&&(e=s),s<e&&(e=s)}),{status:R.SUCCESS,result:e}}case y.percent:{let e,t;a.forValue((o,h,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(r.value)||0,100),0);return{status:R.SUCCESS,result:i*(s/100)+(t||0)}}case y.percentile:{const e=a.toNativeArray().sort((l,u)=>l-u),t=Math.max(Math.min(Number(r.value)||0,100),0),i=(e.length-1)*t/100,s=Math.floor(i),o=i-s,h=e[s]+(e[Math.min(s+1,e.length-1)]-e[s])*o;return{status:R.SUCCESS,result:h}}case y.formula:{const{accessor:e,unitId:t,subUnitId:i,cfId:s}=n,o=String(r.value),h=e.get(g.ConditionalFormattingFormulaService);return h.registerFormulaWithRange(t,i,s,o),h.getFormulaResultWithCoords(t,i,s,o)}case y.num:{const e=Number(r.value);return{status:R.SUCCESS,result:Number.isNaN(e)?0:e}}}},X2=(r,a,n,e)=>{const{accessor:t}=e,i=t.get(g.ConditionalFormattingViewModel),s=new c.ObjectMatrix;return n.ranges.forEach(o=>{c.Range.foreach(o,(h,l)=>{const u=i.getCellCfs(r,a,h,l);if(u){const d=u.find(C=>C.cfId===n.cfId);d!=null&&d.result&&s.setValue(h,l,d.result)}})}),s},q=(r,a)=>{switch(r.operator){case v.between:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return a>=n&&a<=e}case v.notBetween:{if(typeof r.value!="object"||!r.value.length)return;const n=Math.min(...r.value),e=Math.max(...r.value);return!(a>=n&&a<=e)}case v.equal:{const n=r.value||0;return X(n,a)}case v.notEqual:{const n=r.value||0;return!X(n,a)}case v.greaterThan:{const n=r.value||0;return a>n}case v.greaterThanOrEqual:{const n=r.value||0;return a>=n}case v.lessThan:{const n=r.value||0;return a<n}case v.lessThanOrEqual:{const n=r.value||0;return a<=n}default:return!1}},_2=r=>{switch(r){case v.greaterThan:return v.lessThanOrEqual;case v.greaterThanOrEqual:return v.lessThan;case v.lessThan:return v.greaterThanOrEqual;case v.lessThanOrEqual:return v.greaterThan}return r},y2=(r,a)=>{const n=i=>i.a!==void 0?i:{...i,a:1},e=r.findIndex(i=>i.value>=a),t=e-1;if(e===0)return r[0].color.toRgbString();if(t>=0){const i=r[t],s=r[e];if(i.color.isValid&&s.color.isValid){const o=n(i.color.toRgb()),h=n(s.color.toRgb()),l=s.value-i.value,u=(a-i.value)/l,d=["r","g","b","a"].reduce((f,m)=>{const F=o[m];return f[m]=(h[m]-F)*u+F,f},{});return new c.ColorKit(d).toRgbString()}}else return r[r.length-1].color.toRgbString()},Q=(r,a,n)=>r.map(e=>{if(e.startColumn>n||e.startRow>a)return null;const t={...e};return t.endRow=Math.min(t.endRow,a),t.endColumn=Math.min(t.endColumn,n),t}).filter(e=>!!e);function Y2(r){let a=0;return new c.ObjectMatrix(r).forValue((n,e,t)=>{a=Math.max(Number.isNaN(a)?0:a,Number(t))}),a}class K2 extends z{preComputing(a,n,e){const t=e.rule,i=e.worksheet,s=new c.ObjectMatrix;!t.rule.config.every(u=>u.value.type===y.num)&&Q(t.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&s.setValue(C,f,E)}})});const h=[...t.rule.config].sort((u,d)=>u.index-d.index).map(u=>({value:Y(u.value,s,{...e,cfId:t.cfId}),color:new c.ColorKit(u.color)}));if(!h.some(u=>W.isObject(u.value)?u.value.status!==R.SUCCESS:!1)){const u=h.map(d=>d.color).reduce((d,C,f)=>(d.result.push({color:C,value:d.sortValue[f]}),d),{result:[],sortValue:h.map(d=>d.value.result).sort((d,C)=>d-C)}).result;this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t.getCellValue(a,n);if(i.t===c.CellValueType.NUMBER){const s=Number(i.v);if(!Number.isNaN(s))return y2(e,s)}}}const M2="sheet-conditional-rule-data-bar",h2="#ffbe38",g2="#abd91a",x2="#000",J2=34;class R2 extends W.SheetExtension{constructor(){super(...arguments);w(this,"_paddingRightAndLeft",2);w(this,"_paddingTopAndBottom",2);w(this,"uKey",M2);w(this,"Z_INDEX",J2);w(this,"_radius",1)}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!s.getRowVisible(o)||!s.getColVisible(h))return;const l=s.getCell(o,h);if(l&&l.dataBar){const{color:u,value:d,startPoint:C,isGradient:f}=l.dataBar,m=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:F,isMergedMainCell:E,mergeInfo:A,startY:k,endY:N,startX:O,endX:a2}=m;if(F||(E&&(k=A.startY,N=A.endY,O=A.startX,a2=A.endX),!this.isRenderDiffRangesByCell(A,i)))return;const l2=a2-O,m2=N+W.FIX_ONE_PIXEL_BLUR_OFFSET-k,o2=l2-this._paddingRightAndLeft*2,V2=m2-this._paddingTopAndBottom*2;if(d>0){const G=Math.max(o2*(1-C/100)*d/100,1),j=O+this._paddingRightAndLeft+C/100*o2,$=k+this._paddingTopAndBottom;if(f){const P=n.createLinearGradient(j,$,j+G,$);P.addColorStop(0,u),P.addColorStop(1,"rgb(255 255 255)"),n.fillStyle=P,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,$,G,V2,!1,!0,!0,!1),f&&n.stroke()}else{const G=Math.max(o2*C/100*Math.abs(d)/100,1),j=O+this._paddingRightAndLeft+C/100*o2-G,$=k+this._paddingTopAndBottom;if(f){const P=n.createLinearGradient(j,$,j+G,$);P.addColorStop(0,"rgb(255 255 255)"),P.addColorStop(1,u),n.fillStyle=P,n.strokeStyle=u,n.lineWidth=1}else n.fillStyle=u;this._drawRectWithRoundedCorner(n,j,$,G,V2,!0,!1,!1,!0),f&&n.stroke()}}}),n.restore()}_drawRectWithRoundedCorner(n,e,t,i,s,o,h,l,u){const d=this._radius;!s||!i||(n.beginPath(),n.moveTo(e+d,t),n.lineTo(e+i-d,t),h?n.arcTo(e+i,t,e+i,t+d,d):n.lineTo(e+i,t),n.lineTo(e+i,t+s-d),l?n.arcTo(e+i,t+s,e+i-d,t+s,d):n.lineTo(e+i,t+s),n.lineTo(e+d,t+s),u?n.arcTo(e,t+s,e,t+s-d,d):n.lineTo(e,t+s),n.lineTo(e,t+d),o?n.arcTo(e,t,e+d,t,d):n.lineTo(e,t),n.closePath(),n.fill())}}W.SpreadsheetExtensionRegistry.add(R2);const e2=r=>Math.max(Math.min(100,r),0),z2=(r,a,n)=>{const e=n(r,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class Q2 extends z{preComputing(a,n,e){const t=e.rule,i=t.rule,s=e.worksheet,o=new c.ObjectMatrix;![t.rule.config.max,t.rule.config.min].every(f=>f.type===y.num)&&Q(t.ranges,s.getMaxRows()-1,s.getMaxColumns()-1).forEach(m=>{c.Range.foreach(m,(F,E)=>{const A=e.getCellValue(F,E),k=A&&A.v;if(!I(k)&&(A==null?void 0:A.t)===c.CellValueType.NUMBER){const N=Number(k);!Number.isNaN(N)&&o.setValue(F,E,N)}})});const l=Y(i.config.min,o,{...e,cfId:t.cfId}),u=Y(i.config.max,o,{...e,cfId:t.cfId});let d=0,C=0;if(l.status===R.SUCCESS){const f=Number(l.result);d=Number.isNaN(f)?0:f}else{this._preComputingStatus$.next(T.preComputing);return}if(u.status===R.SUCCESS){const f=Number(u.result),m=Number.isNaN(f)?0:f;C=Math.max(m,d),d=Math.min(m,d);let F=50;if(d<0&&C<=0)F=100;else if(d<0&&C>0){const E=Math.abs(C)+Math.abs(d);F=Math.abs(d)/E*100}else d>=0&&C>0&&(F=0);this.setPreComputingCache({min:d,max:C,startPoint:F}),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){const{min:i,max:s,startPoint:o}=e,l=t.rule.rule,u=l.isShowValue,d=l.config.isGradient,C=z2(a,n,t.getCellValue);if(!(C===null||C<i||i===s||s<i)){if(C===0)return{color:x2,startPoint:o,value:0,isGradient:d,isShowValue:u};if(i<0&&s<=0){const f=s-i,m=e2((s-C)/f*100);return m===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-m,isGradient:d,isShowValue:u}}else if(i<0&&s>0)if(C>0){const f=e2(Math.min(C/s,1)*100);return f===0?void 0:{color:l.config.positiveColor||h2,startPoint:o,value:f,isGradient:d,isShowValue:u}}else{const f=e2(Math.min(Math.abs(C)/Math.abs(i),1)*100);return f===0?void 0:{color:l.config.nativeColor||g2,startPoint:o,value:-f,isGradient:d,isShowValue:u}}else if(i>=0&&s>0){const f=s-i,m=0,F=e2((1-(s-C)/f)*100);return F===0?void 0:{color:l.config.positiveColor||h2,startPoint:m,value:F,isGradient:d,isShowValue:u}}}}}class e0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.rule.ranges,o=(()=>{switch(t.subType){case p.average:{let h=0,l=0;return i.forEach(u=>{c.Range.foreach(u,(d,C)=>{const f=e.getCellValue(d,C),m=B(f||void 0);f&&f.t===c.CellValueType.NUMBER&&m!==void 0&&(h+=Number(m)||0,l++)})}),{value:h/l,type:t.subType}}case p.uniqueValues:case p.duplicateValues:{const h=new Map;return i.forEach(l=>{c.Range.foreach(l,(u,d)=>{const C=e.getCellValue(u,d),f=B(C||void 0);if(f!==void 0){const m=h.get(f);m?h.set(f,m+1):h.set(f,1)}})}),{value:h,type:t.subType}}case p.rank:{const h=[];i.forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=B(m||void 0);m&&m.t===c.CellValueType.NUMBER&&F!==void 0&&h.push(Number(F)||0)})}),h.sort((d,C)=>C-d);const l=e.rule.rule,u=l.isPercent?Math.floor(Math.max(Math.min(l.value,100),0)/100*h.length):Math.floor(Math.max(Math.min(l.isBottom?l.value-1:l.value,h.length),0));return l.isBottom?{value:h[h.length-u-1],type:t.subType}:{value:h[Math.max(u-1,0)],type:t.subType}}case p.formula:{const h=t,l=e.accessor.get(g.ConditionalFormattingFormulaService);l.registerFormulaWithRange(e.unitId,e.subUnitId,e.rule.cfId,h.value,e.rule.ranges);const u=l.getFormulaMatrix(e.unitId,e.subUnitId,e.rule.cfId,h.value);return u&&u.status===R.SUCCESS?(this._preComputingStatus$.next(T.preComputingEnd),{value:u.result,type:t.subType}):(this._preComputingStatus$.next(T.preComputing),null)}case p.timePeriod:switch(t.operator){case x.last7Days:return{value:{start:c.dayjs().subtract(7,"day").valueOf(),end:c.dayjs().valueOf()},type:t.subType};case x.lastMonth:return{value:{start:c.dayjs().startOf("month").subtract(1,"month").valueOf(),end:c.dayjs().endOf("month").subtract(1,"month").valueOf()},type:t.subType};case x.lastWeek:return{value:{start:c.dayjs().startOf("week").subtract(1,"week").valueOf(),end:c.dayjs().endOf("week").subtract(1,"week").valueOf()},type:t.subType};case x.nextMonth:return{value:{start:c.dayjs().startOf("month").add(1,"month").valueOf(),end:c.dayjs().endOf("month").add(1,"month").valueOf()},type:t.subType};case x.nextWeek:return{value:{start:c.dayjs().startOf("week").add(1,"week").valueOf(),end:c.dayjs().endOf("week").add(1,"week").valueOf()},type:t.subType};case x.thisMonth:return{value:{start:c.dayjs().startOf("month").valueOf(),end:c.dayjs().endOf("month").valueOf()},type:t.subType};case x.thisWeek:return{value:{start:c.dayjs().startOf("week").valueOf(),end:c.dayjs().endOf("week").valueOf()},type:t.subType};case x.today:return{value:{start:c.dayjs().startOf("day").valueOf(),end:c.dayjs().endOf("day").valueOf()},type:t.subType};case x.tomorrow:return{value:{start:c.dayjs().startOf("day").add(1,"day").valueOf(),end:c.dayjs().endOf("day").add(1,"day").valueOf()},type:t.subType};case x.yesterday:return{value:{start:c.dayjs().startOf("day").subtract(1,"day").valueOf(),end:c.dayjs().endOf("day").subtract(1,"day").valueOf()},type:t.subType}}}})();this.setPreComputingCache(o)}getCellResult(a,n,e,t){const i=t.getCellValue(a,n),s=t.rule.rule;return(()=>{switch(s.subType){case p.number:{const l=i&&Number(i.v),u=(i==null?void 0:i.t)===c.CellValueType.NUMBER,d=s;return u?I(l)||Number.isNaN(l)?void 0:q({operator:d.operator,value:d.value||0},l||0):!![v.notEqual,v.notBetween].includes(d.operator)}case p.text:{const l=s,u=B(i),d=u===null?"":String(u),C=l.value||"";switch(l.operator){case M.beginsWith:return d.startsWith(C);case M.containsBlanks:return/^\s*$/.test(d);case M.notContainsBlanks:return!/^\s*$/.test(d);case M.containsErrors:return U.ERROR_TYPE_SET.has(d);case M.notContainsErrors:return!U.ERROR_TYPE_SET.has(d);case M.containsText:return d.indexOf(C)>-1;case M.notContainsText:return d.indexOf(C)===-1;case M.endsWith:return d.endsWith(C);case M.equal:return d===C;case M.notEqual:return d!==C;default:return!1}}case p.timePeriod:{const l=B(i);if(I(l)||Number.isNaN(Number(l))||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return;const u=A2(Number(l)),{start:d,end:C}=e.value;return u>=d&&u<=C}case p.average:{const l=i&&i.v,u=Number(l),d=(i==null?void 0:i.t)===c.CellValueType.NUMBER,C=s;if(!d)return v.notEqual===C.operator;if(I(l)||Number.isNaN(u)||!e)return!1;const f=e.value;switch(C.operator){case v.greaterThan:return u>f;case v.greaterThanOrEqual:return u>=f;case v.lessThan:return u<f;case v.lessThanOrEqual:return u<=f;case v.equal:return X(u,f);case v.notEqual:return!X(u,f);default:return!1}}case p.rank:{const l=B(i),u=Number(l);if(I(l)||Number.isNaN(u)||(i==null?void 0:i.t)!==c.CellValueType.NUMBER||!e)return!1;const d=e.value;return s.isBottom?u<=d:u>=d}case p.uniqueValues:{const l=B(i);return I(l)||!e?!1:e.value.get(l)===1}case p.duplicateValues:{const l=B(i);return I(l)||!e?!1:e.value.get(l)!==1}case p.formula:{const l=e==null?void 0:e.value;return l?l.getValue(a,n)===!0:!1}}})()?s.style:{}}}const t0=(r,a,n)=>{const e=n(r,a);if(e&&e.t===c.CellValueType.NUMBER){const t=Number(e.v);return Number.isNaN(t)?null:t}return null};class n0 extends z{preComputing(a,n,e){const t=e.rule.rule,i=e.worksheet,s=new c.ObjectMatrix;!t.config.every(u=>u.value.type===y.num)&&Q(e.rule.ranges,i.getMaxRows()-1,i.getMaxColumns()-1).forEach(d=>{c.Range.foreach(d,(C,f)=>{const m=e.getCellValue(C,f),F=m&&m.v;if(!I(F)&&(m==null?void 0:m.t)===c.CellValueType.NUMBER){const E=Number(F);!Number.isNaN(E)&&s.setValue(C,f,E)}})});const h=t.config.map(u=>Y(u.value,s,{...e,cfId:e.rule.cfId}));if(!h.some(u=>u.status!==R.SUCCESS)){const u=h.map((d,C)=>({operator:t.config[C].operator,value:Number(d.result)||0})).reduce((d,C,f,m)=>{const F=t.config[f];if(!f||f===m.length-1)d.push({...C,iconId:F.iconId,iconType:F.iconType});else{const E=m[f-1];q(E,C.value)||d.push({...C,iconId:F.iconId,iconType:F.iconType})}return d},[]);this.setPreComputingCache(u),this._preComputingStatus$.next(T.preComputingEnd);return}this._preComputingStatus$.next(T.preComputing)}getCellResult(a,n,e,t){if(!e)return null;const i=t0(a,n,t.getCellValue);if(i===null)return;const s=t.rule.rule,o=s.isShowValue===void 0?!0:!!s.isShowValue;for(let h=0;h<e.length;h++){const l=e[h],u={...l},d={...l},{iconId:C,iconType:f}=l;if(h===0){if(q(l,i))return{iconId:C,iconType:f,isShowValue:o}}else{if(h===e.length-1)return{iconId:C,iconType:f,isShowValue:o};{const m=e[h-1];if(d.operator=_2(m.operator),d.value=m.value,q(u,i)&&q(d,i))return{iconId:C,iconType:f,isShowValue:o}}}}}}var i0=Object.getOwnPropertyDescriptor,r0=(r,a,n,e)=>{for(var t=e>1?void 0:e?i0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},t2=(r,a)=>(n,e)=>a(n,e,r);const n2=50*20*3*3;g.ConditionalFormattingViewModel=class extends c.Disposable{constructor(n,e,t,i){super();w(this,"_calculateUnitManagers",new Map);w(this,"_rTreeManager",new c.RTree);w(this,"_cellCache",new c.LRUMap(n2));w(this,"_markDirty$",new L.Subject);w(this,"markDirty$",this._markDirty$.asObservable());w(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})});w(this,"markRuleDirty",(()=>{const n=new L.Subject;return this.disposeWithMe(n.pipe(J.bufferTime(100),J.filter(e=>!!e.length),J.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 h=i.find(l=>l.cfId===s.cfId);h.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 d;const s=(d=this._conditionalFormattingRuleModel.getSubunitRules(n,e))!=null?d:[],o=this._ensureCalculateUnitManager(n,e),h=this._rTreeManager.bulkSearch([{unitId:n,sheetId:e,range:{startColumn:i,endColumn:i,startRow:t,endRow:t}}]),l=s.filter(C=>h.has(C.cfId));return l.length?l.map(C=>{const f=o.get(C.cfId);return f?{cfId:C.cfId,result:f.getCell(t,i)}:null}).filter(C=>!!C).map((C,f)=>({...C,priority:f})):[]}_handleCustomFormulasSeparately(){this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{if(n.type==="set"){const{unitId:e,subUnitId:t}=n,i=n.oldRule;i.rule.type===_.highlightCell&&i.rule.subType===p.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,h=this._ensureCalculateUnitManager(e,t);switch(this.markRuleDirty(e,t,s),n.type){case"add":{this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:s,range:u})));const l=this._createRuleCalculateUnitInstance(e,t,i);if(!l)return;h.set(i.cfId,l);break}case"delete":{this._rTreeManager.bulkRemove(o.map(l=>({unitId:e,sheetId:t,id:s,range:l}))),h.delete(i.cfId);break}case"set":{const l=n.oldRule;if(this._rTreeManager.bulkRemove(l.ranges.map(u=>({unitId:e,sheetId:t,id:l.cfId,range:u}))),this._rTreeManager.bulkInsert(o.map(u=>({unitId:e,sheetId:t,id:s,range:u}))),l.rule.type!==i.rule.type){const u=this._createRuleCalculateUnitInstance(e,t,i);if(!u)return;h.delete(l.cfId),h.set(i.cfId,u)}else{const u=h.get(l.cfId);if(!u)return;u.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:n2,getCellValue:(h,l)=>s.getCellRaw(h,l)||{}};switch(t.rule.type){case _.colorScale:return new K2(o);case _.dataBar:return new Q2(o);case _.highlightCell:return new e0(o);case _.iconSet:return new n0(o)}}_createCacheKey(n,e,t,i){return`${n}_${e}_${t}_${i}`}setCacheLength(n=n2){this._cellCache.limit!==n&&(this._cellCache.limit=n,this._calculateUnitManagers.forEach(e=>{e.forEach(t=>{t.forEach(i=>{i.setCacheLength(n)})})}))}},g.ConditionalFormattingViewModel=r0([t2(0,c.Inject(c.Injector)),t2(1,c.Inject(b)),t2(2,c.Inject(g.ConditionalFormattingFormulaService)),t2(3,c.IUniverInstanceService)],g.ConditionalFormattingViewModel);const D={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"}},I2=[{title:"sheet.cf.iconSet.direction",group:[{name:"3Arrows",list:[D.arrow["up-green"],D.arrow["right-gold"],D.arrow["down-red"]]},{name:"3ArrowsGray",list:[D.arrow["up-gray"],D.arrow["right-gray"],D.arrow["down-gray"]]},{name:"4Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"4ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"5Arrows",list:[D.arrow["up-green"],D.arrow["rightAndUp-gold"],D.arrow["right-gold"],D.arrow["rightAndDown-gold"],D.arrow["down-red"]]},{name:"5ArrowsGray",list:[D.arrow["up-gray"],D.arrow["rightAndUp-gray"],D.arrow["right-gray"],D.arrow["rightAndDown-gray"],D.arrow["down-gray"]]},{name:"3Triangles",list:[D.shape.up,D.shape.cross,D.shape.down]}]},{title:"sheet.cf.iconSet.shape",group:[{name:"3TrafficLights1",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"]]},{name:"3Signs",list:[D.shape["roundness-greed"],D.shape["triangle-gold"],D.shape["rhomboid-red"]]},{name:"3TrafficLights2",list:[D.shape["indicate-greed"],D.shape["indicate-gold"],D.shape["indicate-red"]]},{name:"4RedToBlack",list:[D.shape["roundness-red"],D.shape["roundness-pink"],D.shape["roundness-gray"],D.shape["roundness-black"]]},{name:"4TrafficLights",list:[D.shape["roundness-greed"],D.shape["roundness-gold"],D.shape["roundness-red"],D.shape["roundness-black"]]}]},{title:"sheet.cf.iconSet.mark",group:[{name:"3Symbols",list:[D.feedback.correct,D.feedback.warn,D.feedback.mistake]},{name:"3Symbols2",list:[D.feedback2.correct2,D.feedback2.warn2,D.feedback2.mistake2]},{name:"3Flags",list:[D.flag["flag-green"],D.flag["flag-gold"],D.flag["flag-red"]]}]},{title:"sheet.cf.iconSet.rank",group:[{name:"4Rating",list:[D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Rating",list:[D.signal.signal0,D.signal.signal25,D.signal.signal50,D.signal.signal75,D.signal.signal100]},{name:"5Quarters",list:[D.progress.progress100,D.progress.progress75,D.progress.progress50,D.progress.progress25,D.progress.progress0]},{name:"_5Felling",list:[D.feeling.guffaw,D.feeling.smile,D.feeling.noninductive,D.feeling.dissatisfied,D.feeling.impatient]},{name:"5Boxes",list:[D.cell["cell-100"],D.cell["cell-75"],D.cell["cell-50"],D.cell["cell-25"],D.cell["cell-0"]]},{name:"3Stars",list:[D.star.starFull,D.star.starIncomplete,D.star.starEmpty]}]}],K=I2.reduce((r,a)=>{const{group:n}=a;for(const e of n)r[e.name]=e.list;return r},{});for(const r in K){const a=K[r];Object.freeze(a)}const S2="EMPTY_ICON_TYPE",i2={type:c.CommandType.MUTATION,id:"sheet.mutation.move-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,start:t,end:i}=a;return r.get(b).moveRulePriority(n,e,t,i),!0}},s0=r=>{const{unitId:a,subUnitId:n}=r,e=v2(r.start,r.end);if(!e)return[];const[t,i]=e;return[{id:i2.id,params:{unitId:a,subUnitId:n,start:t,end:i}}]},b2=(r,a)=>{const n=r.get(b),{unitId:e,subUnitId:t,cfId:i}=a,s=[...n.getSubunitRules(e,t)||[]],o=s.findIndex(l=>l.cfId===i),h=s[o-1];if(o>-1){const l=s[o],u=[{id:C2.id,params:{unitId:e,subUnitId:t,rule:c.Tools.deepClone(l)}}];if(s.splice(o,1),o!==0){const d=s[0];if(d){const C=w2({id:d.cfId,type:"before"},{id:h.cfId,type:"after"},s,E=>E.cfId);if(!C)return u;const[f,m]=C,F={unitId:e,subUnitId:t,start:f,end:m};u.push({id:i2.id,params:F})}}return u}return[]},r2={type:c.CommandType.MUTATION,id:"sheet.mutation.delete-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,cfId:t}=a;return r.get(b).deleteRule(n,e,t),!0}},a0=(r,a)=>({id:r2.id,params:{unitId:a.unitId,subUnitId:a.subUnitId,cfId:a.rule.cfId}}),C2={type:c.CommandType.MUTATION,id:"sheet.mutation.add-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a;return r.get(b).addRule(n,e,t),!0}},D2={type:c.CommandType.MUTATION,id:"sheet.mutation.set-conditional-rule",handler(r,a){if(!a)return!1;const{unitId:n,subUnitId:e,rule:t}=a,i=a.cfId||a.rule.cfId;return r.get(b).setRule(n,e,t,i),!0}},l0=(r,a)=>{const n=r.get(b),{unitId:e,subUnitId:t}=a,i=a.cfId||a.rule.cfId,s=n.getRule(e,t,i);return s?[{id:D2.id,params:{unitId:e,subUnitId:t,cfId:i,rule:c.Tools.deepClone(s)}}]:[]},o0="ssheets-conditional-formatting.config",L2={};var u0=Object.getOwnPropertyDescriptor,c0=(r,a,n,e)=>{for(var t=e>1?void 0:e?u0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},Z=(r,a)=>(n,e)=>a(n,e,r);g.ConditionalFormattingService=class extends c.Disposable{constructor(a,n,e,t,i,s){super(),this._conditionalFormattingRuleModel=a,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(g.ConditionalFormattingViewModel)}composeStyle(a,n,e,t){const i=this._conditionalFormattingViewModelV2.getCellCfs(a,n,e,t);if(i&&(i!=null&&i.length)){const s=i.map(l=>this._conditionalFormattingRuleModel.getRule(a,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,u)=>{var f;const d=u.rule.type,C=i.find(m=>m.cfId===u.cfId);if(d===_.highlightCell)C.result&&c.Tools.deepMerge(l,{style:C.result});else if(d===_.colorScale){const m=C==null?void 0:C.result;m&&typeof m=="string"&&(l.style={...(f=l.style)!=null?f:{},bg:{rgb:m}})}else if(d===_.dataBar){const m=C==null?void 0:C.result;m&&(l.dataBar=m,l.isShowValue=m.isShowValue)}else if(d===_.iconSet){const m=C==null?void 0:C.result;m&&(l.iconSet=m,l.isShowValue=m.isShowValue)}return l},{})}return null}_initSnapshot(){const a=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:u2,businesses:[c.UniverInstanceType.UNIVER_SHEET],toJson:e=>a(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:a=>{if(a.id===S.RemoveSheetCommand.id){const n=a.params,e=n.unitId||d0(this._univerInstanceService),t=n.subUnitId||h0(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(h=>{const l={unitId:e,subUnitId:t,cfId:h.cfId};s.push({id:r2.id,params:l}),o.push(...b2(this._injector,l))}),{redos:s,undos:o}}return{redos:[],undos:[]}}}))}_initCellChange(){this.disposeWithMe(this._commandService.onCommandExecuted(a=>{const n=(e,t,i)=>{const s=new Set;return i.forEach(([o,h])=>{const l=this._conditionalFormattingViewModelV2.getCellCfs(e,t,o,h);l==null||l.forEach(u=>s.add(u.cfId))}),[...s].map(o=>this._conditionalFormattingRuleModel.getRule(e,t,o)).filter(o=>!!o)};switch(a.id){case S.SetRangeValuesMutation.id:{const e=a.params,{subUnitId:t,unitId:i,cellValue:s}=e,o=[];new c.ObjectMatrix(s).forValue((l,u,d)=>{d&&Object.keys(d).some(f=>["p","v"].includes(f))&&o.push([l,u])}),n(i,t,o).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,t,l.cfId)});break}case S.InsertColMutation.id:case S.RemoveColMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endColumn:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.RemoveRowMutation.id:case S.InsertRowMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i),o={...e,endRow:Number.MAX_SAFE_INTEGER};s&&s.filter(l=>l.ranges.some(u=>c.Rectangle.intersects(u,o))).forEach(l=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,l.cfId)});break}case S.MoveRowsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),h={startRow:Math.min(e.startRow,t.startRow),endRow:Number.MAX_SAFE_INTEGER,startColumn:0,endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,u.cfId)});break}case S.MoveColsMutation.id:{const{sourceRange:e,targetRange:t,unitId:i,subUnitId:s}=a.params,o=this._conditionalFormattingRuleModel.getSubunitRules(i,s),h={startRow:0,endRow:Number.MAX_SAFE_INTEGER,startColumn:Math.min(e.startColumn,t.startColumn),endColumn:Number.MAX_SAFE_INTEGER};o&&o.filter(u=>u.ranges.some(d=>c.Rectangle.intersects(d,h))).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(i,s,u.cfId)});break}case S.MoveRangeMutation.id:{const{unitId:e,to:t,from:i}=a.params,s=o=>{const h=[];new c.ObjectMatrix(o.value).forValue((u,d)=>{h.push([u,d])}),n(e,o.subUnitId,h).forEach(u=>{this._conditionalFormattingViewModelV2.markRuleDirty(e,o.subUnitId,u.cfId)})};s(t),s(i);break}case S.ReorderRangeMutation.id:{const{range:e,unitId:t,subUnitId:i}=a.params,s=this._conditionalFormattingRuleModel.getSubunitRules(t,i);s&&s.filter(h=>h.ranges.some(l=>c.Rectangle.intersects(l,e))).forEach(h=>{this._conditionalFormattingViewModelV2.markRuleDirty(t,i,h.cfId)});break}}}))}},g.ConditionalFormattingService=c0([Z(0,c.Inject(b)),Z(1,c.Inject(c.Injector)),Z(2,c.Inject(c.IUniverInstanceService)),Z(3,c.Inject(c.IResourceManagerService)),Z(4,c.Inject(S.SheetInterceptorService)),Z(5,c.Inject(c.ICommandService))],g.ConditionalFormattingService);const d0=r=>r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getUnitId(),h0=r=>{var a;return(a=r.getCurrentUnitForType(c.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:a.getSheetId()};var g0=Object.getOwnPropertyDescriptor,C0=(r,a,n,e)=>{for(var t=e>1?void 0:e?g0(a,n):a,i=r.length-1,s;i>=0;i--)(s=r[i])&&(t=s(t)||t);return t},f2=(r,a)=>(n,e)=>a(n,e,r);g.UniverSheetsConditionalFormattingPlugin=(s2=class extends c.Plugin{constructor(a=L2,n,e,t){super(),this._config=a,this._injector=n,this._commandService=e,this._configService=t;const{...i}=c.merge({},L2,this._config);this._configService.setConfig(o0,i),[[g.ConditionalFormattingService],[g.ConditionalFormattingFormulaService],[b],[g.ConditionalFormattingViewModel]].forEach(s=>{this._injector.add(s)}),[C2,r2,D2,i2,H].forEach(s=>{this._commandService.registerCommand(s)})}onStarting(){this._injector.get(g.ConditionalFormattingService),c.touchDependencies(this._injector,[[g.ConditionalFormattingService],[g.ConditionalFormattingViewModel]])}},w(s2,"pluginName",u2),w(s2,"type",c.UniverInstanceType.UNIVER_SHEET),s2),g.UniverSheetsConditionalFormattingPlugin=C0([f2(1,c.Inject(c.Injector)),f2(2,c.Inject(c.ICommandService)),f2(3,c.IConfigService)],g.UniverSheetsConditionalFormattingPlugin);const T2="sheet-conditional-rule-icon",D0=35,k2=15,B2=2;class N2 extends W.SheetExtension{constructor(){super();w(this,"_paddingRightAndLeft",B2);w(this,"_width",k2);w(this,"_imageMap",new Map);w(this,"uKey",T2);w(this,"Z_INDEX",D0);w(this,"_radius",1);this._init()}draw(n,e,t,i){const{worksheet:s}=t;if(!s)return!1;n.save(),c.Range.foreach(t.rowColumnSegment,(o,h)=>{if(!s.getRowVisible(o)||!s.getColVisible(h))return;const l=s.getCell(o,h);if(l!=null&&l.iconSet){const{iconType:u,iconId:d}=l.iconSet;if(u===S2)return;const C=this._imageMap.get(this._createKey(u,d));if(!C)return;const f=t.getCellWithCoordByIndex(o,h,!1);let{isMerged:m,isMergedMainCell:F,mergeInfo:E,startY:A,endY:k,startX:N,endX:O}=f;if(m||(F&&(A=E.startY,k=E.endY,N=E.startX,O=E.endX),!this.isRenderDiffRangesByCell(E,i)))return;const a2=O-N,l2=k-A;if(this._width>l2||this._width>a2+this._paddingRightAndLeft*2)return;const m2=(l2-this._width)/2+A;n.drawImage(C,N+this._paddingRightAndLeft,m2,this._width,this._width)}}),n.restore()}_init(){for(const n in K)K[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}`}}W.SpreadsheetExtensionRegistry.add(N2);function U2(r){if(typeof r!="object"||r===null)return r;const a={};for(const n in r)if(r.hasOwnProperty(n)){const e=U2(r[n]);e!==void 0&&(a[n]=e)}return a}Object.defineProperty(g,"isRangesEqual",{enumerable:!0,get:()=>c.isRangesEqual}),g.AddConditionalRuleMutation=C2,g.AddConditionalRuleMutationUndoFactory=a0,g.CFNumberOperator=v,g.CFRuleType=_,g.CFSubRuleType=p,g.CFTextOperator=M,g.CFTimePeriodOperator=x,g.CFValueType=y,g.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH=n2,g.ConditionalFormattingFormulaMarkDirty=H,g.ConditionalFormattingIcon=N2,g.ConditionalFormattingRuleModel=b,g.DEFAULT_BG_COLOR=O2,g.DEFAULT_FONT_COLOR=j2,g.DEFAULT_PADDING=B2,g.DEFAULT_WIDTH=k2,g.DataBar=R2,g.DeleteConditionalRuleMutation=r2,g.DeleteConditionalRuleMutationUndoFactory=b2,g.EMPTY_ICON_TYPE=S2,g.FormulaResultStatus=R,g.IconUKey=T2,g.MoveConditionalRuleMutation=i2,g.MoveConditionalRuleMutationUndoFactory=s0,g.SHEET_CONDITIONAL_FORMATTING_PLUGIN=u2,g.SetConditionalRuleMutation=D2,g.anchorUndoFactory=v2,g.compareWithNumber=q,g.createCfId=E2,g.createDefaultRule=$2,g.createDefaultValue=P2,g.createDefaultValueByValueType=W2,g.dataBarUKey=M2,g.defaultDataBarNativeColor=g2,g.defaultDataBarPositiveColor=h2,g.defaultPlaceholderColor=x2,g.filterRange=Q,g.findIndexByAnchor=V,g.getCacheStyleMatrix=X2,g.getCellValue=B,g.getColorScaleFromValue=y2,g.getMaxInFormulaResult=Y2,g.getOppositeOperator=_2,g.getValueByType=Y,g.iconGroup=I2,g.iconMap=K,g.isAnchorEqual=q2,g.isFloatsEqual=X,g.isNullable=I,g.moveByAnchor=F2,g.removeUndefinedAttr=U2,g.serialTimeToTimestamp=A2,g.setConditionalRuleMutationUndoFactory=l0,g.toYMD_1900=p2,g.transformSupportSymmetryAnchor=w2,Object.defineProperty(g,Symbol.toStringTag,{value:"Module"})});
3
3
 
4
4
 
5
5
  // @univerjs/sheets-conditional-formatting/facade
@@ -7,190 +7,181 @@
7
7
 
8
8
 
9
9
  // @univerjs/sheets-conditional-formatting-ui/index
10
- (function($,v){typeof exports=="object"&&typeof module<"u"?v(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),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","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],v):($=typeof globalThis<"u"?globalThis:$||self,v($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,v,c,q,ge,j,ie,qt,de,In,Re,Ge,wn,qe){"use strict";var ka=Object.defineProperty;var Ba=($,v,c)=>v in $?ka($,v,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[v]=c;var Pe=($,v,c)=>Ba($,typeof v!="symbol"?v+"":v,c);const Xt={type:v.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a}=e,l=t.get(c.ConditionalFormattingRuleModel),S=t.get(v.ICommandService),f=t.get(v.IUniverInstanceService),b=q.getSheetCommandTarget(f);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=l.createCfId(m,T),I={ranges:r,cfId:_,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:a,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:I})}},Xe={type:v.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(t,e){if(!e)return!1;const{rule:r}=e,n=t.get(v.IUndoRedoService),i=t.get(v.ICommandService),a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),S=q.getSheetCommandTarget(l);if(!S)return!1;const{unitId:f,subUnitId:b}=S,m=a.createCfId(f,b),T={unitId:f,subUnitId:b,rule:{...r,cfId:r.cfId||m}},_=c.AddConditionalRuleMutationUndoFactory(t,T),I=i.syncExecuteCommand(c.AddConditionalRuleMutation.id,T);return I&&n.pushUndoRedo({unitID:f,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:T}],undoMutations:[_]}),I}},Yt={type:v.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,config:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),S=t.get(v.IUniverInstanceService),f=q.getSheetCommandTarget(S);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.colorScale,config:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Kt={type:v.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,min:n,max:i,nativeColor:a,positiveColor:l,isGradient:S,stopIfTrue:f,isShowValue:b}=e,m=t.get(c.ConditionalFormattingRuleModel),T=t.get(v.IUniverInstanceService),_=q.getSheetCommandTarget(T);if(!_)return!1;const{unitId:I,subUnitId:R}=_,w=t.get(v.ICommandService),h=m.createCfId(I,R),o={ranges:r,cfId:h,stopIfTrue:!!f,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:i,nativeColor:a,positiveColor:l,isGradient:S}}};return w.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:R,rule:o})}},$t={type:v.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.ICommandService),S=t.get(v.IUniverInstanceService),f=q.getSheetCommandTarget(S);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return l.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Zt={type:v.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a,value:l}=e,S=t.get(c.ConditionalFormattingRuleModel),f=t.get(v.ICommandService),b=t.get(v.IUniverInstanceService),m=q.getSheetCommandTarget(b);if(!m)return!1;const{unitId:T,subUnitId:_}=m,I=S.createCfId(T,_);let R;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(a)){const w=l;if(w.length!==2||!Array.isArray(w))return!1;R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:a,style:n,value:w}}}else{const w=l;if(typeof w!="number")return!1;R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:a,style:n,value:w}}}return f.executeCommand(c.AddConditionalRuleMutation.id,{unitId:T,subUnitId:_,rule:R})}},Jt={type:v.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,isPercent:a,isBottom:l,value:S}=e,f=t.get(c.ConditionalFormattingRuleModel),b=t.get(v.IUniverInstanceService),m=t.get(v.ICommandService),T=q.getSheetCommandTarget(b);if(!T)return!1;const{unitId:_,subUnitId:I}=T,R=f.createCfId(_,I),w={ranges:r,cfId:R,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:a,isBottom:l,style:n,value:S}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:I,rule:w})}},Qt={type:v.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a,value:l}=e,S=t.get(c.ConditionalFormattingRuleModel),f=t.get(v.IUniverInstanceService),b=q.getSheetCommandTarget(f);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=t.get(v.ICommandService),I=S.createCfId(m,T),R={ranges:r,cfId:I,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:a,style:n,value:l}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:R})}},en={type:v.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i,operator:a}=e,l=t.get(c.ConditionalFormattingRuleModel),S=t.get(v.IUniverInstanceService),f=t.get(v.ICommandService),b=q.getSheetCommandTarget(S);if(!b)return!1;const{unitId:m,subUnitId:T}=b,_=l.createCfId(m,T),I={ranges:r,cfId:_,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:a,style:n}};return f.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:T,rule:I})}},tn={type:v.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(t,e){if(!e)return!1;const{ranges:r,style:n,stopIfTrue:i}=e,a=t.get(c.ConditionalFormattingRuleModel),l=t.get(v.IUniverInstanceService),S=t.get(v.ICommandService),f=q.getSheetCommandTarget(l);if(!f)return!1;const{unitId:b,subUnitId:m}=f,T=a.createCfId(b,m),_={ranges:r,cfId:T,stopIfTrue:!!i,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return S.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},St={type:v.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(t,e){var w;if(!e)return!1;const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),i=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=t.get(q.SheetsSelectionsService),S=q.getSheetCommandTarget(n,e);if(!S)return!1;const{unitId:f,subUnitId:b}=S,m=((w=l.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],T=r.getSubunitRules(f,b);if(!(T!=null&&T.length)||!m.length)return!1;const _=[],I=[];T.forEach(h=>{const o=new v.ObjectMatrix;h.ranges.forEach(d=>{v.Range.foreach(d,(C,u)=>{o.setValue(C,u,1)})}),m.forEach(d=>{v.Range.foreach(d,(C,u)=>{o.realDeleteValue(C,u)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(o));if(s.length){const d={...h,ranges:s},C={unitId:f,subUnitId:b,rule:d},u=c.setConditionalRuleMutationUndoFactory(t,C);_.push({id:c.SetConditionalRuleMutation.id,params:C}),I.push(...u)}else{const d={unitId:f,subUnitId:b,cfId:h.cfId},C=c.DeleteConditionalRuleMutationUndoFactory(t,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),I.push(...C)}});const R=v.sequenceExecute(_,i).result;return R&&a.pushUndoRedo({unitID:f,redoMutations:_,undoMutations:I}),R}},Ye={type:v.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(t,e){const r=t.get(c.ConditionalFormattingRuleModel),n=t.get(v.IUniverInstanceService),i=t.get(v.ICommandService),a=t.get(v.IUndoRedoService),l=q.getSheetCommandTarget(n,e);if(!l)return!1;const{unitId:S,subUnitId:f}=l,b=r.getSubunitRules(S,f);if(!(b!=null&&b.length))return!1;const m=b.map(R=>({cfId:R.cfId,unitId:S,subUnitId:f})),T=m.map(R=>({id:c.DeleteConditionalRuleMutation.id,params:R})),_=m.map(R=>c.DeleteConditionalRuleMutationUndoFactory(t,R)[0]),I=v.sequenceExecute(T,i).result;return I&&a.pushUndoRedo({unitID:S,redoMutations:T,undoMutations:_}),I}},Ke={type:v.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=q.getSheetCommandTarget(i,e);if(!a)return!1;const{unitId:l,subUnitId:S}=a,f={unitId:l,subUnitId:S,cfId:e.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(t,f),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,f);return m&&r.pushUndoRedo({unitID:l,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:f}]}),m}},bt={type:v.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=t.get(c.ConditionalFormattingRuleModel),l=q.getSheetCommandTarget(i,e);if(!l)return!1;const{unitId:S,subUnitId:f}=l,b=c.transformSupportSymmetryAnchor(e.start,e.end,a.getSubunitRules(S,f)||[],w=>w.cfId);if(!b)return!1;const[m,T]=b,_={unitId:S,subUnitId:f,start:m,end:T},I=c.MoveConditionalRuleMutationUndoFactory(_),R=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return R&&r.pushUndoRedo({unitID:S,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:I}),R}},Rt={type:v.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(t,e){if(!e)return!1;const r=t.get(v.IUndoRedoService),n=t.get(v.ICommandService),i=t.get(v.IUniverInstanceService),a=q.getSheetCommandTarget(i,e);if(!a)return!1;const{unitId:l,subUnitId:S}=a,f={unitId:l,subUnitId:S,rule:e.rule},b=c.setConditionalRuleMutationUndoFactory(t,f),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,f);return m&&r.pushUndoRedo({unitID:l,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:f}]}),m}};function Ar(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function _n(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}),r}var nn={exports:{}},$e={};/**
11
- * @license React
12
- * react-jsx-runtime.production.min.js
13
- *
14
- * Copyright (c) Facebook, Inc. and its affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var xn;function Wr(){if(xn)return $e;xn=1;var t=j,e=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function l(S,f,b){var m,T={},_=null,I=null;b!==void 0&&(_=""+b),f.key!==void 0&&(_=""+f.key),f.ref!==void 0&&(I=f.ref);for(m in f)n.call(f,m)&&!a.hasOwnProperty(m)&&(T[m]=f[m]);if(S&&S.defaultProps)for(m in f=S.defaultProps,f)T[m]===void 0&&(T[m]=f[m]);return{$$typeof:e,type:S,key:_,ref:I,props:T,_owner:i.current}}return $e.Fragment=r,$e.jsx=l,$e.jsxs=l,$e}var En;function Hr(){return En||(En=1,nn.exports=Wr()),nn.exports}var x=Hr();const A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",cfRuleItem:"univer-cf-rule-item",preview:"univer-preview",createRule:"univer-create-rule",button:"univer-button",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",inputWidth:"univer-input-width",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Se=function(){return Se=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++){e=arguments[r];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])}return t},Se.apply(this,arguments)},kr=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r},Ue=j.forwardRef(function(t,e){var r=t.icon,n=t.id,i=t.className,a=t.extend,l=kr(t,["icon","id","className","extend"]),S="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),f=j.useRef("_".concat(Gr()));return On(r,"".concat(n),{defIds:r.defIds,idSuffix:f.current},Se({ref:e,className:S},l),a)});function On(t,e,r,n,i){return j.createElement(t.tag,Se(Se({key:e},Br(t,r,i)),n),(Fr(t,r).children||[]).map(function(a,l){return On(a,"".concat(e,"-").concat(t.tag,"-").concat(l),r,void 0,i)}))}function Br(t,e,r){var n=Se({},t.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var i=e.defIds;return!i||i.length===0||(t.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(function(a){var l=a[0],S=a[1];typeof S=="string"&&(n[l]=S.replace(/url\(#(.*)\)/,"url(#$1".concat(e.idSuffix,")")))})),n}function Fr(t,e){var r,n=e.defIds;return!n||n.length===0?t:t.tag==="defs"&&(!((r=t.children)===null||r===void 0)&&r.length)?Se(Se({},t),{children:t.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?Se(Se({},i),{attrs:Se(Se({},i.attrs),{id:i.attrs.id+e.idSuffix})}):i})}):t}function Gr(){return Math.random().toString(36).substring(2,8)}Ue.displayName="UniverIcon";var qr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ct=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"delete-single",ref:e,icon:qr}))});Ct.displayName="DeleteSingle";var Xr={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"}}]},Pn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"increase-single",ref:e,icon:Xr}))});Pn.displayName="IncreaseSingle";var Yr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tt=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"more-down-single",ref:e,icon:Yr}))});Tt.displayName="MoreDownSingle";var Kr={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"}}]}]},Mn=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"sequence-single",ref:e,icon:Kr}))});Mn.displayName="SequenceSingle";var $r={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"}}]}]},Ze=j.forwardRef(function(t,e){return j.createElement(Ue,Object.assign({},t,{id:"slash-single",ref:e,icon:$r}))});Ze.displayName="SlashSingle";var rn={exports:{}},Je={},Qe={exports:{}},Zr=Qe.exports,Dn;function an(){return Dn||(Dn=1,function(t,e){(function(r,n){n(e)})(Zr,function(r){function n(k){return function(se,O,P,N,z,K,B){return k(se,O,B)}}function i(k){return function(se,O,P,N){if(!se||!O||typeof se!="object"||typeof O!="object")return k(se,O,P,N);var z=N.get(se),K=N.get(O);if(z&&K)return z===O&&K===se;N.set(se,O),N.set(O,se);var B=k(se,O,P,N);return N.delete(se),N.delete(O),B}}function a(k,Q){var se={};for(var O in k)se[O]=k[O];for(var O in Q)se[O]=Q[O];return se}function l(k){return k.constructor===Object||k.constructor==null}function S(k){return typeof k.then=="function"}function f(k,Q){return k===Q||k!==k&&Q!==Q}var b="[object Arguments]",m="[object Boolean]",T="[object Date]",_="[object RegExp]",I="[object Map]",R="[object Number]",w="[object Object]",h="[object Set]",o="[object String]",s=Object.prototype.toString;function d(k){var Q=k.areArraysEqual,se=k.areDatesEqual,O=k.areMapsEqual,P=k.areObjectsEqual,N=k.areRegExpsEqual,z=k.areSetsEqual,K=k.createIsNestedEqual,B=K(J);function J(Z,te,ce){if(Z===te)return!0;if(!Z||!te||typeof Z!="object"||typeof te!="object")return Z!==Z&&te!==te;if(l(Z)&&l(te))return P(Z,te,B,ce);var je=Array.isArray(Z),be=Array.isArray(te);if(je||be)return je===be&&Q(Z,te,B,ce);var me=s.call(Z);return me!==s.call(te)?!1:me===T?se(Z,te,B,ce):me===_?N(Z,te,B,ce):me===I?O(Z,te,B,ce):me===h?z(Z,te,B,ce):me===w||me===b?S(Z)||S(te)?!1:P(Z,te,B,ce):me===m||me===R||me===o?f(Z.valueOf(),te.valueOf()):!1}return J}function C(k,Q,se,O){var P=k.length;if(Q.length!==P)return!1;for(;P-- >0;)if(!se(k[P],Q[P],P,P,k,Q,O))return!1;return!0}var u=i(C);function g(k,Q){return f(k.valueOf(),Q.valueOf())}function p(k,Q,se,O){var P=k.size===Q.size;if(!P)return!1;if(!k.size)return!0;var N={},z=0;return k.forEach(function(K,B){if(P){var J=!1,Z=0;Q.forEach(function(te,ce){!J&&!N[Z]&&(J=se(B,ce,z,Z,k,Q,O)&&se(K,te,B,ce,k,Q,O))&&(N[Z]=!0),Z++}),z++,P=J}}),P}var y=i(p),M="_owner",L=Object.prototype.hasOwnProperty;function V(k,Q,se,O){var P=Object.keys(k),N=P.length;if(Object.keys(Q).length!==N)return!1;for(var z;N-- >0;){if(z=P[N],z===M){var K=!!k.$$typeof,B=!!Q.$$typeof;if((K||B)&&K!==B)return!1}if(!L.call(Q,z)||!se(k[z],Q[z],z,z,k,Q,O))return!1}return!0}var U=i(V);function E(k,Q){return k.source===Q.source&&k.flags===Q.flags}function D(k,Q,se,O){var P=k.size===Q.size;if(!P)return!1;if(!k.size)return!0;var N={};return k.forEach(function(z,K){if(P){var B=!1,J=0;Q.forEach(function(Z,te){!B&&!N[J]&&(B=se(z,Z,K,te,k,Q,O))&&(N[J]=!0),J++}),P=B}}),P}var W=i(D),X=Object.freeze({areArraysEqual:C,areDatesEqual:g,areMapsEqual:p,areObjectsEqual:V,areRegExpsEqual:E,areSetsEqual:D,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:u,areDatesEqual:g,areMapsEqual:y,areObjectsEqual:U,areRegExpsEqual:E,areSetsEqual:W,createIsNestedEqual:n}),ne=d(X);function ee(k,Q){return ne(k,Q,void 0)}var F=d(a(X,{createIsNestedEqual:function(){return f}}));function H(k,Q){return F(k,Q,void 0)}var re=d(Y);function oe(k,Q){return re(k,Q,new WeakMap)}var ue=d(a(Y,{createIsNestedEqual:function(){return f}}));function he(k,Q){return ue(k,Q,new WeakMap)}function ye(k){return d(a(X,k(X)))}function Ce(k){var Q=d(a(Y,k(Y)));return function(se,O,P){return P===void 0&&(P=new WeakMap),Q(se,O,P)}}r.circularDeepEqual=oe,r.circularShallowEqual=he,r.createCustomCircularEqual=Ce,r.createCustomEqual=ye,r.deepEqual=ee,r.sameValueZeroEqual=f,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Qe,Qe.exports)),Qe.exports}var It={exports:{}},Nn;function on(){if(Nn)return It.exports;Nn=1;function t(r){var n,i,a="";if(typeof r=="string"||typeof r=="number")a+=r;else if(typeof r=="object")if(Array.isArray(r)){var l=r.length;for(n=0;n<l;n++)r[n]&&(i=t(r[n]))&&(a&&(a+=" "),a+=i)}else for(i in r)r[i]&&(a&&(a+=" "),a+=i);return a}function e(){for(var r,n,i=0,a="",l=arguments.length;i<l;i++)(r=arguments[i])&&(n=t(r))&&(a&&(a+=" "),a+=n);return a}return It.exports=e,It.exports.clsx=e,It.exports}var ae={},sn,jn;function Jr(){return jn||(jn=1,sn=function(e,r,n){return e===r?!0:e.className===r.className&&n(e.style,r.style)&&e.width===r.width&&e.autoSize===r.autoSize&&e.cols===r.cols&&e.draggableCancel===r.draggableCancel&&e.draggableHandle===r.draggableHandle&&n(e.verticalCompact,r.verticalCompact)&&n(e.compactType,r.compactType)&&n(e.layout,r.layout)&&n(e.margin,r.margin)&&n(e.containerPadding,r.containerPadding)&&e.rowHeight===r.rowHeight&&e.maxRows===r.maxRows&&e.isBounded===r.isBounded&&e.isDraggable===r.isDraggable&&e.isResizable===r.isResizable&&e.allowOverlap===r.allowOverlap&&e.preventCollision===r.preventCollision&&e.useCSSTransforms===r.useCSSTransforms&&e.transformScale===r.transformScale&&e.isDroppable===r.isDroppable&&n(e.resizeHandles,r.resizeHandles)&&n(e.resizeHandle,r.resizeHandle)&&e.onLayoutChange===r.onLayoutChange&&e.onDragStart===r.onDragStart&&e.onDrag===r.onDrag&&e.onDragStop===r.onDragStop&&e.onResizeStart===r.onResizeStart&&e.onResize===r.onResize&&e.onResizeStop===r.onResizeStop&&e.onDrop===r.onDrop&&n(e.droppingItem,r.droppingItem)&&n(e.innerRef,r.innerRef)}),sn}var Ln;function Ve(){if(Ln)return ae;Ln=1,Object.defineProperty(ae,"__esModule",{value:!0}),ae.bottom=n,ae.childrenEqual=f,ae.cloneLayout=i,ae.cloneLayoutItem=S,ae.collides=m,ae.compact=T,ae.compactItem=R,ae.compactType=k,ae.correctBounds=w,ae.fastPositionEqual=b,ae.fastRGLPropsEqual=void 0,ae.getAllCollisions=s,ae.getFirstCollision=o,ae.getLayoutItem=h,ae.getStatics=d,ae.modifyLayout=a,ae.moveElement=C,ae.moveElementAwayFromCollision=u,ae.noop=void 0,ae.perc=g,ae.resizeItemInDirection=F,ae.setTopLeft=re,ae.setTransform=H,ae.sortLayoutItems=oe,ae.sortLayoutItemsByColRow=he,ae.sortLayoutItemsByRowCol=ue,ae.synchronizeLayoutWithChildren=ye,ae.validateLayout=Ce,ae.withLayoutItem=l;var t=an(),e=r(j);function r(O){return O&&O.__esModule?O:{default:O}}function n(O){let P=0,N;for(let z=0,K=O.length;z<K;z++)N=O[z].y+O[z].h,N>P&&(P=N);return P}function i(O){const P=Array(O.length);for(let N=0,z=O.length;N<z;N++)P[N]=S(O[N]);return P}function a(O,P){const N=Array(O.length);for(let z=0,K=O.length;z<K;z++)P.i===O[z].i?N[z]=P:N[z]=O[z];return N}function l(O,P,N){let z=h(O,P);return z?(z=N(S(z)),O=a(O,z),[O,z]):[O,null]}function S(O){return{w:O.w,h:O.h,x:O.x,y:O.y,i:O.i,minW:O.minW,maxW:O.maxW,minH:O.minH,maxH:O.maxH,moved:!!O.moved,static:!!O.static,isDraggable:O.isDraggable,isResizable:O.isResizable,resizeHandles:O.resizeHandles,isBounded:O.isBounded}}function f(O,P){return(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.key),e.default.Children.map(P,N=>N==null?void 0:N.key))&&(0,t.deepEqual)(e.default.Children.map(O,N=>N==null?void 0:N.props["data-grid"]),e.default.Children.map(P,N=>N==null?void 0:N.props["data-grid"]))}ae.fastRGLPropsEqual=Jr();function b(O,P){return O.left===P.left&&O.top===P.top&&O.width===P.width&&O.height===P.height}function m(O,P){return!(O.i===P.i||O.x+O.w<=P.x||O.x>=P.x+P.w||O.y+O.h<=P.y||O.y>=P.y+P.h)}function T(O,P,N,z){const K=d(O),B=oe(O,P),J=Array(O.length);for(let Z=0,te=B.length;Z<te;Z++){let ce=S(B[Z]);ce.static||(ce=R(K,ce,P,N,B,z),K.push(ce)),J[O.indexOf(B[Z])]=ce,ce.moved=!1}return J}const _={x:"w",y:"h"};function I(O,P,N,z){const K=_[z];P[z]+=1;const B=O.map(J=>J.i).indexOf(P.i);for(let J=B+1;J<O.length;J++){const Z=O[J];if(!Z.static){if(Z.y>P.y+P.h)break;m(P,Z)&&I(O,Z,N+P[K],z)}}P[z]=N}function R(O,P,N,z,K,B){const J=N==="vertical",Z=N==="horizontal";if(J)for(P.y=Math.min(n(O),P.y);P.y>0&&!o(O,P);)P.y--;else if(Z)for(;P.x>0&&!o(O,P);)P.x--;let te;for(;(te=o(O,P))&&!(N===null&&B);)if(Z?I(K,P,te.x+te.w,"x"):I(K,P,te.y+te.h,"y"),Z&&P.x+P.w>z)for(P.x=z-P.w,P.y++;P.x>0&&!o(O,P);)P.x--;return P.y=Math.max(P.y,0),P.x=Math.max(P.x,0),P}function w(O,P){const N=d(O);for(let z=0,K=O.length;z<K;z++){const B=O[z];if(B.x+B.w>P.cols&&(B.x=P.cols-B.w),B.x<0&&(B.x=0,B.w=P.cols),!B.static)N.push(B);else for(;o(N,B);)B.y++}return O}function h(O,P){for(let N=0,z=O.length;N<z;N++)if(O[N].i===P)return O[N]}function o(O,P){for(let N=0,z=O.length;N<z;N++)if(m(O[N],P))return O[N]}function s(O,P){return O.filter(N=>m(N,P))}function d(O){return O.filter(P=>P.static)}function C(O,P,N,z,K,B,J,Z,te){if(P.static&&P.isDraggable!==!0||P.y===z&&P.x===N)return O;`${P.i}${String(N)}${String(z)}${P.x}${P.y}`;const ce=P.x,je=P.y;typeof N=="number"&&(P.x=N),typeof z=="number"&&(P.y=z),P.moved=!0;let be=oe(O,J);(J==="vertical"&&typeof z=="number"?je>=z:J==="horizontal"&&typeof N=="number"?ce>=N:!1)&&(be=be.reverse());const Fe=s(be,P),Gt=Fe.length>0;if(Gt&&te)return i(O);if(Gt&&B)return`${P.i}`,P.x=ce,P.y=je,P.moved=!1,O;for(let Tn=0,Ha=Fe.length;Tn<Ha;Tn++){const Le=Fe[Tn];`${P.i}${P.x}${P.y}${Le.i}${Le.x}${Le.y}`,!Le.moved&&(Le.static?O=u(O,Le,P,K,J):O=u(O,P,Le,K,J))}return O}function u(O,P,N,z,K,B){const J=K==="horizontal",Z=K==="vertical",te=P.static;if(z){z=!1;const be={x:J?Math.max(P.x-N.w,0):N.x,y:Z?Math.max(P.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},me=o(O,be),Fe=me&&me.y+me.h>P.y,Gt=me&&P.x+P.w>me.x;if(me){if(Fe&&Z)return C(O,N,void 0,P.y+1,z,te,K);if(Fe&&K==null)return P.y=N.y,N.y=N.y+N.h,O;if(Gt&&J)return C(O,P,N.x,void 0,z,te,K)}else return`${N.i}${be.x}${be.y}`,C(O,N,J?be.x:void 0,Z?be.y:void 0,z,te,K)}const ce=J?N.x+1:void 0,je=Z?N.y+1:void 0;return ce==null&&je==null?O:C(O,N,J?N.x+1:void 0,Z?N.y+1:void 0,z,te,K)}function g(O){return O*100+"%"}const p=(O,P,N,z)=>O+N>z?P:N,y=(O,P,N)=>O<0?P:N,M=O=>Math.max(0,O),L=O=>Math.max(0,O),V=(O,P,N)=>{let{left:z,height:K,width:B}=P;const J=O.top-(K-O.height);return{left:z,width:B,height:y(J,O.height,K),top:L(J)}},U=(O,P,N)=>{let{top:z,left:K,height:B,width:J}=P;return{top:z,height:B,width:p(O.left,O.width,J,N),left:M(K)}},E=(O,P,N)=>{let{top:z,height:K,width:B}=P;const J=O.left-(B-O.width);return{height:K,width:J<0?O.width:p(O.left,O.width,B,N),top:L(z),left:M(J)}},D=(O,P,N)=>{let{top:z,left:K,height:B,width:J}=P;return{width:J,left:K,height:y(z,O.height,B),top:L(z)}},ee={n:V,ne:function(){return V(arguments.length<=0?void 0:arguments[0],U(...arguments))},e:U,se:function(){return D(arguments.length<=0?void 0:arguments[0],U(...arguments))},s:D,sw:function(){return D(arguments.length<=0?void 0:arguments[0],E(...arguments))},w:E,nw:function(){return V(arguments.length<=0?void 0:arguments[0],E(...arguments))}};function F(O,P,N,z){const K=ee[O];return K?K(P,{...P,...N},z):N}function H(O){let{top:P,left:N,width:z,height:K}=O;const B=`translate(${N}px,${P}px)`;return{transform:B,WebkitTransform:B,MozTransform:B,msTransform:B,OTransform:B,width:`${z}px`,height:`${K}px`,position:"absolute"}}function re(O){let{top:P,left:N,width:z,height:K}=O;return{top:`${P}px`,left:`${N}px`,width:`${z}px`,height:`${K}px`,position:"absolute"}}function oe(O,P){return P==="horizontal"?he(O):P==="vertical"?ue(O):O}function ue(O){return O.slice(0).sort(function(P,N){return P.y>N.y||P.y===N.y&&P.x>N.x?1:P.y===N.y&&P.x===N.x?0:-1})}function he(O){return O.slice(0).sort(function(P,N){return P.x>N.x||P.x===N.x&&P.y>N.y?1:-1})}function ye(O,P,N,z,K){O=O||[];const B=[];e.default.Children.forEach(P,Z=>{if((Z==null?void 0:Z.key)==null)return;const te=h(O,String(Z.key)),ce=Z.props["data-grid"];te&&ce==null?B.push(S(te)):ce?B.push(S({...ce,i:Z.key})):B.push(S({w:1,h:1,x:0,y:n(B),i:String(Z.key)}))});const J=w(B,{cols:N});return K?J:T(J,z,N)}function Ce(O){let P=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(O))throw new Error(P+" must be an array!");for(let z=0,K=O.length;z<K;z++){const B=O[z];for(let J=0;J<N.length;J++)if(typeof B[N[J]]!="number")throw new Error("ReactGridLayout: "+P+"["+z+"]."+N[J]+" must be a number!")}}function k(O){const{verticalCompact:P,compactType:N}=O||{};return P===!1?null:N}function Q(){}const se=()=>{};return ae.noop=se,ae}var Ie={},Un;function ln(){if(Un)return Ie;Un=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.calcGridColWidth=t,Ie.calcGridItemPosition=r,Ie.calcGridItemWHPx=e,Ie.calcWH=i,Ie.calcXY=n,Ie.clamp=a;function t(l){const{margin:S,containerPadding:f,containerWidth:b,cols:m}=l;return(b-S[0]*(m-1)-f[0]*2)/m}function e(l,S,f){return Number.isFinite(l)?Math.round(S*l+Math.max(0,l-1)*f):l}function r(l,S,f,b,m,T){const{margin:_,containerPadding:I,rowHeight:R}=l,w=t(l),h={};return T&&T.resizing?(h.width=Math.round(T.resizing.width),h.height=Math.round(T.resizing.height)):(h.width=e(b,w,_[0]),h.height=e(m,R,_[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((R+_[1])*f+I[1]),h.left=Math.round((w+_[0])*S+I[0])),h}function n(l,S,f,b,m){const{margin:T,cols:_,rowHeight:I,maxRows:R}=l,w=t(l);let h=Math.round((f-T[0])/(w+T[0])),o=Math.round((S-T[1])/(I+T[1]));return h=a(h,0,_-b),o=a(o,0,R-m),{x:h,y:o}}function i(l,S,f,b,m,T){const{margin:_,maxRows:I,cols:R,rowHeight:w}=l,h=t(l);let o=Math.round((S+_[0])/(h+_[0])),s=Math.round((f+_[1])/(w+_[1])),d=a(o,0,R-b),C=a(s,0,I-m);return["sw","w","nw"].indexOf(T)!==-1&&(d=a(o,0,R)),["nw","n","ne"].indexOf(T)!==-1&&(C=a(s,0,I)),{w:d,h:C}}function a(l,S,f){return Math.max(Math.min(l,f),S)}return Ie}var et={},un={exports:{}},cn,Vn;function Qr(){if(Vn)return cn;Vn=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return cn=t,cn}var dn,zn;function ei(){if(zn)return dn;zn=1;var t=Qr();function e(){}function r(){}return r.resetWarningCache=e,dn=function(){function n(l,S,f,b,m,T){if(T!==t){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}n.isRequired=n;function i(){return n}var a={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:i,element:n,elementType:n,instanceOf:i,node:n,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:r,resetWarningCache:e};return a.PropTypes=a,a},dn}var An;function xe(){return An||(An=1,un.exports=ei()()),un.exports}var tt={exports:{}},fn={};function Wn(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(r=Wn(t[e]))&&(n&&(n+=" "),n+=r);else for(e in t)t[e]&&(n&&(n+=" "),n+=e);return n}function Hn(){for(var t,e,r=0,n="";r<arguments.length;)(t=arguments[r++])&&(e=Wn(t))&&(n&&(n+=" "),n+=e);return n}const ti=_n(Object.freeze(Object.defineProperty({__proto__:null,clsx:Hn,default:Hn},Symbol.toStringTag,{value:"Module"})));var fe={},Ee={},kn;function wt(){if(kn)return Ee;kn=1,Object.defineProperty(Ee,"__esModule",{value:!0}),Ee.dontSetMe=i,Ee.findInArray=t,Ee.int=n,Ee.isFunction=e,Ee.isNum=r;function t(a,l){for(let S=0,f=a.length;S<f;S++)if(l.apply(l,[a[S],S,a]))return a[S]}function e(a){return typeof a=="function"||Object.prototype.toString.call(a)==="[object Function]"}function r(a){return typeof a=="number"&&!isNaN(a)}function n(a){return parseInt(a,10)}function i(a,l,S){if(a[l])return new Error("Invalid prop ".concat(l," passed to ").concat(S," - do not set this, set it on the child."))}return Ee}var Oe={},Bn;function ni(){if(Bn)return Oe;Bn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.browserPrefixToKey=r,Oe.browserPrefixToStyle=n,Oe.default=void 0,Oe.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var a;let l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const S=(a=window.document)===null||a===void 0||(a=a.documentElement)===null||a===void 0?void 0:a.style;if(!S||l in S)return"";for(let f=0;f<t.length;f++)if(r(l,t[f])in S)return t[f];return""}function r(a,l){return l?"".concat(l).concat(i(a)):a}function n(a,l){return l?"-".concat(l.toLowerCase(),"-").concat(a):a}function i(a){let l="",S=!0;for(let f=0;f<a.length;f++)S?(l+=a[f].toUpperCase(),S=!1):a[f]==="-"?S=!0:l+=a[f];return l}return Oe.default=e(),Oe}var Fn;function pn(){if(Fn)return fe;Fn=1,Object.defineProperty(fe,"__esModule",{value:!0}),fe.addClassName=u,fe.addEvent=S,fe.addUserSelectStyles=d,fe.createCSSTransform=R,fe.createSVGTransform=w,fe.getTouch=o,fe.getTouchIdentifier=s,fe.getTranslation=h,fe.innerHeight=T,fe.innerWidth=_,fe.matchesSelector=a,fe.matchesSelectorAndParentsTo=l,fe.offsetXYFromParent=I,fe.outerHeight=b,fe.outerWidth=m,fe.removeClassName=g,fe.removeEvent=f,fe.removeUserSelectStyles=C;var t=wt(),e=n(ni());function r(p){if(typeof WeakMap!="function")return null;var y=new WeakMap,M=new WeakMap;return(r=function(L){return L?M:y})(p)}function n(p,y){if(p&&p.__esModule)return p;if(p===null||typeof p!="object"&&typeof p!="function")return{default:p};var M=r(y);if(M&&M.has(p))return M.get(p);var L={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var U in p)if(U!=="default"&&Object.prototype.hasOwnProperty.call(p,U)){var E=V?Object.getOwnPropertyDescriptor(p,U):null;E&&(E.get||E.set)?Object.defineProperty(L,U,E):L[U]=p[U]}return L.default=p,M&&M.set(p,L),L}let i="";function a(p,y){return i||(i=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(M){return(0,t.isFunction)(p[M])})),(0,t.isFunction)(p[i])?p[i](y):!1}function l(p,y,M){let L=p;do{if(a(L,y))return!0;if(L===M)return!1;L=L.parentNode}while(L);return!1}function S(p,y,M,L){if(!p)return;const V={capture:!0,...L};p.addEventListener?p.addEventListener(y,M,V):p.attachEvent?p.attachEvent("on"+y,M):p["on"+y]=M}function f(p,y,M,L){if(!p)return;const V={capture:!0,...L};p.removeEventListener?p.removeEventListener(y,M,V):p.detachEvent?p.detachEvent("on"+y,M):p["on"+y]=null}function b(p){let y=p.clientHeight;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y+=(0,t.int)(M.borderTopWidth),y+=(0,t.int)(M.borderBottomWidth),y}function m(p){let y=p.clientWidth;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y+=(0,t.int)(M.borderLeftWidth),y+=(0,t.int)(M.borderRightWidth),y}function T(p){let y=p.clientHeight;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y-=(0,t.int)(M.paddingTop),y-=(0,t.int)(M.paddingBottom),y}function _(p){let y=p.clientWidth;const M=p.ownerDocument.defaultView.getComputedStyle(p);return y-=(0,t.int)(M.paddingLeft),y-=(0,t.int)(M.paddingRight),y}function I(p,y,M){const V=y===y.ownerDocument.body?{left:0,top:0}:y.getBoundingClientRect(),U=(p.clientX+y.scrollLeft-V.left)/M,E=(p.clientY+y.scrollTop-V.top)/M;return{x:U,y:E}}function R(p,y){const M=h(p,y,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:M}}function w(p,y){return h(p,y,"")}function h(p,y,M){let{x:L,y:V}=p,U="translate(".concat(L).concat(M,",").concat(V).concat(M,")");if(y){const E="".concat(typeof y.x=="string"?y.x:y.x+M),D="".concat(typeof y.y=="string"?y.y:y.y+M);U="translate(".concat(E,", ").concat(D,")")+U}return U}function o(p,y){return p.targetTouches&&(0,t.findInArray)(p.targetTouches,M=>y===M.identifier)||p.changedTouches&&(0,t.findInArray)(p.changedTouches,M=>y===M.identifier)}function s(p){if(p.targetTouches&&p.targetTouches[0])return p.targetTouches[0].identifier;if(p.changedTouches&&p.changedTouches[0])return p.changedTouches[0].identifier}function d(p){if(!p)return;let y=p.getElementById("react-draggable-style-el");y||(y=p.createElement("style"),y.type="text/css",y.id="react-draggable-style-el",y.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
19
- `,y.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
20
- `,p.getElementsByTagName("head")[0].appendChild(y)),p.body&&u(p.body,"react-draggable-transparent-selection")}function C(p){if(p)try{if(p.body&&g(p.body,"react-draggable-transparent-selection"),p.selection)p.selection.empty();else{const y=(p.defaultView||window).getSelection();y&&y.type!=="Caret"&&y.removeAllRanges()}}catch{}}function u(p,y){p.classList?p.classList.add(y):p.className.match(new RegExp("(?:^|\\s)".concat(y,"(?!\\S)")))||(p.className+=" ".concat(y))}function g(p,y){p.classList?p.classList.remove(y):p.className=p.className.replace(new RegExp("(?:^|\\s)".concat(y,"(?!\\S)"),"g"),"")}return fe}var Te={},Gn;function qn(){if(Gn)return Te;Gn=1,Object.defineProperty(Te,"__esModule",{value:!0}),Te.canDragX=i,Te.canDragY=a,Te.createCoreData=S,Te.createDraggableData=f,Te.getBoundPosition=r,Te.getControlPosition=l,Te.snapToGrid=n;var t=wt(),e=pn();function r(T,_,I){if(!T.props.bounds)return[_,I];let{bounds:R}=T.props;R=typeof R=="string"?R:b(R);const w=m(T);if(typeof R=="string"){const{ownerDocument:h}=w,o=h.defaultView;let s;if(R==="parent"?s=w.parentNode:s=h.querySelector(R),!(s instanceof o.HTMLElement))throw new Error('Bounds selector "'+R+'" could not find an element.');const d=s,C=o.getComputedStyle(w),u=o.getComputedStyle(d);R={left:-w.offsetLeft+(0,t.int)(u.paddingLeft)+(0,t.int)(C.marginLeft),top:-w.offsetTop+(0,t.int)(u.paddingTop)+(0,t.int)(C.marginTop),right:(0,e.innerWidth)(d)-(0,e.outerWidth)(w)-w.offsetLeft+(0,t.int)(u.paddingRight)-(0,t.int)(C.marginRight),bottom:(0,e.innerHeight)(d)-(0,e.outerHeight)(w)-w.offsetTop+(0,t.int)(u.paddingBottom)-(0,t.int)(C.marginBottom)}}return(0,t.isNum)(R.right)&&(_=Math.min(_,R.right)),(0,t.isNum)(R.bottom)&&(I=Math.min(I,R.bottom)),(0,t.isNum)(R.left)&&(_=Math.max(_,R.left)),(0,t.isNum)(R.top)&&(I=Math.max(I,R.top)),[_,I]}function n(T,_,I){const R=Math.round(_/T[0])*T[0],w=Math.round(I/T[1])*T[1];return[R,w]}function i(T){return T.props.axis==="both"||T.props.axis==="x"}function a(T){return T.props.axis==="both"||T.props.axis==="y"}function l(T,_,I){const R=typeof _=="number"?(0,e.getTouch)(T,_):null;if(typeof _=="number"&&!R)return null;const w=m(I),h=I.props.offsetParent||w.offsetParent||w.ownerDocument.body;return(0,e.offsetXYFromParent)(R||T,h,I.props.scale)}function S(T,_,I){const R=!(0,t.isNum)(T.lastX),w=m(T);return R?{node:w,deltaX:0,deltaY:0,lastX:_,lastY:I,x:_,y:I}:{node:w,deltaX:_-T.lastX,deltaY:I-T.lastY,lastX:T.lastX,lastY:T.lastY,x:_,y:I}}function f(T,_){const I=T.props.scale;return{node:_.node,x:T.state.x+_.deltaX/I,y:T.state.y+_.deltaY/I,deltaX:_.deltaX/I,deltaY:_.deltaY/I,lastX:T.state.x,lastY:T.state.y}}function b(T){return{left:T.left,top:T.top,right:T.right,bottom:T.bottom}}function m(T){const _=T.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Te}var nt={},_t={},Xn;function Yn(){if(Xn)return _t;Xn=1,Object.defineProperty(_t,"__esModule",{value:!0}),_t.default=t;function t(){}return _t}var Kn;function ri(){if(Kn)return nt;Kn=1,Object.defineProperty(nt,"__esModule",{value:!0}),nt.default=void 0;var t=b(j),e=S(xe()),r=S(In),n=pn(),i=qn(),a=wt(),l=S(Yn());function S(h){return h&&h.__esModule?h:{default:h}}function f(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(f=function(d){return d?s:o})(h)}function b(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=f(o);if(s&&s.has(h))return s.get(h);var d={},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let R=I.mouse,w=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",o=>{if(this.props.onMouseDown(o),!this.props.allowAnyClick&&typeof o.button=="number"&&o.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:d}=s;if(this.props.disabled||!(o.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(o.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(o.target,this.props.cancel,s))return;o.type==="touchstart"&&o.preventDefault();const C=(0,n.getTouchIdentifier)(o);this.touchIdentifier=C;const u=(0,i.getControlPosition)(o,C,this);if(u==null)return;const{x:g,y:p}=u,y=(0,i.createCoreData)(this,g,p);(0,l.default)("DraggableCore: handleDragStart: %j",y),(0,l.default)("calling",this.props.onStart),!(this.props.onStart(o,y)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=p,(0,n.addEvent)(d,R.move,this.handleDrag),(0,n.addEvent)(d,R.stop,this.handleDragStop))}),m(this,"handleDrag",o=>{const s=(0,i.getControlPosition)(o,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let p=d-this.lastX,y=C-this.lastY;if([p,y]=(0,i.snapToGrid)(this.props.grid,p,y),!p&&!y)return;d=this.lastX+p,C=this.lastY+y}const u=(0,i.createCoreData)(this,d,C);if((0,l.default)("DraggableCore: handleDrag: %j",u),this.props.onDrag(o,u)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const y=document.createEvent("MouseEvents");y.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(y)}return}this.lastX=d,this.lastY=C}),m(this,"handleDragStop",o=>{if(!this.dragging)return;const s=(0,i.getControlPosition)(o,this.touchIdentifier,this);if(s==null)return;let{x:d,y:C}=s;if(Array.isArray(this.props.grid)){let y=d-this.lastX||0,M=C-this.lastY||0;[y,M]=(0,i.snapToGrid)(this.props.grid,y,M),d=this.lastX+y,C=this.lastY+M}const u=(0,i.createCoreData)(this,d,C);if(this.props.onStop(o,u)===!1||this.mounted===!1)return!1;const p=this.findDOMNode();p&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(p.ownerDocument),(0,l.default)("DraggableCore: handleDragStop: %j",u),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,p&&((0,l.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(p.ownerDocument,R.move,this.handleDrag),(0,n.removeEvent)(p.ownerDocument,R.stop,this.handleDragStop))}),m(this,"onMouseDown",o=>(R=I.mouse,this.handleDragStart(o))),m(this,"onMouseUp",o=>(R=I.mouse,this.handleDragStop(o))),m(this,"onTouchStart",o=>(R=I.touch,this.handleDragStart(o))),m(this,"onTouchEnd",o=>(R=I.touch,this.handleDragStop(o)))}componentDidMount(){this.mounted=!0;const o=this.findDOMNode();o&&(0,n.addEvent)(o,I.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const o=this.findDOMNode();if(o){const{ownerDocument:s}=o;(0,n.removeEvent)(s,I.mouse.move,this.handleDrag),(0,n.removeEvent)(s,I.touch.move,this.handleDrag),(0,n.removeEvent)(s,I.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,I.touch.stop,this.handleDragStop),(0,n.removeEvent)(o,I.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var o,s;return(o=this.props)!==null&&o!==void 0&&o.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return nt.default=w,m(w,"displayName","DraggableCore"),m(w,"propTypes",{allowAnyClick:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(h,o){if(h[o]&&h[o].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:a.dontSetMe,style:a.dontSetMe,transform:a.dontSetMe}),m(w,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),nt}var $n;function ii(){return $n||($n=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return f.default}}),t.default=void 0;var e=_(j),r=m(xe()),n=m(In),i=m(ti),a=pn(),l=qn(),S=wt(),f=m(ri()),b=m(Yn());function m(s){return s&&s.__esModule?s:{default:s}}function T(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(T=function(u){return u?C:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=T(d);if(C&&C.has(s))return C.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in s)if(p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)){var y=g?Object.getOwnPropertyDescriptor(s,p):null;y&&(y.get||y.set)?Object.defineProperty(u,p,y):u[p]=s[p]}return u.default=s,C&&C.set(s,u),u}function I(){return I=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var u in C)Object.prototype.hasOwnProperty.call(C,u)&&(s[u]=C[u])}return s},I.apply(this,arguments)}function R(s,d,C){return d=w(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function w(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var u=C.call(s,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class o extends e.Component{static getDerivedStateFromProps(d,C){let{position:u}=d,{prevPropsPosition:g}=C;return u&&(!g||u.x!==g.x||u.y!==g.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:u,prevPropsPosition:g}),{x:u.x,y:u.y,prevPropsPosition:{...u}}):null}constructor(d){super(d),R(this,"onDragStart",(C,u)=>{if((0,b.default)("Draggable: onDragStart: %j",u),this.props.onStart(C,(0,l.createDraggableData)(this,u))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),R(this,"onDrag",(C,u)=>{if(!this.state.dragging)return!1;(0,b.default)("Draggable: onDrag: %j",u);const g=(0,l.createDraggableData)(this,u),p={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:M,y:L}=p;p.x+=this.state.slackX,p.y+=this.state.slackY;const[V,U]=(0,l.getBoundPosition)(this,p.x,p.y);p.x=V,p.y=U,p.slackX=this.state.slackX+(M-p.x),p.slackY=this.state.slackY+(L-p.y),g.x=p.x,g.y=p.y,g.deltaX=p.x-this.state.x,g.deltaY=p.y-this.state.y}if(this.props.onDrag(C,g)===!1)return!1;this.setState(p)}),R(this,"onDragStop",(C,u)=>{if(!this.state.dragging||this.props.onStop(C,(0,l.createDraggableData)(this,u))===!1)return!1;(0,b.default)("Draggable: onDragStop: %j",u);const p={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:M,y:L}=this.props.position;p.x=M,p.y=L}this.setState(p)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var d,C;return(d=(C=this.props)===null||C===void 0||(C=C.nodeRef)===null||C===void 0?void 0:C.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:C,children:u,defaultPosition:g,defaultClassName:p,defaultClassNameDragging:y,defaultClassNameDragged:M,position:L,positionOffset:V,scale:U,...E}=this.props;let D={},W=null;const Y=!!!L||this.state.dragging,ne=L||g,ee={x:(0,l.canDragX)(this)&&Y?this.state.x:ne.x,y:(0,l.canDragY)(this)&&Y?this.state.y:ne.y};this.state.isElementSVG?W=(0,a.createSVGTransform)(ee,V):D=(0,a.createCSSTransform)(ee,V);const F=(0,i.default)(u.props.className||"",p,{[y]:this.state.dragging,[M]:this.state.dragged});return e.createElement(f.default,I({},E,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(u),{className:F,style:{...u.props.style,...D},transform:W}))}}t.default=o,R(o,"displayName","Draggable"),R(o,"propTypes",{...f.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:S.dontSetMe,style:S.dontSetMe,transform:S.dontSetMe}),R(o,"defaultProps",{...f.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(fn)),fn}var Zn;function hn(){if(Zn)return tt.exports;Zn=1;const{default:t,DraggableCore:e}=ii();return tt.exports=t,tt.exports.default=t,tt.exports.DraggableCore=e,tt.exports}var rt={exports:{}},it={},xt={},Jn;function ai(){if(Jn)return xt;Jn=1,xt.__esModule=!0,xt.cloneElement=S;var t=e(j);function e(f){return f&&f.__esModule?f:{default:f}}function r(f,b){var m=Object.keys(f);if(Object.getOwnPropertySymbols){var T=Object.getOwnPropertySymbols(f);b&&(T=T.filter(function(_){return Object.getOwnPropertyDescriptor(f,_).enumerable})),m.push.apply(m,T)}return m}function n(f){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?r(Object(m),!0).forEach(function(T){i(f,T,m[T])}):Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(T){Object.defineProperty(f,T,Object.getOwnPropertyDescriptor(m,T))})}return f}function i(f,b,m){return b=a(b),b in f?Object.defineProperty(f,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):f[b]=m,f}function a(f){var b=l(f,"string");return typeof b=="symbol"?b:String(b)}function l(f,b){if(typeof f!="object"||f===null)return f;var m=f[Symbol.toPrimitive];if(m!==void 0){var T=m.call(f,b||"default");if(typeof T!="object")return T;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(f)}function S(f,b){return b.style&&f.props.style&&(b.style=n(n({},f.props.style),b.style)),b.className&&f.props.className&&(b.className=f.props.className+" "+b.className),t.default.cloneElement(f,b)}return xt}var at={},Qn;function er(){if(Qn)return at;Qn=1,at.__esModule=!0,at.resizableProps=void 0;var t=e(xe());hn();function e(n){return n&&n.__esModule?n:{default:n}}var r={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:t.default.node,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var S=a[0];if(S.axis==="both"||S.axis==="y"){var f;return(f=t.default.number).isRequired.apply(f,a)}return t.default.number.apply(t.default,a)},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 i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];var S=a[0];if(S.axis==="both"||S.axis==="x"){var f;return(f=t.default.number).isRequired.apply(f,a)}return t.default.number.apply(t.default,a)}};return at.resizableProps=r,at}var tr;function nr(){if(tr)return it;tr=1,it.__esModule=!0,it.default=void 0;var t=l(j),e=hn(),r=ai(),n=er(),i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function a(o){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(a=function(u){return u?d:s})(o)}function l(o,s){if(o&&o.__esModule)return o;if(o===null||typeof o!="object"&&typeof o!="function")return{default:o};var d=a(s);if(d&&d.has(o))return d.get(o);var C={},u=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in o)if(g!=="default"&&Object.prototype.hasOwnProperty.call(o,g)){var p=u?Object.getOwnPropertyDescriptor(o,g):null;p&&(p.get||p.set)?Object.defineProperty(C,g,p):C[g]=o[g]}return C.default=o,d&&d.set(o,C),C}function S(){return S=Object.assign?Object.assign.bind():function(o){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var C in d)Object.prototype.hasOwnProperty.call(d,C)&&(o[C]=d[C])}return o},S.apply(this,arguments)}function f(o,s){if(o==null)return{};var d={},C=Object.keys(o),u,g;for(g=0;g<C.length;g++)u=C[g],!(s.indexOf(u)>=0)&&(d[u]=o[u]);return d}function b(o,s){var d=Object.keys(o);if(Object.getOwnPropertySymbols){var C=Object.getOwnPropertySymbols(o);s&&(C=C.filter(function(u){return Object.getOwnPropertyDescriptor(o,u).enumerable})),d.push.apply(d,C)}return d}function m(o){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(C){T(o,C,d[C])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(C){Object.defineProperty(o,C,Object.getOwnPropertyDescriptor(d,C))})}return o}function T(o,s,d){return s=_(s),s in o?Object.defineProperty(o,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):o[s]=d,o}function _(o){var s=I(o,"string");return typeof s=="symbol"?s:String(s)}function I(o,s){if(typeof o!="object"||o===null)return o;var d=o[Symbol.toPrimitive];if(d!==void 0){var C=d.call(o,s||"default");if(typeof C!="object")return C;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(o)}function R(o,s){o.prototype=Object.create(s.prototype),o.prototype.constructor=o,w(o,s)}function w(o,s){return w=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,u){return C.__proto__=u,C},w(o,s)}var h=function(o){R(s,o);function s(){for(var C,u=arguments.length,g=new Array(u),p=0;p<u;p++)g[p]=arguments[p];return C=o.call.apply(o,[this].concat(g))||this,C.handleRefs={},C.lastHandleRect=null,C.slack=null,C}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(u,g){var p=this.props,y=p.minConstraints,M=p.maxConstraints,L=p.lockAspectRatio;if(!y&&!M&&!L)return[u,g];if(L){var V=this.props.width/this.props.height,U=u-this.props.width,E=g-this.props.height;Math.abs(U)>Math.abs(E*V)?g=u/V:u=g*V}var D=u,W=g,X=this.slack||[0,0],Y=X[0],ne=X[1];return u+=Y,g+=ne,y&&(u=Math.max(y[0],u),g=Math.max(y[1],g)),M&&(u=Math.min(M[0],u),g=Math.min(M[1],g)),this.slack=[Y+(D-u),ne+(W-g)],[u,g]},d.resizeHandler=function(u,g){var p=this;return function(y,M){var L=M.node,V=M.deltaX,U=M.deltaY;u==="onResizeStart"&&p.resetData();var E=(p.props.axis==="both"||p.props.axis==="x")&&g!=="n"&&g!=="s",D=(p.props.axis==="both"||p.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!E&&!D)){var W=g[0],X=g[g.length-1],Y=L.getBoundingClientRect();if(p.lastHandleRect!=null){if(X==="w"){var ne=Y.left-p.lastHandleRect.left;V+=ne}if(W==="n"){var ee=Y.top-p.lastHandleRect.top;U+=ee}}p.lastHandleRect=Y,X==="w"&&(V=-V),W==="n"&&(U=-U);var F=p.props.width+(E?V/p.props.transformScale:0),H=p.props.height+(D?U/p.props.transformScale:0),re=p.runConstraints(F,H);F=re[0],H=re[1];var oe=F!==p.props.width||H!==p.props.height,ue=typeof p.props[u]=="function"?p.props[u]:null,he=u==="onResize"&&!oe;ue&&!he&&(y.persist==null||y.persist(),ue(y,{node:L,size:{width:F,height:H},handle:g})),u==="onResizeStop"&&p.resetData()}}},d.renderResizeHandle=function(u,g){var p=this.props.handle;if(!p)return t.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+u,ref:g});if(typeof p=="function")return p(u,g);var y=typeof p.type=="string",M=m({ref:g},y?{}:{handleAxis:u});return t.cloneElement(p,M)},d.render=function(){var u=this,g=this.props,p=g.children,y=g.className,M=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 L=g.resizeHandles;g.transformScale;var V=f(g,i);return(0,r.cloneElement)(p,m(m({},V),{},{className:(y?y+" ":"")+"react-resizable",children:[].concat(p.props.children,L.map(function(U){var E,D=(E=u.handleRefs[U])!=null?E:u.handleRefs[U]=t.createRef();return t.createElement(e.DraggableCore,S({},M,{nodeRef:D,key:"resizableHandle-"+U,onStop:u.resizeHandler("onResizeStop",U),onStart:u.resizeHandler("onResizeStart",U),onDrag:u.resizeHandler("onResize",U)}),u.renderResizeHandle(U,D))}))}))},s}(t.Component);return it.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},it}var ot={},rr;function oi(){if(rr)return ot;rr=1,ot.__esModule=!0,ot.default=void 0;var t=S(j),e=a(xe()),r=a(nr()),n=er(),i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function a(s){return s&&s.__esModule?s:{default:s}}function l(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,C=new WeakMap;return(l=function(g){return g?C:d})(s)}function S(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var C=l(d);if(C&&C.has(s))return C.get(s);var u={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var p in s)if(p!=="default"&&Object.prototype.hasOwnProperty.call(s,p)){var y=g?Object.getOwnPropertyDescriptor(s,p):null;y&&(y.get||y.set)?Object.defineProperty(u,p,y):u[p]=s[p]}return u.default=s,C&&C.set(s,u),u}function f(){return f=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var C=arguments[d];for(var u in C)Object.prototype.hasOwnProperty.call(C,u)&&(s[u]=C[u])}return s},f.apply(this,arguments)}function b(s,d){var C=Object.keys(s);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(s);d&&(u=u.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),C.push.apply(C,u)}return C}function m(s){for(var d=1;d<arguments.length;d++){var C=arguments[d]!=null?arguments[d]:{};d%2?b(Object(C),!0).forEach(function(u){T(s,u,C[u])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(C)):b(Object(C)).forEach(function(u){Object.defineProperty(s,u,Object.getOwnPropertyDescriptor(C,u))})}return s}function T(s,d,C){return d=_(d),d in s?Object.defineProperty(s,d,{value:C,enumerable:!0,configurable:!0,writable:!0}):s[d]=C,s}function _(s){var d=I(s,"string");return typeof d=="symbol"?d:String(d)}function I(s,d){if(typeof s!="object"||s===null)return s;var C=s[Symbol.toPrimitive];if(C!==void 0){var u=C.call(s,d||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function R(s,d){if(s==null)return{};var C={},u=Object.keys(s),g,p;for(p=0;p<u.length;p++)g=u[p],!(d.indexOf(g)>=0)&&(C[g]=s[g]);return C}function w(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,g){return u.__proto__=g,u},h(s,d)}var o=function(s){w(d,s);function d(){for(var u,g=arguments.length,p=new Array(g),y=0;y<g;y++)p[y]=arguments[y];return u=s.call.apply(s,[this].concat(p))||this,u.state={width:u.props.width,height:u.props.height,propsWidth:u.props.width,propsHeight:u.props.height},u.onResize=function(M,L){var V=L.size;u.props.onResize?(M.persist==null||M.persist(),u.setState(V,function(){return u.props.onResize&&u.props.onResize(M,L)})):u.setState(V)},u}d.getDerivedStateFromProps=function(g,p){return p.propsWidth!==g.width||p.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var C=d.prototype;return C.render=function(){var g=this.props,p=g.handle,y=g.handleSize;g.onResize;var M=g.onResizeStart,L=g.onResizeStop,V=g.draggableOpts,U=g.minConstraints,E=g.maxConstraints,D=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,ne=g.transformScale,ee=R(g,i);return t.createElement(r.default,{axis:W,draggableOpts:V,handle:p,handleSize:y,height:this.state.height,lockAspectRatio:D,maxConstraints:E,minConstraints:U,onResizeStart:M,onResize:this.onResize,onResizeStop:L,resizeHandles:X,transformScale:ne,width:this.state.width},t.createElement("div",f({},ee,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(t.Component);return ot.default=o,o.propTypes=m(m({},n.resizableProps),{},{children:e.default.element}),ot}var ir;function si(){return ir||(ir=1,rt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},rt.exports.Resizable=nr().default,rt.exports.ResizableBox=oi().default),rt.exports}var we={},ar;function or(){if(ar)return we;ar=1,Object.defineProperty(we,"__esModule",{value:!0}),we.resizeHandleType=we.resizeHandleAxesType=we.default=void 0;var t=r(xe()),e=r(j);function r(a){return a&&a.__esModule?a:{default:a}}const n=we.resizeHandleAxesType=t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),i=we.resizeHandleType=t.default.oneOfType([t.default.node,t.default.func]);return we.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(a){a.verticalCompact},compactType:t.default.oneOf(["vertical","horizontal"]),layout:function(a){var l=a.layout;l!==void 0&&Ve().validateLayout(l,"layout")},margin:t.default.arrayOf(t.default.number),containerPadding:t.default.arrayOf(t.default.number),rowHeight:t.default.number,maxRows:t.default.number,isBounded:t.default.bool,isDraggable:t.default.bool,isResizable:t.default.bool,allowOverlap:t.default.bool,preventCollision:t.default.bool,useCSSTransforms:t.default.bool,transformScale:t.default.number,isDroppable:t.default.bool,resizeHandles:n,resizeHandle:i,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(a,l){const S=a[l],f={};e.default.Children.forEach(S,function(b){if((b==null?void 0:b.key)!=null){if(f[b.key])throw new Error('Duplicate child key "'+b.key+'" found! This will cause problems in ReactGridLayout.');f[b.key]=!0}})},innerRef:t.default.any},we}var sr;function li(){if(sr)return et;sr=1,Object.defineProperty(et,"__esModule",{value:!0}),et.default=void 0;var t=f(j),e=f(xe()),r=hn(),n=si(),i=Ve(),a=ln(),l=or(),S=f(on());function f(I){return I&&I.__esModule?I:{default:I}}function b(I,R,w){return R=m(R),R in I?Object.defineProperty(I,R,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[R]=w,I}function m(I){var R=T(I,"string");return typeof R=="symbol"?R:String(R)}function T(I,R){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,R||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(I)}let _=class extends t.default.Component{constructor(){super(...arguments),b(this,"state",{resizing:null,dragging:null,className:""}),b(this,"elementRef",t.default.createRef()),b(this,"onDragStart",(R,w)=>{let{node:h}=w;const{onDragStart:o,transformScale:s}=this.props;if(!o)return;const d={top:0,left:0},{offsetParent:C}=h;if(!C)return;const u=C.getBoundingClientRect(),g=h.getBoundingClientRect(),p=g.left/s,y=u.left/s,M=g.top/s,L=u.top/s;d.left=p-y+C.scrollLeft,d.top=M-L+C.scrollTop,this.setState({dragging:d});const{x:V,y:U}=(0,a.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return o.call(this,this.props.i,V,U,{e:R,node:h,newPosition:d})}),b(this,"onDrag",(R,w)=>{let{node:h,deltaX:o,deltaY:s}=w;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let C=this.state.dragging.top+s,u=this.state.dragging.left+o;const{isBounded:g,i:p,w:y,h:M,containerWidth:L}=this.props,V=this.getPositionParams();if(g){const{offsetParent:X}=h;if(X){const{margin:Y,rowHeight:ne,containerPadding:ee}=this.props,F=X.clientHeight-(0,a.calcGridItemWHPx)(M,ne,Y[1]);C=(0,a.clamp)(C-ee[1],0,F);const H=(0,a.calcGridColWidth)(V),re=L-(0,a.calcGridItemWHPx)(y,H,Y[0]);u=(0,a.clamp)(u-ee[0],0,re)}}const U={top:C,left:u};this.setState({dragging:U});const{containerPadding:E}=this.props,{x:D,y:W}=(0,a.calcXY)(V,C-E[1],u-E[0],y,M);return d.call(this,p,D,W,{e:R,node:h,newPosition:U})}),b(this,"onDragStop",(R,w)=>{let{node:h}=w;const{onDragStop:o}=this.props;if(!o)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:C,containerPadding:u}=this.props,{left:g,top:p}=this.state.dragging,y={top:p,left:g};this.setState({dragging:null});const{x:M,y:L}=(0,a.calcXY)(this.getPositionParams(),p-u[1],g-u[0],s,d);return o.call(this,C,M,L,{e:R,node:h,newPosition:y})}),b(this,"onResizeStop",(R,w,h)=>this.onResizeHandler(R,w,h,"onResizeStop")),b(this,"onResizeStart",(R,w,h)=>this.onResizeHandler(R,w,h,"onResizeStart")),b(this,"onResize",(R,w,h)=>this.onResizeHandler(R,w,h,"onResize"))}shouldComponentUpdate(R,w){if(this.props.children!==R.children||this.props.droppingPosition!==R.droppingPosition)return!0;const h=(0,a.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),o=(0,a.calcGridItemPosition)(this.getPositionParams(R),R.x,R.y,R.w,R.h,w);return!(0,i.fastPositionEqual)(h,o)||this.props.useCSSTransforms!==R.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(R){this.moveDroppingItem(R)}moveDroppingItem(R){const{droppingPosition:w}=this.props;if(!w)return;const h=this.elementRef.current;if(!h)return;const o=R.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&w.left!==o.left||w.top!==o.top;if(!s)this.onDragStart(w.e,{node:h,deltaX:w.left,deltaY:w.top});else if(d){const C=w.left-s.left,u=w.top-s.top;this.onDrag(w.e,{node:h,deltaX:C,deltaY:u})}}getPositionParams(){let R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:R.cols,containerPadding:R.containerPadding,containerWidth:R.containerWidth,margin:R.margin,maxRows:R.maxRows,rowHeight:R.rowHeight}}createStyle(R){const{usePercentages:w,containerWidth:h,useCSSTransforms:o}=this.props;let s;return o?s=(0,i.setTransform)(R):(s=(0,i.setTopLeft)(R),w&&(s.left=(0,i.perc)(R.left/h),s.width=(0,i.perc)(R.width/h))),s}mixinDraggable(R,w){return t.default.createElement(r.DraggableCore,{disabled:!w,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},R)}curryResizeHandler(R,w){return(h,o)=>w(h,o,R)}mixinResizable(R,w,h){const{cols:o,minW:s,minH:d,maxW:C,maxH:u,transformScale:g,resizeHandles:p,resizeHandle:y}=this.props,M=this.getPositionParams(),L=(0,a.calcGridItemPosition)(M,0,0,o,0).width,V=(0,a.calcGridItemPosition)(M,0,0,s,d),U=(0,a.calcGridItemPosition)(M,0,0,C,u),E=[V.width,V.height],D=[Math.min(U.width,L),Math.min(U.height,1/0)];return t.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:w.width,height:w.height,minConstraints:E,maxConstraints:D,onResizeStop:this.curryResizeHandler(w,this.onResizeStop),onResizeStart:this.curryResizeHandler(w,this.onResizeStart),onResize:this.curryResizeHandler(w,this.onResize),transformScale:g,resizeHandles:p,handle:y},R)}onResizeHandler(R,w,h,o){let{node:s,size:d,handle:C}=w;const u=this.props[o];if(!u)return;const{x:g,y:p,i:y,maxH:M,minH:L,containerWidth:V}=this.props,{minW:U,maxW:E}=this.props;let D=d;s&&(D=(0,i.resizeItemInDirection)(C,h,d,V),this.setState({resizing:o==="onResizeStop"?null:D}));let{w:W,h:X}=(0,a.calcWH)(this.getPositionParams(),D.width,D.height,g,p,C);W=(0,a.clamp)(W,Math.max(U,1),E),X=(0,a.clamp)(X,L,M),u.call(this,y,W,X,{e:R,node:s,size:D,handle:C})}render(){const{x:R,y:w,w:h,h:o,isDraggable:s,isResizable:d,droppingPosition:C,useCSSTransforms:u}=this.props,g=(0,a.calcGridItemPosition)(this.getPositionParams(),R,w,h,o,this.state),p=t.default.Children.only(this.props.children);let y=t.default.cloneElement(p,{ref:this.elementRef,className:(0,S.default)("react-grid-item",p.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!C,cssTransforms:u}),style:{...this.props.style,...p.props.style,...this.createStyle(g)}});return y=this.mixinResizable(y,g,d),y=this.mixinDraggable(y,s),y}};return et.default=_,b(_,"propTypes",{children:e.default.element,cols:e.default.number.isRequired,containerWidth:e.default.number.isRequired,rowHeight:e.default.number.isRequired,margin:e.default.array.isRequired,maxRows:e.default.number.isRequired,containerPadding:e.default.array.isRequired,x:e.default.number.isRequired,y:e.default.number.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired,minW:function(I,R){const w=I[R];if(typeof w!="number")return new Error("minWidth not Number");if(w>I.w||w>I.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(I,R){const w=I[R];if(typeof w!="number")return new Error("maxWidth not Number");if(w<I.w||w<I.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(I,R){const w=I[R];if(typeof w!="number")return new Error("minHeight not Number");if(w>I.h||w>I.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(I,R){const w=I[R];if(typeof w!="number")return new Error("maxHeight not Number");if(w<I.h||w<I.minH)return new Error("maxHeight smaller than item height/minHeight")},i:e.default.string.isRequired,resizeHandles:l.resizeHandleAxesType,resizeHandle:l.resizeHandleType,onDragStop:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,isDraggable:e.default.bool.isRequired,isResizable:e.default.bool.isRequired,isBounded:e.default.bool.isRequired,static:e.default.bool,useCSSTransforms:e.default.bool.isRequired,transformScale:e.default.number,className:e.default.string,handle:e.default.string,cancel:e.default.string,droppingPosition:e.default.shape({e:e.default.object.isRequired,left:e.default.number.isRequired,top:e.default.number.isRequired})}),b(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),et}var lr;function ur(){if(lr)return Je;lr=1,Object.defineProperty(Je,"__esModule",{value:!0}),Je.default=void 0;var t=b(j),e=an(),r=S(on()),n=Ve(),i=ln(),a=S(li()),l=S(or());function S(h){return h&&h.__esModule?h:{default:h}}function f(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(f=function(d){return d?s:o})(h)}function b(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=f(o);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I="react-grid-layout";let R=!1;try{R=/firefox/i.test(navigator.userAgent)}catch{}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p}=this.state,y=(0,n.getLayoutItem)(p,o);if(!y)return;const M={w:y.w,h:y.h,x:y.x,y:y.y,placeholder:!0,i:o};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(y),oldLayout:p,activeDrag:M}),this.props.onDragStart(p,y,y,null,u,g)}),m(this,"onDrag",(o,s,d,C)=>{let{e:u,node:g}=C;const{oldDragItem:p}=this.state;let{layout:y}=this.state;const{cols:M,allowOverlap:L,preventCollision:V}=this.props,U=(0,n.getLayoutItem)(y,o);if(!U)return;const E={w:U.w,h:U.h,x:U.x,y:U.y,placeholder:!0,i:o};y=(0,n.moveElement)(y,U,s,d,!0,V,(0,n.compactType)(this.props),M,L),this.props.onDrag(y,p,U,E,u,g),this.setState({layout:L?y:(0,n.compact)(y,(0,n.compactType)(this.props),M),activeDrag:E})}),m(this,"onDragStop",(o,s,d,C)=>{let{e:u,node:g}=C;if(!this.state.activeDrag)return;const{oldDragItem:p}=this.state;let{layout:y}=this.state;const{cols:M,preventCollision:L,allowOverlap:V}=this.props,U=(0,n.getLayoutItem)(y,o);if(!U)return;y=(0,n.moveElement)(y,U,s,d,!0,L,(0,n.compactType)(this.props),M,V);const D=V?y:(0,n.compact)(y,(0,n.compactType)(this.props),M);this.props.onDragStop(D,p,U,null,u,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:D,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(D,W)}),m(this,"onResizeStart",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p}=this.state,y=(0,n.getLayoutItem)(p,o);y&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(y),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(p,y,y,null,u,g))}),m(this,"onResize",(o,s,d,C)=>{let{e:u,node:g,size:p,handle:y}=C;const{oldResizeItem:M}=this.state,{layout:L}=this.state,{cols:V,preventCollision:U,allowOverlap:E}=this.props;let D=!1,W,X,Y;const[ne,ee]=(0,n.withLayoutItem)(L,o,H=>{let re;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(y)!==-1&&(["sw","nw","w"].indexOf(y)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(y)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),D=!0),U&&!E&&(re=(0,n.getAllCollisions)(L,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,re&&(Y=H.y,d=H.h,X=H.x,s=H.w,D=!1)),H.w=s,H.h=d,H});if(!ee)return;W=ne,D&&(W=(0,n.moveElement)(ne,ee,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),V,E));const F={w:ee.w,h:ee.h,x:ee.x,y:ee.y,static:!0,i:o};this.props.onResize(W,M,ee,F,u,g),this.setState({layout:E?W:(0,n.compact)(W,(0,n.compactType)(this.props),V),activeDrag:F})}),m(this,"onResizeStop",(o,s,d,C)=>{let{e:u,node:g}=C;const{layout:p,oldResizeItem:y}=this.state,{cols:M,allowOverlap:L}=this.props,V=(0,n.getLayoutItem)(p,o),U=L?p:(0,n.compact)(p,(0,n.compactType)(this.props),M);this.props.onResizeStop(U,y,V,null,u,g);const{oldLayout:E}=this.state;this.setState({activeDrag:null,layout:U,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(U,E)}),m(this,"onDragOver",o=>{var ne;if(o.preventDefault(),o.stopPropagation(),R&&!((ne=o.nativeEvent.target)!=null&&ne.classList.contains(I)))return!1;const{droppingItem:s,onDropDragOver:d,margin:C,cols:u,rowHeight:g,maxRows:p,width:y,containerPadding:M,transformScale:L}=this.props,V=d==null?void 0:d(o);if(V===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const U={...s,...V},{layout:E}=this.state,D=o.currentTarget.getBoundingClientRect(),W=o.clientX-D.left,X=o.clientY-D.top,Y={left:W/L,top:X/L,e:o};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:ee,top:F}=this.state.droppingPosition;(ee!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const ee={cols:u,margin:C,maxRows:p,rowHeight:g,containerWidth:y,containerPadding:M||C},F=(0,i.calcXY)(ee,X,W,U.w,U.h);this.setState({droppingDOMNode:t.createElement("div",{key:U.i}),droppingPosition:Y,layout:[...E,{...U,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:o,cols:s}=this.props,{layout:d}=this.state,C=(0,n.compact)(d.filter(u=>u.i!==o.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:C,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",o=>{o.preventDefault(),o.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",o=>{o.preventDefault(),o.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",o=>{o.preventDefault(),o.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,C=d.find(u=>u.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,C,o)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(o,s){let d;return s.activeDrag?null:(!(0,e.deepEqual)(o.layout,s.propsLayout)||o.compactType!==s.compactType?d=o.layout:(0,n.childrenEqual)(o.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,o.children,o.cols,(0,n.compactType)(o),o.allowOverlap),compactType:o.compactType,children:o.children,propsLayout:o.layout}:null)}shouldComponentUpdate(o,s){return this.props.children!==o.children||!(0,n.fastRGLPropsEqual)(this.props,o,e.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(o,s){if(!this.state.activeDrag){const d=this.state.layout,C=s.layout;this.onLayoutMaybeChanged(d,C)}}containerHeight(){if(!this.props.autoSize)return;const o=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return o*this.props.rowHeight+(o-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(o,s){s||(s=this.state.layout),(0,e.deepEqual)(s,o)||this.props.onLayoutChange(o)}placeholder(){const{activeDrag:o}=this.state;if(!o)return null;const{width:s,cols:d,margin:C,containerPadding:u,rowHeight:g,maxRows:p,useCSSTransforms:y,transformScale:M}=this.props;return t.createElement(a.default,{w:o.w,h:o.h,x:o.x,y:o.y,i:o.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:C,containerPadding:u||C,maxRows:p,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:y,transformScale:M},t.createElement("div",null))}processGridItem(o,s){if(!o||!o.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(o.key));if(!d)return null;const{width:C,cols:u,margin:g,containerPadding:p,rowHeight:y,maxRows:M,isDraggable:L,isResizable:V,isBounded:U,useCSSTransforms:E,transformScale:D,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:ne}=this.props,{mounted:ee,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&L,re=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&V,oe=d.resizeHandles||Y,ue=H&&U&&d.isBounded!==!1;return t.createElement(a.default,{containerWidth:C,cols:u,margin:g,containerPadding:p||g,maxRows:M,rowHeight:y,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:re,isBounded:ue,useCSSTransforms:E&&ee,usePercentages:!ee,transformScale:D,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:oe,resizeHandle:ne},o)}render(){const{className:o,style:s,isDroppable:d,innerRef:C}=this.props,u=(0,r.default)(I,o),g={height:this.containerHeight(),...s};return t.createElement("div",{ref:C,className:u,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},t.Children.map(this.props.children,p=>this.processGridItem(p)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Je.default=w,m(w,"displayName","ReactGridLayout"),m(w,"propTypes",l.default),m(w,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Je}var st={},Me={},cr;function dr(){if(cr)return Me;cr=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.findOrGenerateResponsiveLayout=n,Me.getBreakpointFromWidth=e,Me.getColsFromBreakpoint=r,Me.sortBreakpoints=i;var t=Ve();function e(a,l){const S=i(a);let f=S[0];for(let b=1,m=S.length;b<m;b++){const T=S[b];l>a[T]&&(f=T)}return f}function r(a,l){if(!l[a])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+a+" is missing!");return l[a]}function n(a,l,S,f,b,m){if(a[S])return(0,t.cloneLayout)(a[S]);let T=a[f];const _=i(l),I=_.slice(_.indexOf(S));for(let R=0,w=I.length;R<w;R++){const h=I[R];if(a[h]){T=a[h];break}}return T=(0,t.cloneLayout)(T||[]),(0,t.compact)((0,t.correctBounds)(T,{cols:b}),m,b)}function i(a){return Object.keys(a).sort(function(S,f){return a[S]-a[f]})}return Me}var fr;function ui(){if(fr)return st;fr=1,Object.defineProperty(st,"__esModule",{value:!0}),st.default=void 0;var t=f(j),e=l(xe()),r=an(),n=Ve(),i=dr(),a=l(ur());function l(h){return h&&h.__esModule?h:{default:h}}function S(h){if(typeof WeakMap!="function")return null;var o=new WeakMap,s=new WeakMap;return(S=function(d){return d?s:o})(h)}function f(h,o){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=S(o);if(s&&s.has(h))return s.get(h);var d={__proto__:null},C=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in h)if(u!=="default"&&Object.prototype.hasOwnProperty.call(h,u)){var g=C?Object.getOwnPropertyDescriptor(h,u):null;g&&(g.get||g.set)?Object.defineProperty(d,u,g):d[u]=h[u]}return d.default=h,s&&s.set(h,d),d}function b(){return b=Object.assign?Object.assign.bind():function(h){for(var o=1;o<arguments.length;o++){var s=arguments[o];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function m(h,o,s){return o=T(o),o in h?Object.defineProperty(h,o,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[o]=s,h}function T(h){var o=_(h,"string");return typeof o=="symbol"?o:String(o)}function _(h,o){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,o||"default");if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(h)}const I=h=>Object.prototype.toString.call(h);function R(h,o){return h==null?null:Array.isArray(h)?h:h[o]}let w=class extends t.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",o=>{this.props.onLayoutChange(o,{...this.props.layouts,[this.state.breakpoint]:o})})}generateInitialState(){const{width:o,breakpoints:s,layouts:d,cols:C}=this.props,u=(0,i.getBreakpointFromWidth)(s,o),g=(0,i.getColsFromBreakpoint)(u,C),p=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,i.findOrGenerateResponsiveLayout)(d,s,u,u,g,p),breakpoint:u,cols:g}}static getDerivedStateFromProps(o,s){if(!(0,r.deepEqual)(o.layouts,s.layouts)){const{breakpoint:d,cols:C}=s;return{layout:(0,i.findOrGenerateResponsiveLayout)(o.layouts,o.breakpoints,d,d,C,o.compactType),layouts:o.layouts}}return null}componentDidUpdate(o){(this.props.width!=o.width||this.props.breakpoint!==o.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,o.breakpoints)||!(0,r.deepEqual)(this.props.cols,o.cols))&&this.onWidthChange(o)}onWidthChange(o){const{breakpoints:s,cols:d,layouts:C,compactType:u}=this.props,g=this.props.breakpoint||(0,i.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),p=this.state.breakpoint,y=(0,i.getColsFromBreakpoint)(g,d),M={...C};if(p!==g||o.breakpoints!==s||o.cols!==d){p in M||(M[p]=(0,n.cloneLayout)(this.state.layout));let U=(0,i.findOrGenerateResponsiveLayout)(M,s,g,p,y,u);U=(0,n.synchronizeLayoutWithChildren)(U,this.props.children,y,u,this.props.allowOverlap),M[g]=U,this.props.onLayoutChange(U,M),this.props.onBreakpointChange(g,y),this.setState({breakpoint:g,layout:U,cols:y})}const L=R(this.props.margin,g),V=R(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,L,y,V)}render(){const{breakpoint:o,breakpoints:s,cols:d,layouts:C,margin:u,containerPadding:g,onBreakpointChange:p,onLayoutChange:y,onWidthChange:M,...L}=this.props;return t.createElement(a.default,b({},L,{margin:R(u,this.state.breakpoint),containerPadding:R(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return st.default=w,m(w,"propTypes",{breakpoint:e.default.string,breakpoints:e.default.object,allowOverlap:e.default.bool,cols:e.default.object,margin:e.default.oneOfType([e.default.array,e.default.object]),containerPadding:e.default.oneOfType([e.default.array,e.default.object]),layouts(h,o){if(I(h[o])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+I(h[o]));Object.keys(h[o]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:e.default.number.isRequired,onBreakpointChange:e.default.func,onLayoutChange:e.default.func,onWidthChange:e.default.func}),m(w,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),st}var Et={},pr=function(){if(typeof Map<"u")return Map;function t(e,r){var n=-1;return e.some(function(i,a){return i[0]===r?(n=a,!0):!1}),n}return function(){function e(){this.__entries__=[]}return Object.defineProperty(e.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),e.prototype.get=function(r){var n=t(this.__entries__,r),i=this.__entries__[n];return i&&i[1]},e.prototype.set=function(r,n){var i=t(this.__entries__,r);~i?this.__entries__[i][1]=n:this.__entries__.push([r,n])},e.prototype.delete=function(r){var n=this.__entries__,i=t(n,r);~i&&n.splice(i,1)},e.prototype.has=function(r){return!!~t(this.__entries__,r)},e.prototype.clear=function(){this.__entries__.splice(0)},e.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var i=0,a=this.__entries__;i<a.length;i++){var l=a[i];r.call(n,l[1],l[0])}},e}()}(),mn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),ci=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(t){return setTimeout(function(){return t(Date.now())},1e3/60)}}(),di=2;function fi(t,e){var r=!1,n=!1,i=0;function a(){r&&(r=!1,t()),n&&S()}function l(){ci(a)}function S(){var f=Date.now();if(r){if(f-i<di)return;n=!0}else r=!0,n=!1,setTimeout(l,e);i=f}return S}var pi=20,hi=["top","right","bottom","left","width","height","size","weight"],mi=typeof MutationObserver<"u",gi=function(){function t(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=fi(this.refresh.bind(this),pi)}return t.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},t.prototype.removeObserver=function(e){var r=this.observers_,n=r.indexOf(e);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},t.prototype.refresh=function(){var e=this.updateObservers_();e&&this.refresh()},t.prototype.updateObservers_=function(){var e=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return e.forEach(function(r){return r.broadcastActive()}),e.length>0},t.prototype.connect_=function(){!mn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mi?(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(){!mn||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(e){var r=e.propertyName,n=r===void 0?"":r,i=hi.some(function(a){return!!~n.indexOf(a)});i&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),hr=function(t,e){for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];Object.defineProperty(t,i,{value:e[i],enumerable:!1,writable:!1,configurable:!0})}return t},ze=function(t){var e=t&&t.ownerDocument&&t.ownerDocument.defaultView;return e||Ot},mr=Mt(0,0,0,0);function Pt(t){return parseFloat(t)||0}function gr(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return e.reduce(function(n,i){var a=t["border-"+i+"-width"];return n+Pt(a)},0)}function vi(t){for(var e=["top","right","bottom","left"],r={},n=0,i=e;n<i.length;n++){var a=i[n],l=t["padding-"+a];r[a]=Pt(l)}return r}function yi(t){var e=t.getBBox();return Mt(0,0,e.width,e.height)}function Si(t){var e=t.clientWidth,r=t.clientHeight;if(!e&&!r)return mr;var n=ze(t).getComputedStyle(t),i=vi(n),a=i.left+i.right,l=i.top+i.bottom,S=Pt(n.width),f=Pt(n.height);if(n.boxSizing==="border-box"&&(Math.round(S+a)!==e&&(S-=gr(n,"left","right")+a),Math.round(f+l)!==r&&(f-=gr(n,"top","bottom")+l)),!Ri(t)){var b=Math.round(S+a)-e,m=Math.round(f+l)-r;Math.abs(b)!==1&&(S-=b),Math.abs(m)!==1&&(f-=m)}return Mt(i.left,i.top,S,f)}var bi=function(){return typeof SVGGraphicsElement<"u"?function(t){return t instanceof ze(t).SVGGraphicsElement}:function(t){return t instanceof ze(t).SVGElement&&typeof t.getBBox=="function"}}();function Ri(t){return t===ze(t).document.documentElement}function Ci(t){return mn?bi(t)?yi(t):Si(t):mr}function Ti(t){var e=t.x,r=t.y,n=t.width,i=t.height,a=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,l=Object.create(a.prototype);return hr(l,{x:e,y:r,width:n,height:i,top:r,right:e+n,bottom:i+r,left:e}),l}function Mt(t,e,r,n){return{x:t,y:e,width:r,height:n}}var Ii=function(){function t(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Mt(0,0,0,0),this.target=e}return t.prototype.isActive=function(){var e=Ci(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}(),wi=function(){function t(e,r){var n=Ti(r);hr(this,{target:e,contentRect:n})}return t}(),_i=function(){function t(e,r,n){if(this.activeObservations_=[],this.observations_=new pr,typeof e!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=r,this.callbackCtx_=n}return t.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(e instanceof ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)||(r.set(e,new Ii(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 ze(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(e)&&(r.delete(e),r.size||this.controller_.removeObserver(this))}},t.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},t.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&e.activeObservations_.push(r)})},t.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new wi(n.target,n.broadcastRect())});this.callback_.call(e,r,e),this.clearActive()}},t.prototype.clearActive=function(){this.activeObservations_.splice(0)},t.prototype.hasActive=function(){return this.activeObservations_.length>0},t}(),vr=typeof WeakMap<"u"?new WeakMap:new pr,yr=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=gi.getInstance(),n=new _i(e,r,this);vr.set(this,n)}return t}();["observe","unobserve","disconnect"].forEach(function(t){yr.prototype[t]=function(){var e;return(e=vr.get(this))[t].apply(e,arguments)}});var xi=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:yr}();const Ei=_n(Object.freeze(Object.defineProperty({__proto__:null,default:xi},Symbol.toStringTag,{value:"Module"})));var Sr;function Oi(){if(Sr)return Et;Sr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=_;var t=l(j),e=i(xe()),r=i(Ei),n=i(on());function i(I){return I&&I.__esModule?I:{default:I}}function a(I){if(typeof WeakMap!="function")return null;var R=new WeakMap,w=new WeakMap;return(a=function(h){return h?w:R})(I)}function l(I,R){if(I&&I.__esModule)return I;if(I===null||typeof I!="object"&&typeof I!="function")return{default:I};var w=a(R);if(w&&w.has(I))return w.get(I);var h={__proto__:null},o=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in I)if(s!=="default"&&Object.prototype.hasOwnProperty.call(I,s)){var d=o?Object.getOwnPropertyDescriptor(I,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=I[s]}return h.default=I,w&&w.set(I,h),h}function S(){return S=Object.assign?Object.assign.bind():function(I){for(var R=1;R<arguments.length;R++){var w=arguments[R];for(var h in w)Object.prototype.hasOwnProperty.call(w,h)&&(I[h]=w[h])}return I},S.apply(this,arguments)}function f(I,R,w){return R=b(R),R in I?Object.defineProperty(I,R,{value:w,enumerable:!0,configurable:!0,writable:!0}):I[R]=w,I}function b(I){var R=m(I,"string");return typeof R=="symbol"?R:String(R)}function m(I,R){if(typeof I!="object"||I===null)return I;var w=I[Symbol.toPrimitive];if(w!==void 0){var h=w.call(I,R||"default");if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(I)}const T="react-grid-layout";function _(I){var R;return R=class extends t.Component{constructor(){super(...arguments),f(this,"state",{width:1280}),f(this,"elementRef",t.createRef()),f(this,"mounted",!1),f(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(o=>{if(this.elementRef.current instanceof HTMLElement){const d=o[0].contentRect.width;this.setState({width:d})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...o}=this.props;return h&&!this.mounted?t.createElement("div",{className:(0,n.default)(this.props.className,T),style:this.props.style,ref:this.elementRef}):t.createElement(I,S({innerRef:this.elementRef},o,this.state))}},f(R,"defaultProps",{measureBeforeMount:!1}),f(R,"propTypes",{measureBeforeMount:e.default.bool}),R}return Et}var br;function Pi(){return br||(br=1,function(t){t.exports=ur().default,t.exports.utils=Ve(),t.exports.calculateUtils=ln(),t.exports.Responsive=ui().default,t.exports.Responsive.utils=dr(),t.exports.WidthProvider=Oi().default}(rn)),rn.exports}var Mi=Pi();const Di=Ar(Mi);var Ni=Object.defineProperty,ji=Object.getOwnPropertyDescriptor,Li=(t,e,r,n)=>{for(var i=n>1?void 0:n?ji(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ni(e,r,i),i},Ui=(t,e)=>(r,n)=>e(r,n,t);let Ae=class extends v.Disposable{constructor(e){super();Pe(this,"_initLocal",()=>{});Pe(this,"_findReplaceIndex",e=>{const r=/\{([^}]+)?\}/g,n=[];let i=r.exec(e);for(;i;)n.push({startIndex:i.index,key:Number(i[1]),endIndex:i.index+i[0].length-1}),i=r.exec(e);return n});this._localeService=e,this._initLocal()}tWithReactNode(e,...r){const n=this._localeService.getLocales(),i=e.split("."),a=n&&this._localeService.resolveKeyPath(n,i);if(typeof a=="string"){const l=[];return this._findReplaceIndex(a).forEach((S,f,b)=>{const m=b[f-1]||{startIndex:0,endIndex:-1};if(m.endIndex+1<S.startIndex){const T=a.slice(m.endIndex+1,S.startIndex);T&&l.push(T)}if(r[S.key]&&l.push(r[S.key]),f===b.length-1){const T=a.slice(S.endIndex+1);T&&l.push(T)}}),l}return[]}};Ae=Li([Ui(0,v.Inject(v.LocaleService))],Ae);const Dt={cfPreview:"univer-cf-preview"},We=t=>{var i,a;const e=t.rule;if(!e)return null;const r=j.useMemo(()=>{if(e.type===c.CFRuleType.colorScale){const l=e.config.map((b,m)=>({color:new v.ColorKit(b.color),value:m})),S=l.length-1;return new Array(5).fill("").map((b,m,T)=>m*S/(T.length-1)).map(b=>c.getColorScaleFromValue(l,b))}return null},[e]),n=j.useMemo(()=>{if(e.type===c.CFRuleType.iconSet)return e.config.map(l=>{const S=c.iconMap[l.iconType];return S&&S[Number(l.iconId)]})},[e]);switch(e.type){case c.CFRuleType.dataBar:{const{isGradient:l}=e.config,S={width:"50%",height:"100%"},f=l?`linear-gradient(to right, ${e.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:e.config.positiveColor,b=l?`linear-gradient(to right, rgb(255 255 255),${e.config.nativeColor||c.defaultDataBarNativeColor})`:e.config.nativeColor;return x.jsxs("div",{className:Dt.cfPreview,children:[x.jsx("div",{style:{...S,background:b,border:`1px solid ${e.config.nativeColor||c.defaultDataBarNativeColor}`}}),x.jsx("div",{style:{...S,background:f,border:`1px solid ${e.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&x.jsx("div",{className:Dt.cfPreview,children:r.map((l,S)=>x.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:l}},S))});case c.CFRuleType.iconSet:return n&&x.jsx("div",{className:Dt.cfPreview,children:n.map((l,S)=>l?x.jsx("img",{style:{height:"100%"},src:l},S):x.jsx(Ze,{},S))});case c.CFRuleType.highlightCell:{const{ul:l,st:S,it:f,bl:b,bg:m,cl:T}=e.style,_=(l==null?void 0:l.s)===v.BooleanNumber.TRUE,I=(S==null?void 0:S.s)===v.BooleanNumber.TRUE,R=f===v.BooleanNumber.TRUE,w=b===v.BooleanNumber.TRUE,h=(i=m==null?void 0:m.rgb)!=null?i:c.DEFAULT_BG_COLOR,o=(a=T==null?void 0:T.rgb)!=null?a:c.DEFAULT_FONT_COLOR,s={fontWeight:w?"bold":void 0,fontStyle:R?"italic":void 0,textDecoration:`${_?"underline":""} ${I?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:o};return x.jsx("div",{style:s,className:Dt.cfPreview,children:"123"})}}return null},pe={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",selectSelector:"univer-select-selector",selectSelectionItem:"univer-select-selection-item",selectSelectionSearchInput:"univer-select-selection-search-input",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",reactGridItem:"univer-react-grid-item"},Vi=(t,e)=>{const r=t.rule;switch(r.type){case c.CFRuleType.colorScale:return e.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return e.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return e.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,e.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return e.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return e.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(i=>String(i)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return e.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?e.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):e.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?e.t("sheet.cf.preview.describe.bottomN",String(r.value)):e.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return e.t("sheet.cf.ruleType.formula")}}};let Rr=0;const zi=t=>{const{onClick:e}=t,r=v.useDependency(c.ConditionalFormattingRuleModel),n=v.useDependency(v.IUniverInstanceService),i=v.useDependency(q.SheetsSelectionsService),a=v.useDependency(v.ICommandService),l=v.useDependency(v.LocaleService),S=v.useDependency(v.Injector),f=v.useDependency(Ae),b=ge.useObservable(()=>n.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=b.getUnitId(),T=b.getActiveSheet();if(!T)throw new Error("No active sheet found");const _=T.getSheetId(),[I,R]=j.useState([]),[w,h]=j.useState("2"),[o,s]=j.useState(0),[d,C]=j.useState(-1),[u,g]=j.useState(Rr),p=j.useRef(null),y=[{label:l.t("sheet.cf.panel.workSheet"),value:"2"},{label:l.t("sheet.cf.panel.selectedRange"),value:"1"}],M=()=>{const F=r.getSubunitRules(m,_);if(!F||!F.length)return[];if(w==="1"){const H=i.getCurrentLastSelection();if(!H)return[];const re=H.range;return F.filter(ue=>ue.ranges.some(he=>v.Rectangle.intersects(he,re)))}else if(w==="2")return[...F];return[]},[L,V]=j.useState(M);de.useHighlightRange(I),j.useEffect(()=>{const F=a.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),j.useEffect(()=>{V(M)},[w,o,m,_]),j.useEffect(()=>{if(w==="2")return;const F=new Re.Observable(H=>{const re=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],oe=a.onCommandExecuted(ue=>{const{id:he,params:ye}=ue,Ce=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();re.includes(he)&&ye.unitId===Ce&&H.next(null)});return()=>oe.dispose()}).pipe(Re.debounceTime(16)).subscribe(()=>{V(M)});return()=>{F.unsubscribe()}},[n,w,m,_]),j.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),j.useEffect(()=>{const F=()=>{var ue;const oe=Math.max(0,(((ue=p.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return Rr=oe,oe},re=new Re.Observable(oe=>{const ue=document.querySelector(".univer-sidebar");if(ue){let he=setTimeout(()=>{oe.next()},150);const ye=()=>{he&&clearTimeout(he),he=null},Ce=k=>{k.propertyName==="width"&&(ye(),oe.next())};return ue.addEventListener("transitionend",Ce),()=>{ye(),ue.removeEventListener("transitionend",Ce)}}}).pipe(Re.debounceTime(16)).subscribe(()=>{g(F())});return()=>{re.unsubscribe()}},[]);const U=F=>{var oe;const H=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),re=(oe=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:oe.getSheetId();if(!H||!re)throw new Error("No active sheet found");a.executeCommand(Ke.id,{unitId:H,subUnitId:re,cfId:F.cfId})},E=(F,H)=>{C(H.y)},D=(F,H,re)=>{var k;C(-1);const oe=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(k=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:k.getSheetId();if(!oe||!ue)throw new Error("No active sheet found");const he=Q=>{const se=L.length;return Math.min(se-1,Math.max(0,Q))},ye=L[he(H.y)].cfId,Ce=L[he(re.y)].cfId;ye!==Ce&&a.executeCommand(bt.id,{unitId:oe,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Ce,type:re.y>H.y?"after":"before"}})},W=()=>{t.onCreate()},X=()=>{w==="2"?a.executeCommand(Ye.id):w==="1"&&L.map(H=>({unitId:m,subUnitId:_,cfId:H.cfId})).forEach(H=>{a.executeCommand(Ke.id,H)})},Y=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return L.filter(re=>{const oe=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),oe)})},[L]),ne=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),ee=j.useMemo(()=>{const F=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return L.every(re=>{const oe=re.ranges;return q.checkRangesEditablePermission(S,F.getUnitId(),H.getSheetId(),oe)})},[L]);return x.jsxs("div",{className:pe.cfRuleList,children:[x.jsxs("div",{className:pe.ruleSelector,children:[x.jsx("div",{children:f.tWithReactNode("sheet.cf.panel.managerRuleSelect",x.jsx(ie.Select,{className:pe.select,options:y,value:w,onChange:F=>{h(F)}})).map((F,H)=>x.jsx("span",{children:F},H))}),x.jsxs("div",{className:pe.btnList,children:[x.jsx(ie.Tooltip,{title:l.t("sheet.cf.panel.createRule"),placement:"bottom",children:x.jsx("div",{className:`
21
- ${pe.icon}
22
- `,onClick:W,children:x.jsx(Pn,{})})}),L.length&&ee?x.jsx(ie.Tooltip,{title:l.t("sheet.cf.panel.clear"),placement:"bottom",children:x.jsx("div",{className:`
23
- ${pe.gap}
24
- ${pe.icon}
25
- `,onClick:X,children:x.jsx(Ct,{})})}):x.jsx("div",{className:`
26
- ${pe.gap}
27
- ${pe.disabled}
28
- `,children:x.jsx(Ct,{})})]})]}),x.jsx("div",{ref:p,className:pe.gridLayoutWrap,children:u?x.jsx(Di,{onDragStop:D,onDragStart:E,layout:ne,cols:12,rowHeight:60,width:u,margin:[0,10],draggableHandle:".draggableHandle",children:Y==null?void 0:Y.map((F,H)=>x.jsx("div",{children:x.jsxs("div",{onMouseMove:()=>{F.ranges!==I&&R(F.ranges)},onMouseLeave:()=>R([]),onClick:()=>{e(F)},className:`
29
- ${pe.ruleItem}
30
- ${d===H?pe.active:""}
31
- `,children:[x.jsx("div",{className:`
32
- ${pe.draggableHandle}
33
-
10
+ (function($,T){typeof exports=="object"&&typeof module<"u"?T(exports,require("@univerjs/core"),require("@univerjs/sheets-conditional-formatting"),require("@univerjs/sheets"),require("@univerjs/ui"),require("react/jsx-runtime"),require("react"),require("@univerjs/design"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("react-dom"),require("rxjs"),require("@univerjs/sheets-formula-ui"),require("@univerjs/engine-render"),require("rxjs/operators")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-conditional-formatting","@univerjs/sheets","@univerjs/ui","react/jsx-runtime","react","@univerjs/design","@univerjs/engine-formula","@univerjs/sheets-ui","react-dom","rxjs","@univerjs/sheets-formula-ui","@univerjs/engine-render","rxjs/operators"],T):($=typeof globalThis<"u"?globalThis:$||self,T($.UniverSheetsConditionalFormattingUi={},$.UniverCore,$.UniverSheetsConditionalFormatting,$.UniverSheets,$.UniverUi,$.React,$.React,$.UniverDesign,$.UniverEngineFormula,$.UniverSheetsUi,$.ReactDOM,$.rxjs,$.UniverSheetsFormulaUi,$.UniverEngineRender,$.rxjs.operators))})(this,function($,T,c,q,ee,E,L,ae,Gt,fe,Tn,Ce,Ge,In,qe){"use strict";var Ro=Object.defineProperty;var _o=($,T,c)=>T in $?Ro($,T,{enumerable:!0,configurable:!0,writable:!0,value:c}):$[T]=c;var De=($,T,c)=>_o($,typeof T!="symbol"?T+"":T,c);const qt={type:T.CommandType.COMMAND,id:"sheet.command.add-average-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=t,u=e.get(c.ConditionalFormattingRuleModel),y=e.get(T.ICommandService),p=e.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=u.createCfId(m,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:o,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},Xe={type:T.CommandType.COMMAND,id:"sheet.command.add-conditional-rule",handler(e,t){if(!t)return!1;const{rule:r}=t,n=e.get(T.IUndoRedoService),a=e.get(T.ICommandService),o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.IUniverInstanceService),y=q.getSheetCommandTarget(u);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=o.createCfId(p,b),I={unitId:p,subUnitId:b,rule:{...r,cfId:r.cfId||m}},_=c.AddConditionalRuleMutationUndoFactory(e,I),w=a.syncExecuteCommand(c.AddConditionalRuleMutation.id,I);return w&&n.pushUndoRedo({unitID:p,redoMutations:[{id:c.AddConditionalRuleMutation.id,params:I}],undoMutations:[_]}),w}},Xt={type:T.CommandType.COMMAND,id:"sheet.command.add-color-scale-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,config:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.ICommandService),y=e.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.colorScale,config:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},Yt={type:T.CommandType.COMMAND,id:"sheet.command.add-data-bar-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y,stopIfTrue:p,isShowValue:b}=t,m=e.get(c.ConditionalFormattingRuleModel),I=e.get(T.IUniverInstanceService),_=q.getSheetCommandTarget(I);if(!_)return!1;const{unitId:w,subUnitId:C}=_,R=e.get(T.ICommandService),h=m.createCfId(w,C),i={ranges:r,cfId:h,stopIfTrue:!!p,rule:{type:c.CFRuleType.dataBar,isShowValue:b,config:{min:n,max:a,nativeColor:o,positiveColor:u,isGradient:y}}};return R.executeCommand(c.AddConditionalRuleMutation.id,{unitId:w,subUnitId:C,rule:i})}},Kt={type:T.CommandType.COMMAND,id:"sheet.command.add-duplicate-values-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.ICommandService),y=e.get(T.IUniverInstanceService),p=q.getSheetCommandTarget(y);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.duplicateValues,style:n}};return u.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},$t={type:T.CommandType.COMMAND,id:"sheet.command.add-number-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=t,y=e.get(c.ConditionalFormattingRuleModel),p=e.get(T.ICommandService),b=e.get(T.IUniverInstanceService),m=q.getSheetCommandTarget(b);if(!m)return!1;const{unitId:I,subUnitId:_}=m,w=y.createCfId(I,_);let C;if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(o)){const R=u;if(R.length!==2||!Array.isArray(R))return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}else{const R=u;if(typeof R!="number")return!1;C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.number,operator:o,style:n,value:R}}}return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:I,subUnitId:_,rule:C})}},Zt={type:T.CommandType.COMMAND,id:"sheet.command.add-rank-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,isPercent:o,isBottom:u,value:y}=t,p=e.get(c.ConditionalFormattingRuleModel),b=e.get(T.IUniverInstanceService),m=e.get(T.ICommandService),I=q.getSheetCommandTarget(b);if(!I)return!1;const{unitId:_,subUnitId:w}=I,C=p.createCfId(_,w),R={ranges:r,cfId:C,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:o,isBottom:u,style:n,value:y}};return m.executeCommand(c.AddConditionalRuleMutation.id,{unitId:_,subUnitId:w,rule:R})}},Jt={type:T.CommandType.COMMAND,id:"sheet.command.add-text-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o,value:u}=t,y=e.get(c.ConditionalFormattingRuleModel),p=e.get(T.IUniverInstanceService),b=q.getSheetCommandTarget(p);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=e.get(T.ICommandService),w=y.createCfId(m,I),C={ranges:r,cfId:w,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.text,operator:o,style:n,value:u}};return _.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:C})}},Qt={type:T.CommandType.COMMAND,id:"sheet.command.add-time-period-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a,operator:o}=t,u=e.get(c.ConditionalFormattingRuleModel),y=e.get(T.IUniverInstanceService),p=e.get(T.ICommandService),b=q.getSheetCommandTarget(y);if(!b)return!1;const{unitId:m,subUnitId:I}=b,_=u.createCfId(m,I),w={ranges:r,cfId:_,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.timePeriod,operator:o,style:n}};return p.executeCommand(c.AddConditionalRuleMutation.id,{unitId:m,subUnitId:I,rule:w})}},en={type:T.CommandType.COMMAND,id:"sheet.command.add-uniqueValues-conditional-rule",handler(e,t){if(!t)return!1;const{ranges:r,style:n,stopIfTrue:a}=t,o=e.get(c.ConditionalFormattingRuleModel),u=e.get(T.IUniverInstanceService),y=e.get(T.ICommandService),p=q.getSheetCommandTarget(u);if(!p)return!1;const{unitId:b,subUnitId:m}=p,I=o.createCfId(b,m),_={ranges:r,cfId:I,stopIfTrue:!!a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.uniqueValues,style:n}};return y.executeCommand(c.AddConditionalRuleMutation.id,{unitId:b,subUnitId:m,rule:_})}},yt={type:T.CommandType.COMMAND,id:"sheet.command.clear-range-conditional-rule",handler(e,t){var R;if(!t)return!1;const r=e.get(c.ConditionalFormattingRuleModel),n=e.get(T.IUniverInstanceService),a=e.get(T.ICommandService),o=e.get(T.IUndoRedoService),u=e.get(q.SheetsSelectionsService),y=q.getSheetCommandTarget(n,t);if(!y)return!1;const{unitId:p,subUnitId:b}=y,m=((R=u.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],I=r.getSubunitRules(p,b);if(!(I!=null&&I.length)||!m.length)return!1;const _=[],w=[];I.forEach(h=>{const i=new T.ObjectMatrix;h.ranges.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.setValue(S,l,1)})}),m.forEach(d=>{T.Range.foreach(d,(S,l)=>{i.realDeleteValue(S,l)})});const s=q.findAllRectangle(q.createTopMatrixFromMatrix(i));if(s.length){const d={...h,ranges:s},S={unitId:p,subUnitId:b,rule:d},l=c.setConditionalRuleMutationUndoFactory(e,S);_.push({id:c.SetConditionalRuleMutation.id,params:S}),w.push(...l)}else{const d={unitId:p,subUnitId:b,cfId:h.cfId},S=c.DeleteConditionalRuleMutationUndoFactory(e,d);_.push({id:c.DeleteConditionalRuleMutation.id,params:d}),w.push(...S)}});const C=T.sequenceExecute(_,a).result;return C&&o.pushUndoRedo({unitID:p,redoMutations:_,undoMutations:w}),C}},Ye={type:T.CommandType.COMMAND,id:"sheet.command.clear-worksheet-conditional-rule",handler(e,t){const r=e.get(c.ConditionalFormattingRuleModel),n=e.get(T.IUniverInstanceService),a=e.get(T.ICommandService),o=e.get(T.IUndoRedoService),u=q.getSheetCommandTarget(n,t);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=r.getSubunitRules(y,p);if(!(b!=null&&b.length))return!1;const m=b.map(C=>({cfId:C.cfId,unitId:y,subUnitId:p})),I=m.map(C=>({id:c.DeleteConditionalRuleMutation.id,params:C})),_=m.map(C=>c.DeleteConditionalRuleMutationUndoFactory(e,C)[0]),w=T.sequenceExecute(I,a).result;return w&&o.pushUndoRedo({unitID:y,redoMutations:I,undoMutations:_}),w}},Ke={type:T.CommandType.COMMAND,id:"sheet.command.delete-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,cfId:t.cfId},b=c.DeleteConditionalRuleMutationUndoFactory(e,p),m=n.syncExecuteCommand(c.DeleteConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.DeleteConditionalRuleMutation.id,params:p}]}),m}},St={type:T.CommandType.COMMAND,id:"sheet.command.move-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=e.get(c.ConditionalFormattingRuleModel),u=q.getSheetCommandTarget(a,t);if(!u)return!1;const{unitId:y,subUnitId:p}=u,b=c.transformSupportSymmetryAnchor(t.start,t.end,o.getSubunitRules(y,p)||[],R=>R.cfId);if(!b)return!1;const[m,I]=b,_={unitId:y,subUnitId:p,start:m,end:I},w=c.MoveConditionalRuleMutationUndoFactory(_),C=n.syncExecuteCommand(c.MoveConditionalRuleMutation.id,_);return C&&r.pushUndoRedo({unitID:y,redoMutations:[{id:c.MoveConditionalRuleMutation.id,params:_}],undoMutations:w}),C}},bt={type:T.CommandType.COMMAND,id:"sheet.command.set-conditional-rule",handler(e,t){if(!t)return!1;const r=e.get(T.IUndoRedoService),n=e.get(T.ICommandService),a=e.get(T.IUniverInstanceService),o=q.getSheetCommandTarget(a,t);if(!o)return!1;const{unitId:u,subUnitId:y}=o,p={unitId:u,subUnitId:y,rule:t.rule},b=c.setConditionalRuleMutationUndoFactory(e,p),m=n.syncExecuteCommand(c.SetConditionalRuleMutation.id,p);return m&&r.pushUndoRedo({unitID:u,undoMutations:b,redoMutations:[{id:c.SetConditionalRuleMutation.id,params:p}]}),m}},A={conditionalFormattingWrap:"univer-conditional-formatting-wrap",title:"univer-title",label:"univer-label",labelContainer:"univer-label-container",mTBase:"univer-m-t-base",mTSm:"univer-m-t-sm",mTXl:"univer-m-t-xl",mLSm:"univer-m-l-sm",mLXl:"univer-m-l-xl",mLXxs:"univer-m-l-xxs",mL0:"univer-m-l-0",mR0:"univer-m-r-0"};var Se=function(){return Se=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Se.apply(this,arguments)},Nr=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)t.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},Ve=L.forwardRef(function(e,t){var r=e.icon,n=e.id,a=e.className,o=e.extend,u=Nr(e,["icon","id","className","extend"]),y="univerjs-icon univerjs-icon-".concat(n," ").concat(a||"").trim(),p=L.useRef("_".concat(Vr()));return wn(r,"".concat(n),{defIds:r.defIds,idSuffix:p.current},Se({ref:t,className:y},u),o)});function wn(e,t,r,n,a){return L.createElement(e.tag,Se(Se({key:t},Lr(e,r,a)),n),(Ur(e,r).children||[]).map(function(o,u){return wn(o,"".concat(t,"-").concat(e.tag,"-").concat(u),r,void 0,a)}))}function Lr(e,t,r){var n=Se({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1);var a=t.defIds;return!a||a.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(o){var u=o[0],y=o[1];typeof y=="string"&&(n[u]=y.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Ur(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?Se(Se({},e),{children:e.children.map(function(a){return typeof a.attrs.id=="string"&&n&&n.indexOf(a.attrs.id)>-1?Se(Se({},a),{attrs:Se(Se({},a.attrs),{id:a.attrs.id+t.idSuffix})}):a})}):e}function Vr(){return Math.random().toString(36).substring(2,8)}Ve.displayName="UniverIcon";var zr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443zM6.12398 8.30171C6.35829 8.0674 6.73819 8.0674 6.97251 8.30171L8.00007 9.32928 9.02764 8.30171C9.26195 8.0674 9.64185 8.0674 9.87617 8.30171 10.1105 8.53603 10.1105 8.91593 9.87617 9.15024L8.8486 10.1778 9.87617 11.2054C10.1105 11.4397 10.1105 11.8196 9.87617 12.0539 9.64185 12.2882 9.26195 12.2882 9.02764 12.0539L8.00007 11.0263 6.97251 12.0539C6.73819 12.2882 6.35829 12.2882 6.12398 12.0539 5.88966 11.8196 5.88966 11.4397 6.12398 11.2054L7.15154 10.1778 6.12398 9.15024C5.88966 8.91593 5.88966 8.53603 6.12398 8.30171z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V12.5331C3.15332 13.9691 4.31738 15.1332 5.75332 15.1332H10.2465C11.6825 15.1332 12.8465 13.9691 12.8465 12.5331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V12.5331C11.6465 13.3063 11.0197 13.9332 10.2465 13.9332H5.75332C4.98012 13.9332 4.35332 13.3063 4.35332 12.5331V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Ct=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"delete-single",ref:t,icon:zr}))});Ct.displayName="DeleteSingle";var kr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Rn=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"increase-single",ref:t,icon:kr}))});Rn.displayName="IncreaseSingle";var Ar={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Tt=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ar}))});Tt.displayName="MoreDownSingle";var Wr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},_n=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"sequence-single",ref:t,icon:Wr}))});_n.displayName="SequenceSingle";var jr={tag:"svg",attrs:{fill:"none",viewBox:"0 0 17 17",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_436_41",style:{maskType:"alpha"},width:17,height:17,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0.35 0.48H16.35V16.48H0.35z"}}]},{tag:"g",attrs:{mask:"url(#mask0_436_41)",fillRule:"evenodd",clipRule:"evenodd"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M2.27177 13.714L13.5855 2.40025L14.434 3.24878L3.1203 14.5625L2.27177 13.714Z"}},{tag:"path",attrs:{fill:"#E5E5E5",d:"M4.2603 1.82495L2.89617 1.82495C2.23343 1.82495 1.69617 2.36221 1.69617 3.02495L1.69617 4.38908L3.02617 4.38908L3.02617 3.15495L4.2603 3.15495L4.2603 1.82495ZM15.0092 4.38908L15.0092 3.02495C15.0092 2.36221 14.4719 1.82495 13.8092 1.82495L12.4451 1.82495L12.4451 3.15495L13.6792 3.15495L13.6792 4.38908L15.0092 4.38908ZM6.98856 1.82495L6.98856 3.15495L9.71681 3.15495L9.71681 1.82495L6.98856 1.82495ZM15.0092 7.11734L13.6792 7.11734L13.6792 9.84559L15.0092 9.84559L15.0092 7.11734ZM15.0092 12.5739L13.6792 12.5739L13.6792 13.808L12.4451 13.808L12.4451 15.138L13.8092 15.138C14.4719 15.138 15.0092 14.6007 15.0092 13.938L15.0092 12.5739ZM9.71681 15.138L9.71681 13.808L6.98856 13.808L6.98856 15.138L9.71681 15.138ZM4.2603 15.138L4.2603 13.808L3.02617 13.808L3.02617 12.5739L1.69617 12.5739L1.69617 13.938C1.69617 14.6007 2.23343 15.138 2.89617 15.138L4.2603 15.138ZM1.69617 9.8456L3.02617 9.8456L3.02617 7.11734L1.69617 7.11734L1.69617 9.8456Z"}}]}]},$e=L.forwardRef(function(e,t){return L.createElement(Ve,Object.assign({},e,{id:"slash-single",ref:t,icon:jr}))});$e.displayName="SlashSingle";function Hr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function En(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var r=function n(){return this instanceof n?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),r}var tn={exports:{}},Ze={},Je={exports:{}},Br=Je.exports,On;function nn(){return On||(On=1,function(e,t){(function(r,n){n(t)})(Br,function(r){function n(B){return function(le,M,D,N,k,K,j){return B(le,M,j)}}function a(B){return function(le,M,D,N){if(!le||!M||typeof le!="object"||typeof M!="object")return B(le,M,D,N);var k=N.get(le),K=N.get(M);if(k&&K)return k===M&&K===le;N.set(le,M),N.set(M,le);var j=B(le,M,D,N);return N.delete(le),N.delete(M),j}}function o(B,Q){var le={};for(var M in B)le[M]=B[M];for(var M in Q)le[M]=Q[M];return le}function u(B){return B.constructor===Object||B.constructor==null}function y(B){return typeof B.then=="function"}function p(B,Q){return B===Q||B!==B&&Q!==Q}var b="[object Arguments]",m="[object Boolean]",I="[object Date]",_="[object RegExp]",w="[object Map]",C="[object Number]",R="[object Object]",h="[object Set]",i="[object String]",s=Object.prototype.toString;function d(B){var Q=B.areArraysEqual,le=B.areDatesEqual,M=B.areMapsEqual,D=B.areObjectsEqual,N=B.areRegExpsEqual,k=B.areSetsEqual,K=B.createIsNestedEqual,j=K(J);function J(Z,ne,de){if(Z===ne)return!0;if(!Z||!ne||typeof Z!="object"||typeof ne!="object")return Z!==Z&&ne!==ne;if(u(Z)&&u(ne))return D(Z,ne,j,de);var Le=Array.isArray(Z),be=Array.isArray(ne);if(Le||be)return Le===be&&Q(Z,ne,j,de);var ve=s.call(Z);return ve!==s.call(ne)?!1:ve===I?le(Z,ne,j,de):ve===_?N(Z,ne,j,de):ve===w?M(Z,ne,j,de):ve===h?k(Z,ne,j,de):ve===R||ve===b?y(Z)||y(ne)?!1:D(Z,ne,j,de):ve===m||ve===C||ve===i?p(Z.valueOf(),ne.valueOf()):!1}return J}function S(B,Q,le,M){var D=B.length;if(Q.length!==D)return!1;for(;D-- >0;)if(!le(B[D],Q[D],D,D,B,Q,M))return!1;return!0}var l=a(S);function g(B,Q){return p(B.valueOf(),Q.valueOf())}function f(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={},k=0;return B.forEach(function(K,j){if(D){var J=!1,Z=0;Q.forEach(function(ne,de){!J&&!N[Z]&&(J=le(j,de,k,Z,B,Q,M)&&le(K,ne,j,de,B,Q,M))&&(N[Z]=!0),Z++}),k++,D=J}}),D}var v=a(f),P="_owner",U=Object.prototype.hasOwnProperty;function z(B,Q,le,M){var D=Object.keys(B),N=D.length;if(Object.keys(Q).length!==N)return!1;for(var k;N-- >0;){if(k=D[N],k===P){var K=!!B.$$typeof,j=!!Q.$$typeof;if((K||j)&&K!==j)return!1}if(!U.call(Q,k)||!le(B[k],Q[k],k,k,B,Q,M))return!1}return!0}var V=a(z);function O(B,Q){return B.source===Q.source&&B.flags===Q.flags}function x(B,Q,le,M){var D=B.size===Q.size;if(!D)return!1;if(!B.size)return!0;var N={};return B.forEach(function(k,K){if(D){var j=!1,J=0;Q.forEach(function(Z,ne){!j&&!N[J]&&(j=le(k,Z,K,ne,B,Q,M))&&(N[J]=!0),J++}),D=j}}),D}var W=a(x),X=Object.freeze({areArraysEqual:S,areDatesEqual:g,areMapsEqual:f,areObjectsEqual:z,areRegExpsEqual:O,areSetsEqual:x,createIsNestedEqual:n}),Y=Object.freeze({areArraysEqual:l,areDatesEqual:g,areMapsEqual:v,areObjectsEqual:V,areRegExpsEqual:O,areSetsEqual:W,createIsNestedEqual:n}),re=d(X);function te(B,Q){return re(B,Q,void 0)}var F=d(o(X,{createIsNestedEqual:function(){return p}}));function H(B,Q){return F(B,Q,void 0)}var oe=d(Y);function se(B,Q){return oe(B,Q,new WeakMap)}var ue=d(o(Y,{createIsNestedEqual:function(){return p}}));function ge(B,Q){return ue(B,Q,new WeakMap)}function ye(B){return d(o(X,B(X)))}function Te(B){var Q=d(o(Y,B(Y)));return function(le,M,D){return D===void 0&&(D=new WeakMap),Q(le,M,D)}}r.circularDeepEqual=se,r.circularShallowEqual=ge,r.createCustomCircularEqual=Te,r.createCustomEqual=ye,r.deepEqual=te,r.sameValueZeroEqual=p,r.shallowEqual=H,Object.defineProperty(r,"__esModule",{value:!0})})}(Je,Je.exports)),Je.exports}var It={exports:{}},Mn;function rn(){if(Mn)return It.exports;Mn=1;function e(r){var n,a,o="";if(typeof r=="string"||typeof r=="number")o+=r;else if(typeof r=="object")if(Array.isArray(r)){var u=r.length;for(n=0;n<u;n++)r[n]&&(a=e(r[n]))&&(o&&(o+=" "),o+=a)}else for(a in r)r[a]&&(o&&(o+=" "),o+=a);return o}function t(){for(var r,n,a=0,o="",u=arguments.length;a<u;a++)(r=arguments[a])&&(n=e(r))&&(o&&(o+=" "),o+=n);return o}return It.exports=t,It.exports.clsx=t,It.exports}var ie={},an,Dn;function Fr(){return Dn||(Dn=1,an=function(t,r,n){return t===r?!0:t.className===r.className&&n(t.style,r.style)&&t.width===r.width&&t.autoSize===r.autoSize&&t.cols===r.cols&&t.draggableCancel===r.draggableCancel&&t.draggableHandle===r.draggableHandle&&n(t.verticalCompact,r.verticalCompact)&&n(t.compactType,r.compactType)&&n(t.layout,r.layout)&&n(t.margin,r.margin)&&n(t.containerPadding,r.containerPadding)&&t.rowHeight===r.rowHeight&&t.maxRows===r.maxRows&&t.isBounded===r.isBounded&&t.isDraggable===r.isDraggable&&t.isResizable===r.isResizable&&t.allowOverlap===r.allowOverlap&&t.preventCollision===r.preventCollision&&t.useCSSTransforms===r.useCSSTransforms&&t.transformScale===r.transformScale&&t.isDroppable===r.isDroppable&&n(t.resizeHandles,r.resizeHandles)&&n(t.resizeHandle,r.resizeHandle)&&t.onLayoutChange===r.onLayoutChange&&t.onDragStart===r.onDragStart&&t.onDrag===r.onDrag&&t.onDragStop===r.onDragStop&&t.onResizeStart===r.onResizeStart&&t.onResize===r.onResize&&t.onResizeStop===r.onResizeStop&&t.onDrop===r.onDrop&&n(t.droppingItem,r.droppingItem)&&n(t.innerRef,r.innerRef)}),an}var Pn;function ze(){if(Pn)return ie;Pn=1,Object.defineProperty(ie,"__esModule",{value:!0}),ie.bottom=n,ie.childrenEqual=p,ie.cloneLayout=a,ie.cloneLayoutItem=y,ie.collides=m,ie.compact=I,ie.compactItem=C,ie.compactType=B,ie.correctBounds=R,ie.fastPositionEqual=b,ie.fastRGLPropsEqual=void 0,ie.getAllCollisions=s,ie.getFirstCollision=i,ie.getLayoutItem=h,ie.getStatics=d,ie.modifyLayout=o,ie.moveElement=S,ie.moveElementAwayFromCollision=l,ie.noop=void 0,ie.perc=g,ie.resizeItemInDirection=F,ie.setTopLeft=oe,ie.setTransform=H,ie.sortLayoutItems=se,ie.sortLayoutItemsByColRow=ge,ie.sortLayoutItemsByRowCol=ue,ie.synchronizeLayoutWithChildren=ye,ie.validateLayout=Te,ie.withLayoutItem=u;var e=nn(),t=r(L);function r(M){return M&&M.__esModule?M:{default:M}}function n(M){let D=0,N;for(let k=0,K=M.length;k<K;k++)N=M[k].y+M[k].h,N>D&&(D=N);return D}function a(M){const D=Array(M.length);for(let N=0,k=M.length;N<k;N++)D[N]=y(M[N]);return D}function o(M,D){const N=Array(M.length);for(let k=0,K=M.length;k<K;k++)D.i===M[k].i?N[k]=D:N[k]=M[k];return N}function u(M,D,N){let k=h(M,D);return k?(k=N(y(k)),M=o(M,k),[M,k]):[M,null]}function y(M){return{w:M.w,h:M.h,x:M.x,y:M.y,i:M.i,minW:M.minW,maxW:M.maxW,minH:M.minH,maxH:M.maxH,moved:!!M.moved,static:!!M.static,isDraggable:M.isDraggable,isResizable:M.isResizable,resizeHandles:M.resizeHandles,isBounded:M.isBounded}}function p(M,D){return(0,e.deepEqual)(t.default.Children.map(M,N=>N==null?void 0:N.key),t.default.Children.map(D,N=>N==null?void 0:N.key))&&(0,e.deepEqual)(t.default.Children.map(M,N=>N==null?void 0:N.props["data-grid"]),t.default.Children.map(D,N=>N==null?void 0:N.props["data-grid"]))}ie.fastRGLPropsEqual=Fr();function b(M,D){return M.left===D.left&&M.top===D.top&&M.width===D.width&&M.height===D.height}function m(M,D){return!(M.i===D.i||M.x+M.w<=D.x||M.x>=D.x+D.w||M.y+M.h<=D.y||M.y>=D.y+D.h)}function I(M,D,N,k){const K=d(M),j=se(M,D),J=Array(M.length);for(let Z=0,ne=j.length;Z<ne;Z++){let de=y(j[Z]);de.static||(de=C(K,de,D,N,j,k),K.push(de)),J[M.indexOf(j[Z])]=de,de.moved=!1}return J}const _={x:"w",y:"h"};function w(M,D,N,k){const K=_[k];D[k]+=1;const j=M.map(J=>J.i).indexOf(D.i);for(let J=j+1;J<M.length;J++){const Z=M[J];if(!Z.static){if(Z.y>D.y+D.h)break;m(D,Z)&&w(M,Z,N+D[K],k)}}D[k]=N}function C(M,D,N,k,K,j){const J=N==="vertical",Z=N==="horizontal";if(J)for(D.y=Math.min(n(M),D.y);D.y>0&&!i(M,D);)D.y--;else if(Z)for(;D.x>0&&!i(M,D);)D.x--;let ne;for(;(ne=i(M,D))&&!(N===null&&j);)if(Z?w(K,D,ne.x+ne.w,"x"):w(K,D,ne.y+ne.h,"y"),Z&&D.x+D.w>k)for(D.x=k-D.w,D.y++;D.x>0&&!i(M,D);)D.x--;return D.y=Math.max(D.y,0),D.x=Math.max(D.x,0),D}function R(M,D){const N=d(M);for(let k=0,K=M.length;k<K;k++){const j=M[k];if(j.x+j.w>D.cols&&(j.x=D.cols-j.w),j.x<0&&(j.x=0,j.w=D.cols),!j.static)N.push(j);else for(;i(N,j);)j.y++}return M}function h(M,D){for(let N=0,k=M.length;N<k;N++)if(M[N].i===D)return M[N]}function i(M,D){for(let N=0,k=M.length;N<k;N++)if(m(M[N],D))return M[N]}function s(M,D){return M.filter(N=>m(N,D))}function d(M){return M.filter(D=>D.static)}function S(M,D,N,k,K,j,J,Z,ne){if(D.static&&D.isDraggable!==!0||D.y===k&&D.x===N)return M;`${D.i}${String(N)}${String(k)}${D.x}${D.y}`;const de=D.x,Le=D.y;typeof N=="number"&&(D.x=N),typeof k=="number"&&(D.y=k),D.moved=!0;let be=se(M,J);(J==="vertical"&&typeof k=="number"?Le>=k:J==="horizontal"&&typeof N=="number"?de>=N:!1)&&(be=be.reverse());const Fe=s(be,D),Ft=Fe.length>0;if(Ft&&ne)return a(M);if(Ft&&j)return`${D.i}`,D.x=de,D.y=Le,D.moved=!1,M;for(let Cn=0,wo=Fe.length;Cn<wo;Cn++){const Ue=Fe[Cn];`${D.i}${D.x}${D.y}${Ue.i}${Ue.x}${Ue.y}`,!Ue.moved&&(Ue.static?M=l(M,Ue,D,K,J):M=l(M,D,Ue,K,J))}return M}function l(M,D,N,k,K,j){const J=K==="horizontal",Z=K==="vertical",ne=D.static;if(k){k=!1;const be={x:J?Math.max(D.x-N.w,0):N.x,y:Z?Math.max(D.y-N.h,0):N.y,w:N.w,h:N.h,i:"-1"},ve=i(M,be),Fe=ve&&ve.y+ve.h>D.y,Ft=ve&&D.x+D.w>ve.x;if(ve){if(Fe&&Z)return S(M,N,void 0,D.y+1,k,ne,K);if(Fe&&K==null)return D.y=N.y,N.y=N.y+N.h,M;if(Ft&&J)return S(M,D,N.x,void 0,k,ne,K)}else return`${N.i}${be.x}${be.y}`,S(M,N,J?be.x:void 0,Z?be.y:void 0,k,ne,K)}const de=J?N.x+1:void 0,Le=Z?N.y+1:void 0;return de==null&&Le==null?M:S(M,N,J?N.x+1:void 0,Z?N.y+1:void 0,k,ne,K)}function g(M){return M*100+"%"}const f=(M,D,N,k)=>M+N>k?D:N,v=(M,D,N)=>M<0?D:N,P=M=>Math.max(0,M),U=M=>Math.max(0,M),z=(M,D,N)=>{let{left:k,height:K,width:j}=D;const J=M.top-(K-M.height);return{left:k,width:j,height:v(J,M.height,K),top:U(J)}},V=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{top:k,height:j,width:f(M.left,M.width,J,N),left:P(K)}},O=(M,D,N)=>{let{top:k,height:K,width:j}=D;const J=M.left-(j-M.width);return{height:K,width:J<0?M.width:f(M.left,M.width,j,N),top:U(k),left:P(J)}},x=(M,D,N)=>{let{top:k,left:K,height:j,width:J}=D;return{width:J,left:K,height:v(k,M.height,j),top:U(k)}},te={n:z,ne:function(){return z(arguments.length<=0?void 0:arguments[0],V(...arguments))},e:V,se:function(){return x(arguments.length<=0?void 0:arguments[0],V(...arguments))},s:x,sw:function(){return x(arguments.length<=0?void 0:arguments[0],O(...arguments))},w:O,nw:function(){return z(arguments.length<=0?void 0:arguments[0],O(...arguments))}};function F(M,D,N,k){const K=te[M];return K?K(D,{...D,...N},k):N}function H(M){let{top:D,left:N,width:k,height:K}=M;const j=`translate(${N}px,${D}px)`;return{transform:j,WebkitTransform:j,MozTransform:j,msTransform:j,OTransform:j,width:`${k}px`,height:`${K}px`,position:"absolute"}}function oe(M){let{top:D,left:N,width:k,height:K}=M;return{top:`${D}px`,left:`${N}px`,width:`${k}px`,height:`${K}px`,position:"absolute"}}function se(M,D){return D==="horizontal"?ge(M):D==="vertical"?ue(M):M}function ue(M){return M.slice(0).sort(function(D,N){return D.y>N.y||D.y===N.y&&D.x>N.x?1:D.y===N.y&&D.x===N.x?0:-1})}function ge(M){return M.slice(0).sort(function(D,N){return D.x>N.x||D.x===N.x&&D.y>N.y?1:-1})}function ye(M,D,N,k,K){M=M||[];const j=[];t.default.Children.forEach(D,Z=>{if((Z==null?void 0:Z.key)==null)return;const ne=h(M,String(Z.key)),de=Z.props["data-grid"];ne&&de==null?j.push(y(ne)):de?j.push(y({...de,i:Z.key})):j.push(y({w:1,h:1,x:0,y:n(j),i:String(Z.key)}))});const J=R(j,{cols:N});return K?J:I(J,k,N)}function Te(M){let D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Layout";const N=["x","y","w","h"];if(!Array.isArray(M))throw new Error(D+" must be an array!");for(let k=0,K=M.length;k<K;k++){const j=M[k];for(let J=0;J<N.length;J++){const Z=N[J],ne=j[Z];if(typeof ne!="number"||Number.isNaN(ne))throw new Error(`ReactGridLayout: ${D}[${k}].${Z} must be a number! Received: ${ne} (${typeof ne})`)}if(typeof j.i<"u"&&typeof j.i!="string")throw new Error(`ReactGridLayout: ${D}[${k}].i must be a string! Received: ${j.i} (${typeof j.i})`)}}function B(M){const{verticalCompact:D,compactType:N}=M||{};return D===!1?null:N}function Q(){}const le=()=>{};return ie.noop=le,ie}var we={},xn;function on(){if(xn)return we;xn=1,Object.defineProperty(we,"__esModule",{value:!0}),we.calcGridColWidth=e,we.calcGridItemPosition=r,we.calcGridItemWHPx=t,we.calcWH=a,we.calcXY=n,we.clamp=o;function e(u){const{margin:y,containerPadding:p,containerWidth:b,cols:m}=u;return(b-y[0]*(m-1)-p[0]*2)/m}function t(u,y,p){return Number.isFinite(u)?Math.round(y*u+Math.max(0,u-1)*p):u}function r(u,y,p,b,m,I){const{margin:_,containerPadding:w,rowHeight:C}=u,R=e(u),h={};return I&&I.resizing?(h.width=Math.round(I.resizing.width),h.height=Math.round(I.resizing.height)):(h.width=t(b,R,_[0]),h.height=t(m,C,_[1])),I&&I.dragging?(h.top=Math.round(I.dragging.top),h.left=Math.round(I.dragging.left)):I&&I.resizing&&typeof I.resizing.top=="number"&&typeof I.resizing.left=="number"?(h.top=Math.round(I.resizing.top),h.left=Math.round(I.resizing.left)):(h.top=Math.round((C+_[1])*p+w[1]),h.left=Math.round((R+_[0])*y+w[0])),h}function n(u,y,p,b,m){const{margin:I,containerPadding:_,cols:w,rowHeight:C,maxRows:R}=u,h=e(u);let i=Math.round((p-_[0])/(h+I[0])),s=Math.round((y-_[1])/(C+I[1]));return i=o(i,0,w-b),s=o(s,0,R-m),{x:i,y:s}}function a(u,y,p,b,m,I){const{margin:_,maxRows:w,cols:C,rowHeight:R}=u,h=e(u);let i=Math.round((y+_[0])/(h+_[0])),s=Math.round((p+_[1])/(R+_[1])),d=o(i,0,C-b),S=o(s,0,w-m);return["sw","w","nw"].indexOf(I)!==-1&&(d=o(i,0,C)),["nw","n","ne"].indexOf(I)!==-1&&(S=o(s,0,w)),{w:d,h:S}}function o(u,y,p){return Math.max(Math.min(u,p),y)}return we}var Qe={},sn={exports:{}},ln,Nn;function Gr(){if(Nn)return ln;Nn=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ln=e,ln}var cn,Ln;function qr(){if(Ln)return cn;Ln=1;var e=Gr();function t(){}function r(){}return r.resetWarningCache=t,cn=function(){function n(u,y,p,b,m,I){if(I!==e){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}n.isRequired=n;function a(){return n}var o={array:n,bigint:n,bool:n,func:n,number:n,object:n,string:n,symbol:n,any:n,arrayOf:a,element:n,elementType:n,instanceOf:a,node:n,objectOf:a,oneOf:a,oneOfType:a,shape:a,exact:a,checkPropTypes:r,resetWarningCache:t};return o.PropTypes=o,o},cn}var Un;function Ee(){return Un||(Un=1,sn.exports=qr()()),sn.exports}var et={exports:{}},un={};function Vn(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=Vn(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function zn(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=Vn(e))&&(n&&(n+=" "),n+=t);return n}const Xr=En(Object.freeze(Object.defineProperty({__proto__:null,clsx:zn,default:zn},Symbol.toStringTag,{value:"Module"})));var pe={},Oe={},kn;function wt(){if(kn)return Oe;kn=1,Object.defineProperty(Oe,"__esModule",{value:!0}),Oe.dontSetMe=a,Oe.findInArray=e,Oe.int=n,Oe.isFunction=t,Oe.isNum=r;function e(o,u){for(let y=0,p=o.length;y<p;y++)if(u.apply(u,[o[y],y,o]))return o[y]}function t(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function r(o){return typeof o=="number"&&!isNaN(o)}function n(o){return parseInt(o,10)}function a(o,u,y){if(o[u])return new Error("Invalid prop ".concat(u," passed to ").concat(y," - do not set this, set it on the child."))}return Oe}var Me={},An;function Yr(){if(An)return Me;An=1,Object.defineProperty(Me,"__esModule",{value:!0}),Me.browserPrefixToKey=r,Me.browserPrefixToStyle=n,Me.default=void 0,Me.getPrefix=t;const e=["Moz","Webkit","O","ms"];function t(){var o;let u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const y=(o=window.document)===null||o===void 0||(o=o.documentElement)===null||o===void 0?void 0:o.style;if(!y||u in y)return"";for(let p=0;p<e.length;p++)if(r(u,e[p])in y)return e[p];return""}function r(o,u){return u?"".concat(u).concat(a(o)):o}function n(o,u){return u?"-".concat(u.toLowerCase(),"-").concat(o):o}function a(o){let u="",y=!0;for(let p=0;p<o.length;p++)y?(u+=o[p].toUpperCase(),y=!1):o[p]==="-"?y=!0:u+=o[p];return u}return Me.default=t(),Me}var Wn;function dn(){if(Wn)return pe;Wn=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.addClassName=l,pe.addEvent=y,pe.addUserSelectStyles=d,pe.createCSSTransform=C,pe.createSVGTransform=R,pe.getTouch=i,pe.getTouchIdentifier=s,pe.getTranslation=h,pe.innerHeight=I,pe.innerWidth=_,pe.matchesSelector=o,pe.matchesSelectorAndParentsTo=u,pe.offsetXYFromParent=w,pe.outerHeight=b,pe.outerWidth=m,pe.removeClassName=g,pe.removeEvent=p,pe.removeUserSelectStyles=S;var e=wt(),t=n(Yr());function r(f){if(typeof WeakMap!="function")return null;var v=new WeakMap,P=new WeakMap;return(r=function(U){return U?P:v})(f)}function n(f,v){if(f&&f.__esModule)return f;if(f===null||typeof f!="object"&&typeof f!="function")return{default:f};var P=r(v);if(P&&P.has(f))return P.get(f);var U={},z=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var V in f)if(V!=="default"&&Object.prototype.hasOwnProperty.call(f,V)){var O=z?Object.getOwnPropertyDescriptor(f,V):null;O&&(O.get||O.set)?Object.defineProperty(U,V,O):U[V]=f[V]}return U.default=f,P&&P.set(f,U),U}let a="";function o(f,v){return a||(a=(0,e.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(P){return(0,e.isFunction)(f[P])})),(0,e.isFunction)(f[a])?f[a](v):!1}function u(f,v,P){let U=f;do{if(o(U,v))return!0;if(U===P)return!1;U=U.parentNode}while(U);return!1}function y(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.addEventListener?f.addEventListener(v,P,z):f.attachEvent?f.attachEvent("on"+v,P):f["on"+v]=P}function p(f,v,P,U){if(!f)return;const z={capture:!0,...U};f.removeEventListener?f.removeEventListener(v,P,z):f.detachEvent?f.detachEvent("on"+v,P):f["on"+v]=null}function b(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,e.int)(P.borderTopWidth),v+=(0,e.int)(P.borderBottomWidth),v}function m(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v+=(0,e.int)(P.borderLeftWidth),v+=(0,e.int)(P.borderRightWidth),v}function I(f){let v=f.clientHeight;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,e.int)(P.paddingTop),v-=(0,e.int)(P.paddingBottom),v}function _(f){let v=f.clientWidth;const P=f.ownerDocument.defaultView.getComputedStyle(f);return v-=(0,e.int)(P.paddingLeft),v-=(0,e.int)(P.paddingRight),v}function w(f,v,P){const z=v===v.ownerDocument.body?{left:0,top:0}:v.getBoundingClientRect(),V=(f.clientX+v.scrollLeft-z.left)/P,O=(f.clientY+v.scrollTop-z.top)/P;return{x:V,y:O}}function C(f,v){const P=h(f,v,"px");return{[(0,t.browserPrefixToKey)("transform",t.default)]:P}}function R(f,v){return h(f,v,"")}function h(f,v,P){let{x:U,y:z}=f,V="translate(".concat(U).concat(P,",").concat(z).concat(P,")");if(v){const O="".concat(typeof v.x=="string"?v.x:v.x+P),x="".concat(typeof v.y=="string"?v.y:v.y+P);V="translate(".concat(O,", ").concat(x,")")+V}return V}function i(f,v){return f.targetTouches&&(0,e.findInArray)(f.targetTouches,P=>v===P.identifier)||f.changedTouches&&(0,e.findInArray)(f.changedTouches,P=>v===P.identifier)}function s(f){if(f.targetTouches&&f.targetTouches[0])return f.targetTouches[0].identifier;if(f.changedTouches&&f.changedTouches[0])return f.changedTouches[0].identifier}function d(f){if(!f)return;let v=f.getElementById("react-draggable-style-el");v||(v=f.createElement("style"),v.type="text/css",v.id="react-draggable-style-el",v.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
11
+ `,v.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
12
+ `,f.getElementsByTagName("head")[0].appendChild(v)),f.body&&l(f.body,"react-draggable-transparent-selection")}function S(f){if(f)try{if(f.body&&g(f.body,"react-draggable-transparent-selection"),f.selection)f.selection.empty();else{const v=(f.defaultView||window).getSelection();v&&v.type!=="Caret"&&v.removeAllRanges()}}catch{}}function l(f,v){f.classList?f.classList.add(v):f.className.match(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)")))||(f.className+=" ".concat(v))}function g(f,v){f.classList?f.classList.remove(v):f.className=f.className.replace(new RegExp("(?:^|\\s)".concat(v,"(?!\\S)"),"g"),"")}return pe}var Ie={},jn;function Hn(){if(jn)return Ie;jn=1,Object.defineProperty(Ie,"__esModule",{value:!0}),Ie.canDragX=a,Ie.canDragY=o,Ie.createCoreData=y,Ie.createDraggableData=p,Ie.getBoundPosition=r,Ie.getControlPosition=u,Ie.snapToGrid=n;var e=wt(),t=dn();function r(I,_,w){if(!I.props.bounds)return[_,w];let{bounds:C}=I.props;C=typeof C=="string"?C:b(C);const R=m(I);if(typeof C=="string"){const{ownerDocument:h}=R,i=h.defaultView;let s;if(C==="parent"?s=R.parentNode:s=h.querySelector(C),!(s instanceof i.HTMLElement))throw new Error('Bounds selector "'+C+'" could not find an element.');const d=s,S=i.getComputedStyle(R),l=i.getComputedStyle(d);C={left:-R.offsetLeft+(0,e.int)(l.paddingLeft)+(0,e.int)(S.marginLeft),top:-R.offsetTop+(0,e.int)(l.paddingTop)+(0,e.int)(S.marginTop),right:(0,t.innerWidth)(d)-(0,t.outerWidth)(R)-R.offsetLeft+(0,e.int)(l.paddingRight)-(0,e.int)(S.marginRight),bottom:(0,t.innerHeight)(d)-(0,t.outerHeight)(R)-R.offsetTop+(0,e.int)(l.paddingBottom)-(0,e.int)(S.marginBottom)}}return(0,e.isNum)(C.right)&&(_=Math.min(_,C.right)),(0,e.isNum)(C.bottom)&&(w=Math.min(w,C.bottom)),(0,e.isNum)(C.left)&&(_=Math.max(_,C.left)),(0,e.isNum)(C.top)&&(w=Math.max(w,C.top)),[_,w]}function n(I,_,w){const C=Math.round(_/I[0])*I[0],R=Math.round(w/I[1])*I[1];return[C,R]}function a(I){return I.props.axis==="both"||I.props.axis==="x"}function o(I){return I.props.axis==="both"||I.props.axis==="y"}function u(I,_,w){const C=typeof _=="number"?(0,t.getTouch)(I,_):null;if(typeof _=="number"&&!C)return null;const R=m(w),h=w.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,t.offsetXYFromParent)(C||I,h,w.props.scale)}function y(I,_,w){const C=!(0,e.isNum)(I.lastX),R=m(I);return C?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:w,x:_,y:w}:{node:R,deltaX:_-I.lastX,deltaY:w-I.lastY,lastX:I.lastX,lastY:I.lastY,x:_,y:w}}function p(I,_){const w=I.props.scale;return{node:_.node,x:I.state.x+_.deltaX/w,y:I.state.y+_.deltaY/w,deltaX:_.deltaX/w,deltaY:_.deltaY/w,lastX:I.state.x,lastY:I.state.y}}function b(I){return{left:I.left,top:I.top,right:I.right,bottom:I.bottom}}function m(I){const _=I.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return Ie}var tt={},Rt={},Bn;function Fn(){if(Bn)return Rt;Bn=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.default=e;function e(){}return Rt}var Gn;function Kr(){if(Gn)return tt;Gn=1,Object.defineProperty(tt,"__esModule",{value:!0}),tt.default=void 0;var e=b(L),t=y(Ee()),r=y(Tn),n=dn(),a=Hn(),o=wt(),u=y(Fn());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:i})(h)}function b(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var d={},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=w.mouse,R=class extends e.Component{constructor(){super(...arguments),m(this,"dragging",!1),m(this,"lastX",NaN),m(this,"lastY",NaN),m(this,"touchIdentifier",null),m(this,"mounted",!1),m(this,"handleDragStart",i=>{if(this.props.onMouseDown(i),!this.props.allowAnyClick&&typeof i.button=="number"&&i.button!==0)return!1;const s=this.findDOMNode();if(!s||!s.ownerDocument||!s.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:d}=s;if(this.props.disabled||!(i.target instanceof d.defaultView.Node)||this.props.handle&&!(0,n.matchesSelectorAndParentsTo)(i.target,this.props.handle,s)||this.props.cancel&&(0,n.matchesSelectorAndParentsTo)(i.target,this.props.cancel,s))return;i.type==="touchstart"&&i.preventDefault();const S=(0,n.getTouchIdentifier)(i);this.touchIdentifier=S;const l=(0,a.getControlPosition)(i,S,this);if(l==null)return;const{x:g,y:f}=l,v=(0,a.createCoreData)(this,g,f);(0,u.default)("DraggableCore: handleDragStart: %j",v),(0,u.default)("calling",this.props.onStart),!(this.props.onStart(i,v)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,n.addUserSelectStyles)(d),this.dragging=!0,this.lastX=g,this.lastY=f,(0,n.addEvent)(d,C.move,this.handleDrag),(0,n.addEvent)(d,C.stop,this.handleDragStop))}),m(this,"handleDrag",i=>{const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let f=d-this.lastX,v=S-this.lastY;if([f,v]=(0,a.snapToGrid)(this.props.grid,f,v),!f&&!v)return;d=this.lastX+f,S=this.lastY+v}const l=(0,a.createCoreData)(this,d,S);if((0,u.default)("DraggableCore: handleDrag: %j",l),this.props.onDrag(i,l)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const v=document.createEvent("MouseEvents");v.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(v)}return}this.lastX=d,this.lastY=S}),m(this,"handleDragStop",i=>{if(!this.dragging)return;const s=(0,a.getControlPosition)(i,this.touchIdentifier,this);if(s==null)return;let{x:d,y:S}=s;if(Array.isArray(this.props.grid)){let v=d-this.lastX||0,P=S-this.lastY||0;[v,P]=(0,a.snapToGrid)(this.props.grid,v,P),d=this.lastX+v,S=this.lastY+P}const l=(0,a.createCoreData)(this,d,S);if(this.props.onStop(i,l)===!1||this.mounted===!1)return!1;const f=this.findDOMNode();f&&this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(f.ownerDocument),(0,u.default)("DraggableCore: handleDragStop: %j",l),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,f&&((0,u.default)("DraggableCore: Removing handlers"),(0,n.removeEvent)(f.ownerDocument,C.move,this.handleDrag),(0,n.removeEvent)(f.ownerDocument,C.stop,this.handleDragStop))}),m(this,"onMouseDown",i=>(C=w.mouse,this.handleDragStart(i))),m(this,"onMouseUp",i=>(C=w.mouse,this.handleDragStop(i))),m(this,"onTouchStart",i=>(C=w.touch,this.handleDragStart(i))),m(this,"onTouchEnd",i=>(C=w.touch,this.handleDragStop(i)))}componentDidMount(){this.mounted=!0;const i=this.findDOMNode();i&&(0,n.addEvent)(i,w.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const i=this.findDOMNode();if(i){const{ownerDocument:s}=i;(0,n.removeEvent)(s,w.mouse.move,this.handleDrag),(0,n.removeEvent)(s,w.touch.move,this.handleDrag),(0,n.removeEvent)(s,w.mouse.stop,this.handleDragStop),(0,n.removeEvent)(s,w.touch.stop,this.handleDragStop),(0,n.removeEvent)(i,w.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,n.removeUserSelectStyles)(s)}}findDOMNode(){var i,s;return(i=this.props)!==null&&i!==void 0&&i.nodeRef?(s=this.props)===null||s===void 0||(s=s.nodeRef)===null||s===void 0?void 0:s.current:r.default.findDOMNode(this)}render(){return e.cloneElement(e.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return tt.default=R,m(R,"displayName","DraggableCore"),m(R,"propTypes",{allowAnyClick:t.default.bool,children:t.default.node.isRequired,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:function(h,i){if(h[i]&&h[i].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:t.default.arrayOf(t.default.number),handle:t.default.string,cancel:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),m(R,"defaultProps",{allowAnyClick:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),tt}var qn;function $r(){return qn||(qn=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),e.default=void 0;var t=_(L),r=m(Ee()),n=m(Tn),a=m(Xr),o=dn(),u=Hn(),y=wt(),p=m(Kr()),b=m(Fn());function m(s){return s&&s.__esModule?s:{default:s}}function I(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(I=function(l){return l?S:d})(s)}function _(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=I(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function w(){return w=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},w.apply(this,arguments)}function C(s,d,S){return d=R(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function R(s){var d=h(s,"string");return typeof d=="symbol"?d:String(d)}function h(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}class i extends t.Component{static getDerivedStateFromProps(d,S){let{position:l}=d,{prevPropsPosition:g}=S;return l&&(!g||l.x!==g.x||l.y!==g.y)?((0,b.default)("Draggable: getDerivedStateFromProps %j",{position:l,prevPropsPosition:g}),{x:l.x,y:l.y,prevPropsPosition:{...l}}):null}constructor(d){super(d),C(this,"onDragStart",(S,l)=>{if((0,b.default)("Draggable: onDragStart: %j",l),this.props.onStart(S,(0,u.createDraggableData)(this,l))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(S,l)=>{if(!this.state.dragging)return!1;(0,b.default)("Draggable: onDrag: %j",l);const g=(0,u.createDraggableData)(this,l),f={x:g.x,y:g.y,slackX:0,slackY:0};if(this.props.bounds){const{x:P,y:U}=f;f.x+=this.state.slackX,f.y+=this.state.slackY;const[z,V]=(0,u.getBoundPosition)(this,f.x,f.y);f.x=z,f.y=V,f.slackX=this.state.slackX+(P-f.x),f.slackY=this.state.slackY+(U-f.y),g.x=f.x,g.y=f.y,g.deltaX=f.x-this.state.x,g.deltaY=f.y-this.state.y}if(this.props.onDrag(S,g)===!1)return!1;this.setState(f)}),C(this,"onDragStop",(S,l)=>{if(!this.state.dragging||this.props.onStop(S,(0,u.createDraggableData)(this,l))===!1)return!1;(0,b.default)("Draggable: onDragStop: %j",l);const f={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:P,y:U}=this.props.position;f.x=P,f.y=U}this.setState(f)}),this.state={dragging:!1,dragged:!1,x:d.position?d.position.x:d.defaultPosition.x,y:d.position?d.position.y:d.defaultPosition.y,prevPropsPosition:{...d.position},slackX:0,slackY:0,isElementSVG:!1},d.position&&!(d.onDrag||d.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.setState({dragging:!1})}findDOMNode(){var d,S;return(d=(S=this.props)===null||S===void 0||(S=S.nodeRef)===null||S===void 0?void 0:S.current)!==null&&d!==void 0?d:n.default.findDOMNode(this)}render(){const{axis:d,bounds:S,children:l,defaultPosition:g,defaultClassName:f,defaultClassNameDragging:v,defaultClassNameDragged:P,position:U,positionOffset:z,scale:V,...O}=this.props;let x={},W=null;const Y=!!!U||this.state.dragging,re=U||g,te={x:(0,u.canDragX)(this)&&Y?this.state.x:re.x,y:(0,u.canDragY)(this)&&Y?this.state.y:re.y};this.state.isElementSVG?W=(0,o.createSVGTransform)(te,z):x=(0,o.createCSSTransform)(te,z);const F=(0,a.default)(l.props.className||"",f,{[v]:this.state.dragging,[P]:this.state.dragged});return t.createElement(p.default,w({},O,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),t.cloneElement(t.Children.only(l),{className:F,style:{...l.props.style,...x},transform:W}))}}e.default=i,C(i,"displayName","Draggable"),C(i,"propTypes",{...p.default.propTypes,axis:r.default.oneOf(["both","x","y","none"]),bounds:r.default.oneOfType([r.default.shape({left:r.default.number,right:r.default.number,top:r.default.number,bottom:r.default.number}),r.default.string,r.default.oneOf([!1])]),defaultClassName:r.default.string,defaultClassNameDragging:r.default.string,defaultClassNameDragged:r.default.string,defaultPosition:r.default.shape({x:r.default.number,y:r.default.number}),positionOffset:r.default.shape({x:r.default.oneOfType([r.default.number,r.default.string]),y:r.default.oneOfType([r.default.number,r.default.string])}),position:r.default.shape({x:r.default.number,y:r.default.number}),className:y.dontSetMe,style:y.dontSetMe,transform:y.dontSetMe}),C(i,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})}(un)),un}var Xn;function fn(){if(Xn)return et.exports;Xn=1;const{default:e,DraggableCore:t}=$r();return et.exports=e,et.exports.default=e,et.exports.DraggableCore=t,et.exports}var nt={exports:{}},rt={},_t={},Yn;function Zr(){if(Yn)return _t;Yn=1,_t.__esModule=!0,_t.cloneElement=y;var e=t(L);function t(p){return p&&p.__esModule?p:{default:p}}function r(p,b){var m=Object.keys(p);if(Object.getOwnPropertySymbols){var I=Object.getOwnPropertySymbols(p);b&&(I=I.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),m.push.apply(m,I)}return m}function n(p){for(var b=1;b<arguments.length;b++){var m=arguments[b]!=null?arguments[b]:{};b%2?r(Object(m),!0).forEach(function(I){a(p,I,m[I])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(m)):r(Object(m)).forEach(function(I){Object.defineProperty(p,I,Object.getOwnPropertyDescriptor(m,I))})}return p}function a(p,b,m){return b=o(b),b in p?Object.defineProperty(p,b,{value:m,enumerable:!0,configurable:!0,writable:!0}):p[b]=m,p}function o(p){var b=u(p,"string");return typeof b=="symbol"?b:String(b)}function u(p,b){if(typeof p!="object"||p===null)return p;var m=p[Symbol.toPrimitive];if(m!==void 0){var I=m.call(p,b);if(typeof I!="object")return I;throw new TypeError("@@toPrimitive must return a primitive value.")}return(b==="string"?String:Number)(p)}function y(p,b){return b.style&&p.props.style&&(b.style=n(n({},p.props.style),b.style)),b.className&&p.props.className&&(b.className=p.props.className+" "+b.className),e.default.cloneElement(p,b)}return _t}var at={},Kn;function $n(){if(Kn)return at;Kn=1,at.__esModule=!0,at.resizableProps=void 0;var e=t(Ee());fn();function t(n){return n&&n.__esModule?n:{default:n}}var r={axis:e.default.oneOf(["both","x","y","none"]),className:e.default.string,children:e.default.element.isRequired,draggableOpts:e.default.shape({allowAnyClick:e.default.bool,cancel:e.default.string,children:e.default.node,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:e.default.node,grid:e.default.arrayOf(e.default.number),handle:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number}),height:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="y"){var p;return(p=e.default.number).isRequired.apply(p,o)}return e.default.number.apply(e.default,o)},handle:e.default.oneOfType([e.default.node,e.default.func]),handleSize:e.default.arrayOf(e.default.number),lockAspectRatio:e.default.bool,maxConstraints:e.default.arrayOf(e.default.number),minConstraints:e.default.arrayOf(e.default.number),onResizeStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,resizeHandles:e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:e.default.number,width:function(){for(var a=arguments.length,o=new Array(a),u=0;u<a;u++)o[u]=arguments[u];var y=o[0];if(y.axis==="both"||y.axis==="x"){var p;return(p=e.default.number).isRequired.apply(p,o)}return e.default.number.apply(e.default,o)}};return at.resizableProps=r,at}var Zn;function Jn(){if(Zn)return rt;Zn=1,rt.__esModule=!0,rt.default=void 0;var e=u(L),t=fn(),r=Zr(),n=$n(),a=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(i){if(typeof WeakMap!="function")return null;var s=new WeakMap,d=new WeakMap;return(o=function(l){return l?d:s})(i)}function u(i,s){if(i&&i.__esModule)return i;if(i===null||typeof i!="object"&&typeof i!="function")return{default:i};var d=o(s);if(d&&d.has(i))return d.get(i);var S={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in i)if(g!=="default"&&Object.prototype.hasOwnProperty.call(i,g)){var f=l?Object.getOwnPropertyDescriptor(i,g):null;f&&(f.get||f.set)?Object.defineProperty(S,g,f):S[g]=i[g]}return S.default=i,d&&d.set(i,S),S}function y(){return y=Object.assign?Object.assign.bind():function(i){for(var s=1;s<arguments.length;s++){var d=arguments[s];for(var S in d)Object.prototype.hasOwnProperty.call(d,S)&&(i[S]=d[S])}return i},y.apply(this,arguments)}function p(i,s){if(i==null)return{};var d={},S=Object.keys(i),l,g;for(g=0;g<S.length;g++)l=S[g],!(s.indexOf(l)>=0)&&(d[l]=i[l]);return d}function b(i,s){var d=Object.keys(i);if(Object.getOwnPropertySymbols){var S=Object.getOwnPropertySymbols(i);s&&(S=S.filter(function(l){return Object.getOwnPropertyDescriptor(i,l).enumerable})),d.push.apply(d,S)}return d}function m(i){for(var s=1;s<arguments.length;s++){var d=arguments[s]!=null?arguments[s]:{};s%2?b(Object(d),!0).forEach(function(S){I(i,S,d[S])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(d)):b(Object(d)).forEach(function(S){Object.defineProperty(i,S,Object.getOwnPropertyDescriptor(d,S))})}return i}function I(i,s,d){return s=_(s),s in i?Object.defineProperty(i,s,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[s]=d,i}function _(i){var s=w(i,"string");return typeof s=="symbol"?s:String(s)}function w(i,s){if(typeof i!="object"||i===null)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var S=d.call(i,s);if(typeof S!="object")return S;throw new TypeError("@@toPrimitive must return a primitive value.")}return(s==="string"?String:Number)(i)}function C(i,s){i.prototype=Object.create(s.prototype),i.prototype.constructor=i,R(i,s)}function R(i,s){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(S,l){return S.__proto__=l,S},R(i,s)}var h=function(i){C(s,i);function s(){for(var S,l=arguments.length,g=new Array(l),f=0;f<l;f++)g[f]=arguments[f];return S=i.call.apply(i,[this].concat(g))||this,S.handleRefs={},S.lastHandleRect=null,S.slack=null,S}var d=s.prototype;return d.componentWillUnmount=function(){this.resetData()},d.resetData=function(){this.lastHandleRect=this.slack=null},d.runConstraints=function(l,g){var f=this.props,v=f.minConstraints,P=f.maxConstraints,U=f.lockAspectRatio;if(!v&&!P&&!U)return[l,g];if(U){var z=this.props.width/this.props.height,V=l-this.props.width,O=g-this.props.height;Math.abs(V)>Math.abs(O*z)?g=l/z:l=g*z}var x=l,W=g,X=this.slack||[0,0],Y=X[0],re=X[1];return l+=Y,g+=re,v&&(l=Math.max(v[0],l),g=Math.max(v[1],g)),P&&(l=Math.min(P[0],l),g=Math.min(P[1],g)),this.slack=[Y+(x-l),re+(W-g)],[l,g]},d.resizeHandler=function(l,g){var f=this;return function(v,P){var U=P.node,z=P.deltaX,V=P.deltaY;l==="onResizeStart"&&f.resetData();var O=(f.props.axis==="both"||f.props.axis==="x")&&g!=="n"&&g!=="s",x=(f.props.axis==="both"||f.props.axis==="y")&&g!=="e"&&g!=="w";if(!(!O&&!x)){var W=g[0],X=g[g.length-1],Y=U.getBoundingClientRect();if(f.lastHandleRect!=null){if(X==="w"){var re=Y.left-f.lastHandleRect.left;z+=re}if(W==="n"){var te=Y.top-f.lastHandleRect.top;V+=te}}f.lastHandleRect=Y,X==="w"&&(z=-z),W==="n"&&(V=-V);var F=f.props.width+(O?z/f.props.transformScale:0),H=f.props.height+(x?V/f.props.transformScale:0),oe=f.runConstraints(F,H);F=oe[0],H=oe[1];var se=F!==f.props.width||H!==f.props.height,ue=typeof f.props[l]=="function"?f.props[l]:null,ge=l==="onResize"&&!se;ue&&!ge&&(v.persist==null||v.persist(),ue(v,{node:U,size:{width:F,height:H},handle:g})),l==="onResizeStop"&&f.resetData()}}},d.renderResizeHandle=function(l,g){var f=this.props.handle;if(!f)return e.createElement("span",{className:"react-resizable-handle react-resizable-handle-"+l,ref:g});if(typeof f=="function")return f(l,g);var v=typeof f.type=="string",P=m({ref:g},v?{}:{handleAxis:l});return e.cloneElement(f,P)},d.render=function(){var l=this,g=this.props,f=g.children,v=g.className,P=g.draggableOpts;g.width,g.height,g.handle,g.handleSize,g.lockAspectRatio,g.axis,g.minConstraints,g.maxConstraints,g.onResize,g.onResizeStop,g.onResizeStart;var U=g.resizeHandles;g.transformScale;var z=p(g,a);return(0,r.cloneElement)(f,m(m({},z),{},{className:(v?v+" ":"")+"react-resizable",children:[].concat(f.props.children,U.map(function(V){var O,x=(O=l.handleRefs[V])!=null?O:l.handleRefs[V]=e.createRef();return e.createElement(t.DraggableCore,y({},P,{nodeRef:x,key:"resizableHandle-"+V,onStop:l.resizeHandler("onResizeStop",V),onStart:l.resizeHandler("onResizeStart",V),onDrag:l.resizeHandler("onResize",V)}),l.renderResizeHandle(V,x))}))}))},s}(e.Component);return rt.default=h,h.propTypes=n.resizableProps,h.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},rt}var ot={},Qn;function Jr(){if(Qn)return ot;Qn=1,ot.__esModule=!0,ot.default=void 0;var e=y(L),t=o(Ee()),r=o(Jn()),n=$n(),a=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(s){return s&&s.__esModule?s:{default:s}}function u(s){if(typeof WeakMap!="function")return null;var d=new WeakMap,S=new WeakMap;return(u=function(g){return g?S:d})(s)}function y(s,d){if(s&&s.__esModule)return s;if(s===null||typeof s!="object"&&typeof s!="function")return{default:s};var S=u(d);if(S&&S.has(s))return S.get(s);var l={},g=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var f in s)if(f!=="default"&&Object.prototype.hasOwnProperty.call(s,f)){var v=g?Object.getOwnPropertyDescriptor(s,f):null;v&&(v.get||v.set)?Object.defineProperty(l,f,v):l[f]=s[f]}return l.default=s,S&&S.set(s,l),l}function p(){return p=Object.assign?Object.assign.bind():function(s){for(var d=1;d<arguments.length;d++){var S=arguments[d];for(var l in S)Object.prototype.hasOwnProperty.call(S,l)&&(s[l]=S[l])}return s},p.apply(this,arguments)}function b(s,d){var S=Object.keys(s);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(s);d&&(l=l.filter(function(g){return Object.getOwnPropertyDescriptor(s,g).enumerable})),S.push.apply(S,l)}return S}function m(s){for(var d=1;d<arguments.length;d++){var S=arguments[d]!=null?arguments[d]:{};d%2?b(Object(S),!0).forEach(function(l){I(s,l,S[l])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(S)):b(Object(S)).forEach(function(l){Object.defineProperty(s,l,Object.getOwnPropertyDescriptor(S,l))})}return s}function I(s,d,S){return d=_(d),d in s?Object.defineProperty(s,d,{value:S,enumerable:!0,configurable:!0,writable:!0}):s[d]=S,s}function _(s){var d=w(s,"string");return typeof d=="symbol"?d:String(d)}function w(s,d){if(typeof s!="object"||s===null)return s;var S=s[Symbol.toPrimitive];if(S!==void 0){var l=S.call(s,d);if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(s)}function C(s,d){if(s==null)return{};var S={},l=Object.keys(s),g,f;for(f=0;f<l.length;f++)g=l[f],!(d.indexOf(g)>=0)&&(S[g]=s[g]);return S}function R(s,d){s.prototype=Object.create(d.prototype),s.prototype.constructor=s,h(s,d)}function h(s,d){return h=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(l,g){return l.__proto__=g,l},h(s,d)}var i=function(s){R(d,s);function d(){for(var l,g=arguments.length,f=new Array(g),v=0;v<g;v++)f[v]=arguments[v];return l=s.call.apply(s,[this].concat(f))||this,l.state={width:l.props.width,height:l.props.height,propsWidth:l.props.width,propsHeight:l.props.height},l.onResize=function(P,U){var z=U.size;l.props.onResize?(P.persist==null||P.persist(),l.setState(z,function(){return l.props.onResize&&l.props.onResize(P,U)})):l.setState(z)},l}d.getDerivedStateFromProps=function(g,f){return f.propsWidth!==g.width||f.propsHeight!==g.height?{width:g.width,height:g.height,propsWidth:g.width,propsHeight:g.height}:null};var S=d.prototype;return S.render=function(){var g=this.props,f=g.handle,v=g.handleSize;g.onResize;var P=g.onResizeStart,U=g.onResizeStop,z=g.draggableOpts,V=g.minConstraints,O=g.maxConstraints,x=g.lockAspectRatio,W=g.axis;g.width,g.height;var X=g.resizeHandles,Y=g.style,re=g.transformScale,te=C(g,a);return e.createElement(r.default,{axis:W,draggableOpts:z,handle:f,handleSize:v,height:this.state.height,lockAspectRatio:x,maxConstraints:O,minConstraints:V,onResizeStart:P,onResize:this.onResize,onResizeStop:U,resizeHandles:X,transformScale:re,width:this.state.width},e.createElement("div",p({},te,{style:m(m({},Y),{},{width:this.state.width+"px",height:this.state.height+"px"})})))},d}(e.Component);return ot.default=i,i.propTypes=m(m({},n.resizableProps),{},{children:t.default.element}),ot}var er;function Qr(){return er||(er=1,nt.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},nt.exports.Resizable=Jn().default,nt.exports.ResizableBox=Jr().default),nt.exports}var Re={},tr;function nr(){if(tr)return Re;tr=1,Object.defineProperty(Re,"__esModule",{value:!0}),Re.resizeHandleType=Re.resizeHandleAxesType=Re.default=void 0;var e=r(Ee()),t=r(L);function r(o){return o&&o.__esModule?o:{default:o}}const n=Re.resizeHandleAxesType=e.default.arrayOf(e.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),a=Re.resizeHandleType=e.default.oneOfType([e.default.node,e.default.func]);return Re.default={className:e.default.string,style:e.default.object,width:e.default.number,autoSize:e.default.bool,cols:e.default.number,draggableCancel:e.default.string,draggableHandle:e.default.string,verticalCompact:function(o){o.verticalCompact},compactType:e.default.oneOf(["vertical","horizontal"]),layout:function(o){var u=o.layout;u!==void 0&&ze().validateLayout(u,"layout")},margin:e.default.arrayOf(e.default.number),containerPadding:e.default.arrayOf(e.default.number),rowHeight:e.default.number,maxRows:e.default.number,isBounded:e.default.bool,isDraggable:e.default.bool,isResizable:e.default.bool,allowOverlap:e.default.bool,preventCollision:e.default.bool,useCSSTransforms:e.default.bool,transformScale:e.default.number,isDroppable:e.default.bool,resizeHandles:n,resizeHandle:a,onLayoutChange:e.default.func,onDragStart:e.default.func,onDrag:e.default.func,onDragStop:e.default.func,onResizeStart:e.default.func,onResize:e.default.func,onResizeStop:e.default.func,onDrop:e.default.func,droppingItem:e.default.shape({i:e.default.string.isRequired,w:e.default.number.isRequired,h:e.default.number.isRequired}),children:function(o,u){const y=o[u],p={};t.default.Children.forEach(y,function(b){if((b==null?void 0:b.key)!=null){if(p[b.key])throw new Error('Duplicate child key "'+b.key+'" found! This will cause problems in ReactGridLayout.');p[b.key]=!0}})},innerRef:e.default.any},Re}var rr;function ea(){if(rr)return Qe;rr=1,Object.defineProperty(Qe,"__esModule",{value:!0}),Qe.default=void 0;var e=p(L),t=p(Ee()),r=fn(),n=Qr(),a=ze(),o=on(),u=nr(),y=p(rn());function p(w){return w&&w.__esModule?w:{default:w}}function b(w,C,R){return C=m(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function m(w){var C=I(w,"string");return typeof C=="symbol"?C:String(C)}function I(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}let _=class extends e.default.Component{constructor(){super(...arguments),b(this,"state",{resizing:null,dragging:null,className:""}),b(this,"elementRef",e.default.createRef()),b(this,"onDragStart",(C,R)=>{let{node:h}=R;const{onDragStart:i,transformScale:s}=this.props;if(!i)return;const d={top:0,left:0},{offsetParent:S}=h;if(!S)return;const l=S.getBoundingClientRect(),g=h.getBoundingClientRect(),f=g.left/s,v=l.left/s,P=g.top/s,U=l.top/s;d.left=f-v+S.scrollLeft,d.top=P-U+S.scrollTop,this.setState({dragging:d});const{x:z,y:V}=(0,o.calcXY)(this.getPositionParams(),d.top,d.left,this.props.w,this.props.h);return i.call(this,this.props.i,z,V,{e:C,node:h,newPosition:d})}),b(this,"onDrag",(C,R)=>{let{node:h,deltaX:i,deltaY:s}=R;const{onDrag:d}=this.props;if(!d)return;if(!this.state.dragging)throw new Error("onDrag called before onDragStart.");let S=this.state.dragging.top+s,l=this.state.dragging.left+i;const{isBounded:g,i:f,w:v,h:P,containerWidth:U}=this.props,z=this.getPositionParams();if(g){const{offsetParent:W}=h;if(W){const{margin:X,rowHeight:Y,containerPadding:re}=this.props,te=W.clientHeight-(0,o.calcGridItemWHPx)(P,Y,X[1]);S=(0,o.clamp)(S-re[1],0,te);const F=(0,o.calcGridColWidth)(z),H=U-(0,o.calcGridItemWHPx)(v,F,X[0]);l=(0,o.clamp)(l-re[0],0,H)}}const V={top:S,left:l};this.setState({dragging:V});const{x:O,y:x}=(0,o.calcXY)(z,S,l,v,P);return d.call(this,f,O,x,{e:C,node:h,newPosition:V})}),b(this,"onDragStop",(C,R)=>{let{node:h}=R;const{onDragStop:i}=this.props;if(!i)return;if(!this.state.dragging)throw new Error("onDragEnd called before onDragStart.");const{w:s,h:d,i:S}=this.props,{left:l,top:g}=this.state.dragging,f={top:g,left:l};this.setState({dragging:null});const{x:v,y:P}=(0,o.calcXY)(this.getPositionParams(),g,l,s,d);return i.call(this,S,v,P,{e:C,node:h,newPosition:f})}),b(this,"onResizeStop",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStop")),b(this,"onResizeStart",(C,R,h)=>this.onResizeHandler(C,R,h,"onResizeStart")),b(this,"onResize",(C,R,h)=>this.onResizeHandler(C,R,h,"onResize"))}shouldComponentUpdate(C,R){if(this.props.children!==C.children||this.props.droppingPosition!==C.droppingPosition)return!0;const h=(0,o.calcGridItemPosition)(this.getPositionParams(this.props),this.props.x,this.props.y,this.props.w,this.props.h,this.state),i=(0,o.calcGridItemPosition)(this.getPositionParams(C),C.x,C.y,C.w,C.h,R);return!(0,a.fastPositionEqual)(h,i)||this.props.useCSSTransforms!==C.useCSSTransforms}componentDidMount(){this.moveDroppingItem({})}componentDidUpdate(C){this.moveDroppingItem(C)}moveDroppingItem(C){const{droppingPosition:R}=this.props;if(!R)return;const h=this.elementRef.current;if(!h)return;const i=C.droppingPosition||{left:0,top:0},{dragging:s}=this.state,d=s&&R.left!==i.left||R.top!==i.top;if(!s)this.onDragStart(R.e,{node:h,deltaX:R.left,deltaY:R.top});else if(d){const S=R.left-s.left,l=R.top-s.top;this.onDrag(R.e,{node:h,deltaX:S,deltaY:l})}}getPositionParams(){let C=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.props;return{cols:C.cols,containerPadding:C.containerPadding,containerWidth:C.containerWidth,margin:C.margin,maxRows:C.maxRows,rowHeight:C.rowHeight}}createStyle(C){const{usePercentages:R,containerWidth:h,useCSSTransforms:i}=this.props;let s;return i?s=(0,a.setTransform)(C):(s=(0,a.setTopLeft)(C),R&&(s.left=(0,a.perc)(C.left/h),s.width=(0,a.perc)(C.width/h))),s}mixinDraggable(C,R){return e.default.createElement(r.DraggableCore,{disabled:!R,onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop,handle:this.props.handle,cancel:".react-resizable-handle"+(this.props.cancel?","+this.props.cancel:""),scale:this.props.transformScale,nodeRef:this.elementRef},C)}curryResizeHandler(C,R){return(h,i)=>R(h,i,C)}mixinResizable(C,R,h){const{cols:i,minW:s,minH:d,maxW:S,maxH:l,transformScale:g,resizeHandles:f,resizeHandle:v}=this.props,P=this.getPositionParams(),U=(0,o.calcGridItemPosition)(P,0,0,i,0).width,z=(0,o.calcGridItemPosition)(P,0,0,s,d),V=(0,o.calcGridItemPosition)(P,0,0,S,l),O=[z.width,z.height],x=[Math.min(V.width,U),Math.min(V.height,1/0)];return e.default.createElement(n.Resizable,{draggableOpts:{disabled:!h},className:h?void 0:"react-resizable-hide",width:R.width,height:R.height,minConstraints:O,maxConstraints:x,onResizeStop:this.curryResizeHandler(R,this.onResizeStop),onResizeStart:this.curryResizeHandler(R,this.onResizeStart),onResize:this.curryResizeHandler(R,this.onResize),transformScale:g,resizeHandles:f,handle:v},C)}onResizeHandler(C,R,h,i){let{node:s,size:d,handle:S}=R;const l=this.props[i];if(!l)return;const{x:g,y:f,i:v,maxH:P,minH:U,containerWidth:z}=this.props,{minW:V,maxW:O}=this.props;let x=d;s&&(x=(0,a.resizeItemInDirection)(S,h,d,z),this.setState({resizing:i==="onResizeStop"?null:x}));let{w:W,h:X}=(0,o.calcWH)(this.getPositionParams(),x.width,x.height,g,f,S);W=(0,o.clamp)(W,Math.max(V,1),O),X=(0,o.clamp)(X,U,P),l.call(this,v,W,X,{e:C,node:s,size:x,handle:S})}render(){const{x:C,y:R,w:h,h:i,isDraggable:s,isResizable:d,droppingPosition:S,useCSSTransforms:l}=this.props,g=(0,o.calcGridItemPosition)(this.getPositionParams(),C,R,h,i,this.state),f=e.default.Children.only(this.props.children);let v=e.default.cloneElement(f,{ref:this.elementRef,className:(0,y.default)("react-grid-item",f.props.className,this.props.className,{static:this.props.static,resizing:!!this.state.resizing,"react-draggable":s,"react-draggable-dragging":!!this.state.dragging,dropping:!!S,cssTransforms:l}),style:{...this.props.style,...f.props.style,...this.createStyle(g)}});return v=this.mixinResizable(v,g,d),v=this.mixinDraggable(v,s),v}};return Qe.default=_,b(_,"propTypes",{children:t.default.element,cols:t.default.number.isRequired,containerWidth:t.default.number.isRequired,rowHeight:t.default.number.isRequired,margin:t.default.array.isRequired,maxRows:t.default.number.isRequired,containerPadding:t.default.array.isRequired,x:t.default.number.isRequired,y:t.default.number.isRequired,w:t.default.number.isRequired,h:t.default.number.isRequired,minW:function(w,C){const R=w[C];if(typeof R!="number")return new Error("minWidth not Number");if(R>w.w||R>w.maxW)return new Error("minWidth larger than item width/maxWidth")},maxW:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxWidth not Number");if(R<w.w||R<w.minW)return new Error("maxWidth smaller than item width/minWidth")},minH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("minHeight not Number");if(R>w.h||R>w.maxH)return new Error("minHeight larger than item height/maxHeight")},maxH:function(w,C){const R=w[C];if(typeof R!="number")return new Error("maxHeight not Number");if(R<w.h||R<w.minH)return new Error("maxHeight smaller than item height/minHeight")},i:t.default.string.isRequired,resizeHandles:u.resizeHandleAxesType,resizeHandle:u.resizeHandleType,onDragStop:t.default.func,onDragStart:t.default.func,onDrag:t.default.func,onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,isDraggable:t.default.bool.isRequired,isResizable:t.default.bool.isRequired,isBounded:t.default.bool.isRequired,static:t.default.bool,useCSSTransforms:t.default.bool.isRequired,transformScale:t.default.number,className:t.default.string,handle:t.default.string,cancel:t.default.string,droppingPosition:t.default.shape({e:t.default.object.isRequired,left:t.default.number.isRequired,top:t.default.number.isRequired})}),b(_,"defaultProps",{className:"",cancel:"",handle:"",minH:1,minW:1,maxH:1/0,maxW:1/0,transformScale:1}),Qe}var ar;function or(){if(ar)return Ze;ar=1,Object.defineProperty(Ze,"__esModule",{value:!0}),Ze.default=void 0;var e=b(L),t=nn(),r=y(rn()),n=ze(),a=on(),o=y(ea()),u=y(nr());function y(h){return h&&h.__esModule?h:{default:h}}function p(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(p=function(d){return d?s:i})(h)}function b(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=p(i);if(s&&s.has(h))return s.get(h);var d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w="react-grid-layout";let C=!1;try{C=/firefox/i.test(navigator.userAgent)}catch{}let R=class extends e.Component{constructor(){super(...arguments),m(this,"state",{activeDrag:null,layout:(0,n.synchronizeLayoutWithChildren)(this.props.layout,this.props.children,this.props.cols,(0,n.compactType)(this.props),this.props.allowOverlap),mounted:!1,oldDragItem:null,oldLayout:null,oldResizeItem:null,resizing:!1,droppingDOMNode:null,children:[]}),m(this,"dragEnterCounter",0),m(this,"onDragStart",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);if(!v)return;const P={w:v.w,h:v.h,x:v.x,y:v.y,placeholder:!0,i};return this.setState({oldDragItem:(0,n.cloneLayoutItem)(v),oldLayout:f,activeDrag:P}),this.props.onDragStart(f,v,v,null,l,g)}),m(this,"onDrag",(i,s,d,S)=>{let{e:l,node:g}=S;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,allowOverlap:U,preventCollision:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;const O={w:V.w,h:V.h,x:V.x,y:V.y,placeholder:!0,i};v=(0,n.moveElement)(v,V,s,d,!0,z,(0,n.compactType)(this.props),P,U),this.props.onDrag(v,f,V,O,l,g),this.setState({layout:U?v:(0,n.compact)(v,(0,n.compactType)(this.props),P),activeDrag:O})}),m(this,"onDragStop",(i,s,d,S)=>{let{e:l,node:g}=S;if(!this.state.activeDrag)return;const{oldDragItem:f}=this.state;let{layout:v}=this.state;const{cols:P,preventCollision:U,allowOverlap:z}=this.props,V=(0,n.getLayoutItem)(v,i);if(!V)return;v=(0,n.moveElement)(v,V,s,d,!0,U,(0,n.compactType)(this.props),P,z);const x=z?v:(0,n.compact)(v,(0,n.compactType)(this.props),P);this.props.onDragStop(x,f,V,null,l,g);const{oldLayout:W}=this.state;this.setState({activeDrag:null,layout:x,oldDragItem:null,oldLayout:null}),this.onLayoutMaybeChanged(x,W)}),m(this,"onResizeStart",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f}=this.state,v=(0,n.getLayoutItem)(f,i);v&&(this.setState({oldResizeItem:(0,n.cloneLayoutItem)(v),oldLayout:this.state.layout,resizing:!0}),this.props.onResizeStart(f,v,v,null,l,g))}),m(this,"onResize",(i,s,d,S)=>{let{e:l,node:g,size:f,handle:v}=S;const{oldResizeItem:P}=this.state,{layout:U}=this.state,{cols:z,preventCollision:V,allowOverlap:O}=this.props;let x=!1,W,X,Y;const[re,te]=(0,n.withLayoutItem)(U,i,H=>{let oe;return X=H.x,Y=H.y,["sw","w","nw","n","ne"].indexOf(v)!==-1&&(["sw","nw","w"].indexOf(v)!==-1&&(X=H.x+(H.w-s),s=H.x!==X&&X<0?H.w:s,X=X<0?0:X),["ne","n","nw"].indexOf(v)!==-1&&(Y=H.y+(H.h-d),d=H.y!==Y&&Y<0?H.h:d,Y=Y<0?0:Y),x=!0),V&&!O&&(oe=(0,n.getAllCollisions)(U,{...H,w:s,h:d,x:X,y:Y}).filter(ue=>ue.i!==H.i).length>0,oe&&(Y=H.y,d=H.h,X=H.x,s=H.w,x=!1)),H.w=s,H.h=d,H});if(!te)return;W=re,x&&(W=(0,n.moveElement)(re,te,X,Y,!0,this.props.preventCollision,(0,n.compactType)(this.props),z,O));const F={w:te.w,h:te.h,x:te.x,y:te.y,static:!0,i};this.props.onResize(W,P,te,F,l,g),this.setState({layout:O?W:(0,n.compact)(W,(0,n.compactType)(this.props),z),activeDrag:F})}),m(this,"onResizeStop",(i,s,d,S)=>{let{e:l,node:g}=S;const{layout:f,oldResizeItem:v}=this.state,{cols:P,allowOverlap:U}=this.props,z=(0,n.getLayoutItem)(f,i),V=U?f:(0,n.compact)(f,(0,n.compactType)(this.props),P);this.props.onResizeStop(V,v,z,null,l,g);const{oldLayout:O}=this.state;this.setState({activeDrag:null,layout:V,oldResizeItem:null,oldLayout:null,resizing:!1}),this.onLayoutMaybeChanged(V,O)}),m(this,"onDragOver",i=>{var re;if(i.preventDefault(),i.stopPropagation(),C&&!((re=i.nativeEvent.target)!=null&&re.classList.contains(w)))return!1;const{droppingItem:s,onDropDragOver:d,margin:S,cols:l,rowHeight:g,maxRows:f,width:v,containerPadding:P,transformScale:U}=this.props,z=d==null?void 0:d(i);if(z===!1)return this.state.droppingDOMNode&&this.removeDroppingPlaceholder(),!1;const V={...s,...z},{layout:O}=this.state,x=i.currentTarget.getBoundingClientRect(),W=i.clientX-x.left,X=i.clientY-x.top,Y={left:W/U,top:X/U,e:i};if(this.state.droppingDOMNode){if(this.state.droppingPosition){const{left:te,top:F}=this.state.droppingPosition;(te!=W||F!=X)&&this.setState({droppingPosition:Y})}}else{const te={cols:l,margin:S,maxRows:f,rowHeight:g,containerWidth:v,containerPadding:P||S},F=(0,a.calcXY)(te,X,W,V.w,V.h);this.setState({droppingDOMNode:e.createElement("div",{key:V.i}),droppingPosition:Y,layout:[...O,{...V,x:F.x,y:F.y,static:!1,isDraggable:!0}]})}}),m(this,"removeDroppingPlaceholder",()=>{const{droppingItem:i,cols:s}=this.props,{layout:d}=this.state,S=(0,n.compact)(d.filter(l=>l.i!==i.i),(0,n.compactType)(this.props),s,this.props.allowOverlap);this.setState({layout:S,droppingDOMNode:null,activeDrag:null,droppingPosition:void 0})}),m(this,"onDragLeave",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter--,this.dragEnterCounter===0&&this.removeDroppingPlaceholder()}),m(this,"onDragEnter",i=>{i.preventDefault(),i.stopPropagation(),this.dragEnterCounter++}),m(this,"onDrop",i=>{i.preventDefault(),i.stopPropagation();const{droppingItem:s}=this.props,{layout:d}=this.state,S=d.find(l=>l.i===s.i);this.dragEnterCounter=0,this.removeDroppingPlaceholder(),this.props.onDrop(d,S,i)})}componentDidMount(){this.setState({mounted:!0}),this.onLayoutMaybeChanged(this.state.layout,this.props.layout)}static getDerivedStateFromProps(i,s){let d;return s.activeDrag?null:(!(0,t.deepEqual)(i.layout,s.propsLayout)||i.compactType!==s.compactType?d=i.layout:(0,n.childrenEqual)(i.children,s.children)||(d=s.layout),d?{layout:(0,n.synchronizeLayoutWithChildren)(d,i.children,i.cols,(0,n.compactType)(i),i.allowOverlap),compactType:i.compactType,children:i.children,propsLayout:i.layout}:null)}shouldComponentUpdate(i,s){return this.props.children!==i.children||!(0,n.fastRGLPropsEqual)(this.props,i,t.deepEqual)||this.state.activeDrag!==s.activeDrag||this.state.mounted!==s.mounted||this.state.droppingPosition!==s.droppingPosition}componentDidUpdate(i,s){if(!this.state.activeDrag){const d=this.state.layout,S=s.layout;this.onLayoutMaybeChanged(d,S)}}containerHeight(){if(!this.props.autoSize)return;const i=(0,n.bottom)(this.state.layout),s=this.props.containerPadding?this.props.containerPadding[1]:this.props.margin[1];return i*this.props.rowHeight+(i-1)*this.props.margin[1]+s*2+"px"}onLayoutMaybeChanged(i,s){s||(s=this.state.layout),(0,t.deepEqual)(s,i)||this.props.onLayoutChange(i)}placeholder(){const{activeDrag:i}=this.state;if(!i)return null;const{width:s,cols:d,margin:S,containerPadding:l,rowHeight:g,maxRows:f,useCSSTransforms:v,transformScale:P}=this.props;return e.createElement(o.default,{w:i.w,h:i.h,x:i.x,y:i.y,i:i.i,className:`react-grid-placeholder ${this.state.resizing?"placeholder-resizing":""}`,containerWidth:s,cols:d,margin:S,containerPadding:l||S,maxRows:f,rowHeight:g,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:v,transformScale:P},e.createElement("div",null))}processGridItem(i,s){if(!i||!i.key)return;const d=(0,n.getLayoutItem)(this.state.layout,String(i.key));if(!d)return null;const{width:S,cols:l,margin:g,containerPadding:f,rowHeight:v,maxRows:P,isDraggable:U,isResizable:z,isBounded:V,useCSSTransforms:O,transformScale:x,draggableCancel:W,draggableHandle:X,resizeHandles:Y,resizeHandle:re}=this.props,{mounted:te,droppingPosition:F}=this.state,H=typeof d.isDraggable=="boolean"?d.isDraggable:!d.static&&U,oe=typeof d.isResizable=="boolean"?d.isResizable:!d.static&&z,se=d.resizeHandles||Y,ue=H&&V&&d.isBounded!==!1;return e.createElement(o.default,{containerWidth:S,cols:l,margin:g,containerPadding:f||g,maxRows:P,rowHeight:v,cancel:W,handle:X,onDragStop:this.onDragStop,onDragStart:this.onDragStart,onDrag:this.onDrag,onResizeStart:this.onResizeStart,onResize:this.onResize,onResizeStop:this.onResizeStop,isDraggable:H,isResizable:oe,isBounded:ue,useCSSTransforms:O&&te,usePercentages:!te,transformScale:x,w:d.w,h:d.h,x:d.x,y:d.y,i:d.i,minH:d.minH,minW:d.minW,maxH:d.maxH,maxW:d.maxW,static:d.static,droppingPosition:s?F:void 0,resizeHandles:se,resizeHandle:re},i)}render(){const{className:i,style:s,isDroppable:d,innerRef:S}=this.props,l=(0,r.default)(w,i),g={height:this.containerHeight(),...s};return e.createElement("div",{ref:S,className:l,style:g,onDrop:d?this.onDrop:n.noop,onDragLeave:d?this.onDragLeave:n.noop,onDragEnter:d?this.onDragEnter:n.noop,onDragOver:d?this.onDragOver:n.noop},e.Children.map(this.props.children,f=>this.processGridItem(f)),d&&this.state.droppingDOMNode&&this.processGridItem(this.state.droppingDOMNode,!0),this.placeholder())}};return Ze.default=R,m(R,"displayName","ReactGridLayout"),m(R,"propTypes",u.default),m(R,"defaultProps",{autoSize:!0,cols:12,className:"",style:{},draggableHandle:"",draggableCancel:"",containerPadding:null,rowHeight:150,maxRows:1/0,layout:[],margin:[10,10],isBounded:!1,isDraggable:!0,isResizable:!0,allowOverlap:!1,isDroppable:!1,useCSSTransforms:!0,transformScale:1,verticalCompact:!0,compactType:"vertical",preventCollision:!1,droppingItem:{i:"__dropping-elem__",h:1,w:1},resizeHandles:["se"],onLayoutChange:n.noop,onDragStart:n.noop,onDrag:n.noop,onDragStop:n.noop,onResizeStart:n.noop,onResize:n.noop,onResizeStop:n.noop,onDrop:n.noop,onDropDragOver:n.noop}),Ze}var it={},Pe={},ir;function sr(){if(ir)return Pe;ir=1,Object.defineProperty(Pe,"__esModule",{value:!0}),Pe.findOrGenerateResponsiveLayout=n,Pe.getBreakpointFromWidth=t,Pe.getColsFromBreakpoint=r,Pe.sortBreakpoints=a;var e=ze();function t(o,u){const y=a(o);let p=y[0];for(let b=1,m=y.length;b<m;b++){const I=y[b];u>o[I]&&(p=I)}return p}function r(o,u){if(!u[o])throw new Error("ResponsiveReactGridLayout: `cols` entry for breakpoint "+o+" is missing!");return u[o]}function n(o,u,y,p,b,m){if(o[y])return(0,e.cloneLayout)(o[y]);let I=o[p];const _=a(u),w=_.slice(_.indexOf(y));for(let C=0,R=w.length;C<R;C++){const h=w[C];if(o[h]){I=o[h];break}}return I=(0,e.cloneLayout)(I||[]),(0,e.compact)((0,e.correctBounds)(I,{cols:b}),m,b)}function a(o){return Object.keys(o).sort(function(y,p){return o[y]-o[p]})}return Pe}var lr;function ta(){if(lr)return it;lr=1,Object.defineProperty(it,"__esModule",{value:!0}),it.default=void 0;var e=p(L),t=u(Ee()),r=nn(),n=ze(),a=sr(),o=u(or());function u(h){return h&&h.__esModule?h:{default:h}}function y(h){if(typeof WeakMap!="function")return null;var i=new WeakMap,s=new WeakMap;return(y=function(d){return d?s:i})(h)}function p(h,i){if(h&&h.__esModule)return h;if(h===null||typeof h!="object"&&typeof h!="function")return{default:h};var s=y(i);if(s&&s.has(h))return s.get(h);var d={__proto__:null},S=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in h)if(l!=="default"&&Object.prototype.hasOwnProperty.call(h,l)){var g=S?Object.getOwnPropertyDescriptor(h,l):null;g&&(g.get||g.set)?Object.defineProperty(d,l,g):d[l]=h[l]}return d.default=h,s&&s.set(h,d),d}function b(){return b=Object.assign?Object.assign.bind():function(h){for(var i=1;i<arguments.length;i++){var s=arguments[i];for(var d in s)Object.prototype.hasOwnProperty.call(s,d)&&(h[d]=s[d])}return h},b.apply(this,arguments)}function m(h,i,s){return i=I(i),i in h?Object.defineProperty(h,i,{value:s,enumerable:!0,configurable:!0,writable:!0}):h[i]=s,h}function I(h){var i=_(h,"string");return typeof i=="symbol"?i:String(i)}function _(h,i){if(typeof h!="object"||h===null)return h;var s=h[Symbol.toPrimitive];if(s!==void 0){var d=s.call(h,i);if(typeof d!="object")return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(h)}const w=h=>Object.prototype.toString.call(h);function C(h,i){return h==null?null:Array.isArray(h)?h:h[i]}let R=class extends e.Component{constructor(){super(...arguments),m(this,"state",this.generateInitialState()),m(this,"onLayoutChange",i=>{this.props.onLayoutChange(i,{...this.props.layouts,[this.state.breakpoint]:i})})}generateInitialState(){const{width:i,breakpoints:s,layouts:d,cols:S}=this.props,l=(0,a.getBreakpointFromWidth)(s,i),g=(0,a.getColsFromBreakpoint)(l,S),f=this.props.verticalCompact===!1?null:this.props.compactType;return{layout:(0,a.findOrGenerateResponsiveLayout)(d,s,l,l,g,f),breakpoint:l,cols:g}}static getDerivedStateFromProps(i,s){if(!(0,r.deepEqual)(i.layouts,s.layouts)){const{breakpoint:d,cols:S}=s;return{layout:(0,a.findOrGenerateResponsiveLayout)(i.layouts,i.breakpoints,d,d,S,i.compactType),layouts:i.layouts}}return null}componentDidUpdate(i){(this.props.width!=i.width||this.props.breakpoint!==i.breakpoint||!(0,r.deepEqual)(this.props.breakpoints,i.breakpoints)||!(0,r.deepEqual)(this.props.cols,i.cols))&&this.onWidthChange(i)}onWidthChange(i){const{breakpoints:s,cols:d,layouts:S,compactType:l}=this.props,g=this.props.breakpoint||(0,a.getBreakpointFromWidth)(this.props.breakpoints,this.props.width),f=this.state.breakpoint,v=(0,a.getColsFromBreakpoint)(g,d),P={...S};if(f!==g||i.breakpoints!==s||i.cols!==d){f in P||(P[f]=(0,n.cloneLayout)(this.state.layout));let V=(0,a.findOrGenerateResponsiveLayout)(P,s,g,f,v,l);V=(0,n.synchronizeLayoutWithChildren)(V,this.props.children,v,l,this.props.allowOverlap),P[g]=V,this.props.onBreakpointChange(g,v),this.props.onLayoutChange(V,P),this.setState({breakpoint:g,layout:V,cols:v})}const U=C(this.props.margin,g),z=C(this.props.containerPadding,g);this.props.onWidthChange(this.props.width,U,v,z)}render(){const{breakpoint:i,breakpoints:s,cols:d,layouts:S,margin:l,containerPadding:g,onBreakpointChange:f,onLayoutChange:v,onWidthChange:P,...U}=this.props;return e.createElement(o.default,b({},U,{margin:C(l,this.state.breakpoint),containerPadding:C(g,this.state.breakpoint),onLayoutChange:this.onLayoutChange,layout:this.state.layout,cols:this.state.cols}))}};return it.default=R,m(R,"propTypes",{breakpoint:t.default.string,breakpoints:t.default.object,allowOverlap:t.default.bool,cols:t.default.object,margin:t.default.oneOfType([t.default.array,t.default.object]),containerPadding:t.default.oneOfType([t.default.array,t.default.object]),layouts(h,i){if(w(h[i])!=="[object Object]")throw new Error("Layout property must be an object. Received: "+w(h[i]));Object.keys(h[i]).forEach(s=>{if(!(s in h.breakpoints))throw new Error("Each key in layouts must align with a key in breakpoints.");(0,n.validateLayout)(h.layouts[s],"layouts."+s)})},width:t.default.number.isRequired,onBreakpointChange:t.default.func,onLayoutChange:t.default.func,onWidthChange:t.default.func}),m(R,"defaultProps",{breakpoints:{lg:1200,md:996,sm:768,xs:480,xxs:0},cols:{lg:12,md:10,sm:6,xs:4,xxs:2},containerPadding:{lg:null,md:null,sm:null,xs:null,xxs:null},layouts:{},margin:[10,10],allowOverlap:!1,onBreakpointChange:n.noop,onLayoutChange:n.noop,onWidthChange:n.noop}),it}var Et={},cr=function(){if(typeof Map<"u")return Map;function e(t,r){var n=-1;return t.some(function(a,o){return a[0]===r?(n=o,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(r){var n=e(this.__entries__,r),a=this.__entries__[n];return a&&a[1]},t.prototype.set=function(r,n){var a=e(this.__entries__,r);~a?this.__entries__[a][1]=n:this.__entries__.push([r,n])},t.prototype.delete=function(r){var n=this.__entries__,a=e(n,r);~a&&n.splice(a,1)},t.prototype.has=function(r){return!!~e(this.__entries__,r)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(r,n){n===void 0&&(n=null);for(var a=0,o=this.__entries__;a<o.length;a++){var u=o[a];r.call(n,u[1],u[0])}},t}()}(),pn=typeof window<"u"&&typeof document<"u"&&window.document===document,Ot=function(){return typeof global<"u"&&global.Math===Math?global:typeof self<"u"&&self.Math===Math?self:typeof window<"u"&&window.Math===Math?window:Function("return this")()}(),na=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(Ot):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)}}(),ra=2;function aa(e,t){var r=!1,n=!1,a=0;function o(){r&&(r=!1,e()),n&&y()}function u(){na(o)}function y(){var p=Date.now();if(r){if(p-a<ra)return;n=!0}else r=!0,n=!1,setTimeout(u,t);a=p}return y}var oa=20,ia=["top","right","bottom","left","width","height","size","weight"],sa=typeof MutationObserver<"u",la=function(){function e(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=aa(this.refresh.bind(this),oa)}return e.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},e.prototype.removeObserver=function(t){var r=this.observers_,n=r.indexOf(t);~n&&r.splice(n,1),!r.length&&this.connected_&&this.disconnect_()},e.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},e.prototype.updateObservers_=function(){var t=this.observers_.filter(function(r){return r.gatherActive(),r.hasActive()});return t.forEach(function(r){return r.broadcastActive()}),t.length>0},e.prototype.connect_=function(){!pn||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),sa?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},e.prototype.disconnect_=function(){!pn||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},e.prototype.onTransitionEnd_=function(t){var r=t.propertyName,n=r===void 0?"":r,a=ia.some(function(o){return!!~n.indexOf(o)});a&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),ur=function(e,t){for(var r=0,n=Object.keys(t);r<n.length;r++){var a=n[r];Object.defineProperty(e,a,{value:t[a],enumerable:!1,writable:!1,configurable:!0})}return e},ke=function(e){var t=e&&e.ownerDocument&&e.ownerDocument.defaultView;return t||Ot},dr=Dt(0,0,0,0);function Mt(e){return parseFloat(e)||0}function fr(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return t.reduce(function(n,a){var o=e["border-"+a+"-width"];return n+Mt(o)},0)}function ca(e){for(var t=["top","right","bottom","left"],r={},n=0,a=t;n<a.length;n++){var o=a[n],u=e["padding-"+o];r[o]=Mt(u)}return r}function ua(e){var t=e.getBBox();return Dt(0,0,t.width,t.height)}function da(e){var t=e.clientWidth,r=e.clientHeight;if(!t&&!r)return dr;var n=ke(e).getComputedStyle(e),a=ca(n),o=a.left+a.right,u=a.top+a.bottom,y=Mt(n.width),p=Mt(n.height);if(n.boxSizing==="border-box"&&(Math.round(y+o)!==t&&(y-=fr(n,"left","right")+o),Math.round(p+u)!==r&&(p-=fr(n,"top","bottom")+u)),!pa(e)){var b=Math.round(y+o)-t,m=Math.round(p+u)-r;Math.abs(b)!==1&&(y-=b),Math.abs(m)!==1&&(p-=m)}return Dt(a.left,a.top,y,p)}var fa=function(){return typeof SVGGraphicsElement<"u"?function(e){return e instanceof ke(e).SVGGraphicsElement}:function(e){return e instanceof ke(e).SVGElement&&typeof e.getBBox=="function"}}();function pa(e){return e===ke(e).document.documentElement}function ha(e){return pn?fa(e)?ua(e):da(e):dr}function ga(e){var t=e.x,r=e.y,n=e.width,a=e.height,o=typeof DOMRectReadOnly<"u"?DOMRectReadOnly:Object,u=Object.create(o.prototype);return ur(u,{x:t,y:r,width:n,height:a,top:r,right:t+n,bottom:a+r,left:t}),u}function Dt(e,t,r,n){return{x:e,y:t,width:r,height:n}}var va=function(){function e(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=Dt(0,0,0,0),this.target=t}return e.prototype.isActive=function(){var t=ha(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},e.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},e}(),ma=function(){function e(t,r){var n=ga(r);ur(this,{target:t,contentRect:n})}return e}(),ya=function(){function e(t,r,n){if(this.activeObservations_=[],this.observations_=new cr,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=r,this.callbackCtx_=n}return e.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)||(r.set(t,new va(t)),this.controller_.addObserver(this),this.controller_.refresh())}},e.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element>"u"||!(Element instanceof Object))){if(!(t instanceof ke(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var r=this.observations_;r.has(t)&&(r.delete(t),r.size||this.controller_.removeObserver(this))}},e.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},e.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(r){r.isActive()&&t.activeObservations_.push(r)})},e.prototype.broadcastActive=function(){if(this.hasActive()){var t=this.callbackCtx_,r=this.activeObservations_.map(function(n){return new ma(n.target,n.broadcastRect())});this.callback_.call(t,r,t),this.clearActive()}},e.prototype.clearActive=function(){this.activeObservations_.splice(0)},e.prototype.hasActive=function(){return this.activeObservations_.length>0},e}(),pr=typeof WeakMap<"u"?new WeakMap:new cr,hr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var r=la.getInstance(),n=new ya(t,r,this);pr.set(this,n)}return e}();["observe","unobserve","disconnect"].forEach(function(e){hr.prototype[e]=function(){var t;return(t=pr.get(this))[e].apply(t,arguments)}});var Sa=function(){return typeof Ot.ResizeObserver<"u"?Ot.ResizeObserver:hr}();const ba=En(Object.freeze(Object.defineProperty({__proto__:null,default:Sa},Symbol.toStringTag,{value:"Module"})));var gr;function Ca(){if(gr)return Et;gr=1,Object.defineProperty(Et,"__esModule",{value:!0}),Et.default=_;var e=u(L),t=a(Ee()),r=a(ba),n=a(rn());function a(w){return w&&w.__esModule?w:{default:w}}function o(w){if(typeof WeakMap!="function")return null;var C=new WeakMap,R=new WeakMap;return(o=function(h){return h?R:C})(w)}function u(w,C){if(w&&w.__esModule)return w;if(w===null||typeof w!="object"&&typeof w!="function")return{default:w};var R=o(C);if(R&&R.has(w))return R.get(w);var h={__proto__:null},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in w)if(s!=="default"&&Object.prototype.hasOwnProperty.call(w,s)){var d=i?Object.getOwnPropertyDescriptor(w,s):null;d&&(d.get||d.set)?Object.defineProperty(h,s,d):h[s]=w[s]}return h.default=w,R&&R.set(w,h),h}function y(){return y=Object.assign?Object.assign.bind():function(w){for(var C=1;C<arguments.length;C++){var R=arguments[C];for(var h in R)Object.prototype.hasOwnProperty.call(R,h)&&(w[h]=R[h])}return w},y.apply(this,arguments)}function p(w,C,R){return C=b(C),C in w?Object.defineProperty(w,C,{value:R,enumerable:!0,configurable:!0,writable:!0}):w[C]=R,w}function b(w){var C=m(w,"string");return typeof C=="symbol"?C:String(C)}function m(w,C){if(typeof w!="object"||w===null)return w;var R=w[Symbol.toPrimitive];if(R!==void 0){var h=R.call(w,C);if(typeof h!="object")return h;throw new TypeError("@@toPrimitive must return a primitive value.")}return(C==="string"?String:Number)(w)}const I="react-grid-layout";function _(w){var C;return C=class extends e.Component{constructor(){super(...arguments),p(this,"state",{width:1280}),p(this,"elementRef",e.createRef()),p(this,"mounted",!1),p(this,"resizeObserver",void 0)}componentDidMount(){this.mounted=!0,this.resizeObserver=new r.default(i=>{if(this.elementRef.current instanceof HTMLElement){const d=i[0].contentRect.width;this.setState({width:d})}});const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.observe(h)}componentWillUnmount(){this.mounted=!1;const h=this.elementRef.current;h instanceof HTMLElement&&this.resizeObserver.unobserve(h),this.resizeObserver.disconnect()}render(){const{measureBeforeMount:h,...i}=this.props;return h&&!this.mounted?e.createElement("div",{className:(0,n.default)(this.props.className,I),style:this.props.style,ref:this.elementRef}):e.createElement(w,y({innerRef:this.elementRef},i,this.state))}},p(C,"defaultProps",{measureBeforeMount:!1}),p(C,"propTypes",{measureBeforeMount:t.default.bool}),C}return Et}var vr;function Ta(){return vr||(vr=1,function(e){e.exports=or().default,e.exports.utils=ze(),e.exports.calculateUtils=on(),e.exports.Responsive=ta().default,e.exports.Responsive.utils=sr(),e.exports.WidthProvider=Ca().default}(tn)),tn.exports}var Ia=Ta();const wa=Hr(Ia);var Ra=Object.getOwnPropertyDescriptor,_a=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ra(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Ea=(e,t)=>(r,n)=>t(r,n,e);let Ae=class extends T.Disposable{constructor(t){super();De(this,"_initLocal",()=>{});De(this,"_findReplaceIndex",t=>{const r=/\{([^}]+)?\}/g,n=[];let a=r.exec(t);for(;a;)n.push({startIndex:a.index,key:Number(a[1]),endIndex:a.index+a[0].length-1}),a=r.exec(t);return n});this._localeService=t,this._initLocal()}tWithReactNode(t,...r){const n=this._localeService.getLocales(),a=t.split("."),o=n&&this._localeService.resolveKeyPath(n,a);if(typeof o=="string"){const u=[];return this._findReplaceIndex(o).forEach((y,p,b)=>{const m=b[p-1]||{endIndex:-1};if(m.endIndex+1<y.startIndex){const I=o.slice(m.endIndex+1,y.startIndex);I&&u.push(I)}if(r[y.key]&&u.push(r[y.key]),p===b.length-1){const I=o.slice(y.endIndex+1);I&&u.push(I)}}),u}return[]}};Ae=_a([Ea(0,T.Inject(T.LocaleService))],Ae);const Pt={cfPreview:"univer-cf-preview"},We=e=>{var a,o;const t=e.rule;if(!t)return null;const r=L.useMemo(()=>{if(t.type===c.CFRuleType.colorScale){const u=t.config.map((b,m)=>({color:new T.ColorKit(b.color),value:m})),y=u.length-1;return new Array(5).fill("").map((b,m,I)=>m*y/(I.length-1)).map(b=>c.getColorScaleFromValue(u,b))}return null},[t]),n=L.useMemo(()=>{if(t.type===c.CFRuleType.iconSet)return t.config.map(u=>{const y=c.iconMap[u.iconType];return y&&y[Number(u.iconId)]})},[t]);switch(t.type){case c.CFRuleType.dataBar:{const{isGradient:u}=t.config,y={width:"50%",height:"100%"},p=u?`linear-gradient(to right, ${t.config.positiveColor||c.defaultDataBarPositiveColor}, rgb(255 255 255))`:t.config.positiveColor,b=u?`linear-gradient(to right, rgb(255 255 255),${t.config.nativeColor||c.defaultDataBarNativeColor})`:t.config.nativeColor;return E.jsxs("div",{className:Pt.cfPreview,children:[E.jsx("div",{style:{...y,background:b,border:`1px solid ${t.config.nativeColor||c.defaultDataBarNativeColor}`}}),E.jsx("div",{style:{...y,background:p,border:`1px solid ${t.config.positiveColor||c.defaultDataBarPositiveColor}`}})]})}case c.CFRuleType.colorScale:return r&&E.jsx("div",{className:Pt.cfPreview,children:r.map((u,y)=>E.jsx("div",{style:{width:`${100/r.length}%`,height:"100%",background:u}},y))});case c.CFRuleType.iconSet:return n&&E.jsx("div",{className:Pt.cfPreview,children:n.map((u,y)=>u?E.jsx("img",{style:{height:"100%"},src:u},y):E.jsx($e,{},y))});case c.CFRuleType.highlightCell:{const{ul:u,st:y,it:p,bl:b,bg:m,cl:I}=t.style,_=(u==null?void 0:u.s)===T.BooleanNumber.TRUE,w=(y==null?void 0:y.s)===T.BooleanNumber.TRUE,C=p===T.BooleanNumber.TRUE,R=b===T.BooleanNumber.TRUE,h=(a=m==null?void 0:m.rgb)!=null?a:c.DEFAULT_BG_COLOR,i=(o=I==null?void 0:I.rgb)!=null?o:c.DEFAULT_FONT_COLOR,s={fontWeight:R?"bold":void 0,fontStyle:C?"italic":void 0,textDecoration:`${_?"underline":""} ${w?"line-through":""}`.replace(/^ /,"")||void 0,backgroundColor:h,color:i};return E.jsx("div",{style:s,className:Pt.cfPreview,children:"123"})}}return null},he={cfRuleList:"univer-cf-rule-list",ruleSelector:"univer-rule-selector",select:"univer-select",btnList:"univer-btn-list",gap:"univer-gap",icon:"univer-icon",disabled:"univer-disabled",ruleItem:"univer-rule-item",ruleDescribe:"univer-rule-describe",ruleType:"univer-rule-type",ruleRange:"univer-rule-range",active:"univer-active",draggableHandle:"univer-draggableHandle",deleteItem:"univer-delete-item",gridLayoutWrap:"univer-grid-layout-wrap"},Oa=(e,t)=>{const r=e.rule;switch(r.type){case c.CFRuleType.colorScale:return t.t("sheet.cf.ruleType.colorScale");case c.CFRuleType.dataBar:return t.t("sheet.cf.ruleType.dataBar");case c.CFRuleType.iconSet:return t.t("sheet.cf.ruleType.iconSet");case c.CFRuleType.highlightCell:switch(r.subType){case c.CFSubRuleType.average:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,t.t("sheet.cf.subRuleType.average"))}case c.CFSubRuleType.duplicateValues:return t.t("sheet.cf.subRuleType.duplicateValues");case c.CFSubRuleType.uniqueValues:return t.t("sheet.cf.subRuleType.uniqueValues");case c.CFSubRuleType.number:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,...Array.isArray(r.value)?r.value.map(a=>String(a)):[String(r.value||"")])}case c.CFSubRuleType.text:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`,r.value||"")}case c.CFSubRuleType.timePeriod:{const n=r.operator;return t.t(`sheet.cf.preview.describe.${n}`)}case c.CFSubRuleType.rank:return r.isPercent?r.isBottom?t.t("sheet.cf.preview.describe.bottomNPercent",String(r.value)):t.t("sheet.cf.preview.describe.topNPercent",String(r.value)):r.isBottom?t.t("sheet.cf.preview.describe.bottomN",String(r.value)):t.t("sheet.cf.preview.describe.topN",String(r.value));case c.CFSubRuleType.formula:return t.t("sheet.cf.ruleType.formula")}}};let mr=0;const Ma=e=>{const{onClick:t}=e,r=ee.useDependency(c.ConditionalFormattingRuleModel),n=ee.useDependency(T.IUniverInstanceService),a=ee.useDependency(q.SheetsSelectionsService),o=ee.useDependency(T.ICommandService),u=ee.useDependency(T.LocaleService),y=ee.useDependency(T.Injector),p=ee.useDependency(Ae),b=ee.useObservable(()=>n.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET),void 0,void 0,[]),m=b.getUnitId(),I=b.getActiveSheet();if(!I)throw new Error("No active sheet found");const _=I.getSheetId(),[w,C]=L.useState([]),[R,h]=L.useState("2"),[i,s]=L.useState(0),[d,S]=L.useState(-1),[l,g]=L.useState(mr),f=L.useRef(null),v=[{label:u.t("sheet.cf.panel.workSheet"),value:"2"},{label:u.t("sheet.cf.panel.selectedRange"),value:"1"}],P=()=>{const F=r.getSubunitRules(m,_);if(!F||!F.length)return[];if(R==="1"){const H=a.getCurrentLastSelection();if(!H)return[];const oe=H.range;return F.filter(ue=>ue.ranges.some(ge=>T.Rectangle.intersects(ge,oe)))}else if(R==="2")return[...F];return[]},[U,z]=L.useState(P);fe.useHighlightRange(w),L.useEffect(()=>{const F=o.onCommandExecuted(H=>{H.id===q.SetWorksheetActiveOperation.id&&s(Math.random())});return()=>F.dispose()}),L.useEffect(()=>{z(P)},[R,i,m,_]),L.useEffect(()=>{if(R==="2")return;const F=new Ce.Observable(H=>{const oe=[q.SetSelectionsOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],se=o.onCommandExecuted(ue=>{const{id:ge,params:ye}=ue,Te=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();oe.includes(ge)&&ye.unitId===Te&&H.next(null)});return()=>se.dispose()}).pipe(Ce.debounceTime(16)).subscribe(()=>{z(P)});return()=>{F.unsubscribe()}},[n,R,m,_]),L.useEffect(()=>{const F=r.$ruleChange.subscribe(()=>{s(Math.random())});return()=>F.unsubscribe()},[r]),L.useEffect(()=>{const F=()=>{var ue;const se=Math.max(0,(((ue=f.current)==null?void 0:ue.getBoundingClientRect().width)||0)-8);return mr=se,se},oe=new Ce.Observable(se=>{const ue=document.querySelector(".univer-sidebar");if(ue){let ge=setTimeout(()=>{se.next()},150);const ye=()=>{ge&&clearTimeout(ge),ge=null},Te=B=>{B.propertyName==="width"&&(ye(),se.next())};return ue.addEventListener("transitionend",Te),()=>{ye(),ue.removeEventListener("transitionend",Te)}}}).pipe(Ce.debounceTime(16)).subscribe(()=>{g(F())});return()=>{oe.unsubscribe()}},[]);const V=F=>{var se;const H=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),oe=(se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:se.getSheetId();if(!H||!oe)throw new Error("No active sheet found");o.executeCommand(Ke.id,{unitId:H,subUnitId:oe,cfId:F.cfId})},O=(F,H)=>{S(H.y)},x=(F,H,oe)=>{var B;S(-1);const se=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),ue=(B=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:B.getSheetId();if(!se||!ue)throw new Error("No active sheet found");const ge=Q=>{const le=U.length;return Math.min(le-1,Math.max(0,Q))},ye=U[ge(H.y)].cfId,Te=U[ge(oe.y)].cfId;ye!==Te&&o.executeCommand(St.id,{unitId:se,subUnitId:ue,start:{id:ye,type:"self"},end:{id:Te,type:oe.y>H.y?"after":"before"}})},W=()=>{e.onCreate()},X=()=>{R==="2"?o.executeCommand(Ye.id):R==="1"&&U.map(H=>({unitId:m,subUnitId:_,cfId:H.cfId})).forEach(H=>{o.executeCommand(Ke.id,H)})},Y=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.filter(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]),re=Y.map((F,H)=>({i:F.cfId,x:0,w:12,y:H,h:1,isResizable:!1})),te=L.useMemo(()=>{const F=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),H=F.getActiveSheet();return U.every(oe=>{const se=oe.ranges;return q.checkRangesEditablePermission(y,F.getUnitId(),H.getSheetId(),se)})},[U]);return E.jsxs("div",{className:he.cfRuleList,children:[E.jsxs("div",{className:he.ruleSelector,children:[E.jsx("div",{children:p.tWithReactNode("sheet.cf.panel.managerRuleSelect",E.jsx(ae.Select,{className:he.select,options:v,value:R,onChange:F=>{h(F)}})).map((F,H)=>E.jsx("span",{children:F},H))}),E.jsxs("div",{className:he.btnList,children:[E.jsx(ae.Tooltip,{title:u.t("sheet.cf.panel.createRule"),placement:"bottom",children:E.jsx("div",{className:`
13
+ ${he.icon}
14
+ `,onClick:W,children:E.jsx(Rn,{})})}),U.length&&te?E.jsx(ae.Tooltip,{title:u.t("sheet.cf.panel.clear"),placement:"bottom",children:E.jsx("div",{className:`
15
+ ${he.gap}
16
+ ${he.icon}
17
+ `,onClick:X,children:E.jsx(Ct,{})})}):E.jsx("div",{className:`
18
+ ${he.gap}
19
+ ${he.disabled}
20
+ `,children:E.jsx(Ct,{})})]})]}),E.jsx("div",{ref:f,className:he.gridLayoutWrap,children:l?E.jsx(wa,{onDragStop:x,onDragStart:O,layout:re,cols:12,rowHeight:60,width:l,margin:[0,10],draggableHandle:".draggableHandle",children:Y==null?void 0:Y.map((F,H)=>E.jsx("div",{children:E.jsxs("div",{onMouseMove:()=>{F.ranges!==w&&C(F.ranges)},onMouseLeave:()=>C([]),onClick:()=>{t(F)},className:`
21
+ ${he.ruleItem}
22
+ ${d===H?he.active:""}
23
+ `,children:[E.jsx("div",{className:`
24
+ ${he.draggableHandle}
34
25
  draggableHandle
35
- `,onClick:re=>re.stopPropagation(),children:x.jsx(Mn,{})}),x.jsxs("div",{className:pe.ruleDescribe,children:[x.jsx("div",{className:pe.ruleType,children:Vi(F,l)}),x.jsx("div",{className:pe.ruleRange,children:F.ranges.map(re=>qt.serializeRange(re)).join(",")})]}),x.jsx("div",{className:pe.preview,children:x.jsx(We,{rule:F.rule})}),x.jsx("div",{className:`
36
- ${pe.deleteItem}
37
- ${d===H?pe.active:""}
38
- `,onClick:re=>{re.stopPropagation(),U(F),R([])},children:x.jsx(Ct,{})})]})},`${F.cfId}`))}):null})]})},gn={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},De=t=>{const{color:e,onChange:r,disable:n=!1,iconId:i="PaintBucket",className:a,isNeedDropdownIcon:l=!0}=t,S=v.useDependency(ge.ComponentManager),f=j.useMemo(()=>new v.ColorKit(e),[e]),b=S.get(i);return b&&(n?x.jsx(b,{className:a,extend:{colorChannel1:f.isValid?e:"rgb(var(--primary-color))"}}):x.jsx(ie.DropdownLegacy,{overlay:x.jsx("div",{className:`
39
- ${gn.cfColorPicker}
40
- `,children:x.jsx(ie.ColorPicker,{value:e,onChange:r})}),children:x.jsxs("span",{className:`
41
- ${gn.cfColorPickerIcon}
42
- ${a}
43
- `,children:[x.jsx(b,{extend:{colorChannel1:f.isValid?e:"rgb(var(--primary-color))"}}),l&&x.jsx(Tt,{className:gn.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),vn=t=>{var R;const{type:e,className:r,onChange:n,id:i,value:a}=t,l=v.useDependency(v.IUniverInstanceService),S=l.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),f=(R=l.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId(),b=j.useMemo(()=>String(a).startsWith("=")?String(a):"=",[a]),m=j.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=j.useRef({}),[_,I]=j.useState(!1);return ge.useSidebarClick(w=>{var o;const h=(o=T.current)==null?void 0:o.handleOutClick;h&&h(w,()=>I(!1))}),e===c.CFValueType.formula?x.jsx("div",{style:{width:"100%",marginLeft:4},children:x.jsx(Ge.FormulaEditor,{initValue:b,unitId:S,subUnitId:f,isFocus:_,onChange:(w="")=>{n(w||"")},onFocus:()=>I(!0),actions:T.current})}):x.jsx(ie.InputNumber,{className:r,value:Number(t.value)||0,onChange:w=>t.onChange(w||0),...m})},Ai=t=>{var U;const{interceptorManager:e}=t,r=v.useDependency(v.LocaleService),n=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.colorScale?t.rule:void 0,i=[Ne(c.CFValueType.num,r),Ne(c.CFValueType.percent,r),Ne(c.CFValueType.percentile,r),Ne(c.CFValueType.formula,r)],a=[Ne(c.CFValueType.min,r),...i],l=[Ne("none",r),...i],S=[Ne(c.CFValueType.max,r),...i],[f,b]=j.useState(()=>{var D;const E=c.CFValueType.min;return n&&((D=n.config[0])==null?void 0:D.value.type)||E}),[m,T]=j.useState(()=>{var D;const E="none";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.value.type)||E}),[_,I]=j.useState(()=>{var D;const E=c.CFValueType.max;return n&&((D=n.config[n.config.length-1])==null?void 0:D.value.type)||E}),[R,w]=j.useState(()=>{if(!n)return 10;const D=n.config[0];return(D==null?void 0:D.value.value)===void 0?10:D==null?void 0:D.value.value}),[h,o]=j.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const D=(W=n.config[1])==null?void 0:W.value.value;return D===void 0?50:D}),[s,d]=j.useState(()=>{var W;if(!n)return 90;const D=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return D===void 0?90:D}),[C,u]=j.useState(()=>{var D;const E="#d0d9fb";return n&&((D=n.config[0])==null?void 0:D.color)||E}),[g,p]=j.useState(()=>{var D;const E="#7790f3";return!n||n.config.length!==3?E:((D=n.config[1])==null?void 0:D.color)||E}),[y,M]=j.useState(()=>{var D;const E="#2e55ef";return n&&((D=n.config[n.config.length-1])==null?void 0:D.color)||E}),L=j.useMemo(()=>E=>{const{minType:D,medianType:W,maxType:X,minValue:Y,medianValue:ne,maxValue:ee,minColor:F,medianColor:H,maxColor:re}=E,oe=[];return oe.push({color:F,value:{type:D,value:Y}}),W!=="none"&&oe.push({color:H,value:{type:W,value:ne}}),oe.push({color:re,value:{type:X,value:ee}}),{config:oe.map((he,ye)=>({...he,index:ye})),type:c.CFRuleType.colorScale}},[]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return L({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:y})}}),[L,f,m,_,R,h,s,C,g,y,e]);const V=E=>{t.onChange(L(E))};return x.jsxs("div",{children:[x.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
26
+ `,onClick:oe=>oe.stopPropagation(),children:E.jsx(_n,{})}),E.jsxs("div",{className:he.ruleDescribe,children:[E.jsx("div",{className:he.ruleType,children:Oa(F,u)}),E.jsx("div",{className:he.ruleRange,children:F.ranges.map(oe=>Gt.serializeRange(oe)).join(",")})]}),E.jsx("div",{className:he.preview,children:E.jsx(We,{rule:F.rule})}),E.jsx("div",{className:`
27
+ ${he.deleteItem}
28
+ ${d===H?he.active:""}
29
+ `,onClick:oe=>{oe.stopPropagation(),V(F),C([])},children:E.jsx(Ct,{})})]})},`${F.cfId}`))}):null})]})},hn={cfColorPicker:"univer-cf-color-picker",cfColorPickerIcon:"univer-cf-color-picker-icon",iconDropdown:"univer-icon-dropdown"},xe=e=>{const{color:t,onChange:r,disable:n=!1,iconId:a="PaintBucket",className:o,isNeedDropdownIcon:u=!0}=e,y=ee.useDependency(ee.ComponentManager),p=L.useMemo(()=>new T.ColorKit(t),[t]),b=y.get(a);return b&&(n?E.jsx(b,{className:o,extend:{colorChannel1:p.isValid?t:"rgb(var(--primary-color))"}}):E.jsx(ae.DropdownLegacy,{overlay:E.jsx("div",{className:`
30
+ ${hn.cfColorPicker}
31
+ `,children:E.jsx(ae.ColorPicker,{value:t,onChange:r})}),children:E.jsxs("span",{className:`
32
+ ${hn.cfColorPickerIcon}
33
+ ${o}
34
+ `,children:[E.jsx(b,{extend:{colorChannel1:p.isValid?t:"rgb(var(--primary-color))"}}),u&&E.jsx(Tt,{className:hn.iconDropdown})]})}))},G={cfRuleStyleEditor:"univer-cf-rule-style-editor",cfPreviewWrap:"univer-cf-preview-wrap",text:"univer-text",positionRelative:"univer-position-relative",btnList:"univer-btn-list",utilItem:"univer-util-item",iconSet:"univer-icon-set",renderConfig:"univer-render-config",flex:"univer-flex",width45:"univer-width45",iconWrap:"univer-icon-wrap",icon:"univer-icon",dropdownIcon:"univer-dropdown-icon",errorInput:"univer-error-input",errorText:"univer-error-text",iconGroupList:"univer-icon-group-list",title:"univer-title",group:"univer-group",itemContent:"univer-item-content",itemWrap:"univer-item-wrap",item:"univer-item",iconItemListWrap:"univer-icon-item-list-wrap",none:"univer-none",iconItemList:"univer-icon-item-list",width100:"univer-width100",stress:"univer-stress"},Ne=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),gn=e=>{var C;const{type:t,className:r,onChange:n,id:a,value:o}=e,u=ee.useDependency(T.IUniverInstanceService),y=u.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),p=(C=u.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:C.getSheetId(),b=L.useMemo(()=>String(o).startsWith("=")?String(o):"=",[o]),m=L.useMemo(()=>[c.CFValueType.max,c.CFValueType.min,"none"].includes(t)?{disabled:!0}:[c.CFValueType.percent,c.CFValueType.percentile].includes(t)?{min:0,max:100}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[t]),I=L.useRef({}),[_,w]=L.useState(!1);return ee.useSidebarClick(R=>{var i;const h=(i=I.current)==null?void 0:i.handleOutClick;h&&h(R,()=>w(!1))}),t===c.CFValueType.formula?E.jsx("div",{style:{width:"100%",marginLeft:4},children:E.jsx(Ge.FormulaEditor,{initValue:b,unitId:y,subUnitId:p,isFocus:_,onChange:(R="")=>{n(R||"")},onFocus:()=>w(!0),actions:I.current})}):E.jsx(ae.InputNumber,{className:r,value:Number(e.value)||0,onChange:R=>e.onChange(R||0),...m})},Da=e=>{var V;const{interceptorManager:t}=e,r=ee.useDependency(T.LocaleService),n=((V=e.rule)==null?void 0:V.type)===c.CFRuleType.colorScale?e.rule:void 0,a=[Ne(c.CFValueType.num,r),Ne(c.CFValueType.percent,r),Ne(c.CFValueType.percentile,r),Ne(c.CFValueType.formula,r)],o=[Ne(c.CFValueType.min,r),...a],u=[Ne("none",r),...a],y=[Ne(c.CFValueType.max,r),...a],[p,b]=L.useState(()=>{var x;const O=c.CFValueType.min;return n&&((x=n.config[0])==null?void 0:x.value.type)||O}),[m,I]=L.useState(()=>{var x;const O="none";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.value.type)||O}),[_,w]=L.useState(()=>{var x;const O=c.CFValueType.max;return n&&((x=n.config[n.config.length-1])==null?void 0:x.value.type)||O}),[C,R]=L.useState(()=>{if(!n)return 10;const x=n.config[0];return(x==null?void 0:x.value.value)===void 0?10:x==null?void 0:x.value.value}),[h,i]=L.useState(()=>{var W;if(!n||n.config.length!==3)return 50;const x=(W=n.config[1])==null?void 0:W.value.value;return x===void 0?50:x}),[s,d]=L.useState(()=>{var W;if(!n)return 90;const x=(W=n.config[n.config.length-1])==null?void 0:W.value.value;return x===void 0?90:x}),[S,l]=L.useState(()=>{var x;const O="#d0d9fb";return n&&((x=n.config[0])==null?void 0:x.color)||O}),[g,f]=L.useState(()=>{var x;const O="#7790f3";return!n||n.config.length!==3?O:((x=n.config[1])==null?void 0:x.color)||O}),[v,P]=L.useState(()=>{var x;const O="#2e55ef";return n&&((x=n.config[n.config.length-1])==null?void 0:x.color)||O}),U=L.useMemo(()=>O=>{const{minType:x,medianType:W,maxType:X,minValue:Y,medianValue:re,maxValue:te,minColor:F,medianColor:H,maxColor:oe}=O,se=[];return se.push({color:F,value:{type:x,value:Y}}),W!=="none"&&se.push({color:H,value:{type:W,value:re}}),se.push({color:oe,value:{type:X,value:te}}),{config:se.map((ge,ye)=>({...ge,index:ye})),type:c.CFRuleType.colorScale}},[]);L.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return U({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),[U,p,m,_,C,h,s,S,g,v,t]);const z=O=>{e.onChange(U(O))};return E.jsxs("div",{children:[E.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
44
35
  ${G.cfPreviewWrap}
45
- `,children:x.jsx(We,{rule:L({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:y})})}),x.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),x.jsxs("div",{className:`
36
+ `,children:E.jsx(We,{rule:U({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})})}),E.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),E.jsxs("div",{className:`
46
37
  ${A.labelContainer}
47
38
  ${A.mTSm}
48
- `,children:[x.jsx(ie.Select,{style:{flexShrink:0},options:a,value:f,onChange:E=>{b(E);const D=c.createDefaultValueByValueType(E,10);w(D),V({minType:E,medianType:m,maxType:_,minValue:D,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:y})}}),x.jsx(vn,{id:"min",className:`
39
+ `,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:o,value:p,onChange:O=>{b(O);const x=c.createDefaultValueByValueType(O,10);R(x),z({minType:O,medianType:m,maxType:_,minValue:x,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"min",className:`
49
40
  ${A.mLXxs}
50
- `,value:R,type:f,onChange:E=>{w(E),V({minType:f,medianType:m,maxType:_,minValue:E,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:y})}}),x.jsx(De,{className:A.mLXxs,color:C,onChange:E=>{u(E),V({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:s,minColor:E,medianColor:g,maxColor:y})}})]}),x.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.medianValue")}),x.jsxs("div",{className:`
41
+ `,value:C,type:p,onChange:O=>{R(O),z({minType:p,medianType:m,maxType:_,minValue:O,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(xe,{className:A.mLXxs,color:S,onChange:O=>{l(O),z({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:O,medianColor:g,maxColor:v})}})]}),E.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.medianValue")}),E.jsxs("div",{className:`
51
42
  ${A.labelContainer}
52
43
  ${A.mTSm}
53
- `,children:[x.jsx(ie.Select,{style:{flexShrink:0},options:l,value:m,onChange:E=>{T(E);const D=c.createDefaultValueByValueType(E,50);o(D),V({minType:f,medianType:E,maxType:_,minValue:R,medianValue:D,maxValue:s,minColor:C,medianColor:g,maxColor:y})}}),x.jsx(vn,{id:"median",className:`
44
+ `,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:u,value:m,onChange:O=>{I(O);const x=c.createDefaultValueByValueType(O,50);i(x),z({minType:p,medianType:O,maxType:_,minValue:C,medianValue:x,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"median",className:`
54
45
  ${A.mLXxs}
55
- `,value:h,type:m,onChange:E=>{o(E),V({minType:f,medianType:m,maxType:_,minValue:R,medianValue:E,maxValue:s,minColor:C,medianColor:g,maxColor:y})}}),m!=="none"&&x.jsx(De,{className:A.mLXxs,color:g,onChange:E=>{p(E),V({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:s,minColor:C,medianColor:E,maxColor:y})}})]}),x.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),x.jsxs("div",{className:`
46
+ `,value:h,type:m,onChange:O=>{i(O),z({minType:p,medianType:m,maxType:_,minValue:C,medianValue:O,maxValue:s,minColor:S,medianColor:g,maxColor:v})}}),m!=="none"&&E.jsx(xe,{className:A.mLXxs,color:g,onChange:O=>{f(O),z({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:O,maxColor:v})}})]}),E.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),E.jsxs("div",{className:`
56
47
  ${A.labelContainer}
57
48
  ${A.mTSm}
58
- `,children:[x.jsx(ie.Select,{style:{flexShrink:0},options:S,value:_,onChange:E=>{I(E);const D=c.createDefaultValueByValueType(E,90);d(D),V({minType:f,medianType:m,maxType:E,minValue:R,medianValue:h,maxValue:D,minColor:C,medianColor:g,maxColor:y})}}),x.jsx(vn,{id:"max",className:`
49
+ `,children:[E.jsx(ae.Select,{style:{flexShrink:0},options:y,value:_,onChange:O=>{w(O);const x=c.createDefaultValueByValueType(O,90);d(x),z({minType:p,medianType:m,maxType:O,minValue:C,medianValue:h,maxValue:x,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(gn,{id:"max",className:`
59
50
  ${A.mLXxs}
60
- `,value:s,type:_,onChange:E=>{d(E),V({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:E,minColor:C,medianColor:g,maxColor:y})}}),x.jsx(De,{className:A.mLXxs,color:y,onChange:E=>{M(E),V({minType:f,medianType:m,maxType:_,minValue:R,medianValue:h,maxValue:s,minColor:C,medianColor:g,maxColor:E})}})]})]})},He=(t,e)=>({label:e.t(`sheet.cf.valueType.${t}`),value:t}),Cr=t=>{var w;const{onChange:e,className:r,value:n,type:i,id:a,disabled:l=!1}=t,S=v.useDependency(v.IUniverInstanceService),f=S.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),b=(w=S.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId(),m=j.useRef({}),[T,_]=j.useState(!1);ge.useSidebarClick(h=>{var s;const o=(s=m.current)==null?void 0:s.handleOutClick;o&&o(h,()=>_(!1))});const I=j.useRef(n),R=j.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(i)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[i]);if(i===c.CFValueType.formula){const h=String(I.current).startsWith("=")?String(I.current)||"":"=";return x.jsx("div",{style:{width:"100%",marginLeft:12},children:x.jsx(Ge.FormulaEditor,{initValue:h,unitId:f,subUnitId:b,isFocus:T,onChange:(o="")=>{e(o||"")},onFocus:()=>_(!0),actions:m.current})})}return x.jsx(ie.InputNumber,{className:r,value:Number(n)||0,disabled:l,onChange:h=>{e(h||0)},...R})},Wi=t=>{var U;const{interceptorManager:e}=t,r=v.useDependency(v.LocaleService),n=((U=t.rule)==null?void 0:U.type)===c.CFRuleType.dataBar?t.rule:void 0,[i,a]=j.useState(()=>{var D;const E="0";return n?(D=n.config)!=null&&D.isGradient?"1":"0":E}),[l,S]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.positiveColor)||c.defaultDataBarPositiveColor}),[f,b]=j.useState(()=>{var E;return n&&((E=n.config)==null?void 0:E.nativeColor)||c.defaultDataBarNativeColor}),m=[He(c.CFValueType.num,r),He(c.CFValueType.percent,r),He(c.CFValueType.percentile,r),He(c.CFValueType.formula,r)],T=[He(c.CFValueType.min,r),...m],_=[He(c.CFValueType.max,r),...m],[I,R]=j.useState(()=>{var D;const E=T[0].value;return n&&((D=n.config)==null?void 0:D.min.type)||E}),[w,h]=j.useState(()=>{var D;const E=_[0].value;return n&&((D=n.config)==null?void 0:D.max.type)||E}),[o,s]=j.useState(()=>{var W;if(!n)return 0;const D=((W=n.config)==null?void 0:W.min)||{};return D.type===c.CFValueType.formula?D.value||"=":D.value||0}),[d,C]=j.useState(()=>{var W;if(!n)return 100;const D=((W=n.config)==null?void 0:W.max)||{};return D.type===c.CFValueType.formula?D.value||"=":D.value===void 0?100:D.value}),[u,g]=j.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),p=E=>({config:{min:{type:E.minValueType,value:E.minValue},max:{type:E.maxValueType,value:E.maxValue},isGradient:E.isGradient==="1",positiveColor:E.positiveColor||c.defaultDataBarPositiveColor,nativeColor:E.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:E.isShowValue});j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return p({isGradient:i,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})}}),[i,o,I,d,w,l,f,e,u]);const y=E=>{t.onChange(p(E))},M=E=>{S(E),y({isGradient:i,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:E,nativeColor:f,isShowValue:u})},L=E=>{b(E),y({isGradient:i,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:E,isShowValue:u})},V=E=>m.map(D=>D.value).includes(E);return x.jsxs("div",{children:[x.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
51
+ `,value:s,type:_,onChange:O=>{d(O),z({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:O,minColor:S,medianColor:g,maxColor:v})}}),E.jsx(xe,{className:A.mLXxs,color:v,onChange:O=>{P(O),z({minType:p,medianType:m,maxType:_,minValue:C,medianValue:h,maxValue:s,minColor:S,medianColor:g,maxColor:O})}})]})]})},je=(e,t)=>({label:t.t(`sheet.cf.valueType.${e}`),value:e}),yr=e=>{var R;const{onChange:t,className:r,value:n,type:a,id:o,disabled:u=!1}=e,y=ee.useDependency(T.IUniverInstanceService),p=y.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),b=(R=y.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:R.getSheetId(),m=L.useRef({}),[I,_]=L.useState(!1);ee.useSidebarClick(h=>{var s;const i=(s=m.current)==null?void 0:s.handleOutClick;i&&i(h,()=>_(!1))});const w=L.useRef(n),C=L.useMemo(()=>[c.CFValueType.percentile,c.CFValueType.percent].includes(a)?{max:100,min:0}:{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER},[a]);if(a===c.CFValueType.formula){const h=String(w.current).startsWith("=")?String(w.current)||"":"=";return E.jsx("div",{style:{width:"100%",marginLeft:12},children:E.jsx(Ge.FormulaEditor,{initValue:h,unitId:p,subUnitId:b,isFocus:I,onChange:(i="")=>{t(i||"")},onFocus:()=>_(!0),actions:m.current})})}return E.jsx(ae.InputNumber,{className:r,value:Number(n)||0,disabled:u,onChange:h=>{t(h||0)},...C})},Pa=e=>{var V;const{interceptorManager:t}=e,r=ee.useDependency(T.LocaleService),n=((V=e.rule)==null?void 0:V.type)===c.CFRuleType.dataBar?e.rule:void 0,[a,o]=L.useState(()=>{var x;const O="0";return n?(x=n.config)!=null&&x.isGradient?"1":"0":O}),[u,y]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.positiveColor)||c.defaultDataBarPositiveColor}),[p,b]=L.useState(()=>{var O;return n&&((O=n.config)==null?void 0:O.nativeColor)||c.defaultDataBarNativeColor}),m=[je(c.CFValueType.num,r),je(c.CFValueType.percent,r),je(c.CFValueType.percentile,r),je(c.CFValueType.formula,r)],I=[je(c.CFValueType.min,r),...m],_=[je(c.CFValueType.max,r),...m],[w,C]=L.useState(()=>{var x;const O=I[0].value;return n&&((x=n.config)==null?void 0:x.min.type)||O}),[R,h]=L.useState(()=>{var x;const O=_[0].value;return n&&((x=n.config)==null?void 0:x.max.type)||O}),[i,s]=L.useState(()=>{var W;if(!n)return 0;const x=((W=n.config)==null?void 0:W.min)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value||0}),[d,S]=L.useState(()=>{var W;if(!n)return 100;const x=((W=n.config)==null?void 0:W.max)||{};return x.type===c.CFValueType.formula?x.value||"=":x.value===void 0?100:x.value}),[l,g]=L.useState(()=>n?n.isShowValue===void 0?!0:!!n.isShowValue:!0),f=O=>({config:{min:{type:O.minValueType,value:O.minValue},max:{type:O.maxValueType,value:O.maxValue},isGradient:O.isGradient==="1",positiveColor:O.positiveColor||c.defaultDataBarPositiveColor,nativeColor:O.nativeColor||c.defaultDataBarNativeColor},type:c.CFRuleType.dataBar,isShowValue:O.isShowValue});L.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),[a,i,w,d,R,u,p,t,l]);const v=O=>{e.onChange(f(O))},P=O=>{y(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:O,nativeColor:p,isShowValue:l})},U=O=>{b(O),v({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:O,isShowValue:l})},z=O=>m.map(x=>x.value).includes(O);return E.jsxs("div",{children:[E.jsx("div",{className:A.title,children:r.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
61
52
  ${G.cfPreviewWrap}
62
- `,children:x.jsx(We,{rule:p({isGradient:i,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})})}),x.jsxs("div",{children:[x.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.fillType")}),x.jsxs("div",{className:`
53
+ `,children:E.jsx(We,{rule:f({isGradient:a,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})})}),E.jsxs("div",{children:[E.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.fillType")}),E.jsxs("div",{className:`
63
54
  ${A.mTSm}
64
55
  ${A.mLXxs}
65
56
  ${A.labelContainer}
66
- `,children:[x.jsxs(ie.RadioGroup,{value:i,onChange:E=>{a(E),y({isGradient:E,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})},children:[x.jsx(ie.Radio,{value:"0",children:x.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.pureColor")})}),x.jsx(ie.Radio,{value:"1",children:x.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.gradient")})})]}),x.jsxs("div",{className:`
57
+ `,children:[E.jsxs(ae.RadioGroup,{value:a,onChange:O=>{o(O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})},children:[E.jsx(ae.Radio,{value:"0",children:E.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.pureColor")})}),E.jsx(ae.Radio,{value:"1",children:E.jsx("span",{className:G.text,children:r.t("sheet.cf.panel.gradient")})})]}),E.jsxs("div",{className:`
67
58
  ${G.utilItem}
68
59
  ${A.mLXl}
69
- `,children:[x.jsx(ie.Checkbox,{checked:!u,onChange:E=>{g(!E),y({isGradient:E,minValue:o,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:!E})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),x.jsxs("div",{children:[x.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.colorSet")}),x.jsxs("div",{className:`
60
+ `,children:[E.jsx(ae.Checkbox,{checked:!l,onChange:O=>{g(!O),v({isGradient:O,minValue:i,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:!O})}}),r.t("sheet.cf.panel.onlyShowDataBar")]})]})]}),E.jsxs("div",{children:[E.jsx("div",{className:A.label,children:r.t("sheet.cf.panel.colorSet")}),E.jsxs("div",{className:`
70
61
  ${A.labelContainer}
71
62
  ${A.mTSm}
72
63
  ${A.mLXxs}
73
- `,children:[x.jsxs("div",{className:`
64
+ `,children:[E.jsxs("div",{className:`
74
65
  ${A.labelContainer}
75
- `,children:[x.jsx("div",{className:`
66
+ `,children:[E.jsx("div",{className:`
76
67
  ${G.text}
77
- `,children:r.t("sheet.cf.panel.native")}),x.jsx(De,{color:f,onChange:L})]}),x.jsxs("div",{className:`
68
+ `,children:r.t("sheet.cf.panel.native")}),E.jsx(xe,{color:p,onChange:U})]}),E.jsxs("div",{className:`
78
69
  ${A.labelContainer}
79
70
  ${A.mLSm}
80
- `,children:[x.jsx("div",{className:`
71
+ `,children:[E.jsx("div",{className:`
81
72
  ${G.text}
82
- `,children:r.t("sheet.cf.panel.positive")}),x.jsx(De,{color:l,onChange:M})]})]})]}),x.jsxs("div",{children:[x.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),x.jsxs("div",{className:`
73
+ `,children:r.t("sheet.cf.panel.positive")}),E.jsx(xe,{color:u,onChange:P})]})]})]}),E.jsxs("div",{children:[E.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.min")}),E.jsxs("div",{className:`
83
74
  ${A.mTSm}
84
75
  ${A.labelContainer}
85
- `,children:[x.jsx(ie.Select,{style:{width:"50%",flexShrink:0},options:T,value:I,onChange:E=>{R(E);const D=c.createDefaultValueByValueType(E,10);s(D),y({isGradient:i,minValue:D,minValueType:E,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})}}),x.jsx(Cr,{disabled:!V(I),id:"min",type:I,className:A.mLSm,value:o,onChange:E=>{s(E||0),y({isGradient:i,minValue:E||0,minValueType:I,maxValue:d,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})}})]}),x.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),x.jsxs("div",{className:`
76
+ `,children:[E.jsx(ae.Select,{style:{width:"50%",flexShrink:0},options:I,value:w,onChange:O=>{C(O);const x=c.createDefaultValueByValueType(O,10);s(x),v({isGradient:a,minValue:x,minValueType:O,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}}),E.jsx(yr,{disabled:!z(w),id:"min",type:w,className:A.mLSm,value:i,onChange:O=>{s(O||0),v({isGradient:a,minValue:O||0,minValueType:w,maxValue:d,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]}),E.jsx("div",{className:A.label,children:r.t("sheet.cf.valueType.max")}),E.jsxs("div",{className:`
86
77
  ${A.mTSm}
87
78
  ${A.labelContainer}
88
- `,children:[x.jsx(ie.Select,{style:{width:"50%",flexShrink:0},options:_,value:w,onChange:E=>{h(E);const D=c.createDefaultValueByValueType(E,90);C(D),y({isGradient:i,minValue:o,minValueType:I,maxValue:D,maxValueType:E,positiveColor:l,nativeColor:f,isShowValue:u})}}),x.jsx(Cr,{disabled:!V(w),id:"max",type:w,className:A.mLSm,value:d,onChange:E=>{C(E||0),y({isGradient:i,minValue:o,minValueType:I,maxValue:E||0,maxValueType:w,positiveColor:l,nativeColor:f,isShowValue:u})}})]})]})]})};function Tr(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(r=Tr(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Nt(){for(var t,e,r=0,n="",i=arguments.length;r<i;r++)(t=arguments[r])&&(e=Tr(t))&&(n&&(n+=" "),n+=e);return n}const _e={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},jt=t=>[v.BooleanNumber.FALSE,void 0].includes(t)?v.BooleanNumber.TRUE:v.BooleanNumber.FALSE,Lt=t=>t!==v.BooleanNumber.FALSE,yn=t=>{const{style:e,onChange:r,className:n}=t,i=v.useDependency(ge.ComponentManager),[a,l]=j.useState(()=>{if(e!=null&&e.bl)return e.bl}),[S,f]=j.useState(()=>{if(e!=null&&e.it)return e.it}),[b,m]=j.useState(()=>{if(e!=null&&e.ul)return e.ul.s}),[T,_]=j.useState(()=>{if(e!=null&&e.st)return e.st.s}),[I,R]=j.useState(()=>{var g;const u="#2f56ef";return(g=e==null?void 0:e.cl)!=null&&g.rgb?e.cl.rgb:u}),[w,h]=j.useState(()=>{var g;const u="#e8ecfc";return(g=e==null?void 0:e.bg)!=null&&g.rgb?e.bg.rgb:u}),o=i.get("BoldSingle"),s=i.get("ItalicSingle"),d=i.get("UnderlineSingle"),C=i.get("StrikethroughSingle");return j.useEffect(()=>{const u={bl:a,it:S};I!==void 0&&(u.cl={rgb:I}),w!==void 0&&(u.bg={rgb:w}),T!==void 0&&(u.st={s:T}),b!==void 0&&(u.ul={s:b}),r(c.removeUndefinedAttr(u))},[a,S,b,T,I,w]),x.jsxs("div",{className:`
79
+ `,children:[E.jsx(ae.Select,{style:{width:"50%",flexShrink:0},options:_,value:R,onChange:O=>{h(O);const x=c.createDefaultValueByValueType(O,90);S(x),v({isGradient:a,minValue:i,minValueType:w,maxValue:x,maxValueType:O,positiveColor:u,nativeColor:p,isShowValue:l})}}),E.jsx(yr,{disabled:!z(R),id:"max",type:R,className:A.mLSm,value:d,onChange:O=>{S(O||0),v({isGradient:a,minValue:i,minValueType:w,maxValue:O||0,maxValueType:R,positiveColor:u,nativeColor:p,isShowValue:l})}})]})]})]})};function Sr(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=Sr(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function xt(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=Sr(e))&&(n&&(n+=" "),n+=t);return n}const _e={cfStyleEdit:"univer-cf-style-edit",buttonItem:"univer-button-item",isActive:"univer-isActive"},Nt=e=>[T.BooleanNumber.FALSE,void 0].includes(e)?T.BooleanNumber.TRUE:T.BooleanNumber.FALSE,Lt=e=>e!==T.BooleanNumber.FALSE,vn=e=>{const{style:t,onChange:r,className:n}=e,a=ee.useDependency(ee.ComponentManager),[o,u]=L.useState(()=>{if(t!=null&&t.bl)return t.bl}),[y,p]=L.useState(()=>{if(t!=null&&t.it)return t.it}),[b,m]=L.useState(()=>{if(t!=null&&t.ul)return t.ul.s}),[I,_]=L.useState(()=>{if(t!=null&&t.st)return t.st.s}),[w,C]=L.useState(()=>{var g;const l="#2f56ef";return(g=t==null?void 0:t.cl)!=null&&g.rgb?t.cl.rgb:l}),[R,h]=L.useState(()=>{var g;const l="#e8ecfc";return(g=t==null?void 0:t.bg)!=null&&g.rgb?t.bg.rgb:l}),i=a.get("BoldSingle"),s=a.get("ItalicSingle"),d=a.get("UnderlineSingle"),S=a.get("StrikethroughSingle");return L.useEffect(()=>{const l={bl:o,it:y};w!==void 0&&(l.cl={rgb:w}),R!==void 0&&(l.bg={rgb:R}),I!==void 0&&(l.st={s:I}),b!==void 0&&(l.ul={s:b}),r(c.removeUndefinedAttr(l))},[o,y,b,I,w,R]),E.jsxs("div",{className:`
89
80
  ${_e.cfStyleEdit}
90
81
  ${n}
91
- `,children:[o&&x.jsx("div",{className:Nt({[_e.isActive]:Lt(a||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>l(jt(a)),children:x.jsx(o,{})}),s&&x.jsx("div",{className:Nt({[_e.isActive]:Lt(S||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>f(jt(S)),children:x.jsx(s,{})}),d&&x.jsx("div",{className:Nt({[_e.isActive]:Lt(b||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>m(jt(b)),children:x.jsx(d,{})}),C&&x.jsx("div",{className:Nt({[_e.isActive]:Lt(T||v.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>_(jt(T)),children:x.jsx(C,{})}),x.jsx(De,{color:I,onChange:R,iconId:"FontColor"}),x.jsx(De,{color:w,onChange:h,iconId:"PaintBucket"})]})},Hi=t=>{var C;const{onChange:e,interceptorManager:r}=t,n=v.useDependency(v.LocaleService),a=v.useDependency(v.IUniverInstanceService).getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),l=a.getActiveSheet(),S=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.highlightCell?t.rule:void 0,f=j.useRef(null),[b,m]=j.useState(!1),T=j.useRef({}),[_,I]=j.useState({}),[R,w]=j.useState(()=>(S==null?void 0:S.subType)===c.CFSubRuleType.formula?S.value:"="),[h,o]=j.useState(void 0),s=u=>({style:u.style,value:R,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:_,formula:R})}}),[_,R,r]),j.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,p,y)=>h||R.length===1||!R.startsWith("=")?(o(n.t("sheet.cf.errorMessage.formulaError")),!1):y(g)}),[h,R]);const d=u=>{e(s(u))};return ge.useSidebarClick(u=>{var p;const g=(p=T.current)==null?void 0:p.handleOutClick;g&&g(u,()=>m(!1))}),x.jsxs("div",{ref:f,children:[x.jsx("div",{className:`
92
- ${A.title}
93
- ${A.mTBase}
94
- `,children:n.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
95
- ${A.mTSm}
96
- `,children:x.jsx(Ge.FormulaEditor,{onChange:u=>{w(u),d({style:_,formula:u})},onVerify:(u,g)=>{!u||g.length===1?o(n.t("sheet.cf.errorMessage.formulaError")):o(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:T.current,isFocus:b,initValue:R,unitId:a.getUnitId(),subUnitId:l==null?void 0:l.getSheetId()})}),x.jsx("div",{className:`
97
- ${G.cfPreviewWrap}
98
- `,children:x.jsx(We,{rule:s({style:_,formula:R})})}),x.jsx(yn,{style:S==null?void 0:S.style,className:`
82
+ `,children:[i&&E.jsx("div",{className:xt({[_e.isActive]:Lt(o||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>u(Nt(o)),children:E.jsx(i,{})}),s&&E.jsx("div",{className:xt({[_e.isActive]:Lt(y||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>p(Nt(y)),children:E.jsx(s,{})}),d&&E.jsx("div",{className:xt({[_e.isActive]:Lt(b||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>m(Nt(b)),children:E.jsx(d,{})}),S&&E.jsx("div",{className:xt({[_e.isActive]:Lt(I||T.BooleanNumber.FALSE)},_e.buttonItem),onClick:()=>_(Nt(I)),children:E.jsx(S,{})}),E.jsx(xe,{color:w,onChange:C,iconId:"FontColor"}),E.jsx(xe,{color:R,onChange:h,iconId:"PaintBucket"})]})},xa=e=>{var S;const{onChange:t,interceptorManager:r}=e,n=ee.useDependency(T.LocaleService),o=ee.useDependency(T.IUniverInstanceService).getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),u=o.getActiveSheet(),y=((S=e.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?e.rule:void 0,p=L.useRef(null),[b,m]=L.useState(!1),I=L.useRef({}),[_,w]=L.useState({}),[C,R]=L.useState(()=>(y==null?void 0:y.subType)===c.CFSubRuleType.formula?y.value:"="),[h,i]=L.useState(void 0),s=l=>({style:l.style,value:C,type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula});L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return s({style:_})}}),[_,C,r]),L.useEffect(()=>r.intercept(r.getInterceptPoints().beforeSubmit,{handler:(g,f,v)=>h||C.length===1||!C.startsWith("=")?(i(n.t("sheet.cf.errorMessage.formulaError")),!1):v(g)}),[h,C]);const d=l=>{t(s(l))};return ee.useSidebarClick(l=>{var f;const g=(f=I.current)==null?void 0:f.handleOutClick;g&&g(l,()=>m(!1))}),E.jsxs("div",{ref:p,children:[E.jsx("div",{className:`
83
+ ${A.title}
84
+ ${A.mTBase}
85
+ `,children:n.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
86
+ ${A.mTSm}
87
+ `,children:E.jsx(Ge.FormulaEditor,{onChange:l=>{R(l),d({style:_})},onVerify:(l,g)=>{!l||g.length===1?i(n.t("sheet.cf.errorMessage.formulaError")):i(void 0)},errorText:h,onFocus:()=>{m(!0)},actions:I.current,isFocus:b,initValue:C,unitId:o.getUnitId(),subUnitId:u==null?void 0:u.getSheetId()})}),E.jsx("div",{className:`
88
+ ${G.cfPreviewWrap}
89
+ `,children:E.jsx(We,{rule:s({style:_})})}),E.jsx(vn,{style:y==null?void 0:y.style,className:`
99
90
  ${A.mTSm}
100
- `,onChange:u=>{I(u),d({style:u,formula:R})}})]})},Ut=t=>x.jsxs("div",{style:{position:"relative"},children:[x.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:t.errorText}),t.children]}),le=(t,e)=>({label:e.t(`sheet.cf.operator.${t}`),value:t}),ki=t=>{const{type:e,operator:r,onChange:n,value:i,interceptorManager:a}=t,l=v.useDependency(v.LocaleService),[S,f]=j.useState(()=>typeof i=="number"?i:0),[b,m]=j.useState(""),[T,_]=j.useState(()=>typeof i=="string"?i:""),[I,R]=j.useState(""),[w,h]=j.useState(()=>Array.isArray(i)?i[0]===void 0?0:i[0]:0),[o,s]=j.useState(""),[d,C]=j.useState(()=>Array.isArray(i)?i[1]===void 0?100:i[1]:100),[u,g]=j.useState("");switch(j.useEffect(()=>{switch(e){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)&&n(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(r)&&n(S),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)&&n([w,d]);break}}},[e]),j.useEffect(()=>{const p=a.intercept(a.getInterceptPoints().beforeSubmit,{handler:(y,M,L)=>{switch(e){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(r))return T?L(y):(R(l.t("sheet.cf.errorMessage.notBlank")),!1)}return L(y)}});return()=>{p()}},[e,S,T,r]),e){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)){const p=y=>{_(y),n(y)};return x.jsx("div",{className:`
91
+ `,onChange:l=>{w(l),d({style:l})}})]})},Ut=e=>E.jsxs("div",{style:{position:"relative"},children:[E.jsx("div",{style:{position:"absolute",zIndex:999,bottom:"-13px",fontSize:"10px",color:"red"},children:e.errorText}),e.children]}),ce=(e,t)=>({label:t.t(`sheet.cf.operator.${e}`),value:e}),Na=e=>{const{type:t,operator:r,onChange:n,value:a,interceptorManager:o}=e,u=ee.useDependency(T.LocaleService),[y,p]=L.useState(()=>typeof a=="number"?a:0),[b,m]=L.useState(""),[I,_]=L.useState(()=>typeof a=="string"?a:""),[w,C]=L.useState(""),[R,h]=L.useState(()=>Array.isArray(a)?a[0]===void 0?0:a[0]:0),[i,s]=L.useState(""),[d,S]=L.useState(()=>Array.isArray(a)?a[1]===void 0?100:a[1]:100),[l,g]=L.useState("");switch(L.useEffect(()=>{switch(t){case c.CFSubRuleType.text:{[c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)&&n(I);break}case c.CFSubRuleType.number:{[c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)&&n(y),[c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)&&n([R,d]);break}}},[t]),L.useEffect(()=>{const f=o.intercept(o.getInterceptPoints().beforeSubmit,{handler:(v,P,U)=>{switch(t){case c.CFSubRuleType.text:if([c.CFTextOperator.beginsWith,c.CFTextOperator.containsText,c.CFTextOperator.endsWith,c.CFTextOperator.notEqual,c.CFTextOperator.notContainsText,c.CFTextOperator.equal].includes(r))return I?U(v):(C(u.t("sheet.cf.errorMessage.notBlank")),!1)}return U(v)}});return()=>{f()}},[t,y,I,r]),t){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(r)){const f=v=>{_(v),n(v)};return E.jsx("div",{className:`
101
92
  ${A.mTSm}
102
- `,children:x.jsx(Ut,{errorText:I,children:x.jsx(ie.Input,{className:G.width100,value:T,onChange:y=>{R(""),p(y)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)){const p=y=>{f(y||0),n(y||0),m("")};return x.jsx("div",{className:`
93
+ `,children:E.jsx(Ut,{errorText:w,children:E.jsx(ae.Input,{className:G.width100,value:I,onChange:v=>{C(""),f(v)}})})})}break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(r)){const f=v=>{p(v||0),n(v||0),m("")};return E.jsx("div",{className:`
103
94
  ${A.mTSm}
104
- `,children:x.jsx(Ut,{errorText:b,children:x.jsx(ie.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:S,onChange:p})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)){const p=M=>{h(M||0),n([M||0,d]),s("")},y=M=>{C(M||0),n([w,M||0]),g("")};return x.jsxs("div",{className:`
95
+ `,children:E.jsx(Ut,{errorText:b,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:G.width100,value:y,onChange:f})})})}if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(r)){const f=P=>{h(P||0),n([P||0,d]),s("")},v=P=>{S(P||0),n([R,P||0]),g("")};return E.jsxs("div",{className:`
105
96
  ${A.mTSm}
106
97
  ${A.labelContainer}
107
- `,children:[x.jsx(Ut,{errorText:o,children:x.jsx(ie.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:w,onChange:p})}),x.jsx(Ut,{errorText:u,children:x.jsx(ie.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
98
+ `,children:[E.jsx(Ut,{errorText:i,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,value:R,onChange:f})}),E.jsx(Ut,{errorText:l,children:E.jsx(ae.InputNumber,{min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,className:`
108
99
  ${A.mLSm}
109
- `,value:d,onChange:y})})]})}}}return null},Ir=(t,e)=>{switch(t){case c.CFSubRuleType.text:return[le(c.CFTextOperator.containsText,e),le(c.CFTextOperator.notContainsText,e),le(c.CFTextOperator.beginsWith,e),le(c.CFTextOperator.endsWith,e),le(c.CFTextOperator.equal,e),le(c.CFTextOperator.notEqual,e),le(c.CFTextOperator.containsBlanks,e),le(c.CFTextOperator.notContainsBlanks,e),le(c.CFTextOperator.containsErrors,e),le(c.CFTextOperator.notContainsErrors,e)];case c.CFSubRuleType.number:return[le(c.CFNumberOperator.between,e),le(c.CFNumberOperator.notBetween,e),le(c.CFNumberOperator.equal,e),le(c.CFNumberOperator.notEqual,e),le(c.CFNumberOperator.greaterThan,e),le(c.CFNumberOperator.greaterThanOrEqual,e),le(c.CFNumberOperator.lessThan,e),le(c.CFNumberOperator.lessThanOrEqual,e)];case c.CFSubRuleType.timePeriod:return[le(c.CFTimePeriodOperator.yesterday,e),le(c.CFTimePeriodOperator.today,e),le(c.CFTimePeriodOperator.tomorrow,e),le(c.CFTimePeriodOperator.last7Days,e),le(c.CFTimePeriodOperator.lastWeek,e),le(c.CFTimePeriodOperator.thisWeek,e),le(c.CFTimePeriodOperator.nextWeek,e),le(c.CFTimePeriodOperator.lastMonth,e),le(c.CFTimePeriodOperator.thisMonth,e),le(c.CFTimePeriodOperator.nextMonth,e)]}},wr=t=>{var C;const{interceptorManager:e,onChange:r}=t,n=v.useDependency(v.LocaleService),i=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.highlightCell?t.rule:void 0,[a,l]=j.useState(()=>{const u=c.CFSubRuleType.text;return i&&i.subType||u}),S=[{value:c.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],f=j.useMemo(()=>Ir(a,n),[a]),[b,m]=j.useState(()=>{const u=f?f[0].value:void 0;return i&&i.operator||u}),[T,_]=j.useState(()=>{var p;const u="";return i?(p=i.value)!=null?p:c.createDefaultValue(i.subType,i.operator):u}),[I,R]=j.useState({}),w=j.useMemo(()=>u=>{var g,p,y,M,L,V,U,E,D,W,X,Y,ne,ee,F;switch(u.subType||a){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(b))return{type:c.CFRuleType.highlightCell,subType:(g=u.subType)!=null?g:a,operator:(p=u.operator)!=null?p:b,style:(y=u.style)!=null?y:I,value:(M=u.value)!=null?M: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(b))return{type:c.CFRuleType.highlightCell,subType:(L=u.subType)!=null?L:a,operator:(V=u.operator)!=null?V:b,style:(U=u.style)!=null?U:I,value:(E=u.value)!=null?E:T};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(b))return{type:c.CFRuleType.highlightCell,subType:(D=u.subType)!=null?D:a,operator:(W=u.operator)!=null?W:b,style:(X=u.style)!=null?X:I,value:(Y=u.value)!=null?Y:T};break}}return{type:c.CFRuleType.highlightCell,subType:(ne=u.subType)!=null?ne:a,operator:(ee=u.operator)!=null?ee:b,style:(F=u.style)!=null?F:I}},[a,b,T,I]);j.useEffect(()=>e.intercept(e.getInterceptPoints().submit,{handler(){return w({})}}),[w,e]),j.useEffect(()=>{S.some(u=>u.value===a)||l(S[0].value)},[S]);const h=u=>{const g=u,p=Ir(g,n),y=p&&p[0].value;l(g),m(y),y&&_(c.createDefaultValue(g,y)),r(w({subType:g,operator:y}))},o=u=>{const g=u;m(g),r(w({operator:g}))},s=u=>{_(u),r(w({value:u}))},d=j.useMemo(()=>`${a}_${b}_${Math.random()}`,[a,b]);return x.jsxs("div",{children:[x.jsx("div",{className:`
100
+ `,value:d,onChange:v})})]})}}}return null},br=(e,t)=>{switch(e){case c.CFSubRuleType.text:return[ce(c.CFTextOperator.containsText,t),ce(c.CFTextOperator.notContainsText,t),ce(c.CFTextOperator.beginsWith,t),ce(c.CFTextOperator.endsWith,t),ce(c.CFTextOperator.equal,t),ce(c.CFTextOperator.notEqual,t),ce(c.CFTextOperator.containsBlanks,t),ce(c.CFTextOperator.notContainsBlanks,t),ce(c.CFTextOperator.containsErrors,t),ce(c.CFTextOperator.notContainsErrors,t)];case c.CFSubRuleType.number:return[ce(c.CFNumberOperator.between,t),ce(c.CFNumberOperator.notBetween,t),ce(c.CFNumberOperator.equal,t),ce(c.CFNumberOperator.notEqual,t),ce(c.CFNumberOperator.greaterThan,t),ce(c.CFNumberOperator.greaterThanOrEqual,t),ce(c.CFNumberOperator.lessThan,t),ce(c.CFNumberOperator.lessThanOrEqual,t)];case c.CFSubRuleType.timePeriod:return[ce(c.CFTimePeriodOperator.yesterday,t),ce(c.CFTimePeriodOperator.today,t),ce(c.CFTimePeriodOperator.tomorrow,t),ce(c.CFTimePeriodOperator.last7Days,t),ce(c.CFTimePeriodOperator.lastWeek,t),ce(c.CFTimePeriodOperator.thisWeek,t),ce(c.CFTimePeriodOperator.nextWeek,t),ce(c.CFTimePeriodOperator.lastMonth,t),ce(c.CFTimePeriodOperator.thisMonth,t),ce(c.CFTimePeriodOperator.nextMonth,t)]}},Cr=e=>{var S;const{interceptorManager:t,onChange:r}=e,n=ee.useDependency(T.LocaleService),a=((S=e.rule)==null?void 0:S.type)===c.CFRuleType.highlightCell?e.rule:void 0,[o,u]=L.useState(()=>{const l=c.CFSubRuleType.text;return a&&a.subType||l}),y=[{value:c.CFSubRuleType.text,label:n.t("sheet.cf.subRuleType.text")},{value:c.CFSubRuleType.number,label:n.t("sheet.cf.subRuleType.number")},{value:c.CFSubRuleType.timePeriod,label:n.t("sheet.cf.subRuleType.timePeriod")},{value:c.CFSubRuleType.duplicateValues,label:n.t("sheet.cf.subRuleType.duplicateValues")},{value:c.CFSubRuleType.uniqueValues,label:n.t("sheet.cf.subRuleType.uniqueValues")}],p=L.useMemo(()=>br(o,n),[o]),[b,m]=L.useState(()=>{const l=p?p[0].value:void 0;return a&&a.operator||l}),[I,_]=L.useState(()=>{var f;const l="";return a?(f=a.value)!=null?f:c.createDefaultValue(a.subType,a.operator):l}),[w,C]=L.useState({}),R=L.useMemo(()=>l=>{var g,f,v,P,U,z,V,O,x,W,X,Y,re,te,F;switch(l.subType||o){case c.CFSubRuleType.text:{if([c.CFTextOperator.beginsWith,c.CFTextOperator.endsWith,c.CFTextOperator.containsText,c.CFTextOperator.notContainsText,c.CFTextOperator.equal,c.CFTextOperator.notEqual].includes(b))return{type:c.CFRuleType.highlightCell,subType:(g=l.subType)!=null?g:o,operator:(f=l.operator)!=null?f:b,style:(v=l.style)!=null?v:w,value:(P=l.value)!=null?P:I};break}case c.CFSubRuleType.number:{if([c.CFNumberOperator.equal,c.CFNumberOperator.notEqual,c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual,c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(b))return{type:c.CFRuleType.highlightCell,subType:(U=l.subType)!=null?U:o,operator:(z=l.operator)!=null?z:b,style:(V=l.style)!=null?V:w,value:(O=l.value)!=null?O:I};if([c.CFNumberOperator.between,c.CFNumberOperator.notBetween].includes(b))return{type:c.CFRuleType.highlightCell,subType:(x=l.subType)!=null?x:o,operator:(W=l.operator)!=null?W:b,style:(X=l.style)!=null?X:w,value:(Y=l.value)!=null?Y:I};break}}return{type:c.CFRuleType.highlightCell,subType:(re=l.subType)!=null?re:o,operator:(te=l.operator)!=null?te:b,style:(F=l.style)!=null?F:w}},[o,b,I,w]);L.useEffect(()=>t.intercept(t.getInterceptPoints().submit,{handler(){return R({})}}),[R,t]),L.useEffect(()=>{y.some(l=>l.value===o)||u(y[0].value)},[y]);const h=l=>{const g=l,f=br(g,n),v=f&&f[0].value;u(g),m(v),v&&_(c.createDefaultValue(g,v)),r(R({subType:g,operator:v}))},i=l=>{const g=l;m(g),r(R({operator:g}))},s=l=>{_(l),r(R({value:l}))},d=L.useMemo(()=>`${o}_${b}_${Math.random()}`,[o,b]);return E.jsxs("div",{children:[E.jsx("div",{className:`
110
101
  ${A.title}
111
102
  ${A.mTBase}
112
- `,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(ie.Select,{className:`
103
+ `,children:n.t("sheet.cf.panel.styleRule")}),E.jsx(ae.Select,{className:`
113
104
  ${A.mTSm}
114
105
  ${G.width100}
115
- `,onChange:h,value:a,options:S}),(f==null?void 0:f.length)&&x.jsx(ie.Select,{className:`
106
+ `,onChange:h,value:o,options:y}),(p==null?void 0:p.length)&&E.jsx(ae.Select,{className:`
116
107
  ${A.mTSm}
117
108
  ${G.width100}
118
- `,onChange:o,value:b||"",options:f}),x.jsx(ki,{value:T,interceptorManager:e,type:a,operator:b,rule:i,onChange:s},d),x.jsx("div",{className:`
109
+ `,onChange:i,value:b||"",options:p}),E.jsx(Na,{value:I,interceptorManager:t,type:o,operator:b,rule:a,onChange:s},d),E.jsx("div",{className:`
119
110
  ${G.cfPreviewWrap}
120
- `,children:x.jsx(We,{rule:w({})})}),x.jsx(yn,{style:i==null?void 0:i.style,className:`
111
+ `,children:E.jsx(We,{rule:R({})})}),E.jsx(vn,{style:a==null?void 0:a.style,className:`
121
112
  ${A.mLXxs}
122
- `,onChange:u=>{R(u),r(w({style:u}))}})]})},_r=(t,e)=>(c.iconMap[t]||[])[Number(e)]||"",Bi=t=>{var f;const e=v.useDependency(v.IUniverInstanceService),r=e.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(f=e.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:f.getSheetId(),i=j.useMemo(()=>t.error?G.errorInput:"",[t.error]),a=j.useRef({}),[l,S]=j.useState(!1);return ge.useSidebarClick(b=>{var T;const m=(T=a.current)==null?void 0:T.handleOutClick;m&&m(b,()=>S(!1))}),x.jsx("div",{className:G.positionRelative,children:t.type!==c.CFValueType.formula?x.jsxs(x.Fragment,{children:[x.jsx(ie.InputNumber,{className:i,value:Number(t.value)||0,onChange:b=>t.onChange(b!=null?b:0)}),t.error&&x.jsx("div",{className:G.errorText,children:t.error})]}):x.jsx("div",{style:{width:"100%"},children:x.jsx(Ge.FormulaEditor,{initValue:String(t.value),unitId:r,subUnitId:n,isFocus:l,onChange:(b="")=>{const m=b||"";t.onChange(m)},onFocus:()=>S(!0),actions:a.current})})})},xr=(t,e,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-e)*10},iconType:t,iconId:String(e)}),Fi=j.forwardRef((t,e)=>{const r=v.useDependency(v.LocaleService),n=i=>{t.onClick(i)};return x.jsx("div",{ref:e,className:G.iconGroupList,children:c.iconGroup.map((i,a)=>x.jsxs("div",{className:G.group,children:[x.jsx("div",{className:G.title,children:r.t(i.title)}),x.jsx("div",{className:G.itemContent,children:i.group.map(l=>x.jsx("div",{className:G.itemWrap,onClick:()=>{n(l.name)},children:x.jsx("div",{className:G.item,children:l.list.map((S,f)=>x.jsx("img",{className:G.icon,src:S},f))})},l.name))})]},a))})}),Gi=t=>{const e=j.useMemo(()=>{const n=[];for(const i in c.iconMap){const a=c.iconMap[i],l=i;a.forEach((S,f)=>{n.push({iconType:l,base64:S,iconId:String(f)})})}return n},[]),r=n=>{t.onClick(n.iconType,n.iconId)};return x.jsxs("div",{className:G.iconItemListWrap,children:[x.jsxs("div",{className:G.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:"",base64:""}),children:[x.jsx(Ze,{className:G.icon}),x.jsx("span",{children:"无单元格图标"})]}),x.jsx("div",{className:G.iconItemList,children:e.map(n=>x.jsx("div",{className:G.item,children:x.jsx("img",{onClick:()=>r(n),className:`
113
+ `,onChange:l=>{C(l),r(R({style:l}))}})]})},Tr=(e,t)=>(c.iconMap[e]||[])[Number(t)]||"",La=e=>{var p;const t=ee.useDependency(T.IUniverInstanceService),r=t.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),n=(p=t.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:p.getSheetId(),a=L.useMemo(()=>e.error?G.errorInput:"",[e.error]),o=L.useRef({}),[u,y]=L.useState(!1);return ee.useSidebarClick(b=>{var I;const m=(I=o.current)==null?void 0:I.handleOutClick;m&&m(b,()=>y(!1))}),E.jsx("div",{className:G.positionRelative,children:e.type!==c.CFValueType.formula?E.jsxs(E.Fragment,{children:[E.jsx(ae.InputNumber,{className:a,value:Number(e.value)||0,onChange:b=>e.onChange(b!=null?b:0)}),e.error&&E.jsx("div",{className:G.errorText,children:e.error})]}):E.jsx("div",{style:{width:"100%"},children:E.jsx(Ge.FormulaEditor,{initValue:String(e.value),unitId:r,subUnitId:n,isFocus:u,onChange:(b="")=>{const m=b||"";e.onChange(m)},onFocus:()=>y(!0),actions:o.current})})})},Ir=(e,t,r)=>({operator:c.CFNumberOperator.greaterThan,value:{type:c.CFValueType.num,value:(r.length-1-t)*10},iconType:e,iconId:String(t)}),Ua=L.forwardRef((e,t)=>{const r=ee.useDependency(T.LocaleService),n=a=>{e.onClick(a)};return E.jsx("div",{ref:t,className:G.iconGroupList,children:c.iconGroup.map((a,o)=>E.jsxs("div",{className:G.group,children:[E.jsx("div",{className:G.title,children:r.t(a.title)}),E.jsx("div",{className:G.itemContent,children:a.group.map(u=>E.jsx("div",{className:G.itemWrap,onClick:()=>{n(u.name)},children:E.jsx("div",{className:G.item,children:u.list.map((y,p)=>E.jsx("img",{className:G.icon,src:y},p))})},u.name))})]},o))})}),Va=e=>{const t=L.useMemo(()=>{const n=[];for(const a in c.iconMap){const o=c.iconMap[a],u=a;o.forEach((y,p)=>{n.push({iconType:u,base64:y,iconId:String(p)})})}return n},[]),r=n=>{e.onClick(n.iconType,n.iconId)};return E.jsxs("div",{className:G.iconItemListWrap,children:[E.jsxs("div",{className:G.none,onClick:()=>r({iconType:c.EMPTY_ICON_TYPE,iconId:""}),children:[E.jsx($e,{className:G.icon}),E.jsx("span",{children:"无单元格图标"})]}),E.jsx("div",{className:G.iconItemList,children:t.map(n=>E.jsx("div",{className:G.item,children:E.jsx("img",{onClick:()=>r(n),className:`
123
114
  ${G.icon}
124
- `,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},qi=t=>{const{onChange:e,configList:r,errorMap:n={}}=t,i=v.useDependency(v.LocaleService),a=[{label:i.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:i.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],l=[{label:i.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:i.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:i.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:i.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],S=(T,_)=>{e([String(_),"value","value"],T)},f=(T,_)=>{e([String(_),"operator"],T);const I=c.createDefaultValue(c.CFSubRuleType.number,T);S(I,_)},b=(T,_)=>{e([String(_),"value","type"],T);const I=r[_],R=c.createDefaultValue(c.CFSubRuleType.number,I.operator);S(R,_)};return j.useMemo(()=>r.map((T,_)=>{const I=n[_],R=_r(T.iconType,T.iconId),w=_===r.length-1,h=_===0,o=r[_-1],s=(o==null?void 0:o.value.type)===c.CFValueType.formula?i.t("sheet.cf.valueType.formula"):o==null?void 0:o.value.value,d=(C,u)=>{const g={...T,iconId:u,iconType:C};e([String(_)],g)};return x.jsxs("div",{className:`
115
+ `,src:n.base64})},`${n.iconType}_${n.iconId}`))})]})},za=e=>{const{onChange:t,configList:r,errorMap:n={}}=e,a=ee.useDependency(T.LocaleService),o=[{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThan}`),value:c.CFNumberOperator.greaterThan},{label:a.t(`sheet.cf.symbol.${c.CFNumberOperator.greaterThanOrEqual}`),value:c.CFNumberOperator.greaterThanOrEqual}],u=[{label:a.t(`sheet.cf.valueType.${c.CFValueType.num}`),value:c.CFValueType.num},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percent}`),value:c.CFValueType.percent},{label:a.t(`sheet.cf.valueType.${c.CFValueType.percentile}`),value:c.CFValueType.percentile},{label:a.t(`sheet.cf.valueType.${c.CFValueType.formula}`),value:c.CFValueType.formula}],y=(I,_)=>{t([String(_),"value","value"],I)},p=(I,_)=>{t([String(_),"operator"],I);const w=c.createDefaultValue(c.CFSubRuleType.number,I);y(w,_)},b=(I,_)=>{t([String(_),"value","type"],I);const w=r[_],C=c.createDefaultValue(c.CFSubRuleType.number,w.operator);y(C,_)};return L.useMemo(()=>r.map((I,_)=>{const w=n[_],C=Tr(I.iconType,I.iconId),R=_===r.length-1,h=_===0,i=r[_-1],s=(i==null?void 0:i.value.type)===c.CFValueType.formula?a.t("sheet.cf.valueType.formula"):i==null?void 0:i.value.value,d=(S,l)=>{const g={...I,iconId:l,iconType:S};t([String(_)],g)};return E.jsxs("div",{className:`
125
116
  ${_?A.mTXl:A.mTSm}
126
- `,children:[x.jsxs("div",{className:`
127
- ${A.label}
128
- ${G.flex}
129
- `,children:[x.jsxs("div",{className:`
130
- ${G.width45}
131
- `,children:[i.t("sheet.cf.iconSet.icon"),_+1]}),x.jsx("div",{className:`
132
- ${G.width45}
133
- `,children:x.jsxs(x.Fragment,{children:[!h&&!w&&i.t("sheet.cf.iconSet.rule"),!h&&!w&&x.jsxs("span",{className:G.stress,children:["(",i.t("sheet.cf.iconSet.when"),i.t(`sheet.cf.symbol.${c.getOppositeOperator(o.operator)}`),s,w?"":` ${i.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),x.jsxs("div",{className:`
134
- ${G.flex}
135
- ${A.mTSm}
136
- `,children:[x.jsx("div",{className:`
137
- ${G.iconWrap}
138
- ${G.width45}
139
- `,children:x.jsx(ie.DropdownLegacy,{overlay:x.jsx(Gi,{onClick:d,iconId:T.iconId,iconType:T.iconType}),children:x.jsxs("div",{className:G.dropdownIcon,children:[R?x.jsx("img",{src:R,className:G.icon}):x.jsx(Ze,{className:G.icon}),x.jsx(Tt,{})]})})}),w?x.jsxs("div",{className:`
117
+ `,children:[E.jsxs("div",{className:`
118
+ ${A.label}
119
+ ${G.flex}
120
+ `,children:[E.jsxs("div",{className:`
121
+ ${G.width45}
122
+ `,children:[a.t("sheet.cf.iconSet.icon"),_+1]}),E.jsx("div",{className:`
123
+ ${G.width45}
124
+ `,children:E.jsxs(E.Fragment,{children:[!h&&!R&&a.t("sheet.cf.iconSet.rule"),!h&&!R&&E.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]})})]}),E.jsxs("div",{className:`
125
+ ${G.flex}
126
+ ${A.mTSm}
127
+ `,children:[E.jsx("div",{className:`
128
+ ${G.iconWrap}
129
+ ${G.width45}
130
+ `,children:E.jsx(ae.DropdownLegacy,{overlay:E.jsx(Va,{onClick:d,iconId:I.iconId,iconType:I.iconType}),children:E.jsxs("div",{className:G.dropdownIcon,children:[C?E.jsx("img",{src:C,className:G.icon}):E.jsx($e,{className:G.icon}),E.jsx(Tt,{})]})})}),R?E.jsxs("div",{className:`
140
131
  ${G.width45}
141
132
  ${A.label}
142
- `,style:{marginTop:0},children:[i.t("sheet.cf.iconSet.rule"),x.jsxs("span",{className:G.stress,children:["(",i.t("sheet.cf.iconSet.when"),i.t(`sheet.cf.symbol.${c.getOppositeOperator(o.operator)}`),s,w?"":` ${i.t("sheet.cf.iconSet.and")} `,")"]})]}):x.jsx(ie.Select,{className:`
133
+ `,style:{marginTop:0},children:[a.t("sheet.cf.iconSet.rule"),E.jsxs("span",{className:G.stress,children:["(",a.t("sheet.cf.iconSet.when"),a.t(`sheet.cf.symbol.${c.getOppositeOperator(i.operator)}`),s,R?"":` ${a.t("sheet.cf.iconSet.and")} `,")"]})]}):E.jsx(ae.Select,{className:`
143
134
  ${A.mL0}
144
135
  ${G.width45}
145
136
  ${A.mR0}
146
- `,options:a,value:T.operator,onChange:C=>{f(C,_)}})]}),w?x.jsx("div",{}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:`
147
- ${A.mTSm}
148
- ${A.label}
149
- ${G.flex}
150
- `,children:[x.jsx("div",{className:`
151
- ${G.width45}
152
- `,children:i.t("sheet.cf.iconSet.type")}),x.jsx("div",{className:`
153
- ${G.width45}
154
- `,children:i.t("sheet.cf.iconSet.value")})]}),x.jsxs("div",{className:`
155
- ${A.mTSm}
156
- ${G.flex}
157
- `,children:[x.jsx(ie.Select,{style:{flexShrink:0},className:`
137
+ `,options:o,value:I.operator,onChange:S=>{p(S,_)}})]}),R?E.jsx("div",{}):E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:`
138
+ ${A.mTSm}
139
+ ${A.label}
140
+ ${G.flex}
141
+ `,children:[E.jsx("div",{className:`
142
+ ${G.width45}
143
+ `,children:a.t("sheet.cf.iconSet.type")}),E.jsx("div",{className:`
144
+ ${G.width45}
145
+ `,children:a.t("sheet.cf.iconSet.value")})]}),E.jsxs("div",{className:`
146
+ ${A.mTSm}
147
+ ${G.flex}
148
+ `,children:[E.jsx(ae.Select,{style:{flexShrink:0},className:`
158
149
  ${G.width45}
159
150
  ${A.mL0}
160
- `,options:l,value:T.value.type,onChange:C=>{b(C,_)}}),x.jsx("div",{className:`
161
- ${A.mL0}
162
- ${G.width45}
163
- `,children:x.jsx(Bi,{id:_,type:T.value.type,error:I,value:T.value.value||"",onChange:C=>S(C,_)})})]})]})]},_)}),[r,n])},Xi=t=>{var C;const{interceptorManager:e}=t,r=((C=t.rule)==null?void 0:C.type)===c.CFRuleType.iconSet?t.rule:void 0,n=v.useDependency(v.LocaleService),[i,a]=j.useState({}),[l,S]=j.useState(()=>{const u=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(y=>y.iconType!==g))return g}return u}),[f,b]=j.useState(()=>{if(r&&r.config.length)return v.Tools.deepClone(r==null?void 0:r.config);const u=c.iconMap[l]||[];return new Array(u.length).fill("").map((g,p,y)=>p===y.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:l,iconId:String(p)}:xr(l,p,y))}),[m,T]=j.useState(()=>r?!!r.isShowValue:!0),_=j.useMemo(()=>{const u=f.map(g=>_r(g.iconType,g.iconId));return x.jsx("div",{className:G.iconWrap,children:u.map((g,p)=>g?x.jsx("img",{className:G.icon,src:g},p):x.jsx(Ze,{className:G.icon},p))})},[f]),I=u=>{if(u.reduce((p,y,M)=>p.preType&&!p.result||u.length-1===M?p:y.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:p.preType?{result:p.preType===y.value.type,preType:y.value.type}:{result:!0,preType:y.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(u[0].value.type)){const p={};return u.forEach((y,M,L)=>{if(M-1<0||M===L.length-1)return;const U=u[M-1],E=c.getOppositeOperator(U.operator);c.compareWithNumber({operator:E,value:U.value.value},y.value.value)||(p[M]=`${n.t(`sheet.cf.form.${E}`,String(U.value.value))} `)}),p}return{}},R=(u,g)=>{v.get(f,u)!==g&&(v.set(f,u,g),b([...f]),a(I(f)))},w=u=>{S(u);const g=c.iconMap[u]||[],p=new Array(g.length).fill("").map((y,M,L)=>xr(u,M,L));b(p),a(I(p))};j.useEffect(()=>{const u=e.intercept(e.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:f}}});return()=>{u()}},[m,f,e]),j.useEffect(()=>{const u=e.intercept(e.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(i).length===0}});return()=>{u()}},[m,f,e,i]);const h=()=>{const u=f.map(g=>({...g}));f.forEach((g,p)=>{const y=f.length-1-p,M=u[y];g.iconId=M.iconId,g.iconType=M.iconType}),b([...f])},o=v.useDependency(ge.ILayoutService),[s,d]=j.useState();return ge.useScrollYOverContainer(s,o.rootContainerElement),x.jsxs("div",{className:G.iconSet,children:[x.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),x.jsx("div",{className:`
164
- ${A.mTSm}
165
- `,children:x.jsx(ie.DropdownLegacy,{placement:"bottomLeft",overlay:x.jsx(Fi,{ref:u=>!s&&u&&d(u),iconType:l,onClick:w}),children:x.jsxs("div",{className:G.dropdownIcon,style:{width:"unset"},children:[_,x.jsx(Tt,{})]})})}),x.jsxs("div",{className:`
166
- ${A.mTSm}
167
- ${G.renderConfig}
168
- `,children:[x.jsxs("div",{className:G.utilItem,children:[x.jsx(ie.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),x.jsxs("div",{className:`
169
- ${G.utilItem}
170
- ${A.mLXl}
171
- `,children:[x.jsx(ie.Checkbox,{checked:!m,onChange:u=>{T(!u)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),x.jsx(qi,{errorMap:i,onChange:R,configList:f})]})},Yi=t=>{var h;const{onChange:e,interceptorManager:r}=t,n=v.useDependency(v.LocaleService),i=((h=t.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?t.rule:void 0,a=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[l,S]=j.useState(()=>{const o=a[0].value,s=i==null?void 0:i.type;if(!i)return o;switch(s){case c.CFRuleType.highlightCell:switch(i.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(i.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(i.operator)?"lessThanAverage":o;case c.CFSubRuleType.rank:return i.isBottom?"isBottom":"isNotBottom"}}return o}),[f,b]=j.useState(()=>{const s=i==null?void 0:i.type;if(!i)return 10;switch(s){case c.CFRuleType.highlightCell:switch(i.subType){case c.CFSubRuleType.rank:return i.value||10}}return 10}),[m,T]=j.useState(()=>{const s=i==null?void 0:i.type;if(!i)return!1;switch(s){case c.CFRuleType.highlightCell:switch(i.subType){case c.CFSubRuleType.rank:return i.isPercent||!1}}return!1}),[_,I]=j.useState({}),R=o=>{const{type:s,isPercent:d,value:C,style:u}=o;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:C,style:u};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:C,style:u};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:u};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:u}};j.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return R({type:l,isPercent:m,value:f,style:_})}}),[l,m,f,_,r]);const w=o=>{e(R(o))};return x.jsxs("div",{children:[x.jsx("div",{className:`
151
+ `,options:u,value:I.value.type,onChange:S=>{b(S,_)}}),E.jsx("div",{className:`
152
+ ${A.mL0}
153
+ ${G.width45}
154
+ `,children:E.jsx(La,{id:_,type:I.value.type,error:w,value:I.value.value||"",onChange:S=>y(S,_)})})]})]})]},_)}),[r,n])},ka=e=>{var S;const{interceptorManager:t}=e,r=((S=e.rule)==null?void 0:S.type)===c.CFRuleType.iconSet?e.rule:void 0,n=ee.useDependency(T.LocaleService),[a,o]=L.useState({}),[u,y]=L.useState(()=>{const l=Object.keys(c.iconMap)[0];if(r&&r.config.length){const g=r.config[0].iconType;if(!r.config.some(v=>v.iconType!==g))return g}return l}),[p,b]=L.useState(()=>{if(r&&r.config.length)return T.Tools.deepClone(r==null?void 0:r.config);const l=c.iconMap[u]||[];return new Array(l.length).fill("").map((g,f,v)=>f===v.length-1?{operator:c.CFNumberOperator.lessThanOrEqual,value:{type:c.CFValueType.num,value:Number.MAX_SAFE_INTEGER},iconType:u,iconId:String(f)}:Ir(u,f,v))}),[m,I]=L.useState(()=>r?!!r.isShowValue:!0),_=L.useMemo(()=>{const l=p.map(g=>Tr(g.iconType,g.iconId));return E.jsx("div",{className:G.iconWrap,children:l.map((g,f)=>g?E.jsx("img",{className:G.icon,src:g},f):E.jsx($e,{className:G.icon},f))})},[p]),w=l=>{if(l.reduce((f,v,P)=>f.preType&&!f.result||l.length-1===P?f:v.value.type===c.CFValueType.formula?{preType:c.CFValueType.formula,result:!1}:f.preType?{result:f.preType===v.value.type,preType:v.value.type}:{result:!0,preType:v.value.type},{result:!0,preType:""}).result&&[c.CFValueType.num,c.CFValueType.percent,c.CFValueType.percentile].includes(l[0].value.type)){const f={};return l.forEach((v,P,U)=>{if(P-1<0||P===U.length-1)return;const V=l[P-1],O=c.getOppositeOperator(V.operator);c.compareWithNumber({operator:O,value:V.value.value},v.value.value)||(f[P]=`${n.t(`sheet.cf.form.${O}`,String(V.value.value))} `)}),f}return{}},C=(l,g)=>{T.get(p,l)!==g&&(T.set(p,l,g),b([...p]),o(w(p)))},R=l=>{y(l);const g=c.iconMap[l]||[],f=new Array(g.length).fill("").map((v,P,U)=>Ir(l,P,U));b(f),o(w(f))};L.useEffect(()=>{const l=t.intercept(t.getInterceptPoints().submit,{handler(){return{type:c.CFRuleType.iconSet,isShowValue:m,config:p}}});return()=>{l()}},[m,p,t]),L.useEffect(()=>{const l=t.intercept(t.getInterceptPoints().beforeSubmit,{handler(){return Object.keys(a).length===0}});return()=>{l()}},[m,p,t,a]);const h=()=>{const l=p.map(g=>({...g}));p.forEach((g,f)=>{const v=p.length-1-f,P=l[v];g.iconId=P.iconId,g.iconType=P.iconType}),b([...p])},i=ee.useDependency(ee.ILayoutService),[s,d]=L.useState();return ee.useScrollYOverContainer(s,i.rootContainerElement),E.jsxs("div",{className:G.iconSet,children:[E.jsx("div",{className:A.title,children:n.t("sheet.cf.panel.styleRule")}),E.jsx("div",{className:`
155
+ ${A.mTSm}
156
+ `,children:E.jsx(ae.DropdownLegacy,{placement:"bottomLeft",overlay:E.jsx(Ua,{ref:l=>{!s&&l&&d(l)},iconType:u,onClick:R}),children:E.jsxs("div",{className:G.dropdownIcon,style:{width:"unset"},children:[_,E.jsx(Tt,{})]})})}),E.jsxs("div",{className:`
157
+ ${A.mTSm}
158
+ ${G.renderConfig}
159
+ `,children:[E.jsxs("div",{className:G.utilItem,children:[E.jsx(ae.Checkbox,{onChange:h}),n.t("sheet.cf.iconSet.reverseIconOrder")]}),E.jsxs("div",{className:`
160
+ ${G.utilItem}
161
+ ${A.mLXl}
162
+ `,children:[E.jsx(ae.Checkbox,{checked:!m,onChange:l=>{I(!l)}}),n.t("sheet.cf.iconSet.onlyShowIcon")]})]}),E.jsx(za,{errorMap:a,onChange:C,configList:p})]})},Aa=e=>{var h;const{onChange:t,interceptorManager:r}=e,n=ee.useDependency(T.LocaleService),a=((h=e.rule)==null?void 0:h.type)===c.CFRuleType.highlightCell?e.rule:void 0,o=[{label:n.t("sheet.cf.panel.isNotBottom"),value:"isNotBottom"},{label:n.t("sheet.cf.panel.isBottom"),value:"isBottom"},{label:n.t("sheet.cf.panel.greaterThanAverage"),value:"greaterThanAverage"},{label:n.t("sheet.cf.panel.lessThanAverage"),value:"lessThanAverage"}],[u,y]=L.useState(()=>{const i=o[0].value,s=a==null?void 0:a.type;if(!a)return i;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.average:return[c.CFNumberOperator.greaterThan,c.CFNumberOperator.greaterThanOrEqual].includes(a.operator)?"greaterThanAverage":[c.CFNumberOperator.lessThan,c.CFNumberOperator.lessThanOrEqual].includes(a.operator)?"lessThanAverage":i;case c.CFSubRuleType.rank:return a.isBottom?"isBottom":"isNotBottom"}}return i}),[p,b]=L.useState(()=>{const s=a==null?void 0:a.type;if(!a)return 10;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.value||10}}return 10}),[m,I]=L.useState(()=>{const s=a==null?void 0:a.type;if(!a)return!1;switch(s){case c.CFRuleType.highlightCell:switch(a.subType){case c.CFSubRuleType.rank:return a.isPercent||!1}}return!1}),[_,w]=L.useState({}),C=i=>{const{type:s,isPercent:d,value:S,style:l}=i;if(s==="isNotBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!1,value:S,style:l};if(s==="isBottom")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank,isPercent:d,isBottom:!0,value:S,style:l};if(s==="greaterThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.greaterThan,style:l};if(s==="lessThanAverage")return{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.average,operator:c.CFNumberOperator.lessThan,style:l}};L.useEffect(()=>r.intercept(r.getInterceptPoints().submit,{handler(){return C({type:u,isPercent:m,value:p,style:_})}}),[u,m,p,_,r]);const R=i=>{t(C(i))};return E.jsxs("div",{children:[E.jsx("div",{className:`
172
163
  ${A.title}
173
164
  ${A.mTBase}
174
- `,children:n.t("sheet.cf.panel.styleRule")}),x.jsx(ie.Select,{className:`
165
+ `,children:n.t("sheet.cf.panel.styleRule")}),E.jsx(ae.Select,{className:`
175
166
  ${G.width100}
176
167
  ${A.mTSm}
177
- `,value:l,options:a,onChange:o=>{S(o),w({type:o,isPercent:m,value:f,style:_})}}),["isNotBottom","isBottom"].includes(l)&&x.jsxs("div",{className:`
168
+ `,value:u,options:o,onChange:i=>{y(i),R({type:i,isPercent:m,value:p,style:_})}}),["isNotBottom","isBottom"].includes(u)&&E.jsxs("div",{className:`
178
169
  ${A.labelContainer}
179
170
  ${A.mTSm}
180
- `,children:[x.jsx(ie.InputNumber,{min:1,max:1e3,value:f,onChange:o=>{const s=o||0;b(s),w({type:l,isPercent:m,value:s,style:_})}}),x.jsxs("div",{className:`
171
+ `,children:[E.jsx(ae.InputNumber,{min:1,max:1e3,value:p,onChange:i=>{const s=i||0;b(s),R({type:u,isPercent:m,value:s,style:_})}}),E.jsxs("div",{className:`
181
172
  ${A.mLSm}
182
173
  ${A.labelContainer}
183
174
  ${G.text}
184
- `,children:[x.jsx(ie.Checkbox,{checked:m,onChange:o=>{T(!!o),w({type:l,isPercent:!!o,value:f,style:_})}}),n.t("sheet.cf.valueType.percent")]})]}),x.jsx("div",{className:`
175
+ `,children:[E.jsx(ae.Checkbox,{checked:m,onChange:i=>{I(!!i),R({type:u,isPercent:!!i,value:p,style:_})}}),n.t("sheet.cf.valueType.percent")]})]}),E.jsx("div",{className:`
185
176
  ${G.cfPreviewWrap}
186
- `,children:x.jsx(We,{rule:R({type:l,isPercent:m,value:f,style:_})})}),x.jsx(yn,{style:i==null?void 0:i.style,className:`
177
+ `,children:E.jsx(We,{rule:C({type:u,isPercent:m,value:p,style:_})})}),E.jsx(vn,{style:a==null?void 0:a.style,className:`
187
178
  ${A.mTSm}
188
- `,onChange:o=>{I(o),w({type:l,isPercent:m,value:f,style:o})}})]})},Ki=v.createInterceptorKey("beforeSubmit"),$i=v.createInterceptorKey("submit"),Er=t=>t.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),Or=t=>{var e;return(e=t.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:e.getSheetId()},Zi=t=>{var L,V,U;const e=v.useDependency(v.LocaleService),r=v.useDependency(v.ICommandService),n=v.useDependency(v.IUniverInstanceService),i=v.useDependency(c.ConditionalFormattingRuleModel),a=v.useDependency(q.SheetsSelectionsService),l=Er(n),S=Or(n),[f,b]=j.useState(!0),m=j.useRef({}),[T,_]=j.useState(void 0),I=j.useRef((V=(L=t.rule)==null?void 0:L.ranges)!=null?V:[]),R=j.useMemo(()=>{var D,W,X;let E=(D=t.rule)==null?void 0:D.ranges;return E!=null&&E.length||(E=(X=(W=a.getCurrentSelections())==null?void 0:W.map(Y=>Y.range))!=null?X:[]),I.current=E,E!=null&&E.length?E.map(Y=>{const ne=qt.serializeRange(Y);return ne==="NaN"?"":ne}).filter(Y=>!!Y).join(","):""},[t.rule]),w=[{label:e.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:e.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:e.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:e.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:e.t("sheet.cf.ruleType.formula"),value:"5"},{label:e.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,o]=j.useState(()=>{var W,X;const E=(W=t.rule)==null?void 0:W.rule.type,D=w[0].value;if(!E)return D;switch(E){case c.CFRuleType.highlightCell:{switch((X=t.rule)==null?void 0:X.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return D}),s=j.useRef(),d=j.useMemo(()=>new v.InterceptorManager({beforeSubmit:Ki,submit:$i}),[]),C=j.useMemo(()=>{switch(h){case"1":return wr;case"2":return Yi;case"3":return Wi;case"4":return Ai;case"5":return Hi;case"6":return Xi;default:return wr}},[h]);j.useEffect(()=>{const E=r.onCommandExecuted(D=>{if(D.id===q.RemoveSheetMutation.id){const W=D.params;W.subUnitId===S&&W.unitId===l&&t.onCancel()}D.id===q.SetWorksheetActiveOperation.id&&t.onCancel()});return()=>E.dispose()},[]);const u=E=>{s.current=E},g=E=>{const D=E.split(",").filter(W=>!!W).map(qt.deserializeRangeWithSheet).map(W=>W.range);I.current=D},p=()=>{if(T)return;const D=(()=>{const X=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!X)throw new Error("No active sheet found");return I.current.map(ee=>q.setEndForRange(ee,X.getRowCount(),X.getColumnCount())).filter(ee=>!(Number.isNaN(ee.startRow)||Number.isNaN(ee.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const X=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(X){const Y=Er(n),ne=Or(n);if(!Y||!ne)throw new Error("No active sheet found");let ee={};t.rule&&t.rule.cfId?(ee={...t.rule,ranges:D,rule:X},r.executeCommand(Rt.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel()):(ee={cfId:i.createCfId(Y,ne),ranges:D,rule:X,stopIfTrue:!1},r.executeCommand(Xe.id,{unitId:Y,subUnitId:ne,rule:ee}),t.onCancel())}}},y=()=>{t.onCancel()},M=(E,D)=>{E?D.length<1?_(e.t("sheet.cf.errorMessage.rangeError")):_(void 0):_(e.t("sheet.cf.errorMessage.rangeError"))};return ge.useSidebarClick(E=>{var W;const D=(W=m.current)==null?void 0:W.handleOutClick;D&&D(E,()=>b(!1))}),x.jsxs("div",{className:G.cfRuleStyleEditor,children:[x.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.range")}),x.jsx("div",{className:`
179
+ `,onChange:i=>{w(i),R({type:u,isPercent:m,value:p,style:i})}})]})},Wa=T.createInterceptorKey("beforeSubmit"),ja=T.createInterceptorKey("submit"),wr=e=>e.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),Rr=e=>{var t;return(t=e.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:t.getSheetId()},Ha=e=>{var U,z,V;const t=ee.useDependency(T.LocaleService),r=ee.useDependency(T.ICommandService),n=ee.useDependency(T.IUniverInstanceService),a=ee.useDependency(c.ConditionalFormattingRuleModel),o=ee.useDependency(q.SheetsSelectionsService),u=wr(n),y=Rr(n),[p,b]=L.useState(!0),m=L.useRef({}),[I,_]=L.useState(void 0),w=L.useRef((z=(U=e.rule)==null?void 0:U.ranges)!=null?z:[]),C=L.useMemo(()=>{var x,W,X;let O=(x=e.rule)==null?void 0:x.ranges;return O!=null&&O.length||(O=(X=(W=o.getCurrentSelections())==null?void 0:W.map(Y=>Y.range))!=null?X:[]),w.current=O,O!=null&&O.length?O.map(Y=>{const re=Gt.serializeRange(Y);return re==="NaN"?"":re}).filter(Y=>!!Y).join(","):""},[e.rule]),R=[{label:t.t("sheet.cf.ruleType.highlightCell"),value:"1"},{label:t.t("sheet.cf.panel.rankAndAverage"),value:"2"},{label:t.t("sheet.cf.ruleType.dataBar"),value:"3"},{label:t.t("sheet.cf.ruleType.colorScale"),value:"4"},{label:t.t("sheet.cf.ruleType.formula"),value:"5"},{label:t.t("sheet.cf.ruleType.iconSet"),value:"6"}],[h,i]=L.useState(()=>{var W,X;const O=(W=e.rule)==null?void 0:W.rule.type,x=R[0].value;if(!O)return x;switch(O){case c.CFRuleType.highlightCell:{switch((X=e.rule)==null?void 0:X.rule.subType){case c.CFSubRuleType.number:case c.CFSubRuleType.text:case c.CFSubRuleType.duplicateValues:case c.CFSubRuleType.uniqueValues:case c.CFSubRuleType.timePeriod:return"1";case c.CFSubRuleType.average:case c.CFSubRuleType.rank:return"2";case c.CFSubRuleType.formula:return"5"}break}case c.CFRuleType.dataBar:return"3";case c.CFRuleType.colorScale:return"4";case c.CFRuleType.iconSet:return"6"}return x}),s=L.useRef(void 0),d=L.useMemo(()=>new T.InterceptorManager({beforeSubmit:Wa,submit:ja}),[]),S=L.useMemo(()=>{switch(h){case"1":return Cr;case"2":return Aa;case"3":return Pa;case"4":return Da;case"5":return xa;case"6":return ka;default:return Cr}},[h]);L.useEffect(()=>{const O=r.onCommandExecuted(x=>{if(x.id===q.RemoveSheetMutation.id){const W=x.params;W.subUnitId===y&&W.unitId===u&&e.onCancel()}x.id===q.SetWorksheetActiveOperation.id&&e.onCancel()});return()=>O.dispose()},[]);const l=O=>{s.current=O},g=O=>{const x=O.split(",").filter(W=>!!W).map(Gt.deserializeRangeWithSheet).map(W=>W.range);w.current=x},f=()=>{if(I)return;const x=(()=>{const X=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet();if(!X)throw new Error("No active sheet found");return w.current.map(te=>q.setEndForRange(te,X.getRowCount(),X.getColumnCount())).filter(te=>!(Number.isNaN(te.startRow)||Number.isNaN(te.startColumn)))})();if(d.fetchThroughInterceptors(d.getInterceptPoints().beforeSubmit)(!0,null)){const X=d.fetchThroughInterceptors(d.getInterceptPoints().submit)(null,null);if(X){const Y=wr(n),re=Rr(n);if(!Y||!re)throw new Error("No active sheet found");let te={};e.rule&&e.rule.cfId?(te={...e.rule,ranges:x,rule:X},r.executeCommand(bt.id,{unitId:Y,subUnitId:re,rule:te}),e.onCancel()):(te={cfId:a.createCfId(Y,re),ranges:x,rule:X,stopIfTrue:!1},r.executeCommand(Xe.id,{unitId:Y,subUnitId:re,rule:te}),e.onCancel())}}},v=()=>{e.onCancel()},P=(O,x)=>{O?x.length<1?_(t.t("sheet.cf.errorMessage.rangeError")):_(void 0):_(t.t("sheet.cf.errorMessage.rangeError"))};return ee.useSidebarClick(O=>{var W;const x=(W=m.current)==null?void 0:W.handleOutClick;x&&x(O,()=>b(!1))}),E.jsxs("div",{className:G.cfRuleStyleEditor,children:[E.jsx("div",{className:A.title,children:t.t("sheet.cf.panel.range")}),E.jsx("div",{className:`
189
180
  ${A.mTBase}
190
- `,children:x.jsx(Ge.RangeSelector,{unitId:l,errorText:T,subUnitId:S,initValue:R,onChange:g,onVerify:M,onFocus:()=>b(!0),isFocus:f,actions:m.current})}),x.jsx("div",{className:A.title,children:e.t("sheet.cf.panel.styleType")}),x.jsx("div",{className:A.mTBase,children:x.jsx(ie.Select,{className:G.width100,value:h,options:w,onChange:E=>o(E)})}),x.jsx(C,{interceptorManager:d,rule:(U=t.rule)==null?void 0:U.rule,onChange:u}),x.jsxs("div",{className:`
181
+ `,children:E.jsx(Ge.RangeSelector,{unitId:u,errorText:I,subUnitId:y,initValue:C,onChange:g,onVerify:P,onFocus:()=>b(!0),isFocus:p,actions:m.current})}),E.jsx("div",{className:A.title,children:t.t("sheet.cf.panel.styleType")}),E.jsx("div",{className:A.mTBase,children:E.jsx(ae.Select,{className:G.width100,value:h,options:R,onChange:O=>i(O)})}),E.jsx(S,{interceptorManager:d,rule:(V=e.rule)==null?void 0:V.rule,onChange:l}),E.jsxs("div",{className:`
191
182
  ${A.mTBase}
192
183
  ${G.btnList}
193
- `,children:[x.jsx(ie.Button,{size:"small",onClick:y,children:e.t("sheet.cf.panel.cancel")}),x.jsx(ie.Button,{className:A.mLSm,size:"small",type:"primary",onClick:p,children:e.t("sheet.cf.panel.submit")})]})]})},Ji=t=>{const[e,r]=j.useState(t.rule),[n,i]=j.useState(!!t.rule),a=()=>{i(!0)},l=()=>{i(!1),r(void 0)},S=f=>{r(f),i(!0)};return x.jsx("div",{className:A.conditionalFormattingWrap,children:n?x.jsx(Zi,{onCancel:l,rule:e}):x.jsx(zi,{onClick:S,onCreate:a})})};var Qi=Object.defineProperty,ea=Object.getOwnPropertyDescriptor,ta=(t,e,r,n)=>{for(var i=n>1?void 0:n?ea(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Qi(e,r,i),i},lt=(t,e)=>(r,n)=>e(r,n,t);const Vt="sheet.conditional.formatting.panel";let ut=class extends v.Disposable{constructor(e,r,n,i,a){super();Pe(this,"_sidebarDisposable",null);this._univerInstanceService=e,this._injector=r,this._componentManager=n,this._sidebarService=i,this._localeService=a,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(l=>{var S;l||(S=this._sidebarDisposable)==null||S.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(l=>{l.id===Vt&&(l.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(e){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:e,key:v.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ji)}};ut=ta([lt(0,v.IUniverInstanceService),lt(1,v.Inject(v.Injector)),lt(2,v.Inject(ge.ComponentManager)),lt(3,v.Inject(ge.ISidebarService)),lt(4,v.Inject(v.LocaleService))],ut);var ve=(t=>(t[t.createRule=1]="createRule",t[t.viewRule=2]="viewRule",t[t.highlightCell=3]="highlightCell",t[t.rank=4]="rank",t[t.formula=5]="formula",t[t.colorScale=6]="colorScale",t[t.dataBar=7]="dataBar",t[t.icon=8]="icon",t[t.clearRangeRules=9]="clearRangeRules",t[t.clearWorkSheetRules=10]="clearWorkSheetRules",t))(ve||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:v.CommandType.OPERATION,handler:(t,e)=>{var S;const r=t.get(ut),n=t.get(q.SheetsSelectionsService),i=t.get(v.ICommandService),a=((S=n.getCurrentSelections())==null?void 0:S.map(f=>f.range))||[];switch(e.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:a});break}case 4:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(f);break}case 5:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(f);break}case 6:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(f);break}case 7:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(f);break}case 8:{const f={...c.createDefaultRule,ranges:a,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(f);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:a});break}case 9:{i.executeCommand(St.id,{ranges:a});break}case 10:{i.executeCommand(Ye.id);break}}return!0}};var na=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,ia=(t,e,r,n)=>{for(var i=n>1?void 0:n?ra(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&na(e,r,i),i},dt=(t,e)=>(r,n)=>e(r,n,t);let ft=class extends v.Disposable{constructor(e,r,n,i,a){super();Pe(this,"_copyInfo");this._sheetClipboardService=e,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=i,this._univerInstanceService=a,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(e,r,n)=>this._collectConditionalRule(e,r,n),onPasteCells:(e,r,n,i)=>{const{copyType:a=de.COPY_TYPE.COPY,pasteType:l}=i,{range:S}=e||{},{range:f}=r;return this._generateConditionalFormattingMutations(f,{copyType:a,pasteType:l,copyRange:S})}}))}_collectConditionalRule(e,r,n){const i=new v.ObjectMatrix,a={};this._copyInfo={matrix:i,info:{unitId:e,subUnitId:r,cfMap:a}};const l=this._injector.invoke(m=>de.rangeToDiscreteRange(n,m,e,r));if(!l)return;const{rows:S,cols:f}=l,b=new Set;S.forEach((m,T)=>{f.forEach((_,I)=>{const R=this._conditionalFormattingViewModel.getCellCfs(e,r,m,_);R&&(R.forEach(w=>b.add(w.cfId)),i.setValue(T,I,R.map(w=>w.cfId)))})}),b.forEach(m=>{const T=this._conditionalFormattingRuleModel.getRule(e,r,m);T&&(a[m]=T.rule)})}_generateConditionalFormattingMutations(e,r){const n=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),i=n.getActiveSheet(),a=n.getUnitId();if(!i)return{redos:[],undos:[]};const l=i.getSheetId();if(r.copyType===de.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,de.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,de.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[f,b],mapFunc:m}=de.virtualizeDiscreteRanges([r.copyRange,e]),T=de.getRepeatRange(f,b,!0),_={};v.Range.foreach(b,(u,g)=>{const{row:p,col:y}=m(u,g),M=this._conditionalFormattingViewModel.getCellCfs(a,l,p,y);M&&M.forEach(L=>{if(!_[L.cfId]){const V=new v.ObjectMatrix;_[L.cfId]=V;const U=this._conditionalFormattingRuleModel.getRule(a,l,L.cfId);U==null||U.ranges.forEach(E=>{v.Range.foreach(E,(D,W)=>{V.setValue(D,W,1)})})}_[L.cfId].realDeleteValue(p,y)})});const{matrix:I,info:R}=this._copyInfo,w=[];let h=this._conditionalFormattingRuleModel.createCfId(a,l);const o={},s=u=>{if(o[u])return o[u];const g=R==null?void 0:R.cfMap[u],p=[...this._conditionalFormattingRuleModel.getSubunitRules(a,l)||[],...w].find(y=>v.Tools.diffValue(y.rule,g));if(p)return o[u]=p,p;{const y={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return o[u]=y,w.push(y),h=`${Number(h)+1}`,y}};T.forEach(u=>{I&&I.forValue((g,p,y)=>{const M=v.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:p,endColumn:p},u.startRange),{row:L,col:V}=m(M.startRow,M.startColumn);y.forEach(U=>{if(!_[U]){const E=s(U),D=new v.ObjectMatrix;_[U]=D,E.ranges.forEach(W=>{v.Range.foreach(W,(X,Y)=>{D.setValue(X,Y,1)})})}_[U].setValue(L,V,1)})})});const d=[],C=[];for(const u in _){const g=_[u],p=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!p.length){const y={unitId:a,subUnitId:l,cfId:u};d.push({id:c.DeleteConditionalRuleMutation.id,params:y}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,y))}if(w.some(y=>y.cfId===u)){const y=s(u),M={unitId:a,subUnitId:l,rule:{...y,ranges:p}};d.push({id:c.AddConditionalRuleMutation.id,params:M}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,M))}else{const y=this._conditionalFormattingRuleModel.getRule(a,l,u);if(!y)continue;const M={unitId:a,subUnitId:l,rule:{...y,ranges:p}};d.push({id:c.SetConditionalRuleMutation.id,params:M}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,M))}}return{redos:d,undos:C}}};ft=ia([dt(0,v.Inject(de.ISheetClipboardService)),dt(1,v.Inject(c.ConditionalFormattingRuleModel)),dt(2,v.Inject(v.Injector)),dt(3,v.Inject(c.ConditionalFormattingViewModel)),dt(4,v.Inject(v.IUniverInstanceService))],ft);var aa=Object.defineProperty,oa=Object.getOwnPropertyDescriptor,sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?oa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&aa(e,r,i),i},Sn=(t,e)=>(r,n)=>e(r,n,t);let pt=class extends v.Disposable{constructor(t,e,r){super(),this._localeService=t,this._commandService=e,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(t=>{t.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},t.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};pt=sa([Sn(0,v.Inject(v.LocaleService)),Sn(1,v.ICommandService),Sn(2,v.Inject(q.SheetPermissionCheckController))],pt);var la=Object.defineProperty,ua=Object.getOwnPropertyDescriptor,ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?ua(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&la(e,r,i),i},zt=(t,e)=>(r,n)=>e(r,n,t);let ht=class extends v.Disposable{constructor(t,e,r,n){super(),this._conditionalFormattingRuleModel=t,this._univerInstanceService=e,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const t=new Map,e=(n,i,a)=>`${n}_${i}_${a}`,r=(n,i,a)=>{const l=f=>{const b=[...a.ranges],m=b.map(_=>q.handleDefaultRangeChangeWithEffectRefCommands(_,f)).filter(_=>!!_);if(c.isRangesEqual(m,b))return{redos:[],undos:[]};if(m.length){const _={unitId:n,subUnitId:i,rule:{...a,ranges:m}},I=[{id:c.SetConditionalRuleMutation.id,params:_}],R=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:R}}else{const _={unitId:n,subUnitId:i,cfId:a.cfId},I=[{id:c.DeleteConditionalRuleMutation.id,params:_}],R=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:I,undos:R}}},S=[];a.ranges.forEach(f=>{const b=this._refRangeService.registerRefRange(f,l);S.push(()=>b.dispose())}),t.set(e(n,i,a.cfId),()=>S.forEach(f=>f()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:i,subUnitId:a,rule:l}=n,S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),f=S.getActiveSheet();if(!(n.unitId!==S.getUnitId()||n.subUnitId!==(f==null?void 0:f.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const b=t.get(e(i,a,l.cfId));b&&b();break}case"set":{const b=t.get(e(i,a,l.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(v.toDisposable(()=>{t.forEach(n=>{n()}),t.clear()}))}};ht=ca([zt(0,v.Inject(c.ConditionalFormattingRuleModel)),zt(1,v.Inject(v.IUniverInstanceService)),zt(2,v.Inject(v.Injector)),zt(3,v.Inject(q.RefRangeService))],ht);var da=Object.defineProperty,fa=Object.getOwnPropertyDescriptor,pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?fa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&da(e,r,i),i},ke=(t,e)=>(r,n)=>e(r,n,t);let mt=class extends v.Disposable{constructor(e,r,n,i,a,l){super();Pe(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=e,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=i,this._conditionalFormattingViewModel=a,this._conditionalFormattingRuleModel=l,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,i;const e=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(e))==null||r.with(de.SheetSkeletonManagerService).reCalculate(),(i=(n=this._renderManagerService.getRenderById(e))==null?void 0:n.mainComponent)==null||i.makeDirty()}_initSkeleton(){this.disposeWithMe(Re.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(e=>!!e.length),qe.filter(e=>{const r=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?e.filter(i=>i.unitId===r.getUnitId()&&i.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:v.InterceptorEffectEnum.Style,handler:(e,r,n)=>{const i=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!i)return n(e);const a=r.workbook.getStyles(),S={...(typeof(e==null?void 0:e.s)=="string"?a.get(e==null?void 0:e.s):e==null?void 0:e.s)||{}},f={...e,s:S};return i.style&&Object.assign(S,i.style),f.fontRenderExtension||(f.fontRenderExtension={},i.isShowValue!==void 0&&(f.fontRenderExtension.isSkip=!i.isShowValue)),i.dataBar&&(f.dataBar=i.dataBar),i.iconSet&&(f.iconSet=i.iconSet,f.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(f)},priority:10}))}};mt=pa([ke(0,v.Inject(q.SheetInterceptorService)),ke(1,v.Inject(c.ConditionalFormattingService)),ke(2,v.Inject(v.IUniverInstanceService)),ke(3,v.Inject(wn.IRenderManagerService)),ke(4,v.Inject(c.ConditionalFormattingViewModel)),ke(5,v.Inject(c.ConditionalFormattingRuleModel))],mt);const Pr="sheets-conditional-formatting-ui.config",At={};var Mr=Object.defineProperty,ha=Object.getOwnPropertyDescriptor,ma=(t,e,r)=>e in t?Mr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,ga=(t,e,r,n)=>{for(var i=n>1?void 0:n?ha(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Mr(e,r,i),i},bn=(t,e)=>(r,n)=>e(r,n,t),Dr=(t,e,r)=>ma(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends v.Plugin{constructor(e=At,r,n,i){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=i;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand(),this._injector.add([mt]),this._injector.add([ht]),this._injector.add([ft]),this._injector.add([pt]),this._injector.add([Ae])}_initCommand(){[Xt,Yt,Kt,$t,Zt,Jt,Qt,en,tn,ct,Ke,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},Dr($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Dr($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=ga([v.DependentOn(c.UniverSheetsConditionalFormattingPlugin),bn(1,v.Inject(v.Injector)),bn(2,v.Inject(v.ICommandService)),bn(3,v.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var va=Object.defineProperty,ya=Object.getOwnPropertyDescriptor,Sa=(t,e,r,n)=>{for(var i=n>1?void 0:n?ya(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&va(e,r,i),i},gt=(t,e)=>(r,n)=>e(r,n,t);let Wt=class extends v.Disposable{constructor(t,e,r,n,i){super(),this._injector=t,this._univerInstanceService=e,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=i,this._initAutoFill()}_initAutoFill(){const t=()=>({redos:[],undos:[]}),e=(i,a,l,S,f)=>{var I;const b=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(I=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:I.getSheetId();if(!b||!m)return;const T={startRow:i.row,startColumn:i.col,endColumn:i.col,endRow:i.row},_={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row};v.Range.foreach(l,(R,w)=>{const h=v.Rectangle.getPositionRange({startRow:R,startColumn:w,endColumn:w,endRow:R},T),o=v.Rectangle.getPositionRange({startRow:R,startColumn:w,endColumn:w,endRow:R},_),{row:s,col:d}=f(h.startRow,h.startColumn),C=this._conditionalFormattingViewModel.getCellCfs(b,m,s,d),{row:u,col:g}=f(o.startRow,o.startColumn),p=this._conditionalFormattingViewModel.getCellCfs(b,m,u,g);p&&p.forEach(y=>{let M=S.get(y.cfId);if(!S.get(y.cfId)){const L=this._conditionalFormattingRuleModel.getRule(b,m,y.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),S.set(y.cfId,M)}M.realDeleteValue(u,g)}),C&&C.forEach(y=>{let M=S.get(y.cfId);if(!S.get(y.cfId)){const L=this._conditionalFormattingRuleModel.getRule(b,m,y.cfId);if(!L)return;M=new v.ObjectMatrix,L.ranges.forEach(V=>{v.Range.foreach(V,(U,E)=>{M.setValue(U,E,1)})}),S.set(y.cfId,M)}M.setValue(u,g,1)})})},r=(i,a)=>{var o,s,d;const l=(o=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:o.getUnitId(),S=(d=(s=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),f=new Map,b=[],m=[];if(!l||!S)return t();const T=de.virtualizeDiscreteRanges([i,a]),[_,I]=T.ranges,{mapFunc:R}=T,w={row:_.startRow,col:_.startColumn};return de.getAutoFillRepeatRange(_,I).forEach(C=>{e(w,C.repeatStartCell,C.relativeRange,f,R)}),f.forEach((C,u)=>{const g=this._conditionalFormattingRuleModel.getRule(l,S,u);if(!g)return;const p=q.findAllRectangle(q.createTopMatrixFromMatrix(C));if(p.length){const y={unitId:l,subUnitId:S,rule:{...g,ranges:p}};b.push({id:c.SetConditionalRuleMutation.id,params:y}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,y))}else{const y={unitId:l,subUnitId:S,cfId:g.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:y}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,y))}}),{undos:m,redos:b}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(i,a,l)=>{if(l===de.APPLY_TYPE.COPY||l===de.APPLY_TYPE.ONLY_FORMAT||l===de.APPLY_TYPE.SERIES){const{source:S,target:f}=i;return r(S,f)}return t()}};this.disposeWithMe(this._autoFillService.addHook(n))}};Wt=Sa([gt(0,v.Inject(v.Injector)),gt(1,v.Inject(v.IUniverInstanceService)),gt(2,v.Inject(de.IAutoFillService)),gt(3,v.Inject(c.ConditionalFormattingRuleModel)),gt(4,v.Inject(c.ConditionalFormattingViewModel))],Wt);var ba=Object.defineProperty,Ra=Object.getOwnPropertyDescriptor,Ca=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ra(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&ba(e,r,i),i},vt=(t,e)=>(r,n)=>e(r,n,t);$.ConditionalFormattingClearController=class extends v.Disposable{constructor(e,r,n,i,a){super(),this._injector=e,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=i,this._conditionalFormattingRuleModel=a,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{var a;const r=[],n=[],i={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(e.id)){const l=(a=this._selectionManagerService.getCurrentSelections())==null?void 0:a.map(R=>R.range);if(!l)return i;const S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),f=S.getActiveSheet();if(!f)return i;const b=S.getUnitId(),m=f.getSheetId(),T=this._conditionalFormattingRuleModel.getSubunitRules(b,m);if(!T||!T.length)return i;const{redos:_,undos:I}=Nr(this._injector,T,l,b,m);r.push(..._),n.push(...I)}return i}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:r,ranges:n})=>{const i=[],a=[],l={redos:i,undos:a};if(!n||!n.length)return l;const S=this._conditionalFormattingRuleModel.getSubunitRules(e,r);if(!S||!S.length)return l;const{redos:f,undos:b}=Nr(this._injector,S,n,e,r);return i.push(...f),a.push(...b),l}}))}},$.ConditionalFormattingClearController=Ca([vt(0,v.Inject(v.Injector)),vt(1,v.Inject(v.IUniverInstanceService)),vt(2,v.Inject(q.SheetInterceptorService)),vt(3,v.Inject(q.SheetsSelectionsService)),vt(4,v.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Nr(t,e,r,n,i){const a=[],l=[];return e.filter(S=>r.some(f=>S.ranges.some(b=>v.Rectangle.getIntersects(b,f)))).forEach(S=>{const b=new q.RangeMergeUtil().add(...S.ranges).subtract(...r).merge();if(b.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:i,rule:{...S,ranges:b}}},T=c.setConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...T)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:i,cfId:S.cfId}},T=c.DeleteConditionalRuleMutationUndoFactory(t,m.params);a.push(m),l.push(...T)}}),{redos:a,undos:l}}var Ta=Object.defineProperty,Ia=Object.getOwnPropertyDescriptor,wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ia(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ta(e,r,i),i},jr=(t,e)=>(r,n)=>e(r,n,t);let Ht=class extends v.Disposable{constructor(t,e){super(),this._sheetInterceptorService=t,this._conditionalFormattingService=e,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(v.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(t,e,r)=>{var l,S,f;t||r(t);const n=this._conditionalFormattingService.composeStyle(e.unitId,e.subUnitId,e.row,e.col),i=(l=n==null?void 0:n.style)!=null?l:{},a=Object.keys(i);if(t!=null&&t.p)return(f=(S=t.p.body)==null?void 0:S.textRuns)==null||f.forEach(b=>{b.ts&&a.forEach(m=>{var T;(T=b.ts)==null||delete T[m]})}),r(t);{const b={...(typeof(t==null?void 0:t.s)=="string"?e.workbook.getStyles().get(t.s):t==null?void 0:t.s)||{}};a.forEach(T=>{delete b[T]});const m={...t,s:{...b}};return r(m)}}})))}};Ht=wa([jr(0,v.Inject(q.SheetInterceptorService)),jr(1,v.Inject(c.ConditionalFormattingService))],Ht);const Lr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],yt=[{label:"sheet.cf.ruleType.highlightCell",value:ve.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:ve.rank},{label:"sheet.cf.ruleType.formula",value:ve.formula},{label:"sheet.cf.ruleType.colorScale",value:ve.colorScale},{label:"sheet.cf.ruleType.dataBar",value:ve.dataBar},{label:"sheet.cf.ruleType.iconSet",value:ve.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:ve.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:ve.createRule},{label:"sheet.cf.menu.clearRangeRules",value:ve.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:ve.clearWorkSheetRules}],_a=t=>{const e=t.get(q.SheetsSelectionsService),r=t.get(v.ICommandService),n=t.get(v.IUniverInstanceService),i=t.get(c.ConditionalFormattingRuleModel),a=new Re.Observable(f=>Re.merge(e.selectionMoveEnd$,e.selectionSet$,new Re.Observable(b=>{const m=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,R=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(_)&&I.unitId===R&&b.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var w;const b=((w=e.getCurrentSelections())==null?void 0:w.map(h=>h.range))||[],m=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!m)return;const T=m.getActiveSheet();if(!T)return;const R=(i.getSubunitRules(m.getUnitId(),T.getSheetId())||[]).filter(h=>h.ranges.some(o=>b.some(s=>v.Rectangle.intersects(s,o)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(t,m.getUnitId(),T.getSheetId(),h));f.next(R)})),l=new Re.Observable(f=>new Re.Observable(b=>{const m=r.onCommandExecuted(T=>{var w;const{id:_,params:I}=T,R=(w=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:w.getUnitId();Lr.includes(_)&&I.unitId===R&&b.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET);if(!b)return;const m=b.getActiveSheet();if(!m)return;const T=i.getSubunitRules(b.getUnitId(),m.getSheetId())||[];if(!T.length)return f.next(!1),!1;const _=T.map(I=>I.ranges).every(I=>q.checkRangesEditablePermission(t,b.getUnitId(),m.getSheetId(),I));f.next(_)})),S=new Re.Observable(f=>{a.subscribe(b=>{const m=yt.find(T=>T.value===ve.clearRangeRules);m&&(m.disabled=!b,f.next(yt))}),l.subscribe(b=>{const m=yt.find(T=>T.value===ve.clearWorkSheetRules);m&&(m.disabled=!b,f.next(yt))}),f.next(yt)});return{id:ct.id,type:ge.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:S,hidden$:ge.getMenuHiddenObservable(t,v.UniverInstanceType.UNIVER_SHEET),disabled$:de.getCurrentRangeDisable$(t,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},xa={[ge.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:_a}}};var Ea=Object.defineProperty,Oa=Object.getOwnPropertyDescriptor,Pa=(t,e,r,n)=>{for(var i=n>1?void 0:n?Oa(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ea(e,r,i),i},Ur=(t,e)=>(r,n)=>e(r,n,t);let kt=class extends v.Disposable{constructor(e,r){super();Pe(this,"_sidebarDisposable",null);this._injector=e,this._menuManagerService=r,this._menuManagerService.mergeMenu(xa)}};kt=Pa([Ur(0,v.Inject(v.Injector)),Ur(1,ge.IMenuManagerService)],kt);var Ma=Object.defineProperty,Da=Object.getOwnPropertyDescriptor,Na=(t,e,r,n)=>{for(var i=n>1?void 0:n?Da(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Ma(e,r,i),i},Be=(t,e)=>(r,n)=>e(r,n,t);const ja=(t,e)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,i=r(e)%r(t),a=n(e)%n(t),l=Math.floor(r(e)/r(t)),S=Math.floor(n(e)/n(t)),f=[],b={startRow:0,endRow:r(t)-1,startColumn:0,endColumn:n(t)-1};if(r(e)===1&&n(e)===1){const m={startRow:e.startRow,endRow:e.startRow,startColumn:e.startColumn,endColumn:e.startColumn};return f.push({repeatRelativeRange:b,startRange:m}),f}for(let m=0;m<l+(i?.1:0);m++)for(let T=0;T<S+(a?.1:0);T++){const _=r(t)*m,I=n(t)*T,R={startRow:_+e.startRow,endRow:_+e.startRow,startColumn:I+e.startColumn,endColumn:I+e.startColumn};let w=b;m===l&&i&&(w={...w},w.endRow=w.endRow-(r(t)-i)),T===S&&a&&(w={...w},w.endColumn=w.endColumn-(n(t)-a)),f.push({repeatRelativeRange:w,startRange:R})}return f};let Bt=class extends v.Disposable{constructor(e,r,n,i,a,l){super();Pe(this,"_painterConfig",null);this._injector=e,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=i,this._conditionalFormattingRuleModel=a,this._conditionalFormattingViewModel=l,this._initFormattingPainter()}_initFormattingPainter(){const e=()=>({redos:[],undos:[]}),r=(a,l,S,f,b)=>{const{unitId:m,subUnitId:T}=this._painterConfig,{targetUnitId:_,targetSubUnitId:I}=b,R={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},w={startRow:l.row,startColumn:l.col,endColumn:l.col,endRow:l.row};v.Range.foreach(S,(h,o)=>{const s=v.Rectangle.getPositionRange({startRow:h,startColumn:o,endColumn:o,endRow:h},R),d=v.Rectangle.getPositionRange({startRow:h,startColumn:o,endColumn:o,endRow:h},w),C=this._conditionalFormattingViewModel.getCellCfs(m,T,s.startRow,s.startColumn),u=this._conditionalFormattingViewModel.getCellCfs(_,I,d.startRow,d.startColumn);u&&u.forEach(g=>{let p=f.get(g.cfId);if(!f.get(g.cfId)){const y=this._conditionalFormattingRuleModel.getRule(_,I,g.cfId);if(!y)return;p=new v.ObjectMatrix,y.ranges.forEach(M=>{v.Range.foreach(M,(L,V)=>{p.setValue(L,V,1)})}),f.set(g.cfId,p)}p.realDeleteValue(d.startRow,d.startColumn)}),C&&C.forEach(g=>{const p=f.get(g.cfId);p&&p.setValue(d.startRow,d.startColumn,1)})})},n=(a,l,S)=>{var s;const{range:f,unitId:b,subUnitId:m}=this._painterConfig,T=a!==b||m!==l,_=new Map,I=[],R=[];if(!a||!l||!b||!m)return e();const w=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,m))!=null?s:[];w==null||w.forEach(d=>{const{ranges:C,cfId:u}=d;if(C.some(g=>v.Rectangle.intersects(f,g))){const g=new v.ObjectMatrix;T||C.forEach(p=>{v.Range.foreach(p,(y,M)=>{g.setValue(y,M,1)})}),_.set(u,g)}});const h={row:f.startRow,col:f.startColumn};return ja(f,S).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:a,targetSubUnitId:l})}),_.forEach((d,C)=>{if(T){const u=this._conditionalFormattingRuleModel.getRule(a,l,C),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(u)if(g.length){const p={unitId:a,subUnitId:l,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:p}),R.push(...c.setConditionalRuleMutationUndoFactory(this._injector,p))}else{const p={unitId:a,subUnitId:l,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:p}),R.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,p))}else if(g.length){const p=this._conditionalFormattingRuleModel.getRule(b,m,C);if(p){const y={unitId:a,subUnitId:l,rule:{...v.Tools.deepClone(p),cfId:this._conditionalFormattingRuleModel.createCfId(a,l),ranges:g}};I.push({id:c.AddConditionalRuleMutation.id,params:y}),R.push(c.AddConditionalRuleMutationUndoFactory(this._injector,y))}}}else{const u=this._conditionalFormattingRuleModel.getRule(b,m,C);if(!u)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const p={unitId:b,subUnitId:m,rule:{...u,ranges:g}};I.push({id:c.SetConditionalRuleMutation.id,params:p}),R.push(...c.setConditionalRuleMutationUndoFactory(this._injector,p))}else{const p={unitId:b,subUnitId:m,cfId:u.cfId};I.push({id:c.DeleteConditionalRuleMutation.id,params:p}),R.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,p))}}}),{undos:R,redos:I}},i={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:a=>{var l,S,f;switch(a){case de.FormatPainterStatus.INFINITE:case de.FormatPainterStatus.ONCE:{const b=(l=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:l.getUnitId(),m=(f=(S=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET))==null?void 0:S.getActiveSheet())==null?void 0:f.getSheetId(),T=this._sheetsSelectionsService.getCurrentLastSelection(),_=T==null?void 0:T.range;b&&m&&_&&(this._painterConfig={unitId:b,subUnitId:m,range:_});break}case de.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(a,l,S)=>this._painterConfig?n(a,l,S):{redos:[],undos:[]}};this._formatPainterService.addHook(i)}};Bt=Na([Be(0,v.Inject(v.Injector)),Be(1,v.Inject(v.IUniverInstanceService)),Be(2,v.Inject(de.IFormatPainterService)),Be(3,v.Inject(q.SheetsSelectionsService)),Be(4,v.Inject(c.ConditionalFormattingRuleModel)),Be(5,v.Inject(c.ConditionalFormattingViewModel))],Bt);var La=Object.defineProperty,Ua=Object.getOwnPropertyDescriptor,Va=(t,e,r,n)=>{for(var i=n>1?void 0:n?Ua(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&La(e,r,i),i},Rn=(t,e)=>(r,n)=>e(r,n,t);let Ft=class extends v.Disposable{constructor(t,e,r){super(),this._conditionalFormattingViewModel=t,this._univerInstanceService=e,this._renderManagerService=r,this._init()}_init(){const t=this._univerInstanceService.getCurrentUnitForType(v.UniverInstanceType.UNIVER_SHEET),e=r=>{const n=r.getUnitId(),i=this._renderManagerService.getRenderById(n);if(!i)return;const a=i.with(de.SheetSkeletonManagerService);this.disposeWithMe(a.currentSkeleton$.subscribe(l=>{if(l){const S=l.skeleton.rowColumnSegment,f=S.endColumn-S.startColumn+1,m=(S.endRow-S.startRow+1)*f*9,T=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(T)}}))};t&&e(t),this._univerInstanceService.getCurrentTypeOfUnit$(v.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&e(r)})}};Ft=Va([Rn(0,v.Inject(c.ConditionalFormattingViewModel)),Rn(1,v.IUniverInstanceService),Rn(2,wn.IRenderManagerService)],Ft);var Vr=Object.defineProperty,za=Object.getOwnPropertyDescriptor,Aa=(t,e,r)=>e in t?Vr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Wa=(t,e,r,n)=>{for(var i=n>1?void 0:n?za(e,r):e,a=t.length-1,l;a>=0;a--)(l=t[a])&&(i=(n?l(e,r,i):l(i))||i);return n&&i&&Vr(e,r,i),i},Cn=(t,e)=>(r,n)=>e(r,n,t),zr=(t,e,r)=>Aa(t,typeof e!="symbol"?e+"":e,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends v.Plugin{constructor(e=At,r,n,i){super(),this._config=e,this._injector=r,this._commandService=n,this._configService=i;const{menu:a,...l}=v.merge({},At,this._config);a&&this._configService.setConfig("menu",a,{merge:!0}),this._configService.setConfig(Pr,l),this._initCommand()}onStarting(){v.registerDependencies(this._injector,[[mt],[ht],[ft],[Wt],[pt],[ut],[kt],[Ae],[Ht],[$.ConditionalFormattingClearController],[Bt],[Ft]]),v.touchDependencies(this._injector,[[mt]])}onReady(){v.touchDependencies(this._injector,[[kt],[ut]])}onRendered(){v.touchDependencies(this._injector,[[Wt],[$.ConditionalFormattingClearController],[ft],[Ht],[Ae],[Bt],[pt],[ht],[Ft]])}_initCommand(){[Xt,Yt,Kt,$t,Zt,Jt,Qt,en,tn,ct,Ke,Rt,bt,Xe,St,Ye].forEach(e=>{this._commandService.registerCommand(e)})}},zr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),zr($.UniverSheetsConditionalFormattingUIPlugin,"type",v.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Wa([v.DependentOn(c.UniverSheetsConditionalFormattingPlugin),Cn(1,v.Inject(v.Injector)),Cn(2,v.Inject(v.ICommandService)),Cn(3,v.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=Xt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Yt,$.AddDataBarConditionalRuleCommand=Kt,$.AddDuplicateValuesCfCommand=$t,$.AddNumberCfCommand=Zt,$.AddRankCfCommand=Jt,$.AddTextCfCommand=Qt,$.AddTimePeriodCfCommand=en,$.AddUniqueValuesCfCommand=tn,$.ClearRangeCfCommand=St,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=bt,$.OpenConditionalFormattingOperator=ct,$.SetCfCommand=Rt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
184
+ `,children:[E.jsx(ae.Button,{size:"small",onClick:v,children:t.t("sheet.cf.panel.cancel")}),E.jsx(ae.Button,{className:A.mLSm,size:"small",type:"primary",onClick:f,children:t.t("sheet.cf.panel.submit")})]})]})},Ba=e=>{const[t,r]=L.useState(e.rule),[n,a]=L.useState(!!e.rule),o=()=>{a(!0)},u=()=>{a(!1),r(void 0)},y=p=>{r(p),a(!0)};return E.jsx("div",{className:A.conditionalFormattingWrap,children:n?E.jsx(Ha,{onCancel:u,rule:t}):E.jsx(Ma,{onClick:y,onCreate:o})})};var Fa=Object.getOwnPropertyDescriptor,Ga=(e,t,r,n)=>{for(var a=n>1?void 0:n?Fa(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},st=(e,t)=>(r,n)=>t(r,n,e);const Vt="sheet.conditional.formatting.panel";let lt=class extends T.Disposable{constructor(t,r,n,a,o){super();De(this,"_sidebarDisposable",null);this._univerInstanceService=t,this._injector=r,this._componentManager=n,this._sidebarService=a,this._localeService=o,this._initPanel(),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(u=>{var y;u||(y=this._sidebarDisposable)==null||y.dispose()})),this.disposeWithMe(this._sidebarService.sidebarOptions$.subscribe(u=>{u.id===Vt&&(u.visible||setTimeout(()=>{this._sidebarService.sidebarOptions$.next({visible:!1})}))}))}openPanel(t){const r={id:Vt,header:{title:this._localeService.t("sheet.cf.title")},children:{label:Vt,rule:t,key:T.generateRandomId(4)},onClose:()=>this._sidebarDisposable=null};this._sidebarDisposable=this._sidebarService.open(r)}_initPanel(){this._componentManager.register(Vt,Ba)}};lt=Ga([st(0,T.IUniverInstanceService),st(1,T.Inject(T.Injector)),st(2,T.Inject(ee.ComponentManager)),st(3,T.Inject(ee.ISidebarService)),st(4,T.Inject(T.LocaleService))],lt);var me=(e=>(e[e.createRule=1]="createRule",e[e.viewRule=2]="viewRule",e[e.highlightCell=3]="highlightCell",e[e.rank=4]="rank",e[e.formula=5]="formula",e[e.colorScale=6]="colorScale",e[e.dataBar=7]="dataBar",e[e.icon=8]="icon",e[e.clearRangeRules=9]="clearRangeRules",e[e.clearWorkSheetRules=10]="clearWorkSheetRules",e))(me||{});const ct={id:"sheet.operation.open.conditional.formatting.panel",type:T.CommandType.OPERATION,handler:(e,t)=>{var y;const r=e.get(lt),n=e.get(q.SheetsSelectionsService),a=e.get(T.ICommandService),o=((y=n.getCurrentSelections())==null?void 0:y.map(p=>p.range))||[];switch(t.value){case 3:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 4:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.rank}};r.openPanel(p);break}case 5:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.highlightCell,subType:c.CFSubRuleType.formula,value:"="}};r.openPanel(p);break}case 6:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.colorScale,config:[]}};r.openPanel(p);break}case 7:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.dataBar,isShowValue:!0}};r.openPanel(p);break}case 8:{const p={...c.createDefaultRule,ranges:o,rule:{type:c.CFRuleType.iconSet,config:[],isShowValue:!0}};r.openPanel(p);break}case 2:{r.openPanel();break}case 1:{r.openPanel({...c.createDefaultRule(),ranges:o});break}case 9:{a.executeCommand(yt.id,{ranges:o});break}case 10:{a.executeCommand(Ye.id);break}}return!0}};var qa=Object.getOwnPropertyDescriptor,Xa=(e,t,r,n)=>{for(var a=n>1?void 0:n?qa(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},ut=(e,t)=>(r,n)=>t(r,n,e);let dt=class extends T.Disposable{constructor(t,r,n,a,o){super();De(this,"_copyInfo");this._sheetClipboardService=t,this._conditionalFormattingRuleModel=r,this._injector=n,this._conditionalFormattingViewModel=a,this._univerInstanceService=o,this._initClipboardHook()}_initClipboardHook(){this.disposeWithMe(this._sheetClipboardService.addClipboardHook({id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onBeforeCopy:(t,r,n)=>this._collectConditionalRule(t,r,n),onPasteCells:(t,r,n,a)=>{const{copyType:o=fe.COPY_TYPE.COPY,pasteType:u}=a,{range:y}=t||{},{range:p}=r;return this._generateConditionalFormattingMutations(p,{copyType:o,pasteType:u,copyRange:y})}}))}_collectConditionalRule(t,r,n){const a=new T.ObjectMatrix,o={};this._copyInfo={matrix:a,info:{unitId:t,subUnitId:r,cfMap:o}};const u=this._injector.invoke(m=>fe.rangeToDiscreteRange(n,m,t,r));if(!u)return;const{rows:y,cols:p}=u,b=new Set;y.forEach((m,I)=>{p.forEach((_,w)=>{const C=this._conditionalFormattingViewModel.getCellCfs(t,r,m,_);C&&(C.forEach(R=>b.add(R.cfId)),a.setValue(I,w,C.map(R=>R.cfId)))})}),b.forEach(m=>{const I=this._conditionalFormattingRuleModel.getRule(t,r,m);I&&(o[m]=I.rule)})}_generateConditionalFormattingMutations(t,r){const n=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),a=n.getActiveSheet(),o=n.getUnitId();if(!a)return{redos:[],undos:[]};const u=a.getSheetId();if(r.copyType===fe.COPY_TYPE.CUT)return this._copyInfo=null,{redos:[],undos:[]};if(!this._copyInfo||!r.copyRange)return{redos:[],undos:[]};if(![fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_FORMAT,fe.PREDEFINED_HOOK_NAME.DEFAULT_PASTE,fe.PREDEFINED_HOOK_NAME.SPECIAL_PASTE_BESIDES_BORDER].includes(r.pasteType))return{redos:[],undos:[]};const{ranges:[p,b],mapFunc:m}=fe.virtualizeDiscreteRanges([r.copyRange,t]),I=fe.getRepeatRange(p,b,!0),_={};T.Range.foreach(b,(l,g)=>{const{row:f,col:v}=m(l,g),P=this._conditionalFormattingViewModel.getCellCfs(o,u,f,v);P&&P.forEach(U=>{if(!_[U.cfId]){const z=new T.ObjectMatrix;_[U.cfId]=z;const V=this._conditionalFormattingRuleModel.getRule(o,u,U.cfId);V==null||V.ranges.forEach(O=>{T.Range.foreach(O,(x,W)=>{z.setValue(x,W,1)})})}_[U.cfId].realDeleteValue(f,v)})});const{matrix:w,info:C}=this._copyInfo,R=[];let h=this._conditionalFormattingRuleModel.createCfId(o,u);const i={},s=l=>{if(i[l])return i[l];const g=C==null?void 0:C.cfMap[l],f=[...this._conditionalFormattingRuleModel.getSubunitRules(o,u)||[],...R].find(v=>T.Tools.diffValue(v.rule,g));if(f)return i[l]=f,f;{const v={rule:g,cfId:h,ranges:[],stopIfTrue:!1};return i[l]=v,R.push(v),h=`${Number(h)+1}`,v}};I.forEach(l=>{w&&w.forValue((g,f,v)=>{const P=T.Rectangle.getPositionRange({startRow:g,endRow:g,startColumn:f,endColumn:f},l.startRange),{row:U,col:z}=m(P.startRow,P.startColumn);v.forEach(V=>{if(!_[V]){const O=s(V),x=new T.ObjectMatrix;_[V]=x,O.ranges.forEach(W=>{T.Range.foreach(W,(X,Y)=>{x.setValue(X,Y,1)})})}_[V].setValue(U,z,1)})})});const d=[],S=[];for(const l in _){const g=_[l],f=q.findAllRectangle(q.createTopMatrixFromMatrix(g));if(!f.length){const v={unitId:o,subUnitId:u,cfId:l};d.push({id:c.DeleteConditionalRuleMutation.id,params:v}),S.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}if(R.some(v=>v.cfId===l)){const v=s(l),P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.AddConditionalRuleMutation.id,params:P}),S.push(c.AddConditionalRuleMutationUndoFactory(this._injector,P))}else{const v=this._conditionalFormattingRuleModel.getRule(o,u,l);if(!v)continue;const P={unitId:o,subUnitId:u,rule:{...v,ranges:f}};d.push({id:c.SetConditionalRuleMutation.id,params:P}),S.push(...c.setConditionalRuleMutationUndoFactory(this._injector,P))}}return{redos:d,undos:S}}};dt=Xa([ut(0,T.Inject(fe.ISheetClipboardService)),ut(1,T.Inject(c.ConditionalFormattingRuleModel)),ut(2,T.Inject(T.Injector)),ut(3,T.Inject(c.ConditionalFormattingViewModel)),ut(4,T.Inject(T.IUniverInstanceService))],dt);var Ya=Object.getOwnPropertyDescriptor,Ka=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ya(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},mn=(e,t)=>(r,n)=>t(r,n,e);let ft=class extends T.Disposable{constructor(e,t,r){super(),this._localeService=e,this._commandService=t,this._sheetPermissionCheckController=r,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{e.id===Xe.id&&(this._sheetPermissionCheckController.permissionCheckWithRanges({workbookTypes:[q.WorkbookEditablePermission],rangeTypes:[q.RangeProtectionPermissionEditPoint],worksheetTypes:[q.WorksheetEditPermission,q.WorksheetSetCellStylePermission]},e.params.rule.ranges)||this._sheetPermissionCheckController.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.setStyleErr")))}))}};ft=Ka([mn(0,T.Inject(T.LocaleService)),mn(1,T.ICommandService),mn(2,T.Inject(q.SheetPermissionCheckController))],ft);var $a=Object.getOwnPropertyDescriptor,Za=(e,t,r,n)=>{for(var a=n>1?void 0:n?$a(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},zt=(e,t)=>(r,n)=>t(r,n,e);let pt=class extends T.Disposable{constructor(e,t,r,n){super(),this._conditionalFormattingRuleModel=e,this._univerInstanceService=t,this._injector=r,this._refRangeService=n,this._initRefRange()}_initRefRange(){const e=new Map,t=(n,a,o)=>`${n}_${a}_${o}`,r=(n,a,o)=>{const u=p=>{const b=[...o.ranges],m=b.map(_=>q.handleDefaultRangeChangeWithEffectRefCommands(_,p)).filter(_=>!!_);if(c.isRangesEqual(m,b))return{redos:[],undos:[]};if(m.length){const _={unitId:n,subUnitId:a,rule:{...o,ranges:m}},w=[{id:c.SetConditionalRuleMutation.id,params:_}],C=c.setConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:C}}else{const _={unitId:n,subUnitId:a,cfId:o.cfId},w=[{id:c.DeleteConditionalRuleMutation.id,params:_}],C=c.DeleteConditionalRuleMutationUndoFactory(this._injector,_);return{redos:w,undos:C}}},y=[];o.ranges.forEach(p=>{const b=this._refRangeService.registerRefRange(p,u);y.push(()=>b.dispose())}),e.set(t(n,a,o.cfId),()=>y.forEach(p=>p()))};this.disposeWithMe(this._conditionalFormattingRuleModel.$ruleChange.subscribe(n=>{const{unitId:a,subUnitId:o,rule:u}=n,y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!(n.unitId!==y.getUnitId()||n.subUnitId!==(p==null?void 0:p.getSheetId())))switch(n.type){case"add":{r(n.unitId,n.subUnitId,n.rule);break}case"delete":{const b=e.get(t(a,o,u.cfId));b&&b();break}case"set":{const b=e.get(t(a,o,u.cfId));b&&b(),r(n.unitId,n.subUnitId,n.rule)}}})),this.disposeWithMe(T.toDisposable(()=>{e.forEach(n=>{n()}),e.clear()}))}};pt=Za([zt(0,T.Inject(c.ConditionalFormattingRuleModel)),zt(1,T.Inject(T.IUniverInstanceService)),zt(2,T.Inject(T.Injector)),zt(3,T.Inject(q.RefRangeService))],pt);var Ja=Object.getOwnPropertyDescriptor,Qa=(e,t,r,n)=>{for(var a=n>1?void 0:n?Ja(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},He=(e,t)=>(r,n)=>t(r,n,e);let ht=class extends T.Disposable{constructor(t,r,n,a,o,u){super();De(this,"_ruleChangeCacheMap",new Map);this._sheetInterceptorService=t,this._conditionalFormattingService=r,this._univerInstanceService=n,this._renderManagerService=a,this._conditionalFormattingViewModel=o,this._conditionalFormattingRuleModel=u,this._initViewModelInterceptor(),this._initSkeleton(),this.disposeWithMe(()=>{this._ruleChangeCacheMap.clear()})}_markDirtySkeleton(){var r,n,a;const t=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId();(r=this._renderManagerService.getRenderById(t))==null||r.with(fe.SheetSkeletonManagerService).reCalculate(),(a=(n=this._renderManagerService.getRenderById(t))==null?void 0:n.mainComponent)==null||a.makeDirty()}_initSkeleton(){this.disposeWithMe(Ce.merge(this._conditionalFormattingRuleModel.$ruleChange,this._conditionalFormattingViewModel.markDirty$).pipe(qe.bufferTime(16),qe.filter(t=>!!t.length),qe.filter(t=>{const r=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!r)return!1;const n=r.getActiveSheet();return n?t.filter(a=>a.unitId===r.getUnitId()&&a.subUnitId===n.getSheetId()).length>0:!1})).subscribe(()=>this._markDirtySkeleton()))}_initViewModelInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(q.INTERCEPTOR_POINT.CELL_CONTENT,{effect:T.InterceptorEffectEnum.Style,handler:(t,r,n)=>{const a=this._conditionalFormattingService.composeStyle(r.unitId,r.subUnitId,r.row,r.col);if(!a)return n(t);const o=r.workbook.getStyles(),y={...(typeof(t==null?void 0:t.s)=="string"?o.get(t==null?void 0:t.s):t==null?void 0:t.s)||{}},p={...t,s:y};return a.style&&Object.assign(y,a.style),p.fontRenderExtension||(p.fontRenderExtension={},a.isShowValue!==void 0&&(p.fontRenderExtension.isSkip=!a.isShowValue)),a.dataBar&&(p.dataBar=a.dataBar),a.iconSet&&(p.iconSet=a.iconSet,p.fontRenderExtension.leftOffset=c.DEFAULT_PADDING+c.DEFAULT_WIDTH),n(p)},priority:10}))}};ht=Qa([He(0,T.Inject(q.SheetInterceptorService)),He(1,T.Inject(c.ConditionalFormattingService)),He(2,T.Inject(T.IUniverInstanceService)),He(3,T.Inject(In.IRenderManagerService)),He(4,T.Inject(c.ConditionalFormattingViewModel)),He(5,T.Inject(c.ConditionalFormattingRuleModel))],ht);const _r="sheets-conditional-formatting-ui.config",kt={};var eo=Object.defineProperty,to=Object.getOwnPropertyDescriptor,no=(e,t,r)=>t in e?eo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ro=(e,t,r,n)=>{for(var a=n>1?void 0:n?to(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},yn=(e,t)=>(r,n)=>t(r,n,e),Er=(e,t,r)=>no(e,typeof t!="symbol"?t+"":t,r);$.UniverSheetsConditionalFormattingMobileUIPlugin=class extends T.Plugin{constructor(t=kt,r,n,a){super(),this._config=t,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand(),this._injector.add([ht]),this._injector.add([pt]),this._injector.add([dt]),this._injector.add([ft]),this._injector.add([Ae])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(t=>{this._commandService.registerCommand(t)})}},Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_MOBILE_UI_PLUGIN`),Er($.UniverSheetsConditionalFormattingMobileUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingMobileUIPlugin=ro([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),yn(1,T.Inject(T.Injector)),yn(2,T.Inject(T.ICommandService)),yn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingMobileUIPlugin);var ao=Object.getOwnPropertyDescriptor,oo=(e,t,r,n)=>{for(var a=n>1?void 0:n?ao(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},gt=(e,t)=>(r,n)=>t(r,n,e);let At=class extends T.Disposable{constructor(e,t,r,n,a){super(),this._injector=e,this._univerInstanceService=t,this._autoFillService=r,this._conditionalFormattingRuleModel=n,this._conditionalFormattingViewModel=a,this._initAutoFill()}_initAutoFill(){const e=()=>({redos:[],undos:[]}),t=(a,o,u,y,p)=>{var w;const b=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getUnitId(),m=(w=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET).getActiveSheet())==null?void 0:w.getSheetId();if(!b||!m)return;const I={startRow:a.row,startColumn:a.col,endColumn:a.col,endRow:a.row},_={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row};T.Range.foreach(u,(C,R)=>{const h=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},I),i=T.Rectangle.getPositionRange({startRow:C,startColumn:R,endColumn:R,endRow:C},_),{row:s,col:d}=p(h.startRow,h.startColumn),S=this._conditionalFormattingViewModel.getCellCfs(b,m,s,d),{row:l,col:g}=p(i.startRow,i.startColumn),f=this._conditionalFormattingViewModel.getCellCfs(b,m,l,g);f&&f.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.realDeleteValue(l,g)}),S&&S.forEach(v=>{let P=y.get(v.cfId);if(!y.get(v.cfId)){const U=this._conditionalFormattingRuleModel.getRule(b,m,v.cfId);if(!U)return;P=new T.ObjectMatrix,U.ranges.forEach(z=>{T.Range.foreach(z,(V,O)=>{P.setValue(V,O,1)})}),y.set(v.cfId,P)}P.setValue(l,g,1)})})},r=(a,o)=>{var i,s,d;const u=(i=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:i.getUnitId(),y=(d=(s=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:s.getActiveSheet())==null?void 0:d.getSheetId(),p=new Map,b=[],m=[];if(!u||!y)return e();const I=fe.virtualizeDiscreteRanges([a,o]),[_,w]=I.ranges,{mapFunc:C}=I,R={row:_.startRow,col:_.startColumn};return fe.getAutoFillRepeatRange(_,w).forEach(S=>{t(R,S.repeatStartCell,S.relativeRange,p,C)}),p.forEach((S,l)=>{const g=this._conditionalFormattingRuleModel.getRule(u,y,l);if(!g)return;const f=q.findAllRectangle(q.createTopMatrixFromMatrix(S));if(f.length){const v={unitId:u,subUnitId:y,rule:{...g,ranges:f}};b.push({id:c.SetConditionalRuleMutation.id,params:v}),m.push(...c.setConditionalRuleMutationUndoFactory(this._injector,v))}else{const v={unitId:u,subUnitId:y,cfId:g.cfId};b.push({id:c.DeleteConditionalRuleMutation.id,params:v}),m.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,v))}}),{undos:m,redos:b}},n={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onFillData:(a,o,u)=>{if(u===fe.APPLY_TYPE.COPY||u===fe.APPLY_TYPE.ONLY_FORMAT||u===fe.APPLY_TYPE.SERIES){const{source:y,target:p}=a;return r(y,p)}return e()}};this.disposeWithMe(this._autoFillService.addHook(n))}};At=oo([gt(0,T.Inject(T.Injector)),gt(1,T.Inject(T.IUniverInstanceService)),gt(2,T.Inject(fe.IAutoFillService)),gt(3,T.Inject(c.ConditionalFormattingRuleModel)),gt(4,T.Inject(c.ConditionalFormattingViewModel))],At);var io=Object.getOwnPropertyDescriptor,so=(e,t,r,n)=>{for(var a=n>1?void 0:n?io(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},vt=(e,t)=>(r,n)=>t(r,n,e);$.ConditionalFormattingClearController=class extends T.Disposable{constructor(t,r,n,a,o){super(),this._injector=t,this._univerInstanceService=r,this._sheetInterceptorService=n,this._selectionManagerService=a,this._conditionalFormattingRuleModel=o,this._init()}_init(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:t=>{var o;const r=[],n=[],a={redos:r,undos:n};if([q.ClearSelectionFormatCommand.id,q.ClearSelectionAllCommand.id].includes(t.id)){const u=(o=this._selectionManagerService.getCurrentSelections())==null?void 0:o.map(C=>C.range);if(!u)return a;const y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),p=y.getActiveSheet();if(!p)return a;const b=y.getUnitId(),m=p.getSheetId(),I=this._conditionalFormattingRuleModel.getSubunitRules(b,m);if(!I||!I.length)return a;const{redos:_,undos:w}=Or(this._injector,I,u,b,m);r.push(..._),n.push(...w)}return a}})),this.disposeWithMe(this._sheetInterceptorService.interceptRanges({getMutations:({unitId:t,subUnitId:r,ranges:n})=>{const a=[],o=[],u={redos:a,undos:o};if(!n||!n.length)return u;const y=this._conditionalFormattingRuleModel.getSubunitRules(t,r);if(!y||!y.length)return u;const{redos:p,undos:b}=Or(this._injector,y,n,t,r);return a.push(...p),o.push(...b),u}}))}},$.ConditionalFormattingClearController=so([vt(0,T.Inject(T.Injector)),vt(1,T.Inject(T.IUniverInstanceService)),vt(2,T.Inject(q.SheetInterceptorService)),vt(3,T.Inject(q.SheetsSelectionsService)),vt(4,T.Inject(c.ConditionalFormattingRuleModel))],$.ConditionalFormattingClearController);function Or(e,t,r,n,a){const o=[],u=[];return t.filter(y=>r.some(p=>y.ranges.some(b=>T.Rectangle.getIntersects(b,p)))).forEach(y=>{const b=new q.RangeMergeUtil().add(...y.ranges).subtract(...r).merge();if(b.length){const m={id:c.SetConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,rule:{...y,ranges:b}}},I=c.setConditionalRuleMutationUndoFactory(e,m.params);o.push(m),u.push(...I)}else{const m={id:c.DeleteConditionalRuleMutation.id,params:{unitId:n,subUnitId:a,cfId:y.cfId}},I=c.DeleteConditionalRuleMutationUndoFactory(e,m.params);o.push(m),u.push(...I)}}),{redos:o,undos:u}}var lo=Object.getOwnPropertyDescriptor,co=(e,t,r,n)=>{for(var a=n>1?void 0:n?lo(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Mr=(e,t)=>(r,n)=>t(r,n,e);let Wt=class extends T.Disposable{constructor(e,t){super(),this._sheetInterceptorService=e,this._conditionalFormattingService=t,this._initInterceptorEditorEnd()}_initInterceptorEditorEnd(){this.disposeWithMe(T.toDisposable(this._sheetInterceptorService.writeCellInterceptor.intercept(q.AFTER_CELL_EDIT,{handler:(e,t,r)=>{var u,y,p;e||r(e);const n=this._conditionalFormattingService.composeStyle(t.unitId,t.subUnitId,t.row,t.col),a=(u=n==null?void 0:n.style)!=null?u:{},o=Object.keys(a);if(e!=null&&e.p)return(p=(y=e.p.body)==null?void 0:y.textRuns)==null||p.forEach(b=>{b.ts&&o.forEach(m=>{var I;(I=b.ts)==null||delete I[m]})}),r(e);{const b={...(typeof(e==null?void 0:e.s)=="string"?t.workbook.getStyles().get(e.s):e==null?void 0:e.s)||{}};o.forEach(I=>{delete b[I]});const m={...e,s:{...b}};return r(m)}}})))}};Wt=co([Mr(0,T.Inject(q.SheetInterceptorService)),Mr(1,T.Inject(c.ConditionalFormattingService))],Wt);const Dr=[q.SetWorksheetActiveOperation.id,c.AddConditionalRuleMutation.id,c.SetConditionalRuleMutation.id,c.DeleteConditionalRuleMutation.id,c.MoveConditionalRuleMutation.id],mt=[{label:"sheet.cf.ruleType.highlightCell",value:me.highlightCell},{label:"sheet.cf.panel.rankAndAverage",value:me.rank},{label:"sheet.cf.ruleType.formula",value:me.formula},{label:"sheet.cf.ruleType.colorScale",value:me.colorScale},{label:"sheet.cf.ruleType.dataBar",value:me.dataBar},{label:"sheet.cf.ruleType.iconSet",value:me.icon},{label:"sheet.cf.menu.manageConditionalFormatting",value:me.viewRule},{label:"sheet.cf.menu.createConditionalFormatting",value:me.createRule},{label:"sheet.cf.menu.clearRangeRules",value:me.clearRangeRules,disabled:!1},{label:"sheet.cf.menu.clearWorkSheetRules",value:me.clearWorkSheetRules}],uo=e=>{const t=e.get(q.SheetsSelectionsService),r=e.get(T.ICommandService),n=e.get(T.IUniverInstanceService),a=e.get(c.ConditionalFormattingRuleModel),o=new Ce.Observable(p=>Ce.merge(t.selectionMoveEnd$,t.selectionSet$,new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===C&&b.next(null)});return()=>m.dispose()})).pipe(qe.debounceTime(16)).subscribe(()=>{var R;const b=((R=t.getCurrentSelections())==null?void 0:R.map(h=>h.range))||[],m=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!m)return;const I=m.getActiveSheet();if(!I)return;const C=(a.getSubunitRules(m.getUnitId(),I.getSheetId())||[]).filter(h=>h.ranges.some(i=>b.some(s=>T.Rectangle.intersects(s,i)))).map(h=>h.ranges).every(h=>q.checkRangesEditablePermission(e,m.getUnitId(),I.getSheetId(),h));p.next(C)})),u=new Ce.Observable(p=>new Ce.Observable(b=>{const m=r.onCommandExecuted(I=>{var R;const{id:_,params:w}=I,C=(R=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:R.getUnitId();Dr.includes(_)&&w.unitId===C&&b.next(null)});return()=>m.dispose()}).pipe(qe.debounceTime(16)).subscribe(()=>{const b=n.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET);if(!b)return;const m=b.getActiveSheet();if(!m)return;const I=a.getSubunitRules(b.getUnitId(),m.getSheetId())||[];if(!I.length)return p.next(!1),!1;const _=I.map(w=>w.ranges).every(w=>q.checkRangesEditablePermission(e,b.getUnitId(),m.getSheetId(),w));p.next(_)})),y=new Ce.Observable(p=>{o.subscribe(b=>{const m=mt.find(I=>I.value===me.clearRangeRules);m&&(m.disabled=!b,p.next(mt))}),u.subscribe(b=>{const m=mt.find(I=>I.value===me.clearWorkSheetRules);m&&(m.disabled=!b,p.next(mt))}),p.next(mt)});return{id:ct.id,type:ee.MenuItemType.SELECTOR,icon:"Conditions",tooltip:"sheet.cf.title",selections:y,hidden$:ee.getMenuHiddenObservable(e,T.UniverInstanceType.UNIVER_SHEET),disabled$:fe.getCurrentRangeDisable$(e,{workbookTypes:[q.WorkbookEditablePermission],worksheetTypes:[q.WorksheetSetCellStylePermission,q.WorksheetEditPermission],rangeTypes:[q.RangeProtectionPermissionEditPoint]})}},fo={[ee.RibbonStartGroup.FORMULAS_INSERT]:{[ct.id]:{order:0,menuItemFactory:uo}}};var po=Object.getOwnPropertyDescriptor,ho=(e,t,r,n)=>{for(var a=n>1?void 0:n?po(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Pr=(e,t)=>(r,n)=>t(r,n,e);let jt=class extends T.Disposable{constructor(t,r){super();De(this,"_sidebarDisposable",null);this._injector=t,this._menuManagerService=r,this._menuManagerService.mergeMenu(fo)}};jt=ho([Pr(0,T.Inject(T.Injector)),Pr(1,ee.IMenuManagerService)],jt);var go=Object.getOwnPropertyDescriptor,vo=(e,t,r,n)=>{for(var a=n>1?void 0:n?go(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Be=(e,t)=>(r,n)=>t(r,n,e);const mo=(e,t)=>{const r=m=>m.endRow-m.startRow+1,n=m=>m.endColumn-m.startColumn+1,a=r(t)%r(e),o=n(t)%n(e),u=Math.floor(r(t)/r(e)),y=Math.floor(n(t)/n(e)),p=[],b={startRow:0,endRow:r(e)-1,startColumn:0,endColumn:n(e)-1};if(r(t)===1&&n(t)===1){const m={startRow:t.startRow,endRow:t.startRow,startColumn:t.startColumn,endColumn:t.startColumn};return p.push({repeatRelativeRange:b,startRange:m}),p}for(let m=0;m<u+(a?.1:0);m++)for(let I=0;I<y+(o?.1:0);I++){const _=r(e)*m,w=n(e)*I,C={startRow:_+t.startRow,endRow:_+t.startRow,startColumn:w+t.startColumn,endColumn:w+t.startColumn};let R=b;m===u&&a&&(R={...R},R.endRow=R.endRow-(r(e)-a)),I===y&&o&&(R={...R},R.endColumn=R.endColumn-(n(e)-o)),p.push({repeatRelativeRange:R,startRange:C})}return p};let Ht=class extends T.Disposable{constructor(t,r,n,a,o,u){super();De(this,"_painterConfig",null);this._injector=t,this._univerInstanceService=r,this._formatPainterService=n,this._sheetsSelectionsService=a,this._conditionalFormattingRuleModel=o,this._conditionalFormattingViewModel=u,this._initFormattingPainter()}_initFormattingPainter(){const t=()=>({redos:[],undos:[]}),r=(o,u,y,p,b)=>{const{unitId:m,subUnitId:I}=this._painterConfig,{targetUnitId:_,targetSubUnitId:w}=b,C={startRow:o.row,startColumn:o.col,endColumn:o.col,endRow:o.row},R={startRow:u.row,startColumn:u.col,endColumn:u.col,endRow:u.row};T.Range.foreach(y,(h,i)=>{const s=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},C),d=T.Rectangle.getPositionRange({startRow:h,startColumn:i,endColumn:i,endRow:h},R),S=this._conditionalFormattingViewModel.getCellCfs(m,I,s.startRow,s.startColumn),l=this._conditionalFormattingViewModel.getCellCfs(_,w,d.startRow,d.startColumn);l&&l.forEach(g=>{let f=p.get(g.cfId);if(!p.get(g.cfId)){const v=this._conditionalFormattingRuleModel.getRule(_,w,g.cfId);if(!v)return;f=new T.ObjectMatrix,v.ranges.forEach(P=>{T.Range.foreach(P,(U,z)=>{f.setValue(U,z,1)})}),p.set(g.cfId,f)}f.realDeleteValue(d.startRow,d.startColumn)}),S&&S.forEach(g=>{const f=p.get(g.cfId);f&&f.setValue(d.startRow,d.startColumn,1)})})},n=(o,u,y)=>{var s;const{range:p,unitId:b,subUnitId:m}=this._painterConfig,I=o!==b||m!==u,_=new Map,w=[],C=[];if(!o||!u||!b||!m)return t();const R=(s=this._conditionalFormattingRuleModel.getSubunitRules(b,m))!=null?s:[];R==null||R.forEach(d=>{const{ranges:S,cfId:l}=d;if(S.some(g=>T.Rectangle.intersects(p,g))){const g=new T.ObjectMatrix;I||S.forEach(f=>{T.Range.foreach(f,(v,P)=>{g.setValue(v,P,1)})}),_.set(l,g)}});const h={row:p.startRow,col:p.startColumn};return mo(p,y).forEach(d=>{r(h,{row:d.startRange.startRow,col:d.startRange.startColumn},d.repeatRelativeRange,_,{targetUnitId:o,targetSubUnitId:u})}),_.forEach((d,S)=>{if(I){const l=this._conditionalFormattingRuleModel.getRule(o,u,S),g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(l)if(g.length){const f={unitId:o,subUnitId:u,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:o,subUnitId:u,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}else if(g.length){const f=this._conditionalFormattingRuleModel.getRule(b,m,S);if(f){const v={unitId:o,subUnitId:u,rule:{...T.Tools.deepClone(f),cfId:this._conditionalFormattingRuleModel.createCfId(o,u),ranges:g}};w.push({id:c.AddConditionalRuleMutation.id,params:v}),C.push(c.AddConditionalRuleMutationUndoFactory(this._injector,v))}}}else{const l=this._conditionalFormattingRuleModel.getRule(b,m,S);if(!l)return;const g=q.findAllRectangle(q.createTopMatrixFromMatrix(d));if(g.length){const f={unitId:b,subUnitId:m,rule:{...l,ranges:g}};w.push({id:c.SetConditionalRuleMutation.id,params:f}),C.push(...c.setConditionalRuleMutationUndoFactory(this._injector,f))}else{const f={unitId:b,subUnitId:m,cfId:l.cfId};w.push({id:c.DeleteConditionalRuleMutation.id,params:f}),C.push(...c.DeleteConditionalRuleMutationUndoFactory(this._injector,f))}}}),{undos:C,redos:w}},a={id:c.SHEET_CONDITIONAL_FORMATTING_PLUGIN,onStatusChange:o=>{var u,y,p;switch(o){case fe.FormatPainterStatus.INFINITE:case fe.FormatPainterStatus.ONCE:{const b=(u=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:u.getUnitId(),m=(p=(y=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET))==null?void 0:y.getActiveSheet())==null?void 0:p.getSheetId(),I=this._sheetsSelectionsService.getCurrentLastSelection(),_=I==null?void 0:I.range;b&&m&&_&&(this._painterConfig={unitId:b,subUnitId:m,range:_});break}case fe.FormatPainterStatus.OFF:{this._painterConfig=null;break}}},onApply:(o,u,y)=>this._painterConfig?n(o,u,y):{redos:[],undos:[]}};this._formatPainterService.addHook(a)}};Ht=vo([Be(0,T.Inject(T.Injector)),Be(1,T.Inject(T.IUniverInstanceService)),Be(2,T.Inject(fe.IFormatPainterService)),Be(3,T.Inject(q.SheetsSelectionsService)),Be(4,T.Inject(c.ConditionalFormattingRuleModel)),Be(5,T.Inject(c.ConditionalFormattingViewModel))],Ht);var yo=Object.getOwnPropertyDescriptor,So=(e,t,r,n)=>{for(var a=n>1?void 0:n?yo(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},Sn=(e,t)=>(r,n)=>t(r,n,e);let Bt=class extends T.Disposable{constructor(e,t,r){super(),this._conditionalFormattingViewModel=e,this._univerInstanceService=t,this._renderManagerService=r,this._init()}_init(){const e=this._univerInstanceService.getCurrentUnitForType(T.UniverInstanceType.UNIVER_SHEET),t=r=>{const n=r.getUnitId(),a=this._renderManagerService.getRenderById(n);if(!a)return;const o=a.with(fe.SheetSkeletonManagerService);this.disposeWithMe(o.currentSkeleton$.subscribe(u=>{if(u){const y=u.skeleton.rowColumnSegment,p=y.endColumn-y.startColumn+1,m=(y.endRow-y.startRow+1)*p*9,I=Math.max(c.CONDITIONAL_FORMATTING_VIEWPORT_CACHE_LENGTH,m);this._conditionalFormattingViewModel.setCacheLength(I)}}))};e&&t(e),this._univerInstanceService.getCurrentTypeOfUnit$(T.UniverInstanceType.UNIVER_SHEET).subscribe(r=>{r&&t(r)})}};Bt=So([Sn(0,T.Inject(c.ConditionalFormattingViewModel)),Sn(1,T.IUniverInstanceService),Sn(2,In.IRenderManagerService)],Bt);var bo=Object.defineProperty,Co=Object.getOwnPropertyDescriptor,To=(e,t,r)=>t in e?bo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Io=(e,t,r,n)=>{for(var a=n>1?void 0:n?Co(t,r):t,o=e.length-1,u;o>=0;o--)(u=e[o])&&(a=u(a)||a);return a},bn=(e,t)=>(r,n)=>t(r,n,e),xr=(e,t,r)=>To(e,typeof t!="symbol"?t+"":t,r);$.UniverSheetsConditionalFormattingUIPlugin=class extends T.Plugin{constructor(t=kt,r,n,a){super(),this._config=t,this._injector=r,this._commandService=n,this._configService=a;const{menu:o,...u}=T.merge({},kt,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(_r,u),this._initCommand()}onStarting(){T.registerDependencies(this._injector,[[ht],[pt],[dt],[At],[ft],[lt],[jt],[Ae],[Wt],[$.ConditionalFormattingClearController],[Ht],[Bt]]),T.touchDependencies(this._injector,[[ht]])}onReady(){T.touchDependencies(this._injector,[[jt],[lt]])}onRendered(){T.touchDependencies(this._injector,[[At],[$.ConditionalFormattingClearController],[dt],[Wt],[Ae],[Ht],[ft],[pt],[Bt]])}_initCommand(){[qt,Xt,Yt,Kt,$t,Zt,Jt,Qt,en,ct,Ke,bt,St,Xe,yt,Ye].forEach(t=>{this._commandService.registerCommand(t)})}},xr($.UniverSheetsConditionalFormattingUIPlugin,"pluginName",`${c.SHEET_CONDITIONAL_FORMATTING_PLUGIN}_UI_PLUGIN`),xr($.UniverSheetsConditionalFormattingUIPlugin,"type",T.UniverInstanceType.UNIVER_SHEET),$.UniverSheetsConditionalFormattingUIPlugin=Io([T.DependentOn(c.UniverSheetsConditionalFormattingPlugin),bn(1,T.Inject(T.Injector)),bn(2,T.Inject(T.ICommandService)),bn(3,T.IConfigService)],$.UniverSheetsConditionalFormattingUIPlugin),$.AddAverageCfCommand=qt,$.AddCfCommand=Xe,$.AddColorScaleConditionalRuleCommand=Xt,$.AddDataBarConditionalRuleCommand=Yt,$.AddDuplicateValuesCfCommand=Kt,$.AddNumberCfCommand=$t,$.AddRankCfCommand=Zt,$.AddTextCfCommand=Jt,$.AddTimePeriodCfCommand=Qt,$.AddUniqueValuesCfCommand=en,$.ClearRangeCfCommand=yt,$.ClearWorksheetCfCommand=Ye,$.DeleteCfCommand=Ke,$.MoveCfCommand=St,$.OpenConditionalFormattingOperator=ct,$.SetCfCommand=bt,Object.defineProperty($,Symbol.toStringTag,{value:"Module"})});
194
185
 
195
186
 
196
187
  // index