UNPKG

@idm-plugin/ghg

Version:

idm plugin for greenhouse gas

1,530 lines 64.4 kB
var w5 = Object.defineProperty; var N5 = (l, e, o) => e in l ? w5(l, e, { enumerable: !0, configurable: !0, writable: !0, value: o }) : l[e] = o; var Y = (l, e, o) => (N5(l, typeof e != "symbol" ? e + "" : e, o), o); import X from "@log4js-node/log4js-api"; import * as K from "@turf/turf"; let Q; typeof process < "u" && process.versions && process.versions.node && (Q = require("fs")); let W; try { W = X.getLogger("eu-ets"); } catch { } finally { } const j = class j { static async readBoundaries(e) { if (!Q) throw new Error("readBoundaries is only available in Node.js environment. Please use browser-compatible method to load boundaries data."); const o = Q.readFileSync(e, "utf-8"); return JSON.parse(o); } static async convert2Geojson(e) { const o = []; for (const r of e) { const n = r.bound; let a = n.at(-1); const c = n.at(-2); c[0] === a[0] && c[1] === a[1] && n.pop(); const i = n.at(0); a = n.at(-1), (i[0] !== a[0] || i[1] !== a[1]) && n.push(i); const s = n.map((u) => [u[1], u[0]]); o.push([s]); } return K.multiPolygon(o); } /** * Check if the port is in the EU MRV boundaries. * @param port 位置 * @param options * @returns true if the port is in the EU MRV boundaries. */ static async isInEU(e, o = {}) { const t = K.point([e.lng, e.lat]), r = K.booleanPointInPolygon(t, j.euMrvBoundaries, { ignoreBoundary: !1 }); return W == null || W.info("[%s] port(%j) is in-eu: %s", o.requestId, e, r), r; } /** * FuelEU delayed in Norway and Iceland(https://www.sdir.no/en/news/FuelEu_delayed_in_Norway/) * @param port 位置 * @param options * @returns true if the port is in the FuelEU exclude area. */ static async isFuelEUExclude(e, o = {}) { const t = K.point([e.lng, e.lat]), r = K.booleanPointInPolygon(t, j.fuelEuExclude, { ignoreBoundary: !1 }); return W == null || W.info("[%s] port(%j) is excluded from eu: %s", o.requestId, e, r), r; } }; Y(j, "boundaries", { type: "Feature", properties: {}, geometry: { type: "MultiPolygon", coordinates: [ [ [ [10.10742, 58.07788], [6.81152, 56.84897], [7.4707, 55.22902], [7.60254, 54.1367], [4.30664, 53.46189], [2.68066, 52.07951], [1.88965, 51.20688], [0.79102, 50.62507], [-0.13184, 49.86632], [-3.2959, 49.83798], [-5.75684, 48.40003], [-11.7334, 41.54148], [-9.66797, 35.88905], [-6.89941, 35.81781], [-5.81726, 35.9113], [-4.3396, 36.16449], [-0.41748, 36.75649], [4.72412, 38.09998], [9.82178, 37.77071], [11.5741, 37.20408], [12.01355, 36.4257], [12.48596, 35.24113], [19.75342, 35.56798], [25.33447, 33.50476], [32.65137, 33.4131], [35.17822, 34.84988], [35.37598, 36.26199], [31.94824, 35.58585], [28.93799, 35.83563], [28.49854, 36.41244], [28.32825, 36.58025], [27.70203, 36.4257], [27.35046, 36.61553], [27.23511, 36.72568], [27.46033, 36.87083], [27.27905, 36.9455], [27.1637, 37.02448], [27.13623, 37.26968], [27.11975, 37.48358], [27.01538, 37.58594], [26.95358, 37.65882], [26.99066, 37.68817], [27.09503, 37.70338], [27.13898, 37.76854], [27.05658, 37.84558], [26.80939, 37.95503], [26.1145, 38.11295], [26.19141, 38.35458], [26.2793, 38.44068], [26.32874, 38.48369], [26.3356, 38.56427], [26.26694, 38.65442], [26.61987, 38.83543], [26.73523, 39.06611], [26.55396, 39.25778], [26.4798, 39.35766], [26.48941, 39.44998], [26.35345, 39.45104], [26.15707, 39.43195], [25.97717, 39.44044], [26.07742, 39.69345], [26.10077, 39.80432], [26.04721, 39.89499], [25.98679, 39.97817], [26.21887, 40.39676], [26.4386, 40.55555], [26.06506, 40.54303], [25.9552, 40.70563], [26.0424, 40.72853], [26.07193, 40.72384], [26.32324, 40.83044], [26.48804, 41.01307], [26.55396, 41.19519], [26.89453, 41.52503], [27.16919, 41.80408], [28.34473, 41.88592], [30.36621, 44.90258], [29.68506, 45.32125], [22.76367, 54.40614], [19.59961, 54.47004], [18.0835, 55.71473], [10.65674, 59.06315], [10.10742, 58.07788] ] ], [ [ [-24.16992, 67.27204], [-26.80664, 64.77413], [-18.54492, 62.14498], [-9.31641, 63.62674], [-8.4375, 67.33986], [-18.28125, 68.39918], [-24.16992, 67.27204] ] ], [ [ [10.67871, 59.08574], [9.22852, 57.9615], [4.57031, 57.93818], [3.07617, 62.85515], [7.29492, 65.21989], [11.38184, 67.3906], [14.98535, 70.5249], [26.80664, 71.96539], [33.61816, 70.31874], [31.46484, 70.37785], [30.81116, 69.91521], [30.85785, 69.79983], [30.82764, 69.78465], [30.92651, 69.67427], [30.95398, 69.56139], [30.66833, 69.52491], [30.35522, 69.61503], [30.12451, 69.67045], [30.08057, 69.42669], [29.13574, 68.98993], [28.74023, 68.56038], [30.32227, 67.74276], [29.42139, 66.64427], [30.76172, 65.65827], [32.16797, 62.71446], [28.07007, 60.60315], [27.79541, 60.33782], [28.67432, 60.0429], [27.90527, 59.86137], [27.86133, 59.54546], [28.14697, 59.44508], [28.30078, 59.04055], [28.14697, 58.24016], [28.10303, 57.563], [28.45459, 56.02295], [26.2793, 54.00777], [24.30176, 53.73572], [23.33496, 53.74871], [22.76367, 54.40614], [22.82959, 54.90188], [22.17041, 55.10352], [21.46729, 55.22902], [21.09375, 55.20395], [21.00586, 55.62179], [16.09497, 56.57764], [10.67871, 59.08574] ] ], [ [ [-7.20154, 55.06893], [-6.99829, 55.17887], [-6.86646, 55.23529], [-7.11914, 55.44771], [-8.08594, 55.5193], [-9.25049, 54.99337], [-10.85449, 53.96901], [-10.85449, 52.38901], [-10.21729, 50.99993], [-7.40479, 51.60437], [-6.24023, 52.01194], [-5.66895, 52.65639], [-5.76782, 53.7617], [-6.05896, 53.9884], [-6.25671, 54.1045], [-6.95984, 54.23634], [-7.43225, 54.12704], [-7.94312, 54.29409], [-8.15186, 54.45407], [-8.02551, 54.54021], [-7.68494, 54.62934], [-7.85522, 54.74048], [-7.58606, 54.73731], [-7.4762, 54.86712], [-7.39929, 54.99022], [-7.20154, 55.06893] ] ], [ [ [-15.16113, 29.36303], [-18.21533, 29.31514], [-18.28125, 27.23509], [-15.35889, 27.17647], [-13.93066, 27.73216], [-13.12866, 29.02735], [-12.84302, 29.77391], [-15.16113, 29.36303] ] ], [ [ [-61.59485, 16.57829], [-62.00684, 16.35177], [-61.96289, 15.85567], [-61.61682, 15.71295], [-61.0675, 15.7764], [-60.82031, 16.13554], [-60.88623, 16.46769], [-61.40259, 16.62567], [-61.59485, 16.57829] ] ], [ [ [-53.83301, 6.06409], [-54.14063, 5.58318], [-54.54712, 4.97056], [-54.32739, 3.28311], [-54.56909, 2.30651], [-53.80005, 1.90029], [-52.59155, 2.06498], [-51.87744, 3.72175], [-51.61377, 4.10537], [-51.60278, 4.23686], [-51.5918, 4.91583], [-53.00903, 5.9439], [-53.83301, 6.06409] ] ], [ [ [-61.16089, 14.95009], [-61.41907, 14.80675], [-61.17737, 14.36551], [-60.69397, 14.35487], [-60.5896, 14.58358], [-60.83679, 14.85985], [-61.16089, 14.95009] ] ], [ [ [45.20325, -12.57065], [44.95605, -12.55456], [44.94507, -12.76359], [44.94507, -13.02597], [45.16479, -13.10623], [45.32959, -13.02061], [45.35706, -12.80109], [45.30212, -12.63498], [45.20325, -12.57065] ] ], [ [ [-63.13705, 18.0943], [-63.16383, 18.09071], [-63.17276, 18.06101], [-63.15491, 18.04403], [-63.13362, 18.05317], [-63.1089, 18.05317], [-63.09311, 18.04403], [-63.08006, 18.0486], [-63.06702, 18.0584], [-63.05122, 18.06297], [-63.02856, 18.05383], [-63.01071, 18.05252], [-62.98187, 18.0486], [-62.94617, 18.10539], [-62.95715, 18.14585], [-63.06358, 18.14259], [-63.1192, 18.12171], [-63.13705, 18.0943] ] ], [ [ [55.31616, -20.73557], [54.94263, -21.1255], [55.46997, -21.55528], [56.15112, -21.49396], [56.40381, -20.86908], [55.67871, -20.48877], [55.31616, -20.73557] ] ], [ [ [-16.83655, 33.19733], [-17.44629, 33.00866], [-17.65503, 32.5607], [-16.75415, 32.30571], [-15.75989, 32.28249], [-16.00159, 33.16974], [-16.3092, 33.42686], [-16.83655, 33.19733] ] ], [ [ [-26.72974, 39.3343], [-31.15723, 40.00237], [-31.76147, 39.45316], [-30.53101, 38.03079], [-26.15845, 36.85325], [-23.68652, 36.46547], [-23.48877, 38.39334], [-26.16943, 39.15562], [-26.72974, 39.3343] ] ] ] } }), Y(j, "euMrvBoundaries", { type: "Feature", properties: {}, geometry: { type: "MultiPolygon", coordinates: [ [ [ [10.10742, 58.07788], [6.81152, 56.84897], [7.4707, 55.22902], [7.60253, 54.1367], [4.30663, 53.46188], [2.68067, 52.07952], [1.88965, 51.20688], [0.79102, 50.62507], [-0.13183, 49.86632], [-2.06818, 49.8433], [-2.0462, 49.68007], [-2.14233, 49.54125], [-1.81823, 49.21042], [-1.91987, 48.86472], [-2.406, 48.81228], [-3.52662, 48.96398], [-5.75683, 48.40003], [-11.7334, 41.54148], [-9.66797, 35.88905], [-6.89942, 35.81782], [-6.37618, 35.92687], [-6.08643, 35.97023], [-5.85708, 35.9491], [-5.56183, 35.95745], [-5.49042, 35.98023], [-5.4578, 36.00607], [-5.35308, 36.04217], [-5.33763, 36.05493], [-5.35068, 36.06187], [-5.36305, 36.07657], [-5.3754, 36.09627], [-5.39668, 36.13095], [-5.38708, 36.14702], [-5.3627, 36.16005], [-5.35085, 36.15632], [-5.33248, 36.1595], [-5.23293, 36.14342], [-5.22675, 36.1057], [-5.25627, 36.05908], [-5.29198, 35.98245], [-5.38673, 35.95855], [-5.39017, 35.92353], [-5.37935, 35.91185], [-5.37643, 35.8935], [-5.373, 35.88182], [-5.35308, 35.87292], [-5.34278, 35.87403], [-5.32493, 35.85622], [-5.23842, 35.87903], [-5.14228, 35.96578], [-5.10933, 36.05465], [-5.0283, 36.08352], [-4.8539, 36.08458], [-4.3396, 36.16448], [-0.41748, 36.75648], [4.72412, 38.09998], [9.82178, 37.77072], [11.5741, 37.20408], [12.01355, 36.4257], [12.48597, 35.24113], [14.91943, 35.62158], [16.61133, 37.30028], [17.73193, 39.01065], [18.67675, 39.58875], [18.7207, 40.4971], [17.13867, 41.44273], [16.32568, 42.03297], [17.81982, 42.67437], [18.55042, 42.34637], [18.5669, 42.39102], [18.59437, 42.44575], [17.69897, 43.06888], [15.79833, 44.80912], [16.36963, 45.35987], [17.77588, 45.12005], [19.0503, 44.80133], [18.84155, 45.36758], [19.30298, 45.98933], [20.1709, 46.157], [21.03882, 45.65245], [21.6211, 45.10455], [21.44532, 44.74673], [22.31323, 44.52785], [23.00537, 44.10337], [22.85157, 43.19717], [22.36817, 42.4721], [22.91748, 41.6565], [22.63183, 41.07935], [21.57715, 40.94672], [20.61035, 40.3298], [20.30137, 39.7093], [20.17398, 39.6517], [20.0909, 39.68235], [20.04525, 39.6961], [20.03392, 39.70072], [20.01812, 39.6945], [20.0104, 39.69173], [20.00163, 39.68315], [19.98207, 39.67945], [19.9553, 39.73755], [19.98482, 39.78453], [19.86328, 39.96238], [19.27002, 40.03182], [19.17938, 39.67972], [20.25878, 37.21283], [25.33447, 33.50477], [32.65137, 33.4131], [35.17822, 34.84988], [35.37598, 36.26198], [31.55273, 35.54563], [29.69363, 35.96633], [29.6648, 36.11652], [29.61117, 36.14875], [29.6158, 36.16733], [29.59155, 36.17778], [29.56532, 36.1629], [29.5376, 36.16338], [29.51305, 36.18347], [29.46842, 36.16615], [29.34723, 36.1595], [28.49853, 36.41243], [28.32825, 36.58025], [27.98767, 36.5008], [27.92725, 36.54827], [27.93137, 36.62765], [27.9039, 36.70145], [27.77687, 36.6921], [27.68967, 36.6045], [27.33535, 36.6001], [27.23512, 36.72568], [27.41638, 36.81148], [27.48298, 36.86643], [27.44865, 36.91422], [27.40265, 36.94495], [27.28523, 36.94112], [27.22652, 36.94687], [27.18087, 36.97485], [27.11838, 37.00145], [27.17262, 37.04942], [27.0813, 37.14062], [27.17193, 37.25875], [27.11425, 37.39635], [27.06207, 37.53587], [26.95358, 37.65882], [26.99067, 37.68817], [27.09503, 37.70338], [27.13898, 37.76853], [27.05658, 37.84558], [26.80938, 37.95503], [26.11588, 38.11727], [26.19142, 38.35458], [26.2793, 38.44068], [26.32873, 38.48368], [26.3356, 38.56427], [26.26693, 38.65442], [26.61987, 38.83543], [26.73523, 39.06612], [26.55397, 39.25778], [26.4798, 39.35767], [26.48942, 39.44998], [26.35345, 39.45103], [26.15707, 39.43195], [25.97717, 39.44043], [26.02112, 39.67548], [25.9552, 39.73677], [25.85907, 39.79588], [25.7602, 39.8992], [25.68055, 39.94975], [25.56243, 40.06547], [25.5954, 40.23132], [26.21887, 40.39677], [26.4386, 40.55555], [26.06507, 40.54303], [25.9552, 40.70563], [26.0424, 40.72853], [26.07193, 40.72383], [26.32323, 40.83043], [26.48803, 41.01307], [26.55397, 41.19518], [26.89453, 41.52503], [27.16918, 41.80408], [28.34473, 41.88592], [30.36622, 44.90258], [29.68507, 45.32125], [22.76367, 54.40613], [19.59962, 54.47003], [18.0835, 55.71473], [10.9156, 58.94363], [10.6382, 58.95886], [10.33813, 58.93159], [10.12939, 58.6598], [10.10742, 58.07788] ] ], [ [ [-24.16992, 67.27203], [-26.80663, 64.77413], [-18.54492, 62.14498], [-9.31642, 63.62673], [-8.4375, 67.33987], [-18.28125, 68.39918], [-24.16992, 67.27203] ] ], [ [ [10.67871, 59.08574], [9.22852, 57.9615], [4.57031, 57.93818], [3.07617, 62.85515], [7.29492, 65.21989], [11.38184, 67.3906], [14.98535, 70.5249], [26.80664, 71.96539], [33.61816, 70.31874], [31.46484, 70.37785], [30.81116, 69.91521], [30.85785, 69.79983], [30.82764, 69.78465], [30.92651, 69.67427], [30.95398, 69.56139], [30.66833, 69.52491], [30.35522, 69.61503], [30.12451, 69.67045], [30.08057, 69.42669], [29.13574, 68.98993], [28.74023, 68.56038], [30.32227, 67.74276], [29.42139, 66.64427], [30.76172, 65.65827], [32.16797, 62.71446], [28.07007, 60.60315], [27.79541, 60.33782], [28.67432, 60.0429], [27.90527, 59.86137], [27.86133, 59.54546], [28.14697, 59.44508], [28.30078, 59.04055], [28.14697, 58.24016], [28.10303, 57.563], [28.45459, 56.02295], [26.2793, 54.00777], [24.30176, 53.73572], [23.33496, 53.74871], [22.76367, 54.40614], [22.82959, 54.90188], [22.17041, 55.10352], [21.46729, 55.22902], [21.09375, 55.20395], [21.00586, 55.62179], [16.09497, 56.57764], [10.67871, 59.08574] ] ], [ [ [-7.20154, 55.06893], [-6.99829, 55.17887], [-6.86646, 55.23529], [-7.11914, 55.44771], [-8.08594, 55.5193], [-9.25049, 54.99337], [-10.85449, 53.96901], [-10.85449, 52.38901], [-10.21729, 50.99993], [-7.40479, 51.60437], [-6.24023, 52.01194], [-5.66895, 52.65639], [-5.76782, 53.7617], [-6.05896, 53.9884], [-6.25671, 54.1045], [-6.95984, 54.23634], [-7.43225, 54.12704], [-7.94312, 54.29409], [-8.15186, 54.45407], [-8.02551, 54.54021], [-7.68494, 54.62934], [-7.85522, 54.74048], [-7.58606, 54.73731], [-7.4762, 54.86712], [-7.39929, 54.99022], [-7.20154, 55.06893] ] ], [ [ [-15.16113, 29.36303], [-18.21533, 29.31514], [-18.28125, 27.23509], [-15.35889, 27.17647], [-13.93066, 27.73216], [-13.12866, 29.02735], [-12.84302, 29.77391], [-15.16113, 29.36303] ] ], [ [ [-61.59485, 16.57829], [-62.00684, 16.35177], [-61.96289, 15.85567], [-61.61682, 15.71295], [-61.0675, 15.7764], [-60.82031, 16.13554], [-60.88623, 16.46769], [-61.40259, 16.62567], [-61.59485, 16.57829] ] ], [ [ [-53.83301, 6.06409], [-54.14063, 5.58318], [-54.54712, 4.97056], [-54.32739, 3.28311], [-54.56909, 2.30651], [-53.80005, 1.90029], [-52.59155, 2.06498], [-51.87744, 3.72175], [-51.61377, 4.10537], [-51.60278, 4.23686], [-51.5918, 4.91583], [-53.00903, 5.9439], [-53.83301, 6.06409] ] ], [ [ [-61.16089, 14.95009], [-61.41907, 14.80675], [-61.17737, 14.36551], [-60.69397, 14.35487], [-60.5896, 14.58358], [-60.83679, 14.85985], [-61.16089, 14.95009] ] ], [ [ [45.20325, -12.57065], [44.95605, -12.55456], [44.94507, -12.76359], [44.94507, -13.02597], [45.16479, -13.10623], [45.32959, -13.02061], [45.35706, -12.80109], [45.30212, -12.63498], [45.20325, -12.57065] ] ], [ [ [-63.13705, 18.0943], [-63.16383, 18.09071], [-63.17276, 18.06101], [-63.15491, 18.04403], [-63.13362, 18.05317], [-63.1089, 18.05317], [-63.09311, 18.04403], [-63.08006, 18.0486], [-63.06702, 18.0584], [-63.05122, 18.06297], [-63.02856, 18.05383], [-63.01071, 18.05252], [-62.98187, 18.0486], [-62.94617, 18.10539], [-62.95715, 18.14585], [-63.06358, 18.14259], [-63.1192, 18.12171], [-63.13705, 18.0943] ] ], [ [ [55.31616, -20.73557], [54.94263, -21.1255], [55.46997, -21.55528], [56.15112, -21.49396], [56.40381, -20.86908], [55.67871, -20.48877], [55.31616, -20.73557] ] ], [ [ [-16.83655, 33.19733], [-17.44629, 33.00866], [-17.65503, 32.5607], [-16.75415, 32.30571], [-15.75989, 32.28249], [-16.00159, 33.16974], [-16.3092, 33.42686], [-16.83655, 33.19733] ] ], [ [ [-26.72974, 39.3343], [-31.15723, 40.00237], [-31.76147, 39.45316], [-30.53101, 38.03079], [-26.15845, 36.85325], [-23.68652, 36.46547], [-23.48877, 38.39334], [-26.16943, 39.15562], [-26.72974, 39.3343] ] ] ] } }), Y(j, "fuelEuExclude", { type: "Feature", properties: {}, geometry: { type: "MultiPolygon", coordinates: [ [ [ [10.35048, 58.97197], [9.22852, 57.9615], [4.57032, 57.93818], [3.07617, 62.85515], [7.29492, 65.21988], [11.38183, 67.3906], [14.98535, 70.5249], [26.80663, 71.96538], [31.48682, 70.39262], [30.55298, 70.06183], [30.97047, 69.93783], [30.95947, 69.87367], [30.90453, 69.83773], [31.0199, 69.5518], [30.60242, 69.51147], [30.2124, 69.62652], [29.39942, 68.9978], [28.76222, 69.17037], [29.13573, 69.67998], [28.34473, 69.74855], [27.99317, 70.07307], [16.74317, 66.99883], [12.87598, 62.93523], [13.44727, 61.2068], [12.46673, 59.97838], [12.18383, 59.86688], [11.95862, 59.66913], [11.69768, 59.59693], [11.88172, 59.29113], [11.77185, 59.0038], [11.651, 58.87627], [11.53563, 58.87627], [11.45737, 58.88762], [11.45873, 58.933], [11.45598, 58.98542], [11.41582, 59.03685], [11.3839, 59.08822], [11.33927, 59.1143], [11.30423, 59.10583], [11.18477, 59.08008], [11.15662, 59.08008], [11.10855, 59.00238], [11.07147, 58.97815], [10.91783, 58.94283], [10.88677, 58.94807], [10.74052, 58.95567], [10.35048, 58.97197] ] ], [ [ [-24.16992, 67.27203], [-26.80663, 64.77413], [-18.54492, 62.14498], [-9.31642, 63.62673], [-8.4375, 67.33987], [-18.28125, 68.39918], [-24.16992, 67.27203] ] ] ] } }); let _ = j, y; try { y = X.getLogger("eu-ets"); } catch { } finally { } const s5 = { 2024: 0.4, 2025: 0.7, 2026: 1 }; var m5 = /* @__PURE__ */ ((l) => (l[l.PROP5 = 0.99] = "PROP5", l[l.PROP10 = 0.97] = "PROP10", l[l.PROP15 = 0.95] = "PROP15", l[l.NONE = 1] = "NONE", l))(m5 || {}); const U = { MDO_Factor: { co2: 3.206, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0427, //MJ/g wtt: 14.4, //gCO2eq/MJ rwd: 1 }, MGO_Factor: { co2: 3.206, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0427, //MJ/g wtt: 14.4, //gCO2eq/MJ rwd: 1 }, HFO_Factor: { co2: 3.114, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0405, //MJ/g wtt: 13.5, //gCO2eq/MJ rwd: 1 }, LFO_Factor: { co2: 3.151, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.041, //MJ/g wtt: 13.2, //gCO2eq/MJ rwd: 1 }, LNG_OTTO_MEDIUM_SPD_Factor: { co2: 2.75, // gCO2/gFuel ch4: 0, n2o: 11e-5, cj: 3.1, // 燃料泄漏排放因子 lcv: 0.0491, //MJ/g wtt: 18.5 //gCO2eq/MJ }, LNG_OTTO_SLOW_SPD_Factor: { co2: 2.75, // gCO2/gFuel ch4: 0, n2o: 11e-5, cj: 1.7, // 燃料泄漏排放因子 lcv: 0.0491, //MJ/g wtt: 18.5 //gCO2eq/MJ }, LNG_DIESEL_SLOW_SPD_Factor: { co2: 2.75, // gCO2/gFuel ch4: 0, n2o: 11e-5, cj: 0.2, // 燃料泄漏排放因子 lcv: 0.0491, //MJ/g wtt: 18.5 //gCO2eq/MJ }, LNG_LBSI_Factor: { co2: 2.75, // gCO2/gFuel ch4: 0, n2o: 11e-5, cj: 2.6, // 燃料泄漏排放因子 lcv: 0.0491, //MJ/g wtt: 18.5 //gCO2eq/MJ }, ETHANE_Factor: { co2: 2.927, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0464, //MJ/g wtt: 18.5 //gCO2eq/MJ }, LPG_PROPANE_Factor: { co2: 3, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.046, //MJ/g wtt: 7.8 //gCO2eq/MJ }, LPG_BUTANE_Factor: { co2: 3.03, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.046, //MJ/g wtt: 7.8 //gCO2eq/MJ }, // LPG_Factor: { // co2: 3.03, // gCO2/gFuel // }, METHANOL_Factor: { co2: 1.375, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0199, //MJ/g wtt: 31.3 //gCO2eq/MJ }, CUSTOM_Factor: { co2: 3.114, // gCO2/gFuel ch4: 5e-5, n2o: 18e-5, lcv: 0.0405, //MJ/g wtt: 13.5, //gCO2eq/MJ E: 90.389, rwd: 1 } }, F = { CO2: 1, CH4: 28, N2O: 265 }, v = { CO2: 1, CH4: 25, N2O: 298 }; var T = /* @__PURE__ */ ((l) => (l.HFO = "HFO", l.LFO = "LFO", l.MGO = "MGO", l.MDO = "MDO", l.LNG_OTTO_MEDIUM_SPD = "LNG_OTTO_MEDIUM_SPD", l.LNG_OTTO_SLOW_SPD = "LNG_OTTO_SLOW_SPD", l.LNG_DIESEL_SLOW_SPD = "LNG_DIESEL_SLOW_SPD", l.LNG_LBSI = "LNG_LBSI", l.LPG_PROPANE = "LPG_PROPANE", l.LPG_BUTANE = "LPG_BUTANE", l.LNG = "LNG", l.METHANOL = "METHANOL", l.BIODIESEL = "BIODIESEL", l.ETHANE = "ETHANE", l))(T || {}), M5 = /* @__PURE__ */ ((l) => (l.EU_MRV_Non_EU = "Non EU", l.EU_MRV_Arrived_EU = "Arrived EU", l.EU_MRV_Departed_EU = "Departed EU", l.EU_MRV_Between_EU = "Between EU", l))(M5 || {}); class u5 { /** * 计算MRV (Monitoring/Reporting/Verification) 和 TTW (Tank to Wake) * @param cons 燃料消耗, 单位 mt * @param fc 排放因子, 单位 gGHG/gFuel * @param cj 燃料泄漏系数, 单位 % * @param lcv 燃料热值, 单位 MJ/g * @param ch4 是否是 CH4(甲烷) * @returns { * mrv, 燃料产生的温室气体排放量, 单位 mt * ttw, 燃料从Tank到Wake的温室气体排放常量, 单位 gGHG/gFuel * } */ static calculateMRV(e, o, t, r, n) { let a = 0, c = 0; return t ? n ? (a = e * (1 - t / 100) * o + e * (t / 100), c = ((1 - t / 100) * o + t / 100) / r) : (a = e * (1 - t / 100) * o, c = (1 - t / 100) * o / r) : (a = e * o, c = o / r), { mrv: a, ttw: c }; } /** *计算WtT (Well to Tank) GHG Intensity * @param factor * @returns WtT GHG Intensity, 单位 gCO2eq/MJ */ static calculateWtT(e) { let o = 0; return e.wtt ? o = e.wtt : e.E && e.lcv && (o = e.E - e.co2 / e.lcv), o; } /** * 计算 CO2 MRV (Monitoring/Reporting/Verification) * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param customFactor 自定义排放因子 * @param options 配置项 * @returns { mrv, ttw } */ static calculateCO2MRV(e, o, t, r = {}) { const n = U[`${o}_Factor`] || U.CUSTOM_Factor, a = (t == null ? void 0 : t.co2) || n.co2, c = (t == null ? void 0 : t.cj) || n.cj, i = (t == null ? void 0 : t.lcv) || n.lcv, { mrv: s, ttw: u } = this.calculateMRV(e, a, c, i || 0); return y == null || y.info("[%s] co2 emission: %j", r.requestId, { cons: e, type: o, factor: n, customFactor: t, mrv: s, ttw: u }), { mrv: Math.round(s * F.CO2 * 1e5) / 1e5, mrvGWP: F.CO2, ttw: Math.round(u * v.CO2 * 1e5) / 1e5, ttwGWP: v.CO2, fc: a, cj: c, lcv: i }; } /** * 计算 CH4 MRV (Monitoring/Reporting/Verification) * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param customFactor 自定义排放因子 * @param options 配置项 * @returns { mrv, ttw } */ static calculateCH4MRV(e, o, t, r = {}) { const n = U[`${o}_Factor`] || U.CUSTOM_Factor, a = (t == null ? void 0 : t.ch4) || n.ch4, c = (t == null ? void 0 : t.cj) || n.cj, i = (t == null ? void 0 : t.lcv) || n.lcv, { mrv: s, ttw: u } = this.calculateMRV(e, a || 0, c, i || 0, !0); return y == null || y.info("[%s] ch4 emission: %j", r.requestId, { cons: e, type: o, factor: n, customFactor: t, mrv: s, ttw: u }), { mrv: Math.round(s * F.CH4 * 1e5) / 1e5, mrvGWP: F.CH4, ttw: Math.round(u * v.CH4 * 1e5) / 1e5, ttwGWP: v.CH4, fc: a, cj: c, lcv: i }; } /** * 计算 N2O MRV (Monitoring/Reporting/Verification) * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param customFactor 自定义排放因子 * @param options 配置项 * @returns { mrv, ttw } */ static calculateN2OMRV(e, o, t, r = {}) { const n = U[`${o}_Factor`] || U.CUSTOM_Factor, a = (t == null ? void 0 : t.n2o) || n.n2o, c = (t == null ? void 0 : t.cj) || n.cj, i = (t == null ? void 0 : t.lcv) || n.lcv, { mrv: s, ttw: u } = this.calculateMRV(e, a || 0, c, i || 0); return y == null || y.info("[%s] n2o emission: %j", r.requestId, { cons: e, type: o, factor: n, customFactor: t, mrv: s, ttw: u }), { mrv: Math.round(s * F.N2O * 1e5) / 1e5, mrvGWP: F.N2O, ttw: Math.round(u * v.N2O * 1e5) / 1e5, ttwGWP: v.N2O, fc: a, cj: c, lcv: i }; } /** * 计算单一燃料的GHG MRV (Monitoring/Reporting/Verification) * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param year 年份 * @param price 碳税价格 * @param options * @return { * ghg, MRV需要报告的温室气体排放量,2024之后需要报告CO2, CH4, N2O, 单位 mt * ghg2, ETS需要报告的温室气体排放量,2026之后需要报告CO2, CH4, N2O, 单位 mt * euas, 需要交纳的EUAS份额, 2026年以后需全额交纳, 单位 mt * price, 碳税价格, 单位 €/tCO2, 常量 * year, 年份, 常量 * ratio, EUAS交纳比例, 常量 * cost, EUAS成本, 单位 € * energy, 燃料转能量, 计算fuelEU时使用, 单位 TJ * lcv, 燃料低位热值, 计算fuelEU时使用, 单位 MJ/g, 常量(不同燃料取值不同) * wtt, Well to Tank, 计算fuelEU时使用, 单位 gCO2eq/MJ, 常量(不同燃料取值不同) * ttw, Tank to Wake, 计算fuelEU时使用, 单位 gGHG/gFuel, 常量(不同燃料取值不同) * co2, CO2排放量, 单位 mt * ch4, CH4排放量, 单位 mt * n2o, N2O排放量, 单位 mt * } * @deprecated */ static calculateGHGMRV(e, o, t = 64.56, r = 2025, n = {}) { const a = this.calculateCO2MRV(e, o, n.factor, n), c = this.calculateCH4MRV(e, o, n.factor, n), i = this.calculateN2OMRV(e, o, n.factor, n), s = n.factor || U[`${o}_Factor`] || U.CUSTOM_Factor; let u = 0, R = 0; const f = this.getEUETSRatio(r); r >= 2026 ? R = a.mrv + c.mrv + i.mrv : R = a.mrv, r >= 2024 ? u = a.mrv + c.mrv + i.mrv : u = a.mrv, u = Math.round(u * 1e5) / 1e5, R = Math.round(R * 1e5) / 1e5; const N = Math.round(R * f * 1e5) / 1e5, G = Math.round(t * N * 100) / 100, m = Math.round(this.calculateWtT(s) * 1e5) / 1e5, w = Math.round((a.ttw + c.ttw + i.ttw) * 1e5) / 1e5, S = s.lcv || 0, M = Math.round(e * S * 1e5) / 1e5; return { ghg: u, ghg2: R, euas: N, price: t, year: r, ratio: f, cost: G, energy: M, lcv: S, wtt: m, ttw: w, co2: a, ch4: c, n2o: i }; } /** * 计算单一燃料的GHG MRV (Monitoring/Reporting/Verification) * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param year 年份 * @param price 碳税价格 * @param options * @return { * ghg, MRV需要报告的温室气体排放量,2024之后需要报告CO2, CH4, N2O, 单位 mt * ghg2, ETS需要报告的温室气体排放量,2026之后需要报告CO2, CH4, N2O, 单位 mt * euas, 需要交纳的EUAS份额, 2026年以后需全额交纳, 单位 mt * price, 碳税价格, 单位 €/tCO2, 常量 * year, 年份, 常量 * ratio, EUAS交纳比例, 常量 * cost, EUAS成本, 单位 € * co2, CO2排放量, 单位 mt * ch4, CH4排放量, 单位 mt * n2o, N2O排放量, 单位 mt * } */ static calculateSingleGHGMRV(e, o, t = 64.56, r = 2025, n = {}) { const a = this.calculateCO2MRV(e, o, n.factor, n), c = this.calculateCH4MRV(e, o, n.factor, n), i = this.calculateN2OMRV(e, o, n.factor, n), s = n.factor || U[`${o}_Factor`] || U.CUSTOM_Factor; let u = 0, R = 0; const f = this.getEUETSRatio(r); r >= 2026 ? R = a.mrv + c.mrv + i.mrv : R = a.mrv, r >= 2024 ? u = a.mrv + c.mrv + i.mrv : u = a.mrv, u = Math.round(u * 1e5) / 1e5, R = Math.round(R * 1e5) / 1e5; const N = Math.round(R * f * 1e5) / 1e5, G = Math.round(t * N * 100) / 100; return { ghg: u, ghg2: R, euas: N, price: t, year: r, ratio: f, cost: G, co2: a, ch4: c, n2o: i, factor: s }; } /** * 计算单一燃料的FuelEU * @param cons 油耗, 单位 mt * @param type 油耗类型 * @param options * @return { * energy, 燃料转能量, 计算fuelEU时使用, 单位 MJ * lcv, 燃料低位热值, 计算fuelEU时使用, 单位 MJ/g, 常量(不同燃料取值不同) * wtt, Well to Tank, 计算fuelEU时使用, 单位 gCO2eq/MJ, 常量(不同燃料取值不同) * ttw, Tank to Wake, 计算fuelEU时使用, 单位 gGHG/gFuel, 常量(不同燃料取值不同) * co2, CO2排放量, 单位 mt * ch4, CH4排放量, 单位 mt * n2o, N2O排放量, 单位 mt * } */ static calculateSingleFuelEU(e, o, t = {}) { const r = this.calculateCO2MRV(e, o, t.factor, t), n = this.calculateCH4MRV(e, o, t.factor, t), a = this.calculateN2OMRV(e, o, t.factor, t), c = t.factor || U[`${o}_Factor`] || U.CUSTOM_Factor, i = Math.round(this.calculateWtT(c) * 1e5) / 1e5, s = Math.round((r.ttw + n.ttw + a.ttw) * 1e5) / 1e5, u = c.lcv || 0; return { energy: Math.round(e * u * 1e5) / 1e5, lcv: u, wtt: i, ttw: s, rawTtw: { co2: r.ttw, ch4: n.ttw, n2o: a.ttw }, cons: e, factor: c }; } /** * 计算多燃料的GHG MRV * @param fuels 按类型分组油耗类型及消耗 * @param ek 岸电消耗能量,单位 kwh 1kwh = 3.6MJ * @param year 年份 * @param options */ static calculateMultiFuelEU(e, o = 0, t = 2025, r = {}) { o = o * 3.6 || 0; const n = { euets: { ...F }, fuelEU: { ...v } }, a = e.reduce((m, w) => { var d; const S = w.customFactor || w.factor, M = this.calculateSingleFuelEU(w.cons || w.consumption || 0, w.type, { requestId: r.requestId, factor: S }), C = m[w.type] || { energy: 0, energy2: 0, wttEmission: 0, ttwEmission: 0, wtwEmission: 0, cons: 0 }, b = Math.round((C.wttEmission + M.wtt * M.energy) * 1e5) / 1e5, P = Math.round((C.ttwEmission + M.ttw * M.energy) * 1e5) / 1e5, O = Math.round((C.wtwEmission + b + P) * 1e5) / 1e5; return m[w.type] = { cons: Math.round((C.cons + M.cons) * 1e5) / 1e5, // 累计能量, TJ energy: Math.round((C.energy + M.energy) * 1e5) / 1e5, // 累计能量, TJ, 使用rwd, 作为分母时使用 energy2: Math.round((C.energy2 + M.energy * (((d = M.factor) == null ? void 0 : d.rwd) || 1)) * 1e5) / 1e5, // 排放已计算,作为分母时要使用rwd wtt: M.wtt, wttEmission: b, ttw: M.ttw, ttwEmission: P, wtw: Math.round((M.wtt + M.ttw) * 1e5) / 1e5, wtwEmission: O, lcv: M.lcv, rawTtw: M.rawTtw, factor: M.factor, gwp: n }, m; }, {}), c = r.fwind || 1, i = Object.values(a).reduce( (m, w) => (m.wtt = Math.round((m.wtt + w.wtt) * 1e5) / 1e5, m.ttw = Math.round((m.ttw + w.ttw) * 1e5) / 1e5, m.energy = Math.round((m.energy + w.energy) * 1e5) / 1e5, m.energy2 = Math.round((m.energy2 + w.energy2) * 1e5) / 1e5, m.wtwEmission = Math.round((m.wtwEmission + w.wtwEmission) * 1e5) / 1e5, m.ttwEmission = Math.round((m.ttwEmission + w.ttwEmission) * 1e5) / 1e5, m.wttEmission = Math.round((m.wttEmission + w.wttEmission) * 1e5) / 1e5, m), { wtt: 0, ttw: 0, energy: 0, energy2: 0, wtwEmission: 0, wttEmission: 0, ttwEmission: 0 } ); let s = 0, u = 0, R = 0, f = 0, N = 0, G = 0; return t >= 2025 && (s = Math.round(i.wttEmission / (i.energy2 + o) * 1e5) / 1e5, u = Math.round(i.ttwEmission / (i.energy2 + o) * 1e5) / 1e5, R = Math.round(c * (s + u) * 1e5) / 1e5, f = this.calculateGHGITarget(t), N = Math.round((f - R) * (i.energy + o) * 1e8) / 1e8, G = N < 0 ? Math.round(Math.abs(N * 1e6) / (R * 41e3) * 2400) : 0), { year: t, fwind: c, energy: i.energy, energy2: i.energy2, ek: o, wtwEmission: Math.round((i.wttEmission + i.ttwEmission) * 1e5) / 1e5, wttGhgi: s, ttwGhgi: u, actualGhgi: R, targetGhgi: f, balance: N, penalty: G, fuels: a }; } /** * 计算多燃料的GHG MRV * @param fuels 按类型分组油耗类型及消耗 * @param year 年份 * @param price 碳税价格 * @param options */ static calculateMultiGHGMRV(e, o = 2025, t = 64.56, r = {}) { const n = { euets: { ...F }, fuelEU: { ...v } }, a = this.getEUETSRatio(o), c = e.reduce((s, u) => { const R = u.customFactor || u.factor, f = this.calculateSingleGHGMRV(u.cons || u.consumption || 0, u.type, t, o, { requestId: r.requestId, factor: R }), N = s[u.type] || { ghg: 0, ghg2: 0, euas: 0, cost: 0, cons: 0, co2: 0, ch4: 0, n2o: 0, factor: R, gwp: n }; return s[u.type] = { co2: Math.round((N.co2 + f.co2.mrv) * 1e5) / 1e5, ch4: Math.round((N.ch4 + f.ch4.mrv) * 1e5) / 1e5, n2o: Math.round((N.n2o + f.n2o.mrv) * 1e5) / 1e5, ghg: Math.round((N.ghg + f.ghg) * 1e5) / 1e5, ghg2: Math.round((N.ghg2 + f.ghg2) * 1e5) / 1e5, euas: Math.round((N.euas + f.euas) * 1e5) / 1e5, cost: Math.round((N.cost + f.cost) * 1e5) / 1e5, cons: Math.round((N.cons + (u.cons || u.consumption || 0)) * 1e5) / 1e5, factor: f.factor, gwp: n }, s; }, {}), i = Object.values(c).reduce( (s, u) => (s.ghg = Math.round((s.ghg + u.ghg) * 1e5) / 1e5, s.ghg2 = Math.round((s.ghg2 + u.ghg2) * 1e5) / 1e5, s.euas = Math.round((s.euas + u.euas) * 1e5) / 1e5, s.cost = Math.round((s.cost + u.cost) * 1e5) / 1e5, s.co2 = Math.round((s.co2 + u.co2) * 1e5) / 1e5, s.ch4 = Math.round((s.ch4 + u.ch4) * 1e5) / 1e5, s.n2o = Math.round((s.n2o + u.n2o) * 1e5) / 1e5, s), { ghg: 0, ghg2: 0, euas: 0, cost: 0, co2: 0, ch4: 0, n2o: 0 } ); return { year: o, price: t, ratio: a, ghg: i.ghg, ghg2: i.ghg2, euas: i.euas, cost: i.cost, fuels: c }; } /** * 计算MRV及FuelEU * @param fuels 按类型分组油耗类型及消耗 * @param year 年份 * @param price 碳税价格 * @param options * @deprecated */ static calculateGHGMRV2(e, o = 2025, t = 64.56, r = {}) { let n = 0, a = 0, c = 0, i = 0, s = 0, u = 0, R = 0; const f = /* @__PURE__ */ new Map(); for (const O of e) { const d = this.calculateGHGMRV(O.cons || O.consumption || 0, O.type, t, o, { requestId: r.requestId, factor: O.customFactor || O.factor }); n = Math.round((n + d.ghg) * 1e5) / 1e5, a = Math.round((a + d.ghg2) * 1e5) / 1e5, c = Math.round((c + d.euas) * 1e5) / 1e5, i = Math.round((i + d.cost) * 1e5) / 1e5, s = Math.round((s + d.energy) * 1e5) / 1e5, u = Math.round((u + d.wtt * d.energy) * 1e5) / 1e5, R = Math.round((R + d.ttw * d.energy) * 1e5) / 1e5; const E = f.get(O.type) || { cons: 0, ghg: 0, ghg2: 0, co2: 0, ch4: 0, n2o: 0, euas: 0, cost: 0, energy: 0, wtt: 0, ttw: { total: 0, co2: 0, ch4: 0, n2o: 0 }, lcv: 0, wtw: 0, type: O.type, wttEmission: 0, ttwEmission: 0, wtwEmission: 0 }; E.cons = Math.round((E.cons + (O.cons || O.consumption || 0)) * 1e5) / 1e5, E.ghg = Math.round((E.ghg + d.ghg) * 1e5) / 1e5, E.ghg2 = Math.round((E.ghg2 + d.ghg2) * 1e5) / 1e5, E.co2 = Math.round((E.co2 + d.co2.mrv) * 1e5) / 1e5, E.ch4 = Math.round((E.ch4 + d.ch4.mrv) * 1e5) / 1e5, E.n2o = Math.round((E.n2o + d.n2o.mrv) * 1e5) / 1e5, E.euas = Math.round((E.euas + d.euas) * 1e5) / 1e5, E.cost = Math.round((E.cost + d.cost) * 1e5) / 1e5, E.energy = Math.round((E.energy + d.energy) * 1e5) / 1e5, E.lcv = d.lcv, E.co2fc = d.co2.fc, E.co2cj = d.co2.cj, E.ch4fc = d.ch4.fc, E.ch4cj = d.ch4.cj, E.n2ofc = d.n2o.fc, E.n2ocj = d.n2o.cj, E.co2MRVGWP = d.co2.mrvGWP, E.ch4MRVGWP = d.ch4.mrvGWP, E.n2oMRVGWP = d.n2o.mrvGWP, E.co2TTWGWP = d.co2.ttwGWP, E.ch4TTWGWP = d.ch4.ttwGWP, E.n20TTWGWP = d.n2o.ttwGWP, E.wtt = d.wtt, E.ttw.total = d.ttw, E.ttw.co2 = d.co2.ttw, E.ttw.ch4 = d.ch4.ttw, E.ttw.n2o = d.n2o.ttw, E.wtw = Math.round((d.wtt + d.ttw) * 1e5) / 1e5, E.wttEmission = Math.round((E.wttEmission + d.wtt * d.energy) * 1e5) / 1e5, E.ttwEmission = Math.round((E.ttwEmission + d.ttw * d.energy) * 1e5) / 1e5, E.wtwEmission = Math.round((E.wttEmission + E.ttwEmission) * 1e5) / 1e5, f.set(O.type, E); } const N = this.getEUETSRatio(o), G = Array.from(f.values()), m = r.fwind || 1; let w = 0, S = 0, M = 0, C = 0, b = 0, P = 0; if (o >= 2025) { w = Math.round(u / s * 1e5) / 1e5, S = Math.round(R / s * 1e5) / 1e5, M = Math.round(m * (w + S) * 1e5) / 1e5, C = this.calculateGHGITarget(o), b = Math.round((C - M) * s * 1e8) / 1e8; const O = b * 1e6; P = O < 0 ? Math.round(Math.abs(O) / (M * 41e3) * 2400) : 0; } return { year: o, price: t, fwind: m, ratio: N, ghg: n, ghg2: a, euas: c, cost: i, energy: s, wtwEmission: Math.round((u + R) * 1e5) / 1e5, wttGhgi: w, ttwGhgi: S, actualGhgi: M, targetGhgi: C, balance: b, penalty: P, fuels: G }; } /** * 计算 EUETS Ratio, 不同年份交纳的比例不同,2026年以后需全额交纳 * @param year * @returns * @deprecated use getEUETSRatio instead */ static getEUETSRadio(e) { return e > 2026 ? 1 : e >= 2024 && s5[e] || 0; } /** * 计算 EUETS Ratio, 不同年份交纳的比例不同,2026年以后需全额交纳 * @param year * @returns */ static getEUETSRatio(e) { return e > 2026 ? 1 : e >= 2024 && s5[e] || 0; } /** * 计算 GHG Intensity Target, 单位 gCO₂eq/MJ * @param year * @returns */ static calculateGHGITarget(e) { let o = 91.16; return e >= 2025 && (e >= 2050 ? o = o * (1 - 0.8) : e >= 2045 ? o = o * (1 - 0.62) : e >= 2040 ? o = o * (1 - 0.31) : e >= 2035 ? o = o * (1 - 0.145) : e >= 2030 ? o = o * (1 - 0.06) : o = o * (1 - 0.02)), Math.round(o * 1e5) / 1e5; } /** * 计算 EUMRV Leg Category * @param departure 出发地 * @param destination 目的地 * @param fuelEU 是否是fuelEU, 注意 EUETS和fuelEU不同,fuelEU在Norway and Iceland将被视为第三国,在EEA执行50%标准 * @param options 配置项 * @returns * @deprecated */ static async calculateEUMRVLegCategory(e, o, t = !1, r = {}) { let n = "Non EU"; const a = { departure: 0, destination: 0, atSea: 0 }; if (e && o) { let c = await _.isInEU(e, r), i = await _.isInEU(o, r); t && (c = c && !await _.isFuelEUExclude(e, r), i = i && !await _.isFuelEUExclude(o, r)), c && i ? (n = "Between EU", a.departure = 1, a.destination = 1, a.atSea = 1) : c ? (n = "Departed EU", a.departure = 1, a.destination = 0, a.atSea = 0.5) : i && (n = "Arrived EU", a.departure = 0, a.destination = 1, a.atSea = 0.5); } return { category: n, areaRate: a }; } /** * 计算 EUMRV Category * @param departure 出发地 * @param destination 目的地 * @param options 配置项 * @returns { category, areaRate } 是否在EU,以及对应计算比例 */ static async calculateEUMRVCategory(e, o, t = {}) { let r = "Non EU"; const n = { departure: 0, destination: 0, atSea: 0 }; if (e && o) { const a = await _.isInEU(e, t), c = await _.isInEU(o, t); a && c ? (r = "Between EU", n.departure = 1, n.destination = 1, n.atSea = 1) : a ? (r = "Departed EU", n.departure = 1, n.destination = 0, n.atSea = 0.5) : c && (r = "Arrived EU", n.departure = 0, n.destination = 1, n.atSea = 0.5); } return { category: r, areaRate: n }; } /** * 计算 Fuel EU Category * 注意 EUETS和fuelEU不同,fuelEU在Norway and Iceland将被视为第三国,在EEA执行50%标准 * FuelEU delayed in Norway and Iceland(https://www.sdir.no/en/news/FuelEu_delayed_in_Norway/) * @param departure 出发地 * @param destination 目的地 * @param options 配置项 * @returns { category, areaRate } 是否在EU,以及对应计算比例 */ static async calculateFuelEUCategory(e, o, t = {}) { let r = "Non EU"; const n = { departure: 0, destination: 0, atSea: 0 }; if (e && o) { let a = await _.isInEU(e, t), c = await _.isInEU(o, t); a = a && !await _.isFuelEUExclude(e, t), c = c && !await _.isFuelEUExclude(o, t), a && c ? (r = "Between EU", n.departure = 1, n.destination = 1, n.atSea = 1) : a ? (r = "Departed EU", n.departure = 1, n.destination = 0, n.atSea = 0.5) : c && (r = "Arrived EU", n.departure = 0, n.destination = 1, n.atSea = 0.5); } return { category: r, areaRate: n }; } } let D; try { D = X.getLogger("cii"); } catch { } finally { } var S5 = /* @__PURE__ */ ((l) => (l.BULK_CARRIER = "BULK CARRIER", l.GAS_CARRIER = "GAS CARRIER", l.TANKER = "TANKER", l.CONTAINER_SHIP = "CONTAINER SHIP", l.GENERAL_CARGO_SHIP = "GENERAL CARGO SHIP", l.REFRIGERATED_CARGO_CARRIER = "REFRIGERATED CARGO CARRIER", l.COMBINATION_CARRIER = "COMBINATION CARRIER", l.LNG_CARRIER = "LNG CARRIER", l.RO_RO_CARGO_SHIP = "RO-RO CARGO SHIP", l.RO_RO_CARGO_VEHICLE_SHIP = "RO-RO CARGO VEHICLE SHIP", l.RO_RO_PASSENGER_SHIP = "RO-RO PASSENGER SHIP", l.CRUISE_PASSENGER_SHIP = "CRUISE PASSENGER SHIP", l))(S5 || {}); class p { /** * 船舶载运能力:dwt or gt * @see https://docs.qq.com/pdf/DYWl3T1NuemNIZ0JJ? * -对于散货船、液货船、集装箱船、气体运输船、LNG船、杂货船、冷藏货船和兼用船, * 应使用载重吨(DWT)作为载运能力; * -对于豪华邮轮、滚装货船(车辆运输船)、滚装货船及滚装客船,应使用总吨(GT)作 * 为载运能力; * @param props * @param options */ static calculateCapacity(e, o = {}) { var a; const t = ((a = e.type) == null ? void 0 : a.toUpperCase()) || "BULK CARRIER", r = [ "BULK CARRIER", "GAS CARRIER", "TANKER", "CONTAINER SHIP", "GENERAL CARGO SHIP", "REFRIGERATED CARGO CARRIER", "LNG CARRIER", "COMBINATION CARRIER" /* COMBINATION_CARRIER */ ], n = [ "RO-RO CARGO SHIP", "RO-RO CARGO VEHICLE SHIP", "RO-RO PASSENGER SHIP", "CRUISE PASSENGER SHIP" /* CRUISE_PASSENGER_SHIP */ ]; return r.includes(t) ? (D.info("[%s] use dwt as the vessel capacity: %j", o.requestId, e), e.dwt) : n.includes(t) ? (D.info("[%s] use gt as the vessel capacity: %j", o.requestId, e), e.gt) : (D.info("[%s] use max(gt,dwt) as the vessel capacity: %j", o.requestId, e), e.dwt > e.gt ? e.dwt : e.gt); } /** * CII基准(2019) * @see https://docs.qq.com/pdf/DYXRJSkNJbmJQZFJu? * 3.1 考虑到2008年的数据有限,以2019年船型营运碳强度性能为基准。 * 3.2 对于规定的一组船舶,基线的公式如下: * CIIref =aCapacity-c * 单位是 g/(dwt⋅nmile) 或 g/(gt⋅nmile) * * 式中CIIref系指2019年的基准值,Capacity与某一船型特定碳强度指标(CII)规定的值相 * 同,见表1;a和c系指通过中值回归拟合所估算的参数,以2019年通过IMODCS收集的 * attainedCII和单个船舶的Capacity为样本。 * * @param props * @param options */ static calculateReferCII(e, o = {}) { var i, s; const t = p.calculateCapacity(e, o), r = ((s = (i = e.type) == null ? void 0 : i.trim()) == null ? void 0 : s.toUpperCase()) || "BULK CARRIER"; let n = 0, a = 0; r === "BULK CARRIER" ? (n = 4745, a = 0.622) : r === "GAS CARRIER" ? t >= 65e3 ? (n = Math.pow(14405, 7), a = 2.071) : (n = 8104, a = 0.639) : r === "TANKER" ? (n = 5247, a = 0.61) : r === "CONTAINER SHIP" ? (n = 1984, a = 0.489) : r === "GENERAL CARGO SHIP" ? t >= 2e4 ? (n = 31948, a = 0.792) : (n = 588, a = 0.3885) : r === "REFRIGERATED CARGO CARRIER" ? (n = 4600, a = 0.557) : r === "COMBINATION CARRIER" ? (n = 5119, a = 0.622) : r === "LNG CARRIER" ? t >= 1e5 ? (n = 9.827, a = 0) : (n = Math.pow(14479, 10), a = 2.673) : r === "RO-RO CARGO VEHICLE SHIP" ? t < 3e4 ? (n = 330, a = 0.329) : (n = 3627, a = 0.59) : r === "RO-RO CARGO SHIP" ? (n = 1967, a = 0.485) : r === "RO-RO PASSENGER SHIP" ? (n = 2023, a = 0.46) : r === "CRUISE PASSENGER SHIP" && (n = 930, a = 0.383); const c = Math.round(n * Math.pow(t, -a) * 1e3) / 1e3; return D.info("[%s] calculate refer cii (%d) with props: %j ", o.requestId, c, e), { referCii: c, referYear: 2019 }; } /** * 年度达标需求的cii, 已经按年份折减 * @see https://docs.qq.com/pdf/DYVRtWGlsUVdNcGlu? * 按照MARPOL附则VI第28条,对船舶要求的年度营运CII折减因素计算如下: * 要求的年度营运CII=(1–Z/100)×CIIR * 式中CIIR是2019年的基准值,定义见《2021年营运碳强度指标基线指南(G2)》,Z * 是2023年至2030年对船型要求的年度营运CII折减因素的一般参考, * * @param ref * @param year * @param options */ static calculateRequiredCII(e, o, t = {}) { let r = 0; o === 2020 ? r = 1 : o === 2021 ? r = 2 : o === 2022 ? r = 3 : o === 2023 ? r = 5 : o === 2024 ? r = 7 : o === 2025 ? r = 9 : o === 2026 && (r = 11); const n = Math.round((1 - r / 100) * e * 1e3) / 1e3; return D.info("[%s] calculate required cii (%d) with: %j", t.requestId, n, { year: o, ref: e }), { requiredCii: n, z: r, year: o, ref: e }; } /** * 计算CO2, 注意需要换算为: g * @param