@langgraph-js/ui 4.0.4 → 4.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/assets/{arc-VHSz5mGH.js → arc-BAc1czF8.js} +1 -1
  2. package/dist/assets/{architectureDiagram-VXUJARFQ-ByOANAgd.js → architectureDiagram-VXUJARFQ-CavOvirI.js} +1 -1
  3. package/dist/assets/{blockDiagram-VD42YOAC-D9vvw2x2.js → blockDiagram-VD42YOAC-BDD_0NWy.js} +1 -1
  4. package/dist/assets/{c4Diagram-YG6GDRKO-Cjgfea4R.js → c4Diagram-YG6GDRKO-DTVchmmg.js} +1 -1
  5. package/dist/assets/channel-DDK0v3ML.js +1 -0
  6. package/dist/assets/{chunk-4BX2VUAB-DaetH3EV.js → chunk-4BX2VUAB-D4Em_gDP.js} +1 -1
  7. package/dist/assets/{chunk-55IACEB6-HRZ91JWG.js → chunk-55IACEB6-Dcapvv74.js} +1 -1
  8. package/dist/assets/{chunk-B4BG7PRW-BxOW4a9d.js → chunk-B4BG7PRW-BbNrguCc.js} +1 -1
  9. package/dist/assets/{chunk-DI55MBZ5-CJNOQRsD.js → chunk-DI55MBZ5-BH4jwLyd.js} +1 -1
  10. package/dist/assets/{chunk-FMBD7UC4-BWhkxmUU.js → chunk-FMBD7UC4-DInJvo1o.js} +1 -1
  11. package/dist/assets/{chunk-QN33PNHL-CuRPvllX.js → chunk-QN33PNHL-C1e0De2x.js} +1 -1
  12. package/dist/assets/{chunk-QZHKN3VN-9fig0537.js → chunk-QZHKN3VN-CpPtoLmr.js} +1 -1
  13. package/dist/assets/{chunk-TZMSLE5B-C_WU0QiO.js → chunk-TZMSLE5B-BaxZOHW_.js} +1 -1
  14. package/dist/assets/classDiagram-2ON5EDUG-B2rmys2I.js +1 -0
  15. package/dist/assets/classDiagram-v2-WZHVMYZB-B2rmys2I.js +1 -0
  16. package/dist/assets/clone-qt0Uai-W.js +1 -0
  17. package/dist/assets/{cose-bilkent-S5V4N54A-Bsptsgkr.js → cose-bilkent-S5V4N54A-BbQyrWCB.js} +1 -1
  18. package/dist/assets/{dagre-6UL2VRFP-Dp-vNAFo.js → dagre-6UL2VRFP-3ekrdBvk.js} +1 -1
  19. package/dist/assets/{diagram-PSM6KHXK-DydynADF.js → diagram-PSM6KHXK-DsRtX2cw.js} +1 -1
  20. package/dist/assets/{diagram-QEK2KX5R-D9TeDN1X.js → diagram-QEK2KX5R-egxOwKRm.js} +1 -1
  21. package/dist/assets/{diagram-S2PKOQOG-DSRjzc3q.js → diagram-S2PKOQOG-DN1tL3TP.js} +1 -1
  22. package/dist/assets/{erDiagram-Q2GNP2WA-DzdPHEjy.js → erDiagram-Q2GNP2WA-5Dfer6zs.js} +1 -1
  23. package/dist/assets/{flowDiagram-NV44I4VS-CbxmajPf.js → flowDiagram-NV44I4VS-BIV1zHK0.js} +1 -1
  24. package/dist/assets/{ganttDiagram-LVOFAZNH-Drha5fxW.js → ganttDiagram-LVOFAZNH-Bb9iecWS.js} +1 -1
  25. package/dist/assets/{gitGraphDiagram-NY62KEGX-LbHwve64.js → gitGraphDiagram-NY62KEGX-BQxDGGGE.js} +1 -1
  26. package/dist/assets/{graph-DCf4xH9S.js → graph-RLCn-E7g.js} +1 -1
  27. package/dist/assets/{index-BLuMPbxE.js → index-13ycxDV3.js} +3 -3
  28. package/dist/assets/{index-CDM1QYzI.js → index-BCRpZS_X.js} +1 -1
  29. package/dist/assets/{infoDiagram-F6ZHWCRC-ClyhK0t7.js → infoDiagram-F6ZHWCRC-1GNsG9dK.js} +1 -1
  30. package/dist/assets/{isUndefined-C8RsejfO.js → isUndefined-CY0C6OwU.js} +1 -1
  31. package/dist/assets/{journeyDiagram-XKPGCS4Q-D5-QQe5o.js → journeyDiagram-XKPGCS4Q-CPqGEBem.js} +1 -1
  32. package/dist/assets/{kanban-definition-3W4ZIXB7-syv7L3k1.js → kanban-definition-3W4ZIXB7-Drr2wjOC.js} +1 -1
  33. package/dist/assets/{layout-BVJoT6aY.js → layout-BoFEBs_k.js} +1 -1
  34. package/dist/assets/{linear-CYugkV7n.js → linear-JZc4q3eI.js} +1 -1
  35. package/dist/assets/{mermaid.core-C74BWk1B.js → mermaid.core-Cs0rHKmx.js} +5 -5
  36. package/dist/assets/{min-DiXGSxOK.js → min-DBid7Tsd.js} +1 -1
  37. package/dist/assets/{mindmap-definition-VGOIOE7T-BvO9FTOF.js → mindmap-definition-VGOIOE7T-DpBDyrm6.js} +1 -1
  38. package/dist/assets/{pieDiagram-ADFJNKIX-DXn2hC-L.js → pieDiagram-ADFJNKIX-D7wtqGjt.js} +1 -1
  39. package/dist/assets/{quadrantDiagram-AYHSOK5B-v-ly1CnS.js → quadrantDiagram-AYHSOK5B-_vkE9Dfe.js} +1 -1
  40. package/dist/assets/{requirementDiagram-UZGBJVZJ-CXfPn-H8.js → requirementDiagram-UZGBJVZJ-CWmn-U_i.js} +1 -1
  41. package/dist/assets/{sankeyDiagram-TZEHDZUN-BsEZTHTS.js → sankeyDiagram-TZEHDZUN-CbobzCiN.js} +1 -1
  42. package/dist/assets/{sequenceDiagram-WL72ISMW-Bism4Sux.js → sequenceDiagram-WL72ISMW-D9Ic_U5R.js} +1 -1
  43. package/dist/assets/{stateDiagram-FKZM4ZOC-ZURqOAAV.js → stateDiagram-FKZM4ZOC-CNVFpDFO.js} +1 -1
  44. package/dist/assets/stateDiagram-v2-4FDKWEC3-Cf4rHAY7.js +1 -0
  45. package/dist/assets/{timeline-definition-IT6M3QCI-CrIOkZVS.js → timeline-definition-IT6M3QCI-_rhmRDKg.js} +1 -1
  46. package/dist/assets/{treemap-KMMF4GRG-CUO0dPou.js → treemap-KMMF4GRG-fuji10Vw.js} +1 -1
  47. package/dist/assets/{xychartDiagram-PRI3JC2R-CpUXJp3l.js → xychartDiagram-PRI3JC2R-DQ0QJjCT.js} +1 -1
  48. package/dist/index.html +1 -1
  49. package/package.json +1 -1
  50. package/vite.config.preview.ts +0 -6
  51. package/dist/assets/channel-DVXmOWsH.js +0 -1
  52. package/dist/assets/classDiagram-2ON5EDUG-DaMtOxOJ.js +0 -1
  53. package/dist/assets/classDiagram-v2-WZHVMYZB-DaMtOxOJ.js +0 -1
  54. package/dist/assets/clone-n9nuTed8.js +0 -1
  55. package/dist/assets/stateDiagram-v2-4FDKWEC3-25vTwMmA.js +0 -1
@@ -51,14 +51,14 @@ Error generating stack: `+y.message+`
51
51
  ]))`;continue}else if(n[l]==="$"){a+=`($|(?=[\r
52
52
  ]))`;continue}}if(r.s&&n[l]==="."){a+=s?`${n[l]}\r
53
53
  `:`[${n[l]}\r
54
- ]`;continue}a+=n[l],n[l]==="\\"?i=!0:s&&n[l]==="]"?s=!1:!s&&n[l]==="["&&(s=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function PJ(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===Ve.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,a)=>({...n,[a]:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const r={type:"object",additionalProperties:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Ve.ZodString&&e.keyType._def.checks?.length){const{type:n,...a}=MJ(e.keyType._def,t);return{...r,propertyNames:a}}else{if(e.keyType?._def.typeName===Ve.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===Ve.ZodBranded&&e.keyType._def.type._def.typeName===Ve.ZodString&&e.keyType._def.type._def.checks?.length){const{type:n,...a}=LJ(e.keyType._def,t);return{...r,propertyNames:a}}}return r}function Rpe(e,t){if(t.mapStrategy==="record")return PJ(e,t);const r=or(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},n=or(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Ipe(e){const t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),a=Array.from(new Set(n.map(i=>typeof i)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n}}function Ope(){return{not:{}}}function Lpe(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Qb={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Dpe(e,t){if(t.target==="openApi3")return LM(e,t);const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Qb&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((a,i)=>{const s=Qb[i._def.typeName];return s&&!a.includes(s)?[...a,s]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((a,i)=>{const s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...a,s];case"bigint":return[...a,"integer"];case"object":if(i._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){const a=n.filter((i,s,o)=>o.indexOf(i)===s);return{type:a.length>1?a:a[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(i=>!n.includes(i))],[])};return LM(e,t)}const LM=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,a)=>or(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Mpe(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Qb[e.innerType._def.typeName],nullable:!0}:{type:[Qb[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const n=or(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}const r=or(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Ppe(e,t){const r={type:"number"};if(!e.checks)return r;for(const n of e.checks)switch(n.kind){case"int":r.type="integer",OJ(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?mr(r,"minimum",n.value,n.message,t):mr(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),mr(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?mr(r,"maximum",n.value,n.message,t):mr(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),mr(r,"maximum",n.value,n.message,t));break;case"multipleOf":mr(r,"multipleOf",n.value,n.message,t);break}return r}function Fpe(e,t){const r=t.target==="openAi",n={type:"object",properties:{}},a=[],i=e.shape();for(const o in i){let l=i[o];if(l===void 0||l._def===void 0)continue;let c=Bpe(l);c&&r&&(l instanceof mo&&(l=l._def.innerType),l.isNullable()||(l=l.nullable()),c=!1);const d=or(l._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});d!==void 0&&(n.properties[o]=d,c||a.push(o))}a.length&&(n.required=a);const s=$pe(e,t);return s!==void 0&&(n.additionalProperties=s),n}function $pe(e,t){if(e.catchall._def.typeName!=="ZodNever")return or(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Bpe(e){try{return e.isOptional()}catch{return!0}}const Upe=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return or(e.innerType._def,t);const r=or(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},zpe=(e,t)=>{if(t.pipeStrategy==="input")return or(e.in._def,t);if(t.pipeStrategy==="output")return or(e.out._def,t);const r=or(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=or(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(a=>a!==void 0)}};function qpe(e,t){return or(e.type._def,t)}function jpe(e,t){const n={type:"array",uniqueItems:!0,items:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&mr(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&mr(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function Hpe(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>or(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:or(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>or(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Gpe(){return{not:{}}}function Vpe(){return{}}const Ype=(e,t)=>or(e.innerType._def,t),Wpe=(e,t,r)=>{switch(t){case Ve.ZodString:return MJ(e,r);case Ve.ZodNumber:return Ppe(e,r);case Ve.ZodObject:return Fpe(e,r);case Ve.ZodBigInt:return ype(e,r);case Ve.ZodBoolean:return vpe();case Ve.ZodDate:return DJ(e,r);case Ve.ZodUndefined:return Gpe();case Ve.ZodNull:return Lpe(r);case Ve.ZodArray:return bpe(e,r);case Ve.ZodUnion:case Ve.ZodDiscriminatedUnion:return Dpe(e,r);case Ve.ZodIntersection:return Ape(e,r);case Ve.ZodTuple:return Hpe(e,r);case Ve.ZodRecord:return PJ(e,r);case Ve.ZodLiteral:return kpe(e,r);case Ve.ZodEnum:return Tpe(e);case Ve.ZodNativeEnum:return Ipe(e);case Ve.ZodNullable:return Mpe(e,r);case Ve.ZodOptional:return Upe(e,r);case Ve.ZodMap:return Rpe(e,r);case Ve.ZodSet:return jpe(e,r);case Ve.ZodLazy:return()=>e.getter()._def;case Ve.ZodPromise:return qpe(e,r);case Ve.ZodNaN:case Ve.ZodNever:return Ope();case Ve.ZodEffects:return wpe(e,r);case Ve.ZodAny:return gpe();case Ve.ZodUnknown:return Vpe();case Ve.ZodDefault:return Spe(e,r);case Ve.ZodBranded:return LJ(e,r);case Ve.ZodReadonly:return Ype(e,r);case Ve.ZodCatch:return Epe(e,r);case Ve.ZodPipeline:return zpe(e,r);case Ve.ZodFunction:case Ve.ZodVoid:case Ve.ZodSymbol:return;default:return(n=>{})()}};function or(e,t,r=!1){const n=t.seen.get(e);if(t.override){const o=t.override?.(e,t,n,r);if(o!==fpe)return o}if(n&&!r){const o=Kpe(n,t);if(o!==void 0)return o}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=Wpe(e,e.typeName,t),s=typeof i=="function"?or(i(),t):i;if(s&&Zpe(e,t,s),t.postProcess){const o=t.postProcess(s,e,t);return a.jsonSchema=s,o}return a.jsonSchema=s,s}const Kpe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Xpe(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},Xpe=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},Zpe=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),Qpe=(e,t)=>{const r=mpe(t),n=void 0,a=t?.name,i=or(e._def,r,!1)??{},s=a===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...n,[a]:i}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s},FJ=e=>{const t=e.execute||(async(r,n)=>{try{const a=await e.handler?.(r,n);return typeof a=="string"?[{type:"text",text:a}]:[{type:"text",text:JSON.stringify(a)}]}catch(a){return[{type:"text",text:`Error: ${a}`}]}});return{...e,execute:t}},Jpe=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:Qpe(cpe(e.parameters))});class $J{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(r=>this.bindTool(r))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,r,n){const a=this.getTool(t);if(!a)throw new Error(`Tool with name ${t} not found`);return await a.execute?.(r,n)}async toJSON(t,r=!0){return Array.from(this.tools.values()).filter(n=>r?!n.onlyRender:!0).filter(n=>!n.allowGraph||n.allowGraph.includes(t)).map(n=>Jpe(n))}doneWaiting(t,r){return this.waitingMap.has(t)?(this.waitingMap.get(t)(r),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((n,a)=>{this.waitingMap.set(t,n)})}static waitForUIDone(t,r){return r.client.tools.waitForDone(r.message.id)}}class tS{static isTool(t){return t.type==="tool"}static isToolAssistant(t){return t.type==="ai"&&(t.tool_calls?.length||t.tool_call_chunks?.length)}}class ehe{constructor(t="task_store"){this.streamingMessage=[],this.graphMessages=[],this.subAgentsKey=t}getStreamingMessages(){return[...this.streamingMessage]}setStreamingMessages(t){this.streamingMessage=t}clearStreamingMessages(){this.streamingMessage=[]}getGraphMessages(){return[...this.graphMessages]}setGraphMessages(t){this.graphMessages=t}updateStreamingMessage(t){const r=this.streamingMessage[this.streamingMessage.length-1];if(!r?.id||t.id!==r.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(r=>[r.id,r]));return[...this.graphMessages.map(r=>{if(t.has(r.id)){const n=t.get(r.id);return t.delete(r.id),n}return r}),...t.values()]}mergeSubGraphMessagesToStreamingMessages(t){const r=new Map(t.filter(n=>n.id).map(n=>[n.id,n]));this.streamingMessage.forEach(n=>{if(r.has(n.id)){const a=r.get(n.id);Object.assign(n,a),r.delete(n.id)}}),r.forEach(n=>{n.type==="tool"&&n.tool_call_id&&this.streamingMessage.push(n)})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}attachInfoForMessage(t){let r=null;const n=[...t];for(const a of n){const i=a.response_metadata?.create_time||"";if(a.unique_id=a.tool_call_id||a.id,a.spend_time=new Date(i).getTime()-new Date(r?.response_metadata?.create_time||i).getTime(),!a.usage_metadata&&a.response_metadata?.usage){const s=a.response_metadata.usage;a.usage_metadata={...s,input_tokens:s.prompt_tokens,output_tokens:s.completion_tokens,total_tokens:s.total_tokens}}r=a}return n}composeToolMessages(t){const r=[],n=new Map,a=new Map;for(const i of t)if(!(tS.isToolAssistant(i)&&((i.tool_calls||i.tool_call_chunks)?.forEach(s=>{n.set(s.id,s),a.set(s.id,i)}),!i.content))){if(tS.isTool(i)&&!i.tool_input){const s=n.get(i.tool_call_id),o=a.get(i.tool_call_id);s&&(i.tool_input=typeof s.args!="string"?JSON.stringify(s.args):s.args,i.additional_kwargs?(i.additional_kwargs.done=!0,i.done=!0):(i.done=!0,i.additional_kwargs={done:!0})),o&&(i.usage_metadata=o.usage_metadata,i.node_name=o.name,i.name||(i.name=o.tool_calls.find(l=>l.id===i.tool_call_id)?.name))}r.push(i)}return r}convertSubAgentMessages(t,r){const n=r[this.subAgentsKey];if(!n)return t;const a=JSON.parse(JSON.stringify(n));t.filter(o=>o.node_name?.startsWith("subagent_")).forEach(o=>{const l=o.node_name.replace("subagent_",""),c=a[l];c?c.messages.some(p=>p.id===o.id)||c.messages.push(o):a[l]={messages:[o]}});const i=new Set;Object.values(a).forEach(o=>{o.messages.forEach(l=>{i.add(l.id)})});const s=[];for(const o of t){if(o.type==="tool"&&o.tool_call_id){const l=a[o.tool_call_id];l&&(o.sub_agent_messages=this.processMessages(l.messages))}o.id&&i.has(o.id)||s.push(o)}return s}renderMessages(t,r){const n=new Map,a=new Set,i=[],s=this.combineGraphMessagesWithStreamingMessages();for(let o=s.length-1;o>=0;o--){const l=this.cloneMessage(s[o]);if(!l.id){i.unshift(l);continue}if(l.type==="ai"&&(l.name||(l.name=r().name)),tS.isToolAssistant(l)){const c=l;n.set(l.id,c);const p=(c.tool_calls?.length?c.tool_calls:c.tool_call_chunks).filter(h=>!a.has(h.id)).map((h,m)=>({type:"tool",additional_kwargs:{},tool_input:c.additional_kwargs?.tool_calls?.[m]?.function?.arguments,id:h.id,name:h.name,response_metadata:{},tool_call_id:h.id,content:""}));for(const h of p)n.has(h.id)||(i.unshift(h),n.set(h.id,h));i.unshift(c)}else l.type==="tool"&&l.tool_call_id&&a.add(l.tool_call_id),n.set(l.id,l),i.unshift(l)}return this.processMessages(i,t)}processMessages(t,r){const n=this.composeToolMessages(t),a=this.attachInfoForMessage(n);return r?this.convertSubAgentMessages(a,r):a}}async function the(e,t,r){const n=await e.threads.get(t),a=n.values.messages,i=a.findIndex(c=>c.id===r);if(i===-1)throw new Error(`Message id ${r} not found`);const s=a.slice(i+1),o={...n.values,messages:s.map(c=>({type:"remove",id:c.id}))},l=await e.threads.updateState(t,{values:o});return{state:{messages:a.slice(0,i+1)},checkpoint:l}}class rhe extends Pfe{constructor(t){super(),this.currentAssistant=null,this.currentThread=null,this.tools=new $J,this.availableAssistants=[],this.graphState={},this.stopController=null,this.subAgentsKey="task_store",this.graphPosition="",this.extraParams={},this.client=t.client,this.messageProcessor=new ehe(this.subAgentsKey)}get assistants(){return this.client.assistants}get threads(){return this.client.threads}get runs(){return this.client.runs}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t,r={}){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(a=>a.graph_id===t)||null,!this.currentAssistant){if(r.fallbackToAvailableAssistants)return this.currentAssistant=this.availableAssistants[0],this.currentAssistant;throw new Error("Agent not found: "+t)}}else return this.currentAssistant=n[0],this.currentAssistant;else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t,graphId:r}={}){try{return this.currentThread=await this.threads.create({threadId:t,graphId:r}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){return this.assistants.getGraph(this.currentAssistant?.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc",sortBy:"updated_at"})}async deleteThread(t){return this.threads.delete(t)}async resetThread(t,r){await this.initAssistant(t),this.currentThread=await this.threads.get(r),this.graphState=this.currentThread.values;const n=this.graphState?.messages||[];return this.messageProcessor.setGraphMessages(n),this.emit("value",{event:"messages/partial",data:{messages:this.messageProcessor.getGraphMessages()}}),this.currentThread}async resetStream(){const r=(await this.runs.list(this.currentThread.thread_id))?.find(n=>n.status==="running"||n.status==="pending");r&&await this.sendMessage([],{joinRunId:r.run_id})}cloneMessage(t){return this.messageProcessor.cloneMessage(t)}get renderMessage(){return this.messageProcessor.renderMessages(this.graphState,()=>this.getGraphNodeNow())}get tokenCounter(){return this.messageProcessor.getGraphMessages().reduce((t,r)=>{if(r.usage_metadata)t.total_tokens+=r.usage_metadata?.total_tokens||0,t.input_tokens+=r.usage_metadata?.input_tokens||0,t.output_tokens+=r.usage_metadata?.output_tokens||0;else if(r.response_metadata?.usage){const n=r.response_metadata?.usage;t.total_tokens+=n.total_tokens||0,t.input_tokens+=n.prompt_tokens||0,t.output_tokens+=n.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}isFELocking(t){const r=t[t.length-1];if(!r)return!1;const n=this.tools.getTool(r?.name);return n&&n.render&&r?.type==="tool"&&!r?.additional_kwargs?.done}cancelRun(){this.currentThread?.thread_id&&this.currentRun?.run_id&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async revertChatTo(t){const{state:r,checkpoint:n}=await the(this.client,this.currentThread.thread_id,t);return this.graphState=r,this.messageProcessor.clearStreamingMessages(),this.messageProcessor.setGraphMessages(r.messages),r}async sendMessage(t,{joinRunId:r,extraParams:n,_debug:a,command:i}={}){if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread({graphId:this.currentAssistant.graph_id}),this.emit("thread",{event:"thread/create",data:{thread:this.currentThread}}));const s=Array.isArray(t)?t:[{type:"human",content:t}],l=await(async()=>a?.streamResponse?a.streamResponse:r?this.runs.joinStream(this.currentThread.thread_id,r):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...n||{},messages:s,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:i}))(),c=[];this.emit("start",{event:"start"});for await(const p of l)if(c.push(p),p.event==="metadata")this.currentRun=p.data;else if(p.event==="error"||p.event==="Error"||p.event==="__stream_error__")this.emit("error",p);else if(p.event==="messages/partial"){for(const h of p.data)this.messageProcessor.updateStreamingMessage(h);this.emit("message",p);continue}else if(p.event==="values"){const h=p.data;if(h.messages){const m=!!i?.resume,b=h.messages.length>=this.messageProcessor.getGraphMessages().length;(!m||m&&b)&&(this.messageProcessor.setGraphMessages(h.messages),this.emit("value",p)),this.graphState=p.data}continue}else p.event.startsWith("values|")&&(p.data?.messages&&this.messageProcessor.mergeSubGraphMessagesToStreamingMessages(p.data.messages),this.graphPosition=p.event.split("|")[1]);const d=await this.runFETool();return d&&c.push(...d),this.emit("done",{event:"done"}),this.messageProcessor.clearStreamingMessages(),c}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[r,n]=t.split(":");return{id:n,name:r}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}runFETool(){const t=this.messageProcessor.getStreamingMessages(),r=t[t.length-1];if(r&&r.type==="ai"&&r.tool_calls?.length){const n=r.tool_calls.map(a=>{if(this.tools.getTool(a.name)){const i={...a,tool_call_id:a.id,tool_input:JSON.stringify(a.args),additional_kwargs:{}};return this.callFETool(i,a.args)}});return this.currentThread.status="interrupted",Promise.all(n)}}async callFETool(t,r){const n=this,a=await this.tools.callTool(t.name,r,{client:n,message:t});if(a)return this.resume(a)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,r){!this.tools.doneWaiting(t,r)&&this.currentThread?.status==="interrupted"&&this.resume(r)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){await this.initAssistant(this.currentAssistant?.graph_id),this.currentThread=null,this.graphState={},this.messageProcessor.setGraphMessages([]),this.messageProcessor.clearStreamingMessages(),this.currentRun=void 0,this.tools.clearWaiting(),this.emit("value",{event:"messages/partial",data:{messages:[]}})}}function nhe(e,t,r){var n,a,i;r===void 0&&(r={});var s=(n=r.isImmediate)!=null&&n,o=(a=r.callback)!=null&&a,l=r.maxWait,c=Date.now(),d=[];function p(){if(l!==void 0){var m=Date.now()-c;if(m+t>=l)return l-m}return t}var h=function(){var m=[].slice.call(arguments),b=this;return new Promise(function(w,_){var S=s&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,c=Date.now(),!s){var E=e.apply(b,m);o&&o(E),d.forEach(function(T){return(0,T.resolve)(E)}),d=[]}},p()),S){var v=e.apply(b,m);return o&&o(v),w(v)}d.push({resolve:w,reject:_})})};return h.cancel=function(m){i!==void 0&&clearTimeout(i),d.forEach(function(b){return(0,b.reject)(m)}),d=[]},h}class Yc extends Error{constructor(t,r){super("".concat(t," at position ").concat(r)),this.position=r}}const BJ=32,ahe=10,UJ=9,zJ=13,ihe=160,she=8192,ohe=8202,lhe=8239,uhe=8287,che=12288;function dhe(e){return/^[0-9A-Fa-f]$/.test(e)}function hu(e){return e>="0"&&e<="9"}function fhe(e){return e>=" "}function Xm(e){return`,:[]/{}()
54
+ ]`;continue}a+=n[l],n[l]==="\\"?i=!0:s&&n[l]==="]"?s=!1:!s&&n[l]==="["&&(s=!0)}try{new RegExp(a)}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return a}function PJ(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===Ve.ZodEnum)return{type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((n,a)=>({...n,[a]:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",a]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};const r={type:"object",additionalProperties:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return r;if(e.keyType?._def.typeName===Ve.ZodString&&e.keyType._def.checks?.length){const{type:n,...a}=MJ(e.keyType._def,t);return{...r,propertyNames:a}}else{if(e.keyType?._def.typeName===Ve.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===Ve.ZodBranded&&e.keyType._def.type._def.typeName===Ve.ZodString&&e.keyType._def.type._def.checks?.length){const{type:n,...a}=LJ(e.keyType._def,t);return{...r,propertyNames:a}}}return r}function Rpe(e,t){if(t.mapStrategy==="record")return PJ(e,t);const r=or(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||{},n=or(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}function Ipe(e){const t=e.values,n=Object.keys(e.values).filter(i=>typeof t[t[i]]!="number").map(i=>t[i]),a=Array.from(new Set(n.map(i=>typeof i)));return{type:a.length===1?a[0]==="string"?"string":"number":["string","number"],enum:n}}function Ope(){return{not:{}}}function Lpe(e){return e.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}const Qb={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Dpe(e,t){if(t.target==="openApi3")return LM(e,t);const r=e.options instanceof Map?Array.from(e.options.values()):e.options;if(r.every(n=>n._def.typeName in Qb&&(!n._def.checks||!n._def.checks.length))){const n=r.reduce((a,i)=>{const s=Qb[i._def.typeName];return s&&!a.includes(s)?[...a,s]:a},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){const n=r.reduce((a,i)=>{const s=typeof i._def.value;switch(s){case"string":case"number":case"boolean":return[...a,s];case"bigint":return[...a,"integer"];case"object":if(i._def.value===null)return[...a,"null"];case"symbol":case"undefined":case"function":default:return a}},[]);if(n.length===r.length){const a=n.filter((i,s,o)=>o.indexOf(i)===s);return{type:a.length>1?a:a[0],enum:r.reduce((i,s)=>i.includes(s._def.value)?i:[...i,s._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,a)=>[...n,...a._def.values.filter(i=>!n.includes(i))],[])};return LM(e,t)}const LM=(e,t)=>{const r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((n,a)=>or(n._def,{...t,currentPath:[...t.currentPath,"anyOf",`${a}`]})).filter(n=>!!n&&(!t.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0};function Mpe(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Qb[e.innerType._def.typeName],nullable:!0}:{type:[Qb[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){const n=or(e.innerType._def,{...t,currentPath:[...t.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}const r=or(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}function Ppe(e,t){const r={type:"number"};if(!e.checks)return r;for(const n of e.checks)switch(n.kind){case"int":r.type="integer",OJ(r,"type",n.message,t);break;case"min":t.target==="jsonSchema7"?n.inclusive?mr(r,"minimum",n.value,n.message,t):mr(r,"exclusiveMinimum",n.value,n.message,t):(n.inclusive||(r.exclusiveMinimum=!0),mr(r,"minimum",n.value,n.message,t));break;case"max":t.target==="jsonSchema7"?n.inclusive?mr(r,"maximum",n.value,n.message,t):mr(r,"exclusiveMaximum",n.value,n.message,t):(n.inclusive||(r.exclusiveMaximum=!0),mr(r,"maximum",n.value,n.message,t));break;case"multipleOf":mr(r,"multipleOf",n.value,n.message,t);break}return r}function Fpe(e,t){const r=t.target==="openAi",n={type:"object",properties:{}},a=[],i=e.shape();for(const o in i){let l=i[o];if(l===void 0||l._def===void 0)continue;let c=Bpe(l);c&&r&&(l instanceof mo&&(l=l._def.innerType),l.isNullable()||(l=l.nullable()),c=!1);const d=or(l._def,{...t,currentPath:[...t.currentPath,"properties",o],propertyPath:[...t.currentPath,"properties",o]});d!==void 0&&(n.properties[o]=d,c||a.push(o))}a.length&&(n.required=a);const s=$pe(e,t);return s!==void 0&&(n.additionalProperties=s),n}function $pe(e,t){if(e.catchall._def.typeName!=="ZodNever")return or(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function Bpe(e){try{return e.isOptional()}catch{return!0}}const Upe=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return or(e.innerType._def,t);const r=or(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}},zpe=(e,t)=>{if(t.pipeStrategy==="input")return or(e.in._def,t);if(t.pipeStrategy==="output")return or(e.out._def,t);const r=or(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),n=or(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(a=>a!==void 0)}};function qpe(e,t){return or(e.type._def,t)}function jpe(e,t){const n={type:"array",uniqueItems:!0,items:or(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&mr(n,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&mr(n,"maxItems",e.maxSize.value,e.maxSize.message,t),n}function Hpe(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((r,n)=>or(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:or(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((r,n)=>or(r._def,{...t,currentPath:[...t.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}function Gpe(){return{not:{}}}function Vpe(){return{}}const Ype=(e,t)=>or(e.innerType._def,t),Wpe=(e,t,r)=>{switch(t){case Ve.ZodString:return MJ(e,r);case Ve.ZodNumber:return Ppe(e,r);case Ve.ZodObject:return Fpe(e,r);case Ve.ZodBigInt:return ype(e,r);case Ve.ZodBoolean:return vpe();case Ve.ZodDate:return DJ(e,r);case Ve.ZodUndefined:return Gpe();case Ve.ZodNull:return Lpe(r);case Ve.ZodArray:return bpe(e,r);case Ve.ZodUnion:case Ve.ZodDiscriminatedUnion:return Dpe(e,r);case Ve.ZodIntersection:return Ape(e,r);case Ve.ZodTuple:return Hpe(e,r);case Ve.ZodRecord:return PJ(e,r);case Ve.ZodLiteral:return kpe(e,r);case Ve.ZodEnum:return Tpe(e);case Ve.ZodNativeEnum:return Ipe(e);case Ve.ZodNullable:return Mpe(e,r);case Ve.ZodOptional:return Upe(e,r);case Ve.ZodMap:return Rpe(e,r);case Ve.ZodSet:return jpe(e,r);case Ve.ZodLazy:return()=>e.getter()._def;case Ve.ZodPromise:return qpe(e,r);case Ve.ZodNaN:case Ve.ZodNever:return Ope();case Ve.ZodEffects:return wpe(e,r);case Ve.ZodAny:return gpe();case Ve.ZodUnknown:return Vpe();case Ve.ZodDefault:return Spe(e,r);case Ve.ZodBranded:return LJ(e,r);case Ve.ZodReadonly:return Ype(e,r);case Ve.ZodCatch:return Epe(e,r);case Ve.ZodPipeline:return zpe(e,r);case Ve.ZodFunction:case Ve.ZodVoid:case Ve.ZodSymbol:return;default:return(n=>{})()}};function or(e,t,r=!1){const n=t.seen.get(e);if(t.override){const o=t.override?.(e,t,n,r);if(o!==fpe)return o}if(n&&!r){const o=Kpe(n,t);if(o!==void 0)return o}const a={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,a);const i=Wpe(e,e.typeName,t),s=typeof i=="function"?or(i(),t):i;if(s&&Zpe(e,t,s),t.postProcess){const o=t.postProcess(s,e,t);return a.jsonSchema=s,o}return a.jsonSchema=s,s}const Kpe=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:Xpe(t.currentPath,e.path)};case"none":case"seen":return e.path.length<t.currentPath.length&&e.path.every((r,n)=>t.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{}):t.$refStrategy==="seen"?{}:void 0}},Xpe=(e,t)=>{let r=0;for(;r<e.length&&r<t.length&&e[r]===t[r];r++);return[(e.length-r).toString(),...t.slice(r)].join("/")},Zpe=(e,t,r)=>(e.description&&(r.description=e.description,t.markdownDescription&&(r.markdownDescription=e.description)),r),Qpe=(e,t)=>{const r=mpe(t),n=void 0,a=t?.name,i=or(e._def,r,!1)??{},s=a===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,a].join("/"),[r.definitionPath]:{...n,[a]:i}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s},FJ=e=>{const t=e.execute||(async(r,n)=>{try{const a=await e.handler?.(r,n);return typeof a=="string"?[{type:"text",text:a}]:[{type:"text",text:JSON.stringify(a)}]}catch(a){return[{type:"text",text:`Error: ${a}`}]}});return{...e,execute:t}},Jpe=e=>({name:e.name,description:e.description,parameters:e.isPureParams?e.parameters:Qpe(cpe(e.parameters))});class $J{constructor(){this.tools=new Map,this.waitingMap=new Map}bindTool(t){if(this.tools.has(t.name))throw new Error(`Tool with name ${t.name} already exists`);this.tools.set(t.name,t)}bindTools(t){t.forEach(r=>this.bindTool(r))}getAllTools(){return Array.from(this.tools.values())}getTool(t){return this.tools.get(t)}removeTool(t){return this.tools.delete(t)}clearTools(){this.tools.clear()}reset(){this.clearTools(),this.clearWaiting()}clearWaiting(){this.waitingMap.clear()}async callTool(t,r,n){const a=this.getTool(t);if(!a)throw new Error(`Tool with name ${t} not found`);return await a.execute?.(r,n)}async toJSON(t,r=!0){return Array.from(this.tools.values()).filter(n=>r?!n.onlyRender:!0).filter(n=>!n.allowGraph||n.allowGraph.includes(t)).map(n=>Jpe(n))}doneWaiting(t,r){return this.waitingMap.has(t)?(this.waitingMap.get(t)(r),this.waitingMap.delete(t),!0):(console.warn(`Waiting for tool ${t} not found`),!1)}waitForDone(t){return this.waitingMap.has(t)?this.waitingMap.get(t):new Promise((n,a)=>{this.waitingMap.set(t,n)})}static waitForUIDone(t,r){return r.client.tools.waitForDone(r.message.id)}}class tS{static isTool(t){return t.type==="tool"}static isToolAssistant(t){return t.type==="ai"&&(t.tool_calls?.length||t.tool_call_chunks?.length)}}class ehe{constructor(t="task_store"){this.streamingMessage=[],this.graphMessages=[],this.subAgentsKey=t}getStreamingMessages(){return[...this.streamingMessage]}setStreamingMessages(t){this.streamingMessage=t}clearStreamingMessages(){this.streamingMessage=[]}getGraphMessages(){return[...this.graphMessages]}setGraphMessages(t){this.graphMessages=t}updateStreamingMessage(t){const r=this.streamingMessage[this.streamingMessage.length-1];if(!r?.id||t.id!==r.id){this.streamingMessage.push(t);return}this.streamingMessage[this.streamingMessage.length-1]=t}combineGraphMessagesWithStreamingMessages(){const t=new Map(this.streamingMessage.map(r=>[r.id,r]));return[...this.graphMessages.map(r=>{if(t.has(r.id)){const n=t.get(r.id);return t.delete(r.id),n}return r}),...t.values()]}mergeSubGraphMessagesToStreamingMessages(t){const r=new Map(t.filter(n=>n.id).map(n=>[n.id,n]));this.streamingMessage.forEach(n=>{if(r.has(n.id)){const a=r.get(n.id);Object.assign(n,a),r.delete(n.id)}}),r.forEach(n=>{n.type==="tool"&&n.tool_call_id&&this.streamingMessage.push(n)})}cloneMessage(t){return JSON.parse(JSON.stringify(t))}attachInfoForMessage(t){let r=null;const n=[...t];for(const a of n){const i=a.response_metadata?.create_time||"";if(a.unique_id=a.tool_call_id||a.id,a.spend_time=new Date(i).getTime()-new Date(r?.response_metadata?.create_time||i).getTime(),!a.usage_metadata&&a.response_metadata?.usage){const s=a.response_metadata.usage;a.usage_metadata={...s,input_tokens:s.prompt_tokens,output_tokens:s.completion_tokens,total_tokens:s.total_tokens}}r=a}return n}composeToolMessages(t){const r=[],n=new Map,a=new Map;for(const i of t)if(!(tS.isToolAssistant(i)&&((i.tool_calls||i.tool_call_chunks)?.forEach(s=>{n.set(s.id,s),a.set(s.id,i)}),!i.content||typeof i.content=="string"&&i.content.trim()===""))){if(tS.isTool(i)&&!i.tool_input){const s=n.get(i.tool_call_id),o=a.get(i.tool_call_id);s&&(i.tool_input=typeof s.args!="string"?JSON.stringify(s.args):s.args,i.additional_kwargs?(i.additional_kwargs.done=!0,i.done=!0):(i.done=!0,i.additional_kwargs={done:!0})),o&&(i.usage_metadata=o.usage_metadata,i.node_name=o.name,i.name||(i.name=o.tool_calls.find(l=>l.id===i.tool_call_id)?.name))}r.push(i)}return r}convertSubAgentMessages(t,r){const n=r[this.subAgentsKey];if(!n)return t;const a=JSON.parse(JSON.stringify(n));t.filter(o=>o.node_name?.startsWith("subagent_")).forEach(o=>{const l=o.node_name.replace("subagent_",""),c=a[l];c?c.messages.some(p=>p.id===o.id)||c.messages.push(o):a[l]={messages:[o]}});const i=new Set;Object.values(a).forEach(o=>{o.messages.forEach(l=>{i.add(l.id)})});const s=[];for(const o of t){if(o.type==="tool"&&o.tool_call_id){const l=a[o.tool_call_id];l&&(o.sub_agent_messages=this.processMessages(l.messages))}o.id&&i.has(o.id)||s.push(o)}return s}renderMessages(t,r){const n=new Map,a=new Set,i=[],s=this.combineGraphMessagesWithStreamingMessages();for(let o=s.length-1;o>=0;o--){const l=this.cloneMessage(s[o]);if(!l.id){i.unshift(l);continue}if(l.type==="ai"&&(l.name||(l.name=r().name)),tS.isToolAssistant(l)){const c=l;n.set(l.id,c);const p=(c.tool_calls?.length?c.tool_calls:c.tool_call_chunks).filter(h=>!a.has(h.id)).map((h,m)=>({type:"tool",additional_kwargs:{},tool_input:c.additional_kwargs?.tool_calls?.[m]?.function?.arguments,id:h.id,name:h.name,response_metadata:{},tool_call_id:h.id,content:""}));for(const h of p)n.has(h.id)||(i.unshift(h),n.set(h.id,h));c.content&&typeof c.content=="string"&&c.content.trim()!==""&&i.unshift(c)}else l.type==="tool"&&l.tool_call_id&&a.add(l.tool_call_id),n.set(l.id,l),i.unshift(l)}return this.processMessages(i,t)}processMessages(t,r){const n=this.composeToolMessages(t),a=this.attachInfoForMessage(n);return r?this.convertSubAgentMessages(a,r):a}}async function the(e,t,r){const n=await e.threads.get(t),a=n.values.messages,i=a.findIndex(c=>c.id===r);if(i===-1)throw new Error(`Message id ${r} not found`);const s=a.slice(i+1),o={...n.values,messages:s.map(c=>({type:"remove",id:c.id}))},l=await e.threads.updateState(t,{values:o});return{state:{messages:a.slice(0,i+1)},checkpoint:l}}class rhe extends Pfe{constructor(t){super(),this.currentAssistant=null,this.currentThread=null,this.tools=new $J,this.availableAssistants=[],this.graphState={},this.stopController=null,this.subAgentsKey="task_store",this.graphPosition="",this.extraParams={},this.client=t.client,this.messageProcessor=new ehe(this.subAgentsKey)}get assistants(){return this.client.assistants}get threads(){return this.client.threads}get runs(){return this.client.runs}listAssistants(){return this.assistants.search({metadata:null,offset:0,limit:100})}async initAssistant(t,r={}){try{const n=await this.listAssistants();if(this.availableAssistants=n,n.length>0)if(t){if(this.currentAssistant=n.find(a=>a.graph_id===t)||null,!this.currentAssistant){if(r.fallbackToAvailableAssistants)return this.currentAssistant=this.availableAssistants[0],this.currentAssistant;throw new Error("Agent not found: "+t)}}else return this.currentAssistant=n[0],this.currentAssistant;else throw new Error("No assistants found")}catch(n){throw console.error("Failed to initialize LangGraphClient:",n),n}}async createThread({threadId:t,graphId:r}={}){try{return this.currentThread=await this.threads.create({threadId:t,graphId:r}),this.currentThread}catch(n){throw console.error("Failed to create new thread:",n),n}}graphVisualize(){return this.assistants.getGraph(this.currentAssistant?.assistant_id,{xray:!0})}async listThreads(){return this.threads.search({sortOrder:"desc",sortBy:"updated_at"})}async deleteThread(t){return this.threads.delete(t)}async resetThread(t,r){await this.initAssistant(t),this.currentThread=await this.threads.get(r),this.graphState=this.currentThread.values;const n=this.graphState?.messages||[];return this.messageProcessor.setGraphMessages(n),this.emit("value",{event:"messages/partial",data:{messages:this.messageProcessor.getGraphMessages()}}),this.currentThread}async resetStream(){const r=(await this.runs.list(this.currentThread.thread_id))?.find(n=>n.status==="running"||n.status==="pending");r&&await this.sendMessage([],{joinRunId:r.run_id})}cloneMessage(t){return this.messageProcessor.cloneMessage(t)}get renderMessage(){return this.messageProcessor.renderMessages(this.graphState,()=>this.getGraphNodeNow())}get tokenCounter(){return this.messageProcessor.getGraphMessages().reduce((t,r)=>{if(r.usage_metadata)t.total_tokens+=r.usage_metadata?.total_tokens||0,t.input_tokens+=r.usage_metadata?.input_tokens||0,t.output_tokens+=r.usage_metadata?.output_tokens||0;else if(r.response_metadata?.usage){const n=r.response_metadata?.usage;t.total_tokens+=n.total_tokens||0,t.input_tokens+=n.prompt_tokens||0,t.output_tokens+=n.completion_tokens||0}return t},{total_tokens:0,input_tokens:0,output_tokens:0})}isFELocking(t){const r=t[t.length-1];if(!r)return!1;const n=this.tools.getTool(r?.name);return n&&n.render&&r?.type==="tool"&&!r?.additional_kwargs?.done}cancelRun(){this.currentThread?.thread_id&&this.currentRun?.run_id&&this.runs.cancel(this.currentThread.thread_id,this.currentRun.run_id)}async revertChatTo(t){const{state:r,checkpoint:n}=await the(this.client,this.currentThread.thread_id,t);return this.graphState=r,this.messageProcessor.clearStreamingMessages(),this.messageProcessor.setGraphMessages(r.messages),r}async sendMessage(t,{joinRunId:r,extraParams:n,_debug:a,command:i}={}){if(!this.currentAssistant)throw new Error("Thread or Assistant not initialized");this.currentThread||(await this.createThread({graphId:this.currentAssistant.graph_id}),this.emit("thread",{event:"thread/create",data:{thread:this.currentThread}}));const s=Array.isArray(t)?t:[{type:"human",content:t}],l=await(async()=>a?.streamResponse?a.streamResponse:r?this.runs.joinStream(this.currentThread.thread_id,r):this.runs.stream(this.currentThread.thread_id,this.currentAssistant.assistant_id,{input:{...this.graphState,...this.extraParams,...n||{},messages:s,fe_tools:await this.tools.toJSON(this.currentAssistant.graph_id)},streamMode:["messages","values"],streamSubgraphs:!0,command:i}))(),c=[];this.emit("start",{event:"start"});for await(const p of l)if(c.push(p),p.event==="metadata")this.currentRun=p.data;else if(p.event==="error"||p.event==="Error"||p.event==="__stream_error__")this.emit("error",p);else if(p.event==="messages/partial"){for(const h of p.data)this.messageProcessor.updateStreamingMessage(h);this.emit("message",p);continue}else if(p.event==="values"){const h=p.data;if(h.messages){const m=!!i?.resume,b=h.messages.length>=this.messageProcessor.getGraphMessages().length;(!m||m&&b)&&(this.messageProcessor.setGraphMessages(h.messages),this.emit("value",p)),this.graphState=p.data}continue}else p.event.startsWith("values|")&&(p.data?.messages&&this.messageProcessor.mergeSubGraphMessagesToStreamingMessages(p.data.messages),this.graphPosition=p.event.split("|")[1]);const d=await this.runFETool();return d&&c.push(...d),this.emit("done",{event:"done"}),this.messageProcessor.clearStreamingMessages(),c}getGraphPosition(){return this.graphPosition.split("|").map(t=>{const[r,n]=t.split(":");return{id:n,name:r}})}getGraphNodeNow(){const t=this.getGraphPosition();return t[t.length-1]}runFETool(){const t=this.messageProcessor.getStreamingMessages(),r=t[t.length-1];if(r&&r.type==="ai"&&r.tool_calls?.length){const n=r.tool_calls.map(a=>{if(this.tools.getTool(a.name)){const i={...a,tool_call_id:a.id,tool_input:JSON.stringify(a.args),additional_kwargs:{}};return this.callFETool(i,a.args)}});return this.currentThread.status="interrupted",Promise.all(n)}}async callFETool(t,r){const n=this,a=await this.tools.callTool(t.name,r,{client:n,message:t});if(a)return this.resume(a)}resume(t){return this.sendMessage([],{command:{resume:t}})}doneFEToolWaiting(t,r){!this.tools.doneWaiting(t,r)&&this.currentThread?.status==="interrupted"&&this.resume(r)}getCurrentThread(){return this.currentThread}getCurrentAssistant(){return this.currentAssistant}async reset(){await this.initAssistant(this.currentAssistant?.graph_id),this.currentThread=null,this.graphState={},this.messageProcessor.setGraphMessages([]),this.messageProcessor.clearStreamingMessages(),this.currentRun=void 0,this.tools.clearWaiting(),this.emit("value",{event:"messages/partial",data:{messages:[]}})}}function nhe(e,t,r){var n,a,i;r===void 0&&(r={});var s=(n=r.isImmediate)!=null&&n,o=(a=r.callback)!=null&&a,l=r.maxWait,c=Date.now(),d=[];function p(){if(l!==void 0){var m=Date.now()-c;if(m+t>=l)return l-m}return t}var h=function(){var m=[].slice.call(arguments),b=this;return new Promise(function(w,_){var S=s&&i===void 0;if(i!==void 0&&clearTimeout(i),i=setTimeout(function(){if(i=void 0,c=Date.now(),!s){var E=e.apply(b,m);o&&o(E),d.forEach(function(T){return(0,T.resolve)(E)}),d=[]}},p()),S){var v=e.apply(b,m);return o&&o(v),w(v)}d.push({resolve:w,reject:_})})};return h.cancel=function(m){i!==void 0&&clearTimeout(i),d.forEach(function(b){return(0,b.reject)(m)}),d=[]},h}class Yc extends Error{constructor(t,r){super("".concat(t," at position ").concat(r)),this.position=r}}const BJ=32,ahe=10,UJ=9,zJ=13,ihe=160,she=8192,ohe=8202,lhe=8239,uhe=8287,che=12288;function dhe(e){return/^[0-9A-Fa-f]$/.test(e)}function hu(e){return e>="0"&&e<="9"}function fhe(e){return e>=" "}function Xm(e){return`,:[]/{}()
55
55
  +`.includes(e)}function DM(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"}function MM(e){return e>="a"&&e<="z"||e>="A"&&e<="Z"||e==="_"||e==="$"||e>="0"&&e<="9"}const PM=/^(http|https|ftp|mailto|file|data|irc):\/\/$/,FM=/^[A-Za-z0-9-._~:/?#@!$&'()*+;=]$/;function $M(e){return`,[]/{}
