/**
 * APP設定檔案,可能會由jenkins異動
 */
import {Platform} from 'react-native';

export const piwikUrl = 'https://piwik.uhealthbank.com/piwik.php';
const piwikSiteId_ios = 9;
const piwikSiteId_android = 8;
const installSourceId_ios = 'Apple';
const installSourceId_android = 'Google';
export const piwikSiteId = Platform.select({
  ios: () => piwikSiteId_ios,
  android: () => piwikSiteId_android,
})();
export const installSourceId = Platform.select({
  ios: () => installSourceId_ios,
  android: () => installSourceId_android,
})();
export const url = 'http://10.32.86.124/';
export const version = '1.0';
export const modifiedTime = '2017-08-13 17:01:01 +0800';
export const fakeDeviceToken = 'fakeDeviceToken';
export const appUrl = Platform.select({
  ios: () => '',
  android: () => 'market://details?id=',
})();
/* 過敏專區為靜態網頁,預設為連線正式機,開發為連線132,若是SIT/UAT則由jenkins設定 */
export const allergyUrl = __DEV__ ? 'http://10.32.86.124/' : url;

export const APP_CODE = 'HRB-app';

// APP初始化預設語系
export const defaultLanguageCode = 'zh_TW';
/**
 * 單位規格
 * 公制：SI(Système International d'Unités)
 * 美制: USCU(United States customary units)
 * 英制: Imperial(目前沒有特別實作, 目前與公制並列)
 */
export const unitStandard = 'SI';

/* 是否忽略企業用戶代碼取得的連結 */
export const IS_LOCAL_URL = false;

/* 排除 Navigator */
const navigatorExcludedDefault = [];

export const navigatorExcluded = navigatorExcludedDefault;
export const AVATAR_SOURCE = require('../images/profileicon.png');

// 刪除醫療影像目錄比較天數
export const dicomDeleteDays = 7;

// 健康存摺 SDK 產製檔案是否略過檢查身份證號
export const HEALTHBOOK_SDK_PASS_CHECK_ID = false;

// 日期預設格式
let formatDate;
let formatMonth;
let formatDateTime;
const formatTime = 'HH:mm';
const formatMonthDate = 'MM/DD';
let format24Hour;
if (unitStandard === 'USCU') {
  formatDate = 'MM/DD/YYYY';
  formatMonth = 'MM/YYYY';
  formatDateTime = 'MM/DD/YYYY HH:mm';
  format24Hour = 'MM/DD/YYYY HH';
} else {
  formatDate = 'YYYY/MM/DD';
  formatMonth = 'YYYY/MM';
  formatDateTime = 'YYYY/MM/DD HH:mm';
  format24Hour = 'YYYY/MM/DD HH';
}

export const FORMAT_DATE = formatDate;
export const FORMAT_MONTH = formatMonth;
export const FORMAT_MONTH_DATE = formatMonthDate;
export const FORMAT_DATE_TIME = formatDateTime;
export const FORMAT_TIME = formatTime;
export const FORMAT_24_HOUR = format24Hour;
// 是否啟用健康存摺下載功能
export const HEALTBOOK_SDK_ENABLED = true;
