import{t as f}from"./invariant-CkiqGLcK.js";function l(t,r,n){return Math.min(Math.max(t,r),n)}function o(t,r){let n=[...t];return n.splice(r,1),n}function s(t,r,n){r=l(r,0,t.length);let e=[...t];return e.splice(r,0,n),e}function a(t,r,n){let e=[...t],[u]=e.splice(r,1);return e.splice(n,0,u),e}function c(t,r,n){if(t.length===0)return n;r=l(r,0,t.length);let e=[...t];return e.splice(r,0,...n),e}function p(t,r){if(t===r)return!0;if(t.length!==r.length)return!1;for(let n=0,e=t.length;n<e;n++)if(t[n]!==r[n])return!1;return!0}const h={EMPTY:[],zip:(t,r)=>(f(t.length===r.length,"Arrays must be the same length"),t.map((n,e)=>[n,r[e]]))};function g(t){return[...new Set(t)]}function m(t,r){return t.map(n=>[r(n),n]).toSorted(([n],[e])=>n==null&&e==null?0:n==null?1:e==null||n<e?-1:n>e?1:0).map(([,n])=>n)}function d(t,r){if(!t)return[r];let n=t.indexOf(r);if(n===-1)return[...t,r];let e=[...t];return e.splice(n,1),e}function M(t,r){let n=[],e=new Set;for(let u of t){let i=r(u);e.has(i)||(e.add(i),n.push(u))}return n}function w(t,r){let n=new Map;for(let e of t){let u=r(e);n.set(u,e)}return[...n.values()]}function x(t,r,n){return r===0?0:t===null?n==="up"?0:r-1:n==="up"?(t+1)%r:(t-1+r)%r}export{a,x as c,M as d,w as f,c as i,m as l,o as n,p as o,l as p,s as r,d as s,h as t,g as u};
