'use strict';
'use server';
import { getResourcesByName } from '../../meta/server/db/db.js';
import { resourceNames } from '../../../fd-toolbox/resources/resource-names.js';
import { isCurrentYear } from '../../../fd-toolbox/dates/date-time.js';

var __defProp=Object['defineProperty'],__name=(_0xa27cbe,_0x5e3606)=>__defProp(_0xa27cbe,'name',{'value':_0x5e3606,'configurable':!![]});async function countTotalOrderItemQuantity(){const _0x2ed294=await getResourcesByName(resourceNames['orderItem']);return calculateOrderItemTotal(_0x2ed294,_0x1b2850=>_0x1b2850['quantity']);}__name(countTotalOrderItemQuantity,'countTotalOrderItemQuantity');async function countTotalOrderItemPrice(){const _0x4946f9=await getResourcesByName(resourceNames['orderItem']);return calculateOrderItemTotal(_0x4946f9,_0x558bbb=>{if(isCurrentYear(_0x558bbb['createdDate']))return _0x558bbb['price']*_0x558bbb['quantity'];return -0x2*0x3+0xdc6+-0x20*0x6e;});}__name(countTotalOrderItemPrice,'countTotalOrderItemPrice');function calculateOrderItemTotal(_0x5e0598,_0x56ddbb){return _0x5e0598['reduce']((_0x2dcf52,_0x4b77db)=>_0x2dcf52+_0x56ddbb(_0x4b77db),0x363+0x4*0x867+-0x24ff);}__name(calculateOrderItemTotal,'calculateOrderItemTotal');

export { countTotalOrderItemPrice, countTotalOrderItemQuantity };