56
56
  +`.includes(e)}function BM(e){return Ab(e)||phe.test(e)}const phe=/^[[{\w-]$/;function hhe(e){return e===`
57
57
  `||e==="\r"||e===" "||e==="\b"||e==="\f"}function Au(e,t){const r=e.charCodeAt(t);return r===BJ||r===ahe||r===UJ||r===zJ}function mhe(e,t){const r=e.charCodeAt(t);return r===BJ||r===UJ||r===zJ}function ghe(e,t){const r=e.charCodeAt(t);return r===ihe||r>=she&&r<=ohe||r===lhe||r===uhe||r===che}function Ab(e){return qJ(e)||O6(e)}function qJ(e){return e==='"'||e==="“"||e==="”"}function UM(e){return e==='"'}function O6(e){return e==="'"||e==="‘"||e==="’"||e==="`"||e==="´"}function zM(e){return e==="'"}function dp(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;const n=e.lastIndexOf(t);return n!==-1?e.substring(0,n)+(r?"":e.substring(n+1)):e}function Ii(e,t){let r=e.length;if(!Au(e,r-1))return e+t;for(;Au(e,r-1);)r--;return e.substring(0,r)+t+e.substring(r)}function bhe(e,t,r){return e.substring(0,t)+e.substring(t+r)}function yhe(e){return/[,\n][ \t\r]*$/.test(e)}const vhe={"\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},Ehe={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:`
58
58
  `,r:"\r",t:" "};function _he(e){let t=0,r="";c(),i()||q(),c();const a=d(",");for(a&&s(),BM(e[t])&&yhe(r)?(a||(r=Ii(r,",")),_()):a&&(r=dp(r,","));e[t]==="}"||e[t]==="]";)t++,s();if(t>=e.length)return r;V();function i(){s();const X=b()||w()||S()||E()||T()||A(!1)||C();return s(),X}function s(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;const K=t;let ne=o(X);do ne=l(),ne&&(ne=o(X));while(ne);return t>K}function o(X){const K=X?Au:mhe;let ne="";for(;;)if(K(e,t))ne+=e[t],t++;else if(ghe(e,t))ne+=" ",t++;else break;return ne.length>0?(r+=ne,!0):!1}function l(){if(e[t]==="/"&&e[t+1]==="*"){for(;t<e.length&&!She(e,t);)t++;return t+=2,!0}if(e[t]==="/"&&e[t+1]==="/"){for(;t<e.length&&e[t]!==`
59
59
  `;)t++;return!0}return!1}function c(){if(e.slice(t,t+3)==="```"){if(t+=3,DM(e[t]))for(;t<e.length&&MM(e[t]);)t++;return s(),!0}return!1}function d(X){return e[t]===X?(r+=e[t],t++,!0):!1}function p(X){return e[t]===X?(t++,!0):!1}function h(){return p("\\")}function m(){return s(),e[t]==="."&&e[t+1]==="."&&e[t+2]==="."?(t+=3,s(),p(","),!0):!1}function b(){if(e[t]==="{"){r+="{",t++,s(),p(",")&&s();let X=!0;for(;t<e.length&&e[t]!=="}";){let K;if(X?(K=!0,X=!1):(K=d(","),K||(r=Ii(r,",")),s()),m(),!(S()||A(!0))){e[t]==="}"||e[t]==="{"||e[t]==="]"||e[t]==="["||e[t]===void 0?r=dp(r,","):$();break}s();const j=d(":"),U=t>=e.length;j||(BM(e[t])||U?r=Ii(r,":"):W()),i()||(j||U?r+="null":W())}return e[t]==="}"?(r+="}",t++):r=Ii(r,"}"),!0}return!1}function w(){if(e[t]==="["){r+="[",t++,s(),p(",")&&s();let X=!0;for(;t<e.length&&e[t]!=="]";)if(X?X=!1:d(",")||(r=Ii(r,",")),m(),!i()){r=dp(r,",");break}return e[t]==="]"?(r+="]",t++):r=Ii(r,"]"),!0}return!1}function _(){let X=!0,K=!0;for(;K;)X?X=!1:d(",")||(r=Ii(r,",")),K=i();K||(r=dp(r,",")),r=`[
60
60
  `.concat(r,`
