nextclaw 0.8.61 → 0.8.62
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/package.json +1 -1
- package/ui-dist/assets/{ChannelsList-B6N0kXyK.js → ChannelsList-C8cguFLc.js} +1 -1
- package/ui-dist/assets/{ChatPage-DsDFvVQX.js → ChatPage-BkHWNUNR.js} +1 -1
- package/ui-dist/assets/{CronConfig-Cbz6V8MU.js → CronConfig-D-ESQlvk.js} +1 -1
- package/ui-dist/assets/{DocBrowser-hQzP4Iai.js → DocBrowser-B9ZD6pAk.js} +1 -1
- package/ui-dist/assets/{MarketplacePage-DMoWoU1y.js → MarketplacePage-Ds_l9KTF.js} +1 -1
- package/ui-dist/assets/{ModelConfig-BXjF-qbA.js → ModelConfig-N1tbLv9b.js} +1 -1
- package/ui-dist/assets/{ProvidersList-D3hfY5U7.js → ProvidersList-BXHpjVtO.js} +1 -1
- package/ui-dist/assets/{RuntimeConfig-DJ7qIejp.js → RuntimeConfig-KsKfkjgv.js} +1 -1
- package/ui-dist/assets/{SecretsConfig-BFDeNvwV.js → SecretsConfig-KkgMzdt1.js} +1 -1
- package/ui-dist/assets/{SessionsConfig-CJF7lPkX.js → SessionsConfig-CWBp8IPf.js} +1 -1
- package/ui-dist/assets/{card-BREZdIEb.js → card-D7NY0Szf.js} +1 -1
- package/ui-dist/assets/index-BRBYYgR_.js +2 -0
- package/ui-dist/assets/{label-CzMB2yjV.js → label-Ojs7Al6B.js} +1 -1
- package/ui-dist/assets/{logos-vVtRUuoo.js → logos-B1qBsCSi.js} +1 -1
- package/ui-dist/assets/{page-layout-B07kdurB.js → page-layout-CUMMO0nN.js} +1 -1
- package/ui-dist/assets/{switch-Cr6cemeT.js → switch-BdhS_16-.js} +1 -1
- package/ui-dist/assets/{tabs-custom-BzcvgsvR.js → tabs-custom-D261E5EA.js} +1 -1
- package/ui-dist/assets/{useConfig-B4Y6cGwc.js → useConfig-txxbxXnT.js} +1 -1
- package/ui-dist/assets/{useConfirmDialog-Dc5WHCUf.js → useConfirmDialog-BUKGHDL6.js} +1 -1
- package/ui-dist/index.html +1 -1
- package/dist/chunk-4I7WMYPU.js +0 -2289
- package/dist/chunk-HXRBJNWA.js +0 -2324
- package/dist/chunk-PIG2O4DT.js +0 -2095
- package/dist/chunk-RTVGGPPW.js +0 -2307
- package/dist/chunk-X77K7Y4T.js +0 -2316
- package/dist/chunk-XAY6UDOR.js +0 -2282
- package/dist/chunk-Z2YDZBBE.js +0 -2325
- package/ui-dist/assets/index-uTbQ-MAY.js +0 -2
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as j,j as a,ab as Z,s as ee,ae as F,K as ae,a3 as te,af as se,ag as ne,ah as le,ai as re,U as oe,aj as ce,n as ie}from"./vendor-Dh04PGww.js";import{u as $,a as q,b as K,k as me,l as pe,I as T}from"./useConfig-B4Y6cGwc.js";import{B as E,P as de,a as be}from"./page-layout-B07kdurB.js";import{L as ue}from"./label-CzMB2yjV.js";import{S as xe}from"./switch-Cr6cemeT.js";import{t as e,c as D,g as ye,S as ge,a as he,b as fe,d as we,e as je}from"./index-uTbQ-MAY.js";import{C as ve,a as ke,L as H,d as J,S as z,b as Se,c as Ce}from"./logos-vVtRUuoo.js";import{h as U}from"./config-hints-CApS3K_7.js";import{T as Ne}from"./tabs-custom-BzcvgsvR.js";function Pe({value:t,onChange:p,className:i,placeholder:c=""}){const[r,u]=j.useState(""),d=x=>{x.key==="Enter"&&r.trim()?(x.preventDefault(),p([...t,r.trim()]),u("")):x.key==="Backspace"&&!r&&t.length>0&&p(t.slice(0,-1))},g=x=>{p(t.filter((v,h)=>h!==x))};return a.jsxs("div",{className:D("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",i),children:[t.map((x,v)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[x,a.jsx("button",{type:"button",onClick:()=>g(v),className:"hover:text-red-300 transition-colors",children:a.jsx(Z,{className:"h-3 w-3"})})]},v)),a.jsx("input",{type:"text",value:r,onChange:x=>u(x.target.value),onKeyDown:d,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:c||e("enterTag")})]})}function Y(t){var c,r;const p=ye();return((c=t.tutorialUrls)==null?void 0:c[p])||((r=t.tutorialUrls)==null?void 0:r.default)||t.tutorialUrl}const B=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],R=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],Ie=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}],Fe=t=>t.includes("token")||t.includes("secret")||t.includes("password")?a.jsx(ae,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("url")||t.includes("host")?a.jsx(te,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("email")||t.includes("mail")?a.jsx(se,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("id")||t.includes("from")?a.jsx(ne,{className:"h-3.5 w-3.5 text-gray-500"}):t==="enabled"||t==="consentGranted"?a.jsx(le,{className:"h-3.5 w-3.5 text-gray-500"}):a.jsx(re,{className:"h-3.5 w-3.5 text-gray-500"});function G(){return{telegram:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"proxy",type:"text",label:e("proxy")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:B},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:R},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"gatewayUrl",type:"text",label:e("gatewayUrl")},{name:"intents",type:"number",label:e("intents")},{name:"proxy",type:"text",label:e("proxy")},{name:"mediaMaxMb",type:"number",label:e("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:e("streamingMode"),options:Ie},{name:"draftChunk",type:"json",label:e("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:e("textChunkLimit")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:B},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:R},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"bridgeUrl",type:"text",label:e("bridgeUrl")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"appSecret",type:"password",label:e("appSecret")},{name:"encryptKey",type:"password",label:e("encryptKey")},{name:"verificationToken",type:"password",label:e("verificationToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"clientId",type:"text",label:e("clientId")},{name:"clientSecret",type:"password",label:e("clientSecret")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"corpId",type:"text",label:e("corpId")},{name:"agentId",type:"text",label:e("agentId")},{name:"secret",type:"password",label:e("secret")},{name:"token",type:"password",label:e("token")},{name:"callbackPort",type:"number",label:e("callbackPort")},{name:"callbackPath",type:"text",label:e("callbackPath")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"mode",type:"text",label:e("mode")},{name:"webhookPath",type:"text",label:e("webhookPath")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"botToken",type:"password",label:e("botToken")},{name:"appToken",type:"password",label:e("appToken")}],email:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"consentGranted",type:"boolean",label:e("consentGranted")},{name:"imapHost",type:"text",label:e("imapHost")},{name:"imapPort",type:"number",label:e("imapPort")},{name:"imapUsername",type:"text",label:e("imapUsername")},{name:"imapPassword",type:"password",label:e("imapPassword")},{name:"fromAddress",type:"email",label:e("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"baseUrl",type:"text",label:e("baseUrl")},{name:"clawToken",type:"password",label:e("clawToken")},{name:"agentUserId",type:"text",label:e("agentUserId")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"secret",type:"password",label:e("appSecret")},{name:"markdownSupport",type:"boolean",label:e("markdownSupport")},{name:"allowFrom",type:"tags",label:e("allowFrom")}]}}function A(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function V(t,p){const i={...t};for(const[c,r]of Object.entries(p)){const u=i[c];if(A(u)&&A(r)){i[c]=V(u,r);continue}i[c]=r}return i}function Te(t,p){const i=t.split("."),c={};let r=c;for(let u=0;u<i.length-1;u+=1){const d=i[u];r[d]={},r=r[d]}return r[i[i.length-1]]=p,c}function De({channelName:t}){var _,O;const{data:p}=$(),{data:i}=q(),{data:c}=K(),r=me(),u=pe(),[d,g]=j.useState({}),[x,v]=j.useState({}),[h,f]=j.useState(null),k=t?p==null?void 0:p.channels[t]:null,w=t?G()[t]??[]:[],o=c==null?void 0:c.uiHints,m=t?`channels.${t}`:null,S=((_=c==null?void 0:c.actions)==null?void 0:_.filter(s=>s.scope===m))??[],C=t&&(((O=U(`channels.${t}`,o))==null?void 0:O.label)??t),P=i==null?void 0:i.channels.find(s=>s.name===t),I=P?Y(P):void 0;j.useEffect(()=>{if(k){g({...k});const s={};(t?G()[t]??[]:[]).filter(l=>l.type==="json").forEach(l=>{const y=k[l.name];s[l.name]=JSON.stringify(y??{},null,2)}),v(s)}else g({}),v({})},[k,t]);const N=(s,n)=>{g(l=>({...l,[s]:n}))},L=s=>{if(s.preventDefault(),!t)return;const n={...d};for(const l of w){if(l.type!=="password")continue;const y=n[l.name];(typeof y!="string"||y.length===0)&&delete n[l.name]}for(const l of w){if(l.type!=="json")continue;const y=x[l.name]??"";try{n[l.name]=y.trim()?JSON.parse(y):{}}catch{F.error(`${e("invalidJson")}: ${l.name}`);return}}r.mutate({channel:t,data:n})},Q=s=>{if(!s||!t)return;const n=s.channels;if(!A(n))return;const l=n[t];A(l)&&g(y=>V(y,l))},W=async s=>{if(!(!t||!m)){f(s.id);try{let n={...d};s.saveBeforeRun&&(n={...n,...s.savePatch??{}},g(n),await r.mutateAsync({channel:t,data:n}));const l=await u.mutateAsync({actionId:s.id,data:{scope:m,draftConfig:Te(m,n)}});Q(l.patch),l.ok?F.success(l.message||e("success")):F.error(l.message||e("error"))}catch(n){const l=n instanceof Error?n.message:String(n);F.error(`${e("error")}: ${l}`)}finally{f(null)}}};if(!t||!P||!k)return a.jsx("div",{className:ve,children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:e("channelsSelectTitle")}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsSelectDescription")})]})});const M=!!k.enabled;return a.jsxs("div",{className:ke,children:[a.jsx("div",{className:"border-b border-gray-100 px-6 py-5",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(H,{name:t,src:J(t),className:D("h-9 w-9 rounded-lg border",M?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:t[0]})}),a.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900 capitalize",children:C})]}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsFormDescription")}),I&&a.jsxs("a",{href:I,className:"mt-2 inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover",children:[a.jsx(ee,{className:"h-3.5 w-3.5"}),e("channelsGuideTitle")]})]}),a.jsx(z,{status:M?"active":"inactive",label:M?e("statusActive"):e("statusInactive")})]})}),a.jsxs("form",{onSubmit:L,className:"flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 space-y-6 overflow-y-auto px-6 py-5",children:w.map(s=>{const n=t?U(`channels.${t}.${s.name}`,o):void 0,l=(n==null?void 0:n.label)??s.label,y=n==null?void 0:n.placeholder;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs(ue,{htmlFor:s.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[Fe(s.name),l]}),s.type==="boolean"&&a.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[a.jsx("span",{className:"text-sm text-gray-500",children:d[s.name]?e("enabled"):e("disabled")}),a.jsx(xe,{id:s.name,checked:d[s.name]||!1,onCheckedChange:b=>N(s.name,b),className:"data-[state=checked]:bg-emerald-500"})]}),(s.type==="text"||s.type==="email")&&a.jsx(T,{id:s.name,type:s.type,value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y,className:"rounded-xl"}),s.type==="password"&&a.jsx(T,{id:s.name,type:"password",value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y??e("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),s.type==="number"&&a.jsx(T,{id:s.name,type:"number",value:d[s.name]||0,onChange:b=>N(s.name,parseInt(b.target.value,10)||0),placeholder:y,className:"rounded-xl"}),s.type==="tags"&&a.jsx(Pe,{value:d[s.name]||[],onChange:b=>N(s.name,b)}),s.type==="select"&&a.jsxs(ge,{value:d[s.name]||"",onValueChange:b=>N(s.name,b),children:[a.jsx(he,{className:"rounded-xl",children:a.jsx(fe,{})}),a.jsx(we,{children:(s.options??[]).map(b=>a.jsx(je,{value:b.value,children:b.label},b.value))})]}),s.type==="json"&&a.jsx("textarea",{id:s.name,value:x[s.name]??"{}",onChange:b=>v(X=>({...X,[s.name]:b.target.value})),className:"min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},s.name)})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-100 px-6 py-4",children:[a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:S.filter(s=>s.trigger==="manual").map(s=>a.jsx(E,{type:"button",onClick:()=>W(s),disabled:r.isPending||!!h,variant:"secondary",children:h===s.id?e("connecting"):s.title},s.id))}),a.jsx(E,{type:"submit",disabled:r.isPending||!!h,children:r.isPending?e("saving"):e("save")})]})]})]})}const Ae={telegram:"channelDescTelegram",slack:"channelDescSlack",email:"channelDescEmail",webhook:"channelDescWebhook",discord:"channelDescDiscord",feishu:"channelDescFeishu"};function $e(){const{data:t}=$(),{data:p}=q(),{data:i}=K(),[c,r]=j.useState("enabled"),[u,d]=j.useState(),[g,x]=j.useState(""),v=i==null?void 0:i.uiHints,h=p==null?void 0:p.channels,f=t==null?void 0:t.channels,k=[{id:"enabled",label:e("channelsTabEnabled"),count:(h??[]).filter(o=>{var m;return(m=f==null?void 0:f[o.name])==null?void 0:m.enabled}).length},{id:"all",label:e("channelsTabAll"),count:(h??[]).length}],w=j.useMemo(()=>{const o=g.trim().toLowerCase();return(h??[]).filter(m=>{var C;const S=((C=f==null?void 0:f[m.name])==null?void 0:C.enabled)||!1;return c==="enabled"?S:!0}).filter(m=>o?(m.displayName||m.name).toLowerCase().includes(o)||m.name.toLowerCase().includes(o):!0)},[c,f,h,g]);return j.useEffect(()=>{if(w.length===0){d(void 0);return}w.some(m=>m.name===u)||d(w[0].name)},[w,u]),!t||!p?a.jsx("div",{className:"p-8 text-gray-400",children:e("channelsLoading")}):a.jsxs(de,{children:[a.jsx(be,{title:e("channelsPageTitle"),description:e("channelsPageDescription")}),a.jsxs("div",{className:Se,children:[a.jsxs("section",{className:Ce,children:[a.jsx("div",{className:"border-b border-gray-100 px-4 pt-4",children:a.jsx(Ne,{tabs:k,activeTab:c,onChange:r,className:"mb-0"})}),a.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:a.jsxs("div",{className:"relative",children:[a.jsx(oe,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),a.jsx(T,{value:g,onChange:o=>x(o.target.value),placeholder:e("channelsFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[w.map(o=>{const m=t.channels[o.name],S=(m==null?void 0:m.enabled)||!1,C=U(`channels.${o.name}`,v),P=Y(o),I=(C==null?void 0:C.help)||e(Ae[o.name]||"channelDescriptionDefault"),N=u===o.name;return a.jsx("button",{type:"button",onClick:()=>d(o.name),className:D("w-full rounded-xl border p-2.5 text-left transition-all",N?"border-primary/30 bg-primary-50/40 shadow-sm":"border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70"),children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[a.jsx(H,{name:o.name,src:J(o.name),className:D("h-10 w-10 rounded-lg border",S?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:o.name[0]})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:o.displayName||o.name}),a.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:I})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[P&&a.jsx("a",{href:P,onClick:L=>L.stopPropagation(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-300 transition-colors hover:bg-gray-100/70 hover:text-gray-500",title:e("channelsGuideTitle"),children:a.jsx(ce,{className:"h-3.5 w-3.5"})}),a.jsx(z,{status:S?"active":"inactive",label:S?e("statusActive"):e("statusInactive"),className:"min-w-[56px] justify-center"})]})]})},o.name)}),w.length===0&&a.jsxs("div",{className:"flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:a.jsx(ie,{className:"h-5 w-5 text-gray-300"})}),a.jsx("p",{className:"text-sm font-medium text-gray-700",children:e("channelsNoMatch")})]})]})]}),a.jsx(De,{channelName:u})]})]})}export{$e as ChannelsList};
|
|
1
|
+
import{r as j,j as a,ab as Z,s as ee,ae as F,K as ae,a3 as te,af as se,ag as ne,ah as le,ai as re,U as oe,aj as ce,n as ie}from"./vendor-Dh04PGww.js";import{u as $,a as q,b as K,k as me,l as pe,I as T}from"./useConfig-txxbxXnT.js";import{B as E,P as de,a as be}from"./page-layout-CUMMO0nN.js";import{L as ue}from"./label-Ojs7Al6B.js";import{S as xe}from"./switch-BdhS_16-.js";import{t as e,c as D,g as ye,S as ge,a as he,b as fe,d as we,e as je}from"./index-BRBYYgR_.js";import{C as ve,a as ke,L as H,d as J,S as z,b as Se,c as Ce}from"./logos-B1qBsCSi.js";import{h as U}from"./config-hints-CApS3K_7.js";import{T as Ne}from"./tabs-custom-D261E5EA.js";function Pe({value:t,onChange:p,className:i,placeholder:c=""}){const[r,u]=j.useState(""),d=x=>{x.key==="Enter"&&r.trim()?(x.preventDefault(),p([...t,r.trim()]),u("")):x.key==="Backspace"&&!r&&t.length>0&&p(t.slice(0,-1))},g=x=>{p(t.filter((v,h)=>h!==x))};return a.jsxs("div",{className:D("flex flex-wrap gap-2 p-2 border rounded-md min-h-[42px]",i),children:[t.map((x,v)=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-primary text-primary-foreground rounded text-sm",children:[x,a.jsx("button",{type:"button",onClick:()=>g(v),className:"hover:text-red-300 transition-colors",children:a.jsx(Z,{className:"h-3 w-3"})})]},v)),a.jsx("input",{type:"text",value:r,onChange:x=>u(x.target.value),onKeyDown:d,className:"flex-1 outline-none min-w-[100px] bg-transparent text-sm",placeholder:c||e("enterTag")})]})}function Y(t){var c,r;const p=ye();return((c=t.tutorialUrls)==null?void 0:c[p])||((r=t.tutorialUrls)==null?void 0:r.default)||t.tutorialUrl}const B=[{value:"pairing",label:"pairing"},{value:"allowlist",label:"allowlist"},{value:"open",label:"open"},{value:"disabled",label:"disabled"}],R=[{value:"open",label:"open"},{value:"allowlist",label:"allowlist"},{value:"disabled",label:"disabled"}],Ie=[{value:"off",label:"off"},{value:"partial",label:"partial"},{value:"block",label:"block"},{value:"progress",label:"progress"}],Fe=t=>t.includes("token")||t.includes("secret")||t.includes("password")?a.jsx(ae,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("url")||t.includes("host")?a.jsx(te,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("email")||t.includes("mail")?a.jsx(se,{className:"h-3.5 w-3.5 text-gray-500"}):t.includes("id")||t.includes("from")?a.jsx(ne,{className:"h-3.5 w-3.5 text-gray-500"}):t==="enabled"||t==="consentGranted"?a.jsx(le,{className:"h-3.5 w-3.5 text-gray-500"}):a.jsx(re,{className:"h-3.5 w-3.5 text-gray-500"});function G(){return{telegram:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"proxy",type:"text",label:e("proxy")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:B},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:R},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],discord:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"token",type:"password",label:e("botToken")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"allowFrom",type:"tags",label:e("allowFrom")},{name:"gatewayUrl",type:"text",label:e("gatewayUrl")},{name:"intents",type:"number",label:e("intents")},{name:"proxy",type:"text",label:e("proxy")},{name:"mediaMaxMb",type:"number",label:e("attachmentMaxSizeMb")},{name:"streaming",type:"select",label:e("streamingMode"),options:Ie},{name:"draftChunk",type:"json",label:e("draftChunkingJson")},{name:"textChunkLimit",type:"number",label:e("textChunkLimit")},{name:"accountId",type:"text",label:e("accountId")},{name:"dmPolicy",type:"select",label:e("dmPolicy"),options:B},{name:"groupPolicy",type:"select",label:e("groupPolicy"),options:R},{name:"groupAllowFrom",type:"tags",label:e("groupAllowFrom")},{name:"requireMention",type:"boolean",label:e("requireMention")},{name:"mentionPatterns",type:"tags",label:e("mentionPatterns")},{name:"groups",type:"json",label:e("groupRulesJson")}],whatsapp:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"bridgeUrl",type:"text",label:e("bridgeUrl")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],feishu:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"appSecret",type:"password",label:e("appSecret")},{name:"encryptKey",type:"password",label:e("encryptKey")},{name:"verificationToken",type:"password",label:e("verificationToken")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],dingtalk:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"clientId",type:"text",label:e("clientId")},{name:"clientSecret",type:"password",label:e("clientSecret")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],wecom:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"corpId",type:"text",label:e("corpId")},{name:"agentId",type:"text",label:e("agentId")},{name:"secret",type:"password",label:e("secret")},{name:"token",type:"password",label:e("token")},{name:"callbackPort",type:"number",label:e("callbackPort")},{name:"callbackPath",type:"text",label:e("callbackPath")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],slack:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"mode",type:"text",label:e("mode")},{name:"webhookPath",type:"text",label:e("webhookPath")},{name:"allowBots",type:"boolean",label:e("allowBotMessages")},{name:"botToken",type:"password",label:e("botToken")},{name:"appToken",type:"password",label:e("appToken")}],email:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"consentGranted",type:"boolean",label:e("consentGranted")},{name:"imapHost",type:"text",label:e("imapHost")},{name:"imapPort",type:"number",label:e("imapPort")},{name:"imapUsername",type:"text",label:e("imapUsername")},{name:"imapPassword",type:"password",label:e("imapPassword")},{name:"fromAddress",type:"email",label:e("fromAddress")}],mochat:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"baseUrl",type:"text",label:e("baseUrl")},{name:"clawToken",type:"password",label:e("clawToken")},{name:"agentUserId",type:"text",label:e("agentUserId")},{name:"allowFrom",type:"tags",label:e("allowFrom")}],qq:[{name:"enabled",type:"boolean",label:e("enabled")},{name:"appId",type:"text",label:e("appId")},{name:"secret",type:"password",label:e("appSecret")},{name:"markdownSupport",type:"boolean",label:e("markdownSupport")},{name:"allowFrom",type:"tags",label:e("allowFrom")}]}}function A(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function V(t,p){const i={...t};for(const[c,r]of Object.entries(p)){const u=i[c];if(A(u)&&A(r)){i[c]=V(u,r);continue}i[c]=r}return i}function Te(t,p){const i=t.split("."),c={};let r=c;for(let u=0;u<i.length-1;u+=1){const d=i[u];r[d]={},r=r[d]}return r[i[i.length-1]]=p,c}function De({channelName:t}){var _,O;const{data:p}=$(),{data:i}=q(),{data:c}=K(),r=me(),u=pe(),[d,g]=j.useState({}),[x,v]=j.useState({}),[h,f]=j.useState(null),k=t?p==null?void 0:p.channels[t]:null,w=t?G()[t]??[]:[],o=c==null?void 0:c.uiHints,m=t?`channels.${t}`:null,S=((_=c==null?void 0:c.actions)==null?void 0:_.filter(s=>s.scope===m))??[],C=t&&(((O=U(`channels.${t}`,o))==null?void 0:O.label)??t),P=i==null?void 0:i.channels.find(s=>s.name===t),I=P?Y(P):void 0;j.useEffect(()=>{if(k){g({...k});const s={};(t?G()[t]??[]:[]).filter(l=>l.type==="json").forEach(l=>{const y=k[l.name];s[l.name]=JSON.stringify(y??{},null,2)}),v(s)}else g({}),v({})},[k,t]);const N=(s,n)=>{g(l=>({...l,[s]:n}))},L=s=>{if(s.preventDefault(),!t)return;const n={...d};for(const l of w){if(l.type!=="password")continue;const y=n[l.name];(typeof y!="string"||y.length===0)&&delete n[l.name]}for(const l of w){if(l.type!=="json")continue;const y=x[l.name]??"";try{n[l.name]=y.trim()?JSON.parse(y):{}}catch{F.error(`${e("invalidJson")}: ${l.name}`);return}}r.mutate({channel:t,data:n})},Q=s=>{if(!s||!t)return;const n=s.channels;if(!A(n))return;const l=n[t];A(l)&&g(y=>V(y,l))},W=async s=>{if(!(!t||!m)){f(s.id);try{let n={...d};s.saveBeforeRun&&(n={...n,...s.savePatch??{}},g(n),await r.mutateAsync({channel:t,data:n}));const l=await u.mutateAsync({actionId:s.id,data:{scope:m,draftConfig:Te(m,n)}});Q(l.patch),l.ok?F.success(l.message||e("success")):F.error(l.message||e("error"))}catch(n){const l=n instanceof Error?n.message:String(n);F.error(`${e("error")}: ${l}`)}finally{f(null)}}};if(!t||!P||!k)return a.jsx("div",{className:ve,children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:e("channelsSelectTitle")}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsSelectDescription")})]})});const M=!!k.enabled;return a.jsxs("div",{className:ke,children:[a.jsx("div",{className:"border-b border-gray-100 px-6 py-5",children:a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(H,{name:t,src:J(t),className:D("h-9 w-9 rounded-lg border",M?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:t[0]})}),a.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900 capitalize",children:C})]}),a.jsx("p",{className:"mt-2 text-sm text-gray-500",children:e("channelsFormDescription")}),I&&a.jsxs("a",{href:I,className:"mt-2 inline-flex items-center gap-1.5 text-xs text-primary transition-colors hover:text-primary-hover",children:[a.jsx(ee,{className:"h-3.5 w-3.5"}),e("channelsGuideTitle")]})]}),a.jsx(z,{status:M?"active":"inactive",label:M?e("statusActive"):e("statusInactive")})]})}),a.jsxs("form",{onSubmit:L,className:"flex min-h-0 flex-1 flex-col",children:[a.jsx("div",{className:"min-h-0 flex-1 space-y-6 overflow-y-auto px-6 py-5",children:w.map(s=>{const n=t?U(`channels.${t}.${s.name}`,o):void 0,l=(n==null?void 0:n.label)??s.label,y=n==null?void 0:n.placeholder;return a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs(ue,{htmlFor:s.name,className:"flex items-center gap-2 text-sm font-medium text-gray-900",children:[Fe(s.name),l]}),s.type==="boolean"&&a.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-gray-50 p-3",children:[a.jsx("span",{className:"text-sm text-gray-500",children:d[s.name]?e("enabled"):e("disabled")}),a.jsx(xe,{id:s.name,checked:d[s.name]||!1,onCheckedChange:b=>N(s.name,b),className:"data-[state=checked]:bg-emerald-500"})]}),(s.type==="text"||s.type==="email")&&a.jsx(T,{id:s.name,type:s.type,value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y,className:"rounded-xl"}),s.type==="password"&&a.jsx(T,{id:s.name,type:"password",value:d[s.name]||"",onChange:b=>N(s.name,b.target.value),placeholder:y??e("leaveBlankToKeepUnchanged"),className:"rounded-xl"}),s.type==="number"&&a.jsx(T,{id:s.name,type:"number",value:d[s.name]||0,onChange:b=>N(s.name,parseInt(b.target.value,10)||0),placeholder:y,className:"rounded-xl"}),s.type==="tags"&&a.jsx(Pe,{value:d[s.name]||[],onChange:b=>N(s.name,b)}),s.type==="select"&&a.jsxs(ge,{value:d[s.name]||"",onValueChange:b=>N(s.name,b),children:[a.jsx(he,{className:"rounded-xl",children:a.jsx(fe,{})}),a.jsx(we,{children:(s.options??[]).map(b=>a.jsx(je,{value:b.value,children:b.label},b.value))})]}),s.type==="json"&&a.jsx("textarea",{id:s.name,value:x[s.name]??"{}",onChange:b=>v(X=>({...X,[s.name]:b.target.value})),className:"min-h-[120px] w-full resize-none rounded-lg border border-gray-200 bg-white px-3 py-2 text-xs font-mono"})]},s.name)})}),a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-gray-100 px-6 py-4",children:[a.jsx("div",{className:"flex flex-wrap items-center gap-2",children:S.filter(s=>s.trigger==="manual").map(s=>a.jsx(E,{type:"button",onClick:()=>W(s),disabled:r.isPending||!!h,variant:"secondary",children:h===s.id?e("connecting"):s.title},s.id))}),a.jsx(E,{type:"submit",disabled:r.isPending||!!h,children:r.isPending?e("saving"):e("save")})]})]})]})}const Ae={telegram:"channelDescTelegram",slack:"channelDescSlack",email:"channelDescEmail",webhook:"channelDescWebhook",discord:"channelDescDiscord",feishu:"channelDescFeishu"};function $e(){const{data:t}=$(),{data:p}=q(),{data:i}=K(),[c,r]=j.useState("enabled"),[u,d]=j.useState(),[g,x]=j.useState(""),v=i==null?void 0:i.uiHints,h=p==null?void 0:p.channels,f=t==null?void 0:t.channels,k=[{id:"enabled",label:e("channelsTabEnabled"),count:(h??[]).filter(o=>{var m;return(m=f==null?void 0:f[o.name])==null?void 0:m.enabled}).length},{id:"all",label:e("channelsTabAll"),count:(h??[]).length}],w=j.useMemo(()=>{const o=g.trim().toLowerCase();return(h??[]).filter(m=>{var C;const S=((C=f==null?void 0:f[m.name])==null?void 0:C.enabled)||!1;return c==="enabled"?S:!0}).filter(m=>o?(m.displayName||m.name).toLowerCase().includes(o)||m.name.toLowerCase().includes(o):!0)},[c,f,h,g]);return j.useEffect(()=>{if(w.length===0){d(void 0);return}w.some(m=>m.name===u)||d(w[0].name)},[w,u]),!t||!p?a.jsx("div",{className:"p-8 text-gray-400",children:e("channelsLoading")}):a.jsxs(de,{children:[a.jsx(be,{title:e("channelsPageTitle"),description:e("channelsPageDescription")}),a.jsxs("div",{className:Se,children:[a.jsxs("section",{className:Ce,children:[a.jsx("div",{className:"border-b border-gray-100 px-4 pt-4",children:a.jsx(Ne,{tabs:k,activeTab:c,onChange:r,className:"mb-0"})}),a.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:a.jsxs("div",{className:"relative",children:[a.jsx(oe,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),a.jsx(T,{value:g,onChange:o=>x(o.target.value),placeholder:e("channelsFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),a.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[w.map(o=>{const m=t.channels[o.name],S=(m==null?void 0:m.enabled)||!1,C=U(`channels.${o.name}`,v),P=Y(o),I=(C==null?void 0:C.help)||e(Ae[o.name]||"channelDescriptionDefault"),N=u===o.name;return a.jsx("button",{type:"button",onClick:()=>d(o.name),className:D("w-full rounded-xl border p-2.5 text-left transition-all",N?"border-primary/30 bg-primary-50/40 shadow-sm":"border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70"),children:a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[a.jsx(H,{name:o.name,src:J(o.name),className:D("h-10 w-10 rounded-lg border",S?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:a.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:o.name[0]})}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:o.displayName||o.name}),a.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:I})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[P&&a.jsx("a",{href:P,onClick:L=>L.stopPropagation(),className:"inline-flex h-7 w-7 items-center justify-center rounded-md text-gray-300 transition-colors hover:bg-gray-100/70 hover:text-gray-500",title:e("channelsGuideTitle"),children:a.jsx(ce,{className:"h-3.5 w-3.5"})}),a.jsx(z,{status:S?"active":"inactive",label:S?e("statusActive"):e("statusInactive"),className:"min-w-[56px] justify-center"})]})]})},o.name)}),w.length===0&&a.jsxs("div",{className:"flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:a.jsx(ie,{className:"h-5 w-5 text-gray-300"})}),a.jsx("p",{className:"text-sm font-medium text-gray-700",children:e("channelsNoMatch")})]})]})]}),a.jsx(De,{channelName:u})]})]})}export{$e as ChannelsList};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as w,U as kr,W as br,X as wr,Y as Sr,Z as Cr,r as M,_ as Yi,a0 as Xi,a1 as Er,a2 as Gi,a3 as Ji,a4 as Zi,a5 as el,a6 as tl,a7 as nl,a8 as rl}from"./vendor-Dh04PGww.js";import{I as il,s as ll,u as ol,d as al,e as sl,f as ul}from"./useConfig-B4Y6cGwc.js";import{u as cl}from"./useConfirmDialog-Dc5WHCUf.js";import{B as He,P as fl,a as hl}from"./page-layout-B07kdurB.js";import{t as B,S as Ir,a as Ar,b as vr,d as Tr,e as Bt,c as ge,f as Pr}from"./index-uTbQ-MAY.js";import{b as pl,n as ml,e as dl,a as gl,c as xl}from"./chat-message-pw9oafI4.js";function yl(e){return w.jsxs("aside",{className:"w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0",children:[w.jsxs("div",{className:"p-4 border-b border-gray-100 space-y-3",children:[w.jsxs("div",{className:"relative",children:[w.jsx(kr,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),w.jsx(il,{value:e.query,onChange:t=>e.onQueryChange(t.target.value),placeholder:B("chatSearchSessionPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]}),w.jsxs(Ir,{value:e.selectedChannel,onValueChange:e.onSelectedChannelChange,children:[w.jsx(Ar,{className:"h-9 rounded-lg text-xs",children:w.jsx(vr,{placeholder:B("sessionsAllChannels")})}),w.jsxs(Tr,{children:[w.jsx(Bt,{value:"all",children:B("sessionsAllChannels")}),e.channelOptions.map(t=>w.jsx(Bt,{value:t,children:e.channelLabel(t)},t))]})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs(He,{variant:"outline",size:"sm",className:"rounded-lg",onClick:e.onRefresh,children:[w.jsx(br,{className:ge("h-3.5 w-3.5 mr-1.5",e.isRefreshing&&"animate-spin")}),B("chatRefresh")]}),w.jsxs(He,{variant:"subtle",size:"sm",className:"rounded-lg",onClick:e.onCreateSession,children:[w.jsx(wr,{className:"h-3.5 w-3.5 mr-1.5"}),B("chatNewSession")]})]})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2",children:e.isLoading?w.jsx("div",{className:"text-sm text-gray-500 p-4",children:B("sessionsLoading")}):e.sessions.length===0?w.jsxs("div",{className:"p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500",children:[w.jsx(Sr,{className:"h-7 w-7 mx-auto mb-2 text-gray-300"}),B("sessionsEmpty")]}):w.jsx("div",{className:"space-y-1",children:e.sessions.map(t=>{const n=e.selectedSessionKey===t.key;return w.jsxs("button",{onClick:()=>e.onSelectSession(t.key),className:ge("w-full rounded-xl border px-3 py-2.5 text-left transition-all",n?"border-primary/30 bg-primary/5":"border-transparent hover:border-gray-200 hover:bg-gray-50"),children:[w.jsx("div",{className:"text-sm font-semibold text-gray-900 truncate",children:e.sessionTitle(t)}),w.jsx("div",{className:"mt-1 text-[11px] text-gray-500 truncate",children:t.key}),w.jsxs("div",{className:"mt-1 text-[11px] text-gray-400",children:[t.messageCount," · ",Pr(t.updatedAt)]})]},t.key)})})})]})}function kl(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sl={};function Cn(e,t){return(Sl.jsx?wl:bl).test(e)}const Cl=/[ \t\n\f\r]/g;function El(e){return typeof e=="object"?e.type==="text"?En(e.value):!1:En(e)}function En(e){return e.replace(Cl,"")===""}class it{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}it.prototype.normal={};it.prototype.property={};it.prototype.space=void 0;function Dr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new it(n,r,t)}function Ht(e){return e.toLowerCase()}class ae{constructor(t,n){this.attribute=n,this.property=t}}ae.prototype.attribute="";ae.prototype.booleanish=!1;ae.prototype.boolean=!1;ae.prototype.commaOrSpaceSeparated=!1;ae.prototype.commaSeparated=!1;ae.prototype.defined=!1;ae.prototype.mustUseProperty=!1;ae.prototype.number=!1;ae.prototype.overloadedBoolean=!1;ae.prototype.property="";ae.prototype.spaceSeparated=!1;ae.prototype.space=void 0;let Il=0;const j=Fe(),Z=Fe(),qt=Fe(),A=Fe(),X=Fe(),Be=Fe(),fe=Fe();function Fe(){return 2**++Il}const Ut=Object.freeze(Object.defineProperty({__proto__:null,boolean:j,booleanish:Z,commaOrSpaceSeparated:fe,commaSeparated:Be,number:A,overloadedBoolean:qt,spaceSeparated:X},Symbol.toStringTag,{value:"Module"})),St=Object.keys(Ut);class Zt extends ae{constructor(t,n,r,i){let o=-1;if(super(t,n),In(this,"space",i),typeof r=="number")for(;++o<St.length;){const l=St[o];In(this,St[o],(r&Ut[l])===Ut[l])}}}Zt.prototype.defined=!0;function In(e,t,n){n&&(e[t]=n)}function Ue(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Zt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ht(r)]=r,n[Ht(o.attribute)]=r}return new it(t,n,e.space)}const Lr=Ue({properties:{ariaActiveDescendant:null,ariaAtomic:Z,ariaAutoComplete:null,ariaBusy:Z,ariaChecked:Z,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Z,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Z,ariaFlowTo:X,ariaGrabbed:Z,ariaHasPopup:null,ariaHidden:Z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:A,ariaLive:null,ariaModal:Z,ariaMultiLine:Z,ariaMultiSelectable:Z,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:Z,ariaReadOnly:Z,ariaRelevant:null,ariaRequired:Z,ariaRoleDescription:X,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:Z,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Nr(e,t){return t in e?e[t]:t}function zr(e,t){return Nr(e,t.toLowerCase())}const Al=Ue({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Be,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:X,autoFocus:j,autoPlay:j,blocking:X,capture:null,charSet:null,checked:j,cite:null,className:X,cols:A,colSpan:null,content:null,contentEditable:Z,controls:j,controlsList:X,coords:A|Be,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:qt,draggable:Z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:X,height:A,hidden:qt,high:A,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:X,itemRef:X,itemScope:j,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:j,optimum:A,pattern:null,ping:X,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:X,required:j,reversed:j,rows:A,rowSpan:A,sandbox:X,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:Z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:Z,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:Z,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:j,disableRemotePlayback:j,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:zr}),vl=Ue({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fe,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:X,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Be,g2:Be,glyphName:Be,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:fe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fe,rev:fe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fe,requiredFeatures:fe,requiredFonts:fe,requiredFormats:fe,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:fe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fe,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nr}),Rr=Ue({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fr=Ue({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zr}),Or=Ue({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Tl={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Pl=/[A-Z]/g,An=/-[a-z]/g,Dl=/^data[-\w.:]+$/i;function Ll(e,t){const n=Ht(t);let r=t,i=ae;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dl.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(An,zl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!An.test(o)){let l=o.replace(Pl,Nl);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Zt}return new i(r,t)}function Nl(e){return"-"+e.toLowerCase()}function zl(e){return e.charAt(1).toUpperCase()}const Rl=Dr([Lr,Al,Rr,Fr,Or],"html"),en=Dr([Lr,vl,Rr,Fr,Or],"svg");function Fl(e){return e.join(" ").trim()}var je={},Ct,vn;function Ol(){if(vn)return Ct;vn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
|
|
1
|
+
import{j as w,U as kr,W as br,X as wr,Y as Sr,Z as Cr,r as M,_ as Yi,a0 as Xi,a1 as Er,a2 as Gi,a3 as Ji,a4 as Zi,a5 as el,a6 as tl,a7 as nl,a8 as rl}from"./vendor-Dh04PGww.js";import{I as il,s as ll,u as ol,d as al,e as sl,f as ul}from"./useConfig-txxbxXnT.js";import{u as cl}from"./useConfirmDialog-BUKGHDL6.js";import{B as He,P as fl,a as hl}from"./page-layout-CUMMO0nN.js";import{t as B,S as Ir,a as Ar,b as vr,d as Tr,e as Bt,c as ge,f as Pr}from"./index-BRBYYgR_.js";import{b as pl,n as ml,e as dl,a as gl,c as xl}from"./chat-message-pw9oafI4.js";function yl(e){return w.jsxs("aside",{className:"w-[320px] max-lg:w-full shrink-0 rounded-2xl border border-gray-200 bg-white shadow-card flex flex-col min-h-0",children:[w.jsxs("div",{className:"p-4 border-b border-gray-100 space-y-3",children:[w.jsxs("div",{className:"relative",children:[w.jsx(kr,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),w.jsx(il,{value:e.query,onChange:t=>e.onQueryChange(t.target.value),placeholder:B("chatSearchSessionPlaceholder"),className:"pl-8 h-9 rounded-lg text-xs"})]}),w.jsxs(Ir,{value:e.selectedChannel,onValueChange:e.onSelectedChannelChange,children:[w.jsx(Ar,{className:"h-9 rounded-lg text-xs",children:w.jsx(vr,{placeholder:B("sessionsAllChannels")})}),w.jsxs(Tr,{children:[w.jsx(Bt,{value:"all",children:B("sessionsAllChannels")}),e.channelOptions.map(t=>w.jsx(Bt,{value:t,children:e.channelLabel(t)},t))]})]}),w.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[w.jsxs(He,{variant:"outline",size:"sm",className:"rounded-lg",onClick:e.onRefresh,children:[w.jsx(br,{className:ge("h-3.5 w-3.5 mr-1.5",e.isRefreshing&&"animate-spin")}),B("chatRefresh")]}),w.jsxs(He,{variant:"subtle",size:"sm",className:"rounded-lg",onClick:e.onCreateSession,children:[w.jsx(wr,{className:"h-3.5 w-3.5 mr-1.5"}),B("chatNewSession")]})]})]}),w.jsx("div",{className:"flex-1 min-h-0 overflow-y-auto custom-scrollbar p-2",children:e.isLoading?w.jsx("div",{className:"text-sm text-gray-500 p-4",children:B("sessionsLoading")}):e.sessions.length===0?w.jsxs("div",{className:"p-5 m-2 rounded-xl border border-dashed border-gray-200 text-center text-sm text-gray-500",children:[w.jsx(Sr,{className:"h-7 w-7 mx-auto mb-2 text-gray-300"}),B("sessionsEmpty")]}):w.jsx("div",{className:"space-y-1",children:e.sessions.map(t=>{const n=e.selectedSessionKey===t.key;return w.jsxs("button",{onClick:()=>e.onSelectSession(t.key),className:ge("w-full rounded-xl border px-3 py-2.5 text-left transition-all",n?"border-primary/30 bg-primary/5":"border-transparent hover:border-gray-200 hover:bg-gray-50"),children:[w.jsx("div",{className:"text-sm font-semibold text-gray-900 truncate",children:e.sessionTitle(t)}),w.jsx("div",{className:"mt-1 text-[11px] text-gray-500 truncate",children:t.key}),w.jsxs("div",{className:"mt-1 text-[11px] text-gray-400",children:[t.messageCount," · ",Pr(t.updatedAt)]})]},t.key)})})})]})}function kl(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bl=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,wl=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Sl={};function Cn(e,t){return(Sl.jsx?wl:bl).test(e)}const Cl=/[ \t\n\f\r]/g;function El(e){return typeof e=="object"?e.type==="text"?En(e.value):!1:En(e)}function En(e){return e.replace(Cl,"")===""}class it{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}it.prototype.normal={};it.prototype.property={};it.prototype.space=void 0;function Dr(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new it(n,r,t)}function Ht(e){return e.toLowerCase()}class ae{constructor(t,n){this.attribute=n,this.property=t}}ae.prototype.attribute="";ae.prototype.booleanish=!1;ae.prototype.boolean=!1;ae.prototype.commaOrSpaceSeparated=!1;ae.prototype.commaSeparated=!1;ae.prototype.defined=!1;ae.prototype.mustUseProperty=!1;ae.prototype.number=!1;ae.prototype.overloadedBoolean=!1;ae.prototype.property="";ae.prototype.spaceSeparated=!1;ae.prototype.space=void 0;let Il=0;const j=Fe(),Z=Fe(),qt=Fe(),A=Fe(),X=Fe(),Be=Fe(),fe=Fe();function Fe(){return 2**++Il}const Ut=Object.freeze(Object.defineProperty({__proto__:null,boolean:j,booleanish:Z,commaOrSpaceSeparated:fe,commaSeparated:Be,number:A,overloadedBoolean:qt,spaceSeparated:X},Symbol.toStringTag,{value:"Module"})),St=Object.keys(Ut);class Zt extends ae{constructor(t,n,r,i){let o=-1;if(super(t,n),In(this,"space",i),typeof r=="number")for(;++o<St.length;){const l=St[o];In(this,St[o],(r&Ut[l])===Ut[l])}}}Zt.prototype.defined=!0;function In(e,t,n){n&&(e[t]=n)}function Ue(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const o=new Zt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Ht(r)]=r,n[Ht(o.attribute)]=r}return new it(t,n,e.space)}const Lr=Ue({properties:{ariaActiveDescendant:null,ariaAtomic:Z,ariaAutoComplete:null,ariaBusy:Z,ariaChecked:Z,ariaColCount:A,ariaColIndex:A,ariaColSpan:A,ariaControls:X,ariaCurrent:null,ariaDescribedBy:X,ariaDetails:null,ariaDisabled:Z,ariaDropEffect:X,ariaErrorMessage:null,ariaExpanded:Z,ariaFlowTo:X,ariaGrabbed:Z,ariaHasPopup:null,ariaHidden:Z,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:X,ariaLevel:A,ariaLive:null,ariaModal:Z,ariaMultiLine:Z,ariaMultiSelectable:Z,ariaOrientation:null,ariaOwns:X,ariaPlaceholder:null,ariaPosInSet:A,ariaPressed:Z,ariaReadOnly:Z,ariaRelevant:null,ariaRequired:Z,ariaRoleDescription:X,ariaRowCount:A,ariaRowIndex:A,ariaRowSpan:A,ariaSelected:Z,ariaSetSize:A,ariaSort:null,ariaValueMax:A,ariaValueMin:A,ariaValueNow:A,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function Nr(e,t){return t in e?e[t]:t}function zr(e,t){return Nr(e,t.toLowerCase())}const Al=Ue({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Be,acceptCharset:X,accessKey:X,action:null,allow:null,allowFullScreen:j,allowPaymentRequest:j,allowUserMedia:j,alt:null,as:null,async:j,autoCapitalize:null,autoComplete:X,autoFocus:j,autoPlay:j,blocking:X,capture:null,charSet:null,checked:j,cite:null,className:X,cols:A,colSpan:null,content:null,contentEditable:Z,controls:j,controlsList:X,coords:A|Be,crossOrigin:null,data:null,dateTime:null,decoding:null,default:j,defer:j,dir:null,dirName:null,disabled:j,download:qt,draggable:Z,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:j,formTarget:null,headers:X,height:A,hidden:qt,high:A,href:null,hrefLang:null,htmlFor:X,httpEquiv:X,id:null,imageSizes:null,imageSrcSet:null,inert:j,inputMode:null,integrity:null,is:null,isMap:j,itemId:null,itemProp:X,itemRef:X,itemScope:j,itemType:X,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:j,low:A,manifest:null,max:null,maxLength:A,media:null,method:null,min:null,minLength:A,multiple:j,muted:j,name:null,nonce:null,noModule:j,noValidate:j,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:j,optimum:A,pattern:null,ping:X,placeholder:null,playsInline:j,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:j,referrerPolicy:null,rel:X,required:j,reversed:j,rows:A,rowSpan:A,sandbox:X,scope:null,scoped:j,seamless:j,selected:j,shadowRootClonable:j,shadowRootDelegatesFocus:j,shadowRootMode:null,shape:null,size:A,sizes:null,slot:null,span:A,spellCheck:Z,src:null,srcDoc:null,srcLang:null,srcSet:null,start:A,step:null,style:null,tabIndex:A,target:null,title:null,translate:null,type:null,typeMustMatch:j,useMap:null,value:Z,width:A,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:X,axis:null,background:null,bgColor:null,border:A,borderColor:null,bottomMargin:A,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:j,declare:j,event:null,face:null,frame:null,frameBorder:null,hSpace:A,leftMargin:A,link:null,longDesc:null,lowSrc:null,marginHeight:A,marginWidth:A,noResize:j,noHref:j,noShade:j,noWrap:j,object:null,profile:null,prompt:null,rev:null,rightMargin:A,rules:null,scheme:null,scrolling:Z,standby:null,summary:null,text:null,topMargin:A,valueType:null,version:null,vAlign:null,vLink:null,vSpace:A,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:j,disableRemotePlayback:j,prefix:null,property:null,results:A,security:null,unselectable:null},space:"html",transform:zr}),vl=Ue({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:fe,accentHeight:A,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:A,amplitude:A,arabicForm:null,ascent:A,attributeName:null,attributeType:null,azimuth:A,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:A,by:null,calcMode:null,capHeight:A,className:X,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:A,diffuseConstant:A,direction:null,display:null,dur:null,divisor:A,dominantBaseline:null,download:j,dx:null,dy:null,edgeMode:null,editable:null,elevation:A,enableBackground:null,end:null,event:null,exponent:A,externalResourcesRequired:null,fill:null,fillOpacity:A,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Be,g2:Be,glyphName:Be,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:A,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:A,horizOriginX:A,horizOriginY:A,id:null,ideographic:A,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:A,k:A,k1:A,k2:A,k3:A,k4:A,kernelMatrix:fe,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:A,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:A,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:A,overlineThickness:A,paintOrder:null,panose1:null,path:null,pathLength:A,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:X,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:A,pointsAtY:A,pointsAtZ:A,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:fe,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:fe,rev:fe,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:fe,requiredFeatures:fe,requiredFonts:fe,requiredFormats:fe,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:A,specularExponent:A,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:A,strikethroughThickness:A,string:null,stroke:null,strokeDashArray:fe,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:A,strokeOpacity:A,strokeWidth:null,style:null,surfaceScale:A,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:fe,tabIndex:A,tableValues:null,target:null,targetX:A,targetY:A,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:fe,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:A,underlineThickness:A,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:A,values:null,vAlphabetic:A,vMathematical:A,vectorEffect:null,vHanging:A,vIdeographic:A,version:null,vertAdvY:A,vertOriginX:A,vertOriginY:A,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:A,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Nr}),Rr=Ue({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),Fr=Ue({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:zr}),Or=Ue({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),Tl={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},Pl=/[A-Z]/g,An=/-[a-z]/g,Dl=/^data[-\w.:]+$/i;function Ll(e,t){const n=Ht(t);let r=t,i=ae;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&Dl.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(An,zl);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!An.test(o)){let l=o.replace(Pl,Nl);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}i=Zt}return new i(r,t)}function Nl(e){return"-"+e.toLowerCase()}function zl(e){return e.charAt(1).toUpperCase()}const Rl=Dr([Lr,Al,Rr,Fr,Or],"html"),en=Dr([Lr,vl,Rr,Fr,Or],"svg");function Fl(e){return e.join(" ").trim()}var je={},Ct,vn;function Ol(){if(vn)return Ct;vn=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,a=/^\s+|\s+$/g,s=`
|
|
2
2
|
`,u="/",f="*",c="",p="comment",h="declaration";function g(k,x){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];x=x||{};var I=1,E=1;function P(N){var T=N.match(t);T&&(I+=T.length);var W=N.lastIndexOf(s);E=~W?N.length-W:E+N.length}function z(){var N={line:I,column:E};return function(T){return T.position=new b(N),$(),T}}function b(N){this.start=N,this.end={line:I,column:E},this.source=x.source}b.prototype.content=k;function H(N){var T=new Error(x.source+":"+I+":"+E+": "+N);if(T.reason=N,T.filename=x.source,T.line=I,T.column=E,T.source=k,!x.silent)throw T}function _(N){var T=N.exec(k);if(T){var W=T[0];return P(W),k=k.slice(W.length),T}}function $(){_(n)}function y(N){var T;for(N=N||[];T=D();)T!==!1&&N.push(T);return N}function D(){var N=z();if(!(u!=k.charAt(0)||f!=k.charAt(1))){for(var T=2;c!=k.charAt(T)&&(f!=k.charAt(T)||u!=k.charAt(T+1));)++T;if(T+=2,c===k.charAt(T-1))return H("End of comment missing");var W=k.slice(2,T-2);return E+=2,P(W),k=k.slice(T),E+=2,N({type:p,comment:W})}}function L(){var N=z(),T=_(r);if(T){if(D(),!_(i))return H("property missing ':'");var W=_(o),J=N({type:h,property:S(T[0].replace(e,c)),value:W?S(W[0].replace(e,c)):c});return _(l),J}}function K(){var N=[];y(N);for(var T;T=L();)T!==!1&&(N.push(T),y(N));return N}return $(),K()}function S(k){return k?k.replace(a,c):c}return Ct=g,Ct}var Tn;function jl(){if(Tn)return je;Tn=1;var e=je&&je.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(je,"__esModule",{value:!0}),je.default=n;const t=e(Ol());function n(r,i){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),a=typeof i=="function";return l.forEach(s=>{if(s.type!=="declaration")return;const{property:u,value:f}=s;a?i(u,f,s):f&&(o=o||{},o[u]=f)}),o}return je}var We={},Pn;function _l(){if(Pn)return We;Pn=1,Object.defineProperty(We,"__esModule",{value:!0}),We.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,o=function(u){return!u||n.test(u)||e.test(u)},l=function(u,f){return f.toUpperCase()},a=function(u,f){return"".concat(f,"-")},s=function(u,f){return f===void 0&&(f={}),o(u)?u:(u=u.toLowerCase(),f.reactCompat?u=u.replace(i,a):u=u.replace(r,a),u.replace(t,l))};return We.camelCase=s,We}var Qe,Dn;function Ml(){if(Dn)return Qe;Dn=1;var e=Qe&&Qe.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(jl()),n=_l();function r(i,o){var l={};return!i||typeof i!="string"||(0,t.default)(i,function(a,s){a&&s&&(l[(0,n.camelCase)(a,o)]=s)}),l}return r.default=r,Qe=r,Qe}var Bl=Ml();const Hl=Cr(Bl),jr=_r("end"),tn=_r("start");function _r(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function Mr(e){const t=tn(e),n=jr(e);if(t&&n)return{start:t,end:n}}function Ge(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Ln(e.position):"start"in e||"end"in e?Ln(e):"line"in e||"column"in e?$t(e):""}function $t(e){return Nn(e&&e.line)+":"+Nn(e&&e.column)}function Ln(e){return $t(e&&e.start)+"-"+$t(e&&e.end)}function Nn(e){return e&&typeof e=="number"?e:1}class ne extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?i=t:!o.cause&&t&&(l=!0,i=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const s=r.indexOf(":");s===-1?o.ruleId=r:(o.source=r.slice(0,s),o.ruleId=r.slice(s+1))}if(!o.place&&o.ancestors&&o.ancestors){const s=o.ancestors[o.ancestors.length-1];s&&(o.place=s.position)}const a=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=a?a.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=a?a.line:void 0,this.name=Ge(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}ne.prototype.file="";ne.prototype.name="";ne.prototype.reason="";ne.prototype.message="";ne.prototype.stack="";ne.prototype.column=void 0;ne.prototype.line=void 0;ne.prototype.ancestors=void 0;ne.prototype.cause=void 0;ne.prototype.fatal=void 0;ne.prototype.place=void 0;ne.prototype.ruleId=void 0;ne.prototype.source=void 0;const nn={}.hasOwnProperty,ql=new Map,Ul=/[A-Z]/g,$l=new Set(["table","tbody","thead","tfoot","tr"]),Vl=new Set(["td","th"]),Br="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Kl(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=eo(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Zl(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?en:Rl,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=Hr(i,e,void 0);return o&&typeof o!="string"?o:i.create(e,i.Fragment,{children:o||void 0},void 0)}function Hr(e,t,n){if(t.type==="element")return Wl(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return Ql(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Xl(e,t,n);if(t.type==="mdxjsEsm")return Yl(e,t);if(t.type==="root")return Gl(e,t,n);if(t.type==="text")return Jl(e,t)}function Wl(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=en,e.schema=i),e.ancestors.push(t);const o=Ur(e,t.tagName,!1),l=to(e,t);let a=ln(e,t);return $l.has(t.tagName)&&(a=a.filter(function(s){return typeof s=="string"?!El(s):!0})),qr(e,l,o,t),rn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Ql(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}et(e,t.position)}function Yl(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);et(e,t.position)}function Xl(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=en,e.schema=i),e.ancestors.push(t);const o=t.name===null?e.Fragment:Ur(e,t.name,!0),l=no(e,t),a=ln(e,t);return qr(e,l,o,t),rn(l,a),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function Gl(e,t,n){const r={};return rn(r,ln(e,t)),e.create(t,e.Fragment,r,n)}function Jl(e,t){return t.value}function qr(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function rn(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Zl(e,t,n){return r;function r(i,o,l,a){const u=Array.isArray(l.children)?n:t;return a?u(o,l,a):u(o,l)}}function eo(e,t){return n;function n(r,i,o,l){const a=Array.isArray(o.children),s=tn(r);return t(i,o,l,a,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function to(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&nn.call(t.properties,i)){const o=ro(e,i,t.properties[i]);if(o){const[l,a]=o;e.tableCellAlignToStyle&&l==="align"&&typeof a=="string"&&Vl.has(t.tagName)?r=a:n[l]=a}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function no(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const a=l.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else et(e,t.position);else{const i=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const a=r.value.data.estree.body[0];a.type,o=e.evaluater.evaluateExpression(a.expression)}else et(e,t.position);else o=r.value===null?!0:r.value;n[i]=o}return n}function ln(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:ql;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const s=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(s){const u=i.get(s)||0;l=s+"-"+u,i.set(s,u+1)}}const a=Hr(e,o,l);a!==void 0&&n.push(a)}return n}function ro(e,t,n){const r=Ll(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?kl(n):Fl(n)),r.property==="style"){let i=typeof n=="object"?n:io(e,String(n));return e.stylePropertyNameCase==="css"&&(i=lo(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?Tl[r.property]||r.property:r.attribute,n]}}function io(e,t){try{return Hl(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new ne("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=Br+"#cannot-parse-style-attribute",i}}function Ur(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let o=-1,l;for(;++o<i.length;){const a=Cn(i[o])?{type:"Identifier",name:i[o]}:{type:"Literal",value:i[o]};l=l?{type:"MemberExpression",object:l,property:a,computed:!!(o&&a.type==="Literal"),optional:!1}:a}r=l}else r=Cn(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return nn.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);et(e)}function et(e,t){const n=new ne("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=Br+"#cannot-handle-mdx-estrees-without-createevaluater",n}function lo(e){const t={};let n;for(n in e)nn.call(e,n)&&(t[oo(n)]=e[n]);return t}function oo(e){let t=e.replace(Ul,ao);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function ao(e){return"-"+e.toLowerCase()}const Et={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},so={};function on(e,t){const n=so,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return $r(e,r,i)}function $r(e,t,n){if(uo(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zn(e.children,t,n)}return Array.isArray(e)?zn(e,t,n):""}function zn(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=$r(e[i],t,n);return r.join("")}function uo(e){return!!(e&&typeof e=="object")}const Rn=document.createElement("i");function an(e){const t="&"+e+";";Rn.innerHTML=t;const n=Rn.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function he(e,t,n,r){const i=e.length;let o=0,l;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function de(e,t){return e.length>0?(he(e,e.length,0,t),e):t}const Fn={}.hasOwnProperty;function Vr(e){const t={};let n=-1;for(;++n<e.length;)co(t,e[n]);return t}function co(e,t){let n;for(n in t){const i=(Fn.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){Fn.call(i,l)||(i[l]=[]);const a=o[l];fo(i[l],Array.isArray(a)?a:a?[a]:[])}}}function fo(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);he(e,0,0,r)}function Kr(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function ke(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const re=De(/[A-Za-z]/),te=De(/[\dA-Za-z]/),ho=De(/[#-'*+\--9=?A-Z^-~]/);function mt(e){return e!==null&&(e<32||e===127)}const Vt=De(/\d/),po=De(/[\dA-Fa-f]/),mo=De(/[!-/:-@[-`{-~]/);function R(e){return e!==null&&e<-2}function Y(e){return e!==null&&(e<0||e===32)}function q(e){return e===-2||e===-1||e===32}const xt=De(new RegExp("\\p{P}|\\p{S}","u")),Re=De(/\s/);function De(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function $e(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&te(e.charCodeAt(n+1))&&te(e.charCodeAt(n+2)))i=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const a=e.charCodeAt(n+1);o<56320&&a>56319&&a<57344?(l=String.fromCharCode(o,a),i=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+i+1,l=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function V(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(s){return q(s)?(e.enter(n),a(s)):t(s)}function a(s){return q(s)&&o++<i?(e.consume(s),a):(e.exit(n),t(s))}}const go={tokenize:xo};function xo(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),V(e,t,"linePrefix")}function i(a){return e.enter("paragraph"),o(a)}function o(a){const s=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=s),n=s,l(a)}function l(a){if(a===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(a);return}return R(a)?(e.consume(a),e.exit("chunkText"),o):(e.consume(a),l)}}const yo={tokenize:ko},On={tokenize:bo};function ko(e){const t=this,n=[];let r=0,i,o,l;return a;function a(E){if(r<n.length){const P=n[r];return t.containerState=P[1],e.attempt(P[0].continuation,s,u)(E)}return u(E)}function s(E){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&I();const P=t.events.length;let z=P,b;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){b=t.events[z][1].end;break}x(r);let H=P;for(;H<t.events.length;)t.events[H][1].end={...b},H++;return he(t.events,z+1,0,t.events.slice(P)),t.events.length=H,u(E)}return a(E)}function u(E){if(r===n.length){if(!i)return p(E);if(i.currentConstruct&&i.currentConstruct.concrete)return g(E);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(On,f,c)(E)}function f(E){return i&&I(),x(r),p(E)}function c(E){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,g(E)}function p(E){return t.containerState={},e.attempt(On,h,g)(E)}function h(E){return r++,n.push([t.currentConstruct,t.containerState]),p(E)}function g(E){if(E===null){i&&I(),x(0),e.consume(E);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:o}),S(E)}function S(E){if(E===null){k(e.exit("chunkFlow"),!0),x(0),e.consume(E);return}return R(E)?(e.consume(E),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,a):(e.consume(E),S)}function k(E,P){const z=t.sliceStream(E);if(P&&z.push(null),E.previous=o,o&&(o.next=E),o=E,i.defineSkip(E.start),i.write(z),t.parser.lazy[E.start.line]){let b=i.events.length;for(;b--;)if(i.events[b][1].start.offset<l&&(!i.events[b][1].end||i.events[b][1].end.offset>l))return;const H=t.events.length;let _=H,$,y;for(;_--;)if(t.events[_][0]==="exit"&&t.events[_][1].type==="chunkFlow"){if($){y=t.events[_][1].end;break}$=!0}for(x(r),b=H;b<t.events.length;)t.events[b][1].end={...y},b++;he(t.events,_+1,0,t.events.slice(H)),t.events.length=b}}function x(E){let P=n.length;for(;P-- >E;){const z=n[P];t.containerState=z[1],z[0].exit.call(t,e)}n.length=E}function I(){i.write([null]),o=void 0,i=void 0,t.containerState._closeFlow=void 0}}function bo(e,t,n){return V(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qe(e){if(e===null||Y(e)||Re(e))return 1;if(xt(e))return 2}function yt(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const o=e[i].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const Kt={name:"attention",resolveAll:wo,tokenize:So};function wo(e,t){let n=-1,r,i,o,l,a,s,u,f;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;s=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const c={...e[r][1].end},p={...e[n][1].start};jn(c,-s),jn(p,s),l={type:s>1?"strongSequence":"emphasisSequence",start:c,end:{...e[r][1].end}},a={type:s>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:p},o={type:s>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:s>1?"strong":"emphasis",start:{...l.start},end:{...a.end}},e[r][1].end={...l.start},e[n][1].start={...a.end},u=[],e[r][1].end.offset-e[r][1].start.offset&&(u=de(u,[["enter",e[r][1],t],["exit",e[r][1],t]])),u=de(u,[["enter",i,t],["enter",l,t],["exit",l,t],["enter",o,t]]),u=de(u,yt(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),u=de(u,[["exit",o,t],["enter",a,t],["exit",a,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(f=2,u=de(u,[["enter",e[n][1],t],["exit",e[n][1],t]])):f=0,he(e,r-1,n-r+3,u),n=r+u.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function So(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=qe(r);let o;return l;function l(s){return o=s,e.enter("attentionSequence"),a(s)}function a(s){if(s===o)return e.consume(s),a;const u=e.exit("attentionSequence"),f=qe(s),c=!f||f===2&&i||n.includes(s),p=!i||i===2&&f||n.includes(r);return u._open=!!(o===42?c:c&&(i||!p)),u._close=!!(o===42?p:p&&(f||!c)),t(s)}}function jn(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const Co={name:"autolink",tokenize:Eo};function Eo(e,t,n){let r=0;return i;function i(h){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(h){return re(h)?(e.consume(h),l):h===64?n(h):u(h)}function l(h){return h===43||h===45||h===46||te(h)?(r=1,a(h)):u(h)}function a(h){return h===58?(e.consume(h),r=0,s):(h===43||h===45||h===46||te(h))&&r++<32?(e.consume(h),a):(r=0,u(h))}function s(h){return h===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):h===null||h===32||h===60||mt(h)?n(h):(e.consume(h),s)}function u(h){return h===64?(e.consume(h),f):ho(h)?(e.consume(h),u):n(h)}function f(h){return te(h)?c(h):n(h)}function c(h){return h===46?(e.consume(h),r=0,f):h===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(h),e.exit("autolinkMarker"),e.exit("autolink"),t):p(h)}function p(h){if((h===45||te(h))&&r++<63){const g=h===45?p:c;return e.consume(h),g}return n(h)}}const lt={partial:!0,tokenize:Io};function Io(e,t,n){return r;function r(o){return q(o)?V(e,i,"linePrefix")(o):i(o)}function i(o){return o===null||R(o)?t(o):n(o)}}const Wr={continuation:{tokenize:vo},exit:To,name:"blockQuote",tokenize:Ao};function Ao(e,t,n){const r=this;return i;function i(l){if(l===62){const a=r.containerState;return a.open||(e.enter("blockQuote",{_container:!0}),a.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return q(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function vo(e,t,n){const r=this;return i;function i(l){return q(l)?V(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(Wr,t,n)(l)}}function To(e){e.exit("blockQuote")}const Qr={name:"characterEscape",tokenize:Po};function Po(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),i}function i(o){return mo(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Yr={name:"characterReference",tokenize:Do};function Do(e,t,n){const r=this;let i=0,o,l;return a;function a(c){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),s}function s(c){return c===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(c),e.exit("characterReferenceMarkerNumeric"),u):(e.enter("characterReferenceValue"),o=31,l=te,f(c))}function u(c){return c===88||c===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(c),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=po,f):(e.enter("characterReferenceValue"),o=7,l=Vt,f(c))}function f(c){if(c===59&&i){const p=e.exit("characterReferenceValue");return l===te&&!an(r.sliceSerialize(p))?n(c):(e.enter("characterReferenceMarker"),e.consume(c),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(c)&&i++<o?(e.consume(c),f):n(c)}}const _n={partial:!0,tokenize:No},Mn={concrete:!0,name:"codeFenced",tokenize:Lo};function Lo(e,t,n){const r=this,i={partial:!0,tokenize:z};let o=0,l=0,a;return s;function s(b){return u(b)}function u(b){const H=r.events[r.events.length-1];return o=H&&H[1].type==="linePrefix"?H[2].sliceSerialize(H[1],!0).length:0,a=b,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),f(b)}function f(b){return b===a?(l++,e.consume(b),f):l<3?n(b):(e.exit("codeFencedFenceSequence"),q(b)?V(e,c,"whitespace")(b):c(b))}function c(b){return b===null||R(b)?(e.exit("codeFencedFence"),r.interrupt?t(b):e.check(_n,S,P)(b)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),p(b))}function p(b){return b===null||R(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),c(b)):q(b)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),V(e,h,"whitespace")(b)):b===96&&b===a?n(b):(e.consume(b),p)}function h(b){return b===null||R(b)?c(b):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||R(b)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),c(b)):b===96&&b===a?n(b):(e.consume(b),g)}function S(b){return e.attempt(i,P,k)(b)}function k(b){return e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),x}function x(b){return o>0&&q(b)?V(e,I,"linePrefix",o+1)(b):I(b)}function I(b){return b===null||R(b)?e.check(_n,S,P)(b):(e.enter("codeFlowValue"),E(b))}function E(b){return b===null||R(b)?(e.exit("codeFlowValue"),I(b)):(e.consume(b),E)}function P(b){return e.exit("codeFenced"),t(b)}function z(b,H,_){let $=0;return y;function y(T){return b.enter("lineEnding"),b.consume(T),b.exit("lineEnding"),D}function D(T){return b.enter("codeFencedFence"),q(T)?V(b,L,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):L(T)}function L(T){return T===a?(b.enter("codeFencedFenceSequence"),K(T)):_(T)}function K(T){return T===a?($++,b.consume(T),K):$>=l?(b.exit("codeFencedFenceSequence"),q(T)?V(b,N,"whitespace")(T):N(T)):_(T)}function N(T){return T===null||R(T)?(b.exit("codeFencedFence"),H(T)):_(T)}}}function No(e,t,n){const r=this;return i;function i(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const It={name:"codeIndented",tokenize:Ro},zo={partial:!0,tokenize:Fo};function Ro(e,t,n){const r=this;return i;function i(u){return e.enter("codeIndented"),V(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?l(u):n(u)}function l(u){return u===null?s(u):R(u)?e.attempt(zo,l,s)(u):(e.enter("codeFlowValue"),a(u))}function a(u){return u===null||R(u)?(e.exit("codeFlowValue"),l(u)):(e.consume(u),a)}function s(u){return e.exit("codeIndented"),t(u)}}function Fo(e,t,n){const r=this;return i;function i(l){return r.parser.lazy[r.now().line]?n(l):R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),i):V(e,o,"linePrefix",5)(l)}function o(l){const a=r.events[r.events.length-1];return a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):R(l)?i(l):n(l)}}const Oo={name:"codeText",previous:_o,resolve:jo,tokenize:Mo};function jo(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function _o(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Mo(e,t,n){let r=0,i,o;return l;function l(c){return e.enter("codeText"),e.enter("codeTextSequence"),a(c)}function a(c){return c===96?(e.consume(c),r++,a):(e.exit("codeTextSequence"),s(c))}function s(c){return c===null?n(c):c===32?(e.enter("space"),e.consume(c),e.exit("space"),s):c===96?(o=e.enter("codeTextSequence"),i=0,f(c)):R(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),s):(e.enter("codeTextData"),u(c))}function u(c){return c===null||c===32||c===96||R(c)?(e.exit("codeTextData"),s(c)):(e.consume(c),u)}function f(c){return c===96?(e.consume(c),i++,f):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(c)):(o.type="codeTextData",u(c))}}class Bo{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&Ye(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ye(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ye(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ye(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ye(this.left,n.reverse())}}}function Ye(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Xr(e){const t={};let n=-1,r,i,o,l,a,s,u;const f=new Bo(e);for(;++n<f.length;){for(;n in t;)n=t[n];if(r=f.get(n),n&&r[1].type==="chunkFlow"&&f.get(n-1)[1].type==="listItemPrefix"&&(s=r[1]._tokenizer.events,o=0,o<s.length&&s[o][1].type==="lineEndingBlank"&&(o+=2),o<s.length&&s[o][1].type==="content"))for(;++o<s.length&&s[o][1].type!=="content";)s[o][1].type==="chunkText"&&(s[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,Ho(f,n)),n=t[n],u=!0);else if(r[1]._container){for(o=n,i=void 0;o--;)if(l=f.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(i&&(f.get(i)[1].type="lineEndingBlank"),l[1].type="lineEnding",i=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;i&&(r[1].end={...f.get(i)[1].start},a=f.slice(i,n),a.unshift(r),f.splice(i,n-i+1,a))}}return he(e,0,Number.POSITIVE_INFINITY,f.slice(0)),!u}function Ho(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const a=l.events,s=[],u={};let f,c,p=-1,h=n,g=0,S=0;const k=[S];for(;h;){for(;e.get(++i)[1]!==h;);o.push(i),h._tokenizer||(f=r.sliceStream(h),h.next||f.push(null),c&&l.defineSkip(h.start),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(f),h._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),c=h,h=h.next}for(h=n;++p<a.length;)a[p][0]==="exit"&&a[p-1][0]==="enter"&&a[p][1].type===a[p-1][1].type&&a[p][1].start.line!==a[p][1].end.line&&(S=p+1,k.push(S),h._tokenizer=void 0,h.previous=void 0,h=h.next);for(l.events=[],h?(h._tokenizer=void 0,h.previous=void 0):k.pop(),p=k.length;p--;){const x=a.slice(k[p],k[p+1]),I=o.pop();s.push([I,I+x.length-1]),e.splice(I,2,x)}for(s.reverse(),p=-1;++p<s.length;)u[g+s[p][0]]=g+s[p][1],g+=s[p][1]-s[p][0]-1;return u}const qo={resolve:$o,tokenize:Vo},Uo={partial:!0,tokenize:Ko};function $o(e){return Xr(e),e}function Vo(e,t){let n;return r;function r(a){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(a)}function i(a){return a===null?o(a):R(a)?e.check(Uo,l,o)(a):(e.consume(a),i)}function o(a){return e.exit("chunkContent"),e.exit("content"),t(a)}function l(a){return e.consume(a),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function Ko(e,t,n){const r=this;return i;function i(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),V(e,o,"linePrefix")}function o(l){if(l===null||R(l))return n(l);const a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&a&&a[1].type==="linePrefix"&&a[2].sliceSerialize(a[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function Gr(e,t,n,r,i,o,l,a,s){const u=s||Number.POSITIVE_INFINITY;let f=0;return c;function c(x){return x===60?(e.enter(r),e.enter(i),e.enter(o),e.consume(x),e.exit(o),p):x===null||x===32||x===41||mt(x)?n(x):(e.enter(r),e.enter(l),e.enter(a),e.enter("chunkString",{contentType:"string"}),S(x))}function p(x){return x===62?(e.enter(o),e.consume(x),e.exit(o),e.exit(i),e.exit(r),t):(e.enter(a),e.enter("chunkString",{contentType:"string"}),h(x))}function h(x){return x===62?(e.exit("chunkString"),e.exit(a),p(x)):x===null||x===60||R(x)?n(x):(e.consume(x),x===92?g:h)}function g(x){return x===60||x===62||x===92?(e.consume(x),h):h(x)}function S(x){return!f&&(x===null||x===41||Y(x))?(e.exit("chunkString"),e.exit(a),e.exit(l),e.exit(r),t(x)):f<u&&x===40?(e.consume(x),f++,S):x===41?(e.consume(x),f--,S):x===null||x===32||x===40||mt(x)?n(x):(e.consume(x),x===92?k:S)}function k(x){return x===40||x===41||x===92?(e.consume(x),S):S(x)}}function Jr(e,t,n,r,i,o){const l=this;let a=0,s;return u;function u(h){return e.enter(r),e.enter(i),e.consume(h),e.exit(i),e.enter(o),f}function f(h){return a>999||h===null||h===91||h===93&&!s||h===94&&!a&&"_hiddenFootnoteSupport"in l.parser.constructs?n(h):h===93?(e.exit(o),e.enter(i),e.consume(h),e.exit(i),e.exit(r),t):R(h)?(e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),f):(e.enter("chunkString",{contentType:"string"}),c(h))}function c(h){return h===null||h===91||h===93||R(h)||a++>999?(e.exit("chunkString"),f(h)):(e.consume(h),s||(s=!q(h)),h===92?p:c)}function p(h){return h===91||h===92||h===93?(e.consume(h),a++,c):c(h)}}function Zr(e,t,n,r,i,o){let l;return a;function a(p){return p===34||p===39||p===40?(e.enter(r),e.enter(i),e.consume(p),e.exit(i),l=p===40?41:p,s):n(p)}function s(p){return p===l?(e.enter(i),e.consume(p),e.exit(i),e.exit(r),t):(e.enter(o),u(p))}function u(p){return p===l?(e.exit(o),s(l)):p===null?n(p):R(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),V(e,u,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===l||p===null||R(p)?(e.exit("chunkString"),u(p)):(e.consume(p),p===92?c:f)}function c(p){return p===l||p===92?(e.consume(p),f):f(p)}}function Je(e,t){let n;return r;function r(i){return R(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):q(i)?V(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const Wo={name:"definition",tokenize:Yo},Qo={partial:!0,tokenize:Xo};function Yo(e,t,n){const r=this;let i;return o;function o(h){return e.enter("definition"),l(h)}function l(h){return Jr.call(r,e,a,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(h)}function a(h){return i=ke(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),h===58?(e.enter("definitionMarker"),e.consume(h),e.exit("definitionMarker"),s):n(h)}function s(h){return Y(h)?Je(e,u)(h):u(h)}function u(h){return Gr(e,f,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(h)}function f(h){return e.attempt(Qo,c,c)(h)}function c(h){return q(h)?V(e,p,"whitespace")(h):p(h)}function p(h){return h===null||R(h)?(e.exit("definition"),r.parser.defined.push(i),t(h)):n(h)}}function Xo(e,t,n){return r;function r(a){return Y(a)?Je(e,i)(a):n(a)}function i(a){return Zr(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(a)}function o(a){return q(a)?V(e,l,"whitespace")(a):l(a)}function l(a){return a===null||R(a)?t(a):n(a)}}const Go={name:"hardBreakEscape",tokenize:Jo};function Jo(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),i}function i(o){return R(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const Zo={name:"headingAtx",resolve:ea,tokenize:ta};function ea(e,t){let n=e.length-2,r=3,i,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},he(e,r,n-r+1,[["enter",i,t],["enter",o,t],["exit",o,t],["exit",i,t]])),e}function ta(e,t,n){let r=0;return i;function i(f){return e.enter("atxHeading"),o(f)}function o(f){return e.enter("atxHeadingSequence"),l(f)}function l(f){return f===35&&r++<6?(e.consume(f),l):f===null||Y(f)?(e.exit("atxHeadingSequence"),a(f)):n(f)}function a(f){return f===35?(e.enter("atxHeadingSequence"),s(f)):f===null||R(f)?(e.exit("atxHeading"),t(f)):q(f)?V(e,a,"whitespace")(f):(e.enter("atxHeadingText"),u(f))}function s(f){return f===35?(e.consume(f),s):(e.exit("atxHeadingSequence"),a(f))}function u(f){return f===null||f===35||Y(f)?(e.exit("atxHeadingText"),a(f)):(e.consume(f),u)}}const na=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Bn=["pre","script","style","textarea"],ra={concrete:!0,name:"htmlFlow",resolveTo:oa,tokenize:aa},ia={partial:!0,tokenize:ua},la={partial:!0,tokenize:sa};function oa(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function aa(e,t,n){const r=this;let i,o,l,a,s;return u;function u(d){return f(d)}function f(d){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(d),c}function c(d){return d===33?(e.consume(d),p):d===47?(e.consume(d),o=!0,S):d===63?(e.consume(d),i=3,r.interrupt?t:m):re(d)?(e.consume(d),l=String.fromCharCode(d),k):n(d)}function p(d){return d===45?(e.consume(d),i=2,h):d===91?(e.consume(d),i=5,a=0,g):re(d)?(e.consume(d),i=4,r.interrupt?t:m):n(d)}function h(d){return d===45?(e.consume(d),r.interrupt?t:m):n(d)}function g(d){const le="CDATA[";return d===le.charCodeAt(a++)?(e.consume(d),a===le.length?r.interrupt?t:L:g):n(d)}function S(d){return re(d)?(e.consume(d),l=String.fromCharCode(d),k):n(d)}function k(d){if(d===null||d===47||d===62||Y(d)){const le=d===47,Se=l.toLowerCase();return!le&&!o&&Bn.includes(Se)?(i=1,r.interrupt?t(d):L(d)):na.includes(l.toLowerCase())?(i=6,le?(e.consume(d),x):r.interrupt?t(d):L(d)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(d):o?I(d):E(d))}return d===45||te(d)?(e.consume(d),l+=String.fromCharCode(d),k):n(d)}function x(d){return d===62?(e.consume(d),r.interrupt?t:L):n(d)}function I(d){return q(d)?(e.consume(d),I):y(d)}function E(d){return d===47?(e.consume(d),y):d===58||d===95||re(d)?(e.consume(d),P):q(d)?(e.consume(d),E):y(d)}function P(d){return d===45||d===46||d===58||d===95||te(d)?(e.consume(d),P):z(d)}function z(d){return d===61?(e.consume(d),b):q(d)?(e.consume(d),z):E(d)}function b(d){return d===null||d===60||d===61||d===62||d===96?n(d):d===34||d===39?(e.consume(d),s=d,H):q(d)?(e.consume(d),b):_(d)}function H(d){return d===s?(e.consume(d),s=null,$):d===null||R(d)?n(d):(e.consume(d),H)}function _(d){return d===null||d===34||d===39||d===47||d===60||d===61||d===62||d===96||Y(d)?z(d):(e.consume(d),_)}function $(d){return d===47||d===62||q(d)?E(d):n(d)}function y(d){return d===62?(e.consume(d),D):n(d)}function D(d){return d===null||R(d)?L(d):q(d)?(e.consume(d),D):n(d)}function L(d){return d===45&&i===2?(e.consume(d),W):d===60&&i===1?(e.consume(d),J):d===62&&i===4?(e.consume(d),ie):d===63&&i===3?(e.consume(d),m):d===93&&i===5?(e.consume(d),pe):R(d)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(ia,me,K)(d)):d===null||R(d)?(e.exit("htmlFlowData"),K(d)):(e.consume(d),L)}function K(d){return e.check(la,N,me)(d)}function N(d){return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),T}function T(d){return d===null||R(d)?K(d):(e.enter("htmlFlowData"),L(d))}function W(d){return d===45?(e.consume(d),m):L(d)}function J(d){return d===47?(e.consume(d),l="",se):L(d)}function se(d){if(d===62){const le=l.toLowerCase();return Bn.includes(le)?(e.consume(d),ie):L(d)}return re(d)&&l.length<8?(e.consume(d),l+=String.fromCharCode(d),se):L(d)}function pe(d){return d===93?(e.consume(d),m):L(d)}function m(d){return d===62?(e.consume(d),ie):d===45&&i===2?(e.consume(d),m):L(d)}function ie(d){return d===null||R(d)?(e.exit("htmlFlowData"),me(d)):(e.consume(d),ie)}function me(d){return e.exit("htmlFlow"),t(d)}}function sa(e,t,n){const r=this;return i;function i(l){return R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function ua(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(lt,t,n)}}const ca={name:"htmlText",tokenize:fa};function fa(e,t,n){const r=this;let i,o,l;return a;function a(m){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(m),s}function s(m){return m===33?(e.consume(m),u):m===47?(e.consume(m),z):m===63?(e.consume(m),E):re(m)?(e.consume(m),_):n(m)}function u(m){return m===45?(e.consume(m),f):m===91?(e.consume(m),o=0,g):re(m)?(e.consume(m),I):n(m)}function f(m){return m===45?(e.consume(m),h):n(m)}function c(m){return m===null?n(m):m===45?(e.consume(m),p):R(m)?(l=c,J(m)):(e.consume(m),c)}function p(m){return m===45?(e.consume(m),h):c(m)}function h(m){return m===62?W(m):m===45?p(m):c(m)}function g(m){const ie="CDATA[";return m===ie.charCodeAt(o++)?(e.consume(m),o===ie.length?S:g):n(m)}function S(m){return m===null?n(m):m===93?(e.consume(m),k):R(m)?(l=S,J(m)):(e.consume(m),S)}function k(m){return m===93?(e.consume(m),x):S(m)}function x(m){return m===62?W(m):m===93?(e.consume(m),x):S(m)}function I(m){return m===null||m===62?W(m):R(m)?(l=I,J(m)):(e.consume(m),I)}function E(m){return m===null?n(m):m===63?(e.consume(m),P):R(m)?(l=E,J(m)):(e.consume(m),E)}function P(m){return m===62?W(m):E(m)}function z(m){return re(m)?(e.consume(m),b):n(m)}function b(m){return m===45||te(m)?(e.consume(m),b):H(m)}function H(m){return R(m)?(l=H,J(m)):q(m)?(e.consume(m),H):W(m)}function _(m){return m===45||te(m)?(e.consume(m),_):m===47||m===62||Y(m)?$(m):n(m)}function $(m){return m===47?(e.consume(m),W):m===58||m===95||re(m)?(e.consume(m),y):R(m)?(l=$,J(m)):q(m)?(e.consume(m),$):W(m)}function y(m){return m===45||m===46||m===58||m===95||te(m)?(e.consume(m),y):D(m)}function D(m){return m===61?(e.consume(m),L):R(m)?(l=D,J(m)):q(m)?(e.consume(m),D):$(m)}function L(m){return m===null||m===60||m===61||m===62||m===96?n(m):m===34||m===39?(e.consume(m),i=m,K):R(m)?(l=L,J(m)):q(m)?(e.consume(m),L):(e.consume(m),N)}function K(m){return m===i?(e.consume(m),i=void 0,T):m===null?n(m):R(m)?(l=K,J(m)):(e.consume(m),K)}function N(m){return m===null||m===34||m===39||m===60||m===61||m===96?n(m):m===47||m===62||Y(m)?$(m):(e.consume(m),N)}function T(m){return m===47||m===62||Y(m)?$(m):n(m)}function W(m){return m===62?(e.consume(m),e.exit("htmlTextData"),e.exit("htmlText"),t):n(m)}function J(m){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),se}function se(m){return q(m)?V(e,pe,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):pe(m)}function pe(m){return e.enter("htmlTextData"),l(m)}}const sn={name:"labelEnd",resolveAll:da,resolveTo:ga,tokenize:xa},ha={tokenize:ya},pa={tokenize:ka},ma={tokenize:ba};function da(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&he(e,0,e.length,n),e}function ga(e,t){let n=e.length,r=0,i,o,l,a;for(;n--;)if(i=e[n][1],o){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(o=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(l=n);const s={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},u={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},f={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return a=[["enter",s,t],["enter",u,t]],a=de(a,e.slice(o+1,o+r+3)),a=de(a,[["enter",f,t]]),a=de(a,yt(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),a=de(a,[["exit",f,t],e[l-2],e[l-1],["exit",u,t]]),a=de(a,e.slice(l+1)),a=de(a,[["exit",s,t]]),he(e,o,e.length,a),e}function xa(e,t,n){const r=this;let i=r.events.length,o,l;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){o=r.events[i][1];break}return a;function a(p){return o?o._inactive?c(p):(l=r.parser.defined.includes(ke(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelEnd"),s):n(p)}function s(p){return p===40?e.attempt(ha,f,l?f:c)(p):p===91?e.attempt(pa,f,l?u:c)(p):l?f(p):c(p)}function u(p){return e.attempt(ma,f,c)(p)}function f(p){return t(p)}function c(p){return o._balanced=!0,n(p)}}function ya(e,t,n){return r;function r(c){return e.enter("resource"),e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),i}function i(c){return Y(c)?Je(e,o)(c):o(c)}function o(c){return c===41?f(c):Gr(e,l,a,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(c)}function l(c){return Y(c)?Je(e,s)(c):f(c)}function a(c){return n(c)}function s(c){return c===34||c===39||c===40?Zr(e,u,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(c):f(c)}function u(c){return Y(c)?Je(e,f)(c):f(c)}function f(c){return c===41?(e.enter("resourceMarker"),e.consume(c),e.exit("resourceMarker"),e.exit("resource"),t):n(c)}}function ka(e,t,n){const r=this;return i;function i(a){return Jr.call(r,e,o,l,"reference","referenceMarker","referenceString")(a)}function o(a){return r.parser.defined.includes(ke(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(a):n(a)}function l(a){return n(a)}}function ba(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),i}function i(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const wa={name:"labelStartImage",resolveAll:sn.resolveAll,tokenize:Sa};function Sa(e,t,n){const r=this;return i;function i(a){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(a),e.exit("labelImageMarker"),o}function o(a){return a===91?(e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelImage"),l):n(a)}function l(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Ca={name:"labelStartLink",resolveAll:sn.resolveAll,tokenize:Ea};function Ea(e,t,n){const r=this;return i;function i(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const At={name:"lineEnding",tokenize:Ia};function Ia(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),V(e,t,"linePrefix")}}const pt={name:"thematicBreak",tokenize:Aa};function Aa(e,t,n){let r=0,i;return o;function o(u){return e.enter("thematicBreak"),l(u)}function l(u){return i=u,a(u)}function a(u){return u===i?(e.enter("thematicBreakSequence"),s(u)):r>=3&&(u===null||R(u))?(e.exit("thematicBreak"),t(u)):n(u)}function s(u){return u===i?(e.consume(u),r++,s):(e.exit("thematicBreakSequence"),q(u)?V(e,a,"whitespace")(u):a(u))}}const oe={continuation:{tokenize:Da},exit:Na,name:"list",tokenize:Pa},va={partial:!0,tokenize:za},Ta={partial:!0,tokenize:La};function Pa(e,t,n){const r=this,i=r.events[r.events.length-1];let o=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,l=0;return a;function a(h){const g=r.containerState.type||(h===42||h===43||h===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||h===r.containerState.marker:Vt(h)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),h===42||h===45?e.check(pt,n,u)(h):u(h);if(!r.interrupt||h===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),s(h)}return n(h)}function s(h){return Vt(h)&&++l<10?(e.consume(h),s):(!r.interrupt||l<2)&&(r.containerState.marker?h===r.containerState.marker:h===41||h===46)?(e.exit("listItemValue"),u(h)):n(h)}function u(h){return e.enter("listItemMarker"),e.consume(h),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||h,e.check(lt,r.interrupt?n:f,e.attempt(va,p,c))}function f(h){return r.containerState.initialBlankLine=!0,o++,p(h)}function c(h){return q(h)?(e.enter("listItemPrefixWhitespace"),e.consume(h),e.exit("listItemPrefixWhitespace"),p):n(h)}function p(h){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(h)}}function Da(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(lt,i,o);function i(a){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,V(e,t,"listItemIndent",r.containerState.size+1)(a)}function o(a){return r.containerState.furtherBlankLines||!q(a)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(a)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Ta,t,l)(a))}function l(a){return r.containerState._closeFlow=!0,r.interrupt=void 0,V(e,e.attempt(oe,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a)}}function La(e,t,n){const r=this;return V(e,i,"listItemIndent",r.containerState.size+1);function i(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function Na(e){e.exit(this.containerState.type)}function za(e,t,n){const r=this;return V(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(o){const l=r.events[r.events.length-1];return!q(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Hn={name:"setextUnderline",resolveTo:Ra,tokenize:Fa};function Ra(e,t){let n=e.length,r,i,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",o?(e.splice(i,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function Fa(e,t,n){const r=this;let i;return o;function o(u){let f=r.events.length,c;for(;f--;)if(r.events[f][1].type!=="lineEnding"&&r.events[f][1].type!=="linePrefix"&&r.events[f][1].type!=="content"){c=r.events[f][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||c)?(e.enter("setextHeadingLine"),i=u,l(u)):n(u)}function l(u){return e.enter("setextHeadingLineSequence"),a(u)}function a(u){return u===i?(e.consume(u),a):(e.exit("setextHeadingLineSequence"),q(u)?V(e,s,"lineSuffix")(u):s(u))}function s(u){return u===null||R(u)?(e.exit("setextHeadingLine"),t(u)):n(u)}}const Oa={tokenize:ja};function ja(e){const t=this,n=e.attempt(lt,r,e.attempt(this.parser.constructs.flowInitial,i,V(e,e.attempt(this.parser.constructs.flow,i,e.attempt(qo,i)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const _a={resolveAll:ti()},Ma=ei("string"),Ba=ei("text");function ei(e){return{resolveAll:ti(e==="text"?Ha:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],o=n.attempt(i,l,a);return l;function l(f){return u(f)?o(f):a(f)}function a(f){if(f===null){n.consume(f);return}return n.enter("data"),n.consume(f),s}function s(f){return u(f)?(n.exit("data"),o(f)):(n.consume(f),s)}function u(f){if(f===null)return!0;const c=i[f];let p=-1;if(c)for(;++p<c.length;){const h=c[p];if(!h.previous||h.previous.call(r,r.previous))return!0}return!1}}}function ti(e){return t;function t(n,r){let i=-1,o;for(;++i<=n.length;)o===void 0?n[i]&&n[i][1].type==="data"&&(o=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==o+2&&(n[o][1].end=n[i-1][1].end,n.splice(o+2,i-o-2),i=o+2),o=void 0);return e?e(n,r):n}}function Ha(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let o=i.length,l=-1,a=0,s;for(;o--;){const u=i[o];if(typeof u=="string"){for(l=u.length;u.charCodeAt(l-1)===32;)a++,l--;if(l)break;l=-1}else if(u===-2)s=!0,a++;else if(u!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(a=0),a){const u={type:n===e.length||s||a<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-a,offset:r.end.offset-a},end:{...r.end}};r.end={...u.start},r.start.offset===r.end.offset?Object.assign(r,u):(e.splice(n,0,["enter",u,t],["exit",u,t]),n+=2)}n++}return e}const qa={42:oe,43:oe,45:oe,48:oe,49:oe,50:oe,51:oe,52:oe,53:oe,54:oe,55:oe,56:oe,57:oe,62:Wr},Ua={91:Wo},$a={[-2]:It,[-1]:It,32:It},Va={35:Zo,42:pt,45:[Hn,pt],60:ra,61:Hn,95:pt,96:Mn,126:Mn},Ka={38:Yr,92:Qr},Wa={[-5]:At,[-4]:At,[-3]:At,33:wa,38:Yr,42:Kt,60:[Co,ca],91:Ca,92:[Go,Qr],93:sn,95:Kt,96:Oo},Qa={null:[Kt,_a]},Ya={null:[42,95]},Xa={null:[]},Ga=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Ya,contentInitial:Ua,disable:Xa,document:qa,flow:Va,flowInitial:$a,insideSpan:Qa,string:Ka,text:Wa},Symbol.toStringTag,{value:"Module"}));function Ja(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},o=[];let l=[],a=[];const s={attempt:H(z),check:H(b),consume:I,enter:E,exit:P,interrupt:H(b,{interrupt:!0})},u={code:null,containerState:{},defineSkip:S,events:[],now:g,parser:e,previous:null,sliceSerialize:p,sliceStream:h,write:c};let f=t.tokenize.call(u,s);return t.resolveAll&&o.push(t),u;function c(D){return l=de(l,D),k(),l[l.length-1]!==null?[]:(_(t,0),u.events=yt(o,u.events,u),u.events)}function p(D,L){return es(h(D),L)}function h(D){return Za(l,D)}function g(){const{_bufferIndex:D,_index:L,line:K,column:N,offset:T}=r;return{_bufferIndex:D,_index:L,line:K,column:N,offset:T}}function S(D){i[D.line]=D.column,y()}function k(){let D;for(;r._index<l.length;){const L=l[r._index];if(typeof L=="string")for(D=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===D&&r._bufferIndex<L.length;)x(L.charCodeAt(r._bufferIndex));else x(L)}}function x(D){f=f(D)}function I(D){R(D)?(r.line++,r.column=1,r.offset+=D===-3?2:1,y()):D!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),u.previous=D}function E(D,L){const K=L||{};return K.type=D,K.start=g(),u.events.push(["enter",K,u]),a.push(K),K}function P(D){const L=a.pop();return L.end=g(),u.events.push(["exit",L,u]),L}function z(D,L){_(D,L.from)}function b(D,L){L.restore()}function H(D,L){return K;function K(N,T,W){let J,se,pe,m;return Array.isArray(N)?me(N):"tokenize"in N?me([N]):ie(N);function ie(ee){return Ae;function Ae(xe){const F=xe!==null&&ee[xe],G=xe!==null&&ee.null,ue=[...Array.isArray(F)?F:F?[F]:[],...Array.isArray(G)?G:G?[G]:[]];return me(ue)(xe)}}function me(ee){return J=ee,se=0,ee.length===0?W:d(ee[se])}function d(ee){return Ae;function Ae(xe){return m=$(),pe=ee,ee.partial||(u.currentConstruct=ee),ee.name&&u.parser.constructs.disable.null.includes(ee.name)?Se():ee.tokenize.call(L?Object.assign(Object.create(u),L):u,s,le,Se)(xe)}}function le(ee){return D(pe,m),T}function Se(ee){return m.restore(),++se<J.length?d(J[se]):W}}}function _(D,L){D.resolveAll&&!o.includes(D)&&o.push(D),D.resolve&&he(u.events,L,u.events.length-L,D.resolve(u.events.slice(L),u)),D.resolveTo&&(u.events=D.resolveTo(u.events,u))}function $(){const D=g(),L=u.previous,K=u.currentConstruct,N=u.events.length,T=Array.from(a);return{from:N,restore:W};function W(){r=D,u.previous=L,u.currentConstruct=K,u.events.length=N,a=T,y()}}function y(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Za(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,o=t.end._bufferIndex;let l;if(n===i)l=[e[n].slice(r,o)];else{if(l=e.slice(n,i),r>-1){const a=l[0];typeof a=="string"?l[0]=a.slice(r):l.shift()}o>0&&l.push(e[i].slice(0,o))}return l}function es(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
3
3
|
`;break}case-3:{l=`\r
|
|
4
4
|
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&i)continue;l=" ";break}default:l=String.fromCharCode(o)}i=o===-2,r.push(l)}return r.join("")}function ts(e){const r={constructs:Vr([Ga,...(e||{}).extensions||[]]),content:i(go),defined:[],document:i(yo),flow:i(Oa),lazy:{},string:i(Ma),text:i(Ba)};return r;function i(o){return l;function l(a){return Ja(r,o,a)}}}function ns(e){for(;!Xr(e););return e}const qn=/[\0\t\n\r]/g;function rs(){let e=1,t="",n=!0,r;return i;function i(o,l,a){const s=[];let u,f,c,p,h;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),c=0,t="",n&&(o.charCodeAt(0)===65279&&c++,n=void 0);c<o.length;){if(qn.lastIndex=c,u=qn.exec(o),p=u&&u.index!==void 0?u.index:o.length,h=o.charCodeAt(p),!u){t=o.slice(c);break}if(h===10&&c===p&&r)s.push(-3),r=void 0;else switch(r&&(s.push(-5),r=void 0),c<p&&(s.push(o.slice(c,p)),e+=p-c),h){case 0:{s.push(65533),e++;break}case 9:{for(f=Math.ceil(e/4)*4,s.push(-2);e++<f;)s.push(-1);break}case 10:{s.push(-4),e=1;break}default:r=!0,e=1}c=p+1}return a&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}const is=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ls(e){return e.replace(is,os)}function os(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),o=i===120||i===88;return Kr(n.slice(o?2:1),o?16:10)}return an(n)||e}const ni={}.hasOwnProperty;function as(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),ss(n)(ns(ts(n).document().write(rs()(e,t,!0))))}function ss(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(wn),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(yn),blockQuote:o(G),characterEscape:$,characterReference:$,codeFenced:o(ue),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(ue,l),codeText:o(ve,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(st),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(qi),hardBreakEscape:o(kn),hardBreakTrailing:o(kn),htmlFlow:o(bn,l),htmlFlowData:$,htmlText:o(bn,l),htmlTextData:$,image:o(Ui),label:l,link:o(wn),listItem:o($i),listItemValue:p,listOrdered:o(Sn,c),listUnordered:o(Sn),paragraph:o(Vi),reference:d,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(yn),strong:o(Ki),thematicBreak:o(Qi)},exit:{atxHeading:s(),atxHeadingSequence:z,autolink:s(),autolinkEmail:F,autolinkProtocol:xe,blockQuote:s(),characterEscapeValue:y,characterReferenceMarkerHexadecimal:Se,characterReferenceMarkerNumeric:Se,characterReferenceValue:ee,characterReference:Ae,codeFenced:s(k),codeFencedFence:S,codeFencedFenceInfo:h,codeFencedFenceMeta:g,codeFlowValue:y,codeIndented:s(x),codeText:s(T),codeTextData:y,data:y,definition:s(),definitionDestinationString:P,definitionLabelString:I,definitionTitleString:E,emphasis:s(),hardBreakEscape:s(L),hardBreakTrailing:s(L),htmlFlow:s(K),htmlFlowData:y,htmlText:s(N),htmlTextData:y,image:s(J),label:pe,labelText:se,lineEnding:D,link:s(W),listItem:s(),listOrdered:s(),listUnordered:s(),paragraph:s(),referenceString:le,resourceDestinationString:m,resourceTitleString:ie,resource:me,setextHeading:s(_),setextHeadingLineSequence:H,setextHeadingText:b,strong:s(),thematicBreak:s()}};ri(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(C){let v={type:"root",children:[]};const O={stack:[v],tokenStack:[],config:t,enter:a,exit:u,buffer:l,resume:f,data:n},U=[];let Q=-1;for(;++Q<C.length;)if(C[Q][1].type==="listOrdered"||C[Q][1].type==="listUnordered")if(C[Q][0]==="enter")U.push(Q);else{const ye=U.pop();Q=i(C,ye,Q)}for(Q=-1;++Q<C.length;){const ye=t[C[Q][0]];ni.call(ye,C[Q][1].type)&&ye[C[Q][1].type].call(Object.assign({sliceSerialize:C[Q][2].sliceSerialize},O),C[Q][1])}if(O.tokenStack.length>0){const ye=O.tokenStack[O.tokenStack.length-1];(ye[1]||Un).call(O,void 0,ye[0])}for(v.position={start:Te(C.length>0?C[0][1].start:{line:1,column:1,offset:0}),end:Te(C.length>0?C[C.length-2][1].end:{line:1,column:1,offset:0})},Q=-1;++Q<t.transforms.length;)v=t.transforms[Q](v)||v;return v}function i(C,v,O){let U=v-1,Q=-1,ye=!1,Le,Ce,Ve,Ke;for(;++U<=O;){const ce=C[U];switch(ce[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ce[0]==="enter"?Q++:Q--,Ke=void 0;break}case"lineEndingBlank":{ce[0]==="enter"&&(Le&&!Ke&&!Q&&!Ve&&(Ve=U),Ke=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ke=void 0}if(!Q&&ce[0]==="enter"&&ce[1].type==="listItemPrefix"||Q===-1&&ce[0]==="exit"&&(ce[1].type==="listUnordered"||ce[1].type==="listOrdered")){if(Le){let Oe=U;for(Ce=void 0;Oe--;){const Ee=C[Oe];if(Ee[1].type==="lineEnding"||Ee[1].type==="lineEndingBlank"){if(Ee[0]==="exit")continue;Ce&&(C[Ce][1].type="lineEndingBlank",ye=!0),Ee[1].type="lineEnding",Ce=Oe}else if(!(Ee[1].type==="linePrefix"||Ee[1].type==="blockQuotePrefix"||Ee[1].type==="blockQuotePrefixWhitespace"||Ee[1].type==="blockQuoteMarker"||Ee[1].type==="listItemIndent"))break}Ve&&(!Ce||Ve<Ce)&&(Le._spread=!0),Le.end=Object.assign({},Ce?C[Ce][1].start:ce[1].end),C.splice(Ce||U,0,["exit",Le,ce[2]]),U++,O++}if(ce[1].type==="listItemPrefix"){const Oe={type:"listItem",_spread:!1,start:Object.assign({},ce[1].start),end:void 0};Le=Oe,C.splice(U,0,["enter",Oe,ce[2]]),U++,O++,Ve=void 0,Ke=!0}}}return C[v][1]._spread=ye,O}function o(C,v){return O;function O(U){a.call(this,C(U),U),v&&v.call(this,U)}}function l(){this.stack.push({type:"fragment",children:[]})}function a(C,v,O){this.stack[this.stack.length-1].children.push(C),this.stack.push(C),this.tokenStack.push([v,O||void 0]),C.position={start:Te(v.start),end:void 0}}function s(C){return v;function v(O){C&&C.call(this,O),u.call(this,O)}}function u(C,v){const O=this.stack.pop(),U=this.tokenStack.pop();if(U)U[0].type!==C.type&&(v?v.call(this,C,U[0]):(U[1]||Un).call(this,C,U[0]));else throw new Error("Cannot close `"+C.type+"` ("+Ge({start:C.start,end:C.end})+"): it’s not open");O.position.end=Te(C.end)}function f(){return on(this.stack.pop())}function c(){this.data.expectingFirstListItemValue=!0}function p(C){if(this.data.expectingFirstListItemValue){const v=this.stack[this.stack.length-2];v.start=Number.parseInt(this.sliceSerialize(C),10),this.data.expectingFirstListItemValue=void 0}}function h(){const C=this.resume(),v=this.stack[this.stack.length-1];v.lang=C}function g(){const C=this.resume(),v=this.stack[this.stack.length-1];v.meta=C}function S(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const C=this.resume(),v=this.stack[this.stack.length-1];v.value=C.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function x(){const C=this.resume(),v=this.stack[this.stack.length-1];v.value=C.replace(/(\r?\n|\r)$/g,"")}function I(C){const v=this.resume(),O=this.stack[this.stack.length-1];O.label=v,O.identifier=ke(this.sliceSerialize(C)).toLowerCase()}function E(){const C=this.resume(),v=this.stack[this.stack.length-1];v.title=C}function P(){const C=this.resume(),v=this.stack[this.stack.length-1];v.url=C}function z(C){const v=this.stack[this.stack.length-1];if(!v.depth){const O=this.sliceSerialize(C).length;v.depth=O}}function b(){this.data.setextHeadingSlurpLineEnding=!0}function H(C){const v=this.stack[this.stack.length-1];v.depth=this.sliceSerialize(C).codePointAt(0)===61?1:2}function _(){this.data.setextHeadingSlurpLineEnding=void 0}function $(C){const O=this.stack[this.stack.length-1].children;let U=O[O.length-1];(!U||U.type!=="text")&&(U=Wi(),U.position={start:Te(C.start),end:void 0},O.push(U)),this.stack.push(U)}function y(C){const v=this.stack.pop();v.value+=this.sliceSerialize(C),v.position.end=Te(C.end)}function D(C){const v=this.stack[this.stack.length-1];if(this.data.atHardBreak){const O=v.children[v.children.length-1];O.position.end=Te(C.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(v.type)&&($.call(this,C),y.call(this,C))}function L(){this.data.atHardBreak=!0}function K(){const C=this.resume(),v=this.stack[this.stack.length-1];v.value=C}function N(){const C=this.resume(),v=this.stack[this.stack.length-1];v.value=C}function T(){const C=this.resume(),v=this.stack[this.stack.length-1];v.value=C}function W(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const v=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=v,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function J(){const C=this.stack[this.stack.length-1];if(this.data.inReference){const v=this.data.referenceType||"shortcut";C.type+="Reference",C.referenceType=v,delete C.url,delete C.title}else delete C.identifier,delete C.label;this.data.referenceType=void 0}function se(C){const v=this.sliceSerialize(C),O=this.stack[this.stack.length-2];O.label=ls(v),O.identifier=ke(v).toLowerCase()}function pe(){const C=this.stack[this.stack.length-1],v=this.resume(),O=this.stack[this.stack.length-1];if(this.data.inReference=!0,O.type==="link"){const U=C.children;O.children=U}else O.alt=v}function m(){const C=this.resume(),v=this.stack[this.stack.length-1];v.url=C}function ie(){const C=this.resume(),v=this.stack[this.stack.length-1];v.title=C}function me(){this.data.inReference=void 0}function d(){this.data.referenceType="collapsed"}function le(C){const v=this.resume(),O=this.stack[this.stack.length-1];O.label=v,O.identifier=ke(this.sliceSerialize(C)).toLowerCase(),this.data.referenceType="full"}function Se(C){this.data.characterReferenceType=C.type}function ee(C){const v=this.sliceSerialize(C),O=this.data.characterReferenceType;let U;O?(U=Kr(v,O==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):U=an(v);const Q=this.stack[this.stack.length-1];Q.value+=U}function Ae(C){const v=this.stack.pop();v.position.end=Te(C.end)}function xe(C){y.call(this,C);const v=this.stack[this.stack.length-1];v.url=this.sliceSerialize(C)}function F(C){y.call(this,C);const v=this.stack[this.stack.length-1];v.url="mailto:"+this.sliceSerialize(C)}function G(){return{type:"blockquote",children:[]}}function ue(){return{type:"code",lang:null,meta:null,value:""}}function ve(){return{type:"inlineCode",value:""}}function st(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function qi(){return{type:"emphasis",children:[]}}function yn(){return{type:"heading",depth:0,children:[]}}function kn(){return{type:"break"}}function bn(){return{type:"html",value:""}}function Ui(){return{type:"image",title:null,url:"",alt:null}}function wn(){return{type:"link",title:null,url:"",children:[]}}function Sn(C){return{type:"list",ordered:C.type==="listOrdered",start:null,spread:C._spread,children:[]}}function $i(C){return{type:"listItem",spread:C._spread,checked:null,children:[]}}function Vi(){return{type:"paragraph",children:[]}}function Ki(){return{type:"strong",children:[]}}function Wi(){return{type:"text",value:""}}function Qi(){return{type:"thematicBreak"}}}function Te(e){return{line:e.line,column:e.column,offset:e.offset}}function ri(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?ri(e,r):us(e,r)}}function us(e,t){let n;for(n in t)if(ni.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Un(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Ge({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Ge({start:t.start,end:t.end})+") is still open")}function cs(e){const t=this;t.parser=n;function n(r){return as(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function fs(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function hs(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as x,j as e,W as j,A as D,an as L,ao as R,a7 as k}from"./vendor-Dh04PGww.js";import{u as E}from"./useConfirmDialog-
|
|
1
|
+
import{r as x,j as e,W as j,A as D,an as L,ao as R,a7 as k}from"./vendor-Dh04PGww.js";import{u as E}from"./useConfirmDialog-BUKGHDL6.js";import{o as M,p as P,q as T,r as J,I as A}from"./useConfig-txxbxXnT.js";import{P as F,a as z,B as o}from"./page-layout-CUMMO0nN.js";import{c as p,t,S as q,a as B,b as I,d as Q,e as f,f as y}from"./index-BRBYYgR_.js";import{C as H,d as V}from"./card-D7NY0Szf.js";function g(s){return y(s??void 0)}function O(s){return typeof s!="number"||!Number.isFinite(s)?"-":y(new Date(s))}function W(s){if(typeof s!="number"||!Number.isFinite(s))return"-";const r=Math.round(s/1e3);if(r<60)return`${r}s`;const n=Math.round(r/60);if(n<60)return`${n}m`;const c=Math.round(n/60);return c<24?`${c}h`:`${Math.round(c/24)}d`}function G(s){const r=s.schedule;return r.kind==="cron"?r.expr?`cron ${r.expr}`:"cron":r.kind==="every"?`every ${W(r.everyMs)}`:r.kind==="at"?`at ${O(r.atMs)}`:"-"}function K(s){if(!s.payload.deliver)return"-";const r=s.payload.channel??"-",n=s.payload.to??"-";return`${r}:${n}`}function U(s,r){const n=r.trim().toLowerCase();return n?[s.id,s.name,s.payload.message,s.payload.channel??"",s.payload.to??""].join(" ").toLowerCase().includes(n):!0}function X(s,r){return r==="all"?!0:r==="enabled"?s.enabled:!s.enabled}function se(){var h;const[s,r]=x.useState(""),[n,c]=x.useState("all"),i=M({all:!0}),v=P(),N=T(),w=J(),{confirm:m,ConfirmDialog:C}=E(),u=x.useMemo(()=>{var l;return(((l=i.data)==null?void 0:l.jobs)??[]).filter(d=>U(d,s)).filter(d=>X(d,n))},[i.data,s,n]),b=async a=>{await m({title:`${t("cronDeleteConfirm")}?`,description:a.name?`${a.name} (${a.id})`:a.id,variant:"destructive",confirmLabel:t("delete")})&&v.mutate({id:a.id})},S=async a=>{const l=!a.enabled;await m({title:l?`${t("cronEnableConfirm")}?`:`${t("cronDisableConfirm")}?`,description:a.name?`${a.name} (${a.id})`:a.id,variant:l?"default":"destructive",confirmLabel:l?t("cronEnable"):t("cronDisable")})&&N.mutate({id:a.id,enabled:l})},$=async a=>{const l=!a.enabled;await m({title:l?`${t("cronRunForceConfirm")}?`:`${t("cronRunConfirm")}?`,description:a.name?`${a.name} (${a.id})`:a.id,confirmLabel:t("cronRunNow")})&&w.mutate({id:a.id,force:l})};return e.jsxs(F,{fullHeight:!0,children:[e.jsx(z,{title:t("cronPageTitle"),description:t("cronPageDescription"),actions:e.jsx(o,{variant:"ghost",size:"icon",className:"h-9 w-9 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100",onClick:()=>i.refetch(),children:e.jsx(j,{className:p("h-4 w-4",i.isFetching&&"animate-spin")})})}),e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"flex flex-wrap gap-3 items-center",children:[e.jsxs("div",{className:"relative flex-1 min-w-[240px]",children:[e.jsx(A,{value:s,onChange:a=>r(a.target.value),placeholder:t("cronSearchPlaceholder"),className:"pl-9"}),e.jsx(D,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-gray-400"})]}),e.jsx("div",{className:"min-w-[180px]",children:e.jsxs(q,{value:n,onValueChange:a=>c(a),children:[e.jsx(B,{className:"w-full",children:e.jsx(I,{placeholder:t("cronStatusLabel")})}),e.jsxs(Q,{children:[e.jsx(f,{value:"all",children:t("cronStatusAll")}),e.jsx(f,{value:"enabled",children:t("cronStatusEnabled")}),e.jsx(f,{value:"disabled",children:t("cronStatusDisabled")})]})]})}),e.jsxs("div",{className:"text-xs text-gray-500 ml-auto",children:[t("cronTotalLabel"),": ",((h=i.data)==null?void 0:h.total)??0," / ",u.length]})]})}),e.jsx("div",{className:"flex-1 overflow-auto custom-scrollbar",children:i.isLoading?e.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:t("cronLoading")}):u.length===0?e.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:t("cronEmpty")}):e.jsx("div",{className:"space-y-4",children:u.map(a=>e.jsx(H,{className:"border border-gray-200",children:e.jsx(V,{className:"pt-5 pb-5",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-4",children:[e.jsxs("div",{className:"min-w-[220px] flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"text-sm font-semibold text-gray-900",children:a.name||a.id}),e.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500",children:a.id}),e.jsx("span",{className:p("text-[10px] font-semibold px-2 py-0.5 rounded-full",a.enabled?"bg-emerald-50 text-emerald-700":"bg-gray-100 text-gray-500"),children:a.enabled?t("enabled"):t("disabled")}),a.deleteAfterRun&&e.jsx("span",{className:"text-[10px] font-semibold px-2 py-0.5 rounded-full bg-amber-50 text-amber-700",children:t("cronOneShot")})]}),e.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[t("cronScheduleLabel"),": ",G(a)]}),e.jsx("div",{className:"mt-2 text-sm text-gray-700 whitespace-pre-wrap break-words",children:a.payload.message}),e.jsxs("div",{className:"mt-2 text-xs text-gray-500",children:[t("cronDeliverTo"),": ",K(a)]})]}),e.jsxs("div",{className:"min-w-[220px] text-xs text-gray-500 space-y-2",children:[e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium text-gray-700",children:[t("cronNextRun"),":"]})," ",g(a.state.nextRunAt)]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium text-gray-700",children:[t("cronLastRun"),":"]})," ",g(a.state.lastRunAt)]}),e.jsxs("div",{children:[e.jsxs("span",{className:"font-medium text-gray-700",children:[t("cronLastStatus"),":"]})," ",a.state.lastStatus??"-"]}),a.state.lastError&&e.jsx("div",{className:"text-[11px] text-red-500 break-words",children:a.state.lastError})]}),e.jsxs("div",{className:"flex items-start gap-2 flex-wrap justify-end",children:[e.jsxs(o,{variant:"subtle",size:"sm",onClick:()=>$(a),className:"gap-1",children:[e.jsx(L,{className:"h-3.5 w-3.5"}),t("cronRunNow")]}),e.jsxs(o,{variant:a.enabled?"outline":"primary",size:"sm",onClick:()=>S(a),className:"gap-1",children:[e.jsx(R,{className:"h-3.5 w-3.5"}),a.enabled?t("cronDisable"):t("cronEnable")]}),e.jsxs(o,{variant:"destructive",size:"sm",onClick:()=>b(a),className:"gap-1",children:[e.jsx(k,{className:"h-3.5 w-3.5"}),t("delete")]})]})]})})},a.id))})}),e.jsx(C,{})]})}export{se as CronConfig};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as s,j as t,s as oe,aR as ae,aS as ne,ab as W,X as ie,aT as le,aU as ce,U as de,aj as ue,aV as me}from"./vendor-Dh04PGww.js";import{j as we,D as Y,t as i,c as X,l as xe}from"./index-
|
|
1
|
+
import{r as s,j as t,s as oe,aR as ae,aS as ne,ab as W,X as ie,aT as le,aU as ce,U as de,aj as ue,aV as me}from"./vendor-Dh04PGww.js";import{j as we,D as Y,t as i,c as X,l as xe}from"./index-BRBYYgR_.js";function pe(){const{isOpen:T,mode:g,tabs:F,activeTabId:N,currentTab:x,currentUrl:l,navVersion:p,close:A,toggleMode:I,goBack:$,goForward:O,canGoBack:V,canGoForward:_,navigate:y,syncUrl:S,setActiveTab:G,closeTab:H,openNewTab:q}=we(),[k,j]=s.useState(""),[E,C]=s.useState(!1),[J,h]=s.useState(!1),[d,D]=s.useState(()=>({x:Math.max(40,window.innerWidth-520),y:80})),[n,U]=s.useState({w:480,h:600}),[L,K]=s.useState(420),u=s.useRef(null),m=s.useRef(null),b=s.useRef(null),R=s.useRef(null),B=s.useRef(p),a=(x==null?void 0:x.kind)==="docs";s.useEffect(()=>{if(!a){j("");return}try{const e=new URL(l);j(e.pathname)}catch{j(l)}},[l,N,a]),s.useEffect(()=>{var e;if(a){if(p!==B.current){B.current=p;return}if((e=R.current)!=null&&e.contentWindow)try{const r=new URL(l).pathname;R.current.contentWindow.postMessage({type:"docs-navigate",path:r},"*")}catch{}}},[l,p,a]),s.useEffect(()=>{g==="floating"&&D(e=>({x:Math.max(40,window.innerWidth-n.w-40),y:e.y}))},[g,n.w]),s.useEffect(()=>{const e=r=>{var o;a&&((o=r.data)==null?void 0:o.type)==="docs-route-change"&&typeof r.data.url=="string"&&S(r.data.url)};return window.addEventListener("message",e),()=>window.removeEventListener("message",e)},[S,a]);const Q=s.useCallback(e=>{if(e.preventDefault(),!a)return;const r=k.trim();r&&(r.startsWith("/")?y(`${Y}${r}`):r.startsWith("http")?y(r):y(`${Y}/${r}`))},[k,y,a]),Z=s.useCallback(e=>{g==="floating"&&(C(!0),u.current={startX:e.clientX,startY:e.clientY,startPosX:d.x,startPosY:d.y})},[g,d]);s.useEffect(()=>{if(!E)return;const e=o=>{u.current&&D({x:u.current.startPosX+(o.clientX-u.current.startX),y:u.current.startPosY+(o.clientY-u.current.startY)})},r=()=>{C(!1),u.current=null};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",r),()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",r)}},[E]);const z=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0);const r=e.currentTarget.dataset.axis;m.current={startX:e.clientX,startY:e.clientY,startW:n.w,startH:n.h};const o=w=>{m.current&&U(v=>({w:r==="y"?v.w:Math.max(360,m.current.startW+(w.clientX-m.current.startX)),h:r==="x"?v.h:Math.max(400,m.current.startH+(w.clientY-m.current.startY))}))},f=()=>{h(!1),m.current=null,window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",f)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",f)},[n]),ee=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0),b.current={startX:e.clientX,startW:L};const r=f=>{if(!b.current)return;const w=b.current.startX-f.clientX;K(Math.max(320,Math.min(860,b.current.startW+w)))},o=()=>{h(!1),b.current=null,window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",r),window.addEventListener("mouseup",o)},[L]),te=s.useCallback(e=>{e.preventDefault(),e.stopPropagation(),h(!0);const r=e.clientX,o=n.w,f=d.x,w=re=>{const se=r-re.clientX,P=Math.max(360,o+se);U(M=>({...M,w:P})),D(M=>({...M,x:f-(P-o)}))},v=()=>{h(!1),window.removeEventListener("mousemove",w),window.removeEventListener("mouseup",v)};window.addEventListener("mousemove",w),window.addEventListener("mouseup",v)},[n.w,d.x]);if(!T)return null;const c=g==="docked";return t.jsxs("div",{className:X("flex flex-col bg-white overflow-hidden relative",c?"h-full border-l border-gray-200 shrink-0":"rounded-2xl shadow-2xl border border-gray-200"),style:c?{width:L}:{position:"fixed",left:d.x,top:d.y,width:n.w,height:n.h,zIndex:9999},children:[c&&t.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:ee}),t.jsxs("div",{className:X("flex items-center justify-between px-4 py-2.5 bg-gray-50 border-b border-gray-200 shrink-0 select-none",!c&&"cursor-grab active:cursor-grabbing"),onMouseDown:c?void 0:Z,children:[t.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[t.jsx(oe,{className:"w-4 h-4 text-primary shrink-0"}),t.jsx("span",{className:"text-sm font-semibold text-gray-900 truncate",children:i("docBrowserTitle")})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("button",{onClick:I,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:c?i("docBrowserFloatMode"):i("docBrowserDockMode"),children:c?t.jsx(ae,{className:"w-3.5 h-3.5"}):t.jsx(ne,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:A,className:"hover:bg-gray-200 rounded-md p-1.5 text-gray-500 hover:text-gray-700 transition-colors",title:i("docBrowserClose"),children:t.jsx(W,{className:"w-3.5 h-3.5"})})]})]}),t.jsxs("div",{className:"flex items-center gap-1.5 px-2.5 py-2 bg-white border-b border-gray-100 overflow-x-auto custom-scrollbar",children:[F.map(e=>{const r=e.id===N;return t.jsxs("div",{className:X("inline-flex items-center gap-1 h-7 px-1.5 rounded-lg text-xs border max-w-[220px] shrink-0 transition-colors",r?"bg-blue-50 border-blue-300 text-blue-700":"bg-gray-50 border-gray-200 text-gray-600 hover:bg-gray-100"),children:[t.jsx("button",{type:"button",onClick:()=>G(e.id),className:"truncate text-left px-1",title:e.title,children:e.title||i("docBrowserTabUntitled")}),t.jsx("button",{type:"button",onClick:o=>{o.stopPropagation(),H(e.id)},className:"rounded p-0.5 hover:bg-black/10","aria-label":i("docBrowserCloseTab"),children:t.jsx(W,{className:"w-3 h-3"})})]},e.id)}),t.jsx("button",{onClick:()=>q(void 0,{kind:"docs",title:"Docs"}),className:"inline-flex items-center justify-center w-7 h-7 rounded-lg border border-gray-200 bg-white text-gray-600 hover:bg-gray-100 shrink-0",title:i("docBrowserNewTab"),children:t.jsx(ie,{className:"w-3.5 h-3.5"})})]}),a&&t.jsxs("div",{className:"flex items-center gap-2 px-3.5 py-2 bg-white border-b border-gray-100 shrink-0",children:[t.jsx("button",{onClick:$,disabled:!V,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:t.jsx(le,{className:"w-4 h-4"})}),t.jsx("button",{onClick:O,disabled:!_,className:"p-1.5 rounded-md hover:bg-gray-100 disabled:opacity-30 disabled:cursor-not-allowed text-gray-600 transition-colors",children:t.jsx(ce,{className:"w-4 h-4"})}),t.jsxs("form",{onSubmit:Q,className:"flex-1 relative",children:[t.jsx(de,{className:"w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-gray-400"}),t.jsx("input",{type:"text",value:k,onChange:e=>j(e.target.value),placeholder:i("docBrowserSearchPlaceholder"),className:"w-full h-8 pl-8 pr-3 rounded-lg bg-gray-50 border border-gray-200 text-xs text-gray-700 focus:outline-none focus:ring-1 focus:ring-primary/30 focus:border-primary/40 transition-colors placeholder:text-gray-400"})]})]}),t.jsxs("div",{className:"flex-1 relative overflow-hidden",children:[t.jsx("iframe",{ref:R,src:l,className:"absolute inset-0 w-full h-full border-0",title:(x==null?void 0:x.title)||"NextClaw Docs",sandbox:"allow-same-origin allow-scripts allow-popups allow-forms",allow:"clipboard-read; clipboard-write"},`${N}:${p}`),(J||E)&&t.jsx("div",{className:"absolute inset-0 z-10"})]}),a&&xe(l)&&t.jsx("div",{className:"flex items-center justify-between px-4 py-2 bg-gray-50 border-t border-gray-200 shrink-0",children:t.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer","data-doc-external":!0,className:"flex items-center gap-1.5 text-xs text-primary hover:text-primary-hover font-medium transition-colors",children:[i("docBrowserOpenExternal"),t.jsx(ue,{className:"w-3 h-3"})]})}),!c&&t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"absolute top-0 left-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:te}),t.jsx("div",{className:"absolute top-0 right-0 w-1.5 h-full cursor-ew-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:z,"data-axis":"x"}),t.jsx("div",{className:"absolute bottom-0 left-0 h-1.5 w-full cursor-ns-resize z-20 hover:bg-primary/10 transition-colors",onMouseDown:z,"data-axis":"y"}),t.jsx("div",{className:"absolute bottom-0 right-0 w-4 h-4 cursor-se-resize z-30 flex items-center justify-center text-gray-300 hover:text-gray-500 transition-colors",onMouseDown:z,children:t.jsx(me,{className:"w-3 h-3 rotate-[-45deg]"})})]})]})}export{pe as DocBrowser};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as u,j as s,as as Qe,at as Ge,au as Ve,av as Ce,aw as Je,ax as Ye,ay as O,az as Pe,aA as We,aB as Xe,aC as Ze,aD as et,aE as tt,aF as at,aG as nt,ap as je,aq as Ie,ar as Ne,ae as Q,aH as st,aI as rt,aJ as ot}from"./vendor-Dh04PGww.js";import{i as U,c as Ee,t as d,u as lt,j as it,S as ct,a as ut,b as dt,d as pt,e as we}from"./index-uTbQ-MAY.js";import{T as mt}from"./tabs-custom-BzcvgsvR.js";import{P as Re,u as gt}from"./useConfirmDialog-Dc5WHCUf.js";import{P as ft,a as xt}from"./page-layout-B07kdurB.js";function G(e){return e==="plugin"?"plugins":"skills"}async function ht(e){var o,c;const t=new URLSearchParams,a=G(e.type);(o=e.q)!=null&&o.trim()&&t.set("q",e.q.trim()),(c=e.tag)!=null&&c.trim()&&t.set("tag",e.tag.trim()),e.sort&&t.set("sort",e.sort),typeof e.page=="number"&&Number.isFinite(e.page)&&t.set("page",String(Math.max(1,Math.trunc(e.page)))),typeof e.pageSize=="number"&&Number.isFinite(e.pageSize)&&t.set("pageSize",String(Math.max(1,Math.trunc(e.pageSize))));const n=t.toString(),r=await U.get(n?`/api/marketplace/${a}/items?${n}`:`/api/marketplace/${a}/items`);if(!r.ok)throw new Error(r.error.message);return r.data}async function yt(e){const t=await U.get(`/api/marketplace/skills/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function bt(e){const t=await U.get(`/api/marketplace/plugins/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function kt(e){const t=G(e.type),a=await U.post(`/api/marketplace/${t}/install`,e);if(!a.ok)throw new Error(a.error.message);return a.data}async function vt(e){const t=G(e),a=await U.get(`/api/marketplace/${t}/installed`);if(!a.ok)throw new Error(a.error.message);return a.data}async function wt(e){const t=G(e.type),a=await U.post(`/api/marketplace/${t}/manage`,e);if(!a.ok)throw new Error(a.error.message);return a.data}var[V]=Xe("Tooltip",[Pe]),J=Pe(),Me="TooltipProvider",Tt=700,ee="tooltip.open",[St,ne]=V(Me),Le=e=>{const{__scopeTooltip:t,delayDuration:a=Tt,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:o}=e,c=u.useRef(!0),f=u.useRef(!1),i=u.useRef(0);return u.useEffect(()=>{const x=i.current;return()=>window.clearTimeout(x)},[]),s.jsx(St,{scope:t,isOpenDelayedRef:c,delayDuration:a,onOpen:u.useCallback(()=>{window.clearTimeout(i.current),c.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>c.current=!0,n)},[n]),isPointerInTransitRef:f,onPointerInTransitChange:u.useCallback(x=>{f.current=x},[]),disableHoverableContent:r,children:o})};Le.displayName=Me;var q="Tooltip",[Ct,H]=V(q),De=e=>{const{__scopeTooltip:t,children:a,open:n,defaultOpen:r,onOpenChange:o,disableHoverableContent:c,delayDuration:f}=e,i=ne(q,e.__scopeTooltip),x=J(t),[g,h]=u.useState(null),v=Qe(),m=u.useRef(0),w=c??i.disableHoverableContent,S=f??i.delayDuration,P=u.useRef(!1),[I,k]=Ge({prop:n,defaultProp:r??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(ee))):i.onClose(),o==null||o(M)},caller:q}),E=u.useMemo(()=>I?P.current?"delayed-open":"instant-open":"closed",[I]),R=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,P.current=!1,k(!0)},[k]),T=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),C=u.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{P.current=!0,k(!0),m.current=0},S)},[S,k]);return u.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Ve,{...x,children:s.jsx(Ct,{scope:t,contentId:v,open:I,stateAttribute:E,trigger:g,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{i.isOpenDelayedRef.current?C():R()},[i.isOpenDelayedRef,C,R]),onTriggerLeave:u.useCallback(()=>{w?T():(window.clearTimeout(m.current),m.current=0)},[T,w]),onOpen:R,onClose:T,disableHoverableContent:w,children:a})})};De.displayName=q;var te="TooltipTrigger",$e=u.forwardRef((e,t)=>{const{__scopeTooltip:a,...n}=e,r=H(te,a),o=ne(te,a),c=J(a),f=u.useRef(null),i=Ce(t,f,r.onTriggerChange),x=u.useRef(!1),g=u.useRef(!1),h=u.useCallback(()=>x.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(Je,{asChild:!0,...c,children:s.jsx(Ye.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:i,onPointerMove:O(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),g.current=!0)}),onPointerLeave:O(e.onPointerLeave,()=>{r.onTriggerLeave(),g.current=!1}),onPointerDown:O(e.onPointerDown,()=>{r.open&&r.onClose(),x.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:O(e.onFocus,()=>{x.current||r.onOpen()}),onBlur:O(e.onBlur,r.onClose),onClick:O(e.onClick,r.onClose)})})});$e.displayName=te;var se="TooltipPortal",[Pt,jt]=V(se,{forceMount:void 0}),Oe=e=>{const{__scopeTooltip:t,forceMount:a,children:n,container:r}=e,o=H(se,t);return s.jsx(Pt,{scope:t,forceMount:a,children:s.jsx(Re,{present:a||o.open,children:s.jsx(We,{asChild:!0,container:r,children:n})})})};Oe.displayName=se;var A="TooltipContent",_e=u.forwardRef((e,t)=>{const a=jt(A,e.__scopeTooltip),{forceMount:n=a.forceMount,side:r="top",...o}=e,c=H(A,e.__scopeTooltip);return s.jsx(Re,{present:n||c.open,children:c.disableHoverableContent?s.jsx(Ae,{side:r,...o,ref:t}):s.jsx(It,{side:r,...o,ref:t})})}),It=u.forwardRef((e,t)=>{const a=H(A,e.__scopeTooltip),n=ne(A,e.__scopeTooltip),r=u.useRef(null),o=Ce(t,r),[c,f]=u.useState(null),{trigger:i,onClose:x}=a,g=r.current,{onPointerInTransitChange:h}=n,v=u.useCallback(()=>{f(null),h(!1)},[h]),m=u.useCallback((w,S)=>{const P=w.currentTarget,I={x:w.clientX,y:w.clientY},k=Lt(I,P.getBoundingClientRect()),E=Dt(I,k),R=$t(S.getBoundingClientRect()),T=_t([...E,...R]);f(T),h(!0)},[h]);return u.useEffect(()=>()=>v(),[v]),u.useEffect(()=>{if(i&&g){const w=P=>m(P,g),S=P=>m(P,i);return i.addEventListener("pointerleave",w),g.addEventListener("pointerleave",S),()=>{i.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",S)}}},[i,g,m,v]),u.useEffect(()=>{if(c){const w=S=>{const P=S.target,I={x:S.clientX,y:S.clientY},k=(i==null?void 0:i.contains(P))||(g==null?void 0:g.contains(P)),E=!Ot(I,c);k?v():E&&(v(),x())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[i,g,c,x,v]),s.jsx(Ae,{...e,ref:o})}),[Nt,Et]=V(q,{isInside:!1}),Rt=at("TooltipContent"),Ae=u.forwardRef((e,t)=>{const{__scopeTooltip:a,children:n,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:c,...f}=e,i=H(A,a),x=J(a),{onClose:g}=i;return u.useEffect(()=>(document.addEventListener(ee,g),()=>document.removeEventListener(ee,g)),[g]),u.useEffect(()=>{if(i.trigger){const h=v=>{const m=v.target;m!=null&&m.contains(i.trigger)&&g()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[i.trigger,g]),s.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:h=>h.preventDefault(),onDismiss:g,children:s.jsxs(et,{"data-state":i.stateAttribute,...x,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Rt,{children:n}),s.jsx(Nt,{scope:a,isInside:!0,children:s.jsx(tt,{id:i.contentId,role:"tooltip",children:r||n})})]})})});_e.displayName=A;var Ue="TooltipArrow",Mt=u.forwardRef((e,t)=>{const{__scopeTooltip:a,...n}=e,r=J(a);return Et(Ue,a).isInside?null:s.jsx(nt,{...r,...n,ref:t})});Mt.displayName=Ue;function Lt(e,t){const a=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(a,n,r,o)){case o:return"left";case r:return"right";case a:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Dt(e,t,a=5){const n=[];switch(t){case"top":n.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":n.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":n.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":n.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return n}function $t(e){const{top:t,right:a,bottom:n,left:r}=e;return[{x:r,y:t},{x:a,y:t},{x:a,y:n},{x:r,y:n}]}function Ot(e,t){const{x:a,y:n}=e;let r=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const f=t[o],i=t[c],x=f.x,g=f.y,h=i.x,v=i.y;g>n!=v>n&&a<(h-x)*(n-g)/(v-g)+x&&(r=!r)}return r}function _t(e){const t=e.slice();return t.sort((a,n)=>a.x<n.x?-1:a.x>n.x?1:a.y<n.y?-1:a.y>n.y?1:0),At(t)}function At(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(r.y-c.y)>=(o.y-c.y)*(r.x-c.x))t.pop();else break}t.push(r)}t.pop();const a=[];for(let n=e.length-1;n>=0;n--){const r=e[n];for(;a.length>=2;){const o=a[a.length-1],c=a[a.length-2];if((o.x-c.x)*(r.y-c.y)>=(o.y-c.y)*(r.x-c.x))a.pop();else break}a.push(r)}return a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}var Ut=Le,Ft=De,zt=$e,qt=Oe,Fe=_e;const Ht=Ut,W=Ft,X=zt,B=u.forwardRef(({className:e,sideOffset:t=4,...a},n)=>s.jsx(qt,{children:s.jsx(Fe,{ref:n,sideOffset:t,className:Ee("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));B.displayName=Fe.displayName;function Kt(e){return je({queryKey:["marketplace-items",e],queryFn:()=>ht(e),staleTime:15e3})}function Bt(e){return je({queryKey:["marketplace-installed",e],queryFn:()=>vt(e),staleTime:1e4})}function Qt(){const e=Ie();return Ne({mutationFn:t=>kt(t),onSuccess:t=>{e.invalidateQueries({queryKey:["marketplace-installed",t.type]}),e.refetchQueries({queryKey:["marketplace-installed",t.type],type:"active"}),e.refetchQueries({queryKey:["marketplace-items"],type:"active"});const a=t.type==="plugin"?d("marketplaceInstallSuccessPlugin"):d("marketplaceInstallSuccessSkill");Q.success(t.message||a)},onError:t=>{Q.error(t.message||d("marketplaceInstallFailed"))}})}function Gt(){const e=Ie();return Ne({mutationFn:t=>wt(t),onSuccess:t=>{e.invalidateQueries({queryKey:["marketplace-installed",t.type]}),e.invalidateQueries({queryKey:["marketplace-items"]}),e.refetchQueries({queryKey:["marketplace-installed",t.type],type:"active"}),e.refetchQueries({queryKey:["marketplace-items"],type:"active"});const a=t.action==="enable"?d("marketplaceEnableSuccess"):t.action==="disable"?d("marketplaceDisableSuccess"):d("marketplaceUninstallSuccess");Q.success(t.message||a)},onError:t=>{Q.error(t.message||d("marketplaceOperationFailed"))}})}const Vt=12;function ae(e){return(e??"").trim().toLowerCase()}function _(e,t){const a=ae(t);return a.length>0?`${e}:${a}`:""}function Jt(e){const t=new Map;for(const a of e){const n=[a.install.spec,a.slug,a.id];for(const r of n){const o=_(a.type,r);!o||t.has(o)||t.set(o,a)}}return t}function Yt(e){const t=new Map;for(const a of e){const n=[a.spec,a.id,a.label];for(const r of n){const o=_(a.type,r);!o||t.has(o)||t.set(o,a)}}return t}function Te(e,t){const a=[e.install.spec,e.slug,e.id];for(const n of a){const r=_(e.type,n);if(!r)continue;const o=t.get(r);if(o)return o}}function Wt(e,t){const a=t.get(_(e.type,e.spec));if(a)return a;const n=t.get(_(e.type,e.id));return n||t.get(_(e.type,e.label))}function Xt(e){const t=e.trim().toLowerCase().replace(/_/g,"-"),a=t.split("-")[0],n=[t,a,"en"];return Array.from(new Set(n.filter(Boolean)))}function Z(e){return e.trim().toLowerCase().replace(/_/g,"-")}function re(e,t,a){var n;if(e){const r=Object.entries(e).map(([o,c])=>({locale:Z(o),text:typeof c=="string"?c.trim():""})).filter(o=>o.text.length>0);if(r.length>0){const o=new Map(r.map(c=>[c.locale,c.text]));for(const c of a){const f=Z(c),i=o.get(f);if(i)return i}for(const c of a){const f=Z(c).split("-")[0];if(!f)continue;const i=r.find(x=>x.locale===f||x.locale.startsWith(`${f}-`));if(i)return i.text}return((n=r[0])==null?void 0:n.text)??""}}return(t==null?void 0:t.trim())??""}function Zt(e,t,a,n){const r=ae(a);if(!r)return!0;const o=re(t==null?void 0:t.summaryI18n,t==null?void 0:t.summary,n);return[e.id,e.spec,e.label,t==null?void 0:t.name,t==null?void 0:t.slug,t==null?void 0:t.summary,o,...(t==null?void 0:t.tags)??[]].map(f=>ae(f)).filter(Boolean).some(f=>f.includes(r))}function ea(e){const t=["bg-amber-600","bg-orange-500","bg-yellow-600","bg-emerald-600","bg-teal-600","bg-cyan-600","bg-stone-600","bg-rose-500","bg-violet-500"];let a=0;for(let n=0;n<e.length;n++)a=e.charCodeAt(n)+((a<<5)-a);return t[Math.abs(a)%t.length]}function ta({name:e,fallback:t}){const a=e||t,n=a.substring(0,2).toUpperCase(),r=ea(a);return s.jsx("div",{className:Ee("flex items-center justify-center w-10 h-10 rounded-xl text-white font-semibold text-sm shrink-0",r),children:n})}function N(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function z(e){var f,i,x,g;const t=((f=e.metadataRaw)==null?void 0:f.trim())||"-",a=((i=e.contentRaw)==null?void 0:i.trim())||"-",n=(x=e.summary)==null?void 0:x.trim(),r=(g=e.description)==null?void 0:g.trim(),o=!!r&&r!==n,c=`<!doctype html>
|
|
1
|
+
import{r as u,j as s,as as Qe,at as Ge,au as Ve,av as Ce,aw as Je,ax as Ye,ay as O,az as Pe,aA as We,aB as Xe,aC as Ze,aD as et,aE as tt,aF as at,aG as nt,ap as je,aq as Ie,ar as Ne,ae as Q,aH as st,aI as rt,aJ as ot}from"./vendor-Dh04PGww.js";import{i as U,c as Ee,t as d,u as lt,j as it,S as ct,a as ut,b as dt,d as pt,e as we}from"./index-BRBYYgR_.js";import{T as mt}from"./tabs-custom-D261E5EA.js";import{P as Re,u as gt}from"./useConfirmDialog-BUKGHDL6.js";import{P as ft,a as xt}from"./page-layout-CUMMO0nN.js";function G(e){return e==="plugin"?"plugins":"skills"}async function ht(e){var o,c;const t=new URLSearchParams,a=G(e.type);(o=e.q)!=null&&o.trim()&&t.set("q",e.q.trim()),(c=e.tag)!=null&&c.trim()&&t.set("tag",e.tag.trim()),e.sort&&t.set("sort",e.sort),typeof e.page=="number"&&Number.isFinite(e.page)&&t.set("page",String(Math.max(1,Math.trunc(e.page)))),typeof e.pageSize=="number"&&Number.isFinite(e.pageSize)&&t.set("pageSize",String(Math.max(1,Math.trunc(e.pageSize))));const n=t.toString(),r=await U.get(n?`/api/marketplace/${a}/items?${n}`:`/api/marketplace/${a}/items`);if(!r.ok)throw new Error(r.error.message);return r.data}async function yt(e){const t=await U.get(`/api/marketplace/skills/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function bt(e){const t=await U.get(`/api/marketplace/plugins/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function kt(e){const t=G(e.type),a=await U.post(`/api/marketplace/${t}/install`,e);if(!a.ok)throw new Error(a.error.message);return a.data}async function vt(e){const t=G(e),a=await U.get(`/api/marketplace/${t}/installed`);if(!a.ok)throw new Error(a.error.message);return a.data}async function wt(e){const t=G(e.type),a=await U.post(`/api/marketplace/${t}/manage`,e);if(!a.ok)throw new Error(a.error.message);return a.data}var[V]=Xe("Tooltip",[Pe]),J=Pe(),Me="TooltipProvider",Tt=700,ee="tooltip.open",[St,ne]=V(Me),Le=e=>{const{__scopeTooltip:t,delayDuration:a=Tt,skipDelayDuration:n=300,disableHoverableContent:r=!1,children:o}=e,c=u.useRef(!0),f=u.useRef(!1),i=u.useRef(0);return u.useEffect(()=>{const x=i.current;return()=>window.clearTimeout(x)},[]),s.jsx(St,{scope:t,isOpenDelayedRef:c,delayDuration:a,onOpen:u.useCallback(()=>{window.clearTimeout(i.current),c.current=!1},[]),onClose:u.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>c.current=!0,n)},[n]),isPointerInTransitRef:f,onPointerInTransitChange:u.useCallback(x=>{f.current=x},[]),disableHoverableContent:r,children:o})};Le.displayName=Me;var q="Tooltip",[Ct,H]=V(q),De=e=>{const{__scopeTooltip:t,children:a,open:n,defaultOpen:r,onOpenChange:o,disableHoverableContent:c,delayDuration:f}=e,i=ne(q,e.__scopeTooltip),x=J(t),[g,h]=u.useState(null),v=Qe(),m=u.useRef(0),w=c??i.disableHoverableContent,S=f??i.delayDuration,P=u.useRef(!1),[I,k]=Ge({prop:n,defaultProp:r??!1,onChange:M=>{M?(i.onOpen(),document.dispatchEvent(new CustomEvent(ee))):i.onClose(),o==null||o(M)},caller:q}),E=u.useMemo(()=>I?P.current?"delayed-open":"instant-open":"closed",[I]),R=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,P.current=!1,k(!0)},[k]),T=u.useCallback(()=>{window.clearTimeout(m.current),m.current=0,k(!1)},[k]),C=u.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{P.current=!0,k(!0),m.current=0},S)},[S,k]);return u.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),s.jsx(Ve,{...x,children:s.jsx(Ct,{scope:t,contentId:v,open:I,stateAttribute:E,trigger:g,onTriggerChange:h,onTriggerEnter:u.useCallback(()=>{i.isOpenDelayedRef.current?C():R()},[i.isOpenDelayedRef,C,R]),onTriggerLeave:u.useCallback(()=>{w?T():(window.clearTimeout(m.current),m.current=0)},[T,w]),onOpen:R,onClose:T,disableHoverableContent:w,children:a})})};De.displayName=q;var te="TooltipTrigger",$e=u.forwardRef((e,t)=>{const{__scopeTooltip:a,...n}=e,r=H(te,a),o=ne(te,a),c=J(a),f=u.useRef(null),i=Ce(t,f,r.onTriggerChange),x=u.useRef(!1),g=u.useRef(!1),h=u.useCallback(()=>x.current=!1,[]);return u.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),s.jsx(Je,{asChild:!0,...c,children:s.jsx(Ye.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...n,ref:i,onPointerMove:O(e.onPointerMove,v=>{v.pointerType!=="touch"&&!g.current&&!o.isPointerInTransitRef.current&&(r.onTriggerEnter(),g.current=!0)}),onPointerLeave:O(e.onPointerLeave,()=>{r.onTriggerLeave(),g.current=!1}),onPointerDown:O(e.onPointerDown,()=>{r.open&&r.onClose(),x.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:O(e.onFocus,()=>{x.current||r.onOpen()}),onBlur:O(e.onBlur,r.onClose),onClick:O(e.onClick,r.onClose)})})});$e.displayName=te;var se="TooltipPortal",[Pt,jt]=V(se,{forceMount:void 0}),Oe=e=>{const{__scopeTooltip:t,forceMount:a,children:n,container:r}=e,o=H(se,t);return s.jsx(Pt,{scope:t,forceMount:a,children:s.jsx(Re,{present:a||o.open,children:s.jsx(We,{asChild:!0,container:r,children:n})})})};Oe.displayName=se;var A="TooltipContent",_e=u.forwardRef((e,t)=>{const a=jt(A,e.__scopeTooltip),{forceMount:n=a.forceMount,side:r="top",...o}=e,c=H(A,e.__scopeTooltip);return s.jsx(Re,{present:n||c.open,children:c.disableHoverableContent?s.jsx(Ae,{side:r,...o,ref:t}):s.jsx(It,{side:r,...o,ref:t})})}),It=u.forwardRef((e,t)=>{const a=H(A,e.__scopeTooltip),n=ne(A,e.__scopeTooltip),r=u.useRef(null),o=Ce(t,r),[c,f]=u.useState(null),{trigger:i,onClose:x}=a,g=r.current,{onPointerInTransitChange:h}=n,v=u.useCallback(()=>{f(null),h(!1)},[h]),m=u.useCallback((w,S)=>{const P=w.currentTarget,I={x:w.clientX,y:w.clientY},k=Lt(I,P.getBoundingClientRect()),E=Dt(I,k),R=$t(S.getBoundingClientRect()),T=_t([...E,...R]);f(T),h(!0)},[h]);return u.useEffect(()=>()=>v(),[v]),u.useEffect(()=>{if(i&&g){const w=P=>m(P,g),S=P=>m(P,i);return i.addEventListener("pointerleave",w),g.addEventListener("pointerleave",S),()=>{i.removeEventListener("pointerleave",w),g.removeEventListener("pointerleave",S)}}},[i,g,m,v]),u.useEffect(()=>{if(c){const w=S=>{const P=S.target,I={x:S.clientX,y:S.clientY},k=(i==null?void 0:i.contains(P))||(g==null?void 0:g.contains(P)),E=!Ot(I,c);k?v():E&&(v(),x())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[i,g,c,x,v]),s.jsx(Ae,{...e,ref:o})}),[Nt,Et]=V(q,{isInside:!1}),Rt=at("TooltipContent"),Ae=u.forwardRef((e,t)=>{const{__scopeTooltip:a,children:n,"aria-label":r,onEscapeKeyDown:o,onPointerDownOutside:c,...f}=e,i=H(A,a),x=J(a),{onClose:g}=i;return u.useEffect(()=>(document.addEventListener(ee,g),()=>document.removeEventListener(ee,g)),[g]),u.useEffect(()=>{if(i.trigger){const h=v=>{const m=v.target;m!=null&&m.contains(i.trigger)&&g()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[i.trigger,g]),s.jsx(Ze,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:c,onFocusOutside:h=>h.preventDefault(),onDismiss:g,children:s.jsxs(et,{"data-state":i.stateAttribute,...x,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Rt,{children:n}),s.jsx(Nt,{scope:a,isInside:!0,children:s.jsx(tt,{id:i.contentId,role:"tooltip",children:r||n})})]})})});_e.displayName=A;var Ue="TooltipArrow",Mt=u.forwardRef((e,t)=>{const{__scopeTooltip:a,...n}=e,r=J(a);return Et(Ue,a).isInside?null:s.jsx(nt,{...r,...n,ref:t})});Mt.displayName=Ue;function Lt(e,t){const a=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(a,n,r,o)){case o:return"left";case r:return"right";case a:return"top";case n:return"bottom";default:throw new Error("unreachable")}}function Dt(e,t,a=5){const n=[];switch(t){case"top":n.push({x:e.x-a,y:e.y+a},{x:e.x+a,y:e.y+a});break;case"bottom":n.push({x:e.x-a,y:e.y-a},{x:e.x+a,y:e.y-a});break;case"left":n.push({x:e.x+a,y:e.y-a},{x:e.x+a,y:e.y+a});break;case"right":n.push({x:e.x-a,y:e.y-a},{x:e.x-a,y:e.y+a});break}return n}function $t(e){const{top:t,right:a,bottom:n,left:r}=e;return[{x:r,y:t},{x:a,y:t},{x:a,y:n},{x:r,y:n}]}function Ot(e,t){const{x:a,y:n}=e;let r=!1;for(let o=0,c=t.length-1;o<t.length;c=o++){const f=t[o],i=t[c],x=f.x,g=f.y,h=i.x,v=i.y;g>n!=v>n&&a<(h-x)*(n-g)/(v-g)+x&&(r=!r)}return r}function _t(e){const t=e.slice();return t.sort((a,n)=>a.x<n.x?-1:a.x>n.x?1:a.y<n.y?-1:a.y>n.y?1:0),At(t)}function At(e){if(e.length<=1)return e.slice();const t=[];for(let n=0;n<e.length;n++){const r=e[n];for(;t.length>=2;){const o=t[t.length-1],c=t[t.length-2];if((o.x-c.x)*(r.y-c.y)>=(o.y-c.y)*(r.x-c.x))t.pop();else break}t.push(r)}t.pop();const a=[];for(let n=e.length-1;n>=0;n--){const r=e[n];for(;a.length>=2;){const o=a[a.length-1],c=a[a.length-2];if((o.x-c.x)*(r.y-c.y)>=(o.y-c.y)*(r.x-c.x))a.pop();else break}a.push(r)}return a.pop(),t.length===1&&a.length===1&&t[0].x===a[0].x&&t[0].y===a[0].y?t:t.concat(a)}var Ut=Le,Ft=De,zt=$e,qt=Oe,Fe=_e;const Ht=Ut,W=Ft,X=zt,B=u.forwardRef(({className:e,sideOffset:t=4,...a},n)=>s.jsx(qt,{children:s.jsx(Fe,{ref:n,sideOffset:t,className:Ee("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));B.displayName=Fe.displayName;function Kt(e){return je({queryKey:["marketplace-items",e],queryFn:()=>ht(e),staleTime:15e3})}function Bt(e){return je({queryKey:["marketplace-installed",e],queryFn:()=>vt(e),staleTime:1e4})}function Qt(){const e=Ie();return Ne({mutationFn:t=>kt(t),onSuccess:t=>{e.invalidateQueries({queryKey:["marketplace-installed",t.type]}),e.refetchQueries({queryKey:["marketplace-installed",t.type],type:"active"}),e.refetchQueries({queryKey:["marketplace-items"],type:"active"});const a=t.type==="plugin"?d("marketplaceInstallSuccessPlugin"):d("marketplaceInstallSuccessSkill");Q.success(t.message||a)},onError:t=>{Q.error(t.message||d("marketplaceInstallFailed"))}})}function Gt(){const e=Ie();return Ne({mutationFn:t=>wt(t),onSuccess:t=>{e.invalidateQueries({queryKey:["marketplace-installed",t.type]}),e.invalidateQueries({queryKey:["marketplace-items"]}),e.refetchQueries({queryKey:["marketplace-installed",t.type],type:"active"}),e.refetchQueries({queryKey:["marketplace-items"],type:"active"});const a=t.action==="enable"?d("marketplaceEnableSuccess"):t.action==="disable"?d("marketplaceDisableSuccess"):d("marketplaceUninstallSuccess");Q.success(t.message||a)},onError:t=>{Q.error(t.message||d("marketplaceOperationFailed"))}})}const Vt=12;function ae(e){return(e??"").trim().toLowerCase()}function _(e,t){const a=ae(t);return a.length>0?`${e}:${a}`:""}function Jt(e){const t=new Map;for(const a of e){const n=[a.install.spec,a.slug,a.id];for(const r of n){const o=_(a.type,r);!o||t.has(o)||t.set(o,a)}}return t}function Yt(e){const t=new Map;for(const a of e){const n=[a.spec,a.id,a.label];for(const r of n){const o=_(a.type,r);!o||t.has(o)||t.set(o,a)}}return t}function Te(e,t){const a=[e.install.spec,e.slug,e.id];for(const n of a){const r=_(e.type,n);if(!r)continue;const o=t.get(r);if(o)return o}}function Wt(e,t){const a=t.get(_(e.type,e.spec));if(a)return a;const n=t.get(_(e.type,e.id));return n||t.get(_(e.type,e.label))}function Xt(e){const t=e.trim().toLowerCase().replace(/_/g,"-"),a=t.split("-")[0],n=[t,a,"en"];return Array.from(new Set(n.filter(Boolean)))}function Z(e){return e.trim().toLowerCase().replace(/_/g,"-")}function re(e,t,a){var n;if(e){const r=Object.entries(e).map(([o,c])=>({locale:Z(o),text:typeof c=="string"?c.trim():""})).filter(o=>o.text.length>0);if(r.length>0){const o=new Map(r.map(c=>[c.locale,c.text]));for(const c of a){const f=Z(c),i=o.get(f);if(i)return i}for(const c of a){const f=Z(c).split("-")[0];if(!f)continue;const i=r.find(x=>x.locale===f||x.locale.startsWith(`${f}-`));if(i)return i.text}return((n=r[0])==null?void 0:n.text)??""}}return(t==null?void 0:t.trim())??""}function Zt(e,t,a,n){const r=ae(a);if(!r)return!0;const o=re(t==null?void 0:t.summaryI18n,t==null?void 0:t.summary,n);return[e.id,e.spec,e.label,t==null?void 0:t.name,t==null?void 0:t.slug,t==null?void 0:t.summary,o,...(t==null?void 0:t.tags)??[]].map(f=>ae(f)).filter(Boolean).some(f=>f.includes(r))}function ea(e){const t=["bg-amber-600","bg-orange-500","bg-yellow-600","bg-emerald-600","bg-teal-600","bg-cyan-600","bg-stone-600","bg-rose-500","bg-violet-500"];let a=0;for(let n=0;n<e.length;n++)a=e.charCodeAt(n)+((a<<5)-a);return t[Math.abs(a)%t.length]}function ta({name:e,fallback:t}){const a=e||t,n=a.substring(0,2).toUpperCase(),r=ea(a);return s.jsx("div",{className:Ee("flex items-center justify-center w-10 h-10 rounded-xl text-white font-semibold text-sm shrink-0",r),children:n})}function N(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function z(e){var f,i,x,g;const t=((f=e.metadataRaw)==null?void 0:f.trim())||"-",a=((i=e.contentRaw)==null?void 0:i.trim())||"-",n=(x=e.summary)==null?void 0:x.trim(),r=(g=e.description)==null?void 0:g.trim(),o=!!r&&r!==n,c=`<!doctype html>
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8" />
|