rhua-chatgpt-web 1.1.3 → 1.1.4

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 (45) hide show
  1. package/dist/{api_chain-BdfZ6btS.js → api_chain-BydBma6z.js} +2 -2
  2. package/dist/{api_chain-BeqsfaDz.cjs → api_chain-c8nEwmot.cjs} +1 -1
  3. package/dist/{combine_docs_chain-DUTKgXFP.cjs → combine_docs_chain-CbyS610d.cjs} +1 -1
  4. package/dist/{combine_docs_chain-COuoBXN8.js → combine_docs_chain-DTj2391W.js} +2 -2
  5. package/dist/{few_shot-D5v-GZVm.cjs → few_shot-CdebQ5kj.cjs} +1 -1
  6. package/dist/{few_shot-CXrHoFil.js → few_shot-Dr2a_vSB.js} +1 -1
  7. package/dist/index-9U6WHC1B.js +4 -0
  8. package/dist/{index-C-KTbjuY.cjs → index-B-LdfVHm.cjs} +1 -1
  9. package/dist/{index-DL9k9te9.js → index-BFoU0ue3.js} +1 -1
  10. package/dist/{index-B8iepdgY.cjs → index-BMmSvEQc.cjs} +1 -1
  11. package/dist/{index-B2xNSa5_.cjs → index-BRTuC1yI.cjs} +1 -1
  12. package/dist/{index-DS6Ey1Z3.js → index-BV4g85Qw.js} +1 -1
  13. package/dist/{index-ufFGYeSY.cjs → index-BZmikH2I.cjs} +1 -1
  14. package/dist/{index-BB--QoGv.js → index-BiS-zzbc.js} +25 -15
  15. package/dist/index-C4FNHxQj.js +4 -0
  16. package/dist/{index-D6T6bzDk.cjs → index-CGRli7Xu.cjs} +1 -1
  17. package/dist/{index-DpM0G23h.js → index-CNZL8JCz.js} +1 -1
  18. package/dist/{index-5XRIGdCC.js → index-CUSKlnIA.js} +1 -1
  19. package/dist/{index-iTyupZ7c.cjs → index-CjMiMSME.cjs} +1 -1
  20. package/dist/{index-CZx4UvyD.js → index-CoPJQXW-.js} +2 -2
  21. package/dist/{index-C8v1v0ZB.cjs → index-DA-muWZ3.cjs} +1 -1
  22. package/dist/{index-CSKkNkjZ.cjs → index-DAECv62A.cjs} +3 -3
  23. package/dist/{index-DIvROZpA.cjs → index-DHhPWOkF.cjs} +1 -1
  24. package/dist/{index-MSPGHs3d.cjs → index-DNLgDu9x.cjs} +1 -1
  25. package/dist/index-DP32XYQn.js +4 -0
  26. package/dist/{index-D6OD8ywf.js → index-DQjTGvu_.js} +2 -2
  27. package/dist/index-DUe6eKSl.js +4 -0
  28. package/dist/{index-Dkt-39To.cjs → index-DyAjztcW.cjs} +1 -1
  29. package/dist/{index-D1-LRbik.js → index-DyjQyNTp.js} +1 -1
  30. package/dist/{index-BWUHG_4F.cjs → index-r0ADMCt-.cjs} +1 -1
  31. package/dist/index.cjs.js +1 -1
  32. package/dist/{index.es-DD7ie9BT.js → index.es-CfXmOPUR.js} +11 -11
  33. package/dist/{index.es-DGO9vBB2.cjs → index.es-DeBEHu3I.cjs} +2 -2
  34. package/dist/index.esm.js +1 -1
  35. package/dist/{llm_chain-CCSE7ZH0.cjs → llm_chain-CblGjh7C.cjs} +1 -1
  36. package/dist/{llm_chain-BeI0W_p-.js → llm_chain-btHQ9Ypf.js} +1 -1
  37. package/dist/{sequential_chain-DPzxZkxm.cjs → sequential_chain-4_njD1CF.cjs} +1 -1
  38. package/dist/{sequential_chain-DOfqDL23.js → sequential_chain-C4uMLvT0.js} +1 -1
  39. package/dist/{vector_db_qa-DrnJyLCE.cjs → vector_db_qa-CJs8ehg0.cjs} +1 -1
  40. package/dist/{vector_db_qa-DQnKfZL6.js → vector_db_qa-phOaenwb.js} +3 -3
  41. package/package.json +1 -1
  42. package/dist/index-6S2tDoUS.js +0 -4
  43. package/dist/index-B2TrxU0U.js +0 -4
  44. package/dist/index-Cbk2vr7P.js +0 -4
  45. package/dist/index-D0EbNeWR.js +0 -4
@@ -1,5 +1,5 @@
1
- import { P as PromptTemplate, i as BaseChain } from "./index-BB--QoGv.js";
2
- import { LLMChain } from "./llm_chain-BeI0W_p-.js";
1
+ import { P as PromptTemplate, i as BaseChain } from "./index-BiS-zzbc.js";
2
+ import { LLMChain } from "./llm_chain-btHQ9Ypf.js";
3
3
  import "zod";
