"use strict";var e=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function s(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,s)}c((n=n.apply(e,t||[])).next())}))},t=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.readProjectOhPackageJson5=void 0;const r=require("../../util/FsUtil"),n=t(require("path")),o=require("../../config"),a=require("../../common/Constants"),i=require("./OverrideProjectJsonManager"),s=require("../install-targets/TargetManager"),c=t(require("../../log"));exports.readProjectOhPackageJson5=function(){return e(this,void 0,void 0,(function*(){const e=n.default.resolve(o.config.getProjectRoot(),a.Constants.MyPackageJson);let t=yield r.FsUtil.readJSON5(e);const u=i.OverrideProjectJsonManager.getInstance();if(u.hasOverrideConfig()){const e=s.targetManager.getProjectOhPkgJson();e&&(t=e),t=u.overrideConfig(t)}else{const e=s.targetManager.getProjectOhPkgJson();e&&Object.keys(e).length>0&&(t=e)}return c.default.debug("",`readProjectOhPackageJson succeed, content: ${JSON.stringify(t)}.`),t}))};