From bb4914a6c3eb5116c54613b0217af5d126fbd781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AB=98=E5=9D=9A=E6=9E=9C?= <753610399@qq.com> Date: Tue, 23 Jun 2020 11:59:34 +0800 Subject: [PATCH] =?UTF-8?q?WebWorker=E5=85=BC=E5=AE=B9=E6=96=B0=E7=89=88Ch?= =?UTF-8?q?rome83=EF=BC=9A=E5=9C=A8file=E5=8D=8F=E8=AE=AE=E4=B8=8B?= =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=AB=8B=E5=8D=B3revokeObjectURL=EF=BC=8CWeb?= =?UTF-8?q?Worker=E5=B0=86=E6=97=A0=E6=B3=95=E6=AD=A3=E5=B8=B8=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/demo-vue/dist/index.js | 4 ++-- assets/npm-home/hash-history.txt | 8 ++++---- dist/engine/mp3.js | 2 +- recorder.mp3.min.js | 2 +- src/engine/mp3.js | 4 +++- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/assets/demo-vue/dist/index.js b/assets/demo-vue/dist/index.js index 9c1cce5..ea5e3ce 100644 --- a/assets/demo-vue/dist/index.js +++ b/assets/demo-vue/dist/index.js @@ -1,6 +1,6 @@ -!function(e){var t={};function n(r){if(t[r])return t[r].exports;var a=t[r]={i:r,l:!1,exports:{}};return e[r].call(a.exports,a,a.exports,n),a.l=!0,a.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)n.d(r,a,function(t){return e[t]}.bind(null,a));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";n.r(t);var r=n(1),a=n.n(r);for(var i in r)"default"!==i&&function(e){n.d(t,e,(function(){return r[e]}))}(i);t.default=a.a},function(e,t,n){"use strict";var r,a=n(5),i=(r=a)&&r.__esModule?r:{default:r};e.exports={data:function(){return{type:"mp3",bitRate:16,sampleRate:16e3,rec:0,duration:0,powerLevel:0,recOpenDialogShow:0,logs:[]}},methods:{recOpen:function(){var e=this,t=this.rec=(0,i.default)({type:e.type,bitRate:e.bitRate,sampleRate:e.sampleRate,onProcess:function(t,n,r,a){e.duration=r,e.powerLevel=n,e.wave.input(t[t.length-1],n,a)}});e.dialogInt=setTimeout((function(){e.showDialog()}),8e3),t.open((function(){e.dialogCancel(),e.reclog("已打开:"+e.type+" "+e.sampleRate+"hz "+e.bitRate+"kbps",2),e.wave=i.default.WaveView({elem:".ctrlProcessWave"})}),(function(t,n){e.dialogCancel(),e.reclog((n?"UserNotAllow,":"")+"打开失败:"+t,1)})),e.waitDialogClickFn=function(){e.dialogCancel(),e.reclog("打开失败:权限请求被忽略,用户主动点击的弹窗",1)}},recStart:function(){if(this.rec){this.rec.start();var e=this.rec.set;this.reclog("录制中:"+e.type+" "+e.sampleRate+"hz "+e.bitRate+"kbps")}else this.reclog("未打开录音",1)},recStop:function(){var e=this,t=e.rec;e.rec=null,t?t.stop((function(n,r){e.reclog("已录制:","",{blob:n,duration:r,rec:t})}),(function(t){e.reclog("结束出错:"+t,1)}),!0):e.reclog("未打开录音",1)},reclog:function(e,t,n){this.logs.splice(0,0,{idx:this.logs.length,msg:e,color:t,res:n,playMsg:"",down:0,down64Val:""})},recplay:function(e){var t=this,n=this.logs[this.logs.length-e-1];n.play=(n.play||0)+1;var r=function(e){n.playMsg=''+n.play+" "+t.getTime()+" "+e};r("");var a=this.$refs.LogAudioPlayer;a.controls=!0,a.ended||a.paused||a.pause(),a.onerror=function(e){r('播放失败['+a.error.code+"]"+a.error.message+"")},a.src=(window.URL||webkitURL).createObjectURL(n.res.blob),a.play()},recdown:function(e){var t=this.logs[this.logs.length-e-1];t.down=(t.down||0)+1;var n="rec-"+(t=t.res).duration+"ms-"+(t.rec.set.bitRate||"-")+"kbps-"+(t.rec.set.sampleRate||"-")+"hz."+(t.rec.set.type||(/\w+$/.exec(t.blob.type)||[])[0]||"unknown"),r=document.createElement("A");r.href=(window.URL||webkitURL).createObjectURL(t.blob),r.download=n,r.click()},recdown64:function(e){var t=this.logs[this.logs.length-e-1],n=new FileReader;n.onloadend=function(){t.down64Val=n.result},n.readAsDataURL(t.res.blob)},getTime:function(){var e=new Date;return("0"+e.getHours()).substr(-2)+":"+("0"+e.getMinutes()).substr(-2)+":"+("0"+e.getSeconds()).substr(-2)},intp:function(e,t){return(e=null==e?"-":e+"").length>=t?e:("_______"+e).substr(-t)},showDialog:function(){/mobile/i.test(navigator.userAgent)&&(this.recOpenDialogShow=1)},dialogCancel:function(){clearTimeout(this.dialogInt),this.recOpenDialogShow=0},waitDialogClick:function(){this.dialogCancel(),this.waitDialogClickFn()}}}},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);var a={insert:"head",singleton:!1};n(20)(r,a);r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";var r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main"},[e._t("top"),e._v(" "),n("div",{staticClass:"mainBox"},[n("div",[e._v("\r\n 类型:"+e._s(e.type)+"\r\n "),n("span",{staticStyle:{margin:"0 20px"}},[e._v("\r\n 比特率: "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.bitRate,expression:"bitRate"}],staticStyle:{width:"60px"},attrs:{type:"text"},domProps:{value:e.bitRate},on:{input:function(t){t.target.composing||(e.bitRate=t.target.value)}}}),e._v(" kbps\r\n ")]),e._v("\r\n 采样率: "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.sampleRate,expression:"sampleRate"}],staticStyle:{width:"60px"},attrs:{type:"text"},domProps:{value:e.sampleRate},on:{input:function(t){t.target.composing||(e.sampleRate=t.target.value)}}}),e._v(" hz\r\n ")]),e._v(" "),n("div",[n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recOpen}},[e._v("打开录音,请求权限")]),e._v(" "),n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recStart}},[e._v("开始录音")]),e._v(" "),n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recStop}},[e._v("结束录音,并释放资源")])])]),e._v(" "),n("div",{staticClass:"mainBox"},[n("div",{staticClass:"ctrlProcessWave",staticStyle:{height:"100px",width:"300px",border:"1px solid #ccc","box-sizing":"border-box",display:"inline-block","vertical-align":"bottom"}}),e._v(" "),n("div",{staticStyle:{height:"40px",width:"300px",display:"inline-block",background:"#999",position:"relative","vertical-align":"bottom"}},[n("div",{staticClass:"ctrlProcessX",staticStyle:{height:"40px",background:"#0B1",position:"absolute"},style:{width:e.powerLevel+"%"}}),e._v(" "),n("div",{staticClass:"ctrlProcessT",staticStyle:{"padding-left":"50px","line-height":"40px",position:"relative"}},[e._v(e._s(e.duration+"/"+e.powerLevel))])])]),e._v(" "),n("div",{staticClass:"mainBox"},[n("audio",{ref:"LogAudioPlayer",staticStyle:{width:"100%"}}),e._v(" "),n("div",{staticClass:"mainLog"},e._l(e.logs,(function(t){return n("div",{key:t.idx},[n("div",{style:{color:1==t.color?"red":2==t.color?"green":t.color}},[e._o(n("span",[e._v("["+e._s(e.getTime())+"]")]),0,t.idx),n("span",{domProps:{innerHTML:e._s(t.msg)}}),e._v(" "),t.res?[e._v("\r\n "+e._s(e.intp(t.res.rec.set.bitRate,3))+"kbps\r\n "+e._s(e.intp(t.res.rec.set.sampleRate,5))+"hz\r\n 编码"+e._s(e.intp(t.res.blob.size,6))+"b\r\n ["+e._s(t.res.rec.set.type)+"]"+e._s(e.intp(t.res.duration,6))+"ms \r\n \r\n "),n("button",{on:{click:function(n){return e.recdown(t.idx)}}},[e._v("下载")]),e._v(" "),n("button",{on:{click:function(n){return e.recplay(t.idx)}}},[e._v("播放")]),e._v(" "),n("span",{domProps:{innerHTML:e._s(t.playMsg)}}),e._v(" "),t.down?n("span",[n("span",{staticStyle:{color:"red"}},[e._v(e._s(t.down))]),e._v("\r\n \r\n 没弹下载?试一下链接或复制文本"),n("button",{on:{click:function(n){return e.recdown64(t.idx)}}},[e._v("生成Base64文本")]),e._v(" "),t.down64Val?n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.down64Val,expression:"obj.down64Val"}],domProps:{value:t.down64Val},on:{input:function(n){n.target.composing||e.$set(t,"down64Val",n.target.value)}}}):e._e()]):e._e()]:e._e()],2)])})),0)]),e._v(" "),e.recOpenDialogShow?n("div",{staticStyle:{"z-index":"99999",width:"100%",height:"100%",top:"0",left:"0",position:"fixed",background:"rgba(0,0,0,0.3)"}},[n("div",{staticStyle:{display:"flex",height:"100%","align-items":"center"}},[n("div",{staticStyle:{flex:"1"}}),e._v(" "),n("div",{staticStyle:{width:"240px",background:"#fff",padding:"15px 20px","border-radius":"10px"}},[n("div",{staticStyle:{"padding-bottom":"10px"}},[e._v("录音功能需要麦克风权限,请允许;如果未看到任何请求,请点击忽略~")]),e._v(" "),n("div",{staticStyle:{"text-align":"center"}},[n("a",{staticStyle:{color:"#0B1"},on:{click:e.waitDialogClick}},[e._v("忽略")])])]),e._v(" "),n("div",{staticStyle:{flex:"1"}})])]):e._e(),e._v(" "),e._t("bottom")],2)},a=[];r._withStripped=!0,n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}))},function(e,t,n){"use strict";(function(e){var r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){var t=function(){},n=function(e){return new i(e)};n.IsOpen=function(){var e=n.Stream;if(e){var t=(e.getTracks&&e.getTracks()||e.audioTracks||[])[0];if(t){var r=t.readyState;return"live"==r||r==t.LIVE}}return!1},n.BufferSize=4096,n.Destroy=function(){for(var e in console.log("Recorder Destroy"),r)r[e]()};var r={};n.BindDestroy=function(e,t){r[e]=t},n.Support=function(){var t=e.AudioContext;if(t||(t=e.webkitAudioContext),!t)return!1;var r=navigator.mediaDevices||{};return r.getUserMedia||(r=navigator).getUserMedia||(r.getUserMedia=r.webkitGetUserMedia||r.mozGetUserMedia||r.msGetUserMedia),!!r.getUserMedia&&(n.Scope=r,n.Ctx&&"closed"!=n.Ctx.state||(n.Ctx=new t,n.BindDestroy("Ctx",(function(){var e=n.Ctx;e&&e.close&&e.close()}))),!0)},n.SampleData=function(e,t,n,r,a){r||(r={});var i=r.index||0,s=r.offset||0,o=r.frameNext||[];a||(a={});var l=a.frameSize||1;a.frameType&&(l="mp3"==a.frameType?1152:1);for(var c=0,f=i;f1?c=Math.floor(c/u):(u=1,n=t),c+=o.length;var _=new Int16Array(c),p=0;for(f=0;f0){var w=2*(_.length-y);o=new Int16Array(_.buffer.slice(w)),_=new Int16Array(_.buffer.slice(0,w))}return{index:i,offset:s,frameNext:o,sampleRate:n,data:_}};var a=0;function i(e){this.id=++a,n.Traffic&&n.Traffic();var r={type:"mp3",bitRate:16,sampleRate:16e3,onProcess:t};for(var i in e)r[i]=e[i];this.set=r,this._S=9}n.Sync={O:9,C:9},n.prototype=i.prototype={open:function(r,a){var i=this;r=r||t,a=a||t;var s=function(){r(),i._SO=0},o=function(t,n){/Permission|Allow/i.test(t)?a("用户拒绝了录音权限",!0):!1===e.isSecureContext?a("无权录音(需https)"):/Found/i.test(t)?a(n+",无可用麦克风"):a(n)},l=n.Sync,c=++l.O,f=l.C;i._O=i._O_=c,i._SO=i._S;var u=function(){if(f!=l.C||!i._O){var e="open被取消";return c==l.O?i.close():e="open被中断",a(e),!0}};if(n.IsOpen())s();else if(n.Support()){var _=function(e){n.Stream=e,e._call={},u()||setTimeout((function(){u()||(n.IsOpen()?(function(){var e=n.Ctx,t=n.Stream,r=t._m=e.createMediaStreamSource(t),a=t._p=(e.createScriptProcessor||e.createJavaScriptNode).call(e,n.BufferSize,1,1);r.connect(a),a.connect(e.destination);var i=t._call;a.onaudioprocess=function(e){for(var t in i){for(var n=e.inputBuffer.getChannelData(0),r=n.length,a=new Int16Array(r),s=0,o=0;o3e3){p.length=v;break}h=m.t,d+=m.d}var b=p[1],g=u-h;if(g-d>g/3&&(b&&g>1e3||p.length>=6)){var y=u-b.t-_;if(y>_/5){var w=!r.disableEnvInFix;if(console.warn("["+u+"]"+(w?"":"未")+"补偿"+y+"ms"),this.envInFix+=y,w){var S=new Int16Array(y*c/1e3);this.recSize+=S.length,s.push(S)}}}if(a){var x=n.SampleData(s,c,r.sampleRate,a.chunkInfo);a.chunkInfo=x,a.pcmSize+=x.data.length,f=a.pcmSize,(s=a.pcmDatas).push(x.data),c=x.sampleRate,this[r.type+"_encode"](a,x.data)}var A=Math.round(f/c*1e3);r.onProcess(s,o,A,c)},start:function(){if(n.IsOpen()){console.log("["+Date.now()+"]Start");var e=this,t=(e.set,n.Ctx);if(e._stop(),e.state=0,e.envStart(0,t.sampleRate),e._SO&&e._SO+1!=e._S)console.warn("start被中断");else{e._SO=0;var r=function(){e.state=1,e.resume()};"suspended"==t.state?t.resume().then((function(){console.log("ctx resume"),r()})):r()}}else console.error("未open")},pause:function(){this.state&&(this.state=2,delete n.Stream._call[this.id])},resume:function(){var e=this;e.state&&(e.state=1,e.envResume(),n.Stream._call[e.id]=function(t,n){1==e.state&&e.envIn(t,n)})},_stop:function(e){var t=this.set;this.isMock||this._S++,this.state&&(this.pause(),this.state=0),!e&&this[t.type+"_stop"]&&(this[t.type+"_stop"](this.engineCtx),this.engineCtx=0)},stop:function(e,t,r){var a,i=this,s=i.set;console.log("["+Date.now()+"]Stop "+(i.envInLast?i.envInLast-i.envInFirst+"ms 补"+i.envInFix+"ms":"-"));var o=function(){i._stop(),r&&i.close()},l=function(e){t&&t(e),o()},c=function(t,n){console.log("["+Date.now()+"]结束 编码"+(Date.now()-a)+"ms 音频"+n+"ms/"+t.size+"b"),t.size"+h.length+" 花:"+(Date.now()-a)+"ms"),setTimeout((function(){a=Date.now(),i[s.type](h,(function(e){c(e,_)}),(function(e){l(e)}))}))}else l("未加载"+s.type+"编码器");else l("音频被释放");else l("未采集到录音")}},e.Recorder&&e.Recorder.Destroy(),e.Recorder=n,n.LM="2019-11-7 21:47:48",n.TrafficImgUrl="//ia.51.la/go1?id=20469973&pvFlag=1",n.Traffic=function(){var e=n.TrafficImgUrl;if(e){var t=n.Traffic,r=location.href.replace(/#.*/,"");t[r]||(t[r]=1,(new Image).src=e,console.log("Traffic Analysis Image: Recorder.TrafficImgUrl="+e))}}}(window),void 0===(r=function(){return Recorder}.call(t,n,t,e))||(e.exports=r),"object"==a(e)&&e.exports&&(e.exports=Recorder)}).call(this,n(8)(e))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):a&&(l=o?function(){a.call(this,this.$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var f=c.render;c.render=function(e,t){return l.call(t),f(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=s(n(5));n(9),n(10),n(11);var a=s(n(12)),i=s(n(16));function s(e){return e&&e.__esModule?e:{default:e}}var o=new a.default({el:".rootView",data:{Rec:r.default},components:{MainView:i.default},template:'\n\n \n\n \n\n '}),l=o.$refs.mainView;l.reclog('绿油油的一大片,真有食欲'+unescape("%uD83D%uDE02")+' 当前浏览器支持录音':'red">不支持录音')+"");var c=function(e,t){l.reclog(''+e+": "+t+"")};c("Vue",a.default.version),c("UA",navigator.userAgent),c("URL",location.href.replace(/#.*/g,"")),l.reclog("点击打开录音,然后再点击开始录音",2),window.vue_root=o,window.vue_main=l,console.log("Vue",a.default),console.log("Recorder",r.default)},function(e,t,n){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";!function(){var e;Recorder.prototype.enc_mp3={stable:!0,testmsg:"采样率范围48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000"},Recorder.prototype.mp3=function(e,t,a){var i=this.set,s=e.length,o=this.mp3_start(i);if(o)return this.mp3_encode(o,e),void this.mp3_complete(o,t,a,1);var l=new Recorder.lamejs.Mp3Encoder(1,i.sampleRate,i.bitRate),c=[],f=0,u=0;!function a(){if(f0&&(u+=o.buffer.byteLength,c.push(o.buffer)),f+=57600,setTimeout(a)}else{var o;(o=l.flush()).length>0&&(u+=o.buffer.byteLength,c.push(o.buffer));var _=n.fn(c,u,s,i.sampleRate);r(_,i),t(new Blob(c,{type:"audio/mp3"}))}}()},Recorder.BindDestroy("mp3Worker",(function(){console.log("mp3Worker Destroy"),e&&e.terminate(),e=null}));var t={id:0};Recorder.prototype.mp3_start=function(r){var a=e;try{if(!a){var i=");wk_lame();var wk_ctxs={};self.onmessage="+function(e){var t=e.data,n=wk_ctxs[t.id];if("init"==t.action)wk_ctxs[t.id]={sampleRate:t.sampleRate,bitRate:t.bitRate,mp3Size:0,pcmSize:0,encArr:[],encObj:new wk_lame.Mp3Encoder(1,t.sampleRate,t.bitRate)};else if(!n)return;switch(t.action){case"stop":n.encObj=null,delete wk_ctxs[t.id];break;case"encode":n.pcmSize+=t.pcm.length,(r=n.encObj.encodeBuffer(t.pcm)).length>0&&(n.mp3Size+=r.buffer.byteLength,n.encArr.push(r.buffer));break;case"complete":var r;(r=n.encObj.flush()).length>0&&(n.mp3Size+=r.buffer.byteLength,n.encArr.push(r.buffer));var a=wk_mp3TrimFix.fn(n.encArr,n.mp3Size,n.pcmSize,n.sampleRate);self.postMessage({action:t.action,id:t.id,blob:new Blob(n.encArr,{type:"audio/mp3"}),meta:a})}};i+=";var wk_mp3TrimFix={rm:"+n.rm+",fn:"+n.fn+"}";var s=Recorder.lamejs.toString(),o=(window.URL||webkitURL).createObjectURL(new Blob(["var wk_lame=(",s,i],{type:"text/javascript"}));a=new Worker(o),(window.URL||webkitURL).revokeObjectURL(o),a.onmessage=function(e){var n=t[e.data.id];n&&(n.call&&n.call(e.data),n.call=null)}}var l={worker:a,set:r};return l.id=++t.id,t[l.id]=l,a.postMessage({action:"init",id:l.id,sampleRate:r.sampleRate,bitRate:r.bitRate,x:new Int16Array(5)}),e=a,l}catch(e){return a&&a.terminate(),console.error(e),null}},Recorder.prototype.mp3_stop=function(e){if(e&&e.worker){e.worker.postMessage({action:"stop",id:e.id}),e.worker=null,delete t[e.id];var n=-1;for(var r in t)n++;n&&console.warn("mp3 worker剩"+n+"个在串行等待")}},Recorder.prototype.mp3_encode=function(e,t){e&&e.worker&&e.worker.postMessage({action:"encode",id:e.id,pcm:t})},Recorder.prototype.mp3_complete=function(e,t,n,a){var i=this;e&&e.worker?(e.call=function(n){r(n.meta,e.set),t(n.blob),a&&i.mp3_stop(e)},e.worker.postMessage({action:"complete",id:e.id})):n("mp3编码器未打开")},Recorder.mp3ReadMeta=function(e,t){var n=new Uint8Array(e[0]||[]);if(n.length<4)return null;var r=function(e,t){return("0000000"+((t||n)[e]||0).toString(2)).substr(-8)},a=r(0)+r(1),i=r(2)+r(3);if(!/^1{11}/.test(a))return null;var s={"00":2.5,10:2,11:1}[a.substr(11,2)],o={"01":3}[a.substr(13,2)],l={1:[44100,48e3,32e3],2:[22050,24e3,16e3],2.5:[11025,12e3,8e3]}[s];l&&(l=l[parseInt(i.substr(4,2),2)]);var c=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320]][1==s?1:0][parseInt(i.substr(0,4),2)];if(!(s&&o&&c&&l))return null;for(var f=Math.round(8*t/c),u=1==o?384:2==o?1152:1==s?1152:576,_=u/l*1e3,p=Math.floor(u*c/8/l*1e3),h=0,d=0,v=0;v=p+3){var b=new Uint8Array(m);h="1"==r(m.byteLength-(d-(p+3)+1),b).charAt(6);break}}return h&&p++,{version:s,layer:o,sampleRate:l,bitRate:c,duration:f,size:t,hasPadding:h,frameSize:p,frameDurationFloat:_}};var n={rm:Recorder.mp3ReadMeta,fn:function(e,t,n,r){var a=this.rm(e,t);if(!a)return{err:"mp3非预定格式"};var i=Math.round(n/r*1e3),s=Math.floor((a.duration-i)/a.frameDurationFloat);if(s>0){var o=s*a.frameSize-(a.hasPadding?1:0);t-=o;for(var l=0,c=[],f=0;f=u.byteLength?(o-=u.byteLength,c.push(u),e.splice(f,1),f--):(e[f]=u.slice(o),l=u,o=0)}if(!this.rm(e,t)){l&&(e[0]=l);for(f=0;f "+r.duration+"ms",r.remove>2&&(e.err=(e.err?e.err+", ":"")+"移除帧数过多")):n+=(e.duration||"-")+"ms",e.err?console.error(n,e.err,e):console.log(n,e)}}()},function(e,t,n){"use strict";!function(){function e(){var t=function(e){return Math.log(e)/Math.log(10)};function n(e){return new Int8Array(e)}function r(e){return new Int16Array(e)}function a(e){return new Int32Array(e)}function i(e){return new Float32Array(e)}function s(e){return new Float64Array(e)}function o(e){if(1==e.length)return i(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r>=1;0!=e--;)a[i++]=s>n[r++]?0:1,a[i++]=s>n[r++]?0:1}function i(t,n,r,a,i,s){var o=(t>>=1)%2;for(t>>=1;0!=t--;){var l,c,f,u,_,p,h,d;l=r[a++]*n,c=r[a++]*n,_=0|l,f=r[a++]*n,p=0|c,u=r[a++]*n,h=0|f,l+=e.adj43[_],d=0|u,c+=e.adj43[p],i[s++]=0|l,f+=e.adj43[h],i[s++]=0|c,u+=e.adj43[d],i[s++]=0|f,i[s++]=0|u}0!=o&&(_=0|(l=r[a++]*n),p=0|(c=r[a++]*n),l+=e.adj43[_],c+=e.adj43[p],i[s++]=0|l,i[s++]=0|c)}var s=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function o(e,t,n,r){var a=function(e,t,n){var r=0,a=0;do{var i=e[t++],s=e[t++];r>=16)>i&&(o=i,r++),a.bits+=o,r}(e,t,n,s[a-1],r);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,n,r,a){var i=0,s=0,o=0,l=k.ht[r].xlen,c=k.ht[r].hlen,f=k.ht[r+1].hlen,u=k.ht[r+2].hlen;do{var _=e[t+0]*l+e[t+1];t+=2,i+=c[_],s+=f[_],o+=u[_]}while(ts&&(i=s,p++),i>o&&(i=o,p=r+2),a.bits+=i,p}(e,t,n,s[a-1],r);default:if(a>L.IXMAX_VAL)return r.bits=L.LARGE_BITS,-1;var i,o;for(a-=15,i=24;i<32&&!(k.ht[i].linmax>=a);i++);for(o=i-8;o<24&&!(k.ht[o].linmax>=a);o++);return function(e,t,n,r,a,i){var s,o=65536*k.ht[r].xlen+k.ht[a].xlen,l=0;do{var c=e[t++],f=e[t++];0!=c&&(c>14&&(c=15,l+=o),c*=16),0!=f&&(f>14&&(f=15,l+=o),c+=f),l+=k.largetbl[c]}while(t>=16)>s&&(l=s,r=a),i.bits+=l,r}(e,t,n,o,i,r)}}function l(e,n,r,a,i,s,l,c){for(var f=n.big_values,u=2;u=f)break;var p=i[u-2]+n.count1bits;if(r.part2_3_length<=p)break;var h=new t(p),d=o(a,_,f,h);p=h.bits,r.part2_3_length<=p||(r.assign(n),r.part2_3_length=p,r.region0_count=s[u-2],r.region1_count=u-2-s[u-2],r.table_select[0]=l[u-2],r.table_select[1]=c[u-2],r.table_select[2]=d)}}this.noquant_count_bits=function(e,n,r){var a=n.l3_enc,i=Math.min(576,n.max_nonzero_coeff+2>>1<<1);for(null!=r&&(r.sfb_count1=0);i>1&&0==(a[i-1]|a[i-2]);i-=2);n.count1=i;for(var s=0,l=0;i>3;i-=4){var c;if((2147483647&(a[i-1]|a[i-2]|a[i-3]|a[i-4]))>1)break;c=2*(2*(2*a[i-4]+a[i-3])+a[i-2])+a[i-1],s+=k.t32l[c],l+=k.t33l[c]}var f=s;if(n.count1table_select=0,s>l&&(f=l,n.count1table_select=1),n.count1bits=f,n.big_values=i,0==i)return f;if(n.block_type==F.SHORT_TYPE)(s=3*e.scalefac_band.s[3])>n.big_values&&(s=n.big_values),l=n.big_values;else if(n.block_type==F.NORM_TYPE){if(s=n.region0_count=e.bv_scf[i-2],l=n.region1_count=e.bv_scf[i-1],l=e.scalefac_band.l[s+l+2],s=e.scalefac_band.l[s+1],l(l=i)&&(s=l);if(s=Math.min(s,i),l=Math.min(l,i),0l)return L.LARGE_BITS;if(function(t,n,a,s,o){var l,c,f,_=0,p=0,h=0,d=0,v=n,m=0,b=v,g=0,y=t,w=0;for(f=null!=o&&s.global_gain==o.global_gain,c=s.block_type==F.SHORT_TYPE?38:21,l=0;l<=c;l++){var S=-1;if((f||s.block_type==F.NORM_TYPE)&&(S=s.global_gain-(s.scalefac[l]+(0!=s.preflag?e.pretab[l]:0)<s.max_nonzero_coeff)x=s.max_nonzero_coeff-_+1,u.fill(n,s.max_nonzero_coeff,576,0),(A=x)<0&&(A=0),l=c+1;if(0==p&&0==h&&(b=v,g=m,y=t,w=d),null!=o&&o.sfb_count1>0&&l>=o.sfb_count1&&o.step[l]>0&&S>=o.step[l]?(0!=p&&(i(p,a,y,w,b,g),p=0,b=v,g=m,y=t,w=d),h+=A):(0!=h&&(r(h,a,y,w,b,g),h=0,b=v,g=m,y=t,w=d),p+=A),A<=0){0!=h&&(r(h,a,y,w,b,g),h=0),0!=p&&(i(p,a,y,w,b,g),p=0);break}}l<=c&&(m+=s.width[l],d+=s.width[l],_+=s.width[l])}0!=p&&(i(p,a,y,w,b,g),p=0),0!=h&&(r(h,a,y,w,b,g),h=0)}(n,o,e.IPOW20(a.global_gain),a,s),0!=(2&t.substep_shaping))for(var c=0,f=a.global_gain+a.scalefac_scale,_=.634521682242439/e.IPOW20(f),p=0;p=_?o[h]:0}return this.noquant_count_bits(t,a,s)},this.best_huffman_divide=function(e,n){var r=new N,i=n.l3_enc,s=a(23),c=a(23),f=a(23),u=a(23);if(n.block_type!=F.SHORT_TYPE||1!=e.mode_gr){r.assign(n),n.block_type==F.NORM_TYPE&&(!function(e,n,r,a,i,s,l){for(var c=n.big_values,f=0;f<=22;f++)a[f]=L.LARGE_BITS;for(f=0;f<16;f++){var u=e.scalefac_band.l[f+1];if(u>=c)break;var _=0,p=new t(_),h=o(r,0,u,p);_=p.bits;for(var d=0;d<8;d++){var v=e.scalefac_band.l[f+d+2];if(v>=c)break;var m=_,b=o(r,u,v,p=new t(m));m=p.bits,a[f+d]>m&&(a[f+d]=m,i[f+d]=f,s[f+d]=h,l[f+d]=b)}}}(e,n,i,s,c,f,u),l(e,r,n,i,s,c,f,u));var _=r.big_values;if(!(0==_||(i[_-2]|i[_-1])>1||(_=n.count1+2)>576)){r.assign(n),r.count1=_;for(var p=0,h=0;_>r.big_values;_-=4){var d=2*(2*(2*i[_-4]+i[_-3])+i[_-2])+i[_-1];p+=k.t32l[d],h+=k.t33l[d]}if(r.big_values=_,r.count1table_select=0,p>h&&(p=h,r.count1table_select=1),r.count1bits=p,r.block_type==F.NORM_TYPE)l(e,r,n,i,s,c,f,u);else{if(r.part2_3_length=p,(p=e.scalefac_band.l[8])>_&&(p=_),p>0){var v=new t(r.part2_3_length);r.table_select[0]=o(i,0,p,v),r.part2_3_length=v.bits}if(_>p){v=new t(r.part2_3_length);r.table_select[1]=o(i,p,_,v),r.part2_3_length=v.bits}n.part2_3_length>r.part2_3_length&&n.assign(r)}}}};var c=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],f=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],p=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],h=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];g.slen1_tab=p,g.slen2_tab=h,this.best_scalefac_store=function(t,n,r,a){var i,s,o,l,u=a.tt[n][r],_=0;for(o=0,i=0;i0&&(v|=u.scalefac[i]);if(0==(1&v)&&0!=v){for(i=0;i0&&(u.scalefac[i]>>=1);u.scalefac_scale=_=1}}if(0==u.preflag&&u.block_type!=F.SHORT_TYPE&&2==t.mode_gr){for(i=11;i0&&(u.scalefac[i]-=e.pretab[i]);u.preflag=_=1}}for(s=0;s<4;s++)a.scfsi[r][s]=0;for(2==t.mode_gr&&1==n&&a.tt[0][r].block_type!=F.SHORT_TYPE&&a.tt[1][r].block_type!=F.SHORT_TYPE&&(!function(e,t){for(var n,r=t.tt[1][e],a=t.tt[0][e],i=0;i=0);n++);if(n==k.scfsi_band[i+1]){for(n=k.scfsi_band[i];n_&&(r.part2_length=_,r.scalefac_compress=i)}}(r,a),_=0),i=0;ia[n]&&(t.part2_length=a[n],t.scalefac_compress=n);return t.part2_length==L.LARGE_BITS};var b=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(t,n){var r,i,s,o,l,c,f,u,p=a(4),h=n.scalefac;for(r=0!=n.preflag?2:0,f=0;f<4;f++)p[f]=0;if(n.block_type==F.SHORT_TYPE){i=1;var d=e.nr_of_sfb_block[r][i];for(u=0,s=0;s<4;s++)for(o=d[s]/3,f=0;fp[s]&&(p[s]=h[3*u+l])}else{i=0;d=e.nr_of_sfb_block[r][i];for(u=0,s=0;s<4;s++)for(o=d[s],f=0;fp[s]&&(p[s]=h[u])}for(c=!1,s=0;s<4;s++)p[s]>b[r][s]&&(c=!0);if(!c){var v,m,g,w;for(n.sfb_partition_table=e.nr_of_sfb_block[r][i],s=0;s<4;s++)n.slen[s]=y[p[s]];switch(v=n.slen[0],m=n.slen[1],g=n.slen[2],w=n.slen[3],r){case 0:n.scalefac_compress=(5*v+m<<4)+(g<<2)+w;break;case 1:n.scalefac_compress=400+(5*v+m<<2)+g;break;case 2:n.scalefac_compress=500+3*v+m;break;default:_.err.printf("intensity stereo not implemented yet\n")}}if(!c)for(n.part2_length=0,s=0;s<4;s++)n.part2_length+=n.slen[s]*n.sfb_partition_table[s];return c};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var r,a=0;e.scalefac_band.l[++a]t;)r--;for(r<0&&(r=n[a][0]),e.bv_scf[t-2]=r,r=n[a][1];e.scalefac_band.l[r+e.bv_scf[t-2]+2]>t;)r--;r<0&&(r=n[a][1]),e.bv_scf[t-1]=r}}}function y(){}function w(){function e(e,t,n,r,a,i,s,o,l,c,f,u,_,p,h){this.vbr_q=e,this.quant_comp=t,this.quant_comp_s=n,this.expY=r,this.st_lrm=a,this.st_s=i,this.masking_adj=s,this.masking_adj_short=o,this.ath_lower=l,this.ath_curve=c,this.ath_sensitivity=f,this.interch=u,this.safejoint=_,this.sfb21mod=p,this.msfix=h}function t(e,t,n,r,a,i,s,o,l,c,f,u,_,p){this.quant_comp=t,this.quant_comp_s=n,this.safejoint=r,this.nsmsfix=a,this.st_lrm=i,this.st_s=s,this.nsbass=o,this.scale=l,this.masking_adj=c,this.ath_lower=f,this.ath_curve=u,this.interch=_,this.sfscale=p}var n;this.setModules=function(e){n=e};var r=[new e(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new e(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new e(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new e(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new e(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new e(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new e(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new e(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new e(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],a=[new e(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new e(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new e(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new e(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new e(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new e(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new e(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new e(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new e(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function i(e,t,n){var i=e.VBR==v.vbr_rh?r:a,s=e.VBR_q_frac,o=i[t],l=i[t+1],c=o;o.st_lrm=o.st_lrm+s*(l.st_lrm-o.st_lrm),o.st_s=o.st_s+s*(l.st_s-o.st_s),o.masking_adj=o.masking_adj+s*(l.masking_adj-o.masking_adj),o.masking_adj_short=o.masking_adj_short+s*(l.masking_adj_short-o.masking_adj_short),o.ath_lower=o.ath_lower+s*(l.ath_lower-o.ath_lower),o.ath_curve=o.ath_curve+s*(l.ath_curve-o.ath_curve),o.ath_sensitivity=o.ath_sensitivity+s*(l.ath_sensitivity-o.ath_sensitivity),o.interch=o.interch+s*(l.interch-o.interch),o.msfix=o.msfix+s*(l.msfix-o.msfix),function(e,t){var n=0;0>t&&(n=-1,t=0);90||(e.quant_comp=c.quant_comp),0!=n?e.quant_comp_short=c.quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=c.quant_comp_s),0!=c.expY&&(e.experimentalY=0!=c.expY),0!=n?e.internal_flags.nsPsy.attackthre=c.st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=c.st_lrm),0!=n?e.internal_flags.nsPsy.attackthre_s=c.st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=c.st_s),0!=n?e.maskingadjust=c.masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=c.masking_adj),0!=n?e.maskingadjust_short=c.masking_adj_short:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=c.masking_adj_short),0!=n?e.ATHlower=-c.ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-c.ath_lower/10),0!=n?e.ATHcurve=c.ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=c.ath_curve),0!=n?e.athaa_sensitivity=c.ath_sensitivity:Math.abs(e.athaa_sensitivity- -1)>0||(e.athaa_sensitivity=c.ath_sensitivity),c.interch>0&&(0!=n?e.interChRatio=c.interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=c.interch)),c.safejoint>0&&(e.exp_nspsytune=e.exp_nspsytune|c.safejoint),c.sfb21mod>0&&(e.exp_nspsytune=e.exp_nspsytune|c.sfb21mod<<20),0!=n?e.msfix=c.msfix:Math.abs(e.msfix- -1)>0||(e.msfix=c.msfix),0==n&&(e.VBR_q=t,e.VBR_q_frac=s)}var s=[new t(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new t(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new t(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new t(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new t(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new t(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new t(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new t(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new t(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new t(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new t(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new t(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new t(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new t(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new t(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function o(e,t,r){var a=t,i=n.nearestBitrateFullIndex(t);if(e.VBR=v.vbr_abr,e.VBR_mean_bitrate_kbps=a,e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320),e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.brate=e.VBR_mean_bitrate_kbps,e.VBR_mean_bitrate_kbps>320&&(e.disable_reservoir=!0),s[i].safejoint>0&&(e.exp_nspsytune=2|e.exp_nspsytune),s[i].sfscale>0&&(e.internal_flags.noise_shaping=2),Math.abs(s[i].nsbass)>0){var o=int(4*s[i].nsbass);o<0&&(o+=64),e.exp_nspsytune=e.exp_nspsytune|o<<2}return 0!=r?e.quant_comp=s[i].quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=s[i].quant_comp),0!=r?e.quant_comp_short=s[i].quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=s[i].quant_comp_s),0!=r?e.msfix=s[i].nsmsfix:Math.abs(e.msfix- -1)>0||(e.msfix=s[i].nsmsfix),0!=r?e.internal_flags.nsPsy.attackthre=s[i].st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=s[i].st_lrm),0!=r?e.internal_flags.nsPsy.attackthre_s=s[i].st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=s[i].st_s),0!=r?e.scale=s[i].scale:Math.abs(e.scale- -1)>0||(e.scale=s[i].scale),0!=r?e.maskingadjust=s[i].masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=s[i].masking_adj),s[i].masking_adj>0?0!=r?e.maskingadjust_short=.9*s[i].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=.9*s[i].masking_adj):0!=r?e.maskingadjust_short=1.1*s[i].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=1.1*s[i].masking_adj),0!=r?e.ATHlower=-s[i].ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-s[i].ath_lower/10),0!=r?e.ATHcurve=s[i].ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=s[i].ath_curve),0!=r?e.interChRatio=s[i].interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=s[i].interch),t}this.apply_preset=function(e,t,n){switch(t){case G.R3MIX:t=G.V3,e.VBR=v.vbr_mtrh;break;case G.MEDIUM:t=G.V4,e.VBR=v.vbr_rh;break;case G.MEDIUM_FAST:t=G.V4,e.VBR=v.vbr_mtrh;break;case G.STANDARD:t=G.V2,e.VBR=v.vbr_rh;break;case G.STANDARD_FAST:t=G.V2,e.VBR=v.vbr_mtrh;break;case G.EXTREME:t=G.V0,e.VBR=v.vbr_rh;break;case G.EXTREME_FAST:t=G.V0,e.VBR=v.vbr_mtrh;break;case G.INSANE:return t=320,e.preset=t,o(e,t,n),e.VBR=v.vbr_off,t}switch(e.preset=t,t){case G.V9:return i(e,9,n),t;case G.V8:return i(e,8,n),t;case G.V7:return i(e,7,n),t;case G.V6:return i(e,6,n),t;case G.V5:return i(e,5,n),t;case G.V4:return i(e,4,n),t;case G.V3:return i(e,3,n),t;case G.V2:return i(e,2,n),t;case G.V1:return i(e,1,n),t;case G.V0:return i(e,0,n),t}return 8<=t&&t<=320?o(e,t,n):(e.preset=0,t)}}function S(){var e;this.setModules=function(t){e=t},this.ResvFrameBegin=function(t,n){var r,a=t.internal_flags,i=a.l3_side,s=e.getframebits(t);n.bits=(s-8*a.sideinfo_len)/a.mode_gr;var o=2048*a.mode_gr-8;t.brate>320?r=8*int(1e3*t.brate/(t.out_samplerate/1152)/8+.5):(r=11520,t.strict_ISO&&(r=8*int(32e4/(t.out_samplerate/1152)/8+.5))),a.ResvMax=r-s,a.ResvMax>o&&(a.ResvMax=o),(a.ResvMax<0||t.disable_reservoir)&&(a.ResvMax=0);var l=n.bits*a.mode_gr+Math.min(a.ResvSize,a.ResvMax);return l>r&&(l=r),i.resvDrain_pre=0,null!=a.pinfo&&(a.pinfo.mean_bits=n.bits/2,a.pinfo.resvsize=a.ResvSize),l},this.ResvMaxBits=function(e,t,n,r){var a,i=e.internal_flags,s=i.ResvSize,o=i.ResvMax;0!=r&&(s+=t),0!=(1&i.substep_shaping)&&(o*=.9),n.bits=t,10*s>9*o?(a=s-9*o/10,n.bits+=a,i.substep_shaping|=128):(a=0,i.substep_shaping&=127,e.disable_reservoir||0!=(1&i.substep_shaping)||(n.bits-=.1*t));var l=s<6*i.ResvMax/10?s:6*i.ResvMax/10;return(l-=a)<0&&(l=0),l},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var n,r=e.l3_side;e.ResvSize+=t*e.mode_gr;var a=0;r.resvDrain_post=0,r.resvDrain_pre=0,0!=(n=e.ResvSize%8)&&(a+=n),(n=e.ResvSize-a-e.ResvMax)>0&&(a+=n);var i=Math.min(8*r.main_data_begin,a)/8;r.resvDrain_pre+=8*i,a-=8*i,e.ResvSize-=8*i,r.main_data_begin-=i,r.resvDrain_post+=a,e.ResvSize-=a}}function x(){this.setModules=function(e,t,n){e,t,n};var e=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function t(t,n){return n=n>>8^e[255&(n^t)]}this.updateMusicCRC=function(e,n,r,a){for(var i=0;i0;){var r;0==d&&(d=8,h++,e.header[e.w_ptr].write_timing==p&&v(e),f[h]=0),n-=r=Math.min(n,d),d-=r,f[h]|=t>>n<0;){var r;0==d&&(d=8,h++,f[h]=0),n-=r=Math.min(n,d),d-=r,f[h]|=t>>n<=8&&(m(r,76,8),t-=8),t>=8&&(m(r,65,8),t-=8),t>=8&&(m(r,77,8),t-=8),t>=8&&(m(r,69,8),t-=8),t>=32){var a=l.getLameShortVersion();if(t>=32)for(n=0;n=8;++n)t-=8,m(r,a.charCodeAt(n),8)}for(;t>=1;t-=1)m(r,r.ancillary_flag,1),r.ancillary_flag^=e.disable_reservoir?0:1}function S(e,t,n){for(var r=e.header[e.h_ptr].ptr;n>0;){var a=Math.min(n,8-(7&r));n-=a,e.header[e.h_ptr].buf[r>>3]|=t>>n<<8-(7&r)-a,r+=a}e.header[e.h_ptr].ptr=r}function x(e,t){e<<=8;for(var n=0;n<8;n++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=r);return t}function A(e,t){var n,r=k.ht[t.count1table_select+32],a=0,i=t.big_values,s=t.big_values;for(n=(t.count1-t.big_values)/4;n>0;--n){var o=0,l=0;0!=t.l3_enc[i+0]&&(l+=8,t.xr[s+0]<0&&o++),0!=t.l3_enc[i+1]&&(l+=4,o*=2,t.xr[s+1]<0&&o++),0!=t.l3_enc[i+2]&&(l+=2,o*=2,t.xr[s+2]<0&&o++),0!=t.l3_enc[i+3]&&(l++,o*=2,t.xr[s+3]<0&&o++),i+=4,s+=4,m(e,o+r.table[l],r.hlen[l]),a+=r.hlen[l]}return a}function M(e,t,n,r,a){var i=k.ht[t],s=0;if(0==t)return s;for(var o=n;o15){if(p>14)_|=p-15<<1,c=f,p=15;if(h>14)_<<=f,_|=h-15,c+=f,h=15;u=16}0!=h&&(_<<=1,a.xr[o+1]<0&&_++,l--),p=p*u+h,c-=l,l+=i.hlen[p],m(e,i.table[p],l),m(e,_,c),s+=l+c}return s}function T(e,t){var n=3*e.scalefac_band.s[3];n>t.big_values&&(n=t.big_values);var r=M(e,t.table_select[0],0,n,t);return r+=M(e,t.table_select[1],n,t.big_values,t)}function R(e,t){var n,r,a,i;n=t.big_values;var s=t.region0_count+1;return a=e.scalefac_band.l[s],s+=t.region1_count+1,a>n&&(a=n),(i=e.scalefac_band.l[s])>n&&(i=n),r=M(e,t.table_select[0],0,a,t),r+=M(e,t.table_select[1],a,i,t),r+=M(e,t.table_select[2],i,n,t)}function B(){this.total=0}function E(t,n){var r,a,i,s,o,l=t.internal_flags;return o=l.w_ptr,-1==(s=l.h_ptr-1)&&(s=U.MAX_HEADER_BUF-1),r=l.header[s].write_timing-p,n.total=r,r>=0&&(a=1+s-o,s>8),t[5]=byte(255&n)},this.flush_bitstream=function(e){var n,r,a=e.internal_flags,s=a.h_ptr-1;if(-1==s&&(s=U.MAX_HEADER_BUF-1),n=a.l3_side,!((r=E(e,new B))<0)){if(w(e,r),a.ResvSize=0,n.main_data_begin=0,a.findReplayGain){var o=i.GetTitleGain(a.rgdata);a.RadioGain=0|Math.floor(10*o+.5)}a.findPeakSample&&(a.noclipGainChange=0|Math.ceil(20*t(a.PeakSample/32767)*10),a.noclipGainChange>0&&(EQ(e.scale,1)||EQ(e.scale,0))?a.noclipScale=Math.floor(32767/a.PeakSample*100)/100:a.noclipScale=-1)}},this.add_dummy_byte=function(e,t,n){for(var r,a=e.internal_flags;n-- >0;)for(b(0,t,8),r=0;r ResvSize"),8*t.main_data_begin!=n.ResvSize&&(_.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,n.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*n.sideinfo_len,a-t.resvDrain_post-8*n.sideinfo_len,a,a%8,r),_.err.println("This is a fatal error. It has several possible causes:"),_.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),_.err.println(" 9%% Your system is overclocked"),_.err.println(" 1%% bug in LAME encoding library"),n.ResvSize=8*t.main_data_begin),p>1e9){var i;for(i=0;ir)return-1;if(_.arraycopy(f,0,t,n,u),h=-1,d=0,0!=l){var p=a(1);if(p[0]=e.nMusicCRC,c.updateMusicCRC(p,t,n,u),e.nMusicCRC=p[0],u>0&&(e.VBR_seek_table.nBytesWritten+=u),e.decode_on_the_fly)for(var v,m=o([2,1152]),b=u,g=-1;0!=g;)if(g=s.hip_decode1_unclipped(e.hip,t,n,b,m[0],m[1]),b=0,-1==g&&(g=0),g>0){if(e.findPeakSample){for(v=0;ve.PeakSample?e.PeakSample=m[0][v]:-m[0][v]>e.PeakSample&&(e.PeakSample=-m[0][v]);if(e.channels_out>1)for(v=0;ve.PeakSample?e.PeakSample=m[1][v]:-m[1][v]>e.PeakSample&&(e.PeakSample=-m[1][v])}if(e.findReplayGain&&i.AnalyzeSamples(e.rgdata,m[0],0,m[1],0,g,e.channels_out)==y.GAIN_ANALYSIS_ERROR)return-6}}return u},this.init_bit_stream_w=function(e){f=n(G.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,h=-1,d=0,p=0}}function M(e,t,n,r){this.xlen=e,this.linmax=t,this.table=n,this.hlen=r}m.STEREO=new m(0),m.JOINT_STEREO=new m(1),m.DUAL_CHANNEL=new m(2),m.MONO=new m(3),m.NOT_SET=new m(4),y.STEPS_per_dB=100,y.MAX_dB=120,y.GAIN_NOT_ENOUGH_SAMPLES=-24601,y.GAIN_ANALYSIS_ERROR=0,y.GAIN_ANALYSIS_OK=1,y.INIT_GAIN_ANALYSIS_ERROR=0,y.INIT_GAIN_ANALYSIS_OK=1,y.YULE_ORDER=10,y.MAX_ORDER=y.YULE_ORDER,y.MAX_SAMP_FREQ=48e3,y.RMS_WINDOW_TIME_NUMERATOR=1,y.RMS_WINDOW_TIME_DENOMINATOR=20,y.MAX_SAMPLES_PER_WINDOW=y.MAX_SAMP_FREQ*y.RMS_WINDOW_TIME_NUMERATOR/y.RMS_WINDOW_TIME_DENOMINATOR+1,x.NUMTOCENTRIES=100,x.MAXFRAMESIZE=2880,A.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},A.NEQ=function(e,t){return!A.EQ(e,t)};var k={};function T(e){this.bits=e}function R(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function B(){this.setModules=function(e,t){e,t}}function E(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=i(F.SBMAX_l),this.s=i(F.SBMAX_s),this.psfb21=i(F.PSFB21),this.psfb12=i(F.PSFB12),this.cb_l=i(F.CBANDS),this.cb_s=i(F.CBANDS),this.eql_w=i(F.BLKSIZE/2)}function C(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=m.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}function O(e){var t=e;this.quantize=t,this.iteration_loop=function(e,t,n,r){var s,o=e.internal_flags,l=i($.SFBMAX),c=i(576),f=a(2),u=0,_=o.l3_side,p=new T(u);this.quantize.rv.ResvFrameBegin(e,p),u=p.bits;for(var h=0;h>2&63)>=32&&(r-=64),c=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>8&63)>=32&&(r-=64),f=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>14&63)>=32&&(r-=64),p=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>20&63)>=32&&(r-=64),v=p*Math.pow(10,r/4/10),r=0;rU.MAX_BITS_PER_GRANULE&&(d=U.MAX_BITS_PER_GRANULE),l=0,c=0;c3*i/4&&(_[c]=3*i/4),_[c]<0&&(_[c]=0),_[c]+r[c]>U.MAX_BITS_PER_CHANNEL&&(_[c]=Math.max(0,U.MAX_BITS_PER_CHANNEL-r[c])),l+=_[c];if(l>h)for(c=0;cU.MAX_BITS_PER_GRANULE){for(c=0;c.5&&(a=.5);var i=0|.5*a*(e[0]+e[1]);i>U.MAX_BITS_PER_CHANNEL-e[0]&&(i=U.MAX_BITS_PER_CHANNEL-e[0]),i<0&&(i=0),e[1]>=125&&(e[1]-i>125?(e[0]r&&(e[0]=r*e[0]/i,e[1]=r*e[1]/i)},this.athAdjust=function(e,t,n){var r=90.30873362,a=p.FAST_LOG10_X(t,10),i=e*e,s=0;return a-=n,i>1e-20&&(s=1+p.FAST_LOG10_X(i,10/r)),s<0&&(s=0),a*=s,a+=n+r-94.82444863,Math.pow(10,.1*a)},this.calc_xmin=function(e,t,n,r){var a,i=0,s=e.internal_flags,o=0,l=0,c=s.ATH,f=n.xr,u=e.VBR==v.vbr_mtrh?1:0,_=s.masking_lower;for(e.VBR!=v.vbr_mtrh&&e.VBR!=v.vbr_mt||(_=1),a=0;a>1,k=0;do{k+=R=f[o]*f[o],S+=R0);if(k>y&&l++,a==F.SBPSY_l)S<(M=y*s.nsPsy.longfact[a])&&(S=M);if(0!=u&&(y=S),!e.ATHonly)if((x=t.en.l[a])>0)M=k*t.thm.l[a]*_/x,0!=u&&(M*=s.nsPsy.longfact[a]),y>1;w=g/m,S=2220446049250313e-31;do{var R,B;k+=R=f[o]*f[o],S+=R0);if(k>g&&l++,d==F.SBPSY_s)S<(M=g*s.nsPsy.shortfact[d])&&(S=M);if(y=0!=u?S:g,!e.ATHonly&&!e.ATHshort)if((x=t.en.s[d][b])>0)M=k*t.thm.s[d][b]*_/x,0!=u&&(M*=s.nsPsy.shortfact[d]),yr[i-3+1]&&(r[i-3+1]+=(r[i-3]-r[i-3+1])*s.decay),r[i-3+1]>r[i-3+2]&&(r[i-3+2]+=(r[i-3+1]-r[i-3+2])*s.decay))}return l},this.calc_noise_core=function(e,t,n,r){var a=0,s=t.s,o=e.l3_enc;if(s>e.count1)for(;0!=n--;){c=e.xr[s],s++,a+=c*c,c=e.xr[s],s++,a+=c*c}else if(s>e.big_values){var l=i(2);for(l[0]=0,l[1]=r;0!=n--;){c=Math.abs(e.xr[s])-l[o[s]],s++,a+=c*c,c=Math.abs(e.xr[s])-l[o[s]],s++,a+=c*c}}else for(;0!=n--;){var c;c=Math.abs(e.xr[s])-h[o[s]]*r,s++,a+=c*c,c=Math.abs(e.xr[s])-h[o[s]]*r,s++,a+=c*c}return t.s=s,a},this.calc_noise=function(e,t,n,r,a){var i,s,o=0,l=0,c=0,_=0,h=0,d=-20,v=0,m=e.scalefac,b=0;for(r.over_SSD=0,i=0;i>1,v+e.width[i]>e.max_nonzero_coeff)s=(x=e.max_nonzero_coeff-v+1)>0?x>>1:0;var M=new g(v);S=this.calc_noise_core(e,M,s,A),v=M.s,null!=a&&(a.step[i]=w,a.noise[i]=S),S=n[o++]=S/t[l++],S=p.FAST_LOG10(Math.max(S,1e-20)),null!=a&&(a.noise_log[i]=S)}if(null!=a&&(a.global_gain=e.global_gain),h+=S,S>0)y=Math.max(0|10*S+.5,1),r.over_SSD+=y*y,c++,_+=S;d=Math.max(d,S)}return r.over_count=c,r.tot_noise=h,r.over_noise=_,r.max_noise=d,c},this.set_pinfo=function(e,t,n,r,a){var s,o,l,c,u,_=e.internal_flags,p=0==t.scalefac_scale?.5:1,h=t.scalefac,d=i($.SFBMAX),v=i($.SFBMAX),m=new R;calc_xmin(e,n,t,d),calc_noise(t,d,v,m,null);var b=0;for(o=t.sfb_lmax,t.block_type!=F.SHORT_TYPE&&0==t.mixed_block_flag&&(o=22),s=0;s0&&!e.ATHonly?c/=n.en.l[s]:c=0,_.pinfo.thr[r][a][s]=u*Math.max(c*n.thm.l[s],_.ATH.l[s]),_.pinfo.LAMEsfb[r][a][s]=0,0!=t.preflag&&s>=11&&(_.pinfo.LAMEsfb[r][a][s]=-p*f[s]),s0?c/=n.en.s[s][S]:c=0,(e.ATHonly||e.ATHshort)&&(c=0),_.pinfo.thr_s[r][a][3*s+S]=u*Math.max(c*n.thm.s[s][S],_.ATH.s[s]),_.pinfo.LAMEsfb_s[r][a][3*s+S]=-2*t.subblock_gain[S],s0?(i=n.over_SSD<=t.over_SSD,n.over_SSD==t.over_SSD&&(i=n.bits.2||n.max_noise<=0&&t.max_noise<0&&t.max_noise>n.max_noise-.2&&n.tot_noise0&&t.max_noise>n.max_noise-.2&&n.tot_noise0&&t.max_noise>-.05&&t.max_noise>n.max_noise-.1&&n.tot_noise+n.over_noise0&&t.max_noise>-.1&&t.max_noise>n.max_noise-.15&&n.tot_noise+n.over_noise+n.over_noise1?o=Math.pow(o,.5):o*=.95;break;case 0:default:o>1?o=1:o*=.95}var f=0;for(l=0;lt.xrpow_max&&(t.xrpow_max=r[f+u]);if(2==s.noise_shaping_amp)return}}}(e,t,a,i,s);var c=o(t);return!c&&(!(c=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t))||(l.noise_shaping>1&&(u.fill(l.pseudohalf,0),0==t.scalefac_scale?(!function(e,t){for(var r=0,a=0;ae.xrpow_max&&(e.xrpow_max=t[r+o])}e.scalefac[a]=s>>1}e.preflag=0,e.scalefac_scale=1}(t,i),c=!1):t.block_type==F.SHORT_TYPE&&l.subblock_gain>0&&(c=function(e,t,r){var a,i=t.scalefac;for(a=0;a=16)return!0;for(var s=0;s<3;s++){var o=0,l=0;for(a=t.sfb_lmax+s;a=7)return!0;t.subblock_gain[s]++;var c=e.scalefac_band.l[t.sfb_lmax];for(a=t.sfb_lmax+s;a>t.scalefac_scale)>=0)i[a]=u,c+=3*f;else{i[a]=0;var _=210+(u<t.xrpow_max&&(t.xrpow_max=r[c+p]);c+=f*(3-s-1)}}var h=n.IPOW20(202);c+=t.width[a]*(s+1);for(p=-t.width[a];p<0;p++)r[c+p]*=h,r[c+p]>t.xrpow_max&&(t.xrpow_max=r[c+p])}}return!1}(l,t,i)||o(t))),c||(c=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t)),!c))}this.setModules=function(i,s,o,l){e=i,t=s,this.rv=s,n=o,this.qupvt=o,r=l,a.setModules(n,r)},this.ms_convert=function(e,t){for(var n=0;n<576;++n){var r=e.tt[t][0].xr[n],a=e.tt[t][1].xr[n];e.tt[t][0].xr[n]=(r+a)*(.5*p.SQRT2),e.tt[t][1].xr[n]=(r-a)*(.5*p.SQRT2)}},this.init_xrpow=function(e,t,n){var r=0,a=0|t.max_nonzero_coeff;if(t.xrpow_max=0,u.fill(n,a,576,0),(r=function(e,t,n,r){r=0;for(var a=0;a<=n;++a){var i=Math.abs(e.xr[a]);r+=i,t[a]=Math.sqrt(i*Math.sqrt(i)),t[a]>e.xrpow_max&&(e.xrpow_max=t[a])}return r}(t,n,a,r))>1e-20){var i=0;0!=(2&e.substep_shaping)&&(i=1);for(var s=0;s=0&&!i;s--){var o=e.scalefac_band.psfb21[s],l=e.scalefac_band.psfb21[s+1],c=n.athAdjust(r.adjust,r.psfb21[s],r.floor);e.nsPsy.longfact[21]>1e-12&&(c*=e.nsPsy.longfact[21]);for(var f=l-1;f>=o;f--){if(!(Math.abs(a[f])=0&&!i;s--){l=(o=3*e.scalefac_band.s[12]+(e.scalefac_band.s[13]-e.scalefac_band.s[12])*u+(e.scalefac_band.psfb12[s]-e.scalefac_band.psfb12[0]))+(e.scalefac_band.psfb12[s+1]-e.scalefac_band.psfb12[s]);var _=n.athAdjust(r.adjust,r.psfb12[s],r.floor);e.nsPsy.shortfact[12]>1e-12&&(_*=e.nsPsy.shortfact[12]);for(f=l-1;f>=o;f--){if(!(Math.abs(a[f])<_)){i=!0;break}a[f]=0}}}(e,t)},s.BINSEARCH_NONE=new s(0),s.BINSEARCH_UP=new s(1),s.BINSEARCH_DOWN=new s(2),this.trancate_smallspectrums=function(e,t,a,s){var o=i($.SFBMAX);if((0!=(4&e.substep_shaping)||t.block_type!=F.SHORT_TYPE)&&0==(128&e.substep_shaping)){n.calc_noise(t,a,o,new R,null);for(var l=0;l<576;l++){var c=0;0!=t.l3_enc[l]&&(c=Math.abs(t.xr[l])),s[l]=c}l=0;var f=8;t.block_type==F.SHORT_TYPE&&(f=6);do{var _,p,h,d,v=t.width[f];if(l+=v,!(o[f]>=1||(u.sort(s,l-v,v),A.EQ(s[l-1],0)))){_=(1-o[f])*a[f],p=0,d=0;do{var m;for(h=1;d+h0)}}while(++fn?(u==s.BINSEARCH_DOWN&&(c=!0),c&&(l/=2),u=s.BINSEARCH_UP,_=l):(u==s.BINSEARCH_UP&&(c=!0),c&&(l/=2),u=s.BINSEARCH_DOWN,_=-l),t.global_gain+=_,t.global_gain<0&&(t.global_gain=0,c=!0),t.global_gain>255&&(t.global_gain=255,c=!0)}for(;o>n&&t.global_gain<255;)t.global_gain++,o=r.count_bits(e,i,t,null);e.CurrentStep[a]=f-t.global_gain>=4?4:2,e.OldValue[a]=t.global_gain,t.part2_3_length=o}(p,t,u,f,o),0==p.noise_shaping)return 100;n.calc_noise(t,a,m,b,g),b.bits=t.part2_3_length,h.assign(t);var A=0;for(_.arraycopy(o,0,d,0,576);!w;){do{var M,k=new R,T=255;if(M=0!=(2&p.substep_shaping)?20:3,p.sfb21_extra){if(m[h.sfbmax]>1)break;if(h.block_type==F.SHORT_TYPE&&(m[h.sfbmax+1]>1||m[h.sfbmax+2]>1))break}if(!c(e,h,m,o,S))break;0!=h.scalefac_scale&&(T=254);var B=u-h.part2_length;if(B<=0)break;for(;(h.part2_3_length=r.count_bits(p,o,h,g))>B&&h.global_gain<=T;)h.global_gain++;if(h.global_gain>T)break;if(0==b.over_count){for(;(h.part2_3_length=r.count_bits(p,o,h,g))>y&&h.global_gain<=T;)h.global_gain++;if(h.global_gain>T)break}if(n.calc_noise(h,a,m,k,g),k.bits=h.part2_3_length,0!=(l(t.block_type!=F.SHORT_TYPE?e.quant_comp:e.quant_comp_short,b,k,h,m)?1:0))y=t.part2_3_length,b=k,t.assign(h),A=0,_.arraycopy(o,0,d,0,576);else if(0==p.full_outer_loop){if(++A>M&&0==b.over_count)break;if(3==p.noise_shaping_amp&&S&&A>30)break;if(3==p.noise_shaping_amp&&S&&h.global_gain-x>15)break}}while(h.global_gain+h.scalefac_scale<255);3==p.noise_shaping_amp?S?w=!0:(h.assign(t),_.arraycopy(d,0,o,0,576),A=0,x=h.global_gain,S=!0):w=!0}return e.VBR==v.vbr_rh||e.VBR==v.vbr_mtrh?_.arraycopy(d,0,o,0,576):0!=(1&p.substep_shaping)&&trancate_smallspectrums(p,t,a,o),b.over_count},this.iteration_finish_one=function(e,n,a){var i=e.l3_side,s=i.tt[n][a];r.best_scalefac_store(e,n,a,i),1==e.use_best_huffman&&r.best_huffman_divide(e,s),t.ResvAdjust(e,s)},this.VBR_encode_granule=function(e,t,n,r,a,s,o){var l,c=e.internal_flags,f=new N,p=i(576),h=o,d=o+1,v=(o+s)/2,m=0,b=c.sfb21_extra;u.fill(f.l3_enc,0);do{c.sfb21_extra=!(v>h-42)&&b,outer_loop(e,t,n,r,a,v)<=0?(m=1,d=t.part2_3_length,f.assign(t),_.arraycopy(r,0,p,0,576),l=(o=d-32)-s,v=(o+s)/2):(l=o-(s=v+32),v=(o+s)/2,0!=m&&(m=2,t.assign(f),_.arraycopy(p,0,r,0,576)))}while(l>12);c.sfb21_extra=b,2==m&&_.arraycopy(f.l3_enc,0,t.l3_enc,0,576)},this.get_framebits=function(n,r){var a=n.internal_flags;a.bitrate_index=a.VBR_min_bitrate;var i=e.getframebits(n);a.bitrate_index=1,i=e.getframebits(n);for(var s=1;s<=a.VBR_max_bitrate;s++){a.bitrate_index=s;var o=new T(i);r[s]=t.ResvFrameBegin(n,o),i=o.bits}},this.VBR_old_prepare=function(e,r,a,i,s,o,l,c,f){var u,_=e.internal_flags,p=0,h=1,d=0;_.bitrate_index=_.VBR_max_bitrate;var v=t.ResvFrameBegin(e,new T(0))/_.mode_gr;get_framebits(e,o);for(var m=0;m<_.mode_gr;m++){var b=n.on_pe(e,r,c[m],v,m,0);_.mode_ext==F.MPG_MD_MS_LR&&(ms_convert(_.l3_side,m),n.reduce_side(c[m],a[m],v,b));for(var g=0;g<_.channels_out;++g){var y=_.l3_side.tt[m][g];y.block_type!=F.SHORT_TYPE?(p=1.28/(1+Math.exp(3.5-r[m][g]/300))-.05,u=_.PSY.mask_adjust-p):(p=2.56/(1+Math.exp(3.5-r[m][g]/300))-.14,u=_.PSY.mask_adjust_short-p),_.masking_lower=Math.pow(10,.1*u),init_outer_loop(_,y),f[m][g]=n.calc_xmin(e,i[m][g],y,s[m][g]),0!=f[m][g]&&(h=0),l[m][g]=126,d+=c[m][g]}}for(m=0;m<_.mode_gr;m++)for(g=0;g<_.channels_out;g++)d>o[_.VBR_max_bitrate]&&(c[m][g]*=o[_.VBR_max_bitrate],c[m][g]/=d),l[m][g]>c[m][g]&&(l[m][g]=c[m][g]);return h},this.bitpressure_strategy=function(e,t,n,r){for(var a=0;al&&(o[h][d]*=l,o[h][d]/=_);return f},this.calc_target_bits=function(r,a,i,s,o,l){var c,f,u,_,p=r.internal_flags,h=p.l3_side,d=0;p.bitrate_index=p.VBR_max_bitrate;var v=new T(d);for(l[0]=t.ResvFrameBegin(r,v),d=v.bits,p.bitrate_index=1,d=e.getframebits(r)-8*p.sideinfo_len,o[0]=d/(p.mode_gr*p.channels_out),d=r.VBR_mean_bitrate_kbps*r.framesize*1e3,0!=(1&p.substep_shaping)&&(d*=1.09),d/=r.out_samplerate,d-=8*p.sideinfo_len,d/=p.mode_gr*p.channels_out,(c=.93+.07*(11-r.compression_ratio)/5.5)<.9&&(c=.9),c>1&&(c=1),f=0;f700){var b=int((a[f][u]-700)/1.4),g=h.tt[f][u];s[f][u]=int(c*d),g.block_type==F.SHORT_TYPE&&b3*d/2?b=3*d/2:b<0&&(b=0),s[f][u]+=b}s[f][u]>U.MAX_BITS_PER_CHANNEL&&(s[f][u]=U.MAX_BITS_PER_CHANNEL),m+=s[f][u]}if(m>U.MAX_BITS_PER_GRANULE)for(u=0;uU.MAX_BITS_PER_CHANNEL&&(s[f][u]=U.MAX_BITS_PER_CHANNEL),_+=s[f][u];if(_>l[0])for(f=0;f=0;--z){var ee,te;ee=V[q+z]*a[20+z]+V[q+-1-z]*s[28+z],te=V[q+z]*s[28+z]-V[q+-1-z]*a[20+z],V[q+-1-z]=ee,V[q+z]=te}}}if(L=p,H=286,1==e.mode_gr)for(var ne=0;ne<18;ne++)_.arraycopy(e.sb_sample[N][1][ne],0,e.sb_sample[N][0][ne],0,32)}}}function V(){this.thm=new X,this.en=new X}function F(){var e=F.FFTOFFSET,t=F.MPG_MD_MS_LR,n=null;this.psy=null;var r=null,s=null,l=null;this.setModules=function(e,t,a,i){n=e,this.psy=t,r=t,s=i,l=a};var c=new j;this.lame_encode_mp3_frame=function(u,p,h,d,b,g){var y,w=f([2,2]);w[0][0]=new V,w[0][1]=new V,w[1][0]=new V,w[1][1]=new V;var S,x=f([2,2]);x[0][0]=new V,x[0][1]=new V,x[1][0]=new V,x[1][1]=new V;var A,M,k,T=[null,null],R=u.internal_flags,B=o([2,4]),E=[.5,.5],C=[[0,0],[0,0]],O=[[0,0],[0,0]];if(T[0]=p,T[1]=h,0==R.lame_encode_frame_init&&function(e,t){var n,r,a=e.internal_flags;if(0==a.lame_encode_frame_init){var s,o,l=i(2014),f=i(2014);for(a.lame_encode_frame_init=1,s=0,o=0;s<286+576*(1+a.mode_gr);++s)s<576*a.mode_gr?(l[s]=0,2==a.channels_out&&(f[s]=0)):(l[s]=t[0][o],2==a.channels_out&&(f[s]=t[1][o]),++o);for(r=0;r0&&(E[k]=B[k][3]/E[k])),M=0;M.03125)e.ATH.adjust>=1?e.ATH.adjust=1:e.ATH.adjust=r?(e.ATH.adjust*=.075*r+.925,e.ATH.adjust=r?e.ATH.adjust=r:e.ATH.adjust>1,d=(h=a<<1)+(_=a),a=h<<1,s=(i=t)+v;do{x=e[i+0]-e[i+_],S=e[i+0]+e[i+_],T=e[i+h]-e[i+d],M=e[i+h]+e[i+d],e[i+h]=S-M,e[i+0]=S+M,e[i+d]=x-T,e[i+_]=x+T,x=e[s+0]-e[s+_],S=e[s+0]+e[s+_],T=p.SQRT2*e[s+d],M=p.SQRT2*e[s+h],e[s+h]=S-M,e[s+0]=S+M,e[s+d]=x-T,e[s+_]=x+T,s+=a,i+=a}while(i=0);r(n[l],c,F.BLKSIZE_s/2)}},this.fft_long=function(t,n,i,s,o){var l=F.BLKSIZE/8-1,c=F.BLKSIZE/2;do{var f,u,_,p,h,d=255&a[l];u=(f=e[d]*s[i][o+d])-(h=e[d+512]*s[i][o+d+512]),f+=h,p=(_=e[d+256]*s[i][o+d+256])-(h=e[d+768]*s[i][o+d+768]),_+=h,n[(c-=4)+0]=f+_,n[c+2]=f-_,n[c+1]=u+p,n[c+3]=u-p,u=(f=e[d+1]*s[i][o+d+1])-(h=e[d+513]*s[i][o+d+513]),f+=h,p=(_=e[d+257]*s[i][o+d+257])-(h=e[d+769]*s[i][o+d+769]),_+=h,n[c+F.BLKSIZE/2+0]=f+_,n[c+F.BLKSIZE/2+2]=f-_,n[c+F.BLKSIZE/2+1]=u+p,n[c+F.BLKSIZE/2+3]=u-p}while(--l>=0);r(n,c,F.BLKSIZE/2)},this.init_fft=function(n){for(var r=0;r=0;--h){var d=a[i+0][h],v=a[i+1][h];a[i+0][h]=(d+v)*p.SQRT2*.5,a[i+1][h]=(d-v)*p.SQRT2*.5}for(var m=2;m>=0;--m)for(h=F.BLKSIZE_s-1;h>=0;--h){d=s[o+0][m][h],v=s[o+1][m][h];s[o+0][m][h]=(d+v)*p.SQRT2*.5,s[o+1][m][h]=(d-v)*p.SQRT2*.5}}n[0]=a[i+0][0],n[0]*=n[0];for(h=F.BLKSIZE/2-1;h>=0;--h){var b=a[i+0][F.BLKSIZE/2-h],g=a[i+0][F.BLKSIZE/2+h];n[F.BLKSIZE/2-h]=.5*(b*b+g*g)}for(m=2;m>=0;--m){r[m][0]=s[o+0][m][0],r[m][0]*=r[m][0];for(h=F.BLKSIZE_s/2-1;h>=0;--h){b=s[o+0][m][F.BLKSIZE_s/2-h],g=s[o+0][m][F.BLKSIZE_s/2+h];r[m][F.BLKSIZE_s/2-h]=.5*(b*b+g*g)}}var w=0;for(h=11;he){if(!(t=t*x)return e+t;s=e/t}if(e+=t,r+3<=6){if(s>=S)return e;var o=0|p.FAST_LOG10_X(s,16);return e*E[o]}var l,c;o=0|p.FAST_LOG10_X(s,16);return t=0!=i?a.ATH.cb_s[n]*a.ATH.adjust:a.ATH.cb_l[n]*a.ATH.adjust,et?(l=1,o<=13&&(l=C[o]),c=p.FAST_LOG10_X(e/t,10/15),e*((B[o]-l)*c+l)):o>13?e:e*C[o]:e*B[o]}var P=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1];function I(e,t,n){var r;if(e<0&&(e=0),t<0&&(t=0),e<=0)return t;if(t<=0)return e;if(r=t>e?t/e:e/t,-2<=n&&n<=2){if(r>=S)return e+t;var a=0|p.FAST_LOG10_X(r,16);return(e+t)*P[a]}return r=f){++i;break}var _=e.PSY.bo_s_weight[i],p=1-_;o=_*t[s],l=_*n[s],e.en[r].s[i][a]+=o,e.thm[r].s[i][a]+=l,o=p*t[s],l=p*n[s]}for(;i=c){++a;break}var u=e.PSY.bo_l_weight[a],_=1-u;s=u*t[i],o=u*n[i],e.en[r].l[a]+=s,e.thm[r].l[a]+=o,s=_*t[i],o=_*n[i]}for(;a=1?e:n<=0?t:t>0?Math.pow(e/t,n)*t:0}var D=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function j(e,n){for(var r=309.07,a=0;a0){var o=s*n,l=e.en.s[a][i];l>o&&(r+=l>1e10*o?D[a]*(10*t):D[a]*p.FAST_LOG10(l/o))}}return r}var V=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function q(e,n){for(var r=281.0575,a=0;a0){var s=i*n,o=e.en.l[a];o>s&&(r+=o>1e10*s?V[a]*(10*t):V[a]*p.FAST_LOG10(o/s))}}return r}function Y(e,t,n,r,a){var i,s;for(i=s=0;i0?((o=t[i])a&&(l=a),r[i]=l):r[i]=0;for(i=1;i0)(o=t[i-1])a&&(l=a),r[i]=l;else r[i]=0}(s=n[i-1]+n[i])>0?((o=t[i-1])a&&(l=a),r[i]=l):r[i]=0}var z=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function U(t,n,r,a,i,s,o,l){var c=t.internal_flags;if(a<2)e.fft_long(c,o[l],a,n,r);else if(2==a)for(var f=F.BLKSIZE-1;f>=0;--f){var u=o[l+0][f],_=o[l+1][f];o[l+0][f]=(u+_)*p.SQRT2*.5,o[l+1][f]=(u-_)*p.SQRT2*.5}s[0]=o[l+0][0],s[0]*=s[0];for(f=F.BLKSIZE/2-1;f>=0;--f){var h=o[l+0][F.BLKSIZE/2-f],d=o[l+0][F.BLKSIZE/2+f];s[F.BLKSIZE/2-f]=.5*(h*h+d*d)}var v=0;for(f=11;f=0;--f){var u=o[l+0][i][f],_=o[l+1][i][f];o[l+0][i][f]=(u+_)*p.SQRT2*.5,o[l+1][i][f]=(u-_)*p.SQRT2*.5}s[i][0]=o[l+0][i][0],s[i][0]*=s[i][0];for(f=F.BLKSIZE_s/2-1;f>=0;--f){var h=o[l+0][i][F.BLKSIZE_s/2-f],d=o[l+0][i][F.BLKSIZE_s/2+f];s[i][F.BLKSIZE_s/2-f]=.5*(h*h+d*d)}}function G(e,t,n,r){var a=e.internal_flags;2==e.athaa_loudapprox&&n<2&&(a.loudness_sq[t][n]=a.loudness_sq_save[n],a.loudness_sq_save[n]=y(r,a))}this.L3psycho_anal_ns=function(e,t,s,l,c,f,p,d,g,y){var S,x,A,M,k,T,B,E,C,P,I=e.internal_flags,D=o([2,F.BLKSIZE]),V=o([2,3,F.BLKSIZE_s]),U=i(F.CBANDS+1),K=i(F.CBANDS+1),Z=i(F.CBANDS+2),G=a(2),Q=a(2),W=o([2,576]),J=a(F.CBANDS+2),ee=a(F.CBANDS+2);for(u.fill(ee,0),S=I.channels_out,e.mode==m.JOINT_STEREO&&(S=4),C=e.VBR==v.vbr_off?0==I.ResvMax?0:I.ResvSize/I.ResvMax*.5:e.VBR==v.vbr_rh||e.VBR==v.vbr_mtrh||e.VBR==v.vbr_mt?.6:1,x=0;x2&&(f[l][x].en.assign(I.en[x+2]),f[l][x].thm.assign(I.thm[x+2]))}for(x=0;xse[M+3-2]?ye/=se[M+3-2]:ye=se[M+3-2]>10*ye?se[M+3-2]/(10*ye):0,le[M+3]=ye}if(e.analysis){var we=le[0];for(M=1;M<12;M++)weie&&(_e[M/3]=M%3+1);for(M=1;M<4;M++){(oe[M-1]>oe[M]?oe[M-1]/oe[M]:oe[M]/oe[M-1])<1.7&&(_e[M]=0,1==M&&(_e[0]=0))}for(0!=_e[0]&&0!=I.nsPsy.lastAttacks[x]&&(_e[0]=0),3!=I.nsPsy.lastAttacks[x]&&_e[0]+_e[1]+_e[2]+_e[3]==0||(ce=0,0!=_e[1]&&0!=_e[0]&&(_e[1]=0),0!=_e[2]&&0!=_e[1]&&(_e[2]=0),0!=_e[3]&&0!=_e[2]&&(_e[3]=0)),x<2?Q[x]=ce:0==ce&&(Q[0]=Q[1]=0),g[x]=I.tot_ener[x],w(e,pe,he,D,1&x,V,1&x,l,x,t,s),Y(I,pe,U,fe,ue),X(I,fe,ue,J),E=0;E<3;E++){var Se,xe;for(N(e,he,K,Z,x,E),L(I,K,Z,x,E),B=0;B=2||1==_e[E+1]){var Ae=0!=E?E-1:2;ye=$(I.thm[x].s[B][Ae],xe,.6*C);xe=Math.min(xe,ye)}if(1==_e[E]){Ae=0!=E?E-1:2,ye=$(I.thm[x].s[B][Ae],xe,_*C);xe=Math.min(xe,ye)}else if(0!=E&&3==_e[E-1]||0==E&&3==I.nsPsy.lastAttacks[x]){Ae=2!=E?E+1:0,ye=$(I.thm[x].s[B][Ae],xe,_*C);xe=Math.min(xe,ye)}Se=se[3*E+3]+se[3*E+4]+se[3*E+5],6*se[3*E+5]0&&function(e,t){var n=e.internal_flags;if(n.channels_out>1){for(var r=0;r1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var n=e.mld_l[t]*e.en[3].l[t],r=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],n));n=e.mld_l[t]*e.en[2].l[t];var a=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],n));e.thm[2].l[t]=r,e.thm[3].l[t]=a}for(t=0;t1.58*e.thm[1].s[t][i]||e.thm[1].s[t][i]>1.58*e.thm[0].s[t][i])){n=e.mld_s[t]*e.en[3].s[t][i],r=Math.max(e.thm[2].s[t][i],Math.min(e.thm[3].s[t][i],n));n=e.mld_s[t]*e.en[2].s[t][i];a=Math.max(e.thm[3].s[t][i],Math.min(e.thm[2].s[t][i],n));e.thm[2].s[t][i]=r,e.thm[3].s[t][i]=a}}(I),P=e.msfix,Math.abs(P)>0&&function(e,t,n){var r=t,a=Math.pow(10,n);t*=2,r*=2;for(var i=0;i1?(Re=d,Ce=-2,Be=F.NORM_TYPE,y[0]!=F.SHORT_TYPE&&y[1]!=F.SHORT_TYPE||(Be=F.SHORT_TYPE),Ee=f[l][x-2]):(Re=p,Ce=0,Be=y[x],Ee=c[l][x]),Be==F.SHORT_TYPE?Re[Ce+x]=j(Ee,I.masking_lower):Re[Ce+x]=q(Ee,I.masking_lower),e.analysis&&(I.pinfo.pe[l][x]=Re[Ce+x])}return 0};var Q=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function W(e,t,n){if(0==n)for(var r=0;r0?((o=t[i])a&&(l=a),r[i]=l):r[i]=0,i=1;i0)(o=t[i-1])a&&(l=a),r[i]=l;else r[i]=0}(s=n[i-1]+n[i])>0?((o=t[i-1])a&&(l=a),r[i]=l):r[i]=0}(f,u,_,p),l=c=0;cy&&(r[c]=y),f.masking_lower>1&&(r[c]*=f.masking_lower),r[c]>n[c]&&(r[c]=n[c]),f.masking_lower<1&&(r[c]*=f.masking_lower)}for(;c0?Math.min(v,S):Math.min(v,s[c]*_)}else{var x=r*e.nb_2[l][c],A=n*e.nb_1[l][c];x<=0&&(x=v),A<=0&&(A=v),S=e.blocktype_old[1&l]==F.NORM_TYPE?Math.min(A,x):A,o[c]=Math.min(v,S)}e.nb_2[l][c]=e.nb_1[l][c],e.nb_1[l][c]=v,d=f[c],d*=e.minval_l[c],d*=m,o[c]>d&&(o[c]=d),e.masking_lower>1&&(o[c]*=e.masking_lower),o[c]>s[c]&&(o[c]=s[c]),e.masking_lower<1&&(o[c]*=e.masking_lower)}for(;c0?Math.pow(10,a):1,u=0;u0){var y,w,S=r[u]*f;if(y=Math.min(Math.max(h,S),Math.max(d,S)),(w=(v=Math.max(l,S))+(m=Math.max(o,S)))>0&&y*c_&&(l=_),o>p&&(o=p),t[2][u]=l,t[3][u]=o}}function re(e,t){var n;return(n=e>=0?27*-e:e*t)<=-72?0:Math.exp(n*g)}function ae(e){var t,n,r=0;for(r=0;re(r,e)>1e-20;r-=1);for(a=r,i=0;Math.abs(i-a)>1e-12;)re(r=(i+a)/2,e)>0?i=r:a=r;t=a;var a,i;r=0;for(r=0;re(r,e)>1e-20;r+=1);for(a=0,i=r;Math.abs(i-a)>1e-12;)re(r=(i+a)/2,e)>0?a=r:i=r;n=i;var s,o=0;for(s=0;s<=1e3;++s){o+=re(r=t+s*(n-t)/1e3,e)}return 1001/(o*(n-t))}function ie(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function se(e,t,n,r,s,o,l,f,u,_,p,h){var d,v=i(F.CBANDS+1),m=f/(h>15?1152:384),b=a(F.HBLKSIZE);f/=u;var g=0,y=0;for(d=0;du/2){g=u/2,++d;break}}v[d]=f*g;for(var S=0;Su/2&&(A=u/2),n[S]=(b[x]+b[A])/2,t[S]=b[A];var R=m*k;l[S]=(R-v[t[S]])/(v[t[S]+1]-v[t[S]]),l[S]<0?l[S]=0:l[S]>1&&(l[S]=1),T=ie(f*_[S]*p),T=Math.min(T,15.5)/15.5,o[S]=Math.pow(10,1.25*(1-Math.cos(Math.PI*T))-2.5)}g=0;for(var B=0;B=0?3:1.5)>=.5&&f<=2.5?8*((p=f-.5)*p-2*p):0,((_=15.811389+7.5*(f+=.474)-17.5*Math.sqrt(1+f*f))<=-60?0:(f=Math.exp((u+_)*g),f/=.6609193))*r[l]);h[v][l]=m*a[v]}else for(l=0;l0);l++);for(e[v][0]=l,l=t-1;l>0&&!(h[v][l]>0);l--);e[v][1]=l,d+=e[v][1]-e[v][0]+1}var w=i(d),S=0;for(v=0;v2&&(s[r][v].en.assign(p.en[v+2]),s[r][v].thm.assign(p.thm[v+2]))}for(v=0;v0;++y,--x){var C=_[0][y],O=_[1][y];_[0][y]=C+O,_[1][y]=C-O}for(y=0;y<3;y++)M[y]=p.nsPsy.last_en_subshort[v][y+6],A[y]=M[y]/p.nsPsy.last_en_subshort[v][y+4],k[0]+=M[y];for(y=0;y<9;y++){for(var P=R+64,I=1;RM[y+3-2]?I/=M[y+3-2]:I=M[y+3-2]>10*I?M[y+3-2]/(10*I):0,A[y+3]=I}for(y=0;y<3;++y){var L=M[3*y+3]+M[3*y+4]+M[3*y+5],H=1;6*M[3*y+5]B&&(f[v][y/3]=y%3+1);for(y=1;y<4;y++){var $=k[y-1],D=k[y];Math.max($,D)<4e4&&$<1.7*D&&D<1.7*$&&(1==y&&f[v][0]<=f[v][y]&&(f[v][0]=0),f[v][y]=0)}f[v][0]<=p.nsPsy.lastAttacks[v]&&(f[v][0]=0),3!=p.nsPsy.lastAttacks[v]&&f[v][0]+f[v][1]+f[v][2]+f[v][3]==0||(E=0,0!=f[v][1]&&0!=f[v][0]&&(f[v][1]=0),0!=f[v][2]&&0!=f[v][1]&&(f[v][2]=0),0!=f[v][3]&&0!=f[v][2]&&(f[v][3]=0)),v<2?u[v]=E:0==E&&(u[0]=u[1]=0),l[v]=p.tot_ener[v]}}(e,t,n,r,s,l,u,A,M,k),function(e,t){var n=e.internal_flags;e.short_blocks!=h.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var r=0;r=2||1==M[R][B+1]){var I=0!=B?B-1:2,N=$(d.thm[R].s[C][I],P,.36);P=Math.min(P,N)}else if(1==M[R][B]){I=0!=B?B-1:2,N=$(d.thm[R].s[C][I],P,.6*_);P=Math.min(P,N)}else if(0!=B&&3==M[R][B-1]||0==B&&3==d.nsPsy.lastAttacks[R]){I=2!=B?B+1:0,N=$(d.thm[R].s[C][I],P,.6*_);P=Math.min(P,N)}P*=A[R][B],O[B]=P}for(B=0;B<3;B++)d.thm[R].s[C][B]=O[B]}}for(R=0;R1?(D=f,V=-2,Y=F.NORM_TYPE,p[0]!=F.SHORT_TYPE&&p[1]!=F.SHORT_TYPE||(Y=F.SHORT_TYPE),X=l[r][R-2]):(D=c,V=0,Y=p[R],X=s[r][R]),Y==F.SHORT_TYPE?D[V+R]=j(X,d.masking_lower):D[V+R]=q(X,d.masking_lower),e.analysis&&(d.pinfo.pe[r][R]=D[V+R])}return 0},this.psymodel_init=function(n){var r,a=n.internal_flags,s=!0,o=13,l=0,c=0,f=-8.25,u=-4.5,_=i(F.CBANDS),p=i(F.CBANDS),h=i(F.CBANDS),m=n.out_samplerate;switch(n.experimentalZ){default:case 0:s=!0;break;case 1:s=n.VBR!=v.vbr_mtrh&&n.VBR!=v.vbr_mt;break;case 2:s=!1;break;case 3:o=8,l=-1.75,c=-.0125,f=-8.25,u=-2.25}for(a.ms_ener_ratio_old=.25,a.blocktype_old[0]=a.blocktype_old[1]=F.NORM_TYPE,r=0;r<4;++r){for(var b=0;b=o&&(y=c*(_[r]-o)/(24-o)+l*(24-_[r])/(24-o)),h[r]=Math.pow(10,y/10),a.numlines_l[r]>0?a.rnumlines_l[r]=1/a.numlines_l[r]:a.rnumlines_l[r]=0}a.s3_ll=oe(a.s3ind,a.npart_l,_,p,h,s);var w;b=0;for(r=0;r(C*=a.numlines_l[r])&&(E=C)}a.ATH.cb_l[r]=E,(E=20*_[r]/10-20)>6&&(E=100),E<-15&&(E=-15),E-=8,a.minval_l[r]=Math.pow(10,E/10)*a.numlines_l[r]}for(a.npart_s=se(a.numlines_s,a.bo_s,a.bm_s,_,p,a.mld_s,a.PSY.bo_s_weight,m,F.BLKSIZE_s,a.scalefac_band.s,F.BLKSIZE_s/384,F.SBMAX_s),b=0,r=0;r=o&&(y=u*(_[r]-o)/(24-o)+f*(24-_[r])/(24-o)),h[r]=Math.pow(10,y/10),E=d.MAX_VALUE;for(R=0;R(C*=a.numlines_s[r])&&(E=C)}a.ATH.cb_s[r]=E,E=7*_[r]/12-7,_[r]>12&&(E*=1+3.1*Math.log(1+E)),_[r]<12&&(E*=1+2.3*Math.log(1-E)),E<-15&&(E=-15),E-=8,a.minval_s[r]=Math.pow(10,E/10)*a.numlines_s[r]}a.s3_ss=oe(a.s3ind_s,a.npart_s,_,p,h,s),S=Math.pow(10,(M+1)/16),x=Math.pow(10,(k+1)/16),A=Math.pow(10,T/10),e.init_fft(a),a.decay=Math.exp(-1*t/(.01*m/192)),w=3.5,0!=(2&n.exp_nspsytune)&&(w=1),Math.abs(n.msfix)>0&&(w=n.msfix),n.msfix=w;for(var O=0;Oa.npart_l-1&&(a.s3ind[O][1]=a.npart_l-1);var P=576*a.mode_gr/m;if(a.ATH.decay=Math.pow(10,-1.2*P),a.ATH.adjust=.01,a.ATH.adjustLimit=1,-1!=n.ATHtype){var I=n.out_samplerate/F.BLKSIZE,L=0;for(B=0,r=0;r=0;)a.ATH.eql_w[r]*=L}for(O=b=0;O1?0:e<=0?1:Math.cos(Math.PI/2*e)}function x(e,t){switch(e){case 44100:return t.version=1,0;case 48e3:return t.version=1,1;case 32e3:return t.version=1,2;case 22050:return t.version=0,0;case 24e3:return t.version=0,1;case 16e3:return t.version=0,2;case 11025:return t.version=0,0;case 12e3:return t.version=0,1;case 8e3:return t.version=0,2;default:return t.version=0,-1}}function M(e,t,n){n<16e3&&(t=2);for(var r=k.bitrate_table[t][1],a=2;a<=14;a++)k.bitrate_table[t][a]>0&&Math.abs(k.bitrate_table[t][a]-e)0&&k.bitrate_table[t][r]==e)return r;return-1}function R(t,n){var r=[new g(8,2e3),new g(16,3700),new g(24,3900),new g(32,5500),new g(40,7e3),new g(48,7500),new g(56,1e4),new g(64,11e3),new g(80,13500),new g(96,15100),new g(112,15600),new g(128,17e3),new g(160,17500),new g(192,18600),new g(224,19400),new g(256,19700),new g(320,20500)],a=e.nearestBitrateFullIndex(n);t.lowerlimit=r[a].lowpass}function B(e){var t=F.BLKSIZE+e.framesize-F.FFTOFFSET;return t=Math.max(t,512+e.framesize-32)}function I(t,n,r,a,i,s){var o=e.enc.lame_encode_mp3_frame(t,n,r,a,i,s);return t.frameNum++,o}function L(){this.n_in=0,this.n_out=0}function H(){this.num_used=0}function N(e,t,n){var r=Math.PI*t;(e/=n)<0&&(e=0),e>1&&(e=1);var a=e-.5,i=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(a)<1e-9?r/Math.PI:i*Math.sin(n*r*a)/(Math.PI*n*a)}function $(e,t,n,r,a,s,o,l,c){var f,u,_=e.internal_flags,p=0,h=e.out_samplerate/function e(t,n){return 0!=n?e(n,t%n):t}(e.out_samplerate,e.in_samplerate);h>U.BPC&&(h=U.BPC);var d=Math.abs(_.resample_ratio-Math.floor(.5+_.resample_ratio))<1e-4?1:0,v=1/_.resample_ratio;v>1&&(v=1);var m=31;0==m%2&&--m;var b=(m+=d)+1;if(0==_.fill_buffer_resample_init){for(_.inbuf_old[0]=i(b),_.inbuf_old[1]=i(b),f=0;f<=2*h;++f)_.blackfilt[f]=i(b);for(_.itime[0]=0,_.itime[1]=0,p=0;p<=2*h;p++){var g=0,y=(p-h)/(2*h);for(f=0;f<=m;f++)g+=_.blackfilt[p][f]=N(f-y,v,m);for(f=0;f<=m;f++)_.blackfilt[p][f]/=g}_.fill_buffer_resample_init=1}var w=_.inbuf_old[c];for(u=0;u=o)break;y=S-_.itime[c]-(p+m%2*.5);x=0|Math.floor(2*y*h+h+.5);var A=0;for(f=0;f<=m;++f){var M=f+p-m/2;A+=(M<0?w[b+M]:a[s+M])*_.blackfilt[x][f]}t[n+u]=A}if(l.num_used=Math.min(o,m+p-m/2),_.itime[c]+=l.num_used-u*_.resample_ratio,l.num_used>=b)for(f=0;f1.0001)for(var o=0;oe-r?n:a},this.lame_init_params=function(e){var i,c,g,B=e.internal_flags;if(B.Class_ID=0,null==B.ATH&&(B.ATH=new E),null==B.PSY&&(B.PSY=new d),null==B.rgdata&&(B.rgdata=new P),B.channels_in=e.num_channels,1==B.channels_in&&(e.mode=m.MONO),B.channels_out=e.mode==m.MONO?1:2,B.mode_ext=F.MPG_MD_MS_LR,e.mode==m.MONO&&(e.force_ms=!1),e.VBR==v.vbr_off&&128!=e.VBR_mean_bitrate_kbps&&0==e.brate&&(e.brate=e.VBR_mean_bitrate_kbps),e.VBR==v.vbr_off||e.VBR==v.vbr_mtrh||e.VBR==v.vbr_mt||(e.free_format=!1),e.VBR==v.vbr_off&&0==e.brate&&A.EQ(e.compression_ratio,0)&&(e.compression_ratio=11.025),e.VBR==v.vbr_off&&e.compression_ratio>0&&(0==e.out_samplerate&&(e.out_samplerate=map2MP3Frequency(int(.97*e.in_samplerate))),e.brate=0|16*e.out_samplerate*B.channels_out/(1e3*e.compression_ratio),B.samplerate_index=x(e.out_samplerate,e),e.free_format||(e.brate=M(e.brate,e.version,e.out_samplerate))),0!=e.out_samplerate&&(e.out_samplerate<16e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,64)):e.out_samplerate<32e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,160)):(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,32),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320))),0==e.lowpassfreq){var C=16e3;switch(e.VBR){case v.vbr_off:R(I=new b,e.brate),C=I.lowerlimit;break;case v.vbr_abr:var I;R(I=new b,e.VBR_mean_bitrate_kbps),C=I.lowerlimit;break;case v.vbr_rh:var L=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=e.VBR_q&&e.VBR_q<=9){var H=L[e.VBR_q],N=L[e.VBR_q+1],$=e.VBR_q_frac;C=linear_int(H,N,$)}else C=19500;break;default:L=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=e.VBR_q&&e.VBR_q<=9){H=L[e.VBR_q],N=L[e.VBR_q+1],$=e.VBR_q_frac;C=linear_int(H,N,$)}else C=19500}e.mode!=m.MONO||e.VBR!=v.vbr_off&&e.VBR!=v.vbr_abr||(C*=1.5),e.lowpassfreq=0|C}if(0==e.out_samplerate&&(2*e.lowpassfreq>e.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(i=0|e.lowpassfreq,c=e.in_samplerate,g=44100,c>=48e3?g=48e3:c>=44100?g=44100:c>=32e3?g=32e3:c>=24e3?g=24e3:c>=22050?g=22050:c>=16e3?g=16e3:c>=12e3?g=12e3:c>=11025?g=11025:c>=8e3&&(g=8e3),-1==i?g:(i<=15960&&(g=44100),i<=15250&&(g=32e3),i<=11220&&(g=24e3),i<=9970&&(g=22050),i<=7230&&(g=16e3),i<=5420&&(g=12e3),i<=4510&&(g=11025),i<=3970&&(g=8e3),c44100?48e3:c>32e3?44100:c>24e3?32e3:c>22050?24e3:c>16e3?22050:c>12e3?16e3:c>11025?12e3:c>8e3?11025:8e3:g))),e.lowpassfreq=Math.min(20500,e.lowpassfreq),e.lowpassfreq=Math.min(e.out_samplerate/2,e.lowpassfreq),e.VBR==v.vbr_off&&(e.compression_ratio=16*e.out_samplerate*B.channels_out/(1e3*e.brate)),e.VBR==v.vbr_abr&&(e.compression_ratio=16*e.out_samplerate*B.channels_out/(1e3*e.VBR_mean_bitrate_kbps)),e.bWriteVbrTag||(e.findReplayGain=!1,e.decode_on_the_fly=!1,B.findPeakSample=!1),B.findReplayGain=e.findReplayGain,B.decode_on_the_fly=e.decode_on_the_fly,B.decode_on_the_fly&&(B.findPeakSample=!0),B.findReplayGain&&t.InitGainAnalysis(B.rgdata,e.out_samplerate)==y.INIT_GAIN_ANALYSIS_ERROR)return e.internal_flags=null,-6;switch(B.decode_on_the_fly&&!e.decode_only&&(null!=B.hip&&u.hip_decode_exit(B.hip),B.hip=u.hip_decode_init()),B.mode_gr=e.out_samplerate<=24e3?1:2,e.framesize=576*B.mode_gr,e.encoder_delay=F.ENCDELAY,B.resample_ratio=e.in_samplerate/e.out_samplerate,e.VBR){case v.vbr_mt:case v.vbr_rh:case v.vbr_mtrh:e.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][e.VBR_q];break;case v.vbr_abr:e.compression_ratio=16*e.out_samplerate*B.channels_out/(1e3*e.VBR_mean_bitrate_kbps);break;default:e.compression_ratio=16*e.out_samplerate*B.channels_out/(1e3*e.brate)}if(e.mode==m.NOT_SET&&(e.mode=m.JOINT_STEREO),e.highpassfreq>0?(B.highpass1=2*e.highpassfreq,e.highpasswidth>=0?B.highpass2=2*(e.highpassfreq+e.highpasswidth):B.highpass2=2*e.highpassfreq,B.highpass1/=e.out_samplerate,B.highpass2/=e.out_samplerate):(B.highpass1=0,B.highpass2=0),e.lowpassfreq>0?(B.lowpass2=2*e.lowpassfreq,e.lowpasswidth>=0?(B.lowpass1=2*(e.lowpassfreq-e.lowpasswidth),B.lowpass1<0&&(B.lowpass1=0)):B.lowpass1=2*e.lowpassfreq,B.lowpass1/=e.out_samplerate,B.lowpass2/=e.out_samplerate):(B.lowpass1=0,B.lowpass2=0),function(e){var t=e.internal_flags,n=32,r=-1;if(t.lowpass1>0){for(var a=999,i=0;i<=31;i++){(c=i/31)>=t.lowpass2&&(n=Math.min(n,i)),t.lowpass10&&t.highpass2<.75/31*.9&&(t.highpass1=0,t.highpass2=0,_.err.println("Warning: highpass filter disabled. highpass frequency too small\n")),t.highpass2>0){var s=-1;for(i=0;i<=31;i++){(c=i/31)<=t.highpass1&&(r=Math.max(r,i)),t.highpass1t.highpass1?S((t.highpass2-c)/(t.highpass2-t.highpass1+1e-20)):1,l=t.lowpass2>t.lowpass1?S((c-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[i]=o*l}}(e),B.samplerate_index=x(e.out_samplerate,e),B.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==v.vbr_off){if(e.free_format)B.bitrate_index=0;else if(e.brate=M(e.brate,e.version,e.out_samplerate),B.bitrate_index=T(e.brate,e.version,e.out_samplerate),B.bitrate_index<=0)return e.internal_flags=null,-1}else B.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=B.pinfo&&(e.bWriteVbrTag=!1),n.init_bit_stream_w(B);for(var D,j=B.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),V=0;V5&&(e.quality=5),B.PSY.mask_adjust=e.maskingadjust,B.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?B.sfb21_extra=!1:B.sfb21_extra=e.out_samplerate>44e3,B.iteration_loop=new VBRNewIterationLoop(s);break;case v.vbr_rh:r.apply_preset(e,500-10*e.VBR_q,0),B.PSY.mask_adjust=e.maskingadjust,B.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?B.sfb21_extra=!1:B.sfb21_extra=e.out_samplerate>44e3,e.quality>6&&(e.quality=6),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),B.iteration_loop=new VBROldIterationLoop(s);break;default:var X;B.sfb21_extra=!1,e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),(X=e.VBR)==v.vbr_off&&(e.VBR_mean_bitrate_kbps=e.brate),r.apply_preset(e,e.VBR_mean_bitrate_kbps,0),e.VBR=X,B.PSY.mask_adjust=e.maskingadjust,B.PSY.mask_adjust_short=e.maskingadjust_short,X==v.vbr_off?B.iteration_loop=new O(s):B.iteration_loop=new ABRIterationLoop(s)}if(e.VBR!=v.vbr_off){if(B.VBR_min_bitrate=1,B.VBR_max_bitrate=14,e.out_samplerate<16e3&&(B.VBR_max_bitrate=8),0!=e.VBR_min_bitrate_kbps&&(e.VBR_min_bitrate_kbps=M(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),B.VBR_min_bitrate=T(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),B.VBR_min_bitrate<0))return-1;if(0!=e.VBR_max_bitrate_kbps&&(e.VBR_max_bitrate_kbps=M(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),B.VBR_max_bitrate=T(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),B.VBR_max_bitrate<0))return-1;e.VBR_min_bitrate_kbps=k.bitrate_table[e.version][B.VBR_min_bitrate],e.VBR_max_bitrate_kbps=k.bitrate_table[e.version][B.VBR_max_bitrate],e.VBR_mean_bitrate_kbps=Math.min(k.bitrate_table[e.version][B.VBR_max_bitrate],e.VBR_mean_bitrate_kbps),e.VBR_mean_bitrate_kbps=Math.max(k.bitrate_table[e.version][B.VBR_min_bitrate],e.VBR_mean_bitrate_kbps)}return e.tune&&(B.PSY.mask_adjust+=e.tune_value_a,B.PSY.mask_adjust_short+=e.tune_value_a),function(e){var t=e.internal_flags;switch(e.quality){default:case 9:t.psymodel=0,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 8:e.quality=7;case 7:t.psymodel=1,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 6:case 5:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=0,t.full_outer_loop=0;break;case 4:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 3:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 2:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 1:case 0:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=2,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0}}(e),e.athaa_type<0?B.ATH.useAdjust=3:B.ATH.useAdjust=e.athaa_type,B.ATH.aaSensitivityP=Math.pow(10,e.athaa_sensitivity/-10),null==e.short_blocks&&(e.short_blocks=h.short_block_allowed),e.short_blocks!=h.short_block_allowed||e.mode!=m.JOINT_STEREO&&e.mode!=m.STEREO||(e.short_blocks=h.short_block_coupled),e.quant_comp<0&&(e.quant_comp=1),e.quant_comp_short<0&&(e.quant_comp_short=0),e.msfix<0&&(e.msfix=0),e.exp_nspsytune=1|e.exp_nspsytune,e.internal_flags.nsPsy.attackthre<0&&(e.internal_flags.nsPsy.attackthre=Z.NSATTACKTHRE),e.internal_flags.nsPsy.attackthre_s<0&&(e.internal_flags.nsPsy.attackthre_s=Z.NSATTACKTHRE_S),e.scale<0&&(e.scale=1),e.ATHtype<0&&(e.ATHtype=4),e.ATHcurve<0&&(e.ATHcurve=4),e.athaa_loudapprox<0&&(e.athaa_loudapprox=2),e.interChRatio<0&&(e.interChRatio=0),null==e.useTemporal&&(e.useTemporal=!0),B.slot_lag=B.frac_SpF=0,e.VBR==v.vbr_off&&(B.slot_lag=B.frac_SpF=72e3*(e.version+1)*e.brate%e.out_samplerate|0),a.iteration_init(e),p.psymodel_init(e),0},this.lame_encode_flush=function(e,t,r,a){var i,s,o,l,u=e.internal_flags,_=c([2,1152]),p=0,h=u.mf_samples_to_encode-F.POSTDELAY,d=B(e);if(u.mf_samples_to_encode<1)return 0;for(i=0,e.in_samplerate!=e.out_samplerate&&(h+=16*e.out_samplerate/e.in_samplerate),(o=e.framesize-h%e.framesize)<576&&(o+=e.framesize),e.encoder_padding=o,l=(h+o)/e.framesize;l>0&&p>=0;){var v=d-u.mf_size,m=e.frameNum;v*=e.in_samplerate,(v/=e.out_samplerate)>1152&&(v=1152),v<1&&(v=1),s=a-i,0==a&&(s=0),r+=p=this.lame_encode_buffer(e,_[0],_[1],v,t,r,s),i+=p,l-=m!=e.frameNum?1:0}if(u.mf_samples_to_encode=0,p<0)return p;if(s=a-i,0==a&&(s=0),n.flush_bitstream(e),(p=n.copy_buffer(u,t,r,s,1))<0)return p;if(r+=p,s=a-(i+=p),0==a&&(s=0),e.write_id3tag_automatic){if(f.id3tag_write_v1(e),(p=n.copy_buffer(u,t,r,s,0))<0)return p;i+=p}return i},this.lame_encode_buffer=function(e,r,a,s,o,l,c){var f=e.internal_flags,u=[null,null];if(f.Class_ID!=w)return-3;if(0==s)return 0;!function(e,t){(null==e.in_buffer_0||e.in_buffer_nsamples1&&(u[1][_]=a[_]);return function(e,r,a,i,s,o,l){var c,f,u,_,p,h=e.internal_flags,d=0,v=[null,null],m=[null,null];if(h.Class_ID!=w)return-3;if(0==i)return 0;if((p=n.copy_buffer(h,s,o,l,0))<0)return p;if(o+=p,d+=p,m[0]=r,m[1]=a,A.NEQ(e.scale,0)&&A.NEQ(e.scale,1))for(f=0;f0;){var g,S,x=[null,null];x[0]=m[0],x[1]=m[1];var M=new L;if(D(e,v,x,b,i,M),g=M.n_in,S=M.n_out,h.findReplayGain&&!h.decode_on_the_fly&&t.AnalyzeSamples(h.rgdata,v[0],h.mf_size,v[1],h.mf_size,S,h.channels_out)==y.GAIN_ANALYSIS_ERROR)return-6;if(i-=g,b+=g,h.channels_out,h.mf_size+=S,h.mf_samples_to_encode<1&&(h.mf_samples_to_encode=F.ENCDELAY+F.POSTDELAY),h.mf_samples_to_encode+=S,h.mf_size>=_){var k=l-d;if(0==l&&(k=0),(c=I(e,v[0],v[1],s,o,k))<0)return c;for(o+=c,d+=c,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,u=0;uT&&(T=t.length,B=n(R=0|1.25*T+7200));var i=a.lame_encode_buffer(k,t,r,t.length,B,0,R);return new Int8Array(B.subarray(0,i))},this.flush=function(){var e=a.lame_encode_flush(k,B,0,R);return new Int8Array(B.subarray(0,e))}}}e(),Recorder.lamejs=e}()},function(e,t,n){"use strict";var r,a;r=function(e){return new a(e)},(a=function(e){var t={scale:2,speed:8,lineWidth:3,linear1:[0,"rgba(150,96,238,1)",.2,"rgba(170,79,249,1)",1,"rgba(53,199,253,1)"],linear2:[0,"rgba(209,130,255,0.6)",1,"rgba(53,199,255,0.6)"],linearBg:[0,"rgba(255,255,255,0.2)",1,"rgba(54,197,252,0.2)"]};for(var n in e)t[n]=e[n];this.set=e=t;var r=e.elem;r&&("string"==typeof r?r=document.querySelector(r):r.length&&(r=r[0])),r&&(e.width=r.offsetWidth,e.height=r.offsetHeight);var a=e.scale,i=e.width*a,s=e.height*a,o=this.elem=document.createElement("div"),l=["","transform-origin:0 0;","transform:scale("+1/a+");"];o.innerHTML='
';var c=this.canvas=o.querySelector("canvas"),f=this.ctx=c.getContext("2d");c.width=i,c.height=s,this.linear1=this.genLinear(f,i,e.linear1),this.linear2=this.genLinear(f,i,e.linear2),this.linearBg=this.genLinear(f,s,e.linearBg,!0),r&&(r.innerHTML="",r.appendChild(o)),this._phase=0}).prototype=r.prototype={genLinear:function(e,t,n,r){for(var a=e.createLinearGradient(0,0,r?0:t,r?t:0),i=0;i=0;p--,h-=i)a.lineTo(h,_[p]);a.closePath(),a.fillStyle=this.linearBg,a.fill(),this.drawPath(_,this.linear2),this.drawPath(u,this.linear1)},drawPath:function(e,t){var n=this.set,r=this.ctx,a=n.scale,i=n.width*a;r.beginPath();for(var s=0,o=0;o'+n.play+" "+t.getTime()+" "+e};r("");var a=this.$refs.LogAudioPlayer;a.controls=!0,a.ended||a.paused||a.pause(),a.onerror=function(e){r('播放失败['+a.error.code+"]"+a.error.message+"")},a.src=(window.URL||webkitURL).createObjectURL(n.res.blob),a.play()},recdown:function(e){var t=this.logs[this.logs.length-e-1];t.down=(t.down||0)+1;var n="rec-"+(t=t.res).duration+"ms-"+(t.rec.set.bitRate||"-")+"kbps-"+(t.rec.set.sampleRate||"-")+"hz."+(t.rec.set.type||(/\w+$/.exec(t.blob.type)||[])[0]||"unknown"),r=document.createElement("A");r.href=(window.URL||webkitURL).createObjectURL(t.blob),r.download=n,r.click()},recdown64:function(e){var t=this.logs[this.logs.length-e-1],n=new FileReader;n.onloadend=function(){t.down64Val=n.result},n.readAsDataURL(t.res.blob)},getTime:function(){var e=new Date;return("0"+e.getHours()).substr(-2)+":"+("0"+e.getMinutes()).substr(-2)+":"+("0"+e.getSeconds()).substr(-2)},intp:function(e,t){return(e=null==e?"-":e+"").length>=t?e:("_______"+e).substr(-t)},showDialog:function(){/mobile/i.test(navigator.userAgent)&&(this.recOpenDialogShow=1)},dialogCancel:function(){clearTimeout(this.dialogInt),this.recOpenDialogShow=0},waitDialogClick:function(){this.dialogCancel(),this.waitDialogClickFn()}}}},function(e,t,n){var r=n(18);"string"==typeof r&&(r=[[e.i,r,""]]);var a={insert:"head",singleton:!1};n(20)(r,a);r.locals&&(e.exports=r.locals)},function(e,t,n){"use strict";var r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};r=function(){return this}();try{r=r||new Function("return this")()}catch(e){"object"===("undefined"==typeof window?"undefined":a(window))&&(r=window)}e.exports=r},function(e,t,n){"use strict";var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"main"},[e._t("top"),e._v(" "),n("div",{staticClass:"mainBox"},[n("div",[e._v("\r\n 类型:"+e._s(e.type)+"\r\n "),n("span",{staticStyle:{margin:"0 20px"}},[e._v("\r\n 比特率: "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.bitRate,expression:"bitRate"}],staticStyle:{width:"60px"},attrs:{type:"text"},domProps:{value:e.bitRate},on:{input:function(t){t.target.composing||(e.bitRate=t.target.value)}}}),e._v(" kbps\r\n ")]),e._v("\r\n 采样率: "),n("input",{directives:[{name:"model",rawName:"v-model",value:e.sampleRate,expression:"sampleRate"}],staticStyle:{width:"60px"},attrs:{type:"text"},domProps:{value:e.sampleRate},on:{input:function(t){t.target.composing||(e.sampleRate=t.target.value)}}}),e._v(" hz\r\n ")]),e._v(" "),n("div",[n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recOpen}},[e._v("打开录音,请求权限")]),e._v(" "),n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recStart}},[e._v("开始录音")]),e._v(" "),n("button",{staticClass:"mainBtn ctrlBtn",on:{click:e.recStop}},[e._v("结束录音,并释放资源")])])]),e._v(" "),n("div",{staticClass:"mainBox"},[n("div",{staticClass:"ctrlProcessWave",staticStyle:{height:"100px",width:"300px",border:"1px solid #ccc","box-sizing":"border-box",display:"inline-block","vertical-align":"bottom"}}),e._v(" "),n("div",{staticStyle:{height:"40px",width:"300px",display:"inline-block",background:"#999",position:"relative","vertical-align":"bottom"}},[n("div",{staticClass:"ctrlProcessX",staticStyle:{height:"40px",background:"#0B1",position:"absolute"},style:{width:e.powerLevel+"%"}}),e._v(" "),n("div",{staticClass:"ctrlProcessT",staticStyle:{"padding-left":"50px","line-height":"40px",position:"relative"}},[e._v(e._s(e.duration+"/"+e.powerLevel))])])]),e._v(" "),n("div",{staticClass:"mainBox"},[n("audio",{ref:"LogAudioPlayer",staticStyle:{width:"100%"}}),e._v(" "),n("div",{staticClass:"mainLog"},e._l(e.logs,(function(t){return n("div",{key:t.idx},[n("div",{style:{color:1==t.color?"red":2==t.color?"green":t.color}},[e._o(n("span",[e._v("["+e._s(e.getTime())+"]")]),0,t.idx),n("span",{domProps:{innerHTML:e._s(t.msg)}}),e._v(" "),t.res?[e._v("\r\n "+e._s(e.intp(t.res.rec.set.bitRate,3))+"kbps\r\n "+e._s(e.intp(t.res.rec.set.sampleRate,5))+"hz\r\n 编码"+e._s(e.intp(t.res.blob.size,6))+"b\r\n ["+e._s(t.res.rec.set.type)+"]"+e._s(e.intp(t.res.duration,6))+"ms \r\n \r\n "),n("button",{on:{click:function(n){return e.recdown(t.idx)}}},[e._v("下载")]),e._v(" "),n("button",{on:{click:function(n){return e.recplay(t.idx)}}},[e._v("播放")]),e._v(" "),n("span",{domProps:{innerHTML:e._s(t.playMsg)}}),e._v(" "),t.down?n("span",[n("span",{staticStyle:{color:"red"}},[e._v(e._s(t.down))]),e._v("\r\n \r\n 没弹下载?试一下链接或复制文本"),n("button",{on:{click:function(n){return e.recdown64(t.idx)}}},[e._v("生成Base64文本")]),e._v(" "),t.down64Val?n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.down64Val,expression:"obj.down64Val"}],domProps:{value:t.down64Val},on:{input:function(n){n.target.composing||e.$set(t,"down64Val",n.target.value)}}}):e._e()]):e._e()]:e._e()],2)])})),0)]),e._v(" "),e.recOpenDialogShow?n("div",{staticStyle:{"z-index":"99999",width:"100%",height:"100%",top:"0",left:"0",position:"fixed",background:"rgba(0,0,0,0.3)"}},[n("div",{staticStyle:{display:"flex",height:"100%","align-items":"center"}},[n("div",{staticStyle:{flex:"1"}}),e._v(" "),n("div",{staticStyle:{width:"240px",background:"#fff",padding:"15px 20px","border-radius":"10px"}},[n("div",{staticStyle:{"padding-bottom":"10px"}},[e._v("录音功能需要麦克风权限,请允许;如果未看到任何请求,请点击忽略~")]),e._v(" "),n("div",{staticStyle:{"text-align":"center"}},[n("a",{staticStyle:{color:"#0B1"},on:{click:e.waitDialogClick}},[e._v("忽略")])])]),e._v(" "),n("div",{staticStyle:{flex:"1"}})])]):e._e(),e._v(" "),e._t("bottom")],2)},a=[];r._withStripped=!0,n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return a}))},function(e,t,n){"use strict";(function(e){var r,a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e){var t=function(){},n=function(e){return new i(e)};n.IsOpen=function(){var e=n.Stream;if(e){var t=(e.getTracks&&e.getTracks()||e.audioTracks||[])[0];if(t){var r=t.readyState;return"live"==r||r==t.LIVE}}return!1},n.BufferSize=4096,n.Destroy=function(){for(var e in console.log("Recorder Destroy"),r)r[e]()};var r={};n.BindDestroy=function(e,t){r[e]=t},n.Support=function(){var t=e.AudioContext;if(t||(t=e.webkitAudioContext),!t)return!1;var r=navigator.mediaDevices||{};return r.getUserMedia||(r=navigator).getUserMedia||(r.getUserMedia=r.webkitGetUserMedia||r.mozGetUserMedia||r.msGetUserMedia),!!r.getUserMedia&&(n.Scope=r,n.Ctx&&"closed"!=n.Ctx.state||(n.Ctx=new t,n.BindDestroy("Ctx",(function(){var e=n.Ctx;e&&e.close&&e.close()}))),!0)},n.SampleData=function(e,t,n,r,a){r||(r={});var i=r.index||0,s=r.offset||0,o=r.frameNext||[];a||(a={});var l=a.frameSize||1;a.frameType&&(l="mp3"==a.frameType?1152:1);for(var c=0,f=i;f1?c=Math.floor(c/u):(u=1,n=t),c+=o.length;var _=new Int16Array(c),p=0;for(f=0;f0){var w=2*(_.length-y);o=new Int16Array(_.buffer.slice(w)),_=new Int16Array(_.buffer.slice(0,w))}return{index:i,offset:s,frameNext:o,sampleRate:n,data:_}},n.PowerLevel=function(e,t){var n=e/t||0;return n<1251?Math.round(n/1250*10):Math.round(Math.min(100,Math.max(0,100*(1+Math.log(n/1e4)/Math.log(10)))))};var a=0;function i(e){this.id=++a,n.Traffic&&n.Traffic();var r={type:"mp3",bitRate:16,sampleRate:16e3,onProcess:t};for(var i in e)r[i]=e[i];this.set=r,this._S=9}n.Sync={O:9,C:9},n.prototype=i.prototype={open:function(r,a){var i=this;r=r||t,a=a||t;var s=function(){r(),i._SO=0},o=function(t,n){/Permission|Allow/i.test(t)?a("用户拒绝了录音权限",!0):!1===e.isSecureContext?a("无权录音(需https)"):/Found/i.test(t)?a(n+",无可用麦克风"):a(n)},l=n.Sync,c=++l.O,f=l.C;i._O=i._O_=c,i._SO=i._S;var u=function(){if(f!=l.C||!i._O){var e="open被取消";return c==l.O?i.close():e="open被中断",a(e),!0}};if(n.IsOpen())s();else if(n.Support()){var _=i.envCheck({envName:"H5",canProcess:!0});if(_)a("不能录音:"+_);else{var p=function(e){n.Stream=e,e._call={},u()||setTimeout((function(){u()||(n.IsOpen()?(function(){var e=n.Ctx,t=n.Stream,r=t._m=e.createMediaStreamSource(t),a=t._p=(e.createScriptProcessor||e.createJavaScriptNode).call(e,n.BufferSize,1,1);r.connect(a),a.connect(e.destination);var i=t._call;a.onaudioprocess=function(e){for(var t in i){for(var n=e.inputBuffer.getChannelData(0),r=n.length,a=new Int16Array(r),s=0,o=0;o3e3){d.length=b;break}v=g.t,m+=g.d}var y=d[1],w=p-v;if(w-m>w/3&&(y&&w>1e3||d.length>=6)){var S=p-y.t-h;if(S>h/5){var x=!a.disableEnvInFix;if(console.warn("["+p+"]"+(x?"":"未")+"补偿"+S+"ms"),r.envInFix+=S,x){var k=new Int16Array(S*s/1e3);o+=k.length,c.push(k)}}}var A=r.recSize,M=o,T=A+M;if(r.recSize=T,i){var R=n.SampleData(c,s,a.sampleRate,i.chunkInfo);i.chunkInfo=R,T=(A=i.pcmSize)+(M=R.data.length),i.pcmSize=T,c=i.pcmDatas,f=c.length,c.push(R.data),s=R.sampleRate}var B=Math.round(T/s*1e3),E=c.length,C=u.length,O=function(){for(var e=P?0:-M,t=null==c[0],n=f;n"+d.length+" 花:"+(Date.now()-a)+"ms"),setTimeout((function(){a=Date.now(),i[s.type](d,(function(e){c(e,p)}),(function(e){l(e)}))}))}else l("未加载"+s.type+"编码器");else l("音频被释放");else l("未采集到录音")}},e.Recorder&&e.Recorder.Destroy(),e.Recorder=n,n.LM="2020-5-17 08:21:54",n.TrafficImgUrl="//ia.51.la/go1?id=20469973&pvFlag=1",n.Traffic=function(){var e=n.TrafficImgUrl;if(e){var t=n.Traffic,r=location.href.replace(/#.*/,"");0==e.indexOf("//")&&(e=/^https:/i.test(r)?"https:"+e:"http:"+e),t[r]||(t[r]=1,(new Image).src=e,console.log("Traffic Analysis Image: Recorder.TrafficImgUrl="+n.TrafficImgUrl))}}}(window),void 0===(r=function(){return Recorder}.call(t,n,t,e))||(e.exports=r),"object"==a(e)&&e.exports&&(e.exports=Recorder)}).call(this,n(8)(e))},function(e,t,n){"use strict";function r(e,t,n,r,a,i,s,o){var l,c="function"==typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=n,c._compiled=!0),r&&(c.functional=!0),i&&(c._scopeId="data-v-"+i),s?(l=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),a&&a.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},c._ssrRegister=l):a&&(l=o?function(){a.call(this,this.$root.$options.shadowRoot)}:a),l)if(c.functional){c._injectStyles=l;var f=c.render;c.render=function(e,t){return l.call(t),f(e,t)}}else{var u=c.beforeCreate;c.beforeCreate=u?[].concat(u,l):[l]}return{exports:e,options:c}}n.d(t,"a",(function(){return r}))},function(e,t,n){"use strict";var r=s(n(5));n(9),n(10),n(11);var a=s(n(12)),i=s(n(16));function s(e){return e&&e.__esModule?e:{default:e}}var o=new a.default({el:".rootView",data:{Rec:r.default},components:{MainView:i.default},template:'\n\n \n\n \n\n '}),l=o.$refs.mainView;l.reclog('绿油油的一大片,真有食欲'+unescape("%uD83D%uDE02")+' 当前浏览器支持录音':'red">不支持录音')+"");var c=function(e,t){l.reclog(''+e+": "+t+"")};c("Vue",a.default.version),c("UA",navigator.userAgent),c("URL",location.href.replace(/#.*/g,"")),l.reclog("点击打开录音,然后再点击开始录音",2),window.vue_root=o,window.vue_main=l,console.log("Vue",a.default),console.log("Recorder",r.default)},function(e,t,n){"use strict";e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(){var e;Recorder.prototype.enc_mp3={stable:!0,testmsg:"采样率范围48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000"},Recorder.prototype.mp3=function(e,t,n){var r=this.set,s=e.length,o=this.mp3_start(r);if(o)return this.mp3_encode(o,e),void this.mp3_complete(o,t,n,1);var l=new Recorder.lamejs.Mp3Encoder(1,r.sampleRate,r.bitRate),c=[],f=0,u=0;!function n(){if(f0&&(u+=o.buffer.byteLength,c.push(o.buffer)),f+=57600,setTimeout(n)}else{var o;(o=l.flush()).length>0&&(u+=o.buffer.byteLength,c.push(o.buffer));var _=a.fn(c,u,s,r.sampleRate);i(_,r),t(new Blob(c,{type:"audio/mp3"}))}}()},Recorder.BindDestroy("mp3Worker",(function(){console.log("mp3Worker Destroy"),e&&e.terminate(),e=null})),Recorder.prototype.mp3_envCheck=function(e,t){var r="";return t.takeoffEncodeChunk&&(e.canProcess?n()||(r="当前浏览器版本太低,无法实时处理"):r=e.envName+"环境不支持实时处理"),r},Recorder.prototype.mp3_start=function(e){return n(e)};var t={id:0},n=function(n){var r=e;try{if(!r){var i=");wk_lame();var wk_ctxs={};self.onmessage="+function(e){var t=e.data,n=wk_ctxs[t.id];if("init"==t.action)wk_ctxs[t.id]={sampleRate:t.sampleRate,bitRate:t.bitRate,takeoff:t.takeoff,mp3Size:0,pcmSize:0,encArr:[],encObj:new wk_lame.Mp3Encoder(1,t.sampleRate,t.bitRate)};else if(!n)return;switch(t.action){case"stop":n.encObj=null,delete wk_ctxs[t.id];break;case"encode":n.pcmSize+=t.pcm.length,(r=n.encObj.encodeBuffer(t.pcm)).length>0&&(n.takeoff?self.postMessage({action:"takeoff",id:t.id,chunk:r}):(n.mp3Size+=r.buffer.byteLength,n.encArr.push(r.buffer)));break;case"complete":var r;(r=n.encObj.flush()).length>0&&(n.takeoff?self.postMessage({action:"takeoff",id:t.id,chunk:r}):(n.mp3Size+=r.buffer.byteLength,n.encArr.push(r.buffer)));var a=wk_mp3TrimFix.fn(n.encArr,n.mp3Size,n.pcmSize,n.sampleRate);self.postMessage({action:t.action,id:t.id,blob:new Blob(n.encArr,{type:"audio/mp3"}),meta:a})}};i+=";var wk_mp3TrimFix={rm:"+a.rm+",fn:"+a.fn+"}";var s=Recorder.lamejs.toString(),o=(window.URL||webkitURL).createObjectURL(new Blob(["var wk_lame=(",s,i],{type:"text/javascript"}));r=new Worker(o),setTimeout((function(){(window.URL||webkitURL).revokeObjectURL(o)}),1e4),r.onmessage=function(e){var n=e.data,r=t[n.id];r&&("takeoff"==n.action?r.set.takeoffEncodeChunk(new Uint8Array(n.chunk.buffer)):(r.call&&r.call(n),r.call=null))}}var l={worker:r,set:n,takeoffQueue:[]};return n?(l.id=++t.id,t[l.id]=l,r.postMessage({action:"init",id:l.id,sampleRate:n.sampleRate,bitRate:n.bitRate,takeoff:!!n.takeoffEncodeChunk,x:new Int16Array(5)})):r.postMessage({x:new Int16Array(5)}),e=r,l}catch(e){return r&&r.terminate(),console.error(e),null}};Recorder.prototype.mp3_stop=function(e){if(e&&e.worker){e.worker.postMessage({action:"stop",id:e.id}),e.worker=null,delete t[e.id];var n=-1;for(var r in t)n++;n&&console.warn("mp3 worker剩"+n+"个在串行等待")}},Recorder.prototype.mp3_encode=function(e,t){e&&e.worker&&e.worker.postMessage({action:"encode",id:e.id,pcm:t})},Recorder.prototype.mp3_complete=function(e,t,n,r){var a=this;e&&e.worker?(e.call=function(n){i(n.meta,e.set),t(n.blob),r&&a.mp3_stop(e)},e.worker.postMessage({action:"complete",id:e.id})):n("mp3编码器未打开")},Recorder.mp3ReadMeta=function(e,t){var n="object"==("undefined"==typeof window?"undefined":r(window))?window.parseInt:self.parseInt,a=new Uint8Array(e[0]||[]);if(a.length<4)return null;var i=function(e,t){return("0000000"+((t||a)[e]||0).toString(2)).substr(-8)},s=i(0)+i(1),o=i(2)+i(3);if(!/^1{11}/.test(s))return null;var l={"00":2.5,10:2,11:1}[s.substr(11,2)],c={"01":3}[s.substr(13,2)],f={1:[44100,48e3,32e3],2:[22050,24e3,16e3],2.5:[11025,12e3,8e3]}[l];f&&(f=f[n(o.substr(4,2),2)]);var u=[[0,8,16,24,32,40,48,56,64,80,96,112,128,144,160],[0,32,40,48,56,64,80,96,112,128,160,192,224,256,320]][1==l?1:0][n(o.substr(0,4),2)];if(!(l&&c&&u&&f))return null;for(var _=Math.round(8*t/u),p=1==c?384:2==c||1==l?1152:576,h=p/f*1e3,d=Math.floor(p*u/8/f*1e3),v=0,m=0,b=0;b=d+3){var y=new Uint8Array(g);v="1"==i(g.byteLength-(m-(d+3)+1),y).charAt(6);break}}return v&&d++,{version:l,layer:c,sampleRate:f,bitRate:u,duration:_,size:t,hasPadding:v,frameSize:d,frameDurationFloat:h}};var a={rm:Recorder.mp3ReadMeta,fn:function(e,t,n,r){var a=this.rm(e,t);if(!a)return{err:"mp3非预定格式"};var i=Math.round(n/r*1e3),s=Math.floor((a.duration-i)/a.frameDurationFloat);if(s>0){var o=s*a.frameSize-(a.hasPadding?1:0);t-=o;for(var l=0,c=[],f=0;f=u.byteLength?(o-=u.byteLength,c.push(u),e.splice(f,1),f--):(e[f]=u.slice(o),l=u,o=0)}if(!this.rm(e,t)){l&&(e[0]=l);for(f=0;f "+r.duration+"ms",r.remove>2&&(e.err=(e.err?e.err+", ":"")+"移除帧数过多")):n+=(e.duration||"-")+"ms",e.err?console.error(n,e.err,e):console.log(n,e)}}()},function(e,t,n){"use strict";!function(){function e(){var t=function(e){return Math.log(e)/Math.log(10)};function n(e){return new Int8Array(e)}function r(e){return new Int16Array(e)}function a(e){return new Int32Array(e)}function i(e){return new Float32Array(e)}function s(e){return new Float64Array(e)}function o(e){if(1==e.length)return i(e[0]);var t=e[0];e=e.slice(1);for(var n=[],r=0;r>=1;0!=e--;)a[i++]=s>n[r++]?0:1,a[i++]=s>n[r++]?0:1}function i(t,n,r,a,i,s){var o=(t>>=1)%2;for(t>>=1;0!=t--;){var l,c,f,u,_,p,h,d;l=r[a++]*n,c=r[a++]*n,_=0|l,f=r[a++]*n,p=0|c,u=r[a++]*n,h=0|f,l+=e.adj43[_],d=0|u,c+=e.adj43[p],i[s++]=0|l,f+=e.adj43[h],i[s++]=0|c,u+=e.adj43[d],i[s++]=0|f,i[s++]=0|u}0!=o&&(_=0|(l=r[a++]*n),p=0|(c=r[a++]*n),l+=e.adj43[_],c+=e.adj43[p],i[s++]=0|l,i[s++]=0|c)}var s=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function o(e,t,n,r){var a=function(e,t,n){var r=0,a=0;do{var i=e[t++],s=e[t++];r>=16)>i&&(o=i,r++),a.bits+=o,r}(e,t,n,s[a-1],r);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,n,r,a){var i=0,s=0,o=0,l=M.ht[r].xlen,c=M.ht[r].hlen,f=M.ht[r+1].hlen,u=M.ht[r+2].hlen;do{var _=e[t+0]*l+e[t+1];t+=2,i+=c[_],s+=f[_],o+=u[_]}while(ts&&(i=s,p++),i>o&&(i=o,p=r+2),a.bits+=i,p}(e,t,n,s[a-1],r);default:if(a>L.IXMAX_VAL)return r.bits=L.LARGE_BITS,-1;var i,o;for(a-=15,i=24;i<32&&!(M.ht[i].linmax>=a);i++);for(o=i-8;o<24&&!(M.ht[o].linmax>=a);o++);return function(e,t,n,r,a,i){var s,o=65536*M.ht[r].xlen+M.ht[a].xlen,l=0;do{var c=e[t++],f=e[t++];0!=c&&(c>14&&(c=15,l+=o),c*=16),0!=f&&(f>14&&(f=15,l+=o),c+=f),l+=M.largetbl[c]}while(t>=16)>s&&(l=s,r=a),i.bits+=l,r}(e,t,n,o,i,r)}}function l(e,n,r,a,i,s,l,c){for(var f=n.big_values,u=2;u=f)break;var p=i[u-2]+n.count1bits;if(r.part2_3_length<=p)break;var h=new t(p),d=o(a,_,f,h);p=h.bits,r.part2_3_length<=p||(r.assign(n),r.part2_3_length=p,r.region0_count=s[u-2],r.region1_count=u-2-s[u-2],r.table_select[0]=l[u-2],r.table_select[1]=c[u-2],r.table_select[2]=d)}}this.noquant_count_bits=function(e,n,r){var a=n.l3_enc,i=Math.min(576,n.max_nonzero_coeff+2>>1<<1);for(null!=r&&(r.sfb_count1=0);i>1&&0==(a[i-1]|a[i-2]);i-=2);n.count1=i;for(var s=0,l=0;i>3;i-=4){var c;if((2147483647&(a[i-1]|a[i-2]|a[i-3]|a[i-4]))>1)break;c=2*(2*(2*a[i-4]+a[i-3])+a[i-2])+a[i-1],s+=M.t32l[c],l+=M.t33l[c]}var f=s;if(n.count1table_select=0,s>l&&(f=l,n.count1table_select=1),n.count1bits=f,n.big_values=i,0==i)return f;if(n.block_type==F.SHORT_TYPE)(s=3*e.scalefac_band.s[3])>n.big_values&&(s=n.big_values),l=n.big_values;else if(n.block_type==F.NORM_TYPE){if(s=n.region0_count=e.bv_scf[i-2],l=n.region1_count=e.bv_scf[i-1],l=e.scalefac_band.l[s+l+2],s=e.scalefac_band.l[s+1],l(l=i)&&(s=l);if(s=Math.min(s,i),l=Math.min(l,i),0l)return L.LARGE_BITS;if(function(t,n,a,s,o){var l,c,f,_=0,p=0,h=0,d=0,v=n,m=0,b=v,g=0,y=t,w=0;for(f=null!=o&&s.global_gain==o.global_gain,c=s.block_type==F.SHORT_TYPE?38:21,l=0;l<=c;l++){var S=-1;if((f||s.block_type==F.NORM_TYPE)&&(S=s.global_gain-(s.scalefac[l]+(0!=s.preflag?e.pretab[l]:0)<s.max_nonzero_coeff)x=s.max_nonzero_coeff-_+1,u.fill(n,s.max_nonzero_coeff,576,0),(k=x)<0&&(k=0),l=c+1;if(0==p&&0==h&&(b=v,g=m,y=t,w=d),null!=o&&o.sfb_count1>0&&l>=o.sfb_count1&&o.step[l]>0&&S>=o.step[l]?(0!=p&&(i(p,a,y,w,b,g),p=0,b=v,g=m,y=t,w=d),h+=k):(0!=h&&(r(h,a,y,w,b,g),h=0,b=v,g=m,y=t,w=d),p+=k),k<=0){0!=h&&(r(h,a,y,w,b,g),h=0),0!=p&&(i(p,a,y,w,b,g),p=0);break}}l<=c&&(m+=s.width[l],d+=s.width[l],_+=s.width[l])}0!=p&&(i(p,a,y,w,b,g),p=0),0!=h&&(r(h,a,y,w,b,g),h=0)}(n,o,e.IPOW20(a.global_gain),a,s),0!=(2&t.substep_shaping))for(var c=0,f=a.global_gain+a.scalefac_scale,_=.634521682242439/e.IPOW20(f),p=0;p=_?o[h]:0}return this.noquant_count_bits(t,a,s)},this.best_huffman_divide=function(e,n){var r=new H,i=n.l3_enc,s=a(23),c=a(23),f=a(23),u=a(23);if(n.block_type!=F.SHORT_TYPE||1!=e.mode_gr){r.assign(n),n.block_type==F.NORM_TYPE&&(!function(e,n,r,a,i,s,l){for(var c=n.big_values,f=0;f<=22;f++)a[f]=L.LARGE_BITS;for(f=0;f<16;f++){var u=e.scalefac_band.l[f+1];if(u>=c)break;var _=0,p=new t(_),h=o(r,0,u,p);_=p.bits;for(var d=0;d<8;d++){var v=e.scalefac_band.l[f+d+2];if(v>=c)break;var m=_,b=o(r,u,v,p=new t(m));m=p.bits,a[f+d]>m&&(a[f+d]=m,i[f+d]=f,s[f+d]=h,l[f+d]=b)}}}(e,n,i,s,c,f,u),l(e,r,n,i,s,c,f,u));var _=r.big_values;if(!(0==_||(i[_-2]|i[_-1])>1||(_=n.count1+2)>576)){r.assign(n),r.count1=_;for(var p=0,h=0;_>r.big_values;_-=4){var d=2*(2*(2*i[_-4]+i[_-3])+i[_-2])+i[_-1];p+=M.t32l[d],h+=M.t33l[d]}if(r.big_values=_,r.count1table_select=0,p>h&&(p=h,r.count1table_select=1),r.count1bits=p,r.block_type==F.NORM_TYPE)l(e,r,n,i,s,c,f,u);else{if(r.part2_3_length=p,(p=e.scalefac_band.l[8])>_&&(p=_),p>0){var v=new t(r.part2_3_length);r.table_select[0]=o(i,0,p,v),r.part2_3_length=v.bits}if(_>p){v=new t(r.part2_3_length);r.table_select[1]=o(i,p,_,v),r.part2_3_length=v.bits}n.part2_3_length>r.part2_3_length&&n.assign(r)}}}};var c=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],f=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],p=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],h=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];g.slen1_tab=p,g.slen2_tab=h,this.best_scalefac_store=function(t,n,r,a){var i,s,o,l,u=a.tt[n][r],_=0;for(o=0,i=0;i0&&(v|=u.scalefac[i]);if(0==(1&v)&&0!=v){for(i=0;i0&&(u.scalefac[i]>>=1);u.scalefac_scale=_=1}}if(0==u.preflag&&u.block_type!=F.SHORT_TYPE&&2==t.mode_gr){for(i=11;i0&&(u.scalefac[i]-=e.pretab[i]);u.preflag=_=1}}for(s=0;s<4;s++)a.scfsi[r][s]=0;for(2==t.mode_gr&&1==n&&a.tt[0][r].block_type!=F.SHORT_TYPE&&a.tt[1][r].block_type!=F.SHORT_TYPE&&(!function(e,t){for(var n,r=t.tt[1][e],a=t.tt[0][e],i=0;i=0);n++);if(n==M.scfsi_band[i+1]){for(n=M.scfsi_band[i];n_&&(r.part2_length=_,r.scalefac_compress=i)}}(r,a),_=0),i=0;ia[n]&&(t.part2_length=a[n],t.scalefac_compress=n);return t.part2_length==L.LARGE_BITS};var b=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(t,n){var r,i,s,o,l,c,f,u,p=a(4),h=n.scalefac;for(r=0!=n.preflag?2:0,f=0;f<4;f++)p[f]=0;if(n.block_type==F.SHORT_TYPE){i=1;var d=e.nr_of_sfb_block[r][i];for(u=0,s=0;s<4;s++)for(o=d[s]/3,f=0;fp[s]&&(p[s]=h[3*u+l])}else{i=0;d=e.nr_of_sfb_block[r][i];for(u=0,s=0;s<4;s++)for(o=d[s],f=0;fp[s]&&(p[s]=h[u])}for(c=!1,s=0;s<4;s++)p[s]>b[r][s]&&(c=!0);if(!c){var v,m,g,w;for(n.sfb_partition_table=e.nr_of_sfb_block[r][i],s=0;s<4;s++)n.slen[s]=y[p[s]];switch(v=n.slen[0],m=n.slen[1],g=n.slen[2],w=n.slen[3],r){case 0:n.scalefac_compress=(5*v+m<<4)+(g<<2)+w;break;case 1:n.scalefac_compress=400+(5*v+m<<2)+g;break;case 2:n.scalefac_compress=500+3*v+m;break;default:_.err.printf("intensity stereo not implemented yet\n")}}if(!c)for(n.part2_length=0,s=0;s<4;s++)n.part2_length+=n.slen[s]*n.sfb_partition_table[s];return c};var y=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var r,a=0;e.scalefac_band.l[++a]t;)r--;for(r<0&&(r=n[a][0]),e.bv_scf[t-2]=r,r=n[a][1];e.scalefac_band.l[r+e.bv_scf[t-2]+2]>t;)r--;r<0&&(r=n[a][1]),e.bv_scf[t-1]=r}}}function y(){}function w(){function e(e,t,n,r,a,i,s,o,l,c,f,u,_,p,h){this.vbr_q=e,this.quant_comp=t,this.quant_comp_s=n,this.expY=r,this.st_lrm=a,this.st_s=i,this.masking_adj=s,this.masking_adj_short=o,this.ath_lower=l,this.ath_curve=c,this.ath_sensitivity=f,this.interch=u,this.safejoint=_,this.sfb21mod=p,this.msfix=h}function t(e,t,n,r,a,i,s,o,l,c,f,u,_,p){this.quant_comp=t,this.quant_comp_s=n,this.safejoint=r,this.nsmsfix=a,this.st_lrm=i,this.st_s=s,this.nsbass=o,this.scale=l,this.masking_adj=c,this.ath_lower=f,this.ath_curve=u,this.interch=_,this.sfscale=p}var n;this.setModules=function(e){n=e};var r=[new e(0,9,9,0,5.2,125,-4.2,-6.3,4.8,1,0,0,2,21,.97),new e(1,9,9,0,5.3,125,-3.6,-5.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,5.6,125,-2.2,-3.5,2.8,2,0,0,2,21,1.49),new e(3,9,9,1,5.8,130,-1.8,-2.8,2.6,3,-4,0,2,20,1.64),new e(4,9,9,1,6,135,-.7,-1.1,1.1,3.5,-8,0,2,0,1.79),new e(5,9,9,1,6.4,140,.5,.4,-7.5,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,6.6,145,.67,.65,-14.7,6.5,-19,4e-4,0,0,2.3),new e(7,9,9,1,6.6,145,.8,.75,-19.7,8,-22,6e-4,0,0,2.7),new e(8,9,9,1,6.6,145,1.2,1.15,-27.5,10,-23,7e-4,0,0,0),new e(9,9,9,1,6.6,145,1.6,1.6,-36,11,-25,8e-4,0,0,0),new e(10,9,9,1,6.6,145,2,2,-36,12,-25,8e-4,0,0,0)],a=[new e(0,9,9,0,4.2,25,-7,-4,7.5,1,0,0,2,26,.97),new e(1,9,9,0,4.2,25,-5.6,-3.6,4.5,1.5,0,0,2,21,1.35),new e(2,9,9,0,4.2,25,-4.4,-1.8,2,2,0,0,2,18,1.49),new e(3,9,9,1,4.2,25,-3.4,-1.25,1.1,3,-4,0,2,15,1.64),new e(4,9,9,1,4.2,25,-2.2,.1,0,3.5,-8,0,2,0,1.79),new e(5,9,9,1,4.2,25,-1,1.65,-7.7,4,-12,2e-4,0,0,1.95),new e(6,9,9,1,4.2,25,-0,2.47,-7.7,6.5,-19,4e-4,0,0,2),new e(7,9,9,1,4.2,25,.5,2,-14.5,8,-22,6e-4,0,0,2),new e(8,9,9,1,4.2,25,1,2.4,-22,10,-23,7e-4,0,0,2),new e(9,9,9,1,4.2,25,1.5,2.95,-30,11,-25,8e-4,0,0,2),new e(10,9,9,1,4.2,25,2,2.95,-36,12,-30,8e-4,0,0,2)];function i(e,t,n){var i=e.VBR==v.vbr_rh?r:a,s=e.VBR_q_frac,o=i[t],l=i[t+1],c=o;o.st_lrm=o.st_lrm+s*(l.st_lrm-o.st_lrm),o.st_s=o.st_s+s*(l.st_s-o.st_s),o.masking_adj=o.masking_adj+s*(l.masking_adj-o.masking_adj),o.masking_adj_short=o.masking_adj_short+s*(l.masking_adj_short-o.masking_adj_short),o.ath_lower=o.ath_lower+s*(l.ath_lower-o.ath_lower),o.ath_curve=o.ath_curve+s*(l.ath_curve-o.ath_curve),o.ath_sensitivity=o.ath_sensitivity+s*(l.ath_sensitivity-o.ath_sensitivity),o.interch=o.interch+s*(l.interch-o.interch),o.msfix=o.msfix+s*(l.msfix-o.msfix),function(e,t){var n=0;0>t&&(n=-1,t=0);90||(e.quant_comp=c.quant_comp),0!=n?e.quant_comp_short=c.quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=c.quant_comp_s),0!=c.expY&&(e.experimentalY=0!=c.expY),0!=n?e.internal_flags.nsPsy.attackthre=c.st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=c.st_lrm),0!=n?e.internal_flags.nsPsy.attackthre_s=c.st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=c.st_s),0!=n?e.maskingadjust=c.masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=c.masking_adj),0!=n?e.maskingadjust_short=c.masking_adj_short:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=c.masking_adj_short),0!=n?e.ATHlower=-c.ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-c.ath_lower/10),0!=n?e.ATHcurve=c.ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=c.ath_curve),0!=n?e.athaa_sensitivity=c.ath_sensitivity:Math.abs(e.athaa_sensitivity- -1)>0||(e.athaa_sensitivity=c.ath_sensitivity),c.interch>0&&(0!=n?e.interChRatio=c.interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=c.interch)),c.safejoint>0&&(e.exp_nspsytune=e.exp_nspsytune|c.safejoint),c.sfb21mod>0&&(e.exp_nspsytune=e.exp_nspsytune|c.sfb21mod<<20),0!=n?e.msfix=c.msfix:Math.abs(e.msfix- -1)>0||(e.msfix=c.msfix),0==n&&(e.VBR_q=t,e.VBR_q_frac=s)}var s=[new t(8,9,9,0,0,6.6,145,0,.95,0,-30,11,.0012,1),new t(16,9,9,0,0,6.6,145,0,.95,0,-25,11,.001,1),new t(24,9,9,0,0,6.6,145,0,.95,0,-20,11,.001,1),new t(32,9,9,0,0,6.6,145,0,.95,0,-15,11,.001,1),new t(40,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(48,9,9,0,0,6.6,145,0,.95,0,-10,11,9e-4,1),new t(56,9,9,0,0,6.6,145,0,.95,0,-6,11,8e-4,1),new t(64,9,9,0,0,6.6,145,0,.95,0,-2,11,8e-4,1),new t(80,9,9,0,0,6.6,145,0,.95,0,0,8,7e-4,1),new t(96,9,9,0,2.5,6.6,145,0,.95,0,1,5.5,6e-4,1),new t(112,9,9,0,2.25,6.6,145,0,.95,0,2,4.5,5e-4,1),new t(128,9,9,0,1.95,6.4,140,0,.95,0,3,4,2e-4,1),new t(160,9,9,1,1.79,6,135,0,.95,-2,5,3.5,0,1),new t(192,9,9,1,1.49,5.6,125,0,.97,-4,7,3,0,0),new t(224,9,9,1,1.25,5.2,125,0,.98,-6,9,2,0,0),new t(256,9,9,1,.97,5.2,125,0,1,-8,10,1,0,0),new t(320,9,9,1,.9,5.2,125,0,1,-10,12,0,0,0)];function o(e,t,r){var a=t,i=n.nearestBitrateFullIndex(t);if(e.VBR=v.vbr_abr,e.VBR_mean_bitrate_kbps=a,e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320),e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.brate=e.VBR_mean_bitrate_kbps,e.VBR_mean_bitrate_kbps>320&&(e.disable_reservoir=!0),s[i].safejoint>0&&(e.exp_nspsytune=2|e.exp_nspsytune),s[i].sfscale>0&&(e.internal_flags.noise_shaping=2),Math.abs(s[i].nsbass)>0){var o=int(4*s[i].nsbass);o<0&&(o+=64),e.exp_nspsytune=e.exp_nspsytune|o<<2}return 0!=r?e.quant_comp=s[i].quant_comp:Math.abs(e.quant_comp- -1)>0||(e.quant_comp=s[i].quant_comp),0!=r?e.quant_comp_short=s[i].quant_comp_s:Math.abs(e.quant_comp_short- -1)>0||(e.quant_comp_short=s[i].quant_comp_s),0!=r?e.msfix=s[i].nsmsfix:Math.abs(e.msfix- -1)>0||(e.msfix=s[i].nsmsfix),0!=r?e.internal_flags.nsPsy.attackthre=s[i].st_lrm:Math.abs(e.internal_flags.nsPsy.attackthre- -1)>0||(e.internal_flags.nsPsy.attackthre=s[i].st_lrm),0!=r?e.internal_flags.nsPsy.attackthre_s=s[i].st_s:Math.abs(e.internal_flags.nsPsy.attackthre_s- -1)>0||(e.internal_flags.nsPsy.attackthre_s=s[i].st_s),0!=r?e.scale=s[i].scale:Math.abs(e.scale- -1)>0||(e.scale=s[i].scale),0!=r?e.maskingadjust=s[i].masking_adj:Math.abs(e.maskingadjust-0)>0||(e.maskingadjust=s[i].masking_adj),s[i].masking_adj>0?0!=r?e.maskingadjust_short=.9*s[i].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=.9*s[i].masking_adj):0!=r?e.maskingadjust_short=1.1*s[i].masking_adj:Math.abs(e.maskingadjust_short-0)>0||(e.maskingadjust_short=1.1*s[i].masking_adj),0!=r?e.ATHlower=-s[i].ath_lower/10:Math.abs(10*-e.ATHlower-0)>0||(e.ATHlower=-s[i].ath_lower/10),0!=r?e.ATHcurve=s[i].ath_curve:Math.abs(e.ATHcurve- -1)>0||(e.ATHcurve=s[i].ath_curve),0!=r?e.interChRatio=s[i].interch:Math.abs(e.interChRatio- -1)>0||(e.interChRatio=s[i].interch),t}this.apply_preset=function(e,t,n){switch(t){case G.R3MIX:t=G.V3,e.VBR=v.vbr_mtrh;break;case G.MEDIUM:t=G.V4,e.VBR=v.vbr_rh;break;case G.MEDIUM_FAST:t=G.V4,e.VBR=v.vbr_mtrh;break;case G.STANDARD:t=G.V2,e.VBR=v.vbr_rh;break;case G.STANDARD_FAST:t=G.V2,e.VBR=v.vbr_mtrh;break;case G.EXTREME:t=G.V0,e.VBR=v.vbr_rh;break;case G.EXTREME_FAST:t=G.V0,e.VBR=v.vbr_mtrh;break;case G.INSANE:return t=320,e.preset=t,o(e,t,n),e.VBR=v.vbr_off,t}switch(e.preset=t,t){case G.V9:return i(e,9,n),t;case G.V8:return i(e,8,n),t;case G.V7:return i(e,7,n),t;case G.V6:return i(e,6,n),t;case G.V5:return i(e,5,n),t;case G.V4:return i(e,4,n),t;case G.V3:return i(e,3,n),t;case G.V2:return i(e,2,n),t;case G.V1:return i(e,1,n),t;case G.V0:return i(e,0,n),t}return 8<=t&&t<=320?o(e,t,n):(e.preset=0,t)}}function S(){var e;this.setModules=function(t){e=t},this.ResvFrameBegin=function(t,n){var r,a=t.internal_flags,i=a.l3_side,s=e.getframebits(t);n.bits=(s-8*a.sideinfo_len)/a.mode_gr;var o=2048*a.mode_gr-8;t.brate>320?r=8*int(1e3*t.brate/(t.out_samplerate/1152)/8+.5):(r=11520,t.strict_ISO&&(r=8*int(32e4/(t.out_samplerate/1152)/8+.5))),a.ResvMax=r-s,a.ResvMax>o&&(a.ResvMax=o),(a.ResvMax<0||t.disable_reservoir)&&(a.ResvMax=0);var l=n.bits*a.mode_gr+Math.min(a.ResvSize,a.ResvMax);return l>r&&(l=r),i.resvDrain_pre=0,null!=a.pinfo&&(a.pinfo.mean_bits=n.bits/2,a.pinfo.resvsize=a.ResvSize),l},this.ResvMaxBits=function(e,t,n,r){var a,i=e.internal_flags,s=i.ResvSize,o=i.ResvMax;0!=r&&(s+=t),0!=(1&i.substep_shaping)&&(o*=.9),n.bits=t,10*s>9*o?(a=s-9*o/10,n.bits+=a,i.substep_shaping|=128):(a=0,i.substep_shaping&=127,e.disable_reservoir||0!=(1&i.substep_shaping)||(n.bits-=.1*t));var l=s<6*i.ResvMax/10?s:6*i.ResvMax/10;return(l-=a)<0&&(l=0),l},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var n,r=e.l3_side;e.ResvSize+=t*e.mode_gr;var a=0;r.resvDrain_post=0,r.resvDrain_pre=0,0!=(n=e.ResvSize%8)&&(a+=n),(n=e.ResvSize-a-e.ResvMax)>0&&(a+=n);var i=Math.min(8*r.main_data_begin,a)/8;r.resvDrain_pre+=8*i,a-=8*i,e.ResvSize-=8*i,r.main_data_begin-=i,r.resvDrain_post+=a,e.ResvSize-=a}}function x(){this.setModules=function(e,t,n){e,t,n};var e=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];function t(t,n){return n=n>>8^e[255&(n^t)]}this.updateMusicCRC=function(e,n,r,a){for(var i=0;i0;){var r;0==h&&(h=8,p++,e.header[e.w_ptr].write_timing==f&&d(e),c[p]=0),n-=r=Math.min(n,h),h-=r,c[p]|=t>>n<0;){var r;0==h&&(h=8,p++,c[p]=0),n-=r=Math.min(n,h),h-=r,c[p]|=t>>n<=8&&(v(r,76,8),t-=8),t>=8&&(v(r,65,8),t-=8),t>=8&&(v(r,77,8),t-=8),t>=8&&(v(r,69,8),t-=8),t>=32){var a=s.getLameShortVersion();if(t>=32)for(n=0;n=8;++n)t-=8,v(r,a.charCodeAt(n),8)}for(;t>=1;t-=1)v(r,r.ancillary_flag,1),r.ancillary_flag^=e.disable_reservoir?0:1}function w(e,t,n){for(var r=e.header[e.h_ptr].ptr;n>0;){var a=Math.min(n,8-(7&r));n-=a,e.header[e.h_ptr].buf[r>>3]|=t>>n<<8-(7&r)-a,r+=a}e.header[e.h_ptr].ptr=r}function S(e,t){e<<=8;for(var n=0;n<8;n++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=32773);return t}function x(e,t){var n,r=M.ht[t.count1table_select+32],a=0,i=t.big_values,s=t.big_values;for(n=(t.count1-t.big_values)/4;n>0;--n){var o=0,l=0;0!=t.l3_enc[i+0]&&(l+=8,t.xr[s+0]<0&&o++),0!=t.l3_enc[i+1]&&(l+=4,o*=2,t.xr[s+1]<0&&o++),0!=t.l3_enc[i+2]&&(l+=2,o*=2,t.xr[s+2]<0&&o++),0!=t.l3_enc[i+3]&&(l++,o*=2,t.xr[s+3]<0&&o++),i+=4,s+=4,v(e,o+r.table[l],r.hlen[l]),a+=r.hlen[l]}return a}function k(e,t,n,r,a){var i=M.ht[t],s=0;if(0==t)return s;for(var o=n;o15){if(p>14)_|=p-15<<1,c=f,p=15;if(h>14)_<<=f,_|=h-15,c+=f,h=15;u=16}0!=h&&(_<<=1,a.xr[o+1]<0&&_++,l--),p=p*u+h,c-=l,l+=i.hlen[p],v(e,i.table[p],l),v(e,_,c),s+=l+c}return s}function A(e,t){var n=3*e.scalefac_band.s[3];n>t.big_values&&(n=t.big_values);var r=k(e,t.table_select[0],0,n,t);return r+=k(e,t.table_select[1],n,t.big_values,t)}function T(e,t){var n,r,a,i;n=t.big_values;var s=t.region0_count+1;return a=e.scalefac_band.l[s],s+=t.region1_count+1,a>n&&(a=n),(i=e.scalefac_band.l[s])>n&&(i=n),r=k(e,t.table_select[0],0,a,t),r+=k(e,t.table_select[1],a,i,t),r+=k(e,t.table_select[2],i,n,t)}function R(){this.total=0}function B(t,n){var r,a,i,s,o,l=t.internal_flags;return o=l.w_ptr,-1==(s=l.h_ptr-1)&&(s=U.MAX_HEADER_BUF-1),r=l.header[s].write_timing-f,n.total=r,r>=0&&(a=1+s-o,s>8),t[5]=byte(255&n)},this.flush_bitstream=function(e){var n,a,i=e.internal_flags,s=i.h_ptr-1;if(-1==s&&(s=U.MAX_HEADER_BUF-1),n=i.l3_side,!((a=B(e,new R))<0)){if(b(e,a),i.ResvSize=0,n.main_data_begin=0,i.findReplayGain){var o=r.GetTitleGain(i.rgdata);i.RadioGain=0|Math.floor(10*o+.5)}i.findPeakSample&&(i.noclipGainChange=0|Math.ceil(20*t(i.PeakSample/32767)*10),i.noclipGainChange>0&&(EQ(e.scale,1)||EQ(e.scale,0))?i.noclipScale=Math.floor(32767/i.PeakSample*100)/100:i.noclipScale=-1)}},this.add_dummy_byte=function(e,t,n){for(var r,a=e.internal_flags;n-- >0;)for(m(0,t,8),r=0;r ResvSize"),8*t.main_data_begin!=n.ResvSize&&(_.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,n.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*n.sideinfo_len,a-t.resvDrain_post-8*n.sideinfo_len,a,a%8,r),_.err.println("This is a fatal error. It has several possible causes:"),_.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),_.err.println(" 9%% Your system is overclocked"),_.err.println(" 1%% bug in LAME encoding library"),n.ResvSize=8*t.main_data_begin),f>1e9){var i;for(i=0;is)return-1;if(_.arraycopy(c,0,t,n,u),p=-1,h=0,0!=f){var d=a(1);if(d[0]=e.nMusicCRC,l.updateMusicCRC(d,t,n,u),e.nMusicCRC=d[0],u>0&&(e.VBR_seek_table.nBytesWritten+=u),e.decode_on_the_fly)for(var v,m=o([2,1152]),b=u,g=-1;0!=g;)if(g=i.hip_decode1_unclipped(e.hip,t,n,b,m[0],m[1]),b=0,-1==g&&(g=0),g>0){if(e.findPeakSample){for(v=0;ve.PeakSample?e.PeakSample=m[0][v]:-m[0][v]>e.PeakSample&&(e.PeakSample=-m[0][v]);if(e.channels_out>1)for(v=0;ve.PeakSample?e.PeakSample=m[1][v]:-m[1][v]>e.PeakSample&&(e.PeakSample=-m[1][v])}if(e.findReplayGain&&r.AnalyzeSamples(e.rgdata,m[0],0,m[1],0,g,e.channels_out)==y.GAIN_ANALYSIS_ERROR)return-6}}return u},this.init_bit_stream_w=function(e){c=n(G.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,p=-1,h=0,f=0}}function A(e,t,n,r){this.xlen=e,this.linmax=t,this.table=n,this.hlen=r}m.STEREO=new m(0),m.JOINT_STEREO=new m(1),m.DUAL_CHANNEL=new m(2),m.MONO=new m(3),m.NOT_SET=new m(4),y.STEPS_per_dB=100,y.MAX_dB=120,y.GAIN_NOT_ENOUGH_SAMPLES=-24601,y.GAIN_ANALYSIS_ERROR=0,y.GAIN_ANALYSIS_OK=1,y.INIT_GAIN_ANALYSIS_ERROR=0,y.INIT_GAIN_ANALYSIS_OK=1,y.YULE_ORDER=10,y.MAX_ORDER=y.YULE_ORDER,y.MAX_SAMP_FREQ=48e3,y.RMS_WINDOW_TIME_NUMERATOR=1,y.RMS_WINDOW_TIME_DENOMINATOR=20,y.MAX_SAMPLES_PER_WINDOW=y.MAX_SAMP_FREQ*y.RMS_WINDOW_TIME_NUMERATOR/y.RMS_WINDOW_TIME_DENOMINATOR+1,x.NUMTOCENTRIES=100,x.MAXFRAMESIZE=2880,k.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},k.NEQ=function(e,t){return!k.EQ(e,t)};var M={};function T(e){this.bits=e}function R(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function B(){this.setModules=function(e,t){e,t}}function E(){this.useAdjust=0,this.aaSensitivityP=0,this.adjust=0,this.adjustLimit=0,this.decay=0,this.floor=0,this.l=i(F.SBMAX_l),this.s=i(F.SBMAX_s),this.psfb21=i(F.PSFB21),this.psfb12=i(F.PSFB12),this.cb_l=i(F.CBANDS),this.cb_s=i(F.CBANDS),this.eql_w=i(F.BLKSIZE/2)}function C(){this.class_id=0,this.num_samples=0,this.num_channels=0,this.in_samplerate=0,this.out_samplerate=0,this.scale=0,this.scale_left=0,this.scale_right=0,this.analysis=!1,this.bWriteVbrTag=!1,this.decode_only=!1,this.quality=0,this.mode=m.STEREO,this.force_ms=!1,this.free_format=!1,this.findReplayGain=!1,this.decode_on_the_fly=!1,this.write_id3tag_automatic=!1,this.brate=0,this.compression_ratio=0,this.copyright=0,this.original=0,this.extension=0,this.emphasis=0,this.error_protection=0,this.strict_ISO=!1,this.disable_reservoir=!1,this.quant_comp=0,this.quant_comp_short=0,this.experimentalY=!1,this.experimentalZ=0,this.exp_nspsytune=0,this.preset=0,this.VBR=null,this.VBR_q_frac=0,this.VBR_q=0,this.VBR_mean_bitrate_kbps=0,this.VBR_min_bitrate_kbps=0,this.VBR_max_bitrate_kbps=0,this.VBR_hard_min=0,this.lowpassfreq=0,this.highpassfreq=0,this.lowpasswidth=0,this.highpasswidth=0,this.maskingadjust=0,this.maskingadjust_short=0,this.ATHonly=!1,this.ATHshort=!1,this.noATH=!1,this.ATHtype=0,this.ATHcurve=0,this.ATHlower=0,this.athaa_type=0,this.athaa_loudapprox=0,this.athaa_sensitivity=0,this.short_blocks=null,this.useTemporal=!1,this.interChRatio=0,this.msfix=0,this.tune=!1,this.tune_value_a=0,this.version=0,this.encoder_delay=0,this.encoder_padding=0,this.framesize=0,this.frameNum=0,this.lame_allocated_gfp=0,this.internal_flags=null}function O(e){var t=e;this.quantize=t,this.iteration_loop=function(e,t,n,r){var s,o=e.internal_flags,l=i($.SFBMAX),c=i(576),f=a(2),u=0,_=o.l3_side,p=new T(u);this.quantize.rv.ResvFrameBegin(e,p),u=p.bits;for(var h=0;h>2&63)>=32&&(r-=64),c=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>8&63)>=32&&(r-=64),p=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>14&63)>=32&&(r-=64),v=Math.pow(10,r/4/10),(r=n.exp_nspsytune>>20&63)>=32&&(r-=64),b=v*Math.pow(10,r/4/10),r=0;rU.MAX_BITS_PER_GRANULE&&(d=U.MAX_BITS_PER_GRANULE),l=0,c=0;c3*i/4&&(_[c]=3*i/4),_[c]<0&&(_[c]=0),_[c]+r[c]>U.MAX_BITS_PER_CHANNEL&&(_[c]=Math.max(0,U.MAX_BITS_PER_CHANNEL-r[c])),l+=_[c];if(l>h)for(c=0;cU.MAX_BITS_PER_GRANULE){for(c=0;c.5&&(a=.5);var i=0|.5*a*(e[0]+e[1]);i>U.MAX_BITS_PER_CHANNEL-e[0]&&(i=U.MAX_BITS_PER_CHANNEL-e[0]),i<0&&(i=0),e[1]>=125&&(e[1]-i>125?(e[0]r&&(e[0]=r*e[0]/i,e[1]=r*e[1]/i)},this.athAdjust=function(e,t,n){var r=90.30873362,a=p.FAST_LOG10_X(t,10),i=e*e,s=0;return a-=n,i>1e-20&&(s=1+p.FAST_LOG10_X(i,10/r)),s<0&&(s=0),a*=s,a+=n+r-94.82444863,Math.pow(10,.1*a)},this.calc_xmin=function(e,t,n,r){var a,i=0,s=e.internal_flags,o=0,l=0,c=s.ATH,f=n.xr,u=e.VBR==v.vbr_mtrh?1:0,_=s.masking_lower;for(e.VBR!=v.vbr_mtrh&&e.VBR!=v.vbr_mt||(_=1),a=0;a>1,M=0;do{M+=R=f[o]*f[o],S+=R0);if(M>y&&l++,a==F.SBPSY_l)S<(A=y*s.nsPsy.longfact[a])&&(S=A);if(0!=u&&(y=S),!e.ATHonly)if((x=t.en.l[a])>0)A=M*t.thm.l[a]*_/x,0!=u&&(A*=s.nsPsy.longfact[a]),y>1;w=g/m,S=2220446049250313e-31;do{var R,B;M+=R=f[o]*f[o],S+=R0);if(M>g&&l++,d==F.SBPSY_s)S<(A=g*s.nsPsy.shortfact[d])&&(S=A);if(y=0!=u?S:g,!e.ATHonly&&!e.ATHshort)if((x=t.en.s[d][b])>0)A=M*t.thm.s[d][b]*_/x,0!=u&&(A*=s.nsPsy.shortfact[d]),yr[i-3+1]&&(r[i-3+1]+=(r[i-3]-r[i-3+1])*s.decay),r[i-3+1]>r[i-3+2]&&(r[i-3+2]+=(r[i-3+1]-r[i-3+2])*s.decay))}return l},this.calc_noise_core=function(e,t,n,r){var a=0,s=t.s,o=e.l3_enc;if(s>e.count1)for(;0!=n--;){c=e.xr[s],s++,a+=c*c,c=e.xr[s],s++,a+=c*c}else if(s>e.big_values){var l=i(2);for(l[0]=0,l[1]=r;0!=n--;){c=Math.abs(e.xr[s])-l[o[s]],s++,a+=c*c,c=Math.abs(e.xr[s])-l[o[s]],s++,a+=c*c}}else for(;0!=n--;){var c;c=Math.abs(e.xr[s])-_[o[s]]*r,s++,a+=c*c,c=Math.abs(e.xr[s])-_[o[s]]*r,s++,a+=c*c}return t.s=s,a},this.calc_noise=function(e,t,n,r,a){var i,s,o=0,l=0,u=0,_=0,h=0,d=-20,v=0,m=e.scalefac,g=0;for(r.over_SSD=0,i=0;i>1,v+e.width[i]>e.max_nonzero_coeff)s=(x=e.max_nonzero_coeff-v+1)>0?x>>1:0;var A=new b(v);S=this.calc_noise_core(e,A,s,k),v=A.s,null!=a&&(a.step[i]=w,a.noise[i]=S),S=n[o++]=S/t[l++],S=p.FAST_LOG10(Math.max(S,1e-20)),null!=a&&(a.noise_log[i]=S)}if(null!=a&&(a.global_gain=e.global_gain),h+=S,S>0)y=Math.max(0|10*S+.5,1),r.over_SSD+=y*y,u++,_+=S;d=Math.max(d,S)}return r.over_count=u,r.tot_noise=h,r.over_noise=_,r.max_noise=d,u},this.set_pinfo=function(e,t,n,r,a){var s,o,l,f,u,_=e.internal_flags,p=0==t.scalefac_scale?.5:1,h=t.scalefac,d=i($.SFBMAX),v=i($.SFBMAX),m=new R;calc_xmin(e,n,t,d),calc_noise(t,d,v,m,null);var b=0;for(o=t.sfb_lmax,t.block_type!=F.SHORT_TYPE&&0==t.mixed_block_flag&&(o=22),s=0;s0&&!e.ATHonly?f/=n.en.l[s]:f=0,_.pinfo.thr[r][a][s]=u*Math.max(f*n.thm.l[s],_.ATH.l[s]),_.pinfo.LAMEsfb[r][a][s]=0,0!=t.preflag&&s>=11&&(_.pinfo.LAMEsfb[r][a][s]=-p*c[s]),s0?f/=n.en.s[s][S]:f=0,(e.ATHonly||e.ATHshort)&&(f=0),_.pinfo.thr_s[r][a][3*s+S]=u*Math.max(f*n.thm.s[s][S],_.ATH.s[s]),_.pinfo.LAMEsfb_s[r][a][3*s+S]=-2*t.subblock_gain[S],s0?(i=n.over_SSD<=t.over_SSD,n.over_SSD==t.over_SSD&&(i=n.bits.2||n.max_noise<=0&&t.max_noise<0&&t.max_noise>n.max_noise-.2&&n.tot_noise0&&t.max_noise>n.max_noise-.2&&n.tot_noise0&&t.max_noise>-.05&&t.max_noise>n.max_noise-.1&&n.tot_noise+n.over_noise0&&t.max_noise>-.1&&t.max_noise>n.max_noise-.15&&n.tot_noise+n.over_noise+n.over_noise1?o=Math.pow(o,.5):o*=.95;break;case 0:default:o>1?o=1:o*=.95}var f=0;for(l=0;lt.xrpow_max&&(t.xrpow_max=r[f+u]);if(2==s.noise_shaping_amp)return}}}(e,t,a,i,s);var c=o(t);return!c&&(!(c=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t))||(l.noise_shaping>1&&(u.fill(l.pseudohalf,0),0==t.scalefac_scale?(!function(e,t){for(var r=0,a=0;ae.xrpow_max&&(e.xrpow_max=t[r+o])}e.scalefac[a]=s>>1}e.preflag=0,e.scalefac_scale=1}(t,i),c=!1):t.block_type==F.SHORT_TYPE&&l.subblock_gain>0&&(c=function(e,t,r){var a,i=t.scalefac;for(a=0;a=16)return!0;for(var s=0;s<3;s++){var o=0,l=0;for(a=t.sfb_lmax+s;a=7)return!0;t.subblock_gain[s]++;var c=e.scalefac_band.l[t.sfb_lmax];for(a=t.sfb_lmax+s;a>t.scalefac_scale)>=0)i[a]=u,c+=3*f;else{i[a]=0;var _=210+(u<t.xrpow_max&&(t.xrpow_max=r[c+p]);c+=f*(3-s-1)}}var h=n.IPOW20(202);c+=t.width[a]*(s+1);for(p=-t.width[a];p<0;p++)r[c+p]*=h,r[c+p]>t.xrpow_max&&(t.xrpow_max=r[c+p])}}return!1}(l,t,i)||o(t))),c||(c=2==l.mode_gr?r.scale_bitcount(t):r.scale_bitcount_lsf(l,t)),!c))}this.setModules=function(i,s,o,l){e=i,t=s,this.rv=s,n=o,this.qupvt=o,r=l,a.setModules(n,r)},this.ms_convert=function(e,t){for(var n=0;n<576;++n){var r=e.tt[t][0].xr[n],a=e.tt[t][1].xr[n];e.tt[t][0].xr[n]=(r+a)*(.5*p.SQRT2),e.tt[t][1].xr[n]=(r-a)*(.5*p.SQRT2)}},this.init_xrpow=function(e,t,n){var r=0,a=0|t.max_nonzero_coeff;if(t.xrpow_max=0,u.fill(n,a,576,0),(r=function(e,t,n,r){r=0;for(var a=0;a<=n;++a){var i=Math.abs(e.xr[a]);r+=i,t[a]=Math.sqrt(i*Math.sqrt(i)),t[a]>e.xrpow_max&&(e.xrpow_max=t[a])}return r}(t,n,a,r))>1e-20){var i=0;0!=(2&e.substep_shaping)&&(i=1);for(var s=0;s=0&&!i;s--){var o=e.scalefac_band.psfb21[s],l=e.scalefac_band.psfb21[s+1],c=n.athAdjust(r.adjust,r.psfb21[s],r.floor);e.nsPsy.longfact[21]>1e-12&&(c*=e.nsPsy.longfact[21]);for(var f=l-1;f>=o;f--){if(!(Math.abs(a[f])=0&&!i;s--){l=(o=3*e.scalefac_band.s[12]+(e.scalefac_band.s[13]-e.scalefac_band.s[12])*u+(e.scalefac_band.psfb12[s]-e.scalefac_band.psfb12[0]))+(e.scalefac_band.psfb12[s+1]-e.scalefac_band.psfb12[s]);var _=n.athAdjust(r.adjust,r.psfb12[s],r.floor);e.nsPsy.shortfact[12]>1e-12&&(_*=e.nsPsy.shortfact[12]);for(f=l-1;f>=o;f--){if(!(Math.abs(a[f])<_)){i=!0;break}a[f]=0}}}(e,t)},s.BINSEARCH_NONE=new s(0),s.BINSEARCH_UP=new s(1),s.BINSEARCH_DOWN=new s(2),this.trancate_smallspectrums=function(e,t,a,s){var o=i($.SFBMAX);if((0!=(4&e.substep_shaping)||t.block_type!=F.SHORT_TYPE)&&0==(128&e.substep_shaping)){n.calc_noise(t,a,o,new R,null);for(var l=0;l<576;l++){var c=0;0!=t.l3_enc[l]&&(c=Math.abs(t.xr[l])),s[l]=c}l=0;var f=8;t.block_type==F.SHORT_TYPE&&(f=6);do{var _,p,h,d,v=t.width[f];if(l+=v,!(o[f]>=1||(u.sort(s,l-v,v),k.EQ(s[l-1],0)))){_=(1-o[f])*a[f],p=0,d=0;do{var m;for(h=1;d+h0)}}while(++fn?(u==s.BINSEARCH_DOWN&&(c=!0),c&&(l/=2),u=s.BINSEARCH_UP,_=l):(u==s.BINSEARCH_UP&&(c=!0),c&&(l/=2),u=s.BINSEARCH_DOWN,_=-l),t.global_gain+=_,t.global_gain<0&&(t.global_gain=0,c=!0),t.global_gain>255&&(t.global_gain=255,c=!0)}for(;o>n&&t.global_gain<255;)t.global_gain++,o=r.count_bits(e,i,t,null);e.CurrentStep[a]=f-t.global_gain>=4?4:2,e.OldValue[a]=t.global_gain,t.part2_3_length=o}(p,t,u,f,o),0==p.noise_shaping)return 100;n.calc_noise(t,a,m,b,g),b.bits=t.part2_3_length,h.assign(t);var k=0;for(_.arraycopy(o,0,d,0,576);!w;){do{var A,M=new R,T=255;if(A=0!=(2&p.substep_shaping)?20:3,p.sfb21_extra){if(m[h.sfbmax]>1)break;if(h.block_type==F.SHORT_TYPE&&(m[h.sfbmax+1]>1||m[h.sfbmax+2]>1))break}if(!c(e,h,m,o,S))break;0!=h.scalefac_scale&&(T=254);var B=u-h.part2_length;if(B<=0)break;for(;(h.part2_3_length=r.count_bits(p,o,h,g))>B&&h.global_gain<=T;)h.global_gain++;if(h.global_gain>T)break;if(0==b.over_count){for(;(h.part2_3_length=r.count_bits(p,o,h,g))>y&&h.global_gain<=T;)h.global_gain++;if(h.global_gain>T)break}if(n.calc_noise(h,a,m,M,g),M.bits=h.part2_3_length,0!=(l(t.block_type!=F.SHORT_TYPE?e.quant_comp:e.quant_comp_short,b,M,h,m)?1:0))y=t.part2_3_length,b=M,t.assign(h),k=0,_.arraycopy(o,0,d,0,576);else if(0==p.full_outer_loop){if(++k>A&&0==b.over_count)break;if(3==p.noise_shaping_amp&&S&&k>30)break;if(3==p.noise_shaping_amp&&S&&h.global_gain-x>15)break}}while(h.global_gain+h.scalefac_scale<255);3==p.noise_shaping_amp?S?w=!0:(h.assign(t),_.arraycopy(d,0,o,0,576),k=0,x=h.global_gain,S=!0):w=!0}return e.VBR==v.vbr_rh||e.VBR==v.vbr_mtrh?_.arraycopy(d,0,o,0,576):0!=(1&p.substep_shaping)&&trancate_smallspectrums(p,t,a,o),b.over_count},this.iteration_finish_one=function(e,n,a){var i=e.l3_side,s=i.tt[n][a];r.best_scalefac_store(e,n,a,i),1==e.use_best_huffman&&r.best_huffman_divide(e,s),t.ResvAdjust(e,s)},this.VBR_encode_granule=function(e,t,n,r,a,s,o){var l,c=e.internal_flags,f=new H,p=i(576),h=o,d=o+1,v=(o+s)/2,m=0,b=c.sfb21_extra;u.fill(f.l3_enc,0);do{c.sfb21_extra=!(v>h-42)&&b,outer_loop(e,t,n,r,a,v)<=0?(m=1,d=t.part2_3_length,f.assign(t),_.arraycopy(r,0,p,0,576),l=(o=d-32)-s,v=(o+s)/2):(l=o-(s=v+32),v=(o+s)/2,0!=m&&(m=2,t.assign(f),_.arraycopy(p,0,r,0,576)))}while(l>12);c.sfb21_extra=b,2==m&&_.arraycopy(f.l3_enc,0,t.l3_enc,0,576)},this.get_framebits=function(n,r){var a=n.internal_flags;a.bitrate_index=a.VBR_min_bitrate;var i=e.getframebits(n);a.bitrate_index=1,i=e.getframebits(n);for(var s=1;s<=a.VBR_max_bitrate;s++){a.bitrate_index=s;var o=new T(i);r[s]=t.ResvFrameBegin(n,o),i=o.bits}},this.VBR_old_prepare=function(e,r,a,i,s,o,l,c,f){var u,_=e.internal_flags,p=0,h=1,d=0;_.bitrate_index=_.VBR_max_bitrate;var v=t.ResvFrameBegin(e,new T(0))/_.mode_gr;get_framebits(e,o);for(var m=0;m<_.mode_gr;m++){var b=n.on_pe(e,r,c[m],v,m,0);_.mode_ext==F.MPG_MD_MS_LR&&(ms_convert(_.l3_side,m),n.reduce_side(c[m],a[m],v,b));for(var g=0;g<_.channels_out;++g){var y=_.l3_side.tt[m][g];y.block_type!=F.SHORT_TYPE?(p=1.28/(1+Math.exp(3.5-r[m][g]/300))-.05,u=_.PSY.mask_adjust-p):(p=2.56/(1+Math.exp(3.5-r[m][g]/300))-.14,u=_.PSY.mask_adjust_short-p),_.masking_lower=Math.pow(10,.1*u),init_outer_loop(_,y),f[m][g]=n.calc_xmin(e,i[m][g],y,s[m][g]),0!=f[m][g]&&(h=0),l[m][g]=126,d+=c[m][g]}}for(m=0;m<_.mode_gr;m++)for(g=0;g<_.channels_out;g++)d>o[_.VBR_max_bitrate]&&(c[m][g]*=o[_.VBR_max_bitrate],c[m][g]/=d),l[m][g]>c[m][g]&&(l[m][g]=c[m][g]);return h},this.bitpressure_strategy=function(e,t,n,r){for(var a=0;al&&(o[h][d]*=l,o[h][d]/=_);return f},this.calc_target_bits=function(r,a,i,s,o,l){var c,f,u,_,p=r.internal_flags,h=p.l3_side,d=0;p.bitrate_index=p.VBR_max_bitrate;var v=new T(d);for(l[0]=t.ResvFrameBegin(r,v),d=v.bits,p.bitrate_index=1,d=e.getframebits(r)-8*p.sideinfo_len,o[0]=d/(p.mode_gr*p.channels_out),d=r.VBR_mean_bitrate_kbps*r.framesize*1e3,0!=(1&p.substep_shaping)&&(d*=1.09),d/=r.out_samplerate,d-=8*p.sideinfo_len,d/=p.mode_gr*p.channels_out,(c=.93+.07*(11-r.compression_ratio)/5.5)<.9&&(c=.9),c>1&&(c=1),f=0;f700){var b=int((a[f][u]-700)/1.4),g=h.tt[f][u];s[f][u]=int(c*d),g.block_type==F.SHORT_TYPE&&b3*d/2?b=3*d/2:b<0&&(b=0),s[f][u]+=b}s[f][u]>U.MAX_BITS_PER_CHANNEL&&(s[f][u]=U.MAX_BITS_PER_CHANNEL),m+=s[f][u]}if(m>U.MAX_BITS_PER_GRANULE)for(u=0;uU.MAX_BITS_PER_CHANNEL&&(s[f][u]=U.MAX_BITS_PER_CHANNEL),_+=s[f][u];if(_>l[0])for(f=0;f=0;--z){var ee,te;ee=V[q+z]*a[20+z]+V[q+-1-z]*s[28+z],te=V[q+z]*s[28+z]-V[q+-1-z]*a[20+z],V[q+-1-z]=ee,V[q+z]=te}}}if(L=p,N=286,1==e.mode_gr)for(var ne=0;ne<18;ne++)_.arraycopy(e.sb_sample[H][1][ne],0,e.sb_sample[H][0][ne],0,32)}}}function V(){this.thm=new X,this.en=new X}function F(){var e=F.FFTOFFSET,t=F.MPG_MD_MS_LR,n=null;this.psy=null;var r=null,s=null,l=null;this.setModules=function(e,t,a,i){n=e,this.psy=t,r=t,s=i,l=a};var c=new j;this.lame_encode_mp3_frame=function(u,p,h,d,b,g){var y,w=f([2,2]);w[0][0]=new V,w[0][1]=new V,w[1][0]=new V,w[1][1]=new V;var S,x=f([2,2]);x[0][0]=new V,x[0][1]=new V,x[1][0]=new V,x[1][1]=new V;var k,A,M,T=[null,null],R=u.internal_flags,B=o([2,4]),E=[.5,.5],C=[[0,0],[0,0]],O=[[0,0],[0,0]];if(T[0]=p,T[1]=h,0==R.lame_encode_frame_init&&function(e,t){var n,r,a=e.internal_flags;if(0==a.lame_encode_frame_init){var s,o,l=i(2014),f=i(2014);for(a.lame_encode_frame_init=1,s=0,o=0;s<286+576*(1+a.mode_gr);++s)s<576*a.mode_gr?(l[s]=0,2==a.channels_out&&(f[s]=0)):(l[s]=t[0][o],2==a.channels_out&&(f[s]=t[1][o]),++o);for(r=0;r0&&(E[M]=B[M][3]/E[M])),A=0;A.03125)e.ATH.adjust>=1?e.ATH.adjust=1:e.ATH.adjust=r?(e.ATH.adjust*=.075*r+.925,e.ATH.adjust=r?e.ATH.adjust=r:e.ATH.adjust>1,d=(h=a<<1)+(_=a),a=h<<1,s=(i=t)+v;do{x=e[i+0]-e[i+_],S=e[i+0]+e[i+_],T=e[i+h]-e[i+d],A=e[i+h]+e[i+d],e[i+h]=S-A,e[i+0]=S+A,e[i+d]=x-T,e[i+_]=x+T,x=e[s+0]-e[s+_],S=e[s+0]+e[s+_],T=p.SQRT2*e[s+d],A=p.SQRT2*e[s+h],e[s+h]=S-A,e[s+0]=S+A,e[s+d]=x-T,e[s+_]=x+T,s+=a,i+=a}while(i=0);r(n[l],c,F.BLKSIZE_s/2)}},this.fft_long=function(t,n,i,s,o){var l=F.BLKSIZE/8-1,c=F.BLKSIZE/2;do{var f,u,_,p,h,d=255&a[l];u=(f=e[d]*s[i][o+d])-(h=e[d+512]*s[i][o+d+512]),f+=h,p=(_=e[d+256]*s[i][o+d+256])-(h=e[d+768]*s[i][o+d+768]),_+=h,n[(c-=4)+0]=f+_,n[c+2]=f-_,n[c+1]=u+p,n[c+3]=u-p,u=(f=e[d+1]*s[i][o+d+1])-(h=e[d+513]*s[i][o+d+513]),f+=h,p=(_=e[d+257]*s[i][o+d+257])-(h=e[d+769]*s[i][o+d+769]),_+=h,n[c+F.BLKSIZE/2+0]=f+_,n[c+F.BLKSIZE/2+2]=f-_,n[c+F.BLKSIZE/2+1]=u+p,n[c+F.BLKSIZE/2+3]=u-p}while(--l>=0);r(n,c,F.BLKSIZE/2)},this.init_fft=function(n){for(var r=0;r=0;--d){var v=i[s+0][d],m=i[s+1][d];i[s+0][d]=(v+m)*p.SQRT2*.5,i[s+1][d]=(v-m)*p.SQRT2*.5}for(var b=2;b>=0;--b)for(d=F.BLKSIZE_s-1;d>=0;--d){v=o[l+0][b][d],m=o[l+1][b][d];o[l+0][b][d]=(v+m)*p.SQRT2*.5,o[l+1][b][d]=(v-m)*p.SQRT2*.5}}n[0]=i[s+0][0],n[0]*=n[0];for(d=F.BLKSIZE/2-1;d>=0;--d){var g=i[s+0][F.BLKSIZE/2-d],y=i[s+0][F.BLKSIZE/2+d];n[F.BLKSIZE/2-d]=.5*(g*g+y*y)}for(b=2;b>=0;--b){a[b][0]=o[l+0][b][0],a[b][0]*=a[b][0];for(d=F.BLKSIZE_s/2-1;d>=0;--d){g=o[l+0][b][F.BLKSIZE_s/2-d],y=o[l+0][b][F.BLKSIZE_s/2+d];a[b][F.BLKSIZE_s/2-d]=.5*(g*g+y*y)}}var w=0;for(d=11;de){if(!(t=t*c)return e+t;s=e/t}if(e+=t,r+3<=6){if(s>=l)return e;var o=0|p.FAST_LOG10_X(s,16);return e*g[o]}var u,_;o=0|p.FAST_LOG10_X(s,16);return t=0!=i?a.ATH.cb_s[n]*a.ATH.adjust:a.ATH.cb_l[n]*a.ATH.adjust,et?(u=1,o<=13&&(u=y[o]),_=p.FAST_LOG10_X(e/t,10/15),e*((b[o]-u)*_+u)):o>13?e:e*y[o]:e*b[o]}var S=[1.7782755904,1.35879*1.35879,1.38454*1.38454,1.39497*1.39497,1.40548*1.40548,1.3537*1.3537,1.6999465924,1.22321*1.22321,1.3169398564,1];function x(e,t,n){var r;if(e<0&&(e=0),t<0&&(t=0),e<=0)return t;if(t<=0)return e;if(r=t>e?t/e:e/t,-2<=n&&n<=2){if(r>=l)return e+t;var a=0|p.FAST_LOG10_X(r,16);return(e+t)*S[a]}return r=f){++i;break}var _=e.PSY.bo_s_weight[i],p=1-_;o=_*t[s],l=_*n[s],e.en[r].s[i][a]+=o,e.thm[r].s[i][a]+=l,o=p*t[s],l=p*n[s]}for(;i=c){++a;break}var u=e.PSY.bo_l_weight[a],_=1-u;s=u*t[i],o=u*n[i],e.en[r].l[a]+=s,e.thm[r].l[a]+=o,s=_*t[i],o=_*n[i]}for(;a=1?e:n<=0?t:t>0?Math.pow(e/t,n)*t:0}var R=[11.8,13.6,17.2,32,46.5,51.3,57.5,67.1,71.5,84.6,97.6,130];function B(e,n){for(var r=309.07,a=0;a0){var o=s*n,l=e.en.s[a][i];l>o&&(r+=l>1e10*o?R[a]*(10*t):R[a]*p.FAST_LOG10(l/o))}}return r}var E=[6.8,5.8,5.8,6.4,6.5,9.9,12.1,14.4,15,18.9,21.6,26.9,34.2,40.2,46.8,56.5,60.7,73.9,85.7,93.4,126.1];function C(e,n){for(var r=281.0575,a=0;a0){var s=i*n,o=e.en.l[a];o>s&&(r+=o>1e10*s?E[a]*(10*t):E[a]*p.FAST_LOG10(o/s))}}return r}function O(e,t,n,r,a){var i,s;for(i=s=0;i0?((o=t[i])a&&(l=a),r[i]=l):r[i]=0;for(i=1;i0)(o=t[i-1])a&&(l=a),r[i]=l;else r[i]=0}(s=n[i-1]+n[i])>0?((o=t[i-1])a&&(l=a),r[i]=l):r[i]=0}var I=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function L(t,n,r,a,i,s,o,l){var c=t.internal_flags;if(a<2)e.fft_long(c,o[l],a,n,r);else if(2==a)for(var f=F.BLKSIZE-1;f>=0;--f){var u=o[l+0][f],_=o[l+1][f];o[l+0][f]=(u+_)*p.SQRT2*.5,o[l+1][f]=(u-_)*p.SQRT2*.5}s[0]=o[l+0][0],s[0]*=s[0];for(f=F.BLKSIZE/2-1;f>=0;--f){var h=o[l+0][F.BLKSIZE/2-f],d=o[l+0][F.BLKSIZE/2+f];s[F.BLKSIZE/2-f]=.5*(h*h+d*d)}var v=0;for(f=11;f=0;--f){var u=o[l+0][i][f],_=o[l+1][i][f];o[l+0][i][f]=(u+_)*p.SQRT2*.5,o[l+1][i][f]=(u-_)*p.SQRT2*.5}s[i][0]=o[l+0][i][0],s[i][0]*=s[i][0];for(f=F.BLKSIZE_s/2-1;f>=0;--f){var h=o[l+0][i][F.BLKSIZE_s/2-f],d=o[l+0][i][F.BLKSIZE_s/2+f];s[i][F.BLKSIZE_s/2-f]=.5*(h*h+d*d)}}function H(e,t,n,a){var i=e.internal_flags;2==e.athaa_loudapprox&&n<2&&(i.loudness_sq[t][n]=i.loudness_sq_save[n],i.loudness_sq_save[n]=r(a,i))}this.L3psycho_anal_ns=function(e,t,n,r,l,c,f,p,d,b){var g,y,S,x,R,E,L,N,H,$,D=e.internal_flags,j=o([2,F.BLKSIZE]),V=o([2,3,F.BLKSIZE_s]),q=i(F.CBANDS+1),Y=i(F.CBANDS+1),X=i(F.CBANDS+2),z=a(2),U=a(2),K=o([2,576]),Z=a(F.CBANDS+2),G=a(F.CBANDS+2);for(u.fill(G,0),g=D.channels_out,e.mode==m.JOINT_STEREO&&(g=4),H=e.VBR==v.vbr_off?0==D.ResvMax?0:D.ResvSize/D.ResvMax*.5:e.VBR==v.vbr_rh||e.VBR==v.vbr_mtrh||e.VBR==v.vbr_mt?.6:1,y=0;y2&&(c[r][y].en.assign(D.en[y+2]),c[r][y].thm.assign(D.thm[y+2]))}for(y=0;yne[x+3-2]?ve/=ne[x+3-2]:ve=ne[x+3-2]>10*ve?ne[x+3-2]/(10*ve):0,ae[x+3]=ve}if(e.analysis){var me=ae[0];for(x=1;x<12;x++)mete&&(le[x/3]=x%3+1);for(x=1;x<4;x++){(re[x-1]>re[x]?re[x-1]/re[x]:re[x]/re[x-1])<1.7&&(le[x]=0,1==x&&(le[0]=0))}for(0!=le[0]&&0!=D.nsPsy.lastAttacks[y]&&(le[0]=0),3!=D.nsPsy.lastAttacks[y]&&le[0]+le[1]+le[2]+le[3]==0||(ie=0,0!=le[1]&&0!=le[0]&&(le[1]=0),0!=le[2]&&0!=le[1]&&(le[2]=0),0!=le[3]&&0!=le[2]&&(le[3]=0)),y<2?U[y]=ie:0==ie&&(U[0]=U[1]=0),d[y]=D.tot_ener[y],s(e,ce,fe,j,1&y,V,1&y,r,y,t,n),O(D,ce,q,se,oe),P(D,se,oe,Z),N=0;N<3;N++){var be,ge;for(M(e,fe,Y,X,y,N),k(D,Y,X,y,N),L=0;L=2||1==le[N+1]){var ye=0!=N?N-1:2;ve=T(D.thm[y].s[L][ye],ge,.6*H);ge=Math.min(ge,ve)}if(1==le[N]){ye=0!=N?N-1:2,ve=T(D.thm[y].s[L][ye],ge,.3*H);ge=Math.min(ge,ve)}else if(0!=N&&3==le[N-1]||0==N&&3==D.nsPsy.lastAttacks[y]){ye=2!=N?N+1:0,ve=T(D.thm[y].s[L][ye],ge,.3*H);ge=Math.min(ge,ve)}be=ne[3*N+3]+ne[3*N+4]+ne[3*N+5],6*ne[3*N+5]0&&function(e,t){var n=e.internal_flags;if(n.channels_out>1){for(var r=0;r1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var n=e.mld_l[t]*e.en[3].l[t],r=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],n));n=e.mld_l[t]*e.en[2].l[t];var a=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],n));e.thm[2].l[t]=r,e.thm[3].l[t]=a}for(t=0;t1.58*e.thm[1].s[t][i]||e.thm[1].s[t][i]>1.58*e.thm[0].s[t][i])){n=e.mld_s[t]*e.en[3].s[t][i],r=Math.max(e.thm[2].s[t][i],Math.min(e.thm[3].s[t][i],n));n=e.mld_s[t]*e.en[2].s[t][i];a=Math.max(e.thm[3].s[t][i],Math.min(e.thm[2].s[t][i],n));e.thm[2].s[t][i]=r,e.thm[3].s[t][i]=a}}(D),$=e.msfix,Math.abs($)>0&&function(e,t,n){var r=t,a=Math.pow(10,n);t*=2,r*=2;for(var i=0;i1?(ke=p,Te=-2,Ae=F.NORM_TYPE,b[0]!=F.SHORT_TYPE&&b[1]!=F.SHORT_TYPE||(Ae=F.SHORT_TYPE),Me=c[r][y-2]):(ke=f,Te=0,Ae=b[y],Me=l[r][y]),Ae==F.SHORT_TYPE?ke[Te+y]=B(Me,D.masking_lower):ke[Te+y]=C(Me,D.masking_lower),e.analysis&&(D.pinfo.pe[r][y]=ke[Te+y])}return 0};var $=[-1730326e-23,-.01703172,-1349528e-23,.0418072,-673278e-22,-.0876324,-30835e-21,.1863476,-1104424e-22,-.627638];function D(e,t,n){if(0==n)for(var r=0;r0?((o=t[i])a&&(l=a),r[i]=l):r[i]=0,i=1;i0)(o=t[i-1])a&&(l=a),r[i]=l;else r[i]=0}(s=n[i-1]+n[i])>0?((o=t[i-1])a&&(l=a),r[i]=l):r[i]=0}(f,u,p,h),l=c=0;cw&&(r[c]=w),f.masking_lower>1&&(r[c]*=f.masking_lower),r[c]>n[c]&&(r[c]=n[c]),f.masking_lower<1&&(r[c]*=f.masking_lower)}for(;c0?Math.min(h,y):Math.min(h,.3*n[o])}else{var w=16*e.nb_2[s][o],S=2*e.nb_1[s][o];w<=0&&(w=h),S<=0&&(S=h),y=e.blocktype_old[1&s]==F.NORM_TYPE?Math.min(S,w):S,r[o]=Math.min(h,y)}e.nb_2[s][o]=e.nb_1[s][o],e.nb_1[s][o]=h,p=l[o],p*=e.minval_l[o],p*=d,r[o]>p&&(r[o]=p),e.masking_lower>1&&(r[o]*=e.masking_lower),r[o]>n[o]&&(r[o]=n[o]),e.masking_lower<1&&(r[o]*=e.masking_lower)}for(;o0?Math.pow(10,a):1,u=0;u0){var y,w,S=r[u]*f;if(y=Math.min(Math.max(h,S),Math.max(d,S)),(w=(v=Math.max(l,S))+(m=Math.max(o,S)))>0&&y*c_&&(l=_),o>p&&(o=p),t[2][u]=l,t[3][u]=o}}function X(e,t){var n;return(n=e>=0?27*-e:e*t)<=-72?0:Math.exp(.2302585093*n)}function z(e){var t,n,r=0;for(r=0;X(r,e)>1e-20;r-=1);for(a=r,i=0;Math.abs(i-a)>1e-12;)X(r=(i+a)/2,e)>0?i=r:a=r;t=a;var a,i;r=0;for(r=0;X(r,e)>1e-20;r+=1);for(a=0,i=r;Math.abs(i-a)>1e-12;)X(r=(i+a)/2,e)>0?a=r:i=r;n=i;var s,o=0,l=1e3;for(s=0;s<=l;++s){o+=X(r=t+s*(n-t)/l,e)}return 1001/(o*(n-t))}function U(e){return e<0&&(e=0),e*=.001,13*Math.atan(.76*e)+3.5*Math.atan(e*e/56.25)}function Z(e,t,n,r,s,o,l,c,f,u,_,p){var h,d=i(F.CBANDS+1),v=c/(p>15?1152:384),m=a(F.HBLKSIZE);c/=f;var b=0,g=0;for(h=0;hf/2){b=f/2,++h;break}}d[h]=c*b;for(var w=0;wf/2&&(x=f/2),n[w]=(m[S]+m[x])/2,t[w]=m[x];var T=v*A;l[w]=(T-d[t[w]])/(d[t[w]+1]-d[t[w]]),l[w]<0?l[w]=0:l[w]>1&&(l[w]=1),M=U(c*u[w]*_),M=Math.min(M,15.5)/15.5,o[w]=Math.pow(10,1.25*(1-Math.cos(Math.PI*M))-2.5)}b=0;for(var R=0;R=0?3:1.5)>=.5&&f<=2.5?8*((p=f-.5)*p-2*p):0,((_=15.811389+7.5*(f+=.474)-17.5*Math.sqrt(1+f*f))<=-60?0:(f=Math.exp(.2302585093*(u+_)),f/=.6609193))*r[l]);h[v][l]=m*a[v]}else for(l=0;l0);l++);for(e[v][0]=l,l=t-1;l>0&&!(h[v][l]>0);l--);e[v][1]=l,d+=e[v][1]-e[v][0]+1}var y=i(d),w=0;for(v=0;v2&&(s[r][v].en.assign(p.en[v+2]),s[r][v].thm.assign(p.thm[v+2]))}for(v=0;v0;++g,--S){var E=_[0][g],C=_[1][g];_[0][g]=E+C,_[1][g]=E-C}for(g=0;g<3;g++)k[g]=p.nsPsy.last_en_subshort[v][g+6],x[g]=k[g]/p.nsPsy.last_en_subshort[v][g+4],A[0]+=k[g];for(g=0;g<9;g++){for(var O=T+64,P=1;Tk[g+3-2]?P/=k[g+3-2]:P=k[g+3-2]>10*P?k[g+3-2]/(10*P):0,x[g+3]=P}for(g=0;g<3;++g){var I=k[3*g+3]+k[3*g+4]+k[3*g+5],L=1;6*k[3*g+5]R&&(f[v][g/3]=g%3+1);for(g=1;g<4;g++){var H=A[g-1],D=A[g];Math.max(H,D)<4e4&&H<1.7*D&&D<1.7*H&&(1==g&&f[v][0]<=f[v][g]&&(f[v][0]=0),f[v][g]=0)}f[v][0]<=p.nsPsy.lastAttacks[v]&&(f[v][0]=0),3!=p.nsPsy.lastAttacks[v]&&f[v][0]+f[v][1]+f[v][2]+f[v][3]==0||(B=0,0!=f[v][1]&&0!=f[v][0]&&(f[v][1]=0),0!=f[v][2]&&0!=f[v][1]&&(f[v][2]=0),0!=f[v][3]&&0!=f[v][2]&&(f[v][3]=0)),v<2?u[v]=B:0==B&&(u[0]=u[1]=0),l[v]=p.tot_ener[v]}}(e,t,n,r,s,l,u,S,x,M),function(e,t){var n=e.internal_flags;e.short_blocks!=h.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var r=0;r=2||1==x[E][O+1]){var U=0!=O?O-1:2,K=T(p.thm[E].s[I][U],z,.36);z=Math.min(z,K)}else if(1==x[E][O]){U=0!=O?O-1:2,K=T(p.thm[E].s[I][U],z,.18);z=Math.min(z,K)}else if(0!=O&&3==x[E][O-1]||0==O&&3==p.nsPsy.lastAttacks[E]){U=2!=O?O+1:0,K=T(p.thm[E].s[I][U],z,.18);z=Math.min(z,K)}z*=S[E][O],X[O]=z}for(O=0;O<3;O++)p.thm[E].s[I][O]=X[O]}}for(E=0;E1?(Z=f,G=-2,Q=F.NORM_TYPE,_[0]!=F.SHORT_TYPE&&_[1]!=F.SHORT_TYPE||(Q=F.SHORT_TYPE),W=l[r][E-2]):(Z=c,G=0,Q=_[E],W=s[r][E]),Q==F.SHORT_TYPE?Z[G+E]=B(W,p.masking_lower):Z[G+E]=C(W,p.masking_lower),e.analysis&&(p.pinfo.pe[r][E]=Z[G+E])}return 0},this.psymodel_init=function(n){var r,a=n.internal_flags,s=!0,o=13,u=0,_=0,p=-8.25,h=-4.5,m=i(F.CBANDS),b=i(F.CBANDS),g=i(F.CBANDS),y=n.out_samplerate;switch(n.experimentalZ){default:case 0:s=!0;break;case 1:s=n.VBR!=v.vbr_mtrh&&n.VBR!=v.vbr_mt;break;case 2:s=!1;break;case 3:o=8,u=-1.75,_=-.0125,p=-8.25,h=-2.25}for(a.ms_ener_ratio_old=.25,a.blocktype_old[0]=a.blocktype_old[1]=F.NORM_TYPE,r=0;r<4;++r){for(var w=0;w=o&&(x=_*(m[r]-o)/(24-o)+u*(24-m[r])/(24-o)),g[r]=Math.pow(10,x/10),a.numlines_l[r]>0?a.rnumlines_l[r]=1/a.numlines_l[r]:a.rnumlines_l[r]=0}a.s3_ll=G(a.s3ind,a.npart_l,m,b,g,s);var k;w=0;for(r=0;r(R*=a.numlines_l[r])&&(T=R)}a.ATH.cb_l[r]=T,(T=20*m[r]/10-20)>6&&(T=100),T<-15&&(T=-15),T-=8,a.minval_l[r]=Math.pow(10,T/10)*a.numlines_l[r]}for(a.npart_s=Z(a.numlines_s,a.bo_s,a.bm_s,m,b,a.mld_s,a.PSY.bo_s_weight,y,F.BLKSIZE_s,a.scalefac_band.s,F.BLKSIZE_s/384,F.SBMAX_s),w=0,r=0;r=o&&(x=h*(m[r]-o)/(24-o)+p*(24-m[r])/(24-o)),g[r]=Math.pow(10,x/10),T=d.MAX_VALUE;for(A=0;A(R*=a.numlines_s[r])&&(T=R)}a.ATH.cb_s[r]=T,T=7*m[r]/12-7,m[r]>12&&(T*=1+3.1*Math.log(1+T)),m[r]<12&&(T*=1+2.3*Math.log(1-T)),T<-15&&(T=-15),T-=8,a.minval_s[r]=Math.pow(10,T/10)*a.numlines_s[r]}a.s3_ss=G(a.s3ind_s,a.npart_s,m,b,g,s),l=Math.pow(10,9/16),c=Math.pow(10,1.5),f=Math.pow(10,1.5),e.init_fft(a),a.decay=Math.exp(-1*t/(.01*y/192)),k=3.5,0!=(2&n.exp_nspsytune)&&(k=1),Math.abs(n.msfix)>0&&(k=n.msfix),n.msfix=k;for(var B=0;Ba.npart_l-1&&(a.s3ind[B][1]=a.npart_l-1);var E=576*a.mode_gr/y;if(a.ATH.decay=Math.pow(10,-1.2*E),a.ATH.adjust=.01,a.ATH.adjustLimit=1,-1!=n.ATHtype){var C=n.out_samplerate/F.BLKSIZE,O=0;for(M=0,r=0;r=0;)a.ATH.eql_w[r]*=O}for(B=w=0;B1?0:e<=0?1:Math.cos(Math.PI/2*e)}function S(e,t){switch(e){case 44100:return t.version=1,0;case 48e3:return t.version=1,1;case 32e3:return t.version=1,2;case 22050:return t.version=0,0;case 24e3:return t.version=0,1;case 16e3:return t.version=0,2;case 11025:return t.version=0,0;case 12e3:return t.version=0,1;case 8e3:return t.version=0,2;default:return t.version=0,-1}}function x(e,t,n){n<16e3&&(t=2);for(var r=M.bitrate_table[t][1],a=2;a<=14;a++)M.bitrate_table[t][a]>0&&Math.abs(M.bitrate_table[t][a]-e)0&&M.bitrate_table[t][r]==e)return r;return-1}function T(t,n){var r=[new g(8,2e3),new g(16,3700),new g(24,3900),new g(32,5500),new g(40,7e3),new g(48,7500),new g(56,1e4),new g(64,11e3),new g(80,13500),new g(96,15100),new g(112,15600),new g(128,17e3),new g(160,17500),new g(192,18600),new g(224,19400),new g(256,19700),new g(320,20500)],a=e.nearestBitrateFullIndex(n);t.lowerlimit=r[a].lowpass}function R(e){var t=F.BLKSIZE+e.framesize-F.FFTOFFSET;return t=Math.max(t,512+e.framesize-32)}function B(t,n,r,a,i,s){var o=e.enc.lame_encode_mp3_frame(t,n,r,a,i,s);return t.frameNum++,o}function I(){this.n_in=0,this.n_out=0}function L(){this.num_used=0}function N(e,t,n){var r=Math.PI*t;(e/=n)<0&&(e=0),e>1&&(e=1);var a=e-.5,i=.42-.5*Math.cos(2*e*Math.PI)+.08*Math.cos(4*e*Math.PI);return Math.abs(a)<1e-9?r/Math.PI:i*Math.sin(n*r*a)/(Math.PI*n*a)}function H(e,t,n,r,a,s,o,l,c){var f,u,_=e.internal_flags,p=0,h=e.out_samplerate/function e(t,n){return 0!=n?e(n,t%n):t}(e.out_samplerate,e.in_samplerate);h>U.BPC&&(h=U.BPC);var d=Math.abs(_.resample_ratio-Math.floor(.5+_.resample_ratio))<1e-4?1:0,v=1/_.resample_ratio;v>1&&(v=1);var m=31;0==m%2&&--m;var b=(m+=d)+1;if(0==_.fill_buffer_resample_init){for(_.inbuf_old[0]=i(b),_.inbuf_old[1]=i(b),f=0;f<=2*h;++f)_.blackfilt[f]=i(b);for(_.itime[0]=0,_.itime[1]=0,p=0;p<=2*h;p++){var g=0,y=(p-h)/(2*h);for(f=0;f<=m;f++)g+=_.blackfilt[p][f]=N(f-y,v,m);for(f=0;f<=m;f++)_.blackfilt[p][f]/=g}_.fill_buffer_resample_init=1}var w=_.inbuf_old[c];for(u=0;u=o)break;y=S-_.itime[c]-(p+m%2*.5);x=0|Math.floor(2*y*h+h+.5);var k=0;for(f=0;f<=m;++f){var A=f+p-m/2;k+=(A<0?w[b+A]:a[s+A])*_.blackfilt[x][f]}t[n+u]=k}if(l.num_used=Math.min(o,m+p-m/2),_.itime[c]+=l.num_used-u*_.resample_ratio,l.num_used>=b)for(f=0;f1.0001)for(var o=0;oe-r?n:a},this.lame_init_params=function(e){var i,c,g,R=e.internal_flags;if(R.Class_ID=0,null==R.ATH&&(R.ATH=new E),null==R.PSY&&(R.PSY=new d),null==R.rgdata&&(R.rgdata=new P),R.channels_in=e.num_channels,1==R.channels_in&&(e.mode=m.MONO),R.channels_out=e.mode==m.MONO?1:2,R.mode_ext=F.MPG_MD_MS_LR,e.mode==m.MONO&&(e.force_ms=!1),e.VBR==v.vbr_off&&128!=e.VBR_mean_bitrate_kbps&&0==e.brate&&(e.brate=e.VBR_mean_bitrate_kbps),e.VBR==v.vbr_off||e.VBR==v.vbr_mtrh||e.VBR==v.vbr_mt||(e.free_format=!1),e.VBR==v.vbr_off&&0==e.brate&&k.EQ(e.compression_ratio,0)&&(e.compression_ratio=11.025),e.VBR==v.vbr_off&&e.compression_ratio>0&&(0==e.out_samplerate&&(e.out_samplerate=map2MP3Frequency(int(.97*e.in_samplerate))),e.brate=0|16*e.out_samplerate*R.channels_out/(1e3*e.compression_ratio),R.samplerate_index=S(e.out_samplerate,e),e.free_format||(e.brate=x(e.brate,e.version,e.out_samplerate))),0!=e.out_samplerate&&(e.out_samplerate<16e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,64)):e.out_samplerate<32e3?(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,8),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,160)):(e.VBR_mean_bitrate_kbps=Math.max(e.VBR_mean_bitrate_kbps,32),e.VBR_mean_bitrate_kbps=Math.min(e.VBR_mean_bitrate_kbps,320))),0==e.lowpassfreq){var B=16e3;switch(e.VBR){case v.vbr_off:T(C=new b,e.brate),B=C.lowerlimit;break;case v.vbr_abr:var C;T(C=new b,e.VBR_mean_bitrate_kbps),B=C.lowerlimit;break;case v.vbr_rh:var I=[19500,19e3,18600,18e3,17500,16e3,15600,14900,12500,1e4,3950];if(0<=e.VBR_q&&e.VBR_q<=9){var L=I[e.VBR_q],N=I[e.VBR_q+1],H=e.VBR_q_frac;B=linear_int(L,N,H)}else B=19500;break;default:I=[19500,19e3,18500,18e3,17500,16500,15500,14500,12500,9500,3950];if(0<=e.VBR_q&&e.VBR_q<=9){L=I[e.VBR_q],N=I[e.VBR_q+1],H=e.VBR_q_frac;B=linear_int(L,N,H)}else B=19500}e.mode!=m.MONO||e.VBR!=v.vbr_off&&e.VBR!=v.vbr_abr||(B*=1.5),e.lowpassfreq=0|B}if(0==e.out_samplerate&&(2*e.lowpassfreq>e.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(i=0|e.lowpassfreq,c=e.in_samplerate,g=44100,c>=48e3?g=48e3:c>=44100?g=44100:c>=32e3?g=32e3:c>=24e3?g=24e3:c>=22050?g=22050:c>=16e3?g=16e3:c>=12e3?g=12e3:c>=11025?g=11025:c>=8e3&&(g=8e3),-1==i?g:(i<=15960&&(g=44100),i<=15250&&(g=32e3),i<=11220&&(g=24e3),i<=9970&&(g=22050),i<=7230&&(g=16e3),i<=5420&&(g=12e3),i<=4510&&(g=11025),i<=3970&&(g=8e3),c44100?48e3:c>32e3?44100:c>24e3?32e3:c>22050?24e3:c>16e3?22050:c>12e3?16e3:c>11025?12e3:c>8e3?11025:8e3:g))),e.lowpassfreq=Math.min(20500,e.lowpassfreq),e.lowpassfreq=Math.min(e.out_samplerate/2,e.lowpassfreq),e.VBR==v.vbr_off&&(e.compression_ratio=16*e.out_samplerate*R.channels_out/(1e3*e.brate)),e.VBR==v.vbr_abr&&(e.compression_ratio=16*e.out_samplerate*R.channels_out/(1e3*e.VBR_mean_bitrate_kbps)),e.bWriteVbrTag||(e.findReplayGain=!1,e.decode_on_the_fly=!1,R.findPeakSample=!1),R.findReplayGain=e.findReplayGain,R.decode_on_the_fly=e.decode_on_the_fly,R.decode_on_the_fly&&(R.findPeakSample=!0),R.findReplayGain&&t.InitGainAnalysis(R.rgdata,e.out_samplerate)==y.INIT_GAIN_ANALYSIS_ERROR)return e.internal_flags=null,-6;switch(R.decode_on_the_fly&&!e.decode_only&&(null!=R.hip&&u.hip_decode_exit(R.hip),R.hip=u.hip_decode_init()),R.mode_gr=e.out_samplerate<=24e3?1:2,e.framesize=576*R.mode_gr,e.encoder_delay=F.ENCDELAY,R.resample_ratio=e.in_samplerate/e.out_samplerate,e.VBR){case v.vbr_mt:case v.vbr_rh:case v.vbr_mtrh:e.compression_ratio=[5.7,6.5,7.3,8.2,10,11.9,13,14,15,16.5][e.VBR_q];break;case v.vbr_abr:e.compression_ratio=16*e.out_samplerate*R.channels_out/(1e3*e.VBR_mean_bitrate_kbps);break;default:e.compression_ratio=16*e.out_samplerate*R.channels_out/(1e3*e.brate)}if(e.mode==m.NOT_SET&&(e.mode=m.JOINT_STEREO),e.highpassfreq>0?(R.highpass1=2*e.highpassfreq,e.highpasswidth>=0?R.highpass2=2*(e.highpassfreq+e.highpasswidth):R.highpass2=2*e.highpassfreq,R.highpass1/=e.out_samplerate,R.highpass2/=e.out_samplerate):(R.highpass1=0,R.highpass2=0),e.lowpassfreq>0?(R.lowpass2=2*e.lowpassfreq,e.lowpasswidth>=0?(R.lowpass1=2*(e.lowpassfreq-e.lowpasswidth),R.lowpass1<0&&(R.lowpass1=0)):R.lowpass1=2*e.lowpassfreq,R.lowpass1/=e.out_samplerate,R.lowpass2/=e.out_samplerate):(R.lowpass1=0,R.lowpass2=0),function(e){var t=e.internal_flags,n=32,r=-1;if(t.lowpass1>0){for(var a=999,i=0;i<=31;i++){(c=i/31)>=t.lowpass2&&(n=Math.min(n,i)),t.lowpass10&&t.highpass2<.75/31*.9&&(t.highpass1=0,t.highpass2=0,_.err.println("Warning: highpass filter disabled. highpass frequency too small\n")),t.highpass2>0){var s=-1;for(i=0;i<=31;i++){(c=i/31)<=t.highpass1&&(r=Math.max(r,i)),t.highpass1t.highpass1?w((t.highpass2-c)/(t.highpass2-t.highpass1+1e-20)):1,l=t.lowpass2>t.lowpass1?w((c-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[i]=o*l}}(e),R.samplerate_index=S(e.out_samplerate,e),R.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==v.vbr_off){if(e.free_format)R.bitrate_index=0;else if(e.brate=x(e.brate,e.version,e.out_samplerate),R.bitrate_index=A(e.brate,e.version,e.out_samplerate),R.bitrate_index<=0)return e.internal_flags=null,-1}else R.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=R.pinfo&&(e.bWriteVbrTag=!1),n.init_bit_stream_w(R);for(var $,D=R.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),j=0;j5&&(e.quality=5),R.PSY.mask_adjust=e.maskingadjust,R.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?R.sfb21_extra=!1:R.sfb21_extra=e.out_samplerate>44e3,R.iteration_loop=new VBRNewIterationLoop(s);break;case v.vbr_rh:r.apply_preset(e,500-10*e.VBR_q,0),R.PSY.mask_adjust=e.maskingadjust,R.PSY.mask_adjust_short=e.maskingadjust_short,e.experimentalY?R.sfb21_extra=!1:R.sfb21_extra=e.out_samplerate>44e3,e.quality>6&&(e.quality=6),e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),R.iteration_loop=new VBROldIterationLoop(s);break;default:var Y;R.sfb21_extra=!1,e.quality<0&&(e.quality=LAME_DEFAULT_QUALITY),(Y=e.VBR)==v.vbr_off&&(e.VBR_mean_bitrate_kbps=e.brate),r.apply_preset(e,e.VBR_mean_bitrate_kbps,0),e.VBR=Y,R.PSY.mask_adjust=e.maskingadjust,R.PSY.mask_adjust_short=e.maskingadjust_short,Y==v.vbr_off?R.iteration_loop=new O(s):R.iteration_loop=new ABRIterationLoop(s)}if(e.VBR!=v.vbr_off){if(R.VBR_min_bitrate=1,R.VBR_max_bitrate=14,e.out_samplerate<16e3&&(R.VBR_max_bitrate=8),0!=e.VBR_min_bitrate_kbps&&(e.VBR_min_bitrate_kbps=x(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),R.VBR_min_bitrate=A(e.VBR_min_bitrate_kbps,e.version,e.out_samplerate),R.VBR_min_bitrate<0))return-1;if(0!=e.VBR_max_bitrate_kbps&&(e.VBR_max_bitrate_kbps=x(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),R.VBR_max_bitrate=A(e.VBR_max_bitrate_kbps,e.version,e.out_samplerate),R.VBR_max_bitrate<0))return-1;e.VBR_min_bitrate_kbps=M.bitrate_table[e.version][R.VBR_min_bitrate],e.VBR_max_bitrate_kbps=M.bitrate_table[e.version][R.VBR_max_bitrate],e.VBR_mean_bitrate_kbps=Math.min(M.bitrate_table[e.version][R.VBR_max_bitrate],e.VBR_mean_bitrate_kbps),e.VBR_mean_bitrate_kbps=Math.max(M.bitrate_table[e.version][R.VBR_min_bitrate],e.VBR_mean_bitrate_kbps)}return e.tune&&(R.PSY.mask_adjust+=e.tune_value_a,R.PSY.mask_adjust_short+=e.tune_value_a),function(e){var t=e.internal_flags;switch(e.quality){default:case 9:t.psymodel=0,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 8:e.quality=7;case 7:t.psymodel=1,t.noise_shaping=0,t.noise_shaping_amp=0,t.noise_shaping_stop=0,t.use_best_huffman=0,t.full_outer_loop=0;break;case 6:case 5:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=0,t.full_outer_loop=0;break;case 4:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=0,t.noise_shaping_stop=0,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 3:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 2:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=1,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0;break;case 1:case 0:t.psymodel=1,0==t.noise_shaping&&(t.noise_shaping=1),0==t.substep_shaping&&(t.substep_shaping=2),t.noise_shaping_amp=2,t.noise_shaping_stop=1,-1==t.subblock_gain&&(t.subblock_gain=1),t.use_best_huffman=1,t.full_outer_loop=0}}(e),e.athaa_type<0?R.ATH.useAdjust=3:R.ATH.useAdjust=e.athaa_type,R.ATH.aaSensitivityP=Math.pow(10,e.athaa_sensitivity/-10),null==e.short_blocks&&(e.short_blocks=h.short_block_allowed),e.short_blocks!=h.short_block_allowed||e.mode!=m.JOINT_STEREO&&e.mode!=m.STEREO||(e.short_blocks=h.short_block_coupled),e.quant_comp<0&&(e.quant_comp=1),e.quant_comp_short<0&&(e.quant_comp_short=0),e.msfix<0&&(e.msfix=0),e.exp_nspsytune=1|e.exp_nspsytune,e.internal_flags.nsPsy.attackthre<0&&(e.internal_flags.nsPsy.attackthre=Z.NSATTACKTHRE),e.internal_flags.nsPsy.attackthre_s<0&&(e.internal_flags.nsPsy.attackthre_s=Z.NSATTACKTHRE_S),e.scale<0&&(e.scale=1),e.ATHtype<0&&(e.ATHtype=4),e.ATHcurve<0&&(e.ATHcurve=4),e.athaa_loudapprox<0&&(e.athaa_loudapprox=2),e.interChRatio<0&&(e.interChRatio=0),null==e.useTemporal&&(e.useTemporal=!0),R.slot_lag=R.frac_SpF=0,e.VBR==v.vbr_off&&(R.slot_lag=R.frac_SpF=72e3*(e.version+1)*e.brate%e.out_samplerate|0),a.iteration_init(e),p.psymodel_init(e),0},this.lame_encode_flush=function(e,t,r,a){var i,s,o,l,u=e.internal_flags,_=c([2,1152]),p=0,h=u.mf_samples_to_encode-F.POSTDELAY,d=R(e);if(u.mf_samples_to_encode<1)return 0;for(i=0,e.in_samplerate!=e.out_samplerate&&(h+=16*e.out_samplerate/e.in_samplerate),(o=e.framesize-h%e.framesize)<576&&(o+=e.framesize),e.encoder_padding=o,l=(h+o)/e.framesize;l>0&&p>=0;){var v=d-u.mf_size,m=e.frameNum;v*=e.in_samplerate,(v/=e.out_samplerate)>1152&&(v=1152),v<1&&(v=1),s=a-i,0==a&&(s=0),r+=p=this.lame_encode_buffer(e,_[0],_[1],v,t,r,s),i+=p,l-=m!=e.frameNum?1:0}if(u.mf_samples_to_encode=0,p<0)return p;if(s=a-i,0==a&&(s=0),n.flush_bitstream(e),(p=n.copy_buffer(u,t,r,s,1))<0)return p;if(r+=p,s=a-(i+=p),0==a&&(s=0),e.write_id3tag_automatic){if(f.id3tag_write_v1(e),(p=n.copy_buffer(u,t,r,s,0))<0)return p;i+=p}return i},this.lame_encode_buffer=function(e,r,a,s,o,l,c){var f=e.internal_flags,u=[null,null];if(4294479419!=f.Class_ID)return-3;if(0==s)return 0;!function(e,t){(null==e.in_buffer_0||e.in_buffer_nsamples1&&(u[1][_]=a[_]);return function(e,r,a,i,s,o,l){var c,f,u,_,p,h=e.internal_flags,d=0,v=[null,null],m=[null,null];if(4294479419!=h.Class_ID)return-3;if(0==i)return 0;if((p=n.copy_buffer(h,s,o,l,0))<0)return p;if(o+=p,d+=p,m[0]=r,m[1]=a,k.NEQ(e.scale,0)&&k.NEQ(e.scale,1))for(f=0;f0;){var g,w,S=[null,null];S[0]=m[0],S[1]=m[1];var x=new I;if($(e,v,S,b,i,x),g=x.n_in,w=x.n_out,h.findReplayGain&&!h.decode_on_the_fly&&t.AnalyzeSamples(h.rgdata,v[0],h.mf_size,v[1],h.mf_size,w,h.channels_out)==y.GAIN_ANALYSIS_ERROR)return-6;if(i-=g,b+=g,h.channels_out,h.mf_size+=w,h.mf_samples_to_encode<1&&(h.mf_samples_to_encode=F.ENCDELAY+F.POSTDELAY),h.mf_samples_to_encode+=w,h.mf_size>=_){var A=l-d;if(0==l&&(A=0),(c=B(e,v[0],v[1],s,o,A))<0)return c;for(o+=c,d+=c,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,u=0;uT&&(T=t.length,B=n(R=0|1.25*T+7200));var i=a.lame_encode_buffer(M,t,r,t.length,B,0,R);return new Int8Array(B.subarray(0,i))},this.flush=function(){var e=a.lame_encode_flush(M,B,0,R);return new Int8Array(B.subarray(0,e))}}}e(),Recorder.lamejs=e}()},function(e,t,n){"use strict";var r,a;r=function(e){return new a(e)},(a=function(e){var t={scale:2,speed:8,lineWidth:3,linear1:[0,"rgba(150,96,238,1)",.2,"rgba(170,79,249,1)",1,"rgba(53,199,253,1)"],linear2:[0,"rgba(209,130,255,0.6)",1,"rgba(53,199,255,0.6)"],linearBg:[0,"rgba(255,255,255,0.2)",1,"rgba(54,197,252,0.2)"]};for(var n in e)t[n]=e[n];this.set=e=t;var r=e.elem;r&&("string"==typeof r?r=document.querySelector(r):r.length&&(r=r[0])),r&&(e.width=r.offsetWidth,e.height=r.offsetHeight);var a=e.scale,i=e.width*a,s=e.height*a,o=this.elem=document.createElement("div"),l=["","transform-origin:0 0;","transform:scale("+1/a+");"];o.innerHTML='
';var c=this.canvas=o.querySelector("canvas"),f=this.ctx=c.getContext("2d");c.width=i,c.height=s,this.linear1=this.genLinear(f,i,e.linear1),this.linear2=this.genLinear(f,i,e.linear2),this.linearBg=this.genLinear(f,s,e.linearBg,!0),r&&(r.innerHTML="",r.appendChild(o)),this._phase=0}).prototype=r.prototype={genLinear:function(e,t,n,r){for(var a=e.createLinearGradient(0,0,r?0:t,r?t:0),i=0;i=0;p--,h-=i)a.lineTo(h,_[p]);a.closePath(),a.fillStyle=this.linearBg,a.fill(),this.drawPath(_,this.linear2),this.drawPath(u,this.linear1)},drawPath:function(e,t){var n=this.set,r=this.ctx,a=n.scale,i=n.width*a;r.beginPath();for(var s=0,o=0;o=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return s(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function d(e){return null==e?"":Array.isArray(e)||u(e)&&e.toString===f?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(n,1)}}var w=Object.prototype.hasOwnProperty;function S(e,t){return w.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var A=/-(\w)/g,M=x((function(e){return e.replace(A,(function(e,t){return t?t.toUpperCase():""}))})),k=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,R=x((function(e){return e.replace(T,"-$1").toLowerCase()}));var B=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function E(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function C(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,te=W&&W.indexOf("edge/")>0,ne=(W&&W.indexOf("android"),W&&/iphone|ipad|ipod|ios/.test(W)||"ios"===Q),re=(W&&/chrome\/\d+/.test(W),W&&/phantomjs/.test(W),W&&W.match(/firefox\/(\d+)/)),ae={}.watch,ie=!1;if(Z)try{var se={};Object.defineProperty(se,"passive",{get:function(){ie=!0}}),window.addEventListener("test-passive",null,se)}catch(e){}var oe=function(){return void 0===U&&(U=!Z&&!G&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),U},le=Z&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ce(e){return"function"==typeof e&&/native code/.test(e.toString())}var fe,ue="undefined"!=typeof Symbol&&ce(Symbol)&&"undefined"!=typeof Reflect&&ce(Reflect.ownKeys);fe="undefined"!=typeof Set&&ce(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var _e=P,pe=0,he=function(){this.id=pe++,this.subs=[]};he.prototype.addSub=function(e){this.subs.push(e)},he.prototype.removeSub=function(e){y(this.subs,e)},he.prototype.depend=function(){he.target&&he.target.addDep(this)},he.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(i&&!S(a,"default"))s=!1;else if(""===s||s===R(e)){var l=Ye(String,a.type);(l<0||o0&&(pt((a=e(a,(n||"")+"_"+r))[0])&&pt(f)&&(u[c]=we(f.text+a[0].text),a.shift()),u.push.apply(u,a)):l(a)?pt(f)?u[c]=we(f.text+a):""!==a&&u.push(we(a)):pt(a)&&pt(f)?u[c]=we(f.text+a.text):(o(t._isVList)&&s(a.tag)&&i(a.key)&&s(n)&&(a.key="__vlist"+n+"_"+r+"__"),u.push(a)));return u}(e):void 0}function pt(e){return s(e)&&s(e.text)&&!1===e.isComment}function ht(e,t){if(e){for(var n=Object.create(null),r=ue?Reflect.ownKeys(e):Object.keys(e),a=0;a0,s=e?!!e.$stable:!i,o=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==a&&o===n.$key&&!i&&!n.$hasNormal)return n;for(var l in r={},e)e[l]&&"$"!==l[0]&&(r[l]=bt(t,l,e[l]))}else r={};for(var c in t)c in r||(r[c]=gt(t,c));return e&&Object.isExtensible(e)&&(e._normalized=r),X(r,"$stable",s),X(r,"$key",o),X(r,"$hasNormal",i),r}function bt(e,t,n){var a=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"===(void 0===e?"undefined":r(e))&&!Array.isArray(e)?[e]:_t(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:a,enumerable:!0,configurable:!0}),a}function gt(e,t){return function(){return e[t]}}function yt(e,t){var n,r,a,i,o;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,a=e.length;rdocument.createEvent("Event").timeStamp&&(pn=function(){return hn.now()})}function dn(){var e,t;for(_n=pn(),fn=!0,sn.sort((function(e,t){return e.id-t.id})),un=0;unun&&sn[n].id>e.id;)n--;sn.splice(n+1,0,e)}else sn.push(e);cn||(cn=!0,at(dn))}}(this)},mn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||c(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Xe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},mn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},mn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},mn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var bn={enumerable:!0,configurable:!0,get:P,set:P};function gn(e,t,n){bn.get=function(){return this[t][n]},bn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,bn)}function yn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},a=e.$options._propKeys=[];e.$parent&&Te(!1);var i=function(i){a.push(i);var s=Ve(i,t,n,e);Ee(r,i,s),i in e||gn(e,"_props",i)};for(var s in t)i(s);Te(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?P:B(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data="function"==typeof t?function(e,t){ve();try{return e.call(t,t)}catch(e){return Xe(e,t,"data()"),{}}finally{me()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,a=(e.$options.methods,n.length);for(;a--;){var i=n[a];0,r&&S(r,i)||Y(i)||gn(e,"_data",i)}Be(t,!0)}(e):Be(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=oe();for(var a in t){var i=t[a],s="function"==typeof i?i:i.get;0,r||(n[a]=new mn(e,s||P,P,wn)),a in e||Sn(e,a,i)}}(e,t.computed),t.watch&&t.watch!==ae&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var a=0;a-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!_(e)&&e.test(t)}function On(e,t){var n=e.cache,r=e.keys,a=e._vnode;for(var i in n){var s=n[i];if(s){var o=En(s.componentOptions);o&&!t(o)&&Pn(n,i,r,a)}}}function Pn(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=kn++,t._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var a=r.componentOptions;n.propsData=a.propsData,n._parentListeners=a.listeners,n._renderChildren=a.children,n._componentTag=a.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=De(Tn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Jt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=dt(t._renderChildren,r),e.$scopedSlots=a,e._c=function(t,n,r,a){return Yt(e,t,n,r,a,!1)},e.$createElement=function(t,n,r,a){return Yt(e,t,n,r,a,!0)};var i=n&&n.data;Ee(e,"$attrs",i&&i.attrs||a,null,!0),Ee(e,"$listeners",t._parentListeners||a,null,!0)}(t),an(t,"beforeCreate"),function(e){var t=ht(e.$options.inject,e);t&&(Te(!1),Object.keys(t).forEach((function(n){Ee(e,n,t[n])})),Te(!0))}(t),yn(t),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(t),an(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(Rn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ce,e.prototype.$delete=Oe,e.prototype.$watch=function(e,t,n){if(u(t))return Mn(this,e,t,n);(n=n||{}).user=!0;var r=new mn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Xe(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Rn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var a=0,i=e.length;a1?E(n):n;for(var r=E(arguments,1),a='event handler for "'+e+'"',i=0,s=n.length;iparseInt(this.max)&&Pn(s,o[0],o,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return F}};Object.defineProperty(e,"config",t),e.util={warn:_e,extend:C,mergeOptions:De,defineReactive:Ee},e.set=Ce,e.delete=Oe,e.nextTick=at,e.observable=function(e){return Be(e),e},e.options=Object.create(null),j.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,C(e.options.components,Ln),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Bn(e),function(e){j.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Rn),Object.defineProperty(Rn.prototype,"$isServer",{get:oe}),Object.defineProperty(Rn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Rn,"FunctionalRenderContext",{value:Lt}),Rn.version="2.6.10";var Hn=m("style,class"),Nn=m("input,textarea,option,select,progress"),$n=function(e,t,n){return"value"===n&&Nn(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Dn=m("contenteditable,draggable,spellcheck"),jn=m("events,caret,typing,plaintext-only"),Vn=function(e,t){return zn(t)||"false"===t?"false":"contenteditable"===e&&jn(t)?t:"true"},Fn=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),qn="http://www.w3.org/1999/xlink",Yn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Xn=function(e){return Yn(e)?e.slice(6,e.length):""},zn=function(e){return null==e||!1===e};function Un(e){for(var t=e.data,n=e,r=e;s(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=Kn(r.data,t));for(;s(n=n.parent);)n&&n.data&&(t=Kn(t,n.data));return function(e,t){if(s(e)||s(t))return Zn(e,Gn(t));return""}(t.staticClass,t.class)}function Kn(e,t){return{staticClass:Zn(e.staticClass,t.staticClass),class:s(e.class)?[e.class,t.class]:t.class}}function Zn(e,t){return e?t?e+" "+t:e:t||""}function Gn(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,a=e.length;r-1?wr(e,t,n):Fn(t)?zn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Dn(t)?e.setAttribute(t,Vn(t,n)):Yn(t)?zn(n)?e.removeAttributeNS(qn,Xn(t)):e.setAttributeNS(qn,t,n):wr(e,t,n)}function wr(e,t,n){if(zn(n))e.removeAttribute(t);else{if(J&&!ee&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){e.addEventListener("input",(function t(n){n.stopImmediatePropagation(),e.removeEventListener("input",t)})),e.__ieph=!0}e.setAttribute(t,n)}}var Sr={create:gr,update:gr};function xr(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var o=Un(t),l=n._transitionClasses;s(l)&&(o=Zn(o,Gn(l))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var Ar,Mr,kr,Tr,Rr,Br,Er={create:xr,update:xr},Cr=/[\w).+\-_$\]]/;function Or(e){var t,n,r,a,i,s=!1,o=!1,l=!1,c=!1,f=0,u=0,_=0,p=0;for(r=0;r=0&&" "===(d=e.charAt(h));h--);d&&Cr.test(d)||(c=!0)}}else void 0===a?(p=r+1,a=e.slice(0,r).trim()):v();function v(){(i||(i=[])).push(e.slice(p,r).trim()),p=r+1}if(void 0===a?a=e.slice(0,r).trim():0!==p&&v(),i)for(r=0;r-1?{exp:e.slice(0,Tr),key:'"'+e.slice(Tr+1)+'"'}:{exp:e,key:null};Mr=e,Tr=Rr=Br=0;for(;!Zr();)Gr(kr=Kr())?Wr(kr):91===kr&&Qr(kr);return{exp:e.slice(0,Rr),key:e.slice(Rr+1,Br)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Kr(){return Mr.charCodeAt(++Tr)}function Zr(){return Tr>=Ar}function Gr(e){return 34===e||39===e}function Qr(e){var t=1;for(Rr=Tr;!Zr();)if(Gr(e=Kr()))Wr(e);else if(91===e&&t++,93===e&&t--,0===t){Br=Tr;break}}function Wr(e){for(var t=e;!Zr()&&(e=Kr())!==t;);}var Jr,ea="__r",ta="__c";function na(e,t,n){var r=Jr;return function a(){var i=t.apply(null,arguments);null!==i&&ia(e,a,n,r)}}var ra=Ge&&!(re&&Number(re[1])<=53);function aa(e,t,n,r){if(ra){var a=_n,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Jr.addEventListener(e,t,ie?{capture:n,passive:r}:n)}function ia(e,t,n,r){(r||Jr).removeEventListener(e,t._wrapper||t,n)}function sa(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Jr=t.elm,function(e){if(s(e[ea])){var t=J?"change":"input";e[t]=[].concat(e[ea],e[t]||[]),delete e[ea]}s(e[ta])&&(e.change=[].concat(e[ta],e.change||[]),delete e[ta])}(n),ct(n,r,aa,ia,na,t.context),Jr=void 0}}var oa,la={create:sa,update:sa};function ca(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,r,a=t.elm,o=e.data.domProps||{},l=t.data.domProps||{};for(n in s(l.__ob__)&&(l=t.data.domProps=C({},l)),o)n in l||(a[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===o[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var c=i(r)?"":String(r);fa(a,c)&&(a.value=c)}else if("innerHTML"===n&&Jn(a.tagName)&&i(a.innerHTML)){(oa=oa||document.createElement("div")).innerHTML=""+r+"";for(var f=oa.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;f.firstChild;)a.appendChild(f.firstChild)}else if(r!==o[n])try{a[n]=r}catch(e){}}}}function fa(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(s(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var ua={create:ca,update:ca},_a=x((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function pa(e){var t=ha(e.style);return e.staticStyle?C(e.staticStyle,t):t}function ha(e){return Array.isArray(e)?O(e):"string"==typeof e?_a(e):e}var da,va=/^--/,ma=/\s*!important$/,ba=function(e,t,n){if(va.test(t))e.style.setProperty(t,n);else if(ma.test(n))e.style.setProperty(R(t),n.replace(ma,""),"important");else{var r=ya(t);if(Array.isArray(n))for(var a=0,i=n.length;a-1?t.split(xa).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ma(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(xa).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function ka(e){if(e){if("object"===(void 0===e?"undefined":r(e))){var t={};return!1!==e.css&&C(t,Ta(e.name||"v")),C(t,e),t}return"string"==typeof e?Ta(e):void 0}}var Ta=x((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),Ra=Z&&!ee,Ba="transition",Ea="animation",Ca="transition",Oa="transitionend",Pa="animation",Ia="animationend";Ra&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(Ca="WebkitTransition",Oa="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Pa="WebkitAnimation",Ia="webkitAnimationEnd"));var La=Z?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ha(e){La((function(){La(e)}))}function Na(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),Aa(e,t))}function $a(e,t){e._transitionClasses&&y(e._transitionClasses,t),Ma(e,t)}function Da(e,t,n){var r=Va(e,t),a=r.type,i=r.timeout,s=r.propCount;if(!a)return n();var o=a===Ba?Oa:Ia,l=0,c=function(){e.removeEventListener(o,f),n()},f=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l0&&(n=Ba,f=s,u=i.length):t===Ea?c>0&&(n=Ea,f=c,u=l.length):u=(n=(f=Math.max(s,c))>0?s>c?Ba:Ea:null)?n===Ba?i.length:l.length:0,{type:n,timeout:f,propCount:u,hasTransform:n===Ba&&ja.test(r[Ca+"Property"])}}function Fa(e,t){for(;e.length1}function Ka(e,t){!0!==t.data.show&&Ya(t)}var Za=function(e){var t,n,r={},a=e.modules,c=e.nodeOps;for(t=0;th?g(e,i(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&w(0,t,_,h)}(_,v,m,n,f):s(m)?(s(e.text)&&c.setTextContent(_,""),g(_,null,m,0,m.length-1,n)):s(v)?w(0,v,0,v.length-1):s(e.text)&&c.setTextContent(_,""):e.text!==t.text&&c.setTextContent(_,t.text),s(h)&&s(p=h.hook)&&s(p=p.postpatch)&&p(e,t)}}}function M(e,t,n){if(o(n)&&s(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,s.selected!==i&&(s.selected=i);else if(H(ei(s),r))return void(e.selectedIndex!==o&&(e.selectedIndex=o));a||(e.selectedIndex=-1)}}function Ja(e,t){return t.every((function(t){return!H(t,e)}))}function ei(e){return"_value"in e?e._value:e.value}function ti(e){e.target.composing=!0}function ni(e){e.target.composing&&(e.target.composing=!1,ri(e.target,"input"))}function ri(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ai(e){return!e.componentInstance||e.data&&e.data.transition?e:ai(e.componentInstance._vnode)}var ii={model:Ga,show:{bind:function(e,t,n){var r=t.value,a=(n=ai(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&a?(n.data.show=!0,Ya(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=ai(n)).data&&n.data.transition?(n.data.show=!0,r?Ya(n,(function(){e.style.display=e.__vOriginalDisplay})):Xa(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,a){a||(e.style.display=e.__vOriginalDisplay)}}},si={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function oi(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?oi(Zt(t.children)):e}function li(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var a=n._parentListeners;for(var i in a)t[M(i)]=a[i];return t}function ci(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var fi=function(e){return e.tag||Kt(e)},ui=function(e){return"show"===e.name},_i={name:"transition",props:si,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(fi)).length){0;var r=this.mode;0;var a=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return a;var i=oi(a);if(!i)return a;if(this._leaving)return ci(e,a);var s="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?s+"comment":s+i.tag:l(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var o=(i.data||(i.data={})).transition=li(this),c=this._vnode,f=oi(c);if(i.data.directives&&i.data.directives.some(ui)&&(i.data.show=!0),f&&f.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,f)&&!Kt(f)&&(!f.componentInstance||!f.componentInstance._vnode.isComment)){var u=f.data.transition=C({},o);if("out-in"===r)return this._leaving=!0,ft(u,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ci(e,a);if("in-out"===r){if(Kt(i))return c;var _,p=function(){_()};ft(o,"afterEnter",p),ft(o,"enterCancelled",p),ft(u,"delayLeave",(function(e){_=e}))}}return a}}},pi=C({tag:String,moveClass:String},si);function hi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function di(e){e.data.newPos=e.elm.getBoundingClientRect()}function vi(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,a=t.top-n.top;if(r||a){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+a+"px)",i.transitionDuration="0s"}}delete pi.mode;var mi={Transition:_i,TransitionGroup:{props:pi,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var a=tn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,a(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,a=this.$slots.default||[],i=this.children=[],s=li(this),o=0;o-1?nr[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:nr[e]=/HTMLUnknownElement/.test(t.toString())},C(Rn.options.directives,ii),C(Rn.options.components,mi),Rn.prototype.__patch__=Z?Za:P,Rn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ye),an(e,"beforeMount"),r=function(){e._update(e._render(),n)},new mn(e,r,P,{before:function(){e._isMounted&&!e._isDestroyed&&an(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,an(e,"mounted")),e}(this,e=e&&Z?ar(e):void 0,t)},Z&&setTimeout((function(){F.devtools&&le&&le.emit("init",Rn)}),0);var bi=/\{\{((?:.|\r?\n)+?)\}\}/g,gi=/[-.*+?^${}()|[\]\/\\]/g,yi=x((function(e){var t=e[0].replace(gi,"\\$&"),n=e[1].replace(gi,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));var wi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=qr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Fr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var Si,xi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=qr(e,"style");n&&(e.staticStyle=JSON.stringify(_a(n)));var r=Fr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},Ai=function(e){return(Si=Si||document.createElement("div")).innerHTML=e,Si.textContent},Mi=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),ki=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),Ti=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),Ri=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Bi=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Ei="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+q.source+"]*",Ci="((?:"+Ei+"\\:)?"+Ei+")",Oi=new RegExp("^<"+Ci),Pi=/^\s*(\/?)>/,Ii=new RegExp("^<\\/"+Ci+"[^>]*>"),Li=/^]+>/i,Hi=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Vi=/&(?:lt|gt|quot|amp|#39);/g,Fi=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,qi=m("pre,textarea",!0),Yi=function(e,t){return e&&qi(e)&&"\n"===t[0]};function Xi(e,t){var n=t?Fi:Vi;return e.replace(n,(function(e){return ji[e]}))}var zi,Ui,Ki,Zi,Gi,Qi,Wi,Ji,es=/^@|^v-on:/,ts=/^v-|^@|^:/,ns=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,rs=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,as=/^\(|\)$/g,is=/^\[.*\]$/,ss=/:(.*)$/,os=/^:|^\.|^v-bind:/,ls=/\.[^.\]]+(?=[^\]]*$)/g,cs=/^v-slot(:|$)|^#/,fs=/[\r\n]/,us=/\s+/g,_s=x(Ai),ps="_empty_";function hs(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ws(t),rawAttrsMap:{},parent:n,children:[]}}function ds(e,t){zi=t.warn||Ir,Qi=t.isPreTag||I,Wi=t.mustUseProp||I,Ji=t.getTagNamespace||I;var n=t.isReservedTag||I;(function(e){return!!e.component||!n(e.tag)}),Ki=Lr(t.modules,"transformNode"),Zi=Lr(t.modules,"preTransformNode"),Gi=Lr(t.modules,"postTransformNode"),Ui=t.delimiters;var r,a,i=[],s=!1!==t.preserveWhitespace,o=t.whitespace,l=!1,c=!1;function f(e){if(u(e),l||e.processed||(e=vs(e,t)),i.length||e===r||r.if&&(e.elseif||e.else)&&bs(r,{exp:e.elseif,block:e}),a&&!e.forbidden)if(e.elseif||e.else)s=e,(o=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(a.children))&&o.if&&bs(o,{exp:s.elseif,block:s});else{if(e.slotScope){var n=e.slotTarget||'"default"';(a.scopedSlots||(a.scopedSlots={}))[n]=e}a.children.push(e),e.parent=a}var s,o;e.children=e.children.filter((function(e){return!e.slotScope})),u(e),e.pre&&(l=!1),Qi(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),_=e.replace(u,(function(e,n,r){return c=r.length,$i(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),Yi(f,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));l+=e.length-_.length,e=_,k(f,l-c,l)}else{var p=e.indexOf("<");if(0===p){if(Hi.test(e)){var h=e.indexOf("--\x3e");if(h>=0){t.shouldKeepComment&&t.comment(e.substring(4,h),l,l+h+3),x(h+3);continue}}if(Ni.test(e)){var d=e.indexOf("]>");if(d>=0){x(d+2);continue}}var v=e.match(Li);if(v){x(v[0].length);continue}var m=e.match(Ii);if(m){var b=l;x(m[0].length),k(m[1],b,l);continue}var g=A();if(g){M(g),Yi(g.tagName,e)&&x(1);continue}}var y=void 0,w=void 0,S=void 0;if(p>=0){for(w=e.slice(p);!(Ii.test(w)||Oi.test(w)||Hi.test(w)||Ni.test(w)||(S=w.indexOf("<",1))<0);)p+=S,w=e.slice(p);y=e.substring(0,p)}p<0&&(y=e),y&&x(y.length),t.chars&&y&&t.chars(y,l-y.length,l)}if(e===n){t.chars&&t.chars(e);break}}function x(t){l+=t,e=e.substring(t)}function A(){var t=e.match(Oi);if(t){var n,r,a={tagName:t[1],attrs:[],start:l};for(x(t[0].length);!(n=e.match(Pi))&&(r=e.match(Bi)||e.match(Ri));)r.start=l,x(r[0].length),r.end=l,a.attrs.push(r);if(n)return a.unarySlash=n[1],x(n[0].length),a.end=l,a}}function M(e){var n=e.tagName,l=e.unarySlash;i&&("p"===r&&Ti(n)&&k(r),o(n)&&r===n&&k(n));for(var c=s(n)||!!l,f=e.attrs.length,u=new Array(f),_=0;_=0&&a[s].lowerCasedTag!==o;s--);else s=0;if(s>=0){for(var c=a.length-1;c>=s;c--)t.end&&t.end(a[c].tag,n,i);a.length=s,r=s&&a[s-1].tag}else"br"===o?t.start&&t.start(e,[],!0,n,i):"p"===o&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}k()}(e,{warn:zi,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,s,o,u){var _=a&&a.ns||Ji(e);J&&"svg"===_&&(n=function(e){for(var t=[],n=0;nl&&(o.push(i=e.slice(l,a)),s.push(JSON.stringify(i)));var c=Or(r[1].trim());s.push("_s("+c+")"),o.push({"@binding":c}),l=a+r[0].length}return l-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),Vr(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+a+")":a)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Ur(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Ur(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Ur(t,"$$c")+"}",null,!0)}(e,r,a);else if("input"===i&&"radio"===s)!function(e,t,n){var r=n&&n.number,a=Fr(e,"value")||"null";Hr(e,"checked","_q("+t+","+(a=r?"_n("+a+")":a)+")"),Vr(e,"change",Ur(t,a),null,!0)}(e,r,a);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type;0;var a=n||{},i=a.lazy,s=a.number,o=a.trim,l=!i&&"range"!==r,c=i?"change":"range"===r?ea:"input",f="$event.target.value";o&&(f="$event.target.value.trim()");s&&(f="_n("+f+")");var u=Ur(t,f);l&&(u="if($event.target.composing)return;"+u);Hr(e,"value","("+t+")"),Vr(e,c,u,null,!0),(o||s)&&Vr(e,"blur","$forceUpdate()")}(e,r,a);else{if(!F.isReservedTag(i))return zr(e,r,a),!1}return!0},text:function(e,t){t.value&&Hr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Hr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:Mi,mustUseProp:$n,canBeLeftOpenTag:ki,isReservedTag:er,getTagNamespace:tr,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(Ms)},Bs=x((function(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function Es(e,t){e&&(ks=Bs(t.staticKeys||""),Ts=t.isReservedTag||I,function e(t){if(t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||b(e.tag)||!Ts(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(ks)))}(t),1===t.type){if(!Ts(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*(?:[\w$]+)?\s*\(/,Os=/\([^)]*?\);*$/,Ps=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Is={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ls={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Hs=function(e){return"if("+e+")return null;"},Ns={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Hs("$event.target !== $event.currentTarget"),ctrl:Hs("!$event.ctrlKey"),shift:Hs("!$event.shiftKey"),alt:Hs("!$event.altKey"),meta:Hs("!$event.metaKey"),left:Hs("'button' in $event && $event.button !== 0"),middle:Hs("'button' in $event && $event.button !== 1"),right:Hs("'button' in $event && $event.button !== 2")};function $s(e,t){var n=t?"nativeOn:":"on:",r="",a="";for(var i in e){var s=Ds(e[i]);e[i]&&e[i].dynamic?a+=i+","+s+",":r+='"'+i+'":'+s+","}return r="{"+r.slice(0,-1)+"}",a?n+"_d("+r+",["+a.slice(0,-1)+"])":n+r}function Ds(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return Ds(e)})).join(",")+"]";var t=Ps.test(e.value),n=Cs.test(e.value),r=Ps.test(e.value.replace(Os,""));if(e.modifiers){var a="",i="",s=[];for(var o in e.modifiers)if(Ns[o])i+=Ns[o],Is[o]&&s.push(o);else if("exact"===o){var l=e.modifiers;i+=Hs(["ctrl","shift","alt","meta"].filter((function(e){return!l[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(o);return s.length&&(a+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(js).join("&&")+")return null;"}(s)),i&&(a+=i),"function($event){"+a+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function js(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Is[e],r=Ls[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Vs={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:P},Fs=function(e){this.options=e,this.warn=e.warn||Ir,this.transforms=Lr(e.modules,"transformCode"),this.dataGenFns=Lr(e.modules,"genData"),this.directives=C(C({},Vs),e.directives);var t=e.isReservedTag||I;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function qs(e,t){var n=new Fs(t);return{render:"with(this){return "+(e?Ys(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ys(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Xs(e,t);if(e.once&&!e.onceProcessed)return zs(e,t);if(e.for&&!e.forProcessed)return Ks(e,t);if(e.if&&!e.ifProcessed)return Us(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Ws(e,t),a="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?to((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:M(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];!i&&!s||r||(a+=",null");i&&(a+=","+i);s&&(a+=(i?"":",null")+","+s);return a+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Ws(t,n,!0);return"_c("+e+","+Zs(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Zs(e,t));var a=e.inlineTemplate?null:Ws(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(a?","+a:"")+")"}for(var i=0;i>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];0;if(n&&1===n.type){var r=qs(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+to(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Gs(e){return 1===e.type&&("slot"===e.tag||e.children.some(Gs))}function Qs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Us(e,t,Qs,"null");if(e.for&&!e.forProcessed)return Ks(e,t,Qs);var r=e.slotScope===ps?"":String(e.slotScope),a="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Ws(e,t)||"undefined")+":undefined":Ws(e,t)||"undefined":Ys(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+a+i+"}"}function Ws(e,t,n,r,a){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var o=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Ys)(s,t)+o}var l=n?function(e,t){for(var n=0,r=0;r':'
',so.innerHTML.indexOf(" ")>0}var fo=!!Z&&co(!1),uo=!!Z&&co(!0),_o=x((function(e){var t=ar(e);return t&&t.innerHTML})),po=Rn.prototype.$mount;Rn.prototype.$mount=function(e,t){if((e=e&&ar(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=_o(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){0;var a=lo(r,{outputSourceRange:!1,shouldDecodeNewlines:fo,shouldDecodeNewlinesForHref:uo,delimiters:n.delimiters,comments:n.comments},this),i=a.render,s=a.staticRenderFns;n.render=i,n.staticRenderFns=s}}return po.call(this,e,t)},Rn.compile=lo,t.default=Rn}).call(this,n(3),n(13).setImmediate)},function(e,t,n){"use strict";(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(14),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(3))},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var r,a,i,s,o,l=1,c={},f=!1,u=e.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(e);_=_&&_.setTimeout?_:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(a=u.documentElement,r=function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}),_.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n=0&&Math.floor(t)===t&&isFinite(e)}function h(e){return s(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function d(e){return null==e?"":Array.isArray(e)||u(e)&&e.toString===f?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),a=0;a-1)return e.splice(n,1)}}var w=Object.prototype.hasOwnProperty;function S(e,t){return w.call(e,t)}function x(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var k=/-(\w)/g,A=x((function(e){return e.replace(k,(function(e,t){return t?t.toUpperCase():""}))})),M=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),T=/\B([A-Z])/g,R=x((function(e){return e.replace(T,"-$1").toLowerCase()}));var B=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function E(e,t){t=t||0;for(var n=e.length-t,r=new Array(n);n--;)r[n]=e[n+t];return r}function C(e,t){for(var n in t)e[n]=t[n];return e}function O(e){for(var t={},n=0;n0,ee=Q&&Q.indexOf("edge/")>0,te=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===G),ne=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),re={}.watch,ae=!1;if(K)try{var ie={};Object.defineProperty(ie,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,ie)}catch(e){}var se=function(){return void 0===z&&(z=!K&&!Z&&void 0!==e&&(e.process&&"server"===e.process.env.VUE_ENV)),z},oe=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function le(e){return"function"==typeof e&&/native code/.test(e.toString())}var ce,fe="undefined"!=typeof Symbol&&le(Symbol)&&"undefined"!=typeof Reflect&&le(Reflect.ownKeys);ce="undefined"!=typeof Set&&le(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ue=P,_e=0,pe=function(){this.id=_e++,this.subs=[]};pe.prototype.addSub=function(e){this.subs.push(e)},pe.prototype.removeSub=function(e){y(this.subs,e)},pe.prototype.depend=function(){pe.target&&pe.target.addDep(this)},pe.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(i&&!S(a,"default"))s=!1;else if(""===s||s===R(e)){var l=Ye(String,a.type);(l<0||o0&&(pt((a=e(a,(n||"")+"_"+r))[0])&&pt(f)&&(u[c]=ye(f.text+a[0].text),a.shift()),u.push.apply(u,a)):l(a)?pt(f)?u[c]=ye(f.text+a):""!==a&&u.push(ye(a)):pt(a)&&pt(f)?u[c]=ye(f.text+a.text):(o(t._isVList)&&s(a.tag)&&i(a.key)&&s(n)&&(a.key="__vlist"+n+"_"+r+"__"),u.push(a)));return u}(e):void 0}function pt(e){return s(e)&&s(e.text)&&!1===e.isComment}function ht(e,t){if(e){for(var n=Object.create(null),r=fe?Reflect.ownKeys(e):Object.keys(e),a=0;a0,s=e?!!e.$stable:!i,o=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(s&&n&&n!==a&&o===n.$key&&!i&&!n.$hasNormal)return n;for(var l in r={},e)e[l]&&"$"!==l[0]&&(r[l]=bt(t,l,e[l]))}else r={};for(var c in t)c in r||(r[c]=gt(t,c));return e&&Object.isExtensible(e)&&(e._normalized=r),Y(r,"$stable",s),Y(r,"$key",o),Y(r,"$hasNormal",i),r}function bt(e,t,n){var a=function(){var e=arguments.length?n.apply(null,arguments):n({});return(e=e&&"object"===(void 0===e?"undefined":r(e))&&!Array.isArray(e)?[e]:_t(e))&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:a,enumerable:!0,configurable:!0}),a}function gt(e,t){return function(){return e[t]}}function yt(e,t){var n,r,a,i,o;if(Array.isArray(e)||"string"==typeof e)for(n=new Array(e.length),r=0,a=e.length;rdocument.createEvent("Event").timeStamp&&(un=function(){return _n.now()})}function pn(){var e,t;for(fn=un(),ln=!0,rn.sort((function(e,t){return e.id-t.id})),cn=0;cncn&&rn[n].id>e.id;)n--;rn.splice(n+1,0,e)}else rn.push(e);on||(on=!0,at(pn))}}(this)},dn.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||c(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(e){Xe(e,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},dn.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},dn.prototype.depend=function(){for(var e=this.deps.length;e--;)this.deps[e].depend()},dn.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||y(this.vm._watchers,this);for(var e=this.deps.length;e--;)this.deps[e].removeSub(this);this.active=!1}};var vn={enumerable:!0,configurable:!0,get:P,set:P};function mn(e,t,n){vn.get=function(){return this[t][n]},vn.set=function(e){this[t][n]=e},Object.defineProperty(e,n,vn)}function bn(e){e._watchers=[];var t=e.$options;t.props&&function(e,t){var n=e.$options.propsData||{},r=e._props={},a=e.$options._propKeys=[];e.$parent&&Me(!1);var i=function(i){a.push(i);var s=Ve(i,t,n,e);Be(r,i,s),i in e||mn(e,"_props",i)};for(var s in t)i(s);Me(!0)}(e,t.props),t.methods&&function(e,t){e.$options.props;for(var n in t)e[n]="function"!=typeof t[n]?P:B(t[n],e)}(e,t.methods),t.data?function(e){var t=e.$options.data;u(t=e._data="function"==typeof t?function(e,t){de();try{return e.call(t,t)}catch(e){return Xe(e,t,"data()"),{}}finally{ve()}}(t,e):t||{})||(t={});var n=Object.keys(t),r=e.$options.props,a=(e.$options.methods,n.length);for(;a--;){var i=n[a];0,r&&S(r,i)||q(i)||mn(e,"_data",i)}Re(t,!0)}(e):Re(e._data={},!0),t.computed&&function(e,t){var n=e._computedWatchers=Object.create(null),r=se();for(var a in t){var i=t[a],s="function"==typeof i?i:i.get;0,r||(n[a]=new dn(e,s||P,P,gn)),a in e||yn(e,a,i)}}(e,t.computed),t.watch&&t.watch!==re&&function(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var a=0;a-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!_(e)&&e.test(t)}function En(e,t){var n=e.cache,r=e.keys,a=e._vnode;for(var i in n){var s=n[i];if(s){var o=Rn(s.componentOptions);o&&!t(o)&&Cn(n,i,r,a)}}}function Cn(e,t,n,r){var a=e[t];!a||r&&a.tag===r.tag||a.componentInstance.$destroy(),e[t]=null,y(n,t)}!function(e){e.prototype._init=function(e){var t=this;t._uid=kn++,t._isVue=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),r=t._parentVnode;n.parent=t.parent,n._parentVnode=r;var a=r.componentOptions;n.propsData=a.propsData,n._parentListeners=a.listeners,n._renderChildren=a.children,n._componentTag=a.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=De(An(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&Qt(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=dt(t._renderChildren,r),e.$scopedSlots=a,e._c=function(t,n,r,a){return Ft(e,t,n,r,a,!1)},e.$createElement=function(t,n,r,a){return Ft(e,t,n,r,a,!0)};var i=n&&n.data;Be(e,"$attrs",i&&i.attrs||a,null,!0),Be(e,"$listeners",t._parentListeners||a,null,!0)}(t),nn(t,"beforeCreate"),function(e){var t=ht(e.$options.inject,e);t&&(Me(!1),Object.keys(t).forEach((function(n){Be(e,n,t[n])})),Me(!0))}(t),bn(t),function(e){var t=e.$options.provide;t&&(e._provided="function"==typeof t?t.call(e):t)}(t),nn(t,"created"),t.$options.el&&t.$mount(t.$options.el)}}(Mn),function(e){var t={get:function(){return this._data}},n={get:function(){return this._props}};Object.defineProperty(e.prototype,"$data",t),Object.defineProperty(e.prototype,"$props",n),e.prototype.$set=Ee,e.prototype.$delete=Ce,e.prototype.$watch=function(e,t,n){if(u(t))return xn(this,e,t,n);(n=n||{}).user=!0;var r=new dn(this,e,t,n);if(n.immediate)try{t.call(this,r.value)}catch(e){Xe(e,this,'callback for immediate watcher "'+r.expression+'"')}return function(){r.teardown()}}}(Mn),function(e){var t=/^hook:/;e.prototype.$on=function(e,n){var r=this;if(Array.isArray(e))for(var a=0,i=e.length;a1?E(n):n;for(var r=E(arguments,1),a='event handler for "'+e+'"',i=0,s=n.length;iparseInt(this.max)&&Cn(s,o[0],o,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return V}};Object.defineProperty(e,"config",t),e.util={warn:ue,extend:C,mergeOptions:De,defineReactive:Be},e.set=Ee,e.delete=Ce,e.nextTick=at,e.observable=function(e){return Re(e),e},e.options=Object.create(null),D.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,C(e.options.components,Pn),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=E(arguments,1);return n.unshift(this),"function"==typeof e.install?e.install.apply(e,n):"function"==typeof e&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=De(this.options,e),this}}(e),Tn(e),function(e){D.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&u(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"==typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(Mn),Object.defineProperty(Mn.prototype,"$isServer",{get:se}),Object.defineProperty(Mn.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Mn,"FunctionalRenderContext",{value:Lt}),Mn.version="2.6.10";var In=m("style,class"),Ln=m("input,textarea,option,select,progress"),Nn=function(e,t,n){return"value"===n&&Ln(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Hn=m("contenteditable,draggable,spellcheck"),$n=m("events,caret,typing,plaintext-only"),Dn=m("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),jn="http://www.w3.org/1999/xlink",Vn=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Fn=function(e){return Vn(e)?e.slice(6,e.length):""},qn=function(e){return null==e||!1===e};function Yn(e){for(var t=e.data,n=e,r=e;s(r.componentInstance);)(r=r.componentInstance._vnode)&&r.data&&(t=Xn(r.data,t));for(;s(n=n.parent);)n&&n.data&&(t=Xn(t,n.data));return function(e,t){if(s(e)||s(t))return zn(e,Un(t));return""}(t.staticClass,t.class)}function Xn(e,t){return{staticClass:zn(e.staticClass,t.staticClass),class:s(e.class)?[e.class,t.class]:t.class}}function zn(e,t){return e?t?e+" "+t:e:t||""}function Un(e){return Array.isArray(e)?function(e){for(var t,n="",r=0,a=e.length;r-1?br(e,t,n):Dn(t)?qn(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Hn(t)?e.setAttribute(t,function(e,t){return qn(t)||"false"===t?"false":"contenteditable"===e&&$n(t)?t:"true"}(t,n)):Vn(t)?qn(n)?e.removeAttributeNS(jn,Fn(t)):e.setAttributeNS(jn,t,n):br(e,t,n)}function br(e,t,n){if(qn(n))e.removeAttribute(t);else{if(W&&!J&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){e.addEventListener("input",(function t(n){n.stopImmediatePropagation(),e.removeEventListener("input",t)})),e.__ieph=!0}e.setAttribute(t,n)}}var gr={create:vr,update:vr};function yr(e,t){var n=t.elm,r=t.data,a=e.data;if(!(i(r.staticClass)&&i(r.class)&&(i(a)||i(a.staticClass)&&i(a.class)))){var o=Yn(t),l=n._transitionClasses;s(l)&&(o=zn(o,Un(l))),o!==n._prevClass&&(n.setAttribute("class",o),n._prevClass=o)}}var wr,Sr,xr,kr,Ar,Mr,Tr={create:yr,update:yr},Rr=/[\w).+\-_$\]]/;function Br(e){var t,n,r,a,i,s=!1,o=!1,l=!1,c=!1,f=0,u=0,_=0,p=0;for(r=0;r=0&&" "===(d=e.charAt(h));h--);d&&Rr.test(d)||(c=!0)}}else void 0===a?(p=r+1,a=e.slice(0,r).trim()):v();function v(){(i||(i=[])).push(e.slice(p,r).trim()),p=r+1}if(void 0===a?a=e.slice(0,r).trim():0!==p&&v(),i)for(r=0;r-1?{exp:e.slice(0,kr),key:'"'+e.slice(kr+1)+'"'}:{exp:e,key:null};Sr=e,kr=Ar=Mr=0;for(;!zr();)Ur(xr=Xr())?Zr(xr):91===xr&&Kr(xr);return{exp:e.slice(0,Ar),key:e.slice(Ar+1,Mr)}}(e);return null===n.key?e+"="+t:"$set("+n.exp+", "+n.key+", "+t+")"}function Xr(){return Sr.charCodeAt(++kr)}function zr(){return kr>=wr}function Ur(e){return 34===e||39===e}function Kr(e){var t=1;for(Ar=kr;!zr();)if(Ur(e=Xr()))Zr(e);else if(91===e&&t++,93===e&&t--,0===t){Mr=kr;break}}function Zr(e){for(var t=e;!zr()&&(e=Xr())!==t;);}var Gr;function Qr(e,t,n){var r=Gr;return function a(){var i=t.apply(null,arguments);null!==i&&ea(e,a,n,r)}}var Wr=Ge&&!(ne&&Number(ne[1])<=53);function Jr(e,t,n,r){if(Wr){var a=fn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=a||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}Gr.addEventListener(e,t,ae?{capture:n,passive:r}:n)}function ea(e,t,n,r){(r||Gr).removeEventListener(e,t._wrapper||t,n)}function ta(e,t){if(!i(e.data.on)||!i(t.data.on)){var n=t.data.on||{},r=e.data.on||{};Gr=t.elm,function(e){if(s(e.__r)){var t=W?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}s(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),ct(n,r,Jr,ea,Qr,t.context),Gr=void 0}}var na,ra={create:ta,update:ta};function aa(e,t){if(!i(e.data.domProps)||!i(t.data.domProps)){var n,r,a=t.elm,o=e.data.domProps||{},l=t.data.domProps||{};for(n in s(l.__ob__)&&(l=t.data.domProps=C({},l)),o)n in l||(a[n]="");for(n in l){if(r=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),r===o[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=r;var c=i(r)?"":String(r);ia(a,c)&&(a.value=c)}else if("innerHTML"===n&&Gn(a.tagName)&&i(a.innerHTML)){(na=na||document.createElement("div")).innerHTML=""+r+"";for(var f=na.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;f.firstChild;)a.appendChild(f.firstChild)}else if(r!==o[n])try{a[n]=r}catch(e){}}}}function ia(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,r=e._vModifiers;if(s(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var sa={create:aa,update:aa},oa=x((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var r=e.split(n);r.length>1&&(t[r[0].trim()]=r[1].trim())}})),t}));function la(e){var t=ca(e.style);return e.staticStyle?C(e.staticStyle,t):t}function ca(e){return Array.isArray(e)?O(e):"string"==typeof e?oa(e):e}var fa,ua=/^--/,_a=/\s*!important$/,pa=function(e,t,n){if(ua.test(t))e.style.setProperty(t,n);else if(_a.test(n))e.style.setProperty(R(t),n.replace(_a,""),"important");else{var r=da(t);if(Array.isArray(n))for(var a=0,i=n.length;a-1?t.split(ba).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function ya(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(ba).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";n.indexOf(r)>=0;)n=n.replace(r," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function wa(e){if(e){if("object"===(void 0===e?"undefined":r(e))){var t={};return!1!==e.css&&C(t,Sa(e.name||"v")),C(t,e),t}return"string"==typeof e?Sa(e):void 0}}var Sa=x((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),xa=K&&!J,ka="transition",Aa="transitionend",Ma="animation",Ta="animationend";xa&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ka="WebkitTransition",Aa="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ma="WebkitAnimation",Ta="webkitAnimationEnd"));var Ra=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Ba(e){Ra((function(){Ra(e)}))}function Ea(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),ga(e,t))}function Ca(e,t){e._transitionClasses&&y(e._transitionClasses,t),ya(e,t)}function Oa(e,t,n){var r=Ia(e,t),a=r.type,i=r.timeout,s=r.propCount;if(!a)return n();var o="transition"===a?Aa:Ta,l=0,c=function(){e.removeEventListener(o,f),n()},f=function(t){t.target===e&&++l>=s&&c()};setTimeout((function(){l0&&(n="transition",f=s,u=i.length):"animation"===t?c>0&&(n="animation",f=c,u=l.length):u=(n=(f=Math.max(s,c))>0?s>c?"transition":"animation":null)?"transition"===n?i.length:l.length:0,{type:n,timeout:f,propCount:u,hasTransform:"transition"===n&&Pa.test(r[ka+"Property"])}}function La(e,t){for(;e.length1}function Va(e,t){!0!==t.data.show&&Ha(t)}var Fa=function(e){var t,n,r={},a=e.modules,c=e.nodeOps;for(t=0;th?g(e,i(n[m+1])?null:n[m+1].elm,n,p,m,r):p>m&&w(0,t,_,h)}(_,v,m,n,f):s(m)?(s(e.text)&&c.setTextContent(_,""),g(_,null,m,0,m.length-1,n)):s(v)?w(0,v,0,v.length-1):s(e.text)&&c.setTextContent(_,""):e.text!==t.text&&c.setTextContent(_,t.text),s(h)&&s(p=h.hook)&&s(p=p.postpatch)&&p(e,t)}}}function A(e,t,n){if(o(n)&&s(e.parent))e.parent.data.pendingInsert=t;else for(var r=0;r-1,s.selected!==i&&(s.selected=i);else if(N(Ua(s),r))return void(e.selectedIndex!==o&&(e.selectedIndex=o));a||(e.selectedIndex=-1)}}function za(e,t){return t.every((function(t){return!N(t,e)}))}function Ua(e){return"_value"in e?e._value:e.value}function Ka(e){e.target.composing=!0}function Za(e){e.target.composing&&(e.target.composing=!1,Ga(e.target,"input"))}function Ga(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Qa(e){return!e.componentInstance||e.data&&e.data.transition?e:Qa(e.componentInstance._vnode)}var Wa={model:qa,show:{bind:function(e,t,n){var r=t.value,a=(n=Qa(n)).data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&a?(n.data.show=!0,Ha(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value;!r!=!t.oldValue&&((n=Qa(n)).data&&n.data.transition?(n.data.show=!0,r?Ha(n,(function(){e.style.display=e.__vOriginalDisplay})):$a(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,r,a){a||(e.style.display=e.__vOriginalDisplay)}}},Ja={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ei(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?ei(Ut(t.children)):e}function ti(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var a=n._parentListeners;for(var i in a)t[A(i)]=a[i];return t}function ni(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var ri=function(e){return e.tag||zt(e)},ai=function(e){return"show"===e.name},ii={name:"transition",props:Ja,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ri)).length){0;var r=this.mode;0;var a=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return a;var i=ei(a);if(!i)return a;if(this._leaving)return ni(e,a);var s="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?s+"comment":s+i.tag:l(i.key)?0===String(i.key).indexOf(s)?i.key:s+i.key:i.key;var o=(i.data||(i.data={})).transition=ti(this),c=this._vnode,f=ei(c);if(i.data.directives&&i.data.directives.some(ai)&&(i.data.show=!0),f&&f.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(i,f)&&!zt(f)&&(!f.componentInstance||!f.componentInstance._vnode.isComment)){var u=f.data.transition=C({},o);if("out-in"===r)return this._leaving=!0,ft(u,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),ni(e,a);if("in-out"===r){if(zt(i))return c;var _,p=function(){_()};ft(o,"afterEnter",p),ft(o,"enterCancelled",p),ft(u,"delayLeave",(function(e){_=e}))}}return a}}},si=C({tag:String,moveClass:String},Ja);function oi(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function li(e){e.data.newPos=e.elm.getBoundingClientRect()}function ci(e){var t=e.data.pos,n=e.data.newPos,r=t.left-n.left,a=t.top-n.top;if(r||a){e.data.moved=!0;var i=e.elm.style;i.transform=i.WebkitTransform="translate("+r+"px,"+a+"px)",i.transitionDuration="0s"}}delete si.mode;var fi={Transition:ii,TransitionGroup:{props:si,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var a=Jt(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,a(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,a=this.$slots.default||[],i=this.children=[],s=ti(this),o=0;o-1?Jn[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:Jn[e]=/HTMLUnknownElement/.test(t.toString())},C(Mn.options.directives,Wa),C(Mn.options.components,fi),Mn.prototype.__patch__=K?Fa:P,Mn.prototype.$mount=function(e,t){return function(e,t,n){var r;return e.$el=t,e.$options.render||(e.$options.render=ge),nn(e,"beforeMount"),r=function(){e._update(e._render(),n)},new dn(e,r,P,{before:function(){e._isMounted&&!e._isDestroyed&&nn(e,"beforeUpdate")}},!0),n=!1,null==e.$vnode&&(e._isMounted=!0,nn(e,"mounted")),e}(this,e=e&&K?tr(e):void 0,t)},K&&setTimeout((function(){V.devtools&&oe&&oe.emit("init",Mn)}),0);var ui=/\{\{((?:.|\r?\n)+?)\}\}/g,_i=/[-.*+?^${}()|[\]\/\\]/g,pi=x((function(e){var t=e[0].replace(_i,"\\$&"),n=e[1].replace(_i,"\\$&");return new RegExp(t+"((?:.|\\n)+?)"+n,"g")}));var hi={staticKeys:["staticClass"],transformNode:function(e,t){t.warn;var n=jr(e,"class");n&&(e.staticClass=JSON.stringify(n));var r=Dr(e,"class",!1);r&&(e.classBinding=r)},genData:function(e){var t="";return e.staticClass&&(t+="staticClass:"+e.staticClass+","),e.classBinding&&(t+="class:"+e.classBinding+","),t}};var di,vi={staticKeys:["staticStyle"],transformNode:function(e,t){t.warn;var n=jr(e,"style");n&&(e.staticStyle=JSON.stringify(oa(n)));var r=Dr(e,"style",!1);r&&(e.styleBinding=r)},genData:function(e){var t="";return e.staticStyle&&(t+="staticStyle:"+e.staticStyle+","),e.styleBinding&&(t+="style:("+e.styleBinding+"),"),t}},mi=function(e){return(di=di||document.createElement("div")).innerHTML=e,di.textContent},bi=m("area,base,br,col,embed,frame,hr,img,input,isindex,keygen,link,meta,param,source,track,wbr"),gi=m("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr,source"),yi=m("address,article,aside,base,blockquote,body,caption,col,colgroup,dd,details,dialog,div,dl,dt,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,head,header,hgroup,hr,html,legend,li,menuitem,meta,optgroup,option,param,rp,rt,source,style,summary,tbody,td,tfoot,th,thead,title,tr,track"),wi=/^\s*([^\s"'<>\/=]+)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,Si=/^\s*((?:v-[\w-]+:|@|:|#)\[[^=]+\][^\s"'<>\/=]*)(?:\s*(=)\s*(?:"([^"]*)"+|'([^']*)'+|([^\s"'=<>`]+)))?/,xi="[a-zA-Z_][\\-\\.0-9_a-zA-Z"+F.source+"]*",ki="((?:"+xi+"\\:)?"+xi+")",Ai=new RegExp("^<"+ki),Mi=/^\s*(\/?)>/,Ti=new RegExp("^<\\/"+ki+"[^>]*>"),Ri=/^]+>/i,Bi=/^",""":'"',"&":"&"," ":"\n"," ":"\t","'":"'"},Ii=/&(?:lt|gt|quot|amp|#39);/g,Li=/&(?:lt|gt|quot|amp|#39|#10|#9);/g,Ni=m("pre,textarea",!0),Hi=function(e,t){return e&&Ni(e)&&"\n"===t[0]};function $i(e,t){var n=t?Li:Ii;return e.replace(n,(function(e){return Pi[e]}))}var Di,ji,Vi,Fi,qi,Yi,Xi,zi,Ui=/^@|^v-on:/,Ki=/^v-|^@|^:/,Zi=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,Gi=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,Qi=/^\(|\)$/g,Wi=/^\[.*\]$/,Ji=/:(.*)$/,es=/^:|^\.|^v-bind:/,ts=/\.[^.\]]+(?=[^\]]*$)/g,ns=/^v-slot(:|$)|^#/,rs=/[\r\n]/,as=/\s+/g,is=x(mi);function ss(e,t,n){return{type:1,tag:e,attrsList:t,attrsMap:ps(t),rawAttrsMap:{},parent:n,children:[]}}function os(e,t){Di=t.warn||Cr,Yi=t.isPreTag||I,Xi=t.mustUseProp||I,zi=t.getTagNamespace||I;var n=t.isReservedTag||I;(function(e){return!!e.component||!n(e.tag)}),Vi=Or(t.modules,"transformNode"),Fi=Or(t.modules,"preTransformNode"),qi=Or(t.modules,"postTransformNode"),ji=t.delimiters;var r,a,i=[],s=!1!==t.preserveWhitespace,o=t.whitespace,l=!1,c=!1;function f(e){if(u(e),l||e.processed||(e=ls(e,t)),i.length||e===r||r.if&&(e.elseif||e.else)&&fs(r,{exp:e.elseif,block:e}),a&&!e.forbidden)if(e.elseif||e.else)s=e,(o=function(e){for(var t=e.length;t--;){if(1===e[t].type)return e[t];e.pop()}}(a.children))&&o.if&&fs(o,{exp:s.elseif,block:s});else{if(e.slotScope){var n=e.slotTarget||'"default"';(a.scopedSlots||(a.scopedSlots={}))[n]=e}a.children.push(e),e.parent=a}var s,o;e.children=e.children.filter((function(e){return!e.slotScope})),u(e),e.pre&&(l=!1),Yi(e.tag)&&(c=!1);for(var f=0;f]*>)","i")),_=e.replace(u,(function(e,n,r){return c=r.length,Ci(f)||"noscript"===f||(n=n.replace(//g,"$1").replace(//g,"$1")),Hi(f,n)&&(n=n.slice(1)),t.chars&&t.chars(n),""}));l+=e.length-_.length,e=_,M(f,l-c,l)}else{var p=e.indexOf("<");if(0===p){if(Bi.test(e)){var h=e.indexOf("--\x3e");if(h>=0){t.shouldKeepComment&&t.comment(e.substring(4,h),l,l+h+3),x(h+3);continue}}if(Ei.test(e)){var d=e.indexOf("]>");if(d>=0){x(d+2);continue}}var v=e.match(Ri);if(v){x(v[0].length);continue}var m=e.match(Ti);if(m){var b=l;x(m[0].length),M(m[1],b,l);continue}var g=k();if(g){A(g),Hi(g.tagName,e)&&x(1);continue}}var y=void 0,w=void 0,S=void 0;if(p>=0){for(w=e.slice(p);!(Ti.test(w)||Ai.test(w)||Bi.test(w)||Ei.test(w)||(S=w.indexOf("<",1))<0);)p+=S,w=e.slice(p);y=e.substring(0,p)}p<0&&(y=e),y&&x(y.length),t.chars&&y&&t.chars(y,l-y.length,l)}if(e===n){t.chars&&t.chars(e);break}}function x(t){l+=t,e=e.substring(t)}function k(){var t=e.match(Ai);if(t){var n,r,a={tagName:t[1],attrs:[],start:l};for(x(t[0].length);!(n=e.match(Mi))&&(r=e.match(Si)||e.match(wi));)r.start=l,x(r[0].length),r.end=l,a.attrs.push(r);if(n)return a.unarySlash=n[1],x(n[0].length),a.end=l,a}}function A(e){var n=e.tagName,l=e.unarySlash;i&&("p"===r&&yi(n)&&M(r),o(n)&&r===n&&M(n));for(var c=s(n)||!!l,f=e.attrs.length,u=new Array(f),_=0;_=0&&a[s].lowerCasedTag!==o;s--);else s=0;if(s>=0){for(var c=a.length-1;c>=s;c--)t.end&&t.end(a[c].tag,n,i);a.length=s,r=s&&a[s-1].tag}else"br"===o?t.start&&t.start(e,[],!0,n,i):"p"===o&&(t.start&&t.start(e,[],!1,n,i),t.end&&t.end(e,n,i))}M()}(e,{warn:Di,expectHTML:t.expectHTML,isUnaryTag:t.isUnaryTag,canBeLeftOpenTag:t.canBeLeftOpenTag,shouldDecodeNewlines:t.shouldDecodeNewlines,shouldDecodeNewlinesForHref:t.shouldDecodeNewlinesForHref,shouldKeepComment:t.comments,outputSourceRange:t.outputSourceRange,start:function(e,n,s,o,u){var _=a&&a.ns||zi(e);W&&"svg"===_&&(n=function(e){for(var t=[],n=0;nl&&(o.push(i=e.slice(l,a)),s.push(JSON.stringify(i)));var c=Br(r[1].trim());s.push("_s("+c+")"),o.push({"@binding":c}),l=a+r[0].length}return l-1"+("true"===i?":("+t+")":":_q("+t+","+i+")")),$r(e,"change","var $$a="+t+",$$el=$event.target,$$c=$$el.checked?("+i+"):("+s+");if(Array.isArray($$a)){var $$v="+(r?"_n("+a+")":a)+",$$i=_i($$a,$$v);if($$el.checked){$$i<0&&("+Yr(t,"$$a.concat([$$v])")+")}else{$$i>-1&&("+Yr(t,"$$a.slice(0,$$i).concat($$a.slice($$i+1))")+")}}else{"+Yr(t,"$$c")+"}",null,!0)}(e,r,a);else if("input"===i&&"radio"===s)!function(e,t,n){var r=n&&n.number,a=Dr(e,"value")||"null";Pr(e,"checked","_q("+t+","+(a=r?"_n("+a+")":a)+")"),$r(e,"change",Yr(t,a),null,!0)}(e,r,a);else if("input"===i||"textarea"===i)!function(e,t,n){var r=e.attrsMap.type;0;var a=n||{},i=a.lazy,s=a.number,o=a.trim,l=!i&&"range"!==r,c=i?"change":"range"===r?"__r":"input",f="$event.target.value";o&&(f="$event.target.value.trim()");s&&(f="_n("+f+")");var u=Yr(t,f);l&&(u="if($event.target.composing)return;"+u);Pr(e,"value","("+t+")"),$r(e,c,u,null,!0),(o||s)&&$r(e,"blur","$forceUpdate()")}(e,r,a);else{if(!V.isReservedTag(i))return qr(e,r,a),!1}return!0},text:function(e,t){t.value&&Pr(e,"textContent","_s("+t.value+")",t)},html:function(e,t){t.value&&Pr(e,"innerHTML","_s("+t.value+")",t)}},isPreTag:function(e){return"pre"===e},isUnaryTag:bi,mustUseProp:Nn,canBeLeftOpenTag:gi,isReservedTag:Qn,getTagNamespace:Wn,staticKeys:function(e){return e.reduce((function(e,t){return e.concat(t.staticKeys||[])}),[]).join(",")}(ms)},ws=x((function(e){return m("type,tag,attrsList,attrsMap,plain,parent,children,attrs,start,end,rawAttrsMap"+(e?","+e:""))}));function Ss(e,t){e&&(bs=ws(t.staticKeys||""),gs=t.isReservedTag||I,function e(t){if(t.static=function(e){if(2===e.type)return!1;if(3===e.type)return!0;return!(!e.pre&&(e.hasBindings||e.if||e.for||b(e.tag)||!gs(e.tag)||function(e){for(;e.parent;){if("template"!==(e=e.parent).tag)return!1;if(e.for)return!0}return!1}(e)||!Object.keys(e).every(bs)))}(t),1===t.type){if(!gs(t.tag)&&"slot"!==t.tag&&null==t.attrsMap["inline-template"])return;for(var n=0,r=t.children.length;n|^function\s*(?:[\w$]+)?\s*\(/,ks=/\([^)]*?\);*$/,As=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?']|\["[^"]*?"]|\[\d+]|\[[A-Za-z_$][\w$]*])*$/,Ms={esc:27,tab:9,enter:13,space:32,up:38,left:37,right:39,down:40,delete:[8,46]},Ts={esc:["Esc","Escape"],tab:"Tab",enter:"Enter",space:[" ","Spacebar"],up:["Up","ArrowUp"],left:["Left","ArrowLeft"],right:["Right","ArrowRight"],down:["Down","ArrowDown"],delete:["Backspace","Delete","Del"]},Rs=function(e){return"if("+e+")return null;"},Bs={stop:"$event.stopPropagation();",prevent:"$event.preventDefault();",self:Rs("$event.target !== $event.currentTarget"),ctrl:Rs("!$event.ctrlKey"),shift:Rs("!$event.shiftKey"),alt:Rs("!$event.altKey"),meta:Rs("!$event.metaKey"),left:Rs("'button' in $event && $event.button !== 0"),middle:Rs("'button' in $event && $event.button !== 1"),right:Rs("'button' in $event && $event.button !== 2")};function Es(e,t){var n=t?"nativeOn:":"on:",r="",a="";for(var i in e){var s=Cs(e[i]);e[i]&&e[i].dynamic?a+=i+","+s+",":r+='"'+i+'":'+s+","}return r="{"+r.slice(0,-1)+"}",a?n+"_d("+r+",["+a.slice(0,-1)+"])":n+r}function Cs(e){if(!e)return"function(){}";if(Array.isArray(e))return"["+e.map((function(e){return Cs(e)})).join(",")+"]";var t=As.test(e.value),n=xs.test(e.value),r=As.test(e.value.replace(ks,""));if(e.modifiers){var a="",i="",s=[];for(var o in e.modifiers)if(Bs[o])i+=Bs[o],Ms[o]&&s.push(o);else if("exact"===o){var l=e.modifiers;i+=Rs(["ctrl","shift","alt","meta"].filter((function(e){return!l[e]})).map((function(e){return"$event."+e+"Key"})).join("||"))}else s.push(o);return s.length&&(a+=function(e){return"if(!$event.type.indexOf('key')&&"+e.map(Os).join("&&")+")return null;"}(s)),i&&(a+=i),"function($event){"+a+(t?"return "+e.value+"($event)":n?"return ("+e.value+")($event)":r?"return "+e.value:e.value)+"}"}return t||n?e.value:"function($event){"+(r?"return "+e.value:e.value)+"}"}function Os(e){var t=parseInt(e,10);if(t)return"$event.keyCode!=="+t;var n=Ms[e],r=Ts[e];return"_k($event.keyCode,"+JSON.stringify(e)+","+JSON.stringify(n)+",$event.key,"+JSON.stringify(r)+")"}var Ps={on:function(e,t){e.wrapListeners=function(e){return"_g("+e+","+t.value+")"}},bind:function(e,t){e.wrapData=function(n){return"_b("+n+",'"+e.tag+"',"+t.value+","+(t.modifiers&&t.modifiers.prop?"true":"false")+(t.modifiers&&t.modifiers.sync?",true":"")+")"}},cloak:P},Is=function(e){this.options=e,this.warn=e.warn||Cr,this.transforms=Or(e.modules,"transformCode"),this.dataGenFns=Or(e.modules,"genData"),this.directives=C(C({},Ps),e.directives);var t=e.isReservedTag||I;this.maybeComponent=function(e){return!!e.component||!t(e.tag)},this.onceId=0,this.staticRenderFns=[],this.pre=!1};function Ls(e,t){var n=new Is(t);return{render:"with(this){return "+(e?Ns(e,n):'_c("div")')+"}",staticRenderFns:n.staticRenderFns}}function Ns(e,t){if(e.parent&&(e.pre=e.pre||e.parent.pre),e.staticRoot&&!e.staticProcessed)return Hs(e,t);if(e.once&&!e.onceProcessed)return $s(e,t);if(e.for&&!e.forProcessed)return js(e,t);if(e.if&&!e.ifProcessed)return Ds(e,t);if("template"!==e.tag||e.slotTarget||t.pre){if("slot"===e.tag)return function(e,t){var n=e.slotName||'"default"',r=Ys(e,t),a="_t("+n+(r?","+r:""),i=e.attrs||e.dynamicAttrs?Us((e.attrs||[]).concat(e.dynamicAttrs||[]).map((function(e){return{name:A(e.name),value:e.value,dynamic:e.dynamic}}))):null,s=e.attrsMap["v-bind"];!i&&!s||r||(a+=",null");i&&(a+=","+i);s&&(a+=(i?"":",null")+","+s);return a+")"}(e,t);var n;if(e.component)n=function(e,t,n){var r=t.inlineTemplate?null:Ys(t,n,!0);return"_c("+e+","+Vs(t,n)+(r?","+r:"")+")"}(e.component,e,t);else{var r;(!e.plain||e.pre&&t.maybeComponent(e))&&(r=Vs(e,t));var a=e.inlineTemplate?null:Ys(e,t,!0);n="_c('"+e.tag+"'"+(r?","+r:"")+(a?","+a:"")+")"}for(var i=0;i>>0}(s):"")+")"}(e,e.scopedSlots,t)+","),e.model&&(n+="model:{value:"+e.model.value+",callback:"+e.model.callback+",expression:"+e.model.expression+"},"),e.inlineTemplate){var i=function(e,t){var n=e.children[0];0;if(n&&1===n.type){var r=Ls(n,t.options);return"inlineTemplate:{render:function(){"+r.render+"},staticRenderFns:["+r.staticRenderFns.map((function(e){return"function(){"+e+"}"})).join(",")+"]}"}}(e,t);i&&(n+=i+",")}return n=n.replace(/,$/,"")+"}",e.dynamicAttrs&&(n="_b("+n+',"'+e.tag+'",'+Us(e.dynamicAttrs)+")"),e.wrapData&&(n=e.wrapData(n)),e.wrapListeners&&(n=e.wrapListeners(n)),n}function Fs(e){return 1===e.type&&("slot"===e.tag||e.children.some(Fs))}function qs(e,t){var n=e.attrsMap["slot-scope"];if(e.if&&!e.ifProcessed&&!n)return Ds(e,t,qs,"null");if(e.for&&!e.forProcessed)return js(e,t,qs);var r="_empty_"===e.slotScope?"":String(e.slotScope),a="function("+r+"){return "+("template"===e.tag?e.if&&n?"("+e.if+")?"+(Ys(e,t)||"undefined")+":undefined":Ys(e,t)||"undefined":Ns(e,t))+"}",i=r?"":",proxy:true";return"{key:"+(e.slotTarget||'"default"')+",fn:"+a+i+"}"}function Ys(e,t,n,r,a){var i=e.children;if(i.length){var s=i[0];if(1===i.length&&s.for&&"template"!==s.tag&&"slot"!==s.tag){var o=n?t.maybeComponent(s)?",1":",0":"";return""+(r||Ns)(s,t)+o}var l=n?function(e,t){for(var n=0,r=0;r':'
',Ws.innerHTML.indexOf(" ")>0}var no=!!K&&to(!1),ro=!!K&&to(!0),ao=x((function(e){var t=tr(e);return t&&t.innerHTML})),io=Mn.prototype.$mount;Mn.prototype.$mount=function(e,t){if((e=e&&tr(e))===document.body||e===document.documentElement)return this;var n=this.$options;if(!n.render){var r=n.template;if(r)if("string"==typeof r)"#"===r.charAt(0)&&(r=ao(r));else{if(!r.nodeType)return this;r=r.innerHTML}else e&&(r=function(e){if(e.outerHTML)return e.outerHTML;var t=document.createElement("div");return t.appendChild(e.cloneNode(!0)),t.innerHTML}(e));if(r){0;var a=eo(r,{outputSourceRange:!1,shouldDecodeNewlines:no,shouldDecodeNewlinesForHref:ro,delimiters:n.delimiters,comments:n.comments},this),i=a.render,s=a.staticRenderFns;n.render=i,n.staticRenderFns=s}}return io.call(this,e,t)},Mn.compile=eo,t.default=Mn}).call(this,n(3),n(13).setImmediate)},function(e,t,n){"use strict";(function(e){var r=void 0!==e&&e||"undefined"!=typeof self&&self||window,a=Function.prototype.apply;function i(e,t){this._id=e,this._clearFn=t}t.setTimeout=function(){return new i(a.call(setTimeout,r,arguments),clearTimeout)},t.setInterval=function(){return new i(a.call(setInterval,r,arguments),clearInterval)},t.clearTimeout=t.clearInterval=function(e){e&&e.close()},i.prototype.unref=i.prototype.ref=function(){},i.prototype.close=function(){this._clearFn.call(r,this._id)},t.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},t.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},t._unrefActive=t.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},n(14),t.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==e&&e.setImmediate||void 0,t.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==e&&e.clearImmediate||void 0}).call(this,n(3))},function(e,t,n){"use strict";(function(e,t){!function(e,n){if(!e.setImmediate){var r,a,i,s,o,l=1,c={},f=!1,u=e.document,_=Object.getPrototypeOf&&Object.getPrototypeOf(e);_=_&&_.setTimeout?_:e,"[object process]"==={}.toString.call(e.process)?r=function(e){t.nextTick((function(){h(e)}))}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){h(e.data)},r=function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(a=u.documentElement,r=function(e){var t=u.createElement("script");t.onreadystatechange=function(){h(e),t.onreadystatechange=null,a.removeChild(t),t=null},a.appendChild(t)}):r=function(e){setTimeout(h,0,e)}:(s="setImmediate$"+Math.random()+"$",o=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(s)&&h(+t.data.slice(s.length))},e.addEventListener?e.addEventListener("message",o,!1):e.attachEvent("onmessage",o),r=function(t){e.postMessage(s+t,"*")}),_.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),n=0;n1)for(var n=1;n=c.byteLength?(_-=c.byteLength,l.push(c),e.splice(f,1),f--):(e[f]=c.slice(_),o=c,_=0)}if(!this.rm(e,t)){o&&(e[0]=o);for(f=0;f "+s.duration+"ms",2>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function R(e,t,a,s,n,r){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var _,o,l,f,c,h,u,b;_=a[s++]*t,o=a[s++]*t,c=0|_,l=a[s++]*t,h=0|o,f=a[s++]*t,u=0|l,_+=M.adj43[c],b=0|f,o+=M.adj43[h],n[r++]=0|_,l+=M.adj43[u],n[r++]=0|o,f+=M.adj43[b],n[r++]=0|l,n[r++]=0|f}0!=i&&(c=0|(_=a[s++]*t),h=0|(o=a[s++]*t),_+=M.adj43[c],o+=M.adj43[h],n[r++]=0|_,n[r++]=0|o)}var _=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function d(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s>=16)&&(_=r,s++),n.bits+=_,s}(e,t,a,_[n-1],s);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,a,s,n){var r=0,i=0,_=0,o=C.ht[s].xlen,l=C.ht[s].hlen,f=C.ht[s+1].hlen,c=C.ht[s+2].hlen;do{var h=e[t+0]*o+e[t+1];t+=2,r+=l[h],i+=f[h],_+=c[h]}while(t=n);r++);for(i=r-8;i<24&&!(C.ht[i].linmax>=n);i++);return function(e,t,a,s,n,r){var i,_=65536*C.ht[s].xlen+C.ht[n].xlen,o=0;do{var l=e[t++],f=e[t++];0!=l&&(14>=16)&&(o=i,s=n),r.bits+=o,s}(e,t,a,i,r,s)}}function u(e,t,a,s,n,r,i,_){for(var o=t.big_values,l=2;l>1<<1);for(null!=a&&(a.sfb_count1=0);1t.big_values&&(r=t.big_values),i=t.big_values;else if(t.block_type==Pe.NORM_TYPE){if(r=t.region0_count=e.bv_scf[n-2],i=t.region1_count=e.bv_scf[n-1],i=e.scalefac_band.l[r+i+2],r=e.scalefac_band.l[r+1],ir)return y.LARGE_BITS;if(function(e,t,a,s,n){var r,i,_,o=0,l=0,f=0,c=0,h=t,u=0,b=h,m=0,p=e,v=0;for(_=null!=n&&s.global_gain==n.global_gain,i=s.block_type==Pe.SHORT_TYPE?38:21,r=0;r<=i;r++){var d=-1;if((_||s.block_type==Pe.NORM_TYPE)&&(d=s.global_gain-(s.scalefac[r]+(0!=s.preflag?M.pretab[r]:0)<s.max_nonzero_coeff&&(g=s.max_nonzero_coeff-o+1,Te.fill(t,s.max_nonzero_coeff,576,0),(S=g)<0&&(S=0),r=i+1),0==l&&0==f&&(b=h,m=u,p=e,v=c),null!=n&&0=n.sfb_count1&&0=n.step[r]?(0!=l&&(R(l,a,p,v,b,m),l=0,b=h,m=u,p=e,v=c),f+=S):(0!=f&&(w(f,a,p,v,b,m),f=0,b=h,m=u,p=e,v=c),l+=S),S<=0){0!=f&&(w(f,a,p,v,b,m),f=0),0!=l&&(R(l,a,p,v,b,m),l=0);break}}r<=i&&(u+=s.width[r],c+=s.width[r],o+=s.width[r])}0!=l&&(R(l,a,p,v,b,m),l=0),0!=f&&(w(f,a,p,v,b,m),f=0)}(t,n,M.IPOW20(a.global_gain),a,s),0!=(2&e.substep_shaping))for(var i=0,_=a.global_gain+a.scalefac_scale,o=.634521682242439/M.IPOW20(_),l=0;l=o?n[f]:0}return this.noquant_count_bits(e,a,s)},this.best_huffman_divide=function(e,t){var a=new x,s=t.l3_enc,n=Be(23),r=Be(23),i=Be(23),_=Be(23);if(t.block_type!=Pe.SHORT_TYPE||1!=e.mode_gr){a.assign(t),t.block_type==Pe.NORM_TYPE&&(!function(e,t,a,s,n,r,i){for(var _=t.big_values,o=0;o<=22;o++)s[o]=y.LARGE_BITS;for(o=0;o<16;o++){var l=e.scalefac_band.l[o+1];if(_<=l)break;var f=0,c=new v(f),h=d(a,0,l,c);f=c.bits;for(var u=0;u<8;u++){var b=e.scalefac_band.l[o+u+2];if(_<=b)break;var m=f,p=d(a,l,b,c=new v(m));m=c.bits,s[o+u]>m&&(s[o+u]=m,r[(n[o+u]=o)+u]=h,i[o+u]=p)}}}(e,t,s,n,r,i,_),u(e,a,t,s,n,r,i,_));var o=a.big_values;if(!(0==o||1<(s[o-2]|s[o-1])||576<(o=t.count1+2))){a.assign(t),a.count1=o;for(var l=0,f=0;o>a.big_values;o-=4){var c=2*(2*(2*s[o-4]+s[o-3])+s[o-2])+s[o-1];l+=C.t32l[c],f+=C.t33l[c]}if(a.big_values=o,a.count1table_select=0,fa.part2_3_length&&t.assign(a)}}}};var h=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],b=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],m=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],p=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];k.slen1_tab=m,k.slen2_tab=p,this.best_scalefac_store=function(e,t,a,s){var n,r,i,_,o=s.tt[t][a],l=0;for(n=i=0;n>=1);o.scalefac_scale=l=1}}if(0==o.preflag&&o.block_type!=Pe.SHORT_TYPE&&2==e.mode_gr){for(n=11;nf&&(s.part2_length=f,s.scalefac_compress=r)}}(a,s),l=0),n=0;ns[t]&&(e.part2_length=s[t],e.scalefac_compress=t);return e.part2_length==y.LARGE_BITS};var g=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,t){var a,s,n,r,i,_,o,l,f=Be(4),c=t.scalefac;for(a=0!=t.preflag?2:0,o=0;o<4;o++)f[o]=0;if(t.block_type==Pe.SHORT_TYPE){s=1;var h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n]/3,o=0;of[n]&&(f[n]=c[3*l+i])}else{s=0;h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n],o=0;of[n]&&(f[n]=c[l])}for(_=!1,n=0;n<4;n++)f[n]>g[a][n]&&(_=!0);if(!_){var u,b,m,p;for(t.sfb_partition_table=M.nr_of_sfb_block[a][s],n=0;n<4;n++)t.slen[n]=S[f[n]];switch(u=t.slen[0],b=t.slen[1],m=t.slen[2],p=t.slen[3],a){case 0:t.scalefac_compress=(5*u+b<<4)+(m<<2)+p;break;case 1:t.scalefac_compress=400+(5*u+b<<2)+m;break;case 2:t.scalefac_compress=500+3*u+b;break;default:$.err.printf("intensity stereo not implemented yet\n")}}if(!_)for(n=t.part2_length=0;n<4;n++)t.part2_length+=t.slen[n]*t.sfb_partition_table[n];return _};var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var a,s=0;e.scalefac_band.l[++s]t;)a--;for(a<0&&(a=n[s][0]),e.bv_scf[t-2]=a,a=n[s][1];e.scalefac_band.l[a+e.bv_scf[t-2]+2]>t;)a--;a<0&&(a=n[s][1]),e.bv_scf[t-1]=a}}}function q(){}function M(){this.setModules=function(e,t,a){e,t,a};var _=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.updateMusicCRC=function(e,t,a,s){for(var n=0;n>8^_[255&(i^r)]);var r,i}}function j(){var o=this,s=32773,c=null,h=null,r=null,u=null;this.setModules=function(e,t,a,s){c=e,h=t,r=a,u=s};var b=null,l=0,m=0,p=0;function v(e,t,a){for(;0>a<>a<>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function n(e,t){e<<=8;for(var a=0;a<8;a++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=s);return t}function d(e,t){var a,s=C.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;0t.big_values&&(a=t.big_values);var s=g(e,t.table_select[0],0,a,t);return s+=g(e,t.table_select[1],a,t.big_values,t)}function M(e,t){var a,s,n,r;a=t.big_values;var i=t.region0_count+1;return n=e.scalefac_band.l[i],i+=t.region1_count+1,a>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,n=s.h_ptr-1;if(-1==n&&(n=Z.MAX_HEADER_BUF-1),t=s.l3_side,!((a=R(e,new w))<0)){if(_(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var r=c.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*r+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*A(s.PeakSample/32767)*10),0 ResvSize"),8*t.main_data_begin!=a.ResvSize&&($.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,a.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*a.sideinfo_len,n-t.resvDrain_post-8*a.sideinfo_len,n,n%8,s),$.err.println("This is a fatal error. It has several possible causes:"),$.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),$.err.println(" 9%% Your system is overclocked"),$.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),1e9e.PeakSample?e.PeakSample=o[0][_]:-o[0][_]>e.PeakSample&&(e.PeakSample=-o[0][_]);if(1e.PeakSample?e.PeakSample=o[1][_]:-o[1][_]>e.PeakSample&&(e.PeakSample=-o[1][_])}if(e.findReplayGain&&c.AnalyzeSamples(e.rgdata,o[0],0,o[1],0,f,e.channels_out)==q.GAIN_ANALYSIS_ERROR)return-6}}return r},this.init_bit_stream_w=function(e){b=B(Q.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,m=-1,l=p=0}}function e(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}Ee.STEREO=new Ee(0),Ee.JOINT_STEREO=new Ee(1),Ee.DUAL_CHANNEL=new Ee(2),Ee.MONO=new Ee(3),Ee.NOT_SET=new Ee(4),q.STEPS_per_dB=100,q.MAX_dB=120,q.GAIN_NOT_ENOUGH_SAMPLES=-24601,q.GAIN_ANALYSIS_ERROR=0,q.GAIN_ANALYSIS_OK=1,q.INIT_GAIN_ANALYSIS_ERROR=0,q.INIT_GAIN_ANALYSIS_OK=1,q.MAX_ORDER=q.YULE_ORDER=10,q.MAX_SAMPLES_PER_WINDOW=(q.MAX_SAMP_FREQ=48e3)*(q.RMS_WINDOW_TIME_NUMERATOR=1)/(q.RMS_WINDOW_TIME_DENOMINATOR=20)+1,M.NUMTOCENTRIES=100,M.MAXFRAMESIZE=2880,j.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},j.NEQ=function(e,t){return!j.EQ(e,t)};var C={};function F(e){this.bits=e}function T(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function r(e,t,a,s){this.l=Be(1+Pe.SBMAX_l),this.s=Be(1+Pe.SBMAX_s),this.psfb21=Be(1+Pe.PSFB21),this.psfb12=Be(1+Pe.PSFB12);var n=this.l,r=this.s;4==arguments.length&&(this.arrL=e,this.arrS=t,this.arr21=a,this.arr12=s,$.arraycopy(this.arrL,0,n,0,Math.min(this.arrL.length,this.l.length)),$.arraycopy(this.arrS,0,r,0,Math.min(this.arrS.length,this.s.length)),$.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),$.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function y(){var l=null,b=null,s=null;this.setModules=function(e,t,a){l=e,b=t,s=a},this.IPOW20=function(e){return u[e]};var x=2.220446049250313e-16,f=y.IXMAX_VAL+2,c=y.Q_MAX,h=y.Q_MAX2,n=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var w=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=w,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var R=Ae(c+h+1),u=Ae(c),m=Ae(f),p=Ae(f);function v(e,t){var a=s.ATHformula(t,e);return a-=n,a=Math.pow(10,a/10+e.ATHlower)}function B(e){this.s=e}this.adj43=p,this.iteration_init=function(e){var t,a=e.internal_flags,s=a.l3_side;if(0==a.iteration_init_init){for(a.iteration_init_init=1,s.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,a=e.internal_flags.ATH.psfb21,s=e.internal_flags.ATH.s,n=e.internal_flags.ATH.psfb12,r=e.internal_flags,i=e.out_samplerate,_=0;_>2&63)&&(t-=64),n=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>8&63)&&(t-=64),r=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>14&63)&&(t-=64),i=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>20&63)&&(t-=64),_=i*Math.pow(10,t/4/10),t=0;t3*s/4&&(f[_]=3*s/4),f[_]<0&&(f[_]=0),f[_]+a[_]>Z.MAX_BITS_PER_CHANNEL&&(f[_]=Math.max(0,Z.MAX_BITS_PER_CHANNEL-a[_])),i+=f[_];if(hZ.MAX_BITS_PER_CHANNEL-e[0]&&(r=Z.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),125<=e[1]&&(125>1,B=0;do{B+=k=f[_]*f[_],M+=k>1;S=d/p,M=x;do{var k,T;B+=k=f[_]*f[_],M+=ks[r-3+1]&&(s[r-3+1]+=(s[r-3]-s[r-3+1])*i.decay),s[r-3+1]>s[r-3+2]&&(s[r-3+2]+=(s[r-3+1]-s[r-3+2])*i.decay))}return o},this.calc_noise_core=function(e,t,a,s){var n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){o=e.xr[r],r++,n+=o*o,o=e.xr[r],r++,n+=o*o}else if(r>e.big_values){var _=Ae(2);for(_[0]=0,_[1]=s;0!=a--;){o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o,o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o}}else for(;0!=a--;){var o;o=Math.abs(e.xr[r])-m[i[r]]*s,r++,n+=o*o,o=Math.abs(e.xr[r])-m[i[r]]*s,r++,n+=o*o}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,l=0,f=0,c=0,h=-20,u=0,b=e.scalefac,m=0;for(r=s.over_SSD=0;r>1,u+e.width[r]>e.max_nonzero_coeff)i=0<(g=e.max_nonzero_coeff-u+1)?g>>1:0;var M=new B(u);d=this.calc_noise_core(e,M,i,S),u=M.s,null!=n&&(n.step[r]=v,n.noise[r]=d),d=a[_++]=d/t[o++],d=ee.FAST_LOG10(Math.max(d,1e-20)),null!=n&&(n.noise_log[r]=d)}if(null!=n&&(n.global_gain=e.global_gain),c+=d,0a.max_noise-.2&&a.tot_noisea.max_noise-.2&&a.tot_noisea.max_noise-.1&&a.tot_noise+a.over_noisea.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noiset.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,a,s,n);var i=_(t);return!i&&(!(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t))||(1e.xrpow_max&&(e.xrpow_max=t[a+i])}e.scalefac[s]=r>>1}e.preflag=0,e.scalefac_scale=1}(t,s),i=!1):t.block_type==Pe.SHORT_TYPE&&0>t.scalefac_scale))n[s]=f,o+=3*l;else{n[s]=0;var c=210+(f<t.xrpow_max&&(t.xrpow_max=a[o+h]);o+=l*(3-r-1)}}var u=M.IPOW20(202);for(o+=t.width[s]*(r+1),h=-t.width[s];h<0;h++)a[o+h]*=u,a[o+h]>t.xrpow_max&&(t.xrpow_max=a[o+h])}}return!1}(r,t,s)||_(t))),i||(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t)),!i))}this.setModules=function(e,t,a,s){v=e,g=t,this.rv=t,M=a,this.qupvt=a,w=s,n.setModules(M,w)},this.ms_convert=function(e,t){for(var a=0;a<576;++a){var s=e.tt[t][0].xr[a],n=e.tt[t][1].xr[a];e.tt[t][0].xr[a]=(s+n)*(.5*ee.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*ee.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,Te.fill(a,n,576,0),1e-20<(s=function(e,t,a,s){for(var n=s=0;n<=a;++n){var r=Math.abs(e.xr[n]);s+=r,t[n]=Math.sqrt(r*Math.sqrt(r)),t[n]>e.xrpow_max&&(e.xrpow_max=t[n])}return s}(t,a,n,s))){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;iS&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break;if(0==f.over_count){for(;(_.part2_3_length=w.count_bits(i,s,_,c))>h&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break}if(M.calc_noise(_,a,l,d,c),d.bits=_.part2_3_length,0!=(B(t.block_type!=Pe.SHORT_TYPE?e.quant_comp:e.quant_comp_short,f,d,_,l)?1:0))h=t.part2_3_length,f=d,t.assign(_),p=0,$.arraycopy(s,0,o,0,576);else if(0==i.full_outer_loop){if(++p>v&&0==f.over_count)break;if(3==i.noise_shaping_amp&&b&&30r[f.VBR_max_bitrate]&&(_[m][v]*=r[f.VBR_max_bitrate],_[m][v]/=u),i[m][v]>_[m][v]&&(i[m][v]=_[m][v]);return h},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;nZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),b+=s[_][o]}if(Z.MAX_BITS_PER_GRANULEZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),l+=s[_][o];if(l>r[0])for(_=0;_=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust=s?e.ATH.adjust=s:e.ATH.adjust>1,u=(h=(c=s)<<1)+c,s=h<<1,r=(n=t)+b;M=e[n+0]-e[n+c],S=e[n+0]+e[n+c],A=e[n+h]-e[n+u],R=e[n+h]+e[n+u],e[n+h]=S-R,e[n+0]=S+R,e[n+u]=M-A,e[n+c]=M+A,M=e[r+0]-e[r+c],S=e[r+0]+e[r+c],A=ee.SQRT2*e[r+u],R=ee.SQRT2*e[r+h],e[r+h]=S-R,e[r+0]=S+R,e[r+u]=M-A,e[r+c]=M+A,r+=s,(n+=s)<_;);for(l=T[i+0],o=T[i+1],f=1;fN[u+3-2]?U/=N[u+3-2]:U=N[u+3-2]>10*U?N[u+3-2]/(10*U):0,Y[u+3]=U}if(e.analysis){var W=Y[0];for(u=1;u<12;u++)WV&&(j[u/3]=u%3+1);for(u=1;u<4;u++){(O[u-1]>O[u]?O[u-1]/O[u]:O[u]/O[u-1])<1.7&&(j[u]=0,1==u&&(j[0]=0))}for(0!=j[0]&&0!=S.nsPsy.lastAttacks[c]&&(j[0]=0),3!=S.nsPsy.lastAttacks[c]&&j[0]+j[1]+j[2]+j[3]==0||((D=0)!=j[1]&&0!=j[0]&&(j[1]=0),0!=j[2]&&0!=j[1]&&(j[2]=0),0!=j[3]&&0!=j[2]&&(j[3]=0)),c<2?T[c]=D:0==D&&(T[0]=T[1]=0),o[c]=S.tot_ener[c],he(e,C,F,M,1&c,w,1&c,s,c,t,a),Me(S,C,R,X,q),we(S,X,q,y),v=0;v<3;v++){var J,$;for(ve(e,F,B,A,c,v),me(S,B,A,c,v),p=0;p1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var a=e.mld_l[t]*e.en[3].l[t],s=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],a));a=e.mld_l[t]*e.en[2].l[t];var n=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],a));e.thm[2].l[t]=s,e.thm[3].l[t]=n}for(t=0;t1.58*e.thm[1].s[t][r]||e.thm[1].s[t][r]>1.58*e.thm[0].s[t][r]||(a=e.mld_s[t]*e.en[3].s[t][r],s=Math.max(e.thm[2].s[t][r],Math.min(e.thm[3].s[t][r],a)),a=e.mld_s[t]*e.en[2].s[t][r],n=Math.max(e.thm[3].s[t][r],Math.min(e.thm[2].s[t][r],a)),e.thm[2].s[t][r]=s,e.thm[3].s[t][r]=n)}(S),g=e.msfix,0g&&(s[o]=g),1a[o]&&(s[o]=a[o]),l.masking_lower<1&&(s[o]*=l.masking_lower)}for(;of&&(s[r]=f),1a[r]&&(s[r]=a[r]),e.masking_lower<1&&(s[r]*=e.masking_lower)}for(;rM[p+3-2]?E/=M[p+3-2]:E=M[p+3-2]>10*E?M[p+3-2]/(10*E):0,S[p+3]=E}for(p=0;p<3;++p){var P=M[3*p+3]+M[3*p+4]+M[3*p+5],H=1;6*M[3*p+5]A&&(o[b][p/3]=p%3+1);for(p=1;p<4;p++){var I=w[p-1],V=w[p];Math.max(I,V)<4e4&&I<1.7*V&&V<1.7*I&&(1==p&&o[b][0]<=o[b][p]&&(o[b][0]=0),o[b][p]=0)}o[b][0]<=c.nsPsy.lastAttacks[b]&&(o[b][0]=0),3!=c.nsPsy.lastAttacks[b]&&o[b][0]+o[b][1]+o[b][2]+o[b][3]==0||((k=0)!=o[b][1]&&0!=o[b][0]&&(o[b][1]=0),0!=o[b][2]&&0!=o[b][1]&&(o[b][2]=0),0!=o[b][3]&&0!=o[b][2]&&(o[b][3]=0)),b<2?l[b]=k:0==k&&(l[0]=l[1]=0),i[b]=c.tot_ener[b]}}(e,t,a,s,n,r,o,w,R,B),function(e,t){var a=e.internal_flags;e.short_blocks!=xe.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=n&&(m=i*(l[t]-n)/(24-n)+r*(24-l[t])/(24-n)),c[t]=Math.pow(10,m/10),0=n&&(m=o*(l[t]-n)/(24-n)+_*(24-l[t])/(24-n)),c[t]=Math.pow(10,m/10),g=K.MAX_VALUE;for(v=0;va.npart_l-1&&(a.s3ind[M][1]=a.npart_l-1);var w=576*a.mode_gr/h;if(a.ATH.decay=Math.pow(10,-1.2*w),a.ATH.adjust=.01,-(a.ATH.adjustLimit=1)!=e.ATHtype){var R=e.out_samplerate/Pe.BLKSIZE,B=0;for(t=d=0;t=v)for(l=0;le.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(t=0|e.lowpassfreq,a=e.in_samplerate,s=44100,48e3<=a?s=48e3:44100<=a?s=44100:32e3<=a?s=32e3:24e3<=a?s=24e3:22050<=a?s=22050:16e3<=a?s=16e3:12e3<=a?s=12e3:11025<=a?s=11025:8e3<=a&&(s=8e3),-1==t?s:(t<=15960&&(s=44100),t<=15250&&(s=32e3),t<=11220&&(s=24e3),t<=9970&&(s=22050),t<=7230&&(s=16e3),t<=5420&&(s=12e3),t<=4510&&(s=11025),t<=3970&&(s=8e3),a=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1t.highpass1?E((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,o=t.lowpass2>t.lowpass1?E((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=_*o}}(e),n.samplerate_index=P(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==ye.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=H(e.brate,e.version,e.out_samplerate),n.bitrate_index=L(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),R.init_bit_stream_w(n);for(var c,h,u,b=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),m=0;m=f){var M=i-u;if(0==i&&(M=0),(_=N(e,b[0],b[1],n,r,M))<0)return _;for(r+=_,u+=_,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;li&&(s.ResvMax=i),(s.ResvMax<0||e.disable_reservoir)&&(s.ResvMax=0);var _=t.bits*s.mode_gr+Math.min(s.ResvSize,s.ResvMax);return a<_&&(_=a),n.resvDrain_pre=0,null!=s.pinfo&&(s.pinfo.mean_bits=t.bits/2,s.pinfo.resvsize=s.ResvSize),_},this.ResvMaxBits=function(e,t,a,s){var n,r=e.internal_flags,i=r.ResvSize,_=r.ResvMax;0!=s&&(i+=t),0!=(1&r.substep_shaping)&&(_*=.9),a.bits=t,9*_<10*i?(n=i-9*_/10,a.bits+=n,r.substep_shaping|=128):(n=0,r.substep_shaping&=127,e.disable_reservoir||0!=(1&r.substep_shaping)||(a.bits-=.1*t));var o=i<6*r.ResvMax/10?i:6*r.ResvMax/10;return(o-=n)<0&&(o=0),o},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var a,s=e.l3_side;e.ResvSize+=t*e.mode_gr;var n=0;s.resvDrain_post=0,(s.resvDrain_pre=0)!=(a=e.ResvSize%8)&&(n+=a),0<(a=e.ResvSize-n-e.ResvMax)&&(n+=a);var r=Math.min(8*s.main_data_begin,n)/8;s.resvDrain_pre+=8*r,n-=8*r,e.ResvSize-=8*r,s.main_data_begin-=r,s.resvDrain_post+=n,e.ResvSize-=n}},b=new k,m=new function(){this.setModules=function(e,t,a){}},p=new function(){};n.setModules(r,i,_,o,l,f,c,h,p),i.setModules(r,p,c,f),h.setModules(i,c),_.setModules(n),l.setModules(i,u,o,b),o.setModules(b,u,n.enc.psy),u.setModules(i),b.setModules(o),f.setModules(n,i,c),a.setModules(m,p),m.setModules(c,h,_);var v=n.lame_init();v.num_channels=s,v.in_samplerate=e,v.out_samplerate=e,v.brate=t,v.mode=Ee.STEREO,v.quality=3,v.bWriteVbrTag=!1,v.disable_reservoir=!0,v.write_id3tag_automatic=!1,n.lame_init_params(v);var d=1152,g=0|1.25*d+7200,S=B(g);this.encodeBuffer=function(e,t){1==s&&(t=e),e.length>d&&(d=e.length,S=B(g=0|1.25*d+7200));var a=n.lame_encode_buffer(v,e,t,e.length,S,0,g);return new Int8Array(S.subarray(0,a))},this.flush=function(){var e=n.lame_encode_flush(v,S,0,g);return new Int8Array(S.subarray(0,e))}}}t(),Recorder.lamejs=t}(); \ No newline at end of file +!function(){"use strict";var i;Recorder.prototype.enc_mp3={stable:!0,testmsg:"采样率范围48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000"},Recorder.prototype.mp3=function(a,s,e){var t=this,n=t.set,r=a.length,i=t.mp3_start(n);if(i)return t.mp3_encode(i,a),void t.mp3_complete(i,s,e,1);var _=new Recorder.lamejs.Mp3Encoder(1,n.sampleRate,n.bitRate),o=[],l=0,f=0,c=function(){if(l=c.byteLength?(_-=c.byteLength,l.push(c),e.splice(f,1),f--):(e[f]=c.slice(_),o=c,_=0)}if(!this.rm(e,t)){o&&(e[0]=o);for(f=0;f "+s.duration+"ms",2>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function R(e,t,a,s,n,r){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var _,o,l,f,c,h,u,b;_=a[s++]*t,o=a[s++]*t,c=0|_,l=a[s++]*t,h=0|o,f=a[s++]*t,u=0|l,_+=M.adj43[c],b=0|f,o+=M.adj43[h],n[r++]=0|_,l+=M.adj43[u],n[r++]=0|o,f+=M.adj43[b],n[r++]=0|l,n[r++]=0|f}0!=i&&(c=0|(_=a[s++]*t),h=0|(o=a[s++]*t),_+=M.adj43[c],o+=M.adj43[h],n[r++]=0|_,n[r++]=0|o)}var _=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function d(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s>=16)&&(_=r,s++),n.bits+=_,s}(e,t,a,_[n-1],s);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,a,s,n){var r=0,i=0,_=0,o=C.ht[s].xlen,l=C.ht[s].hlen,f=C.ht[s+1].hlen,c=C.ht[s+2].hlen;do{var h=e[t+0]*o+e[t+1];t+=2,r+=l[h],i+=f[h],_+=c[h]}while(t=n);r++);for(i=r-8;i<24&&!(C.ht[i].linmax>=n);i++);return function(e,t,a,s,n,r){var i,_=65536*C.ht[s].xlen+C.ht[n].xlen,o=0;do{var l=e[t++],f=e[t++];0!=l&&(14>=16)&&(o=i,s=n),r.bits+=o,s}(e,t,a,i,r,s)}}function u(e,t,a,s,n,r,i,_){for(var o=t.big_values,l=2;l>1<<1);for(null!=a&&(a.sfb_count1=0);1t.big_values&&(r=t.big_values),i=t.big_values;else if(t.block_type==Pe.NORM_TYPE){if(r=t.region0_count=e.bv_scf[n-2],i=t.region1_count=e.bv_scf[n-1],i=e.scalefac_band.l[r+i+2],r=e.scalefac_band.l[r+1],ir)return y.LARGE_BITS;if(function(e,t,a,s,n){var r,i,_,o=0,l=0,f=0,c=0,h=t,u=0,b=h,m=0,p=e,v=0;for(_=null!=n&&s.global_gain==n.global_gain,i=s.block_type==Pe.SHORT_TYPE?38:21,r=0;r<=i;r++){var d=-1;if((_||s.block_type==Pe.NORM_TYPE)&&(d=s.global_gain-(s.scalefac[r]+(0!=s.preflag?M.pretab[r]:0)<s.max_nonzero_coeff&&(g=s.max_nonzero_coeff-o+1,Te.fill(t,s.max_nonzero_coeff,576,0),(S=g)<0&&(S=0),r=i+1),0==l&&0==f&&(b=h,m=u,p=e,v=c),null!=n&&0=n.sfb_count1&&0=n.step[r]?(0!=l&&(R(l,a,p,v,b,m),l=0,b=h,m=u,p=e,v=c),f+=S):(0!=f&&(w(f,a,p,v,b,m),f=0,b=h,m=u,p=e,v=c),l+=S),S<=0){0!=f&&(w(f,a,p,v,b,m),f=0),0!=l&&(R(l,a,p,v,b,m),l=0);break}}r<=i&&(u+=s.width[r],c+=s.width[r],o+=s.width[r])}0!=l&&(R(l,a,p,v,b,m),l=0),0!=f&&(w(f,a,p,v,b,m),f=0)}(t,n,M.IPOW20(a.global_gain),a,s),0!=(2&e.substep_shaping))for(var i=0,_=a.global_gain+a.scalefac_scale,o=.634521682242439/M.IPOW20(_),l=0;l=o?n[f]:0}return this.noquant_count_bits(e,a,s)},this.best_huffman_divide=function(e,t){var a=new x,s=t.l3_enc,n=Be(23),r=Be(23),i=Be(23),_=Be(23);if(t.block_type!=Pe.SHORT_TYPE||1!=e.mode_gr){a.assign(t),t.block_type==Pe.NORM_TYPE&&(!function(e,t,a,s,n,r,i){for(var _=t.big_values,o=0;o<=22;o++)s[o]=y.LARGE_BITS;for(o=0;o<16;o++){var l=e.scalefac_band.l[o+1];if(_<=l)break;var f=0,c=new v(f),h=d(a,0,l,c);f=c.bits;for(var u=0;u<8;u++){var b=e.scalefac_band.l[o+u+2];if(_<=b)break;var m=f,p=d(a,l,b,c=new v(m));m=c.bits,s[o+u]>m&&(s[o+u]=m,r[(n[o+u]=o)+u]=h,i[o+u]=p)}}}(e,t,s,n,r,i,_),u(e,a,t,s,n,r,i,_));var o=a.big_values;if(!(0==o||1<(s[o-2]|s[o-1])||576<(o=t.count1+2))){a.assign(t),a.count1=o;for(var l=0,f=0;o>a.big_values;o-=4){var c=2*(2*(2*s[o-4]+s[o-3])+s[o-2])+s[o-1];l+=C.t32l[c],f+=C.t33l[c]}if(a.big_values=o,a.count1table_select=0,fa.part2_3_length&&t.assign(a)}}}};var h=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],b=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],m=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],p=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];k.slen1_tab=m,k.slen2_tab=p,this.best_scalefac_store=function(e,t,a,s){var n,r,i,_,o=s.tt[t][a],l=0;for(n=i=0;n>=1);o.scalefac_scale=l=1}}if(0==o.preflag&&o.block_type!=Pe.SHORT_TYPE&&2==e.mode_gr){for(n=11;nf&&(s.part2_length=f,s.scalefac_compress=r)}}(a,s),l=0),n=0;ns[t]&&(e.part2_length=s[t],e.scalefac_compress=t);return e.part2_length==y.LARGE_BITS};var g=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,t){var a,s,n,r,i,_,o,l,f=Be(4),c=t.scalefac;for(a=0!=t.preflag?2:0,o=0;o<4;o++)f[o]=0;if(t.block_type==Pe.SHORT_TYPE){s=1;var h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n]/3,o=0;of[n]&&(f[n]=c[3*l+i])}else{s=0;h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n],o=0;of[n]&&(f[n]=c[l])}for(_=!1,n=0;n<4;n++)f[n]>g[a][n]&&(_=!0);if(!_){var u,b,m,p;for(t.sfb_partition_table=M.nr_of_sfb_block[a][s],n=0;n<4;n++)t.slen[n]=S[f[n]];switch(u=t.slen[0],b=t.slen[1],m=t.slen[2],p=t.slen[3],a){case 0:t.scalefac_compress=(5*u+b<<4)+(m<<2)+p;break;case 1:t.scalefac_compress=400+(5*u+b<<2)+m;break;case 2:t.scalefac_compress=500+3*u+b;break;default:$.err.printf("intensity stereo not implemented yet\n")}}if(!_)for(n=t.part2_length=0;n<4;n++)t.part2_length+=t.slen[n]*t.sfb_partition_table[n];return _};var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var a,s=0;e.scalefac_band.l[++s]t;)a--;for(a<0&&(a=n[s][0]),e.bv_scf[t-2]=a,a=n[s][1];e.scalefac_band.l[a+e.bv_scf[t-2]+2]>t;)a--;a<0&&(a=n[s][1]),e.bv_scf[t-1]=a}}}function q(){}function M(){this.setModules=function(e,t,a){e,t,a};var _=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.updateMusicCRC=function(e,t,a,s){for(var n=0;n>8^_[255&(i^r)]);var r,i}}function j(){var o=this,s=32773,c=null,h=null,r=null,u=null;this.setModules=function(e,t,a,s){c=e,h=t,r=a,u=s};var b=null,l=0,m=0,p=0;function v(e,t,a){for(;0>a<>a<>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function n(e,t){e<<=8;for(var a=0;a<8;a++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=s);return t}function d(e,t){var a,s=C.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;0t.big_values&&(a=t.big_values);var s=g(e,t.table_select[0],0,a,t);return s+=g(e,t.table_select[1],a,t.big_values,t)}function M(e,t){var a,s,n,r;a=t.big_values;var i=t.region0_count+1;return n=e.scalefac_band.l[i],i+=t.region1_count+1,a>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,n=s.h_ptr-1;if(-1==n&&(n=Z.MAX_HEADER_BUF-1),t=s.l3_side,!((a=R(e,new w))<0)){if(_(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var r=c.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*r+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*A(s.PeakSample/32767)*10),0 ResvSize"),8*t.main_data_begin!=a.ResvSize&&($.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,a.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*a.sideinfo_len,n-t.resvDrain_post-8*a.sideinfo_len,n,n%8,s),$.err.println("This is a fatal error. It has several possible causes:"),$.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),$.err.println(" 9%% Your system is overclocked"),$.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),1e9e.PeakSample?e.PeakSample=o[0][_]:-o[0][_]>e.PeakSample&&(e.PeakSample=-o[0][_]);if(1e.PeakSample?e.PeakSample=o[1][_]:-o[1][_]>e.PeakSample&&(e.PeakSample=-o[1][_])}if(e.findReplayGain&&c.AnalyzeSamples(e.rgdata,o[0],0,o[1],0,f,e.channels_out)==q.GAIN_ANALYSIS_ERROR)return-6}}return r},this.init_bit_stream_w=function(e){b=B(Q.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,m=-1,l=p=0}}function e(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}Ee.STEREO=new Ee(0),Ee.JOINT_STEREO=new Ee(1),Ee.DUAL_CHANNEL=new Ee(2),Ee.MONO=new Ee(3),Ee.NOT_SET=new Ee(4),q.STEPS_per_dB=100,q.MAX_dB=120,q.GAIN_NOT_ENOUGH_SAMPLES=-24601,q.GAIN_ANALYSIS_ERROR=0,q.GAIN_ANALYSIS_OK=1,q.INIT_GAIN_ANALYSIS_ERROR=0,q.INIT_GAIN_ANALYSIS_OK=1,q.MAX_ORDER=q.YULE_ORDER=10,q.MAX_SAMPLES_PER_WINDOW=(q.MAX_SAMP_FREQ=48e3)*(q.RMS_WINDOW_TIME_NUMERATOR=1)/(q.RMS_WINDOW_TIME_DENOMINATOR=20)+1,M.NUMTOCENTRIES=100,M.MAXFRAMESIZE=2880,j.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},j.NEQ=function(e,t){return!j.EQ(e,t)};var C={};function F(e){this.bits=e}function T(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function r(e,t,a,s){this.l=Be(1+Pe.SBMAX_l),this.s=Be(1+Pe.SBMAX_s),this.psfb21=Be(1+Pe.PSFB21),this.psfb12=Be(1+Pe.PSFB12);var n=this.l,r=this.s;4==arguments.length&&(this.arrL=e,this.arrS=t,this.arr21=a,this.arr12=s,$.arraycopy(this.arrL,0,n,0,Math.min(this.arrL.length,this.l.length)),$.arraycopy(this.arrS,0,r,0,Math.min(this.arrS.length,this.s.length)),$.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),$.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function y(){var l=null,b=null,s=null;this.setModules=function(e,t,a){l=e,b=t,s=a},this.IPOW20=function(e){return u[e]};var x=2.220446049250313e-16,f=y.IXMAX_VAL+2,c=y.Q_MAX,h=y.Q_MAX2,n=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var w=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=w,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var R=Ae(c+h+1),u=Ae(c),m=Ae(f),p=Ae(f);function v(e,t){var a=s.ATHformula(t,e);return a-=n,a=Math.pow(10,a/10+e.ATHlower)}function B(e){this.s=e}this.adj43=p,this.iteration_init=function(e){var t,a=e.internal_flags,s=a.l3_side;if(0==a.iteration_init_init){for(a.iteration_init_init=1,s.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,a=e.internal_flags.ATH.psfb21,s=e.internal_flags.ATH.s,n=e.internal_flags.ATH.psfb12,r=e.internal_flags,i=e.out_samplerate,_=0;_>2&63)&&(t-=64),n=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>8&63)&&(t-=64),r=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>14&63)&&(t-=64),i=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>20&63)&&(t-=64),_=i*Math.pow(10,t/4/10),t=0;t3*s/4&&(f[_]=3*s/4),f[_]<0&&(f[_]=0),f[_]+a[_]>Z.MAX_BITS_PER_CHANNEL&&(f[_]=Math.max(0,Z.MAX_BITS_PER_CHANNEL-a[_])),i+=f[_];if(hZ.MAX_BITS_PER_CHANNEL-e[0]&&(r=Z.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),125<=e[1]&&(125>1,B=0;do{B+=k=f[_]*f[_],M+=k>1;S=d/p,M=x;do{var k,T;B+=k=f[_]*f[_],M+=ks[r-3+1]&&(s[r-3+1]+=(s[r-3]-s[r-3+1])*i.decay),s[r-3+1]>s[r-3+2]&&(s[r-3+2]+=(s[r-3+1]-s[r-3+2])*i.decay))}return o},this.calc_noise_core=function(e,t,a,s){var n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){o=e.xr[r],r++,n+=o*o,o=e.xr[r],r++,n+=o*o}else if(r>e.big_values){var _=Ae(2);for(_[0]=0,_[1]=s;0!=a--;){o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o,o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o}}else for(;0!=a--;){var o;o=Math.abs(e.xr[r])-m[i[r]]*s,r++,n+=o*o,o=Math.abs(e.xr[r])-m[i[r]]*s,r++,n+=o*o}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,l=0,f=0,c=0,h=-20,u=0,b=e.scalefac,m=0;for(r=s.over_SSD=0;r>1,u+e.width[r]>e.max_nonzero_coeff)i=0<(g=e.max_nonzero_coeff-u+1)?g>>1:0;var M=new B(u);d=this.calc_noise_core(e,M,i,S),u=M.s,null!=n&&(n.step[r]=v,n.noise[r]=d),d=a[_++]=d/t[o++],d=ee.FAST_LOG10(Math.max(d,1e-20)),null!=n&&(n.noise_log[r]=d)}if(null!=n&&(n.global_gain=e.global_gain),c+=d,0a.max_noise-.2&&a.tot_noisea.max_noise-.2&&a.tot_noisea.max_noise-.1&&a.tot_noise+a.over_noisea.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noiset.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,a,s,n);var i=_(t);return!i&&(!(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t))||(1e.xrpow_max&&(e.xrpow_max=t[a+i])}e.scalefac[s]=r>>1}e.preflag=0,e.scalefac_scale=1}(t,s),i=!1):t.block_type==Pe.SHORT_TYPE&&0>t.scalefac_scale))n[s]=f,o+=3*l;else{n[s]=0;var c=210+(f<t.xrpow_max&&(t.xrpow_max=a[o+h]);o+=l*(3-r-1)}}var u=M.IPOW20(202);for(o+=t.width[s]*(r+1),h=-t.width[s];h<0;h++)a[o+h]*=u,a[o+h]>t.xrpow_max&&(t.xrpow_max=a[o+h])}}return!1}(r,t,s)||_(t))),i||(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t)),!i))}this.setModules=function(e,t,a,s){v=e,g=t,this.rv=t,M=a,this.qupvt=a,w=s,n.setModules(M,w)},this.ms_convert=function(e,t){for(var a=0;a<576;++a){var s=e.tt[t][0].xr[a],n=e.tt[t][1].xr[a];e.tt[t][0].xr[a]=(s+n)*(.5*ee.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*ee.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,Te.fill(a,n,576,0),1e-20<(s=function(e,t,a,s){for(var n=s=0;n<=a;++n){var r=Math.abs(e.xr[n]);s+=r,t[n]=Math.sqrt(r*Math.sqrt(r)),t[n]>e.xrpow_max&&(e.xrpow_max=t[n])}return s}(t,a,n,s))){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;iS&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break;if(0==f.over_count){for(;(_.part2_3_length=w.count_bits(i,s,_,c))>h&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break}if(M.calc_noise(_,a,l,d,c),d.bits=_.part2_3_length,0!=(B(t.block_type!=Pe.SHORT_TYPE?e.quant_comp:e.quant_comp_short,f,d,_,l)?1:0))h=t.part2_3_length,f=d,t.assign(_),p=0,$.arraycopy(s,0,o,0,576);else if(0==i.full_outer_loop){if(++p>v&&0==f.over_count)break;if(3==i.noise_shaping_amp&&b&&30r[f.VBR_max_bitrate]&&(_[m][v]*=r[f.VBR_max_bitrate],_[m][v]/=u),i[m][v]>_[m][v]&&(i[m][v]=_[m][v]);return h},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;nZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),b+=s[_][o]}if(Z.MAX_BITS_PER_GRANULEZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),l+=s[_][o];if(l>r[0])for(_=0;_=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust=s?e.ATH.adjust=s:e.ATH.adjust>1,u=(h=(c=s)<<1)+c,s=h<<1,r=(n=t)+b;M=e[n+0]-e[n+c],S=e[n+0]+e[n+c],A=e[n+h]-e[n+u],R=e[n+h]+e[n+u],e[n+h]=S-R,e[n+0]=S+R,e[n+u]=M-A,e[n+c]=M+A,M=e[r+0]-e[r+c],S=e[r+0]+e[r+c],A=ee.SQRT2*e[r+u],R=ee.SQRT2*e[r+h],e[r+h]=S-R,e[r+0]=S+R,e[r+u]=M-A,e[r+c]=M+A,r+=s,(n+=s)<_;);for(l=T[i+0],o=T[i+1],f=1;fN[u+3-2]?U/=N[u+3-2]:U=N[u+3-2]>10*U?N[u+3-2]/(10*U):0,Y[u+3]=U}if(e.analysis){var W=Y[0];for(u=1;u<12;u++)WV&&(j[u/3]=u%3+1);for(u=1;u<4;u++){(O[u-1]>O[u]?O[u-1]/O[u]:O[u]/O[u-1])<1.7&&(j[u]=0,1==u&&(j[0]=0))}for(0!=j[0]&&0!=S.nsPsy.lastAttacks[c]&&(j[0]=0),3!=S.nsPsy.lastAttacks[c]&&j[0]+j[1]+j[2]+j[3]==0||((D=0)!=j[1]&&0!=j[0]&&(j[1]=0),0!=j[2]&&0!=j[1]&&(j[2]=0),0!=j[3]&&0!=j[2]&&(j[3]=0)),c<2?T[c]=D:0==D&&(T[0]=T[1]=0),o[c]=S.tot_ener[c],he(e,C,F,M,1&c,w,1&c,s,c,t,a),Me(S,C,R,X,q),we(S,X,q,y),v=0;v<3;v++){var J,$;for(ve(e,F,B,A,c,v),me(S,B,A,c,v),p=0;p1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var a=e.mld_l[t]*e.en[3].l[t],s=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],a));a=e.mld_l[t]*e.en[2].l[t];var n=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],a));e.thm[2].l[t]=s,e.thm[3].l[t]=n}for(t=0;t1.58*e.thm[1].s[t][r]||e.thm[1].s[t][r]>1.58*e.thm[0].s[t][r]||(a=e.mld_s[t]*e.en[3].s[t][r],s=Math.max(e.thm[2].s[t][r],Math.min(e.thm[3].s[t][r],a)),a=e.mld_s[t]*e.en[2].s[t][r],n=Math.max(e.thm[3].s[t][r],Math.min(e.thm[2].s[t][r],a)),e.thm[2].s[t][r]=s,e.thm[3].s[t][r]=n)}(S),g=e.msfix,0g&&(s[o]=g),1a[o]&&(s[o]=a[o]),l.masking_lower<1&&(s[o]*=l.masking_lower)}for(;of&&(s[r]=f),1a[r]&&(s[r]=a[r]),e.masking_lower<1&&(s[r]*=e.masking_lower)}for(;rM[p+3-2]?E/=M[p+3-2]:E=M[p+3-2]>10*E?M[p+3-2]/(10*E):0,S[p+3]=E}for(p=0;p<3;++p){var P=M[3*p+3]+M[3*p+4]+M[3*p+5],H=1;6*M[3*p+5]A&&(o[b][p/3]=p%3+1);for(p=1;p<4;p++){var I=w[p-1],V=w[p];Math.max(I,V)<4e4&&I<1.7*V&&V<1.7*I&&(1==p&&o[b][0]<=o[b][p]&&(o[b][0]=0),o[b][p]=0)}o[b][0]<=c.nsPsy.lastAttacks[b]&&(o[b][0]=0),3!=c.nsPsy.lastAttacks[b]&&o[b][0]+o[b][1]+o[b][2]+o[b][3]==0||((k=0)!=o[b][1]&&0!=o[b][0]&&(o[b][1]=0),0!=o[b][2]&&0!=o[b][1]&&(o[b][2]=0),0!=o[b][3]&&0!=o[b][2]&&(o[b][3]=0)),b<2?l[b]=k:0==k&&(l[0]=l[1]=0),i[b]=c.tot_ener[b]}}(e,t,a,s,n,r,o,w,R,B),function(e,t){var a=e.internal_flags;e.short_blocks!=xe.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=n&&(m=i*(l[t]-n)/(24-n)+r*(24-l[t])/(24-n)),c[t]=Math.pow(10,m/10),0=n&&(m=o*(l[t]-n)/(24-n)+_*(24-l[t])/(24-n)),c[t]=Math.pow(10,m/10),g=K.MAX_VALUE;for(v=0;va.npart_l-1&&(a.s3ind[M][1]=a.npart_l-1);var w=576*a.mode_gr/h;if(a.ATH.decay=Math.pow(10,-1.2*w),a.ATH.adjust=.01,-(a.ATH.adjustLimit=1)!=e.ATHtype){var R=e.out_samplerate/Pe.BLKSIZE,B=0;for(t=d=0;t=v)for(l=0;le.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(t=0|e.lowpassfreq,a=e.in_samplerate,s=44100,48e3<=a?s=48e3:44100<=a?s=44100:32e3<=a?s=32e3:24e3<=a?s=24e3:22050<=a?s=22050:16e3<=a?s=16e3:12e3<=a?s=12e3:11025<=a?s=11025:8e3<=a&&(s=8e3),-1==t?s:(t<=15960&&(s=44100),t<=15250&&(s=32e3),t<=11220&&(s=24e3),t<=9970&&(s=22050),t<=7230&&(s=16e3),t<=5420&&(s=12e3),t<=4510&&(s=11025),t<=3970&&(s=8e3),a=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1t.highpass1?E((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,o=t.lowpass2>t.lowpass1?E((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=_*o}}(e),n.samplerate_index=P(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==ye.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=H(e.brate,e.version,e.out_samplerate),n.bitrate_index=L(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),R.init_bit_stream_w(n);for(var c,h,u,b=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),m=0;m=f){var M=i-u;if(0==i&&(M=0),(_=N(e,b[0],b[1],n,r,M))<0)return _;for(r+=_,u+=_,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;li&&(s.ResvMax=i),(s.ResvMax<0||e.disable_reservoir)&&(s.ResvMax=0);var _=t.bits*s.mode_gr+Math.min(s.ResvSize,s.ResvMax);return a<_&&(_=a),n.resvDrain_pre=0,null!=s.pinfo&&(s.pinfo.mean_bits=t.bits/2,s.pinfo.resvsize=s.ResvSize),_},this.ResvMaxBits=function(e,t,a,s){var n,r=e.internal_flags,i=r.ResvSize,_=r.ResvMax;0!=s&&(i+=t),0!=(1&r.substep_shaping)&&(_*=.9),a.bits=t,9*_<10*i?(n=i-9*_/10,a.bits+=n,r.substep_shaping|=128):(n=0,r.substep_shaping&=127,e.disable_reservoir||0!=(1&r.substep_shaping)||(a.bits-=.1*t));var o=i<6*r.ResvMax/10?i:6*r.ResvMax/10;return(o-=n)<0&&(o=0),o},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var a,s=e.l3_side;e.ResvSize+=t*e.mode_gr;var n=0;s.resvDrain_post=0,(s.resvDrain_pre=0)!=(a=e.ResvSize%8)&&(n+=a),0<(a=e.ResvSize-n-e.ResvMax)&&(n+=a);var r=Math.min(8*s.main_data_begin,n)/8;s.resvDrain_pre+=8*r,n-=8*r,e.ResvSize-=8*r,s.main_data_begin-=r,s.resvDrain_post+=n,e.ResvSize-=n}},b=new k,m=new function(){this.setModules=function(e,t,a){}},p=new function(){};n.setModules(r,i,_,o,l,f,c,h,p),i.setModules(r,p,c,f),h.setModules(i,c),_.setModules(n),l.setModules(i,u,o,b),o.setModules(b,u,n.enc.psy),u.setModules(i),b.setModules(o),f.setModules(n,i,c),a.setModules(m,p),m.setModules(c,h,_);var v=n.lame_init();v.num_channels=s,v.in_samplerate=e,v.out_samplerate=e,v.brate=t,v.mode=Ee.STEREO,v.quality=3,v.bWriteVbrTag=!1,v.disable_reservoir=!0,v.write_id3tag_automatic=!1,n.lame_init_params(v);var d=1152,g=0|1.25*d+7200,S=B(g);this.encodeBuffer=function(e,t){1==s&&(t=e),e.length>d&&(d=e.length,S=B(g=0|1.25*d+7200));var a=n.lame_encode_buffer(v,e,t,e.length,S,0,g);return new Int8Array(S.subarray(0,a))},this.flush=function(){var e=n.lame_encode_flush(v,S,0,g);return new Int8Array(S.subarray(0,e))}}}t(),Recorder.lamejs=t}(); \ No newline at end of file diff --git a/recorder.mp3.min.js b/recorder.mp3.min.js index 7c6ac75..06b3164 100644 --- a/recorder.mp3.min.js +++ b/recorder.mp3.min.js @@ -3,4 +3,4 @@ https://github.com/xiangyuecn/Recorder src: recorder-core.js,engine/mp3.js,engine/mp3-engine.js */ -!function(u){"use strict";var m=function(){},L=function(e){return new t(e)};L.IsOpen=function(){var e=L.Stream;if(e){var t=e.getTracks&&e.getTracks()||e.audioTracks||[],a=t[0];if(a){var s=a.readyState;return"live"==s||s==a.LIVE}}return!1},L.BufferSize=4096,L.Destroy=function(){for(var e in console.log("Recorder Destroy"),a)a[e]()};var a={};L.BindDestroy=function(e,t){a[e]=t},L.Support=function(){var e=u.AudioContext;if(e||(e=u.webkitAudioContext),!e)return!1;var t=navigator.mediaDevices||{};return t.getUserMedia||(t=navigator).getUserMedia||(t.getUserMedia=t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia),!!t.getUserMedia&&(L.Scope=t,L.Ctx&&"closed"!=L.Ctx.state||(L.Ctx=new e,L.BindDestroy("Ctx",function(){var e=L.Ctx;e&&e.close&&e.close()})),!0)},L.SampleData=function(e,t,a,s,n){s||(s={});var r=s.index||0,i=s.offset||0,_=s.frameNext||[];n||(n={});var o=n.frameSize||1;n.frameType&&(o="mp3"==n.frameType?1152:1);for(var l=0,f=r;f"+m.length+" 花:"+(Date.now()-s)+"ms"),setTimeout(function(){s=Date.now(),n[r.type](m,function(e){o(e,h)},function(e){_(e)})})}else _("未加载"+r.type+"编码器");else _("音频被释放");else _("未采集到录音")}},u.Recorder&&u.Recorder.Destroy(),(u.Recorder=L).LM="2020-5-17 08:21:54",L.TrafficImgUrl="//ia.51.la/go1?id=20469973&pvFlag=1",L.Traffic=function(){var e=L.TrafficImgUrl;if(e){var t=L.Traffic,a=location.href.replace(/#.*/,"");if(0==e.indexOf("//")&&(e=/^https:/i.test(a)?"https:"+e:"http:"+e),!t[a]){t[a]=1;var s=new Image;s.src=e,console.log("Traffic Analysis Image: Recorder.TrafficImgUrl="+L.TrafficImgUrl)}}}}(window),"function"==typeof define&&define.amd&&define(function(){return Recorder}),"object"==typeof module&&module.exports&&(module.exports=Recorder),function(){"use strict";var i;Recorder.prototype.enc_mp3={stable:!0,testmsg:"采样率范围48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000"},Recorder.prototype.mp3=function(a,s,e){var n=this.set,r=a.length,t=this.mp3_start(n);if(t)return this.mp3_encode(t,a),void this.mp3_complete(t,s,e,1);var i=new Recorder.lamejs.Mp3Encoder(1,n.sampleRate,n.bitRate),_=[],o=0,l=0,f=function(){if(o=c.byteLength?(_-=c.byteLength,l.push(c),e.splice(f,1),f--):(e[f]=c.slice(_),o=c,_=0)}if(!this.rm(e,t)){o&&(e[0]=o);for(f=0;f "+s.duration+"ms",2>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function R(e,t,a,s,n,r){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var _,o,l,f,c,h,u,m;_=a[s++]*t,o=a[s++]*t,c=0|_,l=a[s++]*t,h=0|o,f=a[s++]*t,u=0|l,_+=M.adj43[c],m=0|f,o+=M.adj43[h],n[r++]=0|_,l+=M.adj43[u],n[r++]=0|o,f+=M.adj43[m],n[r++]=0|l,n[r++]=0|f}0!=i&&(c=0|(_=a[s++]*t),h=0|(o=a[s++]*t),_+=M.adj43[c],o+=M.adj43[h],n[r++]=0|_,n[r++]=0|o)}var _=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function d(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s>=16)&&(_=r,s++),n.bits+=_,s}(e,t,a,_[n-1],s);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,a,s,n){var r=0,i=0,_=0,o=j.ht[s].xlen,l=j.ht[s].hlen,f=j.ht[s+1].hlen,c=j.ht[s+2].hlen;do{var h=e[t+0]*o+e[t+1];t+=2,r+=l[h],i+=f[h],_+=c[h]}while(t=n);r++);for(i=r-8;i<24&&!(j.ht[i].linmax>=n);i++);return function(e,t,a,s,n,r){var i,_=65536*j.ht[s].xlen+j.ht[n].xlen,o=0;do{var l=e[t++],f=e[t++];0!=l&&(14>=16)&&(o=i,s=n),r.bits+=o,s}(e,t,a,i,r,s)}}function u(e,t,a,s,n,r,i,_){for(var o=t.big_values,l=2;l>1<<1);for(null!=a&&(a.sfb_count1=0);1t.big_values&&(r=t.big_values),i=t.big_values;else if(t.block_type==Pe.NORM_TYPE){if(r=t.region0_count=e.bv_scf[n-2],i=t.region1_count=e.bv_scf[n-1],i=e.scalefac_band.l[r+i+2],r=e.scalefac_band.l[r+1],ir)return y.LARGE_BITS;if(function(e,t,a,s,n){var r,i,_,o=0,l=0,f=0,c=0,h=t,u=0,m=h,b=0,p=e,v=0;for(_=null!=n&&s.global_gain==n.global_gain,i=s.block_type==Pe.SHORT_TYPE?38:21,r=0;r<=i;r++){var d=-1;if((_||s.block_type==Pe.NORM_TYPE)&&(d=s.global_gain-(s.scalefac[r]+(0!=s.preflag?M.pretab[r]:0)<s.max_nonzero_coeff&&(g=s.max_nonzero_coeff-o+1,Te.fill(t,s.max_nonzero_coeff,576,0),(S=g)<0&&(S=0),r=i+1),0==l&&0==f&&(m=h,b=u,p=e,v=c),null!=n&&0=n.sfb_count1&&0=n.step[r]?(0!=l&&(R(l,a,p,v,m,b),l=0,m=h,b=u,p=e,v=c),f+=S):(0!=f&&(w(f,a,p,v,m,b),f=0,m=h,b=u,p=e,v=c),l+=S),S<=0){0!=f&&(w(f,a,p,v,m,b),f=0),0!=l&&(R(l,a,p,v,m,b),l=0);break}}r<=i&&(u+=s.width[r],c+=s.width[r],o+=s.width[r])}0!=l&&(R(l,a,p,v,m,b),l=0),0!=f&&(w(f,a,p,v,m,b),f=0)}(t,n,M.IPOW20(a.global_gain),a,s),0!=(2&e.substep_shaping))for(var i=0,_=a.global_gain+a.scalefac_scale,o=.634521682242439/M.IPOW20(_),l=0;l=o?n[f]:0}return this.noquant_count_bits(e,a,s)},this.best_huffman_divide=function(e,t){var a=new x,s=t.l3_enc,n=Be(23),r=Be(23),i=Be(23),_=Be(23);if(t.block_type!=Pe.SHORT_TYPE||1!=e.mode_gr){a.assign(t),t.block_type==Pe.NORM_TYPE&&(!function(e,t,a,s,n,r,i){for(var _=t.big_values,o=0;o<=22;o++)s[o]=y.LARGE_BITS;for(o=0;o<16;o++){var l=e.scalefac_band.l[o+1];if(_<=l)break;var f=0,c=new v(f),h=d(a,0,l,c);f=c.bits;for(var u=0;u<8;u++){var m=e.scalefac_band.l[o+u+2];if(_<=m)break;var b=f,p=d(a,l,m,c=new v(b));b=c.bits,s[o+u]>b&&(s[o+u]=b,r[(n[o+u]=o)+u]=h,i[o+u]=p)}}}(e,t,s,n,r,i,_),u(e,a,t,s,n,r,i,_));var o=a.big_values;if(!(0==o||1<(s[o-2]|s[o-1])||576<(o=t.count1+2))){a.assign(t),a.count1=o;for(var l=0,f=0;o>a.big_values;o-=4){var c=2*(2*(2*s[o-4]+s[o-3])+s[o-2])+s[o-1];l+=j.t32l[c],f+=j.t33l[c]}if(a.big_values=o,a.count1table_select=0,fa.part2_3_length&&t.assign(a)}}}};var h=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],m=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],b=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],p=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];k.slen1_tab=b,k.slen2_tab=p,this.best_scalefac_store=function(e,t,a,s){var n,r,i,_,o=s.tt[t][a],l=0;for(n=i=0;n>=1);o.scalefac_scale=l=1}}if(0==o.preflag&&o.block_type!=Pe.SHORT_TYPE&&2==e.mode_gr){for(n=11;nf&&(s.part2_length=f,s.scalefac_compress=r)}}(a,s),l=0),n=0;ns[t]&&(e.part2_length=s[t],e.scalefac_compress=t);return e.part2_length==y.LARGE_BITS};var g=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,t){var a,s,n,r,i,_,o,l,f=Be(4),c=t.scalefac;for(a=0!=t.preflag?2:0,o=0;o<4;o++)f[o]=0;if(t.block_type==Pe.SHORT_TYPE){s=1;var h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n]/3,o=0;of[n]&&(f[n]=c[3*l+i])}else{s=0;h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n],o=0;of[n]&&(f[n]=c[l])}for(_=!1,n=0;n<4;n++)f[n]>g[a][n]&&(_=!0);if(!_){var u,m,b,p;for(t.sfb_partition_table=M.nr_of_sfb_block[a][s],n=0;n<4;n++)t.slen[n]=S[f[n]];switch(u=t.slen[0],m=t.slen[1],b=t.slen[2],p=t.slen[3],a){case 0:t.scalefac_compress=(5*u+m<<4)+(b<<2)+p;break;case 1:t.scalefac_compress=400+(5*u+m<<2)+b;break;case 2:t.scalefac_compress=500+3*u+m;break;default:$.err.printf("intensity stereo not implemented yet\n")}}if(!_)for(n=t.part2_length=0;n<4;n++)t.part2_length+=t.slen[n]*t.sfb_partition_table[n];return _};var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var a,s=0;e.scalefac_band.l[++s]t;)a--;for(a<0&&(a=n[s][0]),e.bv_scf[t-2]=a,a=n[s][1];e.scalefac_band.l[a+e.bv_scf[t-2]+2]>t;)a--;a<0&&(a=n[s][1]),e.bv_scf[t-1]=a}}}function X(){}function M(){this.setModules=function(e,t,a){e,t,a};var _=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.updateMusicCRC=function(e,t,a,s){for(var n=0;n>8^_[255&(i^r)]);var r,i}}function q(){var o=this,s=32773,c=null,h=null,r=null,u=null;this.setModules=function(e,t,a,s){c=e,h=t,r=a,u=s};var m=null,l=0,b=0,p=0;function v(e,t,a){for(;0>a<>a<>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function n(e,t){e<<=8;for(var a=0;a<8;a++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=s);return t}function d(e,t){var a,s=j.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;0t.big_values&&(a=t.big_values);var s=g(e,t.table_select[0],0,a,t);return s+=g(e,t.table_select[1],a,t.big_values,t)}function M(e,t){var a,s,n,r;a=t.big_values;var i=t.region0_count+1;return n=e.scalefac_band.l[i],i+=t.region1_count+1,a>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,n=s.h_ptr-1;if(-1==n&&(n=Z.MAX_HEADER_BUF-1),t=s.l3_side,!((a=R(e,new w))<0)){if(_(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var r=c.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*r+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*A(s.PeakSample/32767)*10),0 ResvSize"),8*t.main_data_begin!=a.ResvSize&&($.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,a.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*a.sideinfo_len,n-t.resvDrain_post-8*a.sideinfo_len,n,n%8,s),$.err.println("This is a fatal error. It has several possible causes:"),$.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),$.err.println(" 9%% Your system is overclocked"),$.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),1e9e.PeakSample?e.PeakSample=o[0][_]:-o[0][_]>e.PeakSample&&(e.PeakSample=-o[0][_]);if(1e.PeakSample?e.PeakSample=o[1][_]:-o[1][_]>e.PeakSample&&(e.PeakSample=-o[1][_])}if(e.findReplayGain&&c.AnalyzeSamples(e.rgdata,o[0],0,o[1],0,f,e.channels_out)==X.GAIN_ANALYSIS_ERROR)return-6}}return r},this.init_bit_stream_w=function(e){m=B(U.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,b=-1,l=p=0}}function e(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}Ee.STEREO=new Ee(0),Ee.JOINT_STEREO=new Ee(1),Ee.DUAL_CHANNEL=new Ee(2),Ee.MONO=new Ee(3),Ee.NOT_SET=new Ee(4),X.STEPS_per_dB=100,X.MAX_dB=120,X.GAIN_NOT_ENOUGH_SAMPLES=-24601,X.GAIN_ANALYSIS_ERROR=0,X.GAIN_ANALYSIS_OK=1,X.INIT_GAIN_ANALYSIS_ERROR=0,X.INIT_GAIN_ANALYSIS_OK=1,X.MAX_ORDER=X.YULE_ORDER=10,X.MAX_SAMPLES_PER_WINDOW=(X.MAX_SAMP_FREQ=48e3)*(X.RMS_WINDOW_TIME_NUMERATOR=1)/(X.RMS_WINDOW_TIME_DENOMINATOR=20)+1,M.NUMTOCENTRIES=100,M.MAXFRAMESIZE=2880,q.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},q.NEQ=function(e,t){return!q.EQ(e,t)};var j={};function F(e){this.bits=e}function T(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function r(e,t,a,s){this.l=Be(1+Pe.SBMAX_l),this.s=Be(1+Pe.SBMAX_s),this.psfb21=Be(1+Pe.PSFB21),this.psfb12=Be(1+Pe.PSFB12);var n=this.l,r=this.s;4==arguments.length&&(this.arrL=e,this.arrS=t,this.arr21=a,this.arr12=s,$.arraycopy(this.arrL,0,n,0,Math.min(this.arrL.length,this.l.length)),$.arraycopy(this.arrS,0,r,0,Math.min(this.arrS.length,this.s.length)),$.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),$.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function y(){var l=null,m=null,s=null;this.setModules=function(e,t,a){l=e,m=t,s=a},this.IPOW20=function(e){return u[e]};var x=2.220446049250313e-16,f=y.IXMAX_VAL+2,c=y.Q_MAX,h=y.Q_MAX2,n=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var w=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=w,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var R=Ae(c+h+1),u=Ae(c),b=Ae(f),p=Ae(f);function v(e,t){var a=s.ATHformula(t,e);return a-=n,a=Math.pow(10,a/10+e.ATHlower)}function B(e){this.s=e}this.adj43=p,this.iteration_init=function(e){var t,a=e.internal_flags,s=a.l3_side;if(0==a.iteration_init_init){for(a.iteration_init_init=1,s.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,a=e.internal_flags.ATH.psfb21,s=e.internal_flags.ATH.s,n=e.internal_flags.ATH.psfb12,r=e.internal_flags,i=e.out_samplerate,_=0;_>2&63)&&(t-=64),n=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>8&63)&&(t-=64),r=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>14&63)&&(t-=64),i=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>20&63)&&(t-=64),_=i*Math.pow(10,t/4/10),t=0;t3*s/4&&(f[_]=3*s/4),f[_]<0&&(f[_]=0),f[_]+a[_]>Z.MAX_BITS_PER_CHANNEL&&(f[_]=Math.max(0,Z.MAX_BITS_PER_CHANNEL-a[_])),i+=f[_];if(hZ.MAX_BITS_PER_CHANNEL-e[0]&&(r=Z.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),125<=e[1]&&(125>1,B=0;do{B+=k=f[_]*f[_],M+=k>1;S=d/p,M=x;do{var k,T;B+=k=f[_]*f[_],M+=ks[r-3+1]&&(s[r-3+1]+=(s[r-3]-s[r-3+1])*i.decay),s[r-3+1]>s[r-3+2]&&(s[r-3+2]+=(s[r-3+1]-s[r-3+2])*i.decay))}return o},this.calc_noise_core=function(e,t,a,s){var n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){o=e.xr[r],r++,n+=o*o,o=e.xr[r],r++,n+=o*o}else if(r>e.big_values){var _=Ae(2);for(_[0]=0,_[1]=s;0!=a--;){o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o,o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o}}else for(;0!=a--;){var o;o=Math.abs(e.xr[r])-b[i[r]]*s,r++,n+=o*o,o=Math.abs(e.xr[r])-b[i[r]]*s,r++,n+=o*o}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,l=0,f=0,c=0,h=-20,u=0,m=e.scalefac,b=0;for(r=s.over_SSD=0;r>1,u+e.width[r]>e.max_nonzero_coeff)i=0<(g=e.max_nonzero_coeff-u+1)?g>>1:0;var M=new B(u);d=this.calc_noise_core(e,M,i,S),u=M.s,null!=n&&(n.step[r]=v,n.noise[r]=d),d=a[_++]=d/t[o++],d=ee.FAST_LOG10(Math.max(d,1e-20)),null!=n&&(n.noise_log[r]=d)}if(null!=n&&(n.global_gain=e.global_gain),c+=d,0a.max_noise-.2&&a.tot_noisea.max_noise-.2&&a.tot_noisea.max_noise-.1&&a.tot_noise+a.over_noisea.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noiset.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,a,s,n);var i=_(t);return!i&&(!(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t))||(1e.xrpow_max&&(e.xrpow_max=t[a+i])}e.scalefac[s]=r>>1}e.preflag=0,e.scalefac_scale=1}(t,s),i=!1):t.block_type==Pe.SHORT_TYPE&&0>t.scalefac_scale))n[s]=f,o+=3*l;else{n[s]=0;var c=210+(f<t.xrpow_max&&(t.xrpow_max=a[o+h]);o+=l*(3-r-1)}}var u=M.IPOW20(202);for(o+=t.width[s]*(r+1),h=-t.width[s];h<0;h++)a[o+h]*=u,a[o+h]>t.xrpow_max&&(t.xrpow_max=a[o+h])}}return!1}(r,t,s)||_(t))),i||(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t)),!i))}this.setModules=function(e,t,a,s){v=e,g=t,this.rv=t,M=a,this.qupvt=a,w=s,n.setModules(M,w)},this.ms_convert=function(e,t){for(var a=0;a<576;++a){var s=e.tt[t][0].xr[a],n=e.tt[t][1].xr[a];e.tt[t][0].xr[a]=(s+n)*(.5*ee.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*ee.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,Te.fill(a,n,576,0),1e-20<(s=function(e,t,a,s){for(var n=s=0;n<=a;++n){var r=Math.abs(e.xr[n]);s+=r,t[n]=Math.sqrt(r*Math.sqrt(r)),t[n]>e.xrpow_max&&(e.xrpow_max=t[n])}return s}(t,a,n,s))){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;iS&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break;if(0==f.over_count){for(;(_.part2_3_length=w.count_bits(i,s,_,c))>h&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break}if(M.calc_noise(_,a,l,d,c),d.bits=_.part2_3_length,0!=(B(t.block_type!=Pe.SHORT_TYPE?e.quant_comp:e.quant_comp_short,f,d,_,l)?1:0))h=t.part2_3_length,f=d,t.assign(_),p=0,$.arraycopy(s,0,o,0,576);else if(0==i.full_outer_loop){if(++p>v&&0==f.over_count)break;if(3==i.noise_shaping_amp&&m&&30r[f.VBR_max_bitrate]&&(_[b][v]*=r[f.VBR_max_bitrate],_[b][v]/=u),i[b][v]>_[b][v]&&(i[b][v]=_[b][v]);return h},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;nZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),m+=s[_][o]}if(Z.MAX_BITS_PER_GRANULEZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),l+=s[_][o];if(l>r[0])for(_=0;_=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust=s?e.ATH.adjust=s:e.ATH.adjust>1,u=(h=(c=s)<<1)+c,s=h<<1,r=(n=t)+m;M=e[n+0]-e[n+c],S=e[n+0]+e[n+c],A=e[n+h]-e[n+u],R=e[n+h]+e[n+u],e[n+h]=S-R,e[n+0]=S+R,e[n+u]=M-A,e[n+c]=M+A,M=e[r+0]-e[r+c],S=e[r+0]+e[r+c],A=ee.SQRT2*e[r+u],R=ee.SQRT2*e[r+h],e[r+h]=S-R,e[r+0]=S+R,e[r+u]=M-A,e[r+c]=M+A,r+=s,(n+=s)<_;);for(l=T[i+0],o=T[i+1],f=1;fO[u+3-2]?Q/=O[u+3-2]:Q=O[u+3-2]>10*Q?O[u+3-2]/(10*Q):0,D[u+3]=Q}if(e.analysis){var W=D[0];for(u=1;u<12;u++)WV&&(q[u/3]=u%3+1);for(u=1;u<4;u++){(N[u-1]>N[u]?N[u-1]/N[u]:N[u]/N[u-1])<1.7&&(q[u]=0,1==u&&(q[0]=0))}for(0!=q[0]&&0!=S.nsPsy.lastAttacks[c]&&(q[0]=0),3!=S.nsPsy.lastAttacks[c]&&q[0]+q[1]+q[2]+q[3]==0||((C=0)!=q[1]&&0!=q[0]&&(q[1]=0),0!=q[2]&&0!=q[1]&&(q[2]=0),0!=q[3]&&0!=q[2]&&(q[3]=0)),c<2?T[c]=C:0==C&&(T[0]=T[1]=0),o[c]=S.tot_ener[c],he(e,j,F,M,1&c,w,1&c,s,c,t,a),Me(S,j,R,Y,X),we(S,Y,X,y),v=0;v<3;v++){var J,$;for(ve(e,F,B,A,c,v),be(S,B,A,c,v),p=0;p1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var a=e.mld_l[t]*e.en[3].l[t],s=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],a));a=e.mld_l[t]*e.en[2].l[t];var n=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],a));e.thm[2].l[t]=s,e.thm[3].l[t]=n}for(t=0;t1.58*e.thm[1].s[t][r]||e.thm[1].s[t][r]>1.58*e.thm[0].s[t][r]||(a=e.mld_s[t]*e.en[3].s[t][r],s=Math.max(e.thm[2].s[t][r],Math.min(e.thm[3].s[t][r],a)),a=e.mld_s[t]*e.en[2].s[t][r],n=Math.max(e.thm[3].s[t][r],Math.min(e.thm[2].s[t][r],a)),e.thm[2].s[t][r]=s,e.thm[3].s[t][r]=n)}(S),g=e.msfix,0g&&(s[o]=g),1a[o]&&(s[o]=a[o]),l.masking_lower<1&&(s[o]*=l.masking_lower)}for(;of&&(s[r]=f),1a[r]&&(s[r]=a[r]),e.masking_lower<1&&(s[r]*=e.masking_lower)}for(;rM[p+3-2]?E/=M[p+3-2]:E=M[p+3-2]>10*E?M[p+3-2]/(10*E):0,S[p+3]=E}for(p=0;p<3;++p){var P=M[3*p+3]+M[3*p+4]+M[3*p+5],H=1;6*M[3*p+5]A&&(o[m][p/3]=p%3+1);for(p=1;p<4;p++){var L=w[p-1],V=w[p];Math.max(L,V)<4e4&&L<1.7*V&&V<1.7*L&&(1==p&&o[m][0]<=o[m][p]&&(o[m][0]=0),o[m][p]=0)}o[m][0]<=c.nsPsy.lastAttacks[m]&&(o[m][0]=0),3!=c.nsPsy.lastAttacks[m]&&o[m][0]+o[m][1]+o[m][2]+o[m][3]==0||((k=0)!=o[m][1]&&0!=o[m][0]&&(o[m][1]=0),0!=o[m][2]&&0!=o[m][1]&&(o[m][2]=0),0!=o[m][3]&&0!=o[m][2]&&(o[m][3]=0)),m<2?l[m]=k:0==k&&(l[0]=l[1]=0),i[m]=c.tot_ener[m]}}(e,t,a,s,n,r,o,w,R,B),function(e,t){var a=e.internal_flags;e.short_blocks!=xe.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=n&&(b=i*(l[t]-n)/(24-n)+r*(24-l[t])/(24-n)),c[t]=Math.pow(10,b/10),0=n&&(b=o*(l[t]-n)/(24-n)+_*(24-l[t])/(24-n)),c[t]=Math.pow(10,b/10),g=K.MAX_VALUE;for(v=0;va.npart_l-1&&(a.s3ind[M][1]=a.npart_l-1);var w=576*a.mode_gr/h;if(a.ATH.decay=Math.pow(10,-1.2*w),a.ATH.adjust=.01,-(a.ATH.adjustLimit=1)!=e.ATHtype){var R=e.out_samplerate/Pe.BLKSIZE,B=0;for(t=d=0;t=v)for(l=0;le.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(t=0|e.lowpassfreq,a=e.in_samplerate,s=44100,48e3<=a?s=48e3:44100<=a?s=44100:32e3<=a?s=32e3:24e3<=a?s=24e3:22050<=a?s=22050:16e3<=a?s=16e3:12e3<=a?s=12e3:11025<=a?s=11025:8e3<=a&&(s=8e3),-1==t?s:(t<=15960&&(s=44100),t<=15250&&(s=32e3),t<=11220&&(s=24e3),t<=9970&&(s=22050),t<=7230&&(s=16e3),t<=5420&&(s=12e3),t<=4510&&(s=11025),t<=3970&&(s=8e3),a=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1t.highpass1?E((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,o=t.lowpass2>t.lowpass1?E((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=_*o}}(e),n.samplerate_index=P(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==ye.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=H(e.brate,e.version,e.out_samplerate),n.bitrate_index=I(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),R.init_bit_stream_w(n);for(var c,h,u,m=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),b=0;b=f){var M=i-u;if(0==i&&(M=0),(_=O(e,m[0],m[1],n,r,M))<0)return _;for(r+=_,u+=_,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;li&&(s.ResvMax=i),(s.ResvMax<0||e.disable_reservoir)&&(s.ResvMax=0);var _=t.bits*s.mode_gr+Math.min(s.ResvSize,s.ResvMax);return a<_&&(_=a),n.resvDrain_pre=0,null!=s.pinfo&&(s.pinfo.mean_bits=t.bits/2,s.pinfo.resvsize=s.ResvSize),_},this.ResvMaxBits=function(e,t,a,s){var n,r=e.internal_flags,i=r.ResvSize,_=r.ResvMax;0!=s&&(i+=t),0!=(1&r.substep_shaping)&&(_*=.9),a.bits=t,9*_<10*i?(n=i-9*_/10,a.bits+=n,r.substep_shaping|=128):(n=0,r.substep_shaping&=127,e.disable_reservoir||0!=(1&r.substep_shaping)||(a.bits-=.1*t));var o=i<6*r.ResvMax/10?i:6*r.ResvMax/10;return(o-=n)<0&&(o=0),o},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var a,s=e.l3_side;e.ResvSize+=t*e.mode_gr;var n=0;s.resvDrain_post=0,(s.resvDrain_pre=0)!=(a=e.ResvSize%8)&&(n+=a),0<(a=e.ResvSize-n-e.ResvMax)&&(n+=a);var r=Math.min(8*s.main_data_begin,n)/8;s.resvDrain_pre+=8*r,n-=8*r,e.ResvSize-=8*r,s.main_data_begin-=r,s.resvDrain_post+=n,e.ResvSize-=n}},m=new k,b=new function(){this.setModules=function(e,t,a){}},p=new function(){};n.setModules(r,i,_,o,l,f,c,h,p),i.setModules(r,p,c,f),h.setModules(i,c),_.setModules(n),l.setModules(i,u,o,m),o.setModules(m,u,n.enc.psy),u.setModules(i),m.setModules(o),f.setModules(n,i,c),a.setModules(b,p),b.setModules(c,h,_);var v=n.lame_init();v.num_channels=s,v.in_samplerate=e,v.out_samplerate=e,v.brate=t,v.mode=Ee.STEREO,v.quality=3,v.bWriteVbrTag=!1,v.disable_reservoir=!0,v.write_id3tag_automatic=!1,n.lame_init_params(v);var d=1152,g=0|1.25*d+7200,S=B(g);this.encodeBuffer=function(e,t){1==s&&(t=e),e.length>d&&(d=e.length,S=B(g=0|1.25*d+7200));var a=n.lame_encode_buffer(v,e,t,e.length,S,0,g);return new Int8Array(S.subarray(0,a))},this.flush=function(){var e=n.lame_encode_flush(v,S,0,g);return new Int8Array(S.subarray(0,e))}}}t(),Recorder.lamejs=t}(); \ No newline at end of file +!function(u){"use strict";var m=function(){},L=function(e){return new t(e)};L.IsOpen=function(){var e=L.Stream;if(e){var t=e.getTracks&&e.getTracks()||e.audioTracks||[],a=t[0];if(a){var s=a.readyState;return"live"==s||s==a.LIVE}}return!1},L.BufferSize=4096,L.Destroy=function(){for(var e in console.log("Recorder Destroy"),a)a[e]()};var a={};L.BindDestroy=function(e,t){a[e]=t},L.Support=function(){var e=u.AudioContext;if(e||(e=u.webkitAudioContext),!e)return!1;var t=navigator.mediaDevices||{};return t.getUserMedia||(t=navigator).getUserMedia||(t.getUserMedia=t.webkitGetUserMedia||t.mozGetUserMedia||t.msGetUserMedia),!!t.getUserMedia&&(L.Scope=t,L.Ctx&&"closed"!=L.Ctx.state||(L.Ctx=new e,L.BindDestroy("Ctx",function(){var e=L.Ctx;e&&e.close&&e.close()})),!0)},L.SampleData=function(e,t,a,s,n){s||(s={});var r=s.index||0,i=s.offset||0,_=s.frameNext||[];n||(n={});var o=n.frameSize||1;n.frameType&&(o="mp3"==n.frameType?1152:1);for(var l=0,f=r;f"+m.length+" 花:"+(Date.now()-s)+"ms"),setTimeout(function(){s=Date.now(),n[r.type](m,function(e){o(e,h)},function(e){_(e)})})}else _("未加载"+r.type+"编码器");else _("音频被释放");else _("未采集到录音")}},u.Recorder&&u.Recorder.Destroy(),(u.Recorder=L).LM="2020-5-17 08:21:54",L.TrafficImgUrl="//ia.51.la/go1?id=20469973&pvFlag=1",L.Traffic=function(){var e=L.TrafficImgUrl;if(e){var t=L.Traffic,a=location.href.replace(/#.*/,"");if(0==e.indexOf("//")&&(e=/^https:/i.test(a)?"https:"+e:"http:"+e),!t[a]){t[a]=1;var s=new Image;s.src=e,console.log("Traffic Analysis Image: Recorder.TrafficImgUrl="+L.TrafficImgUrl)}}}}(window),"function"==typeof define&&define.amd&&define(function(){return Recorder}),"object"==typeof module&&module.exports&&(module.exports=Recorder),function(){"use strict";var i;Recorder.prototype.enc_mp3={stable:!0,testmsg:"采样率范围48000, 44100, 32000, 24000, 22050, 16000, 12000, 11025, 8000"},Recorder.prototype.mp3=function(a,s,e){var n=this.set,r=a.length,t=this.mp3_start(n);if(t)return this.mp3_encode(t,a),void this.mp3_complete(t,s,e,1);var i=new Recorder.lamejs.Mp3Encoder(1,n.sampleRate,n.bitRate),_=[],o=0,l=0,f=function(){if(o=c.byteLength?(_-=c.byteLength,l.push(c),e.splice(f,1),f--):(e[f]=c.slice(_),o=c,_=0)}if(!this.rm(e,t)){o&&(e[0]=o);for(f=0;f "+s.duration+"ms",2>=1;0!=e--;)n[r++]=i>a[s++]?0:1,n[r++]=i>a[s++]?0:1}function R(e,t,a,s,n,r){var i=(e>>=1)%2;for(e>>=1;0!=e--;){var _,o,l,f,c,h,u,m;_=a[s++]*t,o=a[s++]*t,c=0|_,l=a[s++]*t,h=0|o,f=a[s++]*t,u=0|l,_+=M.adj43[c],m=0|f,o+=M.adj43[h],n[r++]=0|_,l+=M.adj43[u],n[r++]=0|o,f+=M.adj43[m],n[r++]=0|l,n[r++]=0|f}0!=i&&(c=0|(_=a[s++]*t),h=0|(o=a[s++]*t),_+=M.adj43[c],o+=M.adj43[h],n[r++]=0|_,n[r++]=0|o)}var _=[1,2,5,7,7,10,10,13,13,13,13,13,13,13,13];function d(e,t,a,s){var n=function(e,t,a){var s=0,n=0;do{var r=e[t++],i=e[t++];s>=16)&&(_=r,s++),n.bits+=_,s}(e,t,a,_[n-1],s);case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:return function(e,t,a,s,n){var r=0,i=0,_=0,o=j.ht[s].xlen,l=j.ht[s].hlen,f=j.ht[s+1].hlen,c=j.ht[s+2].hlen;do{var h=e[t+0]*o+e[t+1];t+=2,r+=l[h],i+=f[h],_+=c[h]}while(t=n);r++);for(i=r-8;i<24&&!(j.ht[i].linmax>=n);i++);return function(e,t,a,s,n,r){var i,_=65536*j.ht[s].xlen+j.ht[n].xlen,o=0;do{var l=e[t++],f=e[t++];0!=l&&(14>=16)&&(o=i,s=n),r.bits+=o,s}(e,t,a,i,r,s)}}function u(e,t,a,s,n,r,i,_){for(var o=t.big_values,l=2;l>1<<1);for(null!=a&&(a.sfb_count1=0);1t.big_values&&(r=t.big_values),i=t.big_values;else if(t.block_type==Pe.NORM_TYPE){if(r=t.region0_count=e.bv_scf[n-2],i=t.region1_count=e.bv_scf[n-1],i=e.scalefac_band.l[r+i+2],r=e.scalefac_band.l[r+1],ir)return y.LARGE_BITS;if(function(e,t,a,s,n){var r,i,_,o=0,l=0,f=0,c=0,h=t,u=0,m=h,b=0,p=e,v=0;for(_=null!=n&&s.global_gain==n.global_gain,i=s.block_type==Pe.SHORT_TYPE?38:21,r=0;r<=i;r++){var d=-1;if((_||s.block_type==Pe.NORM_TYPE)&&(d=s.global_gain-(s.scalefac[r]+(0!=s.preflag?M.pretab[r]:0)<s.max_nonzero_coeff&&(g=s.max_nonzero_coeff-o+1,Te.fill(t,s.max_nonzero_coeff,576,0),(S=g)<0&&(S=0),r=i+1),0==l&&0==f&&(m=h,b=u,p=e,v=c),null!=n&&0=n.sfb_count1&&0=n.step[r]?(0!=l&&(R(l,a,p,v,m,b),l=0,m=h,b=u,p=e,v=c),f+=S):(0!=f&&(w(f,a,p,v,m,b),f=0,m=h,b=u,p=e,v=c),l+=S),S<=0){0!=f&&(w(f,a,p,v,m,b),f=0),0!=l&&(R(l,a,p,v,m,b),l=0);break}}r<=i&&(u+=s.width[r],c+=s.width[r],o+=s.width[r])}0!=l&&(R(l,a,p,v,m,b),l=0),0!=f&&(w(f,a,p,v,m,b),f=0)}(t,n,M.IPOW20(a.global_gain),a,s),0!=(2&e.substep_shaping))for(var i=0,_=a.global_gain+a.scalefac_scale,o=.634521682242439/M.IPOW20(_),l=0;l=o?n[f]:0}return this.noquant_count_bits(e,a,s)},this.best_huffman_divide=function(e,t){var a=new x,s=t.l3_enc,n=Be(23),r=Be(23),i=Be(23),_=Be(23);if(t.block_type!=Pe.SHORT_TYPE||1!=e.mode_gr){a.assign(t),t.block_type==Pe.NORM_TYPE&&(!function(e,t,a,s,n,r,i){for(var _=t.big_values,o=0;o<=22;o++)s[o]=y.LARGE_BITS;for(o=0;o<16;o++){var l=e.scalefac_band.l[o+1];if(_<=l)break;var f=0,c=new v(f),h=d(a,0,l,c);f=c.bits;for(var u=0;u<8;u++){var m=e.scalefac_band.l[o+u+2];if(_<=m)break;var b=f,p=d(a,l,m,c=new v(b));b=c.bits,s[o+u]>b&&(s[o+u]=b,r[(n[o+u]=o)+u]=h,i[o+u]=p)}}}(e,t,s,n,r,i,_),u(e,a,t,s,n,r,i,_));var o=a.big_values;if(!(0==o||1<(s[o-2]|s[o-1])||576<(o=t.count1+2))){a.assign(t),a.count1=o;for(var l=0,f=0;o>a.big_values;o-=4){var c=2*(2*(2*s[o-4]+s[o-3])+s[o-2])+s[o-1];l+=j.t32l[c],f+=j.t33l[c]}if(a.big_values=o,a.count1table_select=0,fa.part2_3_length&&t.assign(a)}}}};var h=[1,1,1,1,8,2,2,2,4,4,4,8,8,8,16,16],m=[1,2,4,8,1,2,4,8,2,4,8,2,4,8,4,8],b=[0,0,0,0,3,1,1,1,2,2,2,3,3,3,4,4],p=[0,1,2,3,0,1,2,3,1,2,3,1,2,3,2,3];k.slen1_tab=b,k.slen2_tab=p,this.best_scalefac_store=function(e,t,a,s){var n,r,i,_,o=s.tt[t][a],l=0;for(n=i=0;n>=1);o.scalefac_scale=l=1}}if(0==o.preflag&&o.block_type!=Pe.SHORT_TYPE&&2==e.mode_gr){for(n=11;nf&&(s.part2_length=f,s.scalefac_compress=r)}}(a,s),l=0),n=0;ns[t]&&(e.part2_length=s[t],e.scalefac_compress=t);return e.part2_length==y.LARGE_BITS};var g=[[15,15,7,7],[15,15,7,0],[7,3,0,0],[15,31,31,0],[7,7,7,0],[3,3,0,0]];this.scale_bitcount_lsf=function(e,t){var a,s,n,r,i,_,o,l,f=Be(4),c=t.scalefac;for(a=0!=t.preflag?2:0,o=0;o<4;o++)f[o]=0;if(t.block_type==Pe.SHORT_TYPE){s=1;var h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n]/3,o=0;of[n]&&(f[n]=c[3*l+i])}else{s=0;h=M.nr_of_sfb_block[a][s];for(n=l=0;n<4;n++)for(r=h[n],o=0;of[n]&&(f[n]=c[l])}for(_=!1,n=0;n<4;n++)f[n]>g[a][n]&&(_=!0);if(!_){var u,m,b,p;for(t.sfb_partition_table=M.nr_of_sfb_block[a][s],n=0;n<4;n++)t.slen[n]=S[f[n]];switch(u=t.slen[0],m=t.slen[1],b=t.slen[2],p=t.slen[3],a){case 0:t.scalefac_compress=(5*u+m<<4)+(b<<2)+p;break;case 1:t.scalefac_compress=400+(5*u+m<<2)+b;break;case 2:t.scalefac_compress=500+3*u+m;break;default:$.err.printf("intensity stereo not implemented yet\n")}}if(!_)for(n=t.part2_length=0;n<4;n++)t.part2_length+=t.slen[n]*t.sfb_partition_table[n];return _};var S=[0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4];this.huffman_init=function(e){for(var t=2;t<=576;t+=2){for(var a,s=0;e.scalefac_band.l[++s]t;)a--;for(a<0&&(a=n[s][0]),e.bv_scf[t-2]=a,a=n[s][1];e.scalefac_band.l[a+e.bv_scf[t-2]+2]>t;)a--;a<0&&(a=n[s][1]),e.bv_scf[t-1]=a}}}function X(){}function M(){this.setModules=function(e,t,a){e,t,a};var _=[0,49345,49537,320,49921,960,640,49729,50689,1728,1920,51009,1280,50625,50305,1088,52225,3264,3456,52545,3840,53185,52865,3648,2560,51905,52097,2880,51457,2496,2176,51265,55297,6336,6528,55617,6912,56257,55937,6720,7680,57025,57217,8e3,56577,7616,7296,56385,5120,54465,54657,5440,55041,6080,5760,54849,53761,4800,4992,54081,4352,53697,53377,4160,61441,12480,12672,61761,13056,62401,62081,12864,13824,63169,63361,14144,62721,13760,13440,62529,15360,64705,64897,15680,65281,16320,16e3,65089,64001,15040,15232,64321,14592,63937,63617,14400,10240,59585,59777,10560,60161,11200,10880,59969,60929,11968,12160,61249,11520,60865,60545,11328,58369,9408,9600,58689,9984,59329,59009,9792,8704,58049,58241,9024,57601,8640,8320,57409,40961,24768,24960,41281,25344,41921,41601,25152,26112,42689,42881,26432,42241,26048,25728,42049,27648,44225,44417,27968,44801,28608,28288,44609,43521,27328,27520,43841,26880,43457,43137,26688,30720,47297,47489,31040,47873,31680,31360,47681,48641,32448,32640,48961,32e3,48577,48257,31808,46081,29888,30080,46401,30464,47041,46721,30272,29184,45761,45953,29504,45313,29120,28800,45121,20480,37057,37249,20800,37633,21440,21120,37441,38401,22208,22400,38721,21760,38337,38017,21568,39937,23744,23936,40257,24320,40897,40577,24128,23040,39617,39809,23360,39169,22976,22656,38977,34817,18624,18816,35137,19200,35777,35457,19008,19968,36545,36737,20288,36097,19904,19584,35905,17408,33985,34177,17728,34561,18368,18048,34369,33281,17088,17280,33601,16640,33217,32897,16448];this.updateMusicCRC=function(e,t,a,s){for(var n=0;n>8^_[255&(i^r)]);var r,i}}function q(){var o=this,s=32773,c=null,h=null,r=null,u=null;this.setModules=function(e,t,a,s){c=e,h=t,r=a,u=s};var m=null,l=0,b=0,p=0;function v(e,t,a){for(;0>a<>a<>3]|=t>>a<<8-(7&s)-n,s+=n}e.header[e.h_ptr].ptr=s}function n(e,t){e<<=8;for(var a=0;a<8;a++)0!=(65536&((t<<=1)^(e<<=1)))&&(t^=s);return t}function d(e,t){var a,s=j.ht[t.count1table_select+32],n=0,r=t.big_values,i=t.big_values;for(a=(t.count1-t.big_values)/4;0t.big_values&&(a=t.big_values);var s=g(e,t.table_select[0],0,a,t);return s+=g(e,t.table_select[1],a,t.big_values,t)}function M(e,t){var a,s,n,r;a=t.big_values;var i=t.region0_count+1;return n=e.scalefac_band.l[i],i+=t.region1_count+1,a>8),t[5]=byte(255&a)},this.flush_bitstream=function(e){var t,a,s=e.internal_flags,n=s.h_ptr-1;if(-1==n&&(n=Z.MAX_HEADER_BUF-1),t=s.l3_side,!((a=R(e,new w))<0)){if(_(e,a),s.ResvSize=0,t.main_data_begin=0,s.findReplayGain){var r=c.GetTitleGain(s.rgdata);s.RadioGain=0|Math.floor(10*r+.5)}s.findPeakSample&&(s.noclipGainChange=0|Math.ceil(20*A(s.PeakSample/32767)*10),0 ResvSize"),8*t.main_data_begin!=a.ResvSize&&($.err.printf("bit reservoir error: \nl3_side.main_data_begin: %d \nResvoir size: %d \nresv drain (post) %d \nresv drain (pre) %d \nheader and sideinfo: %d \ndata bits: %d \ntotal bits: %d (remainder: %d) \nbitsperframe: %d \n",8*t.main_data_begin,a.ResvSize,t.resvDrain_post,t.resvDrain_pre,8*a.sideinfo_len,n-t.resvDrain_post-8*a.sideinfo_len,n,n%8,s),$.err.println("This is a fatal error. It has several possible causes:"),$.err.println("90%% LAME compiled with buggy version of gcc using advanced optimizations"),$.err.println(" 9%% Your system is overclocked"),$.err.println(" 1%% bug in LAME encoding library"),a.ResvSize=8*t.main_data_begin),1e9e.PeakSample?e.PeakSample=o[0][_]:-o[0][_]>e.PeakSample&&(e.PeakSample=-o[0][_]);if(1e.PeakSample?e.PeakSample=o[1][_]:-o[1][_]>e.PeakSample&&(e.PeakSample=-o[1][_])}if(e.findReplayGain&&c.AnalyzeSamples(e.rgdata,o[0],0,o[1],0,f,e.channels_out)==X.GAIN_ANALYSIS_ERROR)return-6}}return r},this.init_bit_stream_w=function(e){m=B(U.LAME_MAXMP3BUFFER),e.h_ptr=e.w_ptr=0,e.header[e.h_ptr].write_timing=0,b=-1,l=p=0}}function e(e,t,a,s){this.xlen=e,this.linmax=t,this.table=a,this.hlen=s}Ee.STEREO=new Ee(0),Ee.JOINT_STEREO=new Ee(1),Ee.DUAL_CHANNEL=new Ee(2),Ee.MONO=new Ee(3),Ee.NOT_SET=new Ee(4),X.STEPS_per_dB=100,X.MAX_dB=120,X.GAIN_NOT_ENOUGH_SAMPLES=-24601,X.GAIN_ANALYSIS_ERROR=0,X.GAIN_ANALYSIS_OK=1,X.INIT_GAIN_ANALYSIS_ERROR=0,X.INIT_GAIN_ANALYSIS_OK=1,X.MAX_ORDER=X.YULE_ORDER=10,X.MAX_SAMPLES_PER_WINDOW=(X.MAX_SAMP_FREQ=48e3)*(X.RMS_WINDOW_TIME_NUMERATOR=1)/(X.RMS_WINDOW_TIME_DENOMINATOR=20)+1,M.NUMTOCENTRIES=100,M.MAXFRAMESIZE=2880,q.EQ=function(e,t){return Math.abs(e)>Math.abs(t)?Math.abs(e-t)<=1e-6*Math.abs(e):Math.abs(e-t)<=1e-6*Math.abs(t)},q.NEQ=function(e,t){return!q.EQ(e,t)};var j={};function F(e){this.bits=e}function T(){this.over_noise=0,this.tot_noise=0,this.max_noise=0,this.over_count=0,this.over_SSD=0,this.bits=0}function r(e,t,a,s){this.l=Be(1+Pe.SBMAX_l),this.s=Be(1+Pe.SBMAX_s),this.psfb21=Be(1+Pe.PSFB21),this.psfb12=Be(1+Pe.PSFB12);var n=this.l,r=this.s;4==arguments.length&&(this.arrL=e,this.arrS=t,this.arr21=a,this.arr12=s,$.arraycopy(this.arrL,0,n,0,Math.min(this.arrL.length,this.l.length)),$.arraycopy(this.arrS,0,r,0,Math.min(this.arrS.length,this.s.length)),$.arraycopy(this.arr21,0,this.psfb21,0,Math.min(this.arr21.length,this.psfb21.length)),$.arraycopy(this.arr12,0,this.psfb12,0,Math.min(this.arr12.length,this.psfb12.length)))}function y(){var l=null,m=null,s=null;this.setModules=function(e,t,a){l=e,m=t,s=a},this.IPOW20=function(e){return u[e]};var x=2.220446049250313e-16,f=y.IXMAX_VAL+2,c=y.Q_MAX,h=y.Q_MAX2,n=100;this.nr_of_sfb_block=[[[6,5,5,5],[9,9,9,9],[6,9,9,9]],[[6,5,7,3],[9,9,12,6],[6,9,12,6]],[[11,10,0,0],[18,18,0,0],[15,18,0,0]],[[7,7,7,0],[12,12,12,0],[6,15,12,0]],[[6,6,6,3],[12,9,9,6],[6,12,9,6]],[[8,8,5,0],[15,12,9,0],[6,18,9,0]]];var w=[0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,3,3,3,2,0];this.pretab=w,this.sfBandIndex=[new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,24,32,42,56,74,100,132,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,114,136,162,194,232,278,332,394,464,540,576],[0,4,8,12,18,26,36,48,62,80,104,136,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,52,62,74,90,110,134,162,196,238,288,342,418,576],[0,4,8,12,16,22,30,40,52,66,84,106,136,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,42,50,60,72,88,106,128,156,190,230,276,330,384,576],[0,4,8,12,16,22,28,38,50,64,80,100,126,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,4,8,12,16,20,24,30,36,44,54,66,82,102,126,156,194,240,296,364,448,550,576],[0,4,8,12,16,22,30,42,58,78,104,138,180,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,6,12,18,24,30,36,44,54,66,80,96,116,140,168,200,238,284,336,396,464,522,576],[0,4,8,12,18,26,36,48,62,80,104,134,174,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0]),new r([0,12,24,36,48,60,72,88,108,132,160,192,232,280,336,400,476,566,568,570,572,574,576],[0,8,16,24,36,52,72,96,124,160,162,164,166,192],[0,0,0,0,0,0,0],[0,0,0,0,0,0,0])];var R=Ae(c+h+1),u=Ae(c),b=Ae(f),p=Ae(f);function v(e,t){var a=s.ATHformula(t,e);return a-=n,a=Math.pow(10,a/10+e.ATHlower)}function B(e){this.s=e}this.adj43=p,this.iteration_init=function(e){var t,a=e.internal_flags,s=a.l3_side;if(0==a.iteration_init_init){for(a.iteration_init_init=1,s.main_data_begin=0,function(e){for(var t=e.internal_flags.ATH.l,a=e.internal_flags.ATH.psfb21,s=e.internal_flags.ATH.s,n=e.internal_flags.ATH.psfb12,r=e.internal_flags,i=e.out_samplerate,_=0;_>2&63)&&(t-=64),n=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>8&63)&&(t-=64),r=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>14&63)&&(t-=64),i=Math.pow(10,t/4/10),32<=(t=e.exp_nspsytune>>20&63)&&(t-=64),_=i*Math.pow(10,t/4/10),t=0;t3*s/4&&(f[_]=3*s/4),f[_]<0&&(f[_]=0),f[_]+a[_]>Z.MAX_BITS_PER_CHANNEL&&(f[_]=Math.max(0,Z.MAX_BITS_PER_CHANNEL-a[_])),i+=f[_];if(hZ.MAX_BITS_PER_CHANNEL-e[0]&&(r=Z.MAX_BITS_PER_CHANNEL-e[0]),r<0&&(r=0),125<=e[1]&&(125>1,B=0;do{B+=k=f[_]*f[_],M+=k>1;S=d/p,M=x;do{var k,T;B+=k=f[_]*f[_],M+=ks[r-3+1]&&(s[r-3+1]+=(s[r-3]-s[r-3+1])*i.decay),s[r-3+1]>s[r-3+2]&&(s[r-3+2]+=(s[r-3+1]-s[r-3+2])*i.decay))}return o},this.calc_noise_core=function(e,t,a,s){var n=0,r=t.s,i=e.l3_enc;if(r>e.count1)for(;0!=a--;){o=e.xr[r],r++,n+=o*o,o=e.xr[r],r++,n+=o*o}else if(r>e.big_values){var _=Ae(2);for(_[0]=0,_[1]=s;0!=a--;){o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o,o=Math.abs(e.xr[r])-_[i[r]],r++,n+=o*o}}else for(;0!=a--;){var o;o=Math.abs(e.xr[r])-b[i[r]]*s,r++,n+=o*o,o=Math.abs(e.xr[r])-b[i[r]]*s,r++,n+=o*o}return t.s=r,n},this.calc_noise=function(e,t,a,s,n){var r,i,_=0,o=0,l=0,f=0,c=0,h=-20,u=0,m=e.scalefac,b=0;for(r=s.over_SSD=0;r>1,u+e.width[r]>e.max_nonzero_coeff)i=0<(g=e.max_nonzero_coeff-u+1)?g>>1:0;var M=new B(u);d=this.calc_noise_core(e,M,i,S),u=M.s,null!=n&&(n.step[r]=v,n.noise[r]=d),d=a[_++]=d/t[o++],d=ee.FAST_LOG10(Math.max(d,1e-20)),null!=n&&(n.noise_log[r]=d)}if(null!=n&&(n.global_gain=e.global_gain),c+=d,0a.max_noise-.2&&a.tot_noisea.max_noise-.2&&a.tot_noisea.max_noise-.1&&a.tot_noise+a.over_noisea.max_noise-.15&&a.tot_noise+a.over_noise+a.over_noiset.xrpow_max&&(t.xrpow_max=s[f+c]);if(2==i.noise_shaping_amp)return}}}(e,t,a,s,n);var i=_(t);return!i&&(!(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t))||(1e.xrpow_max&&(e.xrpow_max=t[a+i])}e.scalefac[s]=r>>1}e.preflag=0,e.scalefac_scale=1}(t,s),i=!1):t.block_type==Pe.SHORT_TYPE&&0>t.scalefac_scale))n[s]=f,o+=3*l;else{n[s]=0;var c=210+(f<t.xrpow_max&&(t.xrpow_max=a[o+h]);o+=l*(3-r-1)}}var u=M.IPOW20(202);for(o+=t.width[s]*(r+1),h=-t.width[s];h<0;h++)a[o+h]*=u,a[o+h]>t.xrpow_max&&(t.xrpow_max=a[o+h])}}return!1}(r,t,s)||_(t))),i||(i=2==r.mode_gr?w.scale_bitcount(t):w.scale_bitcount_lsf(r,t)),!i))}this.setModules=function(e,t,a,s){v=e,g=t,this.rv=t,M=a,this.qupvt=a,w=s,n.setModules(M,w)},this.ms_convert=function(e,t){for(var a=0;a<576;++a){var s=e.tt[t][0].xr[a],n=e.tt[t][1].xr[a];e.tt[t][0].xr[a]=(s+n)*(.5*ee.SQRT2),e.tt[t][1].xr[a]=(s-n)*(.5*ee.SQRT2)}},this.init_xrpow=function(e,t,a){var s=0,n=0|t.max_nonzero_coeff;if(t.xrpow_max=0,Te.fill(a,n,576,0),1e-20<(s=function(e,t,a,s){for(var n=s=0;n<=a;++n){var r=Math.abs(e.xr[n]);s+=r,t[n]=Math.sqrt(r*Math.sqrt(r)),t[n]>e.xrpow_max&&(e.xrpow_max=t[n])}return s}(t,a,n,s))){var r=0;0!=(2&e.substep_shaping)&&(r=1);for(var i=0;iS&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break;if(0==f.over_count){for(;(_.part2_3_length=w.count_bits(i,s,_,c))>h&&_.global_gain<=g;)_.global_gain++;if(_.global_gain>g)break}if(M.calc_noise(_,a,l,d,c),d.bits=_.part2_3_length,0!=(B(t.block_type!=Pe.SHORT_TYPE?e.quant_comp:e.quant_comp_short,f,d,_,l)?1:0))h=t.part2_3_length,f=d,t.assign(_),p=0,$.arraycopy(s,0,o,0,576);else if(0==i.full_outer_loop){if(++p>v&&0==f.over_count)break;if(3==i.noise_shaping_amp&&m&&30r[f.VBR_max_bitrate]&&(_[b][v]*=r[f.VBR_max_bitrate],_[b][v]/=u),i[b][v]>_[b][v]&&(i[b][v]=_[b][v]);return h},this.bitpressure_strategy=function(e,t,a,s){for(var n=0;nZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),m+=s[_][o]}if(Z.MAX_BITS_PER_GRANULEZ.MAX_BITS_PER_CHANNEL&&(s[_][o]=Z.MAX_BITS_PER_CHANNEL),l+=s[_][o];if(l>r[0])for(_=0;_=s?(e.ATH.adjust*=.075*s+.925,e.ATH.adjust=s?e.ATH.adjust=s:e.ATH.adjust>1,u=(h=(c=s)<<1)+c,s=h<<1,r=(n=t)+m;M=e[n+0]-e[n+c],S=e[n+0]+e[n+c],A=e[n+h]-e[n+u],R=e[n+h]+e[n+u],e[n+h]=S-R,e[n+0]=S+R,e[n+u]=M-A,e[n+c]=M+A,M=e[r+0]-e[r+c],S=e[r+0]+e[r+c],A=ee.SQRT2*e[r+u],R=ee.SQRT2*e[r+h],e[r+h]=S-R,e[r+0]=S+R,e[r+u]=M-A,e[r+c]=M+A,r+=s,(n+=s)<_;);for(l=T[i+0],o=T[i+1],f=1;fO[u+3-2]?Q/=O[u+3-2]:Q=O[u+3-2]>10*Q?O[u+3-2]/(10*Q):0,D[u+3]=Q}if(e.analysis){var W=D[0];for(u=1;u<12;u++)WV&&(q[u/3]=u%3+1);for(u=1;u<4;u++){(N[u-1]>N[u]?N[u-1]/N[u]:N[u]/N[u-1])<1.7&&(q[u]=0,1==u&&(q[0]=0))}for(0!=q[0]&&0!=S.nsPsy.lastAttacks[c]&&(q[0]=0),3!=S.nsPsy.lastAttacks[c]&&q[0]+q[1]+q[2]+q[3]==0||((C=0)!=q[1]&&0!=q[0]&&(q[1]=0),0!=q[2]&&0!=q[1]&&(q[2]=0),0!=q[3]&&0!=q[2]&&(q[3]=0)),c<2?T[c]=C:0==C&&(T[0]=T[1]=0),o[c]=S.tot_ener[c],he(e,j,F,M,1&c,w,1&c,s,c,t,a),Me(S,j,R,Y,X),we(S,Y,X,y),v=0;v<3;v++){var J,$;for(ve(e,F,B,A,c,v),be(S,B,A,c,v),p=0;p1.58*e.thm[1].l[t]||e.thm[1].l[t]>1.58*e.thm[0].l[t])){var a=e.mld_l[t]*e.en[3].l[t],s=Math.max(e.thm[2].l[t],Math.min(e.thm[3].l[t],a));a=e.mld_l[t]*e.en[2].l[t];var n=Math.max(e.thm[3].l[t],Math.min(e.thm[2].l[t],a));e.thm[2].l[t]=s,e.thm[3].l[t]=n}for(t=0;t1.58*e.thm[1].s[t][r]||e.thm[1].s[t][r]>1.58*e.thm[0].s[t][r]||(a=e.mld_s[t]*e.en[3].s[t][r],s=Math.max(e.thm[2].s[t][r],Math.min(e.thm[3].s[t][r],a)),a=e.mld_s[t]*e.en[2].s[t][r],n=Math.max(e.thm[3].s[t][r],Math.min(e.thm[2].s[t][r],a)),e.thm[2].s[t][r]=s,e.thm[3].s[t][r]=n)}(S),g=e.msfix,0g&&(s[o]=g),1a[o]&&(s[o]=a[o]),l.masking_lower<1&&(s[o]*=l.masking_lower)}for(;of&&(s[r]=f),1a[r]&&(s[r]=a[r]),e.masking_lower<1&&(s[r]*=e.masking_lower)}for(;rM[p+3-2]?E/=M[p+3-2]:E=M[p+3-2]>10*E?M[p+3-2]/(10*E):0,S[p+3]=E}for(p=0;p<3;++p){var P=M[3*p+3]+M[3*p+4]+M[3*p+5],H=1;6*M[3*p+5]A&&(o[m][p/3]=p%3+1);for(p=1;p<4;p++){var L=w[p-1],V=w[p];Math.max(L,V)<4e4&&L<1.7*V&&V<1.7*L&&(1==p&&o[m][0]<=o[m][p]&&(o[m][0]=0),o[m][p]=0)}o[m][0]<=c.nsPsy.lastAttacks[m]&&(o[m][0]=0),3!=c.nsPsy.lastAttacks[m]&&o[m][0]+o[m][1]+o[m][2]+o[m][3]==0||((k=0)!=o[m][1]&&0!=o[m][0]&&(o[m][1]=0),0!=o[m][2]&&0!=o[m][1]&&(o[m][2]=0),0!=o[m][3]&&0!=o[m][2]&&(o[m][3]=0)),m<2?l[m]=k:0==k&&(l[0]=l[1]=0),i[m]=c.tot_ener[m]}}(e,t,a,s,n,r,o,w,R,B),function(e,t){var a=e.internal_flags;e.short_blocks!=xe.short_block_coupled||0!=t[0]&&0!=t[1]||(t[0]=t[1]=0);for(var s=0;s=n&&(b=i*(l[t]-n)/(24-n)+r*(24-l[t])/(24-n)),c[t]=Math.pow(10,b/10),0=n&&(b=o*(l[t]-n)/(24-n)+_*(24-l[t])/(24-n)),c[t]=Math.pow(10,b/10),g=K.MAX_VALUE;for(v=0;va.npart_l-1&&(a.s3ind[M][1]=a.npart_l-1);var w=576*a.mode_gr/h;if(a.ATH.decay=Math.pow(10,-1.2*w),a.ATH.adjust=.01,-(a.ATH.adjustLimit=1)!=e.ATHtype){var R=e.out_samplerate/Pe.BLKSIZE,B=0;for(t=d=0;t=v)for(l=0;le.in_samplerate&&(e.lowpassfreq=e.in_samplerate/2),e.out_samplerate=(t=0|e.lowpassfreq,a=e.in_samplerate,s=44100,48e3<=a?s=48e3:44100<=a?s=44100:32e3<=a?s=32e3:24e3<=a?s=24e3:22050<=a?s=22050:16e3<=a?s=16e3:12e3<=a?s=12e3:11025<=a?s=11025:8e3<=a&&(s=8e3),-1==t?s:(t<=15960&&(s=44100),t<=15250&&(s=32e3),t<=11220&&(s=24e3),t<=9970&&(s=22050),t<=7230&&(s=16e3),t<=5420&&(s=12e3),t<=4510&&(s=11025),t<=3970&&(s=8e3),a=t.lowpass2&&(a=Math.min(a,r)),t.lowpass1t.highpass1?E((t.highpass2-l)/(t.highpass2-t.highpass1+1e-20)):1,o=t.lowpass2>t.lowpass1?E((l-t.lowpass1)/(t.lowpass2-t.lowpass1+1e-20)):1,t.amp_filter[r]=_*o}}(e),n.samplerate_index=P(e.out_samplerate,e),n.samplerate_index<0)return e.internal_flags=null,-1;if(e.VBR==ye.vbr_off){if(e.free_format)n.bitrate_index=0;else if(e.brate=H(e.brate,e.version,e.out_samplerate),n.bitrate_index=I(e.brate,e.version,e.out_samplerate),n.bitrate_index<=0)return e.internal_flags=null,-1}else n.bitrate_index=1;e.analysis&&(e.bWriteVbrTag=!1),null!=n.pinfo&&(e.bWriteVbrTag=!1),R.init_bit_stream_w(n);for(var c,h,u,m=n.samplerate_index+3*e.version+6*(e.out_samplerate<16e3?1:0),b=0;b=f){var M=i-u;if(0==i&&(M=0),(_=O(e,m[0],m[1],n,r,M))<0)return _;for(r+=_,u+=_,h.mf_size-=e.framesize,h.mf_samples_to_encode-=e.framesize,l=0;li&&(s.ResvMax=i),(s.ResvMax<0||e.disable_reservoir)&&(s.ResvMax=0);var _=t.bits*s.mode_gr+Math.min(s.ResvSize,s.ResvMax);return a<_&&(_=a),n.resvDrain_pre=0,null!=s.pinfo&&(s.pinfo.mean_bits=t.bits/2,s.pinfo.resvsize=s.ResvSize),_},this.ResvMaxBits=function(e,t,a,s){var n,r=e.internal_flags,i=r.ResvSize,_=r.ResvMax;0!=s&&(i+=t),0!=(1&r.substep_shaping)&&(_*=.9),a.bits=t,9*_<10*i?(n=i-9*_/10,a.bits+=n,r.substep_shaping|=128):(n=0,r.substep_shaping&=127,e.disable_reservoir||0!=(1&r.substep_shaping)||(a.bits-=.1*t));var o=i<6*r.ResvMax/10?i:6*r.ResvMax/10;return(o-=n)<0&&(o=0),o},this.ResvAdjust=function(e,t){e.ResvSize-=t.part2_3_length+t.part2_length},this.ResvFrameEnd=function(e,t){var a,s=e.l3_side;e.ResvSize+=t*e.mode_gr;var n=0;s.resvDrain_post=0,(s.resvDrain_pre=0)!=(a=e.ResvSize%8)&&(n+=a),0<(a=e.ResvSize-n-e.ResvMax)&&(n+=a);var r=Math.min(8*s.main_data_begin,n)/8;s.resvDrain_pre+=8*r,n-=8*r,e.ResvSize-=8*r,s.main_data_begin-=r,s.resvDrain_post+=n,e.ResvSize-=n}},m=new k,b=new function(){this.setModules=function(e,t,a){}},p=new function(){};n.setModules(r,i,_,o,l,f,c,h,p),i.setModules(r,p,c,f),h.setModules(i,c),_.setModules(n),l.setModules(i,u,o,m),o.setModules(m,u,n.enc.psy),u.setModules(i),m.setModules(o),f.setModules(n,i,c),a.setModules(b,p),b.setModules(c,h,_);var v=n.lame_init();v.num_channels=s,v.in_samplerate=e,v.out_samplerate=e,v.brate=t,v.mode=Ee.STEREO,v.quality=3,v.bWriteVbrTag=!1,v.disable_reservoir=!0,v.write_id3tag_automatic=!1,n.lame_init_params(v);var d=1152,g=0|1.25*d+7200,S=B(g);this.encodeBuffer=function(e,t){1==s&&(t=e),e.length>d&&(d=e.length,S=B(g=0|1.25*d+7200));var a=n.lame_encode_buffer(v,e,t,e.length,S,0,g);return new Int8Array(S.subarray(0,a))},this.flush=function(){var e=n.lame_encode_flush(v,S,0,g);return new Int8Array(S.subarray(0,e))}}}t(),Recorder.lamejs=t}(); \ No newline at end of file diff --git a/src/engine/mp3.js b/src/engine/mp3.js index eae3ce3..bf745a2 100644 --- a/src/engine/mp3.js +++ b/src/engine/mp3.js @@ -162,7 +162,9 @@ var newContext=function(setOrNull){ var url=(window.URL||webkitURL).createObjectURL(new Blob(["var wk_lame=(",lamejsCode,jsCode], {type:"text/javascript"})); worker=new Worker(url); - (window.URL||webkitURL).revokeObjectURL(url);//必须要释放,不然每次调用内存都明显泄露内存 + setTimeout(function(){ + (window.URL||webkitURL).revokeObjectURL(url);//必须要释放,不然每次调用内存都明显泄露内存 + },10000);//chrome 83 file协议下如果直接释放,将会使WebWorker无法启动 worker.onmessage=function(e){ var data=e.data;