4
4
  const API_URL_RAW_PROMPT_TEMPLATE = `You are given the below API Documentation:
5
5
  {api_docs}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs"),i=require("./llm_chain-CCSE7ZH0.cjs");require("zod");const t="You are given the below API Documentation:\n{api_docs}\nUsing this documentation, generate the full API url to call for answering the user question.\nYou should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.\n\nQuestion:{question}\nAPI url:",a=new e.PromptTemplate({inputVariables:["api_docs","question"],template:t}),n=`${t} {api_url}\n\nHere is the response from the API:\n\n{api_response}\n\nSummarize this response to answer the original question.\n\nSummary:`,s=new e.PromptTemplate({inputVariables:["api_docs","question","api_url","api_response"],template:n});class r extends e.BaseChain{get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"apiAnswerChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiRequestChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),this.apiRequestChain=e.apiRequestChain,this.apiAnswerChain=e.apiAnswerChain,this.apiDocs=e.apiDocs,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.headers=e.headers??this.headers}async _call(e,i){const t=e[this.inputKey],a=await this.apiRequestChain.predict({question:t,api_docs:this.apiDocs},null==i?void 0:i.getChild("request")),n=await fetch(a,{headers:this.headers}),s=await n.text(),r=await this.apiAnswerChain.predict({question:t,api_docs:this.apiDocs,api_url:a,api_response:s},null==i?void 0:i.getChild("response"));return{[this.outputKey]:r}}_chainType(){return"api_chain"}static async deserialize(e){const{api_request_chain:t,api_answer_chain:a,api_docs:n}=e;if(!t)throw new Error("LLMChain must have api_request_chain");if(!a)throw new Error("LLMChain must have api_answer_chain");if(!n)throw new Error("LLMChain must have api_docs");return new r({apiAnswerChain:await i.LLMChain.deserialize(a),apiRequestChain:await i.LLMChain.deserialize(t),apiDocs:n})}serialize(){return{_type:this._chainType(),api_answer_chain:this.apiAnswerChain.serialize(),api_request_chain:this.apiRequestChain.serialize(),api_docs:this.apiDocs}}static fromLLMAndAPIDocs(e,t,n={}){const{apiUrlPrompt:r=a,apiResponsePrompt:o=s}=n,u=new i.LLMChain({prompt:r,llm:e});return new this({apiAnswerChain:new i.LLMChain({prompt:o,llm:e}),apiRequestChain:u,apiDocs:t,...n})}}exports.APIChain=r;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs"),i=require("./llm_chain-CblGjh7C.cjs");require("zod");const t="You are given the below API Documentation:\n{api_docs}\nUsing this documentation, generate the full API url to call for answering the user question.\nYou should build the API url in order to get a response that is as short as possible, while still getting the necessary information to answer the question. Pay attention to deliberately exclude any unnecessary pieces of data in the API call.\n\nQuestion:{question}\nAPI url:",a=new e.PromptTemplate({inputVariables:["api_docs","question"],template:t}),n=`${t} {api_url}\n\nHere is the response from the API:\n\n{api_response}\n\nSummarize this response to answer the original question.\n\nSummary:`,s=new e.PromptTemplate({inputVariables:["api_docs","question","api_url","api_response"],template:n});class r extends e.BaseChain{get inputKeys(){return[this.inputKey]}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"apiAnswerChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiRequestChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiDocs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:{}}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"question"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output"}),this.apiRequestChain=e.apiRequestChain,this.apiAnswerChain=e.apiAnswerChain,this.apiDocs=e.apiDocs,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.headers=e.headers??this.headers}async _call(e,i){const t=e[this.inputKey],a=await this.apiRequestChain.predict({question:t,api_docs:this.apiDocs},null==i?void 0:i.getChild("request")),n=await fetch(a,{headers:this.headers}),s=await n.text(),r=await this.apiAnswerChain.predict({question:t,api_docs:this.apiDocs,api_url:a,api_response:s},null==i?void 0:i.getChild("response"));return{[this.outputKey]:r}}_chainType(){return"api_chain"}static async deserialize(e){const{api_request_chain:t,api_answer_chain:a,api_docs:n}=e;if(!t)throw new Error("LLMChain must have api_request_chain");if(!a)throw new Error("LLMChain must have api_answer_chain");if(!n)throw new Error("LLMChain must have api_docs");return new r({apiAnswerChain:await i.LLMChain.deserialize(a),apiRequestChain:await i.LLMChain.deserialize(t),apiDocs:n})}serialize(){return{_type:this._chainType(),api_answer_chain:this.apiAnswerChain.serialize(),api_request_chain:this.apiRequestChain.serialize(),api_docs:this.apiDocs}}static fromLLMAndAPIDocs(e,t,n={}){const{apiUrlPrompt:r=a,apiResponsePrompt:o=s}=n,u=new i.LLMChain({prompt:r,llm:e});return new this({apiAnswerChain:new i.LLMChain({prompt:o,llm:e}),apiRequestChain:u,apiDocs:t,...n})}}exports.APIChain=r;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("zod");const e=require("./index-CSKkNkjZ.cjs"),t=require("./llm_chain-CCSE7ZH0.cjs");class i extends e.BaseChain{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:t,...i}=e,n=t.map(({pageContent:e})=>e).join("\n\n");return{...i,[this.documentVariableName]:n}}async _call(e,t){return await this.llmChain.call(this._prepInputs(e),null==t?void 0:t.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new i({llmChain:await t.LLMChain.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}}class n extends e.BaseChain{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e;let a=i,r=[];for(let o=0;o<this.maxIterations;o+=1){const e=a.map(e=>({[this.documentVariableName]:e.pageContent,...n}));if(0!==o||!this.ensureMapStep){const e=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:a,...n}));if(await this.combineDocumentChain.llmChain._getNumTokens(e)<this.maxTokens)break}const i=await this.llmChain.apply(e,t?Array.from({length:e.length},(e,i)=>t.getChild(`map_${i+1}`)):void 0),{outputKey:s}=this.llmChain;this.returnIntermediateSteps&&(r=r.concat(i.map(e=>e[s]))),a=i.map(e=>({pageContent:e[s],metadata:{}}))}const s={[this.combineDocumentChain.inputKey]:a,...n},u=await this.combineDocumentChain.call(s,null==t?void 0:t.getChild("combine_documents"));return this.returnIntermediateSteps?{...u,intermediateSteps:r}:u}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new n({llmChain:await t.LLMChain.deserialize(e.llm_chain),combineDocumentChain:await i.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}}class a extends e.BaseChain{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new e.PromptTemplate({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});return{...{[this.documentVariableName]:await this.documentPrompt.format({...n})},...t}}async _constructRefineInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});const a={[this.documentVariableName]:await this.documentPrompt.format({...n})};return{[this.initialResponseName]:t,...a}}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e,a=i,r=await this._constructInitialInputs(a[0],n);let s=await this.llmChain.predict({...r},null==t?void 0:t.getChild("answer"));for(let u=1;u<a.length;u+=1){const e={...await this._constructRefineInputs(a[u],s),...n};s=await this.refineLLMChain.predict({...e},null==t?void 0:t.getChild("refine"))}return{[this.outputKey]:s}}_chainType(){return"refine_documents_chain"}static async deserialize(e){const i=e.llm_chain;if(!i)throw new Error("Missing llm_chain");const n=e.refine_llm_chain;if(!n)throw new Error("Missing refine_llm_chain");return new a({llmChain:await t.LLMChain.deserialize(i),refineLLMChain:await t.LLMChain.deserialize(n)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),refine_llm_chain:this.refineLLMChain.serialize()}}}exports.MapReduceDocumentsChain=n,exports.RefineDocumentsChain=a,exports.StuffDocumentsChain=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),require("zod");const e=require("./index-DAECv62A.cjs"),t=require("./llm_chain-CblGjh7C.cjs");class i extends e.BaseChain{static lc_name(){return"StuffDocumentsChain"}get inputKeys(){return[this.inputKey,...this.llmChain.inputKeys].filter(e=>e!==this.documentVariableName)}get outputKeys(){return this.llmChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),this.llmChain=e.llmChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey}_prepInputs(e){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:t,...i}=e,n=t.map(({pageContent:e})=>e).join("\n\n");return{...i,[this.documentVariableName]:n}}async _call(e,t){return await this.llmChain.call(this._prepInputs(e),null==t?void 0:t.getChild("combine_documents"))}_chainType(){return"stuff_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");return new i({llmChain:await t.LLMChain.deserialize(e.llm_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize()}}}class n extends e.BaseChain{static lc_name(){return"MapReduceDocumentsChain"}get inputKeys(){return[this.inputKey,...this.combineDocumentChain.inputKeys]}get outputKeys(){return this.combineDocumentChain.outputKeys}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"returnIntermediateSteps",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"maxTokens",{enumerable:!0,configurable:!0,writable:!0,value:3e3}),Object.defineProperty(this,"maxIterations",{enumerable:!0,configurable:!0,writable:!0,value:10}),Object.defineProperty(this,"ensureMapStep",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"combineDocumentChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.llmChain=e.llmChain,this.combineDocumentChain=e.combineDocumentChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.ensureMapStep=e.ensureMapStep??this.ensureMapStep,this.inputKey=e.inputKey??this.inputKey,this.maxTokens=e.maxTokens??this.maxTokens,this.maxIterations=e.maxIterations??this.maxIterations,this.returnIntermediateSteps=e.returnIntermediateSteps??!1}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e;let a=i,r=[];for(let o=0;o<this.maxIterations;o+=1){const e=a.map(e=>({[this.documentVariableName]:e.pageContent,...n}));if(0!==o||!this.ensureMapStep){const e=await this.combineDocumentChain.llmChain.prompt.format(this.combineDocumentChain._prepInputs({[this.combineDocumentChain.inputKey]:a,...n}));if(await this.combineDocumentChain.llmChain._getNumTokens(e)<this.maxTokens)break}const i=await this.llmChain.apply(e,t?Array.from({length:e.length},(e,i)=>t.getChild(`map_${i+1}`)):void 0),{outputKey:s}=this.llmChain;this.returnIntermediateSteps&&(r=r.concat(i.map(e=>e[s]))),a=i.map(e=>({pageContent:e[s],metadata:{}}))}const s={[this.combineDocumentChain.inputKey]:a,...n},u=await this.combineDocumentChain.call(s,null==t?void 0:t.getChild("combine_documents"));return this.returnIntermediateSteps?{...u,intermediateSteps:r}:u}_chainType(){return"map_reduce_documents_chain"}static async deserialize(e){if(!e.llm_chain)throw new Error("Missing llm_chain");if(!e.combine_document_chain)throw new Error("Missing combine_document_chain");return new n({llmChain:await t.LLMChain.deserialize(e.llm_chain),combineDocumentChain:await i.deserialize(e.combine_document_chain)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),combine_document_chain:this.combineDocumentChain.serialize()}}}class a extends e.BaseChain{static lc_name(){return"RefineDocumentsChain"}get defaultDocumentPrompt(){return new e.PromptTemplate({inputVariables:["page_content"],template:"{page_content}"})}get inputKeys(){return[...new Set([this.inputKey,...this.llmChain.inputKeys,...this.refineLLMChain.inputKeys])].filter(e=>e!==this.documentVariableName&&e!==this.initialResponseName)}get outputKeys(){return[this.outputKey]}constructor(e){super(e),Object.defineProperty(this,"llmChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputKey",{enumerable:!0,configurable:!0,writable:!0,value:"input_documents"}),Object.defineProperty(this,"outputKey",{enumerable:!0,configurable:!0,writable:!0,value:"output_text"}),Object.defineProperty(this,"documentVariableName",{enumerable:!0,configurable:!0,writable:!0,value:"context"}),Object.defineProperty(this,"initialResponseName",{enumerable:!0,configurable:!0,writable:!0,value:"existing_answer"}),Object.defineProperty(this,"refineLLMChain",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"documentPrompt",{enumerable:!0,configurable:!0,writable:!0,value:this.defaultDocumentPrompt}),this.llmChain=e.llmChain,this.refineLLMChain=e.refineLLMChain,this.documentVariableName=e.documentVariableName??this.documentVariableName,this.inputKey=e.inputKey??this.inputKey,this.outputKey=e.outputKey??this.outputKey,this.documentPrompt=e.documentPrompt??this.documentPrompt,this.initialResponseName=e.initialResponseName??this.initialResponseName}async _constructInitialInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});return{...{[this.documentVariableName]:await this.documentPrompt.format({...n})},...t}}async _constructRefineInputs(e,t){const i={page_content:e.pageContent,...e.metadata},n={};this.documentPrompt.inputVariables.forEach(e=>{n[e]=i[e]});const a={[this.documentVariableName]:await this.documentPrompt.format({...n})};return{[this.initialResponseName]:t,...a}}async _call(e,t){if(!(this.inputKey in e))throw new Error(`Document key ${this.inputKey} not found.`);const{[this.inputKey]:i,...n}=e,a=i,r=await this._constructInitialInputs(a[0],n);let s=await this.llmChain.predict({...r},null==t?void 0:t.getChild("answer"));for(let u=1;u<a.length;u+=1){const e={...await this._constructRefineInputs(a[u],s),...n};s=await this.refineLLMChain.predict({...e},null==t?void 0:t.getChild("refine"))}return{[this.outputKey]:s}}_chainType(){return"refine_documents_chain"}static async deserialize(e){const i=e.llm_chain;if(!i)throw new Error("Missing llm_chain");const n=e.refine_llm_chain;if(!n)throw new Error("Missing refine_llm_chain");return new a({llmChain:await t.LLMChain.deserialize(i),refineLLMChain:await t.LLMChain.deserialize(n)})}serialize(){return{_type:this._chainType(),llm_chain:this.llmChain.serialize(),refine_llm_chain:this.refineLLMChain.serialize()}}}exports.MapReduceDocumentsChain=n,exports.RefineDocumentsChain=a,exports.StuffDocumentsChain=i;
@@ -1,6 +1,6 @@
1
1
  import "zod";
2
- import { i as BaseChain, P as PromptTemplate } from "./index-BB--QoGv.js";
3
- import { LLMChain } from "./llm_chain-BeI0W_p-.js";
2
+ import { i as BaseChain, P as PromptTemplate } from "./index-BiS-zzbc.js";
3
+ import { LLMChain } from "./llm_chain-btHQ9Ypf.js";
4
4
  class StuffDocumentsChain extends BaseChain {
5
5
  static lc_name() {
6
6
  return "StuffDocumentsChain";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs");require("zod");class t extends e.BaseStringPromptTemplate{constructor(t){if(super(t),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:"\n\n"}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,t),void 0!==this.examples&&void 0!==this.exampleSelector)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(void 0===this.examples&&void 0===this.exampleSelector)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),e.checkValidTemplate(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(void 0!==this.examples)return this.examples;if(void 0!==this.exampleSelector)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){const r=this.inputVariables.filter(t=>!(t in e)),a={...this.partialVariables??{},...e},i={...this,inputVariables:r,partialVariables:a};return new t(i)}async format(t){const r=await this.mergePartialAndUserVariables(t),a=await this.getExamples(r),i=await Promise.all(a.map(e=>this.examplePrompt.format(e))),l=[this.prefix,...i,this.suffix].join(this.exampleSeparator);return e.renderTemplate(l,this.templateFormat,r)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(void 0!==this.outputParser)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(r){const{example_prompt:a}=r;if(!a)throw new Error("Missing example prompt");const i=await e.PromptTemplate.deserialize(a);let l;if(!Array.isArray(r.examples))throw new Error("Invalid examples format. Only list or string are supported.");return l=r.examples,new t({inputVariables:r.input_variables,examplePrompt:i,examples:l,exampleSeparator:r.example_separator,prefix:r.prefix,suffix:r.suffix,templateFormat:r.template_format})}}exports.FewShotPromptTemplate=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs");require("zod");class t extends e.BaseStringPromptTemplate{constructor(t){if(super(t),Object.defineProperty(this,"lc_serializable",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"examples",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"exampleSelector",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"examplePrompt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"suffix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"exampleSeparator",{enumerable:!0,configurable:!0,writable:!0,value:"\n\n"}),Object.defineProperty(this,"prefix",{enumerable:!0,configurable:!0,writable:!0,value:""}),Object.defineProperty(this,"templateFormat",{enumerable:!0,configurable:!0,writable:!0,value:"f-string"}),Object.defineProperty(this,"validateTemplate",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.assign(this,t),void 0!==this.examples&&void 0!==this.exampleSelector)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(void 0===this.examples&&void 0===this.exampleSelector)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let t=this.inputVariables;this.partialVariables&&(t=t.concat(Object.keys(this.partialVariables))),e.checkValidTemplate(this.prefix+this.suffix,this.templateFormat,t)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(e){if(void 0!==this.examples)return this.examples;if(void 0!==this.exampleSelector)return this.exampleSelector.selectExamples(e);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(e){const r=this.inputVariables.filter(t=>!(t in e)),a={...this.partialVariables??{},...e},i={...this,inputVariables:r,partialVariables:a};return new t(i)}async format(t){const r=await this.mergePartialAndUserVariables(t),a=await this.getExamples(r),i=await Promise.all(a.map(e=>this.examplePrompt.format(e))),l=[this.prefix,...i,this.suffix].join(this.exampleSeparator);return e.renderTemplate(l,this.templateFormat,r)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(void 0!==this.outputParser)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(r){const{example_prompt:a}=r;if(!a)throw new Error("Missing example prompt");const i=await e.PromptTemplate.deserialize(a);let l;if(!Array.isArray(r.examples))throw new Error("Invalid examples format. Only list or string are supported.");return l=r.examples,new t({inputVariables:r.input_variables,examplePrompt:i,examples:l,exampleSeparator:r.example_separator,prefix:r.prefix,suffix:r.suffix,templateFormat:r.template_format})}}exports.FewShotPromptTemplate=t;
@@ -1,4 +1,4 @@
1
- import { B as BaseStringPromptTemplate, e as checkValidTemplate, g as renderTemplate, P as PromptTemplate } from "./index-BB--QoGv.js";
1
+ import { B as BaseStringPromptTemplate, e as checkValidTemplate, g as renderTemplate, P as PromptTemplate } from "./index-BiS-zzbc.js";
2
2
  import "zod";
3
3
  class FewShotPromptTemplate extends BaseStringPromptTemplate {
4
4
  constructor(input) {
@@ -0,0 +1,4 @@
1
+ import { u } from "./index-BiS-zzbc.js";
2
+ export {
3
+ u as unified
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-CSKkNkjZ.cjs"),e=require("./index-Dkt-39To.cjs");function n(t){const e=String(t);let n=e.length;for(;n>0;){const t=e.codePointAt(n-1);if(void 0===t||10!==t&&13!==t)break;n--}return e.slice(0,n)}const r="language-";function i(e,i){const l=i.children;let o,c,s=-1;if("pre"===i.tagName)for(;++s<l.length;){const t=l[s];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){o=t.properties.className;break}}if(o)for(s=-1;++s<o.length;)if(String(o[s]).slice(0,9)===r){c=String(o[s]).slice(9);break}const a={type:"code",lang:c||null,meta:null,value:n(t.toText(i))};return e.patch(i,a),a}function l(t,e){const n={type:"delete",children:t.all(e)};return t.patch(e,n),n}function o(t){let e=-1;if(t.length>1)for(;++e<t.length;)if(t[e].spread)return!0;return!1}function c(t,e){const n=t.all({type:"root",children:e}),r=t.toSpecificContent(n,s);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:o(r),children:r}]}function s(){return{type:"listItem",spread:!1,checked:null,children:[]}}function a(t,e){const n={type:"emphasis",children:t.all(e)};return t.patch(e,n),n}function p(t){let e=0,n=t.length;for(;e<n&&"break"===t[e].type;)e++;for(;n>e&&"break"===t[n-1].type;)n--;return 0===e&&n===t.length?t:t.slice(e,n)}function u(t,e){const n={type:"heading",depth:Number(e.tagName.charAt(1))||1,children:p(t.all(e))};return t.patch(e,n),n}function h(t,e){const n=e.properties||{},r={type:"image",url:t.resolve(String(n.src||"")||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):""};return t.patch(e,r),r}function d(e,n){const r={type:"inlineCode",value:t.toText(n)};return e.patch(n,r),r}function f(e,n){const r=[],i=[],l=n||e.properties||{},o=g(e),c=Math.min(Number.parseInt(String(l.size),10),0)||(l.multiple?4:1);let s=-1;for(;++s<o.length;){const t=o[s];t&&t.properties&&t.properties.selected&&r.push(t)}const a=r.length>0?r:o,p=Math.min(a.length,c);for(s=-1;++s<p;){const e=a[s],n=e.properties||{},r=t.toText(e),l=r||String(n.label||""),o=String(n.value||"")||r;i.push([o,l===o?void 0:l])}return i}function g(t){const e=[];let n=-1;for(;++n<t.children.length;){const r=t.children[n];"children"in r&&Array.isArray(r.children)&&e.push(...g(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||e.push(r)}return e}function y(t,e){const{rest:n,checkbox:r}=b(e),i=r?Boolean(r.properties.checked):null,l={type:"listItem",spread:m(n),checked:i,children:t.toFlow(t.all(n))};return t.patch(e,l),l}function m(t){let n=-1,r=!1;for(;++n<t.children.length;){const i=t.children[n];if("element"===i.type){if(e.phrasing(i))continue;if("p"===i.tagName||r||m(i))return!0;r=!0}}return!1}function b(t){const e=t.children[0];if(e&&"element"===e.type&&"input"===e.tagName&&e.properties&&("checkbox"===e.properties.type||"radio"===e.properties.type)){return{checkbox:e,rest:{...t,children:t.children.slice(1)}}}if(e&&"element"===e.type&&"p"===e.tagName){const{checkbox:n,rest:r}=b(e);if(n){return{checkbox:n,rest:{...t,children:[r,...t.children.slice(1)]}}}}return{checkbox:void 0,rest:t}}function v(t,e){const n="ol"===e.tagName,r=t.toSpecificContent(t.all(e),S);let i=null;n&&(i=e.properties&&e.properties.start?Number.parseInt(String(e.properties.start),10):1);const l={type:"list",ordered:n,start:i,spread:o(r),children:r};return t.patch(e,l),l}function S(){return{type:"listItem",spread:!1,checked:null,children:[]}}function x(t){let e=-1;for(;++e<t.length;){const n=t[e];if(!w(n)||"children"in n&&x(n.children))return!0}return!1}function k(e){return T(e,function(e){return e.every(function(e){return"text"===e.type&&t.whitespace(e.value)})?[]:[{type:"paragraph",children:p(e)}]},function(t){return t})}function N(t){return T(t.children,function(e){const n=C(t);return n.children=e,[n]},function(e){if("children"in e&&"children"in t){const n=C(t),r=C(e);return n.children=e.children,r.children.push(n),r}return{...e}})}function T(t,e,n){const r=function(t){const e=[];let n=-1;for(;++n<t.length;){const r=t[n];"delete"!==r.type&&"link"!==r.type||!x(r.children)?e.push(r):e.push(...N(r))}return e}(t),i=[];let l=[],o=-1;for(;++o<r.length;){const t=r[o];w(t)?l.push(t):(l.length>0&&(i.push(...e(l)),l=[]),i.push(n(t)))}return l.length>0&&(i.push(...e(l)),l=[]),i}function w(n){const r=n.data&&n.data.hName;return r?e.phrasing({type:"element",tagName:r,properties:{},children:[]}):t.phrasing(n)}function C(e){return t.structuredClone({...e,children:[]})}function I(e,n){const r=n.properties||{},i="video"===n.tagName?String(r.poster||""):"";let l=String(r.src||""),o=-1,c=!1,s=e.all(n);const a={type:"root",children:s};if(t.visit(a,function(e){if("link"===e.type)return c=!0,t.EXIT}),c||x(s))return s;for(;!l&&++o<n.children.length;){const t=n.children[o];"element"===t.type&&"source"===t.tagName&&t.properties&&(l=String(t.properties.src||""))}if(i){const r={type:"image",title:null,url:e.resolve(i),alt:t.toString(s)};e.patch(n,r),s=[r]}const p=s,u={type:"link",title:r.title?String(r.title):null,url:e.resolve(l),children:p};return e.patch(n,u),u}function M(t,e){const n=p(t.all(e));if(n.length>0){const r={type:"paragraph",children:n};return t.patch(e,r),r}}const A=['"'];function U(t,e){const n={type:"strong",children:t.all(e)};return t.patch(e,n),n}function q(t,e){const n={type:"tableCell",children:t.all(e)};if(t.patch(e,n),e.properties){const t=e.properties.rowSpan,r=e.properties.colSpan;if(t||r){const e=n.data||(n.data={});t&&(e.hastUtilToMdastTemporaryRowSpan=t),r&&(e.hastUtilToMdastTemporaryColSpan=r)}}return n}function B(){return{type:"tableCell",children:[]}}function R(){return{type:"tableCell",children:[]}}function j(){return{type:"tableRow",children:[]}}const F={comment:function(t,e){const n={type:"html",value:"\x3c!--"+e.value+"--\x3e"};return t.patch(e,n),n},doctype:O,root:function(t,e){let n=t.all(e);(t.options.document||x(n))&&(n=k(n));const r={type:"root",children:n};return t.patch(e,r),r},text:function(t,e){const n={type:"text",value:e.value};return t.patch(e,n),n}},z={applet:O,area:O,basefont:O,bgsound:O,caption:O,col:O,colgroup:O,command:O,content:O,datalist:O,dialog:O,element:O,embed:O,frame:O,frameset:O,isindex:O,keygen:O,link:O,math:O,menu:O,menuitem:O,meta:O,nextid:O,noembed:O,noframes:O,optgroup:O,option:O,param:O,script:O,shadow:O,source:O,spacer:O,style:O,svg:O,template:O,title:O,track:O,abbr:H,acronym:H,bdi:H,bdo:H,big:H,blink:H,button:H,canvas:H,cite:H,data:H,details:H,dfn:H,font:H,ins:H,label:H,map:H,marquee:H,meter:H,nobr:H,noscript:H,object:H,output:H,progress:H,rb:H,rbc:H,rp:H,rt:H,rtc:H,ruby:H,slot:H,small:H,span:H,sup:H,sub:H,tbody:H,tfoot:H,thead:H,time:H,address:P,article:P,aside:P,body:P,center:P,div:P,fieldset:P,figcaption:P,figure:P,form:P,footer:P,header:P,hgroup:P,html:P,legend:P,main:P,multicol:P,nav:P,picture:P,section:P,a:function(t,e){const n=e.properties||{},r=t.all(e),i={type:"link",url:t.resolve(String(n.href||"")||null),title:n.title?String(n.title):null,children:r};return t.patch(e,i),i},audio:I,b:U,base:function(t,e){t.baseFound||(t.frozenBaseUrl=String(e.properties&&e.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,e){const n={type:"blockquote",children:t.toFlow(t.all(e))};return t.patch(e,n),n},br:function(t,e){const n={type:"break"};return t.patch(e,n),n},code:d,dir:v,dl:function(t,e){const n=[],r=[];let i=-1;for(;++i<e.children.length;){const t=e.children[i];"element"===t.type&&"div"===t.tagName?n.push(...t.children):n.push(t)}let l={definitions:[],titles:[]};for(i=-1;++i<n.length;){const t=n[i];if("element"===t.type&&"dt"===t.tagName){const e=n[i-1];e&&"element"===e.type&&"dd"===e.tagName&&(r.push(l),l={definitions:[],titles:[]}),l.titles.push(t)}else l.definitions.push(t)}r.push(l),i=-1;const s=[];for(;++i<r.length;){const e=[...c(t,r[i].titles),...c(t,r[i].definitions)];e.length>0&&s.push({type:"listItem",spread:e.length>1,checked:null,children:e})}if(s.length>0){const n={type:"list",ordered:!1,start:null,spread:o(s),children:s};return t.patch(e,n),n}},dt:y,dd:y,del:l,em:a,h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,hr:function(t,e){const n={type:"thematicBreak"};return t.patch(e,n),n},i:a,iframe:function(t,e){const n=e.properties||{},r=String(n.src||""),i=String(n.title||"");if(r&&i){const n={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:i}]};return t.patch(e,n),n}},img:h,image:h,input:function(t,e){const n=e.properties||{},r=String(n.value||n.placeholder||"");if(n.disabled||"hidden"===n.type||"file"===n.type)return;if("checkbox"===n.type||"radio"===n.type){const r={type:"text",value:n.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(e,r),r}if("image"===n.type){const i=n.alt||r;if(i){const r={type:"image",url:t.resolve(String(n.src||"")||null),title:String(n.title||"")||null,alt:String(i)};return t.patch(e,r),r}return}let i=[];if(r)i=[[r,void 0]];else if("button"!==n.type&&"file"!==n.type&&"password"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&n.list){const e=String(n.list),r=t.elementById.get(e);r&&"datalist"===r.tagName&&(i=f(r,n))}if(0===i.length)return;if("password"===n.type&&(i[0]=["•".repeat(i[0][0].length),void 0]),"email"===n.type||"url"===n.type){const e=[];let r=-1;for(;++r<i.length;){const l=t.resolve(i[r][0]),o={type:"link",title:null,url:"email"===n.type?"mailto:"+l:l,children:[{type:"text",value:i[r][1]||l}]};e.push(o),r!==i.length-1&&e.push({type:"text",value:", "})}return e}const l=[];let o=-1;for(;++o<i.length;)l.push(i[o][1]?i[o][1]+" ("+i[o][0]+")":i[o][0]);const c={type:"text",value:l.join(", ")};return t.patch(e,c),c},kbd:d,li:y,listing:i,mark:a,ol:v,p:M,plaintext:i,pre:i,q:function(t,e){const n=t.options.quotes||A;t.qNesting++;const r=t.all(e);t.qNesting--;const i=n[t.qNesting%n.length],l=r[0],o=r[r.length-1],c=i.charAt(0),s=i.length>1?i.charAt(1):i;return l&&"text"===l.type?l.value=c+l.value:r.unshift({type:"text",value:c}),o&&"text"===o.type?o.value+=s:r.push({type:"text",value:s}),r},s:l,samp:d,select:function(t,e){const n=f(e);let r=-1;const i=[];for(;++r<n.length;){const t=n[r];i.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(i.length>0){const n={type:"text",value:i.join(", ")};return t.patch(e,n),n}},strike:l,strong:U,summary:M,table:function(e,n){if(e.inTable){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r}e.inTable=!0;const{align:r,headless:i}=function(e){const n={align:[null],headless:!0};let r=0,i=0;return t.visit(e,function(l){if("element"===l.type){if("table"===l.tagName&&e!==l)return t.SKIP;if("th"!==l.tagName&&"td"!==l.tagName||!l.properties)"thead"===l.tagName?n.headless=!1:"tr"===l.tagName&&(r++,i=0);else{if(!n.align[i]){const t=String(l.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[i]=t)}n.headless&&r<2&&"th"===l.tagName&&(n.headless=!1),i++}}}),n}(n),l=e.toSpecificContent(e.all(n),j);i&&l.unshift({type:"tableRow",children:[]});let o=-1;for(;++o<l.length;){const t=l[o],n=e.toSpecificContent(t.children,R);t.children=n}let c=1;for(o=-1;++o<l.length;){const t=l[o].children;let e=-1;for(;++e<t.length;){const n=t[e];if(n.data){const t=n.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,i=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||i>1){let t=o-1;for(;++t<o+i;){let n=e-1;for(;++n<e+r&&l[t];){const r=[];t===o&&n===e||r.push({type:"tableCell",children:[]}),l[t].children.splice(n,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(n.data).length&&delete n.data}}t.length>c&&(c=t.length)}for(o=-1;++o<l.length;){const t=l[o].children;let e=t.length-1;for(;++e<c;)t.push({type:"tableCell",children:[]})}let s=r.length-1;for(;++s<c;)r.push(null);e.inTable=!1;const a={type:"table",align:r,children:l};return e.patch(n,a),a},td:q,textarea:function(e,n){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r},th:q,tr:function(t,e){const n={type:"tableRow",children:t.toSpecificContent(t.all(e),B)};return t.patch(e,n),n},tt:d,u:a,ul:v,var:d,video:I,wbr:function(t,e){const n={type:"text",value:"​"};return t.patch(e,n),n},xmp:i};function H(t,e){return t.all(e)}function P(t,e){return t.toFlow(t.all(e))}function O(){}const $={}.hasOwnProperty;function E(t){const e=t.children||[],n=[];let r=-1;for(;++r<e.length;){const i=e[r],l=this.one(i,t);Array.isArray(l)?n.push(...l):l&&n.push(l)}return n}function K(t,e){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if($.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,e)||void 0}else if($.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,e)||void 0;if("value"in t&&"string"==typeof t.value){const e={type:"text",value:t.value};return this.patch(t,e),e}if("children"in t)return this.all(t)}function L(e,n){e.position&&(n.position=t.position(e))}function W(t){const e=this.frozenBaseUrl;return null==t?"":e?String(new URL(t,e)):t}function X(t){return k(t)}function D(t,e){const n=e(),r=[];let i=[],l=-1;for(;++l<t.length;){const e=t[l];if(o(e))i.length>0&&(e.children.unshift(...i),i=[]),r.push(e);else{const t=e;i.push(t)}}if(i.length>0){let t=r[r.length-1];t||(t=e(),r.push(t)),t.children.push(...i),i=[]}return r;function o(t){return t.type===n.type}}const G={};function J(n,r){const i=t.structuredClone(n),l=r||G,o=function(t){return function(n){e.minifyWhitespace(n,t)}}({newlines:!0===l.newlines}),c=function(t){return{all:E,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...z,...t.handlers},inTable:!1,nodeHandlers:{...F,...t.nodeHandlers},one:K,options:t,patch:L,qNesting:0,resolve:W,toFlow:X,toSpecificContent:D}}(l);let s;o(i),t.visit(i,function(t){if(t&&"element"===t.type&&t.properties){const e=String(t.properties.id||"")||void 0;e&&!c.elementById.has(e)&&c.elementById.set(e,t)}});const a=c.one(i,void 0);if(a)if(Array.isArray(a)){s={type:"root",children:a}}else s=a;else s={type:"root",children:[]};return t.visit(s,function(t,e,n){if("text"===t.type&&void 0!==e&&n){const r=n.children[e-1];if(r&&r.type===t.type)return r.value+=t.value,n.children.splice(e,1),r.position&&t.position&&(r.position.end=t.position.end),e-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!n||"heading"!==n.type&&"paragraph"!==n.type&&"root"!==n.type||(e||(t.value=t.value.replace(/^[\t ]+/,"")),e===n.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return n.children.splice(e,1),e}}),s}const Q={document:!0};exports.default=function(t,e){return t&&"run"in t?async function(n,r){const i=J(n,{...Q,...e});await t.run(i,r)}:function(e){return J(e,{...Q,...t})}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-DAECv62A.cjs"),e=require("./index-DyAjztcW.cjs");function n(t){const e=String(t);let n=e.length;for(;n>0;){const t=e.codePointAt(n-1);if(void 0===t||10!==t&&13!==t)break;n--}return e.slice(0,n)}const r="language-";function i(e,i){const l=i.children;let o,c,s=-1;if("pre"===i.tagName)for(;++s<l.length;){const t=l[s];if("element"===t.type&&"code"===t.tagName&&t.properties&&t.properties.className&&Array.isArray(t.properties.className)){o=t.properties.className;break}}if(o)for(s=-1;++s<o.length;)if(String(o[s]).slice(0,9)===r){c=String(o[s]).slice(9);break}const a={type:"code",lang:c||null,meta:null,value:n(t.toText(i))};return e.patch(i,a),a}function l(t,e){const n={type:"delete",children:t.all(e)};return t.patch(e,n),n}function o(t){let e=-1;if(t.length>1)for(;++e<t.length;)if(t[e].spread)return!0;return!1}function c(t,e){const n=t.all({type:"root",children:e}),r=t.toSpecificContent(n,s);return 0===r.length?[]:1===r.length?r[0].children:[{type:"list",ordered:!1,start:null,spread:o(r),children:r}]}function s(){return{type:"listItem",spread:!1,checked:null,children:[]}}function a(t,e){const n={type:"emphasis",children:t.all(e)};return t.patch(e,n),n}function p(t){let e=0,n=t.length;for(;e<n&&"break"===t[e].type;)e++;for(;n>e&&"break"===t[n-1].type;)n--;return 0===e&&n===t.length?t:t.slice(e,n)}function u(t,e){const n={type:"heading",depth:Number(e.tagName.charAt(1))||1,children:p(t.all(e))};return t.patch(e,n),n}function h(t,e){const n=e.properties||{},r={type:"image",url:t.resolve(String(n.src||"")||null),title:n.title?String(n.title):null,alt:n.alt?String(n.alt):""};return t.patch(e,r),r}function d(e,n){const r={type:"inlineCode",value:t.toText(n)};return e.patch(n,r),r}function f(e,n){const r=[],i=[],l=n||e.properties||{},o=g(e),c=Math.min(Number.parseInt(String(l.size),10),0)||(l.multiple?4:1);let s=-1;for(;++s<o.length;){const t=o[s];t&&t.properties&&t.properties.selected&&r.push(t)}const a=r.length>0?r:o,p=Math.min(a.length,c);for(s=-1;++s<p;){const e=a[s],n=e.properties||{},r=t.toText(e),l=r||String(n.label||""),o=String(n.value||"")||r;i.push([o,l===o?void 0:l])}return i}function g(t){const e=[];let n=-1;for(;++n<t.children.length;){const r=t.children[n];"children"in r&&Array.isArray(r.children)&&e.push(...g(r)),"element"!==r.type||"option"!==r.tagName||r.properties&&r.properties.disabled||e.push(r)}return e}function y(t,e){const{rest:n,checkbox:r}=b(e),i=r?Boolean(r.properties.checked):null,l={type:"listItem",spread:m(n),checked:i,children:t.toFlow(t.all(n))};return t.patch(e,l),l}function m(t){let n=-1,r=!1;for(;++n<t.children.length;){const i=t.children[n];if("element"===i.type){if(e.phrasing(i))continue;if("p"===i.tagName||r||m(i))return!0;r=!0}}return!1}function b(t){const e=t.children[0];if(e&&"element"===e.type&&"input"===e.tagName&&e.properties&&("checkbox"===e.properties.type||"radio"===e.properties.type)){return{checkbox:e,rest:{...t,children:t.children.slice(1)}}}if(e&&"element"===e.type&&"p"===e.tagName){const{checkbox:n,rest:r}=b(e);if(n){return{checkbox:n,rest:{...t,children:[r,...t.children.slice(1)]}}}}return{checkbox:void 0,rest:t}}function v(t,e){const n="ol"===e.tagName,r=t.toSpecificContent(t.all(e),S);let i=null;n&&(i=e.properties&&e.properties.start?Number.parseInt(String(e.properties.start),10):1);const l={type:"list",ordered:n,start:i,spread:o(r),children:r};return t.patch(e,l),l}function S(){return{type:"listItem",spread:!1,checked:null,children:[]}}function x(t){let e=-1;for(;++e<t.length;){const n=t[e];if(!w(n)||"children"in n&&x(n.children))return!0}return!1}function k(e){return T(e,function(e){return e.every(function(e){return"text"===e.type&&t.whitespace(e.value)})?[]:[{type:"paragraph",children:p(e)}]},function(t){return t})}function N(t){return T(t.children,function(e){const n=C(t);return n.children=e,[n]},function(e){if("children"in e&&"children"in t){const n=C(t),r=C(e);return n.children=e.children,r.children.push(n),r}return{...e}})}function T(t,e,n){const r=function(t){const e=[];let n=-1;for(;++n<t.length;){const r=t[n];"delete"!==r.type&&"link"!==r.type||!x(r.children)?e.push(r):e.push(...N(r))}return e}(t),i=[];let l=[],o=-1;for(;++o<r.length;){const t=r[o];w(t)?l.push(t):(l.length>0&&(i.push(...e(l)),l=[]),i.push(n(t)))}return l.length>0&&(i.push(...e(l)),l=[]),i}function w(n){const r=n.data&&n.data.hName;return r?e.phrasing({type:"element",tagName:r,properties:{},children:[]}):t.phrasing(n)}function C(e){return t.structuredClone({...e,children:[]})}function I(e,n){const r=n.properties||{},i="video"===n.tagName?String(r.poster||""):"";let l=String(r.src||""),o=-1,c=!1,s=e.all(n);const a={type:"root",children:s};if(t.visit(a,function(e){if("link"===e.type)return c=!0,t.EXIT}),c||x(s))return s;for(;!l&&++o<n.children.length;){const t=n.children[o];"element"===t.type&&"source"===t.tagName&&t.properties&&(l=String(t.properties.src||""))}if(i){const r={type:"image",title:null,url:e.resolve(i),alt:t.toString(s)};e.patch(n,r),s=[r]}const p=s,u={type:"link",title:r.title?String(r.title):null,url:e.resolve(l),children:p};return e.patch(n,u),u}function M(t,e){const n=p(t.all(e));if(n.length>0){const r={type:"paragraph",children:n};return t.patch(e,r),r}}const A=['"'];function U(t,e){const n={type:"strong",children:t.all(e)};return t.patch(e,n),n}function q(t,e){const n={type:"tableCell",children:t.all(e)};if(t.patch(e,n),e.properties){const t=e.properties.rowSpan,r=e.properties.colSpan;if(t||r){const e=n.data||(n.data={});t&&(e.hastUtilToMdastTemporaryRowSpan=t),r&&(e.hastUtilToMdastTemporaryColSpan=r)}}return n}function B(){return{type:"tableCell",children:[]}}function R(){return{type:"tableCell",children:[]}}function j(){return{type:"tableRow",children:[]}}const F={comment:function(t,e){const n={type:"html",value:"\x3c!--"+e.value+"--\x3e"};return t.patch(e,n),n},doctype:O,root:function(t,e){let n=t.all(e);(t.options.document||x(n))&&(n=k(n));const r={type:"root",children:n};return t.patch(e,r),r},text:function(t,e){const n={type:"text",value:e.value};return t.patch(e,n),n}},z={applet:O,area:O,basefont:O,bgsound:O,caption:O,col:O,colgroup:O,command:O,content:O,datalist:O,dialog:O,element:O,embed:O,frame:O,frameset:O,isindex:O,keygen:O,link:O,math:O,menu:O,menuitem:O,meta:O,nextid:O,noembed:O,noframes:O,optgroup:O,option:O,param:O,script:O,shadow:O,source:O,spacer:O,style:O,svg:O,template:O,title:O,track:O,abbr:H,acronym:H,bdi:H,bdo:H,big:H,blink:H,button:H,canvas:H,cite:H,data:H,details:H,dfn:H,font:H,ins:H,label:H,map:H,marquee:H,meter:H,nobr:H,noscript:H,object:H,output:H,progress:H,rb:H,rbc:H,rp:H,rt:H,rtc:H,ruby:H,slot:H,small:H,span:H,sup:H,sub:H,tbody:H,tfoot:H,thead:H,time:H,address:P,article:P,aside:P,body:P,center:P,div:P,fieldset:P,figcaption:P,figure:P,form:P,footer:P,header:P,hgroup:P,html:P,legend:P,main:P,multicol:P,nav:P,picture:P,section:P,a:function(t,e){const n=e.properties||{},r=t.all(e),i={type:"link",url:t.resolve(String(n.href||"")||null),title:n.title?String(n.title):null,children:r};return t.patch(e,i),i},audio:I,b:U,base:function(t,e){t.baseFound||(t.frozenBaseUrl=String(e.properties&&e.properties.href||"")||void 0,t.baseFound=!0)},blockquote:function(t,e){const n={type:"blockquote",children:t.toFlow(t.all(e))};return t.patch(e,n),n},br:function(t,e){const n={type:"break"};return t.patch(e,n),n},code:d,dir:v,dl:function(t,e){const n=[],r=[];let i=-1;for(;++i<e.children.length;){const t=e.children[i];"element"===t.type&&"div"===t.tagName?n.push(...t.children):n.push(t)}let l={definitions:[],titles:[]};for(i=-1;++i<n.length;){const t=n[i];if("element"===t.type&&"dt"===t.tagName){const e=n[i-1];e&&"element"===e.type&&"dd"===e.tagName&&(r.push(l),l={definitions:[],titles:[]}),l.titles.push(t)}else l.definitions.push(t)}r.push(l),i=-1;const s=[];for(;++i<r.length;){const e=[...c(t,r[i].titles),...c(t,r[i].definitions)];e.length>0&&s.push({type:"listItem",spread:e.length>1,checked:null,children:e})}if(s.length>0){const n={type:"list",ordered:!1,start:null,spread:o(s),children:s};return t.patch(e,n),n}},dt:y,dd:y,del:l,em:a,h1:u,h2:u,h3:u,h4:u,h5:u,h6:u,hr:function(t,e){const n={type:"thematicBreak"};return t.patch(e,n),n},i:a,iframe:function(t,e){const n=e.properties||{},r=String(n.src||""),i=String(n.title||"");if(r&&i){const n={type:"link",title:null,url:t.resolve(r),children:[{type:"text",value:i}]};return t.patch(e,n),n}},img:h,image:h,input:function(t,e){const n=e.properties||{},r=String(n.value||n.placeholder||"");if(n.disabled||"hidden"===n.type||"file"===n.type)return;if("checkbox"===n.type||"radio"===n.type){const r={type:"text",value:n.checked?t.options.checked||"[x]":t.options.unchecked||"[ ]"};return t.patch(e,r),r}if("image"===n.type){const i=n.alt||r;if(i){const r={type:"image",url:t.resolve(String(n.src||"")||null),title:String(n.title||"")||null,alt:String(i)};return t.patch(e,r),r}return}let i=[];if(r)i=[[r,void 0]];else if("button"!==n.type&&"file"!==n.type&&"password"!==n.type&&"reset"!==n.type&&"submit"!==n.type&&n.list){const e=String(n.list),r=t.elementById.get(e);r&&"datalist"===r.tagName&&(i=f(r,n))}if(0===i.length)return;if("password"===n.type&&(i[0]=["•".repeat(i[0][0].length),void 0]),"email"===n.type||"url"===n.type){const e=[];let r=-1;for(;++r<i.length;){const l=t.resolve(i[r][0]),o={type:"link",title:null,url:"email"===n.type?"mailto:"+l:l,children:[{type:"text",value:i[r][1]||l}]};e.push(o),r!==i.length-1&&e.push({type:"text",value:", "})}return e}const l=[];let o=-1;for(;++o<i.length;)l.push(i[o][1]?i[o][1]+" ("+i[o][0]+")":i[o][0]);const c={type:"text",value:l.join(", ")};return t.patch(e,c),c},kbd:d,li:y,listing:i,mark:a,ol:v,p:M,plaintext:i,pre:i,q:function(t,e){const n=t.options.quotes||A;t.qNesting++;const r=t.all(e);t.qNesting--;const i=n[t.qNesting%n.length],l=r[0],o=r[r.length-1],c=i.charAt(0),s=i.length>1?i.charAt(1):i;return l&&"text"===l.type?l.value=c+l.value:r.unshift({type:"text",value:c}),o&&"text"===o.type?o.value+=s:r.push({type:"text",value:s}),r},s:l,samp:d,select:function(t,e){const n=f(e);let r=-1;const i=[];for(;++r<n.length;){const t=n[r];i.push(t[1]?t[1]+" ("+t[0]+")":t[0])}if(i.length>0){const n={type:"text",value:i.join(", ")};return t.patch(e,n),n}},strike:l,strong:U,summary:M,table:function(e,n){if(e.inTable){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r}e.inTable=!0;const{align:r,headless:i}=function(e){const n={align:[null],headless:!0};let r=0,i=0;return t.visit(e,function(l){if("element"===l.type){if("table"===l.tagName&&e!==l)return t.SKIP;if("th"!==l.tagName&&"td"!==l.tagName||!l.properties)"thead"===l.tagName?n.headless=!1:"tr"===l.tagName&&(r++,i=0);else{if(!n.align[i]){const t=String(l.properties.align||"")||null;"center"!==t&&"left"!==t&&"right"!==t&&null!==t||(n.align[i]=t)}n.headless&&r<2&&"th"===l.tagName&&(n.headless=!1),i++}}}),n}(n),l=e.toSpecificContent(e.all(n),j);i&&l.unshift({type:"tableRow",children:[]});let o=-1;for(;++o<l.length;){const t=l[o],n=e.toSpecificContent(t.children,R);t.children=n}let c=1;for(o=-1;++o<l.length;){const t=l[o].children;let e=-1;for(;++e<t.length;){const n=t[e];if(n.data){const t=n.data,r=Number.parseInt(String(t.hastUtilToMdastTemporaryColSpan),10)||1,i=Number.parseInt(String(t.hastUtilToMdastTemporaryRowSpan),10)||1;if(r>1||i>1){let t=o-1;for(;++t<o+i;){let n=e-1;for(;++n<e+r&&l[t];){const r=[];t===o&&n===e||r.push({type:"tableCell",children:[]}),l[t].children.splice(n,0,...r)}}}"hastUtilToMdastTemporaryColSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryColSpan,"hastUtilToMdastTemporaryRowSpan"in n.data&&delete n.data.hastUtilToMdastTemporaryRowSpan,0===Object.keys(n.data).length&&delete n.data}}t.length>c&&(c=t.length)}for(o=-1;++o<l.length;){const t=l[o].children;let e=t.length-1;for(;++e<c;)t.push({type:"tableCell",children:[]})}let s=r.length-1;for(;++s<c;)r.push(null);e.inTable=!1;const a={type:"table",align:r,children:l};return e.patch(n,a),a},td:q,textarea:function(e,n){const r={type:"text",value:t.toText(n)};return e.patch(n,r),r},th:q,tr:function(t,e){const n={type:"tableRow",children:t.toSpecificContent(t.all(e),B)};return t.patch(e,n),n},tt:d,u:a,ul:v,var:d,video:I,wbr:function(t,e){const n={type:"text",value:"​"};return t.patch(e,n),n},xmp:i};function H(t,e){return t.all(e)}function P(t,e){return t.toFlow(t.all(e))}function O(){}const $={}.hasOwnProperty;function E(t){const e=t.children||[],n=[];let r=-1;for(;++r<e.length;){const i=e[r],l=this.one(i,t);Array.isArray(l)?n.push(...l):l&&n.push(l)}return n}function K(t,e){if("element"===t.type){if(t.properties&&"ignore"===t.properties.dataMdast)return;if($.call(this.handlers,t.tagName))return this.handlers[t.tagName](this,t,e)||void 0}else if($.call(this.nodeHandlers,t.type))return this.nodeHandlers[t.type](this,t,e)||void 0;if("value"in t&&"string"==typeof t.value){const e={type:"text",value:t.value};return this.patch(t,e),e}if("children"in t)return this.all(t)}function L(e,n){e.position&&(n.position=t.position(e))}function W(t){const e=this.frozenBaseUrl;return null==t?"":e?String(new URL(t,e)):t}function X(t){return k(t)}function D(t,e){const n=e(),r=[];let i=[],l=-1;for(;++l<t.length;){const e=t[l];if(o(e))i.length>0&&(e.children.unshift(...i),i=[]),r.push(e);else{const t=e;i.push(t)}}if(i.length>0){let t=r[r.length-1];t||(t=e(),r.push(t)),t.children.push(...i),i=[]}return r;function o(t){return t.type===n.type}}const G={};function J(n,r){const i=t.structuredClone(n),l=r||G,o=function(t){return function(n){e.minifyWhitespace(n,t)}}({newlines:!0===l.newlines}),c=function(t){return{all:E,baseFound:!1,elementById:new Map,frozenBaseUrl:void 0,handlers:{...z,...t.handlers},inTable:!1,nodeHandlers:{...F,...t.nodeHandlers},one:K,options:t,patch:L,qNesting:0,resolve:W,toFlow:X,toSpecificContent:D}}(l);let s;o(i),t.visit(i,function(t){if(t&&"element"===t.type&&t.properties){const e=String(t.properties.id||"")||void 0;e&&!c.elementById.has(e)&&c.elementById.set(e,t)}});const a=c.one(i,void 0);if(a)if(Array.isArray(a)){s={type:"root",children:a}}else s=a;else s={type:"root",children:[]};return t.visit(s,function(t,e,n){if("text"===t.type&&void 0!==e&&n){const r=n.children[e-1];if(r&&r.type===t.type)return r.value+=t.value,n.children.splice(e,1),r.position&&t.position&&(r.position.end=t.position.end),e-1;if(t.value=t.value.replace(/[\t ]*(\r?\n|\r)[\t ]*/,"$1"),!n||"heading"!==n.type&&"paragraph"!==n.type&&"root"!==n.type||(e||(t.value=t.value.replace(/^[\t ]+/,"")),e===n.children.length-1&&(t.value=t.value.replace(/[\t ]+$/,""))),!t.value)return n.children.splice(e,1),e}}),s}const Q={document:!0};exports.default=function(t,e){return t&&"run"in t?async function(n,r){const i=J(n,{...Q,...e});await t.run(i,r)}:function(e){return J(e,{...Q,...t})}};
@@ -1,4 +1,4 @@
1
- import { n as convertElement, o as convert, p as isElement, w as whitespace } from "./index-BB--QoGv.js";
1
+ import { n as convertElement, o as convert, p as isElement, w as whitespace } from "./index-BiS-zzbc.js";
2
2
  const embedded = convertElement(
3
3
  /**
4
4
  * @param element
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs"),t=require("./index-2yo2kUGy.cjs"),a=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n=/["&'<>`]/g,r=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/[|\\{}()[\]^$+*?.]/g,i=new WeakMap;function c(e,t){return e=e.replace(t.subset?function(e){let t=i.get(e);t||(t=function(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(s,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),i.set(e,t));return t}(t.subset):n,a),t.subset||t.escapeOnly?e:e.replace(r,function(e,a,n){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,n.charCodeAt(a+2),t)}).replace(o,a);function a(e,a,n){return t.format(e.charCodeAt(0),n.charCodeAt(a+1),t)}}const u=/[\dA-Fa-f]/;const l=/\d/;const m=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],g={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},p=["cent","copy","divide","gt","lt","not","para","times"],d={}.hasOwnProperty,f={};let h;for(h in g)d.call(g,h)&&(f[g[h]]=h);const N=/[^\dA-Za-z]/;function y(e,t,a){let n,r=function(e,t,a){const n="&#x"+e.toString(16).toUpperCase();return a&&t&&!u.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);if((a.useNamedReferences||a.useShortestReferences)&&(n=function(e,t,a,n){const r=String.fromCharCode(e);if(d.call(f,r)){const e=f[r],o="&"+e;return a&&m.includes(e)&&!p.includes(e)&&(!n||t&&61!==t&&N.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!n)&&a.useShortestReferences){const n=function(e,t,a){const n="&#"+String(e);return a&&t&&!l.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);n.length<r.length&&(r=n)}return n&&(!a.useShortestReferences||n.length<r.length)?n:r}function b(e,t){return c(e,Object.assign({format:y},t))}const v=/^>|^->|<!--|-->|--!>|<!-$/g,A=[">"],O=["<",">"];const C=q(1),E=q(-1),w=[];function q(t){return function(a,n,r){const o=a?a.children:w;let s=(n||0)+t,i=o[s];if(!r)for(;i&&e.whitespace(i);)s+=t,i=o[s];return i}}const S={}.hasOwnProperty;function x(e){return function(t,a,n){return S.call(e,t.tagName)&&e[t.tagName](t,a,n)}}const D=x({body:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},caption:R,colgroup:R,dd:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:R,html:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},li:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,a){const n=C(a,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!a||!("element"===a.type&&("a"===a.tagName||"audio"===a.tagName||"del"===a.tagName||"ins"===a.tagName||"map"===a.tagName||"noscript"===a.tagName||"video"===a.tagName))},rp:j,rt:j,tbody:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:T,tfoot:function(e,t,a){return!C(a,t)},th:T,thead:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"tr"===n.tagName}});function R(t,a,n){const r=C(n,a,!0);return!r||"comment"!==r.type&&!("text"===r.type&&e.whitespace(r.value.charAt(0)))}function j(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function T(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}const U=x({body:function(t){const a=C(t,-1,!0);return!(a&&("comment"===a.type||"text"===a.type&&e.whitespace(a.value.charAt(0))||"element"===a.type&&("meta"===a.tagName||"link"===a.tagName||"script"===a.tagName||"style"===a.tagName||"template"===a.tagName)))},colgroup:function(e,t,a){const n=E(a,t),r=C(e,-1,!0);if(a&&n&&"element"===n.type&&"colgroup"===n.tagName&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const a=e.children[0];return!a||"element"===a.type},html:function(e){const t=C(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,a){const n=E(a,t),r=C(e,-1);if(a&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const F={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function P(t,a,n){const r=e.find(t.schema,a),o=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let i,c=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const u=b(r.attribute,Object.assign({},t.settings.characterReferences,{subset:F.name[o][s]}));return!0===n?u:(n=Array.isArray(n)?(r.commaSeparated?e.stringify:e.stringify$1)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?u:(t.settings.preferUnquoted&&(i=b(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:F.unquoted[o][s]}))),i!==n&&(t.settings.quoteSmart&&e.ccount(n,c)>e.ccount(n,t.alternative)&&(c=t.alternative),i=c+b(n,Object.assign({},t.settings.characterReferences,{subset:("'"===c?F.single:F.double)[o][s],attribute:!0}))+c),u+(i?"="+i:i)))}const I=["<","&"];function k(e,t,a,n){return!a||"element"!==a.type||"script"!==a.tagName&&"style"!==a.tagName?b(e.value,Object.assign({},n.settings.characterReferences,{subset:I})):e.value}const B=t.zwitch("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,a,n){return n.settings.bogusComments?"<?"+b(e.value,Object.assign({},n.settings.characterReferences,{subset:A}))+">":"\x3c!--"+e.value.replace(v,function(e){return b(e,Object.assign({},n.settings.characterReferences,{subset:O}))})+"--\x3e"},doctype:function(e,t,a,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(t,a,n,r){const o=r.schema,s="svg"!==o.space&&r.settings.omitOptionalTags;let i="svg"===o.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const c=[];let u;"html"===o.space&&"svg"===t.tagName&&(r.schema=e.svg);const l=function(e,t){const a=[];let n,r=-1;if(t)for(n in t)if(null!==t[n]&&void 0!==t[n]){const r=P(e,n,t[n]);r&&a.push(r)}for(;++r<a.length;){const t=e.settings.tightAttributes?a[r].charAt(a[r].length-1):void 0;r!==a.length-1&&'"'!==t&&"'"!==t&&(a[r]+=" ")}return a.join("")}(r,t.properties),m=r.all("html"===o.space&&"template"===t.tagName?t.content:t);return r.schema=o,m&&(i=!1),!l&&s&&U(t,a,n)||(c.push("<",t.tagName,l?" "+l:""),i&&("svg"===o.space||r.settings.closeSelfClosing)&&(u=l.charAt(l.length-1),(!r.settings.tightSelfClosing||"/"===u||u&&'"'!==u&&"'"!==u)&&c.push(" "),c.push("/")),c.push(">")),c.push(m),i||s&&D(t,a,n)||c.push("</"+t.tagName+">"),c.join("")},raw:function(e,t,a,n){return n.settings.allowDangerousHtml?e.value:k(e,0,a,n)},root:function(e,t,a,n){return n.all(e)},text:k}});const z={},H={},L=[];function Y(e,t,a){return B(e,t,a,this)}function M(e){const t=[],a=e&&e.children||L;let n=-1;for(;++n<a.length;)t[n]=this.one(a[n],n,e);return t.join("")}exports.default=function(t){const n={...this.data("settings"),...t};this.compiler=function(t){return function(t,n){const r=n||z,o=r.quote||'"',s='"'===o?"'":'"';if('"'!==o&&"'"!==o)throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Y,all:M,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||a,characterReferences:r.characterReferences||H,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?e.svg:e.html,quote:o,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,n)}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs"),t=require("./index-2yo2kUGy.cjs"),a=["area","base","basefont","bgsound","br","col","command","embed","frame","hr","image","img","input","keygen","link","meta","param","source","track","wbr"],n=/["&'<>`]/g,r=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,o=/[\x01-\t\v\f\x0E-\x1F\x7F\x81\x8D\x8F\x90\x9D\xA0-\uFFFF]/g,s=/[|\\{}()[\]^$+*?.]/g,i=new WeakMap;function c(e,t){return e=e.replace(t.subset?function(e){let t=i.get(e);t||(t=function(e){const t=[];let a=-1;for(;++a<e.length;)t.push(e[a].replace(s,"\\$&"));return new RegExp("(?:"+t.join("|")+")","g")}(e),i.set(e,t));return t}(t.subset):n,a),t.subset||t.escapeOnly?e:e.replace(r,function(e,a,n){return t.format(1024*(e.charCodeAt(0)-55296)+e.charCodeAt(1)-56320+65536,n.charCodeAt(a+2),t)}).replace(o,a);function a(e,a,n){return t.format(e.charCodeAt(0),n.charCodeAt(a+1),t)}}const u=/[\dA-Fa-f]/;const l=/\d/;const m=["AElig","AMP","Aacute","Acirc","Agrave","Aring","Atilde","Auml","COPY","Ccedil","ETH","Eacute","Ecirc","Egrave","Euml","GT","Iacute","Icirc","Igrave","Iuml","LT","Ntilde","Oacute","Ocirc","Ograve","Oslash","Otilde","Ouml","QUOT","REG","THORN","Uacute","Ucirc","Ugrave","Uuml","Yacute","aacute","acirc","acute","aelig","agrave","amp","aring","atilde","auml","brvbar","ccedil","cedil","cent","copy","curren","deg","divide","eacute","ecirc","egrave","eth","euml","frac12","frac14","frac34","gt","iacute","icirc","iexcl","igrave","iquest","iuml","laquo","lt","macr","micro","middot","nbsp","not","ntilde","oacute","ocirc","ograve","ordf","ordm","oslash","otilde","ouml","para","plusmn","pound","quot","raquo","reg","sect","shy","sup1","sup2","sup3","szlig","thorn","times","uacute","ucirc","ugrave","uml","uuml","yacute","yen","yuml"],g={nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"­",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",fnof:"ƒ",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",bull:"•",hellip:"…",prime:"′",Prime:"″",oline:"‾",frasl:"⁄",weierp:"℘",image:"ℑ",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦",quot:'"',amp:"&",lt:"<",gt:">",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",circ:"ˆ",tilde:"˜",ensp:" ",emsp:" ",thinsp:" ",zwnj:"‌",zwj:"‍",lrm:"‎",rlm:"‏",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",permil:"‰",lsaquo:"‹",rsaquo:"›",euro:"€"},p=["cent","copy","divide","gt","lt","not","para","times"],d={}.hasOwnProperty,f={};let h;for(h in g)d.call(g,h)&&(f[g[h]]=h);const N=/[^\dA-Za-z]/;function y(e,t,a){let n,r=function(e,t,a){const n="&#x"+e.toString(16).toUpperCase();return a&&t&&!u.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);if((a.useNamedReferences||a.useShortestReferences)&&(n=function(e,t,a,n){const r=String.fromCharCode(e);if(d.call(f,r)){const e=f[r],o="&"+e;return a&&m.includes(e)&&!p.includes(e)&&(!n||t&&61!==t&&N.test(String.fromCharCode(t)))?o:o+";"}return""}(e,t,a.omitOptionalSemicolons,a.attribute)),(a.useShortestReferences||!n)&&a.useShortestReferences){const n=function(e,t,a){const n="&#"+String(e);return a&&t&&!l.test(String.fromCharCode(t))?n:n+";"}(e,t,a.omitOptionalSemicolons);n.length<r.length&&(r=n)}return n&&(!a.useShortestReferences||n.length<r.length)?n:r}function b(e,t){return c(e,Object.assign({format:y},t))}const v=/^>|^->|<!--|-->|--!>|<!-$/g,A=[">"],O=["<",">"];const C=q(1),E=q(-1),w=[];function q(t){return function(a,n,r){const o=a?a.children:w;let s=(n||0)+t,i=o[s];if(!r)for(;i&&e.whitespace(i);)s+=t,i=o[s];return i}}const S={}.hasOwnProperty;function x(e){return function(t,a,n){return S.call(e,t.tagName)&&e[t.tagName](t,a,n)}}const D=x({body:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},caption:R,colgroup:R,dd:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName)},dt:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("dt"===n.tagName||"dd"===n.tagName))},head:R,html:function(e,t,a){const n=C(a,t);return!n||"comment"!==n.type},li:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"li"===n.tagName},optgroup:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"optgroup"===n.tagName},option:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("option"===n.tagName||"optgroup"===n.tagName)},p:function(e,t,a){const n=C(a,t);return n?"element"===n.type&&("address"===n.tagName||"article"===n.tagName||"aside"===n.tagName||"blockquote"===n.tagName||"details"===n.tagName||"div"===n.tagName||"dl"===n.tagName||"fieldset"===n.tagName||"figcaption"===n.tagName||"figure"===n.tagName||"footer"===n.tagName||"form"===n.tagName||"h1"===n.tagName||"h2"===n.tagName||"h3"===n.tagName||"h4"===n.tagName||"h5"===n.tagName||"h6"===n.tagName||"header"===n.tagName||"hgroup"===n.tagName||"hr"===n.tagName||"main"===n.tagName||"menu"===n.tagName||"nav"===n.tagName||"ol"===n.tagName||"p"===n.tagName||"pre"===n.tagName||"section"===n.tagName||"table"===n.tagName||"ul"===n.tagName):!a||!("element"===a.type&&("a"===a.tagName||"audio"===a.tagName||"del"===a.tagName||"ins"===a.tagName||"map"===a.tagName||"noscript"===a.tagName||"video"===a.tagName))},rp:j,rt:j,tbody:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName)},td:T,tfoot:function(e,t,a){return!C(a,t)},th:T,thead:function(e,t,a){const n=C(a,t);return Boolean(n&&"element"===n.type&&("tbody"===n.tagName||"tfoot"===n.tagName))},tr:function(e,t,a){const n=C(a,t);return!n||"element"===n.type&&"tr"===n.tagName}});function R(t,a,n){const r=C(n,a,!0);return!r||"comment"!==r.type&&!("text"===r.type&&e.whitespace(r.value.charAt(0)))}function j(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("rp"===n.tagName||"rt"===n.tagName)}function T(e,t,a){const n=C(a,t);return!n||"element"===n.type&&("td"===n.tagName||"th"===n.tagName)}const U=x({body:function(t){const a=C(t,-1,!0);return!(a&&("comment"===a.type||"text"===a.type&&e.whitespace(a.value.charAt(0))||"element"===a.type&&("meta"===a.tagName||"link"===a.tagName||"script"===a.tagName||"style"===a.tagName||"template"===a.tagName)))},colgroup:function(e,t,a){const n=E(a,t),r=C(e,-1,!0);if(a&&n&&"element"===n.type&&"colgroup"===n.tagName&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"col"===r.tagName)},head:function(e){const t=new Set;for(const n of e.children)if("element"===n.type&&("base"===n.tagName||"title"===n.tagName)){if(t.has(n.tagName))return!1;t.add(n.tagName)}const a=e.children[0];return!a||"element"===a.type},html:function(e){const t=C(e,-1);return!t||"comment"!==t.type},tbody:function(e,t,a){const n=E(a,t),r=C(e,-1);if(a&&n&&"element"===n.type&&("thead"===n.tagName||"tbody"===n.tagName)&&D(n,a.children.indexOf(n),a))return!1;return Boolean(r&&"element"===r.type&&"tr"===r.tagName)}});const F={name:[["\t\n\f\r &/=>".split(""),"\t\n\f\r \"&'/=>`".split("")],["\0\t\n\f\r \"&'/<=>".split(""),"\0\t\n\f\r \"&'/<=>`".split("")]],unquoted:[["\t\n\f\r &>".split(""),"\0\t\n\f\r \"&'<=>`".split("")],["\0\t\n\f\r \"&'<=>`".split(""),"\0\t\n\f\r \"&'<=>`".split("")]],single:[["&'".split(""),"\"&'`".split("")],["\0&'".split(""),"\0\"&'`".split("")]],double:[['"&'.split(""),"\"&'`".split("")],['\0"&'.split(""),"\0\"&'`".split("")]]};function P(t,a,n){const r=e.find(t.schema,a),o=t.settings.allowParseErrors&&"html"===t.schema.space?0:1,s=t.settings.allowDangerousCharacters?0:1;let i,c=t.quote;if(!r.overloadedBoolean||n!==r.attribute&&""!==n?!r.boolean&&!r.overloadedBoolean||"string"==typeof n&&n!==r.attribute&&""!==n||(n=Boolean(n)):n=!0,null==n||!1===n||"number"==typeof n&&Number.isNaN(n))return"";const u=b(r.attribute,Object.assign({},t.settings.characterReferences,{subset:F.name[o][s]}));return!0===n?u:(n=Array.isArray(n)?(r.commaSeparated?e.stringify:e.stringify$1)(n,{padLeft:!t.settings.tightCommaSeparatedLists}):String(n),t.settings.collapseEmptyAttributes&&!n?u:(t.settings.preferUnquoted&&(i=b(n,Object.assign({},t.settings.characterReferences,{attribute:!0,subset:F.unquoted[o][s]}))),i!==n&&(t.settings.quoteSmart&&e.ccount(n,c)>e.ccount(n,t.alternative)&&(c=t.alternative),i=c+b(n,Object.assign({},t.settings.characterReferences,{subset:("'"===c?F.single:F.double)[o][s],attribute:!0}))+c),u+(i?"="+i:i)))}const I=["<","&"];function k(e,t,a,n){return!a||"element"!==a.type||"script"!==a.tagName&&"style"!==a.tagName?b(e.value,Object.assign({},n.settings.characterReferences,{subset:I})):e.value}const B=t.zwitch("type",{invalid:function(e){throw new Error("Expected node, not `"+e+"`")},unknown:function(e){throw new Error("Cannot compile unknown node `"+e.type+"`")},handlers:{comment:function(e,t,a,n){return n.settings.bogusComments?"<?"+b(e.value,Object.assign({},n.settings.characterReferences,{subset:A}))+">":"\x3c!--"+e.value.replace(v,function(e){return b(e,Object.assign({},n.settings.characterReferences,{subset:O}))})+"--\x3e"},doctype:function(e,t,a,n){return"<!"+(n.settings.upperDoctype?"DOCTYPE":"doctype")+(n.settings.tightDoctype?"":" ")+"html>"},element:function(t,a,n,r){const o=r.schema,s="svg"!==o.space&&r.settings.omitOptionalTags;let i="svg"===o.space?r.settings.closeEmptyElements:r.settings.voids.includes(t.tagName.toLowerCase());const c=[];let u;"html"===o.space&&"svg"===t.tagName&&(r.schema=e.svg);const l=function(e,t){const a=[];let n,r=-1;if(t)for(n in t)if(null!==t[n]&&void 0!==t[n]){const r=P(e,n,t[n]);r&&a.push(r)}for(;++r<a.length;){const t=e.settings.tightAttributes?a[r].charAt(a[r].length-1):void 0;r!==a.length-1&&'"'!==t&&"'"!==t&&(a[r]+=" ")}return a.join("")}(r,t.properties),m=r.all("html"===o.space&&"template"===t.tagName?t.content:t);return r.schema=o,m&&(i=!1),!l&&s&&U(t,a,n)||(c.push("<",t.tagName,l?" "+l:""),i&&("svg"===o.space||r.settings.closeSelfClosing)&&(u=l.charAt(l.length-1),(!r.settings.tightSelfClosing||"/"===u||u&&'"'!==u&&"'"!==u)&&c.push(" "),c.push("/")),c.push(">")),c.push(m),i||s&&D(t,a,n)||c.push("</"+t.tagName+">"),c.join("")},raw:function(e,t,a,n){return n.settings.allowDangerousHtml?e.value:k(e,0,a,n)},root:function(e,t,a,n){return n.all(e)},text:k}});const z={},H={},L=[];function Y(e,t,a){return B(e,t,a,this)}function M(e){const t=[],a=e&&e.children||L;let n=-1;for(;++n<a.length;)t[n]=this.one(a[n],n,e);return t.join("")}exports.default=function(t){const n={...this.data("settings"),...t};this.compiler=function(t){return function(t,n){const r=n||z,o=r.quote||'"',s='"'===o?"'":'"';if('"'!==o&&"'"!==o)throw new Error("Invalid quote `"+o+"`, expected `'` or `\"`");return{one:Y,all:M,settings:{omitOptionalTags:r.omitOptionalTags||!1,allowParseErrors:r.allowParseErrors||!1,allowDangerousCharacters:r.allowDangerousCharacters||!1,quoteSmart:r.quoteSmart||!1,preferUnquoted:r.preferUnquoted||!1,tightAttributes:r.tightAttributes||!1,upperDoctype:r.upperDoctype||!1,tightDoctype:r.tightDoctype||!1,bogusComments:r.bogusComments||!1,tightCommaSeparatedLists:r.tightCommaSeparatedLists||!1,tightSelfClosing:r.tightSelfClosing||!1,collapseEmptyAttributes:r.collapseEmptyAttributes||!1,allowDangerousHtml:r.allowDangerousHtml||!1,voids:r.voids||a,characterReferences:r.characterReferences||H,closeSelfClosing:r.closeSelfClosing||!1,closeEmptyElements:r.closeEmptyElements||!1},schema:"svg"===r.space?e.svg:e.html,quote:o,alternative:s}.one(Array.isArray(t)?{type:"root",children:t}:t,void 0,void 0)}(t,n)}};
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2yo2kUGy.cjs"),t=require("./index-CSKkNkjZ.cjs"),n={}.hasOwnProperty;function r(e,t){let o,i=-1;if(t.extensions)for(;++i<t.extensions.length;)r(e,t.extensions[i]);for(o in t)if(n.call(t,o))switch(o){case"extensions":break;case"unsafe":case"join":c(e[o],t[o]);break;case"handlers":a(e[o],t[o]);break;default:e.options[o]=t[o]}return e}function c(e,t){t&&e.push(...t)}function a(e,t){t&&Object.assign(e,t)}const o=[function(e,n,r,c){if("code"===n.type&&t.formatCodeAsIndented(n,c)&&("list"===e.type||e.type===n.type&&t.formatCodeAsIndented(e,c)))return!1;if("spread"in r&&"boolean"==typeof r.spread){if("paragraph"===e.type&&(e.type===n.type||"definition"===n.type||"heading"===n.type&&t.formatHeadingAsSetext(n,c)))return;return r.spread?1:0}}];const i=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],s=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:i},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:i},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:i},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"~"}];function h(e){return e.label||!e.identifier?e.label||"":t.decodeString(e.identifier)}function u(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function f(e,t,n,r){let c=r.join.length;for(;c--;){const a=r.join[c](e,t,n,r);if(!0===a||1===a)break;if("number"==typeof a)return"\n".repeat(1+a);if(!1===a)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const l=/\r?\n|\r/g;function d(e,t){const n=[];let r,c=0,a=0;for(;r=l.exec(e);)o(e.slice(c,r.index)),n.push(r[0]),c=r.index+r[0].length,a++;return o(e.slice(c)),n.join("");function o(e){n.push(t(e,a,!e))}}function p(e,t){return e-t}function g(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],c=[],a=e+t;let o,i=-1,s=0;for(;o=n.exec(a);)r.push(o.index);for(;++i<r.length;)s!==r[i]&&c.push(e.slice(s,r[i])),c.push("\\"),s=r[i];return c.push(e.slice(s)),c.join("")}function C(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,c=n.line||1,a=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),o=n[n.length-1];return c+=n.length-1,a=1===n.length?a+o.length:1+o.length+r,t},current:function(){return{now:{line:c,column:a},lineShift:r}},shift:function(e){r+=e}}}function b(n,c){const a=c||{},i={associationId:h,containerPhrasing:y,containerFlow:v,createTracker:C,compilePattern:u,enter:function(e){return i.stack.push(e),function(){i.stack.pop()}},handlers:{...t.handle},handle:void 0,indentLines:d,indexStack:[],join:[...o],options:{},safe:m,stack:[],unsafe:[...s]};r(i,a),i.options.tightDefinitions&&i.join.push(A),i.handle=e.zwitch("type",{invalid:k,unknown:x,handlers:i.handlers});let f=i.handle(n,void 0,i,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return f&&10!==f.charCodeAt(f.length-1)&&13!==f.charCodeAt(f.length-1)&&(f+="\n"),f}function k(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function x(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function A(e,t){if("definition"===e.type&&e.type===t.type)return 0}function y(e,n){return function(e,n,r){const c=n.indexStack,a=e.children||[],o=[];let i,s=-1,h=r.before;c.push(-1);let u=n.createTracker(r);for(;++s<a.length;){const f=a[s];let l;if(c[c.length-1]=s,s+1<a.length){let t=n.handle.handlers[a[s+1].type];t&&t.peek&&(t=t.peek),l=t?t(a[s+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else l=r.after;o.length>0&&("\r"===h||"\n"===h)&&"html"===f.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),h=" ",u=n.createTracker(r),u.move(o.join("")));let d=n.handle(f,e,n,{...u.current(),after:l,before:h});i&&i===d.slice(0,1)&&(d=t.encodeCharacterReference(i.charCodeAt(0))+d.slice(1));const p=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,i=void 0,p&&(o.length>0&&p.before&&h===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+t.encodeCharacterReference(h.charCodeAt(0))),p.after&&(i=l)),u.move(d),o.push(d),h=d.slice(-1)}return c.pop(),o.join("")}(e,this,n)}function v(e,t){return function(e,t,n){const r=t.indexStack,c=e.children||[],a=t.createTracker(n),o=[];let i=-1;for(r.push(-1);++i<c.length;){const n=c[i];r[r.length-1]=i,o.push(a.move(t.handle(n,e,t,{before:"\n",after:"\n",...a.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),i<c.length-1&&o.push(a.move(f(n,c[i+1],e,t)))}return r.pop(),o.join("")}(e,this,t)}function m(e,n){return function(e,n,r){const c=(r.before||"")+(n||"")+(r.after||""),a=[],o=[],i={};let s=-1;for(;++s<e.unsafe.length;){const n=e.unsafe[s];if(!t.patternInScope(e.stack,n))continue;const r=e.compilePattern(n);let o;for(;o=r.exec(c);){const e="before"in n||Boolean(n.atBreak),t="after"in n,r=o.index+(e?o[1].length:0);a.includes(r)?(i[r].before&&!e&&(i[r].before=!1),i[r].after&&!t&&(i[r].after=!1)):(a.push(r),i[r]={before:e,after:t})}}a.sort(p);let h=r.before?r.before.length:0;const u=c.length-(r.after?r.after.length:0);for(s=-1;++s<a.length;){const e=a[s];e<h||e>=u||e+1<u&&a[s+1]===e+1&&i[e].after&&!i[e+1].before&&!i[e+1].after||a[s-1]===e-1&&i[e].before&&!i[e-1].before&&!i[e-1].after||(h!==e&&o.push(g(c.slice(h,e),"\\")),h=e,!/[!-/:-@[-`{-~]/.test(c.charAt(e))||r.encode&&r.encode.includes(c.charAt(e))?(o.push(t.encodeCharacterReference(c.charCodeAt(e))),h++):o.push("\\"))}return o.push(g(c.slice(h,u),r.after)),o.join("")}(this,e,n)}exports.default=function(e){const t=this;t.compiler=function(n){return b(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-2yo2kUGy.cjs"),t=require("./index-DAECv62A.cjs"),n={}.hasOwnProperty;function r(e,t){let o,i=-1;if(t.extensions)for(;++i<t.extensions.length;)r(e,t.extensions[i]);for(o in t)if(n.call(t,o))switch(o){case"extensions":break;case"unsafe":case"join":c(e[o],t[o]);break;case"handlers":a(e[o],t[o]);break;default:e.options[o]=t[o]}return e}function c(e,t){t&&e.push(...t)}function a(e,t){t&&Object.assign(e,t)}const o=[function(e,n,r,c){if("code"===n.type&&t.formatCodeAsIndented(n,c)&&("list"===e.type||e.type===n.type&&t.formatCodeAsIndented(e,c)))return!1;if("spread"in r&&"boolean"==typeof r.spread){if("paragraph"===e.type&&(e.type===n.type||"definition"===n.type||"heading"===n.type&&t.formatHeadingAsSetext(n,c)))return;return r.spread?1:0}}];const i=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],s=[{character:"\t",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",before:"[\\r\\n]",inConstruct:"phrasing"},{character:"\t",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:"\n",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:i},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:"(?:[\r\n]|$)"},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:"(?:[ \t\r\n*])"},{character:"*",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"+",after:"(?:[ \t\r\n])"},{atBreak:!0,character:"-",after:"(?:[ \t\r\n-])"},{atBreak:!0,before:"\\d+",character:".",after:"(?:[ \t\r\n]|$)"},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:i},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:i},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:i},{atBreak:!0,character:"~"}];function h(e){return e.label||!e.identifier?e.label||"":t.decodeString(e.identifier)}function u(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function f(e,t,n,r){let c=r.join.length;for(;c--;){const a=r.join[c](e,t,n,r);if(!0===a||1===a)break;if("number"==typeof a)return"\n".repeat(1+a);if(!1===a)return"\n\n\x3c!----\x3e\n\n"}return"\n\n"}const l=/\r?\n|\r/g;function d(e,t){const n=[];let r,c=0,a=0;for(;r=l.exec(e);)o(e.slice(c,r.index)),n.push(r[0]),c=r.index+r[0].length,a++;return o(e.slice(c)),n.join("");function o(e){n.push(t(e,a,!e))}}function p(e,t){return e-t}function g(e,t){const n=/\\(?=[!-/:-@[-`{-~])/g,r=[],c=[],a=e+t;let o,i=-1,s=0;for(;o=n.exec(a);)r.push(o.index);for(;++i<r.length;)s!==r[i]&&c.push(e.slice(s,r[i])),c.push("\\"),s=r[i];return c.push(e.slice(s)),c.join("")}function C(e){const t=e||{},n=t.now||{};let r=t.lineShift||0,c=n.line||1,a=n.column||1;return{move:function(e){const t=e||"",n=t.split(/\r?\n|\r/g),o=n[n.length-1];return c+=n.length-1,a=1===n.length?a+o.length:1+o.length+r,t},current:function(){return{now:{line:c,column:a},lineShift:r}},shift:function(e){r+=e}}}function b(n,c){const a=c||{},i={associationId:h,containerPhrasing:y,containerFlow:v,createTracker:C,compilePattern:u,enter:function(e){return i.stack.push(e),function(){i.stack.pop()}},handlers:{...t.handle},handle:void 0,indentLines:d,indexStack:[],join:[...o],options:{},safe:m,stack:[],unsafe:[...s]};r(i,a),i.options.tightDefinitions&&i.join.push(A),i.handle=e.zwitch("type",{invalid:k,unknown:x,handlers:i.handlers});let f=i.handle(n,void 0,i,{before:"\n",after:"\n",now:{line:1,column:1},lineShift:0});return f&&10!==f.charCodeAt(f.length-1)&&13!==f.charCodeAt(f.length-1)&&(f+="\n"),f}function k(e){throw new Error("Cannot handle value `"+e+"`, expected node")}function x(e){throw new Error("Cannot handle unknown node `"+e.type+"`")}function A(e,t){if("definition"===e.type&&e.type===t.type)return 0}function y(e,n){return function(e,n,r){const c=n.indexStack,a=e.children||[],o=[];let i,s=-1,h=r.before;c.push(-1);let u=n.createTracker(r);for(;++s<a.length;){const f=a[s];let l;if(c[c.length-1]=s,s+1<a.length){let t=n.handle.handlers[a[s+1].type];t&&t.peek&&(t=t.peek),l=t?t(a[s+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else l=r.after;o.length>0&&("\r"===h||"\n"===h)&&"html"===f.type&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),h=" ",u=n.createTracker(r),u.move(o.join("")));let d=n.handle(f,e,n,{...u.current(),after:l,before:h});i&&i===d.slice(0,1)&&(d=t.encodeCharacterReference(i.charCodeAt(0))+d.slice(1));const p=n.attentionEncodeSurroundingInfo;n.attentionEncodeSurroundingInfo=void 0,i=void 0,p&&(o.length>0&&p.before&&h===o[o.length-1].slice(-1)&&(o[o.length-1]=o[o.length-1].slice(0,-1)+t.encodeCharacterReference(h.charCodeAt(0))),p.after&&(i=l)),u.move(d),o.push(d),h=d.slice(-1)}return c.pop(),o.join("")}(e,this,n)}function v(e,t){return function(e,t,n){const r=t.indexStack,c=e.children||[],a=t.createTracker(n),o=[];let i=-1;for(r.push(-1);++i<c.length;){const n=c[i];r[r.length-1]=i,o.push(a.move(t.handle(n,e,t,{before:"\n",after:"\n",...a.current()}))),"list"!==n.type&&(t.bulletLastUsed=void 0),i<c.length-1&&o.push(a.move(f(n,c[i+1],e,t)))}return r.pop(),o.join("")}(e,this,t)}function m(e,n){return function(e,n,r){const c=(r.before||"")+(n||"")+(r.after||""),a=[],o=[],i={};let s=-1;for(;++s<e.unsafe.length;){const n=e.unsafe[s];if(!t.patternInScope(e.stack,n))continue;const r=e.compilePattern(n);let o;for(;o=r.exec(c);){const e="before"in n||Boolean(n.atBreak),t="after"in n,r=o.index+(e?o[1].length:0);a.includes(r)?(i[r].before&&!e&&(i[r].before=!1),i[r].after&&!t&&(i[r].after=!1)):(a.push(r),i[r]={before:e,after:t})}}a.sort(p);let h=r.before?r.before.length:0;const u=c.length-(r.after?r.after.length:0);for(s=-1;++s<a.length;){const e=a[s];e<h||e>=u||e+1<u&&a[s+1]===e+1&&i[e].after&&!i[e+1].before&&!i[e+1].after||a[s-1]===e-1&&i[e].before&&!i[e-1].before&&!i[e-1].after||(h!==e&&o.push(g(c.slice(h,e),"\\")),h=e,!/[!-/:-@[-`{-~]/.test(c.charAt(e))||r.encode&&r.encode.includes(c.charAt(e))?(o.push(t.encodeCharacterReference(c.charCodeAt(e))),h++):o.push("\\"))}return o.push(g(c.slice(h,u),r.after)),o.join("")}(this,e,n)}exports.default=function(e){const t=this;t.compiler=function(n){return b(n,{...t.data("settings"),...e,extensions:t.data("toMarkdownExtensions")||[]})}};
@@ -1,4 +1,4 @@
1
- import { c, d, b, h } from "./index-BB--QoGv.js";
1
+ import { c, d, b, h } from "./index-BiS-zzbc.js";
2
2
  export {
3
3
  c as default,
4
4
  d as defaultFootnoteBackContent,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs");exports.unified=e.unified;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs");exports.unified=e.unified;
@@ -1593,6 +1593,7 @@ const AiList = ({
1593
1593
  handleEdit,
1594
1594
  handleDelete: handleDelete2,
1595
1595
  handleWrite,
1596
+ handleTestStone,
1596
1597
  usageIncrementFn
1597
1598
  }) => {
1598
1599
  const navigate = useNavigate();
@@ -1745,15 +1746,16 @@ const AiList = ({
1745
1746
  };
1746
1747
  const openCard = (card) => {
1747
1748
  console.log("openCard", card);
1748
- if (card.customize === "试金石") {
1749
- navigate("/new-chat/interrogation-record");
1750
- return;
1751
- }
1752
1749
  if (handleWrite) {
1753
1750
  if (card.customize === "在线写作") {
1754
1751
  return handleWrite(card);
1755
1752
  }
1756
1753
  }
1754
+ if (handleTestStone) {
1755
+ if (card.customize === "试金石") {
1756
+ return handleTestStone(card);
1757
+ }
1758
+ }
1757
1759
  if (card.uiType === "default") {
1758
1760
  if (handleAppClick) {
1759
1761
  return handleAppClick(card);
@@ -46832,7 +46834,7 @@ const BlockEdit = ({
46832
46834
  const initVueEditor = async () => {
46833
46835
  if (editorRef.current) {
46834
46836
  try {
46835
- const BlockNoteEditorModule = await import("./index.es-DD7ie9BT.js");
46837
+ const BlockNoteEditorModule = await import("./index.es-CfXmOPUR.js");
46836
46838
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
46837
46839
  const theme = {
46838
46840
  colors: {
@@ -46955,6 +46957,7 @@ const AgentWebIndex = ({
46955
46957
  Edit,
46956
46958
  Delete,
46957
46959
  Write,
46960
+ TestStone,
46958
46961
  Increment,
46959
46962
  pageType,
46960
46963
  Back
@@ -47063,6 +47066,12 @@ const AgentWebIndex = ({
47063
47066
  Write(card);
47064
47067
  }
47065
47068
  }, []);
47069
+ const handleTestStone = useCallback((card) => {
47070
+ console.log("handleTestStone", card);
47071
+ if (TestStone) {
47072
+ TestStone(card);
47073
+ }
47074
+ }, []);
47066
47075
  const handleUsageIncrement = useCallback((card) => {
47067
47076
  console.log("handleUsageIncrement", card);
47068
47077
  if (Increment) {
@@ -47097,6 +47106,7 @@ const AgentWebIndex = ({
47097
47106
  handleEdit,
47098
47107
  handleDelete: handleDelete2,
47099
47108
  handleWrite,
47109
+ handleTestStone,
47100
47110
  handleAppClick,
47101
47111
  usageIncrementFn: handleUsageIncrement
47102
47112
  }
@@ -47788,7 +47798,7 @@ const AiBlockEdit = ({
47788
47798
  const initVueEditor = async () => {
47789
47799
  if (editorRef.current) {
47790
47800
  try {
47791
- const BlockNoteEditorModule = await import("./index.es-DD7ie9BT.js");
47801
+ const BlockNoteEditorModule = await import("./index.es-CfXmOPUR.js");
47792
47802
  const BlockNoteEditor = BlockNoteEditorModule.BlockNoteEditor;
47793
47803
  const theme = {
47794
47804
  colors: {
@@ -48837,7 +48847,7 @@ class BasePromptTemplate extends Runnable {
48837
48847
  return PromptTemplate2.deserialize({ ...data, _type: "prompt" });
48838
48848
  }
48839
48849
  case "few_shot": {
48840
- const { FewShotPromptTemplate } = await import("./few_shot-CXrHoFil.js");
48850
+ const { FewShotPromptTemplate } = await import("./few_shot-Dr2a_vSB.js");
48841
48851
  return FewShotPromptTemplate.deserialize(data);
48842
48852
  }
48843
48853
  default:
@@ -50409,35 +50419,35 @@ class BaseChain extends BaseLangChain {
50409
50419
  static async deserialize(data, values = {}) {
50410
50420
  switch (data._type) {
50411
50421
  case "llm_chain": {
50412
- const { LLMChain } = await import("./llm_chain-BeI0W_p-.js");
50422
+ const { LLMChain } = await import("./llm_chain-btHQ9Ypf.js");
50413
50423
  return LLMChain.deserialize(data);
50414
50424
  }
50415
50425
  case "sequential_chain": {
50416
- const { SequentialChain } = await import("./sequential_chain-DOfqDL23.js");
50426
+ const { SequentialChain } = await import("./sequential_chain-C4uMLvT0.js");
50417
50427
  return SequentialChain.deserialize(data);
50418
50428
  }
50419
50429
  case "simple_sequential_chain": {
50420
- const { SimpleSequentialChain } = await import("./sequential_chain-DOfqDL23.js");
50430
+ const { SimpleSequentialChain } = await import("./sequential_chain-C4uMLvT0.js");
50421
50431
  return SimpleSequentialChain.deserialize(data);
50422
50432
  }
50423
50433
  case "stuff_documents_chain": {
50424
- const { StuffDocumentsChain } = await import("./combine_docs_chain-COuoBXN8.js");
50434
+ const { StuffDocumentsChain } = await import("./combine_docs_chain-DTj2391W.js");
50425
50435
  return StuffDocumentsChain.deserialize(data);
50426
50436
  }
50427
50437
  case "map_reduce_documents_chain": {
50428
- const { MapReduceDocumentsChain } = await import("./combine_docs_chain-COuoBXN8.js");
50438
+ const { MapReduceDocumentsChain } = await import("./combine_docs_chain-DTj2391W.js");
50429
50439
  return MapReduceDocumentsChain.deserialize(data);
50430
50440
  }
50431
50441
  case "refine_documents_chain": {
50432
- const { RefineDocumentsChain } = await import("./combine_docs_chain-COuoBXN8.js");
50442
+ const { RefineDocumentsChain } = await import("./combine_docs_chain-DTj2391W.js");
50433
50443
  return RefineDocumentsChain.deserialize(data);
50434
50444
  }
50435
50445
  case "vector_db_qa": {
50436
- const { VectorDBQAChain } = await import("./vector_db_qa-DQnKfZL6.js");
50446
+ const { VectorDBQAChain } = await import("./vector_db_qa-phOaenwb.js");
50437
50447
  return VectorDBQAChain.deserialize(data, values);
50438
50448
  }
50439
50449
  case "api_chain": {
50440
- const { APIChain } = await import("./api_chain-BdfZ6btS.js");
50450
+ const { APIChain } = await import("./api_chain-BydBma6z.js");
50441
50451
  return APIChain.deserialize(data);
50442
50452
  }
50443
50453
  default:
@@ -0,0 +1,4 @@
1
+ import { a } from "./index-BiS-zzbc.js";
2
+ export {
3
+ a as default
4
+ };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs");exports.default=e.remarkRehype,exports.defaultFootnoteBackContent=e.defaultFootnoteBackContent,exports.defaultFootnoteBackLabel=e.defaultFootnoteBackLabel,exports.defaultHandlers=e.handlers;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs");exports.default=e.remarkRehype,exports.defaultFootnoteBackContent=e.defaultFootnoteBackContent,exports.defaultFootnoteBackLabel=e.defaultFootnoteBackLabel,exports.defaultHandlers=e.handlers;
@@ -1,4 +1,4 @@
1
- import { w as whitespace, A as svg, I as find, L as stringify, M as stringify$1, N as ccount, D as html$2 } from "./index-BB--QoGv.js";
1
+ import { w as whitespace, A as svg, I as find, L as stringify, M as stringify$1, N as ccount, D as html$2 } from "./index-BiS-zzbc.js";
2
2
  import { z as zwitch } from "./index-BEZf1ZPW.js";
3
3
  const htmlVoidElements = [
4
4
  "area",
@@ -1,5 +1,5 @@
1
1
  import { z as zwitch } from "./index-BEZf1ZPW.js";
2
- import { q as formatCodeAsIndented, s as formatHeadingAsSetext, t as decodeString, x as encodeCharacterReference, y as patternInScope, z as handle } from "./index-BB--QoGv.js";
2
+ import { q as formatCodeAsIndented, s as formatHeadingAsSetext, t as decodeString, x as encodeCharacterReference, y as patternInScope, z as handle } from "./index-BiS-zzbc.js";
3
3
  const own = {}.hasOwnProperty;
4
4
  function configure(base, extension) {
5
5
  let index = -1;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CSKkNkjZ.cjs");exports.fromDom=e.fromDom;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-DAECv62A.cjs");exports.fromDom=e.fromDom;
@@ -1,5 +1,5 @@
1
- import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-DL9k9te9.js";
2
- import { v as visitParents, S as SKIP, w as whitespace } from "./index-BB--QoGv.js";
1
+ import { m as minifyWhitespace, e as embedded, p as phrasing } from "./index-BFoU0ue3.js";
2
+ import { v as visitParents, S as SKIP, w as whitespace } from "./index-BiS-zzbc.js";
3
3
  const whitespaceSensitiveTagNames = [
4
4
  "pre",
5
5
  "script",