加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Engine.js 11.14 KB
一键复制 编辑 原始数据 按行查看 历史
yoojia.chen 提交于 2018-03-20 17:02 . 更新构建文件
var native_update_keyboard=function(e){function r(t){if(n[t])return n[t].exports;var _=n[t]={i:t,l:!1,exports:{}};return e[t].call(_.exports,_,_.exports,r),_.l=!0,_.exports}var n={};return r.m=e,r.c=n,r.i=function(e){return e},r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:t})},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},r.p="/",r(r.s=4)}([,,,function(e,r){!function(r,n){e.exports=function(){"use strict";var e={FULL:0,CIVIL:1,CIVIL_SPEC:2},r={GENERAL:0,FUN_DEL:1,FUN_OK:2,FUN_MORE:3},n={UNKNOWN:-1,AUTO_DETECT:0,CIVIL:1,WUJING:2,WUJING_LOCAL:3,ARMY:4,NEW_ENERGY:5,EMBASSY:6,EMBASSY_NEW:7,AVIATION:8,nameOf:function(e){switch(e){case 1:return"UNKNOWN";case 0:return"AUTO_DETECT";case 1:return"CIVIL";case 2:return"WUJING";case 3:return"WUJING_LOCAL";case 4:return"ARMY";case 5:return"NEW_ENERGY";case 6:return"EMBASSY";case 7:return"EMBASSY_NEW";case 8:return"AVIATION";default:return"UNKNOWN"}},lenOf:function(e){switch(e){case 3:case 5:return 8;default:return 7}}};return{KB_TYPES:e,KEY_TYPES:r,NUM_TYPES:n,S_CIVIL_PVS:"京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新",S_ARMY_PVS:"QVKHBSLJNGCEZ",S_ARMY_AREA:"ABCDEFGHJKLMNOPRSTUVXY",S_NUM:"1234567890",S_LETTERS:"QWERTYUPASDFGHJKLZXCVBNM",S_CHARS:"1234567890QWERTYUPASDFGHJKLZXCVBNM",C_EMBASSY:"使",C_HK:"",C_MACAO:"",C_XUE:"",C_JING:"",C_MIN:"",C_HANG:"",S_POSTFIX_ZH:"警挂领试超",C_W:"W",C_J:"J",C_O:"O",S_DF:"DF",S_123:"123",S_NEW_ENERGY:"123DF",S_Q_IOP:"QWERTYUIOP",S_Q_OP:"QWERTYUOP",S_Q_P:"QWERTYUP",S_A_L:"ASDFGHJKL",S_Z_M:"ZXCVBNM",S_HK_MACAO:"港澳",S_EMBASSY_PVS:"使123",C_DEL:"-",C_OK:"+",C_MORE:"=",S_DEL_OK:"-+"}}()}()},function(e,r,n){!function(r,t){e.exports=function(){"use strict";function e(e,r){var n=e["row"+r];return void 0===n?[]:n}function r(r,n,t){r["row"+n]=e(r,n).map(t)}function t(e,n){return e.numberType=e.numberType,r(e,0,n),r(e,1,n),r(e,2,n),r(e,3,n),r(e,4,n),e}function _(e){var r=e.constructor();for(var n in e)e.hasOwnProperty(n)&&(r[n]=e[n]);return r}function u(e,r,n,t){if(void 0===e||e<s.KB_TYPES.FULL||e>s.KB_TYPES.CIVIL_SPEC)throw new RangeError("参数(keyboardType)范围必须在[0, 2]之间,当前: "+e);if(void 0===r||r!==parseInt(r,10))throw new TypeError("参数(inputIndex)必须为整数数值");if(void 0===n||"string"!=typeof n)throw new TypeError("参数(presetNumber)必须为字符串");if(void 0===t||t!==parseInt(t,10))throw new TypeError("参数(numberType)必须为整数数值");var u=S.detectNumberTypeOf(n),o=t;n.length>0&&t===s.NUM_TYPES.AUTO_DETECT&&(o=u);var c=s.NUM_TYPES.lenOf(o),y=n.length;if(r=Math.min(r,c-1),y>c)throw new RangeError("参数(presetNumber)字符太长:"+n+",车牌类型:"+t+",此类型最大长度:"+c);var E={index:r,number:n,keyboardType:e,numberType:o},i=_(a.layoutProvider.process(E));return i.index=E.index,i.presetNumber=E.number,i.keyboardType=E.keyboardType,i.numberType=E.numberType,i.presetNumberType=E.numberType,i.detectedNumberType=u,i.numberLength=y,i.numberLimitLength=c,E.keys=a.keyProvider.process(E),a.mixiner.process(i,E)}var o=n(7),s=n(3),S=n(8),a={keyProvider:o.Chain.create({}),layoutProvider:o.Chain.create({}),mixiner:o.Each.create()};o.Cached.reg({row0:S.keysOf(s.S_CIVIL_PVS.substr(0,9)),row1:S.keysOf(s.S_CIVIL_PVS.substr(9,8)),row2:S.keysOf(s.S_CIVIL_PVS.substr(17,8)),row3:S.keysOf(s.S_CIVIL_PVS.substr(25,6)+s.S_DEL_OK)},"layout.c",0),o.Cached.reg({row0:S.keysOf(s.S_NUM),row1:S.keysOf(s.S_Q_OP+s.C_MACAO),row2:S.keysOf(s.S_A_L+s.C_HK),row3:S.keysOf(s.S_Z_M+s.S_DEL_OK)},"layout.c",1),o.Cached.reg({row0:S.keysOf(s.S_NUM),row1:S.keysOf(s.S_Q_P+s.S_HK_MACAO),row2:S.keysOf(s.S_A_L+s.C_XUE),row3:S.keysOf(s.S_Z_M+s.S_DEL_OK)},"layout.c",[2,3,4,5,6,7]);o.Cached.reg({row0:S.keysOf(s.S_CIVIL_PVS.substr(0,9)),row1:S.keysOf(s.S_CIVIL_PVS.substr(9,9)),row2:S.keysOf(s.S_CIVIL_PVS.substr(18,9)),row3:S.keysOf(s.S_CIVIL_PVS.substr(25,5)+s.C_EMBASSY+s.C_W+s.S_DEL_OK)},"layout.s",0),o.Cached.reg({row0:S.keysOf(s.S_NUM+s.S_CIVIL_PVS.substr(0,1)),row1:S.keysOf(s.S_CIVIL_PVS.substr(1,11)),row2:S.keysOf(s.S_CIVIL_PVS.substr(12,11)),row3:S.keysOf(s.S_CIVIL_PVS.substr(22,8)+s.S_DEL_OK)},"layout.s",2),o.Cached.reg({row0:S.keysOf(s.S_NUM+s.S_CIVIL_PVS.substr(0,1)),row1:S.keysOf(s.S_CIVIL_PVS.substr(1,11)),row2:S.keysOf(s.S_CIVIL_PVS.substr(12,10)),row3:S.keysOf(s.S_CIVIL_PVS.substr(22,9)+s.C_DEL)},"layout.s.f",2);o.Cached.reg({row0:S.keysOf(s.S_CIVIL_PVS.substr(0,10)),row1:S.keysOf(s.S_CIVIL_PVS.substr(10,10)),row2:S.keysOf(s.S_CIVIL_PVS.substr(20,10)),row3:S.keysOf(s.S_CIVIL_PVS.substr(30,1)+s.C_MIN+s.S_EMBASSY_PVS+s.C_W+s.S_ARMY_PVS.substr(0,4)),row4:S.keysOf(s.S_ARMY_PVS.substr(4,9)+s.C_DEL)},"layout.f",0),o.Cached.reg({row0:S.keysOf(s.S_NUM),row1:S.keysOf(s.S_Q_IOP),row2:S.keysOf(s.S_A_L),row3:S.keysOf(s.S_Z_M+s.C_XUE+s.C_HANG),row4:S.keysOf(s.S_HK_MACAO+s.S_POSTFIX_ZH+s.C_EMBASSY+s.C_DEL)},"layout.f",1),o.Cached.reg({row0:S.keysOf(s.S_NUM),row1:S.keysOf(s.S_Q_IOP),row2:S.keysOf(s.S_A_L),row3:S.keysOf(s.S_Z_M+s.C_XUE),row4:S.keysOf(s.S_HK_MACAO+s.S_POSTFIX_ZH+s.C_EMBASSY+s.C_DEL)},"layout.f",[2,3,4,5,6,7]),a.layoutProvider.reg(function(e,r){return 0===r.index&&r.keyboardType===s.KB_TYPES.CIVIL_SPEC?o.Cached.load("layout.s",0):e.next(r)}),a.layoutProvider.reg(function(e,r){return 2!==r.index||r.keyboardType===s.KB_TYPES.CIVIL||s.NUM_TYPES.WUJING!==r.numberType&&s.NUM_TYPES.WUJING_LOCAL!==r.numberType?e.next(r):r.keyboardType===s.KB_TYPES.FULL?o.Cached.load("layout.s.f",2):o.Cached.load("layout.s",2)}),a.layoutProvider.reg(function(e,r){return r.keyboardType===s.KB_TYPES.FULL?o.Cached.load("layout.f",r.index):o.Cached.load("layout.c",r.index)});o.Cached.reg(S.keysOf(s.S_CIVIL_PVS+s.S_EMBASSY_PVS+s.C_W+s.S_ARMY_PVS+s.C_MIN),"keys.any"),o.Cached.reg(S.keysOf(s.S_NUM),"keys.num"),o.Cached.reg(S.keysOf(s.S_CHARS),"keys.num.letters"),o.Cached.reg(S.keysOf(s.S_CHARS+s.C_JING),"keys.O.police"),o.Cached.reg(S.keysOf(s.S_LETTERS+s.C_O),"keys.civil",1),o.Cached.reg(S.keysOf(s.S_ARMY_AREA),"keys.army",1),o.Cached.reg(S.keysOf(s.S_123),"keys.embassy",1),o.Cached.reg(S.keysOf(s.C_J),"keys.wj",1),o.Cached.reg(S.keysOf(s.C_HANG),"keys.aviation",1),o.Cached.reg(S.keysOf(s.S_NUM+s.S_CIVIL_PVS),"keys.wj",2),o.Cached.reg(S.keysOf(s.S_NUM+s.S_DF),"keys.num.df"),o.Cached.reg(S.keysOf(s.S_HK_MACAO),"keys.hk.macao"),o.Cached.reg(S.keysOf(s.S_CHARS+s.S_POSTFIX_ZH+s.C_XUE),"keys.postfix"),o.Cached.reg(S.keysOf(s.C_EMBASSY),"keys.embassy.zh"),a.keyProvider.reg(function(e,r){return 0===r.index?o.Cached.load("keys.any"):e.next(r)}),a.keyProvider.reg(function(e,r){if(1!==r.index)return e.next(r);switch(r.numberType){case s.NUM_TYPES.ARMY:return o.Cached.load("keys.army",1);case s.NUM_TYPES.WUJING:case s.NUM_TYPES.WUJING_LOCAL:return o.Cached.load("keys.wj",1);case s.NUM_TYPES.AVIATION:return o.Cached.load("keys.aviation",1);case s.NUM_TYPES.EMBASSY:return o.Cached.load("keys.embassy",1);case s.NUM_TYPES.EMBASSY_NEW:return o.Cached.load("keys.num");default:return o.Cached.load("keys.civil",1)}}),a.keyProvider.reg(function(e,r){if(2!==r.index)return e.next(r);switch(r.numberType){case s.NUM_TYPES.WUJING:case s.NUM_TYPES.WUJING_LOCAL:return o.Cached.load("keys.wj",2);case s.NUM_TYPES.EMBASSY:case s.NUM_TYPES.EMBASSY_NEW:return o.Cached.load("keys.num");case s.NUM_TYPES.NEW_ENERGY:return o.Cached.load("keys.num.df");default:return o.Cached.load("keys.num.letters")}}),a.keyProvider.reg(function(e,r){return 3===r.index&&s.NUM_TYPES.EMBASSY===r.numberType?o.Cached.load("keys.num"):e.next(r)}),a.keyProvider.reg(function(e,r){return 4!==r.index&&5!==r.index||s.NUM_TYPES.NEW_ENERGY!==r.numberType?e.next(r):o.Cached.load("keys.num")}),a.keyProvider.reg(function(e,r){if(6===r.index){var n=r.numberType;switch(r.numberType){case s.NUM_TYPES.NEW_ENERGY:return o.Cached.load("keys.num");case s.NUM_TYPES.ARMY:case s.NUM_TYPES.EMBASSY:case s.NUM_TYPES.WUJING:case s.NUM_TYPES.AVIATION:case s.NUM_TYPES.WUJING_LOCAL:return o.Cached.load("keys.num.letters");case s.NUM_TYPES.EMBASSY_NEW:return o.Cached.load("keys.embassy.zh");default:var t=r.number.charAt(1);if("O"===t)return o.Cached.load("keys.O.police");return s.NUM_TYPES.CIVIL===n&&""===r.number.charAt(0)&&"Z"===t?o.Cached.load("keys.hk.macao"):o.Cached.load("keys.postfix")}}return e.next(r)}),a.keyProvider.reg(function(e,r){return 7===r.index&&s.NUM_TYPES.NEW_ENERGY===r.numberType?o.Cached.load("keys.num.df"):e.next(r)}),a.keyProvider.reg(function(){return o.Cached.load("keys.num.letters")}),a.mixiner.reg(function(e,r){var n=r.keys.map(function(e){return e.text});return t(e,function(e){return S.keyOfEnabled(e,S.contains(n,e.text))})}),a.mixiner.reg(function(e,r){return t(e,function(n){var t=n.enabled;return t&&0===r.index&&e.numberType===s.NUM_TYPES.NEW_ENERGY&&(t=S.isProvince(n.text)),S.keyOfEnabled(n,t)})}),a.mixiner.reg(function(e){return t(e,function(e){return"-"===e.text?S.keyOfCode(e,"",s.KEY_TYPES.FUN_DEL):"+"===e.text?S.keyOfCode(e,"确定",s.KEY_TYPES.FUN_OK):e})}),a.mixiner.reg(function(e){return t(e,function(r){return r.keyCode===s.KEY_TYPES.FUN_DEL?S.keyOfEnabled(r,0!=e.numberLength):r})}),a.mixiner.reg(function(e){return t(e,function(r){return r.keyCode===s.KEY_TYPES.FUN_OK?S.keyOfEnabled(r,e.numberLength===e.numberLimitLength):r})}),a.mixiner.reg(function(r){return r.keys=e(r,0).concat(e(r,1)).concat(e(r,2)).concat(e(r,3)).concat(e(r,4)),r});var c=function(){this.update=u,this.config=a};return c.$newKey=S.keyOf,c.NUM_TYPES=s.NUM_TYPES,c.KEY_TYPES=s.KEY_TYPES,c.KEYBOARD_TYPES=s.KB_TYPES,c.VERSION="R1.1/2018.0320/iRain(SZ)",c}()}()},,,function(e,r){!function(r,n){e.exports=function(){"use strict";var e={_mcached:{},reg:function(e,r,n){if(void 0!==n&&n.constructor===Array){var t=this._mcached;n.forEach(function(n){t[r+":"+n]=e})}else{var _=void 0===n?0:n;this._mcached[r+":"+_]=e}},load:function(e,r){return this._mcached[e+":"+(void 0===r?0:r)]}};return{Chain:{create:function(e){var r={},n=new Array,t=0;return r.next=function(_){return t<=n.length?n[t++](r,_):e},r.process=function(e){var n=r.next(e);return t=0,n},r.reg=function(e){return n.push(e),r},r}},Cached:e,Each:{create:function(){var e={},r=new Array;return e.process=function(e,n){var t=e;return r.forEach(function(e){t=e(t,n)}),t},e.reg=function(n){return r.push(n),e},e}}}}()}()},function(e,r,n){"use strict";function t(e,r,n){return{text:e,keyCode:void 0===r?c.KEY_TYPES.GENERAL:r,enabled:void 0===n||n,isFunKey:void 0!==r&&r!==c.KEY_TYPES.GENERAL}}function _(e,r){return t(e.text,e.keyCode,r)}function u(e){for(var r=new Array,n=0;n<e.length;n++)r.push(t(e[n]));return r}function o(e,r,n){return t(r,n,e.enabled)}function s(e,r){return e.indexOf(r)>=0}function S(e){return s(c.S_CIVIL_PVS,e)}function a(e){if(0===e.length)return c.NUM_TYPES.AUTO_DETECT;var r=e.charAt(0);return s(c.S_ARMY_PVS,r)?c.NUM_TYPES.ARMY:c.C_EMBASSY===r?c.NUM_TYPES.EMBASSY:c.C_MIN===r?c.NUM_TYPES.AVIATION:s(c.S_123,r)?c.NUM_TYPES.EMBASSY_NEW:c.C_W===r?e.length>=3&&S(e.charAt(2))?c.NUM_TYPES.WUJING_LOCAL:c.NUM_TYPES.WUJING:S(r)?8===e.length?/\W[A-Z][0-9DF][0-9A-Z]\d{3}[0-9DF]/.test(e)?c.NUM_TYPES.NEW_ENERGY:c.NUM_TYPES.UNKNOWN:c.NUM_TYPES.CIVIL:c.NUM_TYPES.UNKNOWN}Object.defineProperty(r,"__esModule",{value:!0}),r.keyOf=t,r.keyOfEnabled=_,r.keysOf=u,r.keyOfCode=o,r.contains=s,r.detectNumberTypeOf=a;var c=n(3)}]);
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化