All files / output zcl_abapgit_repo_labels.clas.mjs

71.85% Statements 240/334
77.61% Branches 52/67
40.62% Functions 13/32
71.85% Lines 240/334

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 3341x 1x                 1x 1x 1x 1x 1x 1x 1x 1x   1x 1x 1x 1x                                             1x 1x         5x 5x 5x 5x 5x 5x 5x 5x 5x 13x 13x 13x 12x 12x 13x 5x 5x 5x 5x 5x         5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 9x 9x 9x 7x 9x 2x 2x     2x 9x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x         17x 17x 17x 17x 17x 17x 17x 17x 17x 17x     17x 7x 7x 17x 10x 10x 17x 17x         10x 10x 10x 10x 10x 10x 10x 36x 36x 36x 10x 10x 10x         18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 18x 35x 35x 35x 28x 28x 28x 28x 28x 35x 18x 18x         1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 2x 2x 2x 2x           2x 1x 1x         4x 4x 4x 4x 4x 4x 4x 9x 9x 9x 1x   9x 4x         10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 10x 13x 13x 7x 10x         22x 22x 22x     22x 22x 22x 22x 22x 22x 22x 22x 22x 2x   22x 3x   17x 22x     17x 22x 10x 10x 2x   10x 22x 7x 6x 22x 2x 2x 22x     22x         9x 9x 9x 9x 9x 9x 9x 9x 9x 9x     9x 9x 1x   9x 9x   1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x
const {cx_root} = await import("./cx_root.clas.mjs");
// zcl_abapgit_repo_labels.clas.abap
class zcl_abapgit_repo_labels {
  static INTERNAL_TYPE = 'CLAS';
  static INTERNAL_NAME = 'ZCL_ABAPGIT_REPO_LABELS';
  static IMPLEMENTED_INTERFACES = [];
  static ATTRIBUTES = {"GV_REGEX": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "I", "is_constant": " ", "is_class": "X"},
  "C_ALLOWED_CHARS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "visibility": "U", "is_constant": "X", "is_class": "X"}};
  static METHODS = {"VALIDATE_ONE_LABEL_COLOR": {"visibility": "I", "parameters": {"IS_LC": {"type": () => {return new abap.types.Structure({
  "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
  "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}},
  "VALIDATE_RGB_COLOR": {"visibility": "I", "parameters": {"IV_COLOR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_INDEX": {"type": () => {return new abap.types.Integer({qualifiedName: "I"});}, "is_optional": " "}}},
  "CLASS_CONSTRUCTOR": {"visibility": "U", "parameters": {}},
  "VALIDATE": {"visibility": "U", "parameters": {"IV_LABELS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "SPLIT": {"visibility": "U", "parameters": {"RT_LABELS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");}, "is_optional": " "}, "IV_LABELS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "NORMALIZE": {"visibility": "U", "parameters": {"RV_LABELS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_LABELS": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "VALIDATE_COLORS": {"visibility": "U", "parameters": {"IV_CONFIG": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "SPLIT_COLORS": {"visibility": "U", "parameters": {"RT_LABEL_COLORS": {"type": () => {return abap.types.TableFactory.construct(new abap.types.Structure({
  "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
  "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");}, "is_optional": " "}, "IV_CONFIG": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "SPLIT_COLORS_INTO_MAP": {"visibility": "U", "parameters": {"RO_MAP": {"type": () => {return new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});}, "is_optional": " "}, "IV_CONFIG": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "NORMALIZE_COLORS": {"visibility": "U", "parameters": {"RV_CONFIG": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}, "IV_CONFIG": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}},
  "PARSE_COLOR": {"visibility": "U", "parameters": {"RS_PARSED": {"type": () => {return new abap.types.Structure({
  "cls": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-CLS"}),
  "fg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-FG"}),
  "bg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BG"}),
  "border": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BORDER"})}, "zcl_abapgit_repo_labels=>ty_color", undefined, {}, {});}, "is_optional": " "}, "IV_COLOR": {"type": () => {return new abap.types.String({qualifiedName: "STRING"});}, "is_optional": " "}}}};
  #gv_regex;
  constructor() {
    this.me = new abap.types.ABAPObject();
    this.me.set(this);
    this.INTERNAL_ID = abap.internalIdCounter++;
    this.FRIENDS_ACCESS_INSTANCE = {
    };
    this.gv_regex = zcl_abapgit_repo_labels.gv_regex;
    this.c_allowed_chars = zcl_abapgit_repo_labels.c_allowed_chars;
  }
  async constructor_(INPUT) {
    if (super.constructor_) { await super.constructor_(INPUT); }
    return this;
  }
  async class_constructor() {
    return zcl_abapgit_repo_labels.class_constructor();
  }
  static async class_constructor() {
    zcl_abapgit_repo_labels.gv_regex.set(new abap.types.String().set(`^[${abap.templateFormatting(zcl_abapgit_repo_labels.c_allowed_chars)}]*$`));
  }
  async normalize(INPUT) {
    return zcl_abapgit_repo_labels.normalize(INPUT);
  }
  static async normalize(INPUT) {
    let rv_labels = new abap.types.String({qualifiedName: "STRING"});
    let iv_labels = INPUT?.iv_labels;
    if (iv_labels?.getQualifiedName === undefined || iv_labels.getQualifiedName() !== "STRING") { iv_labels = undefined; }
    if (iv_labels === undefined) { iv_labels = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_labels); }
    let lt_labels = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let lt_normalized = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let fs_lv_lab_ = new abap.types.FieldSymbol(new abap.types.String({qualifiedName: "STRING"}));
    lt_labels.set((await this.split({iv_labels: iv_labels})));
    for await (const unique557 of abap.statements.loop(lt_labels)) {
      fs_lv_lab_.assign(unique557);
      abap.statements.find(fs_lv_lab_, {regex: zcl_abapgit_repo_labels.gv_regex});
      if (abap.compare.eq(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        abap.statements.append({source: fs_lv_lab_, target: lt_normalized});
      }
    }
    abap.statements.sort(lt_normalized,{});
    await abap.statements.deleteInternal(lt_normalized,{adjacent: true});
    rv_labels.set(abap.builtin.concat_lines_of({table: lt_normalized, sep: new abap.types.String().set(`, `)}));
    return rv_labels;
  }
  async normalize_colors(INPUT) {
    return zcl_abapgit_repo_labels.normalize_colors(INPUT);
  }
  static async normalize_colors(INPUT) {
    let rv_config = new abap.types.String({qualifiedName: "STRING"});
    let iv_config = INPUT?.iv_config;
    if (iv_config?.getQualifiedName === undefined || iv_config.getQualifiedName() !== "STRING") { iv_config = undefined; }
    if (iv_config === undefined) { iv_config = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_config); }
    let lt_colors = abap.types.TableFactory.construct(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
    let lt_normalized = abap.types.TableFactory.construct(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
    let lt_pairs = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let lv_pair = new abap.types.String({qualifiedName: "STRING"});
    let fs_ls_c_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}));
    lt_colors.set((await this.split_colors({iv_config: iv_config})));
    for await (const unique558 of abap.statements.loop(lt_colors)) {
      fs_ls_c_.assign(unique558);
      try {
        await this.validate_one_label_color({is_lc: fs_ls_c_});
        abap.statements.append({source: fs_ls_c_, target: lt_normalized});
      } catch (e) {
        if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
        } else {
          throw e;
        }
      }
    }
    abap.statements.sort(lt_normalized,{by: [{component: "label"}]});
    await abap.statements.deleteInternal(lt_normalized,{adjacent: true,comparing: ['label']});
    for await (const unique559 of abap.statements.loop(lt_normalized)) {
      fs_ls_c_.assign(unique559);
      lv_pair.set(abap.operators.concat(fs_ls_c_.get().label,abap.operators.concat(new abap.types.String().set(`:`),fs_ls_c_.get().color)));
      abap.statements.append({source: lv_pair, target: lt_pairs});
    }
    rv_config.set(abap.builtin.concat_lines_of({table: lt_pairs, sep: new abap.types.String().set(`, `)}));
    return rv_config;
  }
  async parse_color(INPUT) {
    return zcl_abapgit_repo_labels.parse_color(INPUT);
  }
  static async parse_color(INPUT) {
    let rs_parsed = new abap.types.Structure({
    "cls": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-CLS"}),
    "fg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-FG"}),
    "bg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BG"}),
    "border": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BORDER"})}, "zcl_abapgit_repo_labels=>ty_color", undefined, {}, {});
    let iv_color = INPUT?.iv_color;
    if (iv_color?.getQualifiedName === undefined || iv_color.getQualifiedName() !== "STRING") { iv_color = undefined; }
    if (iv_color === undefined) { iv_color = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_color); }
    let lv_tmp = new abap.types.String({qualifiedName: "STRING"});
    if (abap.compare.initial(iv_color)) {
      return rs_parsed;
    }
    if (abap.compare.eq(iv_color.getOffset({offset: 0, length: 1}), abap.CharacterFactory.get(1, '#'))) {
      lv_tmp.set(iv_color.getOffset({offset: 1}));
      abap.statements.split({source: lv_tmp, at: abap.CharacterFactory.get(1, '/'), targets: [rs_parsed.get().fg,rs_parsed.get().bg,rs_parsed.get().border]});
    } else {
      rs_parsed.get().cls.set(iv_color);
    }
    return rs_parsed;
  }
  async split(INPUT) {
    return zcl_abapgit_repo_labels.split(INPUT);
  }
  static async split(INPUT) {
    let rt_labels = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let iv_labels = INPUT?.iv_labels;
    if (iv_labels?.getQualifiedName === undefined || iv_labels.getQualifiedName() !== "STRING") { iv_labels = undefined; }
    if (iv_labels === undefined) { iv_labels = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_labels); }
    let fs_lv_lab_ = new abap.types.FieldSymbol(new abap.types.String({qualifiedName: "STRING"}));
    abap.statements.split({source: iv_labels, at: abap.CharacterFactory.get(1, ','), table: rt_labels});
    for await (const unique560 of abap.statements.loop(rt_labels)) {
      fs_lv_lab_.assign(unique560);
      abap.statements.condense(fs_lv_lab_, {nogaps: false});
    }
    await abap.statements.deleteInternal(rt_labels,{where: async (I) => {return abap.compare.initial(I.table_line);}});
    return rt_labels;
  }
  async split_colors(INPUT) {
    return zcl_abapgit_repo_labels.split_colors(INPUT);
  }
  static async split_colors(INPUT) {
    let rt_label_colors = abap.types.TableFactory.construct(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
    let iv_config = INPUT?.iv_config;
    if (iv_config?.getQualifiedName === undefined || iv_config.getQualifiedName() !== "STRING") { iv_config = undefined; }
    if (iv_config === undefined) { iv_config = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_config); }
    let lt_pairs = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let lv_clean_config = new abap.types.String({qualifiedName: "STRING"});
    let ls_c = new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {});
    let fs_lv_pair_ = new abap.types.FieldSymbol(new abap.types.String({qualifiedName: "STRING"}));
    lv_clean_config.set(abap.builtin.replace({val: iv_config, sub: abap.Classes['CL_ABAP_CHAR_UTILITIES'].newline, with: new abap.types.String().set(` `)}));
    abap.statements.split({source: lv_clean_config, at: abap.CharacterFactory.get(1, ','), table: lt_pairs});
    for await (const unique561 of abap.statements.loop(lt_pairs)) {
      fs_lv_pair_.assign(unique561);
      abap.statements.condense(fs_lv_pair_, {nogaps: false});
      if (abap.compare.initial(fs_lv_pair_) === false) {
        abap.statements.split({source: fs_lv_pair_, at: abap.CharacterFactory.get(1, ':'), targets: [ls_c.get().label,ls_c.get().color]});
        abap.statements.condense(ls_c.get().label, {nogaps: false});
        abap.statements.condense(ls_c.get().color, {nogaps: false});
        abap.statements.append({source: ls_c, target: rt_label_colors});
      }
    }
    return rt_label_colors;
  }
  async split_colors_into_map(INPUT) {
    return zcl_abapgit_repo_labels.split_colors_into_map(INPUT);
  }
  static async split_colors_into_map(INPUT) {
    let ro_map = new abap.types.ABAPObject({qualifiedName: "ZCL_ABAPGIT_STRING_MAP", RTTIName: "\\CLASS=ZCL_ABAPGIT_STRING_MAP"});
    let iv_config = INPUT?.iv_config;
    if (iv_config?.getQualifiedName === undefined || iv_config.getQualifiedName() !== "STRING") { iv_config = undefined; }
    if (iv_config === undefined) { iv_config = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_config); }
    let lt_colors = abap.types.TableFactory.construct(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
    let fs_ls_c_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}));
    lt_colors.set((await this.split_colors({iv_config: iv_config})));
    ro_map.set((await abap.Classes['ZCL_ABAPGIT_STRING_MAP'].create()));
    for await (const unique562 of abap.statements.loop(lt_colors)) {
      fs_ls_c_.assign(unique562);
      try {
        await ro_map.get().set({iv_key: fs_ls_c_.get().label, iv_val: fs_ls_c_.get().color});
      } catch (e) {
        if ((abap.Classes['ZCX_ABAPGIT_EXCEPTION'] && e instanceof abap.Classes['ZCX_ABAPGIT_EXCEPTION'])) {
        } else {
          throw e;
        }
      }
    }
    return ro_map;
  }
  async validate(INPUT) {
    return zcl_abapgit_repo_labels.validate(INPUT);
  }
  static async validate(INPUT) {
    let iv_labels = INPUT?.iv_labels;
    if (iv_labels?.getQualifiedName === undefined || iv_labels.getQualifiedName() !== "STRING") { iv_labels = undefined; }
    if (iv_labels === undefined) { iv_labels = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_labels); }
    let lt_labels = abap.types.TableFactory.construct(new abap.types.String({qualifiedName: "STRING"}), {"withHeader":false,"keyType":"DEFAULT","primaryKey":{"isUnique":false,"type":"STANDARD","keyFields":[],"name":"primary_key"},"secondary":[]}, "STRING_TABLE");
    let fs_lv_lab_ = new abap.types.FieldSymbol(new abap.types.String({qualifiedName: "STRING"}));
    lt_labels.set((await this.split({iv_labels: iv_labels})));
    for await (const unique563 of abap.statements.loop(lt_labels)) {
      fs_lv_lab_.assign(unique563);
      abap.statements.find(fs_lv_lab_, {regex: zcl_abapgit_repo_labels.gv_regex});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Disallowed chars in label #${abap.templateFormatting(abap.builtin.sy.get().tabix)}`)});
      }
    }
  }
  async validate_colors(INPUT) {
    return zcl_abapgit_repo_labels.validate_colors(INPUT);
  }
  static async validate_colors(INPUT) {
    let iv_config = INPUT?.iv_config;
    if (iv_config?.getQualifiedName === undefined || iv_config.getQualifiedName() !== "STRING") { iv_config = undefined; }
    if (iv_config === undefined) { iv_config = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_config); }
    let lt_colors = abap.types.TableFactory.construct(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
    let fs_ls_c_ = new abap.types.FieldSymbol(new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}));
    lt_colors.set((await this.split_colors({iv_config: iv_config})));
    for await (const unique564 of abap.statements.loop(lt_colors)) {
      fs_ls_c_.assign(unique564);
      await this.validate_one_label_color({is_lc: fs_ls_c_, iv_index: abap.builtin.sy.get().tabix});
    }
  }
  async validate_one_label_color(INPUT) {
    return zcl_abapgit_repo_labels.validate_one_label_color(INPUT);
  }
  static async validate_one_label_color(INPUT) {
    let is_lc = INPUT?.is_lc;
    if (is_lc?.getQualifiedName === undefined || is_lc.getQualifiedName() !== "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR") { is_lc = undefined; }
    if (is_lc === undefined) { is_lc = new abap.types.Structure({
    "label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
    "color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}).set(INPUT.is_lc); }
    let iv_index = new abap.types.Integer({qualifiedName: "I"});
    if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);}
    if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);}
    let ls_parsed_color = new abap.types.Structure({
    "cls": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-CLS"}),
    "fg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-FG"}),
    "bg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BG"}),
    "border": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BORDER"})}, "zcl_abapgit_repo_labels=>ty_color", undefined, {}, {});
    if (abap.compare.initial(is_lc.get().label)) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Label is empty in pair #${abap.templateFormatting(iv_index)}`)});
    }
    if (abap.compare.initial(is_lc.get().color)) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Color is empty in pair #${abap.templateFormatting(iv_index)}`)});
    }
    abap.statements.find(is_lc.get().label, {regex: zcl_abapgit_repo_labels.gv_regex});
    if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
      await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Disallowed chars in label in pair #${abap.templateFormatting(iv_index)}`)});
    }
    ls_parsed_color.set((await this.parse_color({iv_color: is_lc.get().color})));
    if (abap.compare.initial(ls_parsed_color.get().cls) === false) {
      abap.statements.find(ls_parsed_color.get().cls, {regex: abap.CharacterFactory.get(13, '^[-_A-Za-z]+$')});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Disallowed chars in color in pair #${abap.templateFormatting(iv_index)}`)});
      }
    }
    if (abap.compare.initial(ls_parsed_color.get().fg) === false) {
      await this.validate_rgb_color({iv_color: ls_parsed_color.get().fg});
    }
    if (abap.compare.initial(ls_parsed_color.get().bg) === false) {
      await this.validate_rgb_color({iv_color: ls_parsed_color.get().bg});
    }
    if (abap.compare.initial(ls_parsed_color.get().border) === false) {
      await this.validate_rgb_color({iv_color: ls_parsed_color.get().border});
    }
  }
  async validate_rgb_color(INPUT) {
    return zcl_abapgit_repo_labels.validate_rgb_color(INPUT);
  }
  static async validate_rgb_color(INPUT) {
    let iv_color = INPUT?.iv_color;
    if (iv_color?.getQualifiedName === undefined || iv_color.getQualifiedName() !== "STRING") { iv_color = undefined; }
    if (iv_color === undefined) { iv_color = new abap.types.String({qualifiedName: "STRING"}).set(INPUT.iv_color); }
    let iv_index = new abap.types.Integer({qualifiedName: "I"});
    if (INPUT && INPUT.iv_index) {iv_index.set(INPUT.iv_index);}
    if (INPUT === undefined || INPUT.iv_index === undefined) {iv_index = abap.IntegerFactory.get(0);}
    let lv_len = new abap.types.Integer({qualifiedName: "I"});
    if (abap.compare.initial(iv_color) === false) {
      abap.statements.find(iv_color, {regex: abap.CharacterFactory.get(14, '^[0-9A-Fa-f]+$')});
      if (abap.compare.ne(abap.builtin.sy.get().subrc, abap.IntegerFactory.get(0))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Disallowed chars in color in pair #${abap.templateFormatting(iv_index)}`)});
      }
      lv_len.set(abap.builtin.strlen({val: iv_color}));
      if (!(abap.compare.eq(lv_len, abap.IntegerFactory.get(3)) || abap.compare.eq(lv_len, abap.IntegerFactory.get(6)))) {
        await abap.Classes['ZCX_ABAPGIT_EXCEPTION'].raise({iv_text: new abap.types.String().set(`Incorrect color in pair #${abap.templateFormatting(iv_index)}`)});
      }
    }
  }
}
abap.Classes['ZCL_ABAPGIT_REPO_LABELS'] = zcl_abapgit_repo_labels;
zcl_abapgit_repo_labels.gv_regex = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_repo_labels.c_allowed_chars = new abap.types.String({qualifiedName: "STRING"});
zcl_abapgit_repo_labels.c_allowed_chars.set(`-_. a-zA-Z0-9`);
await abap.Classes['ZCL_ABAPGIT_REPO_LABELS'].class_constructor();
zcl_abapgit_repo_labels.ty_label_color = new abap.types.Structure({
"label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
"color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {});
zcl_abapgit_repo_labels.ty_label_colors = abap.types.TableFactory.construct(new abap.types.Structure({
"label": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-LABEL"}),
"color": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_LABEL_COLOR-COLOR"})}, "zcl_abapgit_repo_labels=>ty_label_color", undefined, {}, {}), {"withHeader":false,"keyType":"USER","primaryKey":{"name":"primary_key","type":"STANDARD","isUnique":false,"keyFields":["LABEL"]},"secondary":[]}, "zcl_abapgit_repo_labels=>ty_label_colors");
zcl_abapgit_repo_labels.ty_color = new abap.types.Structure({
"cls": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-CLS"}),
"fg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-FG"}),
"bg": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BG"}),
"border": new abap.types.String({qualifiedName: "ZCL_ABAPGIT_REPO_LABELS=>TY_COLOR-BORDER"})}, "zcl_abapgit_repo_labels=>ty_color", undefined, {}, {});
export {zcl_abapgit_repo_labels};