{"version":3,"file":"cf-rule-xform.js","names":["BaseXform","require","CompositeXform","Range","DatabarXform","ExtLstRefXform","FormulaXform","ColorScaleXform","IconSetXform","extIcons","getTextFormula","model","formulae","range","ref","tl","operator","text","undefined","getTimePeriodFormula","timePeriod","opType","attributes","type","CfRuleXform","constructor","map","dataBar","databarXform","extLst","extLstRefXform","formula","formulaXform","colorScale","colorScaleXform","iconSet","iconSetXform","tag","isPrimitive","rule","custom","render","xmlStream","renderExpression","renderCellIs","renderTop10","renderAboveAverage","renderDataBar","renderColorScale","renderIconSet","renderText","renderTimePeriod","openNode","dxfId","priority","closeNode","forEach","leafNode","percent","toBoolAttribute","bottom","rank","toIntValue","aboveAverage","toStringAttribute","createNewModel","_ref","toBoolValue","onParserClose","name","parser","Object","assign","push","module","exports"],"sources":["../../../../../../lib/xlsx/xform/sheet/cf/cf-rule-xform.js"],"sourcesContent":["const BaseXform = require('../../base-xform');\nconst CompositeXform = require('../../composite-xform');\n\nconst Range = require('../../../../doc/range');\n\nconst DatabarXform = require('./databar-xform');\nconst ExtLstRefXform = require('./ext-lst-ref-xform');\nconst FormulaXform = require('./formula-xform');\nconst ColorScaleXform = require('./color-scale-xform');\nconst IconSetXform = require('./icon-set-xform');\n\nconst extIcons = {\n  '3Triangles': true,\n  '3Stars': true,\n  '5Boxes': true,\n};\n\nconst getTextFormula = model => {\n  if (model.formulae && model.formulae[0]) {\n    return model.formulae[0];\n  }\n\n  const range = new Range(model.ref);\n  const {tl} = range;\n  switch (model.operator) {\n    case 'containsText':\n      return `NOT(ISERROR(SEARCH(\"${model.text}\",${tl})))`;\n    case 'containsBlanks':\n      return `LEN(TRIM(${tl}))=0`;\n    case 'notContainsBlanks':\n      return `LEN(TRIM(${tl}))>0`;\n    case 'containsErrors':\n      return `ISERROR(${tl})`;\n    case 'notContainsErrors':\n      return `NOT(ISERROR(${tl}))`;\n    default:\n      return undefined;\n  }\n};\n\nconst getTimePeriodFormula = model => {\n  if (model.formulae && model.formulae[0]) {\n    return model.formulae[0];\n  }\n\n  const range = new Range(model.ref);\n  const {tl} = range;\n  switch (model.timePeriod) {\n    case 'thisWeek':\n      return `AND(TODAY()-ROUNDDOWN(${tl},0)<=WEEKDAY(TODAY())-1,ROUNDDOWN(${tl},0)-TODAY()<=7-WEEKDAY(TODAY()))`;\n    case 'lastWeek':\n      return `AND(TODAY()-ROUNDDOWN(${tl},0)>=(WEEKDAY(TODAY())),TODAY()-ROUNDDOWN(${tl},0)<(WEEKDAY(TODAY())+7))`;\n    case 'nextWeek':\n      return `AND(ROUNDDOWN(${tl},0)-TODAY()>(7-WEEKDAY(TODAY())),ROUNDDOWN(${tl},0)-TODAY()<(15-WEEKDAY(TODAY())))`;\n    case 'yesterday':\n      return `FLOOR(${tl},1)=TODAY()-1`;\n    case 'today':\n      return `FLOOR(${tl},1)=TODAY()`;\n    case 'tomorrow':\n      return `FLOOR(${tl},1)=TODAY()+1`;\n    case 'last7Days':\n      return `AND(TODAY()-FLOOR(${tl},1)<=6,FLOOR(${tl},1)<=TODAY())`;\n    case 'lastMonth':\n      return `AND(MONTH(${tl})=MONTH(EDATE(TODAY(),0-1)),YEAR(${tl})=YEAR(EDATE(TODAY(),0-1)))`;\n    case 'thisMonth':\n      return `AND(MONTH(${tl})=MONTH(TODAY()),YEAR(${tl})=YEAR(TODAY()))`;\n    case 'nextMonth':\n      return `AND(MONTH(${tl})=MONTH(EDATE(TODAY(),0+1)),YEAR(${tl})=YEAR(EDATE(TODAY(),0+1)))`;\n    default:\n      return undefined;\n  }\n};\n\nconst opType = attributes => {\n  const {type, operator} = attributes;\n  switch (type) {\n    case 'containsText':\n    case 'containsBlanks':\n    case 'notContainsBlanks':\n    case 'containsErrors':\n    case 'notContainsErrors':\n      return {\n        type: 'containsText',\n        operator: type,\n      };\n\n    default:\n      return {type, operator};\n  }\n};\n\nclass CfRuleXform extends CompositeXform {\n  constructor() {\n    super();\n\n    this.map = {\n      dataBar: (this.databarXform = new DatabarXform()),\n      extLst: (this.extLstRefXform = new ExtLstRefXform()),\n      formula: (this.formulaXform = new FormulaXform()),\n      colorScale: (this.colorScaleXform = new ColorScaleXform()),\n      iconSet: (this.iconSetXform = new IconSetXform()),\n    };\n  }\n\n  get tag() {\n    return 'cfRule';\n  }\n\n  static isPrimitive(rule) {\n    // is this rule primitive?\n    if (rule.type === 'iconSet') {\n      if (rule.custom || extIcons[rule.iconSet]) {\n        return false;\n      }\n    }\n    return true;\n  }\n\n  render(xmlStream, model) {\n    switch (model.type) {\n      case 'expression':\n        this.renderExpression(xmlStream, model);\n        break;\n      case 'cellIs':\n        this.renderCellIs(xmlStream, model);\n        break;\n      case 'top10':\n        this.renderTop10(xmlStream, model);\n        break;\n      case 'aboveAverage':\n        this.renderAboveAverage(xmlStream, model);\n        break;\n      case 'dataBar':\n        this.renderDataBar(xmlStream, model);\n        break;\n      case 'colorScale':\n        this.renderColorScale(xmlStream, model);\n        break;\n      case 'iconSet':\n        this.renderIconSet(xmlStream, model);\n        break;\n      case 'containsText':\n        this.renderText(xmlStream, model);\n        break;\n      case 'timePeriod':\n        this.renderTimePeriod(xmlStream, model);\n        break;\n    }\n  }\n\n  renderExpression(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: 'expression',\n      dxfId: model.dxfId,\n      priority: model.priority,\n    });\n\n    this.formulaXform.render(xmlStream, model.formulae[0]);\n\n    xmlStream.closeNode();\n  }\n\n  renderCellIs(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: 'cellIs',\n      dxfId: model.dxfId,\n      priority: model.priority,\n      operator: model.operator,\n    });\n\n    model.formulae.forEach(formula => {\n      this.formulaXform.render(xmlStream, formula);\n    });\n\n    xmlStream.closeNode();\n  }\n\n  renderTop10(xmlStream, model) {\n    xmlStream.leafNode(this.tag, {\n      type: 'top10',\n      dxfId: model.dxfId,\n      priority: model.priority,\n      percent: BaseXform.toBoolAttribute(model.percent, false),\n      bottom: BaseXform.toBoolAttribute(model.bottom, false),\n      rank: BaseXform.toIntValue(model.rank, 10, true),\n    });\n  }\n\n  renderAboveAverage(xmlStream, model) {\n    xmlStream.leafNode(this.tag, {\n      type: 'aboveAverage',\n      dxfId: model.dxfId,\n      priority: model.priority,\n      aboveAverage: BaseXform.toBoolAttribute(model.aboveAverage, true),\n    });\n  }\n\n  renderDataBar(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: 'dataBar',\n      priority: model.priority,\n    });\n\n    this.databarXform.render(xmlStream, model);\n    this.extLstRefXform.render(xmlStream, model);\n\n    xmlStream.closeNode();\n  }\n\n  renderColorScale(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: 'colorScale',\n      priority: model.priority,\n    });\n\n    this.colorScaleXform.render(xmlStream, model);\n\n    xmlStream.closeNode();\n  }\n\n  renderIconSet(xmlStream, model) {\n    // iconset is all primitive or all extLst\n    if (!CfRuleXform.isPrimitive(model)) {\n      return;\n    }\n\n    xmlStream.openNode(this.tag, {\n      type: 'iconSet',\n      priority: model.priority,\n    });\n\n    this.iconSetXform.render(xmlStream, model);\n\n    xmlStream.closeNode();\n  }\n\n  renderText(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: model.operator,\n      dxfId: model.dxfId,\n      priority: model.priority,\n      operator: BaseXform.toStringAttribute(model.operator, 'containsText'),\n    });\n\n    const formula = getTextFormula(model);\n    if (formula) {\n      this.formulaXform.render(xmlStream, formula);\n    }\n\n    xmlStream.closeNode();\n  }\n\n  renderTimePeriod(xmlStream, model) {\n    xmlStream.openNode(this.tag, {\n      type: 'timePeriod',\n      dxfId: model.dxfId,\n      priority: model.priority,\n      timePeriod: model.timePeriod,\n    });\n\n    const formula = getTimePeriodFormula(model);\n    if (formula) {\n      this.formulaXform.render(xmlStream, formula);\n    }\n\n    xmlStream.closeNode();\n  }\n\n  createNewModel({attributes}) {\n    return {\n      ...opType(attributes),\n      dxfId: BaseXform.toIntValue(attributes.dxfId),\n      priority: BaseXform.toIntValue(attributes.priority),\n      timePeriod: attributes.timePeriod,\n      percent: BaseXform.toBoolValue(attributes.percent),\n      bottom: BaseXform.toBoolValue(attributes.bottom),\n      rank: BaseXform.toIntValue(attributes.rank),\n      aboveAverage: BaseXform.toBoolValue(attributes.aboveAverage),\n    };\n  }\n\n  onParserClose(name, parser) {\n    switch (name) {\n      case 'dataBar':\n      case 'extLst':\n      case 'colorScale':\n      case 'iconSet':\n        // merge parser model with ours\n        Object.assign(this.model, parser.model);\n        break;\n\n      case 'formula':\n        // except - formula is a string and appends to formulae\n        this.model.formulae = this.model.formulae || [];\n        this.model.formulae.push(parser.model);\n        break;\n    }\n  }\n}\n\nmodule.exports = CfRuleXform;\n"],"mappings":";;AAAA,MAAMA,SAAS,GAAGC,OAAO,CAAC,kBAAkB,CAAC;AAC7C,MAAMC,cAAc,GAAGD,OAAO,CAAC,uBAAuB,CAAC;AAEvD,MAAME,KAAK,GAAGF,OAAO,CAAC,uBAAuB,CAAC;AAE9C,MAAMG,YAAY,GAAGH,OAAO,CAAC,iBAAiB,CAAC;AAC/C,MAAMI,cAAc,GAAGJ,OAAO,CAAC,qBAAqB,CAAC;AACrD,MAAMK,YAAY,GAAGL,OAAO,CAAC,iBAAiB,CAAC;AAC/C,MAAMM,eAAe,GAAGN,OAAO,CAAC,qBAAqB,CAAC;AACtD,MAAMO,YAAY,GAAGP,OAAO,CAAC,kBAAkB,CAAC;AAEhD,MAAMQ,QAAQ,GAAG;EACf,YAAY,EAAE,IAAI;EAClB,QAAQ,EAAE,IAAI;EACd,QAAQ,EAAE;AACZ,CAAC;AAED,MAAMC,cAAc,GAAGC,KAAK,IAAI;EAC9B,IAAIA,KAAK,CAACC,QAAQ,IAAID,KAAK,CAACC,QAAQ,CAAC,CAAC,CAAC,EAAE;IACvC,OAAOD,KAAK,CAACC,QAAQ,CAAC,CAAC,CAAC;EAC1B;EAEA,MAAMC,KAAK,GAAG,IAAIV,KAAK,CAACQ,KAAK,CAACG,GAAG,CAAC;EAClC,MAAM;IAACC;EAAE,CAAC,GAAGF,KAAK;EACl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