Files
lifeRestart/public/libs/laya/min/laya.tbmini.min.js
Vick Scarlet 150c991648 Squashed commit of the following:
commit b421082374
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Dec 31 20:26:20 2021 +0800

    update specialthanks

commit 765a69294b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:10:03 2021 +0800

    fix ios goto

commit 8eb8c3ca72
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 19:03:37 2021 +0800

    add event grade

commit ab705dd46c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:48:42 2021 +0800

    build version

commit a1e4232369
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:47:05 2021 +0800

    change talent replace before property allocate

commit f4d7b3ae3c
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Dec 14 18:06:18 2021 +0800

    add event grade

commit 0567e40ddc
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 21:28:10 2021 +0800

    add particle

commit f17003925e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 20:14:26 2021 +0800

    change ui

commit f8beda1d8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 19:08:30 2021 +0800

    change popup message ui

commit 915a2aa17d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:34:29 2021 +0800

    new build

commit b5edabc104
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 18:18:46 2021 +0800

    add hint message

commit a143feadaf
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:57:31 2021 +0800

    fix copy bug

commit eab1975791
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 17:56:28 2021 +0800

    add save/load

commit acf9b92134
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Dec 2 14:35:33 2021 +0800

    add theme switch

commit 488a6054ab
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 18:30:36 2021 +0800

    fix uiManager bug

commit f0317eaf14
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Dec 1 16:07:03 2021 +0800

    add message popup

commit eb02d1ee6f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 21:22:54 2021 +0800

    change relocation

commit 60503eae47
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:27:16 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 52ef5909c1
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:26:31 2021 +0800

    change ScaleButton -> Laya.runtime.ScaleButton

commit 0284f6aa71
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 19:05:24 2021 +0800

    config webpack

commit 0e272ffd99
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 13:17:41 2021 +0800

    add thanks

commit e1e2ab4701
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 28 11:40:21 2021 +0800

    add light theme

commit 4f55c00f86
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 22:27:39 2021 +0800

    fix bug

commit 1d07bdfc46
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 27 21:48:47 2021 +0800

    daily update

commit 52d6a0ca8f
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 23:10:04 2021 +0800

    daily update

commit f8dd720d4d
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Wed Nov 24 19:08:13 2021 +0800

    daily update

commit d088c1a862
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 21 21:41:46 2021 +0800

    remove useless

commit a711fcf3ed
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 16 00:53:05 2021 +0800

    add achievement popup
    add page adaptive
    add talent extends

commit 05e02de3db
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 01:24:04 2021 +0800

    add github and discord

commit bff0109cc5
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sat Nov 13 00:30:01 2021 +0800

    add trajectory auto mode

commit 54c04f65c2
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:54:31 2021 +0800

    fix property judge negative number bug

commit 660739530b
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Fri Nov 12 19:48:58 2021 +0800

    update achievement

commit c94e9e7433
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Thu Nov 11 21:37:45 2021 +0800

    update daily

commit c06cd9ea62
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Tue Nov 9 00:08:05 2021 +0800

    update daily

commit 2666983f89
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 23:00:22 2021 +0800

    add uiManager auto scan and load skin resource

commit 22fa5d755a
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Nov 7 22:17:04 2021 +0800

    update framework

commit f40698d63e
Author: Vick Scarlet <scarlet_vick@outlook.com>
Date:   Sun Oct 31 00:13:22 2021 +0800

    add laya
2021-12-31 20:31:26 +08:00

1 line
25 KiB
JavaScript

