mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-04-06 03:57:49 +08:00
2 lines
2.9 KiB
JavaScript
2 lines
2.9 KiB
JavaScript
import"./side-channel@1.0.4-DiPXwnX9.js";var m=String.prototype.replace,O=/%20/g,v={RFC1738:"RFC1738",RFC3986:"RFC3986"},y={default:v.RFC3986,formatters:{RFC1738:function(f){return m.call(f,O,"+")},RFC3986:function(f){return String(f)}},RFC1738:v.RFC1738,RFC3986:v.RFC3986},C=y,x=Object.prototype.hasOwnProperty,p=Array.isArray,s=function(){for(var f=[],e=0;e<256;++e)f.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return f}(),R=function(e){for(;e.length>1;){var r=e.pop(),t=r.obj[r.prop];if(p(t)){for(var a=[],l=0;l<t.length;++l)typeof t[l]<"u"&&a.push(t[l]);r.obj[r.prop]=a}}},h=function(e,r){for(var t=r&&r.plainObjects?Object.create(null):{},a=0;a<e.length;++a)typeof e[a]<"u"&&(t[a]=e[a]);return t},g=function f(e,r,t){if(!r)return e;if(typeof r!="object"){if(p(e))e.push(r);else if(e&&typeof e=="object")(t&&(t.plainObjects||t.allowPrototypes)||!x.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var a=e;return p(e)&&!p(r)&&(a=h(e,t)),p(e)&&p(r)?(r.forEach(function(l,o){if(x.call(e,o)){var i=e[o];i&&typeof i=="object"&&l&&typeof l=="object"?e[o]=f(i,l,t):e.push(l)}else e[o]=l}),e):Object.keys(r).reduce(function(l,o){var i=r[o];return x.call(l,o)?l[o]=f(l[o],i,t):l[o]=i,l},a)},S=function(e,r){return Object.keys(r).reduce(function(t,a){return t[a]=r[a],t},e)},j=function(f,e,r){var t=f.replace(/\+/g," ");if(r==="iso-8859-1")return t.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(t)}catch{return t}},E=function(e,r,t,a,l){if(e.length===0)return e;var o=e;if(typeof e=="symbol"?o=Symbol.prototype.toString.call(e):typeof e!="string"&&(o=String(e)),t==="iso-8859-1")return escape(o).replace(/%u[0-9a-f]{4}/gi,function(c){return"%26%23"+parseInt(c.slice(2),16)+"%3B"});for(var i="",u=0;u<o.length;++u){var n=o.charCodeAt(u);if(n===45||n===46||n===95||n===126||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||l===C.RFC1738&&(n===40||n===41)){i+=o.charAt(u);continue}if(n<128){i=i+s[n];continue}if(n<2048){i=i+(s[192|n>>6]+s[128|n&63]);continue}if(n<55296||n>=57344){i=i+(s[224|n>>12]+s[128|n>>6&63]+s[128|n&63]);continue}u+=1,n=65536+((n&1023)<<10|o.charCodeAt(u)&1023),i+=s[240|n>>18]+s[128|n>>12&63]+s[128|n>>6&63]+s[128|n&63]}return i},A=function(e){for(var r=[{obj:{o:e},prop:"o"}],t=[],a=0;a<r.length;++a)for(var l=r[a],o=l.obj[l.prop],i=Object.keys(o),u=0;u<i.length;++u){var n=i[u],c=o[n];typeof c=="object"&&c!==null&&t.indexOf(c)===-1&&(r.push({obj:o,prop:n}),t.push(c))}return R(r),e},w=function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},D=function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},B=function(e,r){return[].concat(e,r)},P=function(e,r){if(p(e)){for(var t=[],a=0;a<e.length;a+=1)t.push(r(e[a]));return t}return r(e)},b={arrayToObject:h,assign:S,combine:B,compact:A,decode:j,encode:E,isBuffer:D,isRegExp:w,maybeMap:P,merge:g},T=b,F=y,N=Date.prototype.toISOString,d=F.default;T.encode,F.formatters[d];var Q=b;Q.decode;
|