@nside/wefa 0.1.0 → 0.2.0
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.
- package/dist/{LegalConsent-Cn3qx30k.cjs → LegalConsent-CT1w5kme.cjs} +1 -1
- package/dist/{LegalConsent-pUADprVB.js → LegalConsent-D1MwmijD.js} +2 -2
- package/dist/{LegalDocument-CU8uyoKh.cjs → LegalDocument-BIlRd478.cjs} +14 -14
- package/dist/{LegalDocument-BHtPY9AH.js → LegalDocument-Cg2xX6Mz.js} +4 -4
- package/dist/{apiClient-B6fJs4NI.cjs → apiClient-Bd4jmhT7.cjs} +1 -1
- package/dist/{apiClient-BAzNCKuU.js → apiClient-WXmPkrC5.js} +1 -1
- package/dist/{axios-C7yNV7KF.js → axios-C8xtaJSd.js} +157 -139
- package/dist/{axios-BompFBxL.cjs → axios-_3J2k8TN.cjs} +6 -6
- package/dist/{index-D7KjmN8m.cjs → index-BLnxyq8L.cjs} +1 -1
- package/dist/{index-CeYaMyhs.cjs → index-BZN-ifZE.cjs} +1 -1
- package/dist/{index-yOMKz8lD.cjs → index-CS8kqiJC.cjs} +1 -1
- package/dist/{index-jIUtvXF6.js → index-DIyoXwWo.js} +1 -1
- package/dist/{index--nRVi6aV.js → index-DclCrvhX.js} +1 -1
- package/dist/{index-BVwluHCk.js → index-_75ekX9o.js} +1 -1
- package/dist/{lib-BEVtXpEW.cjs → lib-B0OhMW6t.cjs} +4 -4
- package/dist/{lib-CA1k4S8X.js → lib-I1PMgFxW.js} +17 -14
- package/dist/lib.cjs +1 -1
- package/dist/lib.d.ts +6 -3
- package/dist/lib.js +1 -1
- package/dist/network.cjs +1 -1
- package/dist/network.d.ts +2 -2
- package/dist/network.js +3 -3
- package/package.json +30 -30
- package/src/components/PlotlyComponent/PlotlyFromTableComponent.mdx +182 -108
- package/src/components/PlotlyComponent/PlotlyFromTableComponent.spec.ts +24 -17
- package/src/components/PlotlyComponent/PlotlyFromTableComponent.stories.ts +99 -36
- package/src/components/PlotlyComponent/PlotlyFromTableComponent.vue +18 -10
- package/src/components/TableComponent/TableComponent.spec.ts +0 -1
- package/src/network/typedApiClient.ts +3 -2
- package/src/plugins/legalConsent/views/__tests__/LegalConsent.test.ts +9 -4
- package/src/utils/componentRegistry.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),v=require("./lib-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),w=require("vue-router"),v=require("./lib-B0OhMW6t.cjs"),T=require("./index-52nB-rKK.cjs"),k=require("pinia"),c=require("./axios-_3J2k8TN.cjs"),P=require("./index-TM4WIzFN.cjs");var V=Symbol();function I(){var t=e.inject(V);if(!t)throw new Error("No PrimeVue Toast provided!");return t}var A=Symbol();function N(){var t=e.inject(A);if(!t)throw new Error("No PrimeVue Confirmation provided!");return t}const R=k.createPinia(),_="authenticationToken",y="jwtAccessToken",x="jwtRefreshToken",L=(t,o=null)=>C(t)(o),C=t=>k.defineStore("backend",()=>j(t));function j(t){switch(t.authenticationType){case"TOKEN":return E();case"JWT":return q();default:throw new Error(`Unknown authentication type: ${t.authenticationType}`)}}function b(t,o,r){let l=null;function i(n){o.value=n}function d(n){r.value=n}function f(n){l=e.watch(t,(p,h)=>{p!=h&&n.push({path:n.currentRoute.value.path,force:!0}).then(()=>{})})}function a(){l&&l()}return{setPostLogin:i,setPostLogout:d,setupAuthRouteGuard:f,unsetAuthRouteGuard:a,authRouteGuardWatcher:l}}function E(){const t=e.ref(!1),o=e.ref(null),r=e.ref(()=>{}),l=e.ref(()=>{}),i=localStorage.getItem(_),d=b(t,l,r);i&&(o.value=i,t.value=!0),e.watch(o,()=>{localStorage.setItem(_,o.value??"")}),c.axiosInstance.defaults.withCredentials=!0,c.axiosInstance.defaults.headers.common["Content-Type"]="application/json",c.axiosInstance.interceptors.request.use(async n=>(t.value&&o.value&&(n.headers.Authorization=`Token ${o.value}`),n),n=>Promise.reject(n)),c.axiosInstance.interceptors.response.use(n=>n,async n=>(n.response.status===403&&n.response.data?.detail==="Authentication credentials were not provided."&&a(),Promise.reject(n)));async function f(n){const p=await c.axiosInstance.post("/api/token-auth/",n);return p.status===200&&(t.value=!0,o.value=p.data.token),l.value(),p}function a(){localStorage.removeItem(_),t.value=!1,o.value=null,r.value()}return{axiosInstance:c.axiosInstance,authenticated:t,login:f,logout:a,setPostLogin:d.setPostLogin,setPostLogout:d.setPostLogout,setupAuthRouteGuard:d.setupAuthRouteGuard,unsetAuthRouteGuard:d.unsetAuthRouteGuard}}function q(){const t=e.ref(!1),o=e.ref(null),r=e.ref(null),l=e.ref(()=>{}),i=e.ref(()=>{}),d=localStorage.getItem(y),f=localStorage.getItem(x),a="/api/token/refresh/",n=b(t,i,l);d&&f&&(o.value=d,r.value=f,t.value=!0),e.watch(o,()=>{localStorage.setItem(y,o.value??"")}),e.watch(r,()=>{localStorage.setItem(x,r.value??"")}),c.axiosInstance.defaults.withCredentials=!0,c.axiosInstance.defaults.headers.common["Content-Type"]="application/json",c.axiosInstance.interceptors.request.use(async s=>(t.value&&o.value&&(s.headers.Authorization=`Bearer ${o.value}`),s),s=>Promise.reject(s));function p(s){return!!(s.response&&[401,403].includes(s.response.status)&&(s.response?.data?.code==="token_not_valid"||!o.value||!r.value))}async function h(s){const u=await c.axiosInstance.post(a,{refresh:r.value});if(u.status===200)return o.value=u.data.access,u.data.refresh&&(r.value=u.data.refresh),s.headers.Authorization=`Bearer ${o.value}`,c.axiosInstance(s);throw new Error("Token refresh failed")}c.axiosInstance.interceptors.response.use(s=>s,async s=>{if(!p(s))return Promise.reject(s);const u=s.config;if(!(u.url===a)&&r.value)try{return await h(u)}catch(S){return m(),Promise.reject(S)}else m();return Promise.reject(s)});async function g(s){const u=await c.axiosInstance.post("/api/token/",s);return u.status===200&&(t.value=!0,o.value=u.data.access,r.value=u.data.refresh),i.value(),u}function m(){localStorage.removeItem(y),localStorage.removeItem(x),t.value=!1,o.value=null,r.value=null,l.value()}return{axiosInstance:c.axiosInstance,authenticated:t,login:g,logout:m,setPostLogin:n.setPostLogin,setPostLogout:n.setPostLogout,setupAuthRouteGuard:n.setupAuthRouteGuard,unsetAuthRouteGuard:n.unsetAuthRouteGuard}}const G=L({authenticationType:"TOKEN"},R),B={class:"text-center"},$={class:"text-2xl font-bold text-gray-900 dark:text-gray-100 mb-2"},F={class:"space-y-4"},D={class:"text-gray-700 dark:text-gray-300 text-center"},K={class:"text-center space-y-2"},z={class:"flex items-center gap-3 p-3 border border-gray-200 dark:border-gray-700 rounded-lg"},U={for:"consent-checkbox",class:"text-sm text-gray-700 dark:text-gray-300 cursor-pointer"},O={class:"flex gap-3 pt-4"},W=e.defineComponent({__name:"LegalConsent",setup(t){const o=w.useRouter(),r=o.currentRoute.value.redirectedFrom,l=v.useLegalStore(),i=I(),d=N(),f=e.ref(!1),{t:a}=P.useI18nLib(),n=async()=>{try{await l.acceptLegalConsent();const h=r?{path:r.path}:"/";o.push(h).then(()=>{i.add({severity:"success",summary:a("legal_consent.toast_accept_summary"),detail:a("legal_consent.toast_accept_detail"),life:5e3})})}catch(h){console.error("Failed to accept legal consent:",h),i.add({severity:"error",summary:a("legal_consent.error_summary"),detail:a("legal_consent.error_detail"),life:5e3})}},p=()=>{d.require({message:a("legal_consent.confirm_message"),header:a("legal_consent.confirm_header"),icon:"pi pi-exclamation-triangle",rejectProps:{label:a("legal_consent.reject_label"),severity:"secondary",outlined:!0},acceptProps:{label:a("legal_consent.accept_label"),severity:"danger"},accept:()=>{i.add({severity:"warn",summary:a("legal_consent.disconnected_summary"),detail:a("legal_consent.disconnected_detail"),life:5e3}),G.logout()}})};return(h,g)=>{const m=e.resolveComponent("router-link");return e.openBlock(),e.createElementBlock("section",null,[e.createVNode(e.unref(T.script),{class:"w-full max-w-md"},{title:e.withCtx(()=>[e.createElementVNode("div",B,[e.createElementVNode("h1",$,e.toDisplayString(e.unref(a)("legal_consent.title")),1)])]),content:e.withCtx(()=>[e.createElementVNode("div",F,[e.createElementVNode("p",D,e.toDisplayString(e.unref(a)("legal_consent.intro")),1),e.createElementVNode("div",K,[e.createElementVNode("div",null,[e.createVNode(m,{to:"/terms-of-use",class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 underline",target:"_blank"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("legal_consent.terms_of_use")),1)]),_:1})]),e.createElementVNode("div",null,[e.createVNode(m,{to:"/privacy-notice",class:"text-blue-600 dark:text-blue-400 hover:text-blue-800 dark:hover:text-blue-300 underline",target:"_blank"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(e.unref(a)("legal_consent.privacy_notice")),1)]),_:1})])]),e.createElementVNode("div",z,[e.createVNode(e.unref(v.script),{modelValue:f.value,"onUpdate:modelValue":g[0]||(g[0]=s=>f.value=s),"input-id":"consent-checkbox",binary:!0},null,8,["modelValue"]),e.createElementVNode("label",U,e.toDisplayString(e.unref(a)("legal_consent.checkbox_label")),1)]),e.createElementVNode("div",O,[e.createVNode(e.unref(v.script$1),{label:e.unref(a)("legal_consent.accept"),icon:"pi pi-check",disabled:!f.value,class:"flex-1",severity:"success",onClick:n},null,8,["label","disabled"]),e.createVNode(e.unref(v.script$1),{label:e.unref(a)("legal_consent.cancel"),icon:"pi pi-times",severity:"secondary",outlined:"",class:"flex-1",onClick:p},null,8,["label"])])])]),_:1})])}}});exports.default=W;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { inject as L, ref as h, watch as x, defineComponent as C, resolveComponent as V, createElementBlock as G, openBlock as I, createVNode as v, unref as d, withCtx as b, createElementVNode as f, toDisplayString as y, createTextVNode as P } from "vue";
|
|
2
2
|
import { useRouter as E } from "vue-router";
|
|
3
|
-
import { u as B, s as N, b as A } from "./lib-
|
|
3
|
+
import { u as B, s as N, b as A } from "./lib-I1PMgFxW.js";
|
|
4
4
|
import { s as F } from "./index-BctaqoUB.js";
|
|
5
5
|
import { createPinia as $, defineStore as q } from "pinia";
|
|
6
|
-
import { a as r } from "./axios-
|
|
6
|
+
import { a as r } from "./axios-C8xtaJSd.js";
|
|
7
7
|
import { c as K } from "./index-CowW14sC.js";
|
|
8
8
|
var z = Symbol();
|
|
9
9
|
function U() {
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue");require("./axios-
|
|
2
|
-
]`).replace("lheading",ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Me=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ke=/^( {2,}|\\)\n(?!\s*$)/,De=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Z=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,de=/[^\s\p{P}\p{S}]/u,Oe=
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("vue");require("./axios-_3J2k8TN.cjs");const $e=require("./apiClient-Bd4jmhT7.cjs"),ne=require("./lib-B0OhMW6t.cjs"),ce=require("./index-BCKqvrXF.cjs"),Re=require("./index-TM4WIzFN.cjs");function H(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var R=H();function pe(n){R=n}var _={exec:()=>null};function h(n,e=""){let r=typeof n=="string"?n:n.source,s={replace:(t,i)=>{let l=typeof i=="string"?i:i.source;return l=l.replace(b.caret,"$1"),r=r.replace(t,l),s},getRegex:()=>new RegExp(r,e)};return s}var b={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},Te=/^(?:[ \t]*(?:\n|$))+/,ze=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Ae=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,I=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ve=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Q=/(?:[*+-]|\d{1,9}[.)])/,he=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ue=h(he).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),_e=h(he).replace(/bull/g,Q).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),G=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Pe=/^[^\n]+/,X=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ie=h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",X).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Be=h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Q).getRegex(),E="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",F=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ce=h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",F).replace("tag",E).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ge=h(G).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex(),Le=h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ge).getRegex(),W={blockquote:Le,code:ze,def:Ie,fences:Ae,heading:ve,hr:I,html:Ce,lheading:ue,list:Be,newline:Te,paragraph:ge,table:_,text:Pe},re=h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex(),qe={...W,lheading:_e,table:re,paragraph:h(G).replace("hr",I).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",re).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",E).getRegex()},Ee={...W,html:h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",F).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:_,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:h(G).replace("hr",I).replace("heading",` *#{1,6} *[^
|
|
2
|
+
]`).replace("lheading",ue).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Ze=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Me=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,ke=/^( {2,}|\\)\n(?!\s*$)/,De=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Z=/[\p{P}\p{S}]/u,U=/[\s\p{P}\p{S}]/u,de=/[^\s\p{P}\p{S}]/u,Oe=h(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,U).getRegex(),fe=/(?!~)[\p{P}\p{S}]/u,je=/(?!~)[\s\p{P}\p{S}]/u,Ne=/(?:[^\s\p{P}\p{S}]|~)/u,He=h(/link|code|html/,"g").replace("link",new RegExp("\\[(?:[^\\[\\]`]|(?<!`)(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("code",new RegExp("(?<!`)(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html",/<(?! )[^<>]*?>/).getRegex(),xe=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,Qe=h(xe,"u").replace(/punct/g,Z).getRegex(),Ge=h(xe,"u").replace(/punct/g,fe).getRegex(),be="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Xe=h(be,"gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,U).replace(/punct/g,Z).getRegex(),Fe=h(be,"gu").replace(/notPunctSpace/g,Ne).replace(/punctSpace/g,je).replace(/punct/g,fe).getRegex(),We=h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,de).replace(/punctSpace/g,U).replace(/punct/g,Z).getRegex(),Ue=h(/\\(punct)/,"gu").replace(/punct/g,Z).getRegex(),Ve=h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ke=h(F).replace("(?:-->|$)","-->").getRegex(),Je=h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ke).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),C=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,Ye=h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",C).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),me=h(/^!?\[(label)\]\[(ref)\]/).replace("label",C).replace("ref",X).getRegex(),we=h(/^!?\[(ref)\](?:\[\])?/).replace("ref",X).getRegex(),et=h("reflink|nolink(?!\\()","g").replace("reflink",me).replace("nolink",we).getRegex(),se=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,V={_backpedal:_,anyPunctuation:Ue,autolink:Ve,blockSkip:He,br:ke,code:Me,del:_,emStrongLDelim:Qe,emStrongRDelimAst:Xe,emStrongRDelimUnd:We,escape:Ze,link:Ye,nolink:we,punctuation:Oe,reflink:me,reflinkSearch:et,tag:Je,text:De,url:_},tt={...V,link:h(/^!?\[(label)\]\((.*?)\)/).replace("label",C).getRegex(),reflink:h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",C).getRegex()},O={...V,emStrongRDelimAst:Fe,emStrongLDelim:Ge,url:h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",se).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",se).getRegex()},nt={...O,br:h(ke).replace("{2,}","*").getRegex(),text:h(O.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},B={normal:W,gfm:qe,pedantic:Ee},z={normal:V,gfm:O,breaks:nt,pedantic:tt},rt={"&":"&","<":"<",">":">",'"':""","'":"'"},le=n=>rt[n];function S(n,e){if(e){if(b.escapeTest.test(n))return n.replace(b.escapeReplace,le)}else if(b.escapeTestNoEncode.test(n))return n.replace(b.escapeReplaceNoEncode,le);return n}function ie(n){try{n=encodeURI(n).replace(b.percentDecode,"%")}catch{return null}return n}function ae(n,e){let r=n.replace(b.findPipe,(i,l,a)=>{let o=!1,c=l;for(;--c>=0&&a[c]==="\\";)o=!o;return o?"|":" |"}),s=r.split(b.splitPipe),t=0;if(s[0].trim()||s.shift(),s.length>0&&!s.at(-1)?.trim()&&s.pop(),e)if(s.length>e)s.splice(e);else for(;s.length<e;)s.push("");for(;t<s.length;t++)s[t]=s[t].trim().replace(b.slashPipe,"|");return s}function A(n,e,r){let s=n.length;if(s===0)return"";let t=0;for(;t<s&&n.charAt(s-t-1)===e;)t++;return n.slice(0,s-t)}function st(n,e){if(n.indexOf(e[1])===-1)return-1;let r=0;for(let s=0;s<n.length;s++)if(n[s]==="\\")s++;else if(n[s]===e[0])r++;else if(n[s]===e[1]&&(r--,r<0))return s;return r>0?-2:-1}function oe(n,e,r,s,t){let i=e.href,l=e.title||null,a=n[1].replace(t.other.outputLinkReplace,"$1");s.state.inLink=!0;let o={type:n[0].charAt(0)==="!"?"image":"link",raw:r,href:i,title:l,text:a,tokens:s.inlineTokens(a)};return s.state.inLink=!1,o}function lt(n,e,r){let s=n.match(r.other.indentCodeCompensation);if(s===null)return e;let t=s[1];return e.split(`
|
|
3
3
|
`).map(i=>{let l=i.match(r.other.beginningSpace);if(l===null)return i;let[a]=l;return a.length>=t.length?i.slice(t.length):i}).join(`
|
|
4
4
|
`)}var L=class{options;rules;lexer;constructor(n){this.options=n||R}space(n){let e=this.rules.block.newline.exec(n);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(n){let e=this.rules.block.code.exec(n);if(e){let r=e[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:e[0],codeBlockStyle:"indented",text:this.options.pedantic?r:A(r,`
|
|
5
5
|
`)}}}fences(n){let e=this.rules.block.fences.exec(n);if(e){let r=e[0],s=lt(r,e[3]||"",this.rules);return{type:"code",raw:r,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:s}}}heading(n){let e=this.rules.block.heading.exec(n);if(e){let r=e[2].trim();if(this.rules.other.endingHash.test(r)){let s=A(r,"#");(this.options.pedantic||!s||this.rules.other.endingSpaceChar.test(s))&&(r=s.trim())}return{type:"heading",raw:e[0],depth:e[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(n){let e=this.rules.block.hr.exec(n);if(e)return{type:"hr",raw:A(e[0],`
|
|
6
6
|
`)}}blockquote(n){let e=this.rules.block.blockquote.exec(n);if(e){let r=A(e[0],`
|
|
7
7
|
`).split(`
|
|
8
8
|
`),s="",t="",i=[];for(;r.length>0;){let l=!1,a=[],o;for(o=0;o<r.length;o++)if(this.rules.other.blockquoteStart.test(r[o]))a.push(r[o]),l=!0;else if(!l)a.push(r[o]);else break;r=r.slice(o);let c=a.join(`
|
|
9
|
-
`),
|
|
9
|
+
`),p=c.replace(this.rules.other.blockquoteSetextReplace,`
|
|
10
10
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");s=s?`${s}
|
|
11
11
|
${c}`:c,t=t?`${t}
|
|
12
|
-
${
|
|
12
|
+
${p}`:p;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=u,r.length===0)break;let k=i.at(-1);if(k?.type==="code")break;if(k?.type==="blockquote"){let x=k,d=x.raw+`
|
|
13
13
|
`+r.join(`
|
|
14
14
|
`),m=this.blockquote(d);i[i.length-1]=m,s=s.substring(0,s.length-x.raw.length)+m.raw,t=t.substring(0,t.length-x.text.length)+m.text;break}else if(k?.type==="list"){let x=k,d=x.raw+`
|
|
15
15
|
`+r.join(`
|
|
16
16
|
`),m=this.list(d);i[i.length-1]=m,s=s.substring(0,s.length-k.raw.length)+m.raw,t=t.substring(0,t.length-x.raw.length)+m.raw,r=d.substring(i.at(-1).raw.length).split(`
|
|
17
|
-
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;n;){let o=!1,c="",
|
|
17
|
+
`);continue}}return{type:"blockquote",raw:s,tokens:i,text:t}}}list(n){let e=this.rules.block.list.exec(n);if(e){let r=e[1].trim(),s=r.length>1,t={type:"list",raw:"",ordered:s,start:s?+r.slice(0,-1):"",loose:!1,items:[]};r=s?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=s?r:"[*+-]");let i=this.rules.other.listItemRegex(r),l=!1;for(;n;){let o=!1,c="",p="";if(!(e=i.exec(n))||this.rules.block.hr.test(n))break;c=e[0],n=n.substring(c.length);let u=e[2].split(`
|
|
18
18
|
`,1)[0].replace(this.rules.other.listReplaceTabs,M=>" ".repeat(3*M.length)),k=n.split(`
|
|
19
|
-
`,1)[0],x=!u.trim(),d=0;if(this.options.pedantic?(d=2,
|
|
19
|
+
`,1)[0],x=!u.trim(),d=0;if(this.options.pedantic?(d=2,p=u.trimStart()):x?d=e[1].length+1:(d=e[2].search(this.rules.other.nonSpaceChar),d=d>4?1:d,p=u.slice(d),d+=e[1].length),x&&this.rules.other.blankLine.test(k)&&(c+=k+`
|
|
20
20
|
`,n=n.substring(k.length+1),o=!0),!o){let M=this.rules.other.nextBulletRegex(d),Y=this.rules.other.hrRegex(d),ee=this.rules.other.fencesBeginRegex(d),te=this.rules.other.headingBeginRegex(d),Se=this.rules.other.htmlBeginRegex(d);for(;n;){let D=n.split(`
|
|
21
|
-
`,1)[0],T;if(k=D,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),T=k):T=k.replace(this.rules.other.tabCharGlobal," "),ee.test(k)||te.test(k)||Se.test(k)||M.test(k)||Y.test(k))break;if(T.search(this.rules.other.nonSpaceChar)>=d||!k.trim())
|
|
22
|
-
`+T.slice(d);else{if(x||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(u)||te.test(u)||Y.test(u))break;
|
|
21
|
+
`,1)[0],T;if(k=D,this.options.pedantic?(k=k.replace(this.rules.other.listReplaceNesting," "),T=k):T=k.replace(this.rules.other.tabCharGlobal," "),ee.test(k)||te.test(k)||Se.test(k)||M.test(k)||Y.test(k))break;if(T.search(this.rules.other.nonSpaceChar)>=d||!k.trim())p+=`
|
|
22
|
+
`+T.slice(d);else{if(x||u.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||ee.test(u)||te.test(u)||Y.test(u))break;p+=`
|
|
23
23
|
`+k}!x&&!k.trim()&&(x=!0),c+=D+`
|
|
24
|
-
`,n=n.substring(D.length+1),u=T.slice(d)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let m=null,J;this.options.gfm&&(m=this.rules.other.listIsTask.exec(
|
|
24
|
+
`,n=n.substring(D.length+1),u=T.slice(d)}}t.loose||(l?t.loose=!0:this.rules.other.doubleBlankLine.test(c)&&(l=!0));let m=null,J;this.options.gfm&&(m=this.rules.other.listIsTask.exec(p),m&&(J=m[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),t.items.push({type:"list_item",raw:c,task:!!m,checked:J,loose:!1,text:p,tokens:[]}),t.raw+=c}let a=t.items.at(-1);if(a)a.raw=a.raw.trimEnd(),a.text=a.text.trimEnd();else return;t.raw=t.raw.trimEnd();for(let o=0;o<t.items.length;o++)if(this.lexer.state.top=!1,t.items[o].tokens=this.lexer.blockTokens(t.items[o].text,[]),!t.loose){let c=t.items[o].tokens.filter(u=>u.type==="space"),p=c.length>0&&c.some(u=>this.rules.other.anyLine.test(u.raw));t.loose=p}if(t.loose)for(let o=0;o<t.items.length;o++)t.items[o].loose=!0;return t}}html(n){let e=this.rules.block.html.exec(n);if(e)return{type:"html",block:!0,raw:e[0],pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:e[0]}}def(n){let e=this.rules.block.def.exec(n);if(e){let r=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),s=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",t=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:r,raw:e[0],href:s,title:t}}}table(n){let e=this.rules.block.table.exec(n);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let r=ae(e[1]),s=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),t=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
25
25
|
`):[],i={type:"table",raw:e[0],header:[],align:[],rows:[]};if(r.length===s.length){for(let l of s)this.rules.other.tableAlignRight.test(l)?i.align.push("right"):this.rules.other.tableAlignCenter.test(l)?i.align.push("center"):this.rules.other.tableAlignLeft.test(l)?i.align.push("left"):i.align.push(null);for(let l=0;l<r.length;l++)i.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:i.align[l]});for(let l of t)i.rows.push(ae(l,i.header.length).map((a,o)=>({text:a,tokens:this.lexer.inline(a),header:!1,align:i.align[o]})));return i}}lheading(n){let e=this.rules.block.lheading.exec(n);if(e)return{type:"heading",raw:e[0],depth:e[2].charAt(0)==="="?1:2,text:e[1],tokens:this.lexer.inline(e[1])}}paragraph(n){let e=this.rules.block.paragraph.exec(n);if(e){let r=e[1].charAt(e[1].length-1)===`
|
|
26
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=A(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,a=t,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+t);(s=c.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){o+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+o);let
|
|
26
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:r,tokens:this.lexer.inline(r)}}}text(n){let e=this.rules.block.text.exec(n);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(n){let e=this.rules.inline.escape.exec(n);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(n){let e=this.rules.inline.tag.exec(n);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(n){let e=this.rules.inline.link.exec(n);if(e){let r=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let i=A(r.slice(0,-1),"\\");if((r.length-i.length)%2===0)return}else{let i=st(e[2],"()");if(i===-2)return;if(i>-1){let l=(e[0].indexOf("!")===0?5:4)+e[1].length+i;e[2]=e[2].substring(0,i),e[0]=e[0].substring(0,l).trim(),e[3]=""}}let s=e[2],t="";if(this.options.pedantic){let i=this.rules.other.pedanticHrefTitle.exec(s);i&&(s=i[1],t=i[3])}else t=e[3]?e[3].slice(1,-1):"";return s=s.trim(),this.rules.other.startAngleBracket.test(s)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?s=s.slice(1):s=s.slice(1,-1)),oe(e,{href:s&&s.replace(this.rules.inline.anyPunctuation,"$1"),title:t&&t.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(n,e){let r;if((r=this.rules.inline.reflink.exec(n))||(r=this.rules.inline.nolink.exec(n))){let s=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),t=e[s.toLowerCase()];if(!t){let i=r[0].charAt(0);return{type:"text",raw:i,text:i}}return oe(r,t,r[0],this.lexer,this.rules)}}emStrong(n,e,r=""){let s=this.rules.inline.emStrongLDelim.exec(n);if(!(!s||s[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(s[1]||s[2])||!r||this.rules.inline.punctuation.exec(r))){let t=[...s[0]].length-1,i,l,a=t,o=0,c=s[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(c.lastIndex=0,e=e.slice(-1*n.length+t);(s=c.exec(e))!=null;){if(i=s[1]||s[2]||s[3]||s[4]||s[5]||s[6],!i)continue;if(l=[...i].length,s[3]||s[4]){a+=l;continue}else if((s[5]||s[6])&&t%3&&!((t+l)%3)){o+=l;continue}if(a-=l,a>0)continue;l=Math.min(l,l+a+o);let p=[...s[0]][0].length,u=n.slice(0,t+s.index+p+l);if(Math.min(t,l)%2){let x=u.slice(1,-1);return{type:"em",raw:u,text:x,tokens:this.lexer.inlineTokens(x)}}let k=u.slice(2,-2);return{type:"strong",raw:u,text:k,tokens:this.lexer.inlineTokens(k)}}}}codespan(n){let e=this.rules.inline.code.exec(n);if(e){let r=e[2].replace(this.rules.other.newLineCharGlobal," "),s=this.rules.other.nonSpaceChar.test(r),t=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return s&&t&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:e[0],text:r}}}br(n){let e=this.rules.inline.br.exec(n);if(e)return{type:"br",raw:e[0]}}del(n){let e=this.rules.inline.del.exec(n);if(e)return{type:"del",raw:e[0],text:e[2],tokens:this.lexer.inlineTokens(e[2])}}autolink(n){let e=this.rules.inline.autolink.exec(n);if(e){let r,s;return e[2]==="@"?(r=e[1],s="mailto:"+r):(r=e[1],s=r),{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}url(n){let e;if(e=this.rules.inline.url.exec(n)){let r,s;if(e[2]==="@")r=e[0],s="mailto:"+r;else{let t;do t=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(t!==e[0]);r=e[0],e[1]==="www."?s="http://"+e[0]:s=e[0]}return{type:"link",raw:e[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(n){let e=this.rules.inline.text.exec(n);if(e){let r=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:r}}}},w=class j{tokens;options;state;tokenizer;inlineQueue;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||R,this.options.tokenizer=this.options.tokenizer||new L,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:b,block:B.normal,inline:z.normal};this.options.pedantic?(r.block=B.pedantic,r.inline=z.pedantic):this.options.gfm&&(r.block=B.gfm,this.options.breaks?r.inline=z.breaks:r.inline=z.gfm),this.tokenizer.rules=r}static get rules(){return{block:B,inline:z}}static lex(e,r){return new j(r).lex(e)}static lexInline(e,r){return new j(r).inlineTokens(e)}lex(e){e=e.replace(b.carriageReturn,`
|
|
27
27
|
`),this.blockTokens(e,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let s=this.inlineQueue[r];this.inlineTokens(s.src,s.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,r=[],s=!1){for(this.options.pedantic&&(e=e.replace(b.tabCharGlobal," ").replace(b.spaceLine,""));e;){let t;if(this.options.extensions?.block?.some(l=>(t=l.call({lexer:this},e,r))?(e=e.substring(t.raw.length),r.push(t),!0):!1))continue;if(t=this.tokenizer.space(e)){e=e.substring(t.raw.length);let l=r.at(-1);t.raw.length===1&&l!==void 0?l.raw+=`
|
|
28
28
|
`:r.push(t);continue}if(t=this.tokenizer.code(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="paragraph"||l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
29
29
|
`)?"":`
|
|
@@ -37,7 +37,7 @@ ${h}`:h;let u=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTo
|
|
|
37
37
|
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t),s=i.length!==e.length,e=e.substring(t.raw.length);continue}if(t=this.tokenizer.text(e)){e=e.substring(t.raw.length);let l=r.at(-1);l?.type==="text"?(l.raw+=(l.raw.endsWith(`
|
|
38
38
|
`)?"":`
|
|
39
39
|
`)+t.raw,l.text+=`
|
|
40
|
-
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,
|
|
40
|
+
`+t.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=l.text):r.push(t);continue}if(e){let l="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(l);break}else throw new Error(l)}}return this.state.top=!0,r}inline(e,r=[]){return this.inlineQueue.push({src:e,tokens:r}),r}inlineTokens(e,r=[]){let s=e,t=null;if(this.tokens.links){let a=Object.keys(this.tokens.links);if(a.length>0)for(;(t=this.tokenizer.rules.inline.reflinkSearch.exec(s))!=null;)a.includes(t[0].slice(t[0].lastIndexOf("[")+1,-1))&&(s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(t=this.tokenizer.rules.inline.anyPunctuation.exec(s))!=null;)s=s.slice(0,t.index)+"++"+s.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;(t=this.tokenizer.rules.inline.blockSkip.exec(s))!=null;)s=s.slice(0,t.index)+"["+"a".repeat(t[0].length-2)+"]"+s.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);s=this.options.hooks?.emStrongMask?.call({lexer:this},s)??s;let i=!1,l="";for(;e;){i||(l=""),i=!1;let a;if(this.options.extensions?.inline?.some(c=>(a=c.call({lexer:this},e,r))?(e=e.substring(a.raw.length),r.push(a),!0):!1))continue;if(a=this.tokenizer.escape(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.tag(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.link(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(a.raw.length);let c=r.at(-1);a.type==="text"&&c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(a=this.tokenizer.emStrong(e,s,l)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.codespan(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.br(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.del(e)){e=e.substring(a.raw.length),r.push(a);continue}if(a=this.tokenizer.autolink(e)){e=e.substring(a.raw.length),r.push(a);continue}if(!this.state.inLink&&(a=this.tokenizer.url(e))){e=e.substring(a.raw.length),r.push(a);continue}let o=e;if(this.options.extensions?.startInline){let c=1/0,p=e.slice(1),u;this.options.extensions.startInline.forEach(k=>{u=k.call({lexer:this},p),typeof u=="number"&&u>=0&&(c=Math.min(c,u))}),c<1/0&&c>=0&&(o=e.substring(0,c+1))}if(a=this.tokenizer.inlineText(o)){e=e.substring(a.raw.length),a.raw.slice(-1)!=="_"&&(l=a.raw.slice(-1)),i=!0;let c=r.at(-1);c?.type==="text"?(c.raw+=a.raw,c.text+=a.text):r.push(a);continue}if(e){let c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(c);break}else throw new Error(c)}}return r}},q=class{options;parser;constructor(n){this.options=n||R}space(n){return""}code({text:n,lang:e,escaped:r}){let s=(e||"").match(b.notSpaceStart)?.[0],t=n.replace(b.endingNewline,"")+`
|
|
41
41
|
`;return s?'<pre><code class="language-'+S(s)+'">'+(r?t:S(t,!0))+`</code></pre>
|
|
42
42
|
`:"<pre><code>"+(r?t:S(t,!0))+`</code></pre>
|
|
43
43
|
`}blockquote({tokens:n}){return`<blockquote>
|
|
@@ -56,8 +56,8 @@ ${this.parser.parse(n)}</blockquote>
|
|
|
56
56
|
${n}</tr>
|
|
57
57
|
`}tablecell(n){let e=this.parser.parseInline(n.tokens),r=n.header?"th":"td";return(n.align?`<${r} align="${n.align}">`:`<${r}>`)+e+`</${r}>
|
|
58
58
|
`}strong({tokens:n}){return`<strong>${this.parser.parseInline(n)}</strong>`}em({tokens:n}){return`<em>${this.parser.parseInline(n)}</em>`}codespan({text:n}){return`<code>${S(n,!0)}</code>`}br(n){return"<br>"}del({tokens:n}){return`<del>${this.parser.parseInline(n)}</del>`}link({href:n,title:e,tokens:r}){let s=this.parser.parseInline(r),t=ie(n);if(t===null)return s;n=t;let i='<a href="'+n+'"';return e&&(i+=' title="'+S(e)+'"'),i+=">"+s+"</a>",i}image({href:n,title:e,text:r,tokens:s}){s&&(r=this.parser.parseInline(s,this.parser.textRenderer));let t=ie(n);if(t===null)return S(r);n=t;let i=`<img src="${n}" alt="${r}"`;return e&&(i+=` title="${S(e)}"`),i+=">",i}text(n){return"tokens"in n&&n.tokens?this.parser.parseInline(n.tokens):"escaped"in n&&n.escaped?n.text:S(n.text)}},K=class{strong({text:n}){return n}em({text:n}){return n}codespan({text:n}){return n}del({text:n}){return n}html({text:n}){return n}text({text:n}){return n}link({text:n}){return""+n}image({text:n}){return""+n}br(){return""}},y=class N{options;renderer;textRenderer;constructor(e){this.options=e||R,this.options.renderer=this.options.renderer||new q,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new K}static parse(e,r){return new N(r).parse(e)}static parseInline(e,r){return new N(r).parseInline(e)}parse(e,r=!0){let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let a=i,o=this.options.extensions.renderers[a.type].call({parser:this},a);if(o!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){s+=o||"";continue}}let l=i;switch(l.type){case"space":{s+=this.renderer.space(l);continue}case"hr":{s+=this.renderer.hr(l);continue}case"heading":{s+=this.renderer.heading(l);continue}case"code":{s+=this.renderer.code(l);continue}case"table":{s+=this.renderer.table(l);continue}case"blockquote":{s+=this.renderer.blockquote(l);continue}case"list":{s+=this.renderer.list(l);continue}case"html":{s+=this.renderer.html(l);continue}case"def":{s+=this.renderer.def(l);continue}case"paragraph":{s+=this.renderer.paragraph(l);continue}case"text":{let a=l,o=this.renderer.text(a);for(;t+1<e.length&&e[t+1].type==="text";)a=e[++t],o+=`
|
|
59
|
-
`+this.renderer.text(a);r?s+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):s+=o;continue}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},v=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},it=class{defaults=H();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=q;TextRenderer=K;Lexer=w;Tokenizer=L;Hooks=v;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let a=t.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new q(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],o=t[l];t[l]=(...c)=>{let
|
|
60
|
-
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},$=new it;function g(n,e){return $.parse(n,e)}g.options=g.setOptions=function(n){return $.setOptions(n),g.defaults=$.defaults,
|
|
59
|
+
`+this.renderer.text(a);r?s+=this.renderer.paragraph({type:"paragraph",raw:o,text:o,tokens:[{type:"text",raw:o,text:o,escaped:!0}]}):s+=o;continue}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}parseInline(e,r=this.renderer){let s="";for(let t=0;t<e.length;t++){let i=e[t];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){s+=a||"";continue}}let l=i;switch(l.type){case"escape":{s+=r.text(l);break}case"html":{s+=r.html(l);break}case"link":{s+=r.link(l);break}case"image":{s+=r.image(l);break}case"strong":{s+=r.strong(l);break}case"em":{s+=r.em(l);break}case"codespan":{s+=r.codespan(l);break}case"br":{s+=r.br(l);break}case"del":{s+=r.del(l);break}case"text":{s+=r.text(l);break}default:{let a='Token with "'+l.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return s}},v=class{options;block;constructor(n){this.options=n||R}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(n){return n}postprocess(n){return n}processAllTokens(n){return n}emStrongMask(n){return n}provideLexer(){return this.block?w.lex:w.lexInline}provideParser(){return this.block?y.parse:y.parseInline}},it=class{defaults=H();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=y;Renderer=q;TextRenderer=K;Lexer=w;Tokenizer=L;Hooks=v;constructor(...n){this.use(...n)}walkTokens(n,e){let r=[];for(let s of n)switch(r=r.concat(e.call(this,s)),s.type){case"table":{let t=s;for(let i of t.header)r=r.concat(this.walkTokens(i.tokens,e));for(let i of t.rows)for(let l of i)r=r.concat(this.walkTokens(l.tokens,e));break}case"list":{let t=s;r=r.concat(this.walkTokens(t.items,e));break}default:{let t=s;this.defaults.extensions?.childTokens?.[t.type]?this.defaults.extensions.childTokens[t.type].forEach(i=>{let l=t[i].flat(1/0);r=r.concat(this.walkTokens(l,e))}):t.tokens&&(r=r.concat(this.walkTokens(t.tokens,e)))}}return r}use(...n){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(r=>{let s={...r};if(s.async=this.defaults.async||s.async||!1,r.extensions&&(r.extensions.forEach(t=>{if(!t.name)throw new Error("extension name required");if("renderer"in t){let i=e.renderers[t.name];i?e.renderers[t.name]=function(...l){let a=t.renderer.apply(this,l);return a===!1&&(a=i.apply(this,l)),a}:e.renderers[t.name]=t.renderer}if("tokenizer"in t){if(!t.level||t.level!=="block"&&t.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let i=e[t.level];i?i.unshift(t.tokenizer):e[t.level]=[t.tokenizer],t.start&&(t.level==="block"?e.startBlock?e.startBlock.push(t.start):e.startBlock=[t.start]:t.level==="inline"&&(e.startInline?e.startInline.push(t.start):e.startInline=[t.start]))}"childTokens"in t&&t.childTokens&&(e.childTokens[t.name]=t.childTokens)}),s.extensions=e),r.renderer){let t=this.defaults.renderer||new q(this.defaults);for(let i in r.renderer){if(!(i in t))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;let l=i,a=r.renderer[l],o=t[l];t[l]=(...c)=>{let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p||""}}s.renderer=t}if(r.tokenizer){let t=this.defaults.tokenizer||new L(this.defaults);for(let i in r.tokenizer){if(!(i in t))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;let l=i,a=r.tokenizer[l],o=t[l];t[l]=(...c)=>{let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.tokenizer=t}if(r.hooks){let t=this.defaults.hooks||new v;for(let i in r.hooks){if(!(i in t))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;let l=i,a=r.hooks[l],o=t[l];v.passThroughHooks.has(i)?t[l]=c=>{if(this.defaults.async&&v.passThroughHooksRespectAsync.has(i))return(async()=>{let u=await a.call(t,c);return o.call(t,u)})();let p=a.call(t,c);return o.call(t,p)}:t[l]=(...c)=>{if(this.defaults.async)return(async()=>{let u=await a.apply(t,c);return u===!1&&(u=await o.apply(t,c)),u})();let p=a.apply(t,c);return p===!1&&(p=o.apply(t,c)),p}}s.hooks=t}if(r.walkTokens){let t=this.defaults.walkTokens,i=r.walkTokens;s.walkTokens=function(l){let a=[];return a.push(i.call(this,l)),t&&(a=a.concat(t.call(this,l))),a}}this.defaults={...this.defaults,...s}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,e){return w.lex(n,e??this.defaults)}parser(n,e){return y.parse(n,e??this.defaults)}parseMarkdown(n){return(e,r)=>{let s={...r},t={...this.defaults,...s},i=this.onError(!!t.silent,!!t.async);if(this.defaults.async===!0&&s.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(t.hooks&&(t.hooks.options=t,t.hooks.block=n),t.async)return(async()=>{let l=t.hooks?await t.hooks.preprocess(e):e,a=await(t.hooks?await t.hooks.provideLexer():n?w.lex:w.lexInline)(l,t),o=t.hooks?await t.hooks.processAllTokens(a):a;t.walkTokens&&await Promise.all(this.walkTokens(o,t.walkTokens));let c=await(t.hooks?await t.hooks.provideParser():n?y.parse:y.parseInline)(o,t);return t.hooks?await t.hooks.postprocess(c):c})().catch(i);try{t.hooks&&(e=t.hooks.preprocess(e));let l=(t.hooks?t.hooks.provideLexer():n?w.lex:w.lexInline)(e,t);t.hooks&&(l=t.hooks.processAllTokens(l)),t.walkTokens&&this.walkTokens(l,t.walkTokens);let a=(t.hooks?t.hooks.provideParser():n?y.parse:y.parseInline)(l,t);return t.hooks&&(a=t.hooks.postprocess(a)),a}catch(l){return i(l)}}}onError(n,e){return r=>{if(r.message+=`
|
|
60
|
+
Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error occurred:</p><pre>"+S(r.message+"",!0)+"</pre>";return e?Promise.resolve(s):s}if(e)return Promise.reject(r);throw r}}},$=new it;function g(n,e){return $.parse(n,e)}g.options=g.setOptions=function(n){return $.setOptions(n),g.defaults=$.defaults,pe(g.defaults),g};g.getDefaults=H;g.defaults=R;g.use=function(...n){return $.use(...n),g.defaults=$.defaults,pe(g.defaults),g};g.walkTokens=function(n,e){return $.walkTokens(n,e)};g.parseInline=$.parseInline;g.Parser=y;g.parser=y.parse;g.Renderer=q;g.TextRenderer=K;g.Lexer=w;g.lexer=w.lex;g.Tokenizer=L;g.Hooks=v;g.parse=g;g.options;g.setOptions;g.use;g.walkTokens;g.parseInline;y.parse;w.lex;var at=`
|
|
61
61
|
.p-skeleton {
|
|
62
62
|
display: block;
|
|
63
63
|
overflow: hidden;
|
|
@@ -107,4 +107,4 @@ Please report this to https://github.com/markedjs/marked.`,n){let s="<p>An error
|
|
|
107
107
|
transform: translateX(-100%);
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
|
-
`,ot={root:{position:"relative"}},ct={root:function(e){var r=e.props;return["p-skeleton p-component",{"p-skeleton-circle":r.shape==="circle","p-skeleton-animation-none":r.animation==="none"}]}},
|
|
110
|
+
`,ot={root:{position:"relative"}},ct={root:function(e){var r=e.props;return["p-skeleton p-component",{"p-skeleton-circle":r.shape==="circle","p-skeleton-animation-none":r.animation==="none"}]}},pt=ce.BaseStyle.extend({name:"skeleton",style:at,classes:ct,inlineStyles:ot}),ht={name:"BaseSkeleton",extends:ce.script,props:{shape:{type:String,default:"rectangle"},size:{type:String,default:null},width:{type:String,default:"100%"},height:{type:String,default:"1rem"},borderRadius:{type:String,default:null},animation:{type:String,default:"wave"}},style:pt,provide:function(){return{$pcSkeleton:this,$parentInstance:this}}};function P(n){"@babel/helpers - typeof";return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},P(n)}function ut(n,e,r){return(e=gt(e))in n?Object.defineProperty(n,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):n[e]=r,n}function gt(n){var e=kt(n,"string");return P(e)=="symbol"?e:e+""}function kt(n,e){if(P(n)!="object"||!n)return n;var r=n[Symbol.toPrimitive];if(r!==void 0){var s=r.call(n,e);if(P(s)!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var ye={name:"Skeleton",extends:ht,inheritAttrs:!1,computed:{containerStyle:function(){return this.size?{width:this.size,height:this.size,borderRadius:this.borderRadius}:{width:this.width,height:this.height,borderRadius:this.borderRadius}},dataP:function(){return Re.f(ut({},this.shape,this.shape))}}},dt=["data-p"];function ft(n,e,r,s,t,i){return f.openBlock(),f.createElementBlock("div",f.mergeProps({class:n.cx("root"),style:[n.sx("root"),i.containerStyle],"aria-hidden":"true"},n.ptmi("root"),{"data-p":i.dataP}),null,16,dt)}ye.render=ft;const xt=f.defineComponent({__name:"LegalDocument",props:{classes:{default:""},documentEndpoint:{}},setup(n){const e=ne.useLegalStore(),r=f.useTemplateRef("legal-document"),{data:s,isLoading:t}=$e.apiClient.query(f.ref(`${e.legalEndpoint}/${n.documentEndpoint}`));f.watch(s,()=>{i(s)}),f.onMounted(()=>{i(s)});function i(l){l.value&&(r.value.innerHTML=g.parse(l.value),ne.applyMarkdownClasses(r.value))}return(l,a)=>(f.openBlock(),f.createElementBlock("section",null,[f.unref(t)?(f.openBlock(),f.createBlock(f.unref(ye),{key:0,width:"100%",height:"10rem"})):f.createCommentVNode("",!0),f.createElementVNode("div",{id:"legal-document",ref:"legal-document",class:f.normalizeClass(["m-1 items-center gap-x-4 rounded-xl bg-white dark:bg-gray-900 p-6 shadow-lg outline outline-black/5 dark:outline-white/10",n.classes])},null,2)]))}});exports.default=xt;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElementBlock as ce, openBlock as D, mergeProps as $e, defineComponent as Re, useTemplateRef as Te, ref as ze, watch as Ae, onMounted as ve, createBlock as _e, createCommentVNode as Pe, createElementVNode as Ie, unref as ne, normalizeClass as Le } from "vue";
|
|
2
|
-
import "./axios-
|
|
3
|
-
import { b as Be } from "./apiClient-
|
|
4
|
-
import { u as Ce, a as Ee } from "./lib-
|
|
2
|
+
import "./axios-C8xtaJSd.js";
|
|
3
|
+
import { b as Be } from "./apiClient-WXmPkrC5.js";
|
|
4
|
+
import { u as Ce, a as Ee } from "./lib-I1PMgFxW.js";
|
|
5
5
|
import { B as qe, s as Ze } from "./index-Dd7rSEka.js";
|
|
6
6
|
import { f as Me } from "./index-CowW14sC.js";
|
|
7
7
|
function H() {
|
|
@@ -20,7 +20,7 @@ function h(n, e = "") {
|
|
|
20
20
|
return s;
|
|
21
21
|
}
|
|
22
22
|
var x = { codeRemoveIndent: /^(?: {1,4}| {0,3}\t)/gm, outputLinkReplace: /\\([\[\]])/g, indentCodeCompensation: /^(\s+)(?:```)/, beginningSpace: /^\s+/, endingHash: /#$/, startingSpaceChar: /^ /, endingSpaceChar: / $/, nonSpaceChar: /[^ ]/, newLineCharGlobal: /\n/g, tabCharGlobal: /\t/g, multipleSpaceGlobal: /\s+/g, blankLine: /^[ \t]*$/, doubleBlankLine: /\n[ \t]*\n[ \t]*$/, blockquoteStart: /^ {0,3}>/, blockquoteSetextReplace: /\n {0,3}((?:=+|-+) *)(?=\n|$)/g, blockquoteSetextReplace2: /^ {0,3}>[ \t]?/gm, listReplaceTabs: /^\t+/, listReplaceNesting: /^ {1,4}(?=( {4})*[^ ])/g, listIsTask: /^\[[ xX]\] /, listReplaceTask: /^\[[ xX]\] +/, anyLine: /\n.*\n/, hrefBrackets: /^<(.*)>$/, tableDelimiter: /[:|]/, tableAlignChars: /^\||\| *$/g, tableRowBlankLine: /\n[ \t]*$/, tableAlignRight: /^ *-+: *$/, tableAlignCenter: /^ *:-+: *$/, tableAlignLeft: /^ *:-+ *$/, startATag: /^<a /i, endATag: /^<\/a>/i, startPreScriptTag: /^<(pre|code|kbd|script)(\s|>)/i, endPreScriptTag: /^<\/(pre|code|kbd|script)(\s|>)/i, startAngleBracket: /^</, endAngleBracket: />$/, pedanticHrefTitle: /^([^'"]*[^\s])\s+(['"])(.*)\2/, unicodeAlphaNumeric: /[\p{L}\p{N}]/u, escapeTest: /[&<>"']/, escapeReplace: /[&<>"']/g, escapeTestNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, escapeReplaceNoEncode: /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g, unescapeTest: /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig, caret: /(^|[^\[])\^/g, percentDecode: /%25/g, findPipe: /\|/g, splitPipe: / \|/, slashPipe: /\\\|/g, carriageReturn: /\r\n|\r/g, spaceLine: /^ +$/gm, notSpaceStart: /^\S*/, endingNewline: /\n$/, listItemRegex: (n) => new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`), nextBulletRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`), hrRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), fencesBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}(?:\`\`\`|~~~)`), headingBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}#`), htmlBeginRegex: (n) => new RegExp(`^ {0,${Math.min(3, n - 1)}}<(?:[a-z].*>|!--)`, "i") }, De = /^(?:[ \t]*(?:\n|$))+/, Ne = /^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/, Oe = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, P = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, je = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, Q = /(?:[*+-]|\d{1,9}[.)])/, he = /^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/, ue = h(he).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/\|table/g, "").getRegex(), He = h(he).replace(/bull/g, Q).replace(/blockCode/g, /(?: {4}| {0,3}\t)/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).replace(/table/g, / {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(), G = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, Qe = /^[^\n]+/, X = /(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/, Ge = h(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label", X).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), Xe = h(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, Q).getRegex(), E = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", F = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, Fe = h("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))", "i").replace("comment", F).replace("tag", E).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), ge = h(G).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), We = h(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", ge).getRegex(), W = { blockquote: We, code: Ne, def: Ge, fences: Oe, heading: je, hr: P, html: Fe, lheading: ue, list: Xe, newline: De, paragraph: ge, table: v, text: Qe }, re = h("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", "(?: {4}| {0,3} )[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex(), Ue = { ...W, lheading: He, table: re, paragraph: h(G).replace("hr", P).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", re).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", E).getRegex() }, Ve = { ...W, html: h(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", F).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(), def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/, heading: /^(#{1,6})(.*)(?:\n+|$)/, fences: v, lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/, paragraph: h(G).replace("hr", P).replace("heading", ` *#{1,6} *[^
|
|
23
|
-
]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ke = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Je = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ke = /^( {2,}|\\)\n(?!\s*$)/, Ye = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, q = /[\p{P}\p{S}]/u, U = /[\s\p{P}\p{S}]/u, de = /[^\s\p{P}\p{S}]/u, et = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, U).getRegex(), fe = /(?!~)[\p{P}\p{S}]/u, tt = /(?!~)[\s\p{P}\p{S}]/u, nt = /(?:[^\s\p{P}\p{S}]|~)/u, rt =
|
|
23
|
+
]`).replace("lheading", ue).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex() }, Ke = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, Je = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, ke = /^( {2,}|\\)\n(?!\s*$)/, Ye = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, q = /[\p{P}\p{S}]/u, U = /[\s\p{P}\p{S}]/u, de = /[^\s\p{P}\p{S}]/u, et = h(/^((?![*_])punctSpace)/, "u").replace(/punctSpace/g, U).getRegex(), fe = /(?!~)[\p{P}\p{S}]/u, tt = /(?!~)[\s\p{P}\p{S}]/u, nt = /(?:[^\s\p{P}\p{S}]|~)/u, rt = h(/link|code|html/, "g").replace("link", new RegExp("\\[(?:[^\\[\\]`]|(?<!`)(?<a>`+)[^`]+\\k<a>(?!`))*?\\]\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)]|\\((?:\\\\[\\s\\S]|[^\\\\\\(\\)])*\\))*\\)")).replace("code", new RegExp("(?<!`)(?<b>`+)[^`]+\\k<b>(?!`)")).replace("html", /<(?! )[^<>]*?>/).getRegex(), xe = /^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/, st = h(xe, "u").replace(/punct/g, q).getRegex(), lt = h(xe, "u").replace(/punct/g, fe).getRegex(), be = "^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)", it = h(be, "gu").replace(/notPunctSpace/g, de).replace(/punctSpace/g, U).replace(/punct/g, q).getRegex(), at = h(be, "gu").replace(/notPunctSpace/g, nt).replace(/punctSpace/g, tt).replace(/punct/g, fe).getRegex(), ot = h("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)", "gu").replace(/notPunctSpace/g, de).replace(/punctSpace/g, U).replace(/punct/g, q).getRegex(), ct = h(/\\(punct)/, "gu").replace(/punct/g, q).getRegex(), pt = h(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), ht = h(F).replace("(?:-->|$)", "-->").getRegex(), ut = h("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", ht).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), L = /(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/, gt = h(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label", L).replace("href", /<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), me = h(/^!?\[(label)\]\[(ref)\]/).replace("label", L).replace("ref", X).getRegex(), we = h(/^!?\[(ref)\](?:\[\])?/).replace("ref", X).getRegex(), kt = h("reflink|nolink(?!\\()", "g").replace("reflink", me).replace("nolink", we).getRegex(), se = /[hH][tT][tT][pP][sS]?|[fF][tT][pP]/, V = { _backpedal: v, anyPunctuation: ct, autolink: pt, blockSkip: rt, br: ke, code: Je, del: v, emStrongLDelim: st, emStrongRDelimAst: it, emStrongRDelimUnd: ot, escape: Ke, link: gt, nolink: we, punctuation: et, reflink: me, reflinkSearch: kt, tag: ut, text: Ye, url: v }, dt = { ...V, link: h(/^!?\[(label)\]\((.*?)\)/).replace("label", L).getRegex(), reflink: h(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", L).getRegex() }, N = { ...V, emStrongRDelimAst: at, emStrongLDelim: lt, url: h(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol", se).replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(), _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/, del: /^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/, text: h(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol", se).getRegex() }, ft = { ...N, br: h(ke).replace("{2,}", "*").getRegex(), text: h(N.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex() }, I = { normal: W, gfm: Ue, pedantic: Ve }, T = { normal: V, gfm: N, breaks: ft, pedantic: dt }, xt = { "&": "&", "<": "<", ">": ">", '"': """, "'": "'" }, le = (n) => xt[n];
|
|
24
24
|
function y(n, e) {
|
|
25
25
|
if (e) {
|
|
26
26
|
if (x.escapeTest.test(n)) return n.replace(x.escapeReplace, le);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const u=require("vue"),Y=require("./axios-BompFBxL.cjs");var P=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},et={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},st=class{#e=et;#t=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#t&&t!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:t}),this.#e=t,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},T=new st;function it(t){setTimeout(t,0)}var F=typeof window>"u"||"Deno"in globalThis;function nt(){}function q(t){return typeof t=="number"&&t>=0&&t!==1/0}function rt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function y(t,e){return typeof t=="function"?t(e):t}function K(t){return JSON.stringify(t,(e,s)=>U(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}var ot=Object.prototype.hasOwnProperty;function L(t,e){if(t===e)return t;const s=z(t)&&z(e);if(!s&&!(U(t)&&U(e)))return e;const i=(s?t:Object.keys(t)).length,r=s?e:Object.keys(e),c=r.length,o=s?new Array(c):{};let f=0;for(let p=0;p<c;p++){const a=s?p:r[p],d=t[a],h=e[a];if(d===h){o[a]=d,(s?p<i:ot.call(t,a))&&f++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){o[a]=h;continue}const l=L(d,h);o[a]=l,l===d&&f++}return i===c&&f===i?t:o}function M(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function z(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function U(t){if(!$(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!$(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function $(t){return Object.prototype.toString.call(t)==="[object Object]"}function B(t,e,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(t,e);if(s.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return L(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${n}`),n}return L(t,e)}return e}function D(t,e){return typeof t=="function"?t(...e):!!t}var at=class extends P{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!F&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ut=new at;function W(){let t,e;const s=new Promise((i,r)=>{t=i,e=r});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},s.reject=i=>{n({status:"rejected",reason:i}),e(i)},s}var ct=it;function ht(){let t=[],e=0,s=o=>{o()},n=o=>{o()},i=ct;const r=o=>{e?t.push(o):i(()=>{s(o)})},c=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(f=>{s(f)})})})};return{batch:o=>{let f;e++;try{f=o()}finally{e--,e||c()}return f},batchCalls:o=>(...f)=>{r(()=>{o(...f)})},schedule:r,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Z=ht(),lt=class extends P{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!F&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},ft=new lt;function dt(t){return(t??"online")==="online"?ft.isOnline():!0}function pt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var bt=class extends P{constructor(t,e){super(),this.options=e,this.#e=t,this.#a=null,this.#o=W(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#n;#r;#o;#a;#b;#f;#d;#c;#h;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),H(this.#t,this.options)?this.#l():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return x(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return x(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#w(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof y(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#R(),this.#t.setOptions(this.options),e._defaulted&&!M(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&J(this.#t,s,this.options,e)&&this.#l(),this.updateResult(),n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(e.staleTime,this.#t))&&this.#v();const i=this.#y();n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||i!==this.#u)&&this.#m(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return yt(this,s)&&(this.#i=s,this.#r=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(s,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#R();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(nt)),e}#v(){this.#O();const t=E(this.options.staleTime,this.#t);if(F||this.#i.isStale||!q(t))return;const s=rt(this.#i.dataUpdatedAt,t)+1;this.#c=T.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#w(),this.#u=t,!(F||y(this.options.enabled,this.#t)===!1||!q(this.#u)||this.#u===0)&&(this.#h=T.setInterval(()=>{(this.options.refetchIntervalInBackground||ut.isFocused())&&this.#l()},this.#u))}#g(){this.#v(),this.#m(this.#y())}#O(){this.#c&&(T.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#h&&(T.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,n=this.options,i=this.#i,r=this.#n,c=this.#r,f=t!==s?t.state:this.#s,{state:p}=t;let a={...p},d=!1,h;if(e._optimisticResults){const b=this.hasListeners(),I=!b&&H(t,e),R=b&&J(t,s,e,n);(I||R)&&(a={...a,...pt(p.data,t.options)}),e._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:l,errorUpdatedAt:g,status:v}=a;h=a.data;let S=!1;if(e.placeholderData!==void 0&&h===void 0&&v==="pending"){let b;i?.isPlaceholderData&&e.placeholderData===c?.placeholderData?(b=i.data,S=!0):b=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,b!==void 0&&(v="success",h=B(i?.data,b,e),d=!0)}if(e.select&&h!==void 0&&!S)if(i&&h===r?.data&&e.select===this.#b)h=this.#f;else try{this.#b=e.select,h=e.select(h),h=B(i?.data,h,e),this.#f=h,this.#a=null}catch(b){this.#a=b}this.#a&&(l=this.#a,h=this.#f,g=Date.now(),v="error");const O=a.fetchStatus==="fetching",w=v==="pending",Q=v==="error",A=w&&O,V=h!==void 0,m={status:v,fetchStatus:a.fetchStatus,isPending:w,isSuccess:v==="success",isError:Q,isInitialLoading:A,isLoading:A,data:h,dataUpdatedAt:a.dataUpdatedAt,error:l,errorUpdatedAt:g,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>f.dataUpdateCount||a.errorUpdateCount>f.errorUpdateCount,isFetching:O,isRefetching:O&&!w,isLoadingError:Q&&!V,isPaused:a.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:Q&&V,isStale:_(t,e),refetch:this.refetch,promise:this.#o,isEnabled:y(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const b=j=>{m.status==="error"?j.reject(m.error):m.data!==void 0&&j.resolve(m.data)},I=()=>{const j=this.#o=m.promise=W();b(j)},R=this.#o;switch(R.status){case"pending":t.queryHash===s.queryHash&&b(R);break;case"fulfilled":(m.status==="error"||m.data!==R.value)&&I();break;case"rejected":(m.status!=="error"||m.error!==R.reason)&&I();break}}return m}updateResult(){const t=this.#i,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#r=this.options,this.#n.data!==void 0&&(this.#d=this.#t),M(e,t))return;this.#i=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(c=>{const o=c;return this.#i[o]!==t[o]&&r.has(o)})};this.#S({listeners:s()})}#R(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#S(t){Z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function vt(t,e){return y(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function H(t,e){return vt(t,e)||t.state.data!==void 0&&x(t,e,e.refetchOnMount)}function x(t,e,s){if(y(e.enabled,t)!==!1&&E(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&_(t,e)}return!1}function J(t,e,s,n){return(t!==e||y(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&_(t,s)}function _(t,e){return y(e.enabled,t)!==!1&&t.isStaleByTime(E(e.staleTime,t))}function yt(t,e){return!M(t.getCurrentResult(),e)}function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gt=class extends P{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),M(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&K(e.mutationKey)!==K(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#r(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#r()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){const t=this.#s?.state??mt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){Z.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,e,s,n),this.#i.onSettled?.(t.data,null,e,s,n)):t?.type==="error"&&(this.#i.onError?.(t.error,e,s,n),this.#i.onSettled?.(void 0,t.error,e,s,n))}this.listeners.forEach(e=>{e(this.#t)})})}},Ot="VUE_QUERY_CLIENT";function wt(t){const e=t?`:${t}`:"";return`${Ot}${e}`}function N(t,e){Object.keys(t).forEach(s=>{t[s]=e[s]})}function k(t,e,s="",n=0){if(e){const i=e(t,s,n);if(i===void 0&&u.isRef(t)||i!==void 0)return i}if(Array.isArray(t))return t.map((i,r)=>k(i,e,String(r),n+1));if(typeof t=="object"&&St(t)){const i=Object.entries(t).map(([r,c])=>[r,k(c,e,r,n+1)]);return Object.fromEntries(i)}return t}function Rt(t,e){return k(t,e)}function C(t,e=!1){return Rt(t,(s,n,i)=>{if(i===1&&n==="queryKey")return C(s,!0);if(e&&Et(s))return C(s(),e);if(u.isRef(s))return C(u.unref(s),e)})}function St(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Et(t){return typeof t=="function"}function X(t=""){if(!u.hasInjectionContext())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const e=wt(t),s=u.inject(e);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}function Ct(t,e,s){process.env.NODE_ENV==="development"&&(u.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const n=X(),i=u.computed(()=>{const l=C(e);typeof l.enabled=="function"&&(l.enabled=l.enabled());const g=n.defaultQueryOptions(l);return g._optimisticResults=n.isRestoring?.value?"isRestoring":"optimistic",g}),r=new t(n,i.value),c=i.value.shallow?u.shallowReactive(r.getCurrentResult()):u.reactive(r.getCurrentResult());let o=()=>{};n.isRestoring&&u.watch(n.isRestoring,l=>{l||(o(),o=r.subscribe(g=>{N(c,g)}))},{immediate:!0});const f=()=>{r.setOptions(i.value),N(c,r.getCurrentResult())};u.watch(i,f),u.onScopeDispose(()=>{o()});const p=(...l)=>(f(),c.refetch(...l)),a=()=>new Promise((l,g)=>{let v=()=>{};const S=()=>{if(i.value.enabled!==!1){r.setOptions(i.value);const O=r.getOptimisticResult(i.value);O.isStale?(v(),r.fetchOptimistic(i.value).then(l,w=>{D(i.value.throwOnError,[w,r.getCurrentQuery()])?g(w):l(r.getCurrentResult())})):(v(),l(O))}};S(),v=u.watch(i,S)});u.watch(()=>c.error,l=>{if(c.isError&&!c.isFetching&&D(i.value.throwOnError,[l,r.getCurrentQuery()]))throw l});const d=i.value.shallow?u.shallowReadonly(c):u.readonly(c),h=u.toRefs(d);for(const l in c)typeof c[l]=="function"&&(h[l]=c[l]);return h.suspense=a,h.refetch=p,h}function G(t,e){return Ct(bt,t)}function tt(t,e){process.env.NODE_ENV==="development"&&(u.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const s=X(),n=u.computed(()=>s.defaultMutationOptions(C(t))),i=new gt(s,n.value),r=n.value.shallow?u.shallowReactive(i.getCurrentResult()):u.reactive(i.getCurrentResult()),c=i.subscribe(a=>{N(r,a)}),o=(a,d)=>{i.mutate(a,d).catch(()=>{})};u.watch(n,()=>{i.setOptions(n.value)}),u.onScopeDispose(()=>{c()});const f=n.value.shallow?u.shallowReadonly(r):u.readonly(r),p=u.toRefs(f);return u.watch(()=>r.error,a=>{if(a&&D(n.value.throwOnError,[a]))throw a}),{...p,mutate:o,mutateAsync:r.mutate,reset:r.reset}}function It(t,e){return G({queryKey:[t],queryFn:async()=>t.value?(await Y.axiosInstance.get(t.value)).data:void 0,enabled:()=>!!t.value,...e})}function jt(t,e){return tt({mutationFn:async s=>t.value?(await Y.axiosInstance.post(t.value,s)).data:void 0,...e})}const Tt={query:It,mutation:jt};exports.apiClient=Tt;exports.useMutation=tt;exports.useQuery=G;
|
|
1
|
+
"use strict";const u=require("vue"),Y=require("./axios-_3J2k8TN.cjs");var P=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},et={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},st=class{#e=et;#t=!1;setTimeoutProvider(t){process.env.NODE_ENV!=="production"&&this.#t&&t!==this.#e&&console.error("[timeoutManager]: Switching provider after calls to previous provider might result in unexpected behavior.",{previous:this.#e,provider:t}),this.#e=t,process.env.NODE_ENV!=="production"&&(this.#t=!1)}setTimeout(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return process.env.NODE_ENV!=="production"&&(this.#t=!0),this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},T=new st;function it(t){setTimeout(t,0)}var F=typeof window>"u"||"Deno"in globalThis;function nt(){}function q(t){return typeof t=="number"&&t>=0&&t!==1/0}function rt(t,e){return Math.max(t+(e||0)-Date.now(),0)}function E(t,e){return typeof t=="function"?t(e):t}function y(t,e){return typeof t=="function"?t(e):t}function K(t){return JSON.stringify(t,(e,s)=>U(s)?Object.keys(s).sort().reduce((n,i)=>(n[i]=s[i],n),{}):s)}var ot=Object.prototype.hasOwnProperty;function L(t,e){if(t===e)return t;const s=z(t)&&z(e);if(!s&&!(U(t)&&U(e)))return e;const i=(s?t:Object.keys(t)).length,r=s?e:Object.keys(e),c=r.length,o=s?new Array(c):{};let f=0;for(let p=0;p<c;p++){const a=s?p:r[p],d=t[a],h=e[a];if(d===h){o[a]=d,(s?p<i:ot.call(t,a))&&f++;continue}if(d===null||h===null||typeof d!="object"||typeof h!="object"){o[a]=h;continue}const l=L(d,h);o[a]=l,l===d&&f++}return i===c&&f===i?t:o}function M(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function z(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function U(t){if(!$(t))return!1;const e=t.constructor;if(e===void 0)return!0;const s=e.prototype;return!(!$(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function $(t){return Object.prototype.toString.call(t)==="[object Object]"}function B(t,e,s){if(typeof s.structuralSharing=="function")return s.structuralSharing(t,e);if(s.structuralSharing!==!1){if(process.env.NODE_ENV!=="production")try{return L(t,e)}catch(n){throw console.error(`Structural sharing requires data to be JSON serializable. To fix this, turn off structuralSharing or return JSON-serializable data from your queryFn. [${s.queryHash}]: ${n}`),n}return L(t,e)}return e}function D(t,e){return typeof t=="function"?t(...e):!!t}var at=class extends P{#e;#t;#s;constructor(){super(),this.#s=t=>{if(!F&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},ut=new at;function W(){let t,e;const s=new Promise((i,r)=>{t=i,e=r});s.status="pending",s.catch(()=>{});function n(i){Object.assign(s,i),delete s.resolve,delete s.reject}return s.resolve=i=>{n({status:"fulfilled",value:i}),t(i)},s.reject=i=>{n({status:"rejected",reason:i}),e(i)},s}var ct=it;function ht(){let t=[],e=0,s=o=>{o()},n=o=>{o()},i=ct;const r=o=>{e?t.push(o):i(()=>{s(o)})},c=()=>{const o=t;t=[],o.length&&i(()=>{n(()=>{o.forEach(f=>{s(f)})})})};return{batch:o=>{let f;e++;try{f=o()}finally{e--,e||c()}return f},batchCalls:o=>(...f)=>{r(()=>{o(...f)})},schedule:r,setNotifyFunction:o=>{s=o},setBatchNotifyFunction:o=>{n=o},setScheduler:o=>{i=o}}}var Z=ht(),lt=class extends P{#e=!0;#t;#s;constructor(){super(),this.#s=t=>{if(!F&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#t||this.setEventListener(this.#s)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#s=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(s=>{s(t)}))}isOnline(){return this.#e}},ft=new lt;function dt(t){return(t??"online")==="online"?ft.isOnline():!0}function pt(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dt(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}var bt=class extends P{constructor(t,e){super(),this.options=e,this.#e=t,this.#a=null,this.#o=W(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#s=void 0;#i=void 0;#n;#r;#o;#a;#b;#f;#d;#c;#h;#u;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),H(this.#t,this.options)?this.#l():this.updateResult(),this.#g())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return x(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return x(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#O(),this.#w(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,s=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof y(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#R(),this.#t.setOptions(this.options),e._defaulted&&!M(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const n=this.hasListeners();n&&J(this.#t,s,this.options,e)&&this.#l(),this.updateResult(),n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||E(this.options.staleTime,this.#t)!==E(e.staleTime,this.#t))&&this.#v();const i=this.#y();n&&(this.#t!==s||y(this.options.enabled,this.#t)!==y(e.enabled,this.#t)||i!==this.#u)&&this.#m(i)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),s=this.createResult(e,t);return yt(this,s)&&(this.#i=s,this.#r=this.options,this.#n=this.#t.state),s}getCurrentResult(){return this.#i}trackResult(t,e){return new Proxy(t,{get:(s,n)=>(this.trackProp(n),e?.(n),n==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&this.#o.status==="pending"&&this.#o.reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,n))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),s=this.#e.getQueryCache().build(this.#e,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#l({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#i))}#l(t){this.#R();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(nt)),e}#v(){this.#O();const t=E(this.options.staleTime,this.#t);if(F||this.#i.isStale||!q(t))return;const s=rt(this.#i.dataUpdatedAt,t)+1;this.#c=T.setTimeout(()=>{this.#i.isStale||this.updateResult()},s)}#y(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#m(t){this.#w(),this.#u=t,!(F||y(this.options.enabled,this.#t)===!1||!q(this.#u)||this.#u===0)&&(this.#h=T.setInterval(()=>{(this.options.refetchIntervalInBackground||ut.isFocused())&&this.#l()},this.#u))}#g(){this.#v(),this.#m(this.#y())}#O(){this.#c&&(T.clearTimeout(this.#c),this.#c=void 0)}#w(){this.#h&&(T.clearInterval(this.#h),this.#h=void 0)}createResult(t,e){const s=this.#t,n=this.options,i=this.#i,r=this.#n,c=this.#r,f=t!==s?t.state:this.#s,{state:p}=t;let a={...p},d=!1,h;if(e._optimisticResults){const b=this.hasListeners(),I=!b&&H(t,e),R=b&&J(t,s,e,n);(I||R)&&(a={...a,...pt(p.data,t.options)}),e._optimisticResults==="isRestoring"&&(a.fetchStatus="idle")}let{error:l,errorUpdatedAt:g,status:v}=a;h=a.data;let S=!1;if(e.placeholderData!==void 0&&h===void 0&&v==="pending"){let b;i?.isPlaceholderData&&e.placeholderData===c?.placeholderData?(b=i.data,S=!0):b=typeof e.placeholderData=="function"?e.placeholderData(this.#d?.state.data,this.#d):e.placeholderData,b!==void 0&&(v="success",h=B(i?.data,b,e),d=!0)}if(e.select&&h!==void 0&&!S)if(i&&h===r?.data&&e.select===this.#b)h=this.#f;else try{this.#b=e.select,h=e.select(h),h=B(i?.data,h,e),this.#f=h,this.#a=null}catch(b){this.#a=b}this.#a&&(l=this.#a,h=this.#f,g=Date.now(),v="error");const O=a.fetchStatus==="fetching",w=v==="pending",Q=v==="error",A=w&&O,V=h!==void 0,m={status:v,fetchStatus:a.fetchStatus,isPending:w,isSuccess:v==="success",isError:Q,isInitialLoading:A,isLoading:A,data:h,dataUpdatedAt:a.dataUpdatedAt,error:l,errorUpdatedAt:g,failureCount:a.fetchFailureCount,failureReason:a.fetchFailureReason,errorUpdateCount:a.errorUpdateCount,isFetched:a.dataUpdateCount>0||a.errorUpdateCount>0,isFetchedAfterMount:a.dataUpdateCount>f.dataUpdateCount||a.errorUpdateCount>f.errorUpdateCount,isFetching:O,isRefetching:O&&!w,isLoadingError:Q&&!V,isPaused:a.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:Q&&V,isStale:_(t,e),refetch:this.refetch,promise:this.#o,isEnabled:y(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const b=j=>{m.status==="error"?j.reject(m.error):m.data!==void 0&&j.resolve(m.data)},I=()=>{const j=this.#o=m.promise=W();b(j)},R=this.#o;switch(R.status){case"pending":t.queryHash===s.queryHash&&b(R);break;case"fulfilled":(m.status==="error"||m.data!==R.value)&&I();break;case"rejected":(m.status!=="error"||m.error!==R.reason)&&I();break}}return m}updateResult(){const t=this.#i,e=this.createResult(this.#t,this.options);if(this.#n=this.#t.state,this.#r=this.options,this.#n.data!==void 0&&(this.#d=this.#t),M(e,t))return;this.#i=e;const s=()=>{if(!t)return!0;const{notifyOnChangeProps:n}=this.options,i=typeof n=="function"?n():n;if(i==="all"||!i&&!this.#p.size)return!0;const r=new Set(i??this.#p);return this.options.throwOnError&&r.add("error"),Object.keys(this.#i).some(c=>{const o=c;return this.#i[o]!==t[o]&&r.has(o)})};this.#S({listeners:s()})}#R(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#s=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#g()}#S(t){Z.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#i)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function vt(t,e){return y(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function H(t,e){return vt(t,e)||t.state.data!==void 0&&x(t,e,e.refetchOnMount)}function x(t,e,s){if(y(e.enabled,t)!==!1&&E(e.staleTime,t)!=="static"){const n=typeof s=="function"?s(t):s;return n==="always"||n!==!1&&_(t,e)}return!1}function J(t,e,s,n){return(t!==e||y(n.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&_(t,s)}function _(t,e){return y(e.enabled,t)!==!1&&t.isStaleByTime(E(e.staleTime,t))}function yt(t,e){return!M(t.getCurrentResult(),e)}function mt(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var gt=class extends P{#e;#t=void 0;#s;#i;constructor(t,e){super(),this.#e=t,this.setOptions(e),this.bindMethods(),this.#n()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){const e=this.options;this.options=this.#e.defaultMutationOptions(t),M(this.options,e)||this.#e.getMutationCache().notify({type:"observerOptionsUpdated",mutation:this.#s,observer:this}),e?.mutationKey&&this.options.mutationKey&&K(e.mutationKey)!==K(this.options.mutationKey)?this.reset():this.#s?.state.status==="pending"&&this.#s.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#s?.removeObserver(this)}onMutationUpdate(t){this.#n(),this.#r(t)}getCurrentResult(){return this.#t}reset(){this.#s?.removeObserver(this),this.#s=void 0,this.#n(),this.#r()}mutate(t,e){return this.#i=e,this.#s?.removeObserver(this),this.#s=this.#e.getMutationCache().build(this.#e,this.options),this.#s.addObserver(this),this.#s.execute(t)}#n(){const t=this.#s?.state??mt();this.#t={...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset}}#r(t){Z.batch(()=>{if(this.#i&&this.hasListeners()){const e=this.#t.variables,s=this.#t.context,n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};t?.type==="success"?(this.#i.onSuccess?.(t.data,e,s,n),this.#i.onSettled?.(t.data,null,e,s,n)):t?.type==="error"&&(this.#i.onError?.(t.error,e,s,n),this.#i.onSettled?.(void 0,t.error,e,s,n))}this.listeners.forEach(e=>{e(this.#t)})})}},Ot="VUE_QUERY_CLIENT";function wt(t){const e=t?`:${t}`:"";return`${Ot}${e}`}function N(t,e){Object.keys(t).forEach(s=>{t[s]=e[s]})}function k(t,e,s="",n=0){if(e){const i=e(t,s,n);if(i===void 0&&u.isRef(t)||i!==void 0)return i}if(Array.isArray(t))return t.map((i,r)=>k(i,e,String(r),n+1));if(typeof t=="object"&&St(t)){const i=Object.entries(t).map(([r,c])=>[r,k(c,e,r,n+1)]);return Object.fromEntries(i)}return t}function Rt(t,e){return k(t,e)}function C(t,e=!1){return Rt(t,(s,n,i)=>{if(i===1&&n==="queryKey")return C(s,!0);if(e&&Et(s))return C(s(),e);if(u.isRef(s))return C(u.unref(s),e)})}function St(t){if(Object.prototype.toString.call(t)!=="[object Object]")return!1;const e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function Et(t){return typeof t=="function"}function X(t=""){if(!u.hasInjectionContext())throw new Error("vue-query hooks can only be used inside setup() function or functions that support injection context.");const e=wt(t),s=u.inject(e);if(!s)throw new Error("No 'queryClient' found in Vue context, use 'VueQueryPlugin' to properly initialize the library.");return s}function Ct(t,e,s){process.env.NODE_ENV==="development"&&(u.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const n=X(),i=u.computed(()=>{const l=C(e);typeof l.enabled=="function"&&(l.enabled=l.enabled());const g=n.defaultQueryOptions(l);return g._optimisticResults=n.isRestoring?.value?"isRestoring":"optimistic",g}),r=new t(n,i.value),c=i.value.shallow?u.shallowReactive(r.getCurrentResult()):u.reactive(r.getCurrentResult());let o=()=>{};n.isRestoring&&u.watch(n.isRestoring,l=>{l||(o(),o=r.subscribe(g=>{N(c,g)}))},{immediate:!0});const f=()=>{r.setOptions(i.value),N(c,r.getCurrentResult())};u.watch(i,f),u.onScopeDispose(()=>{o()});const p=(...l)=>(f(),c.refetch(...l)),a=()=>new Promise((l,g)=>{let v=()=>{};const S=()=>{if(i.value.enabled!==!1){r.setOptions(i.value);const O=r.getOptimisticResult(i.value);O.isStale?(v(),r.fetchOptimistic(i.value).then(l,w=>{D(i.value.throwOnError,[w,r.getCurrentQuery()])?g(w):l(r.getCurrentResult())})):(v(),l(O))}};S(),v=u.watch(i,S)});u.watch(()=>c.error,l=>{if(c.isError&&!c.isFetching&&D(i.value.throwOnError,[l,r.getCurrentQuery()]))throw l});const d=i.value.shallow?u.shallowReadonly(c):u.readonly(c),h=u.toRefs(d);for(const l in c)typeof c[l]=="function"&&(h[l]=c[l]);return h.suspense=a,h.refetch=p,h}function G(t,e){return Ct(bt,t)}function tt(t,e){process.env.NODE_ENV==="development"&&(u.getCurrentScope()||console.warn('vue-query composable like "useQuery()" should only be used inside a "setup()" function or a running effect scope. They might otherwise lead to memory leaks.'));const s=X(),n=u.computed(()=>s.defaultMutationOptions(C(t))),i=new gt(s,n.value),r=n.value.shallow?u.shallowReactive(i.getCurrentResult()):u.reactive(i.getCurrentResult()),c=i.subscribe(a=>{N(r,a)}),o=(a,d)=>{i.mutate(a,d).catch(()=>{})};u.watch(n,()=>{i.setOptions(n.value)}),u.onScopeDispose(()=>{c()});const f=n.value.shallow?u.shallowReadonly(r):u.readonly(r),p=u.toRefs(f);return u.watch(()=>r.error,a=>{if(a&&D(n.value.throwOnError,[a]))throw a}),{...p,mutate:o,mutateAsync:r.mutate,reset:r.reset}}function It(t,e){return G({queryKey:[t],queryFn:async()=>t.value?(await Y.axiosInstance.get(t.value)).data:void 0,enabled:()=>!!t.value,...e})}function jt(t,e){return tt({mutationFn:async s=>t.value?(await Y.axiosInstance.post(t.value,s)).data:void 0,...e})}const Tt={query:It,mutation:jt};exports.apiClient=Tt;exports.useMutation=tt;exports.useQuery=G;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isRef as Y, unref as ut, hasInjectionContext as ht, inject as ct, getCurrentScope as Z, computed as X, shallowReactive as G, reactive as tt, watch as R, onScopeDispose as et, shallowReadonly as st, readonly as it, toRefs as nt } from "vue";
|
|
2
|
-
import { a as rt } from "./axios-
|
|
2
|
+
import { a as rt } from "./axios-C8xtaJSd.js";
|
|
3
3
|
var P = class {
|
|
4
4
|
constructor() {
|
|
5
5
|
this.listeners = /* @__PURE__ */ new Set(), this.subscribe = this.subscribe.bind(this);
|