import{calcAtRulePatternPriority as r}from"./calcAtRulePatternPriority.mjs";import{calcRulePatternPriority as t}from"./calcRulePatternPriority.mjs";import{getDescription as e}from"./getDescription.mjs";import{isAtVariable as s}from"../../utils/isAtVariable.mjs";import{isCustomProperty as i}from"../../utils/isCustomProperty.mjs";import{isDollarVariable as o}from"../../utils/isDollarVariable.mjs";import{isLessMixin as l}from"../../utils/isLessMixin.mjs";import{isStandardSyntaxProperty as a}from"../../utils/isStandardSyntaxProperty.mjs";function m(m,p){let n;if(s(p))n="at-variables";else if(l(p))n="less-mixins";else if("decl"===p.type)i(p.prop)?n="custom-properties":o(p.prop)?n="dollar-variables":a(p.prop)&&(n="declarations");else if("rule"===p.type){n={type:"rule",selector:p.selector};const r=m.rule;if(r&&r.length){let e,s=0;if(r.forEach(r=>{const i=t(r,n);i>s&&(s=i,e=r)}),s)return e}}else if("atrule"===p.type){n={type:"at-rule",name:p.name,hasBlock:!1},p.nodes&&p.nodes.length&&(n.hasBlock=!0),p.params&&p.params.length&&(n.parameter=p.params);const t=m["at-rule"];if(t&&t.length){let e,s=0;if(t.forEach(t=>{const i=r(t,n);i>s&&(s=i,e=t)}),s)return e}}return m[n]?m[n]:{description:e(n)}}export{m as getOrderData};