!function(n,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(n="undefined"!=typeof globalThis?globalThis:n||self).StyleToObject=t()}(this,(function(){"use strict";var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,e=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,c=/^\s+|\s+$/g,f="";function s(n){return n?n.replace(c,f):f}return function(c,a){let l=null;if(!c||"string"!=typeof c)return l;const p=function(c,a){if("string"!=typeof c)throw new TypeError("First argument must be a string");if(!c)return[];a=a||{};var l=1,p=1;function h(n){var e=n.match(t);e&&(l+=e.length);var r=n.lastIndexOf("\n");p=~r?n.length-r:p+n.length}function m(){var n={line:l,column:p};return function(t){return t.position=new v(n),g(),t}}function v(n){this.start=n,this.end={line:l,column:p},this.source=a.source}function y(n){var t=new Error(a.source+":"+l+":"+p+": "+n);if(t.reason=n,t.filename=a.source,t.line=l,t.column=p,t.source=c,!a.silent)throw t}function d(n){var t=n.exec(c);if(t){var e=t[0];return h(e),c=c.slice(e.length),t}}function g(){d(e)}function w(n){var t;for(n=n||[];t=A();)!1!==t&&n.push(t);return n}function A(){var n=m();if("/"==c.charAt(0)&&"*"==c.charAt(1)){for(var t=2;f!=c.charAt(t)&&("*"!=c.charAt(t)||"/"!=c.charAt(t+1));)++t;if(t+=2,f===c.charAt(t-1))return y("End of comment missing");var e=c.slice(2,t-2);return p+=2,h(e),c=c.slice(t),p+=2,n({type:"comment",comment:e})}}function b(){var t=m(),e=d(r);if(e){if(A(),!d(o))return y("property missing ':'");var c=d(i),a=t({type:"declaration",property:s(e[0].replace(n,f)),value:c?s(c[0].replace(n,f)):f});return d(u),a}}return v.prototype.content=c,g(),function(){var n,t=[];for(w(t);n=b();)!1!==n&&(t.push(n),w(t));return t}()}(c),h="function"==typeof a;return p.forEach((n=>{if("declaration"!==n.type)return;const{property:t,value:e}=n;h?a(t,e,n):e&&(l=l||{},l[t]=e)})),l}})); //# sourceMappingURL=style-to-object.min.js.map