function e(e,t,n){throw new Error(n?`No known conditions for "${t}" specifier in "${e}" package`:`Missing "${t}" specifier in "${e}" package`)}function t(e){let t=new Set(["default"]);e.unsafe||t.add(e.require?"require":"import"),e.unsafe||t.add(e.browser?"browser":"node");for(const n of e.conditions||[])n.startsWith("!")?t.delete(n.slice(1)):t.add(n);return t}function n(n,f,o,l){let u,g,c=i(n,o),a=t(l||{}),p=f[c];if(void 0===p){let e,t,n,r;for(r in f)t&&r.length1&&(n=r.indexOf("*",1),~n&&(e=RegExp("^"+r.substring(0,n)+"(.*)"+r.substring(1+n)+"$").exec(c),e&&e[1]&&(g=e[1],t=r))));p=f[t]}return p||e(n,c),u=s(p,a),u||e(n,c,1),g&&r(u,g),u}function r(e,t){let n,r=0,i=e.length,s=/[*]/g,f=/[/]$/;for(;r1&&(n=r.indexOf("*",1),~n&&(e=RegExp("^"+r.substring(0,n)+"(.*)"+r.substring(1+n)+"$").exec(c),e&&e[1]&&(g=e[1],t=r))));p=s[t]}if(p||e(n,c),u=o(p,a),u)return g&&r(u,g),u}function o(e,t,n,r){if(null==e)return;if("string"==typeof e)return r?(n&&n.add(e),[e]):void 0;let i,s;if(Array.isArray(e)){for(s=n||new Set,i=0;i