File: //var/www/ridesyre-land/node_modules/postcss-nesting/dist/index.cjs
"use strict";var e=require("postcss-selector-parser"),t=require("@csstools/selector-specificity");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(e),r=n(t);function s(e){if(!e.nodes.length)return void e.remove();const t=e.nodes.filter((e=>"comment"===e.type));t.length===e.nodes.length&&e.replaceWith(...t)}function l(e){const t=e.parent,n=t.index(e);if(n){s(t.cloneBefore().removeAll().append(t.nodes.slice(0,n)))}return t.before(e),t}function c(e,t){if(t<2)throw new Error("n must be greater than 1");if(e.length<2)throw new Error("s must be greater than 1");if(Math.pow(e.length,t)>1e4)throw new Error("Too many combinations when trying to resolve a nested selector with lists, reduce the complexity of your selectors");const n=[];for(let e=0;e<t;e++)n[e]=0;const o=[];for(;;){const r=[];for(let s=t-1;s>=0;s--){let t=n[s];if(t>=e.length){if(t=0,n[s]=0,0===s)return o;n[s-1]+=1}r[s]=e[t]}o.push(r),n[n.length-1]++}}const a=o.default.pseudo({value:":is"});function i(e){const t=e.nodes.filter((e=>"tag"===e.type));t.length>1&&t.slice(1).forEach((e=>{const t=a.clone();e.replaceWith(t),t.append(e)}))}function p(e,t){let n=[],r=!1;const s=[...e.nodes];for(let e=0;e<s.length+1;e++){const l=s[e];if(l&&"combinator"!==l.type)"nesting"===l.type&&(r=!0),n.push(l);else{if(r){n=[];continue}if(n.length>1){const e=o.default.selector();n[0].replaceWith(e),n.slice(1).forEach((e=>{e.remove()})),n.forEach((t=>{e.append(t)})),u(e),t&&i(e),e.replaceWith(...e.nodes)}n=[]}}}function u(e){e.nodes.sort(((e,t)=>d(e,e.type)-d(t,t.type)))}function d(e,t){return o.default.isPseudoElement(e)?f.pseudoElement:f[t]}const f={universal:0,tag:1,id:2,class:3,attribute:4,selector:5,pseudo:6,pseudoElement:7,string:8,root:9,comment:10,nesting:9999};function h(e,t,n){let s=[];s=function(e){const t=e.map((e=>o.default().astSync(e))).map((e=>r.default(e))),n=t[0];for(let e=1;e<t.length;e++)if(n.a!==t[e].a||n.b!==t[e].b||n.c!==t[e].c)return!1;return!0}(e)||n.noIsPseudoSelector?e.map((e=>o.default().astSync(e))):[o.default().astSync(`:is(${e.join(",")})`)];let l=[];for(let e=0;e<t.length;e++){const r=t[e];let a=1,d=[],f=0;if(o.default().astSync(r).walkNesting((()=>{f++})),f>1&&s.length>1)d=c(s,f),a=d.length;else{a=s.length;for(let e=0;e<s.length;e++){d.push([]);for(let t=0;t<f;t++)d[e].push(s[e])}}for(let e=0;e<a;e++){let t=0;const s=o.default().astSync(r);s.walk((r=>{if("nesting"!==r.type)return;let s=d[e][t];t++,"root"===s.type&&1===s.nodes.length&&(s=s.nodes[0]);const l=o.default().astSync(`:is(${s.toString()})`),c=m(s.nodes[0]),a=y(s.nodes[0]),f=m(r),h=y(r);if(c&&f)return void r.replaceWith(s.clone());if((c||a)&&(f||h)){const e=r.parent;return c&&"selector"===s.type?r.replaceWith(s.clone().nodes[0]):r.replaceWith(...s.clone().nodes),void(e&&e.nodes.length>1&&(u(e),n.noIsPseudoSelector||i(e)))}if(c){const e=r.parent;return r.replaceWith(s.clone().nodes[0]),void(e&&p(e,!n.noIsPseudoSelector))}if(a){const e=r.parent;return r.replaceWith(...s.clone().nodes),void(e&&p(e,!n.noIsPseudoSelector))}if(g(r)){const e=r.parent;return r.replaceWith(...s.clone().nodes),void(e&&p(e,!n.noIsPseudoSelector))}if(v(r)){const e=r.parent;return r.replaceWith(...s.clone().nodes),void(e&&p(e,!n.noIsPseudoSelector))}const b=r.parent;n.noIsPseudoSelector?r.replaceWith(...s.clone().nodes):r.replaceWith(...l.clone().nodes),b&&p(b,!n.noIsPseudoSelector)})),l.push(s.toString())}}return l}function m(e){return"combinator"!==e.type&&!(e.parent&&e.parent.nodes.length>1)}function y(e,t=null){if(m(e))return!1;if(!e.parent)return!1;if(!!e.parent.nodes.find((e=>"combinator"===e.type||"comment"===e.type)))return!1;return!(!!e.parent.nodes.find((e=>"nesting"===e.type))&&t&&!y(t))}function g(e){if(!e.parent)return!1;if(0!==e.parent.nodes.indexOf(e))return!1;for(let t=1;t<e.parent.nodes.length;t++)if("combinator"===e.parent.nodes[t].type&&" "!==e.parent.nodes[t].value&&">"!==e.parent.nodes[t].value)return!1;return!0}function v(e){if(m(e))return!0;if(!e.parent)return!1;for(let t=0;t<e.parent.nodes.length;t++)if("nesting"!==!e.parent.nodes[t].type&&(e.parent.nodes[t].prev()||e.parent.nodes[t].next())){if(e.parent.nodes[t].prev()&&"combinator"!==e.parent.nodes[t].prev().type)return!1;if(e.parent.nodes[t].next()&&"combinator"!==e.parent.nodes[t].next().type)return!1}return!0}const b=e=>{let t=[],n="",o=!1,r=0,s=!1,l=!1;for(let c of e)l?l=!1:"\\"===c?l=!0:s?c===s&&(s=!1):'"'===c||"'"===c?s=c:"("===c?r+=1:")"===c?r>0&&(r-=1):0===r&&","===c&&(o=!0),o?(""!==n&&t.push(n.trim()),n="",o=!1):n+=c;return t.push(n.trim()),t};var S=["container","document","media","supports"];function W(e){const t=l(e);var n,o;e.params=(n=t.params,o=e.params,b(n).map((e=>b(o).map((t=>`${e} and ${t}`)).join(", "))).join(", ")),s(t)}function P(e,t){e.each((e=>{(e=>"rule"===e.type&&"rule"===Object(e.parent).type&&e.selectors.every((e=>0===e.trim().indexOf("&")&&-1===e.indexOf("|"))))(e)?function(e,t){const n=l(e);e.selectors=h(n.selectors,e.selectors,t),("rule"===e.type&&"rule"===n.type&&e.selector===n.selector||"atrule"===e.type&&"atrule"===n.type&&e.params===n.params)&&e.append(...n.nodes),s(n)}(e,t):(e=>"atrule"===e.type&&"nest"===e.name&&"rule"===Object(e.parent).type&&b(e.params).every((e=>e.split("&").length>=2&&-1===e.indexOf("|"))))(e)?function(e,t,n){const o=l(e),r=o.clone().removeAll().append(e.nodes);e.replaceWith(r),r.selectors=h(o.selectors,b(e.params),n),s(o),t(r,n)}(e,P,t):(e=>"atrule"===e.type&&S.includes(e.name)&&"rule"===Object(e.parent).type)(e)?function(e,t,n){const o=l(e),r=o.clone().removeAll().append(e.nodes);e.append(r),s(o),t(r,n)}(e,P,t):(e=>"atrule"===e.type&&S.includes(e.name)&&"atrule"===Object(e.parent).type&&e.name===e.parent.name)(e)&&W(e),Object(e.nodes).length&&P(e,t)}))}function w(e){const t=Object(e).noIsPseudoSelector||!1;return{postcssPlugin:"postcss-nesting",Rule(e){P(e,{noIsPseudoSelector:t})}}}w.postcss=!0,module.exports=w;