import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class CityCategoryService {

  private _population1kk = new Set<string>([
    "QIN","THR","FRU","KZN","LED","IST","HKG","PEE","UFA",
    "OVB","CEK","CAI","SVX","EVN","DEL","MSQ",
    "KJA","KUF","NQZ","OMS","ALA","SHA","VOG",
    "BAK","BKK","BJS","MOW","GOJ","VVO","KHV"
  ]);

  private _population500k = new Set<string>([
    "TJM","TOF","SKD","ULY","PEZ","MCX","KEJ",
    "IJK","REN","ASF","NOZ","BAX","RTW","DOH",
    "AUH","SSH","TAS","CIT","SGN","CAN","HRB",
    "VRA","KGF",
  ]);

  private _population100k = new Set<string>([
    "MMK","GDX","SGC","DYR","ESL","OSS","KVD","KVK","GUW","SCW",
    "SCO","NJC","NBC","UGC","UUD","YKS","MJZ","SKX","STW","KSN",
    "KGD","HMA","HTA","RGK","GRV","ABA","PKC","NAL","MQF","MRV",
    "OSW","ARH","UUS","NUX","BHK","PYJ","CSY","BQS","DLM"
  ]);

  private _popularResorts = new Set<string>([
    "AER","AYT","BJV","CMB","DPS","DXB","GOI",
    "HAV","HKT","HRG","MLE","NHA","SEZ","SYX","IKT"
  ])

  get population1kk(): Set<string>  { return this._population1kk; }
  get population500k(): Set<string> { return this._population500k; }
  get population100k(): Set<string> { return this._population100k; }
  get popularResorts():  Set<string> { return this._popularResorts; }

  zoomLevel(code: string): number 
  {
    if (this._population1kk.has(code) || this._popularResorts.has(code)) 
    {
      return 2;
    }

    if (this._population500k.has(code))
    {
      return 5;
    }   

    if (this._population100k.has(code))
    {
      return 6;
    }      

    return 6;
  }
}
