/**
 * Copyright: The PastVu contributors.
 * GNU Affero General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/agpl.txt)
 */

define(['Browser'], function (Browser) {
    const dirIcons = {
        // Arrows are not unified accross browsers and platforms.
        // The choices we use [default, FF, Mac].
        n: ['&#xf1e0;', 'ü°°', '‚Üë'],
        ne: ['&#xf1e1;', 'ü°•', '‚Üó'],
        e: ['&#xf1df;', 'ü°¢', '‚Üí'],
        se: ['&#xf1e4;', 'ü°¶', '‚Üò'],
        s: ['&#xf1e3;', 'ü°£', '‚Üì'],
        sw: ['&#xf1e5;', 'ü°ß', '‚Üô'],
        w: ['&#xf1e6;', 'ü°†', '‚Üê'],
        nw: ['&#xf1e2;', 'ü°§', '‚Üñ'],
        aero: ['&#xe3f7;', '‚óé', '‚óé'],
    };

    const getDirIcon = function (dir) {
        const iconIndex = Browser.platform.indexOf('MAC') >= 0 ? 2 : Browser.name === 'FIREFOX' ? 1 : 0;

        if (iconIndex === 2 && !(dir === 'e' || dir === 'w' || dir === 'aero')) {
            // Ugly hack to align text in options on Mac.
            return dirIcons[dir][iconIndex] + '&nbsp;';
        }

        return dirIcons[dir][iconIndex];
    };

    return {
        getDirIcon: getDirIcon,
        s: '–°—Ç–∞—Ç—É—Å',
        y: '–ì–æ–¥',
        geo: '–ö–æ–æ—Ä–¥–∏–Ω–∞—Ç—ã',
        type: '–¢–∏–ø',
        regions: '–†–µ–≥–∏–æ–Ω',
        title: '–ù–∞–∑–≤–∞–Ω–∏–µ —Ñ–æ—Ç–æ–≥—Ä–∞—Ñ–∏–∏',
        desc: '–û–ø–∏—Å–∞–Ω–∏–µ',
        source: '–ò—Å—Ç–æ—á–Ω–∏–∫',
        author: '–ê–≤—Ç–æ—Ä',
        address: '–ê–¥—Ä–µ—Å —Ç–æ—á–∫–∏ —Å—ä–µ–º–∫–∏',
        dir: '–ù–∞–ø—Ä–∞–≤–ª–µ–Ω–∏–µ —Å—ä–µ–º–∫–∏',
        typeVals: {
            1: '–§–æ—Ç–æ–≥—Ä–∞—Ñ–∏—è',
            2: '–ö–∞—Ä—Ç–∏–Ω–∞/—Ä–∏—Å—É–Ω–æ–∫',
        },
        types: ['1', '2'],
        dirVals: {
            n: '–°–µ–≤–µ—Ä',
            ne: '–°–µ–≤–µ—Ä–æ-–í–æ—Å—Ç–æ–∫',
            e: '–í–æ—Å—Ç–æ–∫',
            se: '–Æ–≥–æ-–í–æ—Å—Ç–æ–∫',
            s: '–Æ–≥',
            sw: '–Æ–≥–æ-–ó–∞–ø–∞–¥',
            w: '–ó–∞–ø–∞–¥',
            nw: '–°–µ–≤–µ—Ä–æ-–ó–∞–ø–∞–¥',
            aero: '–ê—ç—Ä–æ/–°–ø—É—Ç–Ω–∏–∫',
        },
        dirValsArr: ['w', 'nw', 'n', 'ne', 'e', 'se', 's', 'sw', 'aero'],
        watersign: {
            'title': '–ü–æ–¥–ø–∏—Å—å –Ω–∞ –≤–æ—Ç–µ—Ä–º–∞—Ä–∫–µ',
            'profile': '–ö–∞–∫ —É–∫–∞–∑–∞–Ω–æ –≤ –ø—Ä–æ—Ñ–∏–ª–µ',
            'individual': '–ò–Ω–¥–∏–≤–∏–¥—É–∞–ª—å–Ω–æ',
            'option': '–î–æ–±–∞–≤–ª—è—Ç—å –ø–æ–¥–ø–∏—Å—å –Ω–∞ –≤–æ—Ç–µ—Ä–º–∞—Ä–∫',
            'default': '–ù–∞—Å—Ç—Ä–æ–π–∫–∏ —Å–∏—Å—Ç–µ–º—ã',
            'text': '–¢–µ–∫—Å—Ç',
        },
        watersignText: '–ü–æ–¥–ø–∏—Å—å –Ω–∞ –≤–æ—Ç–µ—Ä–º–∞—Ä–∫–µ',
        watersignLength: 65,
        watersignPattern: /[\w\.,:;\(\)\[\]\\\|/‚Ññ¬ß¬©¬Æ‚Ñó‚Ñ†‚Ñ¢‚Ä¢\?!@#\$%\^&\*\+\-={}"'<>~` ]/g, //eslint-disable-line no-useless-escape
        downloadOrigin: {
            title: '–°–∫–∞—á–∏–≤–∞–Ω–∏–µ –æ—Ä–∏–≥–∏–Ω–∞–ª–∞',
            profile: '–ö–∞–∫ —É–∫–∞–∑–∞–Ω–æ –≤ –ø—Ä–æ—Ñ–∏–ª–µ',
            individual: '–ò–Ω–¥–∏–≤–∏–¥—É–∞–ª—å–Ω–æ',
            option: '–†–∞–∑—Ä–µ—à–∞—Ç—å –¥—Ä—É–≥–∏–º –ø–æ–ª—å–∑–æ–≤–∞—Ç–µ–ª—è–º —Å–∫–∞—á–∏–≤–∞—Ç—å –æ—Ä–∏–≥–∏–Ω–∞–ª',
        },

        painting: {
            title: '–ù–∞–∑–≤–∞–Ω–∏–µ',
        },
    };
});
