"use strict";const i=require("../../../../../../../_virtual/literal.js");require("./options.js");require("./parse.js");require("./populate.js");const u=require("../../../../../../../_virtual/options.js"),d=require("../../../../../../../_virtual/parse.js"),m=require("../../../../../../../_virtual/populate.js");Object.defineProperty(i.__exports,"__esModule",{value:!0});i.__exports.default=v;var _=u.__exports,h=d.__exports,f=m.__exports;function v(r,c,e){const{metadata:l,names:a}=j(r,c,e);return s=>{const n={};return s.forEach((t,o)=>{n[a[o]]=t}),t=>{const o=(0,_.normalizeReplacements)(t);return o&&Object.keys(o).forEach(p=>{if(Object.prototype.hasOwnProperty.call(n,p))throw new Error("Unexpected replacement overlap.")}),r.unwrap((0,f.default)(l,o?Object.assign(o,n):n))}}}function j(r,c,e){let l,a,s,n="";do{n+="$";const t=q(c,n);l=t.names,a=new Set(l),s=(0,h.default)(r,r.code(t.code),{parser:e.parser,placeholderWhitelist:new Set(t.names.concat(e.placeholderWhitelist?Array.from(e.placeholderWhitelist):[])),placeholderPattern:e.placeholderPattern,preserveComments:e.preserveComments,syntacticPlaceholders:e.syntacticPlaceholders})}while(s.placeholders.some(t=>t.isDuplicate&&a.has(t.name)));return{metadata:s,names:l}}function q(r,c){const e=[];let l=r[0];for(let a=1;a<r.length;a++){const s=`${c}${a-1}`;e.push(s),l+=s+r[a]}return{names:e,code:l}}
//# sourceMappingURL=literal.js.map
