window.setTimeout((()=>{var e;pe.current=se.current[null==(e=Pe[Te])?void 0:e.value],fe({alignment:de?"end":"start"})}),50);jc((()=>{Re&&Ie()}),[Re]);return r.createElement(lg.Wrapper,Sj(kj({},a),{__staticSelector:"Select"}),r.createElement(QE,{opened:Re,transitionProps:h,shadow:i,withinPortal:M,portalProps:B,__staticSelector:"Select",onDirectionChange:ue,switchDirectionOnFlip:U,zIndex:H,dropdownPosition:$,positionDependencies:[...Y,Oe],classNames:v,styles:b,unstyled:y,variant:o.variant},r.createElement(QE.Target,null,r.createElement("div",{role:"combobox","aria-haspopup":"listbox","aria-owns":Re?"".concat(o.id,"-items"):null,"aria-controls":o.id,"aria-expanded":Re,onMouseLeave:()=>ie(-1),tabIndex:-1},r.createElement("input",{type:"hidden",name:W,value:we||"",form:K,disabled:C}),r.createElement(lg,kj(Sj(kj(kj({autoComplete:"off",type:"search"},o),J),{ref:zi(t,le),onKeyDown:e=>{switch("function"===typeof f&&f(e),e.key){case"ArrowUp":e.preventDefault(),re?de?Ne():Ae():(ie(Te),ge(!0),Ie());break;case"ArrowDown":e.preventDefault(),re?de?Ae():Ne():(ie(Te),ge(!0),Ie());break;case"Home":if(!k){e.preventDefault(),re||ge(!0);const t=Pe.findIndex((e=>!e.disabled));ie(t),Re&&fe({alignment:de?"end":"start"})}break;case"End":if(!k){e.preventDefault(),re||ge(!0);const t=Pe.map((e=>!!e.disabled)).lastIndexOf(!1);ie(t),Re&&fe({alignment:de?"end":"start"})}break;case"Escape":e.preventDefault(),ge(!1),ie(-1);break;case" ":k||(e.preventDefault(),Pe[ae]&&re?_e(Pe[ae]):(ge(!0),ie(Te),Ie()));break;case"Enter":k||e.preventDefault(),Pe[ae]&&re&&(e.preventDefault(),_e(Pe[ae]))}},__staticSelector:"Select",value:Oe,placeholder:q,onChange:e=>{X||(Ce(e.currentTarget.value),S&&""===e.currentTarget.value&&xe(null),ie(-1),ge(!0))},"aria-autocomplete":"list","aria-controls":Re?"".concat(o.id,"-items"):null,"aria-activedescendant":ae>=0?"".concat(o.id,"-").concat(ae):null,onMouseDown:()=>{X||(ge(!re),we&&!re&&ie(Te))},onBlur:e=>{"function"===typeof p&&p(e);const t=be.find((e=>e.value===we));I&&Pe[ae]&&re&&_e(Pe[ae]),Ce((null==t?void 0:t.label)||""),ge(!1)},onFocus:e=>{"function"===typeof m&&m(e),k&&ge(!0)},readOnly:!k||X,disabled:C,"data-mantine-stop-propagation":Re,name:null,classNames:Sj(kj({},v),{input:te({[ee.input]:!k},null==v?void 0:v.input)})}),pj({theme:ne,rightSection:j,rightSectionWidth:T,styles:b,size:o.size,shouldClear:S&&!!Se,onClear:()=>{var e;X||(xe(null),ke||Ce(""),null==(e=le.current)||e.focus())},error:a.error,clearButtonProps:Z,disabled:C,readOnly:X}))))),r.createElement(QE.Dropdown,{component:z||VE,maxHeight:x,direction:ce,id:o.id,innerRef:me,__staticSelector:"Select",classNames:v,styles:b},r.createElement(TE,{data:Pe,hovered:ae,classNames:v,styles:b,isItemSelected:e=>e===we,uuid:o.id,__staticSelector:"Select",onItemHover:ie,onItemSelect:_e,itemsRefs:se,itemComponent:d,size:o.size,nothingFound:O,creatable:ye&&!!ve,createLabel:ve,"aria-label":a.label,unstyled:y,variant:o.variant}))))}));Ej.displayName="@mantine/core/Select";var Cj=ey("help","IconHelp",[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M12 17l0 .01",key:"svg-1"}],["path",{d:"M12 13.5a1.5 1.5 0 0 1 1 -1.5a2.6 2.6 0 1 0 -3 -4",key:"svg-2"}]]);const _j={x:0,y:0,width:0,height:0,top:0,left:0,bottom:0,right:0};function Pj(){const e=(0,r.useRef)(0),t=(0,r.useRef)(null),[n,o]=(0,r.useState)(_j),a=(0,r.useMemo)((()=>"undefined"!==typeof window?new ResizeObserver((n=>{const r=n[0];r&&(cancelAnimationFrame(e.current),e.current=requestAnimationFrame((()=>{t.current&&o(r.contentRect)})))})):null),[]);return $t((()=>(t.current&&(a.observe(t.current),o(t.current.getBoundingClientRect())),()=>{a.disconnect(),e.current&&cancelAnimationFrame(e.current)})),[t.current]),[t,n]}var jj=Object.defineProperty,Tj=Object.defineProperties,Rj=Object.getOwnPropertyDescriptors,Nj=Object.getOwnPropertySymbols,Aj=Object.prototype.hasOwnProperty,Ij=Object.prototype.propertyIsEnumerable,Dj=(e,t,n)=>t in e?jj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,zj=(e,t)=>{for(var n in t||(t={}))Aj.call(t,n)&&Dj(e,n,t[n]);if(Nj)for(var n of Nj(t))Ij.call(t,n)&&Dj(e,n,t[n]);return e},Lj=(e,t)=>Tj(e,Rj(t));const Fj={xs:"".concat(We(3)," ").concat(We(6)),sm:"".concat(We(5)," ").concat(We(10)),md:"".concat(We(7)," ").concat(We(14)),lg:"".concat(We(9)," ").concat(We(16)),xl:"".concat(We(12)," ").concat(We(20))};var Mj=gn(((e,t,n)=>{let{fullWidth:r,color:o,radius:a,shouldAnimate:i,transitionDuration:l,transitionTimingFunction:s,orientation:c}=t,{size:u}=n;const d="vertical"===c,f=e.fn.variant({variant:"filled",color:o});return{label:Lj(zj(zj({ref:Pk("label")},e.fn.focusStyles()),e.fn.fontStyles()),{WebkitTapHighlightColor:"transparent",borderRadius:e.fn.radius(a),fontWeight:500,fontSize:u in e.fontSizes?e.fontSizes[u]:e.fontSizes.sm,cursor:"pointer",display:"block",textAlign:"center",padding:Fj[u in Fj?u:"sm"],whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",userSelect:"none",color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[7],transition:"color ".concat(i?0:l,"ms ").concat(s||e.transitionTimingFunction),"&:hover":{color:"dark"===e.colorScheme?e.colors.dark[0]:e.black},"&[data-disabled]":{"&, &:hover":{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"}},"&[data-active]":{"&, &:hover":{color:o||"dark"===e.colorScheme?e.white:e.black}}}),control:{ref:Pk("control"),position:"relative",boxSizing:"border-box",flex:1,zIndex:2,transition:"border-left-color ".concat(i?0:l,"ms ").concat(s||e.transitionTimingFunction),"&:not(:first-of-type)":{borderStyle:"solid",borderWidth:d?"".concat(We(1)," 0 0 0"):"0 0 0 ".concat(We(1)),borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3]}},input:{height:0,width:0,position:"absolute",overflow:"hidden",whiteSpace:"nowrap",opacity:0,"&:focus":{outline:"none",["& + .".concat(Pk("label"))]:zj({},"always"===e.focusRing||"auto"===e.focusRing?e.focusRingStyles.styles(e):e.focusRingStyles.resetStyles(e)),"&:focus:not(:focus-visible)":{["& + .".concat(Pk("label"))]:zj({},"auto"===e.focusRing||"never"===e.focusRing?e.focusRingStyles.resetStyles(e):null)}},"&:disabled + label":{"&, &:hover":{color:"dark"===e.colorScheme?e.colors.dark[3]:e.colors.gray[5],cursor:"not-allowed",pointerEvents:"none"}}},root:{position:"relative",display:r||d?"flex":"inline-flex",width:d&&!r?"max-content":"auto",flexDirection:d?"column":"row",backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[1],borderRadius:e.fn.radius(a),overflow:"hidden",padding:4},controlActive:{borderLeftColor:"transparent !important",borderTopColor:"transparent !important",["& + .".concat(Pk("control"))]:{[d?"borderTopColor":"borderLeftColor"]:"transparent !important"},borderRadius:e.fn.radius(a),boxShadow:i?o||"dark"===e.colorScheme?"none":e.shadows.xs:void 0,backgroundColor:i?o?f.background:"dark"===e.colorScheme?e.colors.dark[5]:e.white:void 0},indicator:{boxSizing:"border-box",borderRadius:e.fn.radius(a),position:"absolute",zIndex:1,boxShadow:o||"dark"===e.colorScheme?"none":e.shadows.xs,transition:"transform ".concat(i?0:l,"ms ").concat(e.transitionTimingFunction,", width ").concat(i?0:l/2,"ms ").concat(s||e.transitionTimingFunction),backgroundColor:o?f.background:"dark"===e.colorScheme?e.colors.dark[5]:e.white}}}));const Bj=Mj;var Uj=Object.defineProperty,Hj=Object.getOwnPropertySymbols,Wj=Object.prototype.hasOwnProperty,$j=Object.prototype.propertyIsEnumerable,Vj=(e,t,n)=>t in e?Uj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const qj={disabled:!1,size:"sm",transitionDuration:200},Gj=(0,r.forwardRef)(((e,t)=>{var n,o,a,i;const l=Ht("SegmentedControl",qj,e),{className:s,disabled:c,data:u,name:d,value:f,onChange:p,color:m,fullWidth:h,radius:g,size:y,transitionDuration:v,transitionTimingFunction:b,classNames:w,styles:x,defaultValue:k,orientation:S,unstyled:O,variant:E,readOnly:C}=l,_=((e,t)=>{var n={};for(var r in e)Wj.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Hj)for(var r of Hj(e))t.indexOf(r)<0&&$j.call(e,r)&&(n[r]=e[r]);return n})(l,["className","disabled","data","name","value","onChange","color","fullWidth","radius","size","transitionDuration","transitionTimingFunction","classNames","styles","defaultValue","orientation","unstyled","variant","readOnly"]),P=Bt(),j=Qc(),T=!!P.respectReducedMotion&&j,R=u.map((e=>"string"===typeof e?{label:e,value:e}:e)),N=(0,r.useRef)(),[A,I]=(0,r.useState)(!1),[D,z]=Uf({value:f,defaultValue:k,finalValue:Array.isArray(R)&&null!=(i=null!=(a=null==(n=R.find((e=>!e.disabled)))?void 0:n.value)?a:null==(o=R[0])?void 0:o.value)?i:null,onChange:p}),{classes:L,cx:F}=Bj({fullWidth:h,color:m,radius:g,shouldAnimate:T||!A,transitionDuration:v,transitionTimingFunction:b,orientation:S},{name:"SegmentedControl",classNames:w,styles:x,unstyled:O,variant:E,size:y}),[M,B]=(0,r.useState)({width:0,height:0,translate:[0,0]}),U=Gt(d),H=(0,r.useRef)({}),[W,$]=Pj();$t((()=>{N.current?I(!0):(N.current=!0,I(!1))})),(0,r.useEffect)((()=>{if(D in H.current&&W.current){const e=H.current[D],t=e.getBoundingClientRect(),n=e.offsetWidth/t.width,r=t.width*n||0,o=t.height*n||0,a=$.width-e.parentElement.offsetLeft+4-r,i=e.parentElement.offsetLeft-4;B({width:r,height:o,translate:["rtl"===P.dir?a:i,e.parentElement.offsetTop-4]})}}),[D,$]);const V=R.map((e=>r.createElement("div",{className:F(L.control,{[L.controlActive]:D===e.value}),key:e.value},r.createElement("input",{className:L.input,disabled:c||e.disabled,type:"radio",name:U,value:e.value,id:"".concat(U,"-").concat(e.value),checked:D===e.value,onChange:()=>!C&&z(e.value)}),r.createElement("label",{className:L.label,"data-active":D===e.value&&!(c||e.disabled)||void 0,"data-disabled":c||e.disabled||void 0,htmlFor:"".concat(U,"-").concat(e.value),ref:t=>{H.current[e.value]=t}},e.label)))),q=zi(W,t);return 0===R.length?null:r.createElement(Jn,((e,t)=>{for(var n in t||(t={}))Wj.call(t,n)&&Vj(e,n,t[n]);if(Hj)for(var n of Hj(t))$j.call(t,n)&&Vj(e,n,t[n]);return e})({className:F(L.root,s),ref:q},_),"string"===typeof D&&A&&r.createElement(Jn,{component:"span",className:L.indicator,sx:{width:M.width,height:M.height,transform:"translate(".concat(M.translate[0],"px, ").concat(M.translate[1],"px)")}}),V)}));Gj.displayName="@mantine/core/SegmentedControl";const Kj=(0,r.memo)((function(e){const{disabled:t,property:n,renderProperty:o,setValue:a,...i}=e,l=(0,r.useMemo)((()=>n.types.map(((e,t)=>({label:"",value:t.toString()})))),[n.types]),[s,c]=(0,r.useState)(new Map),[u,d]=(0,r.useState)("0"),f=(0,r.useCallback)((e=>{console.log("set value: ",s.get(e)),a(s.get(e)),d(e)}),[s,a]),p=(0,r.useCallback)((e=>{const t="function"===typeof e?e(s):e;c((e=>e.set(u,t))),a(t)}),[u,s,a]);return(0,oy.jsxs)(wa,{direction:"column",children:[(0,oy.jsx)(Gj,{data:l,value:u,onChange:f,disabled:t}),(0,oy.jsx)("div",{style:{marginLeft:"1em"},children:o({...i,property:n.types[parseInt(u)],setValue:p,propertyName:""})})]})})),Yj="Tabs component was not found in the tree",Xj="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",[Zj,Qj]=Hf(Yj);var Jj=Object.defineProperty,eT=Object.getOwnPropertySymbols,tT=Object.prototype.hasOwnProperty,nT=Object.prototype.propertyIsEnumerable,rT=(e,t,n)=>t in e?Jj(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oT=(e,t)=>{for(var n in t||(t={}))tT.call(t,n)&&rT(e,n,t[n]);if(eT)for(var n of eT(t))nT.call(t,n)&&rT(e,n,t[n]);return e};function aT(e,t,n){let{orientation:r,inverted:o,placement:a}=e;const i="vertical"===r;return"default"===n?{[i?"left"===a?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:"".concat(We(2)," solid ").concat("dark"===t.colorScheme?t.colors.dark[4]:t.colors.gray[3])}:"outline"===n?{[i?"left"===a?"borderRight":"borderLeft":o?"borderTop":"borderBottom"]:"".concat(We(1)," solid ").concat("dark"===t.colorScheme?t.colors.dark[4]:t.colors.gray[3])}:"pills"===n?{gap:"calc(".concat(t.spacing.sm," / 2)")}:{}}var iT=gn(((e,t,n)=>{let{variant:r}=n;const o="vertical"===t.orientation;return{tabsList:oT({display:"flex",flexWrap:"wrap",flexDirection:o?"column":"row",justifyContent:Ta[t.position],'& [role="tab"]':{flex:t.grow?1:void 0}},aT(t,e,r))}}));const lT=iT;var sT=Object.defineProperty,cT=Object.defineProperties,uT=Object.getOwnPropertyDescriptors,dT=Object.getOwnPropertySymbols,fT=Object.prototype.hasOwnProperty,pT=Object.prototype.propertyIsEnumerable,mT=(e,t,n)=>t in e?sT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const hT={grow:!1,position:"left"},gT=(0,r.forwardRef)(((e,t)=>{const n=Ht("TabsList",hT,e),{children:o,className:a,grow:i,position:l}=n,s=((e,t)=>{var n={};for(var r in e)fT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&dT)for(var r of dT(e))t.indexOf(r)<0&&pT.call(e,r)&&(n[r]=e[r]);return n})(n,["children","className","grow","position"]),{orientation:c,variant:u,color:d,radius:f,inverted:p,placement:m,classNames:h,styles:g,unstyled:y}=Qj(),{classes:v,cx:b}=lT({orientation:c,grow:i,color:d,position:l,radius:f,inverted:p,placement:m},{name:"Tabs",unstyled:y,classNames:h,styles:g,variant:u});return r.createElement(Jn,((e,t)=>cT(e,uT(t)))(((e,t)=>{for(var n in t||(t={}))fT.call(t,n)&&mT(e,n,t[n]);if(dT)for(var n of dT(t))pT.call(t,n)&&mT(e,n,t[n]);return e})({},s),{className:b(v.tabsList,a),ref:t,role:"tablist","aria-orientation":c}),o)}));gT.displayName="@mantine/core/TabsList";const yT=gn(((e,t)=>{let{orientation:n}=t;return{panel:{flex:"vertical"===n?1:void 0}}}));var vT=Object.defineProperty,bT=Object.defineProperties,wT=Object.getOwnPropertyDescriptors,xT=Object.getOwnPropertySymbols,kT=Object.prototype.hasOwnProperty,ST=Object.prototype.propertyIsEnumerable,OT=(e,t,n)=>t in e?vT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const ET={},CT=(0,r.forwardRef)(((e,t)=>{const n=Ht("TabsPanel",ET,e),{value:o,children:a,sx:i,className:l}=n,s=((e,t)=>{var n={};for(var r in e)kT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&xT)for(var r of xT(e))t.indexOf(r)<0&&ST.call(e,r)&&(n[r]=e[r]);return n})(n,["value","children","sx","className"]),c=Qj(),{classes:u,cx:d}=yT({orientation:c.orientation,color:c.color,radius:c.radius,inverted:c.inverted,placement:c.placement},{name:"Tabs",unstyled:c.unstyled,classNames:c.classNames,styles:c.styles,variant:c.variant}),f=c.getPanelId(o),p=c.value===o,m=c.keepMounted||p?a:null;return(0,r.useEffect)((()=>(c.setMountedPanelIds((e=>[...e,f])),c.setMountedPanelIds((e=>e.filter((e=>e!==f)))))),[f]),r.createElement(Jn,((e,t)=>bT(e,wT(t)))(((e,t)=>{for(var n in t||(t={}))kT.call(t,n)&&OT(e,n,t[n]);if(xT)for(var n of xT(t))ST.call(t,n)&&OT(e,n,t[n]);return e})({},s),{ref:t,sx:[{display:p?void 0:"none"},...ua(i)],className:d(u.panel,l),role:"tabpanel",id:f,"aria-labelledby":c.getTabId(o)}),m)}));CT.displayName="@mantine/core/TabsPanel";var _T=Object.defineProperty,PT=Object.defineProperties,jT=Object.getOwnPropertyDescriptors,TT=Object.getOwnPropertySymbols,RT=Object.prototype.hasOwnProperty,NT=Object.prototype.propertyIsEnumerable,AT=(e,t,n)=>t in e?_T(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IT=(e,t)=>{for(var n in t||(t={}))RT.call(t,n)&&AT(e,n,t[n]);if(TT)for(var n of TT(t))NT.call(t,n)&&AT(e,n,t[n]);return e},DT=(e,t)=>PT(e,jT(t));function zT(e,t,n){let{orientation:r,color:o,radius:a,inverted:i,placement:l}=t;const s="vertical"===r,c=e.fn.variant({color:o,variant:"filled"}),u=We(e.fn.radius(a)),d="vertical"===r?"left"===l?"".concat(u," 0 0 ").concat(u):" 0 ".concat(u," ").concat(u," 0"):i?"0 0 ".concat(u," ").concat(u):"".concat(u," ").concat(u," 0 0");return"default"===n?DT(IT({[s?"left"===l?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:"".concat(We(2)," solid transparent"),[s?"left"===l?"marginRight":"marginLeft":i?"marginTop":"marginBottom"]:We(-2),borderRadius:d},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0],borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3]})),{"&[data-active]":IT({borderColor:c.background,color:"dark"===e.colorScheme?e.white:e.black},e.fn.hover({borderColor:c.background}))}):"outline"===n?{borderRadius:d,border:"".concat(We(1)," solid transparent"),[s?"left"===l?"borderRight":"borderLeft":i?"borderTop":"borderBottom"]:"none","&[data-active]":{borderColor:"dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3],"&::before":{content:'""',backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.white,position:"absolute",bottom:s?0:i?"unset":We(-1),top:s?0:i?We(-1):"unset",[s?"width":"height"]:We(1),right:s?"left"===l?We(-1):"unset":0,left:s?"left"===l?"unset":We(-1):0}}}:"pills"===n?DT(IT({borderRadius:e.fn.radius(a)},e.fn.hover({backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.colors.gray[0]})),{"&[data-active]":IT({backgroundColor:c.background,color:e.white},e.fn.hover({backgroundColor:c.background}))}):{}}var LT=gn(((e,t,n)=>{let{variant:r}=n;return{tabLabel:{},tab:IT({position:"relative",padding:"".concat(e.spacing.xs," ").concat(e.spacing.md),paddingLeft:t.withIcon?e.spacing.xs:void 0,paddingRight:t.withRightSection?e.spacing.xs:void 0,fontSize:e.fontSizes.sm,whiteSpace:"nowrap",zIndex:0,display:"flex",alignItems:"center",justifyContent:"horizontal"===t.orientation?"center":void 0,lineHeight:1,"&:disabled":IT({opacity:.5,cursor:"not-allowed"},e.fn.hover({backgroundColor:"transparent"})),"&:focus":{zIndex:1}},zT(e,t,r)),tabRightSection:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginLeft:We(7)}},tabIcon:{display:"flex",justifyContent:"center",alignItems:"center","&:not(:only-child)":{marginRight:We(7)}}}}));const FT=LT;var MT=Object.defineProperty,BT=Object.defineProperties,UT=Object.getOwnPropertyDescriptors,HT=Object.getOwnPropertySymbols,WT=Object.prototype.hasOwnProperty,$T=Object.prototype.propertyIsEnumerable,VT=(e,t,n)=>t in e?MT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const qT={},GT=(0,r.forwardRef)(((e,t)=>{const n=Ht("TabsTab",qT,e),{value:o,children:a,onKeyDown:i,onClick:l,className:s,icon:c,rightSection:u,color:d}=n,f=((e,t)=>{var n={};for(var r in e)WT.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&HT)for(var r of HT(e))t.indexOf(r)<0&&$T.call(e,r)&&(n[r]=e[r]);return n})(n,["value","children","onKeyDown","onClick","className","icon","rightSection","color"]),p=Qj(),m=!!c,h=!!u,{theme:g,classes:y,cx:v}=FT({withIcon:m||h&&!a,withRightSection:h||m&&!a,orientation:p.orientation,color:d||p.color,radius:p.radius,inverted:p.inverted,placement:p.placement},{name:"Tabs",unstyled:p.unstyled,classNames:p.classNames,styles:p.styles,variant:p.variant}),b=o===p.value,w=p.getPanelId(o),x=p.mountedPanelIds.includes(o)?w:void 0;return r.createElement(so,((e,t)=>BT(e,UT(t)))(((e,t)=>{for(var n in t||(t={}))WT.call(t,n)&&VT(e,n,t[n]);if(HT)for(var n of HT(t))$T.call(t,n)&&VT(e,n,t[n]);return e})({},f),{unstyled:p.unstyled,className:v(y.tab,s),"data-active":b||void 0,ref:t,type:"button",role:"tab",id:p.getTabId(o),"aria-selected":b,tabIndex:b||null===p.value?0:-1,"aria-controls":x,onClick:e=>{p.onTabChange(p.allowTabDeactivation&&o===p.value?null:o),null==l||l(e)},onKeyDown:ip({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:p.activateTabWithKeyboard,loop:p.loop,dir:g.dir,orientation:p.orientation,onKeyDown:i})}),c&&r.createElement("span",{className:y.tabIcon},c),a&&r.createElement("span",{className:y.tabLabel},a),u&&r.createElement("span",{className:y.tabRightSection},u))}));function KT(e){let{defaultValue:t,value:n,onTabChange:o,orientation:a,children:i,loop:l,id:s,activateTabWithKeyboard:c,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,placement:h,keepMounted:g=!0,classNames:y,styles:v,unstyled:b}=e;const w=Gt(s),[x,k]=(0,r.useState)([]),[S,O]=Uf({value:n,defaultValue:t,finalValue:null,onChange:o});return r.createElement(Zj,{value:{placement:h,value:S,orientation:a,id:w,loop:l,activateTabWithKeyboard:c,getTabId:Bf("".concat(w,"-tab"),Xj),getPanelId:Bf("".concat(w,"-panel"),Xj),onTabChange:O,setMountedPanelIds:k,mountedPanelIds:x,allowTabDeactivation:u,variant:d,color:f,radius:p,inverted:m,keepMounted:g,classNames:y,styles:v,unstyled:b}},i)}GT.displayName="@mantine/core/Tab",KT.displayName="@mantine/core/TabsProvider";const YT=gn(((e,t)=>{let{orientation:n,placement:r}=t;return{root:{display:"vertical"===n?"flex":void 0,flexDirection:"right"===r?"row-reverse":"row"}}}));var XT=Object.defineProperty,ZT=Object.defineProperties,QT=Object.getOwnPropertyDescriptors,JT=Object.getOwnPropertySymbols,eR=Object.prototype.hasOwnProperty,tR=Object.prototype.propertyIsEnumerable,nR=(e,t,n)=>t in e?XT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const rR={orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},oR=(0,r.forwardRef)(((e,t)=>{const n=Ht("Tabs",rR,e),{defaultValue:o,value:a,orientation:i,loop:l,activateTabWithKeyboard:s,allowTabDeactivation:c,children:u,id:d,onTabChange:f,variant:p,color:m,className:h,unstyled:g,classNames:y,styles:v,radius:b,inverted:w,keepMounted:x,placement:k}=n,S=((e,t)=>{var n={};for(var r in e)eR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&JT)for(var r of JT(e))t.indexOf(r)<0&&tR.call(e,r)&&(n[r]=e[r]);return n})(n,["defaultValue","value","orientation","loop","activateTabWithKeyboard","allowTabDeactivation","children","id","onTabChange","variant","color","className","unstyled","classNames","styles","radius","inverted","keepMounted","placement"]),{classes:O,cx:E}=YT({orientation:i,color:m,radius:b,inverted:w,placement:k},{unstyled:g,name:"Tabs",classNames:y,styles:v,variant:p});return r.createElement(KT,{activateTabWithKeyboard:s,defaultValue:o,orientation:i,onTabChange:f,value:a,id:d,loop:l,allowTabDeactivation:c,color:m,variant:p,radius:b,inverted:w,keepMounted:x,placement:k,classNames:y,styles:v,unstyled:g},r.createElement(Jn,((e,t)=>ZT(e,QT(t)))(((e,t)=>{for(var n in t||(t={}))eR.call(t,n)&&nR(e,n,t[n]);if(JT)for(var n of JT(t))tR.call(t,n)&&nR(e,n,t[n]);return e})({},S),{className:E(O.root,h),id:d,ref:t}),u))}));oR.List=gT,oR.Tab=GT,oR.Panel=CT,oR.displayName="@mantine/core/Tabs";var aR=function(){var e=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,t=0,n={},r={util:{encode:function e(t){return t instanceof o?new o(t.type,e(t.content),t.alias):Array.isArray(t)?t.map(e):t.replace(/&/g,"&").replace(/=d.reach);S+=k.value.length,k=k.next){var O=k.value;if(t.length>e.length)return;if(!(O instanceof o)){var E,C=1;if(v){if(!(E=a(x,S,e,y))||E.index>=e.length)break;var _=E.index,P=E.index+E[0].length,j=S;for(j+=k.value.length;_>=j;)j+=(k=k.next).value.length;if(S=j-=k.value.length,k.value instanceof o)continue;for(var T=k;T!==t.tail&&(jd.reach&&(d.reach=I);var D=k.prev;if(N&&(D=s(t,D,N),S+=N.length),c(t,D,C),k=s(t,D,new o(f,g?r.tokenize(R,g):R,b,R)),A&&s(t,k,A),C>1){var z={cause:f+","+m,reach:I};i(e,t,n,k.prev,S,z),d&&z.reach>d.reach&&(d.reach=z.reach)}}}}}}function l(){var e={value:null,prev:null,next:null},t={value:null,prev:e,next:null};e.next=t,this.head=e,this.tail=t,this.length=0}function s(e,t,n){var r=t.next,o={value:n,prev:t,next:r};return t.next=o,r.prev=o,e.length++,o}function c(e,t,n){for(var r=t.next,o=0;o"+a.content+""+a.tag+">"},r}(),iR=aR;aR.default=aR,iR.languages.markup={comment:{pattern://,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern://i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/?[\da-f]{1,8};/i]},iR.languages.markup.tag.inside["attr-value"].inside.entity=iR.languages.markup.entity,iR.languages.markup.doctype.inside["internal-subset"].inside=iR.languages.markup,iR.hooks.add("wrap",(function(e){"entity"===e.type&&(e.attributes.title=e.content.replace(/&/,"&"))})),Object.defineProperty(iR.languages.markup.tag,"addInlined",{value:function(e,t){var n={};n["language-"+t]={pattern:/(^$)/i,lookbehind:!0,inside:iR.languages[t]},n.cdata=/^$/i;var r={"included-cdata":{pattern://i,inside:n}};r["language-"+t]={pattern:/[\s\S]+/,inside:iR.languages[t]};var o={};o[e]={pattern:RegExp(/(<__[^>]*>)(?:))*\]\]>|(?!)/.source.replace(/__/g,(function(){return e})),"i"),lookbehind:!0,greedy:!0,inside:r},iR.languages.insertBefore("markup","cdata",o)}}),Object.defineProperty(iR.languages.markup.tag,"addAttribute",{value:function(e,t){iR.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+e+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[t,"language-"+t],inside:iR.languages[t]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),iR.languages.html=iR.languages.markup,iR.languages.mathml=iR.languages.markup,iR.languages.svg=iR.languages.markup,iR.languages.xml=iR.languages.extend("markup",{}),iR.languages.ssml=iR.languages.xml,iR.languages.atom=iR.languages.xml,iR.languages.rss=iR.languages.xml,function(e){var t="\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b",n={pattern:/(^(["']?)\w+\2)[ \t]+\S.*/,lookbehind:!0,alias:"punctuation",inside:null},r={bash:n,environment:{pattern:RegExp("\\$"+t),alias:"constant"},variable:[{pattern:/\$?\(\([\s\S]+?\)\)/,greedy:!0,inside:{variable:[{pattern:/(^\$\(\([\s\S]+)\)\)/,lookbehind:!0},/^\$\(\(/],number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,operator:/--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,punctuation:/\(\(?|\)\)?|,|;/}},{pattern:/\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,greedy:!0,inside:{variable:/^\$\(|^`|\)$|`$/}},{pattern:/\$\{[^}]+\}/,greedy:!0,inside:{operator:/:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,punctuation:/[\[\]]/,environment:{pattern:RegExp("(\\{)"+t),lookbehind:!0,alias:"constant"}}},/\$(?:\w+|[#?*!@$])/],entity:/\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/};e.languages.bash={shebang:{pattern:/^#!\s*\/.*/,alias:"important"},comment:{pattern:/(^|[^"{\\$])#.*/,lookbehind:!0},"function-name":[{pattern:/(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,lookbehind:!0,alias:"function"},{pattern:/\b[\w-]+(?=\s*\(\s*\)\s*\{)/,alias:"function"}],"for-or-select":{pattern:/(\b(?:for|select)\s+)\w+(?=\s+in\s)/,alias:"variable",lookbehind:!0},"assign-left":{pattern:/(^|[\s;|&]|[<>]\()\w+(?=\+?=)/,inside:{environment:{pattern:RegExp("(^|[\\s;|&]|[<>]\\()"+t),lookbehind:!0,alias:"constant"}},alias:"variable",lookbehind:!0},string:[{pattern:/((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,lookbehind:!0,greedy:!0,inside:r},{pattern:/((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,lookbehind:!0,greedy:!0,inside:{bash:n}},{pattern:/(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,lookbehind:!0,greedy:!0,inside:r},{pattern:/(^|[^$\\])'[^']*'/,lookbehind:!0,greedy:!0},{pattern:/\$'(?:[^'\\]|\\[\s\S])*'/,greedy:!0,inside:{entity:r.entity}}],environment:{pattern:RegExp("\\$?"+t),alias:"constant"},variable:r.variable,function:{pattern:/(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,lookbehind:!0},keyword:{pattern:/(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,lookbehind:!0},builtin:{pattern:/(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,lookbehind:!0,alias:"class-name"},boolean:{pattern:/(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,lookbehind:!0},"file-descriptor":{pattern:/\B&\d\b/,alias:"important"},operator:{pattern:/\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,inside:{"file-descriptor":{pattern:/^\d/,alias:"important"}}},punctuation:/\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,number:{pattern:/(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,lookbehind:!0}},n.inside=e.languages.bash;for(var o=["comment","function-name","for-or-select","assign-left","string","environment","function","keyword","builtin","boolean","file-descriptor","operator","punctuation","number"],a=r.variable[1].inside,i=0;i]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},iR.languages.c=iR.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),iR.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),iR.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},iR.languages.c.string],char:iR.languages.c.char,comment:iR.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:iR.languages.c}}}}),iR.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete iR.languages.c.boolean,function(e){var t=/\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|char8_t|class|co_await|co_return|co_yield|compl|concept|const|const_cast|consteval|constexpr|constinit|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|final|float|for|friend|goto|if|import|inline|int|int16_t|int32_t|int64_t|int8_t|long|module|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|register|reinterpret_cast|requires|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|uint16_t|uint32_t|uint64_t|uint8_t|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/,n=/\b(?!)\w+(?:\s*\.\s*\w+)*\b/.source.replace(//g,(function(){return t.source}));e.languages.cpp=e.languages.extend("c",{"class-name":[{pattern:RegExp(/(\b(?:class|concept|enum|struct|typename)\s+)(?!)\w+/.source.replace(//g,(function(){return t.source}))),lookbehind:!0},/\b[A-Z]\w*(?=\s*::\s*\w+\s*\()/,/\b[A-Z_]\w*(?=\s*::\s*~\w+\s*\()/i,/\b\w+(?=\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>\s*::\s*\w+\s*\()/],keyword:t,number:{pattern:/(?:\b0b[01']+|\b0x(?:[\da-f']+(?:\.[\da-f']*)?|\.[\da-f']+)(?:p[+-]?[\d']+)?|(?:\b[\d']+(?:\.[\d']*)?|\B\.[\d']+)(?:e[+-]?[\d']+)?)[ful]{0,4}/i,greedy:!0},operator:/>>=?|<<=?|->|--|\+\+|&&|\|\||[?:~]|<=>|[-+*/%&|^!=<>]=?|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/,boolean:/\b(?:false|true)\b/}),e.languages.insertBefore("cpp","string",{module:{pattern:RegExp(/(\b(?:import|module)\s+)/.source+"(?:"+/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|<[^<>\r\n]*>/.source+"|"+/(?:\s*:\s*)?|:\s*/.source.replace(//g,(function(){return n}))+")"),lookbehind:!0,greedy:!0,inside:{string:/^[<"][\s\S]+/,operator:/:/,punctuation:/\./}},"raw-string":{pattern:/R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/,alias:"string",greedy:!0}}),e.languages.insertBefore("cpp","keyword",{"generic-function":{pattern:/\b(?!operator\b)[a-z_]\w*\s*<(?:[^<>]|<[^<>]*>)*>(?=\s*\()/i,inside:{function:/^\w+/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:e.languages.cpp}}}}),e.languages.insertBefore("cpp","operator",{"double-colon":{pattern:/::/,alias:"punctuation"}}),e.languages.insertBefore("cpp","class-name",{"base-clause":{pattern:/(\b(?:class|struct)\s+\w+\s*:\s*)[^;{}"'\s]+(?:\s+[^;{}"'\s]+)*(?=\s*[;{])/,lookbehind:!0,greedy:!0,inside:e.languages.extend("cpp",{})}}),e.languages.insertBefore("inside","double-colon",{"class-name":/\b[a-z_]\w*\b(?!\s*::)/i},e.languages.cpp["base-clause"])}(iR),function(e){var t=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;e.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:/@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/,inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+t.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+t.source+"$"),alias:"url"}}},selector:{pattern:RegExp("(^|[{}\\s])[^{}\\s](?:[^{};\"'\\s]|\\s+(?![\\s{])|"+t.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:t,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},e.languages.css.atrule.inside.rest=e.languages.css;var n=e.languages.markup;n&&(n.tag.addInlined("style","css"),n.tag.addAttribute("style","css"))}(iR),function(e){var t,n=/("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/;e.languages.css.selector={pattern:e.languages.css.selector.pattern,lookbehind:!0,inside:t={"pseudo-element":/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,"pseudo-class":/:[-\w]+/,class:/\.[-\w]+/,id:/#[-\w]+/,attribute:{pattern:RegExp("\\[(?:[^[\\]\"']|"+n.source+")*\\]"),greedy:!0,inside:{punctuation:/^\[|\]$/,"case-sensitivity":{pattern:/(\s)[si]$/i,lookbehind:!0,alias:"keyword"},namespace:{pattern:/^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,lookbehind:!0,inside:{punctuation:/\|$/}},"attr-name":{pattern:/^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,lookbehind:!0},"attr-value":[n,{pattern:/(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,lookbehind:!0}],operator:/[|~*^$]?=/}},"n-th":[{pattern:/(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,lookbehind:!0,inside:{number:/[\dn]+/,operator:/[+-]/}},{pattern:/(\(\s*)(?:even|odd)(?=\s*\))/i,lookbehind:!0}],combinator:/>|\+|~|\|\|/,punctuation:/[(),]/}},e.languages.css.atrule.inside["selector-function-argument"].inside=t,e.languages.insertBefore("css","property",{variable:{pattern:/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,lookbehind:!0}});var r={pattern:/(\b\d+)(?:%|[a-z]+(?![\w-]))/,lookbehind:!0},o={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0};e.languages.insertBefore("css","function",{operator:{pattern:/(\s)[+\-*\/](?=\s)/,lookbehind:!0},hexcode:{pattern:/\B#[\da-f]{3,8}\b/i,alias:"color"},color:[{pattern:/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,lookbehind:!0},{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:r,number:o,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:r,number:o})}(iR),iR.languages.javascript=iR.languages.extend("clike",{"class-name":[iR.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),iR.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,iR.languages.insertBefore("javascript","keyword",{regex:{pattern:/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)\/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/,lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:iR.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:iR.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:iR.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:iR.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:iR.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),iR.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:iR.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),iR.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),iR.languages.markup&&(iR.languages.markup.tag.addInlined("script","javascript"),iR.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),iR.languages.js=iR.languages.javascript,function(e){var t=/#(?!\{).+/,n={pattern:/#\{[^}]+\}/,alias:"variable"};e.languages.coffeescript=e.languages.extend("javascript",{comment:t,string:[{pattern:/'(?:\\[\s\S]|[^\\'])*'/,greedy:!0},{pattern:/"(?:\\[\s\S]|[^\\"])*"/,greedy:!0,inside:{interpolation:n}}],keyword:/\b(?:and|break|by|catch|class|continue|debugger|delete|do|each|else|extend|extends|false|finally|for|if|in|instanceof|is|isnt|let|loop|namespace|new|no|not|null|of|off|on|or|own|return|super|switch|then|this|throw|true|try|typeof|undefined|unless|until|when|while|window|with|yes|yield)\b/,"class-member":{pattern:/@(?!\d)\w+/,alias:"variable"}}),e.languages.insertBefore("coffeescript","comment",{"multiline-comment":{pattern:/###[\s\S]+?###/,alias:"comment"},"block-regex":{pattern:/\/{3}[\s\S]*?\/{3}/,alias:"regex",inside:{comment:t,interpolation:n}}}),e.languages.insertBefore("coffeescript","string",{"inline-javascript":{pattern:/`(?:\\[\s\S]|[^\\`])*`/,inside:{delimiter:{pattern:/^`|`$/,alias:"punctuation"},script:{pattern:/[\s\S]+/,alias:"language-javascript",inside:e.languages.javascript}}},"multiline-string":[{pattern:/'''[\s\S]*?'''/,greedy:!0,alias:"string"},{pattern:/"""[\s\S]*?"""/,greedy:!0,alias:"string",inside:{interpolation:n}}]}),e.languages.insertBefore("coffeescript","keyword",{property:/(?!\d)\w+(?=\s*:(?!:))/}),delete e.languages.coffeescript["template-string"],e.languages.coffee=e.languages.coffeescript}(iR),function(e){var t=/[*&][^\s[\]{},]+/,n=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,r="(?:"+n.source+"(?:[ \t]+"+t.source+")?|"+t.source+"(?:[ \t]+"+n.source+")?)",o=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-])(?:[ \t]*(?:(?![#:])|:))*/.source.replace(//g,(function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source})),a=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function i(e,t){t=(t||"").replace(/m/g,"")+"m";var n=/([:\-,[{]\s*(?:\s<>[ \t]+)?)(?:<>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return e}));return RegExp(n,t)}e.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<>/g,(function(){return r}))),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<>[ \t]+)?)<>(?=\s*:\s)/.source.replace(/<>/g,(function(){return r})).replace(/<>/g,(function(){return"(?:"+o+"|"+a+")"}))),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:i(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:i(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:i(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:i(a),lookbehind:!0,greedy:!0},number:{pattern:i(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:n,important:t,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},e.languages.yml=e.languages.yaml}(iR),function(e){var t=/(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source;function n(e){return e=e.replace(//g,(function(){return t})),RegExp(/((?:^|[^\\])(?:\\{2})*)/.source+"(?:"+e+")")}var r=/(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/.source,o=/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(/__/g,(function(){return r})),a=/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/.source;e.languages.markdown=e.languages.extend("markup",{}),e.languages.insertBefore("markdown","prolog",{"front-matter-block":{pattern:/(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,lookbehind:!0,greedy:!0,inside:{punctuation:/^---|---$/,"front-matter":{pattern:/\S+(?:\s+\S+)*/,alias:["yaml","language-yaml"],inside:e.languages.yaml}}},blockquote:{pattern:/^>(?:[\t ]*>)*/m,alias:"punctuation"},table:{pattern:RegExp("^"+o+a+"(?:"+o+")*","m"),inside:{"table-data-rows":{pattern:RegExp("^("+o+a+")(?:"+o+")*$"),lookbehind:!0,inside:{"table-data":{pattern:RegExp(r),inside:e.languages.markdown},punctuation:/\|/}},"table-line":{pattern:RegExp("^("+o+")"+a+"$"),lookbehind:!0,inside:{punctuation:/\||:?-{3,}:?/}},"table-header-row":{pattern:RegExp("^"+o+"$"),inside:{"table-header":{pattern:RegExp(r),alias:"important",inside:e.languages.markdown},punctuation:/\|/}}}},code:[{pattern:/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,lookbehind:!0,alias:"keyword"},{pattern:/^```[\s\S]*?^```$/m,greedy:!0,inside:{"code-block":{pattern:/^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,lookbehind:!0},"code-language":{pattern:/^(```).+/,lookbehind:!0},punctuation:/```/}}],title:[{pattern:/\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,alias:"important",inside:{punctuation:/==+$|--+$/}},{pattern:/(^\s*)#.+/m,lookbehind:!0,alias:"important",inside:{punctuation:/^#+|#+$/}}],hr:{pattern:/(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,lookbehind:!0,alias:"punctuation"},list:{pattern:/(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,lookbehind:!0,alias:"punctuation"},"url-reference":{pattern:/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,inside:{variable:{pattern:/^(!?\[)[^\]]+/,lookbehind:!0},string:/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,punctuation:/^[\[\]!:]|[<>]/},alias:"url"},bold:{pattern:n(/\b__(?:(?!_)|_(?:(?!_))+_)+__\b|\*\*(?:(?!\*)|\*(?:(?!\*))+\*)+\*\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^..)[\s\S]+(?=..$)/,lookbehind:!0,inside:{}},punctuation:/\*\*|__/}},italic:{pattern:n(/\b_(?:(?!_)|__(?:(?!_))+__)+_\b|\*(?:(?!\*)|\*\*(?:(?!\*))+\*\*)+\*/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^.)[\s\S]+(?=.$)/,lookbehind:!0,inside:{}},punctuation:/[*_]/}},strike:{pattern:n(/(~~?)(?:(?!~))+\2/.source),lookbehind:!0,greedy:!0,inside:{content:{pattern:/(^~~?)[\s\S]+(?=\1$)/,lookbehind:!0,inside:{}},punctuation:/~~?/}},"code-snippet":{pattern:/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,lookbehind:!0,greedy:!0,alias:["code","keyword"]},url:{pattern:n(/!?\[(?:(?!\]))+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\]))+\])/.source),lookbehind:!0,greedy:!0,inside:{operator:/^!/,content:{pattern:/(^\[)[^\]]+(?=\])/,lookbehind:!0,inside:{}},variable:{pattern:/(^\][ \t]?\[)[^\]]+(?=\]$)/,lookbehind:!0},url:{pattern:/(^\]\()[^\s)]+/,lookbehind:!0},string:{pattern:/(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,lookbehind:!0}}}}),["url","bold","italic","strike"].forEach((function(t){["url","bold","italic","strike","code-snippet"].forEach((function(n){t!==n&&(e.languages.markdown[t].inside.content.inside[n]=e.languages.markdown[n])}))})),e.hooks.add("after-tokenize",(function(e){"markdown"!==e.language&&"md"!==e.language||function e(t){if(t&&"string"!==typeof t)for(var n=0,r=t.length;n",quot:'"'},s=String.fromCodePoint||String.fromCharCode;e.languages.md=e.languages.markdown}(iR),iR.languages.graphql={comment:/#.*/,description:{pattern:/(?:"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*")(?=\s*[a-z_])/i,greedy:!0,alias:"string",inside:{"language-markdown":{pattern:/(^"(?:"")?)(?!\1)[\s\S]+(?=\1$)/,lookbehind:!0,inside:iR.languages.markdown}}},string:{pattern:/"""(?:[^"]|(?!""")")*"""|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},number:/(?:\B-|\b)\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,boolean:/\b(?:false|true)\b/,variable:/\$[a-z_]\w*/i,directive:{pattern:/@[a-z_]\w*/i,alias:"function"},"attr-name":{pattern:/\b[a-z_]\w*(?=\s*(?:\((?:[^()"]|"(?:\\.|[^\\"\r\n])*")*\))?:)/i,greedy:!0},"atom-input":{pattern:/\b[A-Z]\w*Input\b/,alias:"class-name"},scalar:/\b(?:Boolean|Float|ID|Int|String)\b/,constant:/\b[A-Z][A-Z_\d]*\b/,"class-name":{pattern:/(\b(?:enum|implements|interface|on|scalar|type|union)\s+|&\s*|:\s*|\[)[A-Z_]\w*/,lookbehind:!0},fragment:{pattern:/(\bfragment\s+|\.{3}\s*(?!on\b))[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-mutation":{pattern:/(\bmutation\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},"definition-query":{pattern:/(\bquery\s+)[a-zA-Z_]\w*/,lookbehind:!0,alias:"function"},keyword:/\b(?:directive|enum|extend|fragment|implements|input|interface|mutation|on|query|repeatable|scalar|schema|subscription|type|union)\b/,operator:/[!=|&]|\.{3}/,"property-query":/\w+(?=\s*\()/,object:/\w+(?=\s*\{)/,punctuation:/[!(){}\[\]:=,]/,property:/\w+/},iR.hooks.add("after-tokenize",(function(e){if("graphql"===e.language)for(var t=e.tokens.filter((function(e){return"string"!==typeof e&&"comment"!==e.type&&"scalar"!==e.type})),n=0;n0)){var l=f(/^\{$/,/^\}$/);if(-1===l)continue;for(var s=n;s=0&&p(c,"variable-input")}}}}function u(e){return t[n+e]}function d(e,t){t=t||0;for(var n=0;n?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i,punctuation:/[;[\]()`,.]/},function(e){var t=e.languages.javascript["template-string"],n=t.pattern.source,r=t.inside.interpolation,o=r.inside["interpolation-punctuation"],a=r.pattern.source;function i(t,r){if(e.languages[t])return{pattern:RegExp("((?:"+r+")\\s*)"+n),lookbehind:!0,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},"embedded-code":{pattern:/[\s\S]+/,alias:t}}}}function l(e,t){return"___"+t.toUpperCase()+"_"+e+"___"}function s(t,n,r){var o={code:t,grammar:n,language:r};return e.hooks.run("before-tokenize",o),o.tokens=e.tokenize(o.code,o.grammar),e.hooks.run("after-tokenize",o),o.tokens}function c(t){var n={};n["interpolation-punctuation"]=o;var a=e.tokenize(t,n);if(3===a.length){var i=[1,1];i.push.apply(i,s(a[1],e.languages.javascript,"javascript")),a.splice.apply(a,i)}return new e.Token("interpolation",a,r.alias,t)}function u(t,n,r){var o=e.tokenize(t,{interpolation:{pattern:RegExp(a),lookbehind:!0}}),i=0,u={},d=o.map((function(e){if("string"===typeof e)return e;for(var n,o=e.content;-1!==t.indexOf(n=l(i++,r)););return u[n]=o,n})).join(""),f=s(d,n,r),p=Object.keys(u);return i=0,function e(t){for(var n=0;n=p.length)return;var r=t[n];if("string"===typeof r||"string"===typeof r.content){var o=p[i],a="string"===typeof r?r:r.content,l=a.indexOf(o);if(-1!==l){++i;var s=a.substring(0,l),d=c(u[o]),f=a.substring(l+o.length),m=[];if(s&&m.push(s),m.push(d),f){var h=[f];e(h),m.push.apply(m,h)}"string"===typeof r?(t.splice.apply(t,[n,1].concat(m)),n+=m.length-1):r.content=m}}else{var g=r.content;Array.isArray(g)?e(g):e([g])}}}(f),new e.Token(r,f,"language-"+r,t)}e.languages.javascript["template-string"]=[i("css",/\b(?:styled(?:\([^)]*\))?(?:\s*\.\s*\w+(?:\([^)]*\))*)*|css(?:\s*\.\s*(?:global|resolve))?|createGlobalStyle|keyframes)/.source),i("html",/\bhtml|\.\s*(?:inner|outer)HTML\s*\+?=/.source),i("svg",/\bsvg/.source),i("markdown",/\b(?:markdown|md)/.source),i("graphql",/\b(?:gql|graphql(?:\s*\.\s*experimental)?)/.source),i("sql",/\bsql/.source),t].filter(Boolean);var d={javascript:!0,js:!0,typescript:!0,ts:!0,jsx:!0,tsx:!0};function f(e){return"string"===typeof e?e:Array.isArray(e)?e.map(f).join(""):f(e.content)}e.hooks.add("after-tokenize",(function(t){t.language in d&&function t(n){for(var r=0,o=n.length;r]|<(?:[^<>]|<[^<>]*>)*>)*>)?/,lookbehind:!0,greedy:!0,inside:null},builtin:/\b(?:Array|Function|Promise|any|boolean|console|never|number|string|symbol|unknown)\b/}),e.languages.typescript.keyword.push(/\b(?:abstract|declare|is|keyof|readonly|require)\b/,/\b(?:asserts|infer|interface|module|namespace|type)\b(?=\s*(?:[{_$a-zA-Z\xA0-\uFFFF]|$))/,/\btype\b(?=\s*(?:[\{*]|$))/),delete e.languages.typescript.parameter,delete e.languages.typescript["literal-property"];var t=e.languages.extend("typescript",{});delete t["class-name"],e.languages.typescript["class-name"].inside=t,e.languages.insertBefore("typescript","function",{decorator:{pattern:/@[$\w\xA0-\uFFFF]+/,inside:{at:{pattern:/^@/,alias:"operator"},function:/^[\s\S]+/}},"generic-function":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>(?=\s*\()/,greedy:!0,inside:{function:/^#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/,generic:{pattern:/<[\s\S]+/,alias:"class-name",inside:t}}}}),e.languages.ts=e.languages.typescript}(iR),function(e){function t(e,t){return RegExp(e.replace(//g,(function(){return/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*/.source})),t)}e.languages.insertBefore("javascript","function-variable",{"method-variable":{pattern:RegExp("(\\.\\s*)"+e.languages.javascript["function-variable"].pattern.source),lookbehind:!0,alias:["function-variable","method","function","property-access"]}}),e.languages.insertBefore("javascript","function",{method:{pattern:RegExp("(\\.\\s*)"+e.languages.javascript.function.source),lookbehind:!0,alias:["function","property-access"]}}),e.languages.insertBefore("javascript","constant",{"known-class-name":[{pattern:/\b(?:(?:Float(?:32|64)|(?:Int|Uint)(?:8|16|32)|Uint8Clamped)?Array|ArrayBuffer|BigInt|Boolean|DataView|Date|Error|Function|Intl|JSON|(?:Weak)?(?:Map|Set)|Math|Number|Object|Promise|Proxy|Reflect|RegExp|String|Symbol|WebAssembly)\b/,alias:"class-name"},{pattern:/\b(?:[A-Z]\w*)Error\b/,alias:"class-name"}]}),e.languages.insertBefore("javascript","keyword",{imports:{pattern:t(/(\bimport\b\s*)(?:(?:\s*,\s*(?:\*\s*as\s+|\{[^{}]*\}))?|\*\s*as\s+|\{[^{}]*\})(?=\s*\bfrom\b)/.source),lookbehind:!0,inside:e.languages.javascript},exports:{pattern:t(/(\bexport\b\s*)(?:\*(?:\s*as\s+)?(?=\s*\bfrom\b)|\{[^{}]*\})/.source),lookbehind:!0,inside:e.languages.javascript}}),e.languages.javascript.keyword.unshift({pattern:/\b(?:as|default|export|from|import)\b/,alias:"module"},{pattern:/\b(?:await|break|catch|continue|do|else|finally|for|if|return|switch|throw|try|while|yield)\b/,alias:"control-flow"},{pattern:/\bnull\b/,alias:["null","nil"]},{pattern:/\bundefined\b/,alias:"nil"}),e.languages.insertBefore("javascript","operator",{spread:{pattern:/\.{3}/,alias:"operator"},arrow:{pattern:/=>/,alias:"operator"}}),e.languages.insertBefore("javascript","punctuation",{"property-access":{pattern:t(/(\.\s*)#?/.source),lookbehind:!0},"maybe-class-name":{pattern:/(^|[^$\w\xA0-\uFFFF])[A-Z][$\w\xA0-\uFFFF]+/,lookbehind:!0},dom:{pattern:/\b(?:document|(?:local|session)Storage|location|navigator|performance|window)\b/,alias:"variable"},console:{pattern:/\bconsole(?=\s*\.)/,alias:"class-name"}});for(var n=["function","function-variable","method","method-variable","property-access"],r=0;r*\.{3}(?:[^{}]|)*\})/.source;function a(e,t){return e=e.replace(//g,(function(){return n})).replace(//g,(function(){return r})).replace(//g,(function(){return o})),RegExp(e,t)}o=a(o).source,e.languages.jsx=e.languages.extend("markup",t),e.languages.jsx.tag.pattern=a(/<\/?(?:[\w.:-]+(?:+(?:[\w.:$-]+(?:=(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s{'"/>=]+|))?|))**\/?)?>/.source),e.languages.jsx.tag.inside.tag.pattern=/^<\/?[^\s>\/]*/,e.languages.jsx.tag.inside["attr-value"].pattern=/=(?!\{)(?:"(?:\\[\s\S]|[^\\"])*"|'(?:\\[\s\S]|[^\\'])*'|[^\s'">]+)/,e.languages.jsx.tag.inside.tag.inside["class-name"]=/^[A-Z]\w*(?:\.[A-Z]\w*)*$/,e.languages.jsx.tag.inside.comment=t.comment,e.languages.insertBefore("inside","attr-name",{spread:{pattern:a(//.source),inside:e.languages.jsx}},e.languages.jsx.tag),e.languages.insertBefore("inside","special-attr",{script:{pattern:a(/=/.source),alias:"language-javascript",inside:{"script-punctuation":{pattern:/^=(?=\{)/,alias:"punctuation"},rest:e.languages.jsx}}},e.languages.jsx.tag);var i=function(e){return e?"string"===typeof e?e:"string"===typeof e.content?e.content:e.content.map(i).join(""):""},l=function(t){for(var n=[],r=0;r0&&n[n.length-1].tagName===i(o.content[0].content[1])&&n.pop():"/>"===o.content[o.content.length-1].content||n.push({tagName:i(o.content[0].content[1]),openedBraces:0}):n.length>0&&"punctuation"===o.type&&"{"===o.content?n[n.length-1].openedBraces++:n.length>0&&n[n.length-1].openedBraces>0&&"punctuation"===o.type&&"}"===o.content?n[n.length-1].openedBraces--:a=!0),(a||"string"===typeof o)&&n.length>0&&0===n[n.length-1].openedBraces){var s=i(o);r0&&("string"===typeof t[r-1]||"plain-text"===t[r-1].type)&&(s=i(t[r-1])+s,t.splice(r-1,1),r--),t[r]=new e.Token("plain-text",s,null,s)}o.content&&"string"!==typeof o.content&&l(o.content)}};e.hooks.add("after-tokenize",(function(e){"jsx"!==e.language&&"tsx"!==e.language||l(e.tokens)}))}(iR),function(e){e.languages.diff={coord:[/^(?:\*{3}|-{3}|\+{3}).*$/m,/^@@.*@@$/m,/^\d.*$/m]};var t={"deleted-sign":"-","deleted-arrow":"<","inserted-sign":"+","inserted-arrow":">",unchanged:" ",diff:"!"};Object.keys(t).forEach((function(n){var r=t[n],o=[];/^\w+$/.test(n)||o.push(/\w+/.exec(n)[0]),"diff"===n&&o.push("bold"),e.languages.diff[n]={pattern:RegExp("^(?:["+r+"].*(?:\r\n?|\n|(?![\\s\\S])))+","m"),alias:o,inside:{line:{pattern:/(.)(?=[\s\S]).*(?:\r\n?|\n)?/,lookbehind:!0},prefix:{pattern:/[\s\S]/,alias:/\w+/.exec(n)[0]}}}})),Object.defineProperty(e.languages.diff,"PREFIXES",{value:t})}(iR),iR.languages.git={comment:/^#.*/m,deleted:/^[-\u2013].*/m,inserted:/^\+.*/m,string:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,command:{pattern:/^.*\$ git .*$/m,inside:{parameter:/\s--?\w+/}},coord:/^@@.*@@$/m,"commit-sha1":/^commit \w{40}$/m},iR.languages.go=iR.languages.extend("clike",{string:{pattern:/(^|[^\\])"(?:\\.|[^"\\\r\n])*"|`[^`]*`/,lookbehind:!0,greedy:!0},keyword:/\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go(?:to)?|if|import|interface|map|package|range|return|select|struct|switch|type|var)\b/,boolean:/\b(?:_|false|iota|nil|true)\b/,number:[/\b0(?:b[01_]+|o[0-7_]+)i?\b/i,/\b0x(?:[a-f\d_]+(?:\.[a-f\d_]*)?|\.[a-f\d_]+)(?:p[+-]?\d+(?:_\d+)*)?i?(?!\w)/i,/(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?[\d_]+)?i?(?!\w)/i],operator:/[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./,builtin:/\b(?:append|bool|byte|cap|close|complex|complex(?:64|128)|copy|delete|error|float(?:32|64)|u?int(?:8|16|32|64)?|imag|len|make|new|panic|print(?:ln)?|real|recover|rune|string|uintptr)\b/}),iR.languages.insertBefore("go","string",{char:{pattern:/'(?:\\.|[^'\\\r\n]){0,10}'/,greedy:!0}}),delete iR.languages.go["class-name"],function(e){function t(e,t){return"___"+e.toUpperCase()+t+"___"}Object.defineProperties(e.languages["markup-templating"]={},{buildPlaceholders:{value:function(n,r,o,a){if(n.language===r){var i=n.tokenStack=[];n.code=n.code.replace(o,(function(e){if("function"===typeof a&&!a(e))return e;for(var o,l=i.length;-1!==n.code.indexOf(o=t(r,l));)++l;return i[l]=e,o})),n.grammar=e.languages.markup}}},tokenizePlaceholders:{value:function(n,r){if(n.language===r&&n.tokenStack){n.grammar=e.languages[r];var o=0,a=Object.keys(n.tokenStack);!function i(l){for(var s=0;s=a.length);s++){var c=l[s];if("string"===typeof c||c.content&&"string"===typeof c.content){var u=a[o],d=n.tokenStack[u],f="string"===typeof c?c:c.content,p=t(r,u),m=f.indexOf(p);if(m>-1){++o;var h=f.substring(0,m),g=new e.Token(r,e.tokenize(d,n.grammar),"language-"+r,d),y=f.substring(m+p.length),v=[];h&&v.push.apply(v,i([h])),v.push(g),y&&v.push.apply(v,i([y])),"string"===typeof c?l.splice.apply(l,[s,1].concat(v)):c.content=v}}else c.content&&i(c.content)}return l}(n.tokens)}}}})}(iR),function(e){e.languages.handlebars={comment:/\{\{![\s\S]*?\}\}/,delimiter:{pattern:/^\{\{\{?|\}\}\}?$/,alias:"punctuation"},string:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,number:/\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee][+-]?\d+)?/,boolean:/\b(?:false|true)\b/,block:{pattern:/^(\s*(?:~\s*)?)[#\/]\S+?(?=\s*(?:~\s*)?$|\s)/,lookbehind:!0,alias:"keyword"},brackets:{pattern:/\[[^\]]+\]/,inside:{punctuation:/\[|\]/,variable:/[\s\S]+/}},punctuation:/[!"#%&':()*+,.\/;<=>@\[\\\]^`{|}~]/,variable:/[^!"#%&'()*+,\/;<=>@\[\\\]^`{|}~\s]+/},e.hooks.add("before-tokenize",(function(t){e.languages["markup-templating"].buildPlaceholders(t,"handlebars",/\{\{\{[\s\S]+?\}\}\}|\{\{[\s\S]+?\}\}/g)})),e.hooks.add("after-tokenize",(function(t){e.languages["markup-templating"].tokenizePlaceholders(t,"handlebars")})),e.languages.hbs=e.languages.handlebars}(iR),iR.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}},iR.languages.webmanifest=iR.languages.json,iR.languages.less=iR.languages.extend("css",{comment:[/\/\*[\s\S]*?\*\//,{pattern:/(^|[^\\])\/\/.*/,lookbehind:!0}],atrule:{pattern:/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{punctuation:/[:()]/}},selector:{pattern:/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,inside:{variable:/@+[\w-]+/}},property:/(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,operator:/[+\-*\/]/}),iR.languages.insertBefore("less","property",{variable:[{pattern:/@[\w-]+\s*:/,inside:{punctuation:/:/}},/@@?[\w-]+/],"mixin-usage":{pattern:/([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,lookbehind:!0,alias:"function"}}),iR.languages.makefile={comment:{pattern:/(^|[^\\])#(?:\\(?:\r\n|[\s\S])|[^\\\r\n])*/,lookbehind:!0},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"builtin-target":{pattern:/\.[A-Z][^:#=\s]+(?=\s*:(?!=))/,alias:"builtin"},target:{pattern:/^(?:[^:=\s]|[ \t]+(?![\s:]))+(?=\s*:(?!=))/m,alias:"symbol",inside:{variable:/\$+(?:(?!\$)[^(){}:#=\s]+|(?=[({]))/}},variable:/\$+(?:(?!\$)[^(){}:#=\s]+|\([@*%<^+?][DF]\)|(?=[({]))/,keyword:/-include\b|\b(?:define|else|endef|endif|export|ifn?def|ifn?eq|include|override|private|sinclude|undefine|unexport|vpath)\b/,function:{pattern:/(\()(?:abspath|addsuffix|and|basename|call|dir|error|eval|file|filter(?:-out)?|findstring|firstword|flavor|foreach|guile|if|info|join|lastword|load|notdir|or|origin|patsubst|realpath|shell|sort|strip|subst|suffix|value|warning|wildcard|word(?:list|s)?)(?=[ \t])/,lookbehind:!0},operator:/(?:::|[?:+!])?=|[|@]/,punctuation:/[:;(){}]/},iR.languages.objectivec=iR.languages.extend("c",{string:{pattern:/@?"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},keyword:/\b(?:asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|in|inline|int|long|register|return|self|short|signed|sizeof|static|struct|super|switch|typedef|typeof|union|unsigned|void|volatile|while)\b|(?:@interface|@end|@implementation|@protocol|@class|@public|@protected|@private|@property|@try|@catch|@finally|@throw|@synthesize|@dynamic|@selector)\b/,operator:/-[->]?|\+\+?|!=?|<=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/@]/}),delete iR.languages.objectivec["class-name"],iR.languages.objc=iR.languages.objectivec,iR.languages.ocaml={comment:{pattern:/\(\*[\s\S]*?\*\)/,greedy:!0},char:{pattern:/'(?:[^\\\r\n']|\\(?:.|[ox]?[0-9a-f]{1,3}))'/i,greedy:!0},string:[{pattern:/"(?:\\(?:[\s\S]|\r\n)|[^\\\r\n"])*"/,greedy:!0},{pattern:/\{([a-z_]*)\|[\s\S]*?\|\1\}/,greedy:!0}],number:[/\b(?:0b[01][01_]*|0o[0-7][0-7_]*)\b/i,/\b0x[a-f0-9][a-f0-9_]*(?:\.[a-f0-9_]*)?(?:p[+-]?\d[\d_]*)?(?!\w)/i,/\b\d[\d_]*(?:\.[\d_]*)?(?:e[+-]?\d[\d_]*)?(?!\w)/i],directive:{pattern:/\B#\w+/,alias:"property"},label:{pattern:/\B~\w+/,alias:"property"},"type-variable":{pattern:/\B'\w+/,alias:"function"},variant:{pattern:/`\w+/,alias:"symbol"},keyword:/\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|nonrec|object|of|open|private|rec|sig|struct|then|to|try|type|val|value|virtual|when|where|while|with)\b/,boolean:/\b(?:false|true)\b/,"operator-like-punctuation":{pattern:/\[[<>|]|[>|]\]|\{<|>\}/,alias:"punctuation"},operator:/\.[.~]|:[=>]|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lsl|lsr|lxor|mod|or)\b/,punctuation:/;;|::|[(){}\[\].,:;#]|\b_\b/},iR.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0,greedy:!0},"string-interpolation":{pattern:/(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,lookbehind:!0,inside:{"format-spec":{pattern:/(:)[^:(){}]+(?=\}$)/,lookbehind:!0},"conversion-option":{pattern://,alias:"punctuation"},rest:null}},string:/[\s\S]+/}},"triple-quoted-string":{pattern:/(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,greedy:!0,alias:"string"},string:{pattern:/(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,greedy:!0},function:{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},decorator:{pattern:/(^[\t ]*)@\w+(?:\.\w+)*/m,lookbehind:!0,alias:["annotation","punctuation"],inside:{punctuation:/\./}},keyword:/\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,boolean:/\b(?:False|None|True)\b/,number:/\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,operator:/[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,punctuation:/[{}[\];(),.:]/},iR.languages.python["string-interpolation"].inside.interpolation.inside.rest=iR.languages.python,iR.languages.py=iR.languages.python,iR.languages.reason=iR.languages.extend("clike",{string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},"class-name":/\b[A-Z]\w*/,keyword:/\b(?:and|as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|method|module|mutable|new|nonrec|object|of|open|or|private|rec|sig|struct|switch|then|to|try|type|val|virtual|when|while|with)\b/,operator:/\.{3}|:[:=]|\|>|->|=(?:==?|>)?|<=?|>=?|[|^?'#!~`]|[+\-*\/]\.?|\b(?:asr|land|lor|lsl|lsr|lxor|mod)\b/}),iR.languages.insertBefore("reason","class-name",{char:{pattern:/'(?:\\x[\da-f]{2}|\\o[0-3][0-7][0-7]|\\\d{3}|\\.|[^'\\\r\n])'/,greedy:!0},constructor:/\b[A-Z]\w*\b(?!\s*\.)/,label:{pattern:/\b[a-z]\w*(?=::)/,alias:"symbol"}}),delete iR.languages.reason.function,function(e){e.languages.sass=e.languages.extend("css",{comment:{pattern:/^([ \t]*)\/[\/*].*(?:(?:\r?\n|\r)\1[ \t].+)*/m,lookbehind:!0,greedy:!0}}),e.languages.insertBefore("sass","atrule",{"atrule-line":{pattern:/^(?:[ \t]*)[@+=].+/m,greedy:!0,inside:{atrule:/(?:@[\w-]+|[+=])/}}}),delete e.languages.sass.atrule;var t=/\$[-\w]+|#\{\$[-\w]+\}/,n=[/[+*\/%]|[=!]=|<=?|>=?|\b(?:and|not|or)\b/,{pattern:/(\s)-(?=\s)/,lookbehind:!0}];e.languages.insertBefore("sass","property",{"variable-line":{pattern:/^[ \t]*\$.+/m,greedy:!0,inside:{punctuation:/:/,variable:t,operator:n}},"property-line":{pattern:/^[ \t]*(?:[^:\s]+ *:.*|:[^:\s].*)/m,greedy:!0,inside:{property:[/[^:\s]+(?=\s*:)/,{pattern:/(:)[^:\s]+/,lookbehind:!0}],punctuation:/:/,variable:t,operator:n,important:e.languages.sass.important}}}),delete e.languages.sass.property,delete e.languages.sass.important,e.languages.insertBefore("sass","punctuation",{selector:{pattern:/^([ \t]*)\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*(?:,(?:\r?\n|\r)\1[ \t]+\S(?:,[^,\r\n]+|[^,\r\n]*)(?:,[^,\r\n]+)*)*/m,lookbehind:!0,greedy:!0}})}(iR),iR.languages.scss=iR.languages.extend("css",{comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},atrule:{pattern:/@[\w-](?:\([^()]+\)|[^()\s]|\s+(?!\s))*?(?=\s+[{;])/,inside:{rule:/@[\w-]+/}},url:/(?:[-a-z]+-)?url(?=\()/i,selector:{pattern:/(?=\S)[^@;{}()]?(?:[^@;{}()\s]|\s+(?!\s)|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}][^:{}]*[:{][^}]))/,inside:{parent:{pattern:/&/,alias:"important"},placeholder:/%[-\w]+/,variable:/\$[-\w]+|#\{\$[-\w]+\}/}},property:{pattern:/(?:[-\w]|\$[-\w]|#\{\$[-\w]+\})+(?=\s*:)/,inside:{variable:/\$[-\w]+|#\{\$[-\w]+\}/}}}),iR.languages.insertBefore("scss","atrule",{keyword:[/@(?:content|debug|each|else(?: if)?|extend|for|forward|function|if|import|include|mixin|return|use|warn|while)\b/i,{pattern:/( )(?:from|through)(?= )/,lookbehind:!0}]}),iR.languages.insertBefore("scss","important",{variable:/\$[-\w]+|#\{\$[-\w]+\}/}),iR.languages.insertBefore("scss","function",{"module-modifier":{pattern:/\b(?:as|hide|show|with)\b/i,alias:"keyword"},placeholder:{pattern:/%[-\w]+/,alias:"selector"},statement:{pattern:/\B!(?:default|optional)\b/i,alias:"keyword"},boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"},operator:{pattern:/(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|not|or)(?=\s)/,lookbehind:!0}}),iR.languages.scss.atrule.inside.rest=iR.languages.scss,function(e){var t={pattern:/(\b\d+)(?:%|[a-z]+)/,lookbehind:!0},n={pattern:/(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,lookbehind:!0},r={comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0},url:{pattern:/\burl\((["']?).*?\1\)/i,greedy:!0},string:{pattern:/("|')(?:(?!\1)[^\\\r\n]|\\(?:\r\n|[\s\S]))*\1/,greedy:!0},interpolation:null,func:null,important:/\B!(?:important|optional)\b/i,keyword:{pattern:/(^|\s+)(?:(?:else|for|if|return|unless)(?=\s|$)|@[\w-]+)/,lookbehind:!0},hexcode:/#[\da-f]{3,6}/i,color:[/\b(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)\b/i,{pattern:/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,inside:{unit:t,number:n,function:/[\w-]+(?=\()/,punctuation:/[(),]/}}],entity:/\\[\da-f]{1,8}/i,unit:t,boolean:/\b(?:false|true)\b/,operator:[/~|[+!\/%<>?=]=?|[-:]=|\*[*=]?|\.{2,3}|&&|\|\||\B-\B|\b(?:and|in|is(?: a| defined| not|nt)?|not|or)\b/],number:n,punctuation:/[{}()\[\];:,]/};r.interpolation={pattern:/\{[^\r\n}:]+\}/,alias:"variable",inside:{delimiter:{pattern:/^\{|\}$/,alias:"punctuation"},rest:r}},r.func={pattern:/[\w-]+\([^)]*\).*/,inside:{function:/^[^(]+/,rest:r}},e.languages.stylus={"atrule-declaration":{pattern:/(^[ \t]*)@.+/m,lookbehind:!0,inside:{atrule:/^@[\w-]+/,rest:r}},"variable-declaration":{pattern:/(^[ \t]*)[\w$-]+\s*.?=[ \t]*(?:\{[^{}]*\}|\S.*|$)/m,lookbehind:!0,inside:{variable:/^\S+/,rest:r}},statement:{pattern:/(^[ \t]*)(?:else|for|if|return|unless)[ \t].+/m,lookbehind:!0,inside:{keyword:/^\S+/,rest:r}},"property-declaration":{pattern:/((?:^|\{)([ \t]*))(?:[\w-]|\{[^}\r\n]+\})+(?:\s*:\s*|[ \t]+)(?!\s)[^{\r\n]*(?:;|[^{\r\n,]$(?!(?:\r?\n|\r)(?:\{|\2[ \t])))/m,lookbehind:!0,inside:{property:{pattern:/^[^\s:]+/,inside:{interpolation:r.interpolation}},rest:r}},selector:{pattern:/(^[ \t]*)(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)(?:(?:\r?\n|\r)(?:\1(?:(?=\S)(?:[^{}\r\n:()]|::?[\w-]+(?:\([^)\r\n]*\)|(?![\w-]))|\{[^}\r\n]+\})+)))*(?:,$|\{|(?=(?:\r?\n|\r)(?:\{|\1[ \t])))/m,lookbehind:!0,inside:{interpolation:r.interpolation,comment:r.comment,punctuation:/[{},]/}},func:r.func,string:r.string,comment:{pattern:/(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/,lookbehind:!0,greedy:!0},interpolation:r.interpolation,punctuation:/[{}()\[\];:.]/}}(iR),function(e){var t=e.util.clone(e.languages.typescript);e.languages.tsx=e.languages.extend("jsx",t),delete e.languages.tsx.parameter,delete e.languages.tsx["literal-property"];var n=e.languages.tsx.tag;n.pattern=RegExp(/(^|[^\w$]|(?=<\/))/.source+"(?:"+n.pattern.source+")",n.pattern.flags),n.lookbehind=!0}(iR),iR.languages.wasm={comment:[/\(;[\s\S]*?;\)/,{pattern:/;;.*/,greedy:!0}],string:{pattern:/"(?:\\[\s\S]|[^"\\])*"/,greedy:!0},keyword:[{pattern:/\b(?:align|offset)=/,inside:{operator:/=/}},{pattern:/\b(?:(?:f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|neg?|nearest|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|sqrt|store(?:8|16|32)?|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))?|memory\.(?:grow|size))\b/,inside:{punctuation:/\./}},/\b(?:anyfunc|block|br(?:_if|_table)?|call(?:_indirect)?|data|drop|elem|else|end|export|func|get_(?:global|local)|global|if|import|local|loop|memory|module|mut|nop|offset|param|result|return|select|set_(?:global|local)|start|table|tee_local|then|type|unreachable)\b/],variable:/\$[\w!#$%&'*+\-./:<=>?@\\^`|~]+/,number:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/,punctuation:/[()]/};var lR={Prism:iR,theme:{plain:{backgroundColor:"#2a2734",color:"#9a86fd"},styles:[{types:["comment","prolog","doctype","cdata","punctuation"],style:{color:"#6c6783"}},{types:["namespace"],style:{opacity:.7}},{types:["tag","operator","number"],style:{color:"#e09142"}},{types:["property","function"],style:{color:"#9a86fd"}},{types:["tag-id","selector","atrule-id"],style:{color:"#eeebff"}},{types:["attr-name"],style:{color:"#c4b9fe"}},{types:["boolean","string","entity","url","attr-value","keyword","control","directive","unit","statement","regex","atrule","placeholder","variable"],style:{color:"#ffcc99"}},{types:["deleted"],style:{textDecorationLine:"line-through"}},{types:["inserted"],style:{textDecorationLine:"underline"}},{types:["italic"],style:{fontStyle:"italic"}},{types:["important","bold"],style:{fontWeight:"bold"}},{types:["important"],style:{color:"#c4b9fe"}}]}};function sR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function cR(){return cR=Object.assign||function(e){for(var t=1;t0&&e[n-1]===t?e:e.concat(t)};function pR(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&-1===t.indexOf(r)&&(n[r]=e[r]);return n}var mR=function(e){function t(){for(var t=this,n=[],r=arguments.length;r--;)n[r]=arguments[r];e.apply(this,n),sR(this,"getThemeDict",(function(e){if(void 0!==t.themeDict&&e.theme===t.prevTheme&&e.language===t.prevLanguage)return t.themeDict;t.prevTheme=e.theme,t.prevLanguage=e.language;var n=e.theme?function(e,t){var n=e.plain,r=Object.create(null),o=e.styles.reduce((function(e,n){var r=n.languages,o=n.style;return r&&!r.includes(t)||n.types.forEach((function(t){var n=cR({},e[t],o);e[t]=n})),e}),r);return o.root=n,o.plain=cR({},n,{backgroundColor:null}),o}(e.theme,e.language):void 0;return t.themeDict=n})),sR(this,"getLineProps",(function(e){var n=e.key,r=e.className,o=e.style,a=cR({},pR(e,["key","className","style","line"]),{className:"token-line",style:void 0,key:void 0}),i=t.getThemeDict(t.props);return void 0!==i&&(a.style=i.plain),void 0!==o&&(a.style=void 0!==a.style?cR({},a.style,o):o),void 0!==n&&(a.key=n),r&&(a.className+=" "+r),a})),sR(this,"getStyleForToken",(function(e){var n=e.types,r=e.empty,o=n.length,a=t.getThemeDict(t.props);if(void 0!==a){if(1===o&&"plain"===n[0])return r?{display:"inline-block"}:void 0;if(1===o&&!r)return a[n[0]];var i=r?{display:"inline-block"}:{},l=n.map((function(e){return a[e]}));return Object.assign.apply(Object,[i].concat(l))}})),sR(this,"getTokenProps",(function(e){var n=e.key,r=e.className,o=e.style,a=e.token,i=cR({},pR(e,["key","className","style","token"]),{className:"token "+a.types.join(" "),children:a.content,style:t.getStyleForToken(a),key:void 0});return void 0!==o&&(i.style=void 0!==i.style?cR({},i.style,o):o),void 0!==n&&(i.key=n),r&&(i.className+=" "+r),i})),sR(this,"tokenize",(function(e,t,n,r){var o={code:t,grammar:n,language:r,tokens:[]};e.hooks.run("before-tokenize",o);var a=o.tokens=e.tokenize(o.code,o.grammar,o.language);return e.hooks.run("after-tokenize",o),a}))}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.render=function(){var e=this.props,t=e.Prism,n=e.language,r=e.code,o=e.children,a=this.getThemeDict(this.props),i=t.languages[n],l=function(e){for(var t=[[]],n=[e],r=[0],o=[e.length],a=0,i=0,l=[],s=[l];i>-1;){for(;(a=r[i]++)0?u:["plain"],c=d):(u=fR(u,d.type),d.alias&&(u=fR(u,d.alias)),c=d.content),"string"===typeof c){var f=c.split(uR),p=f.length;l.push({types:u,content:f[0]});for(var m=1;m{let{colorScheme:n,native:r,maxLineSize:o,radius:a}=t;return{scrollArea:{},root:{position:"relative"},code:{boxSizing:"border-box",position:"relative",fontFamily:e.fontFamilyMonospace,lineHeight:1.7,fontSize:We(13),overflowX:r?"auto":void 0,borderRadius:e.fn.radius(a),padding:"".concat(e.spacing.sm," 0"),"&.mantine-Prism-code":{marginTop:0,marginBottom:0}},copy:{position:"absolute",top:e.spacing.xs,right:"ltr"===e.dir?e.spacing.xs:"unset",left:"rtl"===e.dir?e.spacing.xs:"unset",zIndex:2,"&, &:hover":{backgroundColor:"dark"===n?e.colors.dark[8]:e.colors.gray[0]}},line:{display:"flex",width:"100%",padding:"0 ".concat(e.spacing.md)},lineNumber:{color:"dark"===n?e.colors.dark[4]:e.colors.gray[4],textAlign:"right",width:"calc(8 * ".concat(We(o),")"),marginRight:"ltr"===e.dir?e.spacing.xs:void 0,marginLeft:"rtl"===e.dir?e.spacing.xs:void 0,userSelect:"none"},lineContent:{width:"100%"}}}));const vR=yR;var bR=Object.defineProperty,wR=Object.defineProperties,xR=Object.getOwnPropertyDescriptors,kR=Object.getOwnPropertySymbols,SR=Object.prototype.hasOwnProperty,OR=Object.prototype.propertyIsEnumerable,ER=(e,t,n)=>t in e?bR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,CR=(e,t)=>{for(var n in t||(t={}))SR.call(t,n)&&ER(e,n,t[n]);if(kR)for(var n of kR(t))OR.call(t,n)&&ER(e,n,t[n]);return e},_R=(e,t)=>wR(e,xR(t));const PR={noCopy:!1,copyLabel:"Copy code",copiedLabel:"Copied",withLineNumbers:!1,trim:!0,highlightLines:{},scrollAreaComponent:$k,getPrismTheme:(e,t)=>"dark"===t?(e=>({plain:{color:e.colors.gray[4],backgroundColor:e.colors.dark[8]},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted","selector","atrule"],style:{color:e.colors.teal[4]}},{types:["number"],style:{color:e.colors.blue[4]}},{types:["builtin","char","constant","function"],style:{color:e.colors.orange[5]}},{types:["punctuation"],style:{color:e.colors.gray[5]}},{types:["variable"],style:{color:e.colors.gray[5]}},{types:["class-name","attr-name"],style:{color:e.colors.yellow[5]}},{types:["tag","deleted"],style:{color:e.colors.red[6]}},{types:["operator"],style:{color:e.colors.gray[5]}},{types:["boolean"],style:{color:e.colors.red[6]}},{types:["keyword"],style:{color:e.colors.indigo[3]}},{types:["doctype"],style:{color:e.colors.gray[5]}},{types:["url"],style:{color:e.colors.gray[5]}}]}))(e):(e=>({plain:{color:e.colors.gray[9],backgroundColor:e.fn.rgba(e.colors.gray[0],.65)},styles:[{types:["comment"],style:{color:e.colors.gray[6]}},{types:["string","inserted"],style:{color:e.colors.indigo[9]}},{types:["number"],style:{color:e.colors.blue[7]}},{types:["builtin","char","constant","function","selector","atrule"],style:{color:e.colors.lime[9]}},{types:["punctuation"],style:{color:e.colors.gray[7]}},{types:["variable"],style:{color:e.colors.violet[9]}},{types:["attr-name"],style:{color:e.colors.green[9]}},{types:["class-name"],style:{color:e.colors.red[9]}},{types:["tag","deleted"],style:{color:e.colors.violet[9]}},{types:["operator"],style:{color:e.colors.red[9]}},{types:["boolean"],style:{color:e.colors.red[9]}},{types:["keyword"],style:{color:e.colors.red[9]}},{types:["doctype"],style:{color:e.colors.gray[7]}},{types:["url"],style:{color:e.colors.gray[7]}}]}))(e)},jR=(0,r.forwardRef)(((e,t)=>{const n=Ht("Prism",PR,e),{className:o,children:a,language:i,noCopy:l,classNames:s,styles:c,copyLabel:u,copiedLabel:d,withLineNumbers:f,highlightLines:p,scrollAreaComponent:m,colorScheme:h,trim:g,unstyled:y,radius:v,getPrismTheme:b,variant:w}=n,x=((e,t)=>{var n={};for(var r in e)SR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&kR)for(var r of kR(e))t.indexOf(r)<0&&OR.call(e,r)&&(n[r]=e[r]);return n})(n,["className","children","language","noCopy","classNames","styles","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","colorScheme","trim","unstyled","radius","getPrismTheme","variant"]),k=g&&"string"===typeof a?a.trim():a,S=k.split("\n").length.toString().length,O=Bt(),E=Ly(),C=h||O.colorScheme,{classes:_,cx:P}=vR({colorScheme:C,native:m!==$k,maxLineSize:S,radius:v},{name:"Prism",classNames:s,styles:c,unstyled:y,variant:w});return r.createElement(Jn,_R(CR({className:P(_.root,o),ref:t},x),{translate:"no"}),!l&&r.createElement(Au,{label:E.copied?d:u,position:"left",withArrow:!0,arrowSize:6,offset:6,color:E.copied?"teal":void 0,unstyled:y},r.createElement(vo,{className:_.copy,"aria-label":E.copied?d:u,onClick:()=>E.copy(k),unstyled:y},r.createElement(gR,{copied:E.copied}))),r.createElement(hR,_R(CR({},lR),{theme:b(O,C),code:k,language:i}),(e=>{let{className:t,style:n,tokens:o,getLineProps:a,getTokenProps:i}=e;return r.createElement(m,{className:_.scrollArea,dir:"ltr"},r.createElement("pre",{className:P(_.code,t),style:n,dir:"ltr"},o.map(((e,t)=>{var n,l,s,c;if(t===o.length-1&&1===e.length&&"\n"===e[0].content)return null;const u=t+1,d=a({line:e,key:t}),m=u in p,h="dark"===C?O.fn.rgba(O.fn.themeColor(null==(n=p[u])?void 0:n.color,9),.25):O.fn.themeColor(null==(l=p[u])?void 0:l.color,0);return r.createElement("div",_R(CR({},d),{className:P(_.line,d.className),style:CR({},m?{backgroundColor:h}:null)}),f&&r.createElement("div",{className:_.lineNumber,style:{color:m?O.fn.themeColor(null==(s=p[u])?void 0:s.color,"dark"===C?5:8):void 0}},(null==(c=p[u])?void 0:c.label)||u),r.createElement("div",{className:_.lineContent},e.map(((e,t)=>{var n,o;const a=i({token:e,key:t});return r.createElement("span",_R(CR({},a),{style:_R(CR({},a.style),{color:m?O.fn.themeColor(null==(n=p[u])?void 0:n.color,"dark"===C?5:8):null==(o=null==a?void 0:a.style)?void 0:o.color})}))}))))})).filter(Boolean)))})))}));jR.displayName="@mantine/prism/Prism";var TR=gn(((e,t)=>{let{radius:n}=t;return{tab:{paddingLeft:e.spacing.sm,paddingRight:e.spacing.sm,height:We(34),border:"".concat(We(1)," solid ").concat("dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[3]),borderBottom:0,fontSize:e.fontSizes.sm,color:"dark"===e.colorScheme?e.colors.dark[1]:e.colors.gray[7],backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.white,borderRadius:0,"&:first-of-type":{borderTopLeftRadius:e.radius.sm},"&:not(:first-of-type)":{borderLeft:0},"&:last-of-type":{borderTopRightRadius:e.radius.sm},"&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.colors.gray[0]},"&[data-active]":{color:"dark"===e.colorScheme?e.white:e.black,backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.fn.rgba(e.colors.gray[0],.65),"&::before":{backgroundColor:"transparent"}}},prism:{borderRadius:e.fn.radius(n),borderTopRightRadius:0,borderTopLeftRadius:0,border:"".concat(We(1)," solid ").concat("dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3]),borderTop:0,overflow:"hidden"},code:{borderTopRightRadius:0,borderTopLeftRadius:0,border:0}}}));const RR=TR;var NR=Object.defineProperty,AR=Object.defineProperties,IR=Object.getOwnPropertyDescriptors,DR=Object.getOwnPropertySymbols,zR=Object.prototype.hasOwnProperty,LR=Object.prototype.propertyIsEnumerable,FR=(e,t,n)=>t in e?NR(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,MR=(e,t)=>{for(var n in t||(t={}))zR.call(t,n)&&FR(e,n,t[n]);if(DR)for(var n of DR(t))LR.call(t,n)&&FR(e,n,t[n]);return e};const BR=jR;function UR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function HR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function WR(e){for(var t=1;t=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function VR(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=new Array(e),a=0;aAR(e,IR(t)))(MR({},e),{variant:"outline",classNames:{tab:t.tab},translate:"no"}))},BR.Tab=oR.Tab,BR.TabsList=oR.List,BR.Panel=function(e){var t=e,{language:n,children:o,radius:a,noCopy:i,copyLabel:l,copiedLabel:s,withLineNumbers:c,highlightLines:u,scrollAreaComponent:d,trim:f,getPrismTheme:p,colorScheme:m,variant:h}=t,g=((e,t)=>{var n={};for(var r in e)zR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&DR)for(var r of DR(e))t.indexOf(r)<0&&LR.call(e,r)&&(n[r]=e[r]);return n})(t,["language","children","radius","noCopy","copyLabel","copiedLabel","withLineNumbers","highlightLines","scrollAreaComponent","trim","getPrismTheme","colorScheme","variant"]);const{classes:y}=RR({radius:a});return r.createElement(oR.Panel,MR({},g),r.createElement(jR,{language:n,classNames:{root:y.prism,code:y.code},radius:a,noCopy:i,copyLabel:l,copiedLabel:s,withLineNumbers:c,highlightLines:u,scrollAreaComponent:d,trim:f,getPrismTheme:p,colorScheme:m,variant:h},o))};var QR=YR((function(e,t){throw new Error(e[t]||e.default)}))({initialIsRequired:"initial state is required",initialType:"initial state should be an object",initialContent:"initial state shouldn't be an empty object",handlerType:"handler should be an object or a function",handlersType:"all handlers should be a functions",selectorType:"selector should be a function",changeType:"provided value of changes should be an object",changeField:'it seams you want to change a field in the state which is not specified in the "initial" state',default:"an unknown error accured in `state-local` package"}),JR={changes:function(e,t){return XR(t)||QR("changeType"),Object.keys(t).some((function(t){return n=e,r=t,!Object.prototype.hasOwnProperty.call(n,r);var n,r}))&&QR("changeField"),t},selector:function(e){ZR(e)||QR("selectorType")},handler:function(e){ZR(e)||XR(e)||QR("handlerType"),XR(e)&&Object.values(e).some((function(e){return!ZR(e)}))&&QR("handlersType")},initial:function(e){var t;e||QR("initialIsRequired"),XR(e)||QR("initialType"),t=e,Object.keys(t).length||QR("initialContent")}};function eN(e,t){return ZR(t)?t(e.current):t}function tN(e,t){return e.current=KR(KR({},e.current),t),t}function nN(e,t,n){return ZR(t)?t(e.current):Object.keys(n).forEach((function(n){var r;return null===(r=t[n])||void 0===r?void 0:r.call(t,e.current[n])})),n}var rN={create:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};JR.initial(e),JR.handler(t);var n={current:e},r=YR(nN)(n,t),o=YR(tN)(n),a=YR(JR.changes)(e),i=YR(eN)(n);return[function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(e){return e};return JR.selector(e),e(n.current)},function(e){!function(){for(var e=arguments.length,t=new Array(e),n=0;n=e.length?e.apply(this,o):function(){for(var e=arguments.length,r=new Array(e),a=0;a2&&void 0!==arguments[2])||arguments[2],o=(0,r.useRef)(!0);(0,r.useEffect)(o.current||!n?()=>{o.current=!1}:e,t)};function DN(){}function zN(e,t,n,r){return function(e,t){return e.editor.getModel(LN(e,t))}(e,r)||function(e,t,n,r){return e.editor.createModel(t,n,r?LN(e,r):void 0)}(e,t,n,r)}function LN(e,t){return e.Uri.parse(t)}var FN=function(e){let{original:t,modified:n,language:o,originalLanguage:a,modifiedLanguage:i,originalModelPath:l,modifiedModelPath:s,keepCurrentOriginalModel:c=!1,keepCurrentModifiedModel:u=!1,theme:d="light",loading:f="Loading...",options:p={},height:m="100%",width:h="100%",className:g,wrapperProps:y={},beforeMount:v=DN,onMount:b=DN}=e,[w,x]=(0,r.useState)(!1),[k,S]=(0,r.useState)(!0),O=(0,r.useRef)(null),E=(0,r.useRef)(null),C=(0,r.useRef)(null),_=(0,r.useRef)(b),P=(0,r.useRef)(v),j=(0,r.useRef)(!1);AN((()=>{let e=_N.init();return e.then((e=>(E.current=e)&&S(!1))).catch((e=>"cancelation"!==(null===e||void 0===e?void 0:e.type)&&console.error("Monaco initialization: error:",e))),()=>O.current?function(){var e,t,n,r;let o=null===(e=O.current)||void 0===e?void 0:e.getModel();c||null!==o&&void 0!==o&&null!==(t=o.original)&&void 0!==t&&t.dispose(),u||null!==o&&void 0!==o&&null!==(n=o.modified)&&void 0!==n&&n.dispose(),null===(r=O.current)||void 0===r||r.dispose()}():e.cancel()})),IN((()=>{if(O.current&&E.current){let e=O.current.getOriginalEditor(),n=zN(E.current,t||"",a||o||"text",l||"");n!==e.getModel()&&e.setModel(n)}}),[l],w),IN((()=>{if(O.current&&E.current){let e=O.current.getModifiedEditor(),t=zN(E.current,n||"",i||o||"text",s||"");t!==e.getModel()&&e.setModel(t)}}),[s],w),IN((()=>{let e=O.current.getModifiedEditor();e.getOption(E.current.editor.EditorOption.readOnly)?e.setValue(n||""):n!==e.getValue()&&(e.executeEdits("",[{range:e.getModel().getFullModelRange(),text:n||"",forceMoveMarkers:!0}]),e.pushUndoStop())}),[n],w),IN((()=>{var e;null===(e=O.current)||void 0===e||null===(e=e.getModel())||void 0===e||e.original.setValue(t||"")}),[t],w),IN((()=>{let{original:e,modified:t}=O.current.getModel();E.current.editor.setModelLanguage(e,a||o||"text"),E.current.editor.setModelLanguage(t,i||o||"text")}),[o,a,i],w),IN((()=>{var e;null===(e=E.current)||void 0===e||e.editor.setTheme(d)}),[d],w),IN((()=>{var e;null===(e=O.current)||void 0===e||e.updateOptions(p)}),[p],w);let T=(0,r.useCallback)((()=>{var e;if(!E.current)return;P.current(E.current);let r=zN(E.current,t||"",a||o||"text",l||""),c=zN(E.current,n||"",i||o||"text",s||"");null===(e=O.current)||void 0===e||e.setModel({original:r,modified:c})}),[o,n,i,t,a,l,s]),R=(0,r.useCallback)((()=>{var e;!j.current&&C.current&&(O.current=E.current.editor.createDiffEditor(C.current,{automaticLayout:!0,...p}),T(),null!==(e=E.current)&&void 0!==e&&e.editor.setTheme(d),x(!0),j.current=!0)}),[p,d,T]);return(0,r.useEffect)((()=>{w&&_.current(O.current,E.current)}),[w]),(0,r.useEffect)((()=>{!k&&!w&&R()}),[k,w,R]),r.createElement(NN,{width:h,height:m,isEditorReady:w,loading:f,_ref:C,className:g,wrapperProps:y})};(0,r.memo)(FN);var MN=function(e){let t=(0,r.useRef)();return(0,r.useEffect)((()=>{t.current=e}),[e]),t.current},BN=new Map;var UN=function(e){let{defaultValue:t,defaultLanguage:n,defaultPath:o,value:a,language:i,path:l,theme:s="light",line:c,loading:u="Loading...",options:d={},overrideServices:f={},saveViewState:p=!0,keepCurrentModel:m=!1,width:h="100%",height:g="100%",className:y,wrapperProps:v={},beforeMount:b=DN,onMount:w=DN,onChange:x,onValidate:k=DN}=e,[S,O]=(0,r.useState)(!1),[E,C]=(0,r.useState)(!0),_=(0,r.useRef)(null),P=(0,r.useRef)(null),j=(0,r.useRef)(null),T=(0,r.useRef)(w),R=(0,r.useRef)(b),N=(0,r.useRef)(),A=(0,r.useRef)(a),I=MN(l),D=(0,r.useRef)(!1),z=(0,r.useRef)(!1);AN((()=>{let e=_N.init();return e.then((e=>(_.current=e)&&C(!1))).catch((e=>"cancelation"!==(null===e||void 0===e?void 0:e.type)&&console.error("Monaco initialization: error:",e))),()=>P.current?function(){var e,t;null!==(e=N.current)&&void 0!==e&&e.dispose(),m?p&&BN.set(l,P.current.saveViewState()):null===(t=P.current.getModel())||void 0===t||t.dispose(),P.current.dispose()}():e.cancel()})),IN((()=>{var e,r,s,c;let u=zN(_.current,t||a||"",n||i||"",l||o||"");u!==(null===(e=P.current)||void 0===e?void 0:e.getModel())&&(p&&BN.set(I,null===(r=P.current)||void 0===r?void 0:r.saveViewState()),null!==(s=P.current)&&void 0!==s&&s.setModel(u),p&&(null===(c=P.current)||void 0===c||c.restoreViewState(BN.get(l))))}),[l],S),IN((()=>{var e;null===(e=P.current)||void 0===e||e.updateOptions(d)}),[d],S),IN((()=>{!P.current||void 0===a||(P.current.getOption(_.current.editor.EditorOption.readOnly)?P.current.setValue(a):a!==P.current.getValue()&&(z.current=!0,P.current.executeEdits("",[{range:P.current.getModel().getFullModelRange(),text:a,forceMoveMarkers:!0}]),P.current.pushUndoStop(),z.current=!1))}),[a],S),IN((()=>{var e,t;let n=null===(e=P.current)||void 0===e?void 0:e.getModel();n&&i&&(null===(t=_.current)||void 0===t||t.editor.setModelLanguage(n,i))}),[i],S),IN((()=>{var e;void 0!==c&&(null===(e=P.current)||void 0===e||e.revealLine(c))}),[c],S),IN((()=>{var e;null===(e=_.current)||void 0===e||e.editor.setTheme(s)}),[s],S);let L=(0,r.useCallback)((()=>{if(j.current&&_.current&&!D.current){var e;R.current(_.current);let r=l||o,u=zN(_.current,a||t||"",n||i||"",r||"");P.current=null===(e=_.current)||void 0===e?void 0:e.editor.create(j.current,{model:u,automaticLayout:!0,...d},f),p&&P.current.restoreViewState(BN.get(r)),_.current.editor.setTheme(s),void 0!==c&&P.current.revealLine(c),O(!0),D.current=!0}}),[t,n,o,a,i,l,d,f,p,s,c]);return(0,r.useEffect)((()=>{S&&T.current(P.current,_.current)}),[S]),(0,r.useEffect)((()=>{!E&&!S&&L()}),[E,S,L]),A.current=a,(0,r.useEffect)((()=>{var e,t;S&&x&&(null!==(e=N.current)&&void 0!==e&&e.dispose(),N.current=null===(t=P.current)||void 0===t?void 0:t.onDidChangeModelContent((e=>{z.current||x(P.current.getValue(),e)})))}),[S,x]),(0,r.useEffect)((()=>{if(S){let e=_.current.editor.onDidChangeMarkers((e=>{var t;let n=null===(t=P.current.getModel())||void 0===t?void 0:t.uri;if(n&&e.find((e=>e.path===n.path))){let e=_.current.editor.getModelMarkers({resource:n});null===k||void 0===k||k(e)}}));return()=>{null===e||void 0===e||e.dispose()}}return()=>{}}),[S,k]),r.createElement(NN,{width:h,height:g,isEditorReady:S,loading:u,_ref:j,className:y,wrapperProps:v})},HN=(0,r.memo)(UN);const WN=gn((()=>({monacoEditor:{minHeight:"300px"}})));const $N=(0,r.memo)((function(e){let{content:t,onChangeContent:n,schema:r}=e;const o=Bt(),{classes:a}=WN();return(0,oy.jsx)(HN,{defaultLanguage:"json",value:JSON.stringify(t,null,2),onChange:e=>{if(e)try{const t=JSON.parse(e);n(t)}catch(t){return}},theme:"dark"===o.colorScheme?"vs-dark":void 0,className:a.monacoEditor,options:{lineNumbers:!1,minimap:{enabled:!1},wordWrap:"on"},onMount:(e,t)=>{r&&function(e,t,n){t.languages.json.jsonDefaults.setDiagnosticsOptions({validate:!0,schemas:[{uri:"https://json.schemastore.org/aiconfig-1.0",fileMatch:["*"],schema:n}],enableSchemaRequest:!0})}(0,t,r)}})})),VN=(0,r.memo)((function(e){let{content:t,onChange:n,schema:o}=e;const{readOnly:a}=(0,r.useContext)(ry);return!n||a?(0,oy.jsx)(BR,{language:"json",styles:{code:{textWrap:"pretty"}},children:JSON.stringify(t,null,2)}):(0,oy.jsx)($N,{content:t,onChangeContent:n,schema:o})}));function qN(e){const{propertyName:t,propertyDescription:n}=e;return null!=n&&""!==n.trim()?(0,oy.jsxs)(Ma,{spacing:"xs",children:[(0,oy.jsx)(ca,{size:"md",children:t}),(0,oy.jsx)(Au,{label:n,multiline:!0,maw:400,children:(0,oy.jsx)(vo,{children:(0,oy.jsx)(Cj,{size:16})})})]}):(0,oy.jsx)(ca,{size:"md",children:t})}function GN(e){var t;let{propertyName:n,property:o,isRequired:a=!1,initialValue:i=null,setValue:l}=e;const{readOnly:s}=(0,r.useContext)(ry),c=o.type,u=o.default,d=o.description,[f,p]=(0,r.useState)(null!==i&&void 0!==i?i:u);let m;const h=(0,r.useCallback)((e=>{const t="function"===typeof e?e(f):e;null!=n&&""!==n.trim()?l((e=>({...e&&"object"===typeof e?e:{},[n]:t}))):l(t),p(t)}),[n,f,l]),g=(0,r.useRef)(Array.isArray(f)?new Map(f.map((e=>[(0,zf.uniqueId)(),e]))):new Map),[y,v]=(0,r.useState)((()=>Array.from(g.current,(e=>{let[t,n]=e;return(0,oy.jsxs)(Ma,{children:[(0,oy.jsx)(GN,{propertyName:"",property:o.items,initialValue:n,setValue:e=>{g.current.set(t,e),h(Array.from(g.current.values()))}}),(0,oy.jsx)(vo,{onClick:()=>b(t),children:(0,oy.jsx)(ty,{size:16})})]},t)})))),b=(0,r.useCallback)((async e=>{v((t=>t.filter((t=>t.key!==e)))),g.current.delete(e),h(Array.from(g.current.values()))}),[h]),w=(0,r.useCallback)((async()=>{const e=(0,zf.uniqueId)();v((t=>[...t,(0,oy.jsxs)(Ma,{children:[(0,oy.jsx)(GN,{propertyName:"",property:o.items,setValue:t=>{g.current.set(e,t),h(Array.from(g.current.values()))}}),(0,oy.jsx)(vo,{onClick:()=>b(e),children:(0,oy.jsx)(ty,{size:16})})]},e)]))}),[o.items,b,h]);switch(c){case"string":m=null!=o.enum?(0,oy.jsx)(dC,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),filter:(e,t)=>{const n=t.value.toLocaleLowerCase(),r=e.toLocaleLowerCase().trim();return!(!o.enum||!o.enum.some((e=>e===r)))||n.includes(r)},required:a,placeholder:null!==f&&void 0!==f?f:"select",data:o.enum,value:null!==f&&void 0!==f?f:"",onChange:h,disabled:s}):(0,oy.jsx)(Hg,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),placeholder:f,required:a,withAsterisk:a,radius:"md",value:null!==f&&void 0!==f?f:"",onChange:e=>h(e.currentTarget.value),autosize:!0,maxRows:20,disabled:s});break;case"text":m=(0,oy.jsx)(Hg,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),placeholder:f,required:a,withAsterisk:a,radius:"md",value:null!==f&&void 0!==f?f:"",onChange:e=>h(e.currentTarget.value),autosize:!0,disabled:s});break;case"number":var x,k,S;if(null!=o.minimum&&null!=o.maximum)m=(0,oy.jsxs)(zm,{children:[(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),(0,oy.jsx)(y_,{defaultValue:null!==f&&void 0!==f?f:o.minimum,min:o.minimum,max:o.maximum,label:e=>e.toFixed(1),step:null!==(x=o.step)&&void 0!==x?x:.1,styles:{markLabel:{display:"none"}},value:f,onChange:h,style:{padding:"0 0.5em"},disabled:s})]});else m=(0,oy.jsx)(I_,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),defaultValue:f,min:o.minimum,max:o.maximum,step:null!==(k=o.step)&&void 0!==k?k:.05,precision:null!==(S=o.precision)&&void 0!==S?S:2,required:a,withAsterisk:a,radius:"md",value:null!==f&&void 0!==f?f:"",onChange:e=>h(e),disabled:s});break;case"integer":var O,E;if(null!=o.minimum&&null!=o.maximum)m=(0,oy.jsxs)(zm,{children:[(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),(0,oy.jsx)(y_,{defaultValue:null!==f&&void 0!==f?f:o.minimum,min:o.minimum,max:o.maximum,label:e=>e.toFixed(0),step:null!==(O=o.step)&&void 0!==O?O:1,styles:{markLabel:{display:"none"}},value:f,onChange:h,style:{padding:"0 0.5em"},disabled:s})]});else m=(0,oy.jsx)(I_,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),defaultValue:f,min:o.minimum,max:o.maximum,step:null!==(E=o.step)&&void 0!==E?E:1,required:a,withAsterisk:a,radius:"md",value:null!==f&&void 0!==f?f:"",onChange:e=>h(e),disabled:s});break;case"boolean":m=(0,oy.jsx)(zP,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),checked:f,onChange:e=>h(e.currentTarget.checked),disabled:s});break;case"array":m=(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsxs)(Ma,{align:"end",children:[(0,oy.jsx)(ca,{size:"md",children:n}),null!=d&&""!==d.trim()?(0,oy.jsx)(Au,{label:d,multiline:!0,children:(0,oy.jsx)(vo,{children:(0,oy.jsx)(Cj,{size:16})})}):null,(0,oy.jsx)(vo,{onClick:()=>w(),children:(0,oy.jsx)(ny,{size:16})})]}),(0,oy.jsx)(zm,{children:y})]});break;case"object":{var C;const e=new Set(null!==(C=o.required)&&void 0!==C?C:[]),t=o.properties,r=[];for(const n in t){const o=e.has(n),a=t[n];!0!==a.exclude&&r.push((0,oy.jsx)(GN,{isRequired:o,property:a,propertyName:n,initialValue:null===i||void 0===i?void 0:i[n],setValue:h},n))}m=r.length>0?(0,oy.jsxs)(oy.Fragment,{children:[null!=n&&""!==n.trim()?(0,oy.jsx)(ca,{children:n}):(0,oy.jsx)(oy.Fragment,{}),(0,oy.jsx)(zm,{children:r})]}):(0,oy.jsxs)(zm,{children:[(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),(0,oy.jsx)("div",{style:{minWidth:"350px"},children:(0,oy.jsx)(VN,{content:i,onChange:h})})]});break}case"select":null!=o.values&&(m=(0,oy.jsx)(Ej,{label:(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),data:o.values,value:f,onChange:e=>{h(e)},defaultValue:o.default,disabled:s}));break;case"union":m=(0,oy.jsxs)(zm,{children:[(0,oy.jsx)(qN,{propertyName:n,propertyDescription:d}),(0,oy.jsx)(Kj,{property:o,isRequired:a,propertyName:n,initialValue:i,setValue:h,renderProperty:e=>(0,oy.jsx)(GN,{...e}),disabled:s})]});break;default:console.warn("Warning: Unable to render property '".concat(n,"' of type '").concat(c,"'."))}return null!==(t=m)&&void 0!==t?t:null}const KN=(0,r.memo)((function(e){let{schema:t,settings:n,onUpdateModelSettings:o}=e;const a=(0,r.useMemo)((()=>(0,zf.debounce)((e=>o(e)),250)),[o]);return(0,oy.jsx)(GN,{propertyName:"",property:t,isRequired:!1,initialValue:n,setValue:e=>{const t="function"===typeof e?e(n):e;a(t)}})}));var YN=ey("braces-off","IconBracesOff",[["path",{d:"M5.176 5.177c-.113 .251 -.176 .53 -.176 .823v3c0 1.657 -.895 3 -2 3c1.105 0 2 1.343 2 3v3a2 2 0 0 0 2 2",key:"svg-0"}],["path",{d:"M17 4a2 2 0 0 1 2 2v3c0 1.657 .895 3 2 3c-1.105 0 -2 1.343 -2 3m-.176 3.821a2 2 0 0 1 -1.824 1.179",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]]),XN=ey("braces","IconBraces",[["path",{d:"M7 4a2 2 0 0 0 -2 2v3a2 3 0 0 1 -2 3a2 3 0 0 1 2 3v3a2 2 0 0 0 2 2",key:"svg-0"}],["path",{d:"M17 4a2 2 0 0 1 2 2v3a2 3 0 0 0 2 3a2 3 0 0 0 -2 3v3a2 2 0 0 1 -2 2",key:"svg-1"}]]);function ZN(e){let{isRawJSON:t,setIsRawJSON:n}=e;const{readOnly:o}=(0,r.useContext)(ry),a=o?"View JSON":"Toggle JSON Editor";return(0,oy.jsx)(Au,{label:a,withArrow:!0,children:(0,oy.jsx)(vo,{onClick:()=>n(!t),children:t?(0,oy.jsx)(YN,{size:"1rem"}):(0,oy.jsx)(XN,{size:"1rem"})})})}const QN=(0,r.createContext)(null),JN={didCatch:!1,error:null};class eA extends r.Component{constructor(e){super(e),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=JN}static getDerivedStateFromError(e){return{didCatch:!0,error:e}}resetErrorBoundary(){const{error:e}=this.state;if(null!==e){for(var t,n,r=arguments.length,o=new Array(r),a=0;a0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return e.length!==t.length||e.some(((e,n)=>!Object.is(e,t[n])))}(e.resetKeys,r)&&(null===(o=(a=this.props).onReset)||void 0===o||o.call(a,{next:r,prev:e.resetKeys,reason:"keys"}),this.setState(JN))}render(){const{children:e,fallbackRender:t,FallbackComponent:n,fallback:o}=this.props,{didCatch:a,error:i}=this.state;let l=e;if(a){const e={error:i,resetErrorBoundary:this.resetErrorBoundary};if("function"===typeof t)l=t(e);else if(n)l=(0,r.createElement)(n,e);else{if(null!==o&&!(0,r.isValidElement)(o))throw i;l=o}}return(0,r.createElement)(QN.Provider,{value:{didCatch:a,error:i,resetErrorBoundary:this.resetErrorBoundary}},l)}}function tA(){const e=(0,r.useContext)(QN);!function(e){if(null==e||"boolean"!==typeof e.didCatch||"function"!==typeof e.resetErrorBoundary)throw new Error("ErrorBoundaryContext not found")}(e);const[t,n]=(0,r.useState)({error:null,hasError:!1}),o=(0,r.useMemo)((()=>({resetBoundary:()=>{e.resetErrorBoundary(),n({error:null,hasError:!1})},showBoundary:e=>n({error:e,hasError:!0})})),[e.resetErrorBoundary]);if(t.hasError)throw t.error;return o}const nA=gn((()=>({settingsContainer:{overflow:"auto",paddingTop:"0.5em",width:"100%"}})));function rA(e){let{settings:t,toggleJSONEditor:n}=e;const{resetBoundary:r}=tA();return(0,oy.jsxs)(wa,{direction:"column",children:[(0,oy.jsxs)(ca,{color:"red",size:"sm",children:[(0,oy.jsx)(wa,{justify:"flex-end",children:(0,oy.jsx)(ZN,{isRawJSON:!1,setIsRawJSON:()=>{r(),n()}})}),"Invalid settings format for model. Toggle JSON editor to update"]}),(0,oy.jsx)(VN,{content:t})]})}const oA=(0,r.memo)((function(e){let{settings:t,schema:n,onUpdateModelSettings:o}=e;const{classes:a}=nA(),[i,l]=(0,r.useState)(null==n),s=(0,oy.jsx)(wa,{justify:"flex-end",children:(0,oy.jsx)(ZN,{isRawJSON:i,setIsRawJSON:l})});return(0,oy.jsx)(wa,{direction:"column",className:a.settingsContainer,children:i||!n?(0,oy.jsxs)(oy.Fragment,{children:[n&&s,(0,oy.jsx)(VN,{content:t,onChange:e=>o(e)})]}):(0,oy.jsxs)(eA,{fallbackRender:()=>(0,oy.jsx)(rA,{settings:t,toggleJSONEditor:()=>l(!0)}),children:[s,(0,oy.jsx)(KN,{settings:t,schema:n,onUpdateModelSettings:o})]})})}));function aA(e){return null}function iA(e){return null}const lA=(0,r.memo)((function(e){let{prompt:t,schema:n}=e;return n?(0,oy.jsx)(iA,{prompt:t,schema:n}):(0,oy.jsx)(aA,{prompt:t})}));var sA=ey("clear-all","IconClearAll",[["path",{d:"M8 6h12",key:"svg-0"}],["path",{d:"M6 12h12",key:"svg-1"}],["path",{d:"M4 18h12",key:"svg-2"}]]);function cA(e){var t,n,r;if("string"!==typeof(null===(t=e.metadata)||void 0===t?void 0:t.model))return null===(n=e.metadata)||void 0===n||null===(r=n.model)||void 0===r?void 0:r.settings}function uA(e){var t;return null===(t=e.metadata)||void 0===t?void 0:t.parameters}const dA=(0,r.memo)((function(e){let{prompt:t,promptSchema:n,onUpdateModelSettings:o,onUpdateParameters:a}=e;const[i,l]=(0,r.useState)(!1),s=null===n||void 0===n?void 0:n.model_settings,c=null===n||void 0===n?void 0:n.prompt_metadata;return(0,oy.jsx)(wa,{direction:"column",justify:"space-between",h:"100%",children:i?(0,oy.jsx)(oy.Fragment,{children:(0,oy.jsxs)(ja,{miw:"400px",children:[(0,oy.jsx)(vo,{size:"sm",onClick:()=>l(!1),mt:"0.5em",children:(0,oy.jsx)(sA,{})}),(0,oy.jsxs)(oR,{defaultValue:"settings",mb:"1em",children:[(0,oy.jsxs)(oR.List,{children:[(0,oy.jsx)(oR.Tab,{value:"settings",children:"Settings"}),Rf(t)&&(0,oy.jsx)(oR.Tab,{value:"parameters",children:"Local Parameters"})]}),(0,oy.jsxs)(oR.Panel,{value:"settings",className:"actionTabsPanel",children:[(0,oy.jsx)(oA,{settings:cA(t),schema:s,onUpdateModelSettings:o}),(0,oy.jsx)(lA,{prompt:t,schema:c})]}),Rf(t)&&(0,oy.jsx)(oR.Panel,{value:"parameters",className:"actionTabsPanel",children:(0,oy.jsx)(sy,{initialValue:uA(t),onUpdateParameters:a})})]})]})}):(0,oy.jsx)(wa,{direction:"column",justify:"space-between",h:"100%",children:(0,oy.jsx)(wa,{direction:"row",justify:"center",mt:"0.5em",children:(0,oy.jsx)(vo,{size:"sm",onClick:()=>l(!0),children:(0,oy.jsx)(sA,{})})})})})}));var fA=gn(((e,t)=>{let{transitionDuration:n}=t;return{control:{},root:{position:"relative"},content:{display:"flex",flexDirection:"column",overflow:"hidden",transitionProperty:"max-height",transitionTimingFunction:e.transitionTimingFunction,transitionDuration:"".concat(n,"ms"),"@media (prefers-reduced-motion)":{transitionDuration:e.respectReducedMotion?"0ms":void 0}}}}));const pA=fA;var mA=Object.defineProperty,hA=Object.getOwnPropertySymbols,gA=Object.prototype.hasOwnProperty,yA=Object.prototype.propertyIsEnumerable,vA=(e,t,n)=>t in e?mA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,bA=(e,t)=>{for(var n in t||(t={}))gA.call(t,n)&&vA(e,n,t[n]);if(hA)for(var n of hA(t))yA.call(t,n)&&vA(e,n,t[n]);return e};function wA(e){let{theme:t,color:n}=e;return"dimmed"===n?t.fn.dimmed():t.fn.themeColor(n||t.primaryColor,"dark"===t.colorScheme?4:7,!1,!0)}var xA=gn(((e,t)=>{let{color:n,underline:r}=t;return{root:bA({backgroundColor:"transparent",cursor:"pointer",padding:0,border:0,color:wA({theme:e,color:n})},e.fn.hover({textDecoration:r?"underline":"none"}))}}));const kA=xA;var SA=Object.defineProperty,OA=Object.getOwnPropertySymbols,EA=Object.prototype.hasOwnProperty,CA=Object.prototype.propertyIsEnumerable,_A=(e,t,n)=>t in e?SA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,PA=(e,t)=>{for(var n in t||(t={}))EA.call(t,n)&&_A(e,n,t[n]);if(OA)for(var n of OA(t))CA.call(t,n)&&_A(e,n,t[n]);return e};const jA={underline:!0},TA=(0,r.forwardRef)(((e,t)=>{const n=Ht("Anchor",jA,e),{component:o,className:a,unstyled:i,variant:l,size:s,color:c,underline:u}=n,d=((e,t)=>{var n={};for(var r in e)EA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&OA)for(var r of OA(e))t.indexOf(r)<0&&CA.call(e,r)&&(n[r]=e[r]);return n})(n,["component","className","unstyled","variant","size","color","underline"]),{classes:f,cx:p}=kA({color:c,underline:u},{name:"Anchor",unstyled:i,variant:l,size:s}),m="button"===o?{type:"button"}:null;return r.createElement(ca,PA(PA({component:o||"a",ref:t,className:p(f.root,a),size:s},m),d))}));TA.displayName="@mantine/core/Anchor";const RA=TA;var NA=Object.defineProperty,AA=Object.getOwnPropertySymbols,IA=Object.prototype.hasOwnProperty,DA=Object.prototype.propertyIsEnumerable,zA=(e,t,n)=>t in e?NA(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const LA={maxHeight:100,transitionDuration:200,initialState:!1},FA=(0,r.forwardRef)(((e,t)=>{const n=Ht("Spoiler",LA,e),{className:o,children:a,maxHeight:i,hideLabel:l,showLabel:s,transitionDuration:c,controlRef:u,initialState:d,classNames:f,styles:p,unstyled:m,variant:h}=n,g=((e,t)=>{var n={};for(var r in e)IA.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&AA)for(var r of AA(e))t.indexOf(r)<0&&DA.call(e,r)&&(n[r]=e[r]);return n})(n,["className","children","maxHeight","hideLabel","showLabel","transitionDuration","controlRef","initialState","classNames","styles","unstyled","variant"]),{classes:y,cx:v}=pA({transitionDuration:c},{name:"Spoiler",classNames:f,styles:p,unstyled:m,variant:h}),[b,w]=(0,r.useState)(d),{ref:x,height:k}=function(){const[e,{width:t,height:n}]=Pj();return{ref:e,width:t,height:n}}(),S=i{for(var n in t||(t={}))IA.call(t,n)&&zA(e,n,t[n]);if(AA)for(var n of AA(t))DA.call(t,n)&&zA(e,n,t[n]);return e})({className:v(y.root,o),ref:t},g),r.createElement("div",{className:y.content,style:{maxHeight:b?k?We(k):void 0:We(i)}},r.createElement("div",{ref:x},a)),S&&r.createElement(RA,{component:"button",ref:u,onClick:()=>w((e=>!e)),className:y.control},O))}));FA.displayName="@mantine/core/Spoiler";var MA=n(586);function BA(e){return e&&"object"===typeof e?"position"in e||"type"in e?HA(e.position):"start"in e||"end"in e?HA(e):"line"in e||"column"in e?UA(e):"":""}function UA(e){return WA(e&&e.line)+":"+WA(e&&e.column)}function HA(e){return UA(e&&e.start)+"-"+UA(e&&e.end)}function WA(e){return e&&"number"===typeof e?e:1}class $A extends Error{constructor(e,t,n){const r=[null,null];let o={start:{line:null,column:null},end:{line:null,column:null}};if(super(),"string"===typeof t&&(n=t,t=void 0),"string"===typeof n){const e=n.indexOf(":");-1===e?r[1]=n:(r[0]=n.slice(0,e),r[1]=n.slice(e+1))}t&&("type"in t||"position"in t?t.position&&(o=t.position):"start"in t||"end"in t?o=t:("line"in t||"column"in t)&&(o.start=t)),this.name=BA(t)||"1:1",this.message="object"===typeof e?e.message:e,this.stack="","object"===typeof e&&e.stack&&(this.stack=e.stack),this.reason=this.message,this.fatal,this.line=o.start.line,this.column=o.start.column,this.position=o,this.source=r[0],this.ruleId=r[1],this.file,this.actual,this.expected,this.url,this.note}}$A.prototype.file="",$A.prototype.name="",$A.prototype.reason="",$A.prototype.message="",$A.prototype.stack="",$A.prototype.fatal=null,$A.prototype.column=null,$A.prototype.line=null,$A.prototype.source=null,$A.prototype.ruleId=null,$A.prototype.position=null;const VA={basename:function(e,t){if(void 0!==t&&"string"!==typeof t)throw new TypeError('"ext" argument must be a string');qA(e);let n,r=0,o=-1,a=e.length;if(void 0===t||0===t.length||t.length>e.length){for(;a--;)if(47===e.charCodeAt(a)){if(n){r=a+1;break}}else o<0&&(n=!0,o=a+1);return o<0?"":e.slice(r,o)}if(t===e)return"";let i=-1,l=t.length-1;for(;a--;)if(47===e.charCodeAt(a)){if(n){r=a+1;break}}else i<0&&(n=!0,i=a+1),l>-1&&(e.charCodeAt(a)===t.charCodeAt(l--)?l<0&&(o=a):(l=-1,o=i));r===o?o=i:o<0&&(o=e.length);return e.slice(r,o)},dirname:function(e){if(qA(e),0===e.length)return".";let t,n=-1,r=e.length;for(;--r;)if(47===e.charCodeAt(r)){if(t){n=r;break}}else t||(t=!0);return n<0?47===e.charCodeAt(0)?"/":".":1===n&&47===e.charCodeAt(0)?"//":e.slice(0,n)},extname:function(e){qA(e);let t,n=e.length,r=-1,o=0,a=-1,i=0;for(;n--;){const l=e.charCodeAt(n);if(47!==l)r<0&&(t=!0,r=n+1),46===l?a<0?a=n:1!==i&&(i=1):a>-1&&(i=-1);else if(t){o=n+1;break}}if(a<0||r<0||0===i||1===i&&a===r-1&&a===o+1)return"";return e.slice(a,r)},join:function(){let e,t=-1;for(var n=arguments.length,r=new Array(n),o=0;o2){if(r=o.lastIndexOf("/"),r!==o.length-1){r<0?(o="",a=0):(o=o.slice(0,r),a=o.length-1-o.lastIndexOf("/")),i=s,l=0;continue}}else if(o.length>0){o="",a=0,i=s,l=0;continue}t&&(o=o.length>0?o+"/..":"..",a=2)}else o.length>0?o+="/"+e.slice(i+1,s):o=e.slice(i+1,s),a=s-i-1;i=s,l=0}else 46===n&&l>-1?l++:l=-1}return o}(e,!t);0!==n.length||t||(n=".");n.length>0&&47===e.charCodeAt(e.length-1)&&(n+="/");return t?"/"+n:n}(e)},sep:"/"};function qA(e){if("string"!==typeof e)throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const GA={cwd:function(){return"/"}};function KA(e){return null!==e&&"object"===typeof e&&e.href&&e.origin}function YA(e){if("string"===typeof e)e=new URL(e);else if(!KA(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if("file:"!==e.protocol){const e=new TypeError("The URL must be of scheme file");throw e.code="ERR_INVALID_URL_SCHEME",e}return function(e){if(""!==e.hostname){const e=new TypeError('File URL host must be "localhost" or empty on darwin');throw e.code="ERR_INVALID_FILE_URL_HOST",e}const t=e.pathname;let n=-1;for(;++n1?s-1:0),u=1;uo.length;let c;s&&o.push(a);try{c=e.apply(this,o)}catch(r){if(s&&n)throw r;return a(r)}s||(c instanceof Promise?c.then(i,a):c instanceof Error?a(c):i(c))}function a(e){if(!n){n=!0;for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a{if(!e&&t&&n){const o=i.stringify(t,n);void 0===o||null===o||("string"===typeof(r=o)||MA(r)?n.value=o:n.result=o),a(e,n)}else a(e);var r}))}n(null,t)},i.processSync=function(e){let t;i.freeze(),sI("processSync",i.Parser),cI("processSync",i.Compiler);const n=pI(e);return i.process(n,r),fI("processSync","process",t),n;function r(e){t=!0,tI(e)}},i;function i(){const t=e();let r=-1;for(;++r1?t-1:0),l=1;lo?0:o+t:t>o?o:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);i0?(yI(e,e.length,0,t),e):t}const bI={}.hasOwnProperty;function wI(e){const t={};let n=-1;for(;++na))return;const n=t.events.length;let o,l,s=n;for(;s--;)if("exit"===t.events[s][0]&&"chunkFlow"===t.events[s][1].type){if(o){l=t.events[s][1].end;break}o=!0}for(y(i),e=n;er;){const r=n[o];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){r.write([null]),o=void 0,r=void 0,t.containerState._closeFlow=void 0}}},MI={tokenize:function(e,t,n){return zI(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}};const BI={tokenize:function(e,t,n){return function(t){return NI(t)?zI(e,r,"linePrefix")(t):r(t)};function r(e){return null===e||TI(e)?t(e):n(e)}},partial:!0};function UI(e){const t={};let n,r,o,a,i,l,s,c=-1;for(;++c=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}},partial:!0};const VI={tokenize:function(e){const t=this,n=e.attempt(BI,(function(r){if(null===r)return void e.consume(r);return e.enter("lineEndingBlank"),e.consume(r),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}),e.attempt(this.parser.constructs.flowInitial,r,zI(e,e.attempt(this.parser.constructs.flow,r,e.attempt(WI,r)),"linePrefix")));return n;function r(r){if(null!==r)return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),t.currentConstruct=void 0,n;e.consume(r)}}};const qI={resolveAll:XI()},GI=YI("string"),KI=YI("text");function YI(e){return{tokenize:function(t){const n=this,r=this.parser.constructs[e],o=t.attempt(r,a,i);return a;function a(e){return s(e)?o(e):i(e)}function i(e){if(null!==e)return t.enter("data"),t.consume(e),l;t.consume(e)}function l(e){return s(e)?(t.exit("data"),o(e)):(t.consume(e),l)}function s(e){if(null===e)return!0;const t=r[e];let o=-1;if(t)for(;++o-1){const e=i[0];"string"===typeof e?i[0]=e.slice(r):i.shift()}a>0&&i.push(e[o].slice(0,a))}return i}(i,e)}function m(){const{line:e,column:t,offset:n,_index:o,_bufferIndex:a}=r;return{line:e,column:t,offset:n,_index:o,_bufferIndex:a}}function h(){let e;for(;r._index=3&&(null===a||TI(a))?(e.exit("thematicBreak"),t(a)):n(a)}function i(t){return t===r?(e.consume(t),o++,i):(e.exit("thematicBreakSequence"),NI(t)?zI(e,a,"whitespace")(t):a(t))}}};const tD={name:"list",tokenize:function(e,t,n){const r=this,o=r.events[r.events.length-1];let a=o&&"linePrefix"===o[1].type?o[2].sliceSerialize(o[1],!0).length:0,i=0;return function(t){const o=r.containerState.type||(42===t||43===t||45===t?"listUnordered":"listOrdered");if("listUnordered"===o?!r.containerState.marker||t===r.containerState.marker:_I(t)){if(r.containerState.type||(r.containerState.type=o,e.enter(o,{_container:!0})),"listUnordered"===o)return e.enter("listItemPrefix"),42===t||45===t?e.check(eD,n,s)(t):s(t);if(!r.interrupt||49===t)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(t)}return n(t)};function l(t){return _I(t)&&++i<10?(e.consume(t),l):(!r.interrupt||i<2)&&(r.containerState.marker?t===r.containerState.marker:41===t||46===t)?(e.exit("listItemValue"),s(t)):n(t)}function s(t){return e.enter("listItemMarker"),e.consume(t),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||t,e.check(BI,r.interrupt?n:c,e.attempt(nD,d,u))}function c(e){return r.containerState.initialBlankLine=!0,a++,d(e)}function u(t){return NI(t)?(e.enter("listItemPrefixWhitespace"),e.consume(t),e.exit("listItemPrefixWhitespace"),d):n(t)}function d(n){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(n)}},continuation:{tokenize:function(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(BI,o,a);function o(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,zI(e,t,"listItemIndent",r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!NI(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,i(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(rD,t,i)(n))}function i(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,zI(e,e.attempt(tD,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}},exit:function(e){e.exit(this.containerState.type)}},nD={tokenize:function(e,t,n){const r=this;return zI(e,(function(e){const o=r.events[r.events.length-1];return!NI(e)&&o&&"listItemPrefixWhitespace"===o[1].type?t(e):n(e)}),"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5)},partial:!0},rD={tokenize:function(e,t,n){const r=this;return zI(e,(function(e){const o=r.events[r.events.length-1];return o&&"listItemIndent"===o[1].type&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(e):n(e)}),"listItemIndent",r.containerState.size+1)},partial:!0};const oD={name:"blockQuote",tokenize:function(e,t,n){const r=this;return function(t){if(62===t){const n=r.containerState;return n.open||(e.enter("blockQuote",{_container:!0}),n.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(t),e.exit("blockQuoteMarker"),o}return n(t)};function o(n){return NI(n)?(e.enter("blockQuotePrefixWhitespace"),e.consume(n),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(n))}},continuation:{tokenize:function(e,t,n){const r=this;return function(t){if(NI(t))return zI(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t);return o(t)};function o(r){return e.attempt(oD,t,n)(r)}}},exit:function(e){e.exit("blockQuote")}};function aD(e,t,n,r,o,a,i,l,s){const c=s||Number.POSITIVE_INFINITY;let u=0;return function(t){if(60===t)return e.enter(r),e.enter(o),e.enter(a),e.consume(t),e.exit(a),d;if(null===t||32===t||41===t||CI(t))return n(t);return e.enter(r),e.enter(i),e.enter(l),e.enter("chunkString",{contentType:"string"}),m(t)};function d(n){return 62===n?(e.enter(a),e.consume(n),e.exit(a),e.exit(o),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),f(n))}function f(t){return 62===t?(e.exit("chunkString"),e.exit(l),d(t)):null===t||60===t||TI(t)?n(t):(e.consume(t),92===t?p:f)}function p(t){return 60===t||62===t||92===t?(e.consume(t),f):f(t)}function m(o){return u||null!==o&&41!==o&&!RI(o)?u999||null===d||91===d||93===d&&!l||94===d&&!s&&"_hiddenFootnoteSupport"in i.parser.constructs?n(d):93===d?(e.exit(a),e.enter(o),e.consume(d),e.exit(o),e.exit(r),t):TI(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):(e.enter("chunkString",{contentType:"string"}),u(d))}function u(t){return null===t||91===t||93===t||TI(t)||s++>999?(e.exit("chunkString"),c(t)):(e.consume(t),l||(l=!NI(t)),92===t?d:u)}function d(t){return 91===t||92===t||93===t?(e.consume(t),s++,u):u(t)}}function lD(e,t,n,r,o,a){let i;return function(t){if(34===t||39===t||40===t)return e.enter(r),e.enter(o),e.consume(t),e.exit(o),i=40===t?41:t,l;return n(t)};function l(n){return n===i?(e.enter(o),e.consume(n),e.exit(o),e.exit(r),t):(e.enter(a),s(n))}function s(t){return t===i?(e.exit(a),l(i)):null===t?n(t):TI(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),zI(e,s,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),c(t))}function c(t){return t===i||null===t||TI(t)?(e.exit("chunkString"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return t===i||92===t?(e.consume(t),c):c(t)}}function sD(e,t){let n;return function r(o){if(TI(o))return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,r;if(NI(o))return zI(e,r,n?"linePrefix":"lineSuffix")(o);return t(o)}}function cD(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const uD={name:"definition",tokenize:function(e,t,n){const r=this;let o;return function(t){return e.enter("definition"),function(t){return iD.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(t)}(t)};function a(t){return o=cD(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),i):n(t)}function i(t){return RI(t)?sD(e,l)(t):l(t)}function l(t){return aD(e,s,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(t)}function s(t){return e.attempt(dD,c,c)(t)}function c(t){return NI(t)?zI(e,u,"whitespace")(t):u(t)}function u(a){return null===a||TI(a)?(e.exit("definition"),r.parser.defined.push(o),t(a)):n(a)}}},dD={tokenize:function(e,t,n){return function(t){return RI(t)?sD(e,r)(t):n(t)};function r(t){return lD(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(t)}function o(t){return NI(t)?zI(e,a,"whitespace")(t):a(t)}function a(e){return null===e||TI(e)?t(e):n(e)}},partial:!0};const fD={name:"codeIndented",tokenize:function(e,t,n){const r=this;return function(t){return e.enter("codeIndented"),zI(e,o,"linePrefix",5)(t)};function o(e){const t=r.events[r.events.length-1];return t&&"linePrefix"===t[1].type&&t[2].sliceSerialize(t[1],!0).length>=4?a(e):n(e)}function a(t){return null===t?l(t):TI(t)?e.attempt(pD,a,l)(t):(e.enter("codeFlowValue"),i(t))}function i(t){return null===t||TI(t)?(e.exit("codeFlowValue"),a(t)):(e.consume(t),i)}function l(n){return e.exit("codeIndented"),t(n)}}},pD={tokenize:function(e,t,n){const r=this;return o;function o(t){return r.parser.lazy[r.now().line]?n(t):TI(t)?(e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o):zI(e,a,"linePrefix",5)(t)}function a(e){const a=r.events[r.events.length-1];return a&&"linePrefix"===a[1].type&&a[2].sliceSerialize(a[1],!0).length>=4?t(e):TI(e)?o(e):n(e)}},partial:!0};const mD={name:"headingAtx",tokenize:function(e,t,n){let r=0;return function(t){return e.enter("atxHeading"),function(t){return e.enter("atxHeadingSequence"),o(t)}(t)};function o(t){return 35===t&&r++<6?(e.consume(t),o):null===t||RI(t)?(e.exit("atxHeadingSequence"),a(t)):n(t)}function a(n){return 35===n?(e.enter("atxHeadingSequence"),i(n)):null===n||TI(n)?(e.exit("atxHeading"),t(n)):NI(n)?zI(e,a,"whitespace")(n):(e.enter("atxHeadingText"),l(n))}function i(t){return 35===t?(e.consume(t),i):(e.exit("atxHeadingSequence"),a(t))}function l(t){return null===t||35===t||RI(t)?(e.exit("atxHeadingText"),a(t)):(e.consume(t),l)}},resolve:function(e,t){let n,r,o=e.length-2,a=3;"whitespace"===e[a][1].type&&(a+=2);o-2>a&&"whitespace"===e[o][1].type&&(o-=2);"atxHeadingSequence"===e[o][1].type&&(a===o-1||o-4>a&&"whitespace"===e[o-2][1].type)&&(o-=a+1===o?2:4);o>a&&(n={type:"atxHeadingText",start:e[a][1].start,end:e[o][1].end},r={type:"chunkText",start:e[a][1].start,end:e[o][1].end,contentType:"text"},yI(e,a,o-a+1,[["enter",n,t],["enter",r,t],["exit",r,t],["exit",n,t]]));return e}};const hD={name:"setextUnderline",tokenize:function(e,t,n){const r=this;let o;return function(t){let i,l=r.events.length;for(;l--;)if("lineEnding"!==r.events[l][1].type&&"linePrefix"!==r.events[l][1].type&&"content"!==r.events[l][1].type){i="paragraph"===r.events[l][1].type;break}if(!r.parser.lazy[r.now().line]&&(r.interrupt||i))return e.enter("setextHeadingLine"),o=t,function(t){return e.enter("setextHeadingLineSequence"),a(t)}(t);return n(t)};function a(t){return t===o?(e.consume(t),a):(e.exit("setextHeadingLineSequence"),NI(t)?zI(e,i,"lineSuffix")(t):i(t))}function i(r){return null===r||TI(r)?(e.exit("setextHeadingLine"),t(r)):n(r)}},resolveTo:function(e,t){let n,r,o,a=e.length;for(;a--;)if("enter"===e[a][0]){if("content"===e[a][1].type){n=a;break}"paragraph"===e[a][1].type&&(r=a)}else"content"===e[a][1].type&&e.splice(a,1),o||"definition"!==e[a][1].type||(o=a);const i={type:"setextHeading",start:Object.assign({},e[r][1].start),end:Object.assign({},e[e.length-1][1].end)};e[r][1].type="setextHeadingText",o?(e.splice(r,0,["enter",i,t]),e.splice(o+1,0,["exit",e[n][1],t]),e[n][1].end=Object.assign({},e[o][1].end)):e[n][1]=i;return e.push(["exit",i,t]),e}};const gD=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],yD=["pre","script","style","textarea"],vD={name:"htmlFlow",tokenize:function(e,t,n){const r=this;let o,a,i,l,s;return function(t){return function(t){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(t),c}(t)};function c(l){return 33===l?(e.consume(l),u):47===l?(e.consume(l),a=!0,p):63===l?(e.consume(l),o=3,r.interrupt?t:I):SI(l)?(e.consume(l),i=String.fromCharCode(l),m):n(l)}function u(a){return 45===a?(e.consume(a),o=2,d):91===a?(e.consume(a),o=5,l=0,f):SI(a)?(e.consume(a),o=4,r.interrupt?t:I):n(a)}function d(o){return 45===o?(e.consume(o),r.interrupt?t:I):n(o)}function f(o){const a="CDATA[";return o===a.charCodeAt(l++)?(e.consume(o),6===l?r.interrupt?t:C:f):n(o)}function p(t){return SI(t)?(e.consume(t),i=String.fromCharCode(t),m):n(t)}function m(l){if(null===l||47===l||62===l||RI(l)){const s=47===l,c=i.toLowerCase();return s||a||!yD.includes(c)?gD.includes(i.toLowerCase())?(o=6,s?(e.consume(l),h):r.interrupt?t(l):C(l)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(l):a?g(l):y(l)):(o=1,r.interrupt?t(l):C(l))}return 45===l||OI(l)?(e.consume(l),i+=String.fromCharCode(l),m):n(l)}function h(o){return 62===o?(e.consume(o),r.interrupt?t:C):n(o)}function g(t){return NI(t)?(e.consume(t),g):O(t)}function y(t){return 47===t?(e.consume(t),O):58===t||95===t||SI(t)?(e.consume(t),v):NI(t)?(e.consume(t),y):O(t)}function v(t){return 45===t||46===t||58===t||95===t||OI(t)?(e.consume(t),v):b(t)}function b(t){return 61===t?(e.consume(t),w):NI(t)?(e.consume(t),b):y(t)}function w(t){return null===t||60===t||61===t||62===t||96===t?n(t):34===t||39===t?(e.consume(t),s=t,x):NI(t)?(e.consume(t),w):k(t)}function x(t){return t===s?(e.consume(t),s=null,S):null===t||TI(t)?n(t):(e.consume(t),x)}function k(t){return null===t||34===t||39===t||47===t||60===t||61===t||62===t||96===t||RI(t)?b(t):(e.consume(t),k)}function S(e){return 47===e||62===e||NI(e)?y(e):n(e)}function O(t){return 62===t?(e.consume(t),E):n(t)}function E(t){return null===t||TI(t)?C(t):NI(t)?(e.consume(t),E):n(t)}function C(t){return 45===t&&2===o?(e.consume(t),T):60===t&&1===o?(e.consume(t),R):62===t&&4===o?(e.consume(t),D):63===t&&3===o?(e.consume(t),I):93===t&&5===o?(e.consume(t),A):!TI(t)||6!==o&&7!==o?null===t||TI(t)?(e.exit("htmlFlowData"),_(t)):(e.consume(t),C):(e.exit("htmlFlowData"),e.check(bD,z,_)(t))}function _(t){return e.check(wD,P,z)(t)}function P(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),j}function j(t){return null===t||TI(t)?_(t):(e.enter("htmlFlowData"),C(t))}function T(t){return 45===t?(e.consume(t),I):C(t)}function R(t){return 47===t?(e.consume(t),i="",N):C(t)}function N(t){if(62===t){const n=i.toLowerCase();return yD.includes(n)?(e.consume(t),D):C(t)}return SI(t)&&i.length<8?(e.consume(t),i+=String.fromCharCode(t),N):C(t)}function A(t){return 93===t?(e.consume(t),I):C(t)}function I(t){return 62===t?(e.consume(t),D):45===t&&2===o?(e.consume(t),I):C(t)}function D(t){return null===t||TI(t)?(e.exit("htmlFlowData"),z(t)):(e.consume(t),D)}function z(n){return e.exit("htmlFlow"),t(n)}},resolveTo:function(e){let t=e.length;for(;t--&&("enter"!==e[t][0]||"htmlFlow"!==e[t][1].type););t>1&&"linePrefix"===e[t-2][1].type&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2));return e},concrete:!0},bD={tokenize:function(e,t,n){return function(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),e.attempt(BI,t,n)}},partial:!0},wD={tokenize:function(e,t,n){const r=this;return function(t){if(TI(t))return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o;return n(t)};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0};const xD={tokenize:function(e,t,n){const r=this;return function(t){if(null===t)return n(t);return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),o};function o(e){return r.parser.lazy[r.now().line]?n(e):t(e)}},partial:!0},kD={name:"codeFenced",tokenize:function(e,t,n){const r=this,o={tokenize:function(e,t,n){let o=0;return i;function i(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),s}function s(t){return e.enter("codeFencedFence"),NI(t)?zI(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):c(t)}function c(t){return t===a?(e.enter("codeFencedFenceSequence"),u(t)):n(t)}function u(t){return t===a?(o++,e.consume(t),u):o>=l?(e.exit("codeFencedFenceSequence"),NI(t)?zI(e,d,"whitespace")(t):d(t)):n(t)}function d(r){return null===r||TI(r)?(e.exit("codeFencedFence"),t(r)):n(r)}},partial:!0};let a,i=0,l=0;return function(t){return function(t){const n=r.events[r.events.length-1];return i=n&&"linePrefix"===n[1].type?n[2].sliceSerialize(n[1],!0).length:0,a=t,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),s(t)}(t)};function s(t){return t===a?(l++,e.consume(t),s):l<3?n(t):(e.exit("codeFencedFenceSequence"),NI(t)?zI(e,c,"whitespace")(t):c(t))}function c(n){return null===n||TI(n)?(e.exit("codeFencedFence"),r.interrupt?t(n):e.check(xD,p,v)(n)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),u(n))}function u(t){return null===t||TI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(t)):NI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),zI(e,d,"whitespace")(t)):96===t&&t===a?n(t):(e.consume(t),u)}function d(t){return null===t||TI(t)?c(t):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),f(t))}function f(t){return null===t||TI(t)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(t)):96===t&&t===a?n(t):(e.consume(t),f)}function p(t){return e.attempt(o,v,m)(t)}function m(t){return e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),h}function h(t){return i>0&&NI(t)?zI(e,g,"linePrefix",i+1)(t):g(t)}function g(t){return null===t||TI(t)?e.check(xD,p,v)(t):(e.enter("codeFlowValue"),y(t))}function y(t){return null===t||TI(t)?(e.exit("codeFlowValue"),g(t)):(e.consume(t),y)}function v(n){return e.exit("codeFenced"),t(n)}},concrete:!0};const SD=document.createElement("i");function OD(e){const t="&"+e+";";SD.innerHTML=t;const n=SD.textContent;return(59!==n.charCodeAt(n.length-1)||"semi"===e)&&(n!==t&&n)}const ED={name:"characterReference",tokenize:function(e,t,n){const r=this;let o,a,i=0;return function(t){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(t),e.exit("characterReferenceMarker"),l};function l(t){return 35===t?(e.enter("characterReferenceMarkerNumeric"),e.consume(t),e.exit("characterReferenceMarkerNumeric"),s):(e.enter("characterReferenceValue"),o=31,a=OI,c(t))}function s(t){return 88===t||120===t?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(t),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=PI,c):(e.enter("characterReferenceValue"),o=7,a=_I,c(t))}function c(l){if(59===l&&i){const o=e.exit("characterReferenceValue");return a!==OI||OD(r.sliceSerialize(o))?(e.enter("characterReferenceMarker"),e.consume(l),e.exit("characterReferenceMarker"),e.exit("characterReference"),t):n(l)}return a(l)&&i++1&&e[u][1].end.offset-e[u][1].start.offset>1?2:1;const d=Object.assign({},e[n][1].end),f=Object.assign({},e[u][1].start);DD(d,-l),DD(f,l),a={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[n][1].end)},i={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[u][1].start),end:f},o={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[n][1].end),end:Object.assign({},e[u][1].start)},r={type:l>1?"strong":"emphasis",start:Object.assign({},a.start),end:Object.assign({},i.end)},e[n][1].end=Object.assign({},a.start),e[u][1].start=Object.assign({},i.end),s=[],e[n][1].end.offset-e[n][1].start.offset&&(s=vI(s,[["enter",e[n][1],t],["exit",e[n][1],t]])),s=vI(s,[["enter",r,t],["enter",a,t],["exit",a,t],["enter",o,t]]),s=vI(s,QI(t.parser.constructs.insideSpan.null,e.slice(n+1,u),t)),s=vI(s,[["exit",o,t],["enter",i,t],["exit",i,t],["exit",r,t]]),e[u][1].end.offset-e[u][1].start.offset?(c=2,s=vI(s,[["enter",e[u][1],t],["exit",e[u][1],t]])):c=0,yI(e,n-1,u-n+3,s),u=n+s.length-c-2;break}u=-1;for(;++u13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||65535===(65535&n)||65534===(65535&n)||n>1114111?"\ufffd":String.fromCharCode(n)}const QD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function JD(e){return e.replace(QD,ez)}function ez(e,t,n){if(t)return t;if(35===n.charCodeAt(0)){const e=n.charCodeAt(1),t=120===e||88===e;return ZD(n.slice(t?2:1),t?16:10)}return OD(n)||e}const tz={}.hasOwnProperty,nz=function(t,n,r){return"string"!==typeof n&&(r=n,n=void 0),function(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:l(ne),autolinkProtocol:_,autolinkEmail:_,atxHeading:l(Q),blockQuote:l(G),characterEscape:_,characterReference:_,codeFenced:l(K),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:l(K,s),codeText:l(Y,s),codeTextData:_,data:_,codeFlowValue:_,definition:l(X),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:l(Z),hardBreakEscape:l(J),hardBreakTrailing:l(J),htmlFlow:l(ee,s),htmlFlowData:_,htmlText:l(ee,s),htmlTextData:_,image:l(te),label:s,link:l(ne),listItem:l(oe),listItemValue:m,listOrdered:l(re,p),listUnordered:l(re),paragraph:l(ae),reference:U,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:l(Q),strong:l(ie),thematicBreak:l(se)},exit:{atxHeading:u(),atxHeadingSequence:S,autolink:u(),autolinkEmail:q,autolinkProtocol:V,blockQuote:u(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:W,characterReferenceMarkerNumeric:W,characterReferenceValue:$,codeFenced:u(v),codeFencedFence:y,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:P,codeIndented:u(b),codeText:u(A),codeTextData:P,data:P,definition:u(),definitionDestinationString:k,definitionLabelString:w,definitionTitleString:x,emphasis:u(),hardBreakEscape:u(T),hardBreakTrailing:u(T),htmlFlow:u(R),htmlFlowData:P,htmlText:u(N),htmlTextData:P,image:u(D),label:L,labelText:z,lineEnding:j,link:u(I),listItem:u(),listOrdered:u(),listUnordered:u(),paragraph:u(),referenceString:H,resourceDestinationString:F,resourceTitleString:M,resource:B,setextHeading:u(C),setextHeadingLineSequence:E,setextHeadingText:O,strong:u(),thematicBreak:u()}};oz(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(e){let n={type:"root",children:[]};const r={stack:[n],tokenStack:[],config:t,enter:c,exit:d,buffer:s,resume:f,setData:a,getData:i},l=[];let u=-1;for(;++u0){const e=r.tokenStack[r.tokenStack.length-1];(e[1]||iz).call(r,void 0,e[0])}for(n.position={start:rz(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:rz(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},u=-1;++u{const n=this.data("settings");return nz(t,Object.assign({},n,e,{extensions:this.data("micromarkExtensions")||[],mdastExtensions:this.data("fromMarkdownExtensions")||[]}))}})}function sz(e){const t=[];let n=-1,r=0,o=0;for(;++n55295&&a<57344){const t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(i=String.fromCharCode(a,t),o=1):i="\ufffd"}else i=String.fromCharCode(a);i&&(t.push(e.slice(r,n),encodeURIComponent(i)),r=n+o+1,i=""),o&&(n+=o,o=0)}return t.join("")+e.slice(r)}const cz=function(e){if(void 0===e||null===e)return dz;if("string"===typeof e)return function(e){return uz(t);function t(t){return t&&t.type===e}}(e);if("object"===typeof e)return Array.isArray(e)?function(e){const t=[];let n=-1;for(;++n1?n-1:0),o=1;o":"")+")"})}return u;function u(){let c,u,d,f=[];if((!t||o(i,l,s[s.length-1]||null))&&(f=function(e){if(Array.isArray(e))return e;if("number"===typeof e)return[true,e];return[e]}(n(i,s)),false===f[0]))return f;if(i.children&&"skip"!==f[0])for(u=(r?i.children.length:-1)+a,d=s.concat(i);u>-1&&u-1?n.offset:null}}}const yz={}.hasOwnProperty;function vz(e){return String(e||"").toUpperCase()}function bz(e,t){const n=String(t.identifier).toUpperCase(),r=sz(n.toLowerCase()),o=e.footnoteOrder.indexOf(n);let a;-1===o?(e.footnoteOrder.push(n),e.footnoteCounts[n]=1,a=e.footnoteOrder.length):(e.footnoteCounts[n]++,a=o+1);const i=e.footnoteCounts[n],l={type:"element",tagName:"a",properties:{href:"#"+e.clobberPrefix+"fn-"+r,id:e.clobberPrefix+"fnref-"+r+(i>1?"-"+i:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,l);const s={type:"element",tagName:"sup",properties:{},children:[l]};return e.patch(t,s),e.applyData(t,s)}function wz(e,t){const n=t.referenceType;let r="]";if("collapsed"===n?r+="[]":"full"===n&&(r+="["+(t.label||t.identifier)+"]"),"imageReference"===t.type)return{type:"text",value:"!["+t.alt+r};const o=e.all(t),a=o[0];a&&"text"===a.type?a.value="["+a.value:o.unshift({type:"text",value:"["});const i=o[o.length-1];return i&&"text"===i.type?i.value+=r:o.push({type:"text",value:r}),o}function xz(e){const t=e.spread;return void 0===t||null===t?e.children.length>1:t}const kz=9,Sz=32;function Oz(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),o=0;const a=[];for(;r;)a.push(Ez(t.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=n.exec(t);return a.push(Ez(t.slice(o),o>0,!1)),a.join("")}function Ez(e,t,n){let r=0,o=e.length;if(t){let t=e.codePointAt(r);for(;t===kz||t===Sz;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(o-1);for(;t===kz||t===Sz;)o--,t=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}const Cz={blockquote:function(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)},break:function(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:"\n"}]},code:function(e,t){const n=t.value?t.value+"\n":"",r=t.lang?t.lang.match(/^[^ \t]+(?=[ \t]|$)/):null,o={};r&&(o.className=["language-"+r]);let a={type:"element",tagName:"code",properties:o,children:[{type:"text",value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:"element",tagName:"pre",properties:{},children:[a]},e.patch(t,a),a},delete:function(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},emphasis:function(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:bz,footnote:function(e,t){const n=e.footnoteById;let r=1;for(;r in n;)r++;const o=String(r);return n[o]={type:"footnoteDefinition",identifier:o,children:[{type:"paragraph",children:t.children}],position:t.position},bz(e,{type:"footnoteReference",identifier:o,position:t.position})},heading:function(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},html:function(e,t){if(e.dangerous){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}return null},imageReference:function(e,t){const n=e.definition(t.identifier);if(!n)return wz(e,t);const r={src:sz(n.url||""),alt:t.alt};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"img",properties:r,children:[]};return e.patch(t,o),e.applyData(t,o)},image:function(e,t){const n={src:sz(t.url)};null!==t.alt&&void 0!==t.alt&&(n.alt=t.alt),null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)},inlineCode:function(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)},linkReference:function(e,t){const n=e.definition(t.identifier);if(!n)return wz(e,t);const r={href:sz(n.url||"")};null!==n.title&&void 0!==n.title&&(r.title=n.title);const o={type:"element",tagName:"a",properties:r,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)},link:function(e,t){const n={href:sz(t.url)};null!==t.title&&void 0!==t.title&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)},listItem:function(e,t,n){const r=e.all(t),o=n?function(e){let t=!1;if("list"===e.type){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r0&&n.children.unshift({type:"text",value:" "}),n.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),a.className=["task-list-item"]}let l=-1;for(;++l0){const r={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},a=mz(t.children[1]),i=hz(t.children[t.children.length-1]);a.line&&i.line&&(r.position={start:a,end:i}),o.push(r)}const a={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(t,a),e.applyData(t,a)},tableCell:function(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)},tableRow:function(e,t,n){const r=n?n.children:void 0,o=0===(r?r.indexOf(t):1)?"th":"td",a=n&&"table"===n.type?n.align:void 0,i=a?a.length:t.children.length;let l=-1;const s=[];for(;++l{const n=vz(e.identifier);n&&!yz.call(t,n)&&(t[n]=e)})),function(e){const n=vz(e);return n&&yz.call(t,n)?t[n]:null}}(e),i.footnoteById=o,i.footnoteOrder=[],i.footnoteCounts={},i.patch=Tz,i.applyData=Rz,i.one=function(e,t){return Nz(i,e,t)},i.all=function(e){return Az(i,e)},i.wrap=Iz,i.augment=a,pz(e,"footnoteDefinition",(e=>{const t=String(e.identifier).toUpperCase();Pz.call(o,t)||(o[t]=e)})),i;function a(e,t){if(e&&"data"in e&&e.data){const n=e.data;n.hName&&("element"!==t.type&&(t={type:"element",tagName:"",properties:{},children:[]}),t.tagName=n.hName),"element"===t.type&&n.hProperties&&(t.properties={...t.properties,...n.hProperties}),"children"in t&&t.children&&n.hChildren&&(t.children=n.hChildren)}if(e){const n="type"in e?e:{position:e};(function(e){return!e||!e.position||!e.position.start||!e.position.start.line||!e.position.start.column||!e.position.end||!e.position.end.line||!e.position.end.column})(n)||(t.position={start:mz(n),end:hz(n)})}return t}function i(e,t,n,r){return Array.isArray(n)&&(r=n,n={}),a(e,{type:"element",tagName:t,properties:n||{},children:r||[]})}}function Tz(e,t){e.position&&(t.position=function(e){return{start:mz(e),end:hz(e)}}(e))}function Rz(e,t){let n=t;if(e&&e.data){const t=e.data.hName,r=e.data.hChildren,o=e.data.hProperties;"string"===typeof t&&("element"===n.type?n.tagName=t:n={type:"element",tagName:t,properties:{},children:[]}),"element"===n.type&&o&&(n.properties={...n.properties,...o}),"children"in n&&n.children&&null!==r&&void 0!==r&&(n.children=r)}return n}function Nz(e,t,n){const r=t&&t.type;if(!r)throw new Error("Expected node, got `"+t+"`");return Pz.call(e.handlers,r)?e.handlers[r](e,t,n):e.passThrough&&e.passThrough.includes(r)?"children"in t?{...t,children:Az(e,t)}:t:e.unknownHandler?e.unknownHandler(e,t,n):function(e,t){const n=t.data||{},r=!("value"in t)||Pz.call(n,"hProperties")||Pz.call(n,"hChildren")?{type:"element",tagName:"div",properties:{},children:Az(e,t)}:{type:"text",value:t.value};return e.patch(t,r),e.applyData(t,r)}(e,t)}function Az(e,t){const n=[];if("children"in t){const r=t.children;let o=-1;for(;++o0&&n.push({type:"text",value:"\n"}),n}function Dz(e,t){const n=jz(e,t),r=n.one(e,null),o=function(e){const t=[];let n=-1;for(;++n1?"-"+l:""),dataFootnoteBackref:!0,className:["data-footnote-backref"],ariaLabel:e.footnoteBackLabel},children:[{type:"text",value:"\u21a9"}]};l>1&&t.children.push({type:"element",tagName:"sup",children:[{type:"text",value:String(l)}]}),s.length>0&&s.push({type:"text",value:" "}),s.push(t)}const c=o[o.length-1];if(c&&"element"===c.type&&"p"===c.tagName){const e=c.children[c.children.length-1];e&&"text"===e.type?e.value+=" ":c.children.push({type:"text",value:" "}),c.children.push(...s)}else o.push(...s);const u={type:"element",tagName:"li",properties:{id:e.clobberPrefix+"fn-"+i},children:e.wrap(o,!0)};e.patch(r,u),t.push(u)}if(0!==t.length)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:e.footnoteLabelTagName,properties:{...JSON.parse(JSON.stringify(e.footnoteLabelProperties)),id:"footnote-label"},children:[{type:"text",value:e.footnoteLabel}]},{type:"text",value:"\n"},{type:"element",tagName:"ol",properties:{},children:e.wrap(t,!0)},{type:"text",value:"\n"}]}}(n);return o&&r.children.push({type:"text",value:"\n"},o),Array.isArray(r)?{type:"root",children:r}:r}const zz=function(e,t){return e&&"run"in e?function(e,t){return(n,r,o)=>{e.run(Dz(n,t),r,(e=>{o(e)}))}}(e,t):function(e){return t=>Dz(t,e)}(e||t)};class Lz{constructor(e,t,n){this.property=e,this.normal=t,n&&(this.space=n)}}function Fz(e,t){const n={},r={};let o=-1;for(;++o"xlink:"+t.slice(5).toLowerCase(),properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null}}),nL=eL({space:"xml",transform:(e,t)=>"xml:"+t.slice(3).toLowerCase(),properties:{xmlLang:null,xmlBase:null,xmlSpace:null}});function rL(e,t){return t in e?e[t]:t}function oL(e,t){return rL(e,t.toLowerCase())}const aL=eL({space:"xmlns",attributes:{xmlnsxlink:"xmlns:xlink"},transform:oL,properties:{xmlns:null,xmlnsXLink:null}}),iL=eL({transform:(e,t)=>"role"===t?t:"aria-"+t.slice(4).toLowerCase(),properties:{ariaActiveDescendant:null,ariaAtomic:Wz,ariaAutoComplete:null,ariaBusy:Wz,ariaChecked:Wz,ariaColCount:Vz,ariaColIndex:Vz,ariaColSpan:Vz,ariaControls:qz,ariaCurrent:null,ariaDescribedBy:qz,ariaDetails:null,ariaDisabled:Wz,ariaDropEffect:qz,ariaErrorMessage:null,ariaExpanded:Wz,ariaFlowTo:qz,ariaGrabbed:Wz,ariaHasPopup:null,ariaHidden:Wz,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:qz,ariaLevel:Vz,ariaLive:null,ariaModal:Wz,ariaMultiLine:Wz,ariaMultiSelectable:Wz,ariaOrientation:null,ariaOwns:qz,ariaPlaceholder:null,ariaPosInSet:Vz,ariaPressed:Wz,ariaReadOnly:Wz,ariaRelevant:null,ariaRequired:Wz,ariaRoleDescription:qz,ariaRowCount:Vz,ariaRowIndex:Vz,ariaRowSpan:Vz,ariaSelected:Wz,ariaSetSize:Vz,ariaSort:null,ariaValueMax:Vz,ariaValueMin:Vz,ariaValueNow:Vz,ariaValueText:null,role:null}}),lL=eL({space:"html",attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},transform:oL,mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Gz,acceptCharset:qz,accessKey:qz,action:null,allow:null,allowFullScreen:Hz,allowPaymentRequest:Hz,allowUserMedia:Hz,alt:null,as:null,async:Hz,autoCapitalize:null,autoComplete:qz,autoFocus:Hz,autoPlay:Hz,blocking:qz,capture:Hz,charSet:null,checked:Hz,cite:null,className:qz,cols:Vz,colSpan:null,content:null,contentEditable:Wz,controls:Hz,controlsList:qz,coords:Vz|Gz,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Hz,defer:Hz,dir:null,dirName:null,disabled:Hz,download:$z,draggable:Wz,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Hz,formTarget:null,headers:qz,height:Vz,hidden:Hz,high:Vz,href:null,hrefLang:null,htmlFor:qz,httpEquiv:qz,id:null,imageSizes:null,imageSrcSet:null,inert:Hz,inputMode:null,integrity:null,is:null,isMap:Hz,itemId:null,itemProp:qz,itemRef:qz,itemScope:Hz,itemType:qz,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Hz,low:Vz,manifest:null,max:null,maxLength:Vz,media:null,method:null,min:null,minLength:Vz,multiple:Hz,muted:Hz,name:null,nonce:null,noModule:Hz,noValidate:Hz,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored: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,onScrollEnd: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:Hz,optimum:Vz,pattern:null,ping:qz,placeholder:null,playsInline:Hz,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Hz,referrerPolicy:null,rel:qz,required:Hz,reversed:Hz,rows:Vz,rowSpan:Vz,sandbox:qz,scope:null,scoped:Hz,seamless:Hz,selected:Hz,shadowRootDelegatesFocus:Hz,shadowRootMode:null,shape:null,size:Vz,sizes:null,slot:null,span:Vz,spellCheck:Wz,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Vz,step:null,style:null,tabIndex:Vz,target:null,title:null,translate:null,type:null,typeMustMatch:Hz,useMap:null,value:Wz,width:Vz,wrap:null,align:null,aLink:null,archive:qz,axis:null,background:null,bgColor:null,border:Vz,borderColor:null,bottomMargin:Vz,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Hz,declare:Hz,event:null,face:null,frame:null,frameBorder:null,hSpace:Vz,leftMargin:Vz,link:null,longDesc:null,lowSrc:null,marginHeight:Vz,marginWidth:Vz,noResize:Hz,noHref:Hz,noShade:Hz,noWrap:Hz,object:null,profile:null,prompt:null,rev:null,rightMargin:Vz,rules:null,scheme:null,scrolling:Wz,standby:null,summary:null,text:null,topMargin:Vz,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Vz,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Hz,disableRemotePlayback:Hz,prefix:null,property:null,results:Vz,security:null,unselectable:null}}),sL=eL({space:"svg",attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},transform:rL,properties:{about:Kz,accentHeight:Vz,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Vz,amplitude:Vz,arabicForm:null,ascent:Vz,attributeName:null,attributeType:null,azimuth:Vz,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Vz,by:null,calcMode:null,capHeight:Vz,className:qz,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Vz,diffuseConstant:Vz,direction:null,display:null,dur:null,divisor:Vz,dominantBaseline:null,download:Hz,dx:null,dy:null,edgeMode:null,editable:null,elevation:Vz,enableBackground:null,end:null,event:null,exponent:Vz,externalResourcesRequired:null,fill:null,fillOpacity:Vz,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Gz,g2:Gz,glyphName:Gz,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Vz,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Vz,horizOriginX:Vz,horizOriginY:Vz,id:null,ideographic:Vz,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Vz,k:Vz,k1:Vz,k2:Vz,k3:Vz,k4:Vz,kernelMatrix:Kz,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Vz,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Vz,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose: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,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Vz,overlineThickness:Vz,paintOrder:null,panose1:null,path:null,pathLength:Vz,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:qz,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Vz,pointsAtY:Vz,pointsAtZ:Vz,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Kz,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Kz,rev:Kz,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Kz,requiredFeatures:Kz,requiredFonts:Kz,requiredFormats:Kz,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Vz,specularExponent:Vz,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Vz,strikethroughThickness:Vz,string:null,stroke:null,strokeDashArray:Kz,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Vz,strokeOpacity:Vz,strokeWidth:null,style:null,surfaceScale:Vz,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Kz,tabIndex:Vz,tableValues:null,target:null,targetX:Vz,targetY:Vz,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Kz,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Vz,underlineThickness:Vz,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Vz,values:null,vAlphabetic:Vz,vMathematical:Vz,vectorEffect:null,vHanging:Vz,vIdeographic:Vz,version:null,vertAdvY:Vz,vertOriginX:Vz,vertOriginY:Vz,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Vz,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null}}),cL=Fz([nL,tL,aL,iL,lL],"html"),uL=Fz([nL,tL,aL,iL,sL],"svg");function dL(e){if(e.allowedElements&&e.disallowedElements)throw new TypeError("Only one of `allowedElements` and `disallowedElements` should be defined");if(e.allowedElements||e.disallowedElements||e.allowElement)return t=>{pz(t,"element",((t,n,r)=>{const o=r;let a;if(e.allowedElements?a=!e.allowedElements.includes(t.tagName):e.disallowedElements&&(a=e.disallowedElements.includes(t.tagName)),!a&&e.allowElement&&"number"===typeof n&&(a=!e.allowElement(t,n,o)),a&&"number"===typeof n)return e.unwrapDisallowed&&t.children?o.children.splice(n,1,...t.children):o.children.splice(n,1),n}))}}var fL=n(599);function pL(e){const t=e&&"object"===typeof e&&"text"===e.type?e.value||"":e;return"string"===typeof t&&""===t.replace(/[ \t\n\f\r]/g,"")}const mL=/^data[-\w.:]+$/i,hL=/-[a-z]/g,gL=/[A-Z]/g;function yL(e){return"-"+e.toLowerCase()}function vL(e){return e.charAt(1).toUpperCase()}const bL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"};const wL=n(426),xL=["http","https","mailto","tel"];function kL(e){const t=(e||"").trim(),n=t.charAt(0);if("#"===n||"/"===n)return t;const r=t.indexOf(":");if(-1===r)return t;let o=-1;for(;++oo?t:(o=t.indexOf("#"),-1!==o&&r>o?t:"javascript:void(0)")}const SL={}.hasOwnProperty,OL=new Set(["table","thead","tbody","tfoot","tr"]);function EL(e,t){const n=[];let r,o=-1;for(;++o0?r.createElement(m,c,f):r.createElement(m,c)}function _L(e,t){let n=-1,r=0;for(;++n4&&"data"===n.slice(0,4)&&mL.test(t)){if("-"===t.charAt(4)){const e=t.slice(5).replace(hL,vL);r="data"+e.charAt(0).toUpperCase()+e.slice(1)}else{const e=t.slice(4);if(!hL.test(e)){let n=e.replace(gL,yL);"-"!==n.charAt(0)&&(n="-"+n),t="data"+n}}o=Zz}return new o(r,t)}(r.schema,t);let a=n;null!==a&&void 0!==a&&a===a&&(Array.isArray(a)&&(a=o.commaSeparated?function(e,t){const n=t||{};return(""===e[e.length-1]?[...e,""]:e).join((n.padRight?" ":"")+","+(!1===n.padLeft?"":" ")).trim()}(a):function(e){return e.join(" ").trim()}(a)),"style"===o.property&&"string"===typeof a&&(a=function(e){const t={};try{wL(e,n)}catch{}return t;function n(e,n){const r="-ms-"===e.slice(0,4)?"ms-".concat(e.slice(4)):e;t[r.replace(/-([a-z])/g,jL)]=n}}(a)),o.space&&o.property?e[SL.call(bL,o.property)?bL[o.property]:o.property]=a:o.attribute&&(e[o.attribute]=a))}function jL(e,t){return t.toUpperCase()}const TL={}.hasOwnProperty,RL="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",NL={plugins:{to:"remarkPlugins",id:"change-plugins-to-remarkplugins"},renderers:{to:"components",id:"change-renderers-to-components"},astPlugins:{id:"remove-buggy-html-in-markdown-parser"},allowDangerousHtml:{id:"remove-buggy-html-in-markdown-parser"},escapeHtml:{id:"remove-buggy-html-in-markdown-parser"},source:{to:"children",id:"change-source-to-children"},allowNode:{to:"allowElement",id:"replace-allownode-allowedtypes-and-disallowedtypes"},allowedTypes:{to:"allowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},disallowedTypes:{to:"disallowedElements",id:"replace-allownode-allowedtypes-and-disallowedtypes"},includeNodeIndex:{to:"includeElementIndex",id:"change-includenodeindex-to-includeelementindex"}};function AL(e){for(const r in NL)if(TL.call(NL,r)&&TL.call(e,r)){const e=NL[r];console.warn("[react-markdown] Warning: please ".concat(e.to?"use `".concat(e.to,"` instead of"):"remove"," `").concat(r,"` (see <").concat(RL,"#").concat(e.id,"> for more info)")),delete NL[r]}const t=aI().use(lz).use(e.remarkPlugins||[]).use(zz,{...e.remarkRehypeOptions,allowDangerousHtml:!0}).use(e.rehypePlugins||[]).use(dL,e),n=new ZA;"string"===typeof e.children?n.value=e.children:void 0!==e.children&&null!==e.children&&console.warn("[react-markdown] Warning: please pass a string as `children` (not: `".concat(e.children,"`)"));const o=t.runSync(t.parse(n),n);if("root"!==o.type)throw new TypeError("Expected a `root` node");let a=r.createElement(r.Fragment,{},EL({options:e,schema:cL,listDepth:0},o));return e.className&&(a=r.createElement("div",{className:e.className},a)),a}AL.propTypes={children:Wg.string,className:Wg.string,allowElement:Wg.func,allowedElements:Wg.arrayOf(Wg.string),disallowedElements:Wg.arrayOf(Wg.string),unwrapDisallowed:Wg.bool,remarkPlugins:Wg.arrayOf(Wg.oneOfType([Wg.object,Wg.func,Wg.arrayOf(Wg.oneOfType([Wg.bool,Wg.string,Wg.object,Wg.func,Wg.arrayOf(Wg.any)]))])),rehypePlugins:Wg.arrayOf(Wg.oneOfType([Wg.object,Wg.func,Wg.arrayOf(Wg.oneOfType([Wg.bool,Wg.string,Wg.object,Wg.func,Wg.arrayOf(Wg.any)]))])),sourcePos:Wg.bool,rawSourcePos:Wg.bool,skipHtml:Wg.bool,includeElementIndex:Wg.bool,transformLinkUri:Wg.oneOfType([Wg.func,Wg.bool]),linkTarget:Wg.oneOfType([Wg.func,Wg.string]),transformImageUri:Wg.func,components:Wg.object};const IL={tokenize:function(e,t,n){let r=0;return function t(a){if((87===a||119===a)&&r<3)return r++,e.consume(a),t;if(46===a&&3===r)return e.consume(a),o;return n(a)};function o(e){return null===e?n(e):t(e)}},partial:!0},DL={tokenize:function(e,t,n){let r,o,a;return i;function i(t){return 46===t||95===t?e.check(LL,s,l)(t):null===t||RI(t)||II(t)||45!==t&&AI(t)?s(t):(a=!0,e.consume(t),i)}function l(t){return 95===t?r=!0:(o=r,r=void 0),e.consume(t),i}function s(e){return o||r||!a?n(e):t(e)}},partial:!0},zL={tokenize:function(e,t){let n=0,r=0;return o;function o(i){return 40===i?(n++,e.consume(i),o):41===i&&r0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}HL[43]=UL,HL[45]=UL,HL[46]=UL,HL[95]=UL,HL[72]=[UL,BL],HL[104]=[UL,BL],HL[87]=[UL,ML],HL[119]=[UL,ML];const XL={tokenize:function(e,t,n){const r=this;return zI(e,(function(e){const o=r.events[r.events.length-1];return o&&"gfmFootnoteDefinitionIndent"===o[1].type&&4===o[2].sliceSerialize(o[1],!0).length?t(e):n(e)}),"gfmFootnoteDefinitionIndent",5)},partial:!0};function ZL(e,t,n){const r=this;let o=r.events.length;const a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;o--;){const e=r.events[o][1];if("labelImage"===e.type){i=e;break}if("gfmFootnoteCall"===e.type||"labelLink"===e.type||"label"===e.type||"image"===e.type||"link"===e.type)break}return function(o){if(!i||!i._balanced)return n(o);const l=cD(r.sliceSerialize({start:i.end,end:r.now()}));if(94!==l.codePointAt(0)||!a.includes(l.slice(1)))return n(o);return e.enter("gfmFootnoteCallLabelMarker"),e.consume(o),e.exit("gfmFootnoteCallLabelMarker"),t(o)}}function QL(e,t){let n,r=e.length;for(;r--;)if("labelImage"===e[r][1].type&&"enter"===e[r][0]){n=e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const o={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const i={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},i.start),end:Object.assign({},i.end)},s=[e[r+1],e[r+2],["enter",o,t],e[r+3],e[r+4],["enter",a,t],["exit",a,t],["enter",i,t],["enter",l,t],["exit",l,t],["exit",i,t],e[e.length-2],e[e.length-1],["exit",o,t]];return e.splice(r,e.length-r+1,...s),e}function JL(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,i=0;return function(t){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(t),e.exit("gfmFootnoteCallLabelMarker"),l};function l(t){return 94!==t?n(t):(e.enter("gfmFootnoteCallMarker"),e.consume(t),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",s)}function s(l){if(i>999||93===l&&!a||null===l||91===l||RI(l))return n(l);if(93===l){e.exit("chunkString");const a=e.exit("gfmFootnoteCallString");return o.includes(cD(r.sliceSerialize(a)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(l),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(l)}return RI(l)||(a=!0),i++,e.consume(l),92===l?c:s}function c(t){return 91===t||92===t||93===t?(e.consume(t),i++,s):s(t)}}function eF(e,t,n){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a,i,l=0;return function(t){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),s};function s(t){return 94===t?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",c):n(t)}function c(t){if(l>999||93===t&&!i||null===t||91===t||RI(t))return n(t);if(93===t){e.exit("chunkString");const n=e.exit("gfmFootnoteDefinitionLabelString");return a=cD(r.sliceSerialize(n)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(t),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),d}return RI(t)||(i=!0),l++,e.consume(t),92===t?u:c}function u(t){return 91===t||92===t||93===t?(e.consume(t),l++,c):c(t)}function d(t){return 58===t?(e.enter("definitionMarker"),e.consume(t),e.exit("definitionMarker"),o.includes(a)||o.push(a),zI(e,f,"gfmFootnoteDefinitionWhitespace")):n(t)}function f(e){return t(e)}}function tF(e,t,n){return e.check(BI,t,e.attempt(XL,t,n))}function nF(e){e.exit("gfmFootnoteDefinition")}function rF(e){let t=(e||{}).singleTilde;const n={tokenize:function(e,n,r){const o=this.previous,a=this.events;let i=0;return function(t){if(126===o&&"characterEscape"!==a[a.length-1][1].type)return r(t);return e.enter("strikethroughSequenceTemporary"),l(t)};function l(a){const s=AD(o);if(126===a)return i>1?r(a):(e.consume(a),i++,l);if(i<2&&!t)return r(a);const c=e.exit("strikethroughSequenceTemporary"),u=AD(a);return c._open=!u||2===u&&Boolean(s),c._close=!s||2===s&&Boolean(u),n(a)}},resolveAll:function(e,t){let n=-1;for(;++ne[0]-t[0])),0===this.map.length)return;let t=this.map.length;const n=[];for(;t>0;)t-=1,n.push(e.slice(this.map[t][0]+this.map[t][1])),n.push(this.map[t][2]),e.length=this.map[t][0];n.push([...e]),e.length=0;let r=n.pop();for(;r;)e.push(...r),r=n.pop();this.map.length=0}}function aF(e,t){let n=!1;const r=[];for(;t-1;){const e=r.events[t][1].type;if("lineEnding"!==e&&"linePrefix"!==e)break;t--}const o=t>-1?r.events[t][1].type:null,a="tableHead"===o||"tableRow"===o?w:l;if(a===w&&r.parser.lazy[r.now().line])return n(e);return a(e)};function l(t){return e.enter("tableHead"),e.enter("tableRow"),function(e){if(124===e)return s(e);return o=!0,i+=1,s(e)}(t)}function s(t){return null===t?n(t):TI(t)?i>1?(i=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(t),e.exit("lineEnding"),d):n(t):NI(t)?zI(e,s,"whitespace")(t):(i+=1,o&&(o=!1,a+=1),124===t?(e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),o=!0,s):(e.enter("data"),c(t)))}function c(t){return null===t||124===t||RI(t)?(e.exit("data"),s(t)):(e.consume(t),92===t?u:c)}function u(t){return 92===t||124===t?(e.consume(t),c):c(t)}function d(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter("tableDelimiterRow"),o=!1,NI(t)?zI(e,f,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(t):f(t))}function f(t){return 45===t||58===t?m(t):124===t?(o=!0,e.enter("tableCellDivider"),e.consume(t),e.exit("tableCellDivider"),p):b(t)}function p(t){return NI(t)?zI(e,m,"whitespace")(t):m(t)}function m(t){return 58===t?(i+=1,o=!0,e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),h):45===t?(i+=1,h(t)):null===t||TI(t)?v(t):b(t)}function h(t){return 45===t?(e.enter("tableDelimiterFiller"),g(t)):b(t)}function g(t){return 45===t?(e.consume(t),g):58===t?(o=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(t),e.exit("tableDelimiterMarker"),y):(e.exit("tableDelimiterFiller"),y(t))}function y(t){return NI(t)?zI(e,v,"whitespace")(t):v(t)}function v(n){return 124===n?f(n):(null===n||TI(n))&&o&&a===i?(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(n)):b(n)}function b(e){return n(e)}function w(t){return e.enter("tableRow"),x(t)}function x(n){return 124===n?(e.enter("tableCellDivider"),e.consume(n),e.exit("tableCellDivider"),x):null===n||TI(n)?(e.exit("tableRow"),t(n)):NI(n)?zI(e,x,"whitespace")(n):(e.enter("data"),k(n))}function k(t){return null===t||124===t||RI(t)?(e.exit("data"),x(t)):(e.consume(t),92===t?S:k)}function S(t){return 92===t||124===t?(e.consume(t),k):k(t)}},resolveAll:function(e,t){let n,r,o,a=-1,i=!0,l=0,s=[0,0,0,0],c=[0,0,0,0],u=!1,d=0;const f=new oF;for(;++an[2]+1){const t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[["exit",i,t]])}return void 0!==o&&(a.end=Object.assign({},cF(t.events,o)),e.add(o,0,[["exit",a,t]]),a=void 0),a}function sF(e,t,n,r,o){const a=[],i=cF(t.events,n);o&&(o.end=Object.assign({},i),a.push(["exit",o,t])),r.end=Object.assign({},i),a.push(["exit",r,t]),e.add(n+1,0,a)}function cF(e,t){const n=e[t],r="enter"===n[0]?"start":"end";return n[1][r]}const uF={tokenize:function(e,t,n){const r=this;return function(t){if(null!==r.previous||!r._gfmTasklistFirstContentOfListItem)return n(t);return e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),o};function o(t){return RI(t)?(e.enter("taskListCheckValueUnchecked"),e.consume(t),e.exit("taskListCheckValueUnchecked"),a):88===t||120===t?(e.enter("taskListCheckValueChecked"),e.consume(t),e.exit("taskListCheckValueChecked"),a):n(t)}function a(t){return 93===t?(e.enter("taskListCheckMarker"),e.consume(t),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),i):n(t)}function i(r){return TI(r)?t(r):NI(r)?e.check({tokenize:fF},t,n)(r):n(r)}}},dF={text:{91:uF}};function fF(e,t,n){return zI(e,(function(e){return null===e?n(e):t(e)}),"whitespace")}function pF(e,t){const n=String(e);if("string"!==typeof t)throw new TypeError("Expected character");let r=0,o=n.indexOf(t);for(;-1!==o;)r++,o=n.indexOf(t,o+t.length);return r}const mF={}.hasOwnProperty,hF=function(e,t,n,r){let o,a;"string"===typeof t||t instanceof RegExp?(a=[[t,n]],o=r):(a=t,o=n),o||(o={});const i=cz(o.ignore||[]),l=function(e){const t=[];if("object"!==typeof e)throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let n=-1;for(;++n0?{type:"text",value:l}:void 0),!1!==l&&(a!==n&&u.push({type:"text",value:e.value.slice(a,n)}),Array.isArray(l)?u.push(...l):l&&u.push(l),a=n+d[0].length,c=!0),!r.global)break;d=r.exec(e.value)}c?(ae}const vF="phrasing",bF=["autolink","link","image","label"],wF={transforms:[function(e){hF(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,SF],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,OF]],{ignore:["link","linkReference"]})}],enter:{literalAutolink:function(e){this.enter({type:"link",title:null,url:"",children:[]},e)},literalAutolinkEmail:kF,literalAutolinkHttp:kF,literalAutolinkWww:kF},exit:{literalAutolink:function(e){this.exit(e)},literalAutolinkEmail:function(e){this.config.exit.autolinkEmail.call(this,e)},literalAutolinkHttp:function(e){this.config.exit.autolinkProtocol.call(this,e)},literalAutolinkWww:function(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}}},xF={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:vF,notInConstruct:bF},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:vF,notInConstruct:bF},{character:":",before:"[ps]",after:"\\/",inConstruct:vF,notInConstruct:bF}]};function kF(e){this.config.enter.autolinkProtocol.call(this,e)}function SF(e,t,n,r,o){let a="";if(!EF(o))return!1;if(/^w/i.test(t)&&(n=t+n,t="",a="http://"),!function(e){const t=e.split(".");if(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))return!1;return!0}(n))return!1;const i=function(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const o=pF(e,"(");let a=pF(e,")");for(;-1!==r&&o>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),a++;return[e,n]}(n+r);if(!i[0])return!1;const l={type:"link",title:null,url:a+t+i[0],children:[{type:"text",value:t+i[0]}]};return i[1]?[l,{type:"text",value:i[1]}]:l}function OF(e,t,n,r){return!(!EF(r,!0)||/[-\d_]$/.test(n))&&{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function EF(e,t){const n=e.input.charCodeAt(e.index-1);return(0===e.index||II(n)||AI(n))&&(!t||47!==n)}function CF(e){return e.label||!e.identifier?e.label||"":JD(e.identifier)}function _F(e,t,n,r){let o=r.join.length;for(;o--;){const a=r.join[o](e,t,n,r);if(!0===a||1===a)break;if("number"===typeof a)return"\n".repeat(1+a);if(!1===a)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const PF=/\r?\n|\r/g;function jF(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function TF(e,t){return RF(e,t.inConstruct,!0)&&!RF(e,t.notInConstruct,!1)}function RF(e,t,n){if("string"===typeof t&&(t=[t]),!t||0===t.length)return n;let r=-1;for(;++r=c||(e+10?" ":"")),o.shift(4),a+=o.move(function(e,t){const n=[];let r,o=0,a=0;for(;r=PF.exec(e);)i(e.slice(o,r.index)),n.push(r[0]),o=r.index+r[0].length,a++;return i(e.slice(o)),n.join("");function i(e){n.push(t(e,a,!e))}}(function(e,t,n){const r=t.indexStack,o=e.children||[],a=t.createTracker(n),i=[];let l=-1;for(r.push(-1);++l0&&("\r"===l||"\n"===l)&&"html"===c.type&&(a[a.length-1]=a[a.length-1].replace(/(\r?\n|\r)$/," "),l=" ",s=t.createTracker(n),s.move(a.join(""))),a.push(s.move(t.handle(c,e,t,{...s.current(),before:l,after:u}))),l=a[a.length-1].slice(-1)}return r.pop(),a.join("")}$F.peek=function(){return"["};XF.peek=function(){return"~"};const KF={canContainEols:["delete"],enter:{strikethrough:function(e){this.enter({type:"delete",children:[]},e)}},exit:{strikethrough:function(e){this.exit(e)}}},YF={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"]}],handlers:{delete:XF}};function XF(e,t,n,r){const o=DF(r),a=n.enter("strikethrough");let i=o.move("~~");return i+=GF(e,n,{...o.current(),before:i,after:"~"}),i+=o.move("~~"),a(),i}function ZF(e,t,n){let r=e.value||"",o="`",a=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++a"none"===e?null:e)),children:[]},e),this.setData("inTable",!0)},tableData:nM,tableHeader:nM,tableRow:function(e){this.enter({type:"tableRow",children:[]},e)}},exit:{codeText:function(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,rM));const n=this.stack[this.stack.length-1];n.value=t,this.exit(e)},table:function(e){this.exit(e),this.setData("inTable")},tableData:tM,tableHeader:tM,tableRow:tM}};function tM(e){this.exit(e)}function nM(e){this.enter({type:"tableCell",children:[]},e)}function rM(e,t){return"|"===t?t:e}function oM(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,o=t.stringLength,a=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:"\n",inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[\t :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:function(e,t,n,r){return l(function(e,t,n){const r=e.children;let o=-1;const a=[],i=t.enter("table");for(;++o1&&void 0!==arguments[1]?arguments[1]:{};const n=(t.align||[]).concat(),r=t.stringLength||QF,o=[],a=[],i=[],l=[];let s=0,c=-1;for(;++cs&&(s=e[c].length);++dl[d])&&(l[d]=e)}n.push(a)}a[c]=n,i[c]=o}var u;let d=-1;if("object"===typeof n&&"length"in n)for(;++dl[d]&&(l[d]=a),p[d]=a),f[d]=i}a.splice(1,0,f),i.splice(1,0,p),c=-1;const m=[];for(;++c-1?t.start:1)+(!1===n.options.incrementListMarker?0:t.children.indexOf(e))+a);let i=a.length+1;("tab"===o||"mixed"===o&&(t&&"list"===t.type&&t.spread||e.spread))&&(i=4*Math.ceil(i/4));const l=n.createTracker(r);l.move(a+" ".repeat(i-a.length)),l.shift(i);const s=n.enter("listItem"),c=n.indentLines(n.containerFlow(e,l.current()),(function(e,t,n){if(t)return(n?"":" ".repeat(i))+e;return(n?a:a+" ".repeat(i-a.length))+e}));return s(),c}const iM={exit:{taskListCheckValueChecked:sM,taskListCheckValueUnchecked:sM,paragraph:function(e){const t=this.stack[this.stack.length-2];if(t&&"listItem"===t.type&&"boolean"===typeof t.checked){const e=this.stack[this.stack.length-1],n=e.children[0];if(n&&"text"===n.type){const r=t.children;let o,a=-1;for(;++a0&&void 0!==arguments[0]?arguments[0]:{};const t=this.data();function n(e,n){(t[e]?t[e]:t[e]=[]).push(n)}n("micromarkExtensions",function(e){return wI([WL,{document:{91:{tokenize:eF,continuation:{tokenize:tF},exit:nF}},text:{91:{tokenize:JL},93:{add:"after",tokenize:ZL,resolveTo:QL}}},rF(e),iF,dF])}(e)),n("fromMarkdownExtensions",[wF,{enter:{gfmFootnoteDefinition:zF,gfmFootnoteDefinitionLabelString:LF,gfmFootnoteCall:BF,gfmFootnoteCallString:UF},exit:{gfmFootnoteDefinition:MF,gfmFootnoteDefinitionLabelString:FF,gfmFootnoteCall:WF,gfmFootnoteCallString:HF}},KF,eM,iM]),n("toMarkdownExtensions",function(e){return{extensions:[xF,{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:VF,footnoteReference:$F}},YF,oM(e),lM]}}(e))}function uM(e){let{level:t,children:n,...r}=e;return(0,oy.jsx)(Py,{order:t,...r,children:n})}function dM(e){let{content:t}=e;return(0,oy.jsx)(AL,{remarkPlugins:[[cM,{singleTilde:!1}]],components:{code(e){let{inline:t,className:n,children:r,...o}=e;const a=/language-(\w+)/.exec(n||"");return t?(0,oy.jsx)("code",{className:n,...o,children:r}):(0,oy.jsx)(BR,{language:a?a[1]:"",...o,style:{maxWidth:"100%",minWidth:"100%",overflow:"auto"},children:String(r).replace(/\n$/,"")})},h1:uM,h2:uM,h3:uM,h4:uM,h5:uM,h6:uM,p(e){let{children:t}=e;return(0,oy.jsx)(ca,{style:{whiteSpace:"pre-wrap"},children:t})}},children:t||""})}const fM=(0,r.memo)((function(e){let{schema:t,data:n,onChangeData:o}=e;const{readOnly:a}=(0,r.useContext)(ry);if("string"===t.type){const e=n||"";return a?(0,oy.jsx)("div",{style:{padding:"0.5em"},children:(0,oy.jsx)(FA,{maxHeight:200,showLabel:"Show more",hideLabel:"Hide",initialState:!1,transitionDuration:300,children:(0,oy.jsx)(dM,{content:e})})}):(0,oy.jsx)(Hg,{value:e,onChange:e=>o(e.target.value),disabled:a,placeholder:a?"":"Type a prompt"})}return null}));var pM=ey("edit","IconEdit",[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]]);const mM=(0,r.memo)((function(e){return null}));var hM=Object.defineProperty,gM=Object.getOwnPropertySymbols,yM=Object.prototype.hasOwnProperty,vM=Object.prototype.propertyIsEnumerable,bM=(e,t,n)=>t in e?hM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,wM=(e,t)=>{for(var n in t||(t={}))yM.call(t,n)&&bM(e,n,t[n]);if(gM)for(var n of gM(t))vM.call(t,n)&&bM(e,n,t[n]);return e};function xM(e){const t=e,{width:n,height:o,style:a}=t,i=((e,t)=>{var n={};for(var r in e)yM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&gM)for(var r of gM(e))t.indexOf(r)<0&&vM.call(e,r)&&(n[r]=e[r]);return n})(t,["width","height","style"]);return r.createElement("svg",wM({viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:wM({width:n,height:o},a)},i),r.createElement("path",{d:"M2.5 1H12.5C13.3284 1 14 1.67157 14 2.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V2.5C1 1.67157 1.67157 1 2.5 1ZM2.5 2C2.22386 2 2 2.22386 2 2.5V8.3636L3.6818 6.6818C3.76809 6.59551 3.88572 6.54797 4.00774 6.55007C4.12975 6.55216 4.24568 6.60372 4.32895 6.69293L7.87355 10.4901L10.6818 7.6818C10.8575 7.50607 11.1425 7.50607 11.3182 7.6818L13 9.3636V2.5C13 2.22386 12.7761 2 12.5 2H2.5ZM2 12.5V9.6364L3.98887 7.64753L7.5311 11.4421L8.94113 13H2.5C2.22386 13 2 12.7761 2 12.5ZM12.5 13H10.155L8.48336 11.153L11 8.6364L13 10.6364V12.5C13 12.7761 12.7761 13 12.5 13ZM6.64922 5.5C6.64922 5.03013 7.03013 4.64922 7.5 4.64922C7.96987 4.64922 8.35078 5.03013 8.35078 5.5C8.35078 5.96987 7.96987 6.35078 7.5 6.35078C7.03013 6.35078 6.64922 5.96987 6.64922 5.5ZM7.5 3.74922C6.53307 3.74922 5.74922 4.53307 5.74922 5.5C5.74922 6.46693 6.53307 7.25078 7.5 7.25078C8.46693 7.25078 9.25078 6.46693 9.25078 5.5C9.25078 4.53307 8.46693 3.74922 7.5 3.74922Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"}))}var kM=Object.defineProperty,SM=Object.defineProperties,OM=Object.getOwnPropertyDescriptors,EM=Object.getOwnPropertySymbols,CM=Object.prototype.hasOwnProperty,_M=Object.prototype.propertyIsEnumerable,PM=(e,t,n)=>t in e?kM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,jM=(e,t)=>{for(var n in t||(t={}))CM.call(t,n)&&PM(e,n,t[n]);if(EM)for(var n of EM(t))_M.call(t,n)&&PM(e,n,t[n]);return e},TM=(e,t)=>SM(e,OM(t)),RM=gn(((e,t)=>{let{radius:n}=t;return{root:{},imageWrapper:{position:"relative"},figure:{margin:0},image:TM(jM({},e.fn.fontStyles()),{display:"block",width:"100%",height:"100%",border:0,borderRadius:e.fn.radius(n)}),caption:{color:"dark"===e.colorScheme?e.colors.dark[2]:e.colors.gray[7],marginTop:e.spacing.xs},placeholder:TM(jM({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",color:"dark"===e.colorScheme?e.colors.dark[2]:e.colors.gray[6],backgroundColor:"dark"===e.colorScheme?e.colors.dark[8]:e.colors.gray[0],borderRadius:e.fn.radius(n)})}}));const NM=RM;var AM=Object.defineProperty,IM=Object.defineProperties,DM=Object.getOwnPropertyDescriptors,zM=Object.getOwnPropertySymbols,LM=Object.prototype.hasOwnProperty,FM=Object.prototype.propertyIsEnumerable,MM=(e,t,n)=>t in e?AM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,BM=(e,t)=>{for(var n in t||(t={}))LM.call(t,n)&&MM(e,n,t[n]);if(zM)for(var n of zM(t))FM.call(t,n)&&MM(e,n,t[n]);return e};const UM={fit:"cover",width:"100%",height:"auto",radius:0},HM=(0,r.forwardRef)(((e,t)=>{const n=Ht("Image",UM,e),{className:o,alt:a,src:i,fit:l,width:s,height:c,radius:u,imageProps:d,withPlaceholder:f,placeholder:p,imageRef:m,classNames:h,styles:g,caption:y,unstyled:v,style:b,variant:w}=n,x=((e,t)=>{var n={};for(var r in e)LM.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&zM)for(var r of zM(e))t.indexOf(r)<0&&FM.call(e,r)&&(n[r]=e[r]);return n})(n,["className","alt","src","fit","width","height","radius","imageProps","withPlaceholder","placeholder","imageRef","classNames","styles","caption","unstyled","style","variant"]),{classes:k,cx:S}=NM({radius:u},{classNames:h,styles:g,unstyled:v,name:"Image",variant:w}),[O,E]=(0,r.useState)(!i),C=f&&O;return jc((()=>{E(!i)}),[i]),r.createElement(Jn,BM({className:S(k.root,o),style:BM({width:We(s)},b),ref:t},x),r.createElement("figure",{className:k.figure},r.createElement("div",{className:k.imageWrapper},r.createElement("img",((e,t)=>IM(e,DM(t)))(BM({src:i,alt:a,ref:m},d),{className:S(k.image,null==d?void 0:d.className),onError:e=>{E(!0),"function"===typeof(null==d?void 0:d.onError)&&d.onError(e)},style:BM(BM({objectFit:l,width:We(s),height:We(c)},C&&{overflow:"hidden"}),null==d?void 0:d.style)})),C&&r.createElement("div",{className:k.placeholder,title:a},p||r.createElement("div",null,r.createElement(xM,{width:We(40),height:We(40)})))),!!y&&r.createElement(ca,{component:"figcaption",size:"sm",align:"center",className:k.caption},y)))}));HM.displayName="@mantine/core/Image";const WM=(0,r.memo)((function(e){let{mimeType:t,content:n}=e;switch((null!==t&&void 0!==t?t:"text/plain").split("/",1)[0]){case"image":return(0,oy.jsx)(HM,{alt:"Attachment image",src:n,maw:300});case"audio":return(0,oy.jsx)("audio",{controls:!0,children:(0,oy.jsx)("source",{src:n,type:t})});default:return(0,oy.jsx)("span",{children:n})}})),$M=(0,r.memo)((function(e){var t;let{schema:n,attachment:o,onUpdateMetadata:a,onRemoveAttachment:i,onEditAttachment:l}=e;const{readOnly:s}=(0,r.useContext)(ry);return(0,oy.jsxs)(ja,{display:"flex",children:[(0,oy.jsxs)(wa,{direction:"column",children:[l&&!s&&(0,oy.jsx)(vo,{onClick:l,children:(0,oy.jsx)(Au,{label:"Edit attachment",children:(0,oy.jsx)(pM,{size:16})})}),i&&!s&&(0,oy.jsx)(vo,{onClick:i,children:(0,oy.jsx)(Au,{label:"Remove attachment",children:(0,oy.jsx)(ty,{size:16,color:"red"})})})]}),(0,oy.jsx)(WM,{mimeType:o.mime_type,content:o.data.value}),(null===(t=n.items.properties)||void 0===t?void 0:t.metadata)&&(0,oy.jsx)(mM,{schema:n.items.properties.metadata,attachment:o,onUpdateMetadata:a})]})}));var VM=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 qM(e,t){var n=function(e){var t=e.name;if(t&&-1!==t.lastIndexOf(".")&&!e.type){var n=t.split(".").pop().toLowerCase(),r=VM.get(n);r&&Object.defineProperty(e,"type",{value:r,writable:!1,configurable:!1,enumerable:!0})}return e}(e);if("string"!==typeof n.path){var r=e.webkitRelativePath;Object.defineProperty(n,"path",{value:"string"===typeof t?t:"string"===typeof r&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}var GM=[".DS_Store","Thumbs.db"];function KM(e){return"object"===typeof e&&null!==e}function YM(e){return JM(e.target.files).map((function(e){return qM(e)}))}function XM(e){return sv(this,void 0,void 0,(function(){return cv(this,(function(t){switch(t.label){case 0:return[4,Promise.all(e.map((function(e){return e.getFile()})))];case 1:return[2,t.sent().map((function(e){return qM(e)}))]}}))}))}function ZM(e,t){return sv(this,void 0,void 0,(function(){var n;return cv(this,(function(r){switch(r.label){case 0:return e.items?(n=JM(e.items).filter((function(e){return"file"===e.kind})),"drop"!==t?[2,n]:[4,Promise.all(n.map(eB))]):[3,2];case 1:return[2,QM(tB(r.sent()))];case 2:return[2,QM(JM(e.files).map((function(e){return qM(e)})))]}}))}))}function QM(e){return e.filter((function(e){return-1===GM.indexOf(e.name)}))}function JM(e){if(null===e)return[];for(var t=[],n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);nn)return[!1,bB(n)];if(e.sizen)return[!1,bB(n)]}return[!0,null]}function OB(e){return void 0!==e&&null!==e}function EB(e){return"function"===typeof e.isPropagationStopped?e.isPropagationStopped():"undefined"!==typeof e.cancelBubble&&e.cancelBubble}function CB(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,(function(e){return"Files"===e||"application/x-moz-file"===e})):!!e.target&&!!e.target.files}function _B(e){e.preventDefault()}function PB(){for(var e=arguments.length,t=new Array(e),n=0;n1?n-1:0),o=1;oe.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}var WB=(0,r.forwardRef)((function(e,t){var n=e.children,o=qB(HB(e,RB)),a=o.open,i=HB(o,NB);return(0,r.useImperativeHandle)(t,(function(){return{open:a}}),[a]),r.createElement(r.Fragment,null,n(BB(BB({},i),{},{open:a})))}));WB.displayName="Dropzone";var $B={disabled:!1,getFilesFromEvent:function(e){return sv(this,void 0,void 0,(function(){return cv(this,(function(t){return KM(e)&&KM(e.dataTransfer)?[2,ZM(e.dataTransfer,e.type)]:function(e){return KM(e)&&KM(e.target)}(e)?[2,YM(e)]:Array.isArray(e)&&e.every((function(e){return"getFile"in e&&"function"===typeof e.getFile}))?[2,XM(e)]:[2,[]]}))}))},maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};WB.defaultProps=$B,WB.propTypes={children:$g().func,accept:$g().objectOf($g().arrayOf($g().string)),multiple:$g().bool,preventDropOnDocument:$g().bool,noClick:$g().bool,noKeyboard:$g().bool,noDrag:$g().bool,noDragEventsBubbling:$g().bool,minSize:$g().number,maxSize:$g().number,maxFiles:$g().number,disabled:$g().bool,getFilesFromEvent:$g().func,onFileDialogCancel:$g().func,onFileDialogOpen:$g().func,useFsAccessApi:$g().bool,autoFocus:$g().bool,onDragEnter:$g().func,onDragLeave:$g().func,onDragOver:$g().func,onDrop:$g().func,onDropAccepted:$g().func,onDropRejected:$g().func,onError:$g().func,validator:$g().func};var VB={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function qB(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=BB(BB({},$B),e),n=t.accept,o=t.disabled,a=t.getFilesFromEvent,i=t.maxSize,l=t.minSize,s=t.multiple,c=t.maxFiles,u=t.onDragEnter,d=t.onDragLeave,f=t.onDragOver,p=t.onDrop,m=t.onDropAccepted,h=t.onDropRejected,g=t.onFileDialogCancel,y=t.onFileDialogOpen,v=t.useFsAccessApi,b=t.autoFocus,w=t.preventDropOnDocument,x=t.noClick,k=t.noKeyboard,S=t.noDrag,O=t.noDragEventsBubbling,E=t.onError,C=t.validator,_=(0,r.useMemo)((function(){return function(e){if(OB(e))return Object.entries(e).reduce((function(e,t){var n=dB(t,2),r=n[0],o=n[1];return[].concat(lB(e),[r],lB(o))}),[]).filter((function(e){return jB(e)||TB(e)})).join(",")}(n)}),[n]),P=(0,r.useMemo)((function(){return function(e){if(OB(e)){var t=Object.entries(e).filter((function(e){var t=dB(e,2),n=t[0],r=t[1],o=!0;return jB(n)||(console.warn('Skipped "'.concat(n,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),o=!1),Array.isArray(r)&&r.every(TB)||(console.warn('Skipped "'.concat(n,'" because an invalid file extension was provided.')),o=!1),o})).reduce((function(e,t){var n=dB(t,2),r=n[0],o=n[1];return cB(cB({},e),{},uB({},r,o))}),{});return[{description:"Files",accept:t}]}return e}(n)}),[n]),j=(0,r.useMemo)((function(){return"function"===typeof y?y:KB}),[y]),T=(0,r.useMemo)((function(){return"function"===typeof g?g:KB}),[g]),R=(0,r.useRef)(null),N=(0,r.useRef)(null),A=zB((0,r.useReducer)(GB,VB),2),I=A[0],D=A[1],z=I.isFocused,L=I.isFileDialogActive,F=(0,r.useRef)("undefined"!==typeof window&&window.isSecureContext&&v&&"showOpenFilePicker"in window),M=function(){!F.current&&L&&setTimeout((function(){N.current&&(N.current.files.length||(D({type:"closeDialog"}),T()))}),300)};(0,r.useEffect)((function(){return window.addEventListener("focus",M,!1),function(){window.removeEventListener("focus",M,!1)}}),[N,L,T,F]);var B=(0,r.useRef)([]),U=function(e){R.current&&R.current.contains(e.target)||(e.preventDefault(),B.current=[])};(0,r.useEffect)((function(){return w&&(document.addEventListener("dragover",_B,!1),document.addEventListener("drop",U,!1)),function(){w&&(document.removeEventListener("dragover",_B),document.removeEventListener("drop",U))}}),[R,w]),(0,r.useEffect)((function(){return!o&&b&&R.current&&R.current.focus(),function(){}}),[R,b,o]);var H=(0,r.useCallback)((function(e){E?E(e):console.error(e)}),[E]),W=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),ne(e),B.current=[].concat(DB(B.current),[e.target]),CB(e)&&Promise.resolve(a(e)).then((function(t){if(!EB(e)||O){var n=t.length,r=n>0&&function(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,a=e.multiple,i=e.maxFiles,l=e.validator;return!(!a&&t.length>1||a&&i>=1&&t.length>i)&&t.every((function(e){var t=dB(kB(e,n),1)[0],a=dB(SB(e,r,o),1)[0],i=l?l(e):null;return t&&a&&!i}))}({files:t,accept:_,minSize:l,maxSize:i,multiple:s,maxFiles:c,validator:C});D({isDragAccept:r,isDragReject:n>0&&!r,isDragActive:!0,type:"setDraggedFiles"}),u&&u(e)}})).catch((function(e){return H(e)}))}),[a,u,H,O,_,l,i,s,c,C]),$=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),ne(e);var t=CB(e);if(t&&e.dataTransfer)try{e.dataTransfer.dropEffect="copy"}catch(n){}return t&&f&&f(e),!1}),[f,O]),V=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),ne(e);var t=B.current.filter((function(e){return R.current&&R.current.contains(e)})),n=t.indexOf(e.target);-1!==n&&t.splice(n,1),B.current=t,t.length>0||(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),CB(e)&&d&&d(e))}),[R,d,O]),q=(0,r.useCallback)((function(e,t){var n=[],r=[];e.forEach((function(e){var t=zB(kB(e,_),2),o=t[0],a=t[1],s=zB(SB(e,l,i),2),c=s[0],u=s[1],d=C?C(e):null;if(o&&c&&!d)n.push(e);else{var f=[a,u];d&&(f=f.concat(d)),r.push({file:e,errors:f.filter((function(e){return e}))})}})),(!s&&n.length>1||s&&c>=1&&n.length>c)&&(n.forEach((function(e){r.push({file:e,errors:[xB]})})),n.splice(0)),D({acceptedFiles:n,fileRejections:r,type:"setFiles"}),p&&p(n,r,t),r.length>0&&h&&h(r,t),n.length>0&&m&&m(n,t)}),[D,s,_,l,i,c,p,m,h,C]),G=(0,r.useCallback)((function(e){e.preventDefault(),e.persist(),ne(e),B.current=[],CB(e)&&Promise.resolve(a(e)).then((function(t){EB(e)&&!O||q(t,e)})).catch((function(e){return H(e)})),D({type:"reset"})}),[a,q,H,O]),K=(0,r.useCallback)((function(){if(F.current){D({type:"openDialog"}),j();var e={multiple:s,types:P};window.showOpenFilePicker(e).then((function(e){return a(e)})).then((function(e){q(e,null),D({type:"closeDialog"})})).catch((function(e){!function(e){return e instanceof DOMException&&("AbortError"===e.name||e.code===e.ABORT_ERR)}(e)?!function(e){return e instanceof DOMException&&("SecurityError"===e.name||e.code===e.SECURITY_ERR)}(e)?H(e):(F.current=!1,N.current?(N.current.value=null,N.current.click()):H(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no was provided."))):(T(e),D({type:"closeDialog"}))}))}else N.current&&(D({type:"openDialog"}),j(),N.current.value=null,N.current.click())}),[D,j,T,v,q,H,P,s]),Y=(0,r.useCallback)((function(e){R.current&&R.current.isEqualNode(e.target)&&(" "!==e.key&&"Enter"!==e.key&&32!==e.keyCode&&13!==e.keyCode||(e.preventDefault(),K()))}),[R,K]),X=(0,r.useCallback)((function(){D({type:"focus"})}),[]),Z=(0,r.useCallback)((function(){D({type:"blur"})}),[]),Q=(0,r.useCallback)((function(){x||(!function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.navigator.userAgent;return function(e){return-1!==e.indexOf("MSIE")||-1!==e.indexOf("Trident/")}(e)||function(e){return-1!==e.indexOf("Edge/")}(e)}()?K():setTimeout(K,0))}),[x,K]),J=function(e){return o?null:e},ee=function(e){return k?null:J(e)},te=function(e){return S?null:J(e)},ne=function(e){O&&e.stopPropagation()},re=(0,r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.role,a=e.onKeyDown,i=e.onFocus,l=e.onBlur,s=e.onClick,c=e.onDragEnter,u=e.onDragOver,d=e.onDragLeave,f=e.onDrop,p=HB(e,AB);return BB(BB(UB({onKeyDown:ee(PB(a,Y)),onFocus:ee(PB(i,X)),onBlur:ee(PB(l,Z)),onClick:J(PB(s,Q)),onDragEnter:te(PB(c,W)),onDragOver:te(PB(u,$)),onDragLeave:te(PB(d,V)),onDrop:te(PB(f,G)),role:"string"===typeof r&&""!==r?r:"presentation"},n,R),o||k?{}:{tabIndex:0}),p)}}),[R,Y,X,Z,Q,W,$,V,G,k,S,o]),oe=(0,r.useCallback)((function(e){e.stopPropagation()}),[]),ae=(0,r.useMemo)((function(){return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.refKey,n=void 0===t?"ref":t,r=e.onChange,o=e.onClick,a=HB(e,IB);return BB(BB({},UB({accept:_,multiple:s,type:"file",style:{display:"none"},onChange:J(PB(r,G)),onClick:J(PB(o,oe)),tabIndex:-1},n,N)),a)}}),[N,n,s,G,o]);return BB(BB({},I),{},{isFocused:z&&!o,getRootProps:re,getInputProps:ae,rootRef:R,inputRef:N,open:J(K)})}function GB(e,t){switch(t.type){case"focus":return BB(BB({},e),{},{isFocused:!0});case"blur":return BB(BB({},e),{},{isFocused:!1});case"openDialog":return BB(BB({},VB),{},{isFileDialogActive:!0});case"closeDialog":return BB(BB({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return BB(BB({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return BB(BB({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return BB({},VB);default:return e}}function KB(){}var YB=Object.defineProperty,XB=Object.defineProperties,ZB=Object.getOwnPropertyDescriptors,QB=Object.getOwnPropertySymbols,JB=Object.prototype.hasOwnProperty,eU=Object.prototype.propertyIsEnumerable,tU=(e,t,n)=>t in e?YB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,nU=(e,t)=>{for(var n in t||(t={}))JB.call(t,n)&&tU(e,n,t[n]);if(QB)for(var n of QB(t))eU.call(t,n)&&tU(e,n,t[n]);return e},rU=(e,t)=>XB(e,ZB(t)),oU=gn((e=>({root:rU(nU({},e.fn.cover()),{display:"flex",alignItems:"center",justifyContent:"center",overflow:"hidden"})})));const aU=oU;var iU=Object.defineProperty,lU=Object.defineProperties,sU=Object.getOwnPropertyDescriptors,cU=Object.getOwnPropertySymbols,uU=Object.prototype.hasOwnProperty,dU=Object.prototype.propertyIsEnumerable,fU=(e,t,n)=>t in e?iU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,pU=(e,t)=>{for(var n in t||(t={}))uU.call(t,n)&&fU(e,n,t[n]);if(cU)for(var n of cU(t))dU.call(t,n)&&fU(e,n,t[n]);return e},mU=(e,t)=>lU(e,sU(t));const hU={overlayOpacity:.75,transitionDuration:0,radius:0,zIndex:Fi("overlay")},gU=(0,r.forwardRef)(((e,t)=>{const n=Ht("LoadingOverlay",hU,e),{className:o,visible:a,loaderProps:i,overlayOpacity:l,overlayColor:s,transitionDuration:c,exitTransitionDuration:u,zIndex:d,style:f,loader:p,radius:m,overlayBlur:h,unstyled:g,variant:y,keepMounted:v}=n,b=((e,t)=>{var n={};for(var r in e)uU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&cU)for(var r of cU(e))t.indexOf(r)<0&&dU.call(e,r)&&(n[r]=e[r]);return n})(n,["className","visible","loaderProps","overlayOpacity","overlayColor","transitionDuration","exitTransitionDuration","zIndex","style","loader","radius","overlayBlur","unstyled","variant","keepMounted"]),{classes:w,cx:x,theme:k}=aU(null,{name:"LoadingOverlay",unstyled:g,variant:y}),S="calc(".concat(d," + 1)");return r.createElement(eu,{keepMounted:v,duration:c,exitDuration:u,mounted:a,transition:"fade"},(e=>r.createElement(Jn,pU({className:x(w.root,o),style:mU(pU(pU({},e),f),{zIndex:d}),ref:t},b),p?r.createElement("div",{style:{zIndex:S}},p):r.createElement(Vr,pU({style:{zIndex:S}},i)),r.createElement(Eb,{opacity:l,zIndex:d,radius:m,blur:h,unstyled:g,color:s||("dark"===k.colorScheme?k.colors.dark[5]:k.white)}))))}));gU.displayName="@mantine/core/LoadingOverlay";const[yU,vU]=Hf("Dropzone component was not found in tree");function bU(e){return"string"!==typeof e?"":e.charAt(0).toUpperCase()+e.slice(1)}var wU=Object.getOwnPropertySymbols,xU=Object.prototype.hasOwnProperty,kU=Object.prototype.propertyIsEnumerable;function SU(e){const t=t=>{const n=Ht("Dropzone".concat(bU(e)),{},t),{children:o}=n,a=((e,t)=>{var n={};for(var r in e)xU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&wU)for(var r of wU(e))t.indexOf(r)<0&&kU.call(e,r)&&(n[r]=e[r]);return n})(n,["children"]),i=vU(),l=Ai(o)?o:r.createElement("span",null,o);return i[e]?(0,r.cloneElement)(l,a):null};return t.displayName="@mantine/dropzone/".concat(bU(e)),t}const OU=SU("accept"),EU=SU("reject"),CU=SU("idle");var _U=Object.defineProperty,PU=Object.defineProperties,jU=Object.getOwnPropertyDescriptors,TU=Object.getOwnPropertySymbols,RU=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,AU=(e,t,n)=>t in e?_U(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,IU=(e,t)=>{for(var n in t||(t={}))RU.call(t,n)&&AU(e,n,t[n]);if(TU)for(var n of TU(t))NU.call(t,n)&&AU(e,n,t[n]);return e},DU=(e,t)=>PU(e,jU(t)),zU=gn(((e,t)=>{let{padding:n,radius:r}=t;const o=e.fn.variant({color:"red",variant:"light"}),a=e.fn.variant({color:e.primaryColor,variant:"light"});return{root:DU(IU(IU({},e.fn.fontStyles()),e.fn.focusStyles()),{boxSizing:"border-box",backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.white,border:"".concat(We(2)," dashed ").concat("dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[4]),padding:Ve({size:n,sizes:e.spacing}),borderRadius:e.fn.radius(r),cursor:"pointer",userSelect:"none",transition:"background-color 150ms ease",position:"relative","&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[5]:e.colors.gray[0]},"&[data-loading]":{cursor:"default","&:hover":{backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.white}},"&[data-accept]":{backgroundColor:"dark"===e.colorScheme?a.background:e.colors[e.primaryColor][0],borderColor:"dark"===e.colorScheme?a.border:e.colors[e.primaryColor][4],"&:hover":{backgroundColor:"dark"===e.colorScheme?a.background:e.colors[e.primaryColor][0]}},"&[data-reject]":{backgroundColor:"dark"===e.colorScheme?o.background:e.colors.red[0],borderColor:"dark"===e.colorScheme?o.border:e.colors.red[4],"&:hover":{backgroundColor:"dark"===e.colorScheme?o.background:e.colors.red[0]}}}),inner:{pointerEvents:"none",userSelect:"none"}}}));const LU=zU;var FU=Object.defineProperty,MU=Object.defineProperties,BU=Object.getOwnPropertyDescriptors,UU=Object.getOwnPropertySymbols,HU=Object.prototype.hasOwnProperty,WU=Object.prototype.propertyIsEnumerable,$U=(e,t,n)=>t in e?FU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,VU=(e,t)=>{for(var n in t||(t={}))HU.call(t,n)&&$U(e,n,t[n]);if(UU)for(var n of UU(t))WU.call(t,n)&&$U(e,n,t[n]);return e},qU=(e,t)=>MU(e,BU(t)),GU=(e,t)=>{var n={};for(var r in e)HU.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&UU)for(var r of UU(e))t.indexOf(r)<0&&WU.call(e,r)&&(n[r]=e[r]);return n};const KU={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0};function YU(e){const t=Ht("Dropzone",KU,e),{className:n,padding:o,radius:a,disabled:i,classNames:l,styles:s,loading:c,multiple:u,maxSize:d,accept:f,children:p,onDropAny:m,onDrop:h,onReject:g,openRef:y,name:v,unstyled:b,maxFiles:w,autoFocus:x,activateOnClick:k,activateOnDrag:S,dragEventsBubbling:O,activateOnKeyboard:E,onDragEnter:C,onDragLeave:_,onDragOver:P,onFileDialogCancel:j,onFileDialogOpen:T,preventDropOnDocument:R,useFsAccessApi:N,getFilesFromEvent:A,validator:I,variant:D}=t,z=GU(t,["className","padding","radius","disabled","classNames","styles","loading","multiple","maxSize","accept","children","onDropAny","onDrop","onReject","openRef","name","unstyled","maxFiles","autoFocus","activateOnClick","activateOnDrag","dragEventsBubbling","activateOnKeyboard","onDragEnter","onDragLeave","onDragOver","onFileDialogCancel","onFileDialogOpen","preventDropOnDocument","useFsAccessApi","getFilesFromEvent","validator","variant"]),{classes:L,cx:F}=LU({radius:a,padding:o},{name:"Dropzone",classNames:l,styles:s,unstyled:b,variant:D}),{getRootProps:M,getInputProps:B,isDragAccept:U,isDragReject:H,open:W}=qB(VU({onDrop:m,onDropAccepted:h,onDropRejected:g,disabled:i||c,accept:Array.isArray(f)?f.reduce(((e,t)=>qU(VU({},e),{[t]:[]})),{}):f,multiple:u,maxSize:d,maxFiles:w,autoFocus:x,noClick:!k,noDrag:!S,noDragEventsBubbling:!O,noKeyboard:!E,onDragEnter:C,onDragLeave:_,onDragOver:P,onFileDialogCancel:j,onFileDialogOpen:T,preventDropOnDocument:R,useFsAccessApi:N,validator:I},A?{getFilesFromEvent:A}:null));Ii(y,W);const $=!U&&!H;return r.createElement(yU,{value:{accept:U,reject:H,idle:$}},r.createElement(Jn,qU(VU(VU({},z),M()),{"data-accept":U||void 0,"data-reject":H||void 0,"data-idle":$||void 0,"data-loading":c||void 0,className:F(L.root,n)}),r.createElement(gU,{visible:c,radius:a,unstyled:b}),r.createElement("input",qU(VU({},B()),{name:v})),r.createElement("div",{className:L.inner},p)))}YU.displayName="@mantine/dropzone/Dropzone",YU.Accept=OU,YU.Reject=EU,YU.Idle=CU;const XU=YU;var ZU=Object.defineProperty,QU=Object.defineProperties,JU=Object.getOwnPropertyDescriptors,eH=Object.getOwnPropertySymbols,tH=Object.prototype.hasOwnProperty,nH=Object.prototype.propertyIsEnumerable,rH=(e,t,n)=>t in e?ZU(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,oH=(e,t)=>{for(var n in t||(t={}))tH.call(t,n)&&rH(e,n,t[n]);if(eH)for(var n of eH(t))nH.call(t,n)&&rH(e,n,t[n]);return e},aH=(e,t)=>QU(e,JU(t)),iH=gn((e=>({wrapper:aH(oH({},e.fn.cover(0)),{position:"fixed",backgroundColor:"dark"===e.colorScheme?e.colors.dark[7]:e.white,display:"flex",padding:e.spacing.xs,transition:"opacity 100ms ease"}),dropzone:{flex:1}})));const lH=iH;var sH=Object.defineProperty,cH=Object.defineProperties,uH=Object.getOwnPropertyDescriptors,dH=Object.getOwnPropertySymbols,fH=Object.prototype.hasOwnProperty,pH=Object.prototype.propertyIsEnumerable,mH=(e,t,n)=>t in e?sH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,hH=(e,t)=>{for(var n in t||(t={}))fH.call(t,n)&&mH(e,n,t[n]);if(dH)for(var n of dH(t))pH.call(t,n)&&mH(e,n,t[n]);return e},gH=(e,t)=>cH(e,uH(t));const yH={padding:"md",loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Fi("max"),withinPortal:!0};function vH(e){const t=Ht("DropzoneFullScreen",yH,e),{classNames:n,styles:o,sx:a,className:i,style:l,unstyled:s,active:c,onDrop:u,onReject:d,zIndex:f,withinPortal:p,portalProps:m}=t,h=((e,t)=>{var n={};for(var r in e)fH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&dH)for(var r of dH(e))t.indexOf(r)<0&&pH.call(e,r)&&(n[r]=e[r]);return n})(t,["classNames","styles","sx","className","style","unstyled","active","onDrop","onReject","zIndex","withinPortal","portalProps"]),[g,y]=r.useState(0),[v,{open:b,close:w}]=Cx(!1),{classes:x,cx:k}=lH(null,{name:"DropzoneFullScreen",classNames:n,styles:o,unstyled:s}),S=e=>{e.dataTransfer.types.includes("Files")&&(y((e=>e+1)),b())},O=()=>{y((e=>e-1))};return(0,r.useEffect)((()=>{0===g&&w()}),[g]),(0,r.useEffect)((()=>{if(c)return document.addEventListener("dragenter",S,!1),document.addEventListener("dragleave",O,!1),()=>{document.removeEventListener("dragenter",S,!1),document.removeEventListener("dragleave",O,!1)}}),[c]),r.createElement(yc,gH(hH({},m),{withinPortal:p}),r.createElement(Jn,{className:k(x.wrapper,i),sx:a,style:gH(hH({},l),{opacity:v?1:0,pointerEvents:v?"all":"none",zIndex:f})},r.createElement(YU,gH(hH({},h),{classNames:n,styles:o,unstyled:s,className:x.dropzone,onDrop:e=>{null==u||u(e),w()},onReject:e=>{null==d||d(e),w()}}))))}vH.displayName="@mantine/dropzone/DropzoneFullScreen",XU.FullScreen=vH;const bH=XU;var wH=ey("x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);async function xH(e){const t=Math.round(1e4*Math.random()),n="https://s3.amazonaws.com/lastmileai.aiconfig.public/",r="uploads/".concat(function(){const e=new Date,t="".concat(e.getFullYear(),"_").concat(e.getMonth()+1,"_").concat(e.getDate()),n="".concat(e.getUTCHours(),"_").concat(e.getUTCMinutes(),"_").concat(e.getUTCSeconds());return"".concat(t,"_").concat(n)}(),"/").concat(t,"/").concat(e.name.replace(/[_+]/g,"_"));const o=new FormData;o.append("key",r),o.append("acl","public-read"),o.append("Content-Type",e.type),o.append("success_action_status","201"),o.append("file",e);const a=await fetch(n,{method:"POST",mode:"cors",cache:"no-cache",body:o,headers:{Authorization:""}});if(a.ok&&201===a.status)return{url:"".concat(n).concat(r)};throw new Error("Error uploading to S3!")}function kH(e){return e.items.mime_types.join(", ")}const SH=(0,r.memo)((function(e){let{schema:t,onUploadAttachments:n,onCancel:o}=e;const[a,i]=(0,r.useState)([]),[l,s]=(0,r.useState)("idle"),[c,u]=(0,r.useState)(null),{readOnly:d}=(0,r.useContext)(ry),f=t.items.max_size;return(0,oy.jsxs)("div",{children:[("upload_error"===l||"dropzone_error"===l)&&c&&(0,oy.jsx)(ca,{size:"xs",color:"red",children:c}),(0,oy.jsxs)(ja,{display:"flex",children:[o&&(0,oy.jsx)(vo,{onClick:o,children:(0,oy.jsx)(Au,{label:"Cancel",children:(0,oy.jsx)(wH,{size:16})})}),(0,oy.jsx)(bH,{multiple:!0,onDrop:e=>{s("idle"),i(e),(async e=>{if("dropzone_error"===l)return;let t=[];try{var r;if(e.length>0&&(s("uploading"),t=await Promise.all(e.map((async e=>({url:(await xH(e)).url,mimeType:e.type}))))),!(null===(r=t[0])||void 0===r?void 0:r.url))throw new Error("Error uploading file");s("success");const o=t.map((e=>({data:{value:e.url,kind:"file_uri"},mime_type:e.mimeType})));n(o)}catch(o){s("upload_error");const e=o instanceof Error?o.message:"Error uploading file";u(e)}})(e)},onReject:e=>{var t,n,r,o;s("dropzone_error");const a=null===e||void 0===e||null===(t=e[0])||void 0===t||null===(n=t.file)||void 0===n?void 0:n.name,i=null===e||void 0===e||null===(r=e[0])||void 0===r||null===(o=r.errors)||void 0===o?void 0:o[0];u(function(e,t){let n="Failed to upload file".concat(t?" ".concat(t):"");return"file-too-large"===(null===e||void 0===e?void 0:e.code)?n+=": File too large. Please upload a smaller file":null!==e&&void 0!==e&&e.message&&(n+=": ".concat(e.message)),n}(i,a))},accept:t.items.mime_types,disabled:d,children:a.length>0?"".concat(a.length," File(s) Uploading..."):(0,oy.jsxs)("div",{children:[(0,oy.jsx)(Py,{order:4,children:"Upload File"}),(0,oy.jsxs)(ca,{fz:"sm",c:"dimmed",children:["Supported files: ",kH(t)]}),f&&(0,oy.jsxs)(ca,{fz:"sm",c:"dimmed",children:["Max file size: ",f,"MB"]})]})})]})]})}));function OH(e){let{schema:t,attachment:n,onUpdateAttachment:o,onAddAttachments:a,onRemoveAttachment:i}=e;const[l,s]=(0,r.useState)(null==(null===n||void 0===n?void 0:n.data)),{readOnly:c}=(0,r.useContext)(ry);return(0,oy.jsx)(ja,{m:"xs",children:n&&!l?(0,oy.jsx)($M,{attachment:n,schema:t,onUpdateMetadata:e=>o({...n,metadata:e}),onRemoveAttachment:i,onEditAttachment:()=>s(!0)}):(0,oy.jsx)(SH,{schema:t,onUploadAttachments:e=>{a(e),s(!1)},onCancel:n?()=>s(!1):void 0})})}const EH=(0,r.memo)((function(e){let{schema:t,onChangeAttachments:n,attachments:r=[]}=e;const o=(e,t)=>{const o=[...r];o[t]=e,n(o)},a=(e,t)=>{let o;o=t>r.length?[...r,...e]:r.reduce(((n,r,o)=>o===t?[...n,...e]:[...n,r]),[]),n(o)},i=r.length;return(0,oy.jsxs)(oy.Fragment,{children:[r.map(((e,i)=>(0,oy.jsx)(OH,{attachment:e,schema:t,onUpdateAttachment:e=>o(e,i),onAddAttachments:e=>a(e,i),onRemoveAttachment:()=>(e=>{const t=[...r.slice(0,e),...r.slice(e+1)];n(t)})(i)},"".concat(JSON.stringify(e.data),"-").concat(i)))),(null==t.max_items||io(e,i+1),onAddAttachments:e=>a(e,i+1)},i)]})}));function CH(e){let{input:t,schema:n,onChangeInput:r}=e;const{data:o,attachments:a,...i}=n.properties;if("string"===typeof t)throw new Error("Expected input type object but got string");const{data:l,attachments:s,...c}=t;return(0,oy.jsxs)(wa,{direction:"column",children:[o&&(0,oy.jsx)(fM,{schema:o,data:l,onChangeData:e=>{r({...t,data:e})}}),a&&(0,oy.jsx)(EH,{schema:a,onChangeAttachments:e=>{r({...t,attachments:e})},attachments:null!==s&&void 0!==s?s:[]})]})}const _H=(0,r.memo)((function(e){const{readOnly:t}=(0,r.useContext)(ry);return"string"===e.schema.type?e.input&&"string"!==typeof e.input?(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsx)(ca,{color:"red",children:"Expected input type string"}),(0,oy.jsx)(VN,{content:e.input})]}):t?(0,oy.jsx)("div",{style:{padding:"0.5em"},children:(0,oy.jsx)(FA,{maxHeight:200,showLabel:"Show more",hideLabel:"Hide",initialState:!1,transitionDuration:300,children:(0,oy.jsx)(dM,{content:e.input})})}):(0,oy.jsx)(Hg,{value:e.input,label:"Prompt",onChange:t=>e.onChangeInput(t.target.value),placeholder:"Type a prompt",autosize:!0}):(0,oy.jsx)(CH,{...e,schema:e.schema})})),PH=(0,r.memo)((function(e){let{input:t,onChangeInput:n}=e;const{readOnly:o}=(0,r.useContext)(ry);return o?(0,oy.jsx)("div",{style:{padding:"0.5em"},children:(0,oy.jsx)(FA,{maxHeight:200,showLabel:"Show more",hideLabel:"Hide",initialState:!1,transitionDuration:300,children:(0,oy.jsx)(dM,{content:t})})}):(0,oy.jsx)(Hg,{value:t,onChange:e=>n(e.target.value),disabled:o})})),jH={anyOf:[{type:"object",additionalProperties:{},properties:{data:{description:"Input to the model. This can represent a single input, or multiple inputs.\nThe structure of the data object is up to the ModelParser. Attachments field should be leveraged for non-text inputs (e.g. image, audio)."},attachments:{description:"Used to include non-text inputs (e.g. image, audio) of specified MIME types in the prompt",type:"array",items:{$ref:"#/definitions/Attachment"}}}},{type:"string"}],definitions:{Attachment:{description:"Data of specified MIME type to attach to a prompt",type:"object",required:["data"],properties:{mime_type:{description:"MIME type of the attachment. If not specified, the MIME type will be assumed to be text/plain.",type:"string"},data:{description:"Data representing the attachment"},metadata:{description:"Attachment metadata.",type:"object",additionalProperties:{}}}}}},TH=(0,r.memo)((function(e){let{input:t,onChangeInput:n}=e;const o=(0,r.useCallback)((e=>{n(e)}),[n]);return(0,oy.jsx)(VN,{content:t,onChange:o,schema:jH})}));var RH=ey("player-stop","IconPlayerStop",[["path",{d:"M5 5m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}]]),NH=ey("player-play-filled","IconPlayerPlayFilled",[["path",{d:"M6 4v16a1 1 0 0 0 1.524 .852l13 -8a1 1 0 0 0 0 -1.704l-13 -8a1 1 0 0 0 -1.524 .852z",fill:"currentColor",key:"svg-0",strokeWidth:"0"}]]);const AH=(0,r.memo)((function(e){let{cancel:t,runPrompt:n,isRunning:o=!1,disabled:a=!1}=e;const{readOnly:i}=(0,r.useContext)(ry),l=a||i,s=(0,oy.jsx)(Ni,{onClick:async()=>o?await t():await n(),disabled:l,p:"xs",size:"xs",className:"runPromptButton",children:o?(0,oy.jsxs)(wa,{align:"center",justify:"center",children:[(0,oy.jsx)(Vr,{style:{position:"absolute"},size:"xs",color:"white"}),(0,oy.jsx)(RH,{fill:"white",size:14})]}):(0,oy.jsx)(oy.Fragment,{children:(0,oy.jsx)(NH,{size:"16"})})});return l?i?s:(0,oy.jsx)(Au,{label:"Can't run while another prompt is running",withArrow:!0,children:(0,oy.jsx)("div",{children:s})}):s})),IH=gn((()=>({promptInputButtonWrapper:{marginLeft:"4px"},promptInputRendererWrapper:{width:"100%"}})));function DH(e){let{input:t,toggleJSONEditor:n,renderRunButton:r}=e;const{classes:o}=IH(),{resetBoundary:a}=tA();return(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsxs)(wa,{direction:"column",children:[(0,oy.jsx)(ca,{color:"red",size:"sm",children:"Invalid input format for model. Toggle JSON editor to update"}),(0,oy.jsxs)(wa,{children:[(0,oy.jsx)("div",{className:o.promptInputRendererWrapper,children:(0,oy.jsx)(VN,{content:t})}),r()]})]}),(0,oy.jsx)(wa,{justify:"flex-end",children:(0,oy.jsx)(ZN,{isRawJSON:!1,setIsRawJSON:()=>{a(),n()}})})]})}const zH=(0,r.memo)((function(e){let{input:t,schema:n,onChangeInput:o,onCancelRun:a,onRunPrompt:i,isRunning:l=!1,isRunButtonDisabled:s=!1}=e;const{classes:c}=IH(),[u,d]=(0,r.useState)(!1),f=(0,oy.jsx)(wa,{justify:"flex-end",children:(0,oy.jsx)(ZN,{isRawJSON:u,setIsRawJSON:d})}),p=(0,oy.jsx)("div",{className:c.promptInputButtonWrapper,children:(0,oy.jsx)(AH,{isRunning:l,disabled:s,cancel:a,runPrompt:i})}),m=(0,oy.jsxs)(wa,{children:[(0,oy.jsx)("div",{className:c.promptInputRendererWrapper,children:n?(0,oy.jsx)(_H,{input:t,schema:n,onChangeInput:o}):(0,oy.jsx)(PH,{input:t,onChangeInput:o})}),p]});return(0,oy.jsx)(oy.Fragment,{children:u?(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsxs)(wa,{children:[(0,oy.jsx)(TH,{input:t,onChangeInput:o}),p]}),(0,oy.jsx)(wa,{justify:"flex-end",children:f})]}):(0,oy.jsxs)(eA,{fallbackRender:()=>(0,oy.jsx)(DH,{input:t,toggleJSONEditor:()=>d(!0),renderRunButton:()=>p}),children:[m,(0,oy.jsx)(wa,{justify:"flex-end",children:f})]})})})),LH=(0,r.memo)((function(e){let{children:t,copyContent:n,output:o,withRawJSONToggle:a=!1}=e;const[i,l]=(0,r.useState)(!1);return(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsxs)(wa,{justify:"flex-end",children:[n&&(0,oy.jsx)(Yy,{value:n}),a&&(0,oy.jsx)(Au,{label:"Toggle raw JSON",withArrow:!0,children:(0,oy.jsx)(vo,{onClick:()=>l((e=>!e)),children:i?(0,oy.jsx)(YN,{size:"1rem"}):(0,oy.jsx)(XN,{size:"1rem"})})})]}),i?(0,oy.jsx)(VN,{content:o}):(0,oy.jsx)(oy.Fragment,{children:t})]})}));function FH(e){let{output:t}=e;return(0,oy.jsx)(wa,{direction:"column",children:(0,oy.jsxs)(Uo,{color:"red",title:t.ename,children:[(0,oy.jsx)(dM,{content:t.evalue}),(0,oy.jsx)(dM,{content:t.traceback.join("\n")})]})})}const MH=(0,r.memo)((function(e){let{output:t}=e;if(null==t.data)return(0,oy.jsx)(VN,{content:t});if("string"===typeof t.data)return(0,oy.jsx)(LH,{copyContent:t.data,output:t,withRawJSONToggle:!0,children:(0,oy.jsx)(dM,{content:t.data})});if("object"===typeof t.data&&!Array.isArray(t.data)&&Object.prototype.hasOwnProperty.call(t.data,"kind"))switch(t.data.kind){case"file_uri":return(0,oy.jsx)(LH,{copyContent:t.data.value,output:t,withRawJSONToggle:!0,children:(0,oy.jsx)(WM,{mimeType:t.mime_type,content:t.data.value})});case"base64":return(0,oy.jsx)(LH,{copyContent:t.data.value,output:t,withRawJSONToggle:!0,children:(0,oy.jsx)(WM,{mimeType:t.mime_type,content:"data:".concat(t.mime_type,";base64, ").concat(t.data.value)})});default:return(0,oy.jsx)(VN,{content:t.data.value})}return(0,oy.jsx)(VN,{content:t.data})})),BH=(0,r.memo)((function(e){let{output:t}=e;switch(t.output_type){case"execute_result":return(0,oy.jsx)(MH,{output:t});case"error":return(0,oy.jsx)(FH,{output:t})}})),UH=(0,r.memo)((function(e){let{outputs:t}=e;return t.map(((e,t)=>(0,oy.jsx)(BH,{output:e},t)))})),HH=(0,r.createContext)({padding:0}),WH=HH.Provider;var $H=gn(((e,t)=>{let{padding:n,withBorder:r,inheritPadding:o}=t;const a=Ve({size:n,sizes:e.spacing}),i="calc(-1 * ".concat(a,")"),l="dark"===e.colorScheme?e.colors.dark[4]:e.colors.gray[3];return{cardSection:{display:"block",marginLeft:i,marginRight:i,paddingLeft:o?a:void 0,paddingRight:o?a:void 0,borderTop:r?"".concat(We(1)," solid ").concat(l):void 0,borderBottom:r?"".concat(We(1)," solid ").concat(l):void 0,"& + &":{borderTop:0},"&[data-first]":{marginTop:i,borderTop:0,borderBottom:r?"".concat(We(1)," solid ").concat(l):void 0},"&[data-last]":{marginBottom:i,borderBottom:0}}}}));const VH=$H;var qH=Object.defineProperty,GH=Object.getOwnPropertySymbols,KH=Object.prototype.hasOwnProperty,YH=Object.prototype.propertyIsEnumerable,XH=(e,t,n)=>t in e?qH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const ZH={withBorder:!1,inheritPadding:!1},QH=(0,r.forwardRef)(((e,t)=>{const n=Ht("CardSection",ZH,e),{className:o,withBorder:a,inheritPadding:i,unstyled:l,variant:s}=n,c=((e,t)=>{var n={};for(var r in e)KH.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&GH)for(var r of GH(e))t.indexOf(r)<0&&YH.call(e,r)&&(n[r]=e[r]);return n})(n,["className","withBorder","inheritPadding","unstyled","variant"]),{classes:u,cx:d}=VH({padding:(0,r.useContext)(HH).padding,withBorder:a,inheritPadding:i},{name:"Card",unstyled:l,variant:s});return r.createElement(Jn,((e,t)=>{for(var n in t||(t={}))KH.call(t,n)&&XH(e,n,t[n]);if(GH)for(var n of GH(t))YH.call(t,n)&&XH(e,n,t[n]);return e})({className:d(u.cardSection,o),ref:t},c))}));QH.displayName="@mantine/core/CardSection";const JH=QH;var eW=gn((e=>({root:{position:"relative",overflow:"hidden",backgroundColor:"dark"===e.colorScheme?e.colors.dark[6]:e.white}})));const tW=eW;var nW=Object.defineProperty,rW=Object.getOwnPropertySymbols,oW=Object.prototype.hasOwnProperty,aW=Object.prototype.propertyIsEnumerable,iW=(e,t,n)=>t in e?nW(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;const lW={padding:"md"},sW=(0,r.forwardRef)(((e,t)=>{const n=Ht("Card",lW,e),{className:o,padding:a,radius:i,children:l,unstyled:s,variant:c}=n,u=((e,t)=>{var n={};for(var r in e)oW.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&rW)for(var r of rW(e))t.indexOf(r)<0&&aW.call(e,r)&&(n[r]=e[r]);return n})(n,["className","padding","radius","children","unstyled","variant"]),{classes:d,cx:f}=tW(null,{name:"Card",unstyled:s,variant:c}),p=r.Children.toArray(l),m=p.map(((e,t)=>"object"===typeof e&&e&&"type"in e&&e.type===JH?(0,r.cloneElement)(e,{variant:c,padding:a,"data-first":0===t||void 0,"data-last":t===p.length-1||void 0}):e));return r.createElement(WH,{value:{padding:a}},r.createElement(tw,((e,t)=>{for(var n in t||(t={}))oW.call(t,n)&&iW(e,n,t[n]);if(rW)for(var n of rW(t))aW.call(t,n)&&iW(e,n,t[n]);return e})({className:f(d.root,o),radius:i,p:a,ref:t},u),m))}));sW.Section=JH,sW.displayName="@mantine/core/Card";const cW=sW,uW=(0,r.memo)((function(){return(0,oy.jsxs)(wa,{direction:"column",mt:"0.5em",children:[(0,oy.jsx)(pE,{size:"sm",className:"divider"}),(0,oy.jsx)(ca,{color:"dimmed",size:"xs",className:"monoFont",children:"Output"})]})})),dW=(0,r.memo)((function(e){let{promptId:t,name:n,onUpdate:o}=e;const{getState:a,readOnly:i}=(0,r.useContext)(ry),[l,s]=(0,r.useState)(n);return(0,oy.jsx)(yg,{value:l,label:"Prompt Name",className:"ghost",variant:"unstyled",placeholder:"Name this prompt",onChange:e=>{s(e.currentTarget.value),o(e.currentTarget.value)},disabled:i,error:a().prompts.some((e=>e.name===l&&e._ui.id!==t))?"Name already exists":null})})),fW=(0,r.memo)((function(e){let{prompt:t,getModels:n,onSetModel:o,defaultConfigModelName:a}=e;const{mode:i}=(0,r.useContext)(ry),{readOnly:l}=(0,r.useContext)(ry),[s,c]=(0,r.useState)(Pf(t,a)),[u,d]=(0,r.useState)(!0),[f,p]=(0,r.useState)(Pf(t,a)),m=qO(u?"":null!==f&&void 0!==f?f:"",n),h=e=>{c(e),o(e)};return(0,oy.jsx)(dC,{placeholder:"Select ".concat("gradio"===i?"task":"model"),limit:100,className:"ghost",label:"gradio"===i?"HuggingFace Task":"Model",variant:"unstyled",maxDropdownHeight:200,disabled:l,rightSection:s?(0,oy.jsx)(Ni,{size:"xs",variant:"subtle",className:"ghost",mr:10,onClick:()=>{h(void 0),d(!0),p("")},children:(0,oy.jsx)(wH,{size:10})}):null,filter:(e,t)=>{if(u)return!0;return t.value.toLocaleLowerCase().includes(e.toLocaleLowerCase().trim())},data:m,value:f,onChange:e=>{p(e),d(!1),h(e),m.some((t=>{if(t===e)return d(!0),!0}))}})})),pW=(0,r.memo)((function(e){let{prompt:t,cancel:n,getModels:o,onChangePromptInput:a,onChangePromptName:i,defaultConfigModelName:l,onRunPrompt:s,onUpdateModel:c,onUpdateModelSettings:u,onUpdateParameters:d,isRunButtonDisabled:f=!1}=e;const p=t._ui.id,m=(0,r.useCallback)((e=>a(p,e)),[p,a]),h=(0,r.useCallback)((e=>i(p,e)),[p,i]),g=(0,r.useCallback)((e=>u(p,e)),[p,u]),y=(0,r.useCallback)((e=>d(p,e)),[p,d]),v=(0,r.useCallback)((async()=>await s(p)),[p,s]),b=(0,r.useCallback)((async()=>{if(n)return t._ui.cancellationToken?await n(t._ui.cancellationToken):void console.log("Warning: No cancellation token found for prompt: ".concat(t.name))}),[t.name,t._ui.cancellationToken,n]),w=(0,r.useCallback)((e=>c(p,e)),[p,c]),x=Tf(t,l),k=null===x||void 0===x?void 0:x.input;return(0,oy.jsxs)(wa,{justify:"space-between",w:"100%",children:[(0,oy.jsx)(cW,{withBorder:!0,className:"cellStyle",children:(0,oy.jsxs)(wa,{direction:"column",children:[(0,oy.jsxs)(wa,{justify:"space-between",mb:"0.5em",children:[(0,oy.jsx)(dW,{promptId:p,name:t.name,onUpdate:h}),(0,oy.jsx)(fW,{getModels:o,prompt:t,onSetModel:w,defaultConfigModelName:l})]}),(0,oy.jsx)(zH,{input:t.input,schema:k,onChangeInput:m,onCancelRun:b,onRunPrompt:v,isRunning:t._ui.isRunning,isRunButtonDisabled:f}),(0,oy.jsx)(uW,{}),t.outputs&&(0,oy.jsx)(UH,{outputs:t.outputs})]})}),(0,oy.jsx)("div",{className:"sidePanel",children:(0,oy.jsx)(dA,{prompt:t,promptSchema:x,onUpdateModelSettings:g,onUpdateParameters:y})})]})})),mW=gn((e=>({promptsContainer:{[e.fn.smallerThan("sm")]:{padding:"0 0 200px 0"},paddingBottom:400}}))),hW=(0,r.memo)((function(e){const{classes:t}=mW(),{readOnly:n}=(0,r.useContext)(ry);return(0,oy.jsxs)(ja,{maw:"80rem",className:t.promptsContainer,children:[!n&&(0,oy.jsx)(YO,{getModels:e.getModels,addPrompt:t=>e.onAddPrompt(0,t)}),e.prompts.map(((t,r)=>{const o=void 0!==e.runningPromptId&&e.runningPromptId!==t._ui.id;return(0,oy.jsxs)(zm,{children:[(0,oy.jsxs)(wa,{mt:"md",children:[!n&&(0,oy.jsx)(QO,{promptId:t._ui.id,onDeletePrompt:()=>e.onDeletePrompt(t._ui.id)}),(0,oy.jsx)(pW,{prompt:t,getModels:e.getModels,onChangePromptInput:e.onChangePromptInput,onChangePromptName:e.onChangePromptName,cancel:e.cancelRunPrompt,onRunPrompt:e.onRunPrompt,onUpdateModel:e.onUpdatePromptModel,onUpdateModelSettings:e.onUpdatePromptModelSettings,onUpdateParameters:e.onUpdatePromptParameters,defaultConfigModelName:e.defaultModel,isRunButtonDisabled:o})]}),!n&&(0,oy.jsx)(YO,{getModels:e.getModels,addPrompt:t=>e.onAddPrompt(r+1,t)})]},t._ui.id)}))]})}));function gW(e){var t,n;let{aiconfig:o,callbacks:a,mode:i,readOnly:l=!1,themeMode:s}=e;const[c,u]=(0,r.useState)(!1),[d,f]=(0,r.useState)("OK"),[p,m]=(0,r.useReducer)(Df,(h=o,{...h,prompts:h.prompts.map((e=>({...e,_ui:{id:(0,zf.uniqueId)()}}))),_ui:{isDirty:!1}}));var h;const g=(0,r.useRef)(p);g.current=p;const y=null===a||void 0===a?void 0:a.logEventHandler,v=null===a||void 0===a?void 0:a.download,b=(0,r.useCallback)((async()=>{if(v)try{await v()}catch(ZG){var e;const n=null!==(e=ZG.message)&&void 0!==e?e:null;Lu({title:"Error downloading AIConfig",message:n,color:"red"})}}),[v]),w=null===a||void 0===a?void 0:a.share,x=(0,r.useCallback)((async()=>{if(w)try{const{share_url:e}=await w();return e}catch(ZG){var e;const n=null!==(e=ZG.message)&&void 0!==e?e:null;Lu({title:"Error sharing AIConfig",message:n,color:"red"})}}),[w]),k=null===a||void 0===a?void 0:a.save,S=(0,r.useCallback)((async()=>{if(k){u(!0);try{await k(Ff(g.current)),m({type:"SAVE_CONFIG_SUCCESS"})}catch(ZG){var e;const n=null!==(e=ZG.message)&&void 0!==e?e:null;Lu({title:"Error saving",message:n,color:"red"})}finally{u(!1)}}}),[k]),O=null===a||void 0===a?void 0:a.updatePrompt,E=(0,r.useMemo)((()=>{if(O)return(0,zf.debounce)((async(e,t,n,r)=>{try{const r=await O(e,t);null!==r&&void 0!==r&&r.aiconfig&&n(r.aiconfig)}catch(ZG){r(ZG)}}),Ay)}),[O]),C=(0,r.useCallback)((async(e,t)=>{if(!E)return;const n={type:"UPDATE_PROMPT_INPUT",id:e,input:t};m(n);const r=e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error updating prompt input",message:n,color:"red"})};try{const o=Mf(g.current,e);if(!o)throw new Error("Could not find prompt with id ".concat(e));const a=Lf(o);await E(a.name,{...a,input:t},(e=>m({type:"CONSOLIDATE_AICONFIG",action:n,config:e})),r)}catch(ZG){r(ZG)}}),[E,m]),_=(0,r.useCallback)((async(e,t)=>{if(!E)return;const n=e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error updating prompt name",message:n,color:"red"})};try{const r=Mf(g.current,e);if(!r)throw new Error("Could not find prompt with id ".concat(e));const o=Lf(r);await E(o.name,{...o,name:t},(()=>m({type:"UPDATE_PROMPT_NAME",id:e,name:t})),n)}catch(ZG){n(ZG)}}),[E]),P=null===a||void 0===a?void 0:a.updateModel,j=(0,r.useMemo)((()=>{if(P)return(0,zf.debounce)((async(e,t)=>{try{await P(e)}catch(ZG){t(ZG)}}),Ay)}),[P]),T=(0,r.useCallback)((async(e,t)=>{if(!j)return;m({type:"UPDATE_PROMPT_MODEL_SETTINGS",id:e,modelSettings:t});const n=e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error updating prompt model settings",message:n,color:"red"})};try{const r=Mf(g.current,e);if(!r)throw new Error("Could not find prompt with id ".concat(e));const o=Pf(r,g.current.metadata.default_model);if(!o)throw new Error("Could not find model name for prompt ".concat(e));await j({modelName:o,settings:t,promptName:r.name},n)}catch(ZG){n(ZG)}}),[j,m]),R=(0,r.useCallback)((async(e,t)=>{if(!j)return;m({type:"UPDATE_PROMPT_MODEL",id:e,modelName:t});const n=e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error updating model for prompt",message:n,color:"red"})};try{const r=Mf(g.current,e);if(!r)throw new Error("Could not find prompt with id ".concat(e));await j({modelName:t,promptName:r.name},n)}catch(ZG){n(ZG)}}),[m,j]),N=null===a||void 0===a?void 0:a.setParameters,A=(0,r.useMemo)((()=>{if(N)return(0,zf.debounce)((async(e,t,n)=>{try{await N(e,t)}catch(ZG){null===n||void 0===n||n(ZG)}}),Ay)}),[N]),I=(0,r.useCallback)((async e=>{if(!A)return;m({type:"UPDATE_GLOBAL_PARAMETERS",parameters:e});const t=e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error setting global parameters",message:n,color:"red"})};try{await A(e,void 0,t)}catch(ZG){t(ZG)}}),[A,m]),D=(0,r.useCallback)((async(e,t)=>{if(!A)return;m({type:"UPDATE_PROMPT_PARAMETERS",id:e,parameters:t});const n=t=>{var n,r,o;const a=null!==(n=t.message)&&void 0!==n?n:null,i=null!==(r=null===(o=Mf(g.current,e))||void 0===o?void 0:o.name)&&void 0!==r?r:e;Lu({title:"Error setting parameters for prompt ".concat(i),message:a,color:"red"})};try{const r=Mf(g.current,e);if(!r)throw new Error("Could not find prompt with id ".concat(e));await A(t,r.name,n)}catch(ZG){n(ZG)}}),[A,m]),z=null===a||void 0===a?void 0:a.addPrompt,L=(0,r.useCallback)((async(e,t)=>{if(!z)return;const n=function(e){const t=e.prompts.map((e=>e.name));let n=t.length+1;for(;t.includes("prompt_".concat(n));)n++;return"prompt_".concat(n)}(g.current),r={name:n,input:Nf(t),metadata:{model:t}},o={type:"ADD_PROMPT_AT_INDEX",index:e,prompt:{...r,_ui:{id:(0,zf.uniqueId)()}}};m(o),null===y||void 0===y||y("ADD_PROMPT",{model:t,promptIndex:e});try{const t=await z(n,r,e);m({type:"CONSOLIDATE_AICONFIG",action:o,config:t.aiconfig})}catch(ZG){var a;const t=null!==(a=ZG.message)&&void 0!==a?a:null;Lu({title:"Error adding prompt to config",message:t,color:"red"})}}),[z,y]),F=null===a||void 0===a?void 0:a.deletePrompt,M=(0,r.useCallback)((async e=>{if(F){m({type:"DELETE_PROMPT",id:e});try{const t=Mf(g.current,e);if(!t)throw new Error("Could not find prompt with id ".concat(e));await F(t.name)}catch(ZG){var t;const n=null!==(t=ZG.message)&&void 0!==t?t:null;Lu({title:"Error deleting prompt",message:n,color:"red"})}}}),[F,m]),B=null===a||void 0===a?void 0:a.clearOutputs,U=(0,r.useCallback)((async()=>{if(B){m({type:"CLEAR_OUTPUTS"});try{await B()}catch(ZG){var e;const n=null!==(e=ZG.message)&&void 0!==e?e:null;Lu({title:"Error clearing outputs",message:n,color:"red"})}}}),[B,m]),H=null===a||void 0===a?void 0:a.runPrompt,W=(0,r.useCallback)((async e=>{if(!H)return;const t=hf();m({type:"RUN_PROMPT_START",promptId:e,cancellationToken:t}),null===y||void 0===y||y("RUN_PROMPT_START");const n=t=>{var n;m({type:"RUN_PROMPT_ERROR",promptId:e,message:null!==t&&void 0!==t?t:void 0}),null===y||void 0===y||y("RUN_PROMPT_ERROR");const r=null===(n=Mf(g.current,e))||void 0===n?void 0:n.name;Lu({title:"Error running prompt".concat(r?" ".concat(r):""),message:t,color:"red"})};try{const r=Mf(g.current,e);if(!r)throw new Error("Could not find prompt with id ".concat(e));const o=r.name,a=function(e,t){var n,r;const o=null!==(n=e.metadata)&&void 0!==n&&n.model&&"string"!==typeof e.metadata.model?null===(r=e.metadata.model)||void 0===r?void 0:r.settings:void 0;if(o){if(!0===(null===o||void 0===o?void 0:o.stream))return!0;if(!1===(null===o||void 0===o?void 0:o.stream))return!1}const a=Pf(e);if(a){var i,l,s;const e=null===(i=t.metadata)||void 0===i||null===(l=i.models)||void 0===l||null===(s=l[a])||void 0===s?void 0:s.settings;if(!0===(null===e||void 0===e?void 0:e.stream))return!0;if(!1===(null===o||void 0===o?void 0:o.stream))return!1}}(r,g.current),i=await H(o,(t=>{"output_chunk"===t.type?m({type:"STREAM_OUTPUT_CHUNK",promptId:e,output:t.data}):"aiconfig_chunk"===t.type?m({type:"STREAM_AICONFIG_CHUNK",config:t.data}):"stop_streaming"===t.type&&(m({type:"RUN_PROMPT_SUCCESS",promptId:e}),null===y||void 0===y||y("RUN_PROMPT_SUCCESS"))}),(t=>{if(console.log("Error running prompt ".concat(o,": ").concat(JSON.stringify(t))),"error"===t.type)if(499===t.data.code){var r;m({type:"RUN_PROMPT_CANCEL",promptId:e,config:t.data.data}),null===y||void 0===y||y("RUN_PROMPT_CANCELED");const n=null===(r=Mf(g.current,e))||void 0===r?void 0:r.name;Lu({title:"Execution interrupted for prompt".concat(n?" '".concat(n,"'"):"",". Resetting output to previous state."),message:t.data.message,color:"yellow"})}else n(t.data.message)}),a,t);null!==i&&void 0!==i&&i.aiconfig&&(m({type:"RUN_PROMPT_SUCCESS",promptId:e,config:i.aiconfig}),null===y||void 0===y||y("RUN_PROMPT_SUCCESS"))}catch(ZG){var r;const t=null!==(r=ZG.message)&&void 0!==r?r:null;n(t)}}),[y,H]),$=null===a||void 0===a?void 0:a.setConfigName,V=(0,r.useMemo)((()=>{if($)return(0,zf.debounce)((async(e,t)=>{try{await $(e)}catch(ZG){t(ZG)}}),Ay)}),[$]),q=(0,r.useCallback)((async e=>{V&&(m({type:"SET_NAME",name:e}),await V(e,(e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error setting config name",message:n,color:"red"})})))}),[V]),G=null===a||void 0===a?void 0:a.setConfigDescription,K=(0,r.useMemo)((()=>{if(G)return(0,zf.debounce)((async(e,t)=>{try{await G(e)}catch(ZG){t(ZG)}}),Ay)}),[G]),Y=(0,r.useCallback)((async e=>{K&&(m({type:"SET_DESCRIPTION",description:e}),await K(e,(e=>{var t;const n=null!==(t=e.message)&&void 0!==t?t:null;Lu({title:"Error setting config description",message:n,color:"red"})})))}),[K]),X=(0,r.useCallback)((()=>g.current),[]),Z=(0,r.useMemo)((()=>({getState:X,logEventHandler:y,mode:i,readOnly:l})),[X,y,i,l]),Q=!1!==p._ui.isDirty;(0,r.useEffect)((()=>{if(!Q)return;const e=setInterval(S,Iy);return()=>clearInterval(e)}),[Q,S]),(0,r.useEffect)((()=>{const e=e=>{"s"===e.key&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),g.current._ui.isDirty&&S())};return window.addEventListener("keydown",e,!1),()=>window.removeEventListener("keydown",e)}),[S]);const J=null===a||void 0===a?void 0:a.getServerStatus;(0,r.useEffect)((()=>{if(!J||"OK"!==d)return;const e=setInterval((async()=>{try{const e=await J();f(e.status)}catch(ZG){f("ERROR")}}),Dy);return()=>clearInterval(e)}),[J,d]);const ee=p._ui.runningPromptId;return(0,oy.jsx)(Jy,{mode:i,themeMode:s,children:(0,oy.jsxs)(ry.Provider,{value:Z,children:[(0,oy.jsx)(sf,{}),(0,oy.jsxs)("div",{className:"editorBackground",children:["OK"!==d&&(0,oy.jsxs)(oy.Fragment,{children:[(0,oy.jsx)("div",{style:{height:"100px"}}),(0,oy.jsxs)(Uo,{color:"red",title:"Server Connection Error",w:"100%",style:{position:"fixed",top:0,zIndex:999},children:[(0,oy.jsx)(ca,{children:"There is a problem with the editor server connection. Please copy important changes somewhere safe and then try reloading the page or restarting the editor."}),(0,oy.jsxs)(wa,{align:"center",children:[(0,oy.jsx)(Yy,{value:JSON.stringify(Ff(p),null,2),contentLabel:"AIConfig JSON"}),(0,oy.jsx)(ca,{color:"dimmed",children:"Click to copy current AIConfig JSON"})]})]})]}),(0,oy.jsxs)(ja,{maw:"80rem",children:[(0,oy.jsx)(wa,{justify:"flex-end",mt:"md",mb:"xs",children:!l&&(0,oy.jsxs)(Ma,{children:[v&&(0,oy.jsx)(ev,{onDownload:b}),w&&(0,oy.jsx)(_x,{onShare:x}),U&&(0,oy.jsx)(Ni,{loading:void 0,onClick:U,size:"xs",variant:"gradient",children:"Clear Outputs"}),k&&(0,oy.jsx)(Au,{label:Q?"Save changes to config":"No unsaved changes",children:(0,oy.jsx)(Ni,{leftIcon:(0,oy.jsx)(zy,{}),loading:c,onClick:()=>{S(),null===y||void 0===y||y("SAVE_BUTTON_CLICKED")},disabled:!Q,size:"xs",variant:"gradient",children:"Save"})})]})}),(0,oy.jsx)(Ny,{name:p.name,description:p.description,setDescription:Y,setName:q})]}),(0,oy.jsx)(cy,{initialValue:null!==(t=null===p||void 0===p||null===(n=p.metadata)||void 0===n?void 0:n.parameters)&&void 0!==t?t:{},onUpdateParameters:I}),(0,oy.jsx)(hW,{cancelRunPrompt:null===a||void 0===a?void 0:a.cancel,defaultModel:p.metadata.default_model,getModels:null===a||void 0===a?void 0:a.getModels,onAddPrompt:L,onChangePromptInput:C,onChangePromptName:_,onDeletePrompt:M,onRunPrompt:W,onUpdatePromptModel:R,onUpdatePromptModelSettings:T,onUpdatePromptParameters:D,prompts:p.prompts,runningPromptId:ee})]})]})})}var yW=n(454);function vW(){return function(e){var t=[];if(0===e.length)return"";if("string"!==typeof e[0])throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var r=0;r0&&(o=o.replace(/^[\/]+/,"")),o=r0?"?":"")+i.join("&")}("object"===typeof arguments[0]?arguments[0]:[].slice.call(arguments))}const bW="".concat("","/api"),wW={ADD_PROMPT:vW(bW,"/add_prompt"),CANCEL:vW(bW,"/cancel"),CLEAR_OUTPUTS:vW(bW,"/clear_outputs"),DELETE_PROMPT:vW(bW,"/delete_prompt"),GET_AICONFIGRC:vW(bW,"/get_aiconfigrc"),SAVE:vW(bW,"/save"),SET_DESCRIPTION:vW(bW,"/set_description"),SERVER_STATUS:vW(bW,"/server_status"),SET_NAME:vW(bW,"/set_name"),SET_PARAMETERS:vW(bW,"/set_parameters"),LOAD:vW(bW,"/load"),LIST_MODELS:vW(bW,"/list_models"),RUN_PROMPT:vW(bW,"/run"),UPDATE_MODEL:vW(bW,"/update_model"),UPDATE_PROMPT:vW(bW,"/update_prompt")};var xW=n(62),kW=n.n(xW);var SW={log:"log",debug:"debug",info:"info",warn:"warn",error:"error"},OW=console,EW={};Object.keys(SW).forEach((function(e){EW[e]=OW[e]}));var CW="Datadog Browser SDK:",_W={debug:EW.debug.bind(OW,CW),log:EW.log.bind(OW,CW),info:EW.info.bind(OW,CW),warn:EW.warn.bind(OW,CW),error:EW.error.bind(OW,CW)};function PW(e,t){return function(){for(var n=[],r=0;r"}finally{r(),o(),a(),i()}}function t$(e){var t=e,n=t.toJSON;return n?(delete t.toJSON,function(){t.toJSON=n}):JW}function n$(e){return 0===Object.keys(e).length}var r$=3*WW,o$=16*WW,a$=200;function i$(e){void 0===e&&(e=2);var t=new Map,n=!1;function r(r){if(void 0===r&&(r=0),!n&&0!==e){var o=2===e?r$:o$,a=r;t.forEach((function(e){a+=e.getBytesCount()})),a>o&&(!function(e){_W.warn("Customer data exceeds the recommended ".concat(e/WW,"KiB threshold. More details: https://docs.datadoghq.com/real_user_monitoring/browser/troubleshooting/#customer-data-exceeds-the-recommended-threshold-warning"))}(o),n=!0)}}return{createDetachedTracker:function(){var e=l$((function(){return r(e.getBytesCount())}));return e},getOrCreateTracker:function(e){return t.has(e)||t.set(e,l$(r)),t.get(e)},setCompressionStatus:function(t){0===e&&(e=t,r())},getCompressionStatus:function(){return e},stop:function(){t.forEach((function(e){return e.stop()})),t.clear()}}}function l$(e){var t=0,n=QW((function(n){t=qW(e$(n)),e()}),a$),r=n.throttled,o=n.cancel,a=function(){o(),t=0};return{updateCustomerData:function(e){n$(e)?a():r(e)},resetCustomerData:a,getBytesCount:function(){return t},stop:function(){o()}}}function s$(e){return null===e?"null":Array.isArray(e)?"array":typeof e}function c$(e,t,n){if(void 0===n&&(n=function(){if("undefined"!==typeof WeakSet){var e=new WeakSet;return{hasAlreadyBeenSeen:function(t){var n=e.has(t);return n||e.add(t),n}}}var t=[];return{hasAlreadyBeenSeen:function(e){var n=t.indexOf(e)>=0;return n||t.push(e),n}}}()),void 0===t)return e;if("object"!==typeof t||null===t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof RegExp){var r=t.flags||[t.global?"g":"",t.ignoreCase?"i":"",t.multiline?"m":"",t.sticky?"y":"",t.unicode?"u":""].join("");return new RegExp(t.source,r)}if(!n.hasAlreadyBeenSeen(t)){if(Array.isArray(t)){for(var o=Array.isArray(e)?e:[],a=0;at)){for(;a.length>0&&st){y$(t,"truncated",e);break}c.target[d]=f}else for(var d in c.source)if(Object.prototype.hasOwnProperty.call(c.source,d)){var f;if(void 0!==(f=g$(c.source[d],c.path,d,a,i))&&(s+=JSON.stringify(f).length+u+d.length+m$,u=1),s>t){y$(t,"truncated",e);break}c.target[d]=f}}return r(),o(),l}y$(t,"discarded",e)}function g$(e,t,n,r,o){var a=function(e){var t=e;if(t&&"function"===typeof t.toJSON)try{return t.toJSON()}catch(oG){}return e}(e);if(!a||"object"!==typeof a)return function(e){if("bigint"===typeof e)return"[BigInt] ".concat(e.toString());if("function"===typeof e)return"[Function] ".concat(e.name||"unknown");if("symbol"===typeof e)return"[Symbol] ".concat(e.description||e.toString());return e}(a);var i=function(e){try{if(e instanceof Event)return{isTrusted:e.isTrusted};var t=Object.prototype.toString.call(e).match(/\[object (.*)\]/);if(t&&t[1])return"[".concat(t[1],"]")}catch(oG){}return"[Unserializable]"}(a);if("[Object]"!==i&&"[Array]"!==i&&"[Error]"!==i)return i;var l=e;if(o.has(l))return"[Reference seen at ".concat(o.get(l),"]");var s=void 0!==n?"".concat(t,".").concat(n):t,c=Array.isArray(a)?[]:{};return o.set(l,s),r.push({source:a,target:c,path:s}),c}function y$(e,t,n){_W.warn("The data provided has been ".concat(t," as it is over the limit of ").concat(e," characters:"),n)}var v$=function(){function e(e){this.onFirstSubscribe=e,this.observers=[]}return e.prototype.subscribe=function(e){var t=this;return!this.observers.length&&this.onFirstSubscribe&&(this.onLastUnsubscribe=this.onFirstSubscribe(this)||void 0),this.observers.push(e),{unsubscribe:function(){t.observers=t.observers.filter((function(t){return e!==t})),!t.observers.length&&t.onLastUnsubscribe&&t.onLastUnsubscribe()}}},e.prototype.notify=function(e){this.observers.forEach((function(t){return t(e)}))},e}();function b$(){for(var e=[],t=0;t500&&this.buffer.splice(0,1)},e.prototype.drain=function(){this.buffer.forEach((function(e){return e()})),this.buffer.length=0},e}(),O$=1e3,E$=60*O$,C$=60*E$;function _$(){return(new Date).getTime()}function P$(){return _$()}function j$(){return performance.now()}function T$(){return{relative:j$(),timeStamp:P$()}}function R$(e,t){return e+t}function N$(){return void 0===x$&&(x$=performance.timing.navigationStart),x$}function A$(){var e=HW().DatadogEventBridge;if(e)return{getAllowedWebViewHosts:function(){return JSON.parse(e.getAllowedWebViewHosts())},send:function(t,n){e.send(JSON.stringify({eventType:t,event:n}))}}}function I$(e){var t;void 0===e&&(e=null===(t=HW().location)||void 0===t?void 0:t.hostname);var n=A$();return!!n&&n.getAllowedWebViewHosts().some((function(t){return e===t||function(e,t){return e.slice(-t.length)===t}(e,".".concat(t))}))}function D$(e,t,n,r,o){return z$(e,t,[n],r,o)}function z$(e,t,n,r,o){var a=void 0===o?{}:o,i=a.once,l=a.capture,s=a.passive,c=IW((function(t){(t.isTrusted||t.__ddIsTrusted||e.allowUntrustedEvents)&&(i&&f(),r(t))})),u=s?{capture:l,passive:s}:l,d=GW(t,"addEventListener");function f(){var e=GW(t,"removeEventListener");n.forEach((function(n){return e.call(t,n,c,u)}))}return n.forEach((function(e){return d.call(t,e,c,u)})),{stop:f}}!function(e){e.BEFORE_UNLOAD="beforeunload",e.CLICK="click",e.DBL_CLICK="dblclick",e.KEY_DOWN="keydown",e.LOAD="load",e.POP_STATE="popstate",e.SCROLL="scroll",e.TOUCH_START="touchstart",e.TOUCH_END="touchend",e.TOUCH_MOVE="touchmove",e.VISIBILITY_CHANGE="visibilitychange",e.PAGE_SHOW="pageshow",e.FREEZE="freeze",e.RESUME="resume",e.DOM_CONTENT_LOADED="DOMContentLoaded",e.POINTER_DOWN="pointerdown",e.POINTER_UP="pointerup",e.POINTER_CANCEL="pointercancel",e.HASH_CHANGE="hashchange",e.PAGE_HIDE="pagehide",e.MOUSE_DOWN="mousedown",e.MOUSE_UP="mouseup",e.MOUSE_MOVE="mousemove",e.FOCUS="focus",e.BLUR="blur",e.CONTEXT_MENU="contextmenu",e.RESIZE="resize",e.CHANGE="change",e.INPUT="input",e.PLAY="play",e.PAUSE="pause",e.SECURITY_POLICY_VIOLATION="securitypolicyviolation",e.SELECTION_CHANGE="selectionchange",e.STORAGE="storage"}(k$||(k$={}));var L$,F$="_dd_c",M$=[];function B$(e,t,n,r){var o=function(e,t){return"".concat(F$,"_").concat(e,"_").concat(t)}(t,n),a=w$(r);return i(),M$.push(D$(e,window,k$.STORAGE,(function(e){var t=e.key;o===t&&i()}))),a.changeObservable.subscribe((function(){localStorage.setItem(o,JSON.stringify(a.getContext()))})),a;function i(){var e=localStorage.getItem(o),t=null!==e?JSON.parse(e):{};a.setContext(t)}}function U$(e){var t=UW({},e);return["id","name","email"].forEach((function(e){e in t&&(t[e]=String(t[e]))})),t}!function(e){e.PAGEHIDE="pagehide",e.FEATURE_FLAGS="feature_flags",e.RESOURCE_PAGE_STATES="resource_page_states",e.COLLECT_FLUSH_REASON="collect_flush_reason",e.ZERO_LCP_TELEMETRY="zero_lcp_telemetry",e.DISABLE_REPLAY_INLINE_CSS="disable_replay_inline_css",e.WRITABLE_RESOURCE_GRAPHQL="writable_resource_graphql"}(L$||(L$={}));var H$=new Set;function W$(e){return H$.has(e)}function $$(){return H$}function V$(e){return 0!==e&&100*Math.random()<=e}function q$(e){return function(e){return"number"===typeof e}(e)&&e>=0&&e<=100}function G$(e){return e?(parseInt(e,10)^16*Math.random()>>parseInt(e,10)/4).toString(16):"".concat(1e7,"-").concat(1e3,"-").concat(4e3,"-").concat(8e3,"-").concat(1e11).replace(/[018]/g,G$)}var K$=/([\w-]+)\s*=\s*([^;]+)/g;function Y$(e,t,n){void 0===n&&(n="");var r=e.charCodeAt(t-1),o=r>=55296&&r<=56319?t+1:t;return e.length<=o?e:"".concat(e.slice(0,o)).concat(n)}var X$,Z$,Q$,J$=4*C$,eV=15*E$;function tV(){return null!==X$&&void 0!==X$?X$:X$=function(e){var t;void 0===e&&(e=window);var n=e.navigator.userAgent;if(e.chrome||/HeadlessChrome/.test(n))return 1;if(0===(null===(t=e.navigator.vendor)||void 0===t?void 0:t.indexOf("Apple"))||/safari/i.test(n)&&!/chrome|android/i.test(n))return 2;if(e.document.documentMode)return 0;return 3}()}function nV(e,t,n,r){var o=new Date;o.setTime(o.getTime()+n);var a="expires=".concat(o.toUTCString()),i=r&&r.crossSite?"none":"strict",l=r&&r.domain?";domain=".concat(r.domain):"",s=r&&r.secure?";secure":"",c=r&&r.partitioned?";partitioned":"";document.cookie="".concat(e,"=").concat(t,";").concat(a,";path=/;samesite=").concat(i).concat(l).concat(s).concat(c)}function rV(e){return function(e,t){for(K$.lastIndex=0;;){var n=K$.exec(e);if(!n)break;if(n[1]===t)return n[2]}}(document.cookie,e)}function oV(e){return Z$||(Z$=function(e){var t=new Map;for(K$.lastIndex=0;;){var n=K$.exec(e);if(!n)break;t.set(n[1],n[2])}return t}(document.cookie)),Z$.get(e)}function aV(e,t){nV(e,"",0,t)}var iV="_dd_s",lV=/^([a-z]+)=([a-z0-9-]+)$/,sV="&";function cV(e){return n$(e)}function uV(e){e.expire=String(_$()+eV)}function dV(e){return(t=e,Object.keys(t).map((function(e){return[e,t[e]]}))).map((function(e){var t=e[0],n=e[1];return"".concat(t,"=").concat(n)})).join(sV);var t}function fV(e){var t={};return function(e){return!!e&&(-1!==e.indexOf(sV)||lV.test(e))}(e)&&e.split(sV).forEach((function(e){var n=lV.exec(e);if(null!==n){var r=n[1],o=n[2];t[r]=o}})),t}var pV="_dd",mV="_dd_r",hV="_dd_l",gV="rum",yV="logs";function vV(e){var t=function(e){var t={};t.secure=!!e.useSecureSessionCookie||!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.crossSite=!!e.usePartitionedCrossSiteSessionCookie||!!e.useCrossSiteSessionCookie,t.partitioned=!!e.usePartitionedCrossSiteSessionCookie,e.trackSessionAcrossSubdomains&&(t.domain=function(){if(void 0===Q$){for(var e="dd_site_test_".concat(G$()),t=window.location.hostname.split("."),n=t.pop();t.length&&!rV(e);)n="".concat(t.pop(),".").concat(n),nV(e,"test",O$,{domain:n});aV(e,{domain:n}),Q$=n}return Q$}());return t}(e);return function(e){if(void 0===document.cookie||null===document.cookie)return!1;try{var t="dd_cookie_test_".concat(G$()),n="test";nV(t,n,E$,e);var r=rV(t)===n;return aV(t,e),r}catch(o){return _W.error(o),!1}}(t)?{type:"Cookie",cookieOptions:t}:void 0}function bV(e){var t={isLockEnabled:1===tV(),persistSession:wV(e),retrieveSession:xV,clearSession:kV(e)};return function(e){if(!oV(iV)){var t=oV(pV),n=oV(mV),r=oV(hV),o={};t&&(o.id=t),r&&/^[01]$/.test(r)&&(o[yV]=r),n&&/^[012]$/.test(n)&&(o[gV]=n),cV(o)||(uV(o),e.persistSession(o))}}(t),t}function wV(e){return function(t){nV(iV,dV(t),eV,e)}}function xV(){return fV(rV(iV))}function kV(e){return function(){aV(iV,e)}}var SV="_dd_test_";function OV(e){localStorage.setItem(iV,dV(e))}function EV(){return fV(localStorage.getItem(iV))}function CV(){localStorage.removeItem(iV)}var _V,PV=10,jV=100,TV=[];function RV(e,t,n){var r;void 0===n&&(n=0);var o=t.isLockEnabled,a=t.retrieveSession,i=t.persistSession,l=t.clearSession;if(_V||(_V=e),e===_V)if(o&&n>=jV)AV(t);else{var s,c=a();if(o){if(c.lock)return void NV(e,t,n);if(s=G$(),c.lock=s,i(c),(c=a()).lock!==s)return void NV(e,t,n)}var u=e.process(c);if(o&&(c=a()).lock!==s)NV(e,t,n);else{if(u&&(cV(u)?l():(uV(u),i(u))),o&&(!u||!cV(u))){if((c=a()).lock!==s)return void NV(e,t,n);delete c.lock,i(c),u=c}null===(r=e.after)||void 0===r||r.call(e,u||c),AV(t)}}else TV.push(e)}function NV(e,t,n){KW((function(){RV(e,t,n+1)}),PV)}function AV(e){_V=void 0;var t=TV.shift();t&&RV(t,e)}var IV=O$;function DV(e){var t=vV(e);return!t&&e.allowFallbackToLocalStorage&&(t=function(){try{var e=G$(),t="".concat(SV).concat(e);localStorage.setItem(t,e);var n=localStorage.getItem(t);return localStorage.removeItem(t),e===n?{type:"LocalStorage"}:void 0}catch(r){return}}()),t}function zV(e,t,n){var r=new v$,o=new v$,a="Cookie"===e.type?bV(e.cookieOptions):{isLockEnabled:!1,persistSession:OV,retrieveSession:EV,clearSession:CV},i=a.clearSession,l=a.retrieveSession,s=XW((function(){RV({process:function(e){return f(e)?void 0:{}},after:u},a)}),IV),c=function(){var e=l();if(f(e))return e;return{}}();function u(e){return f(e)||(e={}),d()&&(!function(e){return c.id!==e.id||c[t]!==e[t]}(e)?c=e:(c={},o.notify())),e}function d(){return void 0!==c[t]}function f(e){return(void 0===e.created||_$()-Number(e.created)n||GV.test(t))&&_W.warn("".concat(e," value doesn't meet tag requirements and will be sanitized"));var r=t.replace(/,/g,"_");return"".concat(e,":").concat(r)}function YV(e){var t=function(e){var t=e.env,n=e.service,r=e.version,o=e.datacenter,a=[];return t&&a.push(KV("env",t)),n&&a.push(KV("service",n)),r&&a.push(KV("version",r)),o&&a.push(KV("datacenter",o)),a}(e),n=function(e,t){return{logsEndpointBuilder:VV(e,"logs",t),rumEndpointBuilder:VV(e,"rum",t),sessionReplayEndpointBuilder:VV(e,"replay",t)}}(e,t),r=MW(n).map((function(e){return e.urlPrefix})),o=function(e,t,n){if(!e.replica)return;var r=UW({},e,{site:$V,clientToken:e.replica.clientToken}),o={logsEndpointBuilder:VV(r,"logs",n),rumEndpointBuilder:VV(r,"rum",n)};return t.push.apply(t,MW(o).map((function(e){return e.urlPrefix}))),UW({applicationId:e.replica.applicationId},o)}(e,r,t);return UW({isIntakeUrl:function(e){return r.some((function(t){return 0===e.indexOf(t)}))},replica:o,site:e.site||$V},n)}function XV(e){var t,n,r;if(e&&e.clientToken)if(void 0===e.sessionSampleRate||q$(e.sessionSampleRate))if(void 0===e.telemetrySampleRate||q$(e.telemetrySampleRate)){if(void 0===e.telemetryConfigurationSampleRate||q$(e.telemetryConfigurationSampleRate))return Array.isArray(e.enableExperimentalFeatures)&&e.enableExperimentalFeatures.filter((function(e){return t=L$,n=e,Object.keys(t).some((function(e){return t[e]===n}));var t,n})).forEach((function(e){H$.add(e)})),UW({beforeSend:e.beforeSend&&PW(e.beforeSend,"beforeSend threw an error:"),sessionStoreStrategyType:DV(e),sessionSampleRate:null!==(t=e.sessionSampleRate)&&void 0!==t?t:100,telemetrySampleRate:null!==(n=e.telemetrySampleRate)&&void 0!==n?n:20,telemetryConfigurationSampleRate:null!==(r=e.telemetryConfigurationSampleRate)&&void 0!==r?r:5,service:e.service,silentMultipleInit:!!e.silentMultipleInit,allowUntrustedEvents:!!e.allowUntrustedEvents,batchBytesLimit:16*WW,eventRateLimiterThreshold:3e3,maxTelemetryEventsPerPage:15,flushTimeout:30*O$,batchMessagesLimit:50,messageBytesLimit:256*WW},YV(e));_W.error("Telemetry Configuration Sample Rate should be a number between 0 and 100")}else _W.error("Telemetry Sample Rate should be a number between 0 and 100");else _W.error("Session Sample Rate should be a number between 0 and 100");else _W.error("Client Token is not configured, we will not send any data.")}var ZV="?";function QV(e){var t=[],n=lq(e,"stack"),r=String(e);return n&&BW(n,r)&&(n=n.slice(r.length)),n&&n.split("\n").forEach((function(e){var n=function(e){var t=tq.exec(e);if(!t)return;var n=t[2]&&0===t[2].indexOf("native"),r=t[2]&&0===t[2].indexOf("eval"),o=nq.exec(t[2]);r&&o&&(t[2]=o[1],t[3]=o[2],t[4]=o[3]);return{args:n?[t[2]]:[],column:t[4]?+t[4]:void 0,func:t[1]||ZV,line:t[3]?+t[3]:void 0,url:n?void 0:t[2]}}(e)||function(e){var t=rq.exec(e);if(!t)return;return{args:[],column:t[3]?+t[3]:void 0,func:ZV,line:t[2]?+t[2]:void 0,url:t[1]}}(e)||function(e){var t=oq.exec(e);if(!t)return;return{args:[],column:t[4]?+t[4]:void 0,func:t[1]||ZV,line:+t[3],url:t[2]}}(e)||function(e){var t=aq.exec(e);if(!t)return;var n=t[3]&&t[3].indexOf(" > eval")>-1,r=iq.exec(t[3]);n&&r&&(t[3]=r[1],t[4]=r[2],t[5]=void 0);return{args:t[2]?t[2].split(","):[],column:t[5]?+t[5]:void 0,func:t[1]||ZV,line:t[4]?+t[4]:void 0,url:t[3]}}(e);n&&(!n.func&&n.line&&(n.func=ZV),t.push(n))})),{message:lq(e,"message"),name:lq(e,"name"),stack:t}}var JV="((?:file|https?|blob|chrome-extension|native|eval|webpack|snippet||\\w+\\.|\\/).*?)",eq="(?::(\\d+))",tq=new RegExp("^\\s*at (.*?) ?\\(".concat(JV).concat(eq,"?").concat(eq,"?\\)?\\s*$"),"i"),nq=new RegExp("\\((\\S*)".concat(eq).concat(eq,"\\)"));var rq=new RegExp("^\\s*at ?".concat(JV).concat(eq,"?").concat(eq,"??\\s*$"),"i");var oq=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i;var aq=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|capacitor|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,iq=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i;function lq(e,t){if("object"===typeof e&&e&&t in e){var n=e[t];return"string"===typeof n?n:void 0}}function sq(e,t,n,r){var o=[{url:t,column:r,line:n}],a=function(e){var t,n,r;"[object String]"==={}.toString.call(e)&&(n=(t=cq.exec(e))[1],r=t[2]);return{name:n,message:r}}(e);return{name:a.name,message:a.message,stack:o}}var cq=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?([\s\S]*)$/;var uq="No stack, consider using an instance of Error";function dq(e){var t=e.stackTrace,n=e.originalError,r=e.handlingStack,o=e.startClocks,a=e.nonErrorPrefix,i=e.source,l=e.handling,s=n instanceof Error,c=function(e,t,n,r){return(null===e||void 0===e?void 0:e.message)&&(null===e||void 0===e?void 0:e.name)?e.message:t?"Empty message":"".concat(n," ").concat(e$(h$(r)))}(t,s,a,n),u=function(e,t){if(void 0===t)return!1;if(e)return!0;return t.stack.length>0&&(t.stack.length>1||void 0!==t.stack[0].url)}(s,t)?pq(t):uq,d=s?function(e,t){var n=e,r=[];for(;(null===n||void 0===n?void 0:n.cause)instanceof Error&&r.length<10;){var o=QV(n.cause);r.push({message:n.cause.message,source:t,type:null===o||void 0===o?void 0:o.name,stack:o&&pq(o)}),n=n.cause}return r.length?r:void 0}(n,i):void 0;return{startClocks:o,source:i,handling:l,handlingStack:r,originalError:n,type:null===t||void 0===t?void 0:t.name,message:c,stack:u,causes:d,fingerprint:fq(n)}}function fq(e){return e instanceof Error&&"dd_fingerprint"in e?String(e.dd_fingerprint):void 0}function pq(e){var t=mq(e);return e.stack.forEach((function(e){var n="?"===e.func?"":e.func,r=e.args&&e.args.length>0?"(".concat(e.args.join(", "),")"):"",o=e.line?":".concat(e.line):"",a=e.line&&e.column?":".concat(e.column):"";t+="\n at ".concat(n).concat(r," @ ").concat(e.url).concat(o).concat(a)})),t}function mq(e){return"".concat(e.name||"Error",": ").concat(e.message)}var hq={intervention:"intervention",deprecation:"deprecation",cspViolation:"csp_violation"};function gq(e,t){var n=[];LW(t,hq.cspViolation)&&n.push(function(e){return new v$((function(t){return D$(e,document,k$.SECURITY_POLICY_VIOLATION,(function(e){t.notify(function(e){var t=hq.cspViolation,n="'".concat(e.blockedURI,"' blocked by '").concat(e.effectiveDirective,"' directive");return{type:hq.cspViolation,subtype:e.effectiveDirective,message:"".concat(t,": ").concat(n),stack:yq(e.effectiveDirective,e.originalPolicy?"".concat(n,' of the policy "').concat(Y$(e.originalPolicy,100,"..."),'"'):"no policy",e.sourceFile,e.lineNumber,e.columnNumber),originalReport:e}}(e))})).stop}))}(e));var r=t.filter((function(e){return e!==hq.cspViolation}));return r.length&&n.push(function(e){return new v$((function(t){if(window.ReportingObserver){var n=IW((function(e,n){return e.forEach((function(e){t.notify(function(e){var t=e.type,n=e.body;return{type:t,subtype:n.id,message:"".concat(t,": ").concat(n.message),originalReport:e,stack:yq(n.id,n.message,n.sourceFile,n.lineNumber,n.columnNumber)}}(e))}))})),r=new window.ReportingObserver(n,{types:e,buffered:!0});return r.observe(),function(){r.disconnect()}}}))}(r)),b$.apply(void 0,n)}function yq(e,t,n,r,o){return n?pq({name:e,message:t,stack:[{func:"?",url:n,line:null!==r&&void 0!==r?r:void 0,column:null!==o&&void 0!==o?o:void 0}]}):void 0}var vq=32*WW;function bq(e,t,n){return void 0===e?[]:"all"===e||Array.isArray(e)&&e.every((function(e){return LW(t,e)}))?"all"===e?t:function(e){var t=new Set;return e.forEach((function(e){return t.add(e)})),FW(t)}(e):void _W.error("".concat(n,' should be "all" or an array with allowed values "').concat(t.join('", "'),'"'))}var wq={AGENT:"agent",CONSOLE:"console",CUSTOM:"custom",LOGGER:"logger",NETWORK:"network",SOURCE:"source",REPORT:"report"},xq=function(e,t,n,r){var o,a=arguments.length,i=a<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"===typeof Reflect&&"function"===typeof Reflect.decorate)i=Reflect.decorate(e,t,n,r);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(i=(a<3?o(i):a>3?o(t,n,i):o(t,n))||i);return a>3&&i&&Object.defineProperty(t,n,i),i},kq={debug:"debug",error:"error",info:"info",warn:"warn"},Sq={console:"console",http:"http",silent:"silent"},Oq=Object.keys(kq),Eq=function(){function e(e,t,n,r,o,a){void 0===r&&(r=Sq.http),void 0===o&&(o=kq.debug),void 0===a&&(a={}),this.handleLogStrategy=e,this.handlerType=r,this.level=o,this.contextManager=w$(t),this.contextManager.setContext(a),n&&this.contextManager.setContextProperty("logger",{name:n})}return e.prototype.log=function(e,t,n,r){var o;if(void 0===n&&(n=kq.info),void 0!==r&&null!==r){var a=dq({stackTrace:r instanceof Error?QV(r):void 0,originalError:r,nonErrorPrefix:"Provided",source:wq.LOGGER,handling:"handled",startClocks:T$()});o={stack:a.stack,kind:a.type,message:a.message}}var i=h$(t),l=o?d$({error:o},i):i;this.handleLogStrategy({message:h$(e),context:l,status:n},this)},e.prototype.debug=function(e,t,n){this.log(e,t,kq.debug,n)},e.prototype.info=function(e,t,n){this.log(e,t,kq.info,n)},e.prototype.warn=function(e,t,n){this.log(e,t,kq.warn,n)},e.prototype.error=function(e,t,n){this.log(e,t,kq.error,n)},e.prototype.setContext=function(e){this.contextManager.setContext(e)},e.prototype.getContext=function(){return this.contextManager.getContext()},e.prototype.setContextProperty=function(e,t){this.contextManager.setContextProperty(e,t)},e.prototype.removeContextProperty=function(e){this.contextManager.removeContextProperty(e)},e.prototype.clearContext=function(){this.contextManager.clearContext()},e.prototype.setHandler=function(e){this.handlerType=e},e.prototype.getHandler=function(){return this.handlerType},e.prototype.setLevel=function(e){this.level=e},e.prototype.getLevel=function(){return this.level},xq([AW],e.prototype,"log",null),e}(),Cq="logs";function _q(e,t){var n=window.__ddBrowserSdkExtensionCallback;n&&n({type:e,payload:t})}var Pq={HIDDEN:"visibility_hidden",UNLOADING:"before_unload",PAGEHIDE:"page_hide",FROZEN:"page_frozen"};var jq="datadog-synthetics-public-id",Tq="datadog-synthetics-result-id",Rq="datadog-synthetics-injects-rum";function Nq(){return Boolean(window._DATADOG_SYNTHETICS_INJECTS_RUM||oV(Rq))}function Aq(){var e=window._DATADOG_SYNTHETICS_PUBLIC_ID||oV(jq);return"string"===typeof e?e:void 0}function Iq(){var e=window._DATADOG_SYNTHETICS_RESULT_ID||oV(Tq);return"string"===typeof e?e:void 0}var Dq=1/0,zq=E$,Lq=function(){function e(e,t){var n=this;this.expireDelay=e,this.maxEntries=t,this.entries=[],this.clearOldValuesInterval=XW((function(){return n.clearOldValues()}),zq)}return e.prototype.add=function(e,t){var n=this,r={value:e,startTime:t,endTime:Dq,remove:function(){var e=n.entries.indexOf(r);e>=0&&n.entries.splice(e,1)},close:function(e){r.endTime=e}};return this.maxEntries&&this.entries.length>=this.maxEntries&&this.entries.pop(),this.entries.unshift(r),r},e.prototype.find=function(e){void 0===e&&(e=Dq);for(var t=0,n=this.entries;t0&&this.entries[this.entries.length-1].endTime"],Kq=["ddog-gov.com"],Yq={maxEventsPerPage:0,sentEventCount:0,telemetryEnabled:!1,telemetryConfigurationEnabled:!1};function Xq(e,t){var n,r=new v$;Yq.telemetryEnabled=!LW(Kq,t.site)&&V$(t.telemetrySampleRate),Yq.telemetryConfigurationEnabled=Yq.telemetryEnabled&&V$(t.telemetryConfigurationSampleRate);var o={is_local_file:"file:"===window.location.protocol,is_worker:"WorkerGlobalScope"in self};return Vq=function(t){if(Yq.telemetryEnabled){var a=function(e,t,r){return d$({type:"telemetry",date:P$(),service:e,version:"5.7.0",source:"browser",_dd:{format_version:2},telemetry:d$(t,{runtime_env:r}),experimental_features:FW($$())},void 0!==n?n():{})}(e,t,o);r.notify(a),_q("telemetry",a)}},jW=Qq,UW(Yq,{maxEventsPerPage:t.maxTelemetryEventsPerPage,sentEventCount:0}),{setContextProvider:function(e){n=e},observable:r,enabled:Yq.telemetryEnabled}}function Zq(e,t){zW(SW.debug,e,t),Jq(UW({type:qq.log,message:e,status:"debug"},t))}function Qq(e,t){Jq(UW({type:qq.log,status:"error"},function(e){if(e instanceof Error){var t=QV(e);return{error:{kind:t.name,stack:pq(eG(t))},message:t.message}}return{error:{stack:uq},message:"".concat("Uncaught"," ").concat(e$(e))}}(e),t))}function Jq(e){Vq&&Yq.sentEventCount=500}function bG(e,t){if(!e.forwardErrorsToLogs)return{stop:JW};var n=mG(e).subscribe((function(e){"complete"===e.state&&o("xhr",e)})),r=yG().subscribe((function(e){"resolve"===e.state&&o("fetch",e)}));function o(n,r){function o(e){t.notify(0,{rawLogsEvent:{message:"".concat(xG(n)," error ").concat(r.method," ").concat(r.url),date:r.startClocks.timeStamp,error:{stack:e||"Failed to load"},http:{method:r.method,status_code:r.status,url:r.url},status:kq.error,origin:wq.NETWORK}})}e.isIntakeUrl(r.url)||!function(e){return 0===e.status&&"opaque"!==e.responseType}(r)&&!vG(r.status)||("xhr"in r?function(e,t,n){"string"===typeof e.response?n(wG(e.response,t)):n(e.response)}(r.xhr,e,o):r.response?function(e,t,n){var r=function(e){try{return e.clone()}catch(t){return}}(e);r&&r.body?window.TextDecoder?function(e,t,n){!function(e,t,n){var r=e.getReader(),o=[],a=0;function i(){var e,i;if(r.cancel().catch(JW),n.collectStreamBody){var l;if(1===o.length)l=o[0];else{l=new Uint8Array(a);var s=0;o.forEach((function(e){l.set(e,s),s+=e.length}))}e=l.slice(0,n.bytesLimit),i=l.length>n.bytesLimit}t(void 0,e,i)}!function e(){r.read().then(IW((function(t){t.done?i():(n.collectStreamBody&&o.push(t.value),(a+=t.value.length)>n.bytesLimit?i():e())})),IW((function(e){return t(e)})))}()}(e,(function(e,t,r){if(e)n(e);else{var o=(new TextDecoder).decode(t);r&&(o+="..."),n(void 0,o)}}),{bytesLimit:t,collectStreamBody:!0})}(r.body,t.requestErrorResponseLengthLimit,(function(e,t){n(e?"Unable to retrieve response: ".concat(e):t)})):r.text().then(IW((function(e){return n(wG(e,t))})),IW((function(e){return n("Unable to retrieve response: ".concat(e))}))):n()}(r.response,e,o):r.error&&function(e,t,n){n(wG(pq(QV(e)),t))}(r.error,e,o))}return{stop:function(){n.unsubscribe(),r.unsubscribe()}}}function wG(e,t){return e.length>t.requestErrorResponseLengthLimit?"".concat(e.substring(0,t.requestErrorResponseLengthLimit),"..."):e}function xG(e){return"xhr"===e?"XHR":"Fetch"}function kG(e){var t,n=function(t,n){var r=dq({stackTrace:t,originalError:n,startClocks:T$(),nonErrorPrefix:"Uncaught",source:wq.SOURCE,handling:"unhandled"});e.notify(r)},r=(t=n,dG(window,"onerror",(function(e){var n,r=e.parameters,o=r[0],a=r[1],i=r[2],l=r[3],s=r[4];n=s instanceof Error?QV(s):sq(o,a,i,l),t(n,null!==s&&void 0!==s?s:o)}))).stop,o=function(e){return dG(window,"onunhandledrejection",(function(t){var n=t.parameters[0].reason||"Empty reason",r=QV(n);e(r,n)}))}(n).stop;return{stop:function(){r(),o()}}}var SG,OG=function(){function e(){this.callbacks={}}return e.prototype.notify=function(e,t){var n=this.callbacks[e];n&&n.forEach((function(e){return e(t)}))},e.prototype.subscribe=function(e,t){var n=this;return this.callbacks[e]||(this.callbacks[e]=[]),this.callbacks[e].push(t),{unsubscribe:function(){n.callbacks[e]=n.callbacks[e].filter((function(e){return t!==e}))}}},e}(),EG=((SG={})[kq.debug]=0,SG[kq.info]=1,SG[kq.warn]=2,SG[kq.error]=3,SG);function CG(e){return{handleLog:function(t,n,r,o){var a=d$(n.getContext(),t.context);_G(t.status,Sq.console,n)&&function(e,t){EW[e.status].call(OW,e.message,t)}(t,a),_G(t.status,Sq.http,n)&&e.notify(0,{rawLogsEvent:{date:o||P$(),message:t.message,status:t.status,origin:wq.LOGGER},messageContext:a,savedCommonContext:r})}}}function _G(e,t,n){var r=n.getHandler(),o=Array.isArray(r)?r:[r];return EG[e]>=EG[n.getLevel()]&&LW(o,t)}var PG=function(){function e(e,t,n,r){var o=this;this.encoder=e,this.request=t,this.flushController=n,this.messageBytesLimit=r,this.upsertBuffer={},this.flushSubscription=this.flushController.flushObservable.subscribe((function(e){return o.flush(e)}))}return e.prototype.add=function(e){this.addOrUpdate(e)},e.prototype.upsert=function(e,t){this.addOrUpdate(e,t)},e.prototype.stop=function(){this.flushSubscription.unsubscribe()},e.prototype.flush=function(e){var t=MW(this.upsertBuffer).join("\n");this.upsertBuffer={};var n,r=(n=e.reason,LW(MW(Pq),n)),o=r?this.request.sendOnExit:this.request.send;if(r&&this.encoder.isAsync){var a=this.encoder.finishSync();a.outputBytesCount&&o(jG(a,e));var i=[a.pendingData,t].filter(Boolean).join("\n");i&&o({data:i,bytesCount:qW(i),flushReason:e.reason})}else t&&this.encoder.write(this.encoder.isEmpty?t:"\n".concat(t)),this.encoder.finish((function(t){o(jG(t,e))}))},e.prototype.addOrUpdate=function(e,t){var n=e$(e),r=this.encoder.estimateEncodedBytesCount(n);r>=this.messageBytesLimit?_W.warn("Discarded a message whose size was bigger than the maximum allowed size ".concat(this.messageBytesLimit,"KB.")):(this.hasMessageFor(t)&&this.remove(t),this.push(n,r,t))},e.prototype.push=function(e,t,n){var r=this;this.flushController.notifyBeforeAddMessage(t),void 0!==n?(this.upsertBuffer[n]=e,this.flushController.notifyAfterAddMessage()):this.encoder.write(this.encoder.isEmpty?e:"\n".concat(e),(function(e){r.flushController.notifyAfterAddMessage(e-t)}))},e.prototype.remove=function(e){var t=this.upsertBuffer[e];delete this.upsertBuffer[e];var n=this.encoder.estimateEncodedBytesCount(t);this.flushController.notifyAfterRemoveMessage(n)},e.prototype.hasMessageFor=function(e){return void 0!==e&&void 0!==this.upsertBuffer[e]},e}();function jG(e,t){return{data:"string"===typeof e.output?e.output:new Blob([e.output],{type:"text/plain"}),bytesCount:e.outputBytesCount,encoding:e.encoding,flushReason:t.reason}}var TG=80*WW,RG=32,NG=3*$W,AG=E$,IG=O$;function DG(e,t,n,r,o){0===t.transportStatus&&0===t.queuedPayloads.size()&&t.bandwidthMonitor.canHandle(e)?LG(e,t,n,{onSuccess:function(){return FG(0,t,n,r,o)},onFailure:function(){t.queuedPayloads.enqueue(e),zG(t,n,r,o)}}):t.queuedPayloads.enqueue(e)}function zG(e,t,n,r){2===e.transportStatus&&KW((function(){LG(e.queuedPayloads.first(),e,t,{onSuccess:function(){e.queuedPayloads.dequeue(),e.currentBackoffTime=IG,FG(1,e,t,n,r)},onFailure:function(){e.currentBackoffTime=Math.min(AG,2*e.currentBackoffTime),zG(e,t,n,r)}})}),e.currentBackoffTime)}function LG(e,t,n,r){var o=r.onSuccess,a=r.onFailure;t.bandwidthMonitor.add(e),n(e,(function(n){t.bandwidthMonitor.remove(e),!function(e){return"opaque"!==e.type&&(0===e.status&&!navigator.onLine||408===e.status||429===e.status||vG(e.status))}(n)?(t.transportStatus=0,o()):(t.transportStatus=t.bandwidthMonitor.ongoingRequestCount>0?1:2,e.retry={count:e.retry?e.retry.count+1:1,lastFailureStatus:n.status},a())}))}function FG(e,t,n,r,o){0===e&&t.queuedPayloads.isFull()&&!t.queueFullReported&&(o({message:"Reached max ".concat(r," events size queued for upload: ").concat(NG/$W,"MiB"),source:wq.AGENT,startClocks:T$()}),t.queueFullReported=!0);var a=t.queuedPayloads;for(t.queuedPayloads=MG();a.size()>0;)DG(a.dequeue(),t,n,r,o)}function MG(){var e=[];return{bytesCount:0,enqueue:function(t){this.isFull()||(e.push(t),this.bytesCount+=t.bytesCount)},first:function(){return e[0]},dequeue:function(){var t=e.shift();return t&&(this.bytesCount-=t.bytesCount),t},size:function(){return e.length},isFull:function(){return this.bytesCount>=NG}}}function BG(e,t,n,r){var o={transportStatus:0,currentBackoffTime:IG,bandwidthMonitor:{ongoingRequestCount:0,ongoingByteCount:0,canHandle:function(e){return 0===this.ongoingRequestCount||this.ongoingByteCount+e.bytesCount<=TG&&this.ongoingRequestCount=r&&f("bytes_limit"),d+=1,u+=e,void 0===t&&(t=KW((function(){f("duration_limit")}),o))},notifyAfterAddMessage:function(e){void 0===e&&(e=0),u+=e,d>=n?f("messages_limit"):u>=r&&f("bytes_limit")},notifyAfterRemoveMessage:function(e){u-=e,0===(d-=1)&&p()}}}function $G(e,t,n,r,o,a){var i=s(e,t),l=n&&s(e,n);function s(e,t){var n=t.endpoint,i=t.encoder;return new PG(i,BG(e,n,e.batchBytesLimit,r),WG({messagesLimit:e.batchMessagesLimit,bytesLimit:e.batchBytesLimit,durationLimit:e.flushTimeout,pageExitObservable:o,sessionExpireObservable:a}),e.messageBytesLimit)}return{flushObservable:i.flushController.flushObservable,add:function(e,t){void 0===t&&(t=!0),i.add(e),l&&t&&l.add(n.transformMessage?n.transformMessage(e):e)},upsert:function(e,t){i.upsert(e,t),l&&l.upsert(n.transformMessage?n.transformMessage(e):e,t)},stop:function(){i.stop(),null===l||void 0===l||l.stop()}}}function VG(){var e="",t=0;return{isAsync:!1,get isEmpty(){return!e},write:function(n,r){var o=qW(n);t+=o,e+=n,r&&r(o)},finish:function(e){e(this.finishSync())},finishSync:function(){var n={output:e,outputBytesCount:t,rawBytesCount:t,pendingData:""};return e="",t=0,n},estimateEncodedBytesCount:function(e){return e.length}}}function qG(e,t,n,r,o){var a=Xq("browser-logs-sdk",t);a.setContextProvider((function(){var e,t,n,r,a,i;return{application:{id:null===(e=nG())||void 0===e?void 0:e.application_id},session:{id:null===(t=o.findTrackedSession())||void 0===t?void 0:t.id},view:{id:null===(r=null===(n=nG())||void 0===n?void 0:n.view)||void 0===r?void 0:r.id},action:{id:null===(i=null===(a=nG())||void 0===a?void 0:a.user_action)||void 0===i?void 0:i.id}}}));var i=[];if(I$()){var l=A$(),s=a.observable.subscribe((function(e){return l.send("internal_telemetry",e)}));i.push((function(){return s.unsubscribe()}))}else{var c=$G(t,{endpoint:t.rumEndpointBuilder,encoder:VG()},t.replica&&{endpoint:t.replica.rumEndpointBuilder,encoder:VG()},n,r,o.expireObservable);i.push((function(){return c.stop()}));var u=a.observable.subscribe((function(e){return c.add(e,function(e){return e.site===HV}(t))}));i.push((function(){return u.unsubscribe()}))}return function(e){Yq.telemetryConfigurationEnabled&&Jq({type:qq.configuration,configuration:e})}(function(e){var t,n={session_sample_rate:(t=e).sessionSampleRate,telemetry_sample_rate:t.telemetrySampleRate,telemetry_configuration_sample_rate:t.telemetryConfigurationSampleRate,use_before_send:!!t.beforeSend,use_cross_site_session_cookie:t.useCrossSiteSessionCookie,use_partitioned_cross_site_session_cookie:t.usePartitionedCrossSiteSessionCookie,use_secure_session_cookie:t.useSecureSessionCookie,use_proxy:!!t.proxy,silent_multiple_init:t.silentMultipleInit,track_session_across_subdomains:t.trackSessionAcrossSubdomains,allow_fallback_to_local_storage:!!t.allowFallbackToLocalStorage,store_contexts_across_pages:!!t.storeContextsAcrossPages,allow_untrusted_events:!!t.allowUntrustedEvents};return UW({forward_errors_to_logs:e.forwardErrorsToLogs,forward_console_logs:e.forwardConsoleLogs,forward_reports:e.forwardReports},n)}(e)),{telemetry:a,stop:function(){i.forEach((function(e){return e()}))}}}var GG=function(e){var t=!1,n=i$(),r=w$(n.getOrCreateTracker(2)),o=w$(n.getOrCreateTracker(1)),a={},i=function(){},l=new S$,s=function(e,t,n,r){void 0===n&&(n=u$(u())),void 0===r&&(r=P$()),l.add((function(){return s(e,t,n,r)}))},c=function(){};function u(){return{view:{referrer:document.referrer,url:window.location.href},context:r.getContext(),user:o.getContext()}}return function(e){var t=UW({version:"5.7.0",onReady:function(e){e()}},e);return Object.defineProperty(t,"_setDebug",{get:function(){return NW},enumerable:!1}),t}({logger:new Eq((function(){for(var e=[],t=0;t({editorBackground:{background:"radial-gradient(ellipse at top,#08122d,#030712),radial-gradient(ellipse at bottom,#030712,#030712)",margin:"0 auto",minHeight:"100vh"},logo:{maxWidth:"80rem",margin:"0 auto",padding:"32px 0 0 32px",display:"flex",justifyContent:"space-between",alignItems:"center"}}))),YG="local";function XG(){const[e,t]=(0,r.useState)(),{classes:n}=KG(),o=(0,r.useCallback)((async()=>{const e=await yW.ufetch.post(wW.LOAD,{});t(e.aiconfig)}),[]);(0,r.useEffect)((()=>{o()}),[o]);const a=(0,r.useCallback)((async()=>{var e;if("development"===(null!==(e="production")?e:"development"))return;var t;(await yW.ufetch.get(wW.GET_AICONFIGRC,{})).allow_usage_data_sharing&&(GG.init({clientToken:"pub356987caf022337989e492681d1944a8",env:null!==(t="production")?t:"development",service:"aiconfig-editor",site:"us5.datadoghq.com",forwardErrorsToLogs:!0,sessionSampleRate:100}),GG.setGlobalContextProperty("mode",YG))}),[]);(0,r.useEffect)((()=>{a()}),[a]);const i=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.SAVE,{aiconfig:e})),[]),l=(0,r.useCallback)((async e=>{const t=(await yW.ufetch.get(wW.LIST_MODELS)).data;if(e&&e.length>0){const n=e.toLowerCase();return t.filter((e=>e.toLocaleLowerCase().indexOf(n)>=0))}return t}),[]),s=(0,r.useCallback)((async(e,t,n)=>await yW.ufetch.post(wW.ADD_PROMPT,{prompt_name:e,prompt_data:t,index:n})),[]),c=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.DELETE_PROMPT,{prompt_name:e})),[]),u=(0,r.useCallback)((async()=>await yW.ufetch.post(wW.CLEAR_OUTPUTS,{})),[]),d=(0,r.useCallback)((async function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],o=arguments.length>4?arguments[4]:void 0;return await async function(e,t){return new Promise(((n,r)=>{let o=kW()(e);Object.keys(t).forEach((e=>{const n=t[e];o=o.node(e,n)})),o.done((e=>n(e))).fail((e=>r(e.jsonBody)))}))}({url:wW.RUN_PROMPT,method:"POST",body:{prompt_name:e,stream:r,cancellation_token_id:o}},{output_chunk:e=>{t({type:"output_chunk",data:e})},aiconfig_chunk:e=>{t({type:"aiconfig_chunk",data:e})},stop_streaming:e=>{t({type:"stop_streaming",data:null})},error:e=>{n({type:"error",data:e})}})}),[]),f=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.CANCEL,{cancellation_token_id:e})),[]),p=(0,r.useCallback)((async(e,t)=>await yW.ufetch.post(wW.UPDATE_PROMPT,{prompt_name:e,prompt_data:t})),[]),m=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.UPDATE_MODEL,{model_name:e.modelName,settings:e.settings,prompt_name:e.promptName})),[]),h=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.SET_NAME,{name:e})),[]),g=(0,r.useCallback)((async e=>await yW.ufetch.post(wW.SET_DESCRIPTION,{description:e})),[]),y=(0,r.useCallback)((async(e,t)=>await yW.ufetch.post(wW.SET_PARAMETERS,{parameters:e,prompt_name:t})),[]),v=(0,r.useCallback)((async()=>await yW.ufetch.get(wW.SERVER_STATUS)),[]),b=(0,r.useCallback)(((e,t)=>{try{GG.logger.info(e,t)}catch(n){}}),[]),w=(0,r.useMemo)((()=>({addPrompt:s,cancel:f,clearOutputs:u,deletePrompt:c,getModels:l,getServerStatus:v,logEventHandler:b,runPrompt:d,save:i,setConfigDescription:g,setConfigName:h,setParameters:y,updateModel:m,updatePrompt:p})),[s,f,u,c,l,v,b,d,i,g,h,y,m,p]);return(0,oy.jsxs)("div",{className:n.editorBackground,children:[(0,oy.jsx)("div",{className:n.logo,children:(0,oy.jsx)(HM,{withPlaceholder:!0,maw:140,src:"images/aiconfigLogo.png",alt:"AiConfig Logo"})}),e?(0,oy.jsx)(gW,{aiconfig:e,callbacks:w,mode:YG}):(0,oy.jsx)(wa,{justify:"center",mt:"xl",children:(0,oy.jsx)(Vr,{size:"xl"})})]})}a.createRoot(document.getElementById("root")).render((0,oy.jsx)(r.StrictMode,{children:(0,oy.jsx)(XG,{})}))})()})();
-//# sourceMappingURL=main.7cef3223.js.map
\ No newline at end of file
+/*! For license information please see main.1afb2184.js.LICENSE.txt */
+(()=>{var e={998:(e,t)=>{"use strict";t.Z=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),a=o.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim().toLowerCase();return"."===t.charAt(0)?r.toLowerCase().endsWith(t):t.endsWith("/*")?a===t.replace(/\/.*$/,""):o===t}))}return!0}},132:e=>{"use strict";var t=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,o=Object.getOwnPropertyDescriptor,a=function(e){return"function"===typeof Array.isArray?Array.isArray(e):"[object Array]"===n.call(e)},i=function(e){if(!e||"[object Object]"!==n.call(e))return!1;var r,o=t.call(e,"constructor"),a=e.constructor&&e.constructor.prototype&&t.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!o&&!a)return!1;for(r in e);return"undefined"===typeof r||t.call(e,r)},l=function(e,t){r&&"__proto__"===t.name?r(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},s=function(e,n){if("__proto__"===n){if(!t.call(e,n))return;if(o)return o(e,n).value}return e[n]};e.exports=function e(){var t,n,r,o,c,u,d=arguments[0],f=1,p=arguments.length,m=!1;for("boolean"===typeof d&&(m=d,d=arguments[1]||{},f=2),(null==d||"object"!==typeof d&&"function"!==typeof d)&&(d={});f{"use strict";var r=n(441),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},i={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},l={};function s(e){return r.isMemo(e)?i:l[e.$$typeof]||o}l[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},l[r.Memo]=i;var c=Object.defineProperty,u=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,p=Object.getPrototypeOf,m=Object.prototype;e.exports=function e(t,n,r){if("string"!==typeof n){if(m){var o=p(n);o&&o!==m&&e(t,o,r)}var i=u(n);d&&(i=i.concat(d(n)));for(var l=s(t),h=s(n),g=0;g{var t=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,o=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,s=/^\s+|\s+$/g,c="";function u(e){return e?e.replace(s,c):c}e.exports=function(e,s){if("string"!==typeof e)throw new TypeError("First argument must be a string");if(!e)return[];s=s||{};var d=1,f=1;function p(e){var t=e.match(n);t&&(d+=t.length);var r=e.lastIndexOf("\n");f=~r?e.length-r:f+e.length}function m(){var e={line:d,column:f};return function(t){return t.position=new h(e),b(),t}}function h(e){this.start=e,this.end={line:d,column:f},this.source=s.source}h.prototype.content=e;var g=[];function y(t){var n=new Error(s.source+":"+d+":"+f+": "+t);if(n.reason=t,n.filename=s.source,n.line=d,n.column=f,n.source=e,!s.silent)throw n;g.push(n)}function v(t){var n=t.exec(e);if(n){var r=n[0];return p(r),e=e.slice(r.length),n}}function b(){v(r)}function w(e){var t;for(e=e||[];t=x();)!1!==t&&e.push(t);return e}function x(){var t=m();if("/"==e.charAt(0)&&"*"==e.charAt(1)){for(var n=2;c!=e.charAt(n)&&("*"!=e.charAt(n)||"/"!=e.charAt(n+1));)++n;if(n+=2,c===e.charAt(n-1))return y("End of comment missing");var r=e.slice(2,n-2);return f+=2,p(r),e=e.slice(n),f+=2,t({type:"comment",comment:r})}}function k(){var e=m(),n=v(o);if(n){if(x(),!v(a))return y("property missing ':'");var r=v(i),s=e({type:"declaration",property:u(n[0].replace(t,c)),value:r?u(r[0].replace(t,c)):c});return v(l),s}}return b(),function(){var e,t=[];for(w(t);e=k();)!1!==e&&(t.push(e),w(t));return t}()}},586:e=>{e.exports=function(e){return null!=e&&null!=e.constructor&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},101:(e,t,n)=>{n(288),e.exports=self.fetch.bind(self)},763:function(e,t,n){var r;e=n.nmd(e),function(){var o,a="Expected a function",i="__lodash_hash_undefined__",l="__lodash_placeholder__",s=16,c=32,u=64,d=128,f=256,p=1/0,m=9007199254740991,h=NaN,g=4294967295,y=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",s],["flip",512],["partial",c],["partialRight",u],["rearg",f]],v="[object Arguments]",b="[object Array]",w="[object Boolean]",x="[object Date]",k="[object Error]",S="[object Function]",O="[object GeneratorFunction]",E="[object Map]",C="[object Number]",_="[object Object]",P="[object Promise]",j="[object RegExp]",T="[object Set]",R="[object String]",N="[object Symbol]",A="[object WeakMap]",I="[object ArrayBuffer]",D="[object DataView]",z="[object Float32Array]",L="[object Float64Array]",F="[object Int8Array]",M="[object Int16Array]",B="[object Int32Array]",U="[object Uint8Array]",H="[object Uint8ClampedArray]",W="[object Uint16Array]",$="[object Uint32Array]",V=/\b__p \+= '';/g,q=/\b(__p \+=) '' \+/g,G=/(__e\(.*?\)|\b__t\)) \+\n'';/g,K=/&(?:amp|lt|gt|quot|#39);/g,Y=/[&<>"']/g,X=RegExp(K.source),Z=RegExp(Y.source),Q=/<%-([\s\S]+?)%>/g,J=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/,re=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oe=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(oe.source),ie=/^\s+/,le=/\s/,se=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ce=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,fe=/[()=,{}\[\]\/\s]/,pe=/\\(\\)?/g,me=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,ge=/^[-+]0x[0-9a-f]+$/i,ye=/^0b[01]+$/i,ve=/^\[object .+?Constructor\]$/,be=/^0o[0-7]+$/i,we=/^(?:0|[1-9]\d*)$/,xe=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ke=/($^)/,Se=/['\n\r\u2028\u2029\\]/g,Oe="\\ud800-\\udfff",Ee="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ce="\\u2700-\\u27bf",_e="a-z\\xdf-\\xf6\\xf8-\\xff",Pe="A-Z\\xc0-\\xd6\\xd8-\\xde",je="\\ufe0e\\ufe0f",Te="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Re="['\u2019]",Ne="["+Oe+"]",Ae="["+Te+"]",Ie="["+Ee+"]",De="\\d+",ze="["+Ce+"]",Le="["+_e+"]",Fe="[^"+Oe+Te+De+Ce+_e+Pe+"]",Me="\\ud83c[\\udffb-\\udfff]",Be="[^"+Oe+"]",Ue="(?:\\ud83c[\\udde6-\\uddff]){2}",He="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Pe+"]",$e="\\u200d",Ve="(?:"+Le+"|"+Fe+")",qe="(?:"+We+"|"+Fe+")",Ge="(?:['\u2019](?:d|ll|m|re|s|t|ve))?",Ke="(?:['\u2019](?:D|LL|M|RE|S|T|VE))?",Ye="(?:"+Ie+"|"+Me+")"+"?",Xe="["+je+"]?",Ze=Xe+Ye+("(?:"+$e+"(?:"+[Be,Ue,He].join("|")+")"+Xe+Ye+")*"),Qe="(?:"+[ze,Ue,He].join("|")+")"+Ze,Je="(?:"+[Be+Ie+"?",Ie,Ue,He,Ne].join("|")+")",et=RegExp(Re,"g"),tt=RegExp(Ie,"g"),nt=RegExp(Me+"(?="+Me+")|"+Je+Ze,"g"),rt=RegExp([We+"?"+Le+"+"+Ge+"(?="+[Ae,We,"$"].join("|")+")",qe+"+"+Ke+"(?="+[Ae,We+Ve,"$"].join("|")+")",We+"?"+Ve+"+"+Ge,We+"+"+Ke,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",De,Qe].join("|"),"g"),ot=RegExp("["+$e+Oe+Ee+je+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,it=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],lt=-1,st={};st[z]=st[L]=st[F]=st[M]=st[B]=st[U]=st[H]=st[W]=st[$]=!0,st[v]=st[b]=st[I]=st[w]=st[D]=st[x]=st[k]=st[S]=st[E]=st[C]=st[_]=st[j]=st[T]=st[R]=st[A]=!1;var ct={};ct[v]=ct[b]=ct[I]=ct[D]=ct[w]=ct[x]=ct[z]=ct[L]=ct[F]=ct[M]=ct[B]=ct[E]=ct[C]=ct[_]=ct[j]=ct[T]=ct[R]=ct[N]=ct[U]=ct[H]=ct[W]=ct[$]=!0,ct[k]=ct[S]=ct[A]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,ft=parseInt,pt="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,mt="object"==typeof self&&self&&self.Object===Object&&self,ht=pt||mt||Function("return this")(),gt=t&&!t.nodeType&&t,yt=gt&&e&&!e.nodeType&&e,vt=yt&&yt.exports===gt,bt=vt&&pt.process,wt=function(){try{var e=yt&&yt.require&&yt.require("util").types;return e||bt&&bt.binding&&bt.binding("util")}catch(t){}}(),xt=wt&&wt.isArrayBuffer,kt=wt&&wt.isDate,St=wt&&wt.isMap,Ot=wt&&wt.isRegExp,Et=wt&&wt.isSet,Ct=wt&&wt.isTypedArray;function _t(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function Pt(e,t,n,r){for(var o=-1,a=null==e?0:e.length;++o-1}function It(e,t,n){for(var r=-1,o=null==e?0:e.length;++r-1;);return n}function rn(e,t){for(var n=e.length;n--&&Wt(t,e[n],0)>-1;);return n}var on=Kt({"\xc0":"A","\xc1":"A","\xc2":"A","\xc3":"A","\xc4":"A","\xc5":"A","\xe0":"a","\xe1":"a","\xe2":"a","\xe3":"a","\xe4":"a","\xe5":"a","\xc7":"C","\xe7":"c","\xd0":"D","\xf0":"d","\xc8":"E","\xc9":"E","\xca":"E","\xcb":"E","\xe8":"e","\xe9":"e","\xea":"e","\xeb":"e","\xcc":"I","\xcd":"I","\xce":"I","\xcf":"I","\xec":"i","\xed":"i","\xee":"i","\xef":"i","\xd1":"N","\xf1":"n","\xd2":"O","\xd3":"O","\xd4":"O","\xd5":"O","\xd6":"O","\xd8":"O","\xf2":"o","\xf3":"o","\xf4":"o","\xf5":"o","\xf6":"o","\xf8":"o","\xd9":"U","\xda":"U","\xdb":"U","\xdc":"U","\xf9":"u","\xfa":"u","\xfb":"u","\xfc":"u","\xdd":"Y","\xfd":"y","\xff":"y","\xc6":"Ae","\xe6":"ae","\xde":"Th","\xfe":"th","\xdf":"ss","\u0100":"A","\u0102":"A","\u0104":"A","\u0101":"a","\u0103":"a","\u0105":"a","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u0107":"c","\u0109":"c","\u010b":"c","\u010d":"c","\u010e":"D","\u0110":"D","\u010f":"d","\u0111":"d","\u0112":"E","\u0114":"E","\u0116":"E","\u0118":"E","\u011a":"E","\u0113":"e","\u0115":"e","\u0117":"e","\u0119":"e","\u011b":"e","\u011c":"G","\u011e":"G","\u0120":"G","\u0122":"G","\u011d":"g","\u011f":"g","\u0121":"g","\u0123":"g","\u0124":"H","\u0126":"H","\u0125":"h","\u0127":"h","\u0128":"I","\u012a":"I","\u012c":"I","\u012e":"I","\u0130":"I","\u0129":"i","\u012b":"i","\u012d":"i","\u012f":"i","\u0131":"i","\u0134":"J","\u0135":"j","\u0136":"K","\u0137":"k","\u0138":"k","\u0139":"L","\u013b":"L","\u013d":"L","\u013f":"L","\u0141":"L","\u013a":"l","\u013c":"l","\u013e":"l","\u0140":"l","\u0142":"l","\u0143":"N","\u0145":"N","\u0147":"N","\u014a":"N","\u0144":"n","\u0146":"n","\u0148":"n","\u014b":"n","\u014c":"O","\u014e":"O","\u0150":"O","\u014d":"o","\u014f":"o","\u0151":"o","\u0154":"R","\u0156":"R","\u0158":"R","\u0155":"r","\u0157":"r","\u0159":"r","\u015a":"S","\u015c":"S","\u015e":"S","\u0160":"S","\u015b":"s","\u015d":"s","\u015f":"s","\u0161":"s","\u0162":"T","\u0164":"T","\u0166":"T","\u0163":"t","\u0165":"t","\u0167":"t","\u0168":"U","\u016a":"U","\u016c":"U","\u016e":"U","\u0170":"U","\u0172":"U","\u0169":"u","\u016b":"u","\u016d":"u","\u016f":"u","\u0171":"u","\u0173":"u","\u0174":"W","\u0175":"w","\u0176":"Y","\u0177":"y","\u0178":"Y","\u0179":"Z","\u017b":"Z","\u017d":"Z","\u017a":"z","\u017c":"z","\u017e":"z","\u0132":"IJ","\u0133":"ij","\u0152":"Oe","\u0153":"oe","\u0149":"'n","\u017f":"s"}),an=Kt({"&":"&","<":"<",">":">",'"':""","'":"'"});function ln(e){return"\\"+ut[e]}function sn(e){return ot.test(e)}function cn(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function un(e,t){return function(n){return e(t(n))}}function dn(e,t){for(var n=-1,r=e.length,o=0,a=[];++n",""":'"',"'":"'"});var vn=function e(t){var n=(t=null==t?ht:vn.defaults(ht.Object(),t,vn.pick(ht,it))).Array,r=t.Date,le=t.Error,Oe=t.Function,Ee=t.Math,Ce=t.Object,_e=t.RegExp,Pe=t.String,je=t.TypeError,Te=n.prototype,Re=Oe.prototype,Ne=Ce.prototype,Ae=t["__core-js_shared__"],Ie=Re.toString,De=Ne.hasOwnProperty,ze=0,Le=function(){var e=/[^.]+$/.exec(Ae&&Ae.keys&&Ae.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),Fe=Ne.toString,Me=Ie.call(Ce),Be=ht._,Ue=_e("^"+Ie.call(De).replace(oe,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),He=vt?t.Buffer:o,We=t.Symbol,$e=t.Uint8Array,Ve=He?He.allocUnsafe:o,qe=un(Ce.getPrototypeOf,Ce),Ge=Ce.create,Ke=Ne.propertyIsEnumerable,Ye=Te.splice,Xe=We?We.isConcatSpreadable:o,Ze=We?We.iterator:o,Qe=We?We.toStringTag:o,Je=function(){try{var e=fa(Ce,"defineProperty");return e({},"",{}),e}catch(t){}}(),nt=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ot=r&&r.now!==ht.Date.now&&r.now,ut=t.setTimeout!==ht.setTimeout&&t.setTimeout,pt=Ee.ceil,mt=Ee.floor,gt=Ce.getOwnPropertySymbols,yt=He?He.isBuffer:o,bt=t.isFinite,wt=Te.join,Bt=un(Ce.keys,Ce),Kt=Ee.max,bn=Ee.min,wn=r.now,xn=t.parseInt,kn=Ee.random,Sn=Te.reverse,On=fa(t,"DataView"),En=fa(t,"Map"),Cn=fa(t,"Promise"),_n=fa(t,"Set"),Pn=fa(t,"WeakMap"),jn=fa(Ce,"create"),Tn=Pn&&new Pn,Rn={},Nn=Fa(On),An=Fa(En),In=Fa(Cn),Dn=Fa(_n),zn=Fa(Pn),Ln=We?We.prototype:o,Fn=Ln?Ln.valueOf:o,Mn=Ln?Ln.toString:o;function Bn(e){if(tl(e)&&!$i(e)&&!(e instanceof $n)){if(e instanceof Wn)return e;if(De.call(e,"__wrapped__"))return Ma(e)}return new Wn(e)}var Un=function(){function e(){}return function(t){if(!el(t))return{};if(Ge)return Ge(t);e.prototype=t;var n=new e;return e.prototype=o,n}}();function Hn(){}function Wn(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=o}function $n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=g,this.__views__=[]}function Vn(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function sr(e,t,n,r,a,i){var l,s=1&t,c=2&t,u=4&t;if(n&&(l=a?n(e,r,a,i):n(e)),l!==o)return l;if(!el(e))return e;var d=$i(e);if(d){if(l=function(e){var t=e.length,n=new e.constructor(t);t&&"string"==typeof e[0]&&De.call(e,"index")&&(n.index=e.index,n.input=e.input);return n}(e),!s)return To(e,l)}else{var f=ha(e),p=f==S||f==O;if(Ki(e))return Oo(e,s);if(f==_||f==v||p&&!a){if(l=c||p?{}:ya(e),!s)return c?function(e,t){return Ro(e,ma(e),t)}(e,function(e,t){return e&&Ro(t,Nl(t),e)}(l,e)):function(e,t){return Ro(e,pa(e),t)}(e,or(l,e))}else{if(!ct[f])return a?e:{};l=function(e,t,n){var r=e.constructor;switch(t){case I:return Eo(e);case w:case x:return new r(+e);case D:return function(e,t){var n=t?Eo(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,n);case z:case L:case F:case M:case B:case U:case H:case W:case $:return Co(e,n);case E:return new r;case C:case R:return new r(e);case j:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case T:return new r;case N:return o=e,Fn?Ce(Fn.call(o)):{}}var o}(e,f,s)}}i||(i=new Yn);var m=i.get(e);if(m)return m;i.set(e,l),il(e)?e.forEach((function(r){l.add(sr(r,t,n,r,e,i))})):nl(e)&&e.forEach((function(r,o){l.set(o,sr(r,t,n,o,e,i))}));var h=d?o:(u?c?aa:oa:c?Nl:Rl)(e);return jt(h||e,(function(r,o){h&&(r=e[o=r]),tr(l,o,sr(r,t,n,o,e,i))})),l}function cr(e,t,n){var r=n.length;if(null==e)return!r;for(e=Ce(e);r--;){var a=n[r],i=t[a],l=e[a];if(l===o&&!(a in e)||!i(l))return!1}return!0}function ur(e,t,n){if("function"!=typeof e)throw new je(a);return Ra((function(){e.apply(o,n)}),t)}function dr(e,t,n,r){var o=-1,a=At,i=!0,l=e.length,s=[],c=t.length;if(!l)return s;n&&(t=Dt(t,Jt(n))),r?(a=It,i=!1):t.length>=200&&(a=tn,i=!1,t=new Kn(t));e:for(;++o-1},qn.prototype.set=function(e,t){var n=this.__data__,r=nr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this},Gn.prototype.clear=function(){this.size=0,this.__data__={hash:new Vn,map:new(En||qn),string:new Vn}},Gn.prototype.delete=function(e){var t=ua(this,e).delete(e);return this.size-=t?1:0,t},Gn.prototype.get=function(e){return ua(this,e).get(e)},Gn.prototype.has=function(e){return ua(this,e).has(e)},Gn.prototype.set=function(e,t){var n=ua(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this},Kn.prototype.add=Kn.prototype.push=function(e){return this.__data__.set(e,i),this},Kn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.clear=function(){this.__data__=new qn,this.size=0},Yn.prototype.delete=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n},Yn.prototype.get=function(e){return this.__data__.get(e)},Yn.prototype.has=function(e){return this.__data__.has(e)},Yn.prototype.set=function(e,t){var n=this.__data__;if(n instanceof qn){var r=n.__data__;if(!En||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new Gn(r)}return n.set(e,t),this.size=n.size,this};var fr=Io(wr),pr=Io(xr,!0);function mr(e,t){var n=!0;return fr(e,(function(e,r,o){return n=!!t(e,r,o)})),n}function hr(e,t,n){for(var r=-1,a=e.length;++r0&&n(l)?t>1?yr(l,t-1,n,r,o):zt(o,l):r||(o[o.length]=l)}return o}var vr=Do(),br=Do(!0);function wr(e,t){return e&&vr(e,t,Rl)}function xr(e,t){return e&&br(e,t,Rl)}function kr(e,t){return Nt(t,(function(t){return Zi(e[t])}))}function Sr(e,t){for(var n=0,r=(t=wo(t,e)).length;null!=e&&nt}function _r(e,t){return null!=e&&De.call(e,t)}function Pr(e,t){return null!=e&&t in Ce(e)}function jr(e,t,r){for(var a=r?It:At,i=e[0].length,l=e.length,s=l,c=n(l),u=1/0,d=[];s--;){var f=e[s];s&&t&&(f=Dt(f,Jt(t))),u=bn(f.length,u),c[s]=!r&&(t||i>=120&&f.length>=120)?new Kn(s&&f):o}f=e[0];var p=-1,m=c[0];e:for(;++p