New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

wanakana

Package Overview
Dependencies
Maintainers
4
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wanakana - npm Package Compare versions

Comparing version 3.0.0 to 3.0.1

bind.js

132

CHANGELOG.md
# Change Log
All notable changes to this project will be documented in this file.

@@ -25,108 +26,149 @@

-->
## [3.0.0] - 2017-12-24
### Changed
- rewrite of conversion methods to allow custom mapping adapters
- toRomaji() extends vowels for katakana chōonpu, IE: ゲーム => geemu, toHiragana() converts to hyphen => ge-mu
- toKana() **without** IME mode converts 'nn' => 'んん'
### Added
- global option romanization for toRomaji() (currently only 'hepburn')
- global option customKanaMapping for toKana()
- global option customRomajiMapping for toRomaji()
### Fixed
- toRomaji() little ヶヵ used in words like 一ヶ月 are no longer converted since they are used as symbols (like the kanji) and do not actually denote kana. Previous behaviour: 一ヶ月 => 一ke月
- toRomaji() no longer incorrectly duplicates non-glottal stops following っ. Previous behaviour: あっ、 -> a,,
* bind and unbind are now flat modules (wanakana/bind) rather than named exports from domUtils
* domUtils moved to utils/domHelpers and not exposed to npm lib
* rewrite of conversion methods to allow custom mapping adapters
* toRomaji() extends vowels for katakana chōonpu, IE: ゲーム => geemu, toHiragana() converts to hyphen => ge-mu
* toKana() **without** IME mode converts 'nn' => 'んん'
### Added
* global option romanization for toRomaji() (currently only 'hepburn')
* global option customKanaMapping for toKana()
* global option customRomajiMapping for toRomaji()
### Fixed
* toRomaji() little ヶヵ used in words like 一ヶ月 are no longer converted since they are used as symbols (like the kanji) and do not actually denote kana. Previous behaviour: 一ヶ月 => 一 ke 月
* toRomaji() no longer incorrectly duplicates non-glottal stops following っ. Previous behaviour: あっ、 -> a,,
## [2.3.4] - 2017-12-16
### Fixed
- *Uppercase* input with toHiragana() including a double consonant was incorrectly producing a katakana ッ instead of っ
* _Uppercase_ input with toHiragana() including a double consonant was incorrectly producing a katakana ッ instead of っ
## [2.3.3] - 2017-12-12
### Fixed
- Add https to unpkg link
* Add https to unpkg link
## [2.3.2] - 2017-12-12
### Added
- Specify minified bundle in package.json for easy use with unpkg
* Specify minified bundle in package.json for easy use with unpkg
## [2.3.1] - 2017-10-17
### Changed
- Set cursor in IME mode to the current position after conversion (rather than the end of all input)
* Set cursor in IME mode to the current position after conversion (rather than the end of all input)
## [2.3.0] - 2017-08-28
### Changed
- Increase character coverage for isJapanese to include numbers and hankaku katakana
* Increase character coverage for isJapanese to include numbers and hankaku katakana
## [2.2.4] - 2017-08-24
### Fixed
- Pass through long vowel conversion using toHiragana with odd/mixed input
* Pass through long vowel conversion using toHiragana with odd/mixed input
## [2.2.3] - 2017-08-05
### Fixed
- Mobile input not converting automatically during autosuggest (regression due to 2.2.1)
* Mobile input not converting automatically during autosuggest (regression due to 2.2.1)
## [2.2.2] - 2017-07-30
### Fixed
- Keep track of event listeners by generated ids
* Keep track of event listeners by generated ids
## [2.2.1] - 2017-07-30
### Fixed
- [Microsoft IME input with 'tt' / っ](https://github.com/WaniKani/WanaKana/issues/48)
* [Microsoft IME input with 'tt' / っ](https://github.com/WaniKani/WanaKana/issues/48)
## [2.2.0] - 2017-07-13
### Added
- Options object setting `IMEMode` can now accept `'toHiragana'` or `'toKatakana'` to enforce specific conversion on input
* Options object setting `IMEMode` can now accept `'toHiragana'` or `'toKatakana'` to enforce specific conversion on input
## [2.1.0] - 2017-07-09
### Added
- Set `autocapitalize="none"` on bound input fields
- Handle multiple event listeners with separate options
- Increased test coverage
* Set `autocapitalize="none"` on bound input fields
* Handle multiple event listeners with separate options
* Increased test coverage
### Fixed
- Hold onto merged options for dom utils via closure instead of global
- Keep track of event listeners for removal on unbind
* Hold onto merged options for dom utils via closure instead of global
* Keep track of event listeners for removal on unbind
### Changed
- `bind`, `unbind` are now named exports in 'wanakana/domUtils'
* `bind`, `unbind` are now named exports in 'wanakana/domUtils'
## [2.0.4] - 2017-07-07
### Fixed
- Wanakana website address in package.json
* Wanakana website address in package.json
## [2.0.3] - 2017-07-07
### Fixed
- Missing description field in package.json
* Missing description field in package.json
## [2.0.2] - 2017-06-30
### Added
- Documentation regarding recommended use of autocapitalize="none" on input fields
* Documentation regarding recommended use of autocapitalize="none" on input fields
### Changed
- Improve font readability on demo page
* Improve font readability on demo page
## [2.0.1] - 2017-06-17
### Changed
- Fixed some incorrect text references
- Internal build modifications
* Fixed some incorrect text references
* Internal build modifications
## [2.0.0] - 2017-06-17
### Added
- Changelog!
- Separate bundles for different environments (node, esmodules, browser)
- New method: `stripOkurigana()`
- New method: `tokenize()`
- Default options extended with `passRomaji` and `upcaseKatakana`
- [Extended docs](http://www.wanakana.com/docs)
* Changelog!
* Separate bundles for different environments (node, esmodules, browser)
* New method: `stripOkurigana()`
* New method: `tokenize()`
* Default options extended with `passRomaji` and `upcaseKatakana`
* [Extended docs](http://www.wanakana.com/docs)
### Fixed
- [Ambiguous N](https://github.com/WaniKani/WanaKana/issues/38) thanks to @DTJB
- [Mixed Case toHiragana](https://github.com/WaniKani/WanaKana/issues/39) thanks to @DTJB
- [Katakana Long Vowels](https://github.com/WaniKani/WanaKana/issues/40) thanks to @dianahervascastillo @maesierra @codebar @ladieswhocode
- [Missing Space](https://github.com/WaniKani/WanaKana/issues/50) thanks to @mimshwright
* [Ambiguous N](https://github.com/WaniKani/WanaKana/issues/38) thanks to @DTJB
* [Mixed Case toHiragana](https://github.com/WaniKani/WanaKana/issues/39) thanks to @DTJB
* [Katakana Long Vowels](https://github.com/WaniKani/WanaKana/issues/40) thanks to @dianahervascastillo @maesierra @codebar @ladieswhocode
* [Missing Space](https://github.com/WaniKani/WanaKana/issues/50) thanks to @mimshwright
### Changed
- Transliteration converts major punctuation marks both ways.
- `isJapanese()` & `isRomaji()` check major punctuation.
- `isRomaji()` allows hepburn romanisation long vowels. (IE. Tōkyō)
* Transliteration converts major punctuation marks both ways.
* `isJapanese()` & `isRomaji()` check major punctuation.
* `isRomaji()` allows hepburn romanisation long vowels. (IE. Tōkyō)

@@ -133,0 +175,0 @@ [3.0.0]: https://github.com/WaniKani/WanaKana/compare/2.3.4...3.0.0

@@ -6,6 +6,40 @@ 'use strict';

});
exports.TO_ROMAJI = exports.LONG_VOWELS = exports.KANA_SLASH_DOT = exports.PROLONGED_SOUND_MARK = exports.KANJI_END = exports.KANJI_START = exports.KATAKANA_END = exports.KATAKANA_START = exports.HIRAGANA_END = exports.HIRAGANA_START = exports.UPPERCASE_FULLWIDTH_END = exports.UPPERCASE_FULLWIDTH_START = exports.LOWERCASE_FULLWIDTH_END = exports.LOWERCASE_FULLWIDTH_START = exports.UPPERCASE_END = exports.UPPERCASE_START = exports.LOWERCASE_END = exports.LOWERCASE_START = exports.EN_PUNCTUATION_RANGES = exports.ROMAJI_RANGES = exports.JAPANESE_RANGES = exports.JA_PUNCTUATION_RANGES = exports.DEFAULT_OPTIONS = undefined;
exports.TO_ROMAJI = exports.LONG_VOWELS = exports.KANA_SLASH_DOT = exports.PROLONGED_SOUND_MARK = exports.KANJI_END = exports.KANJI_START = exports.KATAKANA_END = exports.KATAKANA_START = exports.HIRAGANA_END = exports.HIRAGANA_START = exports.UPPERCASE_FULLWIDTH_END = exports.UPPERCASE_FULLWIDTH_START = exports.LOWERCASE_FULLWIDTH_END = exports.LOWERCASE_FULLWIDTH_START = exports.UPPERCASE_END = exports.UPPERCASE_START = exports.LOWERCASE_END = exports.LOWERCASE_START = exports.EN_PUNCTUATION_RANGES = exports.ROMAJI_RANGES = exports.JAPANESE_RANGES = exports.JA_PUNCTUATION_RANGES = exports.DEFAULT_OPTIONS = exports.TO_KANA_METHODS = undefined;
var _kanaToRomajiMap = require('./kanaToRomajiMap');
var TO_KANA_METHODS = exports.TO_KANA_METHODS = {
HIRAGANA: 'toHiragana',
KATAKANA: 'toKatakana'
}; /**
* @typedef {Object} DefaultOptions
* @property {Boolean} [useObsoleteKana=false] - Set to true to use obsolete characters, such as ゐ and ゑ.
* @example
* toHiragana('we', { useObsoleteKana: true })
* // => 'ゑ'
* @property {Boolean} [passRomaji=false] - Set to true to pass romaji when using mixed syllabaries with toKatakana() or toHiragana()
* @example
* toHiragana('only convert the katakana: ヒラガナ', { passRomaji: true })
* // => "only convert the katakana: ひらがな"
* @property {Boolean} [upcaseKatakana=false] - Set to true to convert katakana to uppercase using toRomaji()
* @example
* toRomaji('ひらがな カタカナ', { upcaseKatakana: true })
* // => "hiragana KATAKANA"
* @property {Boolean} [IMEMode=false] - Set to true, toHiragana(), or toKatakana() to handle conversion from a text input while it is being typed.
* @property {String} [romanization='hepburn'] - choose toRomaji() romanization map (currently only hepburn)
* @property {Function} [customKanaMapping=(defaultMap) => map] - merges custom map with default conversion
* @example
* toKana('WanaKana', { customKanaMapping: createCustomMapping({ na: 'に', ka: 'Bana' }) });
* // => 'ワにBanaに'
* @property {Function} [customRomajiMapping=(defaultMap) => map] - merges custom map with default conversion
* @example
* toRomaji('つじぎり', { customRomajiMapping: createCustomMapping({ じ: 'zi', つ: 'tu', り: 'li' }) });
* // => 'tuzigili'
*/
/**
* Default config for WanaKana, user passed options will be merged with this
* @type {DefaultOptions}
* @ignore
*/
var DEFAULT_OPTIONS = exports.DEFAULT_OPTIONS = {

@@ -30,33 +64,2 @@ useObsoleteKana: false,

/**
* @typedef {Object} DefaultOptions
* @property {Boolean} [useObsoleteKana=false] - Set to true to use obsolete characters, such as ゐ and ゑ.
* @example
* toHiragana('we', { useObsoleteKana: true })
* // => 'ゑ'
* @property {Boolean} [passRomaji=false] - Set to true to pass romaji when using mixed syllabaries with toKatakana() or toHiragana()
* @example
* toHiragana('only convert the katakana: ヒラガナ', { passRomaji: true })
* // => "only convert the katakana: ひらがな"
* @property {Boolean} [upcaseKatakana=false] - Set to true to convert katakana to uppercase using toRomaji()
* @example
* toRomaji('ひらがな カタカナ', { upcaseKatakana: true })
* // => "hiragana KATAKANA"
* @property {Boolean} [IMEMode=false] - Set to true, toHiragana(), or toKatakana() to handle conversion from a text input while it is being typed.
* @property {String} [romanization='hepburn'] - choose toRomaji() romanization map (currently only hepburn)
* @property {Function} [customKanaMapping=(defaultMap) => map] - merges custom map with default conversion
* @example
* toKana('WanaKana', { customKanaMapping: createCustomMapping({ na: 'に', ka: 'Bana' }) });
* // => 'ワにBanaに'
* @property {Function} [customRomajiMapping=(defaultMap) => map] - merges custom map with default conversion
* @example
* toRomaji('つじぎり', { customRomajiMapping: createCustomMapping({ じ: 'zi', つ: 'tu', り: 'li' }) });
* // => 'tuzigili'
*/
/**
* Default config for WanaKana, user passed options will be merged with this
* @type {DefaultOptions}
* @ignore
*/
var CJK_SYMBOLS_PUNCTUATION = [0x3000, 0x303f];

@@ -63,0 +66,0 @@ var KATAKANA_PUNCTUATION = [0x30fb, 0x30fc];

@@ -7,3 +7,3 @@ 'use strict';

var _domUtils = require('./domUtils');
var _bind = require('./bind');

@@ -13,9 +13,12 @@ Object.defineProperty(exports, 'bind', {

get: function get() {
return _domUtils.bind;
return _interopRequireDefault(_bind).default;
}
});
var _unbind = require('./unbind');
Object.defineProperty(exports, 'unbind', {
enumerable: true,
get: function get() {
return _domUtils.unbind;
return _interopRequireDefault(_unbind).default;
}

@@ -141,17 +144,17 @@ });

var _kanaMappingUtils = require('./kanaMappingUtils');
var _kanaToRomajiMap = require('./kanaToRomajiMap');
Object.defineProperty(exports, 'createCustomMapping', {
Object.defineProperty(exports, 'ROMANIZATIONS', {
enumerable: true,
get: function get() {
return _kanaMappingUtils.createCustomMapping;
return _kanaToRomajiMap.methods;
}
});
var _kanaToRomajiMap = require('./kanaToRomajiMap');
var _kanaMappingUtils = require('./kanaMappingUtils');
Object.defineProperty(exports, 'methods', {
Object.defineProperty(exports, 'createCustomMapping', {
enumerable: true,
get: function get() {
return _kanaToRomajiMap.methods;
return _kanaMappingUtils.createCustomMapping;
}

@@ -158,0 +161,0 @@ });

@@ -134,6 +134,6 @@ 'use strict';

/**
* creates a mapping tree, returns a function to accept a defaultMap to then merge with
* Creates a custom mapping tree, returns a function that accepts a defaultMap which the newly created customMapping will be merged with and returned
* (customMap) => (defaultMap) => mergedMap
* @param {Object} customMap { 'ka' : 'な' }
* @return {Function} (defaultMap) => mergedMap
* @return {Function} (defaultMap) => defaultMergedWithCustomMap
* @example

@@ -140,0 +140,0 @@ * const sillyMap = createCustomMapping({ 'ちゃ': 'time', '茎': 'cookie' });

@@ -1,1 +0,1 @@

!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(r.wanakana={})}(this,function(r){"use strict";function t(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function n(r,t,n){function e(r,t){if(void 0!==r[t])return Object.assign({"":r[""]+t},r[t])}function a(r,t){var n=r.charAt(0);return o(Object.assign({"":n},i[n]),r.slice(1),t,t+1)}function o(r,t,i,u){if(!t)return n||1===Object.keys(r).length?r[""]?[[i,u,r[""]]]:[]:[[i,u,null]];if(1===Object.keys(r).length)return[[i,u,r[""]]].concat(a(t,u));var l=e(r,t.charAt(0));return void 0===l?[[i,u,r[""]]].concat(a(t,u)):o(l,t.slice(1),i,u+1)}var i=t;return a(r,0)}function e(r){var n={},a=!0,o=!1,i=void 0;try{for(var u,l=t(r)[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var v=er(u.value,2),f=v[0],c=v[1];n[f]="string"==typeof c?{"":c}:e(c)}}catch(r){o=!0,i=r}finally{try{!a&&l.return&&l.return()}finally{if(o)throw i}}return n}function a(r,t){var n=r,e=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=i.value;void 0===n[l]&&(n[l]={}),n=n[l]}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}function o(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},e=!0,a=!1,o=void 0;try{for(var i,u=t(r)[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=er(i.value,2),v=l[0],f=l[1],c=n,y=!0,h=!1,d=void 0;try{for(var s,g=v[Symbol.iterator]();!(y=(s=g.next()).done);y=!0){var w=s.value;void 0===c[w]&&(c[w]={}),c=c[w]}}catch(r){h=!0,d=r}finally{try{!y&&g.return&&g.return()}finally{if(h)throw d}}c[""]=f}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return function(){function r(n,e){if(void 0===n||"string"==typeof n)return e;var a=n,o=!0,i=!1,u=void 0;try{for(var l,v=t(e)[Symbol.iterator]();!(o=(l=v.next()).done);o=!0){var f=er(l.value,2),c=f[0],y=f[1];a[c]=r(n[c],y)}}catch(r){i=!0,u=r}finally{try{!o&&v.return&&v.return()}finally{if(i)throw u}}return a}var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(JSON.parse(JSON.stringify(e)),n)}}function i(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function u(){function r(t){var n={},e=!0,a=!1,o=void 0;try{for(var u,l=i(t)[Symbol.iterator]();!(e=(u=l.next()).done);e=!0){var v=er(u.value,2),f=v[0],c=v[1];if(f)n[f]=r(c);else{var y=c.charAt(0);n[f]=y in ur?ur[y]+c:c}}}catch(r){a=!0,o=r}finally{try{!e&&l.return&&l.return()}finally{if(a)throw o}}return n}var t=e({"あ":"a","い":"i","う":"u","え":"e","お":"o","か":"ka","き":"ki","く":"ku","け":"ke","こ":"ko","さ":"sa","し":"shi","す":"su","せ":"se","そ":"so","た":"ta","ち":"chi","つ":"tsu","て":"te","と":"to","な":"na","に":"ni","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","わ":"wa","ゐ":"wi","ゑ":"we","を":"wo","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ざ":"za","じ":"ji","ず":"zu","ぜ":"ze","ぞ":"zo","だ":"da","ぢ":"ji","づ":"zu","で":"de","ど":"do","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","ん":"n"}),n=function(r){return a(t,r)},o=function(r,t){n(r)[""]=t},u={"。":".","、":",",":":":","・":"/","!":"!","?":"?","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"," ":" "},l=!0,v=!1,f=void 0;try{for(var c,y=i(u)[Symbol.iterator]();!(l=(c=y.next()).done);l=!0){var h=er(c.value,2),d=h[0],s=h[1];n(d)[""]=s}}catch(r){v=!0,f=r}finally{try{!l&&y.return&&y.return()}finally{if(v)throw f}}var g={"ゃ":"ya","ゅ":"yu","ょ":"yo"},w={"ぃ":"yi","ぇ":"ye"},p={"ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},m=!0,b=!1,j=void 0;try{for(var k,S=i(g).concat(i(p))[Symbol.iterator]();!(m=(k=S.next()).done);m=!0){var x=er(k.value,2);o(x[0],x[1])}}catch(r){b=!0,j=r}finally{try{!m&&S.return&&S.return()}finally{if(b)throw j}}var O=["き","に","ひ","み","り","ぎ","び","ぴ","ゔ","く","ふ"],z=!0,A=!1,C=void 0;try{for(var E,M=O[Symbol.iterator]();!(z=(E=M.next()).done);z=!0){var N=E.value,q=n(N)[""][0],K=!0,R=!1,J=void 0;try{for(var I,L=i(g)[Symbol.iterator]();!(K=(I=L.next()).done);K=!0){var H=er(I.value,2);o(N+H[0],q+H[1])}}catch(r){R=!0,J=r}finally{try{!K&&L.return&&L.return()}finally{if(R)throw J}}var P=!0,U=!1,T=void 0;try{for(var B,W=i(w)[Symbol.iterator]();!(P=(B=W.next()).done);P=!0){var _=er(B.value,2);o(N+_[0],q+_[1])}}catch(r){U=!0,T=r}finally{try{!P&&W.return&&W.return()}finally{if(U)throw T}}}}catch(r){A=!0,C=r}finally{try{!z&&M.return&&M.return()}finally{if(A)throw C}}var D={"し":"sh","ち":"ch","じ":"j","ぢ":"j"},X=!0,F=!1,G=void 0;try{for(var Q,V=i(D)[Symbol.iterator]();!(X=(Q=V.next()).done);X=!0){var Y=er(Q.value,2),Z=Y[0],$=Y[1],rr=!0,tr=!1,nr=void 0;try{for(var ar,or=i(g)[Symbol.iterator]();!(rr=(ar=or.next()).done);rr=!0){var ir=er(ar.value,2);o(Z+ir[0],$+ir[1][1])}}catch(r){tr=!0,nr=r}finally{try{!rr&&or.return&&or.return()}finally{if(tr)throw nr}}o(Z+"ぃ",$+"yi"),o(Z+"ぇ",$+"e")}}catch(r){F=!0,G=r}finally{try{!X&&V.return&&V.return()}finally{if(F)throw G}}var ur={b:"b",c:"t",d:"d",f:"f",g:"g",h:"h",j:"j",k:"k",m:"m",p:"p",q:"q",r:"r",s:"s",t:"t",v:"v",w:"w",x:"x",z:"z"};t["っ"]=r(t);var lr={"っ":"","ゃ":"ya","ゅ":"yu","ょ":"yo","ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},vr=!0,fr=!1,cr=void 0;try{for(var yr,hr=i(lr)[Symbol.iterator]();!(vr=(yr=hr.next()).done);vr=!0){var dr=er(yr.value,2);o(dr[0],dr[1])}}catch(r){fr=!0,cr=r}finally{try{!vr&&hr.return&&hr.return()}finally{if(fr)throw cr}}var sr=["あ","い","う","え","お","や","ゆ","よ"],gr=!0,wr=!1,pr=void 0;try{for(var mr,br=sr[Symbol.iterator]();!(gr=(mr=br.next()).done);gr=!0){var jr=mr.value;o("ん"+jr,"n'"+n(jr)[""])}}catch(r){wr=!0,pr=r}finally{try{!gr&&br.return&&br.return()}finally{if(wr)throw pr}}return Object.freeze(JSON.parse(JSON.stringify(t)))}function l(){return null===ir&&(ir=u()),ir}function v(r){switch(r.romanization){case or.HEPBURN:return l(r);default:return{}}}function f(r){return"string"!=typeof r||!r.length}function c(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],n=arguments[2];if(f(r))return!1;var e=r.charCodeAt(0);return e>=t&&n>=e}function y(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[].concat(ar(r)).map(function(r,t){var n=r.charCodeAt(0),e=c(r,xr,Or),a=c(r,zr,Ar);return e?String.fromCharCode(n-xr+jr):a?String.fromCharCode(n-zr+kr):r}).join("")}function h(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(f(r))return!1;var n=t?/[bcdfghjklmnpqrstvwxyz]/:/[bcdfghjklmnpqrstvwxz]/;return-1!==r.toLowerCase().charAt(0).search(n)}function d(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function s(){function r(t){var n={},e=!0,a=!1,o=void 0;try{for(var i,u=d(t)[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=er(i.value,2),v=l[0],f=l[1];n[v]=v?r(f):"っ"+f}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}var t=e({a:"あ",i:"い",u:"う",e:"え",o:"お",k:{a:"か",i:"き",u:"く",e:"け",o:"こ"},s:{a:"さ",i:"し",u:"す",e:"せ",o:"そ"},t:{a:"た",i:"ち",u:"つ",e:"て",o:"と"},n:{a:"な",i:"に",u:"ぬ",e:"ね",o:"の"},h:{a:"は",i:"ひ",u:"ふ",e:"へ",o:"ほ"},m:{a:"ま",i:"み",u:"む",e:"め",o:"も"},y:{a:"や",u:"ゆ",o:"よ"},r:{a:"ら",i:"り",u:"る",e:"れ",o:"ろ"},w:{a:"わ",i:"ゐ",e:"ゑ",o:"を"},g:{a:"が",i:"ぎ",u:"ぐ",e:"げ",o:"ご"},z:{a:"ざ",i:"じ",u:"ず",e:"ぜ",o:"ぞ"},d:{a:"だ",i:"ぢ",u:"づ",e:"で",o:"ど"},b:{a:"ば",i:"び",u:"ぶ",e:"べ",o:"ぼ"},p:{a:"ぱ",i:"ぴ",u:"ぷ",e:"ぺ",o:"ぽ"},v:{a:"ゔぁ",i:"ゔぃ",u:"ゔ",e:"ゔぇ",o:"ゔぉ"}}),n=function(r){return a(t,r)},o={k:"き",s:"し",t:"ち",n:"に",h:"ひ",m:"み",r:"り",g:"ぎ",z:"じ",d:"ぢ",b:"び",p:"ぴ",v:"ゔ",q:"く",f:"ふ"},i={ya:"ゃ",yi:"ぃ",yu:"ゅ",ye:"ぇ",yo:"ょ"},u={a:"ぁ",i:"ぃ",u:"ぅ",e:"ぇ",o:"ぉ"},l=!0,v=!1,f=void 0;try{for(var c,y=d(o)[Symbol.iterator]();!(l=(c=y.next()).done);l=!0){var h=er(c.value,2),s=h[0],g=h[1],w=!0,p=!1,m=void 0;try{for(var b,j=d(i)[Symbol.iterator]();!(w=(b=j.next()).done);w=!0){var k=er(b.value,2),S=k[0],x=k[1];n(s+S)[""]=g+x}}catch(r){p=!0,m=r}finally{try{!w&&j.return&&j.return()}finally{if(p)throw m}}}}catch(r){v=!0,f=r}finally{try{!l&&y.return&&y.return()}finally{if(v)throw f}}var O={".":"。",",":"、",":":":","/":"・","!":"!","?":"?","~":"〜","-":"ー","‘":"「","’":"」","“":"『","”":"』","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"},z=!0,A=!1,C=void 0;try{for(var E,M=d(O)[Symbol.iterator]();!(z=(E=M.next()).done);z=!0){var N=er(E.value,2),q=N[0],K=N[1];n(q)[""]=K}}catch(r){A=!0,C=r}finally{try{!z&&M.return&&M.return()}finally{if(A)throw C}}var R={wh:"う",qw:"く",q:"く",gw:"ぐ",sw:"す",ts:"つ",th:"て",tw:"と",dh:"で",dw:"ど",fw:"ふ",f:"ふ"},J=!0,I=!1,L=void 0;try{for(var H,P=d(R)[Symbol.iterator]();!(J=(H=P.next()).done);J=!0){var U=er(H.value,2),T=U[0],B=U[1],W=!0,_=!1,D=void 0;try{for(var X,F=d(u)[Symbol.iterator]();!(W=(X=F.next()).done);W=!0){var G=er(X.value,2),Q=G[0],V=G[1];(Qr=n(T+Q))[""]=B+V}}catch(r){_=!0,D=r}finally{try{!W&&F.return&&F.return()}finally{if(_)throw D}}}}catch(r){I=!0,L=r}finally{try{!J&&P.return&&P.return()}finally{if(I)throw L}}for(var Y=["n","n'","xn"],Z=0;3>Z;Z++)n(Y[Z])[""]="ん";var $={sh:"sy",ch:"ty",cy:"ty",chy:"ty",shy:"sy",j:"zy",jy:"zy",shi:"si",chi:"ti",tsu:"tu",ji:"zi",fu:"hu"};t.c=JSON.parse(JSON.stringify(t.k));var rr=!0,tr=!1,nr=void 0;try{for(var ar,or=d($)[Symbol.iterator]();!(rr=(ar=or.next()).done);rr=!0){var ir=er(ar.value,2),ur=ir[0],lr=ir[1],vr=ur.slice(0,ur.length-1),fr=ur.charAt(ur.length-1);n(vr)[fr]=JSON.parse(JSON.stringify(n(lr)))}}catch(r){tr=!0,nr=r}finally{try{!rr&&or.return&&or.return()}finally{if(tr)throw nr}}var cr=Object.assign({tu:"っ",wa:"ゎ",ka:"ヵ",ke:"ヶ"},u,i),yr=!0,hr=!1,dr=void 0;try{for(var sr,gr=d(cr)[Symbol.iterator]();!(yr=(sr=gr.next()).done);yr=!0){var wr=er(sr.value,2),pr=wr[0],mr=wr[1],br=n("x"+pr);br[""]=mr;var jr=pr.slice(0,pr.length-1),kr=pr.charAt(pr.length-1);n("l"+jr)[kr]=br;var Sr=!0,xr=!1,Or=void 0;try{for(var zr,Ar=function(r){var t=[],n=!0,e=!1,a=void 0;try{for(var o,i=d($).concat([["c","k"]])[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var u=er(o.value,2),l=u[0],v=u[1];r.startsWith(v)&&t.push(r.replace(v,l))}}catch(r){e=!0,a=r}finally{try{!n&&i.return&&i.return()}finally{if(e)throw a}}return t}(pr)[Symbol.iterator]();!(Sr=(zr=Ar.next()).done);Sr=!0)for(var Cr=zr.value,Er=Cr.slice(0,Cr.length-1),Mr=Cr.charAt(Cr.length-1),Nr=["l","x"],qr=0;2>qr;qr++){var Kr=Nr[qr];n(Kr+Er)[Mr]=n(Kr+pr)}}catch(r){xr=!0,Or=r}finally{try{!Sr&&Ar.return&&Ar.return()}finally{if(xr)throw Or}}}}catch(r){hr=!0,dr=r}finally{try{!yr&&gr.return&&gr.return()}finally{if(hr)throw dr}}var Rr={yi:"い",wu:"う",ye:"いぇ",wi:"うぃ",we:"うぇ",kwa:"くぁ",whu:"う",tha:"てゃ",thu:"てゅ",tho:"てょ",dha:"でゃ",dhu:"でゅ",dho:"でょ"},Jr=!0,Ir=!1,Lr=void 0;try{for(var Hr,Pr=d(Rr)[Symbol.iterator]();!(Jr=(Hr=Pr.next()).done);Jr=!0){var Ur=er(Hr.value,2),Tr=Ur[0],Br=Ur[1];n(Tr)[""]=Br}}catch(r){Ir=!0,Lr=r}finally{try{!Jr&&Pr.return&&Pr.return()}finally{if(Ir)throw Lr}}var Wr=!0,_r=!1,Dr=void 0;try{for(var Xr,Fr=Object.keys(o).concat("c","y","w","j")[Symbol.iterator]();!(Wr=(Xr=Fr.next()).done);Wr=!0){var Gr=Xr.value,Qr=t[Gr];Qr[Gr]=r(Qr)}}catch(r){_r=!0,Dr=r}finally{try{!Wr&&Fr.return&&Fr.return()}finally{if(_r)throw Dr}}return delete t.n.n,Object.freeze(JSON.parse(JSON.stringify(t)))}function g(r){return null===Hr&&(Hr=s()),Hr}function w(r){var t=JSON.parse(JSON.stringify(r));return t.n.n={"":"ん"},t.n[" "]={"":"ん"},t}function p(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&c(r,kr,Sr)}function m(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&r.charCodeAt(0)===Rr}function b(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&r.charCodeAt(0)===Jr}function j(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&(!!m(r)||c(r,Cr,Er))}function k(){var r=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("").forEach(function(t){if(m(t)||b(t))r.push(t);else if(j(t)){var n=t.charCodeAt(0)+(Mr-Cr),e=String.fromCharCode(n);r.push(e)}else r.push(t)}),r.join("")}function S(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return x(r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).map(function(t){var n=er(t,3),e=n[0],a=n[2];return null===a?r.slice(e):p(r.charAt(e))?k(a):a}).join("")}function x(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},ur,t),a=g(e);return a=e.IMEMode?w(a):a,a=e.useObsoleteKana?Pr(a):a,a=e.customKanaMapping(a),n(r.toLowerCase(),a,!e.IMEMode)}function O(r){var t=A(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});if(r instanceof Element&&Ur.includes(r.nodeName)){var n=_r();r.setAttribute("data-wanakana-id",n),r.autocapitalize="none",r.addEventListener("compositionupdate",C),r.addEventListener("input",t),Tr=E(t,n)}else console.warn("Element provided to Wanakana bind() was not a valid input field.")}function z(r){var t=M(r);null!=t?(r.removeAttribute("data-wanakana-id"),r.removeEventListener("compositionupdate",C),r.removeEventListener("input",t.handler),Tr=N(t)):console.warn("Element provided to Wanakana unbind() had no listener registered.")}function A(r){var t=Object.assign({},ur,r);return function(r){var n=r.target;if(Wr)Wr=!1;else{var e=y(n.value),a=q(e,t.IMEMode),o=Object.assign({},t,{IMEMode:!0}),i=x(a,o),u=S(a,o);if(e!==u){var l=n.selectionEnd;if(n.value=u,0===l)n.setSelectionRange(0,0);else{n.setSelectionRange(n.value.length,n.value.length);for(var v=0,f=0;i.length>f;f+=1){var c=er(i[f],3),h=c[1];if(v+=c[2].length,h>=l){n.setSelectionRange(v,v);break}}}}}}}function C(r){var t=r.data||r.detail&&r.detail.data,n=t&&t.slice(-2)||"",e="n"===n[0],a=y(n).split("").every(h);Wr=!e&&a}function E(r,t){return Tr.concat({id:t,handler:r})}function M(r){return r&&Tr.find(function(t){return t.id===r.getAttribute("data-wanakana-id")})}function N(r){var t=r.id;return Tr.filter(function(r){return r.id!==t})}function q(r,t){switch(!0){case"toHiragana"===t:return r.toLowerCase();case"toKatakana"===t:return r.toUpperCase();default:return r}}function K(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&mr.some(function(t){var n=er(t,2);return c(r,n[0],n[1])})}function R(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(K)}function J(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return pr.some(function(t){var n=er(t,2);return c(r,n[0],n[1])})}function I(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(J)}function L(){return c(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",Mr,Nr)}function H(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&(j(r)||L(r))}function P(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(H)}function U(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(j)}function T(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(L)}function B(){return c(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",qr,Kr)}function W(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&[].concat(ar(r)).every(B)}function _(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{passKanji:!0},n=[].concat(ar(r)),e=!1;return t.passKanji||(e=n.some(W)),(n.some(U)||n.some(T))&&n.some(R)&&!e}function D(){for(var r=[],t="",n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(""),e=0;n.length>e;e+=1){var a=n[e];if(b(a)||Dr(a,e)||Fr(a))r.push(a);else if(t&&Xr(a,e)){var o=Lr[t].slice(-1);r.push(Ir[o])}else if(!m(a)&&L(a)){var i=a.charCodeAt(0)+(Cr-Mr),u=String.fromCharCode(i);r.push(u),t=u}else r.push(a),t=""}return r.join("")}function X(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return S(r.toLowerCase(),t)}function F(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},ur,t);return n.passRomaji?D(r):R(r)?X(r,n):_(r,{passKanji:!0})?X(D(r),n):D(r)}function G(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},ur,t);return Q(r,n).map(function(n){var e=er(n,3),a=e[0],o=e[1],i=e[2];return t.upcaseKatakana&&T(r.slice(a,o))?i.toUpperCase():i}).join("")}function Q(r,t){var e=v(t);return e=t.customRomajiMapping(e),n(F(r,{passRomaji:!0}),e,!t.IMEMode)}function V(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},ur,t);return k(n.passRomaji?r:R(r)||_(r)?X(r,n):r)}function Y(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&br.some(function(t){var n=er(t,2);return c(r,n[0],n[1])})}function Z(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&gr.some(function(t){var n=er(t,2);return c(r,n[0],n[1])})}function $(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!f(r)&&(Y(r)||Z(r))}function rr(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{all:!1};if(f(r)||!I(r)||P(r))return r;var n=[].concat(ar(r));if(t.all)return n.filter(function(r){return!H(r)}).join("");for(var e=n.reverse(),a=0,o=e.length;o>a;a+=1){var i=e[a];if(!$(i)){if(W(i))break;e[a]=""}}return e.reverse().join("")}function tr(r){switch(!0){case Z(r):return"japanesePunctuation";case B(r):return"kanji";case j(r):return"hiragana";case L(r):return"katakana";default:return"romaji"}}function nr(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(f(r))return[""];var t=[].concat(ar(r)),n=t.shift(),e=tr(n);return t.reduce(function(r,t){var n=tr(t)===e;if(e=tr(t),n){var a=r.pop();return r.concat(a.concat(t))}return r.concat(t)},[n])}var er=function(){function r(r,t){var n=[],e=!0,a=!1,o=void 0;try{for(var i,u=r[Symbol.iterator]();!(e=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);e=!0);}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),ar=function(r){if(Array.isArray(r)){for(var t=0,n=Array(r.length);r.length>t;t++)n[t]=r[t];return n}return Array.from(r)},or=Object.freeze({HEPBURN:"hepburn"}),ir=null,ur={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,ignoreCase:!1,IMEMode:!1,romanization:or.HEPBURN,customKanaMapping:function(r){return r},customRomajiMapping:function(r){return r}},lr=[65296,65305],vr=[65377,65381],fr=[19968,40959],cr=[13312,19903],yr=[48,57],hr=[0,127],dr=[[256,257],[274,275],[298,299],[332,333],[362,363]],sr=[[8216,8217],[8220,8221]],gr=[[12288,12351],vr,[12539,12540],[65281,65295],[65306,65311],[65339,65343],[65371,65376],[65504,65518]],wr=[[12352,12447],[12448,12543],vr,[65382,65439]],pr=[].concat(wr,gr,[yr,lr,fr,cr]),mr=[hr].concat(dr,sr),br=[[33,47],[58,63],[91,96],[123,126]].concat(sr),jr=97,kr=65,Sr=90,xr=65345,Or=65370,zr=65313,Ar=65338,Cr=12353,Er=12438,Mr=12449,Nr=12540,qr=19968,Kr=40879,Rr=12540,Jr=12539,Ir={a:"あ",i:"い",u:"う",e:"え",o:"う"},Lr={" ":" ","!":"!","?":"?","。":".",":":":","・":"/","、":",","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}","あ":"a","い":"i","う":"u","え":"e","お":"o","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","か":"ka","き":"ki","きゃ":"kya","きぃ":"kyi","きゅ":"kyu","く":"ku","け":"ke","こ":"ko","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ぎゃ":"gya","ぎぃ":"gyi","ぎゅ":"gyu","ぎぇ":"gye","ぎょ":"gyo","さ":"sa","す":"su","せ":"se","そ":"so","ざ":"za","ず":"zu","ぜ":"ze","ぞ":"zo","し":"shi","しゃ":"sha","しゅ":"shu","しょ":"sho","じ":"ji","じゃ":"ja","じゅ":"ju","じょ":"jo","た":"ta","ち":"chi","ちゃ":"cha","ちゅ":"chu","ちょ":"cho","つ":"tsu","て":"te","と":"to","だ":"da","ぢ":"di","づ":"du","で":"de","ど":"do","な":"na","に":"ni","にゃ":"nya","にゅ":"nyu","にょ":"nyo","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ひゃ":"hya","ひゅ":"hyu","ひょ":"hyo","ふぁ":"fa","ふぃ":"fi","ふぇ":"fe","ふぉ":"fo","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","びゃ":"bya","びゅ":"byu","びょ":"byo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ぴゃ":"pya","ぴゅ":"pyu","ぴょ":"pyo","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","みゃ":"mya","みゅ":"myu","みょ":"myo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","りゃ":"rya","りゅ":"ryu","りょ":"ryo","わ":"wa","を":"wo","ん":"n","ゐ":"wi","ゑ":"we","きぇ":"kye","きょ":"kyo","じぃ":"jyi","じぇ":"jye","ちぃ":"cyi","ちぇ":"che","ひぃ":"hyi","ひぇ":"hye","びぃ":"byi","びぇ":"bye","ぴぃ":"pyi","ぴぇ":"pye","みぇ":"mye","みぃ":"myi","りぃ":"ryi","りぇ":"rye","にぃ":"nyi","にぇ":"nye","しぃ":"syi","しぇ":"she","いぇ":"ye","うぁ":"wha","うぉ":"who","うぃ":"wi","うぇ":"we","ゔゃ":"vya","ゔゅ":"vyu","ゔょ":"vyo","すぁ":"swa","すぃ":"swi","すぅ":"swu","すぇ":"swe","すぉ":"swo","くゃ":"qya","くゅ":"qyu","くょ":"qyo","くぁ":"qwa","くぃ":"qwi","くぅ":"qwu","くぇ":"qwe","くぉ":"qwo","ぐぁ":"gwa","ぐぃ":"gwi","ぐぅ":"gwu","ぐぇ":"gwe","ぐぉ":"gwo","つぁ":"tsa","つぃ":"tsi","つぇ":"tse","つぉ":"tso","てゃ":"tha","てぃ":"thi","てゅ":"thu","てぇ":"the","てょ":"tho","とぁ":"twa","とぃ":"twi","とぅ":"twu","とぇ":"twe","とぉ":"two","ぢゃ":"dya","ぢぃ":"dyi","ぢゅ":"dyu","ぢぇ":"dye","ぢょ":"dyo","でゃ":"dha","でぃ":"dhi","でゅ":"dhu","でぇ":"dhe","でょ":"dho","どぁ":"dwa","どぃ":"dwi","どぅ":"dwu","どぇ":"dwe","どぉ":"dwo","ふぅ":"fwu","ふゃ":"fya","ふゅ":"fyu","ふょ":"fyo","ぁ":"a","ぃ":"i","ぇ":"e","ぅ":"u","ぉ":"o","ゃ":"ya","ゅ":"yu","ょ":"yo","っ":"","ゕ":"ka","ゖ":"ka","ゎ":"wa","んあ":"n'a","んい":"n'i","んう":"n'u","んえ":"n'e","んお":"n'o","んや":"n'ya","んゆ":"n'yu","んよ":"n'yo"},Hr=null,Pr=o({wi:"ゐ",we:"ゑ"}),Ur=["TEXTAREA","INPUT"],Tr=[],Br=0,Wr=!1,_r=function(){return Br+=1,""+Date.now()+Br},Dr=function(r,t){return m(r)&&1>t},Xr=function(r,t){return m(r)&&t>0},Fr=function(r){return["ヶ","ヵ"].includes(r)};r.bind=O,r.unbind=z,r.isRomaji=R,r.isJapanese=I,r.isKana=P,r.isHiragana=U,r.isKatakana=T,r.isMixed=_,r.isKanji=W,r.toRomaji=G,r.toKana=S,r.toHiragana=F,r.toKatakana=V,r.stripOkurigana=rr,r.tokenize=nr,r.createCustomMapping=o,r.methods=or,Object.defineProperty(r,"__esModule",{value:!0})});
!function(r,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(r.wanakana={})}(this,function(r){"use strict";function t(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function n(r,t,n){function e(r,t){if(void 0!==r[t])return Object.assign({"":r[""]+t},r[t])}function a(r,t){var n=r.charAt(0);return o(Object.assign({"":n},i[n]),r.slice(1),t,t+1)}function o(r,t,i,u){if(!t)return n||1===Object.keys(r).length?r[""]?[[i,u,r[""]]]:[]:[[i,u,null]];if(1===Object.keys(r).length)return[[i,u,r[""]]].concat(a(t,u));var l=e(r,t.charAt(0));return void 0===l?[[i,u,r[""]]].concat(a(t,u)):o(l,t.slice(1),i,u+1)}var i=t;return a(r,0)}function e(r){var n={},a=!0,o=!1,i=void 0;try{for(var u,l=t(r)[Symbol.iterator]();!(a=(u=l.next()).done);a=!0){var c=ar(u.value,2),v=c[0],f=c[1];n[v]="string"==typeof f?{"":f}:e(f)}}catch(r){o=!0,i=r}finally{try{!a&&l.return&&l.return()}finally{if(o)throw i}}return n}function a(r,t){var n=r,e=!0,a=!1,o=void 0;try{for(var i,u=t[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=i.value;void 0===n[l]&&(n[l]={}),n=n[l]}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}function o(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n={},e=!0,a=!1,o=void 0;try{for(var i,u=t(r)[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=ar(i.value,2),c=l[0],v=l[1],f=n,y=!0,h=!1,s=void 0;try{for(var d,g=c[Symbol.iterator]();!(y=(d=g.next()).done);y=!0){var w=d.value;void 0===f[w]&&(f[w]={}),f=f[w]}}catch(r){h=!0,s=r}finally{try{!y&&g.return&&g.return()}finally{if(h)throw s}}f[""]=v}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return function(){function r(n,e){if(void 0===n||"string"==typeof n)return e;var a=n,o=!0,i=!1,u=void 0;try{for(var l,c=t(e)[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){var v=ar(l.value,2),f=v[0],y=v[1];a[f]=r(n[f],y)}}catch(r){i=!0,u=r}finally{try{!o&&c.return&&c.return()}finally{if(i)throw u}}return a}var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return r(JSON.parse(JSON.stringify(e)),n)}}function i(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function u(){function r(t){var n={},e=!0,a=!1,o=void 0;try{for(var u,l=i(t)[Symbol.iterator]();!(e=(u=l.next()).done);e=!0){var c=ar(u.value,2),v=c[0],f=c[1];if(v)n[v]=r(f);else{var y=f.charAt(0);n[v]=y in ur?ur[y]+f:f}}}catch(r){a=!0,o=r}finally{try{!e&&l.return&&l.return()}finally{if(a)throw o}}return n}var t=e({"あ":"a","い":"i","う":"u","え":"e","お":"o","か":"ka","き":"ki","く":"ku","け":"ke","こ":"ko","さ":"sa","し":"shi","す":"su","せ":"se","そ":"so","た":"ta","ち":"chi","つ":"tsu","て":"te","と":"to","な":"na","に":"ni","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","わ":"wa","ゐ":"wi","ゑ":"we","を":"wo","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ざ":"za","じ":"ji","ず":"zu","ぜ":"ze","ぞ":"zo","だ":"da","ぢ":"ji","づ":"zu","で":"de","ど":"do","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","ん":"n"}),n=function(r){return a(t,r)},o=function(r,t){n(r)[""]=t},u={"。":".","、":",",":":":","・":"/","!":"!","?":"?","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"," ":" "},l=!0,c=!1,v=void 0;try{for(var f,y=i(u)[Symbol.iterator]();!(l=(f=y.next()).done);l=!0){var h=ar(f.value,2),s=h[0],d=h[1];n(s)[""]=d}}catch(r){c=!0,v=r}finally{try{!l&&y.return&&y.return()}finally{if(c)throw v}}var g={"ゃ":"ya","ゅ":"yu","ょ":"yo"},w={"ぃ":"yi","ぇ":"ye"},p={"ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},m=!0,b=!1,j=void 0;try{for(var k,S=i(g).concat(i(p))[Symbol.iterator]();!(m=(k=S.next()).done);m=!0){var A=ar(k.value,2);o(A[0],A[1])}}catch(r){b=!0,j=r}finally{try{!m&&S.return&&S.return()}finally{if(b)throw j}}var x=["き","に","ひ","み","り","ぎ","び","ぴ","ゔ","く","ふ"],O=!0,E=!1,N=void 0;try{for(var z,C=x[Symbol.iterator]();!(O=(z=C.next()).done);O=!0){var K=z.value,M=n(K)[""][0],R=!0,q=!1,J=void 0;try{for(var I,L=i(g)[Symbol.iterator]();!(R=(I=L.next()).done);R=!0){var H=ar(I.value,2);o(K+H[0],M+H[1])}}catch(r){q=!0,J=r}finally{try{!R&&L.return&&L.return()}finally{if(q)throw J}}var U=!0,_=!1,T=void 0;try{for(var P,B=i(w)[Symbol.iterator]();!(U=(P=B.next()).done);U=!0){var W=ar(P.value,2);o(K+W[0],M+W[1])}}catch(r){_=!0,T=r}finally{try{!U&&B.return&&B.return()}finally{if(_)throw T}}}}catch(r){E=!0,N=r}finally{try{!O&&C.return&&C.return()}finally{if(E)throw N}}var G={"し":"sh","ち":"ch","じ":"j","ぢ":"j"},D=!0,X=!1,Z=void 0;try{for(var F,Q=i(G)[Symbol.iterator]();!(D=(F=Q.next()).done);D=!0){var V=ar(F.value,2),Y=V[0],$=V[1],rr=!0,tr=!1,nr=void 0;try{for(var er,or=i(g)[Symbol.iterator]();!(rr=(er=or.next()).done);rr=!0){var ir=ar(er.value,2);o(Y+ir[0],$+ir[1][1])}}catch(r){tr=!0,nr=r}finally{try{!rr&&or.return&&or.return()}finally{if(tr)throw nr}}o(Y+"ぃ",$+"yi"),o(Y+"ぇ",$+"e")}}catch(r){X=!0,Z=r}finally{try{!D&&Q.return&&Q.return()}finally{if(X)throw Z}}var ur={b:"b",c:"t",d:"d",f:"f",g:"g",h:"h",j:"j",k:"k",m:"m",p:"p",q:"q",r:"r",s:"s",t:"t",v:"v",w:"w",x:"x",z:"z"};t["っ"]=r(t);var lr={"っ":"","ゃ":"ya","ゅ":"yu","ょ":"yo","ぁ":"a","ぃ":"i","ぅ":"u","ぇ":"e","ぉ":"o"},cr=!0,vr=!1,fr=void 0;try{for(var yr,hr=i(lr)[Symbol.iterator]();!(cr=(yr=hr.next()).done);cr=!0){var sr=ar(yr.value,2);o(sr[0],sr[1])}}catch(r){vr=!0,fr=r}finally{try{!cr&&hr.return&&hr.return()}finally{if(vr)throw fr}}var dr=["あ","い","う","え","お","や","ゆ","よ"],gr=!0,wr=!1,pr=void 0;try{for(var mr,br=dr[Symbol.iterator]();!(gr=(mr=br.next()).done);gr=!0){var jr=mr.value;o("ん"+jr,"n'"+n(jr)[""])}}catch(r){wr=!0,pr=r}finally{try{!gr&&br.return&&br.return()}finally{if(wr)throw pr}}return Object.freeze(JSON.parse(JSON.stringify(t)))}function l(){return null===ur&&(ur=u()),ur}function c(r){switch(r.romanization){case ir.HEPBURN:return l(r);default:return{}}}function v(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function f(){function r(t){var n={},e=!0,a=!1,o=void 0;try{for(var i,u=v(t)[Symbol.iterator]();!(e=(i=u.next()).done);e=!0){var l=ar(i.value,2),c=l[0],f=l[1];n[c]=c?r(f):"っ"+f}}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}var t=e({a:"あ",i:"い",u:"う",e:"え",o:"お",k:{a:"か",i:"き",u:"く",e:"け",o:"こ"},s:{a:"さ",i:"し",u:"す",e:"せ",o:"そ"},t:{a:"た",i:"ち",u:"つ",e:"て",o:"と"},n:{a:"な",i:"に",u:"ぬ",e:"ね",o:"の"},h:{a:"は",i:"ひ",u:"ふ",e:"へ",o:"ほ"},m:{a:"ま",i:"み",u:"む",e:"め",o:"も"},y:{a:"や",u:"ゆ",o:"よ"},r:{a:"ら",i:"り",u:"る",e:"れ",o:"ろ"},w:{a:"わ",i:"ゐ",e:"ゑ",o:"を"},g:{a:"が",i:"ぎ",u:"ぐ",e:"げ",o:"ご"},z:{a:"ざ",i:"じ",u:"ず",e:"ぜ",o:"ぞ"},d:{a:"だ",i:"ぢ",u:"づ",e:"で",o:"ど"},b:{a:"ば",i:"び",u:"ぶ",e:"べ",o:"ぼ"},p:{a:"ぱ",i:"ぴ",u:"ぷ",e:"ぺ",o:"ぽ"},v:{a:"ゔぁ",i:"ゔぃ",u:"ゔ",e:"ゔぇ",o:"ゔぉ"}}),n=function(r){return a(t,r)},o={k:"き",s:"し",t:"ち",n:"に",h:"ひ",m:"み",r:"り",g:"ぎ",z:"じ",d:"ぢ",b:"び",p:"ぴ",v:"ゔ",q:"く",f:"ふ"},i={ya:"ゃ",yi:"ぃ",yu:"ゅ",ye:"ぇ",yo:"ょ"},u={a:"ぁ",i:"ぃ",u:"ぅ",e:"ぇ",o:"ぉ"},l=!0,c=!1,f=void 0;try{for(var y,h=v(o)[Symbol.iterator]();!(l=(y=h.next()).done);l=!0){var s=ar(y.value,2),d=s[0],g=s[1],w=!0,p=!1,m=void 0;try{for(var b,j=v(i)[Symbol.iterator]();!(w=(b=j.next()).done);w=!0){var k=ar(b.value,2),S=k[0],A=k[1];n(d+S)[""]=g+A}}catch(r){p=!0,m=r}finally{try{!w&&j.return&&j.return()}finally{if(p)throw m}}}}catch(r){c=!0,f=r}finally{try{!l&&h.return&&h.return()}finally{if(c)throw f}}var x={".":"。",",":"、",":":":","/":"・","!":"!","?":"?","~":"〜","-":"ー","‘":"「","’":"」","“":"『","”":"』","[":"[","]":"]","(":"(",")":")","{":"{","}":"}"},O=!0,E=!1,N=void 0;try{for(var z,C=v(x)[Symbol.iterator]();!(O=(z=C.next()).done);O=!0){var K=ar(z.value,2),M=K[0],R=K[1];n(M)[""]=R}}catch(r){E=!0,N=r}finally{try{!O&&C.return&&C.return()}finally{if(E)throw N}}var q={wh:"う",qw:"く",q:"く",gw:"ぐ",sw:"す",ts:"つ",th:"て",tw:"と",dh:"で",dw:"ど",fw:"ふ",f:"ふ"},J=!0,I=!1,L=void 0;try{for(var H,U=v(q)[Symbol.iterator]();!(J=(H=U.next()).done);J=!0){var _=ar(H.value,2),T=_[0],P=_[1],B=!0,W=!1,G=void 0;try{for(var D,X=v(u)[Symbol.iterator]();!(B=(D=X.next()).done);B=!0){var Z=ar(D.value,2),F=Z[0],Q=Z[1];(Fr=n(T+F))[""]=P+Q}}catch(r){W=!0,G=r}finally{try{!B&&X.return&&X.return()}finally{if(W)throw G}}}}catch(r){I=!0,L=r}finally{try{!J&&U.return&&U.return()}finally{if(I)throw L}}for(var V=["n","n'","xn"],Y=0;3>Y;Y++)n(V[Y])[""]="ん";var $={sh:"sy",ch:"ty",cy:"ty",chy:"ty",shy:"sy",j:"zy",jy:"zy",shi:"si",chi:"ti",tsu:"tu",ji:"zi",fu:"hu"};t.c=JSON.parse(JSON.stringify(t.k));var rr=!0,tr=!1,nr=void 0;try{for(var er,or=v($)[Symbol.iterator]();!(rr=(er=or.next()).done);rr=!0){var ir=ar(er.value,2),ur=ir[0],lr=ir[1],cr=ur.slice(0,ur.length-1),vr=ur.charAt(ur.length-1);n(cr)[vr]=JSON.parse(JSON.stringify(n(lr)))}}catch(r){tr=!0,nr=r}finally{try{!rr&&or.return&&or.return()}finally{if(tr)throw nr}}var fr=Object.assign({tu:"っ",wa:"ゎ",ka:"ヵ",ke:"ヶ"},u,i),yr=!0,hr=!1,sr=void 0;try{for(var dr,gr=v(fr)[Symbol.iterator]();!(yr=(dr=gr.next()).done);yr=!0){var wr=ar(dr.value,2),pr=wr[0],mr=wr[1],br=n("x"+pr);br[""]=mr;var jr=pr.slice(0,pr.length-1),kr=pr.charAt(pr.length-1);n("l"+jr)[kr]=br;var Sr=!0,Ar=!1,xr=void 0;try{for(var Or,Er=function(r){var t=[],n=!0,e=!1,a=void 0;try{for(var o,i=v($).concat([["c","k"]])[Symbol.iterator]();!(n=(o=i.next()).done);n=!0){var u=ar(o.value,2),l=u[0],c=u[1];r.startsWith(c)&&t.push(r.replace(c,l))}}catch(r){e=!0,a=r}finally{try{!n&&i.return&&i.return()}finally{if(e)throw a}}return t}(pr)[Symbol.iterator]();!(Sr=(Or=Er.next()).done);Sr=!0)for(var Nr=Or.value,zr=Nr.slice(0,Nr.length-1),Cr=Nr.charAt(Nr.length-1),Kr=["l","x"],Mr=0;2>Mr;Mr++){var Rr=Kr[Mr];n(Rr+zr)[Cr]=n(Rr+pr)}}catch(r){Ar=!0,xr=r}finally{try{!Sr&&Er.return&&Er.return()}finally{if(Ar)throw xr}}}}catch(r){hr=!0,sr=r}finally{try{!yr&&gr.return&&gr.return()}finally{if(hr)throw sr}}var qr={yi:"い",wu:"う",ye:"いぇ",wi:"うぃ",we:"うぇ",kwa:"くぁ",whu:"う",tha:"てゃ",thu:"てゅ",tho:"てょ",dha:"でゃ",dhu:"でゅ",dho:"でょ"},Jr=!0,Ir=!1,Lr=void 0;try{for(var Hr,Ur=v(qr)[Symbol.iterator]();!(Jr=(Hr=Ur.next()).done);Jr=!0){var _r=ar(Hr.value,2),Tr=_r[0],Pr=_r[1];n(Tr)[""]=Pr}}catch(r){Ir=!0,Lr=r}finally{try{!Jr&&Ur.return&&Ur.return()}finally{if(Ir)throw Lr}}var Br=!0,Wr=!1,Gr=void 0;try{for(var Dr,Xr=Object.keys(o).concat("c","y","w","j")[Symbol.iterator]();!(Br=(Dr=Xr.next()).done);Br=!0){var Zr=Dr.value,Fr=t[Zr];Fr[Zr]=r(Fr)}}catch(r){Wr=!0,Gr=r}finally{try{!Br&&Xr.return&&Xr.return()}finally{if(Wr)throw Gr}}return delete t.n.n,Object.freeze(JSON.parse(JSON.stringify(t)))}function y(r){return null===_r&&(_r=f()),_r}function h(r){var t=JSON.parse(JSON.stringify(r));return t.n.n={"":"ん"},t.n[" "]={"":"ん"},t}function s(r){return"string"!=typeof r||!r.length}function d(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments[1],n=arguments[2];if(s(r))return!1;var e=r.charCodeAt(0);return e>=t&&n>=e}function g(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&d(r,Ar,xr)}function w(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&r.charCodeAt(0)===Ir}function p(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&r.charCodeAt(0)===Lr}function m(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&(!!w(r)||d(r,Cr,Kr))}function b(){var r=[];return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("").forEach(function(t){if(w(t)||p(t))r.push(t);else if(m(t)){var n=t.charCodeAt(0)+(Mr-Cr),e=String.fromCharCode(n);r.push(e)}else r.push(t)}),r.join("")}function j(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return k(r,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).map(function(t){var n=ar(t,3),e=n[0],a=n[2];return null===a?r.slice(e):g(r.charAt(e))?b(a):a}).join("")}function k(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=Object.assign({},cr,t),a=y(e);return a=e.IMEMode?h(a):a,a=e.useObsoleteKana?Tr(a):a,a=e.customKanaMapping(a),n(r.toLowerCase(),a,!e.IMEMode)}function S(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return[].concat(or(r)).map(function(r,t){var n=r.charCodeAt(0),e=d(r,Or,Er),a=d(r,Nr,zr);return e?String.fromCharCode(n-Or+Sr):a?String.fromCharCode(n-Nr+Ar):r}).join("")}function A(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=1>=arguments.length||void 0===arguments[1]||arguments[1];if(s(r))return!1;var n=t?/[bcdfghjklmnpqrstvwxyz]/:/[bcdfghjklmnpqrstvwxz]/;return-1!==r.toLowerCase().charAt(0).search(n)}function x(r){var t=Object.assign({},cr,r);return function(r){var n=r.target;if(Br)Br=!1;else{var e=S(n.value),a=C(e,t.IMEMode),o=Object.assign({},t,{IMEMode:!0}),i=k(a,o),u=j(a,o);if(e!==u){var l=n.selectionEnd;if(n.value=u,0===l)n.setSelectionRange(0,0);else{n.setSelectionRange(n.value.length,n.value.length);for(var c=0,v=0;i.length>v;v+=1){var f=ar(i[v],3),y=f[1],h=f[2];if(c+=(void 0===h?"":h).length,y>=l){n.setSelectionRange(c,c);break}}}}}}}function O(r){var t=r.data||r.detail&&r.detail.data,n=t&&t.slice(-2)||"",e="n"===n[0],a=S(n).split("").every(A);Br=!e&&a}function E(r,t){Pr=Pr.concat({id:t,handler:r})}function N(r){var t=r.id;Pr=Pr.filter(function(r){return r.id!==t})}function z(r){return r&&Pr.find(function(t){return t.id===r.getAttribute("data-wanakana-id")})}function C(r,t){switch(!0){case t===lr.HIRAGANA:return r.toLowerCase();case t===lr.KATAKANA:return r.toUpperCase();default:return r}}function K(r){for(var t=[],n=Object.keys(r),e=0;n.length>e;++e)t.push([n[e],r[n[e]]]);return t}function M(r){var t=x(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{});if(r instanceof Element&&Xr.includes(r.nodeName)){var n=Fr();window&&window.__DEBUG_WANAKANA&&Gr(r),r.setAttribute("data-wanakana-id",n),r.autocapitalize="none",r.addEventListener("compositionupdate",O),r.addEventListener("input",t),E(t,n)}else console.warn("Element provided to Wanakana bind() was not a valid input field.")}function R(r){var t=z(r);null!=t?(window&&window.__DEBUG_WANAKANA&&Dr(r),r.removeAttribute("data-wanakana-id"),r.removeEventListener("compositionupdate",O),r.removeEventListener("input",t.handler),N(t)):console.warn("Element provided to Wanakana unbind() had no listener registered.")}function q(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&jr.some(function(t){var n=ar(t,2);return d(r,n[0],n[1])})}function J(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(q)}function I(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return br.some(function(t){var n=ar(t,2);return d(r,n[0],n[1])})}function L(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(I)}function H(){return d(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",Mr,Rr)}function U(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&(m(r)||H(r))}function _(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(U)}function T(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(m)}function P(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(H)}function B(){return d(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",qr,Jr)}function W(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&[].concat(or(r)).every(B)}function G(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{passKanji:!0},n=[].concat(or(r)),e=!1;return t.passKanji||(e=n.some(W)),(n.some(T)||n.some(P))&&n.some(J)&&!e}function D(){for(var r=[],t="",n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split(""),e=0;n.length>e;e+=1){var a=n[e];if(p(a)||Qr(a,e)||Yr(a))r.push(a);else if(t&&Vr(a,e)){var o=Ur[t].slice(-1);r.push(Hr[o])}else if(!w(a)&&H(a)){var i=a.charCodeAt(0)+(Cr-Mr),u=String.fromCharCode(i);r.push(u),t=u}else r.push(a),t=""}return r.join("")}function X(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return j(r.toLowerCase(),t)}function Z(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},cr,t);return n.passRomaji?D(r):J(r)?X(r,n):G(r,{passKanji:!0})?X(D(r),n):D(r)}function F(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},cr,t);return Q(r,n).map(function(n){var e=ar(n,3),a=e[0],o=e[1],i=e[2];return t.upcaseKatakana&&P(r.slice(a,o))?i.toUpperCase():i}).join("")}function Q(r,t){var e=c(t);return e=t.customRomajiMapping(e),n(Z(r,{passRomaji:!0}),e,!t.IMEMode)}function V(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=Object.assign({},cr,t);return b(n.passRomaji?r:J(r)||G(r)?X(r,n):r)}function Y(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&kr.some(function(t){var n=ar(t,2);return d(r,n[0],n[1])})}function $(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&pr.some(function(t){var n=ar(t,2);return d(r,n[0],n[1])})}function rr(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return!s(r)&&(Y(r)||$(r))}function tr(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{all:!1};if(s(r)||!L(r)||_(r))return r;var n=[].concat(or(r));if(t.all)return n.filter(function(r){return!U(r)}).join("");for(var e=n.reverse(),a=0,o=e.length;o>a;a+=1){var i=e[a];if(!rr(i)){if(W(i))break;e[a]=""}}return e.reverse().join("")}function nr(r){switch(!0){case $(r):return"japanesePunctuation";case B(r):return"kanji";case m(r):return"hiragana";case H(r):return"katakana";default:return"romaji"}}function er(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";if(s(r))return[""];var t=[].concat(or(r)),n=t.shift(),e=nr(n);return t.reduce(function(r,t){var n=nr(t)===e;if(e=nr(t),n){var a=r.pop();return r.concat(a.concat(t))}return r.concat(t)},[n])}var ar=function(){function r(r,t){var n=[],e=!0,a=!1,o=void 0;try{for(var i,u=r[Symbol.iterator]();!(e=(i=u.next()).done)&&(n.push(i.value),!t||n.length!==t);e=!0);}catch(r){a=!0,o=r}finally{try{!e&&u.return&&u.return()}finally{if(a)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return r(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),or=function(r){if(Array.isArray(r)){for(var t=0,n=Array(r.length);r.length>t;t++)n[t]=r[t];return n}return Array.from(r)},ir=Object.freeze({HEPBURN:"hepburn"}),ur=null,lr={HIRAGANA:"toHiragana",KATAKANA:"toKatakana"},cr={useObsoleteKana:!1,passRomaji:!1,upcaseKatakana:!1,ignoreCase:!1,IMEMode:!1,romanization:ir.HEPBURN,customKanaMapping:function(r){return r},customRomajiMapping:function(r){return r}},vr=[65296,65305],fr=[65377,65381],yr=[19968,40959],hr=[13312,19903],sr=[48,57],dr=[0,127],gr=[[256,257],[274,275],[298,299],[332,333],[362,363]],wr=[[8216,8217],[8220,8221]],pr=[[12288,12351],fr,[12539,12540],[65281,65295],[65306,65311],[65339,65343],[65371,65376],[65504,65518]],mr=[[12352,12447],[12448,12543],fr,[65382,65439]],br=[].concat(mr,pr,[sr,vr,yr,hr]),jr=[dr].concat(gr,wr),kr=[[33,47],[58,63],[91,96],[123,126]].concat(wr),Sr=97,Ar=65,xr=90,Or=65345,Er=65370,Nr=65313,zr=65338,Cr=12353,Kr=12438,Mr=12449,Rr=12540,qr=19968,Jr=40879,Ir=12540,Lr=12539,Hr={a:"あ",i:"い",u:"う",e:"え",o:"う"},Ur={" ":" ","!":"!","?":"?","。":".",":":":","・":"/","、":",","〜":"~","ー":"-","「":"‘","」":"’","『":"“","』":"”","[":"[","]":"]","(":"(",")":")","{":"{","}":"}","あ":"a","い":"i","う":"u","え":"e","お":"o","ゔぁ":"va","ゔぃ":"vi","ゔ":"vu","ゔぇ":"ve","ゔぉ":"vo","か":"ka","き":"ki","きゃ":"kya","きぃ":"kyi","きゅ":"kyu","く":"ku","け":"ke","こ":"ko","が":"ga","ぎ":"gi","ぐ":"gu","げ":"ge","ご":"go","ぎゃ":"gya","ぎぃ":"gyi","ぎゅ":"gyu","ぎぇ":"gye","ぎょ":"gyo","さ":"sa","す":"su","せ":"se","そ":"so","ざ":"za","ず":"zu","ぜ":"ze","ぞ":"zo","し":"shi","しゃ":"sha","しゅ":"shu","しょ":"sho","じ":"ji","じゃ":"ja","じゅ":"ju","じょ":"jo","た":"ta","ち":"chi","ちゃ":"cha","ちゅ":"chu","ちょ":"cho","つ":"tsu","て":"te","と":"to","だ":"da","ぢ":"di","づ":"du","で":"de","ど":"do","な":"na","に":"ni","にゃ":"nya","にゅ":"nyu","にょ":"nyo","ぬ":"nu","ね":"ne","の":"no","は":"ha","ひ":"hi","ふ":"fu","へ":"he","ほ":"ho","ひゃ":"hya","ひゅ":"hyu","ひょ":"hyo","ふぁ":"fa","ふぃ":"fi","ふぇ":"fe","ふぉ":"fo","ば":"ba","び":"bi","ぶ":"bu","べ":"be","ぼ":"bo","びゃ":"bya","びゅ":"byu","びょ":"byo","ぱ":"pa","ぴ":"pi","ぷ":"pu","ぺ":"pe","ぽ":"po","ぴゃ":"pya","ぴゅ":"pyu","ぴょ":"pyo","ま":"ma","み":"mi","む":"mu","め":"me","も":"mo","みゃ":"mya","みゅ":"myu","みょ":"myo","や":"ya","ゆ":"yu","よ":"yo","ら":"ra","り":"ri","る":"ru","れ":"re","ろ":"ro","りゃ":"rya","りゅ":"ryu","りょ":"ryo","わ":"wa","を":"wo","ん":"n","ゐ":"wi","ゑ":"we","きぇ":"kye","きょ":"kyo","じぃ":"jyi","じぇ":"jye","ちぃ":"cyi","ちぇ":"che","ひぃ":"hyi","ひぇ":"hye","びぃ":"byi","びぇ":"bye","ぴぃ":"pyi","ぴぇ":"pye","みぇ":"mye","みぃ":"myi","りぃ":"ryi","りぇ":"rye","にぃ":"nyi","にぇ":"nye","しぃ":"syi","しぇ":"she","いぇ":"ye","うぁ":"wha","うぉ":"who","うぃ":"wi","うぇ":"we","ゔゃ":"vya","ゔゅ":"vyu","ゔょ":"vyo","すぁ":"swa","すぃ":"swi","すぅ":"swu","すぇ":"swe","すぉ":"swo","くゃ":"qya","くゅ":"qyu","くょ":"qyo","くぁ":"qwa","くぃ":"qwi","くぅ":"qwu","くぇ":"qwe","くぉ":"qwo","ぐぁ":"gwa","ぐぃ":"gwi","ぐぅ":"gwu","ぐぇ":"gwe","ぐぉ":"gwo","つぁ":"tsa","つぃ":"tsi","つぇ":"tse","つぉ":"tso","てゃ":"tha","てぃ":"thi","てゅ":"thu","てぇ":"the","てょ":"tho","とぁ":"twa","とぃ":"twi","とぅ":"twu","とぇ":"twe","とぉ":"two","ぢゃ":"dya","ぢぃ":"dyi","ぢゅ":"dyu","ぢぇ":"dye","ぢょ":"dyo","でゃ":"dha","でぃ":"dhi","でゅ":"dhu","でぇ":"dhe","でょ":"dho","どぁ":"dwa","どぃ":"dwi","どぅ":"dwu","どぇ":"dwe","どぉ":"dwo","ふぅ":"fwu","ふゃ":"fya","ふゅ":"fyu","ふょ":"fyo","ぁ":"a","ぃ":"i","ぇ":"e","ぅ":"u","ぉ":"o","ゃ":"ya","ゅ":"yu","ょ":"yo","っ":"","ゕ":"ka","ゖ":"ka","ゎ":"wa","んあ":"n'a","んい":"n'i","んう":"n'u","んえ":"n'e","んお":"n'o","んや":"n'ya","んゆ":"n'yu","んよ":"n'yo"},_r=null,Tr=o({wi:"ゐ",we:"ゑ"}),Pr=[],Br=!1,Wr={beforeinput:function(r){var t=r.data,n=r.target.value;return console.log("beforeinput data "+t+", value: "+n)},input:function(r){var t=r.target;return console.log("input: "+t.value)},change:function(r){var t=r.target;return console.log("change: "+t.value)},keypress:function(r){var t=r.which;return console.log("keypress: "+String.fromCharCode(t))},compositionstart:function(){return console.log("compositionstart")},compositionend:function(){return console.log("compositionend")},compositionupdate:function(r){return console.log("compositionupdate: "+r.data)}},Gr=function(r){K(Wr).forEach(function(t){var n=ar(t,2),e=n[0],a=n[1];return r.addEventListener(e,a)})},Dr=function(r){K(Wr).forEach(function(t){var n=ar(t,2),e=n[0],a=n[1];return r.removeEventListener(e,a)})},Xr=["TEXTAREA","INPUT"],Zr=0,Fr=function(){return Zr+=1,""+Date.now()+Zr},Qr=function(r,t){return w(r)&&1>t},Vr=function(r,t){return w(r)&&t>0},Yr=function(r){return["ヶ","ヵ"].includes(r)};r.bind=M,r.unbind=R,r.isRomaji=J,r.isJapanese=L,r.isKana=_,r.isHiragana=T,r.isKatakana=P,r.isMixed=G,r.isKanji=W,r.toRomaji=F,r.toKana=j,r.toHiragana=Z,r.toKatakana=V,r.stripOkurigana=tr,r.tokenize=er,r.ROMANIZATIONS=ir,r.createCustomMapping=o,Object.defineProperty(r,"__esModule",{value:!0})});
{
"name": "wanakana",
"version": "3.0.0",
"version": "3.0.1",
"license": "MIT",

@@ -5,0 +5,0 @@ "homepage": "http://www.wanakana.com",

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc