<?php

namespace GriffinForms\Admin\Choices;

use GriffinForms\Admin\Choices\Traits\AddressSubdivisions;

class Field extends \GriffinForms\Admin\Choices\Format
{
    use AddressSubdivisions;

    protected function getDefaultValueTypeInputText()
    {
        return array('none', 'custom', 'variable');
    }    
    
    protected function getDefaultValueTypeInputNumber()
    {
        return array('none', 'custom', 'variable');
    }    
    
    protected function getDefaultValueTypeInputEmail()
    {
        return array('none', 'custom', 'variable');
    }    
    
    protected function getDefaultValueTypeInputPassword()
    {
        return array('none');
    }    
    
    protected function getDefaultValueTypeInputPhone()
    {
        return array('none', 'custom', 'variable');
    }    

    protected function getDefaultValueTypeInputAddress()
    {
        return array('none');
    }
    
    protected function getDefaultValueTypeInputUrl()
    {
        return array('none', 'custom', 'variable');
    }
    
    protected function getDefaultValueTypeInputDate()
    {
        return array('none', 'custom');
    }

    protected function getDefaultValueTypeInputTime()
    {
        return array('none', 'custom');
    }

    protected function getDefaultValueTypeSelectField()
    {
        return array('none', 'custom');
    }
    
    protected function getDefaultValueTypeInputRadio()
    {
        return array('none', 'custom');
    }
    
    protected function getDefaultValueTypeInputCheckbox()
    {
        return array('none', 'custom');
    }
    
    protected function getDefaultValueTypeTextArea()
    {
        return array('none', 'custom');
    }
    
    protected function getVariableValuesInputText()
    {
        return array('page_title', 'user_first_name', 'user_last_name');
    }
    
    protected function getVariableValuesInputNumber()
    {
        return array('page_id', 'user_id');
    }
    
    protected function getVariableValuesInputEmail()
    {
        return array('user_email');
    }
    
    protected function getVariableValuesInputPassword()
    {
        return array('none');
    }
    
    protected function getVariableValuesInputPhone()
    {
        return array('user_phone');
    }
    
    protected function getVariableValuesInputUrl()
    {
        return array('user_website', 'current_url');
    }
    
    protected function getVariableValuesInputDate()
    {
        return $this->getDateVariables();
    }

    protected function getVariableValuesInputTime()
    {
        return array('none');
    }

    protected function getVariableValuesSelectField()
    {
        return array('none');
    }
    
    protected function getVariableValuesInputRadio()
    {
        return array('none');
    }
    
    protected function getVariableValuesInputCheckbox()
    {
        return array('none');
    }
    
    protected function getVariableValuesTextArea()
    {
        return array('none');
    }
    
    protected function getValidationTypesInputText()
    {
    	return array('none', 'pattern', 'custom-parameters','db-validate');
    }
    
    protected function getValidationTypesInputNumber()
    {
    	return array('none', 'pattern', 'custom-parameters', 'multiples_of', 'db-validate');
    }
    
    protected function getValidationTypesInputEmail()
    {
    	return array('none', 'pattern', 'custom-parameters', 'db-validate');
    }
    
    protected function getValidationTypesInputPassword()
    {
    	return array('none', 'pattern', 'custom-parameters');
    }
    
    protected function getValidationTypesInputPhone()
    {
    	return array('none', 'pattern', 'custom-parameters', 'db-validate');
    }

    protected function getValidationTypesInputAddress()
    {
        return array('none', 'custom-parameters');
    }
    
    protected function getValidationTypesInputUrl()
    {
    	return array('none', 'pattern', 'custom-parameters', 'db-validate');
    }
    
    protected function getValidationTypesInputDate()
    {
    	return array('none', 'custom-parameters');
    }

    protected function getValidationTypesInputTime()
    {
    	return array('none', 'custom-parameters');
    }

    protected function getValidationTypesSignature()
    {
        return array('none');
    }

    protected function getValidationTypesInputrating()
    {
        return array('none', 'min_rating');
    }

    protected function getValidationTypesInputrichtext()
    {
        return array('none');
    }

    protected function getValidationTypesInputlikert()
    {
        return array('none');
    }

    protected function getValidationTypesImageselection()
    {
        return array('none', 'min_max_select');
    }

    protected function getValidationTypesSelectField()
    {
    	return array('none');
    }

    protected function getValidationTypesInputRadio()
    {
    	return array('none');
    }

    protected function getValidationTypesTextArea()
    {
    	return array('none', 'custom-parameters');
    }
    
    protected function getValidationTypesInputCheckbox()
    {
    	return array('none', 'custom-parameters');
    }

