LightRAG/lightrag/api/webui/assets/utils-vendor-BysuhMZA.js

7 lines
101 KiB
JavaScript
Raw Normal View History

2025-04-22 16:39:45 +08:00
import{R as ut}from"./react-vendor-DEwriMA6.js";const dt=n=>{let e;const t=new Set,r=(c,u)=>{const d=typeof c=="function"?c(e):c;if(!Object.is(d,e)){const h=e;e=u??(typeof d!="object"||d===null)?d:Object.assign({},e,d),t.forEach(b=>b(e,h))}},s=()=>e,a={setState:r,getState:s,getInitialState:()=>l,subscribe:c=>(t.add(c),()=>t.delete(c))},l=e=n(r,s,a);return a},Cn=n=>n?dt(n):dt,Ln=n=>n;function An(n,e=Ln){const t=ut.useSyncExternalStore(n.subscribe,()=>e(n.getState()),()=>e(n.getInitialState()));return ut.useDebugValue(t),t}const ft=n=>{const e=Cn(n),t=r=>An(e,r);return Object.assign(t,e),t},uo=n=>n?ft(n):ft;function Ht(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=Ht(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function fo(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=Ht(n))&&(r&&(r+=" "),r+=e);return r}const ot="-",Pn=n=>{const e=kn(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:r}=n;return{getClassGroupId:i=>{const a=i.split(ot);return a[0]===""&&a.length!==1&&a.shift(),Kt(a,e)||Tn(i)},getConflictingClassGroupIds:(i,a)=>{const l=t[i]||[];return a&&r[i]?[...l,...r[i]]:l}}},Kt=(n,e)=>{var i;if(n.length===0)return e.classGroupId;const t=n[0],r=e.nextPart.get(t),s=r?Kt(n.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const o=n.join(ot);return(i=e.validators.find(({validator:a})=>a(o)))==null?void 0:i.classGroupId},ht=/^\[(.+)\]$/,Tn=n=>{if(ht.test(n)){const e=ht.exec(n)[1],t=e==null?void 0:e.substring(0,e.indexOf(":"));if(t)return"arbitrary.."+t}},kn=n=>{const{theme:e,classGroups:t}=n,r={nextPart:new Map,validators:[]};for(const s in t)We(t[s],r,s,e);return r},We=(n,e,t,r)=>{n.forEach(s=>{if(typeof s=="string"){const o=s===""?e:pt(e,s);o.classGroupId=t;return}if(typeof s=="function"){if(Nn(s)){We(s(r),e,t,r);return}e.validators.push({validator:s,classGroupId:t});return}Object.entries(s).forEach(([o,i])=>{We(i,pt(e,o),t,r)})})},pt=(n,e)=>{let t=n;return e.split(ot).forEach(r=>{t.nextPart.has(r)||t.nextPart.set(r,{nextPart:new Map,validators:[]}),t=t.nextPart.get(r)}),t},Nn=n=>n.isThemeGetter,Fn=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=new Map,r=new Map;const s=(o,i)=>{t.set(o,i),e++,e>n&&(e=0,r=t,t=new Map)};return{get(o){let i=t.get(o);if(i!==void 0)return i;if((i=r.get(o))!==void 0)return s(o,i),i},set(o,i){t.has(o)?t.set(o,i):s(o,i)}}},Xe="!",Qe=":",jn=Qe.length,$n=n=>{const{prefix:e,experimentalParseClassName:t}=n;let r=s=>{const o=[];let i=0,a=0,l=0,c;for(let p=0;p<s.length;p++){let m=s[p];if(i===0&&a===0){if(m===Qe){o.push(s.slice(l,p)),l=p+jn;continue}if(m==="/"){c=p;continue}}m==="["?i++:m==="]"?i--:m==="("?a++:m===")"&&a--}const u=o.length===0?s:s.substring(l),d=In(u),h=d!==u,b=c&&c>l?c-l:void 0;return{modifiers:o,hasImportantModifier:h,baseClassName:d,maybePostfixModifierPosition:b}};if(e){const s=e+Qe,o=r;r=i=>i.startsWith(s)?o(i.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:i,maybePostfixModifierPosition:void 0}}if(t){const s=r;r=o=>t({className:o,parseClassName:s})}return r},In=n=>n.endsWith(Xe)?n.substring(0,n.length-1):n.startsWith(Xe)?n.substring(1):n,Dn=n=>{const e=Object.fromEntries(n.orderSensitiveModifiers.map(r=>[r,!0]));return r=>{if(r.length<=1)return r;const s=[];let o=[];return r.forEach(i=>{i[0]==="["||e[i]?(s.push(...o.sort(),i),o=[]):o.push(i)}),s.push(...o.sort()),s}},Mn=n=>({cache:Fn(n.cacheSize),parseClassName:$n(n),sortModifiers:Dn(n),...Pn(n)}),Un=/\s+/,zn=(n,e)=>{const{parseClassName:t,getClassGroupId:r,getConflictingClassGroupIds:s,sortModifiers:o}=e,i=[],a=n.trim().split(Un);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{isExternal:d,modifiers:h,hasImportantModifier:b,baseClassName:p,maybePostfixModifierPosition:m}=t(u);if(d){l=u+(l.length>0?" "+l:l);continue}let g=!!m,R=r(g?p.substring(0,m):p);if(!R){if(!g){l=u+(l.length>0?" "+l:l);continue}if(R=r(p),!R){l=u+(l.length>0?" "+l:l);continue}g=!1}const E=o(h).join(":"),L=b?E+Xe:E,P=L+R;if(i.in
`).forEach(function(i){s=i.indexOf(":"),t=i.substring(0,s).trim().toLowerCase(),r=i.substring(s+1).trim(),!(!t||e[t]&&ms[t])&&(t==="set-cookie"?e[t]?e[t].push(r):e[t]=[r]:e[t]=e[t]?e[t]+", "+r:r)}),e},St=Symbol("internals");function pe(n){return n&&String(n).trim().toLowerCase()}function Le(n){return n===!1||n==null?n:f.isArray(n)?n.map(Le):String(n)}function ys(n){const e=Object.create(null),t=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=t.exec(n);)e[r[1]]=r[2];return e}const xs=n=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());function _e(n,e,t,r,s){if(f.isFunction(r))return r.call(this,e,t);if(s&&(e=t),!!f.isString(e)){if(f.isString(r))return e.indexOf(r)!==-1;if(f.isRegExp(r))return r.test(e)}}function ws(n){return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r)}function Ss(n,e){const t=f.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(n,r+t,{value:function(s,o,i){return this[r].call(this,e,s,o,i)},configurable:!0})})}let V=class{constructor(e){e&&this.set(e)}set(e,t,r){const s=this;function o(a,l,c){const u=pe(l);if(!u)throw new Error("header name must be a non-empty string");const d=f.findKey(s,u);(!d||s[d]===void 0||c===!0||c===void 0&&s[d]!==!1)&&(s[d||l]=Le(a))}const i=(a,l)=>f.forEach(a,(c,u)=>o(c,u,l));if(f.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(f.isString(e)&&(e=e.trim())&&!xs(e))i(bs(e),t);else if(f.isHeaders(e))for(const[a,l]of e.entries())o(l,a,r);else e!=null&&o(t,e,r);return this}get(e,t){if(e=pe(e),e){const r=f.findKey(this,e);if(r){const s=this[r];if(!t)return s;if(t===!0)return ys(s);if(f.isFunction(t))return t.call(this,s,r);if(f.isRegExp(t))return t.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=pe(e),e){const r=f.findKey(this,e);return!!(r&&this[r]!==void 0&&(!t||_e(this,this[r],r,t)))}return!1}delete(e,t){const r=this;let s=!1;function o(i){if(i=pe(i),i){const a=f.findKey(r,i);a&&(!t||_e(r,r[a],a,t))&&(delete r[a],s=!0)}}return f.isArray(e)?e.forEach(o):o(e),s}clear(e){const t=Object.keys(this);let r=t.length,s=!1;for(;r--;){const o=t[r];(!e||_e(this,this[o],o,e,!0))&&(delete this[o],s=!0)}return s}normalize(e){const t=this,r={};return f.forEach(this,(s,o)=>{const i=f.findKey(r,o);if(i){t[i]=Le(s),delete t[o];return}const a=e?ws(o):String(o).trim();a!==o&&delete t[o],t[a]=Le(s),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return f.forEach(this,(r,s)=>{r!=null&&r!==!1&&(t[s]=e&&f.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join(`
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach(s=>r.set(s)),r}static accessor(e){const r=(this[St]=this[St]={accessors:{}}).accessors,s=this.prototype;function o(i){const a=pe(i);r[a]||(Ss(s,i),r[a]=!0)}return f.isArray(e)?e.forEach(o):o(e),this}};V.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);f.reduceDescriptors(V.prototype,({value:n},e)=>{let t=e[0].toUpperCase()+e.slice(1);return{get:()=>n,set(r){this[t]=r}}});f.freezeMethods(V);function qe(n,e){const t=this||we,r=e||t,s=V.from(r.headers);let o=r.data;return f.forEach(n,function(a){o=a.call(t,o,s.normalize(),e?e.status:void 0)}),s.normalize(),o}function pn(n){return!!(n&&n.__CANCEL__)}function de(n,e,t){O.call(this,n??"canceled",O.ERR_CANCELED,e,t),this.name="CanceledError"}f.inherits(de,O,{__CANCEL__:!0});function gn(n,e,t){const r=t.config.validateStatus;!t.status||!r||r(t.status)?n(t):e(new O("Request failed with status code "+t.status,[O.ERR_BAD_REQUEST,O.ERR_BAD_RESPONSE][Math.floor(t.status/100)-4],t.config,t.request,t))}function Rs(n){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(n);return e&&e[1]||""}function Os(n,e){n=n||10;const t=new Array(n),r=new Array(n);let s=0,o=0,i;return e=e!==void 0?e:1e3,function(l){const c=Date.now(),u=r[o];i||(i=c),t[s]=l,r[s]=c;let d=o,h=0;for(;d!==s;)h+=t[d++],d=d%n;if(s=(s+1)%n,s===o&&(o=(o+1)%n),c-i<e)return;const b=u&&c-u;return b?Math.round(h*1e3/b):void 0}}function Es(n,e){let t=0,r=1e3/e,s,o;const i=(c,u=Date.now())=>{t=u,s=null,o&&(clearTimeout(o),o=null),n.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-t;d>=r?i(c,u):(s=c,o||(o=setTimeout(()=>{o=null,i(s)},r-d)))},()=>s&&i(s)]}const Pe=(n,e,t=3)=>{let r=0;const s=Os(50,250);return Es(o=>{const i=o.loaded,a=o.lengthComputable?o.total:void 0,l=i-r,c=s(l),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:o,lengthComputable:a!=null,[e?"download":"upload"]:!0};n(d)},t)},Rt=(n,e)=>{const t=n!=null;return[r=>e[0]({lengthComputable:t,total:n,loaded:r}),e[1]]},Ot=n=>(...e)=>f.asap(()=>n(...e)),vs=U.hasStandardBrowserEnv?((n,e)=>t=>(t=new URL(t,U.origin),n.protocol===t.protocol&&n.host===t.host&&(e||n.port===t.port)))(new URL(U.origin),U.navigator&&/(msie|trident)/i.test(U.navigator.userAgent)):()=>!0,Cs=U.hasStandardBrowserEnv?{write(n,e,t,r,s,o){const i=[n+"="+encodeURIComponent(e)];f.isNumber(t)&&i.push("expires="+new Date(t).toGMTString()),f.isString(r)&&i.push("path="+r),f.isString(s)&&i.push("domain="+s),o===!0&&i.push("secure"),document.cookie=i.join("; ")},read(n){const e=document.cookie.match(new RegExp("(^|;\\s*)("+n+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(n){this.write(n,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function Ls(n){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(n)}function As(n,e){return e?n.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):n}function mn(n,e){return n&&!Ls(e)?As(n,e):e}const Et=n=>n instanceof V?{...n}:n;function se(n,e){e=e||{};const t={};function r(c,u,d,h){return f.isPlainObject(c)&&f.isPlainObject(u)?f.merge.call({caseless:h},c,u):f.isPlainObject(u)?f.merge({},u):f.isArray(u)?u.slice():u}function s(c,u,d,h){if(f.isUndefined(u)){if(!f.isUndefined(c))return r(void 0,c,d,h)}else return r(c,u,d,h)}function o(c,u){if(!f.isUndefined(u))return r(void 0,u)}function i(c,u){if(f.isUndefined(u)){if(!f.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in e)return r(c,u);if(d in n)return r(void 0,c)}const l={url:o,method:o,data:o,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u,d)=>s(Et(c),Et(u)
`+o.map(Lt).join(`
`):" "+Lt(o[0]):"as no adapter specified";throw new O("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:nt};function Je(n){if(n.cancelToken&&n.cancelToken.throwIfRequested(),n.signal&&n.signal.aborted)throw new de(null,n)}function At(n){return Je(n),n.headers=V.from(n.headers),n.data=qe.call(n,n.transformRequest),["post","put","patch"].indexOf(n.method)!==-1&&n.headers.setContentType("application/x-www-form-urlencoded",!1),wn.getAdapter(n.adapter||we.adapter)(n).then(function(r){return Je(n),r.data=qe.call(n,n.transformResponse,r),r.headers=V.from(r.headers),r},function(r){return pn(r)||(Je(n),r&&r.response&&(r.response.data=qe.call(n,n.transformResponse,r.response),r.response.headers=V.from(r.response.headers))),Promise.reject(r)})}const Sn="1.7.9",ze={};["object","boolean","number","function","string","symbol"].forEach((n,e)=>{ze[n]=function(r){return typeof r===n||"a"+(e<1?"n ":" ")+n}});const Pt={};ze.transitional=function(e,t,r){function s(o,i){return"[Axios v"+Sn+"] Transitional option '"+o+"'"+i+(r?". "+r:"")}return(o,i,a)=>{if(e===!1)throw new O(s(i," has been removed"+(t?" in "+t:"")),O.ERR_DEPRECATED);return t&&!Pt[i]&&(Pt[i]=!0,console.warn(s(i," has been deprecated since v"+t+" and will be removed in the near future"))),e?e(o,i,a):!0}};ze.spelling=function(e){return(t,r)=>(console.warn(`${r} is likely a misspelling of ${e}`),!0)};function Bs(n,e,t){if(typeof n!="object")throw new O("options must be an object",O.ERR_BAD_OPTION_VALUE);const r=Object.keys(n);let s=r.length;for(;s-- >0;){const o=r[s],i=e[o];if(i){const a=n[o],l=a===void 0||i(a,o,n);if(l!==!0)throw new O("option "+o+" must be "+l,O.ERR_BAD_OPTION_VALUE);continue}if(t!==!0)throw new O("Unknown option "+o,O.ERR_BAD_OPTION)}}const Ae={assertOptions:Bs,validators:ze},G=Ae.validators;let re=class{constructor(e){this.defaults=e,this.interceptors={request:new wt,response:new wt}}async request(e,t){try{return await this._request(e,t)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
`+o):r.stack=o}catch{}}throw r}}_request(e,t){typeof e=="string"?(t=t||{},t.url=e):t=e||{},t=se(this.defaults,t);const{transitional:r,paramsSerializer:s,headers:o}=t;r!==void 0&&Ae.assertOptions(r,{silentJSONParsing:G.transitional(G.boolean),forcedJSONParsing:G.transitional(G.boolean),clarifyTimeoutError:G.transitional(G.boolean)},!1),s!=null&&(f.isFunction(s)?t.paramsSerializer={serialize:s}:Ae.assertOptions(s,{encode:G.function,serialize:G.function},!0)),Ae.assertOptions(t,{baseUrl:G.spelling("baseURL"),withXsrfToken:G.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let i=o&&f.merge(o.common,o[t.method]);o&&f.forEach(["delete","get","head","post","put","patch","common"],p=>{delete o[p]}),t.headers=V.concat(i,o);const a=[];let l=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(t)===!1||(l=l&&m.synchronous,a.unshift(m.fulfilled,m.rejected))});const c=[];this.interceptors.response.forEach(function(m){c.push(m.fulfilled,m.rejected)});let u,d=0,h;if(!l){const p=[At.bind(this),void 0];for(p.unshift.apply(p,a),p.push.apply(p,c),h=p.length,u=Promise.resolve(t);d<h;)u=u.then(p[d++],p[d++]);return u}h=a.length;let b=t;for(d=0;d<h;){const p=a[d++],m=a[d++];try{b=p(b)}catch(g){m.call(this,g);break}}try{u=At.call(this,b)}catch(p){return Promise.reject(p)}for(d=0,h=c.length;d<h;)u=u.then(c[d++],c[d++]);return u}getUri(e){e=se(this.defaults,e);const t=mn(e.baseURL,e.url);return dn(t,e.params,e.paramsSerializer)}};f.forEach(["delete","get","head","options"],function(e){re.prototype[e]=function(t,r){return this.request(se(r||{},{method:e,url:t,data:(r||{}).data}))}});f.forEach(["post","put","patch"],function(e){function t(r){return function(o,i,a){return this.request(se(a||{},{method:e,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:i}))}}re.prototype[e]=t(),re.prototype[e+"Form"]=t(!0)});let Vs=class Rn{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(o){t=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const i=new Promise(a=>{r.subscribe(a),o=a}).then(s);return i.cancel=function(){r.unsubscribe(o)},i},e(function(o,i,a){r.reason||(r.reason=new de(o,i,a),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=r=>{e.abort(r)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new Rn(function(s){e=s}),cancel:e}}};function Hs(n){return function(t){return n.apply(null,t)}}function Ks(n){return f.isObject(n)&&n.isAxiosError===!0}const rt={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAls