{
  "code": "import { ui } from \"../ui/layaMaxUI\";\r\nimport { GameUtils } from \"../GameUtils/GameUtils\";\r\nimport { PlayerAccount } from \"../Scripts/Network/PlayerAccount\";\r\nimport ADPlayer from \"../WXSDK/ADPlayer\";\r\nimport { GameManager, GameState } from \"../Scripts/Game/GameManager\";\r\nimport { Player } from \"../Scripts/Game/Player\";\r\nexport class TrialWindow extends ui.Window.TrialWindowUI {\r\n    constructor() {\r\n        super();\r\n        TrialWindow.instance = this;\r\n    }\r\n    static get Instance() {\r\n        return TrialWindow.instance;\r\n    }\r\n    OnOpen(_data = null) {\r\n        this.hidebtn.clickHandler = Laya.Handler.create(this, this.OnTrialHide, null, false);\r\n        var trialid = [2, 3, 4, 5, 6, 8, 9, 10, 11];\r\n        var curids = [];\r\n        for (var i = 0; i < trialid.length; i++) {\r\n            var id = trialid[i];\r\n            if (!PlayerAccount.CurrentAccount.CurAccountData.HasHero(id)) {\r\n                curids.push(id);\r\n            }\r\n        }\r\n        var useids = [];\r\n        for (var i = curids.length - 1; i > -1; i--) {\r\n            if (useids.length < 4) {\r\n                var index = GameUtils.getRandomInt(0, curids.length - 1);\r\n                useids.push(curids[index]);\r\n                curids.splice(index, 1);\r\n            }\r\n        }\r\n        if (curids.length)\r\n            var skins = [];\r\n        if (useids.length > 0) {\r\n            for (var i = 0; i < useids.length; i++) {\r\n                var heroid = useids[i];\r\n                skins.push(PlayerAccount.CurrentAccount.CurAccountData.m_heroDic[heroid]);\r\n            }\r\n        }\r\n        else {\r\n            this.Pass();\r\n            return;\r\n        }\r\n        this.skinlist.array = skins;\r\n        for (var i = 0; i < this.skinlist.cells.length; i++) {\r\n            var cell = this.skinlist.cells[i];\r\n            var config = skins[i];\r\n            var icon = cell.getChildAt(0).getChildAt(0).getChildAt(0);\r\n            icon.skin = config.id > 6 ? \"trial/\" + config.curicon + \".png\" : \"shop/\" + config.curicon + \".png\";\r\n            var btn = cell.getChildAt(0).getChildAt(1);\r\n            btn.clickHandler = Laya.Handler.create(this, this.OnTrialHero, [config], false);\r\n        }\r\n        this.passbtn.clickHandler = Laya.Handler.create(this, this.Pass);\r\n        this.height = Laya.stage.height;\r\n        Laya.stage.on(Laya.Event.RESIZE, this, () => {\r\n            this.height = Laya.stage.height;\r\n        });\r\n    }\r\n    OnTrialHero(_skin) {\r\n        ADPlayer.showVideoAd((flag) => {\r\n            if (flag) {\r\n                Player.Instance.RessetPlayer(_skin);\r\n                GameManager.Instance.ChangeState(GameState.Queue);\r\n            }\r\n        });\r\n    }\r\n    Pass() {\r\n        GameManager.Instance.ChangeState(GameState.Queue);\r\n    }\r\n    OnTrialHide() {\r\n        TrialWindow.trial = !TrialWindow.trial;\r\n        this.ppp.visible = !TrialWindow.trial;\r\n    }\r\n    OnHide() {\r\n    }\r\n}\r\nTrialWindow.trial = true;\r\n//# sourceMappingURL=TrialWindow.js.map",
  "references": [
    "C:/Users/admin/Desktop/runner/src/Window/Component/IWindow.ts",
    "C:/Users/admin/Desktop/runner/src/ui/layaMaxUI.ts",
    "C:/Users/admin/Desktop/runner/src/GameUtils/GameUtils.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Network/PlayerAccount.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/LevelData.ts",
    "C:/Users/admin/Desktop/runner/src/WXSDK/ADPlayer.ts",
    "C:/Users/admin/Desktop/runner/src/WXSDK/wxsdk.ts",
    "C:/Users/admin/Desktop/runner/src/Window/WindowManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/GameManager.ts",
    "C:/Users/admin/Desktop/runner/src/Scripts/Game/Player.ts"
  ],
  "map": "{\"version\":3,\"file\":\"TrialWindow.js\",\"sourceRoot\":\"\",\"sources\":[\"../../../src/Window/TrialWindow.ts\"],\"names\":[],\"mappings\":\"AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MA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