    protected function getCountryFilterModeInputAddress()
    {
        return array(
            'all_countries',
            'limit_to_countries',
            'exclude_countries'
        );
    }
    
    protected function getMatchType()
    {
    	return array('in_column', 'not_in_column');
    }
    
    protected function getAllowNumberTypeInputNumber()
    {
        return array(
            'any_number', 
            'odd_numbers', 
            'even_numbers'
        );
    }
    
    protected function getAllowProtocolTypeInputUrl()
    {
        return array(
            'http',
            'https',
            'ftp',
            'sftp'
        );
    }
    
    protected function getPhoneFormatTypeInputPhone()
    {
        return array(
            'any_format',
            'international_format',
            'national_format'
        );
    }

    protected function getPhoneDisplayModeInputPhone()
    {
        return array(
            'flag_code',
            'code_only',
            'flag_code_name'
        );
    }
    
    protected function getDateLogic()
    {
        return array(
            'before_date',
            'after_date'
        );
    }
    
    protected function getDateVariables()
    {
        return array(
            'current_date',
            'current_page_publish_date',
            'current_page_edit_date',
            'current_form_creation_date'
        );
    }
    
    protected function getValidationDateTypeInputdate()
    {
        return array(
            'fixed_date',
            'relative_date'
        );
    }
    
    protected function getDayType()
    {
        return array(
            'all_days',
            'weekdays',
            'weekends',
            'sunday',
            'monday',
            'tuesday',
            'wednesday',
            'thursday',
            'friday',
            'saturday',
            'sunday'
        );
    }
    
    protected function getDateFormat()
    {
        return array(
            'yy-mm-dd',
            'dd-mm-yy'
        );
    }

    protected function getTimeFormat()
    {
        return array(
            '24h',
            '12h'
        );
    }

    protected function getStorageMode()
    {
        return array(
            'private',
            'media_library'
        );
    }

    protected function getImageMimes()
    {
        return array(
            'jpg', 'jpeg', 'png', 'gif', 'webp', 'bmp', 'heic', 'tif', 'tiff'
        );
    }

    protected function getDocumentMimes()
    {
        return array(
            'doc', 'docx', 'odt', 'rtf', 'wps'
        );
    }

    protected function getSpreadsheetMimes()
    {
        return array(
            'xls', 'xlsx', 'ods', 'csv', 'tsv'
        );
    }

    protected function getPresentationMimes()
    {
        return array(
            'ppt', 'pptx', 'odp', 'key'
        );
    }

    protected function getPdfMimes()
    {
        return array('pdf');
    }

    protected function getAudioMimes()
    {
        return array(
            'mp3', 'aac', 'wav', 'flac', 'ogg', 'm4a'
        );
    }

    protected function getVideoMimes()
    {
        return array(
            'mp4', 'webm', 'mov', 'mkv', 'avi', 'mpeg'
        );
    }

    protected function getArchiveMimes()
    {
        return array(
            'zip', 'sevenz', 'rar', 'tar', 'gz', 'tgz'
        );
    }

    protected function getCodeMimes()
    {
        return array(
            'json', 'xml', 'html', 'css', 'js', 'php', 'py', 'java', 'c', 'cpp', 'cs', 'rb', 'go', 'sh', 'sql', 'yml', 'yaml', 'md'
        );
    }

    protected function getTextMimes()
    {
        return array(
            'txt', 'log', 'md', 'markdown'
        );
    }

    protected function getOtherMimes()
    {
        return array(
            // Fonts & misc
            'eot', 'ttf', 'otf', 'woff', 'woff2', 'ico',
            // Design files
            'psd', 'ai', 'eps'
        );
    }

    /**
     * SVG is unsafe by default in WordPress (can contain scripts). Keep as a separate
     * opt-in bucket so UI can show an explicit warning and keep it OFF by default.
     */
    protected function getSvgMimesUnsafe()
    {
        return array('svg');
    }

    protected function getMimeQuickSelect()
    {
        return array(
            'all',
            'images',
            'documents',
            'spreadsheets',
            'presentations',
            'pdf',
            'audio',
            'video',
            'archives',
            'code',
            'text',
            'manually_select'
        );
    }

