/*
 * SDK Pullenti Unitext, version 4.33, fabruary 2026. Copyright (c) 2013-2026, Pullenti. All rights reserved. 
 * Non-Commercial Freeware and Commercial Software. 
 * This class is generated using the converter UniSharping (www.unisharping.ru) from Pullenti C# project. 
 * The latest version of the code is available on the site www.pullenti.ru
 */

const Hashtable = require("./../../../unisharp/Hashtable");
const RefOutArgWrapper = require("./../../../unisharp/RefOutArgWrapper");

class FcCompressedMapping {
    
    static getChar(code) {
        if (code < (0x80)) 
            return String.fromCharCode(code);
        else {
            let value = 0;
            let wrapvalue525 = new RefOutArgWrapper();
            let inoutres526 = FcCompressedMapping.map.tryGetValue(code, wrapvalue525);
            value = wrapvalue525.value;
            if (inoutres526) 
                return String.fromCharCode(value);
            else 
                return String.fromCharCode(code);
        }
    }
    
    static getCharsArr(data, offset, count) {
        let result = Array(count).fill('\0');
        FcCompressedMapping.getChars(data, offset, count, result, 0);
        return result;
    }
    
    static getChars(data, offset, count, output, outputOffset) {
        for (let i = 0; i < count; i++) {
            output[outputOffset + i] = FcCompressedMapping.getChar(data[offset + i]);
        }
    }
    
    static static_constructor() {
        FcCompressedMapping.map = null;
        FcCompressedMapping.map = new Hashtable();
        FcCompressedMapping.map.put(0x82, 0x201A);
        FcCompressedMapping.map.put(0x83, 0x0192);
        FcCompressedMapping.map.put(0x84, 0x201E);
        FcCompressedMapping.map.put(0x85, 0x2026);
        FcCompressedMapping.map.put(0x86, 0x2020);
        FcCompressedMapping.map.put(0x87, 0x2021);
        FcCompressedMapping.map.put(0x88, 0x02C6);
        FcCompressedMapping.map.put(0x89, 0x2030);
        FcCompressedMapping.map.put(0x8A, 0x0160);
        FcCompressedMapping.map.put(0x8B, 0x2039);
        FcCompressedMapping.map.put(0x8C, 0x0152);
        FcCompressedMapping.map.put(0x91, 0x2018);
        FcCompressedMapping.map.put(0x92, 0x2019);
        FcCompressedMapping.map.put(0x93, 0x201C);
        FcCompressedMapping.map.put(0x94, 0x201D);
        FcCompressedMapping.map.put(0x95, 0x2022);
        FcCompressedMapping.map.put(0x96, 0x2013);
        FcCompressedMapping.map.put(0x97, 0x2014);
        FcCompressedMapping.map.put(0x98, 0x02DC);
        FcCompressedMapping.map.put(0x99, 0x2122);
        FcCompressedMapping.map.put(0x9A, 0x0161);
        FcCompressedMapping.map.put(0x9B, 0x203A);
        FcCompressedMapping.map.put(0x9C, 0x0153);
        FcCompressedMapping.map.put(0x9F, 0x0178);
    }
}


FcCompressedMapping.static_constructor();

module.exports = FcCompressedMapping