import{S as c,l as p}from"./_Uint8Array-D5Z9rM2X.js";import{t as l}from"./isSymbol-xTSywenE.js";import{t as v}from"./_arrayMap-DQI2GUNb.js";import{d,u as s,y as g}from"./isArrayLikeObject-DKyJYtr8.js";import{n as h}from"./get-BYzWDFJH.js";import{t as x}from"./_baseFlatten-8yEsQJi9.js";import{r as y}from"./_baseEach-Xz5DR2cc.js";import{t as S}from"./_baseMap-DMMHaI20.js";function _(n,r){var t=n.length;for(n.sort(r);t--;)n[t]=n[t].value;return n}var b=_;function j(n,r){if(n!==r){var t=n!==void 0,u=n===null,o=n===n,i=l(n),m=r!==void 0,a=r===null,f=r===r,e=l(r);if(!a&&!e&&!i&&n>r||i&&m&&f&&!a&&!e||u&&m&&f||!t&&f||!o)return 1;if(!u&&!i&&!e&&n<r||e&&t&&o&&!u&&!i||a&&t&&o||!m&&o||!f)return-1}return 0}var k=j;function q(n,r,t){for(var u=-1,o=n.criteria,i=r.criteria,m=o.length,a=t.length;++u<m;){var f=k(o[u],i[u]);if(f)return u>=a?f:f*(t[u]=="desc"?-1:1)}return n.index-r.index}var w=q;function z(n,r,t){r=r.length?v(r,function(o){return c(o)?function(i){return h(i,o.length===1?o[0]:o)}:o}):[g];var u=-1;return r=v(r,p(y)),b(S(n,function(o,i,m){return{criteria:v(r,function(a){return a(o)}),index:++u,value:o}}),function(o,i){return w(o,i,t)})}var A=z,B=d(function(n,r){if(n==null)return[];var t=r.length;return t>1&&s(n,r[0],r[1])?r=[]:t>2&&s(r[0],r[1],r[2])&&(r=[r[0]]),A(n,x(r,1),[])});export{B as t};
