import{isString as e,isObject as r}from"../../utils/validateType.mjs";function t(t){if(!Array.isArray(t))return!1;if(!t.every(t=>e(t)?["custom-properties","dollar-variables","at-variables","declarations","rules","at-rules","less-mixins"].includes(t):r(t)&&void 0!==t.type))return!1;return!!t.filter(r).every(r=>{let t=!0;if("at-rule"!==r.type&&"rule"!==r.type)return!1;if("at-rule"===r.type){if(void 0!==r.parameter&&void 0===r.name)return!1;void 0!==r.hasBlock&&(t=!0===r.hasBlock||!1===r.hasBlock),void 0!==r.name&&(t=e(r.name)&&r.name.length),void 0!==r.parameter&&(t=e(r.parameter)&&r.parameter.length||a(r.parameter))}return"rule"===r.type&&(void 0!==r.selector&&(t=e(r.selector)&&r.selector.length||a(r.selector)),t&&void 0!==r.name&&(t=e(r.name)&&r.name.length)),t})}function a(e){return"[object RegExp]"===Object.prototype.toString.call(e)}export{t as validatePrimaryOption};