import{C}from"./CarShopInfo.js";const f=[["Porsche","Horse"],["Lambo","Italiani"]];function i(t,e=!1){const[a,p]=e?[0,1]:[1,0],r=[...f,...C].sort((s,c)=>c[a].length-s[a].length),o=new Map(r.map(s=>[s[a].toLowerCase(),s[p]])),n=new RegExp(`(${[...o.keys()].join("|")})`,"gi");return t.replace(n,s=>m(s,o.get(s.toLowerCase())))}function m(t,e){return e=e.toLowerCase(),t===t.toUpperCase()?e=e.toUpperCase():t[0]===t[0].toUpperCase()&&(e=e[0].toUpperCase()+e.slice(1)),e}export{i as r};
