import{getType as t}from"../main.js";class e{sort(e){const o=new Map;for(const n of e){const e=t(n);e.allowedHands.forEach((t=>{const r=e.getStackInDrawer(n,t);if(void 0===r)return;const s=o.get(r.typeId)||0;o.set(r.typeId,s+e.getDrawerItemCount(n,t))}))}return new Map([...o.entries()].sort(((t,e)=>e[1]-t[1])))}}class o{sort(e){const o=new Map;for(const n of e){const e=t(n);e.allowedHands.forEach((t=>{const r=e.getStackInDrawer(n,t);if(void 0===r)return;const s=o.get(r.typeId)||0;o.set(r.typeId,s+e.getDrawerItemCount(n,t))}))}return new Map([...o.entries()].sort(((t,e)=>t[0].localeCompare(e[0]))))}}const n={AMOUNT:new e,NAME:new o};export{e as AmountSort,o as NameSort,n as SORTS};
