chainlit 0.4.2__py3-none-any.whl → 0.4.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of chainlit might be problematic. Click here for more details.
- chainlit/__init__.py +22 -132
- chainlit/cli/__init__.py +13 -1
- chainlit/cli/mock.py +1571 -7
- chainlit/config.py +5 -2
- chainlit/frontend/dist/assets/{index-995e21ad.js → index-37b5009c.js} +1 -1
- chainlit/frontend/dist/assets/{index-fb1e167a.js → index-51393291.js} +2 -2
- chainlit/frontend/dist/index.html +1 -1
- chainlit/langflow/__init__.py +75 -0
- chainlit/lc/__init__.py +85 -0
- chainlit/lc/agent.py +8 -5
- chainlit/lc/callbacks.py +3 -3
- chainlit/llama_index/__init__.py +34 -0
- chainlit/llama_index/callbacks.py +99 -0
- chainlit/llama_index/run.py +34 -0
- chainlit/message.py +3 -3
- chainlit/server.py +14 -3
- chainlit/session.py +2 -0
- chainlit/sync.py +8 -3
- chainlit/utils.py +51 -0
- {chainlit-0.4.2.dist-info → chainlit-0.4.3.dist-info}/METADATA +3 -2
- {chainlit-0.4.2.dist-info → chainlit-0.4.3.dist-info}/RECORD +23 -18
- {chainlit-0.4.2.dist-info → chainlit-0.4.3.dist-info}/WHEEL +0 -0
- {chainlit-0.4.2.dist-info → chainlit-0.4.3.dist-info}/entry_points.txt +0 -0
chainlit/config.py
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Optional, Any, Callable, Literal, List, Dict, TYPE_CHECKING
|
|
1
|
+
from typing import Optional, Any, Callable, Union, Literal, List, Dict, TYPE_CHECKING
|
|
2
2
|
import os
|
|
3
3
|
import sys
|
|
4
4
|
import tomli
|
|
@@ -108,16 +108,19 @@ class CodeSettings:
|
|
|
108
108
|
lc_postprocess: Optional[Callable[[Any], str]] = None
|
|
109
109
|
lc_factory: Optional[Callable[[], Any]] = None
|
|
110
110
|
lc_rename: Optional[Callable[[str], str]] = None
|
|
111
|
+
llama_index_factory: Optional[Callable[[], Any]] = None
|
|
112
|
+
langflow_schema: Union[Dict, str] = None
|
|
111
113
|
client_factory: Optional[Callable[[str], "BaseClient"]] = None
|
|
112
114
|
|
|
113
115
|
def validate(self):
|
|
114
116
|
requires_one_of = [
|
|
115
117
|
"lc_factory",
|
|
118
|
+
"llama_index_factory",
|
|
116
119
|
"on_message",
|
|
117
120
|
"on_chat_start",
|
|
118
121
|
]
|
|
119
122
|
|
|
120
|
-
mutually_exclusive = ["lc_factory"]
|
|
123
|
+
mutually_exclusive = ["lc_factory", "llama_index_factory"]
|
|
121
124
|
|
|
122
125
|
# Check if at least one of the required attributes is set
|
|
123
126
|
if not any(getattr(self, attr) for attr in requires_one_of):
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as me,g as Xc}from"./index-fb1e167a.js";function Qc(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(a,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Jc=tp,ep=Object.prototype.hasOwnProperty;function tp(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var a in r)ep.call(r,a)&&(e[a]=r[a])}return e}var yc=Tc,ki=Tc.prototype;ki.space=null;ki.normal={};ki.property={};function Tc(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}var eo=Jc,rp=yc,ap=np;function np(e){for(var t=e.length,r=[],a=[],n=-1,i,s;++n<t;)i=e[n],r.push(i.property),a.push(i.normal),s=i.space;return new rp(eo.apply(null,r),eo.apply(null,a),s)}var Oi=ip;function ip(e){return e.toLowerCase()}var vc=Ac,W=Ac.prototype;W.space=null;W.attribute=null;W.property=null;W.boolean=!1;W.booleanish=!1;W.overloadedBoolean=!1;W.number=!1;W.commaSeparated=!1;W.spaceSeparated=!1;W.commaOrSpaceSeparated=!1;W.mustUseProperty=!1;W.defined=!1;function Ac(e,t){this.property=e,this.attribute=t}var K={},op=0;K.boolean=re();K.booleanish=re();K.overloadedBoolean=re();K.number=re();K.spaceSeparated=re();K.commaSeparated=re();K.commaOrSpaceSeparated=re();function re(){return Math.pow(2,++op)}var Rc=vc,to=K,_c=Li;Li.prototype=new Rc;Li.prototype.defined=!0;var Ic=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],sp=Ic.length;function Li(e,t,r,a){var n=-1,i;for(ro(this,"space",a),Rc.call(this,e,t);++n<sp;)i=Ic[n],ro(this,i,(r&to[i])===to[i])}function ro(e,t,r){r&&(e[t]=r)}var ao=Oi,lp=yc,up=_c,de=dp;function dp(e){var t=e.space,r=e.mustUseProperty||[],a=e.attributes||{},n=e.properties,i=e.transform,s={},l={},u,c;for(u in n)c=new up(u,i(a,u),n[u],t),r.indexOf(u)!==-1&&(c.mustUseProperty=!0),s[u]=c,l[ao(u)]=u,l[ao(c.attribute)]=u;return new lp(s,l,t)}var cp=de,pp=cp({space:"xlink",transform:gp,properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});function gp(e,t){return"xlink:"+t.slice(5).toLowerCase()}var bp=de,mp=bp({space:"xml",transform:fp,properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fp(e,t){return"xml:"+t.slice(3).toLowerCase()}var Ep=hp;function hp(e,t){return t in e?e[t]:t}var Sp=Ep,Nc=yp;function yp(e,t){return Sp(e,t.toLowerCase())}var Tp=de,vp=Nc,Ap=Tp({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:vp,properties:{xmlns:null,xmlnsXLink:null}}),Di=K,Rp=de,H=Di.booleanish,j=Di.number,te=Di.spaceSeparated,_p=Rp({transform:Ip,properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:te,ariaCurrent:null,ariaDescribedBy:te,ariaDetails:null,ariaDisabled:H,ariaDropEffect:te,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:te,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:te,ariaLevel:j,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:te,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:te,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:H,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null}});function Ip(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}var oe=K,Np=de,wp=Nc,w=oe.boolean,Cp=oe.overloadedBoolean,se=oe.booleanish,D=oe.number,$=oe.spaceSeparated,ge=oe.commaSeparated,kp=Np({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wp,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ge,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:$,autoFocus:w,autoPlay:w,capture:w,charSet:null,checked:w,cite:null,className:$,cols:D,colSpan:null,content:null,contentEditable:se,controls:w,controlsList:$,coords:D|ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:Cp,draggable:se,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:$,height:D,hidden:w,high:D,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:ge,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:$,itemRef:$,itemScope:w,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:D,pattern:null,ping:$,placeholder:null,playsInline:w,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:$,required:w,reversed:w,rows:D,rowSpan:D,sandbox:$,scope:null,scoped:w,seamless:w,selected:w,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:se,src:null,srcDoc:null,srcLang:null,srcSet:ge,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:se,width:D,wrap:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:se,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:w,disableRemotePlayback:w,prefix:null,property:null,results:D,security:null,unselectable:null}}),Op=ap,Lp=pp,Dp=mp,xp=Ap,Mp=_p,Fp=kp,Up=Op([Dp,Lp,xp,Mp,Fp]),Bp=Oi,Pp=_c,Gp=vc,xi="data",$p=zp,qp=/^data[-\w.:]+$/i,wc=/-[a-z]/g,Hp=/[A-Z]/g;function zp(e,t){var r=Bp(t),a=t,n=Gp;return r in e.normal?e.property[e.normal[r]]:(r.length>4&&r.slice(0,4)===xi&&qp.test(t)&&(t.charAt(4)==="-"?a=Vp(t):t=jp(t),n=Pp),new n(a,t))}function Vp(e){var t=e.slice(5).replace(wc,Yp);return xi+t.charAt(0).toUpperCase()+t.slice(1)}function jp(e){var t=e.slice(4);return wc.test(t)?e:(t=t.replace(Hp,Wp),t.charAt(0)!=="-"&&(t="-"+t),xi+t)}function Wp(e){return"-"+e.toLowerCase()}function Yp(e){return e.charAt(1).toUpperCase()}var Kp=Zp,no=/[#.]/g;function Zp(e,t){for(var r=e||"",a=t||"div",n={},i=0,s,l,u;i<r.length;)no.lastIndex=i,u=no.exec(r),s=r.slice(i,u?u.index:r.length),s&&(l?l==="#"?n.id=s:n.className?n.className.push(s):n.className=[s]:a=s,i+=s.length),u&&(l=u[0],i++);return{type:"element",tagName:a,properties:n,children:[]}}var Mi={};Mi.parse=Jp;Mi.stringify=eg;var io="",Xp=" ",Qp=/[ \t\n\r\f]+/g;function Jp(e){var t=String(e||io).trim();return t===io?[]:t.split(Qp)}function eg(e){return e.join(Xp).trim()}var Fi={};Fi.parse=tg;Fi.stringify=rg;var wi=",",oo=" ",le="";function tg(e){for(var t=[],r=String(e||le),a=r.indexOf(wi),n=0,i=!1,s;!i;)a===-1&&(a=r.length,i=!0),s=r.slice(n,a).trim(),(s||!i)&&t.push(s),n=a+1,a=r.indexOf(wi,n);return t}function rg(e,t){var r=t||{},a=r.padLeft===!1?le:oo,n=r.padRight?oo:le;return e[e.length-1]===le&&(e=e.concat(le)),e.join(n+wi+a).trim()}var ag=$p,so=Oi,ng=Kp,lo=Mi.parse,uo=Fi.parse,ig=sg,og={}.hasOwnProperty;function sg(e,t,r){var a=r?pg(r):null;return n;function n(s,l){var u=ng(s,t),c=Array.prototype.slice.call(arguments,2),d=u.tagName.toLowerCase(),b;if(u.tagName=a&&og.call(a,d)?a[d]:d,l&&lg(l,u)&&(c.unshift(l),l=null),l)for(b in l)i(u.properties,b,l[b]);return Cc(u.children,c),u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}function i(s,l,u){var c,d,b;u==null||u!==u||(c=ag(e,l),d=c.property,b=u,typeof b=="string"&&(c.spaceSeparated?b=lo(b):c.commaSeparated?b=uo(b):c.commaOrSpaceSeparated&&(b=lo(uo(b).join(" ")))),d==="style"&&typeof u!="string"&&(b=cg(b)),d==="className"&&s.className&&(b=s.className.concat(b)),s[d]=dg(c,d,b))}}function lg(e,t){return typeof e=="string"||"length"in e||ug(t.tagName,e)}function ug(e,t){var r=t.type;return e==="input"||!r||typeof r!="string"?!1:typeof t.children=="object"&&"length"in t.children?!0:(r=r.toLowerCase(),e==="button"?r!=="menu"&&r!=="submit"&&r!=="reset"&&r!=="button":"value"in t)}function Cc(e,t){var r,a;if(typeof t=="string"||typeof t=="number"){e.push({type:"text",value:String(t)});return}if(typeof t=="object"&&"length"in t){for(r=-1,a=t.length;++r<a;)Cc(e,t[r]);return}if(typeof t!="object"||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");e.push(t)}function dg(e,t,r){var a,n,i;if(typeof r!="object"||!("length"in r))return co(e,t,r);for(n=r.length,a=-1,i=[];++a<n;)i[a]=co(e,t,r[a]);return i}function co(e,t,r){var a=r;return e.number||e.positiveNumber?!isNaN(a)&&a!==""&&(a=Number(a)):(e.boolean||e.overloadedBoolean)&&typeof a=="string"&&(a===""||so(r)===so(t))&&(a=!0),a}function cg(e){var t=[],r;for(r in e)t.push([r,e[r]].join(": "));return t.join("; ")}function pg(e){for(var t=e.length,r=-1,a={},n;++r<t;)n=e[r],a[n.toLowerCase()]=n;return a}var gg=Up,bg=ig,kc=bg(gg,"div");kc.displayName="html";var mg=kc,fg=mg;const Eg="Æ",hg="&",Sg="Á",yg="Â",Tg="À",vg="Å",Ag="Ã",Rg="Ä",_g="©",Ig="Ç",Ng="Ð",wg="É",Cg="Ê",kg="È",Og="Ë",Lg=">",Dg="Í",xg="Î",Mg="Ì",Fg="Ï",Ug="<",Bg="Ñ",Pg="Ó",Gg="Ô",$g="Ò",qg="Ø",Hg="Õ",zg="Ö",Vg='"',jg="®",Wg="Þ",Yg="Ú",Kg="Û",Zg="Ù",Xg="Ü",Qg="Ý",Jg="á",eb="â",tb="´",rb="æ",ab="à",nb="&",ib="å",ob="ã",sb="ä",lb="¦",ub="ç",db="¸",cb="¢",pb="©",gb="¤",bb="°",mb="÷",fb="é",Eb="ê",hb="è",Sb="ð",yb="ë",Tb="½",vb="¼",Ab="¾",Rb=">",_b="í",Ib="î",Nb="¡",wb="ì",Cb="¿",kb="ï",Ob="«",Lb="<",Db="¯",xb="µ",Mb="·",Fb=" ",Ub="¬",Bb="ñ",Pb="ó",Gb="ô",$b="ò",qb="ª",Hb="º",zb="ø",Vb="õ",jb="ö",Wb="¶",Yb="±",Kb="£",Zb='"',Xb="»",Qb="®",Jb="§",em="",tm="¹",rm="²",am="³",nm="ß",im="þ",om="×",sm="ú",lm="û",um="ù",dm="¨",cm="ü",pm="ý",gm="¥",bm="ÿ",mm={AElig:Eg,AMP:hg,Aacute:Sg,Acirc:yg,Agrave:Tg,Aring:vg,Atilde:Ag,Auml:Rg,COPY:_g,Ccedil:Ig,ETH:Ng,Eacute:wg,Ecirc:Cg,Egrave:kg,Euml:Og,GT:Lg,Iacute:Dg,Icirc:xg,Igrave:Mg,Iuml:Fg,LT:Ug,Ntilde:Bg,Oacute:Pg,Ocirc:Gg,Ograve:$g,Oslash:qg,Otilde:Hg,Ouml:zg,QUOT:Vg,REG:jg,THORN:Wg,Uacute:Yg,Ucirc:Kg,Ugrave:Zg,Uuml:Xg,Yacute:Qg,aacute:Jg,acirc:eb,acute:tb,aelig:rb,agrave:ab,amp:nb,aring:ib,atilde:ob,auml:sb,brvbar:lb,ccedil:ub,cedil:db,cent:cb,copy:pb,curren:gb,deg:bb,divide:mb,eacute:fb,ecirc:Eb,egrave:hb,eth:Sb,euml:yb,frac12:Tb,frac14:vb,frac34:Ab,gt:Rb,iacute:_b,icirc:Ib,iexcl:Nb,igrave:wb,iquest:Cb,iuml:kb,laquo:Ob,lt:Lb,macr:Db,micro:xb,middot:Mb,nbsp:Fb,not:Ub,ntilde:Bb,oacute:Pb,ocirc:Gb,ograve:$b,ordf:qb,ordm:Hb,oslash:zb,otilde:Vb,ouml:jb,para:Wb,plusmn:Yb,pound:Kb,quot:Zb,raquo:Xb,reg:Qb,sect:Jb,shy:em,sup1:tm,sup2:rm,sup3:am,szlig:nm,thorn:im,times:om,uacute:sm,ucirc:lm,ugrave:um,uml:dm,uuml:cm,yacute:pm,yen:gm,yuml:bm},fm={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var Oc=Em;function Em(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}var hm=Sm;function Sm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var ym=Tm;function Tm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var vm=ym,Am=Oc,Rm=_m;function _m(e){return vm(e)||Am(e)}var be,Im=59,Nm=wm;function wm(e){var t="&"+e+";",r;return be=be||document.createElement("i"),be.innerHTML=t,r=be.textContent,r.charCodeAt(r.length-1)===Im&&e!=="semi"||r===t?!1:r}var po=mm,go=fm,Cm=Oc,km=hm,Lc=Rm,Om=Nm,Lm=Vm,Dm={}.hasOwnProperty,ne=String.fromCharCode,xm=Function.prototype,bo={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},Mm=9,mo=10,Fm=12,Um=32,fo=38,Bm=59,Pm=60,Gm=61,$m=35,qm=88,Hm=120,zm=65533,ie="named",Ui="hexadecimal",Bi="decimal",Pi={};Pi[Ui]=16;Pi[Bi]=10;var fe={};fe[ie]=Lc;fe[Bi]=Cm;fe[Ui]=km;var Dc=1,xc=2,Mc=3,Fc=4,Uc=5,Ci=6,Bc=7,J={};J[Dc]="Named character references must be terminated by a semicolon";J[xc]="Numeric character references must be terminated by a semicolon";J[Mc]="Named character references cannot be empty";J[Fc]="Numeric character references cannot be empty";J[Uc]="Named character references must be known";J[Ci]="Numeric character references cannot be disallowed";J[Bc]="Numeric character references cannot be outside the permissible Unicode range";function Vm(e,t){var r={},a,n;t||(t={});for(n in bo)a=t[n],r[n]=a??bo[n];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),jm(e,r)}function jm(e,t){var r=t.additional,a=t.nonTerminated,n=t.text,i=t.reference,s=t.warning,l=t.textContext,u=t.referenceContext,c=t.warningContext,d=t.position,b=t.indent||[],h=e.length,S=0,_=-1,y=d.column||1,R=d.line||1,v="",g=[],p,m,E,f,A,I,T,N,C,U,B,q,P,G,Y,O,M,x,k;for(typeof r=="string"&&(r=r.charCodeAt(0)),O=L(),N=s?Z:xm,S--,h++;++S<h;)if(A===mo&&(y=b[_]||1),A=e.charCodeAt(S),A===fo){if(T=e.charCodeAt(S+1),T===Mm||T===mo||T===Fm||T===Um||T===fo||T===Pm||T!==T||r&&T===r){v+=ne(A),y++;continue}for(P=S+1,q=P,k=P,T===$m?(k=++q,T=e.charCodeAt(k),T===qm||T===Hm?(G=Ui,k=++q):G=Bi):G=ie,p="",B="",f="",Y=fe[G],k--;++k<h&&(T=e.charCodeAt(k),!!Y(T));)f+=ne(T),G===ie&&Dm.call(po,f)&&(p=f,B=po[f]);E=e.charCodeAt(k)===Bm,E&&(k++,m=G===ie?Om(f):!1,m&&(p=f,B=m)),x=1+k-P,!E&&!a||(f?G===ie?(E&&!B?N(Uc,1):(p!==f&&(k=q+p.length,x=1+k-q,E=!1),E||(C=p?Dc:Mc,t.attribute?(T=e.charCodeAt(k),T===Gm?(N(C,x),B=null):Lc(T)?B=null:N(C,x)):N(C,x))),I=B):(E||N(xc,x),I=parseInt(f,Pi[G]),Wm(I)?(N(Bc,x),I=ne(zm)):I in go?(N(Ci,x),I=go[I]):(U="",Ym(I)&&N(Ci,x),I>65535&&(I-=65536,U+=ne(I>>>10|55296),I=56320|I&1023),I=U+ne(I))):G!==ie&&N(Fc,x)),I?(V(),O=L(),S=k-1,y+=k-P+1,g.push(I),M=L(),M.offset++,i&&i.call(u,I,{start:O,end:M},e.slice(P-1,k)),O=M):(f=e.slice(P-1,k),v+=f,y+=f.length,S=k-1)}else A===10&&(R++,_++,y=0),A===A?(v+=ne(A),y++):V();return g.join("");function L(){return{line:R,column:y,offset:S+(d.offset||0)}}function Z(X,ee){var Q=L();Q.column+=ee,Q.offset+=ee,s.call(c,J[X],Q,X)}function V(){v&&(g.push(v),n&&n.call(l,v,{start:O,end:L()}),v="")}}function Wm(e){return e>=55296&&e<=57343||e>1114111}function Ym(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Pc={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
1
|
+
import{c as me,g as Xc}from"./index-51393291.js";function Qc(e,t){for(var r=0;r<t.length;r++){const a=t[r];if(typeof a!="string"&&!Array.isArray(a)){for(const n in a)if(n!=="default"&&!(n in e)){const i=Object.getOwnPropertyDescriptor(a,n);i&&Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Jc=tp,ep=Object.prototype.hasOwnProperty;function tp(){for(var e={},t=0;t<arguments.length;t++){var r=arguments[t];for(var a in r)ep.call(r,a)&&(e[a]=r[a])}return e}var yc=Tc,ki=Tc.prototype;ki.space=null;ki.normal={};ki.property={};function Tc(e,t,r){this.property=e,this.normal=t,r&&(this.space=r)}var eo=Jc,rp=yc,ap=np;function np(e){for(var t=e.length,r=[],a=[],n=-1,i,s;++n<t;)i=e[n],r.push(i.property),a.push(i.normal),s=i.space;return new rp(eo.apply(null,r),eo.apply(null,a),s)}var Oi=ip;function ip(e){return e.toLowerCase()}var vc=Ac,W=Ac.prototype;W.space=null;W.attribute=null;W.property=null;W.boolean=!1;W.booleanish=!1;W.overloadedBoolean=!1;W.number=!1;W.commaSeparated=!1;W.spaceSeparated=!1;W.commaOrSpaceSeparated=!1;W.mustUseProperty=!1;W.defined=!1;function Ac(e,t){this.property=e,this.attribute=t}var K={},op=0;K.boolean=re();K.booleanish=re();K.overloadedBoolean=re();K.number=re();K.spaceSeparated=re();K.commaSeparated=re();K.commaOrSpaceSeparated=re();function re(){return Math.pow(2,++op)}var Rc=vc,to=K,_c=Li;Li.prototype=new Rc;Li.prototype.defined=!0;var Ic=["boolean","booleanish","overloadedBoolean","number","commaSeparated","spaceSeparated","commaOrSpaceSeparated"],sp=Ic.length;function Li(e,t,r,a){var n=-1,i;for(ro(this,"space",a),Rc.call(this,e,t);++n<sp;)i=Ic[n],ro(this,i,(r&to[i])===to[i])}function ro(e,t,r){r&&(e[t]=r)}var ao=Oi,lp=yc,up=_c,de=dp;function dp(e){var t=e.space,r=e.mustUseProperty||[],a=e.attributes||{},n=e.properties,i=e.transform,s={},l={},u,c;for(u in n)c=new up(u,i(a,u),n[u],t),r.indexOf(u)!==-1&&(c.mustUseProperty=!0),s[u]=c,l[ao(u)]=u,l[ao(c.attribute)]=u;return new lp(s,l,t)}var cp=de,pp=cp({space:"xlink",transform:gp,properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}});function gp(e,t){return"xlink:"+t.slice(5).toLowerCase()}var bp=de,mp=bp({space:"xml",transform:fp,properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function fp(e,t){return"xml:"+t.slice(3).toLowerCase()}var Ep=hp;function hp(e,t){return t in e?e[t]:t}var Sp=Ep,Nc=yp;function yp(e,t){return Sp(e,t.toLowerCase())}var Tp=de,vp=Nc,Ap=Tp({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:vp,properties:{xmlns:null,xmlnsXLink:null}}),Di=K,Rp=de,H=Di.booleanish,j=Di.number,te=Di.spaceSeparated,_p=Rp({transform:Ip,properties:{ariaActiveDescendant:null,ariaAtomic:H,ariaAutoComplete:null,ariaBusy:H,ariaChecked:H,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:te,ariaCurrent:null,ariaDescribedBy:te,ariaDetails:null,ariaDisabled:H,ariaDropEffect:te,ariaErrorMessage:null,ariaExpanded:H,ariaFlowTo:te,ariaGrabbed:H,ariaHasPopup:null,ariaHidden:H,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:te,ariaLevel:j,ariaLive:null,ariaModal:H,ariaMultiLine:H,ariaMultiSelectable:H,ariaOrientation:null,ariaOwns:te,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:H,ariaReadOnly:H,ariaRelevant:null,ariaRequired:H,ariaRoleDescription:te,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:H,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null}});function Ip(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}var oe=K,Np=de,wp=Nc,w=oe.boolean,Cp=oe.overloadedBoolean,se=oe.booleanish,D=oe.number,$=oe.spaceSeparated,ge=oe.commaSeparated,kp=Np({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:wp,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:ge,acceptCharset:$,accessKey:$,action:null,allow:null,allowFullScreen:w,allowPaymentRequest:w,allowUserMedia:w,alt:null,as:null,async:w,autoCapitalize:null,autoComplete:$,autoFocus:w,autoPlay:w,capture:w,charSet:null,checked:w,cite:null,className:$,cols:D,colSpan:null,content:null,contentEditable:se,controls:w,controlsList:$,coords:D|ge,crossOrigin:null,data:null,dateTime:null,decoding:null,default:w,defer:w,dir:null,dirName:null,disabled:w,download:Cp,draggable:se,encType:null,enterKeyHint:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:w,formTarget:null,headers:$,height:D,hidden:w,high:D,href:null,hrefLang:null,htmlFor:$,httpEquiv:$,id:null,imageSizes:null,imageSrcSet:ge,inputMode:null,integrity:null,is:null,isMap:w,itemId:null,itemProp:$,itemRef:$,itemScope:w,itemType:$,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:w,low:D,manifest:null,max:null,maxLength:D,media:null,method:null,min:null,minLength:D,multiple:w,muted:w,name:null,nonce:null,noModule:w,noValidate:w,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforePrint:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextMenu:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:w,optimum:D,pattern:null,ping:$,placeholder:null,playsInline:w,poster:null,preload:null,readOnly:w,referrerPolicy:null,rel:$,required:w,reversed:w,rows:D,rowSpan:D,sandbox:$,scope:null,scoped:w,seamless:w,selected:w,shape:null,size:D,sizes:null,slot:null,span:D,spellCheck:se,src:null,srcDoc:null,srcLang:null,srcSet:ge,start:D,step:null,style:null,tabIndex:D,target:null,title:null,translate:null,type:null,typeMustMatch:w,useMap:null,value:se,width:D,wrap:null,align:null,aLink:null,archive:$,axis:null,background:null,bgColor:null,border:D,borderColor:null,bottomMargin:D,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:w,declare:w,event:null,face:null,frame:null,frameBorder:null,hSpace:D,leftMargin:D,link:null,longDesc:null,lowSrc:null,marginHeight:D,marginWidth:D,noResize:w,noHref:w,noShade:w,noWrap:w,object:null,profile:null,prompt:null,rev:null,rightMargin:D,rules:null,scheme:null,scrolling:se,standby:null,summary:null,text:null,topMargin:D,valueType:null,version:null,vAlign:null,vLink:null,vSpace:D,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:w,disableRemotePlayback:w,prefix:null,property:null,results:D,security:null,unselectable:null}}),Op=ap,Lp=pp,Dp=mp,xp=Ap,Mp=_p,Fp=kp,Up=Op([Dp,Lp,xp,Mp,Fp]),Bp=Oi,Pp=_c,Gp=vc,xi="data",$p=zp,qp=/^data[-\w.:]+$/i,wc=/-[a-z]/g,Hp=/[A-Z]/g;function zp(e,t){var r=Bp(t),a=t,n=Gp;return r in e.normal?e.property[e.normal[r]]:(r.length>4&&r.slice(0,4)===xi&&qp.test(t)&&(t.charAt(4)==="-"?a=Vp(t):t=jp(t),n=Pp),new n(a,t))}function Vp(e){var t=e.slice(5).replace(wc,Yp);return xi+t.charAt(0).toUpperCase()+t.slice(1)}function jp(e){var t=e.slice(4);return wc.test(t)?e:(t=t.replace(Hp,Wp),t.charAt(0)!=="-"&&(t="-"+t),xi+t)}function Wp(e){return"-"+e.toLowerCase()}function Yp(e){return e.charAt(1).toUpperCase()}var Kp=Zp,no=/[#.]/g;function Zp(e,t){for(var r=e||"",a=t||"div",n={},i=0,s,l,u;i<r.length;)no.lastIndex=i,u=no.exec(r),s=r.slice(i,u?u.index:r.length),s&&(l?l==="#"?n.id=s:n.className?n.className.push(s):n.className=[s]:a=s,i+=s.length),u&&(l=u[0],i++);return{type:"element",tagName:a,properties:n,children:[]}}var Mi={};Mi.parse=Jp;Mi.stringify=eg;var io="",Xp=" ",Qp=/[ \t\n\r\f]+/g;function Jp(e){var t=String(e||io).trim();return t===io?[]:t.split(Qp)}function eg(e){return e.join(Xp).trim()}var Fi={};Fi.parse=tg;Fi.stringify=rg;var wi=",",oo=" ",le="";function tg(e){for(var t=[],r=String(e||le),a=r.indexOf(wi),n=0,i=!1,s;!i;)a===-1&&(a=r.length,i=!0),s=r.slice(n,a).trim(),(s||!i)&&t.push(s),n=a+1,a=r.indexOf(wi,n);return t}function rg(e,t){var r=t||{},a=r.padLeft===!1?le:oo,n=r.padRight?oo:le;return e[e.length-1]===le&&(e=e.concat(le)),e.join(n+wi+a).trim()}var ag=$p,so=Oi,ng=Kp,lo=Mi.parse,uo=Fi.parse,ig=sg,og={}.hasOwnProperty;function sg(e,t,r){var a=r?pg(r):null;return n;function n(s,l){var u=ng(s,t),c=Array.prototype.slice.call(arguments,2),d=u.tagName.toLowerCase(),b;if(u.tagName=a&&og.call(a,d)?a[d]:d,l&&lg(l,u)&&(c.unshift(l),l=null),l)for(b in l)i(u.properties,b,l[b]);return Cc(u.children,c),u.tagName==="template"&&(u.content={type:"root",children:u.children},u.children=[]),u}function i(s,l,u){var c,d,b;u==null||u!==u||(c=ag(e,l),d=c.property,b=u,typeof b=="string"&&(c.spaceSeparated?b=lo(b):c.commaSeparated?b=uo(b):c.commaOrSpaceSeparated&&(b=lo(uo(b).join(" ")))),d==="style"&&typeof u!="string"&&(b=cg(b)),d==="className"&&s.className&&(b=s.className.concat(b)),s[d]=dg(c,d,b))}}function lg(e,t){return typeof e=="string"||"length"in e||ug(t.tagName,e)}function ug(e,t){var r=t.type;return e==="input"||!r||typeof r!="string"?!1:typeof t.children=="object"&&"length"in t.children?!0:(r=r.toLowerCase(),e==="button"?r!=="menu"&&r!=="submit"&&r!=="reset"&&r!=="button":"value"in t)}function Cc(e,t){var r,a;if(typeof t=="string"||typeof t=="number"){e.push({type:"text",value:String(t)});return}if(typeof t=="object"&&"length"in t){for(r=-1,a=t.length;++r<a;)Cc(e,t[r]);return}if(typeof t!="object"||!("type"in t))throw new Error("Expected node, nodes, or string, got `"+t+"`");e.push(t)}function dg(e,t,r){var a,n,i;if(typeof r!="object"||!("length"in r))return co(e,t,r);for(n=r.length,a=-1,i=[];++a<n;)i[a]=co(e,t,r[a]);return i}function co(e,t,r){var a=r;return e.number||e.positiveNumber?!isNaN(a)&&a!==""&&(a=Number(a)):(e.boolean||e.overloadedBoolean)&&typeof a=="string"&&(a===""||so(r)===so(t))&&(a=!0),a}function cg(e){var t=[],r;for(r in e)t.push([r,e[r]].join(": "));return t.join("; ")}function pg(e){for(var t=e.length,r=-1,a={},n;++r<t;)n=e[r],a[n.toLowerCase()]=n;return a}var gg=Up,bg=ig,kc=bg(gg,"div");kc.displayName="html";var mg=kc,fg=mg;const Eg="Æ",hg="&",Sg="Á",yg="Â",Tg="À",vg="Å",Ag="Ã",Rg="Ä",_g="©",Ig="Ç",Ng="Ð",wg="É",Cg="Ê",kg="È",Og="Ë",Lg=">",Dg="Í",xg="Î",Mg="Ì",Fg="Ï",Ug="<",Bg="Ñ",Pg="Ó",Gg="Ô",$g="Ò",qg="Ø",Hg="Õ",zg="Ö",Vg='"',jg="®",Wg="Þ",Yg="Ú",Kg="Û",Zg="Ù",Xg="Ü",Qg="Ý",Jg="á",eb="â",tb="´",rb="æ",ab="à",nb="&",ib="å",ob="ã",sb="ä",lb="¦",ub="ç",db="¸",cb="¢",pb="©",gb="¤",bb="°",mb="÷",fb="é",Eb="ê",hb="è",Sb="ð",yb="ë",Tb="½",vb="¼",Ab="¾",Rb=">",_b="í",Ib="î",Nb="¡",wb="ì",Cb="¿",kb="ï",Ob="«",Lb="<",Db="¯",xb="µ",Mb="·",Fb=" ",Ub="¬",Bb="ñ",Pb="ó",Gb="ô",$b="ò",qb="ª",Hb="º",zb="ø",Vb="õ",jb="ö",Wb="¶",Yb="±",Kb="£",Zb='"',Xb="»",Qb="®",Jb="§",em="",tm="¹",rm="²",am="³",nm="ß",im="þ",om="×",sm="ú",lm="û",um="ù",dm="¨",cm="ü",pm="ý",gm="¥",bm="ÿ",mm={AElig:Eg,AMP:hg,Aacute:Sg,Acirc:yg,Agrave:Tg,Aring:vg,Atilde:Ag,Auml:Rg,COPY:_g,Ccedil:Ig,ETH:Ng,Eacute:wg,Ecirc:Cg,Egrave:kg,Euml:Og,GT:Lg,Iacute:Dg,Icirc:xg,Igrave:Mg,Iuml:Fg,LT:Ug,Ntilde:Bg,Oacute:Pg,Ocirc:Gg,Ograve:$g,Oslash:qg,Otilde:Hg,Ouml:zg,QUOT:Vg,REG:jg,THORN:Wg,Uacute:Yg,Ucirc:Kg,Ugrave:Zg,Uuml:Xg,Yacute:Qg,aacute:Jg,acirc:eb,acute:tb,aelig:rb,agrave:ab,amp:nb,aring:ib,atilde:ob,auml:sb,brvbar:lb,ccedil:ub,cedil:db,cent:cb,copy:pb,curren:gb,deg:bb,divide:mb,eacute:fb,ecirc:Eb,egrave:hb,eth:Sb,euml:yb,frac12:Tb,frac14:vb,frac34:Ab,gt:Rb,iacute:_b,icirc:Ib,iexcl:Nb,igrave:wb,iquest:Cb,iuml:kb,laquo:Ob,lt:Lb,macr:Db,micro:xb,middot:Mb,nbsp:Fb,not:Ub,ntilde:Bb,oacute:Pb,ocirc:Gb,ograve:$b,ordf:qb,ordm:Hb,oslash:zb,otilde:Vb,ouml:jb,para:Wb,plusmn:Yb,pound:Kb,quot:Zb,raquo:Xb,reg:Qb,sect:Jb,shy:em,sup1:tm,sup2:rm,sup3:am,szlig:nm,thorn:im,times:om,uacute:sm,ucirc:lm,ugrave:um,uml:dm,uuml:cm,yacute:pm,yen:gm,yuml:bm},fm={0:"�",128:"€",130:"‚",131:"ƒ",132:"„",133:"…",134:"†",135:"‡",136:"ˆ",137:"‰",138:"Š",139:"‹",140:"Œ",142:"Ž",145:"‘",146:"’",147:"“",148:"”",149:"•",150:"–",151:"—",152:"˜",153:"™",154:"š",155:"›",156:"œ",158:"ž",159:"Ÿ"};var Oc=Em;function Em(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=48&&t<=57}var hm=Sm;function Sm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=102||t>=65&&t<=70||t>=48&&t<=57}var ym=Tm;function Tm(e){var t=typeof e=="string"?e.charCodeAt(0):e;return t>=97&&t<=122||t>=65&&t<=90}var vm=ym,Am=Oc,Rm=_m;function _m(e){return vm(e)||Am(e)}var be,Im=59,Nm=wm;function wm(e){var t="&"+e+";",r;return be=be||document.createElement("i"),be.innerHTML=t,r=be.textContent,r.charCodeAt(r.length-1)===Im&&e!=="semi"||r===t?!1:r}var po=mm,go=fm,Cm=Oc,km=hm,Lc=Rm,Om=Nm,Lm=Vm,Dm={}.hasOwnProperty,ne=String.fromCharCode,xm=Function.prototype,bo={warning:null,reference:null,text:null,warningContext:null,referenceContext:null,textContext:null,position:{},additional:null,attribute:!1,nonTerminated:!0},Mm=9,mo=10,Fm=12,Um=32,fo=38,Bm=59,Pm=60,Gm=61,$m=35,qm=88,Hm=120,zm=65533,ie="named",Ui="hexadecimal",Bi="decimal",Pi={};Pi[Ui]=16;Pi[Bi]=10;var fe={};fe[ie]=Lc;fe[Bi]=Cm;fe[Ui]=km;var Dc=1,xc=2,Mc=3,Fc=4,Uc=5,Ci=6,Bc=7,J={};J[Dc]="Named character references must be terminated by a semicolon";J[xc]="Numeric character references must be terminated by a semicolon";J[Mc]="Named character references cannot be empty";J[Fc]="Numeric character references cannot be empty";J[Uc]="Named character references must be known";J[Ci]="Numeric character references cannot be disallowed";J[Bc]="Numeric character references cannot be outside the permissible Unicode range";function Vm(e,t){var r={},a,n;t||(t={});for(n in bo)a=t[n],r[n]=a??bo[n];return(r.position.indent||r.position.start)&&(r.indent=r.position.indent||[],r.position=r.position.start),jm(e,r)}function jm(e,t){var r=t.additional,a=t.nonTerminated,n=t.text,i=t.reference,s=t.warning,l=t.textContext,u=t.referenceContext,c=t.warningContext,d=t.position,b=t.indent||[],h=e.length,S=0,_=-1,y=d.column||1,R=d.line||1,v="",g=[],p,m,E,f,A,I,T,N,C,U,B,q,P,G,Y,O,M,x,k;for(typeof r=="string"&&(r=r.charCodeAt(0)),O=L(),N=s?Z:xm,S--,h++;++S<h;)if(A===mo&&(y=b[_]||1),A=e.charCodeAt(S),A===fo){if(T=e.charCodeAt(S+1),T===Mm||T===mo||T===Fm||T===Um||T===fo||T===Pm||T!==T||r&&T===r){v+=ne(A),y++;continue}for(P=S+1,q=P,k=P,T===$m?(k=++q,T=e.charCodeAt(k),T===qm||T===Hm?(G=Ui,k=++q):G=Bi):G=ie,p="",B="",f="",Y=fe[G],k--;++k<h&&(T=e.charCodeAt(k),!!Y(T));)f+=ne(T),G===ie&&Dm.call(po,f)&&(p=f,B=po[f]);E=e.charCodeAt(k)===Bm,E&&(k++,m=G===ie?Om(f):!1,m&&(p=f,B=m)),x=1+k-P,!E&&!a||(f?G===ie?(E&&!B?N(Uc,1):(p!==f&&(k=q+p.length,x=1+k-q,E=!1),E||(C=p?Dc:Mc,t.attribute?(T=e.charCodeAt(k),T===Gm?(N(C,x),B=null):Lc(T)?B=null:N(C,x)):N(C,x))),I=B):(E||N(xc,x),I=parseInt(f,Pi[G]),Wm(I)?(N(Bc,x),I=ne(zm)):I in go?(N(Ci,x),I=go[I]):(U="",Ym(I)&&N(Ci,x),I>65535&&(I-=65536,U+=ne(I>>>10|55296),I=56320|I&1023),I=U+ne(I))):G!==ie&&N(Fc,x)),I?(V(),O=L(),S=k-1,y+=k-P+1,g.push(I),M=L(),M.offset++,i&&i.call(u,I,{start:O,end:M},e.slice(P-1,k)),O=M):(f=e.slice(P-1,k),v+=f,y+=f.length,S=k-1)}else A===10&&(R++,_++,y=0),A===A?(v+=ne(A),y++):V();return g.join("");function L(){return{line:R,column:y,offset:S+(d.offset||0)}}function Z(X,ee){var Q=L();Q.column+=ee,Q.offset+=ee,s.call(c,J[X],Q,X)}function V(){v&&(g.push(v),n&&n.call(l,v,{start:O,end:L()}),v="")}}function Wm(e){return e>=55296&&e<=57343||e>1114111}function Ym(e){return e>=1&&e<=8||e===11||e>=13&&e<=31||e>=127&&e<=159||e>=64976&&e<=65007||(e&65535)===65535||(e&65535)===65534}var Pc={exports:{}};(function(e){var t=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};/**
|
|
2
2
|
* Prism: Lightweight, robust, elegant syntax highlighting
|
|
3
3
|
*
|
|
4
4
|
* @license MIT <https://opensource.org/licenses/MIT>
|
|
@@ -224,7 +224,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
224
224
|
`))})}function iCe(e){var t=e.codeString,n=e.codeStyle,r=e.containerStyle,i=r===void 0?{float:"left",paddingRight:"10px"}:r,o=e.numberStyle,a=o===void 0?{}:o,s=e.startingLineNumber;return pt.createElement("code",{style:Object.assign({},n,i)},rCe({lines:t.replace(/\n$/,"").split(`
|
|
225
225
|
`),style:a,startingLineNumber:s}))}function oCe(e){return"".concat(e.toString().length,".25em")}function tU(e,t){return{type:"element",tagName:"span",properties:{key:"line-number--".concat(e),className:["comment","linenumber","react-syntax-highlighter-line-number"],style:t},children:[{type:"text",value:e}]}}function nU(e,t,n){var r={display:"inline-block",minWidth:oCe(n),paddingRight:"1em",textAlign:"right",userSelect:"none"},i=typeof e=="function"?e(t):e,o=Da(Da({},r),i);return o}function f0(e){var t=e.children,n=e.lineNumber,r=e.lineNumberStyle,i=e.largestLineNumber,o=e.showInlineLineNumbers,a=e.lineProps,s=a===void 0?{}:a,l=e.className,c=l===void 0?[]:l,f=e.showLineNumbers,h=e.wrapLongLines,p=typeof s=="function"?s(n):s;if(p.className=c,n&&o){var y=nU(r,n,i);t.unshift(tU(n,y))}return h&f&&(p.style=Da(Da({},p.style),{},{display:"flex"})),{type:"element",tagName:"span",properties:p,children:t}}function rU(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=0;r<e.length;r++){var i=e[r];if(i.type==="text")n.push(f0({children:[i],className:q_e(new Set(t))}));else if(i.children){var o=t.concat(i.properties.className);rU(i.children,o).forEach(function(a){return n.push(a)})}}return n}function aCe(e,t,n,r,i,o,a,s,l){var c,f=rU(e.value),h=[],p=-1,y=0;function m(O,$){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return f0({children:O,lineNumber:$,lineNumberStyle:s,largestLineNumber:a,showInlineLineNumbers:i,lineProps:n,className:I,showLineNumbers:r,wrapLongLines:l})}function v(O,$){if(r&&$&&i){var I=nU(s,$,a);O.unshift(tU($,I))}return O}function S(O,$){var I=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];return t||I.length>0?m(O,$,I):v(O,$)}for(var x=function(){var $=f[y],I=$.children[0].value,W=nCe(I);if(W){var H=I.split(`
|
|
226
226
|
`);H.forEach(function(j,U){var le=r&&h.length+o,se={type:"text",value:"".concat(j,`
|
|
227
|
-
`)};if(U===0){var ie=f.slice(p+1,y).concat(f0({children:[se],className:$.properties.className})),Q=S(ie,le);h.push(Q)}else if(U===H.length-1){var L=f[y+1]&&f[y+1].children&&f[y+1].children[0],te={type:"text",value:"".concat(j)};if(L){var Z=f0({children:[te],className:$.properties.className});f.splice(y+1,0,Z)}else{var ee=[te],Y=S(ee,le,$.properties.className);h.push(Y)}}else{var M=[se],A=S(M,le,$.properties.className);h.push(A)}}),p=y}y++};y<f.length;)x();if(p!==f.length-1){var w=f.slice(p+1,f.length);if(w&&w.length){var C=r&&h.length+o,E=S(w,C);h.push(E)}}return t?h:(c=[]).concat.apply(c,h)}function sCe(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(i,o){return eU({node:i,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(o)})})}function iU(e){return e&&typeof e.highlightAuto<"u"}function lCe(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(iU(t)){var o=Q_e(t,n);return n==="text"?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function uCe(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=a===void 0?t:a,l=r.customStyle,c=l===void 0?{}:l,f=r.codeTagProps,h=f===void 0?{className:i?"language-".concat(i):void 0,style:Da(Da({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:f,p=r.useInlineStyles,y=p===void 0?!0:p,m=r.showLineNumbers,v=m===void 0?!1:m,S=r.showInlineLineNumbers,x=S===void 0?!0:S,w=r.startingLineNumber,C=w===void 0?1:w,E=r.lineNumberContainerStyle,O=r.lineNumberStyle,$=O===void 0?{}:O,I=r.wrapLines,W=r.wrapLongLines,H=W===void 0?!1:W,j=r.lineProps,U=j===void 0?{}:j,le=r.renderer,se=r.PreTag,ie=se===void 0?"pre":se,Q=r.CodeTag,L=Q===void 0?"code":Q,te=r.code,Z=te===void 0?(Array.isArray(o)?o[0]:o)||"":te,ee=r.astGenerator,Y=U_e(r,eCe);ee=ee||e;var M=v?pt.createElement(iCe,{containerStyle:E,codeStyle:h.style||{},numberStyle:$,startingLineNumber:C,codeString:Z}):null,A=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},ne=iU(ee)?"hljs":"prismjs",oe=y?Object.assign({},Y,{style:Object.assign({},A,c)}):Object.assign({},Y,{className:Y.className?"".concat(ne," ").concat(Y.className):ne,style:Object.assign({},c)});if(H?h.style=Da(Da({},h.style),{},{whiteSpace:"pre-wrap"}):h.style=Da(Da({},h.style),{},{whiteSpace:"pre"}),!ee)return pt.createElement(ie,oe,M,pt.createElement(L,h,Z));(I===void 0&&le||H)&&(I=!0),le=le||sCe;var ce=[{type:"text",value:Z}],re=lCe({astGenerator:ee,language:i,code:Z,defaultCodeValue:ce});re.language===null&&(re.value=ce);var Se=re.value.length+C,ke=aCe(re,I,U,v,x,C,Se,$,H);return pt.createElement(ie,oe,pt.createElement(L,h,!x&&M,le({rows:ke,stylesheet:s,useInlineStyles:y})))}}const cCe="modulepreload",fCe=function(e){return"/"+e},PL={},dCe=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=fCe(o),o in PL)return;PL[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":cCe,a||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),a)return new Promise((f,h)=>{c.addEventListener("load",f),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function LL(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){n(c);return}s.done?t(l):Promise.resolve(l).then(r,i)}function pCe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){LL(o,r,i,a,s,"next",l)}function s(l){LL(o,r,i,a,s,"throw",l)}a(void 0)})}}function hCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q6(r.key),r)}}function gCe(e,t,n){return t&&FL(e.prototype,t),n&&FL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o1(e,t)}function vCe(e,t){if(t&&(Td(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s1(e)}function m1(e){return m1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},m1(e)}var oU={exports:{}},aU={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(aU);var yCe=aU.exports;(function(e){var t=yCe.default;function n(){e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(Q,L,te){Q[L]=te.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function h(Q,L,te){return Object.defineProperty(Q,L,{value:te,enumerable:!0,configurable:!0,writable:!0}),Q[L]}try{h({},"")}catch{h=function(te,Z,ee){return te[Z]=ee}}function p(Q,L,te,Z){var ee=L&&L.prototype instanceof v?L:v,Y=Object.create(ee.prototype),M=new le(Z||[]);return a(Y,"_invoke",{value:W(Q,te,M)}),Y}function y(Q,L,te){try{return{type:"normal",arg:Q.call(L,te)}}catch(Z){return{type:"throw",arg:Z}}}r.wrap=p;var m={};function v(){}function S(){}function x(){}var w={};h(w,l,function(){return this});var C=Object.getPrototypeOf,E=C&&C(C(se([])));E&&E!==i&&o.call(E,l)&&(w=E);var O=x.prototype=v.prototype=Object.create(w);function $(Q){["next","throw","return"].forEach(function(L){h(Q,L,function(te){return this._invoke(L,te)})})}function I(Q,L){function te(ee,Y,M,A){var ne=y(Q[ee],Q,Y);if(ne.type!=="throw"){var oe=ne.arg,ce=oe.value;return ce&&t(ce)=="object"&&o.call(ce,"__await")?L.resolve(ce.__await).then(function(re){te("next",re,M,A)},function(re){te("throw",re,M,A)}):L.resolve(ce).then(function(re){oe.value=re,M(oe)},function(re){return te("throw",re,M,A)})}A(ne.arg)}var Z;a(this,"_invoke",{value:function(Y,M){function A(){return new L(function(ne,oe){te(Y,M,ne,oe)})}return Z=Z?Z.then(A,A):A()}})}function W(Q,L,te){var Z="suspendedStart";return function(ee,Y){if(Z==="executing")throw new Error("Generator is already running");if(Z==="completed"){if(ee==="throw")throw Y;return ie()}for(te.method=ee,te.arg=Y;;){var M=te.delegate;if(M){var A=H(M,te);if(A){if(A===m)continue;return A}}if(te.method==="next")te.sent=te._sent=te.arg;else if(te.method==="throw"){if(Z==="suspendedStart")throw Z="completed",te.arg;te.dispatchException(te.arg)}else te.method==="return"&&te.abrupt("return",te.arg);Z="executing";var ne=y(Q,L,te);if(ne.type==="normal"){if(Z=te.done?"completed":"suspendedYield",ne.arg===m)continue;return{value:ne.arg,done:te.done}}ne.type==="throw"&&(Z="completed",te.method="throw",te.arg=ne.arg)}}}function H(Q,L){var te=L.method,Z=Q.iterator[te];if(Z===void 0)return L.delegate=null,te==="throw"&&Q.iterator.return&&(L.method="return",L.arg=void 0,H(Q,L),L.method==="throw")||te!=="return"&&(L.method="throw",L.arg=new TypeError("The iterator does not provide a '"+te+"' method")),m;var ee=y(Z,Q.iterator,L.arg);if(ee.type==="throw")return L.method="throw",L.arg=ee.arg,L.delegate=null,m;var Y=ee.arg;return Y?Y.done?(L[Q.resultName]=Y.value,L.next=Q.nextLoc,L.method!=="return"&&(L.method="next",L.arg=void 0),L.delegate=null,m):Y:(L.method="throw",L.arg=new TypeError("iterator result is not an object"),L.delegate=null,m)}function j(Q){var L={tryLoc:Q[0]};1 in Q&&(L.catchLoc=Q[1]),2 in Q&&(L.finallyLoc=Q[2],L.afterLoc=Q[3]),this.tryEntries.push(L)}function U(Q){var L=Q.completion||{};L.type="normal",delete L.arg,Q.completion=L}function le(Q){this.tryEntries=[{tryLoc:"root"}],Q.forEach(j,this),this.reset(!0)}function se(Q){if(Q){var L=Q[l];if(L)return L.call(Q);if(typeof Q.next=="function")return Q;if(!isNaN(Q.length)){var te=-1,Z=function ee(){for(;++te<Q.length;)if(o.call(Q,te))return ee.value=Q[te],ee.done=!1,ee;return ee.value=void 0,ee.done=!0,ee};return Z.next=Z}}return{next:ie}}function ie(){return{value:void 0,done:!0}}return S.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:S,configurable:!0}),S.displayName=h(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(Q){var L=typeof Q=="function"&&Q.constructor;return!!L&&(L===S||(L.displayName||L.name)==="GeneratorFunction")},r.mark=function(Q){return Object.setPrototypeOf?Object.setPrototypeOf(Q,x):(Q.__proto__=x,h(Q,f,"GeneratorFunction")),Q.prototype=Object.create(O),Q},r.awrap=function(Q){return{__await:Q}},$(I.prototype),h(I.prototype,c,function(){return this}),r.AsyncIterator=I,r.async=function(Q,L,te,Z,ee){ee===void 0&&(ee=Promise);var Y=new I(p(Q,L,te,Z),ee);return r.isGeneratorFunction(L)?Y:Y.next().then(function(M){return M.done?M.value:Y.next()})},$(O),h(O,f,"Generator"),h(O,l,function(){return this}),h(O,"toString",function(){return"[object Generator]"}),r.keys=function(Q){var L=Object(Q),te=[];for(var Z in L)te.push(Z);return te.reverse(),function ee(){for(;te.length;){var Y=te.pop();if(Y in L)return ee.value=Y,ee.done=!1,ee}return ee.done=!0,ee}},r.values=se,le.prototype={constructor:le,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(U),!L)for(var te in this)te.charAt(0)==="t"&&o.call(this,te)&&!isNaN(+te.slice(1))&&(this[te]=void 0)},stop:function(){this.done=!0;var L=this.tryEntries[0].completion;if(L.type==="throw")throw L.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var te=this;function Z(oe,ce){return M.type="throw",M.arg=L,te.next=oe,ce&&(te.method="next",te.arg=void 0),!!ce}for(var ee=this.tryEntries.length-1;ee>=0;--ee){var Y=this.tryEntries[ee],M=Y.completion;if(Y.tryLoc==="root")return Z("end");if(Y.tryLoc<=this.prev){var A=o.call(Y,"catchLoc"),ne=o.call(Y,"finallyLoc");if(A&&ne){if(this.prev<Y.catchLoc)return Z(Y.catchLoc,!0);if(this.prev<Y.finallyLoc)return Z(Y.finallyLoc)}else if(A){if(this.prev<Y.catchLoc)return Z(Y.catchLoc,!0)}else{if(!ne)throw new Error("try statement without catch or finally");if(this.prev<Y.finallyLoc)return Z(Y.finallyLoc)}}}},abrupt:function(L,te){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var ee=this.tryEntries[Z];if(ee.tryLoc<=this.prev&&o.call(ee,"finallyLoc")&&this.prev<ee.finallyLoc){var Y=ee;break}}Y&&(L==="break"||L==="continue")&&Y.tryLoc<=te&&te<=Y.finallyLoc&&(Y=null);var M=Y?Y.completion:{};return M.type=L,M.arg=te,Y?(this.method="next",this.next=Y.finallyLoc,m):this.complete(M)},complete:function(L,te){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&te&&(this.next=te),m},finish:function(L){for(var te=this.tryEntries.length-1;te>=0;--te){var Z=this.tryEntries[te];if(Z.finallyLoc===L)return this.complete(Z.completion,Z.afterLoc),U(Z),m}},catch:function(L){for(var te=this.tryEntries.length-1;te>=0;--te){var Z=this.tryEntries[te];if(Z.tryLoc===L){var ee=Z.completion;if(ee.type==="throw"){var Y=ee.arg;U(Z)}return Y}}throw new Error("illegal catch attempt")},delegateYield:function(L,te,Z){return this.delegate={iterator:se(L),resultName:te,nextLoc:Z},this.method==="next"&&(this.arg=void 0),m}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(oU);var bCe=oU.exports,d0=bCe(),xCe=d0;try{regeneratorRuntime=d0}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=d0:Function("r","regeneratorRuntime = r")(d0)}const ML=Ha(xCe);function wCe(e){var t=SCe();return function(){var r=m1(e),i;if(t){var o=m1(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return vCe(this,i)}}function SCe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}const _Ce=function(e){var t=e.loader,n=e.isLanguageRegistered,r=e.registerLanguage,i=e.languageLoaders,o=e.noAsyncLoadingLanguages,a=function(s){mCe(c,s);var l=wCe(c);function c(){return hCe(this,c),l.apply(this,arguments)}return gCe(c,[{key:"componentDidUpdate",value:function(){!c.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var h=this;c.astGeneratorPromise||c.loadAstGenerator(),c.astGenerator||c.astGeneratorPromise.then(function(){h.forceUpdate()}),!c.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var h=this,p=this.props.language;p!=="text"&&c.loadLanguage(p).then(function(){return h.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(h){return c.isSupportedLanguage(h)?h:"text"}},{key:"render",value:function(){return pt.createElement(c.highlightInstance,z({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:c.astGenerator}))}}],[{key:"preload",value:function(){return c.loadAstGenerator()}},{key:"loadLanguage",value:function(){var f=pCe(ML.mark(function p(y){var m;return ML.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m=i[y],typeof m!="function"){S.next=5;break}return S.abrupt("return",m(c.registerLanguage));case 5:throw new Error("Language ".concat(y," not supported"));case 6:case"end":return S.stop()}},p)}));function h(p){return f.apply(this,arguments)}return h}()},{key:"isSupportedLanguage",value:function(h){return c.isRegistered(h)||typeof i[h]=="function"}},{key:"loadAstGenerator",value:function(){return c.astGeneratorPromise=t().then(function(h){c.astGenerator=h,r&&c.languages.forEach(function(p,y){return r(h,y,p)})}),c.astGeneratorPromise}}]),c}(pt.PureComponent);return Ss(a,"astGenerator",null),Ss(a,"highlightInstance",uCe(null,{})),Ss(a,"astGeneratorPromise",null),Ss(a,"languages",new Map),Ss(a,"supportedLanguages",e.supportedLanguages||Object.keys(i||{})),Ss(a,"isRegistered",function(s){if(o)return!0;if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");return a.astGenerator?n(a.astGenerator,s):a.languages.has(s)}),Ss(a,"registerLanguage",function(s,l){if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");if(a.astGenerator)return r(a.astGenerator,s,l);a.languages.set(s,l)}),a},CCe=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"],ECe=_Ce({loader:function(){return dCe(()=>import("./index-995e21ad.js").then(t=>t.i),[]).then(function(t){return t.default||t})},noAsyncLoadingLanguages:!0,supportedLanguages:CCe}),kCe={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#282a36",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.3em"},':not(pre) > code[class*="language-"]':{background:"#282a36",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},".namespace":{Opacity:".7"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},constant:{color:"#ff79c6"},symbol:{color:"#ff79c6"},deleted:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#50fa7b"},char:{color:"#50fa7b"},builtin:{color:"#50fa7b"},inserted:{color:"#50fa7b"},operator:{color:"#f8f8f2"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#f8f8f2"},".language-css .token.string":{color:"#f8f8f2"},".style .token.string":{color:"#f8f8f2"},variable:{color:"#f8f8f2"},atrule:{color:"#f1fa8c"},"attr-value":{color:"#f1fa8c"},function:{color:"#f1fa8c"},"class-name":{color:"#f1fa8c"},keyword:{color:"#8be9fd"},regex:{color:"#ffb86c"},important:{color:"#ffb86c",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};function rA({inline:e,children:t,...n}){const r=fa(),i=/language-(\w+)/.exec(n.className||"");return!e&&i?k.jsx(ECe,{...n,children:String(t).replace(/\n$/,""),style:kCe,wrapLongLines:!0,language:i[1],PreTag:"div"}):e?k.jsx("code",{...n,style:{background:r.palette.divider,borderRadius:"4px",padding:"0.2em 0.4em",overflowX:"auto"},children:t}):k.jsx(At,{sx:{background:r.palette.divider,borderRadius:"4px",padding:r.spacing(1),overflowX:"auto"},children:k.jsx("code",{...n,style:{whiteSpace:"pre-wrap"},children:t})})}function TCe(e){return k.jsx(At,{sx:{p:1,boxSizing:"border-box",bgcolor:t=>t.palette.mode==="light"?"#EEEEEE":"#212121",borderRadius:"4px",display:"flex"},children:e.children})}const RCe=(e,t)=>{const n=document.createElement("a");n.href=t,n.target="_blank",n.download=e,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)};function sU({element:e}){const t=e.url||URL.createObjectURL(new Blob([e.content])),n=`${e.display}-image`;return k.jsx(TCe,{children:k.jsx("img",{className:n,src:t,onClick:()=>{if(e.display==="inline"){const r=`${e.name}.png`;RCe(r,t)}},style:{objectFit:"cover",maxWidth:"100%",margin:"auto",height:"auto",display:"block",cursor:e.display==="inline"?"pointer":"default"},alt:e.name,loading:"lazy"})})}function NL(e){return e.size==="small"?1:e.size==="medium"?2:e.size==="large"?4:2}function ACe({items:e}){return k.jsx(sge,{sx:{margin:0,transform:"translateZ(0)",width:"100%",maxWidth:600,maxHeight:400},variant:"quilted",cols:4,gap:8,children:e.map((t,n)=>{const r=NL(t),i=NL(t);return k.jsx(hge,{cols:r,rows:i,children:k.jsx(sU,{element:t})},n)})})}function lU({element:e}){const[t,n]=T.useState(!1),[r,i]=T.useState(!1),[o,a]=T.useState("");T.useEffect(()=>{t||!e.url||(n(!0),fetch(e.url).then(l=>l.text()).then(l=>{a(l),n(!1),i(!1)}).catch(()=>{a(""),i(!0),n(!1)}))},[e]);let s=t?"Loading...":r?"Error":o||e.content;return!t&&!r&&e.language&&(s=`\`\`\`${e.language}
|
|
227
|
+
`)};if(U===0){var ie=f.slice(p+1,y).concat(f0({children:[se],className:$.properties.className})),Q=S(ie,le);h.push(Q)}else if(U===H.length-1){var L=f[y+1]&&f[y+1].children&&f[y+1].children[0],te={type:"text",value:"".concat(j)};if(L){var Z=f0({children:[te],className:$.properties.className});f.splice(y+1,0,Z)}else{var ee=[te],Y=S(ee,le,$.properties.className);h.push(Y)}}else{var M=[se],A=S(M,le,$.properties.className);h.push(A)}}),p=y}y++};y<f.length;)x();if(p!==f.length-1){var w=f.slice(p+1,f.length);if(w&&w.length){var C=r&&h.length+o,E=S(w,C);h.push(E)}}return t?h:(c=[]).concat.apply(c,h)}function sCe(e){var t=e.rows,n=e.stylesheet,r=e.useInlineStyles;return t.map(function(i,o){return eU({node:i,stylesheet:n,useInlineStyles:r,key:"code-segement".concat(o)})})}function iU(e){return e&&typeof e.highlightAuto<"u"}function lCe(e){var t=e.astGenerator,n=e.language,r=e.code,i=e.defaultCodeValue;if(iU(t)){var o=Q_e(t,n);return n==="text"?{value:i,language:"text"}:o?t.highlight(n,r):t.highlightAuto(r)}try{return n&&n!=="text"?{value:t.highlight(r,n)}:{value:i}}catch{return{value:i}}}function uCe(e,t){return function(r){var i=r.language,o=r.children,a=r.style,s=a===void 0?t:a,l=r.customStyle,c=l===void 0?{}:l,f=r.codeTagProps,h=f===void 0?{className:i?"language-".concat(i):void 0,style:Da(Da({},s['code[class*="language-"]']),s['code[class*="language-'.concat(i,'"]')])}:f,p=r.useInlineStyles,y=p===void 0?!0:p,m=r.showLineNumbers,v=m===void 0?!1:m,S=r.showInlineLineNumbers,x=S===void 0?!0:S,w=r.startingLineNumber,C=w===void 0?1:w,E=r.lineNumberContainerStyle,O=r.lineNumberStyle,$=O===void 0?{}:O,I=r.wrapLines,W=r.wrapLongLines,H=W===void 0?!1:W,j=r.lineProps,U=j===void 0?{}:j,le=r.renderer,se=r.PreTag,ie=se===void 0?"pre":se,Q=r.CodeTag,L=Q===void 0?"code":Q,te=r.code,Z=te===void 0?(Array.isArray(o)?o[0]:o)||"":te,ee=r.astGenerator,Y=U_e(r,eCe);ee=ee||e;var M=v?pt.createElement(iCe,{containerStyle:E,codeStyle:h.style||{},numberStyle:$,startingLineNumber:C,codeString:Z}):null,A=s.hljs||s['pre[class*="language-"]']||{backgroundColor:"#fff"},ne=iU(ee)?"hljs":"prismjs",oe=y?Object.assign({},Y,{style:Object.assign({},A,c)}):Object.assign({},Y,{className:Y.className?"".concat(ne," ").concat(Y.className):ne,style:Object.assign({},c)});if(H?h.style=Da(Da({},h.style),{},{whiteSpace:"pre-wrap"}):h.style=Da(Da({},h.style),{},{whiteSpace:"pre"}),!ee)return pt.createElement(ie,oe,M,pt.createElement(L,h,Z));(I===void 0&&le||H)&&(I=!0),le=le||sCe;var ce=[{type:"text",value:Z}],re=lCe({astGenerator:ee,language:i,code:Z,defaultCodeValue:ce});re.language===null&&(re.value=ce);var Se=re.value.length+C,ke=aCe(re,I,U,v,x,C,Se,$,H);return pt.createElement(ie,oe,pt.createElement(L,h,!x&&M,le({rows:ke,stylesheet:s,useInlineStyles:y})))}}const cCe="modulepreload",fCe=function(e){return"/"+e},PL={},dCe=function(t,n,r){if(!n||n.length===0)return t();const i=document.getElementsByTagName("link");return Promise.all(n.map(o=>{if(o=fCe(o),o in PL)return;PL[o]=!0;const a=o.endsWith(".css"),s=a?'[rel="stylesheet"]':"";if(!!r)for(let f=i.length-1;f>=0;f--){const h=i[f];if(h.href===o&&(!a||h.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${o}"]${s}`))return;const c=document.createElement("link");if(c.rel=a?"stylesheet":cCe,a||(c.as="script",c.crossOrigin=""),c.href=o,document.head.appendChild(c),a)return new Promise((f,h)=>{c.addEventListener("load",f),c.addEventListener("error",()=>h(new Error(`Unable to preload CSS for ${o}`)))})})).then(()=>t())};function LL(e,t,n,r,i,o,a){try{var s=e[o](a),l=s.value}catch(c){n(c);return}s.done?t(l):Promise.resolve(l).then(r,i)}function pCe(e){return function(){var t=this,n=arguments;return new Promise(function(r,i){var o=e.apply(t,n);function a(l){LL(o,r,i,a,s,"next",l)}function s(l){LL(o,r,i,a,s,"throw",l)}a(void 0)})}}function hCe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function FL(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Q6(r.key),r)}}function gCe(e,t,n){return t&&FL(e.prototype,t),n&&FL(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function mCe(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&o1(e,t)}function vCe(e,t){if(t&&(Td(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s1(e)}function m1(e){return m1=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},m1(e)}var oU={exports:{}},aU={exports:{}};(function(e){function t(n){"@babel/helpers - typeof";return e.exports=t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},e.exports.__esModule=!0,e.exports.default=e.exports,t(n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports})(aU);var yCe=aU.exports;(function(e){var t=yCe.default;function n(){e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var r={},i=Object.prototype,o=i.hasOwnProperty,a=Object.defineProperty||function(Q,L,te){Q[L]=te.value},s=typeof Symbol=="function"?Symbol:{},l=s.iterator||"@@iterator",c=s.asyncIterator||"@@asyncIterator",f=s.toStringTag||"@@toStringTag";function h(Q,L,te){return Object.defineProperty(Q,L,{value:te,enumerable:!0,configurable:!0,writable:!0}),Q[L]}try{h({},"")}catch{h=function(te,Z,ee){return te[Z]=ee}}function p(Q,L,te,Z){var ee=L&&L.prototype instanceof v?L:v,Y=Object.create(ee.prototype),M=new le(Z||[]);return a(Y,"_invoke",{value:W(Q,te,M)}),Y}function y(Q,L,te){try{return{type:"normal",arg:Q.call(L,te)}}catch(Z){return{type:"throw",arg:Z}}}r.wrap=p;var m={};function v(){}function S(){}function x(){}var w={};h(w,l,function(){return this});var C=Object.getPrototypeOf,E=C&&C(C(se([])));E&&E!==i&&o.call(E,l)&&(w=E);var O=x.prototype=v.prototype=Object.create(w);function $(Q){["next","throw","return"].forEach(function(L){h(Q,L,function(te){return this._invoke(L,te)})})}function I(Q,L){function te(ee,Y,M,A){var ne=y(Q[ee],Q,Y);if(ne.type!=="throw"){var oe=ne.arg,ce=oe.value;return ce&&t(ce)=="object"&&o.call(ce,"__await")?L.resolve(ce.__await).then(function(re){te("next",re,M,A)},function(re){te("throw",re,M,A)}):L.resolve(ce).then(function(re){oe.value=re,M(oe)},function(re){return te("throw",re,M,A)})}A(ne.arg)}var Z;a(this,"_invoke",{value:function(Y,M){function A(){return new L(function(ne,oe){te(Y,M,ne,oe)})}return Z=Z?Z.then(A,A):A()}})}function W(Q,L,te){var Z="suspendedStart";return function(ee,Y){if(Z==="executing")throw new Error("Generator is already running");if(Z==="completed"){if(ee==="throw")throw Y;return ie()}for(te.method=ee,te.arg=Y;;){var M=te.delegate;if(M){var A=H(M,te);if(A){if(A===m)continue;return A}}if(te.method==="next")te.sent=te._sent=te.arg;else if(te.method==="throw"){if(Z==="suspendedStart")throw Z="completed",te.arg;te.dispatchException(te.arg)}else te.method==="return"&&te.abrupt("return",te.arg);Z="executing";var ne=y(Q,L,te);if(ne.type==="normal"){if(Z=te.done?"completed":"suspendedYield",ne.arg===m)continue;return{value:ne.arg,done:te.done}}ne.type==="throw"&&(Z="completed",te.method="throw",te.arg=ne.arg)}}}function H(Q,L){var te=L.method,Z=Q.iterator[te];if(Z===void 0)return L.delegate=null,te==="throw"&&Q.iterator.return&&(L.method="return",L.arg=void 0,H(Q,L),L.method==="throw")||te!=="return"&&(L.method="throw",L.arg=new TypeError("The iterator does not provide a '"+te+"' method")),m;var ee=y(Z,Q.iterator,L.arg);if(ee.type==="throw")return L.method="throw",L.arg=ee.arg,L.delegate=null,m;var Y=ee.arg;return Y?Y.done?(L[Q.resultName]=Y.value,L.next=Q.nextLoc,L.method!=="return"&&(L.method="next",L.arg=void 0),L.delegate=null,m):Y:(L.method="throw",L.arg=new TypeError("iterator result is not an object"),L.delegate=null,m)}function j(Q){var L={tryLoc:Q[0]};1 in Q&&(L.catchLoc=Q[1]),2 in Q&&(L.finallyLoc=Q[2],L.afterLoc=Q[3]),this.tryEntries.push(L)}function U(Q){var L=Q.completion||{};L.type="normal",delete L.arg,Q.completion=L}function le(Q){this.tryEntries=[{tryLoc:"root"}],Q.forEach(j,this),this.reset(!0)}function se(Q){if(Q){var L=Q[l];if(L)return L.call(Q);if(typeof Q.next=="function")return Q;if(!isNaN(Q.length)){var te=-1,Z=function ee(){for(;++te<Q.length;)if(o.call(Q,te))return ee.value=Q[te],ee.done=!1,ee;return ee.value=void 0,ee.done=!0,ee};return Z.next=Z}}return{next:ie}}function ie(){return{value:void 0,done:!0}}return S.prototype=x,a(O,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:S,configurable:!0}),S.displayName=h(x,f,"GeneratorFunction"),r.isGeneratorFunction=function(Q){var L=typeof Q=="function"&&Q.constructor;return!!L&&(L===S||(L.displayName||L.name)==="GeneratorFunction")},r.mark=function(Q){return Object.setPrototypeOf?Object.setPrototypeOf(Q,x):(Q.__proto__=x,h(Q,f,"GeneratorFunction")),Q.prototype=Object.create(O),Q},r.awrap=function(Q){return{__await:Q}},$(I.prototype),h(I.prototype,c,function(){return this}),r.AsyncIterator=I,r.async=function(Q,L,te,Z,ee){ee===void 0&&(ee=Promise);var Y=new I(p(Q,L,te,Z),ee);return r.isGeneratorFunction(L)?Y:Y.next().then(function(M){return M.done?M.value:Y.next()})},$(O),h(O,f,"Generator"),h(O,l,function(){return this}),h(O,"toString",function(){return"[object Generator]"}),r.keys=function(Q){var L=Object(Q),te=[];for(var Z in L)te.push(Z);return te.reverse(),function ee(){for(;te.length;){var Y=te.pop();if(Y in L)return ee.value=Y,ee.done=!1,ee}return ee.done=!0,ee}},r.values=se,le.prototype={constructor:le,reset:function(L){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(U),!L)for(var te in this)te.charAt(0)==="t"&&o.call(this,te)&&!isNaN(+te.slice(1))&&(this[te]=void 0)},stop:function(){this.done=!0;var L=this.tryEntries[0].completion;if(L.type==="throw")throw L.arg;return this.rval},dispatchException:function(L){if(this.done)throw L;var te=this;function Z(oe,ce){return M.type="throw",M.arg=L,te.next=oe,ce&&(te.method="next",te.arg=void 0),!!ce}for(var ee=this.tryEntries.length-1;ee>=0;--ee){var Y=this.tryEntries[ee],M=Y.completion;if(Y.tryLoc==="root")return Z("end");if(Y.tryLoc<=this.prev){var A=o.call(Y,"catchLoc"),ne=o.call(Y,"finallyLoc");if(A&&ne){if(this.prev<Y.catchLoc)return Z(Y.catchLoc,!0);if(this.prev<Y.finallyLoc)return Z(Y.finallyLoc)}else if(A){if(this.prev<Y.catchLoc)return Z(Y.catchLoc,!0)}else{if(!ne)throw new Error("try statement without catch or finally");if(this.prev<Y.finallyLoc)return Z(Y.finallyLoc)}}}},abrupt:function(L,te){for(var Z=this.tryEntries.length-1;Z>=0;--Z){var ee=this.tryEntries[Z];if(ee.tryLoc<=this.prev&&o.call(ee,"finallyLoc")&&this.prev<ee.finallyLoc){var Y=ee;break}}Y&&(L==="break"||L==="continue")&&Y.tryLoc<=te&&te<=Y.finallyLoc&&(Y=null);var M=Y?Y.completion:{};return M.type=L,M.arg=te,Y?(this.method="next",this.next=Y.finallyLoc,m):this.complete(M)},complete:function(L,te){if(L.type==="throw")throw L.arg;return L.type==="break"||L.type==="continue"?this.next=L.arg:L.type==="return"?(this.rval=this.arg=L.arg,this.method="return",this.next="end"):L.type==="normal"&&te&&(this.next=te),m},finish:function(L){for(var te=this.tryEntries.length-1;te>=0;--te){var Z=this.tryEntries[te];if(Z.finallyLoc===L)return this.complete(Z.completion,Z.afterLoc),U(Z),m}},catch:function(L){for(var te=this.tryEntries.length-1;te>=0;--te){var Z=this.tryEntries[te];if(Z.tryLoc===L){var ee=Z.completion;if(ee.type==="throw"){var Y=ee.arg;U(Z)}return Y}}throw new Error("illegal catch attempt")},delegateYield:function(L,te,Z){return this.delegate={iterator:se(L),resultName:te,nextLoc:Z},this.method==="next"&&(this.arg=void 0),m}},r}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports})(oU);var bCe=oU.exports,d0=bCe(),xCe=d0;try{regeneratorRuntime=d0}catch{typeof globalThis=="object"?globalThis.regeneratorRuntime=d0:Function("r","regeneratorRuntime = r")(d0)}const ML=Ha(xCe);function wCe(e){var t=SCe();return function(){var r=m1(e),i;if(t){var o=m1(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return vCe(this,i)}}function SCe(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}const _Ce=function(e){var t=e.loader,n=e.isLanguageRegistered,r=e.registerLanguage,i=e.languageLoaders,o=e.noAsyncLoadingLanguages,a=function(s){mCe(c,s);var l=wCe(c);function c(){return hCe(this,c),l.apply(this,arguments)}return gCe(c,[{key:"componentDidUpdate",value:function(){!c.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"componentDidMount",value:function(){var h=this;c.astGeneratorPromise||c.loadAstGenerator(),c.astGenerator||c.astGeneratorPromise.then(function(){h.forceUpdate()}),!c.isRegistered(this.props.language)&&i&&this.loadLanguage()}},{key:"loadLanguage",value:function(){var h=this,p=this.props.language;p!=="text"&&c.loadLanguage(p).then(function(){return h.forceUpdate()}).catch(function(){})}},{key:"normalizeLanguage",value:function(h){return c.isSupportedLanguage(h)?h:"text"}},{key:"render",value:function(){return pt.createElement(c.highlightInstance,z({},this.props,{language:this.normalizeLanguage(this.props.language),astGenerator:c.astGenerator}))}}],[{key:"preload",value:function(){return c.loadAstGenerator()}},{key:"loadLanguage",value:function(){var f=pCe(ML.mark(function p(y){var m;return ML.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:if(m=i[y],typeof m!="function"){S.next=5;break}return S.abrupt("return",m(c.registerLanguage));case 5:throw new Error("Language ".concat(y," not supported"));case 6:case"end":return S.stop()}},p)}));function h(p){return f.apply(this,arguments)}return h}()},{key:"isSupportedLanguage",value:function(h){return c.isRegistered(h)||typeof i[h]=="function"}},{key:"loadAstGenerator",value:function(){return c.astGeneratorPromise=t().then(function(h){c.astGenerator=h,r&&c.languages.forEach(function(p,y){return r(h,y,p)})}),c.astGeneratorPromise}}]),c}(pt.PureComponent);return Ss(a,"astGenerator",null),Ss(a,"highlightInstance",uCe(null,{})),Ss(a,"astGeneratorPromise",null),Ss(a,"languages",new Map),Ss(a,"supportedLanguages",e.supportedLanguages||Object.keys(i||{})),Ss(a,"isRegistered",function(s){if(o)return!0;if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");return a.astGenerator?n(a.astGenerator,s):a.languages.has(s)}),Ss(a,"registerLanguage",function(s,l){if(!r)throw new Error("Current syntax highlighter doesn't support registration of languages");if(a.astGenerator)return r(a.astGenerator,s,l);a.languages.set(s,l)}),a},CCe=["abap","abnf","actionscript","ada","agda","al","antlr4","apacheconf","apex","apl","applescript","aql","arduino","arff","asciidoc","asm6502","asmatmel","aspnet","autohotkey","autoit","avisynth","avro-idl","bash","basic","batch","bbcode","bicep","birb","bison","bnf","brainfuck","brightscript","bro","bsl","c","cfscript","chaiscript","cil","clike","clojure","cmake","cobol","coffeescript","concurnas","coq","cpp","crystal","csharp","cshtml","csp","css-extras","css","csv","cypher","d","dart","dataweave","dax","dhall","diff","django","dns-zone-file","docker","dot","ebnf","editorconfig","eiffel","ejs","elixir","elm","erb","erlang","etlua","excel-formula","factor","false","firestore-security-rules","flow","fortran","fsharp","ftl","gap","gcode","gdscript","gedcom","gherkin","git","glsl","gml","gn","go-module","go","graphql","groovy","haml","handlebars","haskell","haxe","hcl","hlsl","hoon","hpkp","hsts","http","ichigojam","icon","icu-message-format","idris","iecst","ignore","inform7","ini","io","j","java","javadoc","javadoclike","javascript","javastacktrace","jexl","jolie","jq","js-extras","js-templates","jsdoc","json","json5","jsonp","jsstacktrace","jsx","julia","keepalived","keyman","kotlin","kumir","kusto","latex","latte","less","lilypond","liquid","lisp","livescript","llvm","log","lolcode","lua","magma","makefile","markdown","markup-templating","markup","matlab","maxscript","mel","mermaid","mizar","mongodb","monkey","moonscript","n1ql","n4js","nand2tetris-hdl","naniscript","nasm","neon","nevod","nginx","nim","nix","nsis","objectivec","ocaml","opencl","openqasm","oz","parigp","parser","pascal","pascaligo","pcaxis","peoplecode","perl","php-extras","php","phpdoc","plsql","powerquery","powershell","processing","prolog","promql","properties","protobuf","psl","pug","puppet","pure","purebasic","purescript","python","q","qml","qore","qsharp","r","racket","reason","regex","rego","renpy","rest","rip","roboconf","robotframework","ruby","rust","sas","sass","scala","scheme","scss","shell-session","smali","smalltalk","smarty","sml","solidity","solution-file","soy","sparql","splunk-spl","sqf","sql","squirrel","stan","stylus","swift","systemd","t4-cs","t4-templating","t4-vb","tap","tcl","textile","toml","tremor","tsx","tt2","turtle","twig","typescript","typoscript","unrealscript","uorazor","uri","v","vala","vbnet","velocity","verilog","vhdl","vim","visual-basic","warpscript","wasm","web-idl","wiki","wolfram","wren","xeora","xml-doc","xojo","xquery","yaml","yang","zig"],ECe=_Ce({loader:function(){return dCe(()=>import("./index-37b5009c.js").then(t=>t.i),[]).then(function(t){return t.default||t})},noAsyncLoadingLanguages:!0,supportedLanguages:CCe}),kCe={'code[class*="language-"]':{color:"#f8f8f2",background:"none",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none"},'pre[class*="language-"]':{color:"#f8f8f2",background:"#282a36",textShadow:"0 1px rgba(0, 0, 0, 0.3)",fontFamily:"Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace",textAlign:"left",whiteSpace:"pre",wordSpacing:"normal",wordBreak:"normal",wordWrap:"normal",lineHeight:"1.5",MozTabSize:"4",OTabSize:"4",tabSize:"4",WebkitHyphens:"none",MozHyphens:"none",msHyphens:"none",hyphens:"none",padding:"1em",margin:".5em 0",overflow:"auto",borderRadius:"0.3em"},':not(pre) > code[class*="language-"]':{background:"#282a36",padding:".1em",borderRadius:".3em",whiteSpace:"normal"},comment:{color:"#6272a4"},prolog:{color:"#6272a4"},doctype:{color:"#6272a4"},cdata:{color:"#6272a4"},punctuation:{color:"#f8f8f2"},".namespace":{Opacity:".7"},property:{color:"#ff79c6"},tag:{color:"#ff79c6"},constant:{color:"#ff79c6"},symbol:{color:"#ff79c6"},deleted:{color:"#ff79c6"},boolean:{color:"#bd93f9"},number:{color:"#bd93f9"},selector:{color:"#50fa7b"},"attr-name":{color:"#50fa7b"},string:{color:"#50fa7b"},char:{color:"#50fa7b"},builtin:{color:"#50fa7b"},inserted:{color:"#50fa7b"},operator:{color:"#f8f8f2"},entity:{color:"#f8f8f2",cursor:"help"},url:{color:"#f8f8f2"},".language-css .token.string":{color:"#f8f8f2"},".style .token.string":{color:"#f8f8f2"},variable:{color:"#f8f8f2"},atrule:{color:"#f1fa8c"},"attr-value":{color:"#f1fa8c"},function:{color:"#f1fa8c"},"class-name":{color:"#f1fa8c"},keyword:{color:"#8be9fd"},regex:{color:"#ffb86c"},important:{color:"#ffb86c",fontWeight:"bold"},bold:{fontWeight:"bold"},italic:{fontStyle:"italic"}};function rA({inline:e,children:t,...n}){const r=fa(),i=/language-(\w+)/.exec(n.className||"");return!e&&i?k.jsx(ECe,{...n,children:String(t).replace(/\n$/,""),style:kCe,wrapLongLines:!0,language:i[1],PreTag:"div"}):e?k.jsx("code",{...n,style:{background:r.palette.divider,borderRadius:"4px",padding:"0.2em 0.4em",overflowX:"auto"},children:t}):k.jsx(At,{sx:{background:r.palette.divider,borderRadius:"4px",padding:r.spacing(1),overflowX:"auto"},children:k.jsx("code",{...n,style:{whiteSpace:"pre-wrap"},children:t})})}function TCe(e){return k.jsx(At,{sx:{p:1,boxSizing:"border-box",bgcolor:t=>t.palette.mode==="light"?"#EEEEEE":"#212121",borderRadius:"4px",display:"flex"},children:e.children})}const RCe=(e,t)=>{const n=document.createElement("a");n.href=t,n.target="_blank",n.download=e,n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n)};function sU({element:e}){const t=e.url||URL.createObjectURL(new Blob([e.content])),n=`${e.display}-image`;return k.jsx(TCe,{children:k.jsx("img",{className:n,src:t,onClick:()=>{if(e.display==="inline"){const r=`${e.name}.png`;RCe(r,t)}},style:{objectFit:"cover",maxWidth:"100%",margin:"auto",height:"auto",display:"block",cursor:e.display==="inline"?"pointer":"default"},alt:e.name,loading:"lazy"})})}function NL(e){return e.size==="small"?1:e.size==="medium"?2:e.size==="large"?4:2}function ACe({items:e}){return k.jsx(sge,{sx:{margin:0,transform:"translateZ(0)",width:"100%",maxWidth:600,maxHeight:400},variant:"quilted",cols:4,gap:8,children:e.map((t,n)=>{const r=NL(t),i=NL(t);return k.jsx(hge,{cols:r,rows:i,children:k.jsx(sU,{element:t})},n)})})}function lU({element:e}){const[t,n]=T.useState(!1),[r,i]=T.useState(!1),[o,a]=T.useState("");T.useEffect(()=>{t||!e.url||(n(!0),fetch(e.url).then(l=>l.text()).then(l=>{a(l),n(!1),i(!1)}).catch(()=>{a(""),i(!0),n(!1)}))},[e]);let s=t?"Loading...":r?"Error":o||e.content;return!t&&!r&&e.language&&(s=`\`\`\`${e.language}
|
|
228
228
|
${s}
|
|
229
229
|
\`\`\``),k.jsx(_x,{remarkPlugins:[tA],className:"markdown-body",components:{code({...l}){return k.jsx(rA,{...l})}},children:s})}function OCe({items:e}){return k.jsx(In,{spacing:1,children:e.map((t,n)=>k.jsxs(Wl,{color:"info",icon:!1,children:[k.jsx(ode,{children:t.name}),k.jsx(lU,{element:t})]},n))})}function DCe(e){return wt("MuiLoadingButton",e)}const $Ce=bt("MuiLoadingButton",["root","loading","loadingIndicator","loadingIndicatorCenter","loadingIndicatorStart","loadingIndicatorEnd","endIconLoadingEnd","startIconLoadingStart"]),ps=$Ce,ICe=["children","disabled","id","loading","loadingIndicator","loadingPosition","variant"],PCe=e=>{const{loading:t,loadingPosition:n,classes:r}=e,i={root:["root",t&&"loading"],startIcon:[t&&`startIconLoading${Be(n)}`],endIcon:[t&&`endIconLoading${Be(n)}`],loadingIndicator:["loadingIndicator",t&&`loadingIndicator${Be(n)}`]},o=_t(i,DCe,r);return z({},r,o)},LCe=e=>e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"&&e!=="classes",FCe=je(mc,{shouldForwardProp:e=>LCe(e)||e==="classes",name:"MuiLoadingButton",slot:"Root",overridesResolver:(e,t)=>[t.root,t.startIconLoadingStart&&{[`& .${ps.startIconLoadingStart}`]:t.startIconLoadingStart},t.endIconLoadingEnd&&{[`& .${ps.endIconLoadingEnd}`]:t.endIconLoadingEnd}]})(({ownerState:e,theme:t})=>z({[`& .${ps.startIconLoadingStart}, & .${ps.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0}},e.loadingPosition==="center"&&{transition:t.transitions.create(["background-color","box-shadow","border-color"],{duration:t.transitions.duration.short}),[`&.${ps.loading}`]:{color:"transparent"}},e.loadingPosition==="start"&&e.fullWidth&&{[`& .${ps.startIconLoadingStart}, & .${ps.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginRight:-8}},e.loadingPosition==="end"&&e.fullWidth&&{[`& .${ps.startIconLoadingStart}, & .${ps.endIconLoadingEnd}`]:{transition:t.transitions.create(["opacity"],{duration:t.transitions.duration.short}),opacity:0,marginLeft:-8}})),MCe=je("div",{name:"MuiLoadingButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.loadingIndicator,t[`loadingIndicator${Be(n.loadingPosition)}`]]}})(({theme:e,ownerState:t})=>z({position:"absolute",visibility:"visible",display:"flex"},t.loadingPosition==="start"&&(t.variant==="outlined"||t.variant==="contained")&&{left:t.size==="small"?10:14},t.loadingPosition==="start"&&t.variant==="text"&&{left:6},t.loadingPosition==="center"&&{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled},t.loadingPosition==="end"&&(t.variant==="outlined"||t.variant==="contained")&&{right:t.size==="small"?10:14},t.loadingPosition==="end"&&t.variant==="text"&&{right:6},t.loadingPosition==="start"&&t.fullWidth&&{position:"relative",left:-10},t.loadingPosition==="end"&&t.fullWidth&&{position:"relative",right:-10})),NCe=T.forwardRef(function(t,n){const r=Ct({props:t,name:"MuiLoadingButton"}),{children:i,disabled:o=!1,id:a,loading:s=!1,loadingIndicator:l,loadingPosition:c="center",variant:f="text"}=r,h=et(r,ICe),p=im(a),y=l??k.jsx(s5,{"aria-labelledby":p,color:"inherit",size:16}),m=z({},r,{disabled:o,loading:s,loadingIndicator:y,loadingPosition:c,variant:f}),v=PCe(m),S=s?k.jsx(MCe,{className:v.loadingIndicator,ownerState:m,children:y}):null;return k.jsxs(FCe,z({disabled:o||s,id:p,ref:n},h,{variant:f,classes:v,ownerState:m,children:[m.loadingPosition==="end"?i:S,m.loadingPosition==="end"?S:i]}))}),Ex=NCe;let BCe={data:""},zCe=e=>typeof window=="object"?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||BCe,jCe=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,UCe=/\/\*[^]*?\*\/| +/g,BL=/\n+/g,El=(e,t)=>{let n="",r="",i="";for(let o in e){let a=e[o];o[0]=="@"?o[1]=="i"?n=o+" "+a+";":r+=o[1]=="f"?El(a,o):o+"{"+El(a,o[1]=="k"?"":t)+"}":typeof a=="object"?r+=El(a,t?t.replace(/([^,])+/g,s=>o.replace(/(^:.*)|([^,])+/g,l=>/&/.test(l)?l.replace(/&/g,s):s?s+" "+l:l)):o):a!=null&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=El.p?El.p(o,a):o+":"+a+";")}return n+(t&&i?t+"{"+i+"}":i)+r},hs={},uU=e=>{if(typeof e=="object"){let t="";for(let n in e)t+=n+uU(e[n]);return t}return e},KCe=(e,t,n,r,i)=>{let o=uU(e),a=hs[o]||(hs[o]=(l=>{let c=0,f=11;for(;c<l.length;)f=101*f+l.charCodeAt(c++)>>>0;return"go"+f})(o));if(!hs[a]){let l=o!==e?e:(c=>{let f,h,p=[{}];for(;f=jCe.exec(c.replace(UCe,""));)f[4]?p.shift():f[3]?(h=f[3].replace(BL," ").trim(),p.unshift(p[0][h]=p[0][h]||{})):p[0][f[1]]=f[2].replace(BL," ").trim();return p[0]})(e);hs[a]=El(i?{["@keyframes "+a]:l}:l,n?"":"."+a)}let s=n&&hs.g?hs.g:null;return n&&(hs.g=hs[a]),((l,c,f,h)=>{h?c.data=c.data.replace(h,l):c.data.indexOf(l)===-1&&(c.data=f?l+c.data:c.data+l)})(hs[a],t,r,s),a},WCe=(e,t,n)=>e.reduce((r,i,o)=>{let a=t[o];if(a&&a.call){let s=a(n),l=s&&s.props&&s.props.className||/^go/.test(s)&&s;a=l?"."+l:s&&typeof s=="object"?s.props?"":El(s,""):s===!1?"":s}return r+i+(a??"")},"");function kx(e){let t=this||{},n=e.call?e(t.p):e;return KCe(n.unshift?n.raw?WCe(n,[].slice.call(arguments,1),t.p):n.reduce((r,i)=>Object.assign(r,i&&i.call?i(t.p):i),{}):n,zCe(t.target),t.g,t.o,t.k)}let cU,BE,zE;kx.bind({g:1});let Ms=kx.bind({k:1});function VCe(e,t,n,r){El.p=t,cU=e,BE=n,zE=r}function tu(e,t){let n=this||{};return function(){let r=arguments;function i(o,a){let s=Object.assign({},o),l=s.className||i.className;n.p=Object.assign({theme:BE&&BE()},s),n.o=/ *go\d+/.test(l),s.className=kx.apply(n,r)+(l?" "+l:""),t&&(s.ref=a);let c=e;return e[0]&&(c=s.as||e,delete s.as),zE&&c[0]&&zE(s),cU(c,s)}return t?t(i):i}}var HCe=e=>typeof e=="function",v1=(e,t)=>HCe(e)?e(t):e,qCe=(()=>{let e=0;return()=>(++e).toString()})(),fU=(()=>{let e;return()=>{if(e===void 0&&typeof window<"u"){let t=matchMedia("(prefers-reduced-motion: reduce)");e=!t||t.matches}return e}})(),GCe=20,p0=new Map,YCe=1e3,zL=e=>{if(p0.has(e))return;let t=setTimeout(()=>{p0.delete(e),xc({type:4,toastId:e})},YCe);p0.set(e,t)},XCe=e=>{let t=p0.get(e);t&&clearTimeout(t)},jE=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,GCe)};case 1:return t.toast.id&&XCe(t.toast.id),{...e,toasts:e.toasts.map(o=>o.id===t.toast.id?{...o,...t.toast}:o)};case 2:let{toast:n}=t;return e.toasts.find(o=>o.id===n.id)?jE(e,{type:1,toast:n}):jE(e,{type:0,toast:n});case 3:let{toastId:r}=t;return r?zL(r):e.toasts.forEach(o=>{zL(o.id)}),{...e,toasts:e.toasts.map(o=>o.id===r||r===void 0?{...o,visible:!1}:o)};case 4:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(o=>o.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(o=>({...o,pauseDuration:o.pauseDuration+i}))}}},h0=[],g0={toasts:[],pausedAt:void 0},xc=e=>{g0=jE(g0,e),h0.forEach(t=>{t(g0)})},ZCe={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},JCe=(e={})=>{let[t,n]=T.useState(g0);T.useEffect(()=>(h0.push(n),()=>{let i=h0.indexOf(n);i>-1&&h0.splice(i,1)}),[t]);let r=t.toasts.map(i=>{var o,a;return{...e,...e[i.type],...i,duration:i.duration||((o=e[i.type])==null?void 0:o.duration)||(e==null?void 0:e.duration)||ZCe[i.type],style:{...e.style,...(a=e[i.type])==null?void 0:a.style,...i.style}}});return{...t,toasts:r}},QCe=(e,t="blank",n)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...n,id:(n==null?void 0:n.id)||qCe()}),vm=e=>(t,n)=>{let r=QCe(t,e,n);return xc({type:2,toast:r}),r.id},Er=(e,t)=>vm("blank")(e,t);Er.error=vm("error");Er.success=vm("success");Er.loading=vm("loading");Er.custom=vm("custom");Er.dismiss=e=>{xc({type:3,toastId:e})};Er.remove=e=>xc({type:4,toastId:e});Er.promise=(e,t,n)=>{let r=Er.loading(t.loading,{...n,...n==null?void 0:n.loading});return e.then(i=>(Er.success(v1(t.success,i),{id:r,...n,...n==null?void 0:n.success}),i)).catch(i=>{Er.error(v1(t.error,i),{id:r,...n,...n==null?void 0:n.error})}),e};var eEe=(e,t)=>{xc({type:1,toast:{id:e,height:t}})},tEe=()=>{xc({type:5,time:Date.now()})},nEe=e=>{let{toasts:t,pausedAt:n}=JCe(e);T.useEffect(()=>{if(n)return;let o=Date.now(),a=t.map(s=>{if(s.duration===1/0)return;let l=(s.duration||0)+s.pauseDuration-(o-s.createdAt);if(l<0){s.visible&&Er.dismiss(s.id);return}return setTimeout(()=>Er.dismiss(s.id),l)});return()=>{a.forEach(s=>s&&clearTimeout(s))}},[t,n]);let r=T.useCallback(()=>{n&&xc({type:6,time:Date.now()})},[n]),i=T.useCallback((o,a)=>{let{reverseOrder:s=!1,gutter:l=8,defaultPosition:c}=a||{},f=t.filter(y=>(y.position||c)===(o.position||c)&&y.height),h=f.findIndex(y=>y.id===o.id),p=f.filter((y,m)=>m<h&&y.visible).length;return f.filter(y=>y.visible).slice(...s?[p+1]:[0,p]).reduce((y,m)=>y+(m.height||0)+l,0)},[t]);return{toasts:t,handlers:{updateHeight:eEe,startPause:tEe,endPause:r,calculateOffset:i}}},rEe=Ms`
|
|
230
230
|
from {
|
|
@@ -402,7 +402,7 @@ to {
|
|
|
402
402
|
> * {
|
|
403
403
|
pointer-events: auto;
|
|
404
404
|
}
|
|
405
|
-
`,yy=16,REe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:l}=nEe(n);return T.createElement("div",{style:{position:"fixed",zIndex:9999,top:yy,left:yy,right:yy,bottom:yy,pointerEvents:"none",...o},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},s.map(c=>{let f=c.position||t,h=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),p=kEe(f,h);return T.createElement(EEe,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?TEe:"",style:p},c.type==="custom"?v1(c.message,c):i?i(c):T.createElement(CEe,{toast:c,position:f}))}))},dU=Er;function AEe({action:e}){const t=Tt(dm),n=Tt(jd),r=T.useCallback(async()=>{try{if(!(n==null?void 0:n.socket.id))return;n==null||n.socket.emit("action_call",e)}catch(s){s instanceof Error&&Er.error(s.message)}},[n]),o=`action-${e.name.trim().toLowerCase().replaceAll(" ","-")}`,a=k.jsx(Ex,{id:o,onClick:r,disabled:t,children:e.label||e.name});return e.description?k.jsx(Wa,{title:e.description,placement:"top",children:a}):a}function OEe({actions:e}){return k.jsx(In,{direction:"row",spacing:1,children:e.map(t=>k.jsx(AEe,{action:t},t.name))})}function pU({element:e}){if(!e.url&&!e.content)return null;const t=`${e.display}-pdf`,n=e.url||URL.createObjectURL(new Blob([e.content],{type:"application/pdf"}));return k.jsx("iframe",{className:t,src:n,style:{border:"none"},width:"100%",height:"100%"})}function DEe({items:e}){return k.jsx(In,{spacing:1,children:e.map((t,n)=>k.jsx("div",{style:{maxWidth:"600px",height:"400px"},children:k.jsx(pU,{element:t})},n))})}function $Ee({elements:e,actions:t}){var r,i,o;if(!e.length&&!t.length)return null;const n=e.reduce((a,s)=>(a[s.type]||(a[s.type]=[]),a[s.type].push(s),a),{});return k.jsxs(In,{gap:1,mt:1,children:[(r=n.image)!=null&&r.length?k.jsx(ACe,{items:n.image}):null,(i=n.text)!=null&&i.length?k.jsx(OCe,{items:n.text}):null,(o=n.pdf)!=null&&o.length?k.jsx(DEe,{items:n.pdf}):null,t.length?k.jsx(OEe,{actions:t}):null]})}const jL=(e,t)=>!t||!t.length||!e?!1:t.includes(e.toString()),IEe=e=>!e||!e.length;function PEe({id:e,elements:t,actions:n,content:r,language:i}){const o=t.map(h=>h.name);o.sort((h,p)=>p.length-h.length);const a=o.length?new RegExp(`(${o.join("|")})`,"g"):void 0,s=n.filter(h=>h.forId?h.forId===e:!0);let l=r?r.trim():"";const c=t.filter(h=>jL(e,h==null?void 0:h.forIds)&&h.display==="inline"),f=[];return a&&(l=l.replaceAll(a,h=>{const p=t.find(v=>{const S=v.name===h,x=IEe(v==null?void 0:v.forIds)||jL(e,v==null?void 0:v.forIds);return S&&x}),y=!!p,m=(p==null?void 0:p.display)==="inline";return y?m?(c.indexOf(p)===-1&&c.push(p),h):(f.push(p),`[${h}](${h.replaceAll(" ","_")})`):h})),i&&(l=`\`\`\`${i}
|
|
405
|
+
`,yy=16,REe=({reverseOrder:e,position:t="top-center",toastOptions:n,gutter:r,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:s,handlers:l}=nEe(n);return T.createElement("div",{style:{position:"fixed",zIndex:9999,top:yy,left:yy,right:yy,bottom:yy,pointerEvents:"none",...o},className:a,onMouseEnter:l.startPause,onMouseLeave:l.endPause},s.map(c=>{let f=c.position||t,h=l.calculateOffset(c,{reverseOrder:e,gutter:r,defaultPosition:t}),p=kEe(f,h);return T.createElement(EEe,{id:c.id,key:c.id,onHeightUpdate:l.updateHeight,className:c.visible?TEe:"",style:p},c.type==="custom"?v1(c.message,c):i?i(c):T.createElement(CEe,{toast:c,position:f}))}))},dU=Er;function AEe({action:e}){const t=Tt(dm),n=Tt(jd),r=T.useCallback(async()=>{try{if(!(n==null?void 0:n.socket.id))return;n==null||n.socket.emit("action_call",e)}catch(s){s instanceof Error&&Er.error(s.message)}},[n]),o=`action-${e.name.trim().toLowerCase().replaceAll(" ","-")}`,a=k.jsx(Ex,{id:o,onClick:r,disabled:t,children:e.label||e.name});return e.description?k.jsx(Wa,{title:e.description,placement:"top",children:a}):a}function OEe({actions:e}){return k.jsx(In,{direction:"row",spacing:1,children:e.map(t=>k.jsx(AEe,{action:t},t.name))})}function pU({element:e}){if(!e.url&&!e.content)return null;const t=`${e.display}-pdf`,n=e.url||URL.createObjectURL(new Blob([e.content],{type:"application/pdf"}));return k.jsx("iframe",{className:t,src:n,style:{border:"none"},width:"100%",height:"100%"})}function DEe({items:e}){return k.jsx(In,{spacing:1,children:e.map((t,n)=>k.jsx("div",{style:{maxWidth:"600px",height:"400px"},children:k.jsx(pU,{element:t})},n))})}function $Ee({elements:e,actions:t}){var r,i,o;if(!e.length&&!t.length)return null;const n=e.reduce((a,s)=>(a[s.type]||(a[s.type]=[]),a[s.type].push(s),a),{});return k.jsxs(In,{gap:1,mt:1,children:[(r=n.image)!=null&&r.length?k.jsx(ACe,{items:n.image}):null,(i=n.text)!=null&&i.length?k.jsx(OCe,{items:n.text}):null,(o=n.pdf)!=null&&o.length?k.jsx(DEe,{items:n.pdf}):null,t.length?k.jsx(OEe,{actions:t}):null]})}const jL=(e,t)=>!t||!t.length||!e?!1:t.includes(e.toString()),IEe=e=>!e||!e.length;function PEe({id:e,elements:t,actions:n,content:r,language:i}){const o=t.filter(h=>h.type!=="avatar").map(h=>h.name);o.sort((h,p)=>p.length-h.length);const a=o.length?new RegExp(`(${o.join("|")})`,"g"):void 0,s=n.filter(h=>h.forId?h.forId===e:!0);let l=r?r.trim():"";const c=t.filter(h=>jL(e,h==null?void 0:h.forIds)&&h.display==="inline"),f=[];return a&&(l=l.replaceAll(a,h=>{const p=t.find(v=>{const S=v.name===h,x=IEe(v==null?void 0:v.forIds)||jL(e,v==null?void 0:v.forIds);return S&&x}),y=!!p,m=(p==null?void 0:p.display)==="inline";return y?m?(c.indexOf(p)===-1&&c.push(p),h):(f.push(p),`[${h}](${h.replaceAll(" ","_")})`):h})),i&&(l=`\`\`\`${i}
|
|
406
406
|
${l}
|
|
407
407
|
\`\`\``),{preparedContent:l,inlinedElements:c,refElements:f,scopedActions:s}}const LEe=T.memo(function({id:t,content:n,elements:r,actions:i,language:o,authorIsUser:a}){const{preparedContent:s,inlinedElements:l,refElements:c,scopedActions:f}=PEe({id:t,content:n,language:o,elements:r,actions:i});return s?k.jsxs(In,{width:"100%",children:[k.jsx(fn,{sx:{width:"100%",minHeight:"20px",fontSize:"1rem",lineHeight:"1.5rem",fontFamily:"Inter",fontWeight:a?500:300},component:"div",children:k.jsx(_x,{remarkPlugins:[tA],className:"markdown-body",components:{a({children:h,...p}){const y=h[0],m=c.find(v=>v.name===y);return m?k.jsx(j_e,{element:m}):k.jsx(IR,{...p,target:"_blank",children:h})},code({...h}){return k.jsx(rA,{...h})}},children:s})}),k.jsx($Ee,{elements:l,actions:f})]}):null});function Wd(e,t,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(f){try{c(r.next(f))}catch(h){a(h)}}function l(f){try{c(r.throw(f))}catch(h){a(h)}}function c(f){f.done?o(f.value):i(f.value).then(s,l)}c((r=r.apply(e,t||[])).next())})}function Vd(e,t){var n={label:0,sent:function(){if(o[0]&1)throw o[1];return o[1]},trys:[],ops:[]},r,i,o,a;return a={next:s(0),throw:s(1),return:s(2)},typeof Symbol=="function"&&(a[Symbol.iterator]=function(){return this}),a;function s(c){return function(f){return l([c,f])}}function l(c){if(r)throw new TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(n=0)),n;)try{if(r=1,i&&(o=c[0]&2?i.return:c[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,c[1])).done)return o;switch(i=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return n.label++,{value:c[1],done:!1};case 5:n.label++,i=c[1],c=[0];continue;case 7:c=n.ops.pop(),n.trys.pop();continue;default:if(o=n.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){n=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){n.label=c[1];break}if(c[0]===6&&n.label<o[1]){n.label=o[1],o=c;break}if(o&&n.label<o[2]){n.label=o[2],n.ops.push(c);break}o[2]&&n.ops.pop(),n.trys.pop();continue}c=t.call(e,n)}catch(f){c=[6,f],i=0}finally{r=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function UL(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,o=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(s){a={error:s}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}function KL(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,o;r<i;r++)(o||!(r in t))&&(o||(o=Array.prototype.slice.call(t,0,r)),o[r]=t[r]);return e.concat(o||Array.prototype.slice.call(t))}var FEe=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function ym(e,t){var n=MEe(e);if(typeof n.path!="string"){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function MEe(e){var t=e.name,n=t&&t.lastIndexOf(".")!==-1;if(n&&!e.type){var r=t.split(".").pop().toLowerCase(),i=FEe.get(r);i&&Object.defineProperty(e,"type",{value:i,writable:!1,configurable:!1,enumerable:!0})}return e}var NEe=[".DS_Store","Thumbs.db"];function BEe(e){return Wd(this,void 0,void 0,function(){return Vd(this,function(t){return y1(e)&&zEe(e.dataTransfer)?[2,WEe(e.dataTransfer,e.type)]:jEe(e)?[2,UEe(e)]:Array.isArray(e)&&e.every(function(n){return"getFile"in n&&typeof n.getFile=="function"})?[2,KEe(e)]:[2,[]]})})}function zEe(e){return y1(e)}function jEe(e){return y1(e)&&y1(e.target)}function y1(e){return typeof e=="object"&&e!==null}function UEe(e){return UE(e.target.files).map(function(t){return ym(t)})}function KEe(e){return Wd(this,void 0,void 0,function(){var t;return Vd(this,function(n){switch(n.label){case 0:return[4,Promise.all(e.map(function(r){return r.getFile()}))];case 1:return t=n.sent(),[2,t.map(function(r){return ym(r)})]}})})}function WEe(e,t){return Wd(this,void 0,void 0,function(){var n,r;return Vd(this,function(i){switch(i.label){case 0:return e.items?(n=UE(e.items).filter(function(o){return o.kind==="file"}),t!=="drop"?[2,n]:[4,Promise.all(n.map(VEe))]):[3,2];case 1:return r=i.sent(),[2,WL(hU(r))];case 2:return[2,WL(UE(e.files).map(function(o){return ym(o)}))]}})})}function WL(e){return e.filter(function(t){return NEe.indexOf(t.name)===-1})}function UE(e){if(e===null)return[];for(var t=[],n=0;n<e.length;n++){var r=e[n];t.push(r)}return t}function VEe(e){if(typeof e.webkitGetAsEntry!="function")return VL(e);var t=e.webkitGetAsEntry();return t&&t.isDirectory?gU(t):VL(e)}function hU(e){return e.reduce(function(t,n){return KL(KL([],UL(t),!1),UL(Array.isArray(n)?hU(n):[n]),!1)},[])}function VL(e){var t=e.getAsFile();if(!t)return Promise.reject("".concat(e," is not a File"));var n=ym(t);return Promise.resolve(n)}function HEe(e){return Wd(this,void 0,void 0,function(){return Vd(this,function(t){return[2,e.isDirectory?gU(e):qEe(e)]})})}function gU(e){var t=e.createReader();return new Promise(function(n,r){var i=[];function o(){var a=this;t.readEntries(function(s){return Wd(a,void 0,void 0,function(){var l,c,f;return Vd(this,function(h){switch(h.label){case 0:if(s.length)return[3,5];h.label=1;case 1:return h.trys.push([1,3,,4]),[4,Promise.all(i)];case 2:return l=h.sent(),n(l),[3,4];case 3:return c=h.sent(),r(c),[3,4];case 4:return[3,6];case 5:f=Promise.all(s.map(HEe)),i.push(f),o(),h.label=6;case 6:return[2]}})})},function(s){r(s)})}o()})}function qEe(e){return Wd(this,void 0,void 0,function(){return Vd(this,function(t){return[2,new Promise(function(n,r){e.file(function(i){var o=ym(i,e.fullPath);n(o)},function(i){r(i)})})]})})}var GEe=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",i=(e.type||"").toLowerCase(),o=i.replace(/\/.*$/,"");return n.some(function(a){var s=a.trim().toLowerCase();return s.charAt(0)==="."?r.toLowerCase().endsWith(s):s.endsWith("/*")?o===s.replace(/\/.*$/,""):i===s})}return!0};function HL(e){return ZEe(e)||XEe(e)||vU(e)||YEe()}function YEe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
408
408
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XEe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ZEe(e){if(Array.isArray(e))return KE(e)}function qL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function GL(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?qL(Object(n),!0).forEach(function(r){mU(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):qL(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function mU(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Mg(e,t){return eke(e)||QEe(e,t)||vU(e,t)||JEe()}function JEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<script>
|
|
15
15
|
const global = globalThis;
|
|
16
16
|
</script>
|
|
17
|
-
<script type="module" crossorigin src="/assets/index-
|
|
17
|
+
<script type="module" crossorigin src="/assets/index-51393291.js"></script>
|
|
18
18
|
<link rel="stylesheet" href="/assets/index-f93cc942.css">
|
|
19
19
|
</head>
|
|
20
20
|
<body>
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
try:
|
|
2
|
+
import langflow
|
|
3
|
+
|
|
4
|
+
if langflow.__version__ < "0.1.4":
|
|
5
|
+
raise ValueError(
|
|
6
|
+
"LlamaIndex version is too old, expected >= 0.1.4. Run `pip install langflow --upgrade`"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
LANGFLOW_INSTALLED = True
|
|
10
|
+
except ImportError:
|
|
11
|
+
LANGFLOW_INSTALLED = False
|
|
12
|
+
|
|
13
|
+
from typing import Callable, Union, Dict, Optional
|
|
14
|
+
import aiohttp
|
|
15
|
+
|
|
16
|
+
from chainlit.telemetry import trace
|
|
17
|
+
from chainlit.config import config
|
|
18
|
+
from chainlit.lc import langchain_factory
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@trace
|
|
22
|
+
def langflow_factory(
|
|
23
|
+
use_async: bool, schema: Union[Dict, str], tweaks: Optional[Dict] = None
|
|
24
|
+
) -> Callable:
|
|
25
|
+
"""
|
|
26
|
+
Plug and play decorator for the Langflow library.
|
|
27
|
+
One instance per user session is created and cached.
|
|
28
|
+
The per user instance is called every time a new message is received.
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
use_async bool: Whether to call the the agent asynchronously or not.
|
|
32
|
+
schema (Union[Dict, str]): The langflow schema dict or url.
|
|
33
|
+
tweaks Optional[Dict]: Optional tweaks to be processed
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
Returns:
|
|
37
|
+
Callable[[], Any]: The decorated factory function.
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
# Check if the factory is called with the correct parameter
|
|
41
|
+
if type(schema) not in [dict, str]:
|
|
42
|
+
error_message = "langflow_factory schema parameter is required"
|
|
43
|
+
raise ValueError(error_message)
|
|
44
|
+
|
|
45
|
+
# Check if the factory is called with the correct parameter
|
|
46
|
+
if type(use_async) != bool:
|
|
47
|
+
error_message = "langflow_factory use_async parameter is required"
|
|
48
|
+
raise ValueError(error_message)
|
|
49
|
+
|
|
50
|
+
config.code.langflow_schema = schema
|
|
51
|
+
|
|
52
|
+
def decorator(func: Callable) -> Callable:
|
|
53
|
+
async def wrapper():
|
|
54
|
+
from langflow import load_flow_from_json
|
|
55
|
+
|
|
56
|
+
schema = config.code.langflow_schema
|
|
57
|
+
|
|
58
|
+
if type(schema) == str:
|
|
59
|
+
async with aiohttp.ClientSession() as session:
|
|
60
|
+
async with session.get(
|
|
61
|
+
schema,
|
|
62
|
+
) as r:
|
|
63
|
+
if not r.ok:
|
|
64
|
+
reason = await r.text()
|
|
65
|
+
raise ValueError(f"Error: {reason}")
|
|
66
|
+
schema = await r.json()
|
|
67
|
+
|
|
68
|
+
flow = load_flow_from_json(input=schema, tweaks=tweaks)
|
|
69
|
+
return func(flow)
|
|
70
|
+
|
|
71
|
+
langchain_factory(use_async=use_async)(wrapper)
|
|
72
|
+
|
|
73
|
+
return func
|
|
74
|
+
|
|
75
|
+
return decorator
|
chainlit/lc/__init__.py
CHANGED
|
@@ -9,3 +9,88 @@ try:
|
|
|
9
9
|
LANGCHAIN_INSTALLED = True
|
|
10
10
|
except ImportError:
|
|
11
11
|
LANGCHAIN_INSTALLED = False
|
|
12
|
+
|
|
13
|
+
from chainlit.telemetry import trace
|
|
14
|
+
from typing import Callable, Any
|
|
15
|
+
|
|
16
|
+
from chainlit.config import config
|
|
17
|
+
from chainlit.utils import wrap_user_function
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@trace
|
|
21
|
+
def langchain_factory(use_async: bool) -> Callable:
|
|
22
|
+
"""
|
|
23
|
+
Plug and play decorator for the LangChain library.
|
|
24
|
+
The decorated function should instantiate a new LangChain instance (Chain, Agent...).
|
|
25
|
+
One instance per user session is created and cached.
|
|
26
|
+
The per user instance is called every time a new message is received.
|
|
27
|
+
|
|
28
|
+
Args:
|
|
29
|
+
use_async bool: Whether to call the the agent asynchronously or not.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Callable[[], Any]: The decorated factory function.
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
# Check if the factory is called with the correct parameter
|
|
36
|
+
if type(use_async) != bool:
|
|
37
|
+
error_message = "langchain_factory use_async parameter is required"
|
|
38
|
+
raise ValueError(error_message)
|
|
39
|
+
|
|
40
|
+
def decorator(func: Callable) -> Callable:
|
|
41
|
+
config.code.lc_factory = wrap_user_function(func, with_task=True)
|
|
42
|
+
return func
|
|
43
|
+
|
|
44
|
+
config.code.lc_agent_is_async = use_async
|
|
45
|
+
|
|
46
|
+
return decorator
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@trace
|
|
50
|
+
def langchain_postprocess(func: Callable[[Any], str]) -> Callable:
|
|
51
|
+
"""
|
|
52
|
+
Useful to post process the response a LangChain object instantiated with @langchain_factory.
|
|
53
|
+
The decorated function takes the raw output of the LangChain object as input.
|
|
54
|
+
The response will NOT be automatically sent to the UI, you need to send a Message.
|
|
55
|
+
|
|
56
|
+
Args:
|
|
57
|
+
func (Callable[[Any], str]): The post-processing function to apply after generating a response. Takes the response as parameter.
|
|
58
|
+
|
|
59
|
+
Returns:
|
|
60
|
+
Callable[[Any], str]: The decorated post-processing function.
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
config.code.lc_postprocess = wrap_user_function(func)
|
|
64
|
+
return func
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
@trace
|
|
68
|
+
def langchain_run(func: Callable[[Any, str], str]) -> Callable:
|
|
69
|
+
"""
|
|
70
|
+
Useful to override the default behavior of the LangChain object instantiated with @langchain_factory.
|
|
71
|
+
Use when your agent run method has custom parameters.
|
|
72
|
+
Takes the LangChain agent and the user input as parameters.
|
|
73
|
+
The response will NOT be automatically sent to the UI, you need to send a Message.
|
|
74
|
+
Args:
|
|
75
|
+
func (Callable[[Any, str], str]): The function to be called when a new message is received. Takes the agent and user input as parameters and returns the output string.
|
|
76
|
+
|
|
77
|
+
Returns:
|
|
78
|
+
Callable[[Any, str], Any]: The decorated function.
|
|
79
|
+
"""
|
|
80
|
+
config.code.lc_run = wrap_user_function(func)
|
|
81
|
+
return func
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
@trace
|
|
85
|
+
def langchain_rename(func: Callable[[str], str]) -> Callable[[str], str]:
|
|
86
|
+
"""
|
|
87
|
+
Useful to rename the LangChain tools/chains used in the agent and display more friendly author names in the UI.
|
|
88
|
+
Args:
|
|
89
|
+
func (Callable[[str], str]): The function to be called to rename a tool/chain. Takes the original tool/chain name as parameter.
|
|
90
|
+
|
|
91
|
+
Returns:
|
|
92
|
+
Callable[[Any, str], Any]: The decorated function.
|
|
93
|
+
"""
|
|
94
|
+
|
|
95
|
+
config.code.lc_rename = wrap_user_function(func)
|
|
96
|
+
return func
|
chainlit/lc/agent.py
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
from typing import Any
|
|
2
|
-
from chainlit.lc.callbacks import
|
|
2
|
+
from chainlit.lc.callbacks import (
|
|
3
|
+
LangchainCallbackHandler,
|
|
4
|
+
AsyncLangchainCallbackHandler,
|
|
5
|
+
)
|
|
3
6
|
from chainlit.sync import make_async
|
|
4
7
|
from chainlit.context import emitter_var
|
|
5
8
|
|
|
@@ -9,20 +12,20 @@ async def run_langchain_agent(agent: Any, input_str: str, use_async: bool):
|
|
|
9
12
|
input_key = agent.input_keys[0]
|
|
10
13
|
if use_async:
|
|
11
14
|
raw_res = await agent.acall(
|
|
12
|
-
{input_key: input_str}, callbacks=[
|
|
15
|
+
{input_key: input_str}, callbacks=[AsyncLangchainCallbackHandler()]
|
|
13
16
|
)
|
|
14
17
|
else:
|
|
15
18
|
raw_res = await make_async(agent.__call__)(
|
|
16
|
-
{input_key: input_str}, callbacks=[
|
|
19
|
+
{input_key: input_str}, callbacks=[LangchainCallbackHandler()]
|
|
17
20
|
)
|
|
18
21
|
else:
|
|
19
22
|
if use_async:
|
|
20
23
|
raw_res = await agent.acall(
|
|
21
|
-
input_str, callbacks=[
|
|
24
|
+
input_str, callbacks=[AsyncLangchainCallbackHandler()]
|
|
22
25
|
)
|
|
23
26
|
else:
|
|
24
27
|
raw_res = await make_async(agent.__call__)(
|
|
25
|
-
input_str, callbacks=[
|
|
28
|
+
input_str, callbacks=[LangchainCallbackHandler()]
|
|
26
29
|
)
|
|
27
30
|
|
|
28
31
|
if hasattr(agent, "output_keys"):
|
chainlit/lc/callbacks.py
CHANGED
|
@@ -38,7 +38,7 @@ def get_llm_settings(invocation_params: Union[Dict, None]):
|
|
|
38
38
|
return None
|
|
39
39
|
|
|
40
40
|
|
|
41
|
-
class
|
|
41
|
+
class BaseLangchainCallbackHandler(BaseCallbackHandler):
|
|
42
42
|
emitter: ChainlitEmitter
|
|
43
43
|
# Keep track of the formatted prompts to display them in the prompt playground.
|
|
44
44
|
prompts: List[str]
|
|
@@ -100,7 +100,7 @@ class BaseChainlitCallbackHandler(BaseCallbackHandler):
|
|
|
100
100
|
return author, indent, llm_settings
|
|
101
101
|
|
|
102
102
|
|
|
103
|
-
class
|
|
103
|
+
class LangchainCallbackHandler(BaseLangchainCallbackHandler, BaseCallbackHandler):
|
|
104
104
|
def start_stream(self):
|
|
105
105
|
author, indent, llm_settings = self.get_message_params()
|
|
106
106
|
|
|
@@ -252,7 +252,7 @@ class ChainlitCallbackHandler(BaseChainlitCallbackHandler, BaseCallbackHandler):
|
|
|
252
252
|
pass
|
|
253
253
|
|
|
254
254
|
|
|
255
|
-
class
|
|
255
|
+
class AsyncLangchainCallbackHandler(BaseLangchainCallbackHandler, AsyncCallbackHandler):
|
|
256
256
|
async def start_stream(self):
|
|
257
257
|
author, indent, llm_settings = self.get_message_params()
|
|
258
258
|
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
try:
|
|
2
|
+
import llama_index
|
|
3
|
+
|
|
4
|
+
if llama_index.__version__ < "0.6.27":
|
|
5
|
+
raise ValueError(
|
|
6
|
+
"LlamaIndex version is too old, expected >= 0.6.27. Run `pip install llama_index --upgrade`"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
LLAMA_INDEX_INSTALLED = True
|
|
10
|
+
except ImportError:
|
|
11
|
+
LLAMA_INDEX_INSTALLED = False
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from chainlit.telemetry import trace
|
|
15
|
+
from typing import Callable
|
|
16
|
+
|
|
17
|
+
from chainlit.config import config
|
|
18
|
+
from chainlit.utils import wrap_user_function
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@trace
|
|
22
|
+
def llama_index_factory(func: Callable) -> Callable:
|
|
23
|
+
"""
|
|
24
|
+
Plug and play decorator for the Llama Index library.
|
|
25
|
+
The decorated function should instantiate a new Llama instance.
|
|
26
|
+
One instance per user session is created and cached.
|
|
27
|
+
The per user instance is called every time a new message is received.
|
|
28
|
+
|
|
29
|
+
Returns:
|
|
30
|
+
Callable[[], Any]: The decorated factory function.
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
config.code.llama_index_factory = wrap_user_function(func, with_task=True)
|
|
34
|
+
return func
|