61
- ]`)}function S(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,ne=e[t]==="\\";if(ne&&(t++,ne=!0),Ab(e[t])){const j=UM(e[t])?UM:zM(e[t])?zM:O6(e[t])?O6:qJ,U=t,Q=r.length;let D='"';for(t++;;){if(t>=e.length){const F=I(t-1);return!X&&Xm(e.charAt(F))?(t=U,r=r.substring(0,Q),S(!0)):(D=Ii(D,'"'),r+=D,!0)}else{if(t===K)return D=Ii(D,'"'),r+=D,!0;if(j(e[t])){const F=t,G=D.length;if(D+='"',t++,r+=D,s(!1),X||t>=e.length||Xm(e[t])||Ab(e[t])||hu(e[t]))return v(),!0;const J=I(F-1),ue=e.charAt(J);if(ue===",")return t=U,r=r.substring(0,Q),S(!1,J);if(Xm(ue))return t=U,r=r.substring(0,Q),S(!0);r=r.substring(0,Q),t=F+1,D="".concat(D.substring(0,G),"\\").concat(D.substring(G))}else if(X&&$M(e[t])){if(e[t-1]===":"&&PM.test(e.substring(U+1,t+2)))for(;t<e.length&&FM.test(e[t]);)D+=e[t],t++;return D=Ii(D,'"'),r+=D,v(),!0}else if(e[t]==="\\"){const F=e.charAt(t+1);if(Ehe[F]!==void 0)D+=e.slice(t,t+2),t+=2;else if(F==="u"){let J=2;for(;J<6&&dhe(e[t+J]);)J++;J===6?(D+=e.slice(t,t+6),t+=6):t+J>=e.length?t=e.length:Y()}else D+=F,t+=2}else{const F=e.charAt(t);F==='"'&&e[t-1]!=="\\"?(D+="\\".concat(F),t++):hhe(F)?(D+=vhe[F],t++):(fhe(F)||B(F),D+=F,t++)}}ne&&h()}}return!1}function v(){let X=!1;for(s();e[t]==="+";){X=!0,t++,s(),r=dp(r,'"',!0);const K=r.length;S()?r=bhe(r,K,1):r=Ii(r,'"')}return X}function E(){const X=t;if(e[t]==="-"){if(t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1}for(;hu(e[t]);)t++;if(e[t]==="."){if(t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1;for(;hu(e[t]);)t++}if(e[t]==="e"||e[t]==="E"){if(t++,(e[t]==="-"||e[t]==="+")&&t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1;for(;hu(e[t]);)t++}if(!L())return t=X,!1;if(t>X){const K=e.slice(X,t),ne=/^0\d/.test(K);return r+=ne?'"'.concat(K,'"'):K,!0}return!1}function T(){return x("true","true")||x("false","false")||x("null","null")||x("True","true")||x("False","false")||x("None","null")}function x(X,K){return e.slice(t,t+X.length)===X?(r+=K,t+=X.length,!0):!1}function A(X){const K=t;if(DM(e[t])){for(;t<e.length&&MM(e[t]);)t++;let ne=t;for(;Au(e,ne);)ne++;if(e[ne]==="(")return t=ne+1,i(),e[t]===")"&&(t++,e[t]===";"&&t++),!0}for(;t<e.length&&!$M(e[t])&&!Ab(e[t])&&(!X||e[t]!==":");)t++;if(e[t-1]===":"&&PM.test(e.substring(K,t+2)))for(;t<e.length&&FM.test(e[t]);)t++;if(t>K){for(;Au(e,t-1)&&t>0;)t--;const ne=e.slice(K,t);return r+=ne==="undefined"?"null":JSON.stringify(ne),e[t]==='"'&&t++,!0}}function C(){if(e[t]==="/"){const X=t;for(t++;t<e.length&&(e[t]!=="/"||e[t-1]==="\\");)t++;return t++,r+='"'.concat(e.substring(X,t),'"'),!0}}function I(X){let K=X;for(;K>0&&Au(e,K);)K--;return K}function L(){return t>=e.length||Xm(e[t])||Au(e,t)}function M(X){r+="".concat(e.slice(X,t),"0")}function B(X){throw new Yc("Invalid character ".concat(JSON.stringify(X)),t)}function V(){throw new Yc("Unexpected character ".concat(JSON.stringify(e[t])),t)}function q(){throw new Yc("Unexpected end of json string",e.length)}function $(){throw new Yc("Object key expected",t)}function W(){throw new Yc("Colon expected",t)}function Y(){const X=e.slice(t,t+6);throw new Yc('Invalid unicode character "'.concat(X,'"'),t)}}function She(e,t){return e[t]==="*"&&e[t+1]==="/"}class jJ{constructor(t,r){this.message=t,this.client=r}get state(){return this.message.type==="tool"&&this.message?.additional_kwargs?.done?"done":this.message.tool_input?"loading":"idle"}get input(){try{return JSON.parse(this.message.tool_input)}catch{return null}}get output(){return Jb(this.message.content)}getJSONOutput(){return JSON.parse(this.output)}getJSONOutputSafe(){try{return JSON.parse(this.output)}catch{return null}}getInputRepaired(){try{return JSON.parse(_he(this.message.tool_input||""))}catch{return{}}}response(t){this.client.doneFEToolWaiting(this.message.id,JSON.stringify(t))}}const whe="modulepreload",The=function(e){return"/"+e},qM={},se=function(t,r,n){let a=Promise.resolve();if(r&&r.length>0){let l=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");a=l(r.map(c=>{if(c=The(c),c in qM)return;qM[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":whe,d||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),d)return new Promise((m,b)=>{h.addEventListener("load",m),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return a.then(s=>{for(const o of s||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})},xhe=async e=>{const{Client:t}=await se(async()=>{const{Client:r}=await import("./index-CDM1QYzI.js");return{Client:r}},[]);return new t(e)};dpe(["create","update","rewrite"]).describe("The operation to perform: create new artifact, update existing, or rewrite"),pu().describe("Unique identifier for the artifact"),pu().describe("Human-readable title for the artifact"),pu().describe("MIME type of the artifact content (e.g., 'application/vnd.ant.react')"),pu().describe("Programming language or format of the content"),pu().describe("The actual content to be created or updated. Don't Reply These Code to User, User can see these code in artifacts."),pu().describe("The existing content to be replaced (for update operations)"),pu().describe("The new content to replace the old content (for update operations)");const Ahe=(e,t)=>{const r=new Map;for(const a of e)if(a.type==="tool"&&a.name==="create_artifacts"){const i=new jJ(a,t),s=i.getInputRepaired();if(!s.id)continue;s.tool_id=i.message.id,s.is_done=i.state==="done",r.set(s.id,[...r.get(s.id)||[],s])}const n=new Map;for(const[a,i]of r){const s=[];let o="",l="",c="",d=1;for(const p of i){switch(p.command){case"create":o=p.content,l=p.title||`artifact-${a}`,c=p.type||p.language;break;case"update":p.old_str&&p.new_str?o=o.replace(p.old_str,p.new_str):p.content&&(o=p.content);break;case"rewrite":o=p.content;break}const h={group_id:a,id:p.tool_id,code:o,filename:l,filetype:c,version:d,is_done:p.is_done};s.push(h),d++}n.set(a,s)}return[...n.values()].map(a=>({id:a[0].group_id,filename:a[a.length-1].filename,filetype:a[a.length-1].filetype,versions:a}))},khe=(e,t)=>{const r=Hn(!1),n=Hn(null),a=Hn([]);return Ofe([e,t],()=>{a.set(Ahe(e.get(),t.get()))}),{data:{artifacts:a,currentArtifactId:n,showArtifact:r},mutation:{setCurrentArtifactById:(s,o)=>{const l=n.get();l?.[0]===s&&l?.[1]===o||(r.set(!0),n.set([s,o]))},setShowArtifact:s=>r.set(s)}}},Che=e=>e.toLocaleTimeString("en-US"),Nhe=e=>e.toLocaleString("en"),Jb=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),Rhe=e=>{const t=e?.values?.messages?.[0]?.content;return t&&Array.isArray(t)?t.map(r=>{if(r.type==="text")return r.text}):typeof t=="string"?t:""},Ihe=(e,t,r={})=>{const n=Hn(null),a=Hn([]),i=Hn(""),s=Hn(!1),o=Hn([]),l=Hn(null),c=Hn(r.showHistory??!1),d=Hn(e),p=Hn(null),h=Hn("__start__"),m=Hn([]),b=async()=>{const q=n.get();q&&(q.tools.clearTools(),q.tools.bindTools(m.get()))},w=Hn(r.showGraph??!1),_=Hn(null),S=async()=>{w.get()&&_.set(await n.get()?.graphVisualize()||null)},v=nhe(q=>{const $=q.renderMessage,W=$[$.length-1];h.set(W?.node_name||W?.name||"__start__"),a.set($)},10);async function E(){const q=new rhe({...t,client:t.client??await xhe(t)});return await q.initAssistant(d.get(),{fallbackToAvailableAssistants:r.fallbackToAvailableAssistants??!1}),d.set(q.getCurrentAssistant().graph_id),l.set(null),q.on("start",()=>{s.set(!0)}),q.on("thread",()=>{p.set(q.getCurrentThread()?.thread_id||null),h.set("__start__"),L()}),q.on("done",()=>{s.set(!1),v(q)}),q.on("error",$=>{s.set(!1),l.set($.data)}),q.on("message",()=>{p.set(q.getCurrentThread()?.thread_id||null),v(q)}),q.on("value",()=>{p.set(q.getCurrentThread()?.thread_id||null),v(q)}),r.onInit?.(q),q.graphState={},n.set(q),w.get()&&S(),b(),q}const T=async(q,$,W=!1)=>{if(!(!W&&!i.get().trim()&&!q?.length||s.get()||!n.get())){s.set(!0),l.set(null);try{await n.get()?.sendMessage(q||i.get(),$)}catch(Y){if(Y.message.includes("422"))await n.get()?.resetStream();else throw Y}finally{i.set(""),s.set(!1)}}},x=()=>{n.get()?.cancelRun()},A=q=>{const $=o.get();o.set($.includes(q)?$.filter(W=>W!==q):[...$,q])},C=()=>{c.set(!c.get()),c.get()&&L()},I=Hn([]),L=async()=>{if(!(!n.get()||!c.get()))try{const q=await n.get()?.listThreads();I.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}},M=q=>{const $=I.get();I.set([q,...$])},B=q=>{const W=n.get().tools.getAllTools().find(Y=>Y.name===q)?.render;return W?Y=>W(new jJ(Y,n.get())):null},V=khe(a,n);return{data:{client:n,renderMessages:a,userInput:i,loading:s,inChatError:l,currentAgent:d,collapsedTools:o,showHistory:c,historyList:I,currentChatId:p,showGraph:w,graphVisualize:_,currentNodeName:h,tools:m,...V.data},mutations:{refreshTools:b,setTools(q){m.set(q),b()},isFELocking(){return n.get()?.isFELocking(a.get())},getClient(){return n.get()},initClient:E,sendMessage:T,stopGeneration:x,toggleToolCollapse:A,toggleHistoryVisible:C,refreshHistoryList:L,addToHistory:M,async revertChatTo(q,$=!1,W){if(await n.get()?.revertChatTo(q),$)return T([],W,!0);v(n.get())},setUserInput(q){i.set(q)},setCurrentAgent(q){return d.set(q),E().then(()=>{c.get()&&L()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&S()},refreshGraph:S,createNewChat(){n.get()?.reset(),l.set(null),s.set(!1)},async toHistoryChat(q){l.set(null),s.set(!1);const $=await n.get()?.resetThread(q.metadata?.graph_id,q.thread_id);return $&&n.get()?.resetStream(),$},async deleteHistoryChat(q){await n.get()?.deleteThread(q.thread_id),await L()},getToolUIRender:B,...V.mutation}}},Ohe=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([n,a])=>[n,t(a)])),...e.mutations});let rS=(e,t)=>r=>{e.current!==r&&(e.current=r,t())};function Lhe(e,{keys:t,deps:r=[e,t]}={}){let n=re.useRef();n.current=e.get();let a=re.useCallback(s=>(rS(n,s)(e.value),t?.length>0?Lfe(e,t,rS(n,s)):e.listen(rS(n,s))),r),i=()=>n.current;return re.useSyncExternalStore(a,i,i)}const HJ=re.createContext(void 0),qi=()=>{const e=re.useContext(HJ);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Dhe=({children:e,defaultAgent:t="",apiUrl:r="http://localhost:8123",defaultHeaders:n,withCredentials:a=!1,showHistory:i=!1,showGraph:s=!1,fallbackToAvailableAssistants:o=!1,onInitError:l})=>{const c=re.useMemo(()=>n||{},[n]),d=re.useRef(l);re.useEffect(()=>{d.current=l},[l]);const p=re.useMemo(()=>Ihe(t,{apiUrl:r,defaultHeaders:c,callerOptions:{fetch:a?(w,_)=>(_.credentials="include",fetch(w,_)):fetch,maxRetries:1}},{showHistory:i,showGraph:s,fallbackToAvailableAssistants:o}),[t,r,c,a,i,s,o]),h=Ohe(p,Lhe),m=re.useRef(!1);return re.useEffect(()=>{m.current||(m.current=!0,h.initClient().then(b=>{h.showHistory&&h.refreshHistoryList()}).catch(b=>{console.error(b),d.current&&d.current(b,h.currentAgent)}))},[h]),re.createElement(HJ.Provider,{value:h},e)},Zm=e=>e.toString(),mI=({usage_metadata:e,spend_time:t,response_metadata:r,id:n,tool_call_id:a})=>{const i=t?(e.output_tokens||0)*1e3/(t||1):0;t=t&&!isNaN(t)?t:0;const{currentChatId:s}=qi(),{openMonitorWithChat:o}=iy();return R.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 mt-3",children:[R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx(Mhe,{usage_metadata:e}),!!t&&R.jsxs("span",{className:"text-gray-400",children:[(t/1e3).toFixed(2),"s"]}),!!i&&R.jsxs("span",{className:"text-gray-400",children:[i.toFixed(2)," TPS"]})]}),R.jsxs("div",{className:"flex items-center gap-2",children:[r?.model_name&&R.jsx("span",{className:"text-gray-500",children:r.model_name}),a&&R.jsxs("span",{className:"text-gray-400",children:["Tool: ",a]}),n&&R.jsxs("span",{className:"text-gray-400",onClick:()=>o(s,n),children:["ID: ",n]})]})]})},Mhe=({usage_metadata:e})=>R.jsx("div",{className:"flex items-center gap-1",children:R.jsxs("span",{className:"flex items-center gap-1.5 group relative",children:[R.jsx("span",{className:"text-xs",children:"📊"}),R.jsx("span",{className:"text-gray-400",children:Zm(e.total_tokens||0)}),R.jsx("div",{className:"hidden group-hover:block absolute bottom-full left-0 mb-2 bg-white/95 backdrop-blur-sm border border-gray-200 shadow-lg rounded-lg text-xs z-10 min-w-[280px]",children:R.jsxs("div",{className:"p-3",children:[R.jsx("div",{className:"text-sm font-medium text-gray-700 mb-3 border-b border-gray-100 pb-2",children:"Token 使用详情"}),R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center justify-between",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-green-600",children:"📥"}),R.jsx("span",{className:"text-gray-700 font-medium",children:"输入 Token"})]}),R.jsx("span",{className:"text-gray-900 font-mono",children:Zm(e.input_tokens||0)})]}),!!e.input_token_details?.cache_read&&R.jsxs("div",{className:"flex items-center justify-between ml-6",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-blue-600",children:"💾"}),R.jsx("span",{className:"text-gray-600 text-xs",children:"缓存读取"})]}),R.jsx("span",{className:"text-blue-700 font-mono text-xs",children:Zm(e.input_token_details.cache_read)})]}),R.jsxs("div",{className:"flex items-center justify-between border-t border-gray-100 pt-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-blue-600",children:"📤"}),R.jsx("span",{className:"text-gray-700 font-medium",children:"输出 Token"})]}),R.jsx("span",{className:"text-gray-900 font-mono",children:Zm(e.output_tokens||0)})]}),(e.prompt_tokens_details||e.completion_tokens_details)&&R.jsxs("div",{className:"border-t border-gray-100 pt-3 mt-3",children:[R.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"详细数据"}),R.jsxs("div",{className:"text-xs text-gray-400 bg-gray-50 p-2 rounded",children:["输入详情: ",JSON.stringify(e)]})]})]})]})})]})});var fp={exports:{}},nS={},aS,jM;function Phe(){if(jM)return aS;jM=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return aS=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,n=0,a=0;a<this._errors.length;a++){var i=this._errors[a],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=n&&(r=i,n=o)}return r},aS}var HM;function Fhe(){return HM||(HM=1,function(e){var t=Phe();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var a in r)n[a]=r[a];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<n.retries;s++)i.push(this.createTimeout(s,n));return r&&r.forever&&!i.length&&i.push(this.createTimeout(s,n)),i.sort(function(o,l){return o-l}),i},e.createTimeout=function(r,n){var a=n.randomize?Math.random()+1:1,i=Math.round(a*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return i=Math.min(i,n.maxTimeout),i},e.wrap=function(r,n,a){if(n instanceof Array&&(a=n,n=null),!a){a=[];for(var i in r)typeof r[i]=="function"&&a.push(i)}for(var s=0;s<a.length;s++){var o=a[s],l=r[o];r[o]=(function(d){var p=e.operation(n),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),m.apply(this,arguments))}),p.attempt(function(){d.apply(r,h)})}).bind(r,l),r[o].options=n}}}(nS)),nS}var iS,GM;function $he(){return GM||(GM=1,iS=Fhe()),iS}var VM;function Bhe(){if(VM)return fp.exports;VM=1;const e=$he(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const n=(s,o,l)=>{const c=l.retries-(o-1);return s.attemptNumber=o,s.retriesLeft=c,s},a=s=>t.includes(s),i=(s,o)=>new Promise((l,c)=>{o={onFailedAttempt:()=>{},retries:10,...o};const d=e.operation(o);d.attempt(async p=>{try{l(await s(p))}catch(h){if(!(h instanceof Error)){c(new TypeError(`Non-error was thrown: "${h}". You should only throw errors.`));return}if(h instanceof r)d.stop(),c(h.originalError);else if(h instanceof TypeError&&!a(h.message))d.stop(),c(h);else{n(h,p,o);try{await o.onFailedAttempt(h)}catch(m){c(m);return}d.retry(h)||c(d.mainError())}}})});return fp.exports=i,fp.exports.default=i,fp.exports.AbortError=r,fp.exports}var Uhe=Bhe();const $rt=Vn(Uhe);var Qm={},sS={exports:{}},YM;function zhe(){return YM||(YM=1,function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,p,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new a(d,p||l,h),b=r?r+c:c;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],m]:l._events[b].push(m):(l._events[b]=m,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],d,p;if(this._eventsCount===0)return c;for(p in d=this._events)t.call(d,p)&&c.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},o.prototype.listeners=function(c){var d=r?r+c:c,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,m=p.length,b=new Array(m);h<m;h++)b[h]=p[h].fn;return b},o.prototype.listenerCount=function(c){var d=r?r+c:c,p=this._events[d];return p?p.fn?1:p.length:0},o.prototype.emit=function(c,d,p,h,m,b){var w=r?r+c:c;if(!this._events[w])return!1;var _=this._events[w],S=arguments.length,v,E;if(_.fn){switch(_.once&&this.removeListener(c,_.fn,void 0,!0),S){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,d),!0;case 3:return _.fn.call(_.context,d,p),!0;case 4:return _.fn.call(_.context,d,p,h),!0;case 5:return _.fn.call(_.context,d,p,h,m),!0;case 6:return _.fn.call(_.context,d,p,h,m,b),!0}for(E=1,v=new Array(S-1);E<S;E++)v[E-1]=arguments[E];_.fn.apply(_.context,v)}else{var T=_.length,x;for(E=0;E<T;E++)switch(_[E].once&&this.removeListener(c,_[E].fn,void 0,!0),S){case 1:_[E].fn.call(_[E].context);break;case 2:_[E].fn.call(_[E].context,d);break;case 3:_[E].fn.call(_[E].context,d,p);break;case 4:_[E].fn.call(_[E].context,d,p,h);break;default:if(!v)for(x=1,v=new Array(S-1);x<S;x++)v[x-1]=arguments[x];_[E].fn.apply(_[E].context,v)}}return!0},o.prototype.on=function(c,d,p){return i(this,c,d,p,!1)},o.prototype.once=function(c,d,p){return i(this,c,d,p,!0)},o.prototype.removeListener=function(c,d,p,h){var m=r?r+c:c;if(!this._events[m])return this;if(!d)return s(this,m),this;var b=this._events[m];if(b.fn)b.fn===d&&(!h||b.once)&&(!p||b.context===p)&&s(this,m);else{for(var w=0,_=[],S=b.length;w<S;w++)(b[w].fn!==d||h&&!b[w].once||p&&b[w].context!==p)&&_.push(b[w]);_.length?this._events[m]=_.length===1?_[0]:_:s(this,m)}return this},o.prototype.removeAllListeners=function(c){var d;return c?(d=r?r+c:c,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(sS)),sS.exports}var pp={exports:{}},oS,WM;function qhe(){return WM||(WM=1,oS=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))),oS}var KM;function jhe(){if(KM)return pp.exports;KM=1;const e=qhe();class t extends Error{constructor(a){super(a),this.name="TimeoutError"}}const r=(n,a,i)=>new Promise((s,o)=>{if(typeof a!="number"||a<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(a===1/0){s(n);return}const l=setTimeout(()=>{if(typeof i=="function"){try{s(i())}catch(p){o(p)}return}const c=typeof i=="string"?i:`Promise timed out after ${a} milliseconds`,d=i instanceof Error?i:new t(c);typeof n.cancel=="function"&&n.cancel(),o(d)},a);e(n.then(s,o),()=>{clearTimeout(l)})});return pp.exports=r,pp.exports.default=r,pp.exports.TimeoutError=t,pp.exports}var Jm={},eg={},XM;function Hhe(){if(XM)return eg;XM=1,Object.defineProperty(eg,"__esModule",{value:!0});function e(t,r,n){let a=0,i=t.length;for(;i>0;){const s=i/2|0;let o=a+s;n(t[o],r)<=0?(a=++o,i-=s+1):i=s}return a}return eg.default=e,eg}var ZM;function Ghe(){if(ZM)return Jm;ZM=1,Object.defineProperty(Jm,"__esModule",{value:!0});const e=Hhe();class t{constructor(){this._queue=[]}enqueue(n,a){a=Object.assign({priority:0},a);const i={priority:a.priority,run:n};if(this.size&&this._queue[this.size-1].priority>=a.priority){this._queue.push(i);return}const s=e.default(this._queue,i,(o,l)=>l.priority-o.priority);this._queue.splice(s,0,i)}dequeue(){const n=this._queue.shift();return n?.run}filter(n){return this._queue.filter(a=>a.priority===n.priority).map(a=>a.run)}get size(){return this._queue.length}}return Jm.default=t,Jm}var QM;function Vhe(){if(QM)return Qm;QM=1,Object.defineProperty(Qm,"__esModule",{value:!0});const e=zhe(),t=jhe(),r=Ghe(),n=()=>{},a=new t.TimeoutError;class i extends e{constructor(o){var l,c,d,p;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=n,this._resolveIdle=n,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:r.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(c=(l=o.intervalCap)===null||l===void 0?void 0:l.toString())!==null&&c!==void 0?c:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(p=(d=o.interval)===null||d===void 0?void 0:d.toString())!==null&&p!==void 0?p:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=n,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=n,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const o=Date.now();if(this._intervalId===void 0){const l=this._intervalEnd-o;if(l<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},l)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const l=this._queue.dequeue();return l?(this.emit("active"),l(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,l={}){return new Promise((c,d)=>{const p=async()=>{this._pendingCount++,this._intervalCount++;try{const h=this._timeout===void 0&&l.timeout===void 0?o():t.default(Promise.resolve(o()),l.timeout===void 0?this._timeout:l.timeout,()=>{(l.throwOnTimeout===void 0?this._throwOnTimeout:l.throwOnTimeout)&&d(a)});c(await h)}catch(h){d(h)}this._next()};this._queue.enqueue(p,l),this._tryToStartAnother(),this.emit("add")})}async addAll(o,l){return Promise.all(o.map(async c=>this.add(c,l)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{const l=this._resolveEmpty;this._resolveEmpty=()=>{l(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{const l=this._resolveIdle;this._resolveIdle=()=>{l(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return Qm.default=i,Qm}var Yhe=Vhe();const Brt=Vn(Yhe);function GJ(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=GJ(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function VJ(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=GJ(e))&&(n&&(n+=" "),n+=t);return n}const gI="-",Whe=e=>{const t=Xhe(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const o=s.split(gI);return o[0]===""&&o.length!==1&&o.shift(),YJ(o,t)||Khe(s)},getConflictingClassGroupIds:(s,o)=>{const l=r[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},YJ=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?YJ(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(gI);return t.validators.find(({validator:s})=>s(i))?.classGroupId},JM=/^\[(.+)\]$/,Khe=e=>{if(JM.test(e)){const t=JM.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xhe=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)L6(r[a],n,a,t);return n},L6=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:eP(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(Zhe(a)){L6(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{L6(s,eP(t,i),r,n)})})},eP=(e,t)=>{let r=e;return t.split(gI).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Zhe=e=>e.isThemeGetter,Qhe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},D6="!",M6=":",Jhe=M6.length,e0e=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let s=0,o=0,l=0,c;for(let b=0;b<a.length;b++){let w=a[b];if(s===0&&o===0){if(w===M6){i.push(a.slice(l,b)),l=b+Jhe;continue}if(w==="/"){c=b;continue}}w==="["?s++:w==="]"?s--:w==="("?o++:w===")"&&o--}const d=i.length===0?a:a.substring(l),p=t0e(d),h=p!==d,m=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+M6,i=n;n=s=>s.startsWith(a)?i(s.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},t0e=e=>e.endsWith(D6)?e.substring(0,e.length-1):e.startsWith(D6)?e.substring(1):e,r0e=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(s=>{s[0]==="["||t[s]?(a.push(...i.sort(),s),i=[]):i.push(s)}),a.push(...i.sort()),a}},n0e=e=>({cache:Qhe(e.cacheSize),parseClassName:e0e(e),sortModifiers:r0e(e),...Whe(e)}),a0e=/\s+/,i0e=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],o=e.trim().split(a0e);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:w}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let _=!!w,S=n(_?b.substring(0,w):b);if(!S){if(!_){l=d+(l.length>0?" "+l:l);continue}if(S=n(b),!S){l=d+(l.length>0?" "+l:l);continue}_=!1}const v=i(h).join(":"),E=m?v+D6:v,T=E+S;if(s.includes(T))continue;s.push(T);const x=a(S,_);for(let A=0;A<x.length;++A){const C=x[A];s.push(E+C)}l=d+(l.length>0?" "+l:l)}return l};function s0e(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=WJ(t))&&(n&&(n+=" "),n+=r);return n}const WJ=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=WJ(e[n]))&&(r&&(r+=" "),r+=t);return r};function o0e(e,...t){let r,n,a,i=s;function s(l){const c=t.reduce((d,p)=>p(d),e());return r=n0e(c),n=r.cache.get,a=r.cache.set,i=o,o(l)}function o(l){const c=n(l);if(c)return c;const d=i0e(l,r);return a(l,d),d}return function(){return i(s0e.apply(null,arguments))}}const Sn=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},KJ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XJ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,l0e=/^\d+\/\d+$/,u0e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,c0e=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,d0e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f0e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p0e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wc=e=>l0e.test(e),Dt=e=>!!e&&!Number.isNaN(Number(e)),dl=e=>!!e&&Number.isInteger(Number(e)),lS=e=>e.endsWith("%")&&Dt(e.slice(0,-1)),Zs=e=>u0e.test(e),h0e=()=>!0,m0e=e=>c0e.test(e)&&!d0e.test(e),ZJ=()=>!1,g0e=e=>f0e.test(e),b0e=e=>p0e.test(e),y0e=e=>!et(e)&&!tt(e),v0e=e=>Yd(e,eee,ZJ),et=e=>KJ.test(e),mu=e=>Yd(e,tee,m0e),uS=e=>Yd(e,T0e,Dt),tP=e=>Yd(e,QJ,ZJ),E0e=e=>Yd(e,JJ,b0e),tg=e=>Yd(e,ree,g0e),tt=e=>XJ.test(e),hp=e=>Wd(e,tee),_0e=e=>Wd(e,x0e),rP=e=>Wd(e,QJ),S0e=e=>Wd(e,eee),w0e=e=>Wd(e,JJ),rg=e=>Wd(e,ree,!0),Yd=(e,t,r)=>{const n=KJ.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wd=(e,t,r=!1)=>{const n=XJ.exec(e);return n?n[1]?t(n[1]):r:!1},QJ=e=>e==="position"||e==="percentage",JJ=e=>e==="image"||e==="url",eee=e=>e==="length"||e==="size"||e==="bg-size",tee=e=>e==="length",T0e=e=>e==="number",x0e=e=>e==="family-name",ree=e=>e==="shadow",A0e=()=>{const e=Sn("color"),t=Sn("font"),r=Sn("text"),n=Sn("font-weight"),a=Sn("tracking"),i=Sn("leading"),s=Sn("breakpoint"),o=Sn("container"),l=Sn("spacing"),c=Sn("radius"),d=Sn("shadow"),p=Sn("inset-shadow"),h=Sn("text-shadow"),m=Sn("drop-shadow"),b=Sn("blur"),w=Sn("perspective"),_=Sn("aspect"),S=Sn("ease"),v=Sn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...T(),tt,et],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],I=()=>[tt,et,l],L=()=>[Wc,"full","auto",...I()],M=()=>[dl,"none","subgrid",tt,et],B=()=>["auto",{span:["full",dl,tt,et]},dl,tt,et],V=()=>[dl,"auto",tt,et],q=()=>["auto","min","max","fr",tt,et],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...I()],X=()=>[Wc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],K=()=>[e,tt,et],ne=()=>[...T(),rP,tP,{position:[tt,et]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",S0e,v0e,{size:[tt,et]}],Q=()=>[lS,hp,mu],D=()=>["","none","full",c,tt,et],F=()=>["",Dt,hp,mu],G=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Dt,lS,rP,tP],me=()=>["","none",b,tt,et],fe=()=>["none",Dt,tt,et],Ee=()=>["none",Dt,tt,et],ie=()=>[Dt,tt,et],oe=()=>[Wc,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[h0e],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[y0e],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",Dt],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wc,et,tt,_]}],container:["container"],columns:[{columns:[Dt,et,tt,o]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[dl,"auto",tt,et]}],basis:[{basis:[Wc,"full","auto",o,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Dt,Wc,"auto","initial","none",et]}],grow:[{grow:["",Dt,tt,et]}],shrink:[{shrink:["",Dt,tt,et]}],order:[{order:[dl,"first","last","none",tt,et]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",r,hp,mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,tt,uS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lS,et]}],"font-family":[{font:[_0e,et,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,tt,et]}],"line-clamp":[{"line-clamp":[Dt,"none",tt,uS]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",tt,et]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,et]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Dt,"from-font","auto",tt,mu]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Dt,"auto",tt,et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt,et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dl,tt,et],radial:["",tt,et],conic:[dl,tt,et]},w0e,E0e]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Dt,tt,et]}],"outline-w":[{outline:["",Dt,hp,mu]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",d,rg,tg]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",p,rg,tg]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Dt,mu]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",h,rg,tg]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Dt,tt,et]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[tt,et]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,et]}],filter:[{filter:["","none",tt,et]}],blur:[{blur:me()}],brightness:[{brightness:[Dt,tt,et]}],contrast:[{contrast:[Dt,tt,et]}],"drop-shadow":[{"drop-shadow":["","none",m,rg,tg]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Dt,tt,et]}],"hue-rotate":[{"hue-rotate":[Dt,tt,et]}],invert:[{invert:["",Dt,tt,et]}],saturate:[{saturate:[Dt,tt,et]}],sepia:[{sepia:["",Dt,tt,et]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,et]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Dt,tt,et]}],"backdrop-contrast":[{"backdrop-contrast":[Dt,tt,et]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Dt,tt,et]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Dt,tt,et]}],"backdrop-invert":[{"backdrop-invert":["",Dt,tt,et]}],"backdrop-opacity":[{"backdrop-opacity":[Dt,tt,et]}],"backdrop-saturate":[{"backdrop-saturate":[Dt,tt,et]}],"backdrop-sepia":[{"backdrop-sepia":["",Dt,tt,et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,et]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Dt,"initial",tt,et]}],ease:[{ease:["linear","initial",S,tt,et]}],delay:[{delay:[Dt,tt,et]}],animate:[{animate:["none",v,tt,et]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,tt,et]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[tt,et,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt,et]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt,et]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Dt,hp,mu,uS]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nee=o0e(A0e);function aee(...e){return nee(VJ(e))}function nP(e){const t=[],r=String(e||"");let n=r.indexOf(","),a=0,i=!1;for(;!i;){n===-1&&(n=r.length,i=!0);const s=r.slice(a,n).trim();(s||!i)&&t.push(s),a=n+1,n=r.indexOf(",",a)}return t}function bI(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const k0e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C0e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N0e={};function aP(e,t){return(N0e.jsx?C0e:k0e).test(e)}const R0e=/[ \t\n\f\r]/g;function sy(e){return typeof e=="object"?e.type==="text"?iP(e.value):!1:iP(e)}function iP(e){return e.replace(R0e,"")===""}let Zh=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};Zh.prototype.normal={};Zh.prototype.property={};Zh.prototype.space=void 0;function iee(e,t){const r={},n={};for(const a of e)Object.assign(r,a.property),Object.assign(n,a.normal);return new Zh(r,n,t)}function gh(e){return e.toLowerCase()}let Na=class{constructor(t,r){this.attribute=r,this.property=t}};Na.prototype.attribute="";Na.prototype.booleanish=!1;Na.prototype.boolean=!1;Na.prototype.commaOrSpaceSeparated=!1;Na.prototype.commaSeparated=!1;Na.prototype.defined=!1;Na.prototype.mustUseProperty=!1;Na.prototype.number=!1;Na.prototype.overloadedBoolean=!1;Na.prototype.property="";Na.prototype.spaceSeparated=!1;Na.prototype.space=void 0;let I0e=0;const Ct=Yu(),fn=Yu(),see=Yu(),ze=Yu(),kr=Yu(),gd=Yu(),za=Yu();function Yu(){return 2**++I0e}const P6=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:fn,commaOrSpaceSeparated:za,commaSeparated:gd,number:ze,overloadedBoolean:see,spaceSeparated:kr},Symbol.toStringTag,{value:"Module"})),cS=Object.keys(P6);let yI=class extends Na{constructor(t,r,n,a){let i=-1;if(super(t,r),sP(this,"space",a),typeof n=="number")for(;++i<cS.length;){const s=cS[i];sP(this,cS[i],(n&P6[s])===P6[s])}}};yI.prototype.defined=!0;function sP(e,t,r){r&&(e[t]=r)}function Kd(e){const t={},r={};for(const[n,a]of Object.entries(e.properties)){const i=new yI(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[gh(n)]=n,r[gh(i.attribute)]=n}return new Zh(t,r,e.space)}const oee=Kd({properties:{ariaActiveDescendant:null,ariaAtomic:fn,ariaAutoComplete:null,ariaBusy:fn,ariaChecked:fn,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:kr,ariaCurrent:null,ariaDescribedBy:kr,ariaDetails:null,ariaDisabled:fn,ariaDropEffect:kr,ariaErrorMessage:null,ariaExpanded:fn,ariaFlowTo:kr,ariaGrabbed:fn,ariaHasPopup:null,ariaHidden:fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kr,ariaLevel:ze,ariaLive:null,ariaModal:fn,ariaMultiLine:fn,ariaMultiSelectable:fn,ariaOrientation:null,ariaOwns:kr,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:fn,ariaReadOnly:fn,ariaRelevant:null,ariaRequired:fn,ariaRoleDescription:kr,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:fn,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lee(e,t){return t in e?e[t]:t}function uee(e,t){return lee(e,t.toLowerCase())}const O0e=Kd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gd,acceptCharset:kr,accessKey:kr,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:kr,autoFocus:Ct,autoPlay:Ct,blocking:kr,capture:null,charSet:null,checked:Ct,cite:null,className:kr,cols:ze,colSpan:null,content:null,contentEditable:fn,controls:Ct,controlsList:kr,coords:ze|gd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:see,draggable:fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:kr,height:ze,hidden:Ct,high:ze,href:null,hrefLang:null,htmlFor:kr,httpEquiv:kr,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:kr,itemRef:kr,itemScope:Ct,itemType:kr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,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:Ct,optimum:ze,pattern:null,ping:kr,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:kr,required:Ct,reversed:Ct,rows:ze,rowSpan:ze,sandbox:kr,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:fn,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kr,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:fn,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:uee}),L0e=Kd({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"},properties:{about:za,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:kr,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:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,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:gd,g2:gd,glyphName:gd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:za,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,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:ze,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:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:za,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:za,rev:za,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:za,requiredFeatures:za,requiredFonts:za,requiredFormats:za,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:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:za,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:za,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:za,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lee}),cee=Kd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dee=Kd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uee}),fee=Kd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),D0e={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"},M0e=/[A-Z]/g,oP=/-[a-z]/g,P0e=/^data[-\w.:]+$/i;function oy(e,t){const r=gh(t);let n=t,a=Na;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&P0e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(oP,$0e);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!oP.test(i)){let s=i.replace(M0e,F0e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=yI}return new a(n,t)}function F0e(e){return"-"+e.toLowerCase()}function $0e(e){return e.charAt(1).toUpperCase()}const Qh=iee([oee,O0e,cee,dee,fee],"html"),jl=iee([oee,L0e,cee,dee,fee],"svg");function lP(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vI(e){return e.join(" ").trim()}var Kc={},dS,uP;function B0e(){if(uP)return dS;uP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
61
+ ]`)}function S(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:-1,ne=e[t]==="\\";if(ne&&(t++,ne=!0),Ab(e[t])){const j=UM(e[t])?UM:zM(e[t])?zM:O6(e[t])?O6:qJ,U=t,Q=r.length;let D='"';for(t++;;){if(t>=e.length){const F=I(t-1);return!X&&Xm(e.charAt(F))?(t=U,r=r.substring(0,Q),S(!0)):(D=Ii(D,'"'),r+=D,!0)}else{if(t===K)return D=Ii(D,'"'),r+=D,!0;if(j(e[t])){const F=t,G=D.length;if(D+='"',t++,r+=D,s(!1),X||t>=e.length||Xm(e[t])||Ab(e[t])||hu(e[t]))return v(),!0;const J=I(F-1),ue=e.charAt(J);if(ue===",")return t=U,r=r.substring(0,Q),S(!1,J);if(Xm(ue))return t=U,r=r.substring(0,Q),S(!0);r=r.substring(0,Q),t=F+1,D="".concat(D.substring(0,G),"\\").concat(D.substring(G))}else if(X&&$M(e[t])){if(e[t-1]===":"&&PM.test(e.substring(U+1,t+2)))for(;t<e.length&&FM.test(e[t]);)D+=e[t],t++;return D=Ii(D,'"'),r+=D,v(),!0}else if(e[t]==="\\"){const F=e.charAt(t+1);if(Ehe[F]!==void 0)D+=e.slice(t,t+2),t+=2;else if(F==="u"){let J=2;for(;J<6&&dhe(e[t+J]);)J++;J===6?(D+=e.slice(t,t+6),t+=6):t+J>=e.length?t=e.length:Y()}else D+=F,t+=2}else{const F=e.charAt(t);F==='"'&&e[t-1]!=="\\"?(D+="\\".concat(F),t++):hhe(F)?(D+=vhe[F],t++):(fhe(F)||B(F),D+=F,t++)}}ne&&h()}}return!1}function v(){let X=!1;for(s();e[t]==="+";){X=!0,t++,s(),r=dp(r,'"',!0);const K=r.length;S()?r=bhe(r,K,1):r=Ii(r,'"')}return X}function E(){const X=t;if(e[t]==="-"){if(t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1}for(;hu(e[t]);)t++;if(e[t]==="."){if(t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1;for(;hu(e[t]);)t++}if(e[t]==="e"||e[t]==="E"){if(t++,(e[t]==="-"||e[t]==="+")&&t++,L())return M(X),!0;if(!hu(e[t]))return t=X,!1;for(;hu(e[t]);)t++}if(!L())return t=X,!1;if(t>X){const K=e.slice(X,t),ne=/^0\d/.test(K);return r+=ne?'"'.concat(K,'"'):K,!0}return!1}function T(){return x("true","true")||x("false","false")||x("null","null")||x("True","true")||x("False","false")||x("None","null")}function x(X,K){return e.slice(t,t+X.length)===X?(r+=K,t+=X.length,!0):!1}function A(X){const K=t;if(DM(e[t])){for(;t<e.length&&MM(e[t]);)t++;let ne=t;for(;Au(e,ne);)ne++;if(e[ne]==="(")return t=ne+1,i(),e[t]===")"&&(t++,e[t]===";"&&t++),!0}for(;t<e.length&&!$M(e[t])&&!Ab(e[t])&&(!X||e[t]!==":");)t++;if(e[t-1]===":"&&PM.test(e.substring(K,t+2)))for(;t<e.length&&FM.test(e[t]);)t++;if(t>K){for(;Au(e,t-1)&&t>0;)t--;const ne=e.slice(K,t);return r+=ne==="undefined"?"null":JSON.stringify(ne),e[t]==='"'&&t++,!0}}function C(){if(e[t]==="/"){const X=t;for(t++;t<e.length&&(e[t]!=="/"||e[t-1]==="\\");)t++;return t++,r+='"'.concat(e.substring(X,t),'"'),!0}}function I(X){let K=X;for(;K>0&&Au(e,K);)K--;return K}function L(){return t>=e.length||Xm(e[t])||Au(e,t)}function M(X){r+="".concat(e.slice(X,t),"0")}function B(X){throw new Yc("Invalid character ".concat(JSON.stringify(X)),t)}function V(){throw new Yc("Unexpected character ".concat(JSON.stringify(e[t])),t)}function q(){throw new Yc("Unexpected end of json string",e.length)}function $(){throw new Yc("Object key expected",t)}function W(){throw new Yc("Colon expected",t)}function Y(){const X=e.slice(t,t+6);throw new Yc('Invalid unicode character "'.concat(X,'"'),t)}}function She(e,t){return e[t]==="*"&&e[t+1]==="/"}class jJ{constructor(t,r){this.message=t,this.client=r}get state(){return this.message.type==="tool"&&this.message?.additional_kwargs?.done?"done":this.message.tool_input?"loading":"idle"}get input(){try{return JSON.parse(this.message.tool_input)}catch{return null}}get output(){return Jb(this.message.content)}getJSONOutput(){return JSON.parse(this.output)}getJSONOutputSafe(){try{return JSON.parse(this.output)}catch{return null}}getInputRepaired(){try{return JSON.parse(_he(this.message.tool_input||""))}catch{return{}}}response(t){this.client.doneFEToolWaiting(this.message.id,JSON.stringify(t))}}const whe="modulepreload",The=function(e){return"/"+e},qM={},se=function(t,r,n){let a=Promise.resolve();if(r&&r.length>0){let l=function(c){return Promise.all(c.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),o=s?.nonce||s?.getAttribute("nonce");a=l(r.map(c=>{if(c=The(c),c in qM)return;qM[c]=!0;const d=c.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${p}`))return;const h=document.createElement("link");if(h.rel=d?"stylesheet":whe,d||(h.as="script"),h.crossOrigin="",h.href=c,o&&h.setAttribute("nonce",o),document.head.appendChild(h),d)return new Promise((m,b)=>{h.addEventListener("load",m),h.addEventListener("error",()=>b(new Error(`Unable to preload CSS for ${c}`)))})}))}function i(s){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=s,window.dispatchEvent(o),!o.defaultPrevented)throw s}return a.then(s=>{for(const o of s||[])o.status==="rejected"&&i(o.reason);return t().catch(i)})},xhe=async e=>{const{Client:t}=await se(async()=>{const{Client:r}=await import("./index-BCRpZS_X.js");return{Client:r}},[]);return new t(e)};dpe(["create","update","rewrite"]).describe("The operation to perform: create new artifact, update existing, or rewrite"),pu().describe("Unique identifier for the artifact"),pu().describe("Human-readable title for the artifact"),pu().describe("MIME type of the artifact content (e.g., 'application/vnd.ant.react')"),pu().describe("Programming language or format of the content"),pu().describe("The actual content to be created or updated. Don't Reply These Code to User, User can see these code in artifacts."),pu().describe("The existing content to be replaced (for update operations)"),pu().describe("The new content to replace the old content (for update operations)");const Ahe=(e,t)=>{const r=new Map;for(const a of e)if(a.type==="tool"&&a.name==="create_artifacts"){const i=new jJ(a,t),s=i.getInputRepaired();if(!s.id)continue;s.tool_id=i.message.id,s.is_done=i.state==="done",r.set(s.id,[...r.get(s.id)||[],s])}const n=new Map;for(const[a,i]of r){const s=[];let o="",l="",c="",d=1;for(const p of i){switch(p.command){case"create":o=p.content,l=p.title||`artifact-${a}`,c=p.type||p.language;break;case"update":p.old_str&&p.new_str?o=o.replace(p.old_str,p.new_str):p.content&&(o=p.content);break;case"rewrite":o=p.content;break}const h={group_id:a,id:p.tool_id,code:o,filename:l,filetype:c,version:d,is_done:p.is_done};s.push(h),d++}n.set(a,s)}return[...n.values()].map(a=>({id:a[0].group_id,filename:a[a.length-1].filename,filetype:a[a.length-1].filetype,versions:a}))},khe=(e,t)=>{const r=Hn(!1),n=Hn(null),a=Hn([]);return Ofe([e,t],()=>{a.set(Ahe(e.get(),t.get()))}),{data:{artifacts:a,currentArtifactId:n,showArtifact:r},mutation:{setCurrentArtifactById:(s,o)=>{const l=n.get();l?.[0]===s&&l?.[1]===o||(r.set(!0),n.set([s,o]))},setShowArtifact:s=>r.set(s)}}},Che=e=>e.toLocaleTimeString("en-US"),Nhe=e=>e.toLocaleString("en"),Jb=e=>typeof e=="string"?e:Array.isArray(e)?e.map(t=>typeof t=="string"?t:t.type==="text"?t.text:t.type==="image_url"?"[图片]":JSON.stringify(t)).join(""):JSON.stringify(e),Rhe=e=>{const t=e?.values?.messages?.[0]?.content;return t&&Array.isArray(t)?t.map(r=>{if(r.type==="text")return r.text}):typeof t=="string"?t:""},Ihe=(e,t,r={})=>{const n=Hn(null),a=Hn([]),i=Hn(""),s=Hn(!1),o=Hn([]),l=Hn(null),c=Hn(r.showHistory??!1),d=Hn(e),p=Hn(null),h=Hn("__start__"),m=Hn([]),b=async()=>{const q=n.get();q&&(q.tools.clearTools(),q.tools.bindTools(m.get()))},w=Hn(r.showGraph??!1),_=Hn(null),S=async()=>{w.get()&&_.set(await n.get()?.graphVisualize()||null)},v=nhe(q=>{const $=q.renderMessage,W=$[$.length-1];h.set(W?.node_name||W?.name||"__start__"),a.set($)},10);async function E(){const q=new rhe({...t,client:t.client??await xhe(t)});return await q.initAssistant(d.get(),{fallbackToAvailableAssistants:r.fallbackToAvailableAssistants??!1}),d.set(q.getCurrentAssistant().graph_id),l.set(null),q.on("start",()=>{s.set(!0)}),q.on("thread",()=>{p.set(q.getCurrentThread()?.thread_id||null),h.set("__start__"),L()}),q.on("done",()=>{s.set(!1),v(q)}),q.on("error",$=>{s.set(!1),l.set($.data)}),q.on("message",()=>{p.set(q.getCurrentThread()?.thread_id||null),v(q)}),q.on("value",()=>{p.set(q.getCurrentThread()?.thread_id||null),v(q)}),r.onInit?.(q),q.graphState={},n.set(q),w.get()&&S(),b(),q}const T=async(q,$,W=!1)=>{if(!(!W&&!i.get().trim()&&!q?.length||s.get()||!n.get())){s.set(!0),l.set(null);try{await n.get()?.sendMessage(q||i.get(),$)}catch(Y){if(Y.message.includes("422"))await n.get()?.resetStream();else throw Y}finally{i.set(""),s.set(!1)}}},x=()=>{n.get()?.cancelRun()},A=q=>{const $=o.get();o.set($.includes(q)?$.filter(W=>W!==q):[...$,q])},C=()=>{c.set(!c.get()),c.get()&&L()},I=Hn([]),L=async()=>{if(!(!n.get()||!c.get()))try{const q=await n.get()?.listThreads();I.set(q||[])}catch(q){console.error("Failed to fetch threads:",q)}},M=q=>{const $=I.get();I.set([q,...$])},B=q=>{const W=n.get().tools.getAllTools().find(Y=>Y.name===q)?.render;return W?Y=>W(new jJ(Y,n.get())):null},V=khe(a,n);return{data:{client:n,renderMessages:a,userInput:i,loading:s,inChatError:l,currentAgent:d,collapsedTools:o,showHistory:c,historyList:I,currentChatId:p,showGraph:w,graphVisualize:_,currentNodeName:h,tools:m,...V.data},mutations:{refreshTools:b,setTools(q){m.set(q),b()},isFELocking(){return n.get()?.isFELocking(a.get())},getClient(){return n.get()},initClient:E,sendMessage:T,stopGeneration:x,toggleToolCollapse:A,toggleHistoryVisible:C,refreshHistoryList:L,addToHistory:M,async revertChatTo(q,$=!1,W){if(await n.get()?.revertChatTo(q),$)return T([],W,!0);v(n.get())},setUserInput(q){i.set(q)},setCurrentAgent(q){return d.set(q),E().then(()=>{c.get()&&L()})},toggleGraphVisible(){w.set(!w.get()),w.get()&&S()},refreshGraph:S,createNewChat(){n.get()?.reset(),l.set(null),s.set(!1)},async toHistoryChat(q){l.set(null),s.set(!1);const $=await n.get()?.resetThread(q.metadata?.graph_id,q.thread_id);return $&&n.get()?.resetStream(),$},async deleteHistoryChat(q){await n.get()?.deleteThread(q.thread_id),await L()},getToolUIRender:B,...V.mutation}}},Ohe=(e,t)=>({...Object.fromEntries(Object.entries(e.data).map(([n,a])=>[n,t(a)])),...e.mutations});let rS=(e,t)=>r=>{e.current!==r&&(e.current=r,t())};function Lhe(e,{keys:t,deps:r=[e,t]}={}){let n=re.useRef();n.current=e.get();let a=re.useCallback(s=>(rS(n,s)(e.value),t?.length>0?Lfe(e,t,rS(n,s)):e.listen(rS(n,s))),r),i=()=>n.current;return re.useSyncExternalStore(a,i,i)}const HJ=re.createContext(void 0),qi=()=>{const e=re.useContext(HJ);if(!e)throw new Error("useChat must be used within a ChatProvider");return e},Dhe=({children:e,defaultAgent:t="",apiUrl:r="http://localhost:8123",defaultHeaders:n,withCredentials:a=!1,showHistory:i=!1,showGraph:s=!1,fallbackToAvailableAssistants:o=!1,onInitError:l})=>{const c=re.useMemo(()=>n||{},[n]),d=re.useRef(l);re.useEffect(()=>{d.current=l},[l]);const p=re.useMemo(()=>Ihe(t,{apiUrl:r,defaultHeaders:c,callerOptions:{fetch:a?(w,_)=>(_.credentials="include",fetch(w,_)):fetch,maxRetries:1}},{showHistory:i,showGraph:s,fallbackToAvailableAssistants:o}),[t,r,c,a,i,s,o]),h=Ohe(p,Lhe),m=re.useRef(!1);return re.useEffect(()=>{m.current||(m.current=!0,h.initClient().then(b=>{h.showHistory&&h.refreshHistoryList()}).catch(b=>{console.error(b),d.current&&d.current(b,h.currentAgent)}))},[h]),re.createElement(HJ.Provider,{value:h},e)},Zm=e=>e.toString(),mI=({usage_metadata:e,spend_time:t,response_metadata:r,id:n,tool_call_id:a})=>{const i=t?(e.output_tokens||0)*1e3/(t||1):0;t=t&&!isNaN(t)?t:0;const{currentChatId:s}=qi(),{openMonitorWithChat:o}=iy();return R.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400 mt-3",children:[R.jsxs("div",{className:"flex items-center gap-3",children:[R.jsx(Mhe,{usage_metadata:e}),!!t&&R.jsxs("span",{className:"text-gray-400",children:[(t/1e3).toFixed(2),"s"]}),!!i&&R.jsxs("span",{className:"text-gray-400",children:[i.toFixed(2)," TPS"]})]}),R.jsxs("div",{className:"flex items-center gap-2",children:[r?.model_name&&R.jsx("span",{className:"text-gray-500",children:r.model_name}),a&&R.jsxs("span",{className:"text-gray-400",children:["Tool: ",a]}),n&&R.jsxs("span",{className:"text-gray-400",onClick:()=>o(s,n),children:["ID: ",n]})]})]})},Mhe=({usage_metadata:e})=>R.jsx("div",{className:"flex items-center gap-1",children:R.jsxs("span",{className:"flex items-center gap-1.5 group relative",children:[R.jsx("span",{className:"text-xs",children:"📊"}),R.jsx("span",{className:"text-gray-400",children:Zm(e.total_tokens||0)}),R.jsx("div",{className:"hidden group-hover:block absolute bottom-full left-0 mb-2 bg-white/95 backdrop-blur-sm border border-gray-200 shadow-lg rounded-lg text-xs z-10 min-w-[280px]",children:R.jsxs("div",{className:"p-3",children:[R.jsx("div",{className:"text-sm font-medium text-gray-700 mb-3 border-b border-gray-100 pb-2",children:"Token 使用详情"}),R.jsxs("div",{className:"space-y-3",children:[R.jsxs("div",{className:"flex items-center justify-between",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-green-600",children:"📥"}),R.jsx("span",{className:"text-gray-700 font-medium",children:"输入 Token"})]}),R.jsx("span",{className:"text-gray-900 font-mono",children:Zm(e.input_tokens||0)})]}),!!e.input_token_details?.cache_read&&R.jsxs("div",{className:"flex items-center justify-between ml-6",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-blue-600",children:"💾"}),R.jsx("span",{className:"text-gray-600 text-xs",children:"缓存读取"})]}),R.jsx("span",{className:"text-blue-700 font-mono text-xs",children:Zm(e.input_token_details.cache_read)})]}),R.jsxs("div",{className:"flex items-center justify-between border-t border-gray-100 pt-3",children:[R.jsxs("div",{className:"flex items-center gap-2",children:[R.jsx("span",{className:"text-blue-600",children:"📤"}),R.jsx("span",{className:"text-gray-700 font-medium",children:"输出 Token"})]}),R.jsx("span",{className:"text-gray-900 font-mono",children:Zm(e.output_tokens||0)})]}),(e.prompt_tokens_details||e.completion_tokens_details)&&R.jsxs("div",{className:"border-t border-gray-100 pt-3 mt-3",children:[R.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"详细数据"}),R.jsxs("div",{className:"text-xs text-gray-400 bg-gray-50 p-2 rounded",children:["输入详情: ",JSON.stringify(e)]})]})]})]})})]})});var fp={exports:{}},nS={},aS,jM;function Phe(){if(jM)return aS;jM=1;function e(t,r){typeof r=="boolean"&&(r={forever:r}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=r||{},this._maxRetryTime=r&&r.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return aS=e,e.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},e.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},e.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var r=new Date().getTime();if(t&&r-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var n=this._timeouts.shift();if(n===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1);else return!1;var a=this;return this._timer=setTimeout(function(){a._attempts++,a._operationTimeoutCb&&(a._timeout=setTimeout(function(){a._operationTimeoutCb(a._attempts)},a._operationTimeout),a._options.unref&&a._timeout.unref()),a._fn(a._attempts)},n),this._options.unref&&this._timer.unref(),!0},e.prototype.attempt=function(t,r){this._fn=t,r&&(r.timeout&&(this._operationTimeout=r.timeout),r.cb&&(this._operationTimeoutCb=r.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){n._operationTimeoutCb()},n._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},e.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},e.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},e.prototype.start=e.prototype.try,e.prototype.errors=function(){return this._errors},e.prototype.attempts=function(){return this._attempts},e.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},r=null,n=0,a=0;a<this._errors.length;a++){var i=this._errors[a],s=i.message,o=(t[s]||0)+1;t[s]=o,o>=n&&(r=i,n=o)}return r},aS}var HM;function Fhe(){return HM||(HM=1,function(e){var t=Phe();e.operation=function(r){var n=e.timeouts(r);return new t(n,{forever:r&&(r.forever||r.retries===1/0),unref:r&&r.unref,maxRetryTime:r&&r.maxRetryTime})},e.timeouts=function(r){if(r instanceof Array)return[].concat(r);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var a in r)n[a]=r[a];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],s=0;s<n.retries;s++)i.push(this.createTimeout(s,n));return r&&r.forever&&!i.length&&i.push(this.createTimeout(s,n)),i.sort(function(o,l){return o-l}),i},e.createTimeout=function(r,n){var a=n.randomize?Math.random()+1:1,i=Math.round(a*Math.max(n.minTimeout,1)*Math.pow(n.factor,r));return i=Math.min(i,n.maxTimeout),i},e.wrap=function(r,n,a){if(n instanceof Array&&(a=n,n=null),!a){a=[];for(var i in r)typeof r[i]=="function"&&a.push(i)}for(var s=0;s<a.length;s++){var o=a[s],l=r[o];r[o]=(function(d){var p=e.operation(n),h=Array.prototype.slice.call(arguments,1),m=h.pop();h.push(function(b){p.retry(b)||(b&&(arguments[0]=p.mainError()),m.apply(this,arguments))}),p.attempt(function(){d.apply(r,h)})}).bind(r,l),r[o].options=n}}}(nS)),nS}var iS,GM;function $he(){return GM||(GM=1,iS=Fhe()),iS}var VM;function Bhe(){if(VM)return fp.exports;VM=1;const e=$he(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class r extends Error{constructor(o){super(),o instanceof Error?(this.originalError=o,{message:o}=o):(this.originalError=new Error(o),this.originalError.stack=this.stack),this.name="AbortError",this.message=o}}const n=(s,o,l)=>{const c=l.retries-(o-1);return s.attemptNumber=o,s.retriesLeft=c,s},a=s=>t.includes(s),i=(s,o)=>new Promise((l,c)=>{o={onFailedAttempt:()=>{},retries:10,...o};const d=e.operation(o);d.attempt(async p=>{try{l(await s(p))}catch(h){if(!(h instanceof Error)){c(new TypeError(`Non-error was thrown: "${h}". You should only throw errors.`));return}if(h instanceof r)d.stop(),c(h.originalError);else if(h instanceof TypeError&&!a(h.message))d.stop(),c(h);else{n(h,p,o);try{await o.onFailedAttempt(h)}catch(m){c(m);return}d.retry(h)||c(d.mainError())}}})});return fp.exports=i,fp.exports.default=i,fp.exports.AbortError=r,fp.exports}var Uhe=Bhe();const $rt=Vn(Uhe);var Qm={},sS={exports:{}},YM;function zhe(){return YM||(YM=1,function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function a(l,c,d){this.fn=l,this.context=c,this.once=d||!1}function i(l,c,d,p,h){if(typeof d!="function")throw new TypeError("The listener must be a function");var m=new a(d,p||l,h),b=r?r+c:c;return l._events[b]?l._events[b].fn?l._events[b]=[l._events[b],m]:l._events[b].push(m):(l._events[b]=m,l._eventsCount++),l}function s(l,c){--l._eventsCount===0?l._events=new n:delete l._events[c]}function o(){this._events=new n,this._eventsCount=0}o.prototype.eventNames=function(){var c=[],d,p;if(this._eventsCount===0)return c;for(p in d=this._events)t.call(d,p)&&c.push(r?p.slice(1):p);return Object.getOwnPropertySymbols?c.concat(Object.getOwnPropertySymbols(d)):c},o.prototype.listeners=function(c){var d=r?r+c:c,p=this._events[d];if(!p)return[];if(p.fn)return[p.fn];for(var h=0,m=p.length,b=new Array(m);h<m;h++)b[h]=p[h].fn;return b},o.prototype.listenerCount=function(c){var d=r?r+c:c,p=this._events[d];return p?p.fn?1:p.length:0},o.prototype.emit=function(c,d,p,h,m,b){var w=r?r+c:c;if(!this._events[w])return!1;var _=this._events[w],S=arguments.length,v,E;if(_.fn){switch(_.once&&this.removeListener(c,_.fn,void 0,!0),S){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,d),!0;case 3:return _.fn.call(_.context,d,p),!0;case 4:return _.fn.call(_.context,d,p,h),!0;case 5:return _.fn.call(_.context,d,p,h,m),!0;case 6:return _.fn.call(_.context,d,p,h,m,b),!0}for(E=1,v=new Array(S-1);E<S;E++)v[E-1]=arguments[E];_.fn.apply(_.context,v)}else{var T=_.length,x;for(E=0;E<T;E++)switch(_[E].once&&this.removeListener(c,_[E].fn,void 0,!0),S){case 1:_[E].fn.call(_[E].context);break;case 2:_[E].fn.call(_[E].context,d);break;case 3:_[E].fn.call(_[E].context,d,p);break;case 4:_[E].fn.call(_[E].context,d,p,h);break;default:if(!v)for(x=1,v=new Array(S-1);x<S;x++)v[x-1]=arguments[x];_[E].fn.apply(_[E].context,v)}}return!0},o.prototype.on=function(c,d,p){return i(this,c,d,p,!1)},o.prototype.once=function(c,d,p){return i(this,c,d,p,!0)},o.prototype.removeListener=function(c,d,p,h){var m=r?r+c:c;if(!this._events[m])return this;if(!d)return s(this,m),this;var b=this._events[m];if(b.fn)b.fn===d&&(!h||b.once)&&(!p||b.context===p)&&s(this,m);else{for(var w=0,_=[],S=b.length;w<S;w++)(b[w].fn!==d||h&&!b[w].once||p&&b[w].context!==p)&&_.push(b[w]);_.length?this._events[m]=_.length===1?_[0]:_:s(this,m)}return this},o.prototype.removeAllListeners=function(c){var d;return c?(d=r?r+c:c,this._events[d]&&s(this,d)):(this._events=new n,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=r,o.EventEmitter=o,e.exports=o}(sS)),sS.exports}var pp={exports:{}},oS,WM;function qhe(){return WM||(WM=1,oS=(e,t)=>(t=t||(()=>{}),e.then(r=>new Promise(n=>{n(t())}).then(()=>r),r=>new Promise(n=>{n(t())}).then(()=>{throw r})))),oS}var KM;function jhe(){if(KM)return pp.exports;KM=1;const e=qhe();class t extends Error{constructor(a){super(a),this.name="TimeoutError"}}const r=(n,a,i)=>new Promise((s,o)=>{if(typeof a!="number"||a<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(a===1/0){s(n);return}const l=setTimeout(()=>{if(typeof i=="function"){try{s(i())}catch(p){o(p)}return}const c=typeof i=="string"?i:`Promise timed out after ${a} milliseconds`,d=i instanceof Error?i:new t(c);typeof n.cancel=="function"&&n.cancel(),o(d)},a);e(n.then(s,o),()=>{clearTimeout(l)})});return pp.exports=r,pp.exports.default=r,pp.exports.TimeoutError=t,pp.exports}var Jm={},eg={},XM;function Hhe(){if(XM)return eg;XM=1,Object.defineProperty(eg,"__esModule",{value:!0});function e(t,r,n){let a=0,i=t.length;for(;i>0;){const s=i/2|0;let o=a+s;n(t[o],r)<=0?(a=++o,i-=s+1):i=s}return a}return eg.default=e,eg}var ZM;function Ghe(){if(ZM)return Jm;ZM=1,Object.defineProperty(Jm,"__esModule",{value:!0});const e=Hhe();class t{constructor(){this._queue=[]}enqueue(n,a){a=Object.assign({priority:0},a);const i={priority:a.priority,run:n};if(this.size&&this._queue[this.size-1].priority>=a.priority){this._queue.push(i);return}const s=e.default(this._queue,i,(o,l)=>l.priority-o.priority);this._queue.splice(s,0,i)}dequeue(){const n=this._queue.shift();return n?.run}filter(n){return this._queue.filter(a=>a.priority===n.priority).map(a=>a.run)}get size(){return this._queue.length}}return Jm.default=t,Jm}var QM;function Vhe(){if(QM)return Qm;QM=1,Object.defineProperty(Qm,"__esModule",{value:!0});const e=zhe(),t=jhe(),r=Ghe(),n=()=>{},a=new t.TimeoutError;class i extends e{constructor(o){var l,c,d,p;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=n,this._resolveIdle=n,o=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:r.default},o),!(typeof o.intervalCap=="number"&&o.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(c=(l=o.intervalCap)===null||l===void 0?void 0:l.toString())!==null&&c!==void 0?c:""}\` (${typeof o.intervalCap})`);if(o.interval===void 0||!(Number.isFinite(o.interval)&&o.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(p=(d=o.interval)===null||d===void 0?void 0:d.toString())!==null&&p!==void 0?p:""}\` (${typeof o.interval})`);this._carryoverConcurrencyCount=o.carryoverConcurrencyCount,this._isIntervalIgnored=o.intervalCap===1/0||o.interval===0,this._intervalCap=o.intervalCap,this._interval=o.interval,this._queue=new o.queueClass,this._queueClass=o.queueClass,this.concurrency=o.concurrency,this._timeout=o.timeout,this._throwOnTimeout=o.throwOnTimeout===!0,this._isPaused=o.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount<this._intervalCap}get _doesConcurrentAllowAnother(){return this._pendingCount<this._concurrency}_next(){this._pendingCount--,this._tryToStartAnother(),this.emit("next")}_resolvePromises(){this._resolveEmpty(),this._resolveEmpty=n,this._pendingCount===0&&(this._resolveIdle(),this._resolveIdle=n,this.emit("idle"))}_onResumeInterval(){this._onInterval(),this._initializeIntervalIfNeeded(),this._timeoutId=void 0}_isIntervalPaused(){const o=Date.now();if(this._intervalId===void 0){const l=this._intervalEnd-o;if(l<0)this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0;else return this._timeoutId===void 0&&(this._timeoutId=setTimeout(()=>{this._onResumeInterval()},l)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){const o=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){const l=this._queue.dequeue();return l?(this.emit("active"),l(),o&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(o){if(!(typeof o=="number"&&o>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${o}\` (${typeof o})`);this._concurrency=o,this._processQueue()}async add(o,l={}){return new Promise((c,d)=>{const p=async()=>{this._pendingCount++,this._intervalCount++;try{const h=this._timeout===void 0&&l.timeout===void 0?o():t.default(Promise.resolve(o()),l.timeout===void 0?this._timeout:l.timeout,()=>{(l.throwOnTimeout===void 0?this._throwOnTimeout:l.throwOnTimeout)&&d(a)});c(await h)}catch(h){d(h)}this._next()};this._queue.enqueue(p,l),this._tryToStartAnother(),this.emit("add")})}async addAll(o,l){return Promise.all(o.map(async c=>this.add(c,l)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(o=>{const l=this._resolveEmpty;this._resolveEmpty=()=>{l(),o()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(o=>{const l=this._resolveIdle;this._resolveIdle=()=>{l(),o()}})}get size(){return this._queue.size}sizeBy(o){return this._queue.filter(o).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(o){this._timeout=o}}return Qm.default=i,Qm}var Yhe=Vhe();const Brt=Vn(Yhe);function GJ(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t<a;t++)e[t]&&(r=GJ(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function VJ(){for(var e,t,r=0,n="",a=arguments.length;r<a;r++)(e=arguments[r])&&(t=GJ(e))&&(n&&(n+=" "),n+=t);return n}const gI="-",Whe=e=>{const t=Xhe(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:s=>{const o=s.split(gI);return o[0]===""&&o.length!==1&&o.shift(),YJ(o,t)||Khe(s)},getConflictingClassGroupIds:(s,o)=>{const l=r[s]||[];return o&&n[s]?[...l,...n[s]]:l}}},YJ=(e,t)=>{if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),a=n?YJ(e.slice(1),n):void 0;if(a)return a;if(t.validators.length===0)return;const i=e.join(gI);return t.validators.find(({validator:s})=>s(i))?.classGroupId},JM=/^\[(.+)\]$/,Khe=e=>{if(JM.test(e)){const t=JM.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Xhe=e=>{const{theme:t,classGroups:r}=e,n={nextPart:new Map,validators:[]};for(const a in r)L6(r[a],n,a,t);return n},L6=(e,t,r,n)=>{e.forEach(a=>{if(typeof a=="string"){const i=a===""?t:eP(t,a);i.classGroupId=r;return}if(typeof a=="function"){if(Zhe(a)){L6(a(n),t,r,n);return}t.validators.push({validator:a,classGroupId:r});return}Object.entries(a).forEach(([i,s])=>{L6(s,eP(t,i),r,n)})})},eP=(e,t)=>{let r=e;return t.split(gI).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},Zhe=e=>e.isThemeGetter,Qhe=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const a=(i,s)=>{r.set(i,s),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let s=r.get(i);if(s!==void 0)return s;if((s=n.get(i))!==void 0)return a(i,s),s},set(i,s){r.has(i)?r.set(i,s):a(i,s)}}},D6="!",M6=":",Jhe=M6.length,e0e=e=>{const{prefix:t,experimentalParseClassName:r}=e;let n=a=>{const i=[];let s=0,o=0,l=0,c;for(let b=0;b<a.length;b++){let w=a[b];if(s===0&&o===0){if(w===M6){i.push(a.slice(l,b)),l=b+Jhe;continue}if(w==="/"){c=b;continue}}w==="["?s++:w==="]"?s--:w==="("?o++:w===")"&&o--}const d=i.length===0?a:a.substring(l),p=t0e(d),h=p!==d,m=c&&c>l?c-l:void 0;return{modifiers:i,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}};if(t){const a=t+M6,i=n;n=s=>s.startsWith(a)?i(s.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(r){const a=n;n=i=>r({className:i,parseClassName:a})}return n},t0e=e=>e.endsWith(D6)?e.substring(0,e.length-1):e.startsWith(D6)?e.substring(1):e,r0e=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(n=>[n,!0]));return n=>{if(n.length<=1)return n;const a=[];let i=[];return n.forEach(s=>{s[0]==="["||t[s]?(a.push(...i.sort(),s),i=[]):i.push(s)}),a.push(...i.sort()),a}},n0e=e=>({cache:Qhe(e.cacheSize),parseClassName:e0e(e),sortModifiers:r0e(e),...Whe(e)}),a0e=/\s+/,i0e=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:a,sortModifiers:i}=t,s=[],o=e.trim().split(a0e);let l="";for(let c=o.length-1;c>=0;c-=1){const d=o[c],{isExternal:p,modifiers:h,hasImportantModifier:m,baseClassName:b,maybePostfixModifierPosition:w}=r(d);if(p){l=d+(l.length>0?" "+l:l);continue}let _=!!w,S=n(_?b.substring(0,w):b);if(!S){if(!_){l=d+(l.length>0?" "+l:l);continue}if(S=n(b),!S){l=d+(l.length>0?" "+l:l);continue}_=!1}const v=i(h).join(":"),E=m?v+D6:v,T=E+S;if(s.includes(T))continue;s.push(T);const x=a(S,_);for(let A=0;A<x.length;++A){const C=x[A];s.push(E+C)}l=d+(l.length>0?" "+l:l)}return l};function s0e(){let e=0,t,r,n="";for(;e<arguments.length;)(t=arguments[e++])&&(r=WJ(t))&&(n&&(n+=" "),n+=r);return n}const WJ=e=>{if(typeof e=="string")return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=WJ(e[n]))&&(r&&(r+=" "),r+=t);return r};function o0e(e,...t){let r,n,a,i=s;function s(l){const c=t.reduce((d,p)=>p(d),e());return r=n0e(c),n=r.cache.get,a=r.cache.set,i=o,o(l)}function o(l){const c=n(l);if(c)return c;const d=i0e(l,r);return a(l,d),d}return function(){return i(s0e.apply(null,arguments))}}const Sn=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},KJ=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,XJ=/^\((?:(\w[\w-]*):)?(.+)\)$/i,l0e=/^\d+\/\d+$/,u0e=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,c0e=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,d0e=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,f0e=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,p0e=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Wc=e=>l0e.test(e),Dt=e=>!!e&&!Number.isNaN(Number(e)),dl=e=>!!e&&Number.isInteger(Number(e)),lS=e=>e.endsWith("%")&&Dt(e.slice(0,-1)),Zs=e=>u0e.test(e),h0e=()=>!0,m0e=e=>c0e.test(e)&&!d0e.test(e),ZJ=()=>!1,g0e=e=>f0e.test(e),b0e=e=>p0e.test(e),y0e=e=>!et(e)&&!tt(e),v0e=e=>Yd(e,eee,ZJ),et=e=>KJ.test(e),mu=e=>Yd(e,tee,m0e),uS=e=>Yd(e,T0e,Dt),tP=e=>Yd(e,QJ,ZJ),E0e=e=>Yd(e,JJ,b0e),tg=e=>Yd(e,ree,g0e),tt=e=>XJ.test(e),hp=e=>Wd(e,tee),_0e=e=>Wd(e,x0e),rP=e=>Wd(e,QJ),S0e=e=>Wd(e,eee),w0e=e=>Wd(e,JJ),rg=e=>Wd(e,ree,!0),Yd=(e,t,r)=>{const n=KJ.exec(e);return n?n[1]?t(n[1]):r(n[2]):!1},Wd=(e,t,r=!1)=>{const n=XJ.exec(e);return n?n[1]?t(n[1]):r:!1},QJ=e=>e==="position"||e==="percentage",JJ=e=>e==="image"||e==="url",eee=e=>e==="length"||e==="size"||e==="bg-size",tee=e=>e==="length",T0e=e=>e==="number",x0e=e=>e==="family-name",ree=e=>e==="shadow",A0e=()=>{const e=Sn("color"),t=Sn("font"),r=Sn("text"),n=Sn("font-weight"),a=Sn("tracking"),i=Sn("leading"),s=Sn("breakpoint"),o=Sn("container"),l=Sn("spacing"),c=Sn("radius"),d=Sn("shadow"),p=Sn("inset-shadow"),h=Sn("text-shadow"),m=Sn("drop-shadow"),b=Sn("blur"),w=Sn("perspective"),_=Sn("aspect"),S=Sn("ease"),v=Sn("animate"),E=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],x=()=>[...T(),tt,et],A=()=>["auto","hidden","clip","visible","scroll"],C=()=>["auto","contain","none"],I=()=>[tt,et,l],L=()=>[Wc,"full","auto",...I()],M=()=>[dl,"none","subgrid",tt,et],B=()=>["auto",{span:["full",dl,tt,et]},dl,tt,et],V=()=>[dl,"auto",tt,et],q=()=>["auto","min","max","fr",tt,et],$=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],W=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...I()],X=()=>[Wc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...I()],K=()=>[e,tt,et],ne=()=>[...T(),rP,tP,{position:[tt,et]}],j=()=>["no-repeat",{repeat:["","x","y","space","round"]}],U=()=>["auto","cover","contain",S0e,v0e,{size:[tt,et]}],Q=()=>[lS,hp,mu],D=()=>["","none","full",c,tt,et],F=()=>["",Dt,hp,mu],G=()=>["solid","dashed","dotted","double"],J=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ue=()=>[Dt,lS,rP,tP],me=()=>["","none",b,tt,et],fe=()=>["none",Dt,tt,et],Ee=()=>["none",Dt,tt,et],ie=()=>[Dt,tt,et],oe=()=>[Wc,"full",...I()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Zs],breakpoint:[Zs],color:[h0e],container:[Zs],"drop-shadow":[Zs],ease:["in","out","in-out"],font:[y0e],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Zs],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Zs],shadow:[Zs],spacing:["px",Dt],text:[Zs],"text-shadow":[Zs],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Wc,et,tt,_]}],container:["container"],columns:[{columns:[Dt,et,tt,o]}],"break-after":[{"break-after":E()}],"break-before":[{"break-before":E()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:x()}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[dl,"auto",tt,et]}],basis:[{basis:[Wc,"full","auto",o,...I()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Dt,Wc,"auto","initial","none",et]}],grow:[{grow:["",Dt,tt,et]}],shrink:[{shrink:["",Dt,tt,et]}],order:[{order:[dl,"first","last","none",tt,et]}],"grid-cols":[{"grid-cols":M()}],"col-start-end":[{col:B()}],"col-start":[{"col-start":V()}],"col-end":[{"col-end":V()}],"grid-rows":[{"grid-rows":M()}],"row-start-end":[{row:B()}],"row-start":[{"row-start":V()}],"row-end":[{"row-end":V()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:I()}],"gap-x":[{"gap-x":I()}],"gap-y":[{"gap-y":I()}],"justify-content":[{justify:[...$(),"normal"]}],"justify-items":[{"justify-items":[...W(),"normal"]}],"justify-self":[{"justify-self":["auto",...W()]}],"align-content":[{content:["normal",...$()]}],"align-items":[{items:[...W(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...W(),{baseline:["","last"]}]}],"place-content":[{"place-content":$()}],"place-items":[{"place-items":[...W(),"baseline"]}],"place-self":[{"place-self":["auto",...W()]}],p:[{p:I()}],px:[{px:I()}],py:[{py:I()}],ps:[{ps:I()}],pe:[{pe:I()}],pt:[{pt:I()}],pr:[{pr:I()}],pb:[{pb:I()}],pl:[{pl:I()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":I()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":I()}],"space-y-reverse":["space-y-reverse"],size:[{size:X()}],w:[{w:[o,"screen",...X()]}],"min-w":[{"min-w":[o,"screen","none",...X()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[s]},...X()]}],h:[{h:["screen","lh",...X()]}],"min-h":[{"min-h":["screen","lh","none",...X()]}],"max-h":[{"max-h":["screen","lh",...X()]}],"font-size":[{text:["base",r,hp,mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[n,tt,uS]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",lS,et]}],"font-family":[{font:[_0e,et,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,tt,et]}],"line-clamp":[{"line-clamp":[Dt,"none",tt,uS]}],leading:[{leading:[i,...I()]}],"list-image":[{"list-image":["none",tt,et]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",tt,et]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:K()}],"text-color":[{text:K()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:[Dt,"from-font","auto",tt,mu]}],"text-decoration-color":[{decoration:K()}],"underline-offset":[{"underline-offset":[Dt,"auto",tt,et]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:I()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",tt,et]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",tt,et]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ne()}],"bg-repeat":[{bg:j()}],"bg-size":[{bg:U()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},dl,tt,et],radial:["",tt,et],conic:[dl,tt,et]},w0e,E0e]}],"bg-color":[{bg:K()}],"gradient-from-pos":[{from:Q()}],"gradient-via-pos":[{via:Q()}],"gradient-to-pos":[{to:Q()}],"gradient-from":[{from:K()}],"gradient-via":[{via:K()}],"gradient-to":[{to:K()}],rounded:[{rounded:D()}],"rounded-s":[{"rounded-s":D()}],"rounded-e":[{"rounded-e":D()}],"rounded-t":[{"rounded-t":D()}],"rounded-r":[{"rounded-r":D()}],"rounded-b":[{"rounded-b":D()}],"rounded-l":[{"rounded-l":D()}],"rounded-ss":[{"rounded-ss":D()}],"rounded-se":[{"rounded-se":D()}],"rounded-ee":[{"rounded-ee":D()}],"rounded-es":[{"rounded-es":D()}],"rounded-tl":[{"rounded-tl":D()}],"rounded-tr":[{"rounded-tr":D()}],"rounded-br":[{"rounded-br":D()}],"rounded-bl":[{"rounded-bl":D()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":F()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...G(),"hidden","none"]}],"divide-style":[{divide:[...G(),"hidden","none"]}],"border-color":[{border:K()}],"border-color-x":[{"border-x":K()}],"border-color-y":[{"border-y":K()}],"border-color-s":[{"border-s":K()}],"border-color-e":[{"border-e":K()}],"border-color-t":[{"border-t":K()}],"border-color-r":[{"border-r":K()}],"border-color-b":[{"border-b":K()}],"border-color-l":[{"border-l":K()}],"divide-color":[{divide:K()}],"outline-style":[{outline:[...G(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Dt,tt,et]}],"outline-w":[{outline:["",Dt,hp,mu]}],"outline-color":[{outline:K()}],shadow:[{shadow:["","none",d,rg,tg]}],"shadow-color":[{shadow:K()}],"inset-shadow":[{"inset-shadow":["none",p,rg,tg]}],"inset-shadow-color":[{"inset-shadow":K()}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:K()}],"ring-offset-w":[{"ring-offset":[Dt,mu]}],"ring-offset-color":[{"ring-offset":K()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":K()}],"text-shadow":[{"text-shadow":["none",h,rg,tg]}],"text-shadow-color":[{"text-shadow":K()}],opacity:[{opacity:[Dt,tt,et]}],"mix-blend":[{"mix-blend":[...J(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":J()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Dt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ue()}],"mask-image-linear-to-pos":[{"mask-linear-to":ue()}],"mask-image-linear-from-color":[{"mask-linear-from":K()}],"mask-image-linear-to-color":[{"mask-linear-to":K()}],"mask-image-t-from-pos":[{"mask-t-from":ue()}],"mask-image-t-to-pos":[{"mask-t-to":ue()}],"mask-image-t-from-color":[{"mask-t-from":K()}],"mask-image-t-to-color":[{"mask-t-to":K()}],"mask-image-r-from-pos":[{"mask-r-from":ue()}],"mask-image-r-to-pos":[{"mask-r-to":ue()}],"mask-image-r-from-color":[{"mask-r-from":K()}],"mask-image-r-to-color":[{"mask-r-to":K()}],"mask-image-b-from-pos":[{"mask-b-from":ue()}],"mask-image-b-to-pos":[{"mask-b-to":ue()}],"mask-image-b-from-color":[{"mask-b-from":K()}],"mask-image-b-to-color":[{"mask-b-to":K()}],"mask-image-l-from-pos":[{"mask-l-from":ue()}],"mask-image-l-to-pos":[{"mask-l-to":ue()}],"mask-image-l-from-color":[{"mask-l-from":K()}],"mask-image-l-to-color":[{"mask-l-to":K()}],"mask-image-x-from-pos":[{"mask-x-from":ue()}],"mask-image-x-to-pos":[{"mask-x-to":ue()}],"mask-image-x-from-color":[{"mask-x-from":K()}],"mask-image-x-to-color":[{"mask-x-to":K()}],"mask-image-y-from-pos":[{"mask-y-from":ue()}],"mask-image-y-to-pos":[{"mask-y-to":ue()}],"mask-image-y-from-color":[{"mask-y-from":K()}],"mask-image-y-to-color":[{"mask-y-to":K()}],"mask-image-radial":[{"mask-radial":[tt,et]}],"mask-image-radial-from-pos":[{"mask-radial-from":ue()}],"mask-image-radial-to-pos":[{"mask-radial-to":ue()}],"mask-image-radial-from-color":[{"mask-radial-from":K()}],"mask-image-radial-to-color":[{"mask-radial-to":K()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Dt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ue()}],"mask-image-conic-to-pos":[{"mask-conic-to":ue()}],"mask-image-conic-from-color":[{"mask-conic-from":K()}],"mask-image-conic-to-color":[{"mask-conic-to":K()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ne()}],"mask-repeat":[{mask:j()}],"mask-size":[{mask:U()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",tt,et]}],filter:[{filter:["","none",tt,et]}],blur:[{blur:me()}],brightness:[{brightness:[Dt,tt,et]}],contrast:[{contrast:[Dt,tt,et]}],"drop-shadow":[{"drop-shadow":["","none",m,rg,tg]}],"drop-shadow-color":[{"drop-shadow":K()}],grayscale:[{grayscale:["",Dt,tt,et]}],"hue-rotate":[{"hue-rotate":[Dt,tt,et]}],invert:[{invert:["",Dt,tt,et]}],saturate:[{saturate:[Dt,tt,et]}],sepia:[{sepia:["",Dt,tt,et]}],"backdrop-filter":[{"backdrop-filter":["","none",tt,et]}],"backdrop-blur":[{"backdrop-blur":me()}],"backdrop-brightness":[{"backdrop-brightness":[Dt,tt,et]}],"backdrop-contrast":[{"backdrop-contrast":[Dt,tt,et]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Dt,tt,et]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Dt,tt,et]}],"backdrop-invert":[{"backdrop-invert":["",Dt,tt,et]}],"backdrop-opacity":[{"backdrop-opacity":[Dt,tt,et]}],"backdrop-saturate":[{"backdrop-saturate":[Dt,tt,et]}],"backdrop-sepia":[{"backdrop-sepia":["",Dt,tt,et]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":I()}],"border-spacing-x":[{"border-spacing-x":I()}],"border-spacing-y":[{"border-spacing-y":I()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",tt,et]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Dt,"initial",tt,et]}],ease:[{ease:["linear","initial",S,tt,et]}],delay:[{delay:[Dt,tt,et]}],animate:[{animate:["none",v,tt,et]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,tt,et]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:Ee()}],"scale-x":[{"scale-x":Ee()}],"scale-y":[{"scale-y":Ee()}],"scale-z":[{"scale-z":Ee()}],"scale-3d":["scale-3d"],skew:[{skew:ie()}],"skew-x":[{"skew-x":ie()}],"skew-y":[{"skew-y":ie()}],transform:[{transform:[tt,et,"","none","gpu","cpu"]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:K()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:K()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",tt,et]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":I()}],"scroll-mx":[{"scroll-mx":I()}],"scroll-my":[{"scroll-my":I()}],"scroll-ms":[{"scroll-ms":I()}],"scroll-me":[{"scroll-me":I()}],"scroll-mt":[{"scroll-mt":I()}],"scroll-mr":[{"scroll-mr":I()}],"scroll-mb":[{"scroll-mb":I()}],"scroll-ml":[{"scroll-ml":I()}],"scroll-p":[{"scroll-p":I()}],"scroll-px":[{"scroll-px":I()}],"scroll-py":[{"scroll-py":I()}],"scroll-ps":[{"scroll-ps":I()}],"scroll-pe":[{"scroll-pe":I()}],"scroll-pt":[{"scroll-pt":I()}],"scroll-pr":[{"scroll-pr":I()}],"scroll-pb":[{"scroll-pb":I()}],"scroll-pl":[{"scroll-pl":I()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",tt,et]}],fill:[{fill:["none",...K()]}],"stroke-w":[{stroke:[Dt,hp,mu,uS]}],stroke:[{stroke:["none",...K()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},nee=o0e(A0e);function aee(...e){return nee(VJ(e))}function nP(e){const t=[],r=String(e||"");let n=r.indexOf(","),a=0,i=!1;for(;!i;){n===-1&&(n=r.length,i=!0);const s=r.slice(a,n).trim();(s||!i)&&t.push(s),a=n+1,n=r.indexOf(",",a)}return t}function bI(e,t){const r=t||{};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const k0e=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,C0e=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,N0e={};function aP(e,t){return(N0e.jsx?C0e:k0e).test(e)}const R0e=/[ \t\n\f\r]/g;function sy(e){return typeof e=="object"?e.type==="text"?iP(e.value):!1:iP(e)}function iP(e){return e.replace(R0e,"")===""}let Zh=class{constructor(t,r,n){this.normal=r,this.property=t,n&&(this.space=n)}};Zh.prototype.normal={};Zh.prototype.property={};Zh.prototype.space=void 0;function iee(e,t){const r={},n={};for(const a of e)Object.assign(r,a.property),Object.assign(n,a.normal);return new Zh(r,n,t)}function gh(e){return e.toLowerCase()}let Na=class{constructor(t,r){this.attribute=r,this.property=t}};Na.prototype.attribute="";Na.prototype.booleanish=!1;Na.prototype.boolean=!1;Na.prototype.commaOrSpaceSeparated=!1;Na.prototype.commaSeparated=!1;Na.prototype.defined=!1;Na.prototype.mustUseProperty=!1;Na.prototype.number=!1;Na.prototype.overloadedBoolean=!1;Na.prototype.property="";Na.prototype.spaceSeparated=!1;Na.prototype.space=void 0;let I0e=0;const Ct=Yu(),fn=Yu(),see=Yu(),ze=Yu(),kr=Yu(),gd=Yu(),za=Yu();function Yu(){return 2**++I0e}const P6=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ct,booleanish:fn,commaOrSpaceSeparated:za,commaSeparated:gd,number:ze,overloadedBoolean:see,spaceSeparated:kr},Symbol.toStringTag,{value:"Module"})),cS=Object.keys(P6);let yI=class extends Na{constructor(t,r,n,a){let i=-1;if(super(t,r),sP(this,"space",a),typeof n=="number")for(;++i<cS.length;){const s=cS[i];sP(this,cS[i],(n&P6[s])===P6[s])}}};yI.prototype.defined=!0;function sP(e,t,r){r&&(e[t]=r)}function Kd(e){const t={},r={};for(const[n,a]of Object.entries(e.properties)){const i=new yI(n,e.transform(e.attributes||{},n),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(n)&&(i.mustUseProperty=!0),t[n]=i,r[gh(n)]=n,r[gh(i.attribute)]=n}return new Zh(t,r,e.space)}const oee=Kd({properties:{ariaActiveDescendant:null,ariaAtomic:fn,ariaAutoComplete:null,ariaBusy:fn,ariaChecked:fn,ariaColCount:ze,ariaColIndex:ze,ariaColSpan:ze,ariaControls:kr,ariaCurrent:null,ariaDescribedBy:kr,ariaDetails:null,ariaDisabled:fn,ariaDropEffect:kr,ariaErrorMessage:null,ariaExpanded:fn,ariaFlowTo:kr,ariaGrabbed:fn,ariaHasPopup:null,ariaHidden:fn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:kr,ariaLevel:ze,ariaLive:null,ariaModal:fn,ariaMultiLine:fn,ariaMultiSelectable:fn,ariaOrientation:null,ariaOwns:kr,ariaPlaceholder:null,ariaPosInSet:ze,ariaPressed:fn,ariaReadOnly:fn,ariaRelevant:null,ariaRequired:fn,ariaRoleDescription:kr,ariaRowCount:ze,ariaRowIndex:ze,ariaRowSpan:ze,ariaSelected:fn,ariaSetSize:ze,ariaSort:null,ariaValueMax:ze,ariaValueMin:ze,ariaValueNow:ze,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function lee(e,t){return t in e?e[t]:t}function uee(e,t){return lee(e,t.toLowerCase())}const O0e=Kd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:gd,acceptCharset:kr,accessKey:kr,action:null,allow:null,allowFullScreen:Ct,allowPaymentRequest:Ct,allowUserMedia:Ct,alt:null,as:null,async:Ct,autoCapitalize:null,autoComplete:kr,autoFocus:Ct,autoPlay:Ct,blocking:kr,capture:null,charSet:null,checked:Ct,cite:null,className:kr,cols:ze,colSpan:null,content:null,contentEditable:fn,controls:Ct,controlsList:kr,coords:ze|gd,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ct,defer:Ct,dir:null,dirName:null,disabled:Ct,download:see,draggable:fn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ct,formTarget:null,headers:kr,height:ze,hidden:Ct,high:ze,href:null,hrefLang:null,htmlFor:kr,httpEquiv:kr,id:null,imageSizes:null,imageSrcSet:null,inert:Ct,inputMode:null,integrity:null,is:null,isMap:Ct,itemId:null,itemProp:kr,itemRef:kr,itemScope:Ct,itemType:kr,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ct,low:ze,manifest:null,max:null,maxLength:ze,media:null,method:null,min:null,minLength:ze,multiple:Ct,muted:Ct,name:null,nonce:null,noModule:Ct,noValidate:Ct,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:Ct,optimum:ze,pattern:null,ping:kr,placeholder:null,playsInline:Ct,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ct,referrerPolicy:null,rel:kr,required:Ct,reversed:Ct,rows:ze,rowSpan:ze,sandbox:kr,scope:null,scoped:Ct,seamless:Ct,selected:Ct,shadowRootClonable:Ct,shadowRootDelegatesFocus:Ct,shadowRootMode:null,shape:null,size:ze,sizes:null,slot:null,span:ze,spellCheck:fn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ze,step:null,style:null,tabIndex:ze,target:null,title:null,translate:null,type:null,typeMustMatch:Ct,useMap:null,value:fn,width:ze,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:kr,axis:null,background:null,bgColor:null,border:ze,borderColor:null,bottomMargin:ze,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ct,declare:Ct,event:null,face:null,frame:null,frameBorder:null,hSpace:ze,leftMargin:ze,link:null,longDesc:null,lowSrc:null,marginHeight:ze,marginWidth:ze,noResize:Ct,noHref:Ct,noShade:Ct,noWrap:Ct,object:null,profile:null,prompt:null,rev:null,rightMargin:ze,rules:null,scheme:null,scrolling:fn,standby:null,summary:null,text:null,topMargin:ze,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ze,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ct,disableRemotePlayback:Ct,prefix:null,property:null,results:ze,security:null,unselectable:null},space:"html",transform:uee}),L0e=Kd({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"},properties:{about:za,accentHeight:ze,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ze,amplitude:ze,arabicForm:null,ascent:ze,attributeName:null,attributeType:null,azimuth:ze,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ze,by:null,calcMode:null,capHeight:ze,className:kr,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:ze,diffuseConstant:ze,direction:null,display:null,dur:null,divisor:ze,dominantBaseline:null,download:Ct,dx:null,dy:null,edgeMode:null,editable:null,elevation:ze,enableBackground:null,end:null,event:null,exponent:ze,externalResourcesRequired:null,fill:null,fillOpacity:ze,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:gd,g2:gd,glyphName:gd,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ze,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ze,horizOriginX:ze,horizOriginY:ze,id:null,ideographic:ze,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ze,k:ze,k1:ze,k2:ze,k3:ze,k4:ze,kernelMatrix:za,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ze,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:ze,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:ze,overlineThickness:ze,paintOrder:null,panose1:null,path:null,pathLength:ze,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:kr,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ze,pointsAtY:ze,pointsAtZ:ze,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:za,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:za,rev:za,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:za,requiredFeatures:za,requiredFonts:za,requiredFormats:za,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:ze,specularExponent:ze,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ze,strikethroughThickness:ze,string:null,stroke:null,strokeDashArray:za,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ze,strokeOpacity:ze,strokeWidth:null,style:null,surfaceScale:ze,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:za,tabIndex:ze,tableValues:null,target:null,targetX:ze,targetY:ze,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:za,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ze,underlineThickness:ze,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ze,values:null,vAlphabetic:ze,vMathematical:ze,vectorEffect:null,vHanging:ze,vIdeographic:ze,version:null,vertAdvY:ze,vertOriginX:ze,vertOriginY:ze,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ze,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:lee}),cee=Kd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),dee=Kd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:uee}),fee=Kd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),D0e={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"},M0e=/[A-Z]/g,oP=/-[a-z]/g,P0e=/^data[-\w.:]+$/i;function oy(e,t){const r=gh(t);let n=t,a=Na;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&P0e.test(t)){if(t.charAt(4)==="-"){const i=t.slice(5).replace(oP,$0e);n="data"+i.charAt(0).toUpperCase()+i.slice(1)}else{const i=t.slice(4);if(!oP.test(i)){let s=i.replace(M0e,F0e);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}a=yI}return new a(n,t)}function F0e(e){return"-"+e.toLowerCase()}function $0e(e){return e.charAt(1).toUpperCase()}const Qh=iee([oee,O0e,cee,dee,fee],"html"),jl=iee([oee,L0e,cee,dee,fee],"svg");function lP(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function vI(e){return e.join(" ").trim()}var Kc={},dS,uP;function B0e(){if(uP)return dS;uP=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,r=/^\s*/,n=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,i=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,s=/^[;\s]*/,o=/^\s+|\s+$/g,l=`
62
62
  `,c="/",d="*",p="",h="comment",m="declaration";dS=function(w,_){if(typeof w!="string")throw new TypeError("First argument must be a string");if(!w)return[];_=_||{};var S=1,v=1;function E(q){var $=q.match(t);$&&(S+=$.length);var W=q.lastIndexOf(l);v=~W?q.length-W:v+q.length}function T(){var q={line:S,column:v};return function($){return $.position=new x(q),I(),$}}function x(q){this.start=q,this.end={line:S,column:v},this.source=_.source}x.prototype.content=w;function A(q){var $=new Error(_.source+":"+S+":"+v+": "+q);if($.reason=q,$.filename=_.source,$.line=S,$.column=v,$.source=w,!_.silent)throw $}function C(q){var $=q.exec(w);if($){var W=$[0];return E(W),w=w.slice(W.length),$}}function I(){C(r)}function L(q){var $;for(q=q||[];$=M();)$!==!1&&q.push($);return q}function M(){var q=T();if(!(c!=w.charAt(0)||d!=w.charAt(1))){for(var $=2;p!=w.charAt($)&&(d!=w.charAt($)||c!=w.charAt($+1));)++$;if($+=2,p===w.charAt($-1))return A("End of comment missing");var W=w.slice(2,$-2);return v+=2,E(W),w=w.slice($),v+=2,q({type:h,comment:W})}}function B(){var q=T(),$=C(n);if($){if(M(),!C(a))return A("property missing ':'");var W=C(i),Y=q({type:m,property:b($[0].replace(e,p)),value:W?b(W[0].replace(e,p)):p});return C(s),Y}}function V(){var q=[];L(q);for(var $;$=B();)$!==!1&&(q.push($),L(q));return q}return I(),V()};function b(w){return w?w.replace(o,p):p}return dS}var cP;function U0e(){if(cP)return Kc;cP=1;var e=Kc&&Kc.__importDefault||function(n){return n&&n.__esModule?n:{default:n}};Object.defineProperty(Kc,"__esModule",{value:!0}),Kc.default=r;var t=e(B0e());function r(n,a){var i=null;if(!n||typeof n!="string")return i;var s=(0,t.default)(n),o=typeof a=="function";return s.forEach(function(l){if(l.type==="declaration"){var c=l.property,d=l.value;o?a(c,d,l):d&&(i=i||{},i[c]=d)}}),i}return Kc}var mp={},dP;function z0e(){if(dP)return mp;dP=1,Object.defineProperty(mp,"__esModule",{value:!0}),mp.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,r=/^[^-]+$/,n=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,i=function(c){return!c||r.test(c)||e.test(c)},s=function(c,d){return d.toUpperCase()},o=function(c,d){return"".concat(d,"-")},l=function(c,d){return d===void 0&&(d={}),i(c)?c:(c=c.toLowerCase(),d.reactCompat?c=c.replace(a,o):c=c.replace(n,o),c.replace(t,s))};return mp.camelCase=l,mp}var gp,fP;function q0e(){if(fP)return gp;fP=1;var e=gp&&gp.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(U0e()),r=z0e();function n(a,i){var s={};return!a||typeof a!="string"||(0,t.default)(a,function(o,l){o&&l&&(s[(0,r.camelCase)(o,i)]=l)}),s}return n.default=n,gp=n,gp}var j0e=q0e();const H0e=Vn(j0e),ly=pee("end"),vs=pee("start");function pee(e){return t;function t(r){const n=r&&r.position&&r.position[e]||{};if(typeof n.line=="number"&&n.line>0&&typeof n.column=="number"&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset=="number"&&n.offset>-1?n.offset:void 0}}}function G0e(e){const t=vs(e),r=ly(e);if(t&&r)return{start:t,end:r}}function Yp(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?pP(e.position):"start"in e||"end"in e?pP(e):"line"in e||"column"in e?F6(e):""}function F6(e){return hP(e&&e.line)+":"+hP(e&&e.column)}function pP(e){return F6(e&&e.start)+"-"+F6(e&&e.end)}function hP(e){return e&&typeof e=="number"?e:1}class ta extends Error{constructor(t,r,n){super(),typeof r=="string"&&(n=r,r=void 0);let a="",i={},s=!1;if(r&&("line"in r&&"column"in r?i={place:r}:"start"in r&&"end"in r?i={place:r}:"type"in r?i={ancestors:[r],place:r.position}:i={...r}),typeof t=="string"?a=t:!i.cause&&t&&(s=!0,a=t.message,i.cause=t),!i.ruleId&&!i.source&&typeof n=="string"){const l=n.indexOf(":");l===-1?i.ruleId=n:(i.source=n.slice(0,l),i.ruleId=n.slice(l+1))}if(!i.place&&i.ancestors&&i.ancestors){const l=i.ancestors[i.ancestors.length-1];l&&(i.place=l.position)}const o=i.place&&"start"in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=a,this.line=o?o.line:void 0,this.name=Yp(i.place)||"1:1",this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=s&&i.cause&&typeof i.cause.stack=="string"?i.cause.stack:"",this.actual,this.expected,this.note,this.url}}ta.prototype.file="";ta.prototype.name="";ta.prototype.reason="";ta.prototype.message="";ta.prototype.stack="";ta.prototype.column=void 0;ta.prototype.line=void 0;ta.prototype.ancestors=void 0;ta.prototype.cause=void 0;ta.prototype.fatal=void 0;ta.prototype.place=void 0;ta.prototype.ruleId=void 0;ta.prototype.source=void 0;const EI={}.hasOwnProperty,V0e=new Map,Y0e=/[A-Z]/g,W0e=new Set(["table","tbody","thead","tfoot","tr"]),K0e=new Set(["td","th"]),hee="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function X0e(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=t.filePath||void 0;let n;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");n=ame(r,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");n=nme(r,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:n,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?jl:Qh,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},i=mee(a,e,void 0);return i&&typeof i!="string"?i:a.create(e,a.Fragment,{children:i||void 0},void 0)}function mee(e,t,r){if(t.type==="element")return Z0e(e,t,r);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Q0e(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return eme(e,t,r);if(t.type==="mdxjsEsm")return J0e(e,t);if(t.type==="root")return tme(e,t,r);if(t.type==="text")return rme(e,t)}function Z0e(e,t,r){const n=e.schema;let a=n;t.tagName.toLowerCase()==="svg"&&n.space==="html"&&(a=jl,e.schema=a),e.ancestors.push(t);const i=bee(e,t.tagName,!1),s=ime(e,t);let o=SI(e,t);return W0e.has(t.tagName)&&(o=o.filter(function(l){return typeof l=="string"?!sy(l):!0})),gee(e,s,i,t),_I(s,o),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function Q0e(e,t){if(t.data&&t.data.estree&&e.evaluater){const n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bh(e,t.position)}function J0e(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bh(e,t.position)}function eme(e,t,r){const n=e.schema;let a=n;t.name==="svg"&&n.space==="html"&&(a=jl,e.schema=a),e.ancestors.push(t);const i=t.name===null?e.Fragment:bee(e,t.name,!0),s=sme(e,t),o=SI(e,t);return gee(e,s,i,t),_I(s,o),e.ancestors.pop(),e.schema=n,e.create(t,i,s,r)}function tme(e,t,r){const n={};return _I(n,SI(e,t)),e.create(t,e.Fragment,n,r)}function rme(e,t){return t.value}function gee(e,t,r,n){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(t.node=n)}function _I(e,t){if(t.length>0){const r=t.length>1?t:t[0];r&&(e.children=r)}}function nme(e,t,r){return n;function n(a,i,s,o){const c=Array.isArray(s.children)?r:t;return o?c(i,s,o):c(i,s)}}function ame(e,t){return r;function r(n,a,i,s){const o=Array.isArray(i.children),l=vs(n);return t(a,i,s,o,{columnNumber:l?l.column-1:void 0,fileName:e,lineNumber:l?l.line:void 0},void 0)}}function ime(e,t){const r={};let n,a;for(a in t.properties)if(a!=="children"&&EI.call(t.properties,a)){const i=ome(e,a,t.properties[a]);if(i){const[s,o]=i;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&K0e.has(t.tagName)?n=o:r[s]=o}}if(n){const i=r.style||(r.style={});i[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=n}return r}function sme(e,t){const r={};for(const n of t.attributes)if(n.type==="mdxJsxExpressionAttribute")if(n.data&&n.data.estree&&e.evaluater){const i=n.data.estree.body[0];i.type;const s=i.expression;s.type;const o=s.properties[0];o.type,Object.assign(r,e.evaluater.evaluateExpression(o.argument))}else bh(e,t.position);else{const a=n.name;let i;if(n.value&&typeof n.value=="object")if(n.value.data&&n.value.data.estree&&e.evaluater){const o=n.value.data.estree.body[0];o.type,i=e.evaluater.evaluateExpression(o.expression)}else bh(e,t.position);else i=n.value===null?!0:n.value;r[a]=i}return r}function SI(e,t){const r=[];let n=-1;const a=e.passKeys?new Map:V0e;for(;++n<t.children.length;){const i=t.children[n];let s;if(e.passKeys){const l=i.type==="element"?i.tagName:i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement"?i.name:void 0;if(l){const c=a.get(l)||0;s=l+"-"+c,a.set(l,c+1)}}const o=mee(e,i,s);o!==void 0&&r.push(o)}return r}function ome(e,t,r){const n=oy(e.schema,t);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=n.commaSeparated?bI(r):vI(r)),n.property==="style"){let a=typeof r=="object"?r:lme(e,String(r));return e.stylePropertyNameCase==="css"&&(a=ume(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&n.space?D0e[n.property]||n.property:n.attribute,r]}}function lme(e,t){try{return H0e(t,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const n=r,a=new ta("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=hee+"#cannot-parse-style-attribute",a}}function bee(e,t,r){let n;if(!r)n={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let i=-1,s;for(;++i<a.length;){const o=aP(a[i])?{type:"Identifier",name:a[i]}:{type:"Literal",value:a[i]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(i&&o.type==="Literal"),optional:!1}:o}n=s}else n=aP(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(n.type==="Literal"){const a=n.value;return EI.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(n);bh(e)}function bh(e,t){const r=new ta("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=hee+"#cannot-handle-mdx-estrees-without-createevaluater",r}function ume(e){const t={};let r;for(r in e)EI.call(e,r)&&(t[cme(r)]=e[r]);return t}function cme(e){let t=e.replace(Y0e,dme);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function dme(e){return"-"+e.toLowerCase()}const fS={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},fme={};function wI(e,t){const r=fme,n=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return yee(e,n,a)}function yee(e,t,r){if(pme(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return mP(e.children,t,r)}return Array.isArray(e)?mP(e,t,r):""}function mP(e,t,r){const n=[];let a=-1;for(;++a<e.length;)n[a]=yee(e[a],t,r);return n.join("")}function pme(e){return!!(e&&typeof e=="object")}const gP=document.createElement("i");function TI(e){const t="&"+e+";";gP.innerHTML=t;const r=gP.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===t?!1:r}function Wa(e,t,r,n){const a=e.length;let i=0,s;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,r=r>0?r:0,n.length<1e4)s=Array.from(n),s.unshift(t,r),e.splice(...s);else for(r&&e.splice(t,r);i<n.length;)s=n.slice(i,i+1e4),s.unshift(t,0),e.splice(...s),i+=1e4,t+=1e4}function ci(e,t){return e.length>0?(Wa(e,e.length,0,t),e):t}const bP={}.hasOwnProperty;function vee(e){const t={};let r=-1;for(;++r<e.length;)hme(t,e[r]);return t}function hme(e,t){let r;for(r in t){const a=(bP.call(e,r)?e[r]:void 0)||(e[r]={}),i=t[r];let s;if(i)for(s in i){bP.call(a,s)||(a[s]=[]);const o=i[s];mme(a[s],Array.isArray(o)?o:o?[o]:[])}}}function mme(e,t){let r=-1;const n=[];for(;++r<t.length;)(t[r].add==="after"?e:n).push(t[r]);Wa(e,0,0,n)}function Eee(e,t){const r=Number.parseInt(e,t);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function Ui(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const ca=Hl(/[A-Za-z]/),Jn=Hl(/[\dA-Za-z]/),gme=Hl(/[#-'*+\--9=?A-Z^-~]/);function e1(e){return e!==null&&(e<32||e===127)}const $6=Hl(/\d/),bme=Hl(/[\dA-Fa-f]/),yme=Hl(/[!-/:-@[-`{-~]/);function ut(e){return e!==null&&e<-2}function Tr(e){return e!==null&&(e<0||e===32)}function zt(e){return e===-2||e===-1||e===32}const uy=Hl(new RegExp("\\p{P}|\\p{S}","u")),Fu=Hl(/\s/);function Hl(e){return t;function t(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function Xd(e){const t=[];let r=-1,n=0,a=0;for(;++r<e.length;){const i=e.charCodeAt(r);let s="";if(i===37&&Jn(e.charCodeAt(r+1))&&Jn(e.charCodeAt(r+2)))a=2;else if(i<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(i))||(s=String.fromCharCode(i));else if(i>55295&&i<57344){const o=e.charCodeAt(r+1);i<56320&&o>56319&&o<57344?(s=String.fromCharCode(i,o),a=1):s="�"}else s=String.fromCharCode(i);s&&(t.push(e.slice(n,r),encodeURIComponent(s)),n=r+a+1,s=""),a&&(r+=a,a=0)}return t.join("")+e.slice(n)}function Ft(e,t,r,n){const a=n?n-1:Number.POSITIVE_INFINITY;let i=0;return s;function s(l){return zt(l)?(e.enter(r),o(l)):t(l)}function o(l){return zt(l)&&i++<a?(e.consume(l),o):(e.exit(r),t(l))}}const vme={tokenize:Eme};function Eme(e){const t=e.attempt(this.parser.constructs.contentInitial,n,a);let r;return t;function n(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ft(e,t,"linePrefix")}function a(o){return e.enter("paragraph"),i(o)}function i(o){const l=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=l),r=l,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ut(o)?(e.consume(o),e.exit("chunkText"),i):(e.consume(o),s)}}const _me={tokenize:Sme},yP={tokenize:wme};function Sme(e){const t=this,r=[];let n=0,a,i,s;return o;function o(E){if(n<r.length){const T=r[n];return t.containerState=T[1],e.attempt(T[0].continuation,l,c)(E)}return c(E)}function l(E){if(n++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&v();const T=t.events.length;let x=T,A;for(;x--;)if(t.events[x][0]==="exit"&&t.events[x][1].type==="chunkFlow"){A=t.events[x][1].end;break}S(n);let C=T;for(;C<t.events.length;)t.events[C][1].end={...A},C++;return Wa(t.events,x+1,0,t.events.slice(T)),t.events.length=C,c(E)}return o(E)}function c(E){if(n===r.length){if(!a)return h(E);if(a.currentConstruct&&a.currentConstruct.concrete)return b(E);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(yP,d,p)(E)}function d(E){return a&&v(),S(n),h(E)}function p(E){return t.parser.lazy[t.now().line]=n!==r.length,s=t.now().offset,b(E)}function h(E){return t.containerState={},e.attempt(yP,m,b)(E)}function m(E){return n++,r.push([t.currentConstruct,t.containerState]),h(E)}function b(E){if(E===null){a&&v(),S(0),e.consume(E);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:i}),w(E)}function w(E){if(E===null){_(e.exit("chunkFlow"),!0),S(0),e.consume(E);return}return ut(E)?(e.consume(E),_(e.exit("chunkFlow")),n=0,t.interrupt=void 0,o):(e.consume(E),w)}function _(E,T){const x=t.sliceStream(E);if(T&&x.push(null),E.previous=i,i&&(i.next=E),i=E,a.defineSkip(E.start),a.write(x),t.parser.lazy[E.start.line]){let A=a.events.length;for(;A--;)if(a.events[A][1].start.offset<s&&(!a.events[A][1].end||a.events[A][1].end.offset>s))return;const C=t.events.length;let I=C,L,M;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(L){M=t.events[I][1].end;break}L=!0}for(S(n),A=C;A<t.events.length;)t.events[A][1].end={...M},A++;Wa(t.events,I+1,0,t.events.slice(C)),t.events.length=A}}function S(E){let T=r.length;for(;T-- >E;){const x=r[T];t.containerState=x[1],x[0].exit.call(t,e)}r.length=E}function v(){a.write([null]),i=void 0,a=void 0,t.containerState._closeFlow=void 0}}function wme(e,t,r){return Ft(e,e.attempt(this.parser.constructs.document,t,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Nd(e){if(e===null||Tr(e)||Fu(e))return 1;if(uy(e))return 2}function cy(e,t,r){const n=[];let a=-1;for(;++a<e.length;){const i=e[a].resolveAll;i&&!n.includes(i)&&(t=i(t,r),n.push(i))}return t}const B6={name:"attention",resolveAll:Tme,tokenize:xme};function Tme(e,t){let r=-1,n,a,i,s,o,l,c,d;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(n=r;n--;)if(e[n][0]==="exit"&&e[n][1].type==="attentionSequence"&&e[n][1]._open&&t.sliceSerialize(e[n][1]).charCodeAt(0)===t.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[n][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[n][1].end.offset-e[n][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;l=e[n][1].end.offset-e[n][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const p={...e[n][1].end},h={...e[r][1].start};vP(p,-l),vP(h,l),s={type:l>1?"strongSequence":"emphasisSequence",start:p,end:{...e[n][1].end}},o={type:l>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:h},i={type:l>1?"strongText":"emphasisText",start:{...e[n][1].end},end:{...e[r][1].start}},a={type:l>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[n][1].end={...s.start},e[r][1].start={...o.end},c=[],e[n][1].end.offset-e[n][1].start.offset&&(c=ci(c,[["enter",e[n][1],t],["exit",e[n][1],t]])),c=ci(c,[["enter",a,t],["enter",s,t],["exit",s,t],["enter",i,t]]),c=ci(c,cy(t.parser.constructs.insideSpan.null,e.slice(n+1,r),t)),c=ci(c,[["exit",i,t],["enter",o,t],["exit",o,t],["exit",a,t]]),e[r][1].end.offset-e[r][1].start.offset?(d=2,c=ci(c,[["enter",e[r][1],t],["exit",e[r][1],t]])):d=0,Wa(e,n-1,r-n+3,c),r=n+c.length-d-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function xme(e,t){const r=this.parser.constructs.attentionMarkers.null,n=this.previous,a=Nd(n);let i;return s;function s(l){return i=l,e.enter("attentionSequence"),o(l)}function o(l){if(l===i)return e.consume(l),o;const c=e.exit("attentionSequence"),d=Nd(l),p=!d||d===2&&a||r.includes(l),h=!a||a===2&&d||r.includes(n);return c._open=!!(i===42?p:p&&(a||!h)),c._close=!!(i===42?h:h&&(d||!p)),t(l)}}function vP(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Ame={name:"autolink",tokenize:kme};function kme(e,t,r){let n=0;return a;function a(m){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),i}function i(m){return ca(m)?(e.consume(m),s):m===64?r(m):c(m)}function s(m){return m===43||m===45||m===46||Jn(m)?(n=1,o(m)):c(m)}function o(m){return m===58?(e.consume(m),n=0,l):(m===43||m===45||m===46||Jn(m))&&n++<32?(e.consume(m),o):(n=0,c(m))}function l(m){return m===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):m===null||m===32||m===60||e1(m)?r(m):(e.consume(m),l)}function c(m){return m===64?(e.consume(m),d):gme(m)?(e.consume(m),c):r(m)}function d(m){return Jn(m)?p(m):r(m)}function p(m){return m===46?(e.consume(m),n=0,d):m===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(m),e.exit("autolinkMarker"),e.exit("autolink"),t):h(m)}function h(m){if((m===45||Jn(m))&&n++<63){const b=m===45?h:p;return e.consume(m),b}return r(m)}}const Jh={partial:!0,tokenize:Cme};function Cme(e,t,r){return n;function n(i){return zt(i)?Ft(e,a,"linePrefix")(i):a(i)}function a(i){return i===null||ut(i)?t(i):r(i)}}const _ee={continuation:{tokenize:Rme},exit:Ime,name:"blockQuote",tokenize:Nme};function Nme(e,t,r){const n=this;return a;function a(s){if(s===62){const o=n.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),i}return r(s)}function i(s){return zt(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function Rme(e,t,r){const n=this;return a;function a(s){return zt(s)?Ft(e,i,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):i(s)}function i(s){return e.attempt(_ee,t,r)(s)}}function Ime(e){e.exit("blockQuote")}const See={name:"characterEscape",tokenize:Ome};function Ome(e,t,r){return n;function n(i){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(i),e.exit("escapeMarker"),a}function a(i){return yme(i)?(e.enter("characterEscapeValue"),e.consume(i),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):r(i)}}const wee={name:"characterReference",tokenize:Lme};function Lme(e,t,r){const n=this;let a=0,i,s;return o;function o(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),l}function l(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),c):(e.enter("characterReferenceValue"),i=31,s=Jn,d(p))}function c(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),i=6,s=bme,d):(e.enter("characterReferenceValue"),i=7,s=$6,d(p))}function d(p){if(p===59&&a){const h=e.exit("characterReferenceValue");return s===Jn&&!TI(n.sliceSerialize(h))?r(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(p)&&a++<i?(e.consume(p),d):r(p)}}const EP={partial:!0,tokenize:Mme},_P={concrete:!0,name:"codeFenced",tokenize:Dme};function Dme(e,t,r){const n=this,a={partial:!0,tokenize:x};let i=0,s=0,o;return l;function l(A){return c(A)}function c(A){const C=n.events[n.events.length-1];return i=C&&C[1].type==="linePrefix"?C[2].sliceSerialize(C[1],!0).length:0,o=A,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),d(A)}function d(A){return A===o?(s++,e.consume(A),d):s<3?r(A):(e.exit("codeFencedFenceSequence"),zt(A)?Ft(e,p,"whitespace")(A):p(A))}function p(A){return A===null||ut(A)?(e.exit("codeFencedFence"),n.interrupt?t(A):e.check(EP,w,T)(A)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),h(A))}function h(A){return A===null||ut(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(A)):zt(A)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ft(e,m,"whitespace")(A)):A===96&&A===o?r(A):(e.consume(A),h)}function m(A){return A===null||ut(A)?p(A):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(A))}function b(A){return A===null||ut(A)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(A)):A===96&&A===o?r(A):(e.consume(A),b)}function w(A){return e.attempt(a,T,_)(A)}function _(A){return e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),S}function S(A){return i>0&&zt(A)?Ft(e,v,"linePrefix",i+1)(A):v(A)}function v(A){return A===null||ut(A)?e.check(EP,w,T)(A):(e.enter("codeFlowValue"),E(A))}function E(A){return A===null||ut(A)?(e.exit("codeFlowValue"),v(A)):(e.consume(A),E)}function T(A){return e.exit("codeFenced"),t(A)}function x(A,C,I){let L=0;return M;function M(W){return A.enter("lineEnding"),A.consume(W),A.exit("lineEnding"),B}function B(W){return A.enter("codeFencedFence"),zt(W)?Ft(A,V,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):V(W)}function V(W){return W===o?(A.enter("codeFencedFenceSequence"),q(W)):I(W)}function q(W){return W===o?(L++,A.consume(W),q):L>=s?(A.exit("codeFencedFenceSequence"),zt(W)?Ft(A,$,"whitespace")(W):$(W)):I(W)}function $(W){return W===null||ut(W)?(A.exit("codeFencedFence"),C(W)):I(W)}}}function Mme(e,t,r){const n=this;return a;function a(s){return s===null?r(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}const pS={name:"codeIndented",tokenize:Fme},Pme={partial:!0,tokenize:$me};function Fme(e,t,r){const n=this;return a;function a(c){return e.enter("codeIndented"),Ft(e,i,"linePrefix",5)(c)}function i(c){const d=n.events[n.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?s(c):r(c)}function s(c){return c===null?l(c):ut(c)?e.attempt(Pme,s,l)(c):(e.enter("codeFlowValue"),o(c))}function o(c){return c===null||ut(c)?(e.exit("codeFlowValue"),s(c)):(e.consume(c),o)}function l(c){return e.exit("codeIndented"),t(c)}}function $me(e,t,r){const n=this;return a;function a(s){return n.parser.lazy[n.now().line]?r(s):ut(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):Ft(e,i,"linePrefix",5)(s)}function i(s){const o=n.events[n.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):ut(s)?a(s):r(s)}}const Bme={name:"codeText",previous:zme,resolve:Ume,tokenize:qme};function Ume(e){let t=e.length-4,r=3,n,a;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(n=r;++n<t;)if(e[n][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[t][1].type="codeTextPadding",r+=2,t-=2;break}}for(n=r-1,t++;++n<=t;)a===void 0?n!==t&&e[n][1].type!=="lineEnding"&&(a=n):(n===t||e[n][1].type==="lineEnding")&&(e[a][1].type="codeTextData",n!==a+2&&(e[a][1].end=e[n-1][1].end,e.splice(a+2,n-a-2),t-=n-a-2,n=a+2),a=void 0);return e}function zme(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function qme(e,t,r){let n=0,a,i;return s;function s(p){return e.enter("codeText"),e.enter("codeTextSequence"),o(p)}function o(p){return p===96?(e.consume(p),n++,o):(e.exit("codeTextSequence"),l(p))}function l(p){return p===null?r(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),l):p===96?(i=e.enter("codeTextSequence"),a=0,d(p)):ut(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),l):(e.enter("codeTextData"),c(p))}function c(p){return p===null||p===32||p===96||ut(p)?(e.exit("codeTextData"),l(p)):(e.consume(p),c)}function d(p){return p===96?(e.consume(p),a++,d):a===n?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(i.type="codeTextData",c(p))}}class jme{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,r){const n=r??Number.POSITIVE_INFINITY;return n<this.left.length?this.left.slice(t,n):t>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(t,r,n){const a=r||0;this.setCursor(Math.trunc(t));const i=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return n&&bp(this.left,n),i.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),bp(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),bp(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const r=this.left.splice(t,Number.POSITIVE_INFINITY);bp(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);bp(this.left,r.reverse())}}}function bp(e,t){let r=0;if(t.length<1e4)e.push(...t);else for(;r<t.length;)e.push(...t.slice(r,r+1e4)),r+=1e4}function Tee(e){const t={};let r=-1,n,a,i,s,o,l,c;const d=new jme(e);for(;++r<d.length;){for(;r in t;)r=t[r];if(n=d.get(r),r&&n[1].type==="chunkFlow"&&d.get(r-1)[1].type==="listItemPrefix"&&(l=n[1]._tokenizer.events,i=0,i<l.length&&l[i][1].type==="lineEndingBlank"&&(i+=2),i<l.length&&l[i][1].type==="content"))for(;++i<l.length&&l[i][1].type!=="content";)l[i][1].type==="chunkText"&&(l[i][1]._isInFirstContentOfListItem=!0,i++);if(n[0]==="enter")n[1].contentType&&(Object.assign(t,Hme(d,r)),r=t[r],c=!0);else if(n[1]._container){for(i=r,a=void 0;i--;)if(s=d.get(i),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(a&&(d.get(a)[1].type="lineEndingBlank"),s[1].type="lineEnding",a=i);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;a&&(n[1].end={...d.get(a)[1].start},o=d.slice(a,r),o.unshift(n),d.splice(a,r-a+1,o))}}return Wa(e,0,Number.POSITIVE_INFINITY,d.slice(0)),!c}function Hme(e,t){const r=e.get(t)[1],n=e.get(t)[2];let a=t-1;const i=[];let s=r._tokenizer;s||(s=n.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,l=[],c={};let d,p,h=-1,m=r,b=0,w=0;const _=[w];for(;m;){for(;e.get(++a)[1]!==m;);i.push(a),m._tokenizer||(d=n.sliceStream(m),m.next||d.push(null),p&&s.defineSkip(m.start),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(d),m._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),p=m,m=m.next}for(m=r;++h<o.length;)o[h][0]==="exit"&&o[h-1][0]==="enter"&&o[h][1].type===o[h-1][1].type&&o[h][1].start.line!==o[h][1].end.line&&(w=h+1,_.push(w),m._tokenizer=void 0,m.previous=void 0,m=m.next);for(s.events=[],m?(m._tokenizer=void 0,m.previous=void 0):_.pop(),h=_.length;h--;){const S=o.slice(_[h],_[h+1]),v=i.pop();l.push([v,v+S.length-1]),e.splice(v,2,S)}for(l.reverse(),h=-1;++h<l.length;)c[b+l[h][0]]=b+l[h][1],b+=l[h][1]-l[h][0]-1;return c}const Gme={resolve:Yme,tokenize:Wme},Vme={partial:!0,tokenize:Kme};function Yme(e){return Tee(e),e}function Wme(e,t){let r;return n;function n(o){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),a(o)}function a(o){return o===null?i(o):ut(o)?e.check(Vme,s,i)(o):(e.consume(o),a)}function i(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function Kme(e,t,r){const n=this;return a;function a(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ft(e,i,"linePrefix")}function i(s){if(s===null||ut(s))return r(s);const o=n.events[n.events.length-1];return!n.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(n.parser.constructs.flow,r,t)(s)}}function xee(e,t,r,n,a,i,s,o,l){const c=l||Number.POSITIVE_INFINITY;let d=0;return p;function p(S){return S===60?(e.enter(n),e.enter(a),e.enter(i),e.consume(S),e.exit(i),h):S===null||S===32||S===41||e1(S)?r(S):(e.enter(n),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),w(S))}function h(S){return S===62?(e.enter(i),e.consume(S),e.exit(i),e.exit(a),e.exit(n),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===62?(e.exit("chunkString"),e.exit(o),h(S)):S===null||S===60||ut(S)?r(S):(e.consume(S),S===92?b:m)}function b(S){return S===60||S===62||S===92?(e.consume(S),m):m(S)}function w(S){return!d&&(S===null||S===41||Tr(S))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(n),t(S)):d<c&&S===40?(e.consume(S),d++,w):S===41?(e.consume(S),d--,w):S===null||S===32||S===40||e1(S)?r(S):(e.consume(S),S===92?_:w)}function _(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function Aee(e,t,r,n,a,i){const s=this;let o=0,l;return c;function c(m){return e.enter(n),e.enter(a),e.consume(m),e.exit(a),e.enter(i),d}function d(m){return o>999||m===null||m===91||m===93&&!l||m===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?r(m):m===93?(e.exit(i),e.enter(a),e.consume(m),e.exit(a),e.exit(n),t):ut(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),d):(e.enter("chunkString",{contentType:"string"}),p(m))}function p(m){return m===null||m===91||m===93||ut(m)||o++>999?(e.exit("chunkString"),d(m)):(e.consume(m),l||(l=!zt(m)),m===92?h:p)}function h(m){return m===91||m===92||m===93?(e.consume(m),o++,p):p(m)}}function kee(e,t,r,n,a,i){let s;return o;function o(h){return h===34||h===39||h===40?(e.enter(n),e.enter(a),e.consume(h),e.exit(a),s=h===40?41:h,l):r(h)}function l(h){return h===s?(e.enter(a),e.consume(h),e.exit(a),e.exit(n),t):(e.enter(i),c(h))}function c(h){return h===s?(e.exit(i),l(s)):h===null?r(h):ut(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),Ft(e,c,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),d(h))}function d(h){return h===s||h===null||ut(h)?(e.exit("chunkString"),c(h)):(e.consume(h),h===92?p:d)}function p(h){return h===s||h===92?(e.consume(h),d):d(h)}}function Wp(e,t){let r;return n;function n(a){return ut(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,n):zt(a)?Ft(e,n,r?"linePrefix":"lineSuffix")(a):t(a)}}const Xme={name:"definition",tokenize:Qme},Zme={partial:!0,tokenize:Jme};function Qme(e,t,r){const n=this;let a;return i;function i(m){return e.enter("definition"),s(m)}function s(m){return Aee.call(n,e,o,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(m)}function o(m){return a=Ui(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)),m===58?(e.enter("definitionMarker"),e.consume(m),e.exit("definitionMarker"),l):r(m)}function l(m){return Tr(m)?Wp(e,c)(m):c(m)}function c(m){return xee(e,d,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(m)}function d(m){return e.attempt(Zme,p,p)(m)}function p(m){return zt(m)?Ft(e,h,"whitespace")(m):h(m)}function h(m){return m===null||ut(m)?(e.exit("definition"),n.parser.defined.push(a),t(m)):r(m)}}function Jme(e,t,r){return n;function n(o){return Tr(o)?Wp(e,a)(o):r(o)}function a(o){return kee(e,i,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function i(o){return zt(o)?Ft(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ut(o)?t(o):r(o)}}const ege={name:"hardBreakEscape",tokenize:tge};function tge(e,t,r){return n;function n(i){return e.enter("hardBreakEscape"),e.consume(i),a}function a(i){return ut(i)?(e.exit("hardBreakEscape"),t(i)):r(i)}}const rge={name:"headingAtx",resolve:nge,tokenize:age};function nge(e,t){let r=e.length-2,n=3,a,i;return e[n][1].type==="whitespace"&&(n+=2),r-2>n&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(n===r-1||r-4>n&&e[r-2][1].type==="whitespace")&&(r-=n+1===r?2:4),r>n&&(a={type:"atxHeadingText",start:e[n][1].start,end:e[r][1].end},i={type:"chunkText",start:e[n][1].start,end:e[r][1].end,contentType:"text"},Wa(e,n,r-n+1,[["enter",a,t],["enter",i,t],["exit",i,t],["exit",a,t]])),e}function age(e,t,r){let n=0;return a;function a(d){return e.enter("atxHeading"),i(d)}function i(d){return e.enter("atxHeadingSequence"),s(d)}function s(d){return d===35&&n++<6?(e.consume(d),s):d===null||Tr(d)?(e.exit("atxHeadingSequence"),o(d)):r(d)}function o(d){return d===35?(e.enter("atxHeadingSequence"),l(d)):d===null||ut(d)?(e.exit("atxHeading"),t(d)):zt(d)?Ft(e,o,"whitespace")(d):(e.enter("atxHeadingText"),c(d))}function l(d){return d===35?(e.consume(d),l):(e.exit("atxHeadingSequence"),o(d))}function c(d){return d===null||d===35||Tr(d)?(e.exit("atxHeadingText"),o(d)):(e.consume(d),c)}}const ige=["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"],SP=["pre","script","style","textarea"],sge={concrete:!0,name:"htmlFlow",resolveTo:uge,tokenize:cge},oge={partial:!0,tokenize:fge},lge={partial:!0,tokenize:dge};function uge(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function cge(e,t,r){const n=this;let a,i,s,o,l;return c;function c(D){return d(D)}function d(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),h):D===47?(e.consume(D),i=!0,w):D===63?(e.consume(D),a=3,n.interrupt?t:j):ca(D)?(e.consume(D),s=String.fromCharCode(D),_):r(D)}function h(D){return D===45?(e.consume(D),a=2,m):D===91?(e.consume(D),a=5,o=0,b):ca(D)?(e.consume(D),a=4,n.interrupt?t:j):r(D)}function m(D){return D===45?(e.consume(D),n.interrupt?t:j):r(D)}function b(D){const F="CDATA[";return D===F.charCodeAt(o++)?(e.consume(D),o===F.length?n.interrupt?t:V:b):r(D)}function w(D){return ca(D)?(e.consume(D),s=String.fromCharCode(D),_):r(D)}function _(D){if(D===null||D===47||D===62||Tr(D)){const F=D===47,G=s.toLowerCase();return!F&&!i&&SP.includes(G)?(a=1,n.interrupt?t(D):V(D)):ige.includes(s.toLowerCase())?(a=6,F?(e.consume(D),S):n.interrupt?t(D):V(D)):(a=7,n.interrupt&&!n.parser.lazy[n.now().line]?r(D):i?v(D):E(D))}return D===45||Jn(D)?(e.consume(D),s+=String.fromCharCode(D),_):r(D)}function S(D){return D===62?(e.consume(D),n.interrupt?t:V):r(D)}function v(D){return zt(D)?(e.consume(D),v):M(D)}function E(D){return D===47?(e.consume(D),M):D===58||D===95||ca(D)?(e.consume(D),T):zt(D)?(e.consume(D),E):M(D)}function T(D){return D===45||D===46||D===58||D===95||Jn(D)?(e.consume(D),T):x(D)}function x(D){return D===61?(e.consume(D),A):zt(D)?(e.consume(D),x):E(D)}function A(D){return D===null||D===60||D===61||D===62||D===96?r(D):D===34||D===39?(e.consume(D),l=D,C):zt(D)?(e.consume(D),A):I(D)}function C(D){return D===l?(e.consume(D),l=null,L):D===null||ut(D)?r(D):(e.consume(D),C)}function I(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||Tr(D)?x(D):(e.consume(D),I)}function L(D){return D===47||D===62||zt(D)?E(D):r(D)}function M(D){return D===62?(e.consume(D),B):r(D)}function B(D){return D===null||ut(D)?V(D):zt(D)?(e.consume(D),B):r(D)}function V(D){return D===45&&a===2?(e.consume(D),Y):D===60&&a===1?(e.consume(D),X):D===62&&a===4?(e.consume(D),U):D===63&&a===3?(e.consume(D),j):D===93&&a===5?(e.consume(D),ne):ut(D)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(oge,Q,q)(D)):D===null||ut(D)?(e.exit("htmlFlowData"),q(D)):(e.consume(D),V)}function q(D){return e.check(lge,$,Q)(D)}function $(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),W}function W(D){return D===null||ut(D)?q(D):(e.enter("htmlFlowData"),V(D))}function Y(D){return D===45?(e.consume(D),j):V(D)}function X(D){return D===47?(e.consume(D),s="",K):V(D)}function K(D){if(D===62){const F=s.toLowerCase();return SP.includes(F)?(e.consume(D),U):V(D)}return ca(D)&&s.length<8?(e.consume(D),s+=String.fromCharCode(D),K):V(D)}function ne(D){return D===93?(e.consume(D),j):V(D)}function j(D){return D===62?(e.consume(D),U):D===45&&a===2?(e.consume(D),j):V(D)}function U(D){return D===null||ut(D)?(e.exit("htmlFlowData"),Q(D)):(e.consume(D),U)}function Q(D){return e.exit("htmlFlow"),t(D)}}function dge(e,t,r){const n=this;return a;function a(s){return ut(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),i):r(s)}function i(s){return n.parser.lazy[n.now().line]?r(s):t(s)}}function fge(e,t,r){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Jh,t,r)}}const pge={name:"htmlText",tokenize:hge};function hge(e,t,r){const n=this;let a,i,s;return o;function o(j){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(j),l}function l(j){return j===33?(e.consume(j),c):j===47?(e.consume(j),x):j===63?(e.consume(j),E):ca(j)?(e.consume(j),I):r(j)}function c(j){return j===45?(e.consume(j),d):j===91?(e.consume(j),i=0,b):ca(j)?(e.consume(j),v):r(j)}function d(j){return j===45?(e.consume(j),m):r(j)}function p(j){return j===null?r(j):j===45?(e.consume(j),h):ut(j)?(s=p,X(j)):(e.consume(j),p)}function h(j){return j===45?(e.consume(j),m):p(j)}function m(j){return j===62?Y(j):j===45?h(j):p(j)}function b(j){const U="CDATA[";return j===U.charCodeAt(i++)?(e.consume(j),i===U.length?w:b):r(j)}function w(j){return j===null?r(j):j===93?(e.consume(j),_):ut(j)?(s=w,X(j)):(e.consume(j),w)}function _(j){return j===93?(e.consume(j),S):w(j)}function S(j){return j===62?Y(j):j===93?(e.consume(j),S):w(j)}function v(j){return j===null||j===62?Y(j):ut(j)?(s=v,X(j)):(e.consume(j),v)}function E(j){return j===null?r(j):j===63?(e.consume(j),T):ut(j)?(s=E,X(j)):(e.consume(j),E)}function T(j){return j===62?Y(j):E(j)}function x(j){return ca(j)?(e.consume(j),A):r(j)}function A(j){return j===45||Jn(j)?(e.consume(j),A):C(j)}function C(j){return ut(j)?(s=C,X(j)):zt(j)?(e.consume(j),C):Y(j)}function I(j){return j===45||Jn(j)?(e.consume(j),I):j===47||j===62||Tr(j)?L(j):r(j)}function L(j){return j===47?(e.consume(j),Y):j===58||j===95||ca(j)?(e.consume(j),M):ut(j)?(s=L,X(j)):zt(j)?(e.consume(j),L):Y(j)}function M(j){return j===45||j===46||j===58||j===95||Jn(j)?(e.consume(j),M):B(j)}function B(j){return j===61?(e.consume(j),V):ut(j)?(s=B,X(j)):zt(j)?(e.consume(j),B):L(j)}function V(j){return j===null||j===60||j===61||j===62||j===96?r(j):j===34||j===39?(e.consume(j),a=j,q):ut(j)?(s=V,X(j)):zt(j)?(e.consume(j),V):(e.consume(j),$)}function q(j){return j===a?(e.consume(j),a=void 0,W):j===null?r(j):ut(j)?(s=q,X(j)):(e.consume(j),q)}function $(j){return j===null||j===34||j===39||j===60||j===61||j===96?r(j):j===47||j===62||Tr(j)?L(j):(e.consume(j),$)}function W(j){return j===47||j===62||Tr(j)?L(j):r(j)}function Y(j){return j===62?(e.consume(j),e.exit("htmlTextData"),e.exit("htmlText"),t):r(j)}function X(j){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),K}function K(j){return zt(j)?Ft(e,ne,"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(j):ne(j)}function ne(j){return e.enter("htmlTextData"),s(j)}}const xI={name:"labelEnd",resolveAll:yge,resolveTo:vge,tokenize:Ege},mge={tokenize:_ge},gge={tokenize:Sge},bge={tokenize:wge};function yge(e){let t=-1;const r=[];for(;++t<e.length;){const n=e[t][1];if(r.push(e[t]),n.type==="labelImage"||n.type==="labelLink"||n.type==="labelEnd"){const a=n.type==="labelImage"?4:2;n.type="data",t+=a}}return e.length!==r.length&&Wa(e,0,e.length,r),e}function vge(e,t){let r=e.length,n=0,a,i,s,o;for(;r--;)if(a=e[r][1],i){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(s){if(e[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(i=r,a.type!=="labelLink")){n=2;break}}else a.type==="labelEnd"&&(s=r);const l={type:e[i][1].type==="labelLink"?"link":"image",start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:"label",start:{...e[i][1].start},end:{...e[s][1].end}},d={type:"labelText",start:{...e[i+n+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",l,t],["enter",c,t]],o=ci(o,e.slice(i+1,i+n+3)),o=ci(o,[["enter",d,t]]),o=ci(o,cy(t.parser.constructs.insideSpan.null,e.slice(i+n+4,s-3),t)),o=ci(o,[["exit",d,t],e[s-2],e[s-1],["exit",c,t]]),o=ci(o,e.slice(s+1)),o=ci(o,[["exit",l,t]]),Wa(e,i,e.length,o),e}function Ege(e,t,r){const n=this;let a=n.events.length,i,s;for(;a--;)if((n.events[a][1].type==="labelImage"||n.events[a][1].type==="labelLink")&&!n.events[a][1]._balanced){i=n.events[a][1];break}return o;function o(h){return i?i._inactive?p(h):(s=n.parser.defined.includes(Ui(n.sliceSerialize({start:i.end,end:n.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(h),e.exit("labelMarker"),e.exit("labelEnd"),l):r(h)}function l(h){return h===40?e.attempt(mge,d,s?d:p)(h):h===91?e.attempt(gge,d,s?c:p)(h):s?d(h):p(h)}function c(h){return e.attempt(bge,d,p)(h)}function d(h){return t(h)}function p(h){return i._balanced=!0,r(h)}}function _ge(e,t,r){return n;function n(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),a}function a(p){return Tr(p)?Wp(e,i)(p):i(p)}function i(p){return p===41?d(p):xee(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function s(p){return Tr(p)?Wp(e,l)(p):d(p)}function o(p){return r(p)}function l(p){return p===34||p===39||p===40?kee(e,c,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):d(p)}function c(p){return Tr(p)?Wp(e,d)(p):d(p)}function d(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):r(p)}}function Sge(e,t,r){const n=this;return a;function a(o){return Aee.call(n,e,i,s,"reference","referenceMarker","referenceString")(o)}function i(o){return n.parser.defined.includes(Ui(n.sliceSerialize(n.events[n.events.length-1][1]).slice(1,-1)))?t(o):r(o)}function s(o){return r(o)}}function wge(e,t,r){return n;function n(i){return e.enter("reference"),e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),a}function a(i){return i===93?(e.enter("referenceMarker"),e.consume(i),e.exit("referenceMarker"),e.exit("reference"),t):r(i)}}const Tge={name:"labelStartImage",resolveAll:xI.resolveAll,tokenize:xge};function xge(e,t,r){const n=this;return a;function a(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),i}function i(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):r(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(o):t(o)}}const Age={name:"labelStartLink",resolveAll:xI.resolveAll,tokenize:kge};function kge(e,t,r){const n=this;return a;function a(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),i}function i(s){return s===94&&"_hiddenFootnoteSupport"in n.parser.constructs?r(s):t(s)}}const hS={name:"lineEnding",tokenize:Cge};function Cge(e,t){return r;function r(n){return e.enter("lineEnding"),e.consume(n),e.exit("lineEnding"),Ft(e,t,"linePrefix")}}const kb={name:"thematicBreak",tokenize:Nge};function Nge(e,t,r){let n=0,a;return i;function i(c){return e.enter("thematicBreak"),s(c)}function s(c){return a=c,o(c)}function o(c){return c===a?(e.enter("thematicBreakSequence"),l(c)):n>=3&&(c===null||ut(c))?(e.exit("thematicBreak"),t(c)):r(c)}function l(c){return c===a?(e.consume(c),n++,l):(e.exit("thematicBreakSequence"),zt(c)?Ft(e,o,"whitespace")(c):o(c))}}const wa={continuation:{tokenize:Lge},exit:Mge,name:"list",tokenize:Oge},Rge={partial:!0,tokenize:Pge},Ige={partial:!0,tokenize:Dge};function Oge(e,t,r){const n=this,a=n.events[n.events.length-1];let i=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,s=0;return o;function o(m){const b=n.containerState.type||(m===42||m===43||m===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!n.containerState.marker||m===n.containerState.marker:$6(m)){if(n.containerState.type||(n.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),m===42||m===45?e.check(kb,r,c)(m):c(m);if(!n.interrupt||m===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),l(m)}return r(m)}function l(m){return $6(m)&&++s<10?(e.consume(m),l):(!n.interrupt||s<2)&&(n.containerState.marker?m===n.containerState.marker:m===41||m===46)?(e.exit("listItemValue"),c(m)):r(m)}function c(m){return e.enter("listItemMarker"),e.consume(m),e.exit("listItemMarker"),n.containerState.marker=n.containerState.marker||m,e.check(Jh,n.interrupt?r:d,e.attempt(Rge,h,p))}function d(m){return n.containerState.initialBlankLine=!0,i++,h(m)}function p(m){return zt(m)?(e.enter("listItemPrefixWhitespace"),e.consume(m),e.exit("listItemPrefixWhitespace"),h):r(m)}function h(m){return n.containerState.size=i+n.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(m)}}function Lge(e,t,r){const n=this;return n.containerState._closeFlow=void 0,e.check(Jh,a,i);function a(o){return n.containerState.furtherBlankLines=n.containerState.furtherBlankLines||n.containerState.initialBlankLine,Ft(e,t,"listItemIndent",n.containerState.size+1)(o)}function i(o){return n.containerState.furtherBlankLines||!zt(o)?(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,s(o)):(n.containerState.furtherBlankLines=void 0,n.containerState.initialBlankLine=void 0,e.attempt(Ige,t,s)(o))}function s(o){return n.containerState._closeFlow=!0,n.interrupt=void 0,Ft(e,e.attempt(wa,t,r),"linePrefix",n.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function Dge(e,t,r){const n=this;return Ft(e,a,"listItemIndent",n.containerState.size+1);function a(i){const s=n.events[n.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===n.containerState.size?t(i):r(i)}}function Mge(e){e.exit(this.containerState.type)}function Pge(e,t,r){const n=this;return Ft(e,a,"listItemPrefixWhitespace",n.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(i){const s=n.events[n.events.length-1];return!zt(i)&&s&&s[1].type==="listItemPrefixWhitespace"?t(i):r(i)}}const wP={name:"setextUnderline",resolveTo:Fge,tokenize:$ge};function Fge(e,t){let r=e.length,n,a,i;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){n=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&e.splice(r,1),!i&&e[r][1].type==="definition"&&(i=r);const s={type:"setextHeading",start:{...e[n][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",i?(e.splice(a,0,["enter",s,t]),e.splice(i+1,0,["exit",e[n][1],t]),e[n][1].end={...e[i][1].end}):e[n][1]=s,e.push(["exit",s,t]),e}function $ge(e,t,r){const n=this;let a;return i;function i(c){let d=n.events.length,p;for(;d--;)if(n.events[d][1].type!=="lineEnding"&&n.events[d][1].type!=="linePrefix"&&n.events[d][1].type!=="content"){p=n.events[d][1].type==="paragraph";break}return!n.parser.lazy[n.now().line]&&(n.interrupt||p)?(e.enter("setextHeadingLine"),a=c,s(c)):r(c)}function s(c){return e.enter("setextHeadingLineSequence"),o(c)}function o(c){return c===a?(e.consume(c),o):(e.exit("setextHeadingLineSequence"),zt(c)?Ft(e,l,"lineSuffix")(c):l(c))}function l(c){return c===null||ut(c)?(e.exit("setextHeadingLine"),t(c)):r(c)}}const Bge={tokenize:Uge};function Uge(e){const t=this,r=e.attempt(Jh,n,e.attempt(this.parser.constructs.flowInitial,a,Ft(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Gme,a)),"linePrefix")));return r;function n(i){if(i===null){e.consume(i);return}return e.enter("lineEndingBlank"),e.consume(i),e.exit("lineEndingBlank"),t.currentConstruct=void 0,r}function a(i){if(i===null){e.consume(i);return}return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),t.currentConstruct=void 0,r}}const zge={resolveAll:Nee()},qge=Cee("string"),jge=Cee("text");function Cee(e){return{resolveAll:Nee(e==="text"?Hge:void 0),tokenize:t};function t(r){const n=this,a=this.parser.constructs[e],i=r.attempt(a,s,o);return s;function s(d){return c(d)?i(d):o(d)}function o(d){if(d===null){r.consume(d);return}return r.enter("data"),r.consume(d),l}function l(d){return c(d)?(r.exit("data"),i(d)):(r.consume(d),l)}function c(d){if(d===null)return!0;const p=a[d];let h=-1;if(p)for(;++h<p.length;){const m=p[h];if(!m.previous||m.previous.call(n,n.previous))return!0}return!1}}}function Nee(e){return t;function t(r,n){let a=-1,i;for(;++a<=r.length;)i===void 0?r[a]&&r[a][1].type==="data"&&(i=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==i+2&&(r[i][1].end=r[a-1][1].end,r.splice(i+2,a-i-2),a=i+2),i=void 0);return e?e(r,n):r}}function Hge(e,t){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const n=e[r-1][1],a=t.sliceStream(n);let i=a.length,s=-1,o=0,l;for(;i--;){const c=a[i];if(typeof c=="string"){for(s=c.length;c.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(c===-2)l=!0,o++;else if(c!==-1){i++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(o=0),o){const c={type:r===e.length||l||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:i?s:n.start._bufferIndex+s,_index:n.start._index+i,line:n.end.line,column:n.end.column-o,offset:n.end.offset-o},end:{...n.end}};n.end={...c.start},n.start.offset===n.end.offset?Object.assign(n,c):(e.splice(r,0,["enter",c,t],["exit",c,t]),r+=2)}r++}return e}const Gge={42:wa,43:wa,45:wa,48:wa,49:wa,50:wa,51:wa,52:wa,53:wa,54:wa,55:wa,56:wa,57:wa,62:_ee},Vge={91:Xme},Yge={[-2]:pS,[-1]:pS,32:pS},Wge={35:rge,42:kb,45:[wP,kb],60:sge,61:wP,95:kb,96:_P,126:_P},Kge={38:wee,92:See},Xge={[-5]:hS,[-4]:hS,[-3]:hS,33:Tge,38:wee,42:B6,60:[Ame,pge],91:Age,92:[ege,See],93:xI,95:B6,96:Bme},Zge={null:[B6,zge]},Qge={null:[42,95]},Jge={null:[]},ebe=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Qge,contentInitial:Vge,disable:Jge,document:Gge,flow:Wge,flowInitial:Yge,insideSpan:Zge,string:Kge,text:Xge},Symbol.toStringTag,{value:"Module"}));function tbe(e,t,r){let n={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const a={},i=[];let s=[],o=[];const l={attempt:C(x),check:C(A),consume:v,enter:E,exit:T,interrupt:C(A,{interrupt:!0})},c={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:h,sliceStream:m,write:p};let d=t.tokenize.call(c,l);return t.resolveAll&&i.push(t),c;function p(B){return s=ci(s,B),_(),s[s.length-1]!==null?[]:(I(t,0),c.events=cy(i,c.events,c),c.events)}function h(B,V){return nbe(m(B),V)}function m(B){return rbe(s,B)}function b(){const{_bufferIndex:B,_index:V,line:q,column:$,offset:W}=n;return{_bufferIndex:B,_index:V,line:q,column:$,offset:W}}function w(B){a[B.line]=B.column,M()}function _(){let B;for(;n._index<s.length;){const V=s[n._index];if(typeof V=="string")for(B=n._index,n._bufferIndex<0&&(n._bufferIndex=0);n._index===B&&n._bufferIndex<V.length;)S(V.charCodeAt(n._bufferIndex));else S(V)}}function S(B){d=d(B)}function v(B){ut(B)?(n.line++,n.column=1,n.offset+=B===-3?2:1,M()):B!==-1&&(n.column++,n.offset++),n._bufferIndex<0?n._index++:(n._bufferIndex++,n._bufferIndex===s[n._index].length&&(n._bufferIndex=-1,n._index++)),c.previous=B}function E(B,V){const q=V||{};return q.type=B,q.start=b(),c.events.push(["enter",q,c]),o.push(q),q}function T(B){const V=o.pop();return V.end=b(),c.events.push(["exit",V,c]),V}function x(B,V){I(B,V.from)}function A(B,V){V.restore()}function C(B,V){return q;function q($,W,Y){let X,K,ne,j;return Array.isArray($)?Q($):"tokenize"in $?Q([$]):U($);function U(J){return ue;function ue(me){const fe=me!==null&&J[me],Ee=me!==null&&J.null,ie=[...Array.isArray(fe)?fe:fe?[fe]:[],...Array.isArray(Ee)?Ee:Ee?[Ee]:[]];return Q(ie)(me)}}function Q(J){return X=J,K=0,J.length===0?Y:D(J[K])}function D(J){return ue;function ue(me){return j=L(),ne=J,J.partial||(c.currentConstruct=J),J.name&&c.parser.constructs.disable.null.includes(J.name)?G():J.tokenize.call(V?Object.assign(Object.create(c),V):c,l,F,G)(me)}}function F(J){return B(ne,j),W}function G(J){return j.restore(),++K<X.length?D(X[K]):Y}}}function I(B,V){B.resolveAll&&!i.includes(B)&&i.push(B),B.resolve&&Wa(c.events,V,c.events.length-V,B.resolve(c.events.slice(V),c)),B.resolveTo&&(c.events=B.resolveTo(c.events,c))}function L(){const B=b(),V=c.previous,q=c.currentConstruct,$=c.events.length,W=Array.from(o);return{from:$,restore:Y};function Y(){n=B,c.previous=V,c.currentConstruct=q,c.events.length=$,o=W,M()}}function M(){n.line in a&&n.column<2&&(n.column=a[n.line],n.offset+=a[n.line]-1)}}function rbe(e,t){const r=t.start._index,n=t.start._bufferIndex,a=t.end._index,i=t.end._bufferIndex;let s;if(r===a)s=[e[r].slice(n,i)];else{if(s=e.slice(r,a),n>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(n):s.shift()}i>0&&s.push(e[a].slice(0,i))}return s}function nbe(e,t){let r=-1;const n=[];let a;for(;++r<e.length;){const i=e[r];let s;if(typeof i=="string")s=i;else switch(i){case-5:{s="\r";break}case-4:{s=`
63
63
  `;break}case-3:{s=`\r
64
64
  `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&a)continue;s=" ";break}default:s=String.fromCharCode(i)}a=i===-2,n.push(s)}return n.join("")}function abe(e){const n={constructs:vee([ebe,...(e||{}).extensions||[]]),content:a(vme),defined:[],document:a(_me),flow:a(Bge),lazy:{},string:a(qge),text:a(jge)};return n;function a(i){return s;function s(o){return tbe(n,i,o)}}}function ibe(e){for(;!Tee(e););return e}const TP=/[\0\t\n\r]/g;function sbe(){let e=1,t="",r=!0,n;return a;function a(i,s,o){const l=[];let c,d,p,h,m;for(i=t+(typeof i=="string"?i.toString():new TextDecoder(s||void 0).decode(i)),p=0,t="",r&&(i.charCodeAt(0)===65279&&p++,r=void 0);p<i.length;){if(TP.lastIndex=p,c=TP.exec(i),h=c&&c.index!==void 0?c.index:i.length,m=i.charCodeAt(h),!c){t=i.slice(p);break}if(m===10&&p===h&&n)l.push(-3),n=void 0;else switch(n&&(l.push(-5),n=void 0),p<h&&(l.push(i.slice(p,h)),e+=h-p),m){case 0:{l.push(65533),e++;break}case 9:{for(d=Math.ceil(e/4)*4,l.push(-2);e++<d;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:n=!0,e=1}p=h+1}return o&&(n&&l.push(-5),t&&l.push(t),l.push(null)),l}}const obe=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function lbe(e){return e.replace(obe,ube)}function ube(e,t,r){if(t)return t;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),i=a===120||a===88;return Eee(r.slice(i?2:1),i?16:10)}return TI(r)||e}const Ree={}.hasOwnProperty;function cbe(e,t,r){return typeof t!="string"&&(r=t,t=void 0),dbe(r)(ibe(abe(r).document().write(sbe()(e,t,!0))))}function dbe(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:i(rt),autolinkProtocol:L,autolinkEmail:L,atxHeading:i(Ne),blockQuote:i(Ee),characterEscape:L,characterReference:L,codeFenced:i(ie),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:i(ie,s),codeText:i(oe,s),codeTextData:L,data:L,codeFlowValue:L,definition:i(ye),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:i(Te),hardBreakEscape:i(Me),hardBreakTrailing:i(Me),htmlFlow:i(Ye,s),htmlFlowData:L,htmlText:i(Ye,s),htmlTextData:L,image:i(dt),label:s,link:i(rt),listItem:i(St),listItemValue:h,listOrdered:i(yt,p),listUnordered:i(yt),paragraph:i(Ke),reference:D,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:i(Ne),strong:i(ct),thematicBreak:i(xt)},exit:{atxHeading:l(),atxHeadingSequence:x,autolink:l(),autolinkEmail:fe,autolinkProtocol:me,blockQuote:l(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:G,characterReferenceMarkerNumeric:G,characterReferenceValue:J,characterReference:ue,codeFenced:l(_),codeFencedFence:w,codeFencedFenceInfo:m,codeFencedFenceMeta:b,codeFlowValue:M,codeIndented:l(S),codeText:l(W),codeTextData:M,data:M,definition:l(),definitionDestinationString:T,definitionLabelString:v,definitionTitleString:E,emphasis:l(),hardBreakEscape:l(V),hardBreakTrailing:l(V),htmlFlow:l(q),htmlFlowData:M,htmlText:l($),htmlTextData:M,image:l(X),label:ne,labelText:K,lineEnding:B,link:l(Y),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:F,resourceDestinationString:j,resourceTitleString:U,resource:Q,setextHeading:l(I),setextHeadingLineSequence:C,setextHeadingText:A,strong:l(),thematicBreak:l()}};Iee(t,(e||{}).mdastExtensions||[]);const r={};return n;function n(ke){let Le={type:"root",children:[]};const Ge={stack:[Le],tokenStack:[],config:t,enter:o,exit:c,buffer:s,resume:d,data:r},nt=[];let vt=-1;for(;++vt<ke.length;)if(ke[vt][1].type==="listOrdered"||ke[vt][1].type==="listUnordered")if(ke[vt][0]==="enter")nt.push(vt);else{const Pr=nt.pop();vt=a(ke,Pr,vt)}for(vt=-1;++vt<ke.length;){const Pr=t[ke[vt][0]];Ree.call(Pr,ke[vt][1].type)&&Pr[ke[vt][1].type].call(Object.assign({sliceSerialize:ke[vt][2].sliceSerialize},Ge),ke[vt][1])}if(Ge.tokenStack.length>0){const Pr=Ge.tokenStack[Ge.tokenStack.length-1];(Pr[1]||xP).call(Ge,void 0,Pr[0])}for(Le.position={start:fl(ke.length>0?ke[0][1].start:{line:1,column:1,offset:0}),end:fl(ke.length>0?ke[ke.length-2][1].end:{line:1,column:1,offset:0})},vt=-1;++vt<t.transforms.length;)Le=t.transforms[vt](Le)||Le;return Le}function a(ke,Le,Ge){let nt=Le-1,vt=-1,Pr=!1,ur,Yt,Ot,cr;for(;++nt<=Ge;){const Gt=ke[nt];switch(Gt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Gt[0]==="enter"?vt++:vt--,cr=void 0;break}case"lineEndingBlank":{Gt[0]==="enter"&&(ur&&!cr&&!vt&&!Ot&&(Ot=nt),cr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:cr=void 0}if(!vt&&Gt[0]==="enter"&&Gt[1].type==="listItemPrefix"||vt===-1&&Gt[0]==="exit"&&(Gt[1].type==="listUnordered"||Gt[1].type==="listOrdered")){if(ur){let In=nt;for(Yt=void 0;In--;){const Vr=ke[In];if(Vr[1].type==="lineEnding"||Vr[1].type==="lineEndingBlank"){if(Vr[0]==="exit")continue;Yt&&(ke[Yt][1].type="lineEndingBlank",Pr=!0),Vr[1].type="lineEnding",Yt=In}else if(!(Vr[1].type==="linePrefix"||Vr[1].type==="blockQuotePrefix"||Vr[1].type==="blockQuotePrefixWhitespace"||Vr[1].type==="blockQuoteMarker"||Vr[1].type==="listItemIndent"))break}Ot&&(!Yt||Ot<Yt)&&(ur._spread=!0),ur.end=Object.assign({},Yt?ke[Yt][1].start:Gt[1].end),ke.splice(Yt||nt,0,["exit",ur,Gt[2]]),nt++,Ge++}if(Gt[1].type==="listItemPrefix"){const In={type:"listItem",_spread:!1,start:Object.assign({},Gt[1].start),end:void 0};ur=In,ke.splice(nt,0,["enter",In,Gt[2]]),nt++,Ge++,Ot=void 0,cr=!0}}}return ke[Le][1]._spread=Pr,Ge}function i(ke,Le){return Ge;function Ge(nt){o.call(this,ke(nt),nt),Le&&Le.call(this,nt)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(ke,Le,Ge){this.stack[this.stack.length-1].children.push(ke),this.stack.push(ke),this.tokenStack.push([Le,Ge||void 0]),ke.position={start:fl(Le.start),end:void 0}}function l(ke){return Le;function Le(Ge){ke&&ke.call(this,Ge),c.call(this,Ge)}}function c(ke,Le){const Ge=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==ke.type&&(Le?Le.call(this,ke,nt[0]):(nt[1]||xP).call(this,ke,nt[0]));else throw new Error("Cannot close `"+ke.type+"` ("+Yp({start:ke.start,end:ke.end})+"): it’s not open");Ge.position.end=fl(ke.end)}function d(){return wI(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function h(ke){if(this.data.expectingFirstListItemValue){const Le=this.stack[this.stack.length-2];Le.start=Number.parseInt(this.sliceSerialize(ke),10),this.data.expectingFirstListItemValue=void 0}}function m(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.lang=ke}function b(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.meta=ke}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ke.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ke.replace(/(\r?\n|\r)$/g,"")}function v(ke){const Le=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Le,Ge.identifier=Ui(this.sliceSerialize(ke)).toLowerCase()}function E(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.title=ke}function T(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.url=ke}function x(ke){const Le=this.stack[this.stack.length-1];if(!Le.depth){const Ge=this.sliceSerialize(ke).length;Le.depth=Ge}}function A(){this.data.setextHeadingSlurpLineEnding=!0}function C(ke){const Le=this.stack[this.stack.length-1];Le.depth=this.sliceSerialize(ke).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function L(ke){const Ge=this.stack[this.stack.length-1].children;let nt=Ge[Ge.length-1];(!nt||nt.type!=="text")&&(nt=Et(),nt.position={start:fl(ke.start),end:void 0},Ge.push(nt)),this.stack.push(nt)}function M(ke){const Le=this.stack.pop();Le.value+=this.sliceSerialize(ke),Le.position.end=fl(ke.end)}function B(ke){const Le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ge=Le.children[Le.children.length-1];Ge.position.end=fl(ke.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Le.type)&&(L.call(this,ke),M.call(this,ke))}function V(){this.data.atHardBreak=!0}function q(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ke}function $(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ke}function W(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ke}function Y(){const ke=this.stack[this.stack.length-1];if(this.data.inReference){const Le=this.data.referenceType||"shortcut";ke.type+="Reference",ke.referenceType=Le,delete ke.url,delete ke.title}else delete ke.identifier,delete ke.label;this.data.referenceType=void 0}function X(){const ke=this.stack[this.stack.length-1];if(this.data.inReference){const Le=this.data.referenceType||"shortcut";ke.type+="Reference",ke.referenceType=Le,delete ke.url,delete ke.title}else delete ke.identifier,delete ke.label;this.data.referenceType=void 0}function K(ke){const Le=this.sliceSerialize(ke),Ge=this.stack[this.stack.length-2];Ge.label=lbe(Le),Ge.identifier=Ui(Le).toLowerCase()}function ne(){const ke=this.stack[this.stack.length-1],Le=this.resume(),Ge=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ge.type==="link"){const nt=ke.children;Ge.children=nt}else Ge.alt=Le}function j(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.url=ke}function U(){const ke=this.resume(),Le=this.stack[this.stack.length-1];Le.title=ke}function Q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function F(ke){const Le=this.resume(),Ge=this.stack[this.stack.length-1];Ge.label=Le,Ge.identifier=Ui(this.sliceSerialize(ke)).toLowerCase(),this.data.referenceType="full"}function G(ke){this.data.characterReferenceType=ke.type}function J(ke){const Le=this.sliceSerialize(ke),Ge=this.data.characterReferenceType;let nt;Ge?(nt=Eee(Le,Ge==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=TI(Le);const vt=this.stack[this.stack.length-1];vt.value+=nt}function ue(ke){const Le=this.stack.pop();Le.position.end=fl(ke.end)}function me(ke){M.call(this,ke);const Le=this.stack[this.stack.length-1];Le.url=this.sliceSerialize(ke)}function fe(ke){M.call(this,ke);const Le=this.stack[this.stack.length-1];Le.url="mailto:"+this.sliceSerialize(ke)}function Ee(){return{type:"blockquote",children:[]}}function ie(){return{type:"code",lang:null,meta:null,value:""}}function oe(){return{type:"inlineCode",value:""}}function ye(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Te(){return{type:"emphasis",children:[]}}function Ne(){return{type:"heading",depth:0,children:[]}}function Me(){return{type:"break"}}function Ye(){return{type:"html",value:""}}function dt(){return{type:"image",title:null,url:"",alt:null}}function rt(){return{type:"link",title:null,url:"",children:[]}}function yt(ke){return{type:"list",ordered:ke.type==="listOrdered",start:null,spread:ke._spread,children:[]}}function St(ke){return{type:"listItem",spread:ke._spread,checked:null,children:[]}}function Ke(){return{type:"paragraph",children:[]}}function ct(){return{type:"strong",children:[]}}function Et(){return{type:"text",value:""}}function xt(){return{type:"thematicBreak"}}}function fl(e){return{line:e.line,column:e.column,offset:e.offset}}function Iee(e,t){let r=-1;for(;++r<t.length;){const n=t[r];Array.isArray(n)?Iee(e,n):fbe(e,n)}}function fbe(e,t){let r;for(r in t)if(Ree.call(t,r))switch(r){case"canContainEols":{const n=t[r];n&&e[r].push(...n);break}case"transforms":{const n=t[r];n&&e[r].push(...n);break}case"enter":case"exit":{const n=t[r];n&&Object.assign(e[r],n);break}}}function xP(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Yp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Yp({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Yp({start:t.start,end:t.end})+") is still open")}function pbe(e){const t=this;t.parser=r;function r(n){return cbe(n,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function hbe(e,t){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,r),e.applyData(t,r)}function mbe(e,t){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,r),[e.applyData(t,r),{type:"text",value:`
@@ -598,7 +598,7 @@ ${t}</tr>
598
598
  `}tablecell(t){let r=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+r+`</${n}>
599
599
  `}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${as(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:r,tokens:n}){let a=this.parser.parseInline(n),i=H$(t);if(i===null)return a;t=i;let s='<a href="'+t+'"';return r&&(s+=' title="'+as(r)+'"'),s+=">"+a+"</a>",s}image({href:t,title:r,text:n,tokens:a}){a&&(n=this.parser.parseInline(a,this.parser.textRenderer));let i=H$(t);if(i===null)return as(n);t=i;let s=`<img src="${t}" alt="${n}"`;return r&&(s+=` title="${as(r)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:as(t.text)}},LO=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}},Mi=class A5{options;renderer;textRenderer;constructor(t){this.options=t||Qu,this.options.renderer=this.options.renderer||new k1,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new LO}static parse(t,r){return new A5(r).parse(t)}static parseInline(t,r){return new A5(r).parseInline(t)}parse(t,r=!0){let n="";for(let a=0;a<t.length;a++){let i=t[a];if(this.options.extensions?.renderers?.[i.type]){let o=i,l=this.options.extensions.renderers[o.type].call({parser:this},o);if(l!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=l||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);continue}case"hr":{n+=this.renderer.hr(s);continue}case"heading":{n+=this.renderer.heading(s);continue}case"code":{n+=this.renderer.code(s);continue}case"table":{n+=this.renderer.table(s);continue}case"blockquote":{n+=this.renderer.blockquote(s);continue}case"list":{n+=this.renderer.list(s);continue}case"html":{n+=this.renderer.html(s);continue}case"def":{n+=this.renderer.def(s);continue}case"paragraph":{n+=this.renderer.paragraph(s);continue}case"text":{let o=s,l=this.renderer.text(o);for(;a+1<t.length&&t[a+1].type==="text";)o=t[++a],l+=`
600
600
  `+this.renderer.text(o);r?n+=this.renderer.paragraph({type:"paragraph",raw:l,text:l,tokens:[{type:"text",raw:l,text:l,escaped:!0}]}):n+=l;continue}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}parseInline(t,r=this.renderer){let n="";for(let a=0;a<t.length;a++){let i=t[a];if(this.options.extensions?.renderers?.[i.type]){let o=this.options.extensions.renderers[i.type].call({parser:this},i);if(o!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=o||"";continue}}let s=i;switch(s.type){case"escape":{n+=r.text(s);break}case"html":{n+=r.html(s);break}case"link":{n+=r.link(s);break}case"image":{n+=r.image(s);break}case"strong":{n+=r.strong(s);break}case"em":{n+=r.em(s);break}case"codespan":{n+=r.codespan(s);break}case"br":{n+=r.br(s);break}case"del":{n+=r.del(s);break}case"text":{n+=r.text(s);break}default:{let o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}return n}},Up=class{options;block;constructor(t){this.options=t||Qu}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(){return this.block?fi.lex:fi.lexInline}provideParser(){return this.block?Mi.parse:Mi.parseInline}},cCe=class{defaults=xO();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Mi;Renderer=k1;TextRenderer=LO;Lexer=fi;Tokenizer=A1;Hooks=Up;constructor(...t){this.use(...t)}walkTokens(t,r){let n=[];for(let a of t)switch(n=n.concat(r.call(this,a)),a.type){case"table":{let i=a;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,r));for(let s of i.rows)for(let o of s)n=n.concat(this.walkTokens(o.tokens,r));break}case"list":{let i=a;n=n.concat(this.walkTokens(i.items,r));break}default:{let i=a;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let o=i[s].flat(1/0);n=n.concat(this.walkTokens(o,r))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,r)))}}return n}use(...t){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let a={...n};if(a.async=this.defaults.async||a.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=r.renderers[i.name];s?r.renderers[i.name]=function(...o){let l=i.renderer.apply(this,o);return l===!1&&(l=s.apply(this,o)),l}:r.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=r[i.level];s?s.unshift(i.tokenizer):r[i.level]=[i.tokenizer],i.start&&(i.level==="block"?r.startBlock?r.startBlock.push(i.start):r.startBlock=[i.start]:i.level==="inline"&&(r.startInline?r.startInline.push(i.start):r.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(r.childTokens[i.name]=i.childTokens)}),a.extensions=r),n.renderer){let i=this.defaults.renderer||new k1(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let o=s,l=n.renderer[o],c=i[o];i[o]=(...d)=>{let p=l.apply(i,d);return p===!1&&(p=c.apply(i,d)),p||""}}a.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new A1(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let o=s,l=n.tokenizer[o],c=i[o];i[o]=(...d)=>{let p=l.apply(i,d);return p===!1&&(p=c.apply(i,d)),p}}a.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new Up;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let o=s,l=n.hooks[o],c=i[o];Up.passThroughHooks.has(s)?i[o]=d=>{if(this.defaults.async&&Up.passThroughHooksRespectAsync.has(s))return(async()=>{let h=await l.call(i,d);return c.call(i,h)})();let p=l.call(i,d);return c.call(i,p)}:i[o]=(...d)=>{if(this.defaults.async)return(async()=>{let h=await l.apply(i,d);return h===!1&&(h=await c.apply(i,d)),h})();let p=l.apply(i,d);return p===!1&&(p=c.apply(i,d)),p}}a.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;a.walkTokens=function(o){let l=[];return l.push(s.call(this,o)),i&&(l=l.concat(i.call(this,o))),l}}this.defaults={...this.defaults,...a}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,r){return fi.lex(t,r??this.defaults)}parser(t,r){return Mi.parse(t,r??this.defaults)}parseMarkdown(t){return(r,n)=>{let a={...n},i={...this.defaults,...a},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&a.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let o=i.hooks?await i.hooks.preprocess(r):r,l=await(i.hooks?await i.hooks.provideLexer():t?fi.lex:fi.lexInline)(o,i),c=i.hooks?await i.hooks.processAllTokens(l):l;i.walkTokens&&await Promise.all(this.walkTokens(c,i.walkTokens));let d=await(i.hooks?await i.hooks.provideParser():t?Mi.parse:Mi.parseInline)(c,i);return i.hooks?await i.hooks.postprocess(d):d})().catch(s);try{i.hooks&&(r=i.hooks.preprocess(r));let o=(i.hooks?i.hooks.provideLexer():t?fi.lex:fi.lexInline)(r,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let l=(i.hooks?i.hooks.provideParser():t?Mi.parse:Mi.parseInline)(o,i);return i.hooks&&(l=i.hooks.postprocess(l)),l}catch(o){return s(o)}}}onError(t,r){return n=>{if(n.message+=`
601
- Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+as(n.message+"",!0)+"</pre>";return r?Promise.resolve(a):a}if(r)return Promise.reject(n);throw n}}},Uu=new cCe;function vr(e,t){return Uu.parse(e,t)}vr.options=vr.setOptions=function(e){return Uu.setOptions(e),vr.defaults=Uu.defaults,mae(vr.defaults),vr};vr.getDefaults=xO;vr.defaults=Qu;vr.use=function(...e){return Uu.use(...e),vr.defaults=Uu.defaults,mae(vr.defaults),vr};vr.walkTokens=function(e,t){return Uu.walkTokens(e,t)};vr.parseInline=Uu.parseInline;vr.Parser=Mi;vr.parser=Mi.parse;vr.Renderer=k1;vr.TextRenderer=LO;vr.Lexer=fi;vr.lexer=fi.lex;vr.Tokenizer=A1;vr.Hooks=Up;vr.parse=vr;vr.options;vr.setOptions;vr.use;vr.walkTokens;vr.parseInline;Mi.parse;fi.lex;var Ht=(...e)=>nee(VJ(e)),DO=(e,t,r)=>{let n=typeof t=="string"?new Blob([t],{type:r}):t,a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)},dCe=/<pre(\s|>)/,MO=re.createContext({code:""}),fCe=class{constructor(){this.lightHighlighter=null,this.darkHighlighter=null,this.lightTheme=null,this.darkTheme=null,this.loadedLanguages=new Set,this.initializationPromise=null}isLanguageSupported(t){return Object.hasOwn(jne,t)}getFallbackLanguage(){return"text"}async ensureHighlightersInitialized(t,r){var n,a;let[i,s]=t,o=C3e({forgiving:!0}),l=!this.lightHighlighter||this.lightTheme!==i,c=!this.darkHighlighter||this.darkTheme!==s;(l||c)&&this.loadedLanguages.clear();let d=this.isLanguageSupported(r),p=!this.loadedLanguages.has(r)&&d;if(l?(this.lightHighlighter=await E$({themes:[i],langs:d?[r]:[],engine:o}),this.lightTheme=i,d&&this.loadedLanguages.add(r)):p&&await((n=this.lightHighlighter)==null?void 0:n.loadLanguage(r)),c){let h=p?[...this.loadedLanguages].concat(d?[r]:[]):Array.from(this.loadedLanguages);this.darkHighlighter=await E$({themes:[s],langs:h.length>0?h:d?[r]:[],engine:o}),this.darkTheme=s}else p&&await((a=this.darkHighlighter)==null?void 0:a.loadLanguage(r));p&&this.loadedLanguages.add(r)}async highlightCode(t,r,n,a){var i,s;this.initializationPromise&&await this.initializationPromise,this.initializationPromise=this.ensureHighlightersInitialized(n,r),await this.initializationPromise,this.initializationPromise=null;let[o,l]=n,c=this.isLanguageSupported(r)?r:this.getFallbackLanguage(),d=(i=this.lightHighlighter)==null?void 0:i.codeToHtml(t,{lang:c,theme:o}),p=(s=this.darkHighlighter)==null?void 0:s.codeToHtml(t,{lang:c,theme:l}),h=m=>a?m.replace(dCe,`<pre class="${a}"$1`):m;return[h(d),h(p)]}},pCe=new fCe,hCe=({code:e,language:t,className:r,children:n,preClassName:a,...i})=>{let[s,o]=re.useState(""),[l,c]=re.useState(""),d=re.useRef(!1),[p,h]=re.useContext(eie);return re.useEffect(()=>(d.current=!0,pCe.highlightCode(e,t,[p,h],a).then(([m,b])=>{d.current&&(o(m),c(b))}),()=>{d.current=!1}),[e,t,p,h,a]),R.jsx(MO.Provider,{value:{code:e},children:R.jsxs("div",{className:"my-4 w-full overflow-hidden rounded-xl border","data-code-block-container":!0,"data-language":t,children:[R.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-code-block-header":!0,"data-language":t,children:[R.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),R.jsx("div",{className:"flex items-center gap-2",children:n})]}),R.jsx("div",{className:"w-full",children:R.jsxs("div",{className:"min-w-full",children:[R.jsx("div",{className:Ht("overflow-x-auto dark:hidden",r),dangerouslySetInnerHTML:{__html:s},"data-code-block":!0,"data-language":t,...i}),R.jsx("div",{className:Ht("hidden overflow-x-auto dark:block",r),dangerouslySetInnerHTML:{__html:l},"data-code-block":!0,"data-language":t,...i})]})})]})})},Y$={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},W$=({onDownload:e,onError:t,language:r,children:n,className:a,code:i,...s})=>{let{code:o}=re.useContext(MO),{isAnimating:l}=re.useContext(d0),c=i??o,d=`file.${r&&r in Y$?Y$[r]:"txt"}`,p="text/plain",h=()=>{try{DO(d,c,p),e?.()}catch(m){t?.(m)}};return R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:l,onClick:h,title:"Download file",type:"button",...s,children:n??R.jsx(dO,{size:14})})},K$=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:a,code:i,...s})=>{let[o,l]=re.useState(!1),c=re.useRef(0),{code:d}=re.useContext(MO),{isAnimating:p}=re.useContext(d0),h=i??d,m=async()=>{var w;if(typeof window>"u"||!((w=navigator?.clipboard)!=null&&w.writeText)){t?.(new Error("Clipboard API not available"));return}try{o||(await navigator.clipboard.writeText(h),l(!0),e?.(),c.current=window.setTimeout(()=>l(!1),r))}catch(_){t?.(_)}};re.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let b=o?dne:fne;return R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:p,onClick:m,type:"button",...s,children:n??R.jsx(b,{size:14})})},mCe=({node:e,className:t,src:r,alt:n,...a})=>{let i=async()=>{var s;if(r)try{let o=await(await fetch(r)).blob(),l=new URL(r,window.location.origin).pathname.split("/").pop()||"",c=l.includes(".")&&((s=l.split(".").pop())==null?void 0:s.length)<=4,d="";if(c)d=l;else{let p=o.type,h="png";p.includes("jpeg")||p.includes("jpg")?h="jpg":p.includes("png")?h="png":p.includes("svg")?h="svg":p.includes("gif")?h="gif":p.includes("webp")&&(h="webp"),d=`${(n||l||"image").replace(/\.[^/.]+$/,"")}.${h}`}DO(d,o,o.type)}catch(o){console.error("Failed to download image:",o)}};return r?R.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[R.jsx("img",{alt:n,className:Ht("max-w-full rounded-lg",t),"data-streamdown":"image",src:r,...a}),R.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),R.jsx("button",{className:Ht("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:i,title:"Download image",type:"button",children:R.jsx(dO,{size:14})})]}):null},gCe=async e=>{let t={startOnLoad:!1,theme:"default",securityLevel:"strict",fontFamily:"monospace",suppressErrorRendering:!0,...e},r=(await se(async()=>{const{default:n}=await import("./mermaid.core-C74BWk1B.js").then(a=>a.aI);return{default:n}},[])).default;return r.initialize(t),r},bCe=({chart:e,className:t,config:r})=>{let[n,a]=re.useState(null),[i,s]=re.useState(!0),[o,l]=re.useState(""),[c,d]=re.useState("");if(re.useEffect(()=>{(async()=>{try{a(null),s(!0);let h=await gCe(r),m=e.split("").reduce((_,S)=>(_<<5)-_+S.charCodeAt(0)|0,0),b=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:w}=await h.render(b,e);l(w),d(w)}catch(h){if(!(c||o)){let m=h instanceof Error?h.message:"Failed to render Mermaid chart";a(m)}}finally{s(!1)}})()},[e,r]),i&&!o&&!c)return R.jsx("div",{className:Ht("my-4 flex justify-center p-4",t),children:R.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[R.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),R.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(n&&!o&&!c)return R.jsxs("div",{className:Ht("rounded-lg border border-red-200 bg-red-50 p-4",t),children:[R.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",n]}),R.jsxs("details",{className:"mt-2",children:[R.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),R.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let p=o||c;return R.jsx("div",{"aria-label":"Mermaid chart",className:Ht("my-4 flex justify-center",t),dangerouslySetInnerHTML:{__html:p},role:"img"})};function Aae(e){var t,r;let n=[],a=[],i=e.querySelectorAll("thead th");for(let o of i)n.push(((t=o.textContent)==null?void 0:t.trim())||"");let s=e.querySelectorAll("tbody tr");for(let o of s){let l=[],c=o.querySelectorAll("td");for(let d of c)l.push(((r=d.textContent)==null?void 0:r.trim())||"");a.push(l)}return{headers:n,rows:a}}function kae(e){let{headers:t,rows:r}=e,n=i=>i.includes(",")||i.includes('"')||i.includes(`
601
+ Please report this to https://github.com/markedjs/marked.`,t){let a="<p>An error occurred:</p><pre>"+as(n.message+"",!0)+"</pre>";return r?Promise.resolve(a):a}if(r)return Promise.reject(n);throw n}}},Uu=new cCe;function vr(e,t){return Uu.parse(e,t)}vr.options=vr.setOptions=function(e){return Uu.setOptions(e),vr.defaults=Uu.defaults,mae(vr.defaults),vr};vr.getDefaults=xO;vr.defaults=Qu;vr.use=function(...e){return Uu.use(...e),vr.defaults=Uu.defaults,mae(vr.defaults),vr};vr.walkTokens=function(e,t){return Uu.walkTokens(e,t)};vr.parseInline=Uu.parseInline;vr.Parser=Mi;vr.parser=Mi.parse;vr.Renderer=k1;vr.TextRenderer=LO;vr.Lexer=fi;vr.lexer=fi.lex;vr.Tokenizer=A1;vr.Hooks=Up;vr.parse=vr;vr.options;vr.setOptions;vr.use;vr.walkTokens;vr.parseInline;Mi.parse;fi.lex;var Ht=(...e)=>nee(VJ(e)),DO=(e,t,r)=>{let n=typeof t=="string"?new Blob([t],{type:r}):t,a=URL.createObjectURL(n),i=document.createElement("a");i.href=a,i.download=e,document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(a)},dCe=/<pre(\s|>)/,MO=re.createContext({code:""}),fCe=class{constructor(){this.lightHighlighter=null,this.darkHighlighter=null,this.lightTheme=null,this.darkTheme=null,this.loadedLanguages=new Set,this.initializationPromise=null}isLanguageSupported(t){return Object.hasOwn(jne,t)}getFallbackLanguage(){return"text"}async ensureHighlightersInitialized(t,r){var n,a;let[i,s]=t,o=C3e({forgiving:!0}),l=!this.lightHighlighter||this.lightTheme!==i,c=!this.darkHighlighter||this.darkTheme!==s;(l||c)&&this.loadedLanguages.clear();let d=this.isLanguageSupported(r),p=!this.loadedLanguages.has(r)&&d;if(l?(this.lightHighlighter=await E$({themes:[i],langs:d?[r]:[],engine:o}),this.lightTheme=i,d&&this.loadedLanguages.add(r)):p&&await((n=this.lightHighlighter)==null?void 0:n.loadLanguage(r)),c){let h=p?[...this.loadedLanguages].concat(d?[r]:[]):Array.from(this.loadedLanguages);this.darkHighlighter=await E$({themes:[s],langs:h.length>0?h:d?[r]:[],engine:o}),this.darkTheme=s}else p&&await((a=this.darkHighlighter)==null?void 0:a.loadLanguage(r));p&&this.loadedLanguages.add(r)}async highlightCode(t,r,n,a){var i,s;this.initializationPromise&&await this.initializationPromise,this.initializationPromise=this.ensureHighlightersInitialized(n,r),await this.initializationPromise,this.initializationPromise=null;let[o,l]=n,c=this.isLanguageSupported(r)?r:this.getFallbackLanguage(),d=(i=this.lightHighlighter)==null?void 0:i.codeToHtml(t,{lang:c,theme:o}),p=(s=this.darkHighlighter)==null?void 0:s.codeToHtml(t,{lang:c,theme:l}),h=m=>a?m.replace(dCe,`<pre class="${a}"$1`):m;return[h(d),h(p)]}},pCe=new fCe,hCe=({code:e,language:t,className:r,children:n,preClassName:a,...i})=>{let[s,o]=re.useState(""),[l,c]=re.useState(""),d=re.useRef(!1),[p,h]=re.useContext(eie);return re.useEffect(()=>(d.current=!0,pCe.highlightCode(e,t,[p,h],a).then(([m,b])=>{d.current&&(o(m),c(b))}),()=>{d.current=!1}),[e,t,p,h,a]),R.jsx(MO.Provider,{value:{code:e},children:R.jsxs("div",{className:"my-4 w-full overflow-hidden rounded-xl border","data-code-block-container":!0,"data-language":t,children:[R.jsxs("div",{className:"flex items-center justify-between bg-muted/80 p-3 text-muted-foreground text-xs","data-code-block-header":!0,"data-language":t,children:[R.jsx("span",{className:"ml-1 font-mono lowercase",children:t}),R.jsx("div",{className:"flex items-center gap-2",children:n})]}),R.jsx("div",{className:"w-full",children:R.jsxs("div",{className:"min-w-full",children:[R.jsx("div",{className:Ht("overflow-x-auto dark:hidden",r),dangerouslySetInnerHTML:{__html:s},"data-code-block":!0,"data-language":t,...i}),R.jsx("div",{className:Ht("hidden overflow-x-auto dark:block",r),dangerouslySetInnerHTML:{__html:l},"data-code-block":!0,"data-language":t,...i})]})})]})})},Y$={"1c":"1c","1c-query":"1cq",abap:"abap","actionscript-3":"as",ada:"ada",adoc:"adoc","angular-html":"html","angular-ts":"ts",apache:"conf",apex:"cls",apl:"apl",applescript:"applescript",ara:"ara",asciidoc:"adoc",asm:"asm",astro:"astro",awk:"awk",ballerina:"bal",bash:"sh",bat:"bat",batch:"bat",be:"be",beancount:"beancount",berry:"berry",bibtex:"bib",bicep:"bicep",blade:"blade.php",bsl:"bsl",c:"c","c#":"cs","c++":"cpp",cadence:"cdc",cairo:"cairo",cdc:"cdc",clarity:"clar",clj:"clj",clojure:"clj","closure-templates":"soy",cmake:"cmake",cmd:"cmd",cobol:"cob",codeowners:"CODEOWNERS",codeql:"ql",coffee:"coffee",coffeescript:"coffee","common-lisp":"lisp",console:"sh",coq:"v",cpp:"cpp",cql:"cql",crystal:"cr",cs:"cs",csharp:"cs",css:"css",csv:"csv",cue:"cue",cypher:"cql",d:"d",dart:"dart",dax:"dax",desktop:"desktop",diff:"diff",docker:"dockerfile",dockerfile:"dockerfile",dotenv:"env","dream-maker":"dm",edge:"edge",elisp:"el",elixir:"ex",elm:"elm","emacs-lisp":"el",erb:"erb",erl:"erl",erlang:"erl",f:"f","f#":"fs",f03:"f03",f08:"f08",f18:"f18",f77:"f77",f90:"f90",f95:"f95",fennel:"fnl",fish:"fish",fluent:"ftl",for:"for","fortran-fixed-form":"f","fortran-free-form":"f90",fs:"fs",fsharp:"fs",fsl:"fsl",ftl:"ftl",gdresource:"tres",gdscript:"gd",gdshader:"gdshader",genie:"gs",gherkin:"feature","git-commit":"gitcommit","git-rebase":"gitrebase",gjs:"js",gleam:"gleam","glimmer-js":"js","glimmer-ts":"ts",glsl:"glsl",gnuplot:"plt",go:"go",gql:"gql",graphql:"graphql",groovy:"groovy",gts:"gts",hack:"hack",haml:"haml",handlebars:"hbs",haskell:"hs",haxe:"hx",hbs:"hbs",hcl:"hcl",hjson:"hjson",hlsl:"hlsl",hs:"hs",html:"html","html-derivative":"html",http:"http",hxml:"hxml",hy:"hy",imba:"imba",ini:"ini",jade:"jade",java:"java",javascript:"js",jinja:"jinja",jison:"jison",jl:"jl",js:"js",json:"json",json5:"json5",jsonc:"jsonc",jsonl:"jsonl",jsonnet:"jsonnet",jssm:"jssm",jsx:"jsx",julia:"jl",kotlin:"kt",kql:"kql",kt:"kt",kts:"kts",kusto:"kql",latex:"tex",lean:"lean",lean4:"lean",less:"less",liquid:"liquid",lisp:"lisp",lit:"lit",llvm:"ll",log:"log",logo:"logo",lua:"lua",luau:"luau",make:"mak",makefile:"mak",markdown:"md",marko:"marko",matlab:"m",md:"md",mdc:"mdc",mdx:"mdx",mediawiki:"wiki",mermaid:"mmd",mips:"s",mipsasm:"s",mmd:"mmd",mojo:"mojo",move:"move",nar:"nar",narrat:"narrat",nextflow:"nf",nf:"nf",nginx:"conf",nim:"nim",nix:"nix",nu:"nu",nushell:"nu",objc:"m","objective-c":"m","objective-cpp":"mm",ocaml:"ml",pascal:"pas",perl:"pl",perl6:"p6",php:"php",plsql:"pls",po:"po",polar:"polar",postcss:"pcss",pot:"pot",potx:"potx",powerquery:"pq",powershell:"ps1",prisma:"prisma",prolog:"pl",properties:"properties",proto:"proto",protobuf:"proto",ps:"ps",ps1:"ps1",pug:"pug",puppet:"pp",purescript:"purs",py:"py",python:"py",ql:"ql",qml:"qml",qmldir:"qmldir",qss:"qss",r:"r",racket:"rkt",raku:"raku",razor:"cshtml",rb:"rb",reg:"reg",regex:"regex",regexp:"regexp",rel:"rel",riscv:"s",rs:"rs",rst:"rst",ruby:"rb",rust:"rs",sas:"sas",sass:"sass",scala:"scala",scheme:"scm",scss:"scss",sdbl:"sdbl",sh:"sh",shader:"shader",shaderlab:"shader",shell:"sh",shellscript:"sh",shellsession:"sh",smalltalk:"st",solidity:"sol",soy:"soy",sparql:"rq",spl:"spl",splunk:"spl",sql:"sql","ssh-config":"config",stata:"do",styl:"styl",stylus:"styl",svelte:"svelte",swift:"swift","system-verilog":"sv",systemd:"service",talon:"talon",talonscript:"talon",tasl:"tasl",tcl:"tcl",templ:"templ",terraform:"tf",tex:"tex",tf:"tf",tfvars:"tfvars",toml:"toml",ts:"ts","ts-tags":"ts",tsp:"tsp",tsv:"tsv",tsx:"tsx",turtle:"ttl",twig:"twig",typ:"typ",typescript:"ts",typespec:"tsp",typst:"typ",v:"v",vala:"vala",vb:"vb",verilog:"v",vhdl:"vhdl",vim:"vim",viml:"vim",vimscript:"vim",vue:"vue","vue-html":"html","vue-vine":"vine",vy:"vy",vyper:"vy",wasm:"wasm",wenyan:"wy",wgsl:"wgsl",wiki:"wiki",wikitext:"wiki",wit:"wit",wl:"wl",wolfram:"wl",xml:"xml",xsl:"xsl",yaml:"yaml",yml:"yml",zenscript:"zs",zig:"zig",zsh:"zsh",文言:"wy"},W$=({onDownload:e,onError:t,language:r,children:n,className:a,code:i,...s})=>{let{code:o}=re.useContext(MO),{isAnimating:l}=re.useContext(d0),c=i??o,d=`file.${r&&r in Y$?Y$[r]:"txt"}`,p="text/plain",h=()=>{try{DO(d,c,p),e?.()}catch(m){t?.(m)}};return R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:l,onClick:h,title:"Download file",type:"button",...s,children:n??R.jsx(dO,{size:14})})},K$=({onCopy:e,onError:t,timeout:r=2e3,children:n,className:a,code:i,...s})=>{let[o,l]=re.useState(!1),c=re.useRef(0),{code:d}=re.useContext(MO),{isAnimating:p}=re.useContext(d0),h=i??d,m=async()=>{var w;if(typeof window>"u"||!((w=navigator?.clipboard)!=null&&w.writeText)){t?.(new Error("Clipboard API not available"));return}try{o||(await navigator.clipboard.writeText(h),l(!0),e?.(),c.current=window.setTimeout(()=>l(!1),r))}catch(_){t?.(_)}};re.useEffect(()=>()=>{window.clearTimeout(c.current)},[]);let b=o?dne:fne;return R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",a),disabled:p,onClick:m,type:"button",...s,children:n??R.jsx(b,{size:14})})},mCe=({node:e,className:t,src:r,alt:n,...a})=>{let i=async()=>{var s;if(r)try{let o=await(await fetch(r)).blob(),l=new URL(r,window.location.origin).pathname.split("/").pop()||"",c=l.includes(".")&&((s=l.split(".").pop())==null?void 0:s.length)<=4,d="";if(c)d=l;else{let p=o.type,h="png";p.includes("jpeg")||p.includes("jpg")?h="jpg":p.includes("png")?h="png":p.includes("svg")?h="svg":p.includes("gif")?h="gif":p.includes("webp")&&(h="webp"),d=`${(n||l||"image").replace(/\.[^/.]+$/,"")}.${h}`}DO(d,o,o.type)}catch(o){console.error("Failed to download image:",o)}};return r?R.jsxs("div",{className:"group relative my-4 inline-block","data-streamdown":"image-wrapper",children:[R.jsx("img",{alt:n,className:Ht("max-w-full rounded-lg",t),"data-streamdown":"image",src:r,...a}),R.jsx("div",{className:"pointer-events-none absolute inset-0 hidden rounded-lg bg-black/10 group-hover:block"}),R.jsx("button",{className:Ht("absolute right-2 bottom-2 flex h-8 w-8 cursor-pointer items-center justify-center rounded-md border border-border bg-background/90 shadow-sm backdrop-blur-sm transition-all duration-200 hover:bg-background","opacity-0 group-hover:opacity-100"),onClick:i,title:"Download image",type:"button",children:R.jsx(dO,{size:14})})]}):null},gCe=async e=>{let t={startOnLoad:!1,theme:"default",securityLevel:"strict",fontFamily:"monospace",suppressErrorRendering:!0,...e},r=(await se(async()=>{const{default:n}=await import("./mermaid.core-Cs0rHKmx.js").then(a=>a.aI);return{default:n}},[])).default;return r.initialize(t),r},bCe=({chart:e,className:t,config:r})=>{let[n,a]=re.useState(null),[i,s]=re.useState(!0),[o,l]=re.useState(""),[c,d]=re.useState("");if(re.useEffect(()=>{(async()=>{try{a(null),s(!0);let h=await gCe(r),m=e.split("").reduce((_,S)=>(_<<5)-_+S.charCodeAt(0)|0,0),b=`mermaid-${Math.abs(m)}-${Date.now()}-${Math.random().toString(36).substring(2,9)}`,{svg:w}=await h.render(b,e);l(w),d(w)}catch(h){if(!(c||o)){let m=h instanceof Error?h.message:"Failed to render Mermaid chart";a(m)}}finally{s(!1)}})()},[e,r]),i&&!o&&!c)return R.jsx("div",{className:Ht("my-4 flex justify-center p-4",t),children:R.jsxs("div",{className:"flex items-center space-x-2 text-muted-foreground",children:[R.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-current border-b-2"}),R.jsx("span",{className:"text-sm",children:"Loading diagram..."})]})});if(n&&!o&&!c)return R.jsxs("div",{className:Ht("rounded-lg border border-red-200 bg-red-50 p-4",t),children:[R.jsxs("p",{className:"font-mono text-red-700 text-sm",children:["Mermaid Error: ",n]}),R.jsxs("details",{className:"mt-2",children:[R.jsx("summary",{className:"cursor-pointer text-red-600 text-xs",children:"Show Code"}),R.jsx("pre",{className:"mt-2 overflow-x-auto rounded bg-red-100 p-2 text-red-800 text-xs",children:e})]})]});let p=o||c;return R.jsx("div",{"aria-label":"Mermaid chart",className:Ht("my-4 flex justify-center",t),dangerouslySetInnerHTML:{__html:p},role:"img"})};function Aae(e){var t,r;let n=[],a=[],i=e.querySelectorAll("thead th");for(let o of i)n.push(((t=o.textContent)==null?void 0:t.trim())||"");let s=e.querySelectorAll("tbody tr");for(let o of s){let l=[],c=o.querySelectorAll("td");for(let d of c)l.push(((r=d.textContent)==null?void 0:r.trim())||"");a.push(l)}return{headers:n,rows:a}}function kae(e){let{headers:t,rows:r}=e,n=i=>i.includes(",")||i.includes('"')||i.includes(`
602
602
  `)?`"${i.replace(/"/g,'""')}"`:i,a=[];t.length>0&&a.push(t.map(n).join(","));for(let i of r)a.push(i.map(n).join(","));return a.join(`
603
603
  `)}function Cae(e){let{headers:t,rows:r}=e;if(t.length===0)return"";let n=[],a=t.map(i=>i.replace(/\|/g,"\\|"));n.push(`| ${a.join(" | ")} |`),n.push(`| ${t.map(()=>"---").join(" | ")} |`);for(let i of r){let s=[...i];for(;s.length<t.length;)s.push("");let o=s.map(l=>l.replace(/\|/g,"\\|"));n.push(`| ${o.join(" | ")} |`)}return n.join(`
604
604
  `)}var yCe=({children:e,className:t,onCopy:r,onError:n,timeout:a=2e3,format:i="markdown"})=>{let[s,o]=re.useState(!1),l=re.useRef(0),{isAnimating:c}=re.useContext(d0),d=async h=>{var m;if(typeof window>"u"||!((m=navigator?.clipboard)!=null&&m.write)){n?.(new Error("Clipboard API not available"));return}try{if(!s){let b=h.currentTarget.closest('[data-streamdown="table-wrapper"]'),w=b?.querySelector("table");if(!w){n?.(new Error("Table not found"));return}let _=Aae(w),S=new ClipboardItem({"text/plain":i==="markdown"?Cae(_):kae(_),"text/html":new Blob([w.outerHTML],{type:"text/html"})});await navigator.clipboard.write([S]),o(!0),r?.(),l.current=window.setTimeout(()=>o(!1),a)}}catch(b){n?.(b)}};re.useEffect(()=>()=>{window.clearTimeout(l.current)},[]);let p=s?dne:fne;return R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:c,onClick:d,title:`Copy table as ${i}`,type:"button",children:e??R.jsx(p,{size:14})})},vCe=({children:e,className:t,onDownload:r,onError:n})=>{let[a,i]=re.useState(!1),s=re.useRef(null),{isAnimating:o}=re.useContext(d0),l=c=>{var d;try{let p=(d=s.current)==null?void 0:d.closest('[data-streamdown="table-wrapper"]'),h=p?.querySelector("table");if(!h){n?.(new Error("Table not found"));return}let m=Aae(h),b=c==="csv"?kae(m):Cae(m);DO(`table.${c==="csv"?"csv":"md"}`,b,c==="csv"?"text/csv":"text/markdown"),i(!1),r?.(c)}catch(p){n?.(p)}};return re.useEffect(()=>{let c=d=>{s.current&&!s.current.contains(d.target)&&i(!1)};return document.addEventListener("mousedown",c),()=>{document.removeEventListener("mousedown",c)}},[]),R.jsxs("div",{className:"relative",ref:s,children:[R.jsx("button",{className:Ht("cursor-pointer p-1 text-muted-foreground transition-all hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",t),disabled:o,onClick:()=>i(!a),title:"Download table",type:"button",children:e??R.jsx(dO,{size:14})}),a&&R.jsxs("div",{className:"absolute top-full right-0 z-10 mt-1 min-w-[120px] rounded-md border border-border bg-background shadow-lg",children:[R.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("csv"),type:"button",children:"CSV"}),R.jsx("button",{className:"w-full px-3 py-2 text-left text-sm transition-colors hover:bg-muted/40",onClick:()=>l("markdown"),type:"button",children:"Markdown"})]})]})},ECe=/language-([^\s]+)/;function Ly(e,t){if(!(e!=null&&e.position||t!=null&&t.position))return!0;if(!(e!=null&&e.position&&t!=null&&t.position))return!1;let r=e.position.start,n=t.position.start,a=e.position.end,i=t.position.end;return r?.line===n?.line&&r?.column===n?.column&&a?.line===i?.line&&a?.column===i?.column}function Qr(e,t){return e.className===t.className&&Ly(e.node,t.node)}var k5=(e,t)=>typeof e=="boolean"?e:e[t]!==!1,PO=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("ol",{className:Ht("ml-4 list-outside list-decimal whitespace-normal",t),"data-streamdown":"ordered-list",...n,children:e}),(e,t)=>Qr(e,t));PO.displayName="MarkdownOl";var Nae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("li",{className:Ht("py-1",t),"data-streamdown":"list-item",...n,children:e}),(e,t)=>e.className===t.className&&Ly(e.node,t.node));Nae.displayName="MarkdownLi";var Rae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("ul",{className:Ht("ml-4 list-outside list-disc whitespace-normal",t),"data-streamdown":"unordered-list",...n,children:e}),(e,t)=>Qr(e,t));Rae.displayName="MarkdownUl";var Iae=re.memo(({className:e,node:t,...r})=>R.jsx("hr",{className:Ht("my-6 border-border",e),"data-streamdown":"horizontal-rule",...r}),(e,t)=>Qr(e,t));Iae.displayName="MarkdownHr";var Oae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("span",{className:Ht("font-semibold",t),"data-streamdown":"strong",...n,children:e}),(e,t)=>Qr(e,t));Oae.displayName="MarkdownStrong";var Lae=re.memo(({children:e,className:t,href:r,node:n,...a})=>{let i=r==="streamdown:incomplete-link";return R.jsx("a",{className:Ht("wrap-anywhere font-medium text-primary underline",t),"data-incomplete":i,"data-streamdown":"link",href:r,rel:"noreferrer",target:"_blank",...a,children:e})},(e,t)=>Qr(e,t)&&e.href===t.href);Lae.displayName="MarkdownA";var Dae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h1",{className:Ht("mt-6 mb-2 font-semibold text-3xl",t),"data-streamdown":"heading-1",...n,children:e}),(e,t)=>Qr(e,t));Dae.displayName="MarkdownH1";var Mae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h2",{className:Ht("mt-6 mb-2 font-semibold text-2xl",t),"data-streamdown":"heading-2",...n,children:e}),(e,t)=>Qr(e,t));Mae.displayName="MarkdownH2";var Pae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h3",{className:Ht("mt-6 mb-2 font-semibold text-xl",t),"data-streamdown":"heading-3",...n,children:e}),(e,t)=>Qr(e,t));Pae.displayName="MarkdownH3";var Fae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h4",{className:Ht("mt-6 mb-2 font-semibold text-lg",t),"data-streamdown":"heading-4",...n,children:e}),(e,t)=>Qr(e,t));Fae.displayName="MarkdownH4";var $ae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h5",{className:Ht("mt-6 mb-2 font-semibold text-base",t),"data-streamdown":"heading-5",...n,children:e}),(e,t)=>Qr(e,t));$ae.displayName="MarkdownH5";var Bae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("h6",{className:Ht("mt-6 mb-2 font-semibold text-sm",t),"data-streamdown":"heading-6",...n,children:e}),(e,t)=>Qr(e,t));Bae.displayName="MarkdownH6";var Uae=re.memo(({children:e,className:t,node:r,...n})=>{let a=re.useContext(FO),i=k5(a,"table");return R.jsxs("div",{className:"my-4 flex flex-col space-y-2","data-streamdown":"table-wrapper",children:[i&&R.jsxs("div",{className:"flex items-center justify-end gap-1",children:[R.jsx(yCe,{}),R.jsx(vCe,{})]}),R.jsx("div",{className:"overflow-x-auto",children:R.jsx("table",{className:Ht("w-full border-collapse border border-border",t),"data-streamdown":"table",...n,children:e})})]})},(e,t)=>Qr(e,t));Uae.displayName="MarkdownTable";var zae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("thead",{className:Ht("bg-muted/80",t),"data-streamdown":"table-header",...n,children:e}),(e,t)=>Qr(e,t));zae.displayName="MarkdownThead";var qae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("tbody",{className:Ht("divide-y divide-border bg-muted/40",t),"data-streamdown":"table-body",...n,children:e}),(e,t)=>Qr(e,t));qae.displayName="MarkdownTbody";var jae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("tr",{className:Ht("border-border border-b",t),"data-streamdown":"table-row",...n,children:e}),(e,t)=>Qr(e,t));jae.displayName="MarkdownTr";var Hae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("th",{className:Ht("whitespace-nowrap px-4 py-2 text-left font-semibold text-sm",t),"data-streamdown":"table-header-cell",...n,children:e}),(e,t)=>Qr(e,t));Hae.displayName="MarkdownTh";var Gae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("td",{className:Ht("px-4 py-2 text-sm",t),"data-streamdown":"table-cell",...n,children:e}),(e,t)=>Qr(e,t));Gae.displayName="MarkdownTd";var Vae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("blockquote",{className:Ht("my-4 border-muted-foreground/30 border-l-4 pl-4 text-muted-foreground italic",t),"data-streamdown":"blockquote",...n,children:e}),(e,t)=>Qr(e,t));Vae.displayName="MarkdownBlockquote";var Yae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("sup",{className:Ht("text-sm",t),"data-streamdown":"superscript",...n,children:e}),(e,t)=>Qr(e,t));Yae.displayName="MarkdownSup";var Wae=re.memo(({children:e,className:t,node:r,...n})=>R.jsx("sub",{className:Ht("text-sm",t),"data-streamdown":"subscript",...n,children:e}),(e,t)=>Qr(e,t));Wae.displayName="MarkdownSub";var Kae=re.memo(({children:e,className:t,node:r,...n})=>{if("data-footnotes"in n){let a=s=>{var o,l;if(!re.isValidElement(s))return!1;let c=Array.isArray(s.props.children)?s.props.children:[s.props.children],d=!1,p=!1;for(let h of c)if(h){if(typeof h=="string")h.trim()!==""&&(d=!0);else if(re.isValidElement(h))if(((o=h.props)==null?void 0:o["data-footnote-backref"])!==void 0)p=!0;else{let m=Array.isArray(h.props.children)?h.props.children:[h.props.children];for(let b of m){if(typeof b=="string"&&b.trim()!==""){d=!0;break}if(re.isValidElement(b)&&((l=b.props)==null?void 0:l["data-footnote-backref"])===void 0){d=!0;break}}}}return p&&!d},i=Array.isArray(e)?e.map(s=>{if(!re.isValidElement(s))return s;if(s.type===PO){let o=(Array.isArray(s.props.children)?s.props.children:[s.props.children]).filter(l=>!a(l));return o.length===0?null:{...s,props:{...s.props,children:o}}}return s}):e;return(Array.isArray(i)?i.some(s=>s!==null):i!==null)?R.jsx("section",{className:t,...n,children:i}):null}return R.jsx("section",{className:t,...n,children:e})},(e,t)=>Qr(e,t));Kae.displayName="MarkdownSection";var _Ce=({node:e,className:t,children:r,...n})=>{var a,i,s;let o=((a=e?.position)==null?void 0:a.start.line)===((i=e?.position)==null?void 0:i.end.line),l=re.useContext(tie),c=re.useContext(FO);if(o)return R.jsx("code",{className:Ht("rounded bg-muted px-1.5 py-0.5 font-mono text-sm",t),"data-streamdown":"inline-code",...n,children:r});let d=t?.match(ECe),p=(s=d?.at(1))!=null?s:"",h="";if(re.isValidElement(r)&&r.props&&typeof r.props=="object"&&"children"in r.props&&typeof r.props.children=="string"?h=r.props.children:typeof r=="string"&&(h=r),p==="mermaid"){let b=k5(c,"mermaid");return R.jsxs("div",{className:Ht("group relative my-4 h-auto rounded-xl border p-4",t),"data-streamdown":"mermaid-block",children:[b&&R.jsxs("div",{className:"flex items-center justify-end gap-2",children:[R.jsx(W$,{code:h,language:p}),R.jsx(K$,{code:h})]}),R.jsx(bCe,{chart:h,config:l})]})}let m=k5(c,"code");return R.jsx(hCe,{className:Ht("overflow-x-auto border-t",t),code:h,"data-language":p,"data-streamdown":"code-block",language:p,preClassName:"overflow-x-auto font-mono text-xs p-4 bg-muted/40",children:m&&R.jsxs(R.Fragment,{children:[R.jsx(W$,{code:h,language:p}),R.jsx(K$,{})]})})},Xae=re.memo(_Ce,(e,t)=>e.className===t.className&&Ly(e.node,t.node));Xae.displayName="MarkdownCode";var Zae=re.memo(mCe,(e,t)=>e.className===t.className&&Ly(e.node,t.node));Zae.displayName="MarkdownImg";var Qae=re.memo(({children:e,className:t,node:r,...n})=>{var a;let i=(Array.isArray(e)?e:[e]).filter(s=>s!=null&&s!=="");return i.length===1&&re.isValidElement(i[0])&&((a=i[0].props.node)==null?void 0:a.tagName)==="img"?R.jsx(R.Fragment,{children:e}):R.jsx("p",{className:t,...n,children:e})},(e,t)=>Qr(e,t));Qae.displayName="MarkdownParagraph";var SCe={ol:PO,li:Nae,ul:Rae,hr:Iae,strong:Oae,a:Lae,h1:Dae,h2:Mae,h3:Pae,h4:Fae,h5:$ae,h6:Bae,table:Uae,thead:zae,tbody:qae,tr:jae,th:Hae,td:Gae,blockquote:Vae,code:Xae,img:Zae,pre:({children:e})=>e,sup:Yae,sub:Wae,p:Qae,section:Kae},wCe=e=>{let t=/\[\^[^\]\s]{1,200}\](?!:)/.test(e),r=/\[\^[^\]\s]{1,200}\]:/.test(e);if(t||r)return[e];let n=fi.lex(e,{gfm:!0}),a=[],i=[];for(let s=0;s<n.length;s++){let o=n[s],l=o.raw;if(i.length>0){if(a[a.length-1]+=l,o.type==="html"){let c=l.match(/<\/(\w+)>/);if(c){let d=c[1];i[i.length-1]===d&&i.pop()}}continue}if(o.type==="html"&&o.block){let c=l.match(/<(\w+)[\s>]/);if(c){let d=c[1];l.includes(`</${d}>`)||i.push(d)}}if(l.trim()==="$$"&&a.length>0){let c=a.at(-1);if(!c){a.push(l);continue}let d=c.trimStart().startsWith("$$"),p=(c.match(/\$\$/g)||[]).length;if(d&&p%2===1){a[a.length-1]=c+l;continue}}if(a.length>0&&l.trimEnd().endsWith("$$")){let c=a.at(-1);if(!c){a.push(l);continue}let d=c.trimStart().startsWith("$$"),p=(c.match(/\$\$/g)||[]).length,h=(l.match(/\$\$/g)||[]).length;if(d&&p%2===1&&!l.trimStart().startsWith("$$")&&h===1){a[a.length-1]=c+l;continue}}a.push(l)}return a},TCe=/(!?\[)([^\]]*?)$/,xCe=/(\*\*)([^*]*?)$/,ACe=/(__)([^_]*?)$/,kCe=/(\*\*\*)([^*]*?)$/,CCe=/(\*)([^*]*?)$/,NCe=/(_)([^_]*?)$/,RCe=/(`)([^`]*?)$/,ICe=/(~~)([^~]*?)$/,Dy=e=>{let t=(e.match(/```/g)||[]).length;return t>0&&t%2===0&&e.includes(`