class BjcCov {
    coverage: {
        [key: string]: string | number;
    };
    constructor(covData: object) {
        const gcv = "__coverage__";
        let coverage = globalThis[gcv] || (globalThis[gcv] = {});
        if (!coverage[covData.path] && true) {
            coverage[covData.path] = covData;
        }
        this.coverage = coverage[covData.path];
    }
    instrumentFunction(func: number) {
        this.coverage.functions[func].count++;
        this.coverage.functions[func].regions[0].count++;
    }
    instrumentRegion(func: number, region: number) {
        this.coverage.functions[func].regions[region].count++;
    }
    instrumentReturn(func: number, retIdx: number) {
        this.coverage.functions[func].returnes[retIdx].count++;
    }
    instrumentBranch(func: number, branch: number, trueOrFalse: boolean) {
        if (trueOrFalse) {
            this.coverage.functions[func].branches[branch].trueCount++;
            for (let r of Object.values(this.coverage.functions[func].branches[branch].group)) {
                if (r !== branch) {
                    this.coverage.functions[func].branches[r as number].falseCount++;
                }
            }
        }
        else {
            this.coverage.functions[func].branches[branch].falseCount++;
        }
    }
}
let bjccovms8pf5z1 = new BjcCov({ version: "bjc v1.0.0", versionCode: 10000, path: "tencentqianwebview/src/main/ets/TencentQianWebViewPage.ets", hash: "441da1d765c9f02135f7fac2f4e544594609aae1150dcf4802c2ba22689fe1e1", lineCnt: 418, count: 0, projectPath: "", functions: { 0: { name: "anonymous_1", count: 0, regions: { 0: { startLoc: { line: 38, col: 46 }, endLoc: { line: 40, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 0 }, 1: { name: "url", count: 0, regions: { 0: { startLoc: { line: 35, col: 18 }, endLoc: { line: 35, col: 21 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 1 }, 2: { name: "url", count: 0, regions: { 0: { startLoc: { line: 35, col: 18 }, endLoc: { line: 35, col: 29 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 2 }, 3: { name: "config", count: 0, regions: { 0: { startLoc: { line: 36, col: 18 }, endLoc: { line: 36, col: 24 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 3 }, 4: { name: "config", count: 0, regions: { 0: { startLoc: { line: 36, col: 18 }, endLoc: { line: 36, col: 50 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 4 }, 5: { name: "handlers", count: 0, regions: { 0: { startLoc: { line: 45, col: 18 }, endLoc: { line: 45, col: 26 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 5 }, 6: { name: "handlers", count: 0, regions: { 0: { startLoc: { line: 45, col: 18 }, endLoc: { line: 45, col: 61 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 6 }, 7: { name: "nodeController", count: 0, regions: { 0: { startLoc: { line: 47, col: 18 }, endLoc: { line: 47, col: 32 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 7 }, 8: { name: "nodeController", count: 0, regions: { 0: { startLoc: { line: 47, col: 18 }, endLoc: { line: 47, col: 58 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 8 }, 9: { name: "progress", count: 0, regions: { 0: { startLoc: { line: 50, col: 18 }, endLoc: { line: 50, col: 26 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 9 }, 10: { name: "progress", count: 0, regions: { 0: { startLoc: { line: 50, col: 18 }, endLoc: { line: 50, col: 34 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 10 }, 11: { name: "progressVisible", count: 0, regions: { 0: { startLoc: { line: 51, col: 18 }, endLoc: { line: 51, col: 33 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 11 }, 12: { name: "progressVisible", count: 0, regions: { 0: { startLoc: { line: 51, col: 18 }, endLoc: { line: 51, col: 42 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 12 }, 13: { name: "currentTitle", count: 0, regions: { 0: { startLoc: { line: 52, col: 18 }, endLoc: { line: 52, col: 30 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 13 }, 14: { name: "currentTitle", count: 0, regions: { 0: { startLoc: { line: 52, col: 18 }, endLoc: { line: 52, col: 38 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 14 }, 15: { name: "canGoBack", count: 0, regions: { 0: { startLoc: { line: 53, col: 18 }, endLoc: { line: 53, col: 27 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 15 }, 16: { name: "canGoBack", count: 0, regions: { 0: { startLoc: { line: 53, col: 18 }, endLoc: { line: 53, col: 36 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 16 }, 17: { name: "aboutToAppear", count: 0, regions: { 0: { startLoc: { line: 58, col: 3 }, endLoc: { line: 93, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 60, col: 27 }, endLoc: { line: 64, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 86, col: 56 }, endLoc: { line: 88, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 88, col: 12 }, endLoc: { line: 90, col: 6 }, count: 0, ignored: 0 }, 4: { startLoc: { line: 92, col: 5 }, endLoc: { line: 93, col: 4 }, count: 0, ignored: 0 }, 5: { startLoc: { line: 79, col: 7 }, endLoc: { line: 80, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 60, col: 9 }, endLoc: { line: 60, col: 25 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 1: { startLoc: { line: 86, col: 9 }, endLoc: { line: 86, col: 54 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 17 }, 18: { name: "anonymous_2", count: 0, regions: { 0: { startLoc: { line: 67, col: 31 }, endLoc: { line: 80, col: 6 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 69, col: 25 }, endLoc: { line: 71, col: 8 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 74, col: 11 }, endLoc: { line: 76, col: 8 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 76, col: 9 }, endLoc: { line: 78, col: 8 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 69, col: 11 }, endLoc: { line: 69, col: 23 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 18 }, 19: { name: "aboutToDisappear", count: 0, regions: { 0: { startLoc: { line: 95, col: 3 }, endLoc: { line: 127, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 97, col: 33 }, endLoc: { line: 103, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 98, col: 11 }, endLoc: { line: 100, col: 8 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 100, col: 9 }, endLoc: { line: 102, col: 8 }, count: 0, ignored: 0 }, 4: { startLoc: { line: 105, col: 39 }, endLoc: { line: 110, col: 6 }, count: 0, ignored: 0 }, 5: { startLoc: { line: 107, col: 27 }, endLoc: { line: 109, col: 8 }, count: 0, ignored: 0 }, 6: { startLoc: { line: 111, col: 24 }, endLoc: { line: 115, col: 6 }, count: 0, ignored: 0 }, 7: { startLoc: { line: 115, col: 12 }, endLoc: { line: 121, col: 6 }, count: 0, ignored: 0 }, 8: { startLoc: { line: 117, col: 41 }, endLoc: { line: 120, col: 8 }, count: 0, ignored: 0 }, 9: { startLoc: { line: 123, col: 24 }, endLoc: { line: 126, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 97, col: 9 }, endLoc: { line: 97, col: 31 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 1: { startLoc: { line: 105, col: 9 }, endLoc: { line: 105, col: 37 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 2: { startLoc: { line: 107, col: 11 }, endLoc: { line: 107, col: 25 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 3: { startLoc: { line: 111, col: 9 }, endLoc: { line: 111, col: 22 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 4: { startLoc: { line: 117, col: 11 }, endLoc: { line: 117, col: 39 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 5: { startLoc: { line: 123, col: 9 }, endLoc: { line: 123, col: 22 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 19 }, 20: { name: "reusePooled", count: 0, regions: { 0: { startLoc: { line: 130, col: 3 }, endLoc: { line: 179, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 142, col: 23 }, endLoc: { line: 148, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 143, col: 11 }, endLoc: { line: 145, col: 8 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 145, col: 9 }, endLoc: { line: 147, col: 8 }, count: 0, ignored: 0 }, 4: { startLoc: { line: 168, col: 9 }, endLoc: { line: 170, col: 6 }, count: 0, ignored: 0 }, 5: { startLoc: { line: 170, col: 7 }, endLoc: { line: 172, col: 6 }, count: 0, ignored: 0 }, 6: { startLoc: { line: 174, col: 9 }, endLoc: { line: 176, col: 6 }, count: 0, ignored: 0 }, 7: { startLoc: { line: 176, col: 7 }, endLoc: { line: 178, col: 6 }, count: 0, ignored: 0 }, 8: { startLoc: { line: 162, col: 7 }, endLoc: { line: 163, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 142, col: 9 }, endLoc: { line: 142, col: 21 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 20 }, 21: { name: "anonymous_3", count: 0, regions: { 0: { startLoc: { line: 157, col: 37 }, endLoc: { line: 163, col: 6 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 21 }, 22: { name: "buildOwnNode", count: 0, regions: { 0: { startLoc: { line: 182, col: 3 }, endLoc: { line: 198, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 183, col: 5 }, endLoc: { line: 198, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 22 }, 23: { name: "bindModelListeners", count: 0, regions: { 0: { startLoc: { line: 201, col: 3 }, endLoc: { line: 215, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 202, col: 5 }, endLoc: { line: 215, col: 4 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 204, col: 7 }, endLoc: { line: 205, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 208, col: 7 }, endLoc: { line: 209, col: 6 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 23 }, 24: { name: "anonymous_4", count: 0, regions: { 0: { startLoc: { line: 202, col: 31 }, endLoc: { line: 205, col: 6 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 24 }, 25: { name: "anonymous_5", count: 0, regions: { 0: { startLoc: { line: 206, col: 28 }, endLoc: { line: 209, col: 6 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 25 }, 26: { name: "anonymous_6", count: 0, regions: { 0: { startLoc: { line: 212, col: 35 }, endLoc: { line: 214, col: 6 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 213, col: 7 }, endLoc: { line: 214, col: 6 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 26 }, 27: { name: "applyStatusBar", count: 0, regions: { 0: { startLoc: { line: 220, col: 3 }, endLoc: { line: 234, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 221, col: 9 }, endLoc: { line: 231, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 231, col: 7 }, endLoc: { line: 233, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 222, col: 34 }, endLoc: { line: 224, col: 8 }, count: 0, ignored: 0 }, 4: { startLoc: { line: 225, col: 7 }, endLoc: { line: 231, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 222, col: 11 }, endLoc: { line: 222, col: 32 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 1: { startLoc: { line: 229, col: 32 }, endLoc: { line: 229, col: 62 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 27 }, 28: { name: "handleBack", count: 0, regions: { 0: { startLoc: { line: 244, col: 3 }, endLoc: { line: 260, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 246, col: 9 }, endLoc: { line: 248, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 248, col: 7 }, endLoc: { line: 250, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 251, col: 18 }, endLoc: { line: 258, col: 6 }, count: 0, ignored: 0 }, 4: { startLoc: { line: 252, col: 11 }, endLoc: { line: 254, col: 8 }, count: 0, ignored: 0 }, 5: { startLoc: { line: 254, col: 9 }, endLoc: { line: 256, col: 8 }, count: 0, ignored: 0 }, 6: { startLoc: { line: 259, col: 5 }, endLoc: { line: 260, col: 4 }, count: 0, ignored: 0 }, 7: { startLoc: { line: 257, col: 7 }, endLoc: { line: 258, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 251, col: 9 }, endLoc: { line: 251, col: 16 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 28 }, 29: { name: "tryClose", count: 0, regions: { 0: { startLoc: { line: 265, col: 3 }, endLoc: { line: 271, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 266, col: 41 }, endLoc: { line: 269, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 270, col: 5 }, endLoc: { line: 271, col: 4 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 266, col: 9 }, endLoc: { line: 266, col: 39 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 29 }, 30: { name: "showCloseConfirm", count: 0, regions: { 0: { startLoc: { line: 276, col: 3 }, endLoc: { line: 298, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 283, col: 9 }, endLoc: { line: 295, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 295, col: 7 }, endLoc: { line: 297, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 292, col: 31 }, endLoc: { line: 294, col: 8 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 277, col: 27 }, endLoc: { line: 279, col: 16 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 1: { startLoc: { line: 280, col: 29 }, endLoc: { line: 282, col: 26 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 2: { startLoc: { line: 292, col: 11 }, endLoc: { line: 292, col: 29 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 30 }, 31: { name: "doClose", count: 0, regions: { 0: { startLoc: { line: 303, col: 3 }, endLoc: { line: 314, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 304, col: 23 }, endLoc: { line: 306, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 309, col: 9 }, endLoc: { line: 311, col: 6 }, count: 0, ignored: 0 }, 3: { startLoc: { line: 311, col: 7 }, endLoc: { line: 313, col: 6 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 304, col: 9 }, endLoc: { line: 304, col: 21 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 31 }, 32: { name: "onBackPress", count: 0, regions: { 0: { startLoc: { line: 319, col: 3 }, endLoc: { line: 322, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 320, col: 5 }, endLoc: { line: 322, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 32 }, 33: { name: "initialRender", count: 0, regions: { 0: { startLoc: { line: 324, col: 3 }, endLoc: { line: 397, col: 4 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 33 }, 34: { name: "anonymous_7", count: 0, regions: { 0: { startLoc: { line: 325, col: 5 }, endLoc: { line: 396, col: 31 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 34 }, 35: { name: "anonymous_8", count: 0, regions: { 0: { startLoc: { line: 327, col: 7 }, endLoc: { line: 365, col: 8 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 327, col: 35 }, endLoc: { line: 365, col: 8 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 327, col: 11 }, endLoc: { line: 327, col: 33 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 35 }, 36: { name: "anonymous_9", count: 0, regions: { 0: { startLoc: { line: 328, col: 9 }, endLoc: { line: 328, col: 12 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 36 }, 37: { name: "anonymous_10", count: 0, regions: { 0: { startLoc: { line: 328, col: 9 }, endLoc: { line: 364, col: 61 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 37 }, 38: { name: "anonymous_11", count: 0, regions: { 0: { startLoc: { line: 330, col: 11 }, endLoc: { line: 337, col: 45 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 38 }, 39: { name: "anonymous_12", count: 0, regions: { 0: { startLoc: { line: 337, col: 22 }, endLoc: { line: 337, col: 45 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 39 }, 40: { name: "anonymous_13", count: 0, regions: { 0: { startLoc: { line: 340, col: 11 }, endLoc: { line: 347, col: 62 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 40 }, 41: { name: "anonymous_14", count: 0, regions: { 0: { startLoc: { line: 350, col: 11 }, endLoc: { line: 360, col: 12 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 350, col: 44 }, endLoc: { line: 358, col: 12 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 358, col: 18 }, endLoc: { line: 360, col: 12 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 350, col: 15 }, endLoc: { line: 350, col: 42 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 41 }, 42: { name: "anonymous_15", count: 0, regions: { 0: { startLoc: { line: 351, col: 13 }, endLoc: { line: 351, col: 17 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 42 }, 43: { name: "anonymous_16", count: 0, regions: { 0: { startLoc: { line: 351, col: 13 }, endLoc: { line: 357, col: 45 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 43 }, 44: { name: "anonymous_17", count: 0, regions: { 0: { startLoc: { line: 357, col: 24 }, endLoc: { line: 357, col: 45 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 44 }, 45: { name: "anonymous_18", count: 0, regions: { 0: { startLoc: { line: 359, col: 13 }, endLoc: { line: 359, col: 18 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 45 }, 46: { name: "anonymous_19", count: 0, regions: { 0: { startLoc: { line: 359, col: 13 }, endLoc: { line: 359, col: 29 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 46 }, 47: { name: "anonymous_21", count: 0, regions: { 0: { startLoc: { line: 369, col: 7 }, endLoc: { line: 392, col: 20 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 47 }, 48: { name: "anonymous_22", count: 0, regions: { 0: { startLoc: { line: 370, col: 9 }, endLoc: { line: 381, col: 10 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 370, col: 43 }, endLoc: { line: 374, col: 10 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 374, col: 16 }, endLoc: { line: 381, col: 10 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 370, col: 13 }, endLoc: { line: 370, col: 41 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 48 }, 49: { name: "anonymous_23", count: 0, regions: { 0: { startLoc: { line: 371, col: 11 }, endLoc: { line: 373, col: 27 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 49 }, 50: { name: "anonymous_24", count: 0, regions: { 0: { startLoc: { line: 371, col: 11 }, endLoc: { line: 373, col: 27 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 50 }, 51: { name: "anonymous_25", count: 0, regions: { 0: { startLoc: { line: 375, col: 11 }, endLoc: { line: 375, col: 15 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 51 }, 52: { name: "anonymous_26", count: 0, regions: { 0: { startLoc: { line: 375, col: 11 }, endLoc: { line: 380, col: 40 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 52 }, 53: { name: "anonymous_27", count: 0, regions: { 0: { startLoc: { line: 383, col: 9 }, endLoc: { line: 389, col: 10 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 383, col: 35 }, endLoc: { line: 389, col: 10 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 383, col: 13 }, endLoc: { line: 383, col: 33 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 53 }, 54: { name: "anonymous_28", count: 0, regions: { 0: { startLoc: { line: 384, col: 11 }, endLoc: { line: 388, col: 53 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 54 }, 55: { name: "anonymous_29", count: 0, regions: { 0: { startLoc: { line: 384, col: 11 }, endLoc: { line: 388, col: 53 }, count: 0, ignored: 0 } }, branches: {}, ignored: 0, index: 55 }, 56: { name: "resolveTopBarTitle", count: 0, regions: { 0: { startLoc: { line: 399, col: 3 }, endLoc: { line: 404, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 400, col: 45 }, endLoc: { line: 402, col: 6 }, count: 0, ignored: 0 }, 2: { startLoc: { line: 403, col: 5 }, endLoc: { line: 404, col: 4 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 400, col: 9 }, endLoc: { line: 400, col: 43 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 }, 1: { startLoc: { line: 403, col: 12 }, endLoc: { line: 403, col: 69 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 56 }, 57: { name: "resolveTopBarBackgroundColor", count: 0, regions: { 0: { startLoc: { line: 406, col: 3 }, endLoc: { line: 410, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 407, col: 5 }, endLoc: { line: 410, col: 4 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 407, col: 12 }, endLoc: { line: 409, col: 19 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 57 }, 58: { name: "resolveTopBarTextColor", count: 0, regions: { 0: { startLoc: { line: 412, col: 3 }, endLoc: { line: 416, col: 4 }, count: 0, ignored: 0 }, 1: { startLoc: { line: 413, col: 5 }, endLoc: { line: 416, col: 4 }, count: 0, ignored: 0 } }, branches: { 0: { startLoc: { line: 413, col: 12 }, endLoc: { line: 415, col: 19 }, trueCount: 0, falseCount: 0, group: {}, ignored: 0 } }, ignored: 0, index: 58 } }, exeLine: { 0: 1, 1: 2, 2: 3, 3: 4, 4: 5, 5: 6, 6: 7, 7: 8, 8: 9, 9: 10, 10: 11, 11: 12, 12: 13, 13: 14, 14: 15, 15: 20, 16: 31, 17: 33, 18: 35, 19: 36, 20: 37, 21: 38, 22: 41, 23: 44, 24: 45, 25: 47, 26: 49, 27: 50, 28: 51, 29: 52, 30: 53, 31: 56, 32: 58, 33: 59, 34: 60, 35: 61, 36: 62, 37: 63, 38: 65, 39: 66, 40: 67, 41: 69, 42: 70, 43: 72, 44: 73, 45: 74, 46: 75, 47: 76, 48: 79, 49: 81, 50: 84, 51: 85, 52: 86, 53: 87, 54: 88, 55: 89, 56: 92, 57: 95, 58: 97, 59: 98, 60: 99, 61: 100, 62: 105, 63: 106, 64: 107, 65: 108, 66: 111, 67: 113, 68: 114, 69: 115, 70: 117, 71: 118, 72: 119, 73: 123, 74: 124, 75: 125, 76: 130, 77: 131, 78: 132, 79: 133, 80: 134, 81: 135, 82: 136, 83: 137, 84: 138, 85: 141, 86: 142, 87: 143, 88: 144, 89: 145, 90: 149, 91: 150, 92: 153, 93: 156, 94: 157, 95: 161, 96: 162, 97: 164, 98: 165, 99: 166, 100: 168, 101: 169, 102: 170, 103: 174, 104: 175, 105: 176, 106: 182, 107: 183, 108: 184, 109: 185, 110: 186, 111: 187, 112: 188, 113: 190, 114: 191, 115: 192, 116: 193, 117: 194, 118: 195, 119: 196, 120: 197, 121: 201, 122: 202, 123: 203, 124: 204, 125: 206, 126: 207, 127: 208, 128: 212, 129: 213, 130: 220, 131: 221, 132: 222, 133: 223, 134: 225, 135: 226, 136: 227, 137: 228, 138: 229, 139: 231, 140: 244, 141: 245, 142: 246, 143: 247, 144: 248, 145: 249, 146: 251, 147: 252, 148: 253, 149: 254, 150: 255, 151: 257, 152: 259, 153: 265, 154: 266, 155: 267, 156: 268, 157: 270, 158: 276, 159: 277, 160: 278, 161: 279, 162: 280, 163: 281, 164: 282, 165: 283, 166: 284, 167: 285, 168: 286, 169: 287, 170: 288, 171: 289, 172: 292, 173: 293, 174: 295, 175: 303, 176: 304, 177: 305, 178: 307, 179: 308, 180: 309, 181: 310, 182: 311, 183: 319, 184: 320, 185: 321, 186: 324, 187: 325, 188: 327, 189: 328, 190: 330, 191: 331, 192: 332, 193: 333, 194: 334, 195: 335, 196: 336, 197: 337, 198: 340, 199: 341, 200: 342, 201: 343, 202: 344, 203: 345, 204: 346, 205: 347, 206: 350, 207: 351, 208: 352, 209: 353, 210: 354, 211: 355, 212: 356, 213: 357, 214: 358, 215: 359, 216: 362, 217: 363, 218: 364, 219: 369, 220: 370, 221: 371, 222: 372, 223: 373, 224: 374, 225: 375, 226: 376, 227: 377, 228: 378, 229: 379, 230: 380, 231: 383, 232: 384, 233: 385, 234: 386, 235: 387, 236: 388, 237: 391, 238: 392, 239: 394, 240: 395, 241: 396, 242: 399, 243: 400, 244: 401, 245: 403, 246: 406, 247: 407, 248: 408, 249: 409, 250: 412, 251: 413, 252: 414, 253: 415 } });
if (!("finalizeConstruction" in ViewPU.prototype)) {
    Reflect.set(ViewPU.prototype, "finalizeConstruction", () => { });
}
interface TencentQianWebViewPage_Params {
    url?: string;
    config?: TencentQianWebViewConfig;
    context?: common.UIAbilityContext;
    signResultCallback?: OnSignResult;
    sdkEventCallback?: OnSdkEvent;
    controller?: webview.WebviewController;
    handlers?: TencentQianWebViewHandlers | null;
    nodeController?: WebNodeController | null;
    fromPool?: boolean;
    progress?: number;
    progressVisible?: boolean;
    currentTitle?: string;
    canGoBack?: boolean;
    closing?: boolean;
}
import webview from "@ohos:web.webview";
import router from "@ohos:router";
import type common from "@ohos:app.ability.common";
import window from "@ohos:window";
import { TencentQianWebViewConfig } from "@normalized:N&&&tencentqianwebview/src/main/ets/model/TencentQianWebViewConfig&1.0.0";
import type { StatusBarStyle } from "@normalized:N&&&tencentqianwebview/src/main/ets/model/TencentQianWebViewConfig&1.0.0";
import type { OnSignResult, OnSdkEvent } from './model/SignCallback';
import type { SignResult } from './model/SignResult';
import { IntentBridge } from "@normalized:N&&&tencentqianwebview/src/main/ets/internal/IntentBridge&1.0.0";
import type { IntentBridgePayload } from "@normalized:N&&&tencentqianwebview/src/main/ets/internal/IntentBridge&1.0.0";
import { TencentQianWebViewConfigurator } from "@normalized:N&&&tencentqianwebview/src/main/ets/TencentQianWebViewConfigurator&1.0.0";
import type { TencentQianWebViewHandlers } from "@normalized:N&&&tencentqianwebview/src/main/ets/TencentQianWebViewConfigurator&1.0.0";
import { WebHostModel } from "@normalized:N&&&tencentqianwebview/src/main/ets/internal/prewarm/WebHostModel&1.0.0";
import { WebNodeController } from "@normalized:N&&&tencentqianwebview/src/main/ets/internal/prewarm/TencentQianWebNode&1.0.0";
import { HarmonyWebViewPool } from "@normalized:N&&&tencentqianwebview/src/main/ets/internal/prewarm/HarmonyWebViewPool&1.0.0";
/**
 * 内置容器页面在命名路由表中的注册名,与 `router_map.json` 一致。
 */
export const TENCENT_QIAN_WEBVIEW_PAGE_NAME: string = 'TencentQianWebViewPage';
class TencentQianWebViewPage extends ViewPU {
    constructor(parent, params, __localStorage, elmtId = -1, paramsLambda = undefined, extraInfo) {
        super(parent, __localStorage, elmtId, extraInfo);
        if (typeof paramsLambda === "function") {
            this.paramsGenerator_ = paramsLambda;
        }
        this.__url = new ObservedPropertySimplePU('', this, "url");
        this.__config = new ObservedPropertyObjectPU(new TencentQianWebViewConfig(), this, "config");
        this.context = getContext(this) as common.UIAbilityContext;
        this.signResultCallback = (_r): void => {
            bjccovms8pf5z1.instrumentFunction(0);
        };
        this.sdkEventCallback = undefined;
        this.controller = new webview.WebviewController();
        this.__handlers = new ObservedPropertyObjectPU(null, this, "handlers");
        this.__nodeController = new ObservedPropertyObjectPU(null, this, "nodeController");
        this.fromPool = false;
        this.__progress = new ObservedPropertySimplePU(0, this, "progress");
        this.__progressVisible = new ObservedPropertySimplePU(false, this, "progressVisible");
        this.__currentTitle = new ObservedPropertySimplePU('', this, "currentTitle");
        this.__canGoBack = new ObservedPropertySimplePU(false, this, "canGoBack");
        this.closing = false;
        this.setInitiallyProvidedValue(params);
        this.finalizeConstruction();
    }
    setInitiallyProvidedValue(params: TencentQianWebViewPage_Params) {
        if (params.url !== undefined) {
            this.url = params.url;
        }
        if (params.config !== undefined) {
            this.config = params.config;
        }
        if (params.context !== undefined) {
            this.context = params.context;
        }
        if (params.signResultCallback !== undefined) {
            this.signResultCallback = params.signResultCallback;
        }
        if (params.sdkEventCallback !== undefined) {
            this.sdkEventCallback = params.sdkEventCallback;
        }
        if (params.controller !== undefined) {
            this.controller = params.controller;
        }
        if (params.handlers !== undefined) {
            this.handlers = params.handlers;
        }
        if (params.nodeController !== undefined) {
            this.nodeController = params.nodeController;
        }
        if (params.fromPool !== undefined) {
            this.fromPool = params.fromPool;
        }
        if (params.progress !== undefined) {
            this.progress = params.progress;
        }
        if (params.progressVisible !== undefined) {
            this.progressVisible = params.progressVisible;
        }
        if (params.currentTitle !== undefined) {
            this.currentTitle = params.currentTitle;
        }
        if (params.canGoBack !== undefined) {
            this.canGoBack = params.canGoBack;
        }
        if (params.closing !== undefined) {
            this.closing = params.closing;
        }
    }
    updateStateVars(params: TencentQianWebViewPage_Params) {
    }
    purgeVariableDependenciesOnElmtId(rmElmtId) {
        this.__url.purgeDependencyOnElmtId(rmElmtId);
        this.__config.purgeDependencyOnElmtId(rmElmtId);
        this.__handlers.purgeDependencyOnElmtId(rmElmtId);
        this.__nodeController.purgeDependencyOnElmtId(rmElmtId);
        this.__progress.purgeDependencyOnElmtId(rmElmtId);
        this.__progressVisible.purgeDependencyOnElmtId(rmElmtId);
        this.__currentTitle.purgeDependencyOnElmtId(rmElmtId);
        this.__canGoBack.purgeDependencyOnElmtId(rmElmtId);
    }
    aboutToBeDeleted() {
        this.__url.aboutToBeDeleted();
        this.__config.aboutToBeDeleted();
        this.__handlers.aboutToBeDeleted();
        this.__nodeController.aboutToBeDeleted();
        this.__progress.aboutToBeDeleted();
        this.__progressVisible.aboutToBeDeleted();
        this.__currentTitle.aboutToBeDeleted();
        this.__canGoBack.aboutToBeDeleted();
        SubscriberManager.Get().delete(this.id__());
        this.aboutToBeDeletedInternal();
    }
    // ── 从 IntentBridge 取出的入参 ──
    private __url: ObservedPropertySimplePU<string>;
    get url() {
        bjccovms8pf5z1.instrumentFunction(1);
        return this.__url.get();
    }
    set url(newValue: string) {
        bjccovms8pf5z1.instrumentFunction(2);
        this.__url.set(newValue);
    }
    private __config: ObservedPropertyObjectPU<TencentQianWebViewConfig>;
    get config() {
        bjccovms8pf5z1.instrumentFunction(3);
        return this.__config.get();
    }
    set config(newValue: TencentQianWebViewConfig) {
        bjccovms8pf5z1.instrumentFunction(4);
        this.__config.set(newValue);
    }
    private context: common.UIAbilityContext;
    private signResultCallback: OnSignResult;
    private sdkEventCallback?: OnSdkEvent;
    // ── Web 状态 ──
    private controller: webview.WebviewController;
    private __handlers: ObservedPropertyObjectPU<TencentQianWebViewHandlers | null>;
    get handlers() {
        bjccovms8pf5z1.instrumentFunction(5);
        return this.__handlers.get();
    }
    set handlers(newValue: TencentQianWebViewHandlers | null) {
        bjccovms8pf5z1.instrumentFunction(6);
        this.__handlers.set(newValue);
    }
    /** 承载离线 Web 组件的 NodeController。 */
    private __nodeController: ObservedPropertyObjectPU<WebNodeController | null>;
    get nodeController() {
        bjccovms8pf5z1.instrumentFunction(7);
        return this.__nodeController.get();
    }
    set nodeController(newValue: WebNodeController | null) {
        bjccovms8pf5z1.instrumentFunction(8);
        this.__nodeController.set(newValue);
    }
    /** 本页 Web 实例是否借自预热池（决定关闭时归还还是销毁）。 */
    private fromPool: boolean;
    private __progress: ObservedPropertySimplePU<number>;
    get progress() {
        bjccovms8pf5z1.instrumentFunction(9);
        return this.__progress.get();
    }
    set progress(newValue: number) {
        bjccovms8pf5z1.instrumentFunction(10);
        this.__progress.set(newValue);
    }
    private __progressVisible: ObservedPropertySimplePU<boolean>;
    get progressVisible() {
        bjccovms8pf5z1.instrumentFunction(11);
        return this.__progressVisible.get();
    }
    set progressVisible(newValue: boolean) {
        bjccovms8pf5z1.instrumentFunction(12);
        this.__progressVisible.set(newValue);
    }
    private __currentTitle: ObservedPropertySimplePU<string>;
    get currentTitle() {
        bjccovms8pf5z1.instrumentFunction(13);
        return this.__currentTitle.get();
    }
    set currentTitle(newValue: string) {
        bjccovms8pf5z1.instrumentFunction(14);
        this.__currentTitle.set(newValue);
    }
    private __canGoBack: ObservedPropertySimplePU<boolean>;
    get canGoBack() {
        bjccovms8pf5z1.instrumentFunction(15);
        return this.__canGoBack.get();
    }
    set canGoBack(newValue: boolean) {
        bjccovms8pf5z1.instrumentFunction(16);
        this.__canGoBack.set(newValue);
    }
    // ── 防重复关闭 ──
    private closing: boolean;
    aboutToAppear(): void {
        bjccovms8pf5z1.instrumentFunction(17);
        const payload: IntentBridgePayload | null = IntentBridge.peek();
        if (payload === null) {
            bjccovms8pf5z1.instrumentBranch(17, 0, true);
            bjccovms8pf5z1.instrumentRegion(17, 1);
            console.error('[TencentQianWebViewPage] IntentBridge has no payload, closing');
            router.back();
            return;
        }
        else {
            bjccovms8pf5z1.instrumentBranch(17, 0, false);
        }
        this.url = payload.url;
        this.config = payload.config;
        this.signResultCallback = (result: SignResult): void => {
            bjccovms8pf5z1.instrumentFunction(18);
            // 关闭流程仅触发一次 onSignResult,避免双回调
            if (this.closing) {
                bjccovms8pf5z1.instrumentBranch(18, 0, true);
                bjccovms8pf5z1.instrumentRegion(18, 1);
                return;
            }
            else {
                bjccovms8pf5z1.instrumentBranch(18, 0, false);
            }
            this.closing = true;
            payload.onSignResult(result);
            try {
                bjccovms8pf5z1.instrumentRegion(18, 2);
                router.back();
            }
            catch (_e) {
                bjccovms8pf5z1.instrumentRegion(18, 3);
            }
            bjccovms8pf5z1.instrumentRegion(17, 5);
            IntentBridge.clear();
        };
        this.sdkEventCallback = payload.onSdkEvent;
        // 优先复用预热池实例（UA 配置匹配时）；否则自建离线组件
        const pooled: WebNodeController | null = HarmonyWebViewPool.obtain(this.config.injectUserAgent, this.config.userAgentExtra);
        if (pooled !== null && pooled.getModel() !== null) {
            bjccovms8pf5z1.instrumentBranch(17, 1, true);
            bjccovms8pf5z1.instrumentRegion(17, 2);
            this.reusePooled(pooled);
        }
        else {
            bjccovms8pf5z1.instrumentBranch(17, 1, false);
            bjccovms8pf5z1.instrumentRegion(17, 3);
            this.buildOwnNode();
        }
        bjccovms8pf5z1.instrumentRegion(17, 4);
        this.applyStatusBar();
    }
    aboutToDisappear(): void {
        bjccovms8pf5z1.instrumentFunction(19);
        // 释放网络状态监听
        if (this.handlers !== null) {
            bjccovms8pf5z1.instrumentBranch(19, 0, true);
            bjccovms8pf5z1.instrumentRegion(19, 1);
            try {
                bjccovms8pf5z1.instrumentRegion(19, 2);
                this.handlers.networkStateInjector.detach();
            }
            catch (_e) {
                bjccovms8pf5z1.instrumentRegion(19, 3);
            }
        }
        // 断开 model 对本容器的联动回调，防止池 model 长期持有已销毁容器引用（内存泄漏）。
        else {
            bjccovms8pf5z1.instrumentBranch(19, 0, false);
        }
        // 断开 model 对本容器的联动回调，防止池 model 长期持有已销毁容器引用（内存泄漏）。
        if (this.nodeController !== null) {
            bjccovms8pf5z1.instrumentBranch(19, 1, true);
            bjccovms8pf5z1.instrumentRegion(19, 4);
            const model: WebHostModel | null = this.nodeController.getModel();
            if (model !== null) {
                bjccovms8pf5z1.instrumentBranch(19, 2, true);
                bjccovms8pf5z1.instrumentRegion(19, 5);
                model.clearContainerListeners();
            }
            else {
                bjccovms8pf5z1.instrumentBranch(19, 2, false);
            }
        }
        else {
            bjccovms8pf5z1.instrumentBranch(19, 1, false);
        }
        if (this.fromPool) {
            bjccovms8pf5z1.instrumentBranch(19, 3, true);
            bjccovms8pf5z1.instrumentRegion(19, 6);
            // 借还池（同 Android）：先解绑 NodeContainer，再归还（about:blank + clearHistory，不销毁）
            this.nodeController = null;
            HarmonyWebViewPool.recycle();
        }
        else {
            bjccovms8pf5z1.instrumentBranch(19, 3, false);
            bjccovms8pf5z1.instrumentRegion(19, 7);
            // 自建：销毁离线节点
            if (this.nodeController !== null) {
                bjccovms8pf5z1.instrumentBranch(19, 4, true);
                bjccovms8pf5z1.instrumentRegion(19, 8);
                this.nodeController.disposeNode();
                this.nodeController = null;
            }
            else // 页面销毁兜底,保证 IntentBridge 清空
             {
                bjccovms8pf5z1.instrumentBranch(19, 4, false);
            }
        }
        // 页面销毁兜底,保证 IntentBridge 清空
        if (!this.closing) {
            bjccovms8pf5z1.instrumentBranch(19, 5, true);
            bjccovms8pf5z1.instrumentRegion(19, 9);
            this.closing = true;
            IntentBridge.clear();
        }
        else /** 复用预热池实例：用池 controller 生成真实 handlers，热替换 model.handlers/url 并重新激活。 */ {
            bjccovms8pf5z1.instrumentBranch(19, 5, false);
        }
    }
    /** 复用预热池实例：用池 controller 生成真实 handlers，热替换 model.handlers/url 并重新激活。 */
    private reusePooled(pooled: WebNodeController): void {
        bjccovms8pf5z1.instrumentFunction(20);
        const model: WebHostModel = pooled.getModel()!;
        this.controller = model.controller;
        this.handlers = TencentQianWebViewConfigurator.apply(this.controller, this.context, this.config, this.signResultCallback, this.sdkEventCallback);
        // detach 预热 handlers 的网络监听，切到真实 handlers
        const old: TencentQianWebViewHandlers | null = model.handlers;
        if (old !== null) {
            bjccovms8pf5z1.instrumentBranch(20, 0, true);
            bjccovms8pf5z1.instrumentRegion(20, 1);
            try {
                bjccovms8pf5z1.instrumentRegion(20, 2);
                old.networkStateInjector.detach();
            }
            catch (_e) {
                bjccovms8pf5z1.instrumentRegion(20, 3);
            }
        }
        else {
            bjccovms8pf5z1.instrumentBranch(20, 0, false);
        }
        model.handlers = this.handlers;
        model.url = this.url;
        // 池实例已在预热时加载过 warmupUrl（历史栈残留）；标记首个 onPageEnd 清历史，
        // 使 signingUrl 成为唯一历史项，避免第一次返回退回预热页。
        model.clearHistoryOnce = true;
        // 标记来自池 + 绑定作废回调：借出态渲染进程崩溃时作废池实例（避免僵尸复用），
        // 并同步容器 fromPool=false（后续关闭不再走归还）。对齐 Android。
        model.fromPool = true;
        model.onPoolInvalidateRequest = (): void => {
            bjccovms8pf5z1.instrumentFunction(21);
            // 借出态崩溃：只脱池（不再被 obtain 复用 / 不再被 recycle 收回），**不销毁正在显示的活节点**。
            // controller 崩溃后仍有效，容器在同一 controller 上 refresh() 原地恢复（鸿蒙无需分离节点/重建）；
            // 活节点由容器继续持有，关闭时（fromPool=false → disposeNode）再销毁收口。对齐 Android invalidateIfPooled。
            HarmonyWebViewPool.unpoolBorrowed();
            bjccovms8pf5z1.instrumentRegion(20, 8);
            this.fromPool = false;
        };
        this.bindModelListeners(model);
        this.nodeController = pooled;
        this.fromPool = true;
        // controller 已 attach（预热时），手动执行真实 handlers 的 attach（UA + 网络监听）
        try {
            bjccovms8pf5z1.instrumentRegion(20, 4);
            this.handlers.onControllerAttached();
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(20, 5);
        }
        // 加载真实签署页（命中预热热身的连接/内核缓存）
        try {
            bjccovms8pf5z1.instrumentRegion(20, 6);
            this.controller.loadUrl(this.url);
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(20, 7);
        }
    }
    /** 自建离线组件（无池可复用时）。 */
    private buildOwnNode(): void {
        bjccovms8pf5z1.instrumentFunction(22);
        bjccovms8pf5z1.instrumentRegion(22, 1);
        this.handlers = TencentQianWebViewConfigurator.apply(this.controller, this.context, this.config, this.signResultCallback, this.sdkEventCallback);
        const model: WebHostModel = new WebHostModel(this.controller);
        model.url = this.url;
        model.handlers = this.handlers;
        this.bindModelListeners(model);
        const ctrl: WebNodeController = new WebNodeController();
        ctrl.init(this.getUIContext(), model);
        this.nodeController = ctrl;
        this.fromPool = false;
    }
    /** 绑定进度/标题联动回调到 model（驱动本页 @State）。 */
    private bindModelListeners(model: WebHostModel): void {
        bjccovms8pf5z1.instrumentFunction(23);
        bjccovms8pf5z1.instrumentRegion(23, 1);
        model.onProgressChanged = (progress: number, visible: boolean): void => {
            bjccovms8pf5z1.instrumentFunction(24);
            this.progress = progress;
            bjccovms8pf5z1.instrumentRegion(23, 2);
            this.progressVisible = visible;
        };
        model.onTitleChanged = (title: string, canGoBack: boolean): void => {
            bjccovms8pf5z1.instrumentFunction(25);
            this.currentTitle = title;
            bjccovms8pf5z1.instrumentRegion(23, 3);
            this.canGoBack = canGoBack;
        };
        // 渲染进程崩溃且 refresh/loadUrl 均无法恢复 → 关闭页面，避免持久白屏。
        // 对齐 Android recoverFromRenderProcessGone 恢复失败 finish()。
        model.onRenderUnrecoverable = (): void => {
            bjccovms8pf5z1.instrumentFunction(26);
            bjccovms8pf5z1.instrumentRegion(26, 1);
            this.doClose();
        };
    }
    /**
     * 状态栏样式应用。
     */
    private async applyStatusBar(): Promise<void> {
        bjccovms8pf5z1.instrumentFunction(27);
        try {
            bjccovms8pf5z1.instrumentRegion(27, 1);
            if (this.context === null) {
                bjccovms8pf5z1.instrumentBranch(27, 0, true);
                bjccovms8pf5z1.instrumentRegion(27, 3);
                return;
            }
            else {
                bjccovms8pf5z1.instrumentBranch(27, 0, false);
            }
            bjccovms8pf5z1.instrumentRegion(27, 4);
            const style: StatusBarStyle = this.config.statusBarStyle;
            const isDark: boolean = style === 'DARK_CONTENT';
            const win = await window.getLastWindow(this.context);
            await win.setWindowSystemBarProperties({
                statusBarContentColor: isDark ? (bjccovms8pf5z1.instrumentBranch(27, 1, true), '#000000') : (bjccovms8pf5z1.instrumentBranch(27, 1, false), '#FFFFFF')
            });
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(27, 2);
        }
    }
    /**
     * 顶栏返回按钮 / 系统返回键处理。
     *
     * 实时查询 `accessBackward()` 判断是否可后退，而非依赖 `onPageEnd` 刷新的
     * `canGoBack` @State —— SPA 的 `pushState` / `hashchange` 路由跳转不触发 `onPageEnd`，
     * `canGoBack` 会陈旧，导致 H5 页内还能后退时却误弹退出。实时查询可覆盖
     * 整页导航与 SPA 路由两种历史深度，退到 H5 首屏（不可后退）才走关闭流程。
     */
    private handleBack(): void {
        bjccovms8pf5z1.instrumentFunction(28);
        let canBack: boolean = false;
        try {
            bjccovms8pf5z1.instrumentRegion(28, 1);
            canBack = this.controller.accessBackward();
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(28, 2);
            canBack = false;
        }
        if (canBack) {
            bjccovms8pf5z1.instrumentBranch(28, 0, true);
            bjccovms8pf5z1.instrumentRegion(28, 3);
            try {
                bjccovms8pf5z1.instrumentRegion(28, 4);
                this.controller.backward();
            }
            catch (_e) {
                bjccovms8pf5z1.instrumentRegion(28, 5);
                this.tryClose();
            }
            bjccovms8pf5z1.instrumentRegion(28, 7);
            return;
        }
        else {
            bjccovms8pf5z1.instrumentBranch(28, 0, false);
        }
        bjccovms8pf5z1.instrumentRegion(28, 6);
        this.tryClose();
    }
    /**
     * 尝试关闭页面(若开启确认则先弹框)。
     */
    private tryClose(): void {
        bjccovms8pf5z1.instrumentFunction(29);
        if (this.config.confirmBeforeClose) {
            bjccovms8pf5z1.instrumentBranch(29, 0, true);
            bjccovms8pf5z1.instrumentRegion(29, 1);
            this.showCloseConfirm();
            return;
        }
        else {
            bjccovms8pf5z1.instrumentBranch(29, 0, false);
        }
        bjccovms8pf5z1.instrumentRegion(29, 2);
        this.doClose();
    }
    /**
     * 显示关闭确认对话框。
     */
    private async showCloseConfirm(): Promise<void> {
        bjccovms8pf5z1.instrumentFunction(30);
        const title: string = this.config.confirmCloseTitle.length > 0
            ? (bjccovms8pf5z1.instrumentBranch(30, 0, true), this.config.confirmCloseTitle) : (bjccovms8pf5z1.instrumentBranch(30, 0, false), '确认离开?');
        const message: string = this.config.confirmCloseMessage.length > 0
            ? (bjccovms8pf5z1.instrumentBranch(30, 1, true), this.config.confirmCloseMessage) : (bjccovms8pf5z1.instrumentBranch(30, 1, false), '签署流程尚未完成,确认离开吗?');
        try {
            bjccovms8pf5z1.instrumentRegion(30, 1);
            const result = await this.getUIContext().getPromptAction().showDialog({
                title: title,
                message: message,
                buttons: [
                    { text: '继续签署', color: '#999999' },
                    { text: '离开', color: '#000000' }
                ]
            });
            if (result.index === 1) {
                bjccovms8pf5z1.instrumentBranch(30, 2, true);
                bjccovms8pf5z1.instrumentRegion(30, 3);
                this.doClose();
            }
            else {
                bjccovms8pf5z1.instrumentBranch(30, 2, false);
            }
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(30, 2);
        }
    }
    /**
     * 实际关闭页面。
     */
    private doClose(): void {
        bjccovms8pf5z1.instrumentFunction(31);
        if (this.closing) {
            bjccovms8pf5z1.instrumentBranch(31, 0, true);
            bjccovms8pf5z1.instrumentRegion(31, 1);
            return;
        }
        else {
            bjccovms8pf5z1.instrumentBranch(31, 0, false);
        }
        this.closing = true;
        IntentBridge.clear();
        try {
            bjccovms8pf5z1.instrumentRegion(31, 2);
            router.back();
        }
        catch (_e) {
            bjccovms8pf5z1.instrumentRegion(31, 3);
        }
    }
    /**
     * 系统返回键处理。返回 true = 已消费。
     */
    onBackPress(): boolean {
        bjccovms8pf5z1.instrumentFunction(32);
        bjccovms8pf5z1.instrumentRegion(32, 1);
        this.handleBack();
        return true;
    }
    initialRender() {
        bjccovms8pf5z1.instrumentFunction(33);
        this.observeComponentCreation2((elmtId, isInitialRender) => {
            bjccovms8pf5z1.instrumentFunction(34);
            Column.create();
            Column.width('100%');
            Column.height('100%');
            Column.backgroundColor('#FFFFFF');
        }, Column);
        this.observeComponentCreation2((elmtId, isInitialRender) => {
            bjccovms8pf5z1.instrumentFunction(35);
            If.create();
            // ────────── 顶栏 ──────────
            if (this.config.showTopBar) {
                bjccovms8pf5z1.instrumentBranch(35, 0, true);
                bjccovms8pf5z1.instrumentRegion(35, 1);
                this.ifElseBranchUpdateFunction(0, () => {
                    bjccovms8pf5z1.instrumentFunction(36);
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(37);
                        Row.create();
                        Row.width('100%');
                        Row.height(56);
                        Row.backgroundColor(this.resolveTopBarBackgroundColor());
                    }, Row);
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(38);
                        // 返回按钮
                        Text.create('<');
                        // 返回按钮
                        Text.fontSize(20);
                        // 返回按钮
                        Text.fontWeight(FontWeight.Bold);
                        // 返回按钮
                        Text.fontColor(this.resolveTopBarTextColor());
                        // 返回按钮
                        Text.width(44);
                        // 返回按钮
                        Text.height('100%');
                        // 返回按钮
                        Text.textAlign(TextAlign.Center);
                        // 返回按钮
                        Text.onClick(() => { bjccovms8pf5z1.instrumentFunction(39); return this.handleBack(); });
                    }, Text);
                    // 返回按钮
                    Text.pop();
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(40);
                        // 标题
                        Text.create(this.resolveTopBarTitle());
                        // 标题
                        Text.fontSize(17);
                        // 标题
                        Text.fontWeight(FontWeight.Medium);
                        // 标题
                        Text.fontColor(this.resolveTopBarTextColor());
                        // 标题
                        Text.layoutWeight(1);
                        // 标题
                        Text.textAlign(TextAlign.Center);
                        // 标题
                        Text.maxLines(1);
                        // 标题
                        Text.textOverflow({ overflow: TextOverflow.Ellipsis });
                    }, Text);
                    // 标题
                    Text.pop();
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(41);
                        If.create();
                        // 关闭按钮
                        if (this.config.showCloseButton) {
                            bjccovms8pf5z1.instrumentBranch(41, 0, true);
                            bjccovms8pf5z1.instrumentRegion(41, 1);
                            this.ifElseBranchUpdateFunction(0, () => {
                                bjccovms8pf5z1.instrumentFunction(42);
                                this.observeComponentCreation2((elmtId, isInitialRender) => {
                                    bjccovms8pf5z1.instrumentFunction(43);
                                    Text.create('×');
                                    Text.fontSize(24);
                                    Text.fontColor(this.resolveTopBarTextColor());
                                    Text.width(44);
                                    Text.height('100%');
                                    Text.textAlign(TextAlign.Center);
                                    Text.onClick(() => { bjccovms8pf5z1.instrumentFunction(44); return this.tryClose(); });
                                }, Text);
                                Text.pop();
                            });
                        }
                        else {
                            bjccovms8pf5z1.instrumentBranch(41, 0, false);
                            bjccovms8pf5z1.instrumentRegion(41, 2);
                            this.ifElseBranchUpdateFunction(1, () => {
                                bjccovms8pf5z1.instrumentFunction(45);
                                this.observeComponentCreation2((elmtId, isInitialRender) => {
                                    bjccovms8pf5z1.instrumentFunction(46);
                                    Blank.create();
                                    Blank.width(44);
                                }, Blank);
                                Blank.pop();
                            });
                        }
                    }, If);
                    If.pop();
                    Row.pop();
                });
            }
            // ────────── Web 组件 + 进度条（Stack 叠加）──────────
            // 进度条浮在 Web 顶部,不占据布局空间,避免显隐时布局跳动(对齐 Android / iOS)。
            else {
                bjccovms8pf5z1.instrumentBranch(35, 0, false);
                this.ifElseBranchUpdateFunction(1, () => {
                });
            }
        }, If);
        If.pop();
        this.observeComponentCreation2((elmtId, isInitialRender) => {
            bjccovms8pf5z1.instrumentFunction(47);
            // ────────── Web 组件 + 进度条（Stack 叠加）──────────
            // 进度条浮在 Web 顶部,不占据布局空间,避免显隐时布局跳动(对齐 Android / iOS)。
            Stack.create({ alignContent: Alignment.Top });
            // ────────── Web 组件 + 进度条（Stack 叠加）──────────
            // 进度条浮在 Web 顶部,不占据布局空间,避免显隐时布局跳动(对齐 Android / iOS)。
            Stack.layoutWeight(1);
            // ────────── Web 组件 + 进度条（Stack 叠加）──────────
            // 进度条浮在 Web 顶部,不占据布局空间,避免显隐时布局跳动(对齐 Android / iOS)。
            Stack.width('100%');
        }, Stack);
        this.observeComponentCreation2((elmtId, isInitialRender) => {
            bjccovms8pf5z1.instrumentFunction(48);
            If.create();
            if (this.nodeController !== null) {
                bjccovms8pf5z1.instrumentBranch(48, 0, true);
                bjccovms8pf5z1.instrumentRegion(48, 1);
                this.ifElseBranchUpdateFunction(0, () => {
                    bjccovms8pf5z1.instrumentFunction(49);
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(50);
                        NodeContainer.create(this.nodeController);
                        NodeContainer.width('100%');
                        NodeContainer.height('100%');
                    }, NodeContainer);
                });
            }
            else {
                bjccovms8pf5z1.instrumentBranch(48, 0, false);
                bjccovms8pf5z1.instrumentRegion(48, 2);
                this.ifElseBranchUpdateFunction(1, () => {
                    bjccovms8pf5z1.instrumentFunction(51);
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(52);
                        Text.create('容器初始化失败,请重试');
                        Text.fontSize(14);
                        Text.fontColor('#999999');
                        Text.width('100%');
                        Text.height('100%');
                        Text.textAlign(TextAlign.Center);
                    }, Text);
                    Text.pop();
                });
            }
        }, If);
        If.pop();
        this.observeComponentCreation2((elmtId, isInitialRender) => {
            bjccovms8pf5z1.instrumentFunction(53);
            If.create();
            if (this.progressVisible) {
                bjccovms8pf5z1.instrumentBranch(53, 0, true);
                bjccovms8pf5z1.instrumentRegion(53, 1);
                this.ifElseBranchUpdateFunction(0, () => {
                    bjccovms8pf5z1.instrumentFunction(54);
                    this.observeComponentCreation2((elmtId, isInitialRender) => {
                        bjccovms8pf5z1.instrumentFunction(55);
                        Progress.create({ value: this.progress, total: 100, type: ProgressType.Linear });
                        Progress.height(2);
                        Progress.width('100%');
                        Progress.color('#1989FA');
                        Progress.hitTestBehavior(HitTestMode.Transparent);
                    }, Progress);
                });
            }
            else {
                bjccovms8pf5z1.instrumentBranch(53, 0, false);
                this.ifElseBranchUpdateFunction(1, () => {
                });
            }
        }, If);
        If.pop();
        // ────────── Web 组件 + 进度条（Stack 叠加）──────────
        // 进度条浮在 Web 顶部,不占据布局空间,避免显隐时布局跳动(对齐 Android / iOS)。
        Stack.pop();
        Column.pop();
    }
    private resolveTopBarTitle(): string {
        bjccovms8pf5z1.instrumentFunction(56);
        if (this.config.topBarTitle.length > 0) {
            bjccovms8pf5z1.instrumentBranch(56, 0, true);
            bjccovms8pf5z1.instrumentRegion(56, 1);
            return this.config.topBarTitle;
        }
        else {
            bjccovms8pf5z1.instrumentBranch(56, 0, false);
        }
        bjccovms8pf5z1.instrumentRegion(56, 2);
        return this.currentTitle.length > 0 ? (bjccovms8pf5z1.instrumentBranch(56, 1, true), this.currentTitle) : (bjccovms8pf5z1.instrumentBranch(56, 1, false), '电子签署');
    }
    private resolveTopBarBackgroundColor(): number {
        bjccovms8pf5z1.instrumentFunction(57);
        bjccovms8pf5z1.instrumentRegion(57, 1);
        return this.config.topBarBackgroundColor !== null
            ? (bjccovms8pf5z1.instrumentBranch(57, 0, true), this.config.topBarBackgroundColor) : (bjccovms8pf5z1.instrumentBranch(57, 0, false), 0xFFFFFFFF);
    }
    private resolveTopBarTextColor(): number {
        bjccovms8pf5z1.instrumentFunction(58);
        bjccovms8pf5z1.instrumentRegion(58, 1);
        return this.config.topBarTextColor !== null
            ? (bjccovms8pf5z1.instrumentBranch(58, 0, true), this.config.topBarTextColor) : (bjccovms8pf5z1.instrumentBranch(58, 0, false), 0xFF000000);
    }
    rerender() {
        this.updateDirtyElements();
    }
    static getEntryName(): string {
        return "TencentQianWebViewPage";
    }
}
{
    let routeNameNode = TENCENT_QIAN_WEBVIEW_PAGE_NAME;
    registerNamedRoute(() => new TencentQianWebViewPage(undefined, {}), routeNameNode, { bundleName: "com.tencent.qian.webview.demo", moduleName: "tencentqianwebview", pagePath: "TencentQianWebViewPage", pageFullPath: "tencentqianwebview/src/main/ets/TencentQianWebViewPage", integratedHsp: "false", moduleType: "followWithHap" });
}
