"use strict";const a=require("../../../../../../../_virtual/options.js");Object.defineProperty(a.__exports,"__esModule",{value:!0});a.__exports.merge=c;a.__exports.normalizeReplacements=p;a.__exports.validate=d;const s=["placeholderWhitelist","placeholderPattern","preserveComments","syntacticPlaceholders"];function u(e,o){if(e==null)return{};var n={},r=Object.keys(e),l,t;for(t=0;t<r.length;t++)l=r[t],!(o.indexOf(l)>=0)&&(n[l]=e[l]);return n}function c(e,o){const{placeholderWhitelist:n=e.placeholderWhitelist,placeholderPattern:r=e.placeholderPattern,preserveComments:l=e.preserveComments,syntacticPlaceholders:t=e.syntacticPlaceholders}=o;return{parser:Object.assign({},e.parser,o.parser),placeholderWhitelist:n,placeholderPattern:r,preserveComments:l,syntacticPlaceholders:t}}function d(e){if(e!=null&&typeof e!="object")throw new Error("Unknown template options.");const o=e||{},{placeholderWhitelist:n,placeholderPattern:r,preserveComments:l,syntacticPlaceholders:t}=o,i=u(o,s);if(n!=null&&!(n instanceof Set))throw new Error("'.placeholderWhitelist' must be a Set, null, or undefined");if(r!=null&&!(r instanceof RegExp)&&r!==!1)throw new Error("'.placeholderPattern' must be a RegExp, false, null, or undefined");if(l!=null&&typeof l!="boolean")throw new Error("'.preserveComments' must be a boolean, null, or undefined");if(t!=null&&typeof t!="boolean")throw new Error("'.syntacticPlaceholders' must be a boolean, null, or undefined");if(t===!0&&(n!=null||r!=null))throw new Error("'.placeholderWhitelist' and '.placeholderPattern' aren't compatible with '.syntacticPlaceholders: true'");return{parser:i,placeholderWhitelist:n||void 0,placeholderPattern:r==null?void 0:r,preserveComments:l==null?void 0:l,syntacticPlaceholders:t==null?void 0:t}}function p(e){if(Array.isArray(e))return e.reduce((o,n,r)=>(o["$"+r]=n,o),{});if(typeof e=="object"||e==null)return e||void 0;throw new Error("Template replacements must be an array, object, null, or undefined")}module.exports=a.__exports;
//# sourceMappingURL=options.js.map
