function t(n,o){t=function(t,e){return new l(t,void 0,e)};var u=r(RegExp),i=RegExp.prototype,c=new WeakMap;function l(t,e,r){var n=u.call(this,t,e);return c.set(n,r||c.get(t)),n}function p(t,e){var r=c.get(e);return Object.keys(r).reduce((function(e,n){return e[n]=t[r[n]],e}),Object.create(null))}return e(l,u),l.prototype.exec=function(t){var e=i.exec.call(this,t);return e&&(e.groups=p(e,this)),e},l.prototype[Symbol.replace]=function(t,e){if("string"==typeof e){var r=c.get(this);return i[Symbol.replace].call(this,t,e.replace(/\$<([^>]+)>/g,(function(t,e){return"$"+r[e]})))}if("function"==typeof e){var n=this;return i[Symbol.replace].call(this,t,(function(){var t=[];return t.push.apply(t,arguments),"object"!=typeof t[t.length-1]&&t.push(p(t,n)),e.apply(this,t)}))}return i[Symbol.replace].call(this,t,e)},t.apply(this,arguments)}function e(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&u(t,e)}function r(t){var e="function"==typeof Map?new Map:void 0;return(r=function(t){if(null===t||(r=t,-1===Function.toString.call(r).indexOf("[native code]")))return t;var r;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,o)}function o(){return n(t,arguments,i(this).constructor)}return o.prototype=Object.create(t.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),u(o,t)})(t)}function n(t,e,r){return(n=o()?Reflect.construct:function(t,e,r){var n=[null];n.push.apply(n,e);var o=new(Function.bind.apply(t,n));return r&&u(o,r.prototype),o}).apply(null,arguments)}function o(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}function u(t,e){return(u=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function i(t){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var c={"to-t":"to top","to-tr":"to top right","to-r":"to right","to-br":"to bottom right","to-b":"to bottom","to-bl":"to bottom left","to-l":"to left","to-tl":"to top left"},l=new Set(Object.values(c)),p=new Set(["none","-moz-initial","inherit","initial","revert","unset"]),a=t=>t.trim();function f(e,r){var n,o;if(null==e||p.has(e))return e;var u=t(/(^[\x2DA-Za-z]+)\(((.*))\)/g,{type:1,values:2}),{type:i,values:f}=null!=(n=null==(o=u.exec(e))?void 0:o.groups)?n:{};if(!i||!f)return e;var s=i.includes("-gradient")?i:i+"-gradient",[y,...v]=f.split(",").map(a).filter(Boolean);if(0===(null==v?void 0:v.length))return e;var h=y in c?c[y]:y;return v.unshift(h),s+"("+v.map((t=>{if(l.has(t))return t;var[e,n]=t.split(" "),o="colors."+e,u=o in r.__cssMap?r.__cssMap[o].varRef:e;return n?[u,n].join(" "):u})).join(", ")+")"}var s=(t,e)=>f(t,null!=e?e:{});export{p as globalSet,s as gradientTransform,f as parseGradient};
//# sourceMappingURL=parse-gradient.js.map