    protected function getAddressCountries()
    {
        return array(
            'AF' => 'Afghanistan',
            'AL' => 'Albania',
            'DZ' => 'Algeria',
            'AS' => 'American Samoa',
            'AD' => 'Andorra',
            'AO' => 'Angola',
            'AI' => 'Anguilla',
            'AG' => 'Antigua and Barbuda',
            'AR' => 'Argentina',
            'AM' => 'Armenia',
            'AW' => 'Aruba',
            'AU' => 'Australia',
            'AT' => 'Austria',
            'AZ' => 'Azerbaijan',
            'BS' => 'Bahamas',
            'BH' => 'Bahrain',
            'BD' => 'Bangladesh',
            'BB' => 'Barbados',
            'BY' => 'Belarus',
            'BE' => 'Belgium',
            'BZ' => 'Belize',
            'BJ' => 'Benin',
            'BM' => 'Bermuda',
            'BT' => 'Bhutan',
            'BO' => 'Bolivia',
            'BQ' => 'Bonaire, Sint Eustatius and Saba',
            'BA' => 'Bosnia and Herzegovina',
            'BW' => 'Botswana',
            'BR' => 'Brazil',
            'IO' => 'British Indian Ocean Territory',
            'VG' => 'British Virgin Islands',
            'BN' => 'Brunei',
            'BG' => 'Bulgaria',
            'BF' => 'Burkina Faso',
            'BI' => 'Burundi',
            'KH' => 'Cambodia',
            'CM' => 'Cameroon',
            'CA' => 'Canada',
            'CV' => 'Cape Verde',
            'KY' => 'Cayman Islands',
            'CF' => 'Central African Republic',
            'TD' => 'Chad',
            'CL' => 'Chile',
            'CN' => 'China',
            'CX' => 'Christmas Island',
            'CC' => 'Cocos Islands',
            'CO' => 'Colombia',
            'KM' => 'Comoros',
            'CK' => 'Cook Islands',
            'CR' => 'Costa Rica',
            'CI' => 'Cote d\'Ivoire',
            'HR' => 'Croatia',
            'CU' => 'Cuba',
            'CW' => 'Curacao',
            'CY' => 'Cyprus',
            'CZ' => 'Czechia',
            'CD' => 'Democratic Republic of the Congo',
            'DK' => 'Denmark',
            'DJ' => 'Djibouti',
            'DM' => 'Dominica',
            'DO' => 'Dominican Republic',
            'TL' => 'Timor-Leste',
            'EC' => 'Ecuador',
            'EG' => 'Egypt',
            'SV' => 'El Salvador',
            'GQ' => 'Equatorial Guinea',
            'ER' => 'Eritrea',
            'EE' => 'Estonia',
            'SZ' => 'Eswatini',
            'ET' => 'Ethiopia',
            'FK' => 'Falkland Islands',
            'FO' => 'Faroe Islands',
            'FJ' => 'Fiji',
            'FI' => 'Finland',
            'FR' => 'France',
            'GF' => 'French Guiana',
            'PF' => 'French Polynesia',
            'GA' => 'Gabon',
            'GM' => 'Gambia',
            'GE' => 'Georgia',
            'DE' => 'Germany',
            'GH' => 'Ghana',
            'GI' => 'Gibraltar',
            'GR' => 'Greece',
            'GL' => 'Greenland',
            'GD' => 'Grenada',
            'GP' => 'Guadeloupe',
            'GU' => 'Guam',
            'GT' => 'Guatemala',
            'GG' => 'Guernsey',
            'GN' => 'Guinea',
            'GW' => 'Guinea-Bissau',
            'GY' => 'Guyana',
            'HT' => 'Haiti',
            'HN' => 'Honduras',
            'HK' => 'Hong Kong',
            'HU' => 'Hungary',
            'IS' => 'Iceland',
            'IN' => 'India',
            'ID' => 'Indonesia',
            'IR' => 'Iran',
            'IQ' => 'Iraq',
            'IE' => 'Ireland',
            'IM' => 'Isle of Man',
            'IL' => 'Israel',
            'IT' => 'Italy',
            'JM' => 'Jamaica',
            'JP' => 'Japan',
            'JE' => 'Jersey',
            'JO' => 'Jordan',
            'KZ' => 'Kazakhstan',
            'KE' => 'Kenya',
            'KI' => 'Kiribati',
            'XK' => 'Kosovo',
            'KW' => 'Kuwait',
            'KG' => 'Kyrgyzstan',
            'LA' => 'Laos',
            'LV' => 'Latvia',
            'LB' => 'Lebanon',
            'LS' => 'Lesotho',
            'LR' => 'Liberia',
            'LY' => 'Libya',
            'LI' => 'Liechtenstein',
            'LT' => 'Lithuania',
            'LU' => 'Luxembourg',
            'MO' => 'Macao',
            'MG' => 'Madagascar',
            'MW' => 'Malawi',
            'MY' => 'Malaysia',
            'MV' => 'Maldives',
            'ML' => 'Mali',
            'MT' => 'Malta',
            'MH' => 'Marshall Islands',
            'MQ' => 'Martinique',
            'MR' => 'Mauritania',
            'MU' => 'Mauritius',
            'YT' => 'Mayotte',
            'MX' => 'Mexico',
            'FM' => 'Micronesia',
            'MD' => 'Moldova',
            'MC' => 'Monaco',
            'MN' => 'Mongolia',
            'ME' => 'Montenegro',
            'MS' => 'Montserrat',
            'MA' => 'Morocco',
            'MZ' => 'Mozambique',
            'MM' => 'Myanmar',
            'NA' => 'Namibia',
            'NR' => 'Nauru',
            'NP' => 'Nepal',
            'NL' => 'Netherlands',
            'NC' => 'New Caledonia',
            'NZ' => 'New Zealand',
            'NI' => 'Nicaragua',
            'NE' => 'Niger',
            'NG' => 'Nigeria',
            'NU' => 'Niue',
            'NF' => 'Norfolk Island',
            'KP' => 'North Korea',
            'MK' => 'North Macedonia',
            'MP' => 'Northern Mariana Islands',
            'NO' => 'Norway',
            'OM' => 'Oman',
            'PK' => 'Pakistan',
            'PW' => 'Palau',
            'PS' => 'Palestine',
            'PA' => 'Panama',
            'PG' => 'Papua New Guinea',
            'PY' => 'Paraguay',
            'PE' => 'Peru',
            'PH' => 'Philippines',
            'PN' => 'Pitcairn Islands',
            'PL' => 'Poland',
            'PT' => 'Portugal',
            'PR' => 'Puerto Rico',
            'QA' => 'Qatar',
            'CG' => 'Republic of the Congo',
            'RE' => 'Reunion',
            'RO' => 'Romania',
            'RU' => 'Russia',
            'RW' => 'Rwanda',
            'BL' => 'Saint Barthelemy',
            'SH' => 'Saint Helena',
            'KN' => 'Saint Kitts and Nevis',
            'LC' => 'Saint Lucia',
            'MF' => 'Saint Martin',
            'PM' => 'Saint Pierre and Miquelon',
            'VC' => 'Saint Vincent and the Grenadines',
            'WS' => 'Samoa',
            'SM' => 'San Marino',
            'ST' => 'Sao Tome and Principe',
            'SA' => 'Saudi Arabia',
            'SN' => 'Senegal',
            'RS' => 'Serbia',
            'SC' => 'Seychelles',
            'SL' => 'Sierra Leone',
            'SG' => 'Singapore',
            'SX' => 'Sint Maarten',
            'SK' => 'Slovakia',
            'SI' => 'Slovenia',
            'SB' => 'Solomon Islands',
            'SO' => 'Somalia',
            'ZA' => 'South Africa',
            'GS' => 'South Georgia and the South Sandwich Islands',
            'KR' => 'South Korea',
            'SS' => 'South Sudan',
            'ES' => 'Spain',
            'LK' => 'Sri Lanka',
            'SD' => 'Sudan',
            'SR' => 'Suriname',
            'SJ' => 'Svalbard and Jan Mayen',
            'SE' => 'Sweden',
            'CH' => 'Switzerland',
            'SY' => 'Syria',
            'TW' => 'Taiwan',
            'TJ' => 'Tajikistan',
            'TZ' => 'Tanzania',
            'TH' => 'Thailand',
            'TG' => 'Togo',
            'TK' => 'Tokelau',
            'TO' => 'Tonga',
            'TT' => 'Trinidad and Tobago',
            'TN' => 'Tunisia',
            'TR' => 'Turkey',
            'TM' => 'Turkmenistan',
            'TC' => 'Turks and Caicos Islands',
            'TV' => 'Tuvalu',
            'UG' => 'Uganda',
            'UA' => 'Ukraine',
            'AE' => 'United Arab Emirates',
            'GB' => 'United Kingdom',
            'US' => 'United States',
            'UM' => 'United States Minor Outlying Islands',
            'UY' => 'Uruguay',
            'UZ' => 'Uzbekistan',
            'VU' => 'Vanuatu',
            'VA' => 'Vatican City',
            'VE' => 'Venezuela',
            'VN' => 'Vietnam',
            'VI' => 'Virgin Islands, U.S.',
            'WF' => 'Wallis and Futuna',
            'EH' => 'Western Sahara',
            'YE' => 'Yemen',
            'ZM' => 'Zambia',
            'ZW' => 'Zimbabwe'
        );
    }

}
