2019-05-14 18:48:48 -04:00
|
|
|
"use strict";
|
|
|
|
var __extends = (this && this.__extends) || (function () {
|
|
|
|
var extendStatics = function (d, b) {
|
|
|
|
extendStatics = Object.setPrototypeOf ||
|
|
|
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
|
|
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
|
|
|
return extendStatics(d, b);
|
|
|
|
};
|
|
|
|
return function (d, b) {
|
|
|
|
extendStatics(d, b);
|
|
|
|
function __() { this.constructor = d; }
|
|
|
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
|
|
};
|
|
|
|
})();
|
|
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
|
var strings_1 = require("@ethersproject/strings");
|
|
|
|
var wordlist_1 = require("./wordlist");
|
|
|
|
var words = "AbaisserAbandonAbdiquerAbeilleAbolirAborderAboutirAboyerAbrasifAbreuverAbriterAbrogerAbruptAbsenceAbsoluAbsurdeAbusifAbyssalAcade/mieAcajouAcarienAccablerAccepterAcclamerAccoladeAccrocheAccuserAcerbeAchatAcheterAcidulerAcierAcompteAcque/rirAcronymeActeurActifActuelAdepteAde/quatAdhe/sifAdjectifAdjugerAdmettreAdmirerAdopterAdorerAdoucirAdresseAdroitAdulteAdverbeAe/rerAe/ronefAffaireAffecterAfficheAffreuxAffublerAgacerAgencerAgileAgiterAgraferAgre/ableAgrumeAiderAiguilleAilierAimableAisanceAjouterAjusterAlarmerAlchimieAlerteAlge-breAlgueAlie/nerAlimentAlle/gerAlliageAllouerAllumerAlourdirAlpagaAltesseAlve/oleAmateurAmbiguAmbreAme/nagerAmertumeAmidonAmiralAmorcerAmourAmovibleAmphibieAmpleurAmusantAnalyseAnaphoreAnarchieAnatomieAncienAne/antirAngleAngoisseAnguleuxAnimalAnnexerAnnonceAnnuelAnodinAnomalieAnonymeAnormalAntenneAntidoteAnxieuxApaiserApe/ritifAplanirApologieAppareilAppelerApporterAppuyerAquariumAqueducArbitreArbusteArdeurArdoiseArgentArlequinArmatureArmementArmoireArmureArpenterArracherArriverArroserArsenicArte/rielArticleAspectAsphalteAspirerAssautAsservirAssietteAssocierAssurerAsticotAstreAstuceAtelierAtomeAtriumAtroceAttaqueAttentifAttirerAttraperAubaineAubergeAudaceAudibleAugurerAuroreAutomneAutrucheAvalerAvancerAvariceAvenirAverseAveugleAviateurAvideAvionAviserAvoineAvouerAvrilAxialAxiomeBadgeBafouerBagageBaguetteBaignadeBalancerBalconBaleineBalisageBambinBancaireBandageBanlieueBannie-reBanquierBarbierBarilBaronBarqueBarrageBassinBastionBatailleBateauBatterieBaudrierBavarderBeletteBe/lierBeloteBe/ne/ficeBerceauBergerBerlineBermudaBesaceBesogneBe/tailBeurreBiberonBicycleBiduleBijouBilanBilingueBillardBinaireBiologieBiopsieBiotypeBiscuitBisonBistouriBitumeBizarreBlafardBlagueBlanchirBlessantBlinderBlondBloquerBlousonBobardBobineBoireBoiserBolideBonbonBondirBonheurBonifierBonusBordureBorneBotteBoucleBoueuxBougieBoulonBouquinBourseBoussoleBoutiqueBoxeurBrancheBrasierBraveBrebisBre-cheBreuvageBricolerBrigadeBrillantBriocheBriqueBrochureBroderBronzerBrousseBroyeurBrumeBrusqueBrutalBruyantBuffleBuissonBulletinBureauBurinBustierButinerButoirBuvableBuvetteCabanonCabineCachetteCadeauCadreCafe/ineCaillouCaissonCalculerCalepinCalibreCalmerCalomnieCalvaireCamaradeCame/raCamionCampagneCanalCanetonCanonCantineCanularCapableCaporalCapriceCapsuleCapterCapucheCarabineCarboneCaresserCaribouCarnageCarotteCarreauCartonCascadeCasierCasqueCassureCauserCautionCavalierCaverneCaviarCe/dilleCeintureCe/lesteCelluleCendrierCensurerCentralCercleCe/re/bralCeriseCernerCerveauCesserChagrinChaiseChaleurChambreChanceChapitreCharbonChasseurChatonChaussonChavirerChemiseChenilleChe/quierChercherChevalChienChiffreChignonChime-reChiotChlorureChocolatChoisirChoseChouetteChromeChuteCigareCigogneCimenterCine/maCintrerCirculerCirerCirqueCiterneCitoyenCitronCivilClaironClameurClaquerClasseClavierClientClignerClimatClivageClocheClonageCloporteCobaltCobraCocasseCocotierCoderCodifierCoffreCognerCohe/sionCoifferCoincerCole-reColibriCollineColmaterColonelCombatCome/dieCommandeCompactConcertConduireConfierCongelerConnoterConsonneContactConvexeCopainCopieCorailCorbeauCordageCornicheCorpusCorrectCorte-geCosmiqueCostumeCotonCoudeCoupureCourageCouteauCouvrirCoyoteCrabeCrainteCravateCrayonCre/atureCre/diterCre/meuxCreuserCrevetteCriblerCrierCristalCrite-reCroireCroquerCrotaleCrucialCruelCrypterCubiqueCueillirCuille-reCuisineCuivreCulminerCultiverCumulerCupideCuratifCurseurCyanureCycleCylindreCyniqueDaignerDamierDangerDanseurDauphinDe/battreDe/biterDe/borderDe/briderDe/butantDe/calerDe/cembreDe/chirerDe/ciderDe/clarerDe/corerDe/crireDe/cuplerDe/daleDe/ductifDe/esseDe/fensifDe/filerDe/frayerDe/gagerDe/givrerDe/glutirDe/graferDe/jeunerDe/liceDe/logerDemanderDemeurerDe/molirDe/nicherDe/nouerDentelleDe/nuderDe/partDe/penserDe/phaserDe/placerDe/poserDe/rangerDe/roberDe/sastreDescenteDe/sertDe/signerDe/sobe/irDessinerDestrierDe/tacherDe/testerDe/tourerDe/tresseDevancerDevenirDevinerDevoirDiableDialogueDiamantDicterDiffe/rerDige/rerDigitalDigneDiluerDimancheDiminuerDioxydeDirectifDirigerDiscuterDisposerDissiperDistanceDivertirDiviserDocileDocteurDogmeDoigtDo
|
|
|
|
var wordlist = null;
|
|
|
|
var lookup = {};
|
|
|
|
function dropDiacritic(word) {
|
2019-11-23 21:38:13 +09:00
|
|
|
wordlist_1.logger.checkNormalize();
|
2019-05-14 18:48:48 -04:00
|
|
|
return strings_1.toUtf8String(Array.prototype.filter.call(strings_1.toUtf8Bytes(word.normalize("NFD").toLowerCase()), function (c) {
|
|
|
|
return ((c >= 65 && c <= 90) || (c >= 97 && c <= 123));
|
|
|
|
}));
|
|
|
|
}
|
|
|
|
function expand(word) {
|
|
|
|
var output = [];
|
|
|
|
Array.prototype.forEach.call(strings_1.toUtf8Bytes(word), function (c) {
|
|
|
|
// Acute accent
|
|
|
|
if (c === 47) {
|
|
|
|
output.push(204);
|
|
|
|
output.push(129);
|
|
|
|
// Grave accent
|
|
|
|
}
|
|
|
|
else if (c === 45) {
|
|
|
|
output.push(204);
|
|
|
|
output.push(128);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
output.push(c);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return strings_1.toUtf8String(output);
|
|
|
|
}
|
|
|
|
function loadWords(lang) {
|
|
|
|
if (wordlist != null) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
wordlist = words.replace(/([A-Z])/g, " $1").toLowerCase().substring(1).split(" ").map(function (w) { return expand(w); });
|
|
|
|
wordlist.forEach(function (word, index) {
|
|
|
|
lookup[dropDiacritic(word)] = index;
|
|
|
|
});
|
2020-07-13 08:03:56 -04:00
|
|
|
// Verify the computed list matches the official list
|
|
|
|
/* istanbul ignore if */
|
2019-11-23 21:38:13 +09:00
|
|
|
if (wordlist_1.Wordlist.check(lang) !== "0x51deb7ae009149dc61a6bd18a918eb7ac78d2775726c68e598b92d002519b045") {
|
2019-05-14 18:48:48 -04:00
|
|
|
wordlist = null;
|
|
|
|
throw new Error("BIP39 Wordlist for fr (French) FAILED");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var LangFr = /** @class */ (function (_super) {
|
|
|
|
__extends(LangFr, _super);
|
|
|
|
function LangFr() {
|
|
|
|
return _super.call(this, "fr") || this;
|
|
|
|
}
|
|
|
|
LangFr.prototype.getWord = function (index) {
|
|
|
|
loadWords(this);
|
|
|
|
return wordlist[index];
|
|
|
|
};
|
|
|
|
LangFr.prototype.getWordIndex = function (word) {
|
|
|
|
loadWords(this);
|
2020-07-13 08:03:56 -04:00
|
|
|
return lookup[dropDiacritic(word)];
|
2019-05-14 18:48:48 -04:00
|
|
|
};
|
|
|
|
return LangFr;
|
|
|
|
}(wordlist_1.Wordlist));
|
|
|
|
var langFr = new LangFr();
|
|
|
|
exports.langFr = langFr;
|
2019-11-23 21:38:13 +09:00
|
|
|
wordlist_1.Wordlist.register(langFr);
|
2020-07-13 08:03:56 -04:00
|
|
|
//# sourceMappingURL=lang-fr.js.map
|