/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
const o=(o,t,n,e)=>{let i=t,c=t;const l=n>>>1,d=o[i-1];for(;c<=l;){c=i<<1,c<n&&e(o[c-1],o[c])<0&&++c;const t=o[c-1];if(e(t,d)<=0)break;o[i-1]=t,i=c}o[i-1]=d},t=(o,t)=>o<t?-1:o>t?1:0;function n(n,e,i,c){void 0===e&&(e=0),void 0===i&&(i=n.length),void 0===c&&(c=t);for(let t=i>>>1;t>e;t--)o(n,t,i,c);const l=e+1;for(let t=i-1;t>e;t--){const i=n[e];n[e]=n[t],n[t]=i,o(n,l,t,c)}}function*e(n,e,i,c){void 0===e&&(e=0),void 0===i&&(i=n.length),void 0===c&&(c=t);for(let t=i>>>1;t>e;t--)o(n,t,i,c),yield;const l=e+1;for(let t=i-1;t>e;t--){const i=n[e];n[e]=n[t],n[t]=i,o(n,l,t,c),yield}}export{e as iterableSort,n as sort};