!function(t,a){a.un,a.uns;var i=a.static,n=a.class,o=a.getset,d=(a.__newvec,laya.utils.Browser),e=a.Config,s=(laya.events.Event,laya.events.EventDispatcher),l=laya.resource.HTMLImage,f=laya.utils.Handler,r=laya.display.Input,h=laya.net.Loader,u=laya.net.LocalStorage,c=(laya.maths.Matrix,laya.renders.Render),v=laya.net.ResourceVersion,p=laya.utils.RunDriver,m=laya.media.SoundChannel,y=laya.media.SoundManager,_=laya.net.URL,g=laya.utils.Utils,w=(n(F,"laya.tb.mini.MiniFileMgr",null,"MiniFileMgr$10"),F.isLocalNativeFile=function(i){for(var e=0,t=x.nativefiles.length;e<t;e++)if(-1!=i.indexOf(x.nativefiles[e]))return!0;return!1},F.isSubNativeFile=function(i){for(var e=0,t=x.subNativeheads.length;e<t;e++)if(-1!=i.indexOf(x.subNativeheads[e]))return!0;return!1},F.getFileInfo=function(i){i=F.fakeObj[i];return null==i?null:i},F.read=function(i,e,t,n,o,a){void 0===e&&(e="utf8"),void 0===o&&(o=!1),void 0===a&&(a=""),i=""==(n=void 0===n?"":n)||-1==n.indexOf("http://")&&-1==n.indexOf("https://")?i:F.getFileNativePath(i),F.fs.readFile({filePath:i,encoding:e,success:function(i){null!=t&&t.runWith([0,i])},fail:function(i){i&&""!=n?F.downFiles(n,e,t,n,o,a):null!=t&&t.runWith([1])}})},F.downFiles=function(e,t,n,o,a,s,l){void 0===t&&(t="utf8"),void 0===o&&(o=""),void 0===a&&(a=!1),void 0===s&&(s=""),void 0===l&&(l=!0),F.wxdown({url:e,success:function(i){i.hasOwnProperty("statusCode")||(i.statusCode=200),200===i.statusCode?F.readFile(i.apFilePath,t,n,o,a,s,l):403===i.statusCode?null!=n&&n.runWith([0,e]):null!=n&&n.runWith([1,i])},fail:function(i){null!=n&&n.runWith([1,i])}}).onProgressUpdate(function(i){null!=n&&n.runWith([2,i.progress])})},F.readFile=function(e,t,n,o,a,i,s){void 0===o&&(o=""),void 0===a&&(a=!1),void 0===i&&(i=""),void 0===s&&(s=!0),F.fs.readFile({filePath:e,encoding:t=void 0===t?"utf8":t,success:function(i){(-1!=e.indexOf("http://")||-1!=e.indexOf("https://"))&&a?(null!=n&&n.runWith([0,i]),F.copyFile(e,o,null,t,s)):null!=n&&n.runWith([0,i])},fail:function(i){i&&null!=n&&n.runWith([1,i])}})},F.downOtherFiles=function(i,e,t,n,o){void 0===t&&(t=""),void 0===n&&(n=!1),void 0===o&&(o=!0),F.wxdown({url:i,success:function(i){i.hasOwnProperty("statusCode")||(i.statusCode=200),200===i.statusCode?n&&-1==t.indexOf(".php")?(null!=e&&e.runWith([0,i.apFilePath]),F.copyFile(i.apFilePath,t,null,"",o)):null!=e&&e.runWith([0,i.apFilePath]):null!=e&&e.runWith([1,i])},fail:function(i){null!=e&&e.runWith([1,i])}})},F.downLoadFile=function(i,e,t,n,o){void 0===e&&(e=""),void 0===n&&(n="utf8"),void 0===o&&(o=!1),d.window.hasOwnProperty("my")?a.loader.load(i,t):"image"==e||"sound"==e?F.downOtherFiles(i,t,i,o,!1):F.downFiles(i,n,t,i,!0,e,o)},F.copyFile=function(t,n,o,a,s){void 0===a&&(a=""),void 0===s&&(s=!0);var i=t.split("/"),l=i[i.length-1],i=F.getFileInfo(n),r=F.getFileNativePath(l);F.fakeObj[n]={md5:l,readyUrl:n,size:0,times:d.now(),encoding:a};var u=F.getCacheUseSize();i?i.readyUrl!=n?F.fs.getFileInfo({filePath:t,success:function(i){s&&52428800<=u+4194304+i.size&&(i.size>x.minClearSize&&(x.minClearSize=i.size),F.onClearCacheRes()),F.deleteFile(t,n,o,a,i.size)},fail:function(i){null!=o&&o.runWith([1,i])}}):null!=o&&o.runWith([0]):F.fs.getFileInfo({filePath:t,success:function(e){s&&52428800<=u+4194304+e.size&&(e.size>x.minClearSize&&(x.minClearSize=e.size),F.onClearCacheRes()),F.fs.copyFile({srcPath:t,destPath:r,success:function(i){F.onSaveFile(n,l,!0,a,o,e.size)},fail:function(i){null!=o&&o.runWith([1,i])}})},fail:function(i){null!=o&&o.runWith([1,i])}})},F.onClearCacheRes=function(){var i,e=x.minClearSize,t=[];for(i in F.filesListObj)"fileUsedSize"!=i&&t.push(F.filesListObj[i]);F.sortOn(t,"times",16);for(var n=0,o=1,a=t.length;o<a;o++){var s=t[o];if(e<=n)break;n+=s.size,F.deleteFile("",s.readyUrl)}},F.sortOn=function(i,t,e){return 16==(e=void 0===e?0:e)?i.sort(function(i,e){return i[t]-e[t]}):18==e?i.sort(function(i,e){return e[t]-i[t]}):i.sort(function(i,e){return i[t]-e[t]})},F.getFileNativePath=function(i){return laya.tb.mini.MiniFileMgr.fileNativeDir+"/"+i},F.deleteFile=function(n,o,a,s,l){void 0===s&&(s=""),void 0===l&&(l=0);var i=F.getFileInfo(o=void 0===o?"":o),i=F.getFileNativePath(i.md5);F.fs.unlink({filePath:i,success:function(i){var e,t=""!=n;""!=n?(e=F.getFileNativePath(n),F.fs.copyFile({srcPath:n,destPath:e,success:function(i){F.onSaveFile(o,n,t,s,a,i.size)},fail:function(i){null!=a&&a.runWith([1,i])}})):F.onSaveFile(o,n,t,s,a,l)},fail:function(i){}})},F.deleteAll=function(){var i,e=[];for(i in F.filesListObj)"fileUsedSize"!=i&&e.push(F.filesListObj[i]);for(var t=1,n=e.length;t<n;t++){var o=e[t];F.deleteFile("",o.readyUrl)}laya.tb.mini.MiniFileMgr.filesListObj&&laya.tb.mini.MiniFileMgr.filesListObj.fileUsedSize&&(laya.tb.mini.MiniFileMgr.filesListObj.fileUsedSize=0),laya.tb.mini.MiniFileMgr.writeFilesList("",JSON.stringify({}),!1)},F.onSaveFile=function(i,e,t,n,o,a){void 0===t&&(t=!0),void 0===n&&(n=""),void 0===a&&(a=0);var s=i;null==F.filesListObj.fileUsedSize&&(F.filesListObj.fileUsedSize=0),t?(F.getFileNativePath(e),F.filesListObj[s]={md5:e,readyUrl:i,size:a,times:d.now(),encoding:n},F.filesListObj.fileUsedSize=parseInt(F.filesListObj.fileUsedSize)+a,F.writeFilesList(s,JSON.stringify(F.filesListObj),!0),null!=o&&o.runWith([0])):F.filesListObj[s]&&(a=parseInt(F.filesListObj[s].size),F.filesListObj.fileUsedSize=parseInt(F.filesListObj.fileUsedSize)-a,F.filesListObj[s].md5==F.fakeObj[s].md5&&delete F.fakeObj[s],delete F.filesListObj[s],F.writeFilesList(s,JSON.stringify(F.filesListObj),!1),null!=o&&o.runWith([0]))},F.writeFilesList=function(i,e,t){F.fs.writeFile({filePath:F.fileNativeDir+"/"+F.fileListName,encoding:"utf8",data:e,success:function(i){},fail:function(i){}}),!x.isZiYu&&x.isPosMsgYu&&x.window.my.postMessage&&x.window.my.postMessage({url:i,data:F.filesListObj[i],isLoad:"filenative",isAdd:t})},F.getCacheUseSize=function(){return F.filesListObj&&F.filesListObj.fileUsedSize?F.filesListObj.fileUsedSize:0},F.existDir=function(i,e){F.fs.mkdir({dirPath:i,success:function(i){null!=e&&e.runWith([0,{data:JSON.stringify({})}])},fail:function(i){10025==i.error?F.readSync(F.fileListName,"utf8",e):null!=e&&e.runWith([1,i])}})},F.readSync=function(i,e,t,n){void 0===e&&(e="utf8"),void 0===n&&(n="");var o,i=F.getFileNativePath(i);try{F.fs.readFile({filePath:i,encoding:e,success:function(i){o=i.data,null!=t&&t.runWith([0,{data:o}])},fail:function(){null!=t&&t.runWith([1])}})}catch(i){null!=t&&t.runWith([1])}},F.setNativeFileDir=function(i){F.fileNativeDir=x.window.my.env.USER_DATA_PATH+i},F.filesListObj={},F.fakeObj={},F.fileNativeDir=null,F.fileListName="layaairfiles.txt",F.ziyuFileData={},F.ziyuFileTextureData={},F.loadPath="",F.DESCENDING=2,F.NUMERIC=16,i(F,["fs",function(){return this.fs=x.window.my.getFileSystemManager()},"wxdown",function(){return this.wxdown=x.window.my.downloadFile}]),F);function F(){}var C=(n(E,"laya.tb.mini.MiniImage",null,"MiniImage$10"),E.prototype._loadImage=function(i){var e,t;i=_.formatURL(i),w.isLocalNativeFile(i)||-1==i.indexOf("http://")&&-1==i.indexOf("https://")?-1!=i.indexOf(x.window.my.env.USER_DATA_PATH)?E.onCreateImage(i,this,!1,i):(i=""!=w.loadPath?i.split(w.loadPath)[1]:(t=i,(i=""!=(e=""!=_.rootPath?_.rootPath:_.basePath)?i.split(e)[1]:i)||t),E.onCreateImage(i,this,!0)):E.onCreateImage(i,this,!1,encodeURI(i))},E.onCreateImage=function(e,t,i,n){var o,a;function s(){a.onload=null,a.onerror=null,delete t.imgCache[e]}void 0===n&&(n=""),o=(i=void 0===i?!1:i)?w.isSubNativeFile(e)?e:x.baseDir+e:""!=n?n:e,null==t.imgCache&&(t.imgCache={});i=function(){s(),t.onLoaded(a)},n=function(){s(),delete w.filesListObj[e],delete w.fakeObj[e],t.event("error","Load image failed")};"nativeimage"==t._type?((a=new d.window.Image).crossOrigin="",a.onload=i,a.onerror=n,a.src=o,t.imgCache[e]=a):new l.create(o,{onload:i,onerror:n,onCreate:function(i){a=i,t.imgCache[e]=i}})},E);function E(){}var b=(n(S,"laya.tb.mini.MiniInput",null,"MiniInput$10"),S._createInputElement=function(){r._initInput(r.area=d.createElement("textarea")),r._initInput(r.input=d.createElement("input")),r.inputContainer=d.createElement("div"),r.inputContainer.style.position="absolute",r.inputContainer.style.zIndex=1e5,d.container.appendChild(r.inputContainer),r.inputContainer.setPos=function(i,e){r.inputContainer.style.left=i+"px",r.inputContainer.style.top=e+"px"},y._soundClass=D,y._musicClass=D;var i=x.systemInfo.model,e=x.systemInfo.system;-1!=i.indexOf("iPhone")&&(d.onIPhone=!0,d.onIOS=!0,d.onIPad=!0,d.onAndroid=!1),-1==e.indexOf("Android")&&-1==e.indexOf("Adr")||(d.onAndroid=!0,d.onIPhone=!1,d.onIOS=!1,d.onIPad=!1)},S._onStageResize=function(){a.stage._canvasTransform.identity().scale(d.width/c.canvas.width/p.getPixelRatio(),d.height/c.canvas.height/p.getPixelRatio())},S.wxinputFocus=function(i){},S.inputEnter=function(i){},S.wxinputblur=function(){},S.hideKeyboard=function(){},S);function S(){}var L=(n(O,"laya.tb.mini.MiniLocalStorage",null,"MiniLocalStorage$9"),O.__init__=function(){O.items=O},O.setItem=function(e,t){try{x.window.my.setStorageSync({key:e,data:t})}catch(i){x.window.my.setStorage({key:e,data:t})}},O.getItem=function(i){i=x.window.my.getStorageSync({key:i});return i.success?i.data:null},O.setJSON=function(i,e){O.setItem(i,e)},O.getJSON=function(i){return O.getItem(i)},O.removeItem=function(i){x.window.my.removeStorageSync(i)},O.clear=function(){x.window.my.clearStorageSync()},O.getStorageInfoSync=function(){try{var i=x.window.my.getStorageInfoSync();return console.log(i.keys),console.log(i.currentSize),console.log(i.limitSize),i}catch(i){}return null},O.support=!0,O.items=null,O);function O(){}n(P,"laya.tb.mini.MiniLocation",null,"MiniLocation$10"),P.__init__=function(){x.window.navigator.geolocation.getCurrentPosition=P.getCurrentPosition,x.window.navigator.geolocation.watchPosition=P.watchPosition,x.window.navigator.geolocation.clearWatch=P.clearWatch},P.getCurrentPosition=function(e,i,t){var n;(n={success:function(i){null!=e&&e(i)}}).fail=i,x.window.my.getLocation(n)},P.watchPosition=function(i,e,t){var n;return P._curID++,(n={}).success=i,n.error=e,P._watchDic[P._curID]=n,a.timer.loop(1e3,null,P._myLoop),P._curID},P.clearWatch=function(i){delete P._watchDic[i],P._hasWatch()||a.timer.clear(null,P._myLoop)},P._hasWatch=function(){for(var i in P._watchDic)if(P._watchDic[i])return!0;return!1},P._myLoop=function(){P.getCurrentPosition(P._mySuccess,P._myError)},P._mySuccess=function(i){var e,t={};for(e in t.coords=i,t.timestamp=d.now(),P._watchDic)P._watchDic[e].success&&P._watchDic[e].success(t)},P._myError=function(i){for(var e in P._watchDic)P._watchDic[e].error&&P._watchDic[e].error(i)},P._watchDic={},P._curID=0;function P(){}!function(){function i(i,e){this.videoend=!1,this.videourl="",this.videoElement=null,this.onPlayFunc=null,this.onEndedFunC=null,this._duration=NaN,this.position=NaN,this.videoElement=x.window.my.createVideo({width:i=void 0===i?320:i,height:e=void 0===e?240:e,autoplay:!0})}n(i,"laya.tb.mini.MiniVideo",null,"MiniVideo$8");var e=i.prototype;e.on=function(i,e,t){"loadedmetadata"==i?(this.onPlayFunc=t.bind(e),this.videoElement.onPlay=this.onPlayFunction.bind(this)):"ended"==i&&(this.onEndedFunC=t.bind(e),this.videoElement.onEnded=this.onEndedFunction.bind(this)),this.videoElement.onTimeUpdate=this.onTimeUpdateFunc.bind(this)},e.onTimeUpdateFunc=function(i){this.position=i.position,this._duration=i.duration},e.onPlayFunction=function(){this.videoElement&&(this.videoElement.readyState=200),console.log("=====视频加载完成========"),null!=this.onPlayFunc&&this.onPlayFunc()},e.onEndedFunction=function(){this.videoElement&&(this.videoend=!0,console.log("=====视频播放完毕========"),null!=this.onEndedFunC&&this.onEndedFunC())},e.off=function(i,e,t){"loadedmetadata"==i?(this.onPlayFunc=t.bind(e),this.videoElement.offPlay=this.onPlayFunction.bind(this)):"ended"==i&&(this.onEndedFunC=t.bind(e),this.videoElement.offEnded=this.onEndedFunction.bind(this))},e.load=function(i){this.videoElement&&(this.videoElement.src=i)},e.play=function(){this.videoElement&&(this.videoend=!1,this.videoElement.play())},e.pause=function(){this.videoElement&&(this.videoend=!0,this.videoElement.pause())},e.size=function(i,e){this.videoElement&&(this.videoElement.width=i,this.videoElement.height=e)},e.destroy=function(){this.videoElement&&this.videoElement.destroy(),this.videoElement=null,this.onEndedFunC=null,this.onPlayFunc=null,this.videoend=!1,this.videourl=null},e.reload=function(){this.videoElement&&(this.videoElement.src=this.videourl)},o(0,e,"duration",function(){return this._duration}),o(0,e,"paused",function(){return!!this.videoElement&&this.videoElement.paused}),o(0,e,"loop",function(){return!!this.videoElement&&this.videoElement.loop},function(i){this.videoElement&&(this.videoElement.loop=i)}),o(0,e,"currentTime",function(){return this.videoElement?this.videoElement.initialTime:0},function(i){this.videoElement&&(this.videoElement.initialTime=i)}),o(0,e,"ended",function(){return this.videoend}),o(0,e,"muted",function(){return!!this.videoElement&&this.videoElement.muted},function(i){this.videoElement&&(this.videoElement.muted=i)}),o(0,e,"videoWidth",function(){return this.videoElement?this.videoElement.width:0}),o(0,e,"videoHeight",function(){return this.videoElement?this.videoElement.height:0}),o(0,e,"playbackRate",function(){return this.videoElement?this.videoElement.playbackRate:0},function(i){this.videoElement&&(this.videoElement.playbackRate=i)}),o(0,e,"x",function(){return this.videoElement?this.videoElement.x:0},function(i){this.videoElement&&(this.videoElement.x=i)}),o(0,e,"y",function(){return this.videoElement?this.videoElement.y:0},function(i){this.videoElement&&(this.videoElement.y=i)}),o(0,e,"currentSrc",function(){return this.videoElement.src}),i.__init__=function(){laya.device.media.Video=i}}();var x=(n(N,"laya.tb.mini.TBMiniAdapter"),N.getJson=function(i){return JSON.parse(i)},N.init=function(){var i;N._inited||(N._inited=!0,(-1<(i=(N.window=t).navigator.userAgent).indexOf("TB")||-1<i.indexOf("Taobao")||-1<i.indexOf("TM/"))&&(N.EnvConfig={},w.setNativeFileDir("/layaairGame"),w.existDir(w.fileNativeDir,f.create(N,N.onMkdirCallBack)),N.systemInfo=N.window.my.getSystemInfoSync(),N.window.focus=function(){},a._getUrlPath=function(){},a.getUrlPath=function(){},N.window.logtime=function(i){},N.window.alertTimeLog=function(i){},N.window.resetShareInfo=function(){},N._preCreateElement=d.createElement,d.createElement=N.createElement,N.window.CanvasRenderingContext2D=function(){},N.window.CanvasRenderingContext2D.prototype=N._preCreateElement("canvas").getContext("2d").__proto__,N.window.document.body.appendChild=function(){},p.createShaderCondition=N.createShaderCondition,g.parseXMLFromString=N.parseXMLFromString,r._createInputElement=b._createInputElement,N.EnvConfig.load=h.prototype.load,h.prototype.load=I.prototype.load,h.prototype._loadImage=C.prototype._loadImage,(u._baseClass=L).__init__(),e.useRetinalCanvas=!0))},N.measureText=function(i){i=N._measureText(i);return i||(i={width:16},console.warn("-------微信获取文字宽度失败----等待修复---------")),i},N.getUrlEncode=function(i,e){return"arraybuffer"==e?"":"utf8"},N.downLoadFile=function(i,e,t,n){void 0===e&&(e=""),void 0===n&&(n="utf8"),w.getFileInfo(i)?null!=t&&t.runWith([0]):w.downLoadFile(i,e,t,n)},N.remove=function(i,e){w.deleteFile("",i,e,"",0)},N.removeAll=function(){w.deleteAll()},N.hasNativeFile=function(i){return w.isLocalNativeFile(i)},N.getFileInfo=function(i){return w.getFileInfo(i)},N.getFileList=function(){return w.filesListObj},N.exitMiniProgram=function(){N.window.my.exitMiniProgram()},N.onMkdirCallBack=function(i,e){i||(w.filesListObj=JSON.parse(e.data),w.fakeObj=JSON.parse(e.data))},N.pixelRatio=function(){if(!N.EnvConfig.pixelRatioInt)try{return N.EnvConfig.pixelRatioInt=N.systemInfo.pixelRatio,N.systemInfo.pixelRatio}catch(i){}return N.EnvConfig.pixelRatioInt},N.createElement=function(i){if("canvas"==i){var e=1==N.idx?N.window.canvas.getRealCanvas():N._preCreateElement(i);return e.style||(e.style={}),N.idx++,e}if("textarea"==i||"input"==i)return N.onCreateInput(i);if("div"!=i)return N._preCreateElement(i);i=N._preCreateElement(i);return i.contains=function(i){return null},i.removeChild=function(i){},i},N.onCreateInput=function(i){i=N._preCreateElement(i);return i.focus=b.wxinputFocus,i.blur=b.wxinputblur,i.value=0,i.placeholder={},i.type={},i.setColor=function(i){},i.setType=function(i){},i.setFontFace=function(i){},i.contains=function(i){return null},i},N.createShaderCondition=function(i){var e=this;return function(){return e[i.replace("this.","")]}},N.EnvConfig=null,N.window=null,N._preCreateElement=null,N._inited=!1,N.systemInfo=null,N.isPosMsgYu=!1,N.autoCacheFile=!0,N.minClearSize=5242880,N.subNativeFiles={},N.subNativeheads=[],N.subMaps=[],N.AutoCacheDownFile=!1,N.baseDir="pages/index/",N._measureText=null,N.parseXMLFromString=function(i){var e;i=i.replace(/>\s+</g,"><");try{e=(new t.Parser.DOMParser).parseFromString(i,"text/xml")}catch(i){throw"需要引入xml解析库文件"}return e},N.idx=1,i(N,["nativefiles",function(){return this.nativefiles=["layaNativeDir"]}]),N);function N(){}!function(o){function a(){a.__super.call(this)}n(a,"laya.tb.mini.MiniAccelerator",o,"MiniAccelerator$10");var i=a.prototype;i.on=function(i,e,t,n){return o.prototype.on.call(this,i,e,t,n),a.startListen(this.onDeviceOrientationChange),this},i.off=function(i,e,t,n){return void 0===n&&(n=!1),this.hasListener(i)||a.stopListen(),o.prototype.off.call(this,i,e,t,n)},a.__init__=function(){try{var i=laya.device.motion.Accelerator;if(!i)return;i.prototype.on=a.prototype.on,i.prototype.off=a.prototype.off}catch(i){}},a.startListen=function(i){if(a._callBack=i,!a._isListening){a._isListening=!0;try{x.window.my.onAccelerometerChange(laya.tb.mini.MiniAccelerator.onAccelerometerChange)}catch(i){}}},a.stopListen=function(){a._isListening=!1;try{x.window.my.stopAccelerometer({})}catch(i){}},a.onAccelerometerChange=function(i){var e={};e.acceleration=i,e.accelerationIncludingGravity=i,e.rotationRate={},null!=a._callBack&&a._callBack(e)},a._isListening=!1,a._callBack=null}(s);var I=(n(M,"laya.tb.mini.MiniLoader",s,"MiniLoader$10"),M.prototype.load=function(i,e,t,n,o){void 0===t&&(t=!0),void 0===o&&(o=!1);var a=this;if(0===(a._url=i).indexOf("data:image")?a._type=e="image":a._type=e=e||a.getTypeFromUrl(i),a._cache=t,a._data=null,!o&&h.loadedMap[_.formatURL(i)])return a._data=h.loadedMap[_.formatURL(i)],this.event("progress",1),void this.event("complete",a._data);if(null!=h.parserMap[e])return a._customParse=!0,void(h.parserMap[e]instanceof laya.utils.Handler?h.parserMap[e].runWith(this):h.parserMap[e].call(null,this));if(w.isLocalNativeFile(i)&&!w.getFileInfo(i)){if(x.subNativeFiles&&0==x.subNativeheads.length)for(var s in x.subNativeFiles){var l=x.subNativeFiles[s];x.subNativeheads=x.subNativeheads.concat(l);for(var r=0;r<l.length;r++)x.subMaps[l[r]]=s+"/"+l[r]}!x.subNativeFiles||-1==i.indexOf("/")||(d=i.split("/")[0]+"/")&&-1!=x.subNativeheads.indexOf(d)&&(c=x.subMaps[d],i=i.replace(d,c))}var u,d=x.getUrlEncode(i,e),c=g.getFileExtension(i);-1!=M._fileTypeArr.indexOf(c)||"image"==e?x.EnvConfig.load.call(this,i,e,t,n,o):w.getFileInfo(i)?((u=w.getFileInfo(_.formatURL(i))).encoding=null==u.encoding?"utf8":u.encoding,c=w.getFileNativePath(u.md5),w.readFile(c,u.encoding,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a]),i)):w.isLocalNativeFile(i)?w.isSubNativeFile(i)?w.readFile(v.addVersionPrefix(i),d,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a])):w.readFile(x.baseDir+v.addVersionPrefix(i),d,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a])):(_.formatURL(i),(u=w.getFileInfo(i))?(u.encoding=null==u.encoding?"utf8":u.encoding,w.readFile(u.url,d,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a]),i)):(i=_.formatURL(i),"image"!=e&&-1==i.indexOf("http://")&&-1==i.indexOf("https://")?w.readFile(x.baseDir+i,d,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a]),i):w.downFiles(encodeURI(i),d,new f(M,M.onReadNativeCallBack,[d,i,e,t,n,o,a]),i,x.AutoCacheDownFile)))},M.onReadNativeCallBack=function(i,e,t,n,o,a,s,l,r){void 0===n&&(n=!0),void 0===a&&(a=!1),(l=void 0===l?0:l)?1==l&&s.onError&&s.onError(r):(r="json"==t||"atlas"==t?x.getJson(r.data):"xml"==t?g.parseXMLFromString(r.data):r.data,s.onLoaded(r))},i(M,["_fileTypeArr",function(){return this._fileTypeArr=["png","jpg","bmp","jpeg","gif"]}]),M);function M(){M.__super.call(this)}var D=function(){function i(){this._sound=null,this.url=null,this.loaded=!1,this.readyUrl=null,i.__super.call(this),this._sound=i._createSound()}n(i,"laya.tb.mini.MiniSound",s,"MiniSound$10");var e=i.prototype;return e.load=function(i){if(w.isLocalNativeFile(i)?-1==i.indexOf("http://")&&-1==i.indexOf("https://")||(""!=w.loadPath?i=i.split(w.loadPath)[1]:""!=(e=""!=_.rootPath?_.rootPath:_.basePath)&&(i=i.split(e)[1])):i=_.formatURL(i),this.url=i,this.readyUrl=i,x.autoCacheFile&&w.getFileInfo(i))this.onDownLoadCallBack(i,0);else if(x.autoCacheFile)if(w.isLocalNativeFile(i)){var e,t=i;if(i=(i=""!=(e=""!=_.rootPath?_.rootPath:_.basePath)?i.split(e)[1]:i)||t,x.subNativeFiles&&0==x.subNativeheads.length)for(var n in x.subNativeFiles){var o=x.subNativeFiles[n];x.subNativeheads=x.subNativeheads.concat(o);for(var a=0;a<o.length;a++)x.subMaps[o[a]]=n+"/"+o[a]}!x.subNativeFiles||-1==i.indexOf("/")||(e=i.split("/")[0]+"/")&&-1!=x.subNativeheads.indexOf(e)&&(t=x.subMaps[e],i=i.replace(e,t)),this.onDownLoadCallBack(i,0)}else-1==i.indexOf("http://")&&-1==i.indexOf("https://")||-1!=i.indexOf(x.window.my.env.USER_DATA_PATH)?this.onDownLoadCallBack(i,0):w.downOtherFiles(i,f.create(this,this.onDownLoadCallBack,[i]),i,x.autoCacheFile);else this.onDownLoadCallBack(i,0)},e.onDownLoadCallBack=function(i,e,t){var n,o;void 0===t&&(t=""),!e&&this._sound?x.autoCacheFile?(""==t?w.isLocalNativeFile(i)?(n=i,""==(e=""!=_.rootPath?_.rootPath:_._basePath)||-1==i.indexOf("http://")&&-1==i.indexOf("https://")||(o=i.split(e)[1]),w.isSubNativeFile(o=o||n)||(o=x.baseDir+o)):o=(n=w.getFileInfo(i))&&n.md5?(n=n.md5,w.getFileNativePath(n)):-1==i.indexOf("http://")&&-1==i.indexOf("https://")&&-1==i.indexOf(x.window.my.env.USER_DATA_PATH)?x.baseDir+i:i:o=t,this._sound.src=this.url=o):((w.isLocalNativeFile(i)&&!w.isSubNativeFile(i)||-1==i.indexOf("http://")&&-1==i.indexOf("https://")&&-1==i.indexOf(x.window.my.env.USER_DATA_PATH))&&(i=x.baseDir+i),this._sound.src=i):this.event("error")},e.play=function(i,e){if(void 0===i&&(i=0),void 0===e&&(e=0),!this.url)return null;var t=new U(this);return t.url=this.url,t.loops=e,t.loop=0===e,t.startTime=i,t.isStopped=!1,y.addChannel(t),t},e.dispose=function(){this._sound&&(this._sound.src="",i._audioCache.push(this._sound),this._sound=null,this.readyUrl=this.url=null)},o(0,e,"duration",function(){return this._sound.duration}),i._createSound=function(){return i._audioCache.length?i._audioCache.pop():(i._id++,x.window.my.createInnerAudioContext())},i._id=0,i._audioCache=[],i}(),U=function(i){function e(i){this._audio=null,this._onEnd=null,this._onCanplay=null,this._onError=null,this._miniSound=null,e.__super.call(this),this._audio=i._sound,this._miniSound=i,this._onEnd=e.bindToThis(this.__onEnd,this),this._onCanplay=e.bindToThis(this.onCanPlay,this),this._onError=e.bindToThis(this.onError,this),this.addEventListener()}n(e,"laya.tb.mini.MiniSoundChannel",i,"MiniSoundChannel$10");var t=e.prototype;return t.addEventListener=function(){this._audio.onError(this._onError),this._audio.onCanplay(this._onCanplay)},t.offEventListener=function(){this._audio.offError(this._onError),this._audio.offCanplay(this._onCanplay),this._audio.offEnded(this._onEnd)},t.onError=function(i){console.log("-----1---------------minisound-----url:",this.url),console.log(i),this.event("error"),this._audio&&(this._miniSound.dispose(),this.offEventListener(),this._audio=this._miniSound=null)},t.onCanPlay=function(){this._audio&&(this.event("complete"),this.offEventListener(),this._audio.onEnded(this._onEnd),this.isStopped?this.stop():this.play())},t.__onEnd=function(){if(1==this.loops)return this.completeHandler&&(a.timer.once(10,this,this.__runComplete,[this.completeHandler],!1),this.completeHandler=null),this.stop(),void this.event("complete");0<this.loops&&this.loops--,this.startTime=0,this.play()},t.play=function(){this.isStopped=!1,y.addChannel(this),this._audio&&this._audio.play()},t.stop=function(){i.prototype.stop.call(this),this.isStopped=!0,y.removeChannel(this),this.completeHandler=null,this._audio&&(this._audio.stop(),this.loop||(this.offEventListener(),this._miniSound.dispose(),this._miniSound=null,this._audio=null))},t.pause=function(){this.isStopped=!0,this._audio&&this._audio.pause()},t.resume=function(){this._audio&&(this.isStopped=!1,y.addChannel(this),this._audio.play())},o(0,t,"startTime",function(){return this._audio?this._audio.startTime:0},function(i){this._audio&&(this._audio.startTime=i)}),o(0,t,"autoplay",function(){return!!this._audio&&this._audio.autoplay},function(i){this._audio&&(this._audio.autoplay=i)}),o(0,t,"duration",function(){return this._audio?this._audio.duration:0}),o(0,t,"position",function(){return this._audio?this._audio.currentTime:0}),o(0,t,"loop",function(){return!!this._audio&&this._audio.loop},function(i){this._audio&&(this._audio.loop=i)}),o(0,t,"volume",function(){return this._audio?this._audio.volume:1},function(i){this._audio&&(this._audio.volume=i)}),e.bindToThis=function(i,e){return i.bind(e)},e}(m)}(window,(document,Laya)),"function"==typeof define&&define.amd&&define("laya.core",["require","exports"],function(i,e){"use strict";for(var t in Object.defineProperty(e,"__esModule",{value:!0}),Laya){var n=Laya[t];n&&n.__isclass&&(e[t]=n)}});