const Application_License = [
  'Mobile Game License',
  'Non-Mobile Game License',
  'Mobile App License',
  'App License',
  'Ec-App License',
  'Companion App License',
  'App+ License',
  'Software Distribution',
  'App',
  'Gaming',
  'app_annual',
  'App Pay As You Go / 50000 titles for one year',
  'Application Unlimited',
];

const Desktop_License = [
  'Desktop App',
  'User',
  'Computer',
  'Combined (Computer+User)',
  'Fontservice',
  'Third Party Desktop License',
  'Desktop License (max. 5 Users)',
  'Single Seat Desktop License (1 User)',
  'Multiuser Desktop License',
  'DTL Desktop License (1 User)',
  'Studio',
  'Small business',
  'Personal (non-commercial) Licence',
  'Single User Studio Licence',
  'desktop',
  'Desktop Pay Once / 5 users',
  'Desktop Pay Once / 1 user',
];

const Digital_Ads_License = [
  'Digital Ads License',
  'ad',
  'Digital Ads Pay As You Go',
  'Digital Ads Pay As You Go / 1000000 impressions',
];

const ePub_License = ['ePub License', 'Commercial Documents', 'ePub', 'ebook'];

const Product_License = ['Product', 'Product license'];

const Server_License = [
  'Server License',
  'Server App License',
  'Web-to-print',
  'Server',
  'server_annual',
];

const Webfont_License = [
  'PageViews',
  'Companion WebFont License',
  'WebPayOnce License',
  'Web License',
  'Web Only',
  'CRM self-hosted Webfonts',
  'Cloud.typography',
  'Self-hosted Webfonts',
  'Web Font EULA',
  'Computer, PageView',
  'web',
  'web_annual',
  'Webfont Pay Once',
  'Webfont Pay As You Go',
  'Webfonts Pay As You Go / 250000 page views',
  'Webfonts Pay Once / 10000 page views per month',
  'Webfonts Pay Once / Unlimited page views per month',
  'Webfonts / 100,000 pageviews per month',
  'Cloud.typography',
  'Cloud Upgrade',
  'Custom',
];

export const Others = [
  'FEA',
  'Gift Card',
  'Report',
  'Provision/Commission',
  'Wartungs-/Servicevertrag',
  'Enterprise License',
  'Versandkosten',
  'eFont License',
  'Buch',
  'Extended License',
  '(keine Angabe)',
  'OEM License',
  'Discount/Rabatt',
  'Monotype Imaging EULA',
  'Droid Pro Fonts EULA',
  'Font Bureau EULA',
  'LetterPerfect EULA',
  'Letraset EULA',
  'Simonson EULA',
  'Paratype EULA',
  'Parkinson EULA',
  'Red Rooster EULA',
  'Mecanorma EULA',
  'Prime Graphics EULA',
  'ABC Types EULA',
  'Alan Meeks EULA',
  'exljbris EULA',
  'ClubType EULA',
  `Nick's Fonts EULA`,
  'Webtype EULA',
  'SOTA EULA',
  'Dynacomware EULA',
  'Type-Together EULA',
  'Dunwich EULA',
  'Georgia and Verdana Fonts EULA',
  'Ascender EULA',
  'Berthold Fonts EULA',
  'ITC EULA',
  'Linotype EULA',
  'Adobe EULA',
  'Image Club EULA',
  'China Type EULA',
  'Supplier',
  'Broadcast',
  'moving-socialmedia',
  'moving-broadcasting',
  'trademark',
  'GiftCertificate',
  'Library_Subscription',
  'Webfont_Digital_Ad',
];

export const getLicenseConstantName = (licenseType: string) => {
  const lowerCaseLicenseType = licenseType.toLowerCase();

  if (
    Application_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'Application License';
  } else if (
    Desktop_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'Desktop License';
  } else if (
    Digital_Ads_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'Digital Ads License';
  } else if (
    ePub_License
      .map((item) => item.toLowerCase())
      .includes(lowerCaseLicenseType)
  ) {
    return 'ePub License';
  } else if (
    Product_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'product License';
  } else if (
    Server_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'Server License';
  } else if (
    Webfont_License.map((item) => item.toLowerCase()).includes(
      lowerCaseLicenseType,
    )
  ) {
    return 'Webfont License';
  } else {
    return 'Others';
  }
};
