@usemosio/cli-linux-x64 1.0.0-next.1 → 1.0.0-next.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_NOTICES.md +22 -0
- package/apps/studio/dist/assets/Workspace-Dr-hVeFd.js +34 -0
- package/apps/studio/dist/assets/{agent-panel-CqJuv5Sn.js → agent-panel-DMrVed-J.js} +5 -5
- package/apps/studio/dist/assets/{boundary-bK2S8z05.js → boundary-DL9veUlN.js} +1 -1
- package/apps/studio/dist/assets/{feedback-BqzXUdVd.js → feedback-x6ZumR_x.js} +1 -1
- package/apps/studio/dist/assets/index-C6juWzGV.js +1984 -0
- package/apps/studio/dist/assets/index-CjDBKmB_.css +2 -0
- package/apps/studio/dist/assets/inspector3d-sqergHSP.js +1 -0
- package/apps/studio/dist/index.html +4 -3
- package/apps/studio/dist-host/studio-host.mjs +262 -3
- package/bin/mosio +0 -0
- package/bin/mosio-agent +0 -0
- package/crates/mosio/src/adapters/mosio-three.js +112 -8
- package/crates/mosio/src/adapters/room-env-pmrem.json +1 -0
- package/crates/mosio/src/runtime.js +205 -6
- package/fixtures/camera-inspect/mosio.json +56 -0
- package/fixtures/camera-inspect/scenes/behind.html +22 -0
- package/fixtures/camera-inspect/scenes/cut.html +18 -0
- package/fixtures/camera-inspect/scenes/edges.html +18 -0
- package/fixtures/camera-inspect/scenes/good.html +23 -0
- package/fixtures/camera-inspect/scenes/read.html +22 -0
- package/fixtures/camera-inspect/scenes/shake.html +23 -0
- package/fixtures/camera-inspect/scenes/speed.html +18 -0
- package/fixtures/camera-inspect-vertical/mosio.json +31 -0
- package/fixtures/camera-inspect-vertical/scenes/good.html +20 -0
- package/fixtures/camera-inspect-vertical/scenes/safe.html +18 -0
- package/fixtures/cloudrun-gpu/audio/music.wav +0 -0
- package/fixtures/cloudrun-gpu/audio/vo.wav +0 -0
- package/fixtures/cloudrun-gpu/mosio.json +18 -0
- package/fixtures/cloudrun-gpu/scenes/cube.html +25 -0
- package/fixtures/direct-seek/mosio.json +4 -0
- package/fixtures/direct-seek/scenes/clock.html +9 -0
- package/fixtures/direct-seek/scenes/meta.html +11 -0
- package/fixtures/direct-seek/scenes/pure.html +11 -0
- package/fixtures/direct-seek/scenes/slow.html +11 -0
- package/fixtures/direct-seek-media/mosio.json +6 -0
- package/fixtures/direct-seek-media/scenes/pure.html +11 -0
- package/fixtures/gl-readback/mosio.json +16 -0
- package/fixtures/gl-readback/scenes/compositor.html +23 -0
- package/fixtures/gl-readback/scenes/readback.html +23 -0
- package/fixtures/inspect-physics/expect.json +18 -0
- package/fixtures/inspect-physics/mosio.json +29 -0
- package/fixtures/inspect-physics/scenes/calm.html +46 -0
- package/fixtures/inspect-physics/scenes/physics.html +47 -0
- package/package.json +1 -1
- package/primitives/README.md +23 -2
- package/primitives/example/shared/mosio-prims.js +349 -1
- package/primitives/impact-burst/golden/f030.png +0 -0
- package/primitives/impact-burst/golden/f032.png +0 -0
- package/primitives/impact-burst/golden/f036.png +0 -0
- package/primitives/impact-burst/impact-burst.js +51 -0
- package/primitives/impact-burst/primitive.json +130 -0
- package/primitives/impact-burst/scene.html +24 -0
- package/primitives/stick-figure/golden/f030.png +0 -0
- package/primitives/stick-figure/golden/f092.png +0 -0
- package/primitives/stick-figure/golden/f140.png +0 -0
- package/primitives/stick-figure/primitive.json +179 -0
- package/primitives/stick-figure/scene.html +40 -0
- package/primitives/stick-figure/stick-figure.js +297 -0
- package/primitives/zoom-through/primitive.json +7 -2
- package/primitives/zoom-through/zoom-through.js +6 -5
- package/scripts/3d-acceptance.sh +8 -1
- package/scripts/3d-attach-bench.mjs +119 -0
- package/scripts/3d-bake-room-env.mjs +74 -0
- package/scripts/3d-e2b-job.sh +1 -0
- package/scripts/3d-gen-heavy-fixture.py +65 -0
- package/scripts/3d-trace-summary.py +14 -0
- package/scripts/acceptance/camera-inspect.sh +49 -0
- package/scripts/acceptance/direct-seek.sh +68 -0
- package/scripts/acceptance/export.sh +5 -3
- package/scripts/acceptance/frames.sh +7 -2
- package/scripts/acceptance/hardening.sh +37 -6
- package/scripts/acceptance/hub.sh +208 -0
- package/scripts/acceptance/inspect.sh +21 -2
- package/scripts/acceptance/revisions-git.sh +137 -0
- package/scripts/acceptance/revisions-sync.sh +323 -0
- package/scripts/acceptance/revisions.sh +118 -4
- package/scripts/acceptance/segcache.sh +100 -0
- package/scripts/acceptance/split.sh +78 -0
- package/scripts/bootstrap.sh +20 -1
- package/scripts/check-error-codes.py +9 -1
- package/scripts/check-file-size.sh +45 -0
- package/scripts/ci.sh +4 -4
- package/scripts/dedupe-report.sh +47 -0
- package/scripts/e2b/template/provision.sh +1 -1
- package/scripts/fastpath/cdp.mjs +25 -0
- package/scripts/fastpath/dbg.mjs +11 -0
- package/scripts/fastpath/e2b.mjs +40 -0
- package/scripts/fastpath/features/gen.py +109 -0
- package/scripts/fastpath/features/mosio.json +100 -0
- package/scripts/fastpath/features/scenes/backdrop.html +11 -0
- package/scripts/fastpath/features/scenes/blend.html +11 -0
- package/scripts/fastpath/features/scenes/canvas2d.html +11 -0
- package/scripts/fastpath/features/scenes/filter.html +11 -0
- package/scripts/fastpath/features/scenes/gradient.html +11 -0
- package/scripts/fastpath/features/scenes/iframe.html +11 -0
- package/scripts/fastpath/features/scenes/image.html +11 -0
- package/scripts/fastpath/features/scenes/svg.html +11 -0
- package/scripts/fastpath/features/scenes/text.html +11 -0
- package/scripts/fastpath/features/scenes/typo.html +11 -0
- package/scripts/fastpath/features/scenes/video.html +11 -0
- package/scripts/fastpath/features/scenes/video2.html +11 -0
- package/scripts/fastpath/features-xfade/mosio.json +49 -0
- package/scripts/fastpath/features-xfade/scenes/image.html +11 -0
- package/scripts/fastpath/features-xfade/scenes/video.html +11 -0
- package/scripts/fastpath/fixtures/gen_layout.py +80 -0
- package/scripts/fastpath/fixtures/l12-no-reset/assets/img/photo-1015.jpg +0 -0
- package/scripts/fastpath/fixtures/l12-no-reset/mosio.json +34 -0
- package/scripts/fastpath/fixtures/l12-no-reset/scenes/main.html +20 -0
- package/scripts/fastpath/fp.mjs +91 -0
- package/scripts/fastpath/inpage.js +68 -0
- package/scripts/fastpath/recipes.py +49 -0
- package/scripts/fastpath/sandbox.sh +68 -0
- package/scripts/fastpath/sandbox10.sh +57 -0
- package/scripts/fastpath/sandbox11.sh +18 -0
- package/scripts/fastpath/sandbox12.sh +30 -0
- package/scripts/fastpath/sandbox13.sh +16 -0
- package/scripts/fastpath/sandbox14.sh +28 -0
- package/scripts/fastpath/sandbox15.sh +36 -0
- package/scripts/fastpath/sandbox16.sh +60 -0
- package/scripts/fastpath/sandbox17.sh +34 -0
- package/scripts/fastpath/sandbox18.sh +59 -0
- package/scripts/fastpath/sandbox19.sh +67 -0
- package/scripts/fastpath/sandbox2.sh +41 -0
- package/scripts/fastpath/sandbox20.sh +34 -0
- package/scripts/fastpath/sandbox21.sh +22 -0
- package/scripts/fastpath/sandbox22.sh +22 -0
- package/scripts/fastpath/sandbox23.sh +21 -0
- package/scripts/fastpath/sandbox3.sh +151 -0
- package/scripts/fastpath/sandbox4.sh +161 -0
- package/scripts/fastpath/sandbox5.sh +69 -0
- package/scripts/fastpath/sandbox6.sh +85 -0
- package/scripts/fastpath/sandbox7.sh +81 -0
- package/scripts/fastpath/sandbox8.sh +62 -0
- package/scripts/fastpath/sandbox9.sh +130 -0
- package/scripts/fastpath/srv.mjs +15 -0
- package/scripts/fastpath/www/probe.html +1 -0
- package/scripts/gen-media-fixtures.sh +1 -0
- package/scripts/gl-readback-check.sh +26 -0
- package/scripts/hpbench/make-bench-fixtures.sh +43 -0
- package/scripts/hpbench/render-cgroup.sh +56 -0
- package/scripts/install.sh +2 -1
- package/scripts/npm-clean-install-proof-win.sh +64 -0
- package/scripts/platform-smoke.sh +80 -0
- package/scripts/prim.mjs +31 -13
- package/scripts/user-journey.sh +68 -0
- package/skills/mosio-3d/SKILL.md +31 -3
- package/skills/mosio-brief/SKILL.md +80 -0
- package/skills/mosio-brief/references/brief.md +141 -0
- package/skills/mosio-brief/references/copy.md +99 -0
- package/skills/mosio-brief/references/narration.md +61 -0
- package/skills/mosio-brief/references/storyboard.md +98 -0
- package/skills/mosio-collab/SKILL.md +104 -0
- package/skills/mosio-collab/references/hub.md +62 -0
- package/skills/mosio-engine/SKILL.md +44 -13
- package/skills/mosio-engine/references/camera.md +12 -2
- package/skills/mosio-engine/references/character.md +88 -0
- package/skills/mosio-engine/references/checks.md +11 -4
- package/skills/mosio-engine/references/delivery.md +29 -2
- package/skills/mosio-engine/references/kit-primitives.md +8 -4
- package/skills/mosio-engine/references/layout.md +8 -0
- package/skills/mosio-engine/references/plan.md +3 -1
- package/skills/mosio-engine/references/project.md +15 -3
- package/skills/mosio-engine/references/publish.md +79 -0
- package/skills/mosio-engine/references/registry.md +27 -15
- package/skills/mosio-engine/references/timeline.md +19 -1
- package/skills/mosio-engine/references/timing.md +2 -1
- package/skills/mosio-import/SKILL.md +1 -1
- package/skills/mosio-import/references/from-hyperframes.md +1 -1
- package/skills/mosio-import/references/from-remotion.md +1 -1
- package/skills/mosio-media/SKILL.md +16 -4
- package/skills/mosio-media/references/audio.md +29 -11
- package/skills/mosio-media/references/captions.md +26 -5
- package/skills/mosio-media/references/editing.md +70 -0
- package/skills/mosio-media/references/footage.md +40 -8
- package/skills/mosio-media/references/voice.md +52 -7
- package/skills/mosio-replicate/references/mosio.md +1 -1
- package/toolchain.lock.json +151 -4
- package/apps/studio/dist/assets/Workspace-KSOFeEgc.js +0 -32
- package/apps/studio/dist/assets/index-B-uuTqe9.js +0 -1785
- package/apps/studio/dist/assets/index-CajSh04l.css +0 -2
- package/apps/studio/dist/assets/inspector3d-vDz97X99.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`):void 0}function j(e,t){if(t.turn_id){let n=e.turns.find(e=>e.id===t.turn_id);return n||(n={id:t.turn_id,user:null,items:[],tools:[],plan:null,startedMs:t.ts_ms},e.turns.push(n)),n}return e.turns[e.turns.length-1]??null}function M(e){return{...e,items:[...e.items],tools:[...e.tools]}}function te(e,t){if(t.session_id!==e.sessionId||t.seq<=e.lastSeq)return e;if(t.seq!==e.lastSeq+1&&e.lastSeq!==0)return{...e,gap:!0};let n={...e,lastSeq:t.seq,gap:!1,turns:e.turns.map(n=>n.id===t.turn_id||n===e.turns[e.turns.length-1]?M(n):n),proposals:e.proposals,artifacts:e.artifacts,permissions:e.permissions},r=t.data;switch(t.kind){case`session.state`:n.state=O(r.state,n.state);break;case`provider.ready`:{let e=r.capabilities??{};n.provider={name:O(e.agent_name,O(r.provider)),title:O(e.agent_title)||void 0,version:O(e.agent_version)||void 0,capabilities:e};break}case`context.updated`:n.contextChips=A(r.context??r.chips);break;case`turn.started`:{let e=j(n,t);e&&(e.user={text:O(r.text),chips:A(r.context),tsMs:t.ts_ms},e.startedMs=t.ts_ms),n.lastError=null;break}case`message.chunk`:{let e=j(n,t),i=r.role===`thought`?`thought`:r.role===`agent`?`agent`:null,a=O(r.text);if(!e||!i||!a)break;let o=e.items[e.items.length-1];o&&o.type===`text`&&o.role===i&&!e.sealed?e.items[e.items.length-1]={...o,text:o.text+a}:e.items.push({type:`text`,role:i,text:a}),e.sealed=!1;break}case`tool.call`:case`tool.update`:{let e=j(n,t),i=O(r.toolCallId);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i&&e.source===`agent`),o=a>=0?e.tools[a]:void 0,s=O(r.status,o?.status??`pending`),c={id:i,source:`agent`,title:O(r.title,o?.title??i),kind:O(r.kind,o?.kind??`other`),status:s,text:ee(r.content)??o?.text,locations:A(r.locations).map(e=>O(e.path)).filter(Boolean),startedMs:o?.startedMs??t.ts_ms,endedMs:s===`completed`||s===`failed`?t.ts_ms:o?.endedMs};c.locations?.length||(c.locations=o?.locations),a>=0?e.tools[a]=c:(e.tools.push(c),e.sealed=!0);break}case`mosio.tool.started`:case`mosio.tool.finished`:{let e=j(n,t),i=O(r.call_id);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i),o=r.ok!==!1,s=a>=0?{...e.tools[a],status:t.kind===`mosio.tool.finished`?o?`completed`:`failed`:`in_progress`,endedMs:t.kind===`mosio.tool.finished`?t.ts_ms:void 0,text:o?e.tools[a].text:O(r.error?.message)}:{id:i,source:`mosio`,tool:O(r.tool),title:O(r.tool).replace(/_/g,` `),kind:`other`,status:`in_progress`,startedMs:t.ts_ms};a>=0?e.tools[a]=s:e.tools.push(s);break}case`plan`:{let e=j(n,t);e&&Array.isArray(r.entries)&&(e.plan=A(r.entries));break}case`usage`:n.usage={used:k(r.used),size:k(r.size),cost:r.cost??null};break;case`permission.requested`:{let e=O(r.request_id);if(!e)break;n.permissions={...n.permissions,[e]:{requestId:e,source:O(r.source),class:O(r.class),key:O(r.key),details:r.details??{},options:A(r.options),requestedAtMs:k(r.requested_at_ms)??t.ts_ms,expiresAtMs:k(r.expires_at_ms)??t.ts_ms}},j(n,t)?.items.push({type:`permission`,requestId:e});break}case`permission.resolved`:{let e=O(r.request_id);if(e&&n.permissions[e])n.permissions={...n.permissions,[e]:{...n.permissions[e],outcome:O(r.outcome),by:O(r.by)}};else if(!e&&r.outcome===`denied`&&r.by===`policy`){let e=O(r.class,`action`).replace(/_/g,` `);j(n,t)?.items.push({type:`notice`,level:`warning`,text:`Mosio blocked a ${e} request (policy: never allowed).`})}break}case`proposal.created`:case`proposal.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.proposals[e.id];n.proposals={...n.proposals,[e.id]:e},i&&j(n,t)?.items.push({type:`proposal`,id:e.id});break}case`artifact.created`:case`artifact.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.artifacts[e.id];n.artifacts={...n.artifacts,[e.id]:e},i&&j(n,t)?.items.push({type:`artifact`,id:e.id});break}case`error`:{let e=r;n.lastError=e,j(n,t)?.items.push({type:`error`,error:e});break}case`notice`:{let e={level:O(r.level,`info`),text:O(r.text,O(r.message))};e.text&&(n.notices=[...n.notices,e].slice(-20),j(n,t)?.items.push({type:`notice`,...e}));break}case`provider.exited`:{let e={level:`warning`,text:O(r.reason,`The agent process stopped.`)};n.notices=[...n.notices,e].slice(-20);break}case`turn.ended`:{let e=j(n,t);e&&(e.endedMs=t.ts_ms,e.stopReason=O(r.stop_reason),r.usage&&typeof r.usage==`object`&&(e.usage=r.usage));break}}return n}function ne(e){let t={...e,tools:ie(e)};if(!t.tools.length)return null;let n=t.tools.filter(e=>e.kind===`read`||e.kind===`search`||/^(get|list|inspect|render_preview|plan|compare)/.test(e.tool??``)).length,r=t.tools.filter(e=>e.kind===`edit`||/^(propose|apply|create|update)/.test(e.tool??``)).length,i=t.tools.filter(e=>e.status===`failed`).length,a=[];n&&a.push(`Read ${n} ${n===1?`item`:`items`}`),r&&a.push(`${r} ${r===1?`change`:`changes`}`),!n&&!r&&a.push(`${t.tools.length} ${t.tools.length===1?`step`:`steps`}`),i&&a.push(`${i} failed`);let o=((t.endedMs??Math.max(...t.tools.map(e=>e.endedMs??e.startedMs)))-t.startedMs)/1e3;return o>0&&a.push(`${o.toFixed(1)} s`),a.join(` · `)}function re(e){let t=Object.values(e.permissions).some(e=>!e.outcome),n=Object.values(e.proposals).some(e=>e.status===`pending`||e.status===`conflict`);switch(e.state){case`starting`:return{text:`Starting`,tone:`muted`};case`running`:return{text:`Working`,tone:`blue`};case`awaiting_permission`:return{text:`Needs approval`,tone:`amber`};case`cancelling`:return{text:`Stopping`,tone:`muted`};case`interrupted`:return{text:`Interrupted`,tone:`red`};case`failed`:return{text:`Failed`,tone:`red`};case`closed`:return{text:`Closed`,tone:`muted`};default:return t?{text:`Needs approval`,tone:`amber`}:n?{text:`In review`,tone:`amber`}:{text:`Your turn`,tone:`blue`}}}function ie(e){let t=e.tools.filter(e=>e.source===`agent`);return t.length?t:e.tools}var ae=class extends Error{code;retryable;fix;details;status;constructor(e,t=0){super(e.message),this.code=e.code,this.retryable=e.retryable,this.fix=e.fix,this.details=e.details,this.status=t}};function oe(){let e=globalThis.crypto;return e&&`randomUUID`in e?`m_${e.randomUUID().replace(/-/g,``).slice(0,24)}`:`m_${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}var se=class{kind=`http`;base;token;f;WS;backoff;constructor(e){this.base=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.f=e.fetch??globalThis.fetch.bind(globalThis),this.WS=e.WebSocket??globalThis.WebSocket,this.backoff=e.backoff??[250,5e3]}async req(e,t,n){let r=await this.f(`${this.base}${t}`,{method:e,headers:{Authorization:`Bearer ${this.token}`,...n===void 0?{}:{"Content-Type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new ae(i.error??{code:`E_TRANSPORT`,message:`HTTP ${r.status}`,retryable:r.status>=500},r.status);return i}async providers(){return(await this.req(`GET`,`/api/providers`)).providers}async listSessions(){return(await this.req(`GET`,`/api/sessions`)).sessions}async createSession(e,t){return(await this.req(`POST`,`/api/sessions`,{provider:e,title:t})).session}async getSession(e){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}`)).session}async forkSession(e,t){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/fork`,{at_seq:t})).session}async events(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/events?since=${t}`)).events.map(T).filter(e=>e!==null)}async prompt(e,t,n,r=oe()){return this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/prompt`,{text:t,context:n,client_msg_id:r})}async cancel(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/cancel`)).cancelled}async setContext(e,t){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/context`,t)}async answerPermission(e,t,n){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,{option_id:n})}async rebase(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/rebase`)).base_revision}async decideProposal(e,t,n){return(await this.req(`POST`,`/api/proposals/${encodeURIComponent(e)}/${t}`,n?{proposal_digest:n}:void 0)).proposal}async editArtifact(e,t,n,r){return(await this.req(`PUT`,`/api/artifacts/${encodeURIComponent(e)}`,{base_version:t,data:n,note:r})).artifact}async decideArtifact(e,t,n={}){return(await this.req(`POST`,`/api/artifacts/${encodeURIComponent(e)}/${t}`,n)).artifact}async protocol(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/protocol?offset=${t}`)).messages}mediaUrl(e){return`${this.base}/api/files?path=${encodeURIComponent(e)}&token=${encodeURIComponent(this.token)}`}subscribe(e,t,n,r){let i=t,a=!1,o=null,s=0,c=null,l=t=>{t.seq<=i||(t.seq===i+1?(i=t.seq,n(t)):this.events(e,i).then(e=>e.forEach(l)))},u=()=>{if(a)return;r?.(s===0?`connecting`:`reconnecting`);let t=`${this.base.replace(/^http/,`ws`)}/api/sessions/${encodeURIComponent(e)}/stream?since=${i}&token=${encodeURIComponent(this.token)}`;o=new this.WS(t),o.onopen=()=>{s=0,r?.(`open`)},o.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}let n=T(t);n&&l(n)},o.onclose=()=>{if(o=null,a)return;s+=1;let[e,t]=this.backoff;c=setTimeout(u,Math.min(t,e*2**Math.min(s,6))),r?.(`reconnecting`)},o.onerror=()=>o?.close()};return u(),{close:()=>{a=!0,c&&clearTimeout(c),o?.close(),r?.(`closed`)}}}},N=l(a(),1);function P(...e){return o(c(e))}function ce(e,t){return t.type===`reset`?D(t.id):te(e,t.e)}function le(e,t){let[n,r]=(0,N.useReducer)(ce,D(t??``)),[i,a]=(0,N.useState)(`connecting`),[o,s]=(0,N.useState)(null),c=(0,N.useRef)(0);c.current=n.lastSeq,(0,N.useEffect)(()=>{if(!t)return;r({type:`reset`,id:t});let n=e.subscribe(t,0,e=>r({type:`event`,e}),a);return()=>n.close()},[e,t]);let l=(0,N.useCallback)(async e=>{try{s(null),await e()}catch(e){s(e instanceof ae?e:new ae({code:`E_TRANSPORT`,message:String(e),retryable:!0}))}},[]);return{thread:n,connection:i,busy:[`starting`,`running`,`awaiting_permission`,`cancelling`].includes(n.state),error:o,send:(n,r)=>l(()=>e.prompt(t,n,r,oe())),cancel:()=>l(()=>e.cancel(t)),answerPermission:(n,r)=>l(()=>e.answerPermission(t,n,r)),clearError:()=>s(null)}}function ue(e,t=0){let[n,r]=(0,N.useState)([]),i=(0,N.useCallback)(()=>e.listSessions().then(r).catch(()=>r([])),[e]);return(0,N.useEffect)(()=>{i()},[i,t]),{sessions:n,reload:i}}var F=i(),I={stroke:`currentColor`,fill:`none`,strokeWidth:2,viewBox:`0 0 24 24`,strokeLinecap:`round`,strokeLinejoin:`round`,width:`100%`,height:`100%`,"aria-hidden":!0},de=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`16 18 22 12 16 6`}),(0,F.jsx)(`polyline`,{points:`8 6 2 12 8 18`})]}),fe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),pe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),me=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`11 17 6 12 11 7`}),(0,F.jsx)(`polyline`,{points:`18 17 13 12 18 7`})]}),he=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`5`}),(0,F.jsx)(`polyline`,{points:`5 12 12 5 19 12`})]}),ge=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),(0,F.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,F.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),_e=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,F.jsx)(`line`,{x1:`3`,y1:`9`,x2:`21`,y2:`9`}),(0,F.jsx)(`line`,{x1:`9`,y1:`21`,x2:`9`,y2:`9`})]}),ve=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,ry:`2`,fill:`currentColor`,stroke:`none`})}),ye=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),be=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,F.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),xe=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,F.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),Se=b(`inline-flex h-[30px] shrink-0 items-center justify-center rounded-lg font-sans text-xs leading-normal whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent-blue-edge disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{primary:`bg-accent-blue px-3 font-semibold text-text-on-accent hover:brightness-110`,outline:`border border-border-strong px-3 font-medium text-text-primary hover:bg-surface-hover`,ghost:`px-2.5 font-normal text-text-secondary hover:text-text-primary`}},defaultVariants:{variant:`primary`}});function L({variant:e,className:t,...n}){return(0,F.jsx)(`button`,{type:`button`,className:P(Se({variant:e}),t),...n})}var Ce={blue:`border-accent-blue-edge`,amber:`border-accent-amber-edge`,strong:`border-border-strong`};function we({tone:e=`strong`,className:t,...n}){return(0,F.jsx)(`div`,{className:P(`flex min-h-0 min-w-0 flex-col overflow-clip rounded-xl border bg-surface-card`,Ce[e],t),...n})}function Te({title:e,kind:t,lead:n,className:r}){return(0,F.jsxs)(`div`,{className:P(`flex h-[38px] shrink-0 items-center gap-2 border-b border-border-default px-3`,r),children:[n,(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-[13px] font-medium leading-normal text-text-primary`,children:e}),t!=null&&(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal text-accent-blue-text`,children:t})]})}function Ee({className:e,...t}){return(0,F.jsx)(`div`,{className:P(`flex flex-wrap items-center gap-2 px-2.5 pt-0 pb-2.5`,e),...t})}function De({tone:e}){let t={blue:`bg-accent-blue`,amber:`bg-accent-amber`,muted:`bg-text-secondary`,red:`bg-accent-amber`}[e];return(0,F.jsx)(`span`,{"aria-hidden":!0,className:P(`block size-1.5 shrink-0 rounded-full`,t)})}function Oe({label:e,onRemove:t}){return(0,F.jsxs)(`span`,{className:`flex h-[22px] max-w-full items-center gap-1 rounded-md bg-accent-blue-glow px-2`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[11px] leading-normal text-accent-blue-text`,children:e}),t&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:t,className:`font-sans text-[11px] leading-none text-accent-blue-text/70 hover:text-accent-blue-text`,children:`×`})]})}function ke({children:e,...t}){return(0,F.jsx)(`button`,{type:`button`,className:`flex h-7 items-center rounded-full border border-border-strong px-2.5 font-sans text-xs leading-normal text-text-primary hover:bg-surface-hover`,...t,children:e})}var Ae={brief:`Brief`,creative_direction:`Direction`,script:`Script`,storyboard:`Storyboard`,reference_analysis:`Reference`,styleframes:`Styleframes`,asset_plan:`Assets`,scene_alternatives:`Refinement`,revision_proposal:`Proposal`,render_report:`Render`};function je({a:e}){return e.status===`approved`?(0,F.jsxs)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:[`Approved v`,e.approved_version]}):e.status===`rejected`?(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Rejected`}):(0,F.jsx)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:Ae[e.kind]??e.kind})}function Me({src:e,alt:t,selected:n,height:r,letter:i,onClick:a}){return(0,F.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":n,"aria-label":t,className:P(`relative block w-full min-w-0 overflow-clip rounded-md bg-scene-ground`,r,n?`shadow-[0px_0px_0px_2px_var(--color-accent-blue)]`:`shadow-[0px_0px_0px_1px_var(--color-border-strong)]`),children:[e?(0,F.jsx)(`img`,{src:e,alt:``,className:`absolute inset-0 size-full object-cover`,loading:`lazy`,draggable:!1}):(0,F.jsx)(`span`,{className:`mosio-agent-hatch absolute inset-0 block`}),i&&(0,F.jsx)(`span`,{className:P(`absolute top-[5px] left-[5px] flex size-4 items-center justify-center rounded-full`,n?`bg-accent-blue`:`bg-surface-card`),children:(0,F.jsx)(`span`,{className:`font-sans text-[10px] leading-normal font-semibold text-text-on-accent`,children:i})})]})}function Ne({artifact:e,actions:t,mediaUrl:n}){let r=e.data,i=Array.isArray(r.options)?r.options:[],[a,o]=(0,N.useState)(null),s=a??e.selected??i[0]?.id??null,c=!/caption|placement|refine/i.test(e.title)&&i.every(e=>e.label.length<18),l=!c,u=i.find(e=>e.id===s),d=e.status===`approved`;return(0,F.jsxs)(we,{tone:c?`strong`:`blue`,"data-testid":`artifact-scene-alternatives`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:d?(0,F.jsx)(je,{a:e}):c?`Asset`:`Refinement`}),(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:i.map((r,i)=>{let a=r.id===s;return(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.label,selected:a,height:c?`h-24`:`h-[150px]`,letter:l?String.fromCharCode(65+i):void 0,onClick:d?void 0:()=>{o(r.id),t.onSelectOption(e.id,r.id)}}),(0,F.jsx)(`span`,{className:P(`block font-sans text-xs leading-[1.3]`,a?`font-medium text-text-primary`:`text-text-secondary`),children:r.label})]},r.id)})}),!d&&u&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:l?`Apply ${String.fromCharCode(65+i.indexOf(u))}`:`Use ${u.label.toLowerCase()}`}),t.onPreviewOption&&(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onPreviewOption(e,u.id),children:`Preview in player`})]})]})}function Pe({title:e,meta:t,onOpen:n}){return(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-11 w-full items-center gap-2.5 rounded-xl border border-accent-blue-edge bg-accent-blue-glow px-3 text-left hover:brightness-125`,children:[(0,F.jsx)(`span`,{className:`block size-[15px] shrink-0 text-accent-blue-text`,children:(0,F.jsx)(_e,{})}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[13px] leading-normal font-medium text-text-primary`,children:e}),(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs leading-normal text-text-secondary`,children:t})]})]})}function Fe({artifact:e,actions:t,mediaUrl:n}){let r=e.data.frames??[],i=r.reduce((e,t)=>e+(t.duration_s??0),0),a=e.status!==`proposed`&&e.status!==`draft`;return t.onOpenArtifact?(0,F.jsx)(`div`,{"data-testid":`artifact-storyboard`,"data-status":e.status,children:(0,F.jsx)(Pe,{title:e.title,meta:`Open in workspace · ${r.length} frames${i?` · ${i.toFixed(1)} s`:``}${e.status===`approved`?` · approved`:e.status===`rejected`?` · changes requested`:` · v${e.version}`}`,onOpen:()=>t.onOpenArtifact(e)})}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`artifact-storyboard`,"data-status":e.status,children:[(0,F.jsx)(Pe,{title:e.title,meta:`${r.length} frames${i?` · ${i.toFixed(1)} s`:``} · v${e.version}${e.status===`approved`?` · approved`:``}`}),(0,F.jsxs)(we,{tone:`strong`,children:[(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:r.map((r,i)=>(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.title,selected:e.selected===r.id,height:`h-24`,onClick:()=>t.onSelectOption(e.id,r.id)}),(0,F.jsxs)(`span`,{className:`block truncate font-sans text-xs leading-normal font-medium text-text-primary`,children:[i+1,`. `,r.title]})]},r.id))}),!a&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve storyboard`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Request changes`})]})]})]})}function Ie({k:e,v:t}){return t==null||t===``||Array.isArray(t)&&t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-3`,children:[(0,F.jsx)(`span`,{className:`font-sans text-[11px] text-text-secondary`,children:e}),(0,F.jsx)(`span`,{className:`font-sans text-xs leading-[1.4] break-words whitespace-pre-wrap text-text-primary`,children:Array.isArray(t)?t.join(` · `):typeof t==`object`?JSON.stringify(t):String(t)})]})}function Le({a:e}){let t=e.data;switch(e.kind){case`brief`:{let e=t,n=e.format;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Goal`,v:e.goal}),(0,F.jsx)(Ie,{k:`Audience`,v:e.audience}),(0,F.jsx)(Ie,{k:`Message`,v:e.message}),(0,F.jsx)(Ie,{k:`Call to action`,v:e.call_to_action}),(0,F.jsx)(Ie,{k:`Tone`,v:e.tone}),(0,F.jsx)(Ie,{k:`Format`,v:n?[n.width&&n.height?`${n.width}×${n.height}`:null,n.fps?`${n.fps} fps`:null,n.duration_s?`${n.duration_s} s`:null].filter(Boolean):null})]})}case`creative_direction`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Direction`,v:t.summary}),Array.isArray(t.palette)&&(0,F.jsx)(`div`,{className:`flex gap-1 px-3`,children:t.palette.map(e=>(0,F.jsx)(`span`,{title:e,className:`block size-5 rounded-md border border-border-strong`,style:{background:/^#[0-9a-fA-F]{3,8}$/.test(e)?e:`transparent`}},e))}),(0,F.jsx)(Ie,{k:`Motion`,v:t.motion})]});case`script`:return(0,F.jsx)(`ol`,{className:`flex flex-col gap-1 px-3`,children:(t.beats??[]).map((e,t)=>(0,F.jsxs)(`li`,{className:`font-sans text-xs leading-[1.4] text-text-primary`,children:[(0,F.jsxs)(`span`,{className:`text-text-secondary`,children:[t+1,`.`]}),` `,e.on_screen,e.voiceover&&(0,F.jsxs)(`span`,{className:`block text-text-secondary`,children:[`VO: `,e.voiceover]})]},e.id))});case`asset_plan`:return(0,F.jsx)(`div`,{className:`flex flex-col`,children:(t.assets??[]).map(e=>(0,F.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:`flex-1 truncate font-sans text-xs text-text-primary`,children:e.description}),(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:e.status})]},e.id))});default:return(0,F.jsx)(F.Fragment,{children:Object.entries(t).slice(0,8).map(([e,t])=>(0,F.jsx)(Ie,{k:e.replace(/_/g,` `),v:t},e))})}}function Re({artifact:e,actions:t}){let n=e.status===`proposed`||e.status===`draft`;return(0,F.jsxs)(we,{tone:n?`blue`:`strong`,"data-testid":`artifact-${e.kind}`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:(0,F.jsx)(je,{a:e})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-2 py-2.5`,children:(0,F.jsx)(Le,{a:e})}),n&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve`}),t.onOpenArtifact&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>t.onOpenArtifact(e),children:`Edit`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Reject`})]})]})}function ze({artifact:e,actions:t,mediaUrl:n}){switch(e.kind){case`scene_alternatives`:case`styleframes`:if(e.kind===`styleframes`){let r=(e.data.frames??[]).map(e=>({id:e.id,label:e.title,image:e.image}));return(0,F.jsx)(Ne,{artifact:{...e,data:{question:e.title,options:r}},actions:t,mediaUrl:n})}return(0,F.jsx)(Ne,{artifact:e,actions:t,mediaUrl:n});case`storyboard`:return(0,F.jsx)(Fe,{artifact:e,actions:t,mediaUrl:n});default:return(0,F.jsx)(Re,{artifact:e,actions:t})}}function Be(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,He=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ue={};function We(e,t){return((t||Ue).jsx?He:Ve).test(e)}var Ge=/[ \t\n\f\r]/g;function Ke(e){return typeof e==`object`?e.type===`text`&&qe(e.value):qe(e)}function qe(e){return e.replace(Ge,``)===``}var Je=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Je.prototype.normal={},Je.prototype.property={},Je.prototype.space=void 0;function Ye(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Je(n,r,t)}function Xe(e){return e.toLowerCase()}var R=class{constructor(e,t){this.attribute=t,this.property=e}};R.prototype.attribute=``,R.prototype.booleanish=!1,R.prototype.boolean=!1,R.prototype.commaOrSpaceSeparated=!1,R.prototype.commaSeparated=!1,R.prototype.defined=!1,R.prototype.mustUseProperty=!1,R.prototype.number=!1,R.prototype.overloadedBoolean=!1,R.prototype.property=``,R.prototype.spaceSeparated=!1,R.prototype.space=void 0;var Ze=s({boolean:()=>z,booleanish:()=>B,commaOrSpaceSeparated:()=>U,commaSeparated:()=>et,number:()=>V,overloadedBoolean:()=>$e,spaceSeparated:()=>H}),Qe=0,z=tt(),B=tt(),$e=tt(),V=tt(),H=tt(),et=tt(),U=tt();function tt(){return 2**++Qe}var nt=Object.keys(Ze),rt=class extends R{constructor(e,t,n,r){let i=-1;if(super(e,t),it(this,`space`,r),typeof n==`number`)for(;++i<nt.length;){let e=nt[i];it(this,nt[i],(n&Ze[e])===Ze[e])}}};rt.prototype.defined=!0;function it(e,t,n){n&&(e[t]=n)}function at(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new rt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xe(r)]=r,n[Xe(a.attribute)]=r}return new Je(t,n,e.space)}var ot=at({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:B,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:H,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:V,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:H,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:B,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function st(e,t){return t in e?e[t]:t}function ct(e,t){return st(e,t.toLowerCase())}var lt=at({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:et,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:H,autoFocus:z,autoPlay:z,blocking:H,capture:null,charSet:null,checked:z,cite:null,className:H,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:B,controls:z,controlsList:H,coords:V|et,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:$e,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:H,height:V,hidden:$e,high:V,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:H,itemRef:H,itemScope:z,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,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:z,optimum:V,pattern:null,ping:H,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:H,required:z,reversed:z,rows:V,rowSpan:V,sandbox:H,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:B,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:et,part:H,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:ct}),ut=at({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`,maskType:`mask-type`,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:U,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:H,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:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,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:et,g2:et,glyphName:et,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:U,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,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:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U,rev:U,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U,requiredFeatures:U,requiredFonts:U,requiredFormats:U,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:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:U,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:st}),dt=at({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()}}),ft=at({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ct}),pt=at({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),mt={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`},ht=/[A-Z]/g,gt=/-[a-z]/g,_t=/^data[-\w.:]+$/i;function vt(e,t){let n=Xe(t),r=t,i=R;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_t.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(gt,bt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!gt.test(e)){let n=e.replace(ht,yt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=rt}return new i(r,t)}function yt(e){return`-`+e.toLowerCase()}function bt(e){return e.charAt(1).toUpperCase()}var xt=Ye([ot,lt,dt,ft,pt],`html`),St=Ye([ot,ut,dt,ft,pt],`svg`);function Ct(e){return e.join(` `).trim()}var wt=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Tt=/\n/g,Et=/^\s*/,Dt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ot=/^:\s*/,kt=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,At=/^[;\s]*/,jt=`
|
|
3
|
-
`,Mt=`/`,Nt=`*`,Pt=``,Ft=`comment`,It=`declaration`;function Lt(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Tt);t&&(n+=t.length);var i=e.lastIndexOf(jt);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Et)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Mt==e.charAt(0)&&Nt==e.charAt(1)){for(var n=2;Pt!=e.charAt(n)&&(Nt!=e.charAt(n)||Mt!=e.charAt(n+1));)++n;if(n+=2,Pt===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Ft,comment:o})}}function f(){var e=a(),t=c(Dt);if(t){if(d(),!c(Ot))return s(`property missing ':'`);var n=c(kt),r=e({type:It,property:t[0].replace(wt,Pt).trim(),value:n?n[0].replace(wt,Pt).trim():Pt});return c(At),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function Rt(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Lt(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var zt=Vt(`end`),Bt=Vt(`start`);function Vt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ht(e){let t=Bt(e),n=zt(e);if(t&&n)return{start:t,end:n}}function Ut(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gt(e.position):`start`in e||`end`in e?Gt(e):`line`in e||`column`in e?Wt(e):``}function Wt(e){return Kt(e&&e.line)+`:`+Kt(e&&e.column)}function Gt(e){return Wt(e&&e.start)+`-`+Wt(e&&e.end)}function Kt(e){return e&&typeof e==`number`?e:1}var qt=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ut(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(qt.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Jt={}.hasOwnProperty,Yt=new Map,Xt=/[A-Z]/g,Zt=/-([a-z])/g,Qt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),$t=new Set([`td`,`th`]),en=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function tn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=pn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=fn(n,t.jsx,t.jsxs)}let 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`?St:xt,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nn(e,t,n){if(t.type===`element`)return rn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return an(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return sn(e,t,n);if(t.type===`mdxjsEsm`)return on(e,t);if(t.type===`root`)return cn(e,t,n);if(t.type===`text`)return ln(e,t)}function rn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=yn(e,t.tagName,!1),o=mn(e,t),s=gn(e,t);return Qt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ke(e)})),un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function an(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bn(e,t.position)}function on(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bn(e,t.position)}function sn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:yn(e,t.name,!0),o=hn(e,t),s=gn(e,t);return un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cn(e,t,n){let r={};return dn(r,gn(e,t)),e.create(t,e.Fragment,r,n)}function ln(e,t){return t.value}function un(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function fn(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function pn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function mn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Jt.call(t.properties,i)){let a=_n(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&$t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function hn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bn(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else bn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function gn(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=nn(e,a,o);s!==void 0&&n.push(s)}return n}function _n(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=vt(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Be(n):Ct(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:xn(n):vn(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?mt[r.property]||r.property:r.attribute,n]}function vn(e,t){let n={};try{Rt(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Zt,wn))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=en+`#cannot-parse-style-attribute`,r}return n}function yn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=We(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=We(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Jt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);bn(e)}function bn(e,t){let n=new qt("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=en+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function xn(e){let t={},n;for(n in e)Jt.call(e,n)&&(t[Sn(n)]=e[n]);return t}function Sn(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Xt,Cn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Cn(e){return`-`+e.toLowerCase()}function wn(e,t){return t.toUpperCase()}var Tn={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`]},En={};function Dn(e,t){let n=t||En;return On(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function On(e,t,n){if(An(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 kn(e.children,t,n)}return Array.isArray(e)?kn(e,t,n):``}function kn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=On(e[i],t,n);return r.join(``)}function An(e){return!!(e&&typeof e==`object`)}var jn=document.createElement(`i`);function Mn(e){let t=`&`+e+`;`;jn.innerHTML=t;let n=jn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function W(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function G(e,t){return e.length>0?(W(e,e.length,0,t),e):t}var Nn={}.hasOwnProperty;function Pn(e){let t={},n=-1;for(;++n<e.length;)Fn(t,e[n]);return t}function Fn(e,t){let n;for(n in t){let r=(Nn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Nn.call(r,a)||(r[a]=[]);let e=i[a];In(r[a],Array.isArray(e)?e:e?[e]:[])}}}function In(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);W(e,0,0,r)}function Ln(e,t){let 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 K(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var q=Gn(/[A-Za-z]/),J=Gn(/[\dA-Za-z]/),Rn=Gn(/[#-'*+\--9=?A-Z^-~]/);function zn(e){return e!==null&&(e<32||e===127)}var Bn=Gn(/\d/),Vn=Gn(/[\dA-Fa-f]/),Hn=Gn(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Un=Gn(/\p{P}|\p{S}/u),Wn=Gn(/\s/);function Gn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Kn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function qn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Z(t)?(e.enter(r),c(t)):l(t)}function c(t){return Z(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Jn={tokenize:Yn};function Yn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Xn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Zn(this,e,t,n,!1)}addBefore(e,t,n){Zn(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Zn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Qn={tokenize:er},$n={tokenize:tr};function er(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Xn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($n,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt($n,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Xn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tr(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function nr(e){if(e===null||X(e)||Wn(e))return 1;if(Un(e))return 2}function rr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ir={name:`attention`,resolveAll:ar,tokenize:or};function ar(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};sr(o,-a),sr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=G(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=G(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=G(r,rr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=G(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=G(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),W(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function or(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=nr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function sr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var cr={name:`autolink`,tokenize:lr};function lr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return q(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||zn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Rn(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ur={partial:!0,tokenize:dr};function dr(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var fr={continuation:{tokenize:mr},exit:hr,name:`blockQuote`,tokenize:pr};function pr(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mr(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fr,t,n)(r)}}function hr(e){e.exit(`blockQuote`)}var gr={name:`characterEscape`,tokenize:_r};function _r(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Hn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var vr={name:`characterReference`,tokenize:yr};function yr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Vn,u):(e.enter(`characterReferenceValue`),a=7,o=Bn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!Mn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var br={partial:!0,tokenize:xr};function xr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Sr={concrete:!0,name:`codeFenced`,tokenize:Cr};function Cr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(br,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(br,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var wr={name:`codeIndented`,tokenize:Er},Tr={partial:!0,tokenize:Dr};function Er(e,t,n){return r;function r(t){return e.enter(`codeIndented`),qn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Y(t)?e.attempt(Tr,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Dr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Y(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):qn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Y(e)?i(e):n(e)}}var Or={name:`codeText`,previous:Ar,resolve:kr,tokenize:jr};function kr(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 Ar(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function jr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Mr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Nr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Nr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Nr(this.left,t.reverse())}}}};function Nr(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 Pr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Mr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return W(e,0,1/0,u.slice(0)),!l}function Fr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ir={resolve:Rr,tokenize:zr},Lr={partial:!0,tokenize:Br};function Rr(e){return Pr(e),e}function zr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(Lr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Br(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let 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(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Vr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||zn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||zn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Hr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ur(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Wr(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Gr={name:`definition`,tokenize:qr},Kr={partial:!0,tokenize:Jr};function qr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Hr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Wr(e,l)(t):l(t)}function l(t){return Vr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Kr,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Jr(e,t,n){return r;function r(t){return X(t)?Wr(e,i)(t):n(t)}function i(t){return Ur(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Yr={name:`hardBreakEscape`,tokenize:Xr};function Xr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Zr={name:`headingAtx`,resolve:Qr,tokenize:$r};function Qr(e,t){let n=e.length-2,r=3;if(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){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};W(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function $r(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ei=`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`.split(`.`),ti=[`pre`,`script`,`style`,`textarea`],ni={concrete:!0,name:`htmlFlow`,resolveTo:ii,tokenize:ai},ri={partial:!0,tokenize:oi};function ii(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 ai(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):q(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):q(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return q(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ti.includes(l)?(i=1,r.interrupt?t(s):O(s)):ei.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||q(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),ne):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ri,ae,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(br,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),re):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return ti.includes(n)?(e.consume(t),ie):O(t)}return q(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),re):O(t)}function ie(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function oi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ur,t,n)}}var si={name:`htmlText`,tokenize:ci};function ci(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):q(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):q(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):Y(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return q(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,M(t)):Z(t)?(e.consume(t),C):j(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||q(t)?(e.consume(t),E):Y(t)?(o=T,M(t)):Z(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,M(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,M(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Y(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||X(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return Z(t)?Q(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var li={name:`labelEnd`,resolveAll:pi,resolveTo:mi,tokenize:hi},ui={tokenize:gi},di={tokenize:_i},fi={tokenize:vi};function pi(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&W(e,0,e.length,n),e}function mi(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=G(o,e.slice(i+1,i+r+3)),o=G(o,[[`enter`,l,t]]),o=G(o,rr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=G(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=G(o,e.slice(a+1)),o=G(o,[[`exit`,s,t]]),W(e,i,e.length,o),e}function hi(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(K(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ui,u,o?u:d)(t):t===91?e.attempt(di,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(fi,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function gi(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Wr(e,a)(t):a(t)}function a(t){return t===41?u(t):Vr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Wr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ur(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Wr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function _i(e,t,n){let r=this;return i;function i(t){return Hr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function vi(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var yi={name:`labelStartImage`,resolveAll:li.resolveAll,tokenize:bi};function bi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var xi={name:`labelStartLink`,resolveAll:li.resolveAll,tokenize:Si};function Si(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ci={name:`lineEnding`,tokenize:wi};function wi(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Ti={name:`thematicBreak`,tokenize:Ei};function Ei(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var $={continuation:{tokenize:Ai},exit:Mi,name:`list`,tokenize:ki},Di={partial:!0,tokenize:Ni},Oi={partial:!0,tokenize:ji};function ki(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Bn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ti,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Bn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ur,r.interrupt?n:u,e.attempt(Di,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ai(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ur,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Oi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt($,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ji(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Mi(e){e.exit(this.containerState.type)}function Ni(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Pi={name:`setextUnderline`,resolveTo:Fi,tokenize:Ii};function Fi(e,t){let n=new Xn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Ii(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Li={tokenize:Ri};function Ri(e){let t=this,n=e.attempt(ur,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ir,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zi={resolveAll:Ui()},Bi=Hi(`string`),Vi=Hi(`text`);function Hi(e){return{resolveAll:Ui(e===`text`?Wi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ui(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Wi(e,t){let n=new Xn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Gi=s({attentionMarkers:()=>$i,contentInitial:()=>qi,disable:()=>ea,document:()=>Ki,flow:()=>Yi,flowInitial:()=>Ji,insideSpan:()=>Qi,string:()=>Xi,text:()=>Zi}),Ki={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:fr},qi={91:Gr},Ji={[-2]:wr,[-1]:wr,32:wr},Yi={35:Zr,42:Ti,45:[Pi,Ti],60:ni,61:Pi,95:Ti,96:Sr,126:Sr},Xi={38:vr,92:gr},Zi={[-5]:Ci,[-4]:Ci,[-3]:Ci,33:yi,38:vr,42:ir,60:[cr,si],91:xi,92:[Yr,gr],93:li,95:ir,96:Or},Qi={null:[ir,zi]},$i={null:[42,95]},ea={null:[]};function ta(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=G(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=rr(a,l.events,l),l.events):[]}function f(e,t){return ra(p(e),t)}function p(e){return na(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&W(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function na(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ra(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
1
|
+
import{P as e,Z as t,a as n,at as r,ct as i,it as a,ot as o,rt as s,st as c,t as l,tt as u,y as d}from"./feedback-x6ZumR_x.js";import{E as f,I as p,L as m,P as h,T as g,o as _,ot as v,s as y,st as b}from"./index-C6juWzGV.js";import{n as x,t as S}from"./boundary-DL9veUlN.js";var C=`mosio.agent.event/1`,w=e=>typeof e==`object`&&!!e&&!Array.isArray(e);function T(e){if(!w(e)||e.schema!==`mosio.agent.event/1`||typeof e.seq!=`number`||!Number.isInteger(e.seq)||e.seq<1||typeof e.id!=`string`||typeof e.kind!=`string`||typeof e.session_id!=`string`||typeof e.ts_ms!=`number`||e.turn_id!==void 0&&e.turn_id!==null&&typeof e.turn_id!=`string`)return null;let t=w(e.data)?e.data:{};return{schema:C,seq:e.seq,id:e.id,session_id:e.session_id,ts_ms:e.ts_ms,turn_id:e.turn_id??void 0,kind:e.kind,data:t}}function E(e,t){let n=Math.max(1,Math.round(t)),r=Math.floor(e/n),i=String(e%n).padStart(2,`0`),a=String(r%60).padStart(2,`0`);return r<60?`${a}:${i}`:`${Math.floor(r/60)}:${a}:${i}`}function D(e){return{sessionId:e,lastSeq:0,gap:!1,state:`idle`,turns:[],proposals:{},artifacts:{},permissions:{},usage:null,provider:null,lastError:null,notices:[],contextChips:[]}}var O=(e,t=``)=>typeof e==`string`?e:t,k=e=>typeof e==`number`&&Number.isFinite(e)?e:null,A=e=>Array.isArray(e)?e:[];function ee(e){let t=[];for(let n of A(e)){let e=n.content??n;typeof e?.text==`string`?t.push(e.text):n.type===`diff`&&typeof n.path==`string`&&t.push(`diff ${n.path}`)}return t.length?t.join(`
|
|
2
|
+
`):void 0}function j(e,t){if(t.turn_id){let n=e.turns.find(e=>e.id===t.turn_id);return n||(n={id:t.turn_id,user:null,items:[],tools:[],plan:null,startedMs:t.ts_ms},e.turns.push(n)),n}return e.turns[e.turns.length-1]??null}function M(e){return{...e,items:[...e.items],tools:[...e.tools]}}function te(e,t){if(t.session_id!==e.sessionId||t.seq<=e.lastSeq)return e;if(t.seq!==e.lastSeq+1&&e.lastSeq!==0)return{...e,gap:!0};let n={...e,lastSeq:t.seq,gap:!1,turns:e.turns.map(n=>n.id===t.turn_id||n===e.turns[e.turns.length-1]?M(n):n),proposals:e.proposals,artifacts:e.artifacts,permissions:e.permissions},r=t.data;switch(t.kind){case`session.state`:n.state=O(r.state,n.state);break;case`provider.ready`:{let e=r.capabilities??{};n.provider={name:O(e.agent_name,O(r.provider)),title:O(e.agent_title)||void 0,version:O(e.agent_version)||void 0,capabilities:e};break}case`context.updated`:n.contextChips=A(r.context??r.chips);break;case`turn.started`:{let e=j(n,t);e&&(e.user={text:O(r.text),chips:A(r.context),tsMs:t.ts_ms},e.startedMs=t.ts_ms),n.lastError=null;break}case`message.chunk`:{let e=j(n,t),i=r.role===`thought`?`thought`:r.role===`agent`?`agent`:null,a=O(r.text);if(!e||!i||!a)break;let o=e.items[e.items.length-1];o&&o.type===`text`&&o.role===i&&!e.sealed?e.items[e.items.length-1]={...o,text:o.text+a}:e.items.push({type:`text`,role:i,text:a}),e.sealed=!1;break}case`tool.call`:case`tool.update`:{let e=j(n,t),i=O(r.toolCallId);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i&&e.source===`agent`),o=a>=0?e.tools[a]:void 0,s=O(r.status,o?.status??`pending`),c={id:i,source:`agent`,title:O(r.title,o?.title??i),kind:O(r.kind,o?.kind??`other`),status:s,text:ee(r.content)??o?.text,locations:A(r.locations).map(e=>O(e.path)).filter(Boolean),startedMs:o?.startedMs??t.ts_ms,endedMs:s===`completed`||s===`failed`?t.ts_ms:o?.endedMs};c.locations?.length||(c.locations=o?.locations),a>=0?e.tools[a]=c:(e.tools.push(c),e.sealed=!0);break}case`mosio.tool.started`:case`mosio.tool.finished`:{let e=j(n,t),i=O(r.call_id);if(!e||!i)break;let a=e.tools.findIndex(e=>e.id===i),o=r.ok!==!1,s=a>=0?{...e.tools[a],status:t.kind===`mosio.tool.finished`?o?`completed`:`failed`:`in_progress`,endedMs:t.kind===`mosio.tool.finished`?t.ts_ms:void 0,text:o?e.tools[a].text:O(r.error?.message)}:{id:i,source:`mosio`,tool:O(r.tool),title:O(r.tool).replace(/_/g,` `),kind:`other`,status:`in_progress`,startedMs:t.ts_ms};a>=0?e.tools[a]=s:e.tools.push(s);break}case`plan`:{let e=j(n,t);e&&Array.isArray(r.entries)&&(e.plan=A(r.entries));break}case`usage`:n.usage={used:k(r.used),size:k(r.size),cost:r.cost??null};break;case`permission.requested`:{let e=O(r.request_id);if(!e)break;n.permissions={...n.permissions,[e]:{requestId:e,source:O(r.source),class:O(r.class),key:O(r.key),details:r.details??{},options:A(r.options),requestedAtMs:k(r.requested_at_ms)??t.ts_ms,expiresAtMs:k(r.expires_at_ms)??t.ts_ms}},j(n,t)?.items.push({type:`permission`,requestId:e});break}case`permission.resolved`:{let e=O(r.request_id);if(e&&n.permissions[e])n.permissions={...n.permissions,[e]:{...n.permissions[e],outcome:O(r.outcome),by:O(r.by)}};else if(!e&&r.outcome===`denied`&&r.by===`policy`){let e=O(r.class,`action`).replace(/_/g,` `);j(n,t)?.items.push({type:`notice`,level:`warning`,text:`Mosio blocked a ${e} request (policy: never allowed).`})}break}case`proposal.created`:case`proposal.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.proposals[e.id];n.proposals={...n.proposals,[e.id]:e},i&&j(n,t)?.items.push({type:`proposal`,id:e.id});break}case`artifact.created`:case`artifact.updated`:{let e=r;if(!e||typeof e.id!=`string`)break;let i=!n.artifacts[e.id];n.artifacts={...n.artifacts,[e.id]:e},i&&j(n,t)?.items.push({type:`artifact`,id:e.id});break}case`error`:{let e=r;n.lastError=e,j(n,t)?.items.push({type:`error`,error:e});break}case`notice`:{let e={level:O(r.level,`info`),text:O(r.text,O(r.message))};e.text&&(n.notices=[...n.notices,e].slice(-20),j(n,t)?.items.push({type:`notice`,...e}));break}case`provider.exited`:{let e={level:`warning`,text:O(r.reason,`The agent process stopped.`)};n.notices=[...n.notices,e].slice(-20);break}case`turn.ended`:{let e=j(n,t);e&&(e.endedMs=t.ts_ms,e.stopReason=O(r.stop_reason),r.usage&&typeof r.usage==`object`&&(e.usage=r.usage));break}}return n}function ne(e){let t={...e,tools:ie(e)};if(!t.tools.length)return null;let n=t.tools.filter(e=>e.kind===`read`||e.kind===`search`||/^(get|list|inspect|render_preview|plan|compare)/.test(e.tool??``)).length,r=t.tools.filter(e=>e.kind===`edit`||/^(propose|apply|create|update)/.test(e.tool??``)).length,i=t.tools.filter(e=>e.status===`failed`).length,a=[];n&&a.push(`Read ${n} ${n===1?`item`:`items`}`),r&&a.push(`${r} ${r===1?`change`:`changes`}`),!n&&!r&&a.push(`${t.tools.length} ${t.tools.length===1?`step`:`steps`}`),i&&a.push(`${i} failed`);let o=((t.endedMs??Math.max(...t.tools.map(e=>e.endedMs??e.startedMs)))-t.startedMs)/1e3;return o>0&&a.push(`${o.toFixed(1)} s`),a.join(` · `)}function re(e){let t=Object.values(e.permissions).some(e=>!e.outcome),n=Object.values(e.proposals).some(e=>e.status===`pending`||e.status===`conflict`);switch(e.state){case`starting`:return{text:`Starting`,tone:`muted`};case`running`:return{text:`Working`,tone:`blue`};case`awaiting_permission`:return{text:`Needs approval`,tone:`amber`};case`cancelling`:return{text:`Stopping`,tone:`muted`};case`interrupted`:return{text:`Interrupted`,tone:`red`};case`failed`:return{text:`Failed`,tone:`red`};case`closed`:return{text:`Closed`,tone:`muted`};default:return t?{text:`Needs approval`,tone:`amber`}:n?{text:`In review`,tone:`amber`}:{text:`Your turn`,tone:`blue`}}}function ie(e){let t=e.tools.filter(e=>e.source===`agent`);return t.length?t:e.tools}var ae=class extends Error{code;retryable;fix;details;status;constructor(e,t=0){super(e.message),this.code=e.code,this.retryable=e.retryable,this.fix=e.fix,this.details=e.details,this.status=t}};function oe(){let e=globalThis.crypto;return e&&`randomUUID`in e?`m_${e.randomUUID().replace(/-/g,``).slice(0,24)}`:`m_${Date.now().toString(36)}${Math.random().toString(36).slice(2,10)}`}var se=class{kind=`http`;base;token;f;WS;backoff;constructor(e){this.base=e.baseUrl.replace(/\/$/,``),this.token=e.token,this.f=e.fetch??globalThis.fetch.bind(globalThis),this.WS=e.WebSocket??globalThis.WebSocket,this.backoff=e.backoff??[250,5e3]}async req(e,t,n){let r=await this.f(`${this.base}${t}`,{method:e,headers:{Authorization:`Bearer ${this.token}`,...n===void 0?{}:{"Content-Type":`application/json`}},body:n===void 0?void 0:JSON.stringify(n)}),i=await r.json().catch(()=>({}));if(!r.ok)throw new ae(i.error??{code:`E_TRANSPORT`,message:`HTTP ${r.status}`,retryable:r.status>=500},r.status);return i}async providers(){return(await this.req(`GET`,`/api/providers`)).providers}async listSessions(){return(await this.req(`GET`,`/api/sessions`)).sessions}async createSession(e,t){return(await this.req(`POST`,`/api/sessions`,{provider:e,title:t})).session}async getSession(e){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}`)).session}async forkSession(e,t){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/fork`,{at_seq:t})).session}async events(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/events?since=${t}`)).events.map(T).filter(e=>e!==null)}async prompt(e,t,n,r=oe()){return this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/prompt`,{text:t,context:n,client_msg_id:r})}async cancel(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/cancel`)).cancelled}async setContext(e,t){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/context`,t)}async answerPermission(e,t,n){await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/permissions/${encodeURIComponent(t)}`,{option_id:n})}async rebase(e){return(await this.req(`POST`,`/api/sessions/${encodeURIComponent(e)}/rebase`)).base_revision}async decideProposal(e,t,n){return(await this.req(`POST`,`/api/proposals/${encodeURIComponent(e)}/${t}`,n?{proposal_digest:n}:void 0)).proposal}async editArtifact(e,t,n,r){return(await this.req(`PUT`,`/api/artifacts/${encodeURIComponent(e)}`,{base_version:t,data:n,note:r})).artifact}async decideArtifact(e,t,n={}){return(await this.req(`POST`,`/api/artifacts/${encodeURIComponent(e)}/${t}`,n)).artifact}async protocol(e,t=0){return(await this.req(`GET`,`/api/sessions/${encodeURIComponent(e)}/protocol?offset=${t}`)).messages}mediaUrl(e){return`${this.base}/api/files?path=${encodeURIComponent(e)}&token=${encodeURIComponent(this.token)}`}subscribe(e,t,n,r){let i=t,a=!1,o=null,s=0,c=null,l=t=>{t.seq<=i||(t.seq===i+1?(i=t.seq,n(t)):this.events(e,i).then(e=>e.forEach(l)))},u=()=>{if(a)return;r?.(s===0?`connecting`:`reconnecting`);let t=`${this.base.replace(/^http/,`ws`)}/api/sessions/${encodeURIComponent(e)}/stream?since=${i}&token=${encodeURIComponent(this.token)}`;o=new this.WS(t),o.onopen=()=>{s=0,r?.(`open`)},o.onmessage=e=>{let t;try{t=JSON.parse(String(e.data))}catch{return}let n=T(t);n&&l(n)},o.onclose=()=>{if(o=null,a)return;s+=1;let[e,t]=this.backoff;c=setTimeout(u,Math.min(t,e*2**Math.min(s,6))),r?.(`reconnecting`)},o.onerror=()=>o?.close()};return u(),{close:()=>{a=!0,c&&clearTimeout(c),o?.close(),r?.(`closed`)}}}},N=i(r(),1);function P(...e){return s(a(e))}function ce(e,t){return t.type===`reset`?D(t.id):te(e,t.e)}function le(e,t){let[n,r]=(0,N.useReducer)(ce,D(t??``)),[i,a]=(0,N.useState)(`connecting`),[o,s]=(0,N.useState)(null),c=(0,N.useRef)(0);c.current=n.lastSeq,(0,N.useEffect)(()=>{if(!t)return;r({type:`reset`,id:t});let n=e.subscribe(t,0,e=>r({type:`event`,e}),a);return()=>n.close()},[e,t]);let l=(0,N.useCallback)(async e=>{try{s(null),await e()}catch(e){s(e instanceof ae?e:new ae({code:`E_TRANSPORT`,message:String(e),retryable:!0}))}},[]);return{thread:n,connection:i,busy:[`starting`,`running`,`awaiting_permission`,`cancelling`].includes(n.state),error:o,send:(n,r)=>l(()=>e.prompt(t,n,r,oe())),cancel:()=>l(()=>e.cancel(t)),answerPermission:(n,r)=>l(()=>e.answerPermission(t,n,r)),clearError:()=>s(null)}}function ue(e,t=0){let[n,r]=(0,N.useState)([]),i=(0,N.useCallback)(()=>e.listSessions().then(r).catch(()=>r([])),[e]);return(0,N.useEffect)(()=>{i()},[i,t]),{sessions:n,reload:i}}var F=u(),I={stroke:`currentColor`,fill:`none`,strokeWidth:2,viewBox:`0 0 24 24`,strokeLinecap:`round`,strokeLinejoin:`round`,width:`100%`,height:`100%`,"aria-hidden":!0},de=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`16 18 22 12 16 6`}),(0,F.jsx)(`polyline`,{points:`8 6 2 12 8 18`})]}),fe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`6 9 12 15 18 9`})}),pe=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`9 18 15 12 9 6`})}),me=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`11 17 6 12 11 7`}),(0,F.jsx)(`polyline`,{points:`18 17 13 12 18 7`})]}),he=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`19`,x2:`12`,y2:`5`}),(0,F.jsx)(`polyline`,{points:`5 12 12 5 19 12`})]}),ge=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`path`,{d:`M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z`}),(0,F.jsx)(`line`,{x1:`12`,y1:`9`,x2:`12`,y2:`13`}),(0,F.jsx)(`line`,{x1:`12`,y1:`17`,x2:`12.01`,y2:`17`})]}),_e=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,ry:`2`}),(0,F.jsx)(`line`,{x1:`3`,y1:`9`,x2:`21`,y2:`9`}),(0,F.jsx)(`line`,{x1:`9`,y1:`21`,x2:`9`,y2:`9`})]}),ve=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`rect`,{x:`5`,y:`5`,width:`14`,height:`14`,rx:`2`,ry:`2`,fill:`currentColor`,stroke:`none`})}),ye=e=>(0,F.jsx)(`svg`,{...I,...e,children:(0,F.jsx)(`polyline`,{points:`20 6 9 17 4 12`})}),be=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`line`,{x1:`12`,y1:`5`,x2:`12`,y2:`19`}),(0,F.jsx)(`line`,{x1:`5`,y1:`12`,x2:`19`,y2:`12`})]}),xe=e=>(0,F.jsxs)(`svg`,{...I,...e,children:[(0,F.jsx)(`polyline`,{points:`1 4 1 10 7 10`}),(0,F.jsx)(`path`,{d:`M3.51 15a9 9 0 1 0 2.13-9.36L1 10`})]}),Se=b(`inline-flex h-[30px] shrink-0 items-center justify-center rounded-lg font-sans text-xs leading-normal whitespace-nowrap transition-colors outline-none focus-visible:ring-2 focus-visible:ring-accent-blue-edge disabled:cursor-not-allowed disabled:opacity-50`,{variants:{variant:{primary:`bg-accent-blue px-3 font-semibold text-text-on-accent hover:brightness-110`,outline:`border border-border-strong px-3 font-medium text-text-primary hover:bg-surface-hover`,ghost:`px-2.5 font-normal text-text-secondary hover:text-text-primary`}},defaultVariants:{variant:`primary`}});function L({variant:e,className:t,...n}){return(0,F.jsx)(`button`,{type:`button`,className:P(Se({variant:e}),t),...n})}var Ce={blue:`border-accent-blue-edge`,amber:`border-accent-amber-edge`,strong:`border-border-strong`};function we({tone:e=`strong`,className:t,...n}){return(0,F.jsx)(`div`,{className:P(`flex min-h-0 min-w-0 flex-col overflow-clip rounded-xl border bg-surface-card`,Ce[e],t),...n})}function Te({title:e,kind:t,lead:n,className:r}){return(0,F.jsxs)(`div`,{className:P(`flex h-[38px] shrink-0 items-center gap-2 border-b border-border-default px-3`,r),children:[n,(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-[13px] font-medium leading-normal text-text-primary`,children:e}),t!=null&&(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal text-accent-blue-text`,children:t})]})}function Ee({className:e,...t}){return(0,F.jsx)(`div`,{className:P(`flex flex-wrap items-center gap-2 px-2.5 pt-0 pb-2.5`,e),...t})}function De({tone:e}){let t={blue:`bg-accent-blue`,amber:`bg-accent-amber`,muted:`bg-text-secondary`,red:`bg-accent-amber`}[e];return(0,F.jsx)(`span`,{"aria-hidden":!0,className:P(`block size-1.5 shrink-0 rounded-full`,t)})}function Oe({label:e,onRemove:t}){return(0,F.jsxs)(`span`,{className:`flex h-[22px] max-w-full items-center gap-1 rounded-md bg-accent-blue-glow px-2`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[11px] leading-normal text-accent-blue-text`,children:e}),t&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e}`,onClick:t,className:`font-sans text-[11px] leading-none text-accent-blue-text/70 hover:text-accent-blue-text`,children:`×`})]})}function ke({children:e,...t}){return(0,F.jsx)(`button`,{type:`button`,className:`flex h-7 items-center rounded-full border border-border-strong px-2.5 font-sans text-xs leading-normal text-text-primary hover:bg-surface-hover`,...t,children:e})}var Ae={brief:`Brief`,creative_direction:`Direction`,script:`Script`,storyboard:`Storyboard`,reference_analysis:`Reference`,styleframes:`Styleframes`,asset_plan:`Assets`,scene_alternatives:`Refinement`,revision_proposal:`Proposal`,render_report:`Render`};function je({a:e}){return e.status===`approved`?(0,F.jsxs)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:[`Approved v`,e.approved_version]}):e.status===`rejected`?(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Rejected`}):(0,F.jsx)(`span`,{className:`font-sans text-xs text-accent-blue-text`,children:Ae[e.kind]??e.kind})}function Me({src:e,alt:t,selected:n,height:r,letter:i,onClick:a}){return(0,F.jsxs)(`button`,{type:`button`,onClick:a,"aria-pressed":n,"aria-label":t,className:P(`relative block w-full min-w-0 overflow-clip rounded-md bg-scene-ground`,r,n?`shadow-[0px_0px_0px_2px_var(--color-accent-blue)]`:`shadow-[0px_0px_0px_1px_var(--color-border-strong)]`),children:[e?(0,F.jsx)(`img`,{src:e,alt:``,className:`absolute inset-0 size-full object-cover`,loading:`lazy`,draggable:!1}):(0,F.jsx)(`span`,{className:`mosio-agent-hatch absolute inset-0 block`}),i&&(0,F.jsx)(`span`,{className:P(`absolute top-[5px] left-[5px] flex size-4 items-center justify-center rounded-full`,n?`bg-accent-blue`:`bg-surface-card`),children:(0,F.jsx)(`span`,{className:`font-sans text-[10px] leading-normal font-semibold text-text-on-accent`,children:i})})]})}function Ne({artifact:e,actions:t,mediaUrl:n}){let r=e.data,i=Array.isArray(r.options)?r.options:[],[a,o]=(0,N.useState)(null),s=a??e.selected??i[0]?.id??null,c=!/caption|placement|refine/i.test(e.title)&&i.every(e=>e.label.length<18),l=!c,u=i.find(e=>e.id===s),d=e.status===`approved`;return(0,F.jsxs)(we,{tone:c?`strong`:`blue`,"data-testid":`artifact-scene-alternatives`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:d?(0,F.jsx)(je,{a:e}):c?`Asset`:`Refinement`}),(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:i.map((r,i)=>{let a=r.id===s;return(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.label,selected:a,height:c?`h-24`:`h-[150px]`,letter:l?String.fromCharCode(65+i):void 0,onClick:d?void 0:()=>{o(r.id),t.onSelectOption(e.id,r.id)}}),(0,F.jsx)(`span`,{className:P(`block font-sans text-xs leading-[1.3]`,a?`font-medium text-text-primary`:`text-text-secondary`),children:r.label})]},r.id)})}),!d&&u&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:l?`Apply ${String.fromCharCode(65+i.indexOf(u))}`:`Use ${u.label.toLowerCase()}`}),t.onPreviewOption&&(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onPreviewOption(e,u.id),children:`Preview in player`})]})]})}function Pe({title:e,meta:t,onOpen:n}){return(0,F.jsxs)(`button`,{type:`button`,onClick:n,className:`flex h-11 w-full items-center gap-2.5 rounded-xl border border-accent-blue-edge bg-accent-blue-glow px-3 text-left hover:brightness-125`,children:[(0,F.jsx)(`span`,{className:`block size-[15px] shrink-0 text-accent-blue-text`,children:(0,F.jsx)(_e,{})}),(0,F.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-[13px] leading-normal font-medium text-text-primary`,children:e}),(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs leading-normal text-text-secondary`,children:t})]})]})}function Fe({artifact:e,actions:t,mediaUrl:n}){let r=e.data.frames??[],i=r.reduce((e,t)=>e+(t.duration_s??0),0),a=e.status!==`proposed`&&e.status!==`draft`;return t.onOpenArtifact?(0,F.jsx)(`div`,{"data-testid":`artifact-storyboard`,"data-status":e.status,children:(0,F.jsx)(Pe,{title:e.title,meta:`Open in workspace · ${r.length} frames${i?` · ${i.toFixed(1)} s`:``}${e.status===`approved`?` · approved`:e.status===`rejected`?` · changes requested`:` · v${e.version}`}`,onOpen:()=>t.onOpenArtifact(e)})}):(0,F.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`artifact-storyboard`,"data-status":e.status,children:[(0,F.jsx)(Pe,{title:e.title,meta:`${r.length} frames${i?` · ${i.toFixed(1)} s`:``} · v${e.version}${e.status===`approved`?` · approved`:``}`}),(0,F.jsxs)(we,{tone:`strong`,children:[(0,F.jsx)(`div`,{className:`grid grid-cols-3 gap-2 p-2.5`,children:r.map((r,i)=>(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[(0,F.jsx)(Me,{src:r.image?n(r.image.uri):``,alt:r.title,selected:e.selected===r.id,height:`h-24`,onClick:()=>t.onSelectOption(e.id,r.id)}),(0,F.jsxs)(`span`,{className:`block truncate font-sans text-xs leading-normal font-medium text-text-primary`,children:[i+1,`. `,r.title]})]},r.id))}),!a&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve storyboard`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Request changes`})]})]})]})}function Ie({k:e,v:t}){return t==null||t===``||Array.isArray(t)&&t.length===0?null:(0,F.jsxs)(`div`,{className:`flex flex-col gap-0.5 px-3`,children:[(0,F.jsx)(`span`,{className:`font-sans text-[11px] text-text-secondary`,children:e}),(0,F.jsx)(`span`,{className:`font-sans text-xs leading-[1.4] break-words whitespace-pre-wrap text-text-primary`,children:Array.isArray(t)?t.join(` · `):typeof t==`object`?JSON.stringify(t):String(t)})]})}function Le({a:e}){let t=e.data;switch(e.kind){case`brief`:{let e=t,n=e.format;return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Goal`,v:e.goal}),(0,F.jsx)(Ie,{k:`Audience`,v:e.audience}),(0,F.jsx)(Ie,{k:`Message`,v:e.message}),(0,F.jsx)(Ie,{k:`Call to action`,v:e.call_to_action}),(0,F.jsx)(Ie,{k:`Tone`,v:e.tone}),(0,F.jsx)(Ie,{k:`Format`,v:n?[n.width&&n.height?`${n.width}×${n.height}`:null,n.fps?`${n.fps} fps`:null,n.duration_s?`${n.duration_s} s`:null].filter(Boolean):null})]})}case`creative_direction`:return(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(Ie,{k:`Direction`,v:t.summary}),Array.isArray(t.palette)&&(0,F.jsx)(`div`,{className:`flex gap-1 px-3`,children:t.palette.map(e=>(0,F.jsx)(`span`,{title:e,className:`block size-5 rounded-md border border-border-strong`,style:{background:/^#[0-9a-fA-F]{3,8}$/.test(e)?e:`transparent`}},e))}),(0,F.jsx)(Ie,{k:`Motion`,v:t.motion})]});case`script`:return(0,F.jsx)(`ol`,{className:`flex flex-col gap-1 px-3`,children:(t.beats??[]).map((e,t)=>(0,F.jsxs)(`li`,{className:`font-sans text-xs leading-[1.4] text-text-primary`,children:[(0,F.jsxs)(`span`,{className:`text-text-secondary`,children:[t+1,`.`]}),` `,e.on_screen,e.voiceover&&(0,F.jsxs)(`span`,{className:`block text-text-secondary`,children:[`VO: `,e.voiceover]})]},e.id))});case`asset_plan`:return(0,F.jsx)(`div`,{className:`flex flex-col`,children:(t.assets??[]).map(e=>(0,F.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:`flex-1 truncate font-sans text-xs text-text-primary`,children:e.description}),(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:e.status})]},e.id))});default:return(0,F.jsx)(F.Fragment,{children:Object.entries(t).slice(0,8).map(([e,t])=>(0,F.jsx)(Ie,{k:e.replace(/_/g,` `),v:t},e))})}}function Re({artifact:e,actions:t}){let n=e.status===`proposed`||e.status===`draft`;return(0,F.jsxs)(we,{tone:n?`blue`:`strong`,"data-testid":`artifact-${e.kind}`,"data-status":e.status,children:[(0,F.jsx)(Te,{title:e.title,kind:(0,F.jsx)(je,{a:e})}),(0,F.jsx)(`div`,{className:`flex flex-col gap-2 py-2.5`,children:(0,F.jsx)(Le,{a:e})}),n&&(0,F.jsxs)(Ee,{children:[(0,F.jsx)(L,{variant:`primary`,onClick:()=>t.onApproveArtifact(e.id,e.version),children:`Approve`}),t.onOpenArtifact&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>t.onOpenArtifact(e),children:`Edit`}),(0,F.jsx)(L,{variant:`ghost`,onClick:()=>t.onRejectArtifact(e.id),children:`Reject`})]})]})}function ze({artifact:e,actions:t,mediaUrl:n}){switch(e.kind){case`scene_alternatives`:case`styleframes`:if(e.kind===`styleframes`){let r=(e.data.frames??[]).map(e=>({id:e.id,label:e.title,image:e.image}));return(0,F.jsx)(Ne,{artifact:{...e,data:{question:e.title,options:r}},actions:t,mediaUrl:n})}return(0,F.jsx)(Ne,{artifact:e,actions:t,mediaUrl:n});case`storyboard`:return(0,F.jsx)(Fe,{artifact:e,actions:t,mediaUrl:n});default:return(0,F.jsx)(Re,{artifact:e,actions:t})}}function Be(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Ve=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,He=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Ue={};function We(e,t){return((t||Ue).jsx?He:Ve).test(e)}var Ge=/[ \t\n\f\r]/g;function Ke(e){return typeof e==`object`?e.type===`text`&&qe(e.value):qe(e)}function qe(e){return e.replace(Ge,``)===``}var Je=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};Je.prototype.normal={},Je.prototype.property={},Je.prototype.space=void 0;function Ye(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new Je(n,r,t)}function Xe(e){return e.toLowerCase()}var R=class{constructor(e,t){this.attribute=t,this.property=e}};R.prototype.attribute=``,R.prototype.booleanish=!1,R.prototype.boolean=!1,R.prototype.commaOrSpaceSeparated=!1,R.prototype.commaSeparated=!1,R.prototype.defined=!1,R.prototype.mustUseProperty=!1,R.prototype.number=!1,R.prototype.overloadedBoolean=!1,R.prototype.property=``,R.prototype.spaceSeparated=!1,R.prototype.space=void 0;var Ze=c({boolean:()=>z,booleanish:()=>B,commaOrSpaceSeparated:()=>U,commaSeparated:()=>et,number:()=>V,overloadedBoolean:()=>$e,spaceSeparated:()=>H}),Qe=0,z=tt(),B=tt(),$e=tt(),V=tt(),H=tt(),et=tt(),U=tt();function tt(){return 2**++Qe}var nt=Object.keys(Ze),rt=class extends R{constructor(e,t,n,r){let i=-1;if(super(e,t),it(this,`space`,r),typeof n==`number`)for(;++i<nt.length;){let e=nt[i];it(this,nt[i],(n&Ze[e])===Ze[e])}}};rt.prototype.defined=!0;function it(e,t,n){n&&(e[t]=n)}function at(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new rt(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[Xe(r)]=r,n[Xe(a.attribute)]=r}return new Je(t,n,e.space)}var ot=at({properties:{ariaActiveDescendant:null,ariaAtomic:B,ariaAutoComplete:null,ariaBusy:B,ariaChecked:B,ariaColCount:V,ariaColIndex:V,ariaColSpan:V,ariaControls:H,ariaCurrent:null,ariaDescribedBy:H,ariaDetails:null,ariaDisabled:B,ariaDropEffect:H,ariaErrorMessage:null,ariaExpanded:B,ariaFlowTo:H,ariaGrabbed:B,ariaHasPopup:null,ariaHidden:B,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:H,ariaLevel:V,ariaLive:null,ariaModal:B,ariaMultiLine:B,ariaMultiSelectable:B,ariaOrientation:null,ariaOwns:H,ariaPlaceholder:null,ariaPosInSet:V,ariaPressed:B,ariaReadOnly:B,ariaRelevant:null,ariaRequired:B,ariaRoleDescription:H,ariaRowCount:V,ariaRowIndex:V,ariaRowSpan:V,ariaSelected:B,ariaSetSize:V,ariaSort:null,ariaValueMax:V,ariaValueMin:V,ariaValueNow:V,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function st(e,t){return t in e?e[t]:t}function ct(e,t){return st(e,t.toLowerCase())}var lt=at({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:et,acceptCharset:H,accessKey:H,action:null,allow:null,allowFullScreen:z,allowPaymentRequest:z,allowUserMedia:z,alpha:z,alt:null,as:null,async:z,autoCapitalize:null,autoComplete:H,autoFocus:z,autoPlay:z,blocking:H,capture:null,charSet:null,checked:z,cite:null,className:H,closedBy:null,colorSpace:null,cols:V,colSpan:V,command:null,commandFor:null,content:null,contentEditable:B,controls:z,controlsList:H,coords:V|et,crossOrigin:null,data:null,dateTime:null,decoding:null,default:z,defer:z,dir:null,dirName:null,disabled:z,download:$e,draggable:B,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:z,formTarget:null,headers:H,height:V,hidden:$e,high:V,href:null,hrefLang:null,htmlFor:H,httpEquiv:H,id:null,imageSizes:null,imageSrcSet:null,inert:z,inputMode:null,integrity:null,is:null,isMap:z,itemId:null,itemProp:H,itemRef:H,itemScope:z,itemType:H,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:z,low:V,manifest:null,max:null,maxLength:V,media:null,method:null,min:null,minLength:V,multiple:z,muted:z,name:null,nonce:null,noModule:z,noValidate:z,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:z,optimum:V,pattern:null,ping:H,placeholder:null,playsInline:z,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:z,referrerPolicy:null,rel:H,required:z,reversed:z,rows:V,rowSpan:V,sandbox:H,scope:null,scoped:z,seamless:z,selected:z,shadowRootClonable:z,shadowRootCustomElementRegistry:z,shadowRootDelegatesFocus:z,shadowRootMode:null,shadowRootSerializable:z,shape:null,size:V,sizes:null,slot:null,span:V,spellCheck:B,src:null,srcDoc:null,srcLang:null,srcSet:null,start:V,step:null,style:null,tabIndex:V,target:null,title:null,translate:null,type:null,typeMustMatch:z,useMap:null,value:B,width:V,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:H,axis:null,background:null,bgColor:null,border:V,borderColor:null,bottomMargin:V,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:z,declare:z,event:null,face:null,frame:null,frameBorder:null,hSpace:V,leftMargin:V,link:null,longDesc:null,lowSrc:null,marginHeight:V,marginWidth:V,noResize:z,noHref:z,noShade:z,noWrap:z,object:null,profile:null,prompt:null,rev:null,rightMargin:V,rules:null,scheme:null,scrolling:B,standby:null,summary:null,text:null,topMargin:V,valueType:null,version:null,vAlign:null,vLink:null,vSpace:V,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:z,disablePictureInPicture:z,disableRemotePlayback:z,exportParts:et,part:H,prefix:null,property:null,results:V,security:null,unselectable:null},space:`html`,transform:ct}),ut=at({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`,maskType:`mask-type`,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:U,accentHeight:V,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:V,amplitude:V,arabicForm:null,ascent:V,attributeName:null,attributeType:null,azimuth:V,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:V,by:null,calcMode:null,capHeight:V,className:H,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:V,diffuseConstant:V,direction:null,display:null,dur:null,divisor:V,dominantBaseline:null,download:z,dx:null,dy:null,edgeMode:null,editable:null,elevation:V,enableBackground:null,end:null,event:null,exponent:V,externalResourcesRequired:null,fill:null,fillOpacity:V,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:et,g2:et,glyphName:et,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:V,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:V,horizOriginX:V,horizOriginY:V,id:null,ideographic:V,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:V,k:V,k1:V,k2:V,k3:V,k4:V,kernelMatrix:U,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:V,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:V,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:V,overlineThickness:V,paintOrder:null,panose1:null,path:null,pathLength:V,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:H,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:V,pointsAtY:V,pointsAtZ:V,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:U,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:U,rev:U,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:U,requiredFeatures:U,requiredFonts:U,requiredFormats:U,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:V,specularExponent:V,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:V,strikethroughThickness:V,string:null,stroke:null,strokeDashArray:U,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:V,strokeOpacity:V,strokeWidth:null,style:null,surfaceScale:V,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:U,tabIndex:V,tableValues:null,target:null,targetX:V,targetY:V,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:U,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:V,underlineThickness:V,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:V,values:null,vAlphabetic:V,vMathematical:V,vectorEffect:null,vHanging:V,vIdeographic:V,version:null,vertAdvY:V,vertOriginX:V,vertOriginY:V,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:V,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:st}),dt=at({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()}}),ft=at({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:ct}),pt=at({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),mt={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`},ht=/[A-Z]/g,gt=/-[a-z]/g,_t=/^data[-\w.:]+$/i;function vt(e,t){let n=Xe(t),r=t,i=R;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&_t.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(gt,bt);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!gt.test(e)){let n=e.replace(ht,yt);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=rt}return new i(r,t)}function yt(e){return`-`+e.toLowerCase()}function bt(e){return e.charAt(1).toUpperCase()}var xt=Ye([ot,lt,dt,ft,pt],`html`),St=Ye([ot,ut,dt,ft,pt],`svg`);function Ct(e){return e.join(` `).trim()}var wt=/\/\*(?:[^*]|\*(?!\/))*\*\//g,Tt=/\n/g,Et=/^\s*/,Dt=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,Ot=/^:\s*/,kt=/^((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|url\((?:'(?:\\.|[^'\\])*'|"(?:\\.|[^"\\])*"|[^)]*)\)|[^};])+)/,At=/^[;\s]*/,jt=`
|
|
3
|
+
`,Mt=`/`,Nt=`*`,Pt=``,Ft=`comment`,It=`declaration`;function Lt(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var n=1,r=1;function i(e){var t=e.match(Tt);t&&(n+=t.length);var i=e.lastIndexOf(jt);r=~i?e.length-i:r+e.length}function a(){var e={line:n,column:r};return function(t){return t.position=new o(e),l(),t}}function o(e){this.start=e,this.end={line:n,column:r},this.source=t.source}o.prototype.content=e;function s(i){var a=Error(t.source+`:`+n+`:`+r+`: `+i);if(a.reason=i,a.filename=t.source,a.line=n,a.column=r,a.source=e,!t.silent)throw a}function c(t){var n=t.exec(e);if(n){var r=n[0];return i(r),e=e.slice(r.length),n}}function l(){c(Et)}function u(e){for(var t;t=d();)e.push(t);return e}function d(){var t=a();if(Mt==e.charAt(0)&&Nt==e.charAt(1)){for(var n=2;Pt!=e.charAt(n)&&(Nt!=e.charAt(n)||Mt!=e.charAt(n+1));)++n;if(n+=2,Pt===e.charAt(n-1))return s(`End of comment missing`);var o=e.slice(2,n-2);return r+=2,i(o),e=e.slice(n),r+=2,t({type:Ft,comment:o})}}function f(){var e=a(),t=c(Dt);if(t){if(d(),!c(Ot))return s(`property missing ':'`);var n=c(kt),r=e({type:It,property:t[0].replace(wt,Pt).trim(),value:n?n[0].replace(wt,Pt).trim():Pt});return c(At),r}}function p(){var e=[];u(e);for(var t;t=f();)e.push(t),u(e);return e}return l(),p()}function Rt(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=Lt(e),i=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:a}=e;i?t(r,a,e):a&&(n??={},n[r]=a)}),n}var zt=Vt(`end`),Bt=Vt(`start`);function Vt(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Ht(e){let t=Bt(e),n=zt(e);if(t&&n)return{start:t,end:n}}function Ut(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Gt(e.position):`start`in e||`end`in e?Gt(e):`line`in e||`column`in e?Wt(e):``}function Wt(e){return Kt(e&&e.line)+`:`+Kt(e&&e.column)}function Gt(e){return Wt(e&&e.start)+`-`+Wt(e&&e.end)}function Kt(e){return e&&typeof e==`number`?e:1}var qt=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Ut(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Object.defineProperties(qt.prototype,{file:{configurable:!0,enumerable:!0,value:``,writable:!0},name:{configurable:!0,enumerable:!0,value:``,writable:!0},reason:{configurable:!0,enumerable:!0,value:``,writable:!0},message:{configurable:!0,enumerable:!0,value:``,writable:!0},stack:{configurable:!0,enumerable:!0,value:``,writable:!0},column:{configurable:!0,enumerable:!0,writable:!0},line:{configurable:!0,enumerable:!0,writable:!0},ancestors:{configurable:!0,enumerable:!0,writable:!0},cause:{configurable:!0,enumerable:!0,writable:!0},fatal:{configurable:!0,enumerable:!0,writable:!0},place:{configurable:!0,enumerable:!0,writable:!0},ruleId:{configurable:!0,enumerable:!0,writable:!0},source:{configurable:!0,enumerable:!0,writable:!0}});var Jt={}.hasOwnProperty,Yt=new Map,Xt=/[A-Z]/g,Zt=/-([a-z])/g,Qt=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),$t=new Set([`td`,`th`]),en=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function tn(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=pn(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=fn(n,t.jsx,t.jsxs)}let 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`?St:xt,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=nn(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function nn(e,t,n){if(t.type===`element`)return rn(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return an(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return sn(e,t,n);if(t.type===`mdxjsEsm`)return on(e,t);if(t.type===`root`)return cn(e,t,n);if(t.type===`text`)return ln(e,t)}function rn(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=yn(e,t.tagName,!1),o=mn(e,t),s=gn(e,t);return Qt.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!Ke(e)})),un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function an(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}bn(e,t.position)}function on(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);bn(e,t.position)}function sn(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=St,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:yn(e,t.name,!0),o=hn(e,t),s=gn(e,t);return un(e,o,a,t),dn(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function cn(e,t,n){let r={};return dn(r,gn(e,t)),e.create(t,e.Fragment,r,n)}function ln(e,t){return t.value}function un(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function dn(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function fn(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function pn(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Bt(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function mn(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Jt.call(t.properties,i)){let a=_n(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&$t.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function hn(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else bn(e,t.position)}else{let{name:i}=r,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else bn(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function gn(e,t){let n=[],r=-1,i=e.passKeys?new Map:Yt;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=nn(e,a,o);s!==void 0&&n.push(s)}return n}function _n(e,t,n){if(n==null||typeof n==`number`&&Number.isNaN(n))return;let r=vt(e.schema,t);return Array.isArray(n)&&(n=r.commaSeparated?Be(n):Ct(n)),r.property===`style`?[`style`,typeof n==`object`?e.stylePropertyNameCase===`dom`?n:xn(n):vn(e,String(n))]:[e.elementAttributeNameCase===`react`&&r.space?mt[r.property]||r.property:r.attribute,n]}function vn(e,t){let n={};try{Rt(t,function(t,r){if(t&&r){let i=t;i.slice(0,2)!==`--`&&(i=i.toLowerCase(),e.stylePropertyNameCase===`dom`&&(i.slice(0,4)===`-ms-`&&(i=i.slice(1)),i=i.replace(Zt,wn))),n[i]=r}})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new qt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=en+`#cannot-parse-style-attribute`,r}return n}function yn(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=We(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=We(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Jt.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);bn(e)}function bn(e,t){let n=new qt("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=en+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function xn(e){let t={},n;for(n in e)Jt.call(e,n)&&(t[Sn(n)]=e[n]);return t}function Sn(e){if(e.slice(0,2)===`--`)return e;let t=e.replace(Xt,Cn);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Cn(e){return`-`+e.toLowerCase()}function wn(e,t){return t.toUpperCase()}var Tn={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`]},En={};function Dn(e,t){let n=t||En;return On(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function On(e,t,n){if(An(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 kn(e.children,t,n)}return Array.isArray(e)?kn(e,t,n):``}function kn(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=On(e[i],t,n);return r.join(``)}function An(e){return!!(e&&typeof e==`object`)}var jn=document.createElement(`i`);function Mn(e){let t=`&`+e+`;`;jn.innerHTML=t;let n=jn.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function W(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function G(e,t){return e.length>0?(W(e,e.length,0,t),e):t}var Nn={}.hasOwnProperty;function Pn(e){let t={},n=-1;for(;++n<e.length;)Fn(t,e[n]);return t}function Fn(e,t){let n;for(n in t){let r=(Nn.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Nn.call(r,a)||(r[a]=[]);let e=i[a];In(r[a],Array.isArray(e)?e:e?[e]:[])}}}function In(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);W(e,0,0,r)}function Ln(e,t){let 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 K(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var q=Gn(/[A-Za-z]/),J=Gn(/[\dA-Za-z]/),Rn=Gn(/[#-'*+\--9=?A-Z^-~]/);function zn(e){return e!==null&&(e<32||e===127)}var Bn=Gn(/\d/),Vn=Gn(/[\dA-Fa-f]/),Hn=Gn(/[!-/:-@[-`{-~]/);function Y(e){return e!==null&&e<-2}function X(e){return e!==null&&(e<0||e===32)}function Z(e){return e===-2||e===-1||e===32}var Un=Gn(/\p{P}|\p{S}/u),Wn=Gn(/\s/);function Gn(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function Kn(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&J(e.charCodeAt(n+1))&&J(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function Q(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Z(r)?(e.enter(n),s(r)):t(r)}function s(r){return Z(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function qn(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Z(t)?(e.enter(r),c(t)):l(t)}function c(t){return Z(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var Jn={tokenize:Yn};function Yn(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Y(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var Xn=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){Zn(this,e,t,n,!1)}addBefore(e,t,n){Zn(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function Zn(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var Qn={tokenize:er},$n={tokenize:tr};function er(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new Xn;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check($n,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt($n,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Y(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new Xn;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function tr(e,t,n){return Q(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function nr(e){if(e===null||X(e)||Wn(e))return 1;if(Un(e))return 2}function rr(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var ir={name:`attention`,resolveAll:ar,tokenize:or};function ar(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};sr(o,-a),sr(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=G(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=G(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=G(r,rr(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=G(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=G(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),W(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function or(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=nr(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=nr(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function sr(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var cr={name:`autolink`,tokenize:lr};function lr(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return q(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||J(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||J(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||zn(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Rn(t)?(e.consume(t),l):n(t)}function u(e){return J(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||J(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var ur={partial:!0,tokenize:dr};function dr(e,t,n){return r;function r(t){return Z(t)?Q(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Y(e)?t(e):n(e)}}var fr={continuation:{tokenize:mr},exit:hr,name:`blockQuote`,tokenize:pr};function pr(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Z(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function mr(e,t,n){let r=this;return i;function i(t){return Z(t)?Q(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(fr,t,n)(r)}}function hr(e){e.exit(`blockQuote`)}var gr={name:`characterEscape`,tokenize:_r};function _r(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Hn(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var vr={name:`characterReference`,tokenize:yr};function yr(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=J,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=Vn,u):(e.enter(`characterReferenceValue`),a=7,o=Bn,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===J&&!Mn(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var br={partial:!0,tokenize:xr};function xr(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Sr={concrete:!0,name:`codeFenced`,tokenize:Cr};function Cr(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Y(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(br,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Z(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),Q(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Y(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Y(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Z(t)?Q(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Y(t)?e.check(br,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Z(t)?Q(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Z(t)?Q(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Y(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var wr={name:`codeIndented`,tokenize:Er},Tr={partial:!0,tokenize:Dr};function Er(e,t,n){return r;function r(t){return e.enter(`codeIndented`),qn(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Y(t)?e.attempt(Tr,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Y(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Dr(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Y(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):qn(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Y(e)?i(e):n(e)}}var Or={name:`codeText`,previous:Ar,resolve:kr,tokenize:jr};function kr(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 Ar(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function jr(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Y(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Mr=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Nr(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Nr(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Nr(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Nr(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Nr(this.left,t.reverse())}}}};function Nr(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 Pr(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Mr(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Fr(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return W(e,0,1/0,u.slice(0)),!l}function Fr(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Ir={resolve:Rr,tokenize:zr},Lr={partial:!0,tokenize:Br};function Rr(e){return Pr(e),e}function zr(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Y(t)?e.check(Lr,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Br(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,a,`linePrefix`)}function a(i){if(i===null||Y(i))return n(i);let 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(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Vr(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||zn(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Y(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||X(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||zn(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Hr(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Y(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Y(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Z(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function Ur(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Y(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),Q(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Y(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function Wr(e,t){let n;return r;function r(i){return Y(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Z(i)?Q(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var Gr={name:`definition`,tokenize:qr},Kr={partial:!0,tokenize:Jr};function qr(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Hr.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return X(t)?Wr(e,l)(t):l(t)}function l(t){return Vr(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(Kr,d,d)(t)}function d(t){return Z(t)?Q(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Y(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function Jr(e,t,n){return r;function r(t){return X(t)?Wr(e,i)(t):n(t)}function i(t){return Ur(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Z(t)?Q(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Y(e)?t(e):n(e)}}var Yr={name:`hardBreakEscape`,tokenize:Xr};function Xr(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Y(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var Zr={name:`headingAtx`,resolve:Qr,tokenize:$r};function Qr(e,t){let n=e.length-2,r=3;if(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){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};W(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function $r(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||X(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Y(n)?(e.exit(`atxHeading`),t(n)):Z(n)?Q(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||X(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ei=`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`.split(`.`),ti=[`pre`,`script`,`style`,`textarea`],ni={concrete:!0,name:`htmlFlow`,resolveTo:ii,tokenize:ai},ri={partial:!0,tokenize:oi};function ii(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 ai(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:re):q(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):q(a)?(e.consume(a),i=4,r.interrupt?t:re):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:re):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:O:m):n(i)}function h(t){return q(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||X(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&ti.includes(l)?(i=1,r.interrupt?t(s):O(s)):ei.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):O(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||J(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:O):n(i)}function v(t){return Z(t)?(e.consume(t),v):E(t)}function y(t){return t===47?(e.consume(t),E):t===58||t===95||q(t)?(e.consume(t),b):Z(t)?(e.consume(t),y):E(t)}function b(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Z(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Z(t)?(e.consume(t),S):w(t)}function C(t){return t===c?(e.consume(t),c=null,T):t===null||Y(t)?n(t):(e.consume(t),C)}function w(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||X(t)?x(t):(e.consume(t),w)}function T(e){return e===47||e===62||Z(e)?y(e):n(e)}function E(t){return t===62?(e.consume(t),D):n(t)}function D(t){return t===null||Y(t)?O(t):Z(t)?(e.consume(t),D):n(t)}function O(t){return t===45&&i===2?(e.consume(t),j):t===60&&i===1?(e.consume(t),M):t===62&&i===4?(e.consume(t),ie):t===63&&i===3?(e.consume(t),re):t===93&&i===5?(e.consume(t),ne):Y(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(ri,ae,k)(t)):t===null||Y(t)?(e.exit(`htmlFlowData`),k(t)):(e.consume(t),O)}function k(t){return e.check(br,A,ae)(t)}function A(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ee}function ee(t){return t===null||Y(t)?k(t):(e.enter(`htmlFlowData`),O(t))}function j(t){return t===45?(e.consume(t),re):O(t)}function M(t){return t===47?(e.consume(t),o=``,te):O(t)}function te(t){if(t===62){let n=o.toLowerCase();return ti.includes(n)?(e.consume(t),ie):O(t)}return q(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),te):O(t)}function ne(t){return t===93?(e.consume(t),re):O(t)}function re(t){return t===62?(e.consume(t),ie):t===45&&i===2?(e.consume(t),re):O(t)}function ie(t){return t===null||Y(t)?(e.exit(`htmlFlowData`),ae(t)):(e.consume(t),ie)}function ae(n){return e.exit(`htmlFlow`),t(n)}}function oi(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(ur,t,n)}}var si={name:`htmlText`,tokenize:ci};function ci(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):q(t)?(e.consume(t),w):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):q(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Y(t)?(o=d,M(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?j(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Y(t)?(o=h,M(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?j(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?j(t):Y(t)?(o=v,M(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Y(t)?(o=y,M(t)):(e.consume(t),y)}function b(e){return e===62?j(e):y(e)}function x(t){return q(t)?(e.consume(t),S):n(t)}function S(t){return t===45||J(t)?(e.consume(t),S):C(t)}function C(t){return Y(t)?(o=C,M(t)):Z(t)?(e.consume(t),C):j(t)}function w(t){return t===45||J(t)?(e.consume(t),w):t===47||t===62||X(t)?T(t):n(t)}function T(t){return t===47?(e.consume(t),j):t===58||t===95||q(t)?(e.consume(t),E):Y(t)?(o=T,M(t)):Z(t)?(e.consume(t),T):j(t)}function E(t){return t===45||t===46||t===58||t===95||J(t)?(e.consume(t),E):D(t)}function D(t){return t===61?(e.consume(t),O):Y(t)?(o=D,M(t)):Z(t)?(e.consume(t),D):T(t)}function O(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,k):Y(t)?(o=O,M(t)):Z(t)?(e.consume(t),O):(e.consume(t),A)}function k(t){return t===i?(e.consume(t),i=void 0,ee):t===null?n(t):Y(t)?(o=k,M(t)):(e.consume(t),k)}function A(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||X(t)?T(t):(e.consume(t),A)}function ee(e){return e===47||e===62||X(e)?T(e):n(e)}function j(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function M(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),te}function te(t){return Z(t)?Q(e,ne,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):ne(t)}function ne(t){return e.enter(`htmlTextData`),o(t)}}var li={name:`labelEnd`,resolveAll:pi,resolveTo:mi,tokenize:hi},ui={tokenize:gi},di={tokenize:_i},fi={tokenize:vi};function pi(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&W(e,0,e.length,n),e}function mi(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=G(o,e.slice(i+1,i+r+3)),o=G(o,[[`enter`,l,t]]),o=G(o,rr(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=G(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=G(o,e.slice(a+1)),o=G(o,[[`exit`,s,t]]),W(e,i,e.length,o),e}function hi(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(K(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(ui,u,o?u:d)(t):t===91?e.attempt(di,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(fi,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function gi(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return X(t)?Wr(e,a)(t):a(t)}function a(t){return t===41?u(t):Vr(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return X(t)?Wr(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?Ur(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return X(t)?Wr(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function _i(e,t,n){let r=this;return i;function i(t){return Hr.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(K(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function vi(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var yi={name:`labelStartImage`,resolveAll:li.resolveAll,tokenize:bi};function bi(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var xi={name:`labelStartLink`,resolveAll:li.resolveAll,tokenize:Si};function Si(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ci={name:`lineEnding`,tokenize:wi};function wi(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),Q(e,t,`linePrefix`)}}var Ti={name:`thematicBreak`,tokenize:Ei};function Ei(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Y(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Z(t)?Q(e,s,`whitespace`)(t):s(t))}}var $={continuation:{tokenize:Ai},exit:Mi,name:`list`,tokenize:ki},Di={partial:!0,tokenize:Ni},Oi={partial:!0,tokenize:ji};function ki(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Bn(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Ti,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Bn(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(ur,r.interrupt?n:u,e.attempt(Di,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Z(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Ai(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(ur,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Q(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Z(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Oi,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,Q(e,e.attempt($,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function ji(e,t,n){let r=this;return Q(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Mi(e){e.exit(this.containerState.type)}function Ni(e,t,n){let r=this;return Q(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Z(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Pi={name:`setextUnderline`,resolveTo:Fi,tokenize:Ii};function Fi(e,t){let n=new Xn,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function Ii(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Z(t)?Q(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Y(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Li={tokenize:Ri};function Ri(e){let t=this,n=e.attempt(ur,r,e.attempt(this.parser.constructs.flowInitial,i,Q(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Ir,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var zi={resolveAll:Ui()},Bi=Hi(`string`),Vi=Hi(`text`);function Hi(e){return{resolveAll:Ui(e===`text`?Wi:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function Ui(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):t[r]&&t[r][1].type===`data`||(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function Wi(e,t){let n=new Xn,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var Gi=c({attentionMarkers:()=>$i,contentInitial:()=>qi,disable:()=>ea,document:()=>Ki,flow:()=>Yi,flowInitial:()=>Ji,insideSpan:()=>Qi,string:()=>Xi,text:()=>Zi}),Ki={42:$,43:$,45:$,48:$,49:$,50:$,51:$,52:$,53:$,54:$,55:$,56:$,57:$,62:fr},qi={91:Gr},Ji={[-2]:wr,[-1]:wr,32:wr},Yi={35:Zr,42:Ti,45:[Pi,Ti],60:ni,61:Pi,95:Ti,96:Sr,126:Sr},Xi={38:vr,92:gr},Zi={[-5]:Ci,[-4]:Ci,[-3]:Ci,33:yi,38:vr,42:ir,60:[cr,si],91:xi,92:[Yr,gr],93:li,95:ir,96:Or},Qi={null:[ir,zi]},$i={null:[42,95]},ea={null:[]};function ta(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=G(o,e),g(),o[o.length-1]===null?(w(t,0),l.events=rr(a,l.events,l),l.events):[]}function f(e,t){return ra(p(e),t)}function p(e){return na(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,E()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Y(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,E()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){w(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=T(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function w(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&W(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function T(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,E()}}function E(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function na(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function ra(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
4
4
|
`;break;case-3:o=`\r
|
|
5
5
|
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function ia(e){let t={constructs:Pn([Gi,...(e||{}).extensions||[]]),content:n(Jn),defined:[],document:n(Qn),flow:n(Li),lazy:{},string:n(Bi),text:n(Vi)};return t;function n(e){return n;function n(n){return ta(t,e,n)}}}function aa(e){for(;!Pr(e););return e}var oa=/[\0\t\n\r]/g;function sa(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){oa.lastIndex=c;let n=oa.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var ca=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function la(e){return e.replace(ca,ua)}function ua(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Ln(n.slice(t?2:1),t?16:10)}return Mn(n)||e}var da={}.hasOwnProperty;function fa(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),pa(n)(aa(ia(n).document().write(sa()(e,t,!0))))}function pa(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(ye),autolinkProtocol:E,autolinkEmail:E,atxHeading:o(he),blockQuote:o(I),characterEscape:E,characterReference:E,codeFenced:o(de),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(de,s),codeText:o(fe,s),codeTextData:E,data:E,codeFlowValue:E,definition:o(pe),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(me),hardBreakEscape:o(ge),hardBreakTrailing:o(ge),htmlFlow:o(_e,s),htmlFlowData:E,htmlText:o(_e,s),htmlTextData:E,image:o(ve),label:s,link:o(ye),listItem:o(xe),listItemValue:p,listOrdered:o(be,f),listUnordered:o(be),paragraph:o(Se),reference:se,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(he),strong:o(L),thematicBreak:o(we)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:F,autolinkProtocol:ue,blockQuote:l(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:P,characterReferenceMarkerNumeric:P,characterReferenceValue:ce,characterReference:le,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:D,codeIndented:l(v),codeText:l(j),codeTextData:D,data:D,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(k),hardBreakTrailing:l(k),htmlFlow:l(A),htmlFlowData:D,htmlText:l(ee),htmlTextData:D,image:l(te),label:re,labelText:ne,lineEnding:O,link:l(M),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:N,resourceDestinationString:ie,resourceTitleString:ae,resource:oe,setextHeading:l(T),setextHeadingLineSequence:w,setextHeadingText:C,strong:l(),thematicBreak:l()}};ha(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),da.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||_a).call(o,void 0,e[0])}for(r.position={start:ma(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:ma(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:ma(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Ut({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||_a).call(this,e,r[0])),n.position.end=ma(e.end)}function d(){return Dn(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=K(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function w(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function T(){this.data.setextHeadingSlurpLineEnding=void 0}function E(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];n&&n.type===`text`||(n=Ce(),n.position={start:ma(e.start),end:void 0},t.push(n)),this.stack.push(n)}function D(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=ma(e.end)}function O(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=ma(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(E.call(this,e),D.call(this,e))}function k(){this.data.atHardBreak=!0}function A(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ee(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function j(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function M(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function te(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ne(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=la(t),n.identifier=K(t).toLowerCase()}function re(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function ae(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function oe(){this.data.inReference=void 0}function se(){this.data.referenceType=`collapsed`}function N(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=K(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function P(e){this.data.characterReferenceType=e.type}function ce(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Ln(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Mn(t);let i=this.stack[this.stack.length-1];i.value+=r}function le(e){let t=this.stack.pop();t.position.end=ma(e.end)}function ue(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function F(e){D.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function I(){return{type:`blockquote`,children:[],position:void 0}}function de(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function fe(){return{type:`inlineCode`,value:``,position:void 0}}function pe(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function me(){return{type:`emphasis`,children:[],position:void 0}}function he(){return{type:`heading`,depth:0,children:[],position:void 0}}function ge(){return{type:`break`,position:void 0}}function _e(){return{type:`html`,value:``,position:void 0}}function ve(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function ye(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function be(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function xe(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Se(){return{type:`paragraph`,children:[],position:void 0}}function L(){return{type:`strong`,children:[],position:void 0}}function Ce(){return{type:`text`,value:``,position:void 0}}function we(){return{type:`thematicBreak`,position:void 0}}}function ma(e){return{line:e.line,column:e.column,offset:e.offset}}function ha(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?ha(e,r):ga(e,r)}}function ga(e,t){let n;for(n in t)if(da.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function _a(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Ut({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Ut({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Ut({start:t.start,end:t.end})+`) is still open`)}function va(e){let t=this;t.parser=n;function n(n){return fa(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function ya(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function ba(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
6
6
|
`}]}function xa(e,t){let n=t.value?t.value+`
|
|
@@ -12,7 +12,7 @@ import{N as e,X as t,a as n,at as r,et as i,it as a,nt as o,ot as s,rt as c,st a
|
|
|
12
12
|
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
13
13
|
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
14
14
|
`}),n}function Lo(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Ro(e,t){let n=Mo(e,t),r=n.one(e,void 0),i=mo(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
15
|
-
`},i)),a}function zo(e,t){return e&&`run`in e?async function(n,r){let i=Ro(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ro(n,{file:r,...e||t})}}function Bo(e){if(e)throw e}var Vo=r(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ho(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Uo(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Wo(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Wo(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Go={basename:Ko,dirname:qo,extname:Jo,join:Yo,sep:`/`};function Ko(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Qo(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qo(e){if(Qo(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Jo(e){Qo(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Yo(...e){let t=-1,n;for(;++t<e.length;)Qo(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Xo(n)}function Xo(e){Qo(e);let t=e.codePointAt(0)===47,n=Zo(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Zo(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Qo(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $o={cwd:es};function es(){return`/`}function ts(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ns(e){if(typeof e==`string`)e=new URL(e);else if(!ts(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return rs(e)}function rs(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var is=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],as=class{constructor(e){let t;t=e?ts(e)?{path:e}:typeof e==`string`||ls(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:$o.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<is.length;){let e=is[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)is.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Go.basename(this.path):void 0}set basename(e){ss(e,`basename`),os(e,`basename`),this.path=Go.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Go.dirname(this.path):void 0}set dirname(e){cs(this.basename,`dirname`),this.path=Go.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Go.extname(this.path):void 0}set extname(e){if(os(e,`extname`),cs(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Go.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ts(e)&&(e=ns(e)),ss(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Go.basename(this.path,this.extname):void 0}set stem(e){ss(e,`stem`),os(e,`stem`),this.path=Go.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new qt(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function os(e,t){if(e&&e.includes(Go.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Go.sep+"`")}function ss(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function cs(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ls(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var us=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ds=l(Vo(),1),fs={}.hasOwnProperty,ps=new class e extends us{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Uo()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ds.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(gs(`data`,this.frozen),this.namespace[e]=t,this):fs.call(this.namespace,e)&&this.namespace[e]||void 0:e?(gs(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ys(e),n=this.parser||this.Parser;return ms(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ms(`process`,this.parser||this.Parser),hs(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ys(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xs(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ms(`processSync`,this.parser||this.Parser),hs(`processSync`,this.compiler||this.Compiler),this.process(e,r),vs(`processSync`,`process`,t),n;function r(e,r){t=!0,Bo(e),n=r}}run(e,t,n){_s(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ys(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),vs(`runSync`,`run`,n),r;function i(e,t){Bo(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ys(t),r=this.compiler||this.Compiler;return hs(`stringify`,r),_s(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(gs(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ds.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ho(o)&&Ho(r)&&(r=(0,ds.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ms(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function hs(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function gs(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _s(e){if(!Ho(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function vs(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ys(e){return bs(e)?e:new as(e)}function bs(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xs(e){return typeof e==`string`||Ss(e)}function Ss(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Cs=[],ws={allowDangerousHtml:!0},Ts=/^(https?|ircs?|mailto|xmpp)$/i,Es=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ds(e){let t=Os(e),n=ks(e);return As(t.runSync(t.parse(n),n),e)}function Os(e){let t=e.rehypePlugins||Cs,n=e.remarkPlugins||Cs,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ws}:ws;return ps().use(va).use(n).use(zo,r).use(t)}function ks(e){let t=e.children||``,n=new as;return typeof t==`string`?n.value=t:``+t,n}function As(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||js;for(let e of Es)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Do(e,l),tn(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Tn)if(Object.hasOwn(Tn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Tn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function js(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ts.test(e.slice(0,t))?e:``}var Ms=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],Ns={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...Ms,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...Ms],h2:[[`className`,`sr-only`]],img:[...Ms,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...Ms,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...Ms],table:[...Ms],ul:[...Ms,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},Ps={}.hasOwnProperty;function Fs(e,t){let n={type:`root`,children:[]},r=Is({schema:t?{...Ns,...t}:Ns,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Is(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Ls(e,n);case`doctype`:return Rs(e,n);case`element`:return zs(e,n);case`root`:return Bs(e,n);case`text`:return Vs(e,n)}}}function Ls(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return Js(r,t),r}}function Rs(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Js(e,t),e}}function zs(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Hs(e,t.children),i=Us(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Ps.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return Js(o,t),o}function Bs(e,t){let n={type:`root`,children:Hs(e,t.children)};return Js(n,t),n}function Vs(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return Js(n,t),n}function Hs(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Is(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Us(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Ps.call(r,n)?r[n]:void 0,o=r&&Ps.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(Ps.call(s,l)){let t=s[l],n=Ws(e,Ys(a,l),l,t);n??=Ws(e,Ys(o,l),l,t),n!=null&&(c[l]=n)}if(i&&Ps.call(i,n)){let e=i[n];for(l in e)Ps.call(e,l)&&!Ps.call(c,l)&&(c[l]=e[l])}return c}function Ws(e,t,n,r){return t?Array.isArray(r)?Gs(e,t,n,r):Ks(e,t,n,r):void 0}function Gs(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Ks(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Ks(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&qs(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function qs(e,t,n){let r=e.schema.protocols&&Ps.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function Js(e,t){let n=Ht(t);t.data&&(e.data=uo(t.data)),n&&(e.position=n)}function Ys(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Xs(e){return function(t){return Fs(t,e)}}function Zs(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Qs(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function $s(e,t,n){let r=ho((n||{}).ignore||[]),i=ec(t),a=-1;for(;++a<i.length;)To(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return wo}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i!==!1){if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(i===!1||d[0].length===0){let t=e.value.codePointAt(n)||0;o.lastIndex=n+(/[uv]/.test(o.flags)&&t>65535?2:1)}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function ec(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([tc(e[0]),nc(e[1])])}return t}function tc(e){return typeof e==`string`?new RegExp(Qs(e),`g`):e}function nc(e){return typeof e==`function`?e:function(){return e}}var rc=`phrasing`,ic=[`autolink`,`link`,`image`,`label`];function ac(){return{transforms:[pc],enter:{literalAutolink:sc,literalAutolinkEmail:cc,literalAutolinkHttp:cc,literalAutolinkWww:cc},exit:{literalAutolink:fc,literalAutolinkEmail:dc,literalAutolinkHttp:lc,literalAutolinkWww:uc}}}function oc(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:rc,notInConstruct:ic},{character:`.`,before:`[Ww]{3}`,inConstruct:rc,notInConstruct:ic},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:rc,notInConstruct:ic}]}}function sc(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function cc(e){this.config.enter.autolinkProtocol.call(this,e)}function lc(e){this.config.exit.autolinkProtocol.call(this,e)}function uc(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function dc(e){this.config.exit.autolinkEmail.call(this,e)}function fc(e){this.exit(e)}function pc(e){$s(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,mc],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,_c],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,gc],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,hc]],{ignore:[`link`,`linkReference`]})}function mc(e,t,n,r,i){if(!bc(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),Un(n.charCodeAt(0))||!vc(n))return!1;let o=yc(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function hc(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function gc(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function _c(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function vc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function yc(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=Zs(e,`(`),a=Zs(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function bc(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Wn(t)||Un(t)}Ac.peek=kc;function xc(){this.buffer()}function Sc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Cc(){this.buffer()}function wc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Tc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ec(e){this.exit(e)}function Dc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Oc(e){this.exit(e)}function kc(){return`[`}function Ac(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function jc(){return{enter:{gfmFootnoteCallString:xc,gfmFootnoteCall:Sc,gfmFootnoteDefinitionLabelString:Cc,gfmFootnoteDefinition:wc},exit:{gfmFootnoteCallString:Tc,gfmFootnoteCall:Ec,gfmFootnoteDefinitionLabelString:Dc,gfmFootnoteDefinition:Oc}}}function Mc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ac},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
15
|
+
`},i)),a}function zo(e,t){return e&&`run`in e?async function(n,r){let i=Ro(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Ro(n,{file:r,...e||t})}}function Bo(e){if(e)throw e}var Vo=o(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Ho(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Uo(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Wo(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Wo(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var Go={basename:Ko,dirname:qo,extname:Jo,join:Yo,sep:`/`};function Ko(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);Qo(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function qo(e){if(Qo(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function Jo(e){Qo(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function Yo(...e){let t=-1,n;for(;++t<e.length;)Qo(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:Xo(n)}function Xo(e){Qo(e);let t=e.codePointAt(0)===47,n=Zo(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function Zo(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function Qo(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var $o={cwd:es};function es(){return`/`}function ts(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function ns(e){if(typeof e==`string`)e=new URL(e);else if(!ts(e)){let t=TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code=`ERR_INVALID_ARG_TYPE`,t}if(e.protocol!==`file:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return rs(e)}function rs(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var is=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],as=class{constructor(e){let t;t=e?ts(e)?{path:e}:typeof e==`string`||ls(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:$o.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<is.length;){let e=is[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)is.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?Go.basename(this.path):void 0}set basename(e){ss(e,`basename`),os(e,`basename`),this.path=Go.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?Go.dirname(this.path):void 0}set dirname(e){cs(this.basename,`dirname`),this.path=Go.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?Go.extname(this.path):void 0}set extname(e){if(os(e,`extname`),cs(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=Go.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ts(e)&&(e=ns(e)),ss(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?Go.basename(this.path,this.extname):void 0}set stem(e){ss(e,`stem`),os(e,`stem`),this.path=Go.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new qt(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function os(e,t){if(e&&e.includes(Go.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+Go.sep+"`")}function ss(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function cs(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function ls(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var us=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),ds=i(Vo(),1),fs={}.hasOwnProperty,ps=new class e extends us{constructor(){super(`copy`),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=Uo()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,ds.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(gs(`data`,this.frozen),this.namespace[e]=t,this):fs.call(this.namespace,e)&&this.namespace[e]||void 0:e?(gs(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=ys(e),n=this.parser||this.Parser;return ms(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),ms(`process`,this.parser||this.Parser),hs(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=ys(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);xs(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),ms(`processSync`,this.parser||this.Parser),hs(`processSync`,this.compiler||this.Compiler),this.process(e,r),vs(`processSync`,`process`,t),n;function r(e,r){t=!0,Bo(e),n=r}}run(e,t,n){_s(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=ys(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),vs(`runSync`,`run`,n),r;function i(e,t){Bo(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=ys(t),r=this.compiler||this.Compiler;return hs(`stringify`,r),_s(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(gs(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");o(e.plugins),e.settings&&(r.settings=(0,ds.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Ho(o)&&Ho(r)&&(r=(0,ds.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function ms(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function hs(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function gs(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function _s(e){if(!Ho(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function vs(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function ys(e){return bs(e)?e:new as(e)}function bs(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function xs(e){return typeof e==`string`||Ss(e)}function Ss(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var Cs=[],ws={allowDangerousHtml:!0},Ts=/^(https?|ircs?|mailto|xmpp)$/i,Es=[{from:`astPlugins`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowDangerousHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`allowNode`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowElement`},{from:`allowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`allowedElements`},{from:`className`,id:`remove-classname`},{from:`disallowedTypes`,id:`replace-allownode-allowedtypes-and-disallowedtypes`,to:`disallowedElements`},{from:`escapeHtml`,id:`remove-buggy-html-in-markdown-parser`},{from:`includeElementIndex`,id:`#remove-includeelementindex`},{from:`includeNodeIndex`,id:`change-includenodeindex-to-includeelementindex`},{from:`linkTarget`,id:`remove-linktarget`},{from:`plugins`,id:`change-plugins-to-remarkplugins`,to:`remarkPlugins`},{from:`rawSourcePos`,id:`#remove-rawsourcepos`},{from:`renderers`,id:`change-renderers-to-components`,to:`components`},{from:`source`,id:`change-source-to-children`,to:`children`},{from:`sourcePos`,id:`#remove-sourcepos`},{from:`transformImageUri`,id:`#add-urltransform`,to:`urlTransform`},{from:`transformLinkUri`,id:`#add-urltransform`,to:`urlTransform`}];function Ds(e){let t=Os(e),n=ks(e);return As(t.runSync(t.parse(n),n),e)}function Os(e){let t=e.rehypePlugins||Cs,n=e.remarkPlugins||Cs,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ws}:ws;return ps().use(va).use(n).use(zo,r).use(t)}function ks(e){let t=e.children||``,n=new as;return typeof t==`string`?n.value=t:``+t,n}function As(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||js;for(let e of Es)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Do(e,l),tn(e,{Fragment:F.Fragment,components:i,ignoreInvalidStyle:!0,jsx:F.jsx,jsxs:F.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Tn)if(Object.hasOwn(Tn,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Tn[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function js(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ts.test(e.slice(0,t))?e:``}var Ms=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],Ns={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...Ms,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...Ms],h2:[[`className`,`sr-only`]],img:[...Ms,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...Ms,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...Ms],table:[...Ms],ul:[...Ms,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},Ps={}.hasOwnProperty;function Fs(e,t){let n={type:`root`,children:[]},r=Is({schema:t?{...Ns,...t}:Ns,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function Is(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return Ls(e,n);case`doctype`:return Rs(e,n);case`element`:return zs(e,n);case`root`:return Bs(e,n);case`text`:return Vs(e,n)}}}function Ls(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return Js(r,t),r}}function Rs(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return Js(e,t),e}}function zs(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=Hs(e,t.children),i=Us(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&Ps.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return Js(o,t),o}function Bs(e,t){let n={type:`root`,children:Hs(e,t.children)};return Js(n,t),n}function Vs(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return Js(n,t),n}function Hs(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=Is(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function Us(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&Ps.call(r,n)?r[n]:void 0,o=r&&Ps.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(Ps.call(s,l)){let t=s[l],n=Ws(e,Ys(a,l),l,t);n??=Ws(e,Ys(o,l),l,t),n!=null&&(c[l]=n)}if(i&&Ps.call(i,n)){let e=i[n];for(l in e)Ps.call(e,l)&&!Ps.call(c,l)&&(c[l]=e[l])}return c}function Ws(e,t,n,r){return t?Array.isArray(r)?Gs(e,t,n,r):Ks(e,t,n,r):void 0}function Gs(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=Ks(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function Ks(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&qs(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function qs(e,t,n){let r=e.schema.protocols&&Ps.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function Js(e,t){let n=Ht(t);t.data&&(e.data=uo(t.data)),n&&(e.position=n)}function Ys(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function Xs(e){return function(t){return Fs(t,e)}}function Zs(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function Qs(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function $s(e,t,n){let r=ho((n||{}).ignore||[]),i=ec(t),a=-1;for(;++a<i.length;)To(e,o);function o(e,t,n){if(e.type===`text`&&typeof n==`number`)return s(e,t,n);if(r(e,n,t[t.length-1]))return wo}function s(e,t,n){let r=t[t.length-1],o=i[a][0],s=i[a][1],c=0,l=!1,u=[];o.lastIndex=0;let d=o.exec(e.value);for(;d;){let n=d.index,r={index:d.index,input:d.input,stack:[...t,e]},i=s(...d,r);if(typeof i==`string`&&(i=i.length>0?{type:`text`,value:i}:void 0),i!==!1){if(c!==n&&f({type:`text`,value:e.value.slice(c,n)}),Array.isArray(i))for(let e of i)f(e);else i&&f(i);c=n+d[0].length,l=!0}if(i===!1||d[0].length===0){let t=e.value.codePointAt(n)||0;o.lastIndex=n+(/[uv]/.test(o.flags)&&t>65535?2:1)}if(!o.global)break;d=o.exec(e.value)}return l?(c<e.value.length&&f({type:`text`,value:e.value.slice(c)}),r.children.splice(n,1,...u)):u=[e],n+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function ec(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([tc(e[0]),nc(e[1])])}return t}function tc(e){return typeof e==`string`?new RegExp(Qs(e),`g`):e}function nc(e){return typeof e==`function`?e:function(){return e}}var rc=`phrasing`,ic=[`autolink`,`link`,`image`,`label`];function ac(){return{transforms:[pc],enter:{literalAutolink:sc,literalAutolinkEmail:cc,literalAutolinkHttp:cc,literalAutolinkWww:cc},exit:{literalAutolink:fc,literalAutolinkEmail:dc,literalAutolinkHttp:lc,literalAutolinkWww:uc}}}function oc(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:rc,notInConstruct:ic},{character:`.`,before:`[Ww]{3}`,inConstruct:rc,notInConstruct:ic},{character:`:`,before:`[PSps]`,after:`\\/`,inConstruct:rc,notInConstruct:ic}]}}function sc(e){this.enter({type:`link`,title:null,url:``,children:[],position:void 0},e)}function cc(e){this.config.enter.autolinkProtocol.call(this,e)}function lc(e){this.config.exit.autolinkProtocol.call(this,e)}function uc(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function dc(e){this.config.exit.autolinkEmail.call(this,e)}function fc(e){this.exit(e)}function pc(e){$s(e,[[/(?<![\da-z])(https?:\/\/|www(?=\.))([\w-]*\.[\w\-.]*)([^\t\n\r ]*)/gi,mc],[/(?<![\w+\-.@])xmpp:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)(\/(?:[\w\-/]|\.(?=[\dA-Za-z]))*)?/g,_c],[/(?<![\w+\-.@])mailto:([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,gc],[/(?<![\w+\-.]|(?:^|[^\d@A-Za-z])(?:mailto|xmpp):)([\w+\-.]+)@([\w-]+(?:\.[\w-]+)+)/g,hc]],{ignore:[`link`,`linkReference`]})}function mc(e,t,n,r,i){if(!bc(i))return!1;let a=``;if(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),Un(n.charCodeAt(0))||!vc(n))return!1;let o=yc(n+r),s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0],position:void 0}],position:void 0};return o[1]?[s,{type:`text`,value:o[1],position:void 0}]:s}function hc(e,t,n){return!/[\d\-_]$/.test(n)&&{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n,position:void 0}],position:void 0}}function gc(e,t,n){if(/[\d\-_]$/.test(n))return!1;let r=`mailto:`+t+`@`+n;return{type:`link`,title:null,url:r,children:[{type:`text`,value:r,position:void 0}],position:void 0}}function _c(e,t,n,r,i){if(/[\d\-_]$/.test(n)||r&&(!/[A-Za-z]$/.test(r)||i.input.charAt(i.index+e.length)===`@`))return!1;let a=`xmpp:`+t+`@`+n+(r||``);return{type:`link`,title:null,url:a,children:[{type:`text`,value:a,position:void 0}],position:void 0}}function vc(e){let t=e.split(`.`);return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[\dA-Za-z]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[\dA-Za-z]/.test(t[t.length-2])))}function yc(e){let t=e.length;for(;t>0;){let n=e.charCodeAt(t-1);if(n===33||n===34||n===38||n===39||n===41||n===44||n===46||n===58||n===59||n===60||n===62||n===63||n===93||n===125)t--;else break}if(t===e.length)return[e,void 0];let n=e.slice(t);e=e.slice(0,t);let r=n.indexOf(`)`),i=Zs(e,`(`),a=Zs(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function bc(e){let t=e.input.charCodeAt(e.index-1);return e.index===0||Wn(t)||Un(t)}Ac.peek=kc;function xc(){this.buffer()}function Sc(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function Cc(){this.buffer()}function wc(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function Tc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Ec(e){this.exit(e)}function Dc(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=K(this.sliceSerialize(e)).toLowerCase(),n.label=t}function Oc(e){this.exit(e)}function kc(){return`[`}function Ac(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function jc(){return{enter:{gfmFootnoteCallString:xc,gfmFootnoteCall:Sc,gfmFootnoteDefinitionLabelString:Cc,gfmFootnoteDefinition:wc},exit:{gfmFootnoteCallString:Tc,gfmFootnoteCall:Ec,gfmFootnoteDefinitionLabelString:Dc,gfmFootnoteDefinition:Oc}}}function Mc(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ac},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
16
16
|
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?Pc:Nc))),s(),o}}function Nc(e,t,n){return t===0?e:Pc(e,t,n)}function Pc(e,t,n){return(n?``:` `)+e}var Fc=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];Bc.attention=Vc,Bc.peek=Hc;function Ic(){return{canContainEols:[`delete`],enter:{strikethrough:Rc},exit:{strikethrough:zc}}}function Lc(){return{handlers:{delete:Bc},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:Fc}]}}function Rc(e){this.enter({type:`delete`,children:[],position:void 0},e)}function zc(e){this.exit(e)}function Bc(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function Vc(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function Hc(){return`~`}function Uc(e){return e.length}function Wc(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||Uc,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=Gc(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=Kc(r[d]);else{let e=Kc(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u],r=n.fillRows===!1?Math.max(1,o[u===1?0:u].length):l;d=-1;let i=[];for(;++d<r;){let o=e[d]||``,s=``,l=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];if(n===114)s=` `.repeat(e);else if(n===99){let t=e/2;e%2?(s=` `.repeat(t+.5),l=` `.repeat(t-.5)):(s=` `.repeat(t),l=s)}else l=` `.repeat(e)}n.delimiterStart!==!1&&!d&&i.push(`|`),n.padding===!1||n.alignDelimiters===!1&&o===``||n.delimiterStart===!1&&!d||i.push(` `),n.alignDelimiters!==!1&&i.push(s),i.push(o),n.alignDelimiters!==!1&&i.push(l),n.padding!==!1&&i.push(` `),(n.delimiterEnd!==!1||d!==r-1)&&i.push(`|`)}m.push(n.delimiterEnd===!1?i.join(``).replace(/ +$/,``):i.join(``))}return m.join(`
|
|
17
17
|
`)}function Gc(e){return e==null?``:String(e)}function Kc(e){let t=typeof e==`string`?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}var qc=ho([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function Jc(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),Yc);return i(),o}function Yc(e,t,n){return`>`+(n?``:` `)+e}function Xc(e,t){return Zc(e,t.inConstruct,!0)&&!Zc(e,t.notInConstruct,!1)}function Zc(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function Qc(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
18
18
|
`&&!e.before&&!e.after&&Xc(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
@@ -31,4 +31,4 @@ import{N as e,X as t,a as n,at as r,et as i,it as a,nt as o,ot as s,rt as c,st a
|
|
|
31
31
|
`||f===`\r`)){let e=0;for(;e<u.length&&u.charCodeAt(e)!==93;)e+=u.charCodeAt(e)===92?2:1;u.charCodeAt(e+1)===58&&(p=``)}return!e.url&&typeof p==`string`||d?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:typeof p==`string`?` `:`)`,...o.current()}))),c(),typeof p==`string`&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(p,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function Bl(e,t,n){return Rl(e,n)?`<`:`[`}Vl.peek=Hl;function Vl(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function Hl(){return`[`}function Ul(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function Wl(e){let t=Ul(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Gl(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Kl(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function ql(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?Gl(n):Ul(n),s=e.ordered?o===`.`?`)`:`.`:Wl(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if(o!==`*`&&o!==`-`||!t||t.children&&t.children[0]||n.stack[n.stack.length-1]!==`list`||n.stack[n.stack.length-2]!==`listItem`||n.stack[n.stack.length-3]!==`list`||n.stack[n.stack.length-4]!==`listItem`||n.indexStack[n.indexStack.length-1]!==0||n.indexStack[n.indexStack.length-2]!==0||n.indexStack[n.indexStack.length-3]!==0||(c=!0),Kl(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function Jl(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Yl(e,t,n,r){let i=Jl(n),a=n.bulletCurrent||Ul(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function Xl(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function Zl(e,t,n,r){if(!e.children.some(function(e){return qc(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function Ql(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}$l.attention=eu,$l.peek=tu;function $l(e,t,n,r){let i=n.enter(`phrasing`),a=bl(e,eu,n,n.createTracker(r)),o=a?wl([a],r.before,r.after):``;return i(),o}function eu(e,t){return{construct:`strong`,markers:Ql(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function tu(e,t,n){return n.options.strong||`*`}function nu(e,t,n,r){let i=t?t.children:[],a=n.indexStack[n.indexStack.length-1];return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function ru(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function iu(e,t,n){let r=(Kl(n)+(n.options.ruleSpaces?` `:``)).repeat(ru(n));return n.options.ruleSpaces?r.slice(0,-1):r}var au={blockquote:Jc,break:Qc,code:nl,definition:al,emphasis:Tl,hardBreak:Qc,heading:kl,html:Al,image:Ml,imageReference:Pl,inlineCode:Il,link:zl,linkReference:Vl,list:ql,listItem:Yl,paragraph:Xl,root:Zl,strong:$l,text:nu,thematicBreak:iu};function ou(){return{enter:{table:su,tableData:du,tableHeader:du,tableRow:lu},exit:{codeText:fu,table:cu,tableData:uu,tableHeader:uu,tableRow:uu}}}function su(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[],position:void 0},e),this.data.inTable=!0}function cu(e){this.exit(e),this.data.inTable=void 0}function lu(e){this.enter({type:`tableRow`,children:[],position:void 0},e)}function uu(e){this.exit(e)}function du(e){this.enter({type:`tableCell`,children:[],position:void 0},e)}function fu(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,pu));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function pu(e,t){return t===`|`?t:e}function mu(e){let{tableCellPadding:t,tablePipeAlign:n,stringLength:r}=e||{},i=t?` `:`|`;return{handlers:{inlineCode:d,table:a,tableCell:s,tableRow:o},join:[hu],unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
32
32
|
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}]};function a(e,t,n,r){let i=l(e,n,r),a=i[0];if(a){let t=e.align?e.align.length:0,n=-1;if(!t)for(;++n<i.length;)i[n].length>t&&(t=i[n].length);for(;a.length<t;)a.push(``)}return c(i,e.align)}function o(e,t,n,r){let i=c([u(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
33
33
|
`))}function s(e,t,n,r){let a=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:i,after:i});return o(),a(),s}function c(e,i){return Wc(e,{align:i,alignDelimiters:n,fillRows:!1,padding:t,stringLength:r})}function l(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=u(r[i],t,n);return o(),a}function u(e,t,n){let{children:r}=e,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=s(r[i],e,t,n);return o(),a}function d(e,t,n){let r=au.inlineCode(e,t,n);if(!n.stack.includes(`tableCell`))return r;let i=[],a=0,o=r.indexOf(`|`);for(;o!==-1;){let e=o;for(;e>a&&r.charCodeAt(e-1)===92;)e--;i.push(r.slice(a,o)),(o-e)%2==0&&i.push(`\\`),a=o,o=r.indexOf(`|`,o+1)}return i.push(r.slice(a)),i.join(``)}}function hu(e,t,n,r){if(e.type===`table`&&n.type===`listItem`&&n.spread===!1&&(t.type===`definition`||t.type===`heading`&&gu(t,r)||t.type===`paragraph`||t.type===`table`))return 1}function gu(e,t){let n=!1;return Do(e,function(e){if(e.type===`break`||`value`in e&&/\r?\n|\r/.test(e.value))return n=!0,!1}),!!((!e.depth||e.depth<3)&&Dn(e)&&(t.options.setext||n))}function _u(){return{exit:{taskListCheckValueChecked:yu,taskListCheckValueUnchecked:yu,paragraph:bu}}}function vu(){return{handlers:{paragraph:xu},join:[Su]}}function yu(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function bu(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start={...n.position.start}))}}this.exit(e)}function xu(e,t,n,r){if(!t||t.type!==`listItem`||Cu(t)!==e)return au.paragraph(e,t,n,r);let i=`[`+(t.checked?`x`:` `)+`] `,a=n.createTracker(r);return a.move(i),i+au.paragraph(e.children.length>0?e:{type:`paragraph`,children:[{type:`text`,value:` `}]},t,n,{...r,...a.current()})}function Su(e,t,n){if(e.type!==`definition`||n.type!==`listItem`)return;let r=Cu(n);if(r&&n.children.indexOf(e)<n.children.indexOf(r))return 0}function Cu(e){if(typeof e.checked==`boolean`)for(let t of e.children){if(t.type===`paragraph`)return t;if(t.type!==`definition`)return}}function wu(){return[ac(),jc(),Ic(),ou(),_u()]}function Tu(e){return{extensions:[oc(),Mc(e),Lc(),mu(e),vu()]}}var Eu={tokenize:Bu,partial:!0},Du={tokenize:Vu,partial:!0},Ou={tokenize:Hu,partial:!0},ku={tokenize:Uu,partial:!0},Au={tokenize:Wu,partial:!0},ju={name:`wwwAutolink`,tokenize:Ru,previous:Gu},Mu={name:`protocolAutolink`,tokenize:zu,previous:Ku},Nu={name:`emailAutolink`,tokenize:Lu,previous:qu},Pu={};function Fu(){return{text:Pu}}for(var Iu=48;Iu<123;)Pu[Iu]=Nu,Iu++,Iu===58?Iu=65:Iu===91&&(Iu=97);Pu[43]=Nu,Pu[45]=Nu,Pu[46]=Nu,Pu[95]=Nu,Pu[72]=[Nu,Mu],Pu[104]=[Nu,Mu],Pu[87]=[Nu,ju],Pu[119]=[Nu,ju];function Lu(e,t,n){let r=this,i,a;return o;function o(t){return!Ju(t)||!qu.call(r,r.previous)||Yu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return Ju(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(Au,u,l)(t):t===45||t===95||J(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&q(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function Ru(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!Gu.call(r,r.previous)||Yu(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(Eu,e.attempt(Du,e.attempt(Ou,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function zu(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&Ku.call(r,r.previous)&&!Yu(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(q(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||zn(t)||X(t)||Wn(t)||Un(t)?n(t):e.attempt(Du,e.attempt(Ou,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function Bu(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function Vu(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(ku,c,s)(t):t===null||X(t)||Wn(t)||t!==45&&Un(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function Hu(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(ku,t,a)(o):o===null||X(o)||Wn(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function Uu(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||X(o)||Wn(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||X(e)||Wn(e)?t(e):r(e)}function a(e){return q(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):q(t)?(e.consume(t),o):n(t)}}function Wu(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return J(e)?n(e):t(e)}}function Gu(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function Ku(e){return!q(e)}function qu(e){return!(e===47||Ju(e))}function Ju(e){return e===43||e===45||e===46||e===95||J(e)}function Yu(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var Xu={tokenize:id,partial:!0};function Zu(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:td,continuation:{tokenize:nd},exit:rd}},text:{91:{name:`gfmFootnoteCall`,tokenize:ed},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:Qu,resolveTo:$u}}}}function Qu(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=K(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function $u(e,t){let n=e.length;for(;n--;)if(e[n][1].type===`labelImage`&&e[n][0]===`enter`){e[n][1];break}e[n+1][1].type=`data`,e[n+3][1].type=`gfmFootnoteCallLabelMarker`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function ed(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||X(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(K(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return X(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function td(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||X(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=K(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return X(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),Q(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function nd(e,t,n){return e.check(ur,t,e.attempt(Xu,t,n))}function rd(e){e.exit(`gfmFootnoteDefinition`)}function id(e,t,n){let r=this;return Q(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function ad(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&W(o,o.length,0,rr(s,e.slice(r+1,n),t)),W(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),W(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=nr(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=nr(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var od=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){sd(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function sd(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function cd(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function ld(){return{flow:{null:{name:`table`,tokenize:ud,resolveAll:dd}}}}function ud(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Y(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Z(t)?Q(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||X(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Z(t)?Q(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Z(t)?Q(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Y(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Z(t)?Q(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Y(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Y(n)?(e.exit(`tableRow`),t(n)):Z(n)?Q(e,C,`whitespace`)(n):(e.enter(`data`),w(n))}function w(t){return t===null||t===124||X(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?T:w)}function T(t){return t===92||t===124?(e.consume(t),w):w(t)}}function dd(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new od;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(pd(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=fd(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=fd(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=fd(f,t,o,i,n,d)):(o[0]=o[1],d=fd(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&pd(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=cd(t.events,n))}return e}function fd(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},md(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=md(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=md(t.events,n[2]),a=md(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},md(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function pd(e,t,n,r,i){let a=[],o=md(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function md(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var hd={name:`tasklistCheck`,tokenize:_d};function gd(){return{text:{91:hd}}}function _d(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return X(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Y(r)?t(r):Z(r)?e.check({tokenize:vd},t,n)(r):n(r)}}function vd(e,t,n){return Q(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function yd(e){return Pn([Fu(),Zu(),ad(e),ld(),gd()])}var bd={};function xd(e){let t=this,n=e||bd,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(yd(n)),a.push(wu()),o.push(Tu(n))}function Sd(e){try{let t=new URL(e);return t.protocol===`https:`||t.protocol===`mailto:`?t.toString():``}catch{return``}}var Cd={a:({href:e,children:t})=>{let n=Sd(e??``);return n?(0,F.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer nofollow`,children:t}):(0,F.jsx)(`span`,{children:t})},img:({alt:e})=>(0,F.jsx)(`span`,{children:e?`[${e}]`:``})},wd=(0,N.memo)(function({text:e}){return(0,F.jsx)(`div`,{className:`mosio-agent-md`,children:(0,F.jsx)(Ds,{remarkPlugins:[xd],rehypePlugins:[Xs],components:Cd,urlTransform:e=>Sd(e)||`#`,skipHtml:!0,children:e})})});function Td({text:e,chips:t}){let[n,r]=(0,N.useState)(!1);return(0,F.jsxs)(`div`,{className:`flex max-w-[280px] flex-col items-end gap-1.5 self-end`,"data-testid":`user-turn`,children:[(0,F.jsx)(`div`,{className:`rounded-xl rounded-br-sm bg-surface-hover px-3 py-2.5`,children:(0,F.jsx)(`span`,{className:`font-sans text-[13px] leading-[1.45] break-words whitespace-pre-wrap text-text-primary`,children:e})}),t.length>0&&(0,F.jsxs)(`div`,{className:`flex flex-col items-end gap-1`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[(0,F.jsx)(`span`,{className:`block font-sans text-[11px] leading-normal text-text-secondary`,children:t.map(e=>e.label).join(` · `)}),(0,F.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-expanded":n,className:`font-sans text-xs leading-normal text-accent-blue-text hover:underline`,children:`Context`})]}),n&&(0,F.jsx)(`ul`,{className:`flex flex-col items-end gap-0.5`,children:t.map((e,t)=>(0,F.jsxs)(`li`,{className:`font-sans text-[11px] text-text-secondary`,children:[e.kind,`: `,e.label]},t))})]})]})}var Ed={pending:`Pending`,in_progress:`Running`,completed:`Done`,failed:`Failed`};function Dd({tool:e}){let[t,n]=(0,N.useState)(!1),r=e.status===`failed`,i=e.status===`pending`||e.status===`in_progress`;return(0,F.jsxs)(`li`,{className:`flex flex-col`,"data-testid":`tool-call`,"data-status":e.status,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`flex h-[26px] items-center gap-2 rounded-md px-2 text-left hover:bg-surface-hover`,children:[(0,F.jsx)(De,{tone:r?`amber`:i?`blue`:`muted`}),(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-xs leading-normal text-text-primary`,children:e.title}),(0,F.jsx)(`span`,{className:P(`block font-sans text-xs leading-normal`,r?`text-accent-amber`:`text-text-secondary`),children:Ed[e.status]??e.status})]}),t&&(0,F.jsxs)(`div`,{className:`mx-2 mb-1 flex flex-col gap-1 rounded-lg border border-border-default bg-surface-ground px-2.5 py-2`,children:[(0,F.jsxs)(`span`,{className:`font-sans text-[11px] text-text-secondary`,children:[e.source===`mosio`?`Mosio tool`:`Agent tool`,` · `,e.kind,e.endedMs?` · ${((e.endedMs-e.startedMs)/1e3).toFixed(1)} s`:``]}),e.locations?.length?(0,F.jsx)(`span`,{className:`font-mono text-[11px] break-all text-text-secondary`,children:e.locations.join(`, `)}):null,e.text&&(0,F.jsx)(`pre`,{className:`max-h-40 overflow-auto font-mono text-[11px] whitespace-pre-wrap break-all text-text-primary`,children:e.text})]})]})}function Od({turn:e}){let[t,n]=(0,N.useState)(!1),r=ie(e),i=ne(e);return i?(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`flex items-center gap-1.5 self-start text-text-secondary hover:text-text-primary`,children:[(0,F.jsx)(`span`,{className:P(`block size-3 transition-transform`,t&&`rotate-90`),children:(0,F.jsx)(pe,{})}),(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal`,children:i})]}),t&&(0,F.jsx)(`ul`,{className:`flex flex-col`,"aria-label":`Tool calls`,children:r.map(e=>(0,F.jsx)(Dd,{tool:e},`${e.source}:${e.id}`))})]}):null}function kd({text:e,streaming:t,role:n=`agent`}){return n===`thought`?(0,F.jsx)(`p`,{className:`font-sans text-xs leading-normal whitespace-pre-wrap text-text-secondary italic`,children:e}):(0,F.jsxs)(`div`,{className:`font-sans text-[13px] leading-normal break-words text-text-primary`,"aria-live":t?`polite`:void 0,children:[(0,F.jsx)(wd,{text:e}),t&&(0,F.jsx)(`span`,{className:`mosio-agent-caret`,"aria-hidden":!0})]})}function Ad({entries:e}){let t=e.filter(e=>e.status===`completed`).length;return(0,F.jsxs)(we,{tone:`strong`,"data-testid":`plan-card`,children:[(0,F.jsx)(Te,{title:`Plan`,kind:`${t} of ${e.length}`}),(0,F.jsx)(`ol`,{className:`flex flex-col py-1.5`,children:e.map((e,t)=>(0,F.jsxs)(`li`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:P(`flex size-3.5 shrink-0 items-center justify-center rounded-full border`,e.status===`completed`?`border-accent-blue bg-accent-blue text-text-on-accent`:e.status===`in_progress`?`border-accent-blue`:`border-border-strong`),children:e.status===`completed`&&(0,F.jsx)(`span`,{className:`block size-2.5`,children:(0,F.jsx)(ye,{})})}),(0,F.jsx)(`span`,{className:P(`block min-w-0 flex-1 font-sans text-xs leading-normal`,e.status===`completed`?`text-text-secondary line-through decoration-text-secondary/50`:`text-text-primary`),children:e.content})]},t))})]})}var jd={read:`Read`,write_workspace:`Edit workspace`,write_project:`Change project`,render:`Render`,network:`Network`,execute:`Run command`,other:`Action`};function Md(e,t){let[n,r]=(0,N.useState)(()=>Date.now());return(0,N.useEffect)(()=>{if(!t)return;let e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[t]),Math.max(0,Math.round((e-n)/1e3))}function Nd({request:e,onAnswer:t}){let n=!e.outcome,r=Md(e.expiresAtMs,n),i=e.details,a=i.tool_call??{},o=String(i.summary??i.title??a.title??e.key),s=Array.isArray(i.locations)?i.locations:[];return(0,F.jsxs)(we,{tone:`amber`,"data-testid":`permission-request`,"data-outcome":e.outcome??`open`,children:[(0,F.jsx)(Te,{lead:(0,F.jsx)(De,{tone:`amber`}),title:o,kind:jd[e.class]??e.class}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-1 px-3 py-2`,children:[s.length>0&&(0,F.jsx)(`span`,{className:`font-mono text-[11px] break-all text-text-secondary`,children:s.join(`, `)}),(0,F.jsxs)(`span`,{className:`font-sans text-xs leading-[1.4] text-text-secondary`,children:[e.source===`mosio`?`A Mosio tool`:`The agent`,` asks to `,String(jd[e.class]??`act`).toLowerCase(),n?` · expires in ${r} s`:``]})]}),n?(0,F.jsx)(Ee,{className:`px-3 pb-3`,children:e.options.map(e=>(0,F.jsx)(L,{variant:e.kind===`allow_once`?`primary`:e.kind===`allow_always`?`outline`:`ghost`,onClick:()=>t(e.optionId),children:e.name},e.optionId))}):(0,F.jsxs)(`div`,{className:`px-3 pb-3 font-sans text-xs text-text-secondary`,children:[{allowed:`Allowed`,denied:`Denied`,expired:`Expired — denied`,cancelled:`Cancelled`}[e.outcome]??e.outcome,e.by&&e.by!==`user`?` by ${e.by}`:``]})]})}function Pd(e){let t=e.diff?.changes??[];return t.length?t.map(e=>({layer:e.id??e.pointer??e.file,change:e.kind===`element_changed`?`${String(e.before??`∅`)} → ${String(e.after??`∅`)}`:e.kind.replace(/_/g,` `)})):e.changes.map(e=>({layer:e.path,change:e.kind}))}function Fd({proposal:e}){return(0,F.jsxs)(`div`,{className:`flex flex-col border-t border-border-default py-1.5`,"data-testid":`proposal-files`,children:[(0,F.jsxs)(`span`,{className:`px-3 pb-1 font-sans text-[11px] text-text-secondary`,children:[e.changes.length,` `,e.changes.length===1?`file`:`files`]}),e.changes.map(e=>{let t=(e.flags??[]).length>0;return(0,F.jsxs)(`details`,{className:`px-3`,"data-testid":`proposal-file`,"data-flags":(e.flags??[]).join(`,`),"data-code":e.code_changed?`1`:`0`,children:[(0,F.jsxs)(`summary`,{className:`flex min-h-[26px] cursor-pointer list-none items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-mono text-[11px] text-text-primary`,title:e.path,children:e.path}),(0,F.jsx)(`span`,{className:`font-sans text-[11px] text-text-secondary`,children:e.kind}),e.code_changed&&(0,F.jsx)(`span`,{className:`rounded bg-surface-hover px-1 font-sans text-[10px] text-text-secondary`,children:`code`}),(e.flags??[]).map(e=>(0,F.jsx)(`span`,{className:`rounded bg-accent-amber-glow px-1 font-sans text-[10px] text-accent-amber`,"data-testid":`proposal-flag`,children:e},e))]}),(e.residual??[]).length>0&&(0,F.jsx)(`pre`,{className:P(`mb-1.5 max-h-40 overflow-auto rounded-md border px-2 py-1 font-mono text-[10px] leading-[1.4] whitespace-pre-wrap break-all`,t?`border-accent-amber-edge`:`border-border-default`),children:(e.residual??[]).join(`
|
|
34
|
-
`)})]},e.path)}),(e.excluded??[]).length>0&&(0,F.jsxs)(`span`,{className:`px-3 pt-1 font-sans text-[11px] text-text-secondary`,children:[`Not included (agent configuration): `,(e.excluded??[]).join(`, `)]})]})}function Id({proposal:e,version:t,onDecide:n,onOpenHistory:r,busy:i}){let[a,o]=(0,N.useState)(!1),s=Pd(e),c=a?s:s.slice(0,8),l=e.status===`pending`||e.status===`conflict`,u=e.changes.some(e=>(e.flags??[]).length>0),d=`${s.length} ${s.length===1?`change`:`changes`}`,f={pending:`${d} pending`,applied:`${d} applied`,conflict:`Conflicts with your edits`,rejected:`Discarded`,reverted:`Reverted`,applying:`Applying ${d}…`,apply_failed:`Apply did not complete`}[e.status]??e.status,p=e.status===`apply_failed`,m=e.failure?.rolled_back===!0;return(0,F.jsxs)(we,{tone:l?`amber`:`strong`,"data-testid":`revision-proposal`,"data-status":e.status,children:[(0,F.jsxs)(`div`,{className:`flex h-[38px] items-center gap-2 border-b border-border-default px-3`,children:[(0,F.jsx)(De,{tone:l||p?`amber`:`muted`}),(0,F.jsx)(`span`,{className:`block flex-1 font-sans text-[13px] font-medium leading-normal text-text-primary`,children:f}),(0,F.jsx)(`span`,{className:`block font-mono text-xs leading-normal text-text-secondary`,title:`Content digest ${e.digest??``}`,"data-testid":`proposal-digest`,children:t??(e.digest??e.revision).slice(0,8)})]}),(0,F.jsxs)(`div`,{className:`flex flex-col py-1.5`,children:[(0,F.jsx)(`span`,{className:`px-3 pb-1 font-sans text-xs text-text-secondary`,children:e.title}),c.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-xs leading-normal text-text-primary`,children:e.layer}),(0,F.jsx)(`span`,{className:`block max-w-[60%] truncate font-sans text-xs leading-normal text-text-secondary`,title:e.change,children:e.change})]},t)),s.length>8&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(!a),className:`self-start px-3 font-sans text-xs text-accent-blue-text`,children:a?`Show fewer`:`Show ${s.length-8} more`})]}),(0,F.jsx)(Fd,{proposal:e}),u&&l&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,"data-testid":`proposal-risk`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:`This change adds code or remote references. Open the flagged files before approving.`})]}),e.status===`conflict`&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:[e.conflicts.map(e=>e.path).join(`, `)||`Some files`,` changed since the agent started. Nothing was overwritten.`]})]}),p&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,"data-testid":`proposal-failure`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:[m?`The apply failed and the project was put back as it was. Ask the agent to propose the change again.`:`The apply stopped part way. Review the project; Roll back restores the revision saved just before the apply and undoes every change made since.`,e.failure?.error?.message?` (${e.failure.error.message})`:``]})]}),l?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[(0,F.jsx)(L,{variant:`primary`,disabled:i||e.status===`conflict`,onClick:()=>n(`approve`),children:`Approve`}),r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`reject`),children:`Discard run`})]}):p&&!m?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`revert`),children:`Roll back`})]}):e.status===`applied`?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`revert`),children:`Revert`})]}):null]})}function Ld({error:e,onRetry:t,onDismiss:n}){return(0,F.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,role:`alert`,"data-testid":`error-recovery`,"data-code":e.code,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:e.message}),e.fix&&(0,F.jsx)(`span`,{className:`block font-sans text-[11px] leading-[1.4] text-text-secondary`,children:e.fix}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.retryable&&t&&(0,F.jsxs)(L,{variant:`outline`,onClick:t,className:`h-7 gap-1.5`,children:[(0,F.jsx)(`span`,{className:`block size-3`,children:(0,F.jsx)(xe,{})}),`Retry`]}),n&&(0,F.jsx)(L,{variant:`ghost`,onClick:n,className:`h-7`,children:`Dismiss`}),(0,F.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-text-secondary`,children:e.code})]})]})]})}function Rd({usage:e}){if(!e||e.used==null)return null;let t=e.size?Math.min(100,Math.round(e.used/e.size*100)):null,n=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e),r=`${n(e.used)}${e.size?` / ${n(e.size)}`:``} tokens${e.cost?` · ${e.cost.amount.toFixed(2)} ${e.cost.currency}`:``}`;return(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 font-sans text-[11px] text-text-secondary`,title:`Reported by the agent`,"data-testid":`usage`,children:[t!=null&&(0,F.jsx)(`span`,{className:`block h-1 w-8 overflow-hidden rounded-full bg-border-strong`,"aria-hidden":!0,children:(0,F.jsx)(`span`,{className:`block h-full bg-accent-blue-text`,style:{width:`${t}%`}})}),r]})}function zd({turn:e,thread:t,live:n,h:r,suggestions:i}){let a=(0,N.useMemo)(()=>{for(let t=e.items.length-1;t>=0;t--)if(e.items[t].type===`text`)return t;return-1},[e.items]),o=[];e.items.forEach((i,s)=>{switch(i.type){case`text`:o.push((0,F.jsx)(kd,{text:i.text,role:i.role,streaming:n&&s===a&&s===e.items.length-1},s));break;case`permission`:{let e=t.permissions[i.requestId];e&&o.push((0,F.jsx)(Nd,{request:e,onAnswer:t=>r.onPermission(e.requestId,t)},s));break}case`proposal`:{let e=t.proposals[i.id];e&&o.push((0,F.jsx)(Id,{proposal:e,onDecide:t=>r.onProposal(e.id,t,e.digest),onOpenHistory:r.onOpenHistory},s));break}case`artifact`:{let e=t.artifacts[i.id];e&&o.push((0,F.jsx)(ze,{artifact:e,actions:r,mediaUrl:r.mediaUrl},s));break}case`error`:o.push((0,F.jsx)(Ld,{error:i.error,onRetry:r.onRetry},s));break;case`notice`:o.push((0,F.jsx)(`p`,{className:`font-sans text-xs leading-[1.4] text-text-secondary`,children:i.text},s))}});let s=e.plan&&e.plan.length>1&&(n||e.plan.some(e=>e.status!==`completed`));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,"data-testid":`agent-turn`,"data-stop":e.stopReason??``,children:[(0,F.jsx)(Od,{turn:e}),s&&(0,F.jsx)(Ad,{entries:e.plan}),o,n&&e.items.length===0&&(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Thinking…`}),e.stopReason===`cancelled`&&(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Stopped.`}),!n&&i&&i.length>0&&r.onSuggestion&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,F.jsx)(ke,{onClick:()=>r.onSuggestion(e),children:e},e))})]})}function Bd({thread:e,h:t,suggestions:n,empty:r}){let i=(0,N.useRef)(null),a=[`starting`,`running`,`awaiting_permission`,`cancelling`].includes(e.state);return(0,N.useEffect)(()=>{i.current?.scrollIntoView?.({block:`end`})},[e.lastSeq]),(0,F.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3.5 overflow-y-auto p-3`,"data-testid":`thread`,role:`log`,"aria-label":`Agent conversation`,children:[e.turns.length===0&&r,e.turns.map((r,i)=>{let o=a&&i===e.turns.length-1;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[r.user&&(0,F.jsx)(Td,{text:r.user.text,chips:r.user.chips}),(0,F.jsx)(zd,{turn:r,thread:e,live:o,h:t,suggestions:i===e.turns.length-1?n:void 0})]},r.id)}),(0,F.jsx)(`div`,{ref:i})]})}function Vd({label:e,sessions:t,providers:n,currentId:r,onSelect:i,onCreate:a,onFork:o}){let[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u=(0,N.useId)();return(0,N.useEffect)(()=>{if(!s)return;let e=e=>!l.current?.contains(e.target)&&c(!1);return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]),(0,F.jsxs)(`div`,{ref:l,className:`relative min-w-0`,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":s,"aria-controls":u,onClick:()=>c(!s),onKeyDown:e=>e.key===`Escape`&&c(!1),className:`flex h-6 max-w-[132px] items-center gap-1 rounded-md border border-border-default px-2 hover:bg-surface-hover`,"data-testid":`session-switcher`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs leading-normal text-text-secondary`,children:e}),(0,F.jsx)(`span`,{className:`block size-[11px] shrink-0 text-text-secondary`,children:(0,F.jsx)(fe,{})})]}),s&&(0,F.jsxs)(`div`,{id:u,role:`listbox`,"aria-label":`Sessions`,className:`absolute top-7 left-0 z-20 flex w-[260px] flex-col overflow-clip rounded-xl border border-border-strong bg-surface-card shadow-[0_8px_24px_var(--color-effect-drop-shadow)]`,children:[(0,F.jsxs)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:[t.length===0&&(0,F.jsx)(`div`,{className:`px-3 py-2 font-sans text-xs text-text-secondary`,children:`No sessions yet`}),t.map(e=>(0,F.jsxs)(`div`,{role:`option`,"aria-selected":e.id===r,className:P(`group flex min-h-[34px] items-center gap-2 px-3`,e.id===r&&`bg-surface-hover`),children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 flex-col text-left`,onClick:()=>{i(e.id),c(!1)},children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs text-text-primary`,children:e.title}),(0,F.jsxs)(`span`,{className:`block truncate font-sans text-[11px] text-text-secondary`,children:[e.provider,` · `,e.state,e.forked_from?` · fork`:``]})]}),o&&(0,F.jsx)(`button`,{type:`button`,className:`invisible font-sans text-[11px] text-accent-blue-text group-hover:visible`,onClick:()=>o(e.id),children:`Fork`})]},e.id))]}),(0,F.jsx)(`div`,{className:`flex flex-col border-t border-border-default py-1`,children:n.map(e=>(0,F.jsxs)(`button`,{type:`button`,disabled:!e.available,title:e.unavailable_reason??e.auth,onClick:()=>{a(e.id),c(!1)},className:`flex h-8 items-center gap-2 px-3 text-left hover:bg-surface-hover disabled:opacity-40`,children:[(0,F.jsx)(`span`,{className:`block size-3 text-accent-blue-text`,children:(0,F.jsx)(be,{})}),(0,F.jsxs)(`span`,{className:`flex-1 truncate font-sans text-xs text-text-primary`,children:[`New · `,e.name]})]},e.id))})]})]})}function Hd({chips:e,onRemoveChip:t,busy:n,disabled:r,onSend:i,onStop:a,hint:o,placeholder:s=`Direct the agent…`}){let[c,l]=(0,N.useState)(``),u=(0,N.useRef)(null),d=()=>{let e=c.trim();!e||n||r||(i(e),l(``))};return(0,N.useEffect)(()=>{let e=u.current;e&&(e.style.height=`0px`,e.style.height=`${Math.min(160,Math.max(20,e.scrollHeight))}px`)},[c]),(0,F.jsx)(`div`,{className:`shrink-0 border-t border-border-default p-3`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl border border-border-strong bg-surface-card p-2.5 focus-within:border-accent-blue-edge`,children:[e.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,"data-testid":`composer-chips`,children:e.map((e,n)=>(0,F.jsx)(Oe,{label:e.label,onRemove:t?()=>t(n):void 0},`${e.kind}:${e.label}`))}),(0,F.jsx)(`textarea`,{ref:u,rows:1,value:c,disabled:r,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),d())},placeholder:s,"aria-label":`Message the agent`,className:`min-h-5 resize-none bg-transparent font-sans text-[13px] leading-normal text-text-primary outline-none placeholder:text-text-secondary`}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`block flex-1 font-sans text-xs leading-normal text-text-secondary`,children:o??(e.length?`Selection is attached`:`Nothing selected`)}),n?(0,F.jsx)(`button`,{type:`button`,"aria-label":`Stop`,onClick:a,className:`flex size-7 items-center justify-center rounded-lg border border-border-strong text-text-primary hover:bg-surface-hover`,"data-testid":`stop`,children:(0,F.jsx)(`span`,{className:`block size-3`,children:(0,F.jsx)(ve,{})})}):(0,F.jsx)(`button`,{type:`button`,"aria-label":`Send`,onClick:d,disabled:!c.trim()||r,className:`flex size-7 items-center justify-center rounded-lg bg-accent-blue text-text-on-accent disabled:opacity-50`,"data-testid":`send`,children:(0,F.jsx)(`span`,{className:`block size-3.5`,children:(0,F.jsx)(he,{})})})]})]})})}function Ud(e){let{host:t,contextSource:n}=e,[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(0),{sessions:s}=ue(t,a),[c,l]=(0,N.useState)([]),u=e.sessionId===void 0?r:e.sessionId,d=le(t,u),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)([]);(0,N.useEffect)(()=>{t.providers().then(l).catch(()=>l([]))},[t]);let g=(0,N.useCallback)(t=>{e.sessionId===void 0&&i(t),e.onSessionChange?.(t)},[e]),_=(0,N.useCallback)(async e=>{let n=await t.createSession(e);o(e=>e+1),g(n.id)},[t,g]);(0,N.useEffect)(()=>{e.sessionId!==void 0||r||(s[0]?i(s[0].id):e.defaultProvider&&_(e.defaultProvider))},[s,r,e.sessionId,e.defaultProvider,_]),(0,N.useEffect)(()=>{o(e=>e+1)},[d.thread.state]),(0,N.useEffect)(()=>{if(n)return n.subscribe(e=>{p(e),h(n.chips(e))})},[n]);let v=re(d.thread),y=s.find(e=>e.id===u),b=c.find(e=>e.id===y?.provider)?.name??d.thread.provider?.title??y?.provider??`Agent`,x=[...d.thread.turns].reverse().find(e=>e.user)?.user?.text,S={mediaUrl:e=>t.mediaUrl(e),onPermission:(e,t)=>void d.answerPermission(e,t),onProposal:(e,n,r)=>void t.decideProposal(e,n,r).catch(()=>void 0),onApproveArtifact:(e,n)=>void t.decideArtifact(e,`approve`,{version:n}).catch(()=>void 0),onRejectArtifact:e=>void t.decideArtifact(e,`reject`).catch(()=>void 0),onSelectOption:(e,n)=>void t.decideArtifact(e,`select`,{option:n}).catch(()=>void 0),onEditArtifact:(e,n)=>void t.editArtifact(e.id,e.version,n).catch(()=>void 0),onOpenArtifact:e.onOpenArtifact,onPreviewOption:e.onPreviewOption,onOpenHistory:e.onOpenHistory,onRetry:x?()=>void d.send(x,f??void 0):void 0,onSuggestion:e=>void d.send(e,f??void 0)};return(0,F.jsxs)(`aside`,{className:P(`relative flex h-full w-[336px] shrink-0 flex-col border-r border-border-default bg-surface-raised font-sans`,e.className),"aria-label":`Agent`,"data-testid":`agent-panel`,"data-state":d.thread.state,children:[(0,F.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border-default px-3`,children:[(0,F.jsx)(`span`,{className:`flex size-[22px] shrink-0 items-center justify-center rounded-full border border-accent-blue`,children:(0,F.jsx)(`span`,{className:`block size-[11px] text-accent-blue-text`,children:(0,F.jsx)(de,{})})}),(0,F.jsx)(`span`,{className:`block font-sans text-sm leading-normal font-semibold text-text-primary`,children:`Agent`}),(0,F.jsx)(Vd,{label:b,sessions:s,providers:c,currentId:u,onSelect:g,onCreate:e=>void _(e),onFork:e=>void t.forkSession(e).then(e=>(o(e=>e+1),g(e.id)))}),(0,F.jsx)(`span`,{className:`block flex-1`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-[5px]`,"data-testid":`agent-status`,"data-tone":v.tone,children:[(0,F.jsx)(De,{tone:v.tone}),(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal whitespace-nowrap text-text-secondary`,children:v.text})]}),e.onCollapse&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Collapse agent panel`,onClick:e.onCollapse,className:`block size-3.5 text-text-secondary hover:text-text-primary`,children:(0,F.jsx)(me,{})})]}),d.connection===`reconnecting`&&(0,F.jsx)(`div`,{className:`border-b border-border-default bg-accent-amber-glow px-3 py-1 font-sans text-[11px] text-text-primary`,children:`Reconnecting… events will resume where they stopped.`}),(0,F.jsx)(Bd,{thread:d.thread,h:S,suggestions:e.suggestions,empty:e.emptyState??(0,F.jsx)(`p`,{className:`m-auto max-w-[240px] text-center font-sans text-xs leading-[1.5] text-text-secondary`,children:`Select something in the player and tell the agent what to change. Changes arrive as proposals you approve.`})}),d.error&&(0,F.jsx)(`div`,{className:`px-3 pb-2`,children:(0,F.jsx)(Ld,{error:d.error,onDismiss:d.clearError})}),(0,F.jsx)(`div`,{className:`flex justify-end px-3 empty:hidden`,children:(0,F.jsx)(Rd,{usage:d.thread.usage})}),(0,F.jsx)(Hd,{chips:m,onRemoveChip:e=>h(m.filter((t,n)=>n!==e)),busy:d.busy,disabled:!u||d.thread.state===`closed`,onSend:e=>void d.send(e,m.length?f??void 0:void 0),onStop:()=>void d.cancel()}),(0,F.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-[calc(50%-16px)] right-[-3px] block h-8 w-[5px] rounded-full bg-border-strong`})]})}var Wd=E;function Gd(e){let t=[],n=e.selection;if(n){let r=[n.element_id?.split(`/`).pop(),typeof n.frame==`number`?Wd(n.frame,e.fps??30):null].filter(Boolean);r.length&&t.push({kind:n.element_id?`element`:`frame`,label:r.join(` · `)}),n.time_range&&t.push({kind:`range`,label:`${Wd(n.time_range.start,e.fps??30)} → ${Wd(n.time_range.end,e.fps??30)}`}),n.annotation?.note&&t.push({kind:`annotation`,label:`comment`})}for(let n of e.attachments??[])t.push({kind:n.kind,label:n.label});return t}function Kd(e=null){let t=e,n=new Set;return{subscribe(e){return n.add(e),t&&e(t),()=>n.delete(e)},chips:Gd,set(e){t=e,n.forEach(t=>t(e??{}))}}}var qd=`/__studio/agent`;function Jd(e,t){return!e||e.schema!==`mosio.selection/1`?{}:{selection:e,fps:t??void 0}}function Yd(e,t){let n=e.filter(e=>e.available);return t?n.find(e=>e.id===t)?.id:n.find(e=>!e.test_only)?.id}function Xd(e){return e.applied_revision??e.base_revision??null}function Zd(e,t){return new Proxy(e,{get(e,n,r){if(n===`decideProposal`)return async(...n)=>{let r=await e.decideProposal(...n);try{t(r,n[1])}catch{}return r};let i=Reflect.get(e,n,r);return typeof i==`function`?i.bind(e):i}})}var Qd=e=>`Looked at ${e} ${e===1?`frame`:`frames`}`;function $d(e,t){return t?{kind:`down`,title:`Agent host not reachable`,message:t,command:null}:e?e.running?{kind:`running`}:{kind:`down`,title:e.code===`E_AGENT_WRONG_PROJECT`?`Agent host serves another project`:e.code===`E_AGENT_AUTH`?`Agent host refused the token`:`Agent host not running`,message:e.message,command:e.command}:{kind:`checking`}}function ef(e){let t=e;return[t.element_id??`coordinates only`,t.composition_id,typeof t.frame==`number`?`frame ${t.frame}`:null,t.mapping?`mapping ${t.mapping}`:null].filter(Boolean).join(` · `)}var tf=2500,nf=8;function rf(e,t){let[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(null),[o,s]=(0,N.useState)(0);return(0,N.useEffect)(()=>{if(!t){a(`this Studio was opened without its host (no API token on the page), so it cannot reach an agent host`);return}let n=!0,i,o=async()=>{try{let s=await fetch(`${qd}/status?project=${encodeURIComponent(e)}`,{headers:{[y]:t}}),c=await s.json();if(!n)return;if(!s.ok)throw Error(`${c.code??s.status}`);a(null),r(c),c.running||(i=setTimeout(o,tf))}catch(e){if(!n)return;a(`the Studio host did not answer the agent status request (${e instanceof Error?e.message:String(e)})`),i=setTimeout(o,tf)}};return r(null),o(),()=>{n=!1,i&&clearTimeout(i)}},[e,t,o]),{status:n,error:i,recheck:(0,N.useCallback)(()=>s(e=>e+1),[])}}function af({title:r,message:i,command:a,selection:o,onRetry:s,onCollapse:c}){return(0,F.jsxs)(`div`,{className:`flex h-full flex-col border-r border-border-default bg-surface-raised font-sans`,"data-testid":`panel-agent`,"data-agent-host":`down`,children:[(0,F.jsx)(t,{icon:(0,F.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-full border border-accent-blue text-accent-blue-text`,children:(0,F.jsx)(e,{size:12})}),title:`Agent`,meta:(0,F.jsx)(n,{tone:`warning`,children:`Not connected`}),actions:(0,F.jsx)(x,{"aria-label":`Hide agent panel`,icon:(0,F.jsx)(d,{size:14}),onClick:c})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 overflow-y-auto p-3.5`,"data-testid":`agent-host-down`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-[13px] font-medium text-text-primary`,children:`The agent is not connected`}),(0,F.jsx)(`span`,{className:`text-xs leading-(--line-height-snug) text-text-secondary`,children:`The AI agent runs as its own service next to Studio. When it is running, this panel connects by itself. Everything else in Studio works without it.`})]}),(0,F.jsxs)(`details`,{className:`text-xs text-text-secondary`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer rounded-sm outline-none hover:text-text-primary focus-visible:ring-2 focus-visible:ring-accent-blue-edge`,children:`How to start it`}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,F.jsxs)(u,{tone:`warning`,children:[(0,F.jsxs)(`span`,{className:`font-medium`,children:[r,`.`]}),` `,i]}),a&&(0,F.jsxs)(h,{children:[(0,F.jsx)(m,{title:`Run`,kind:`shell`}),(0,F.jsx)(p,{children:(0,F.jsx)(`code`,{className:`block font-mono text-[11px] leading-normal break-all whitespace-pre-wrap text-text-primary`,"data-testid":`agent-host-command`,children:a})})]})]})]}),(0,F.jsx)(`span`,{className:`text-xs text-text-secondary`,"data-testid":`agent-context`,children:o?(0,F.jsxs)(F.Fragment,{children:[`Will attach: `,(0,F.jsx)(`span`,{className:`text-text-primary`,children:ef(o)})]}):`Select an element in the Player to attach it to your request.`}),(0,F.jsx)(v,{variant:`outline`,size:`sm`,className:`self-start`,onClick:s,"data-testid":`agent-host-retry`,children:`Check again`})]})]})}function of({contactSheet:e}){let[t,n]=(0,N.useState)(null),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),s=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>void(s.current&&URL.revokeObjectURL(s.current)),[]);let c=async()=>{i(!0),o(null);try{let t=await e(nf);s.current&&URL.revokeObjectURL(s.current),s.current=URL.createObjectURL(t.sheet),n({url:s.current,frames:t.frames})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}};return(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border-default bg-surface-raised px-3 py-2`,"data-testid":`agent-contact-sheet`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`flex-1 text-xs text-text-secondary`,"data-testid":`agent-frames-label`,children:t?Qd(t.frames.length):`Frames from the Player`}),(0,F.jsx)(v,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void c(),"data-testid":`agent-contact-sheet-open`,children:r?`Sampling…`:t?`Refresh`:`Contact sheet`})]}),a&&(0,F.jsx)(u,{tone:`error`,children:a}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`img`,{src:t.url,alt:Qd(t.frames.length),className:`w-full rounded-md border border-border-default`,"data-testid":`agent-contact-sheet-img`}),(0,F.jsxs)(`span`,{className:`font-mono text-[11px] text-text-secondary`,children:[`frames `,t.frames.join(` · `)]})]})]})}function sf({selection:e,contactSheet:t,openRevision:n,projectId:r}){let{controller:i,player:a,workspace:o}=f(),s=(0,N.useMemo)(()=>_(),[]),{status:c,error:l,recheck:u}=rf(r,s),d=$d(c,l),p=(0,N.useCallback)(()=>o.current?.toggle(`agent`),[o]),m=(0,N.useMemo)(()=>!s||d.kind!==`running`?null:Zd(new se({baseUrl:`${location.origin}${qd}`,token:s}),()=>{i.refresh().then(()=>i.runtime&&a.load({runtime:i.runtime,projectId:r,revisionId:null})).catch(()=>void 0)}),[s,d.kind,i,a,r]),[h,g]=(0,N.useState)(null);(0,N.useEffect)(()=>{g(null),m?.providers().then(g).catch(()=>g([]))},[m]);let v=(0,N.useMemo)(()=>new URLSearchParams(location.search).get(`agentProvider`),[]),y=(0,N.useMemo)(()=>Kd(),[]),b=cf();return(0,N.useEffect)(()=>y.set(e?Jd(e,b):null),[y,e,b]),d.kind===`checking`?(0,F.jsx)(`div`,{className:`flex h-full flex-col border-r border-border-default bg-surface-raised p-3.5 text-xs text-text-secondary`,"data-testid":`panel-agent`,"data-agent-host":`checking`,children:`Looking for the agent host…`}):d.kind===`down`?(0,F.jsx)(af,{title:d.title,message:d.message,command:d.command,selection:e,onRetry:u,onCollapse:p}):!m||!h?(0,F.jsx)(`div`,{className:`p-3.5 text-xs text-text-secondary`,"data-testid":`panel-agent`,"data-agent-host":`connecting`,children:`Connecting to the agent host…`}):(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`panel-agent`,"data-agent-host":`running`,children:[(0,F.jsx)(of,{contactSheet:t}),(0,F.jsx)(Ud,{className:`w-full min-h-0 flex-1`,host:m,contextSource:y,defaultProvider:Yd(h,v),onOpenHistory:e=>{let t=Xd(e);t&&n(t)},onCollapse:p})]})}function cf(){let e=g(e=>e.project?.snapshot?.composition.rate??null);return e?e.num/e.den:null}function lf(e){return(0,F.jsx)(S,{name:`Agent`,resetKey:e.projectId,children:(0,F.jsx)(sf,{...e})})}export{lf as AgentPanelSlot};
|
|
34
|
+
`)})]},e.path)}),(e.excluded??[]).length>0&&(0,F.jsxs)(`span`,{className:`px-3 pt-1 font-sans text-[11px] text-text-secondary`,children:[`Not included (agent configuration): `,(e.excluded??[]).join(`, `)]})]})}function Id({proposal:e,version:t,onDecide:n,onOpenHistory:r,busy:i}){let[a,o]=(0,N.useState)(!1),s=Pd(e),c=a?s:s.slice(0,8),l=e.status===`pending`||e.status===`conflict`,u=e.changes.some(e=>(e.flags??[]).length>0),d=`${s.length} ${s.length===1?`change`:`changes`}`,f={pending:`${d} pending`,applied:`${d} applied`,conflict:`Conflicts with your edits`,rejected:`Discarded`,reverted:`Reverted`,applying:`Applying ${d}…`,apply_failed:`Apply did not complete`}[e.status]??e.status,p=e.status===`apply_failed`,m=e.failure?.rolled_back===!0;return(0,F.jsxs)(we,{tone:l?`amber`:`strong`,"data-testid":`revision-proposal`,"data-status":e.status,children:[(0,F.jsxs)(`div`,{className:`flex h-[38px] items-center gap-2 border-b border-border-default px-3`,children:[(0,F.jsx)(De,{tone:l||p?`amber`:`muted`}),(0,F.jsx)(`span`,{className:`block flex-1 font-sans text-[13px] font-medium leading-normal text-text-primary`,children:f}),(0,F.jsx)(`span`,{className:`block font-mono text-xs leading-normal text-text-secondary`,title:`Content digest ${e.digest??``}`,"data-testid":`proposal-digest`,children:t??(e.digest??e.revision).slice(0,8)})]}),(0,F.jsxs)(`div`,{className:`flex flex-col py-1.5`,children:[(0,F.jsx)(`span`,{className:`px-3 pb-1 font-sans text-xs text-text-secondary`,children:e.title}),c.map((e,t)=>(0,F.jsxs)(`div`,{className:`flex min-h-[26px] items-center gap-2 px-3`,children:[(0,F.jsx)(`span`,{className:`block min-w-0 flex-1 truncate font-sans text-xs leading-normal text-text-primary`,children:e.layer}),(0,F.jsx)(`span`,{className:`block max-w-[60%] truncate font-sans text-xs leading-normal text-text-secondary`,title:e.change,children:e.change})]},t)),s.length>8&&(0,F.jsx)(`button`,{type:`button`,onClick:()=>o(!a),className:`self-start px-3 font-sans text-xs text-accent-blue-text`,children:a?`Show fewer`:`Show ${s.length-8} more`})]}),(0,F.jsx)(Fd,{proposal:e}),u&&l&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,"data-testid":`proposal-risk`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:`This change adds code or remote references. Open the flagged files before approving.`})]}),e.status===`conflict`&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:[e.conflicts.map(e=>e.path).join(`, `)||`Some files`,` changed since the agent started. Nothing was overwritten.`]})]}),p&&(0,F.jsxs)(`div`,{className:`mx-3 mb-2.5 flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,"data-testid":`proposal-failure`,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:[m?`The apply failed and the project was put back as it was. Ask the agent to propose the change again.`:`The apply stopped part way. Review the project; Roll back restores the revision saved just before the apply and undoes every change made since.`,e.failure?.error?.message?` (${e.failure.error.message})`:``]})]}),l?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[(0,F.jsx)(L,{variant:`primary`,disabled:i||e.status===`conflict`,onClick:()=>n(`approve`),children:`Approve`}),r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`reject`),children:`Discard run`})]}):p&&!m?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`revert`),children:`Roll back`})]}):e.status===`applied`?(0,F.jsxs)(Ee,{className:`px-3 pb-3`,children:[r&&(0,F.jsx)(L,{variant:`outline`,onClick:()=>r(e),children:`Open in History`}),(0,F.jsx)(L,{variant:`ghost`,disabled:i,onClick:()=>n(`revert`),children:`Revert`})]}):null]})}function Ld({error:e,onRetry:t,onDismiss:n}){return(0,F.jsxs)(`div`,{className:`flex items-start gap-2 rounded-lg bg-accent-amber-glow px-2.5 py-2`,role:`alert`,"data-testid":`error-recovery`,"data-code":e.code,children:[(0,F.jsx)(`span`,{className:`mt-0.5 block size-[13px] shrink-0 text-accent-amber`,children:(0,F.jsx)(ge,{})}),(0,F.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-[1.4] text-text-primary`,children:e.message}),e.fix&&(0,F.jsx)(`span`,{className:`block font-sans text-[11px] leading-[1.4] text-text-secondary`,children:e.fix}),(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[e.retryable&&t&&(0,F.jsxs)(L,{variant:`outline`,onClick:t,className:`h-7 gap-1.5`,children:[(0,F.jsx)(`span`,{className:`block size-3`,children:(0,F.jsx)(xe,{})}),`Retry`]}),n&&(0,F.jsx)(L,{variant:`ghost`,onClick:n,className:`h-7`,children:`Dismiss`}),(0,F.jsx)(`span`,{className:`ml-auto font-mono text-[10px] text-text-secondary`,children:e.code})]})]})]})}function Rd({usage:e}){if(!e||e.used==null)return null;let t=e.size?Math.min(100,Math.round(e.used/e.size*100)):null,n=e=>e>=1e3?`${(e/1e3).toFixed(e>=1e4?0:1)}k`:String(e),r=`${n(e.used)}${e.size?` / ${n(e.size)}`:``} tokens${e.cost?` · ${e.cost.amount.toFixed(2)} ${e.cost.currency}`:``}`;return(0,F.jsxs)(`span`,{className:`flex items-center gap-1.5 font-sans text-[11px] text-text-secondary`,title:`Reported by the agent`,"data-testid":`usage`,children:[t!=null&&(0,F.jsx)(`span`,{className:`block h-1 w-8 overflow-hidden rounded-full bg-border-strong`,"aria-hidden":!0,children:(0,F.jsx)(`span`,{className:`block h-full bg-accent-blue-text`,style:{width:`${t}%`}})}),r]})}function zd({turn:e,thread:t,live:n,h:r,suggestions:i}){let a=(0,N.useMemo)(()=>{for(let t=e.items.length-1;t>=0;t--)if(e.items[t].type===`text`)return t;return-1},[e.items]),o=[];e.items.forEach((i,s)=>{switch(i.type){case`text`:o.push((0,F.jsx)(kd,{text:i.text,role:i.role,streaming:n&&s===a&&s===e.items.length-1},s));break;case`permission`:{let e=t.permissions[i.requestId];e&&o.push((0,F.jsx)(Nd,{request:e,onAnswer:t=>r.onPermission(e.requestId,t)},s));break}case`proposal`:{let e=t.proposals[i.id];e&&o.push((0,F.jsx)(Id,{proposal:e,onDecide:t=>r.onProposal(e.id,t,e.digest),onOpenHistory:r.onOpenHistory},s));break}case`artifact`:{let e=t.artifacts[i.id];e&&o.push((0,F.jsx)(ze,{artifact:e,actions:r,mediaUrl:r.mediaUrl},s));break}case`error`:o.push((0,F.jsx)(Ld,{error:i.error,onRetry:r.onRetry},s));break;case`notice`:o.push((0,F.jsx)(`p`,{className:`font-sans text-xs leading-[1.4] text-text-secondary`,children:i.text},s))}});let s=e.plan&&e.plan.length>1&&(n||e.plan.some(e=>e.status!==`completed`));return(0,F.jsxs)(`div`,{className:`flex flex-col gap-2.5`,"data-testid":`agent-turn`,"data-stop":e.stopReason??``,children:[(0,F.jsx)(Od,{turn:e}),s&&(0,F.jsx)(Ad,{entries:e.plan}),o,n&&e.items.length===0&&(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Thinking…`}),e.stopReason===`cancelled`&&(0,F.jsx)(`span`,{className:`font-sans text-xs text-text-secondary`,children:`Stopped.`}),!n&&i&&i.length>0&&r.onSuggestion&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,children:i.map(e=>(0,F.jsx)(ke,{onClick:()=>r.onSuggestion(e),children:e},e))})]})}function Bd({thread:e,h:t,suggestions:n,empty:r}){let i=(0,N.useRef)(null),a=[`starting`,`running`,`awaiting_permission`,`cancelling`].includes(e.state);return(0,N.useEffect)(()=>{i.current?.scrollIntoView?.({block:`end`})},[e.lastSeq]),(0,F.jsxs)(`div`,{className:`flex min-h-0 min-w-0 flex-1 flex-col gap-3.5 overflow-y-auto p-3`,"data-testid":`thread`,role:`log`,"aria-label":`Agent conversation`,children:[e.turns.length===0&&r,e.turns.map((r,i)=>{let o=a&&i===e.turns.length-1;return(0,F.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[r.user&&(0,F.jsx)(Td,{text:r.user.text,chips:r.user.chips}),(0,F.jsx)(zd,{turn:r,thread:e,live:o,h:t,suggestions:i===e.turns.length-1?n:void 0})]},r.id)}),(0,F.jsx)(`div`,{ref:i})]})}function Vd({label:e,sessions:t,providers:n,currentId:r,onSelect:i,onCreate:a,onFork:o}){let[s,c]=(0,N.useState)(!1),l=(0,N.useRef)(null),u=(0,N.useId)();return(0,N.useEffect)(()=>{if(!s)return;let e=e=>!l.current?.contains(e.target)&&c(!1);return document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[s]),(0,F.jsxs)(`div`,{ref:l,className:`relative min-w-0`,children:[(0,F.jsxs)(`button`,{type:`button`,"aria-haspopup":`listbox`,"aria-expanded":s,"aria-controls":u,onClick:()=>c(!s),onKeyDown:e=>e.key===`Escape`&&c(!1),className:`flex h-6 max-w-[132px] items-center gap-1 rounded-md border border-border-default px-2 hover:bg-surface-hover`,"data-testid":`session-switcher`,children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs leading-normal text-text-secondary`,children:e}),(0,F.jsx)(`span`,{className:`block size-[11px] shrink-0 text-text-secondary`,children:(0,F.jsx)(fe,{})})]}),s&&(0,F.jsxs)(`div`,{id:u,role:`listbox`,"aria-label":`Sessions`,className:`absolute top-7 left-0 z-20 flex w-[260px] flex-col overflow-clip rounded-xl border border-border-strong bg-surface-card shadow-[0_8px_24px_var(--color-effect-drop-shadow)]`,children:[(0,F.jsxs)(`div`,{className:`max-h-64 overflow-y-auto py-1`,children:[t.length===0&&(0,F.jsx)(`div`,{className:`px-3 py-2 font-sans text-xs text-text-secondary`,children:`No sessions yet`}),t.map(e=>(0,F.jsxs)(`div`,{role:`option`,"aria-selected":e.id===r,className:P(`group flex min-h-[34px] items-center gap-2 px-3`,e.id===r&&`bg-surface-hover`),children:[(0,F.jsxs)(`button`,{type:`button`,className:`flex min-w-0 flex-1 flex-col text-left`,onClick:()=>{i(e.id),c(!1)},children:[(0,F.jsx)(`span`,{className:`block truncate font-sans text-xs text-text-primary`,children:e.title}),(0,F.jsxs)(`span`,{className:`block truncate font-sans text-[11px] text-text-secondary`,children:[e.provider,` · `,e.state,e.forked_from?` · fork`:``]})]}),o&&(0,F.jsx)(`button`,{type:`button`,className:`invisible font-sans text-[11px] text-accent-blue-text group-hover:visible`,onClick:()=>o(e.id),children:`Fork`})]},e.id))]}),(0,F.jsx)(`div`,{className:`flex flex-col border-t border-border-default py-1`,children:n.map(e=>(0,F.jsxs)(`button`,{type:`button`,disabled:!e.available,title:e.unavailable_reason??e.auth,onClick:()=>{a(e.id),c(!1)},className:`flex h-8 items-center gap-2 px-3 text-left hover:bg-surface-hover disabled:opacity-40`,children:[(0,F.jsx)(`span`,{className:`block size-3 text-accent-blue-text`,children:(0,F.jsx)(be,{})}),(0,F.jsxs)(`span`,{className:`flex-1 truncate font-sans text-xs text-text-primary`,children:[`New · `,e.name]})]},e.id))})]})]})}function Hd({chips:e,onRemoveChip:t,busy:n,disabled:r,onSend:i,onStop:a,hint:o,placeholder:s=`Direct the agent…`}){let[c,l]=(0,N.useState)(``),u=(0,N.useRef)(null),d=()=>{let e=c.trim();!e||n||r||(i(e),l(``))};return(0,N.useEffect)(()=>{let e=u.current;e&&(e.style.height=`0px`,e.style.height=`${Math.min(160,Math.max(20,e.scrollHeight))}px`)},[c]),(0,F.jsx)(`div`,{className:`shrink-0 border-t border-border-default p-3`,children:(0,F.jsxs)(`div`,{className:`flex flex-col gap-2 rounded-xl border border-border-strong bg-surface-card p-2.5 focus-within:border-accent-blue-edge`,children:[e.length>0&&(0,F.jsx)(`div`,{className:`flex flex-wrap gap-1.5`,"data-testid":`composer-chips`,children:e.map((e,n)=>(0,F.jsx)(Oe,{label:e.label,onRemove:t?()=>t(n):void 0},`${e.kind}:${e.label}`))}),(0,F.jsx)(`textarea`,{ref:u,rows:1,value:c,disabled:r,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),d())},placeholder:s,"aria-label":`Message the agent`,className:`min-h-5 resize-none bg-transparent font-sans text-[13px] leading-normal text-text-primary outline-none placeholder:text-text-secondary`}),(0,F.jsxs)(`div`,{className:`flex items-center`,children:[(0,F.jsx)(`span`,{className:`block flex-1 font-sans text-xs leading-normal text-text-secondary`,children:o??(e.length?`Selection is attached`:`Nothing selected`)}),n?(0,F.jsx)(`button`,{type:`button`,"aria-label":`Stop`,onClick:a,className:`flex size-7 items-center justify-center rounded-lg border border-border-strong text-text-primary hover:bg-surface-hover`,"data-testid":`stop`,children:(0,F.jsx)(`span`,{className:`block size-3`,children:(0,F.jsx)(ve,{})})}):(0,F.jsx)(`button`,{type:`button`,"aria-label":`Send`,onClick:d,disabled:!c.trim()||r,className:`flex size-7 items-center justify-center rounded-lg bg-accent-blue text-text-on-accent disabled:opacity-50`,"data-testid":`send`,children:(0,F.jsx)(`span`,{className:`block size-3.5`,children:(0,F.jsx)(he,{})})})]})]})})}function Ud(e){let{host:t,contextSource:n}=e,[r,i]=(0,N.useState)(null),[a,o]=(0,N.useState)(0),{sessions:s}=ue(t,a),[c,l]=(0,N.useState)([]),u=e.sessionId===void 0?r:e.sessionId,d=le(t,u),[f,p]=(0,N.useState)(null),[m,h]=(0,N.useState)([]);(0,N.useEffect)(()=>{t.providers().then(l).catch(()=>l([]))},[t]);let g=(0,N.useCallback)(t=>{e.sessionId===void 0&&i(t),e.onSessionChange?.(t)},[e]),_=(0,N.useCallback)(async e=>{let n=await t.createSession(e);o(e=>e+1),g(n.id)},[t,g]);(0,N.useEffect)(()=>{e.sessionId!==void 0||r||(s[0]?i(s[0].id):e.defaultProvider&&_(e.defaultProvider))},[s,r,e.sessionId,e.defaultProvider,_]),(0,N.useEffect)(()=>{o(e=>e+1)},[d.thread.state]),(0,N.useEffect)(()=>{if(n)return n.subscribe(e=>{p(e),h(n.chips(e))})},[n]);let v=re(d.thread),y=s.find(e=>e.id===u),b=c.find(e=>e.id===y?.provider)?.name??d.thread.provider?.title??y?.provider??`Agent`,x=[...d.thread.turns].reverse().find(e=>e.user)?.user?.text,S={mediaUrl:e=>t.mediaUrl(e),onPermission:(e,t)=>void d.answerPermission(e,t),onProposal:(e,n,r)=>void t.decideProposal(e,n,r).catch(()=>void 0),onApproveArtifact:(e,n)=>void t.decideArtifact(e,`approve`,{version:n}).catch(()=>void 0),onRejectArtifact:e=>void t.decideArtifact(e,`reject`).catch(()=>void 0),onSelectOption:(e,n)=>void t.decideArtifact(e,`select`,{option:n}).catch(()=>void 0),onEditArtifact:(e,n)=>void t.editArtifact(e.id,e.version,n).catch(()=>void 0),onOpenArtifact:e.onOpenArtifact,onPreviewOption:e.onPreviewOption,onOpenHistory:e.onOpenHistory,onRetry:x?()=>void d.send(x,f??void 0):void 0,onSuggestion:e=>void d.send(e,f??void 0)};return(0,F.jsxs)(`aside`,{className:P(`relative flex h-full w-[336px] shrink-0 flex-col border-r border-border-default bg-surface-raised font-sans`,e.className),"aria-label":`Agent`,"data-testid":`agent-panel`,"data-state":d.thread.state,children:[(0,F.jsxs)(`header`,{className:`flex h-11 shrink-0 items-center gap-2 border-b border-border-default px-3`,children:[(0,F.jsx)(`span`,{className:`flex size-[22px] shrink-0 items-center justify-center rounded-full border border-accent-blue`,children:(0,F.jsx)(`span`,{className:`block size-[11px] text-accent-blue-text`,children:(0,F.jsx)(de,{})})}),(0,F.jsx)(`span`,{className:`block font-sans text-sm leading-normal font-semibold text-text-primary`,children:`Agent`}),(0,F.jsx)(Vd,{label:b,sessions:s,providers:c,currentId:u,onSelect:g,onCreate:e=>void _(e),onFork:e=>void t.forkSession(e).then(e=>(o(e=>e+1),g(e.id)))}),(0,F.jsx)(`span`,{className:`block flex-1`}),(0,F.jsxs)(`span`,{className:`flex items-center gap-[5px]`,"data-testid":`agent-status`,"data-tone":v.tone,children:[(0,F.jsx)(De,{tone:v.tone}),(0,F.jsx)(`span`,{className:`block font-sans text-xs leading-normal whitespace-nowrap text-text-secondary`,children:v.text})]}),e.onCollapse&&(0,F.jsx)(`button`,{type:`button`,"aria-label":`Collapse agent panel`,onClick:e.onCollapse,className:`block size-3.5 text-text-secondary hover:text-text-primary`,children:(0,F.jsx)(me,{})})]}),d.connection===`reconnecting`&&(0,F.jsx)(`div`,{className:`border-b border-border-default bg-accent-amber-glow px-3 py-1 font-sans text-[11px] text-text-primary`,children:`Reconnecting… events will resume where they stopped.`}),(0,F.jsx)(Bd,{thread:d.thread,h:S,suggestions:e.suggestions,empty:e.emptyState??(0,F.jsx)(`p`,{className:`m-auto max-w-[240px] text-center font-sans text-xs leading-[1.5] text-text-secondary`,children:`Select something in the player and tell the agent what to change. Changes arrive as proposals you approve.`})}),d.error&&(0,F.jsx)(`div`,{className:`px-3 pb-2`,children:(0,F.jsx)(Ld,{error:d.error,onDismiss:d.clearError})}),(0,F.jsx)(`div`,{className:`flex justify-end px-3 empty:hidden`,children:(0,F.jsx)(Rd,{usage:d.thread.usage})}),(0,F.jsx)(Hd,{chips:m,onRemoveChip:e=>h(m.filter((t,n)=>n!==e)),busy:d.busy,disabled:!u||d.thread.state===`closed`,onSend:e=>void d.send(e,m.length?f??void 0:void 0),onStop:()=>void d.cancel()}),(0,F.jsx)(`span`,{"aria-hidden":!0,className:`absolute top-[calc(50%-16px)] right-[-3px] block h-8 w-[5px] rounded-full bg-border-strong`})]})}var Wd=E;function Gd(e){let t=[],n=e.selection;if(n){let r=[n.element_id?.split(`/`).pop(),typeof n.frame==`number`?Wd(n.frame,e.fps??30):null].filter(Boolean);r.length&&t.push({kind:n.element_id?`element`:`frame`,label:r.join(` · `)}),n.time_range&&t.push({kind:`range`,label:`${Wd(n.time_range.start,e.fps??30)} → ${Wd(n.time_range.end,e.fps??30)}`}),n.annotation?.note&&t.push({kind:`annotation`,label:`comment`})}for(let n of e.attachments??[])t.push({kind:n.kind,label:n.label});return t}function Kd(e=null){let t=e,n=new Set;return{subscribe(e){return n.add(e),t&&e(t),()=>n.delete(e)},chips:Gd,set(e){t=e,n.forEach(t=>t(e??{}))}}}var qd=`/__studio/agent`;function Jd(e,t){return!e||e.schema!==`mosio.selection/1`?{}:{selection:e,fps:t??void 0}}function Yd(e,t){let n=e.filter(e=>e.available);return t?n.find(e=>e.id===t)?.id:n.find(e=>!e.test_only)?.id}function Xd(e){return e.applied_revision??e.base_revision??null}function Zd(e,t){return new Proxy(e,{get(e,n,r){if(n===`decideProposal`)return async(...n)=>{let r=await e.decideProposal(...n);try{t(r,n[1])}catch{}return r};let i=Reflect.get(e,n,r);return typeof i==`function`?i.bind(e):i}})}var Qd=e=>`Looked at ${e} ${e===1?`frame`:`frames`}`;function $d(e,t){return t?{kind:`down`,title:`Agent host not reachable`,message:t,command:null}:e?e.running?{kind:`running`}:{kind:`down`,title:e.code===`E_AGENT_WRONG_PROJECT`?`Agent host serves another project`:e.code===`E_AGENT_AUTH`?`Agent host refused the token`:`Agent host not running`,message:e.message,command:e.command}:{kind:`checking`}}function ef(e){let t=e;return[t.element_id??`coordinates only`,t.composition_id,typeof t.frame==`number`?`frame ${t.frame}`:null,t.mapping?`mapping ${t.mapping}`:null].filter(Boolean).join(` · `)}var tf=2500,nf=8;function rf(e,t){let[n,r]=(0,N.useState)(null),[i,a]=(0,N.useState)(null),[o,s]=(0,N.useState)(0);return(0,N.useEffect)(()=>{if(!t){a(`this Studio was opened without its host (no API token on the page), so it cannot reach an agent host`);return}let n=!0,i,o=async()=>{try{let s=await fetch(`${qd}/status?project=${encodeURIComponent(e)}`,{headers:{[y]:t}}),c=await s.json();if(!n)return;if(!s.ok)throw Error(`${c.code??s.status}`);a(null),r(c),c.running||(i=setTimeout(o,tf))}catch(e){if(!n)return;a(`the Studio host did not answer the agent status request (${e instanceof Error?e.message:String(e)})`),i=setTimeout(o,tf)}};return r(null),o(),()=>{n=!1,i&&clearTimeout(i)}},[e,t,o]),{status:n,error:i,recheck:(0,N.useCallback)(()=>s(e=>e+1),[])}}function af({title:r,message:i,command:a,selection:o,onRetry:s,onCollapse:c}){return(0,F.jsxs)(`div`,{className:`flex h-full flex-col border-r border-border-default bg-surface-raised font-sans`,"data-testid":`panel-agent`,"data-agent-host":`down`,children:[(0,F.jsx)(t,{icon:(0,F.jsx)(`span`,{className:`flex size-6 items-center justify-center rounded-full border border-accent-blue text-accent-blue-text`,children:(0,F.jsx)(e,{size:12})}),title:`Agent`,meta:(0,F.jsx)(n,{tone:`warning`,children:`Not connected`}),actions:(0,F.jsx)(x,{"aria-label":`Hide agent panel`,icon:(0,F.jsx)(d,{size:14}),onClick:c})}),(0,F.jsxs)(`div`,{className:`flex flex-col gap-3 overflow-y-auto p-3.5`,"data-testid":`agent-host-down`,children:[(0,F.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,F.jsx)(`span`,{className:`text-[13px] font-medium text-text-primary`,children:`The agent is not connected`}),(0,F.jsx)(`span`,{className:`text-xs leading-(--line-height-snug) text-text-secondary`,children:`The AI agent runs as its own service next to Studio. When it is running, this panel connects by itself. Everything else in Studio works without it.`})]}),(0,F.jsxs)(`details`,{className:`text-xs text-text-secondary`,children:[(0,F.jsx)(`summary`,{className:`cursor-pointer rounded-sm outline-none hover:text-text-primary focus-visible:ring-2 focus-visible:ring-accent-blue-edge`,children:`How to start it`}),(0,F.jsxs)(`div`,{className:`mt-2 flex flex-col gap-2`,children:[(0,F.jsxs)(l,{tone:`warning`,children:[(0,F.jsxs)(`span`,{className:`font-medium`,children:[r,`.`]}),` `,i]}),a&&(0,F.jsxs)(h,{children:[(0,F.jsx)(m,{title:`Run`,kind:`shell`}),(0,F.jsx)(p,{children:(0,F.jsx)(`code`,{className:`block font-mono text-[11px] leading-normal break-all whitespace-pre-wrap text-text-primary`,"data-testid":`agent-host-command`,children:a})})]})]})]}),(0,F.jsx)(`span`,{className:`text-xs text-text-secondary`,"data-testid":`agent-context`,children:o?(0,F.jsxs)(F.Fragment,{children:[`Will attach: `,(0,F.jsx)(`span`,{className:`text-text-primary`,children:ef(o)})]}):`Select an element in the Player to attach it to your request.`}),(0,F.jsx)(v,{variant:`outline`,size:`sm`,className:`self-start`,onClick:s,"data-testid":`agent-host-retry`,children:`Check again`})]})]})}function of({contactSheet:e}){let[t,n]=(0,N.useState)(null),[r,i]=(0,N.useState)(!1),[a,o]=(0,N.useState)(null),s=(0,N.useRef)(null);(0,N.useEffect)(()=>()=>void(s.current&&URL.revokeObjectURL(s.current)),[]);let c=async()=>{i(!0),o(null);try{let t=await e(nf);s.current&&URL.revokeObjectURL(s.current),s.current=URL.createObjectURL(t.sheet),n({url:s.current,frames:t.frames})}catch(e){o(e instanceof Error?e.message:String(e))}finally{i(!1)}};return(0,F.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-2 border-b border-border-default bg-surface-raised px-3 py-2`,"data-testid":`agent-contact-sheet`,children:[(0,F.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`flex-1 text-xs text-text-secondary`,"data-testid":`agent-frames-label`,children:t?Qd(t.frames.length):`Frames from the Player`}),(0,F.jsx)(v,{variant:`outline`,size:`sm`,disabled:r,onClick:()=>void c(),"data-testid":`agent-contact-sheet-open`,children:r?`Sampling…`:t?`Refresh`:`Contact sheet`})]}),a&&(0,F.jsx)(l,{tone:`error`,children:a}),t&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(`img`,{src:t.url,alt:Qd(t.frames.length),className:`w-full rounded-md border border-border-default`,"data-testid":`agent-contact-sheet-img`}),(0,F.jsxs)(`span`,{className:`font-mono text-[11px] text-text-secondary`,children:[`frames `,t.frames.join(` · `)]})]})]})}function sf({selection:e,contactSheet:t,openRevision:n,projectId:r}){let{controller:i,player:a,workspace:o}=f(),s=(0,N.useMemo)(()=>_(),[]),{status:c,error:l,recheck:u}=rf(r,s),d=$d(c,l),p=(0,N.useCallback)(()=>o.current?.toggle(`agent`),[o]),m=(0,N.useMemo)(()=>!s||d.kind!==`running`?null:Zd(new se({baseUrl:`${location.origin}${qd}`,token:s}),()=>{i.refresh().then(()=>i.runtime&&a.load({runtime:i.runtime,projectId:r,revisionId:null})).catch(()=>void 0)}),[s,d.kind,i,a,r]),[h,g]=(0,N.useState)(null);(0,N.useEffect)(()=>{g(null),m?.providers().then(g).catch(()=>g([]))},[m]);let v=(0,N.useMemo)(()=>new URLSearchParams(location.search).get(`agentProvider`),[]),y=(0,N.useMemo)(()=>Kd(),[]),b=cf();return(0,N.useEffect)(()=>y.set(e?Jd(e,b):null),[y,e,b]),d.kind===`checking`?(0,F.jsx)(`div`,{className:`flex h-full flex-col border-r border-border-default bg-surface-raised p-3.5 text-xs text-text-secondary`,"data-testid":`panel-agent`,"data-agent-host":`checking`,children:`Looking for the agent host…`}):d.kind===`down`?(0,F.jsx)(af,{title:d.title,message:d.message,command:d.command,selection:e,onRetry:u,onCollapse:p}):!m||!h?(0,F.jsx)(`div`,{className:`p-3.5 text-xs text-text-secondary`,"data-testid":`panel-agent`,"data-agent-host":`connecting`,children:`Connecting to the agent host…`}):(0,F.jsxs)(`div`,{className:`flex h-full min-h-0 flex-col`,"data-testid":`panel-agent`,"data-agent-host":`running`,children:[(0,F.jsx)(of,{contactSheet:t}),(0,F.jsx)(Ud,{className:`w-full min-h-0 flex-1`,host:m,contextSource:y,defaultProvider:Yd(h,v),onOpenHistory:e=>{let t=Xd(e);t&&n(t)},onCollapse:p})]})}function cf(){let e=g(e=>e.project?.snapshot?.composition.rate??null);return e?e.num/e.den:null}function lf(e){return(0,F.jsx)(S,{name:`Agent`,resetKey:e.projectId,children:(0,F.jsx)(sf,{...e})})}export{lf as AgentPanelSlot};
|