function t(t,n){if(!Array.isArray(t))return r(t,n);for(const e of t){const t=r(e,n);if(t)return t}return!1}function r(t,r){if(!Array.isArray(r))return e(t,r);for(const n of r){const r=e(t,n);if(r)return r}return!1}function n(t,r){const n=t.match(r);return!!n&&{match:t,pattern:r,substring:n[0]??""}}function e(t,r){if(r instanceof RegExp)return n(t,r);if(r.startsWith("/")&&(r.endsWith("/")||r.endsWith("/i"))){const e=n(t,r.endsWith("i")?new RegExp(r.slice(1,-2),"i"):new RegExp(r.slice(1,-1)));return e&&(e.pattern=r),e}return t===r&&{match:t,pattern:r,substring:t}}export{t as default};