class Configuration {
  static instance = null;

  static getInstance() {
    if (this.instance == null) {
      this.instance = new Configuration();
    }
    return this.instance;
  }

  get is_debug() {
    return false;
  }

  get ajax_url() {
    return window.ajaxurl;
  }

  get categories() {
    let cats = []
    for (let i=0; i<10; i++) {
      cats.push({value: 'cat'+i, label: 'Category '+i})
    }
    return cats
  }

  get selectedCategories()
  {
    return window.dreamfox_wdd_params['categories'];
  }

  get commonSettings()
  {
    return {
      deliveryDays: 100,
    }
  }

  get otherSettings()
  {
    return {
      required: false,
      showEmptyOnCheckout: true,
      labelOnCheckout: 'labelOnCheckout',
      descriptionOnCheckout: 'descriptionOnCheckout',
    }
  }

  get categorySettings()
  {
    return [
      {id: 1, name: 'Cat 1', selected: false, days: 10},
      {id: 2, name: 'Cat 2', selected: true, days: 20},
    ]
  }

  get holidaySettings()
  {
    return {
      countOnlyWorkingDays: false,
      disableDays: [
        {id: 2, label: 'Monday', checked: false},
        {id: 3, label: 'Tuesday', checked: false},
        {id: 4, label: 'Wednesday', checked: false},
        {id: 5, label: 'Thursday', checked: false},
        {id: 6, label: 'Friday', checked: false},
        {id: 7, label: 'Saturday', checked: false},
        {id: 1, label: 'Sunday', checked: false},
      ],
      holidays: [
        {id: 1, label: 'I]', startDate: '', endDate: ''},
        {id: 2, label: 'II]', startDate: '', endDate: ''},
        {id: 3, label: 'III]', startDate: '', endDate: ''},
        {id: 4, label: 'IV]', startDate: '', endDate: ''},
        {id: 5, label: 'V]', startDate: '', endDate: ''},
      ],
    }
  }

  get nonce() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['nonce'] : '';
  }

  get asset_images_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['assetImageUrl'] : '';
  }

  get is_premium() {
    return window.dreamfox_wdd_params ? !!window.dreamfox_wdd_params['isPremium'] : true;
  }

  get upgrade_url() {
    return (window.dreamfox_wdd_params && window.dreamfox_wdd_params['upgradeUrl'])
      ? window.dreamfox_wdd_params['upgradeUrl']
      : '';
  }

  get premium_features_url() {
    return (window.dreamfox_wdd_params && window.dreamfox_wdd_params['premiumFeaturesUrl'])
      ? window.dreamfox_wdd_params['premiumFeaturesUrl']
      : this.upgrade_url;
  }

  get support_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['supportUrl'] || 'https://dreamfoxmedia.com/support' : 'https://dreamfoxmedia.com/support';
  }

  get contact_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['contactUrl'] || this.support_url : this.support_url;
  }

  get kb_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['kbUrl'] || 'https://help.dreamfoxmedia.com/delivery-date-for-woocommerce' : 'https://help.dreamfoxmedia.com/delivery-date-for-woocommerce';
  }

  get faq_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['faqUrl'] || 'https://wordpress.org/plugins/woocommerce-delivery-date/#faq' : 'https://wordpress.org/plugins/woocommerce-delivery-date/#faq';
  }

  get wp_support_url() {
    return window.dreamfox_wdd_params ? window.dreamfox_wdd_params['wpSupportUrl'] || 'https://wordpress.org/support/plugin/woocommerce-delivery-date/' : 'https://wordpress.org/support/plugin/woocommerce-delivery-date/';
  }
}

export default Configuration