@inkeep/open-knowledge 0.16.0 → 0.16.1-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/dist/assets/skills/discovery/SKILL.md +1 -1
  2. package/dist/assets/skills/project/SKILL.md +1 -1
  3. package/dist/cli.mjs +6 -6
  4. package/dist/constants-CAj2OG6r.mjs +2 -0
  5. package/dist/{dist--S8onIrO.mjs → dist-DI00wise.mjs} +1 -1
  6. package/dist/{dist-Br1AQTZl.mjs → dist-DK6nQomd.mjs} +7 -7
  7. package/dist/{gh-detect-DnwA-B1z.mjs → gh-detect-Dfl-0bCl.mjs} +2 -2
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-DkpslbhQ.mjs → init-BuVVoeqs.mjs} +4 -4
  10. package/dist/init-ElfEbTWy.mjs +1 -0
  11. package/dist/{loader-MW55y84t.mjs → loader-Cdaa6CrF.mjs} +2 -2
  12. package/dist/loader-bbAwSl3z.mjs +1 -0
  13. package/dist/preview-6aJgEhTw.mjs +1 -0
  14. package/dist/{preview-hHaiN9fv.mjs → preview-CmvbuLFx.mjs} +2 -2
  15. package/dist/public/assets/{ActivityModeContent-BYzNZP-E.js → ActivityModeContent-BZfDggRe.js} +1 -1
  16. package/dist/public/assets/{ConsentDialogBody-C3cfuPKS.js → ConsentDialogBody-DOf6_QiW.js} +1 -1
  17. package/dist/public/assets/{DocumentContext-COLJhbxu.js → DocumentContext-D8INk7jT.js} +1 -1
  18. package/dist/public/assets/{GraphPanel-_FO8Dj1z.js → GraphPanel-Ch6asGi2.js} +1 -1
  19. package/dist/public/assets/{McpConsentDialogBody-CG9ncDqv.js → McpConsentDialogBody-stteh15-.js} +1 -1
  20. package/dist/public/assets/{OpenInAgentMenuRequestContext-DgbNofgM.js → OpenInAgentMenuRequestContext-MdDQqW0P.js} +1 -1
  21. package/dist/public/assets/{SettingsDialogBody-Im-nZuQD.js → SettingsDialogBody-B_p9wl5R.js} +1 -1
  22. package/dist/public/assets/{SourceEditor-jEv8YtjM.js → SourceEditor-D5__UsME.js} +1 -1
  23. package/dist/public/assets/{TerminalPanel-BmOjKfef.js → TerminalPanel-Cjyt7ADc.js} +3 -3
  24. package/dist/public/assets/{agent-presence-CarzuseD.js → agent-presence-DYKkeiBZ.js} +1 -1
  25. package/dist/public/assets/{button-CNAPefQE.js → button-CmLxDlCv.js} +1 -1
  26. package/dist/public/assets/{checkbox-LNtTTZgr.js → checkbox-BlEgF5ZV.js} +1 -1
  27. package/dist/public/assets/{collapsible-CiYR1NR5.js → collapsible-BzkAcCLq.js} +1 -1
  28. package/dist/public/assets/{config-validation-events-B7gv45uC.js → config-validation-events-B31yU1ex.js} +1 -1
  29. package/dist/public/assets/{dialog-CtMCOb1V.js → dialog-uOgi9SAD.js} +1 -1
  30. package/dist/public/assets/{dist-CP3jvVRS.js → dist-BIbxx2ds.js} +1 -1
  31. package/dist/public/assets/{dist-CUqyztDT.js → dist-CSynDsuh.js} +1 -1
  32. package/dist/public/assets/{dist-qcpgtxJO.js → dist-C_giuVsx.js} +1 -1
  33. package/dist/public/assets/{dist-rFfpDyC7.js → dist-DuNRfJxD.js} +1 -1
  34. package/dist/public/assets/{index-BmwXZ8xM.js → index-CQsSvQMF.js} +96 -96
  35. package/dist/public/assets/index-GNAYzOUb.css +1 -0
  36. package/dist/public/assets/{keyboard-shortcuts-AGKmTzB4.js → keyboard-shortcuts-DhU9JBBP.js} +1 -1
  37. package/dist/public/assets/{panel-B_EgE6h3.js → panel-BQ1weDcE.js} +1 -1
  38. package/dist/public/assets/{project-paths-By95zyI0.js → project-paths-lA0ULe1F.js} +1 -1
  39. package/dist/public/assets/{prop-types-6by4K8X_.js → prop-types-JdxpK0Ba.js} +1 -1
  40. package/dist/public/assets/{target-navigation-intent-Dn_E8zR8.js → target-navigation-intent-h5JrxhMT.js} +1 -1
  41. package/dist/public/assets/{telemetry-impl-B69NnnZ-.js → telemetry-impl-DMS50lWu.js} +1 -1
  42. package/dist/public/assets/{textarea-BeqA3EKD.js → textarea-DV1qaluU.js} +1 -1
  43. package/dist/public/assets/{toggle-group-Df7XaPvr.js → toggle-group-oSLn0Q3B.js} +1 -1
  44. package/dist/public/assets/{tooltip-Bp4cM4E8.js → tooltip-DjrmDp0P.js} +1 -1
  45. package/dist/public/index.html +22 -22
  46. package/dist/{repair-launch-json-DSGotwZz.mjs → repair-launch-json-3Z4fXvrz.mjs} +2 -2
  47. package/dist/{repair-mcp-configs-DyxMTxFK.mjs → repair-mcp-configs-CfMHuE87.mjs} +2 -2
  48. package/dist/repair-skills-BRbSYbWT.mjs +1 -0
  49. package/dist/{repair-skills-CA90BNvr.mjs → repair-skills-fEOpZb8J.mjs} +2 -2
  50. package/dist/{server-lock-BpjJj3OD-DieV1RDy.mjs → server-lock-BpjJj3OD-7KPAM7xJ.mjs} +2 -2
  51. package/dist/server-lock-CyhBidkz-Cn1wgQoO.mjs +1 -0
  52. package/dist/{src-ZJC5dF92.mjs → src-CSi1jwK-.mjs} +2 -2
  53. package/dist/{start-C7mMJgYI.mjs → start-B6t-aE3I.mjs} +2 -2
  54. package/dist/start-CTh6vTLm.mjs +1 -0
  55. package/dist/{write-project-skill-B6sZCIWR.mjs → write-project-skill-tUkoCT_R.mjs} +2 -2
  56. package/package.json +1 -1
  57. package/dist/constants-BB8OuOYZ.mjs +0 -2
  58. package/dist/init-BNVs1xkp.mjs +0 -1
  59. package/dist/loader-DtUzpiqj.mjs +0 -1
  60. package/dist/preview-CCPEAWcn.mjs +0 -1
  61. package/dist/public/assets/index-Ch1_o2WE.css +0 -1
  62. package/dist/repair-skills-Bv7y6ZgO.mjs +0 -1
  63. package/dist/server-lock-CyhBidkz-KHJ5sHjG.mjs +0 -1
  64. package/dist/start-BF89k0Ti.mjs +0 -1
@@ -508,4 +508,4 @@ Read more at https://docs.orama.com/docs/orama-js/plugins/plugin-secure-proxy#pl
508
508
  `:`
509
509
  `;return l.join(f)},table(e,t,n,r){let i=n.enter(`table`),a=[],o=[],s=e.children??[];for(let e of s){let t=e.children??[],i=[],s=[];for(let e of t){let t=n.enter(`tableCell`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,{...r,before:` `,after:` `});a(),t(),i.push(o);let c=e.data?.sourcePadding;s.push(c&&typeof c.left==`number`&&typeof c.right==`number`?{left:c.left,right:c.right}:null)}a.push(i),o.push(s)}i();let c=e.align??[],l=e.data?.sourceDashCounts,u=a[0]?.length??0,d=a.slice(1).reduce((e,t)=>Math.max(e,t.length),0),f=Math.max(u,d,c.length),p=[];for(let e=0;e<f;e++){let t=c[e],n=``,r=``;t===`center`?(n=`:`,r=`:`):t===`left`?n=`:`:t===`right`&&(r=`:`);let i=l?.[e],a=typeof i==`number`&&i>=1?i:1;p.push(n+`-`.repeat(a)+r)}let m=(e,t)=>{let n=[];for(let r=0;r<f;r++){let i=e[r]??``,a=t[r]??{left:1,right:1};n.push(` `.repeat(a.left)+i+` `.repeat(a.right))}let r=v&&!v.leading?``:`|`,i=v&&!v.trailing?``:`|`;return`${r}${n.join(`|`)}${i}`},h=e.data?.sourceAlignmentPadding,g=Array.from({length:f},(e,t)=>{let n=h?.[t];return n&&typeof n.left==`number`&&typeof n.right==`number`?n:null}),_=e.data?.sourceOuterPipes,v=_&&f>=2&&a.every(e=>{let t=(e[0]??``).trim(),n=(e[f-1]??``).trim();return(_.leading||t.length>0)&&(_.trailing||n.length>0&&!n.endsWith(`\\`))})?_:null;if(a.length===0)return m(p,g);let y=[];y.push(m(a[0],o[0]??[])),y.push(m(p,g));for(let e=1;e<a.length;e++)y.push(m(a[e],o[e]??[]));return y.join(`
510
510
  `)},mdxJsxFlowElement(e,t,n,r){let i=e,a=i.data?.sourceRaw;if(typeof a==`string`)return a;let o=i.data?.htmlBoundary;if(o&&typeof o.opener==`string`&&typeof o.closer==`string`){let e=n.containerFlow({type:`root`,children:i.children??[]},r);return`${o.opener}\n\n${e}\n\n${o.closer}`}let s=i.name??``,c=G7(i.attributes??[]);return!i.children||i.children.length===0?s?c?`<${s} ${c} />`:`<${s} />`:``:nne({...i,attributes:(i.attributes??[]).map(ine)},t,n,r)},mark(e,t,n,r){let i=n.createTracker(r),a=n.enter(`mark`),o=i.move(`==`);return o+=n.containerPhrasing(e,{before:o,after:`==`,...i.current()}),o+=i.move(`==`),a(),o},comment(e,t,n,r){let i=e.data?.sourceForm,a=i===`html`?`<!-- `:`%%`,o=i===`html`?` -->`:`%%`,s=n.createTracker(r),c=n.enter(`comment`),l=s.move(a);return l+=n.containerPhrasing(e,{before:l,after:o,...s.current()}),l+=s.move(o),c(),l},commentBlock(e,t,n,r){let i=n.createTracker(r),a=n.enter(`commentBlock`),o=e.children??[],s=e.data?.sourceForm,c=e.data?.sourceLayout,l=o.length===1&&o[0]?.type===`paragraph`;if(s===`html`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`<!-- `,after:` -->`,...i.current()});return a(),`<!-- ${t} -->`}if(c===`inline`&&l){let e=o[0],t=n.containerPhrasing(e,{before:`%% `,after:` %%`,...i.current()});return a(),`%% ${t} %%`}let u=n.containerFlow(e,i.current());return a(),`%%\n\n${u}\n\n%%`},mdxJsxTextElement(e){let t=e.data?.sourceRaw;if(typeof t==`string`)return t;let n=e.name??``,r=G7(e.attributes??[]);return r?`<${n} ${r} />`:`<${n}/>`},rawMdxFallback(e){return e.value??``},blockquote(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.containerFlow(e,a.current());i();let s=e.data?.sourceMarkerSpacings,c=0;return n.indentLines(o,(e,t,n)=>{if(n)return`>`;let r=s?.[c++];return r===`none`||r===0?`>${e}`:typeof r==`number`&&r>=2&&!e.startsWith(` `)?`>${` `.repeat(r)}${e}`:`> ${e}`})}};function G7(e){let t=[];for(let n of e){if(n.type===`mdxJsxExpressionAttribute`){t.push(`{${n.value}}`);continue}let e=n.name;if(n.value===null||n.value===void 0){t.push(e);continue}if(typeof n.value==`string`){n.value.includes(`"`)?t.push(`${e}={${K7(n.value)}}`):t.push(`${e}="${n.value}"`);continue}t.push(`${e}={${n.value.value}}`)}return t.join(` `)}function K7(e){return`"${e.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`)}"`}function ine(e){return e.type===`mdxJsxAttribute`&&typeof e.value==`string`&&e.value.includes(`"`)?{type:`mdxJsxAttribute`,name:e.name,value:{type:`mdxJsxAttributeValueExpression`,value:K7(e.value)}}:e}function q7(e,t,n=` `){return t===`single`?`${n}'${e.replace(/'/g,`\\'`)}'`:t===`paren`?`${n}(${e.replace(/[()]/g,`\\$&`)})`:`${n}"${e.replace(/"/g,`\\"`)}"`}function J7(e){if(!e)return``;let t=0,n=!0;for(let r of e)r===`(`?t++:r===`)`&&(t--,t<0&&(n=!1));return t!==0&&(n=!1),n?e:e.replace(/[\\()]/g,`\\$&`)}function ane(e){return e.replace(/(?<!\\)&(?=(#[0-9]+|#[xX][0-9A-Fa-f]+|[A-Za-z][A-Za-z0-9]*);)/g,(e,t)=>one(t)?e:`\\${e}`)}function one(e){if(e.charCodeAt(0)!==35)return!1;let t=e[1]===`x`||e[1]===`X`?Number.parseInt(e.slice(2),16):Number.parseInt(e.slice(1),10);return t===9||t===10||t===11||t===12||t===13||t===32}function Y7(e,t,n){let r=e.unsafe;e.unsafe=r.filter(e=>!(e.character===`&`&&e.after===`[#A-Za-z]`||e.character===`<`||e.character===`[`||e.character===`(`||e.character==="`"||(e.character===`*`||e.character===`_`||e.character===`~`)&&e.inConstruct===`phrasing`||e.character===`=`&&e.atBreak===!0));let i;try{i=e.safe(t,n)}finally{e.unsafe=r}return ane(une(i,n))}var X7=1,sne=2;function Z7(e){if(Number.isNaN(e))return`ws`;let t=sz(e);return t===X7?`ws`:t===sne?`punct`:`other`}function cne(e,t,n){let r=Z7(t),i=Z7(n),a=i!==`ws`&&(i===`other`||r!==`other`),o=r!==`ws`&&(r===`other`||i!==`other`);return e===`_`?a&&(!o||r===`punct`)||o&&(!a||i===`punct`):a||o}function lne(e,t,n){let r=t;for(;r<e.length&&(e[r]===` `||e[r]===` `);)r++;if(r<e.length)return e[r]===`
511
- `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function une(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&lne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=cne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Q7(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);$7(t.before.charCodeAt(t.before.length-1),a,r)&&(i=e9(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return $7(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+e9(o)),i}function $7(e,t,n){return!(sz(t)!==X7||n===`_`&&sz(e)===void 0)}function e9(e){return`&#x${e.toString(16).toUpperCase()};`}function dne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!pne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function fne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function pne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function t9(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var mne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Tb(e.extensions),this.handlers=bne(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=xne(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Gte({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Kte({toMarkdownHandlers:rne})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Jte(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Yte(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?X6(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return Xte(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},n9=D6();function hne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function gne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function _ne(e){return e.attrs.sourceDirty||gne(e)}function vne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r9(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i9(e,t){if(e.length===0)return r9({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r9({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i9(n.children,t)]}}return r9({type:`inlineCode`,value:a9(e)},t)}function a9(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a9(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var yne=V1;function bne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=XU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=XU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=W7(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&r2(t.raw)!==null&&e2(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=r2(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=ZU(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=ZU(r.highlight)),r.comment&&(i.comment=ZU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=XU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=ZU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=ZU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=XU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=XU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=XU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=n9.getOrWildcard(o),c=hne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=W7(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=b2(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&yne.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&H1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&W1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&G1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:t9(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=XU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function xne(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=nW(`paragraph`)),r.blockquote&&(t.blockquote=nW(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=nW(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=nW(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&vne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=nW(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=nW(`tableCell`,a)),r.tableHeader&&(t.tableHeader=nW(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!_ne(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:n9.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:n9,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=rW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=rW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i9(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=rW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=rW(`mark`)),i.comment&&(n.comment=rW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=nW(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=nW(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return a2(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Sne=/\p{M}+/gu,Cne=/[^\p{L}\p{N}]+/gu,wne=/^-+|-+$/g;function o9(e){return e.trim().normalize(`NFKD`).replace(Sne,``).toLowerCase().replace(Cne,`-`).replace(wne,``)}function Tne(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Ene(e,t){let n=o9(e);return n?Tne(n,t):``}function s9(e,t){let n=o9(e);return t?`#${n}-${o9(t)}`:`#${n}`}var c9=new Set([`img`,`video`,`audio`,`mark`]),Dne=new Map(T6.flatMap(e=>e.surface===`compat`&&c9.has(e.rendersAs)?[[e.name,e]]:[]));function l9(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function u9(e){let t=e.name;if(!t||!c9.has(t))return null;let n=l9(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function d9(e){let t=e.name;if(!t)return null;let n=Dne.get(t);if(!n)return null;let r=l9(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var One=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},kne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Ane=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},jne=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Mne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Nne=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function f9(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(f9).join(``):``}var p9={wikiLink:One,wikiLinkEmbed:kne,mdxJsxFlowElement:Ane,mdxJsxTextElement:jne,rawMdxFallback:Mne,mark:Nne,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Pne=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Fne=/\bexpression\s*\(/i,Ine=1e4;function Lne(e){return!(e.length>Ine||Pne.test(e)||Fne.test(e))}function m9(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!k0(e.split(/\s+/)[0]??``))return!1}return!0}var Rne={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},zne=new Set([`href`,`src`]),Bne=cV(`<>`),h9=()=>e=>{IF(e,`element`,e=>{let t=Rne[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?U8(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(zne.has(e))if(t===`<>`||t===Bne)r=``;else{let e=U8(t);r=e===t?t:cV(e)}else r=U8(t);r!==t&&(n[e]=r)}})},g9=()=>e=>{IF(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!k0(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!k0(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!k0(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!m9(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!m9(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!k0(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Lne(r)&&delete n.style})};function Vne(e){let t=DU().use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ),n=t.runSync(e);return String(t.stringify(n))}function _9(e){let t=DU().use(TG).use(wW,[`yaml`]).use(w7).use(vU).use(R7).use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ);return String(t.processSync(e))}fq(),TK(),EK(),A({docName:d4,summary:p4,content:E().optional(),...f4}).loose(),A({docName:d4,summary:p4,markdown:E(),position:j([`append`,`prepend`,`replace`]).optional(),extension:j(T1).optional(),...f4}).loose(),A({docName:d4,summary:p4,find:E().min(1),replace:E(),offset:D().int().nonnegative().optional(),...f4}).loose(),A({docName:d4,connectionId:E().min(1),scope:j([`last`,`session`,`file`]).optional(),...f4}).loose();var v9=A({value:E(),truncatedFrom:D().int().nonnegative().optional(),hint:E().optional()}).loose(),Hne=Ua(`kind`,[A({kind:M(`inline`),content:E()}),A({kind:M(`truncated`),byteLength:D().int().nonnegative(),hint:E()})]),y9=A({kind:M(`content-divergence`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),divergenceType:E().optional(),currentState:Hne.optional(),hint:E().optional()}).loose(),Une=A({type:M(`orphan`),parentCandidates:k(E()),message:E()}).loose(),b9=A({kind:M(`disk-edit-reconciled`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),mergeOutcome:E().optional(),hint:E().optional()}).loose(),x9=Ua(`kind`,[y9,b9]),S9=k(Ua(`kind`,[y9,b9,A({kind:M(`mermaid-parse-error`),fenceIndex:D().int().positive(),fenceFirstLine:E(),message:E(),line:D().int().positive().optional()}).loose()])).min(1);A({timestamp:E().min(1),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),hints:k(Une).optional(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({docName:E().min(1),scope:j([`last`,`session`]),undone:O()}).loose(),A({docName:d4,patch:qa(E(),Va([WQ,Ma()])),types:qa(E(),j(VQ)).optional(),summary:p4,...f4}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),appliedKeys:k(E()),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({entries:k(A({level:j([`info`,`warn`,`error`]),message:E().max(N4),event:E().optional(),fields:qa(E(),Pa()).optional(),ts:D().optional(),sourceId:E().optional(),lineNumber:D().optional()}).loose()).max(100)}).loose(),A({accepted:D().int().min(0)}).loose();var Wne=A({status:E().min(1),reason:E()}).loose();A({docName:E().min(1),content:E(),lifecycle:Wne.nullable()}).loose();var C9=A({kind:j([`document`,`asset`,`folder`,`file`]).default(`document`),docName:E().min(1).optional(),docExt:E().min(1).default(`.md`),size:D().int().nonnegative(),modified:E().min(1),isSymlink:O().default(!1),canonicalDocName:E().nullable().default(null),targetPath:E().nullable().default(null),path:E().min(1).optional(),assetExt:E().min(1).optional(),mediaKind:j([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:k(E().min(1)).optional(),hasChildren:O().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Gne=A({documents:k(C9),truncated:O().optional()}).loose(),Kne=A({source:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),qne=A({docName:E().min(1),backlinks:k(Kne)}).loose();A({counts:qa(E().min(1),D().int().nonnegative())}).loose();var Jne=Ua(`kind`,[A({kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),A({kind:M(`external`),url:E().min(1),title:E(),snippet:E().nullable()}).loose()]),Yne=A({docName:E().min(1),forwardLinks:k(Jne)}).loose(),Xne=Ua(`kind`,[A({id:E().min(1),kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),label:E(),cluster:E().nullable(),category:E().nullable(),tags:k(E()).nullable()}).loose(),A({id:E().min(1),kind:M(`external`),url:E().min(1),label:E()}).loose()]),Zne=A({source:E().min(1),target:E().min(1)}).loose(),Qne=A({nodes:k(Xne),links:k(Zne)}).loose(),$ne=A({ts:D().int().min(0),url:E(),method:E(),ua:E().optional(),origin:E().optional(),referer:E().optional(),host:E().optional(),remote:E().optional(),secChUa:E().optional(),secChUaMobile:E().optional(),secChUaPlatform:E().optional(),secFetchSite:E().optional(),secFetchDest:E().optional(),secFetchMode:E().optional(),secFetchUser:E().optional()}).loose(),ere=A({app:Va([M(`cursor`),M(`codex`),M(`claude`),Ma()]),signals_fired:k(E())}).loose();A({entries:k($ne),count:D().int().min(0),detection:ere}).loose(),A({writers:k(A({id:E().min(1),name:E().optional(),email:E().optional()}).loose()).optional(),summary:p4,...f4}).loose(),A({checkpointRef:E().min(1)}).loose();var tre=A({v:D().int().optional(),id:E().min(1),name:E().min(1),colorSeed:E().optional(),docs:k(E()),summaries:k(E()).optional()}).loose();A({entries:k(A({sha:E().min(1),timestamp:E().min(1),author:E(),authorEmail:E(),type:j([`checkpoint`,`wip`,`upstream`,`park`]),message:E(),contributors:k(tre),checkpoint:Pa().nullable()}).loose()),total:D().int().nonnegative().optional(),truncated:O().optional(),hasMore:O().optional()}).loose(),A({sha:E().regex(/^[0-9a-f]{40}$/i),content:E(),timestamp:E(),author:E()}).loose();var nre=A({contentDir:E().min(1),pathSeparator:j([`/`,`\\`]),symlinkResolved:O()}).loose();k(Ua(`source`,[A({docName:E().min(1),timestamp:E().min(1),size:D().int().nonnegative(),source:M(`flat`)}).loose(),A({docName:E().min(1),timestamp:E().min(1),source:M(`timeline`),sha:E().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var rre=A({orphans:k(A({docName:E().min(1),title:E()}).loose())}).loose(),ire=A({hubs:k(A({docName:E().min(1),title:E(),count:D().int().nonnegative()}).loose())}).loose(),are=A({source:E().min(1),title:E(),snippet:E().nullable()}).loose();A({deadLinks:k(A({target:E().min(1),sources:k(are)}).loose())}).loose(),A({target:A({docName:E().min(1),title:E(),aliases:k(E())}).loose(),mentions:k(A({source:E().min(1),excerpt:E(),offset:D().int().nonnegative()}).loose()),truncated:O()}).loose(),A({projectPath:E().min(1)}).loose();var ore=j([`not-a-git-worktree`,`init-failed`]);Ua(`ok`,[A({ok:M(!0),projectPath:E().min(1)}).loose(),A({ok:M(!1),reason:ore,message:E().min(1)}).loose()]),A({host:E().min(1).optional()}).loose(),A({key:E().min(1)}).loose(),A({keyPresent:O()}).loose(),A({name:E().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:E().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),A({authenticated:O()}).loose(),A({}).loose();var sre=A({stackIndex:D().int().min(0),ts:D().int().min(0),additions:D().int().min(0),deletions:D().int().min(0)}).loose(),cre=A({docName:E().min(1),additionsTotal:D().int().min(0),deletionsTotal:D().int().min(0),lastTs:D().int().min(0),bursts:k(sre)}).loose(),lre=A({displayName:E().min(1),color:E().min(1),icon:E().optional(),connectionId:E().min(1)}).loose(),ure=A({sessionAlive:O(),agent:lre.nullable(),files:k(cre)}).loose(),dre=A({diff:E(),generatedAt:D().int().min(0)}).loose();A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose();var fre=A({displayName:E().min(1),icon:E(),color:E().min(1),currentDoc:E().nullable(),mode:j([`idle`,`writing`]),ts:D().int().min(0)}).loose();A({presence:qa(E().min(1),fre)}).loose(),qa(E().min(1),O()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),A({path:E().min(1,`path must be non-empty`)}).loose(),A({}).loose();var pre=A({fromDocName:E().min(1),toDocName:E().min(1)}).loose(),mre=A({fromPath:E().min(1),toPath:E().min(1)}).loose();A({}).loose(),A({path:E().min(1),...f4,summary:p4}).loose();var hre=A({docName:E().min(1)}).loose();A({path:E().min(1),...f4,summary:p4}).loose();var gre=A({path:E().min(1)}).loose();A({kind:j([`file`,`folder`]),path:E().min(1),...f4,summary:p4}).loose();var _re=A({kind:j([`file`,`folder`]),path:E().min(1),duplicatedDocNames:k(E().min(1))}).loose(),vre=A({pages:k(A({docName:E().min(1),title:E(),docExt:E().min(1),size:D().int().nonnegative(),modified:E().min(1),icon:E().min(1).max(2048).optional()}).loose())}).loose(),yre=A({level:D().int().min(1).max(6),text:E(),slug:E()}).loose(),bre=A({docName:E().min(1),headings:k(yre)}).loose(),xre=A({docName:E().min(1),rewrites:D().int().nonnegative()}).loose();A({kind:j([`file`,`folder`,`asset`]),fromPath:E().min(1),toPath:E().min(1),...f4,summary:p4}).loose();var Sre=A({renamed:k(pre),renamedAssets:k(mre),rewrittenDocs:k(xre).optional(),summary:v9.optional()}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4}).loose();var Cre=A({deletedDocNames:k(E().min(1))}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4,summary:p4}).loose();var wre=A({deletedDocNames:k(E().min(1))}).loose();A({docName:E().min(1),commitSha:E().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:p4,...f4}).loose(),A({restoredFrom:E().min(1),timestamp:E().min(1),summary:v9.optional(),warning:y9.optional(),warnings:S9.optional()}).loose();var Tre=j([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Ere=A({label:E().min(1),webUrl:da().nullable()}).loose(),Dre=Ua(`checkStatus`,[A({checkStatus:M(`allowed`)}).loose(),A({checkStatus:M(`denied`),deniedReason:j([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),A({checkStatus:M(`unknown`),unknownError:j([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w9=j([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);A({state:Tre,lastSyncUtc:E().nullable(),lastFetchUtc:E().nullable(),lastPushedSha:E().nullable(),ahead:D().int().min(0),behind:D().int().min(0),consecutiveFailures:D().int().min(0),conflictCount:D().int().min(0),hasRemote:O(),syncEnabled:O(),identityUnresolved:O(),remote:Ere.nullable().optional(),pushError:E().optional(),pushErrorCode:w9.optional(),pullError:E().optional(),pullErrorCode:w9.optional(),pausedReason:E().optional(),pushPermission:Dre.optional()}).loose(),A({op:j([`sync`,`push`,`pull`]).optional()}).loose(),A({op:j([`sync`,`push`,`pull`])}).loose(),A({conflicts:k(A({file:E().min(1),detectedAt:E().min(1),oursSha:E().optional(),theirsSha:E().optional(),baseSha:E().optional()}).loose())}).loose(),A({file:E().min(1),strategy:j([`mine`,`theirs`,`content`,`delete`]),content:E().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),A({}).loose(),A({file:E().min(1),base:E(),ours:E(),theirs:E(),kind:j([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:E().nullable()}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({result:go(e=>e!==void 0,{message:`result is required`})}).loose();var Ore=A({path:E().min(1),summary:E().min(1)}).loose(),kre=A({files:D().int().nonnegative(),folders:D().int().nonnegative()}).loose();A({packs:k(A({id:E().min(1),name:E().min(1),description:E().min(1),defaultSubfolder:E().optional(),folders:k(Ore),entryCounts:kre}).loose())}).loose(),A({noOpen:O().optional(),out:E().min(1).optional()}).loose();var Are=A({reason:j([`unsupported-platform`,`spawn-error`]),message:E()}).loose();Ua(`status`,[A({status:M(`installed`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E()}).loose(),A({status:M(`built`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E(),handoffError:Are.optional()}).loose(),A({status:M(`failed`),buildError:E()}).loose(),A({status:M(`skip-current`),skillVersion:E(),recordedAt:E().optional()}).loose()]),A({tags:k(A({name:E().min(1),count:D().int().nonnegative(),isLeaf:O()}).loose())}).loose();var jre=A({docName:E().min(1),title:E(),matchingTags:k(E().min(1)),snippet:E().nullable()}).loose();A({name:E().min(1),docs:k(jre)}).loose(),A({folder:Pa(),frontmatter_local:qa(E(),Pa()).nullable()}).loose(),A({path:E(),frontmatter:qa(E(),Pa()).optional()}).loose(),A({applied:Pa()}).loose();var T9=qa(E(),Pa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});A({template:A({name:E().min(1),folder:E(),scope:j([`local`,`inherited`]),path:E().min(1),frontmatter:T9,body:E()}).strict()}).strict();var Mre=A({templates:k(A({name:E().min(1),title:E().optional(),description:E().optional(),path:E().min(1),source_folder:E()}).strict()),truncated:O()}).strict();A({folder:E(),name:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({path:E().min(1),created:O(),warnings:k(E())}).strict(),A({existed:O(),path:E().min(1)}).strict(),A({fromFolder:E(),fromName:E(),toFolder:E(),toName:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({from:E().min(1),to:E().min(1),committed:O()}).strict(),A({query:E().optional(),intent:j([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:j([`navigation`,`relevance`]).optional(),scopes:k(j([`page`,`folder`,`content`,`file`])).optional(),scope:E().optional(),limit:D().int().nonnegative().optional(),semantic:O().optional(),source:j([`omnibar`,`mcp`,`http`]).optional()}).loose();var Nre=A({kind:j([`page`,`folder`,`content`,`file`]),path:E().min(1),title:E(),score:D(),signals:qa(E(),Pa()),snippet:E().optional()}).loose(),Pre=A({capable:O(),applied:O(),coverage:A({embedded:D().int().nonnegative(),total:D().int().nonnegative()})}).loose();A({enabled:O(),keyPresent:O(),keySource:j([`file`,`env`]).nullable(),keyHint:E().nullable(),ready:O(),capable:O(),embedded:D().int().nonnegative(),total:D().int().nonnegative()}).loose(),A({query:E(),intent:j([`autocomplete`,`full_text`,`omnibar`]),results:k(Nre),elapsedMs:D().nonnegative(),semantic:Pre.optional(),truncated:O().optional()}).loose();var Fre=A({version:E().min(1),recordedAt:E().min(1)}).loose();A({currentVersion:E().min(1),targets:qa(E(),Fre.nullable())}).loose();var Ire=`server-info`,Lre=`branch-switched`,Rre=`disk-ack`,zre=`config-validation-rejected`,Bre=`config-ignore-nested-error`,E9=j([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Vre=A({v:M(1),ch:M(Ire),seq:D(),serverInstanceId:E().min(1),currentBranch:E().min(1).optional()}).loose(),Hre=A({v:M(1),ch:M(Lre),seq:D(),branch:E().min(1)}).loose(),Ure=A({v:M(1),ch:E9,seq:D()}).loose(),Wre=A({v:M(1),ch:M(Rre),seq:D(),docName:E().min(1),sv:E().min(1)}).loose(),Gre=A({v:M(1),ch:M(zre),seq:D(),docName:E().min(1),error:wu}).loose(),Kre=A({v:M(1),ch:M(Bre),seq:D(),path:E().min(1),error:E().min(1)}).loose(),qre={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function Jre(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Yre=/\.(?:md|mdx)$/;function Xre(e,t){if(t!==`page`)return e;let n=e.replace(Yre,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zre(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=KZ({schema:qre});return e.length>0&&rQ(t,e),t}function Qre(e){let t={documents:e};return D9.set(t,A9(e)),t}function $re(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function eie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tie(e,t){let n=O9(t);if(!n)return 0;let r=Xre(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nie=.5;function M9(e,t){let n=tie(e,t);return n<=0?n:l4(e.path)?n*nie:n}var rie=60;function iie(e){return e===`file`?-rie:0}var aie=1e3,N9=50,oie=1,sie=1,cie=.001;function lie(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-cie:0,c=oie*a+sie*o+s;return e*aie+c}function P9(e,t,n,r){return e+t*20+n+iie(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):lie(t,n,r,i,a)}function uie(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function die(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pie(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function mie(e,t){return O9(t).length<4?0:+(e===`full_text`)}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=[],i=0,a=0;for(let t of e){if(t.document.kind===`folder`){if(i>=3)continue;i+=1}else if(t.document.kind===`file`){if(a>=3)continue;a+=1}if(r.push(t),r.length>=n)break}return r}function hie(e,t,n={}){let r=n.intent??`omnibar`,i=uie(r,n.ranking),a=Jre(n.limit),o=new Set(n.scopes??eie(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=NQ($re(e),{term:c,properties:fie(r),boost:pie(r),tolerance:mie(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=die(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(gie({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function gie(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function _ie(e){return`https://github.com/${e.owner}/${e.repo}.git`}function vie(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mr());var V9=B9[z9],H9=za({version:E().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:j([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()});za({schema:M(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:za({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function yie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??bie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function bie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function xie(){let e=!1,t=``,n=0;return r=>{let i=Sie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Sie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}function Cie(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function wie(e){if(typeof e!=`string`||e.length===0)return e;let t=Q3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(q3(e)){let t=Cie(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=W3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Tie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Eie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Die={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Oie(e,t=Tie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function kie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Aie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var jie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Mie(e){return e?jie[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Nie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Pie(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Fie(e){let[t]=Nie(e);return Pie(t,45,32)}var Iie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Lie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Rie(){return`${q9(Iie)} ${q9(Lie)}`}function zie(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Bie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Rie(),Y9(G9,n)),r||(r=zie(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Vie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Hie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Uie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Vie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Wie(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Gie(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Kie(e,t,n=null){let r=Q9(e);r.pop();let i=Q9(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function qie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Jie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{rre as $,d$ as $n,F as $r,xie as $t,C9 as A,qQ as An,Ob as Ar,W$ as At,W9 as B,_9 as Bn,av as Br,Uie as Bt,gre as C,B6 as Cn,TS as Cr,H1 as Ct,D1 as D,M6 as Dn,gb as Dr,nre as Dt,J1 as E,F6 as En,nb as Er,S2 as Et,p1 as F,P1 as Fn,hb as Fr,A2 as Ft,C0 as G,h0 as Gn,Vp as Gr,g0 as Gt,ire as H,F3 as Hn,wp as Hr,Y$ as Ht,$Q as I,A0 as In,Xb as Ir,Kie as It,P0 as J,W3 as Jn,L as Jr,z2 as Jt,w0 as K,W7 as Kn,I as Kr,Oie as Kt,E2 as L,k0 as Ln,xS as Lr,_ie as Lt,_re as M,$9 as Mn,uS as Mr,s4 as Mt,A1 as N,XQ as Nn,zy as Nr,D2 as Nt,Cre as O,L6 as On,Tb as Or,Hie as Ot,G1 as P,G3 as Pn,Dy as Pr,O2 as Pt,N1 as Q,Q3 as Qn,od as Qr,kie as Qt,w2 as R,T2 as Rn,iS as Rr,yie as Rt,u0 as S,P6 as Sn,qb as Sr,M4 as St,Y1 as T,z6 as Tn,lS as Tr,y2 as Tt,V1 as U,l0 as Un,R as Ur,X$ as Ut,j3 as V,Vne as Vn,zv as Vr,Wie as Vt,l7 as W,l1 as Wn,Rp as Wr,C1 as Wt,mne as X,I4 as Xn,Zd as Xr,R2 as Xt,Qne as Y,qie as Yn,gf as Yr,L2 as Yt,W0 as Z,_2 as Zn,P as Zr,a4 as Zt,_1 as _,P3 as _n,YT as _r,b4 as _t,W1 as a,M as ai,m1 as an,C2 as ar,j4 as at,w1 as b,H6 as bn,tS as br,Mre as bt,qne as c,g as ci,zQ as cn,o9 as cr,BQ as ct,Gre as d,Aie as dn,I2 as dr,E0 as dt,ou as ei,D6 as en,u$ as er,F1 as et,Ure as f,ZQ as fn,k9 as fr,O0 as ft,b1 as g,h1 as gn,vT as gr,x4 as gt,q$ as h,v2 as hn,IT as hr,g4 as ht,k1 as i,du as ii,M1 as in,hie as ir,A4 as it,Gne as j,O1 as jn,Jb as jr,c1 as jt,E9 as k,R6 as kn,Db as kr,n1 as kt,Hre as l,h as li,_0 as ln,L4 as lr,G0 as lt,Vre as m,Bie as mn,_te as mr,k4 as mt,Die as n,Ou as ni,Zre as nn,wie as nr,bre as nt,ure as o,A as oi,b2 as on,e$ as or,P4 as ot,Wre as p,Ene as pn,xte as pr,g1 as pt,E1 as q,g2 as qn,yp as qr,B2 as qt,L1 as r,Tu as ri,Fie as rn,Jie as rr,vre as rt,dre as s,E as si,Z9 as sn,S0 as sr,N4 as st,Eie as t,$l as ti,Qre as tn,Gie as tr,I1 as tt,Kre as u,t9 as un,s9 as ur,Sre as ut,y1 as v,Mie as vn,tE as vr,w4 as vt,hre as w,I6 as wn,SS as wr,X1 as wt,U9 as x,N6 as xn,Bx as xr,wre as xt,v1 as y,V6 as yn,KT as yr,d2 as yt,Yne as z,q3 as zn,nv as zr,vie as zt};
511
+ `||e[r]===`\r`;let i=n.after.charCodeAt(0);return Number.isNaN(i)||i===10||i===13}function une(e,t){let n=``,r=0;for(;r<e.length;){let i=e.charAt(r);if(i===`\\`){n+=e.slice(r,r+2),r+=2;continue}if(i===`*`||i===`_`||i===`~`||i===`=`){let a=r+1;for(;a<e.length&&e.charAt(a)===i;)a++;let o=r===0?t.before.charCodeAt(t.before.length-1):e.charCodeAt(r-1);if(i===`=`)n+=(Number.isNaN(o)||o===10||o===13)&&lne(e,a,t)?`\\${e.slice(r,a)}`:e.slice(r,a);else{let s=a<e.length?e.charCodeAt(a):t.after.charCodeAt(0);n+=cne(i,o,s)?`\\${i}`.repeat(a-r):e.slice(r,a)}r=a;continue}n+=i,r+=1}return n}function Q7(e,t,n){let r=n.startsWith(`_`)?`_`:`*`,i=e,a=i.charCodeAt(0);$7(t.before.charCodeAt(t.before.length-1),a,r)&&(i=e9(a)+i.slice(1));let o=i.charCodeAt(i.length-1);return $7(t.after.charCodeAt(0),o,r)&&(i=i.slice(0,-1)+e9(o)),i}function $7(e,t,n){return!(sz(t)!==X7||n===`_`&&sz(e)===void 0)}function e9(e){return`&#x${e.toString(16).toUpperCase()};`}function dne(e,t,n,r){let i=e.value??``,a=e.data?.sourceDelimiter,o=typeof a==`string`&&/^\$+$/.test(a)?a.length:2;for(o===1&&!pne(i,r)&&(o=2);RegExp(`(^|[^$])${`\\$`.repeat(o)}([^$]|$)`).test(i);)o++;let s=`$`.repeat(o);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` ${i} `);let c=-1;for(;++c<n.unsafe.length;){let e=n.unsafe[c];if(!e.atBreak)continue;let t=n.compilePattern(e),r;for(;(r=t.exec(i))!==null;){let e=r.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=`${i.slice(0,e)} ${i.slice(r.index+1)}`}}return s+i+s}function fne(e,t,n,r){let i=e.data?.sourceDelimiter===`~`?`~`:`~~`,a=n.createTracker(r),o=n.enter(`strikethrough`),s=a.move(i);return s+=n.containerPhrasing(e,{...a.current(),before:s,after:`~`}),s+=a.move(i),o(),s}function pne(e,t){return!(e.length===0||!/^\S/.test(e)||!/\S$/.test(e)||/[$\r\n]/.test(e)||e.endsWith(`\\`)||/\\[!-/:-@[-`{-~]/.test(e)||/^\d/.test(t.after)||t.before.endsWith(`\\`))}function t9(e){if(!Number.isFinite(e)||e<0)return``;if(e<1024)return`${e} B`;let t=[`KiB`,`MiB`,`GiB`,`TiB`],n=e/1024,r=0;for(;n>=1024&&r<t.length-1;)n/=1024,r+=1;return`${n.toFixed(1).replace(/\.0$/,``)} ${t[r]}`}var mne=class{schema;handlers;pmNodeHandlers;pmMarkHandlers;parseProcessor;serializeProcessor;parseCtx={current:{}};constructor(e){this.schema=Tb(e.extensions),this.handlers=bne(this.schema,this.parseCtx);let{nodeHandlers:t,markHandlers:n}=xne(this.schema);this.pmNodeHandlers=t,this.pmMarkHandlers=n,this.parseProcessor=Gte({schema:this.schema,handlers:this.handlers,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers}),this.serializeProcessor=Kte({toMarkdownHandlers:rne})}parse(e,t){if(!e.trim())return{type:`doc`,content:[{type:`paragraph`,content:[]}]};this.parseCtx.current=t??{};try{return Jte(e,this.parseProcessor).toJSON()}finally{this.parseCtx.current={}}}parseToMdast(e){return e.trim()?Yte(e,this.parseProcessor):{type:`root`,children:[]}}parseWithFallback(e,t){return e.trim()?X6(e,{parse:e=>this.parse(e,t)}):{type:`doc`,content:[{type:`paragraph`,content:[]}]}}serialize(e){let t;try{t=this.schema.nodeFromJSON(e)}catch(t){let n=`MarkdownManager.serialize() failed: schema rejected JSONContent (type=${e.type}, childCount=${e.content?.length??0})`;throw Error(n,{cause:t})}return Xte(t,this.serializeProcessor,{schema:this.schema,pmNodeHandlers:this.pmNodeHandlers,pmMarkHandlers:this.pmMarkHandlers})}},n9=D6();function hne(e,t){let n=new Map;for(let e of t)n.set(e.name,e);let r={};for(let t of e){if(t.type===`mdxJsxExpressionAttribute`)continue;let e=t.name,i=n.get(e);if(t.value===null||t.value===void 0){r[e]=!0;continue}if(typeof t.value==`string`){if(i?.type===`number`){let n=Number(t.value);r[e]=Number.isNaN(n)?t.value:n}else i?.type===`boolean`?r[e]=t.value===`true`:r[e]=t.value;continue}let a=t.value.value;try{r[e]=JSON.parse(a)}catch{r[e]=a}}return r}function gne(e){let t=!1;return e.descendants(e=>t||e.type.name===`jsxInline`?!1:e.type.name===`jsxComponent`&&e.attrs.sourceDirty?(t=!0,!1):!0),t}function _ne(e){return e.attrs.sourceDirty||gne(e)}function vne(e){if(e.type!==`paragraph`)return!1;let t=e.children??[];return t.length===0?!0:t.every(e=>e.type===`text`&&e.value===``)}function r9(e,t){if(!t)return e;let n={};return t.sourceFenceChar&&(n.sourceFenceChar=t.sourceFenceChar),typeof t.sourceFenceLength==`number`&&(n.sourceFenceLength=t.sourceFenceLength),t.sourcePadded===!0&&(n.sourcePadded=!0),Object.keys(n).length===0?e:{...e,data:n}}function i9(e,t){if(e.length===0)return r9({type:`inlineCode`,value:``},t);if(e.every(e=>e.type===`text`))return r9({type:`inlineCode`,value:e.map(e=>e.value).join(``)},t);if(e.length===1&&`children`in e[0]){let n=e[0];return{...n,children:[i9(n.children,t)]}}return r9({type:`inlineCode`,value:a9(e)},t)}function a9(e){let t=``;for(let n of e)n.type===`text`?t+=n.value:`children`in n&&Array.isArray(n.children)?t+=a9(n.children):`value`in n&&typeof n.value==`string`&&(t+=n.value);return t}var yne=V1;function bne(e,t){let n=e.nodes,r=e.marks,i={};n.paragraph&&(i.paragraph=(e,t,r)=>{let i=r.all(e).flat(),a=i.some(e=>e?.isBlock&&!e?.isInline),o=i.some(e=>e?.isInline||e?.isText||e?.isTextblock);if(a&&!o)return i.length===1?i[0]:i;if(a&&o){let e=i.filter(e=>!e?.isBlock||e?.isInline),t=i.filter(e=>e?.isBlock&&!e?.isInline),r=[],a=n.paragraph.createAndFill(null,e.length>0?e:null);return a&&r.push(a),r.push(...t),r.length===1?r[0]:r}return n.paragraph.createAndFill(null,i.length>0?i:null)}),n.blockquote&&(i.blockquote=XU(n.blockquote,e=>({sourceMarkerSpacings:e.data?.sourceMarkerSpacings??null}))),n.tableCell&&(i.tableCell=(e=>(t,r,i)=>{let a=i.all(t).flat();if(a.length>0&&n.paragraph){let t=n.paragraph.create(null,a);return e.createAndFill(null,[t])}return e.createAndFill(null,null)})(n.tableCell)),n.tableRow&&(i.tableRow=XU(n.tableRow)),n.table&&n.tableRow&&n.tableCell&&(i.table=(e,t,r)=>{let i=e.align??[],a=e.children??[],o=[];for(let e=0;e<a.length;e++){let t=a[e];if(t.type!==`tableRow`)continue;let s=t.children??[],c=[];for(let t=0;t<s.length;t++){let a=s[t];if(a.type!==`tableCell`)continue;let o=r.all(a).flat(),l=o.length>0&&n.paragraph?[n.paragraph.create(null,o)]:null,u=i[t]??null,d=e===0&&n.tableHeader?n.tableHeader:n.tableCell,f=a.data?.sourcePadding??null,p=d.createAndFill({align:u,sourcePadding:f},l);p&&c.push(p)}let l=n.tableRow.createAndFill(null,c.length>0?c:null);l&&o.push(l)}let s=e.data?.sourceDashCounts??null,c=e.data?.sourceOuterPipes??null,l=e.data?.sourceAlignmentPadding??null;return n.table.createAndFill({sourceDashCounts:s,sourceOuterPipes:c,sourceAlignmentPadding:l},o.length>0?o:null)}),n.image&&(i.image=e=>{let r=e.url??``,i=W7(r,t.current.sourcePath);return n.image.createAndFill({src:i,alt:e.alt??null,title:e.title??null,sourceUrl:i===r?null:r})},n.imageReference?i.imageReference=e=>n.imageReference.createAndFill({alt:e.alt??``,label:e.label??e.identifier??``,identifier:e.identifier??``,referenceType:e.referenceType??`shortcut`}):i.imageReference=e=>n.image.createAndFill({src:``,alt:e.alt??null,title:null})),r.escapeMark&&(i.text=t=>{let n=t.value??``,i=typeof t.data?.sourceRaw==`string`?t.data.sourceRaw:null;if(!n&&!i)return null;if(i){let t=n.replaceAll(`\xA0`,` `);return r.sourceLiteral?e.text(t,[r.sourceLiteral.create({sourceRaw:i})]):e.text(t)}let a=t.data?.escapedChars,o=t.data?.entityRefSpans;if(!a?.length&&!o?.length)return e.text(n.replaceAll(`\xA0`,` `));let s=[...(a??[]).map(e=>({kind:`escape`,offset:e.offset,length:1})),...(o??[]).map(e=>({kind:`entity`,offset:e.offset,length:e.length,raw:e.raw}))];s.sort((e,t)=>e.offset-t.offset);let c=[];for(let e of s){let t=c[c.length-1];e.kind===`entity`&&t?.kind===`entity`&&t.offset+t.length===e.offset&&r2(t.raw)!==null&&e2(e.raw)?c[c.length-1]={kind:`entity`,offset:t.offset,length:t.length+e.length,raw:t.raw+e.raw}:c.push(e)}let l=[],u=0;for(let t of c){if(t.offset>u){let r=n.slice(u,t.offset).replaceAll(`\xA0`,` `);r&&l.push(e.text(r))}if(t.offset<n.length){let i=n.slice(t.offset,t.offset+t.length).replaceAll(`\xA0`,` `);if(i)if(t.kind===`escape`)l.push(e.text(i,[r.escapeMark.create()]));else if(r.sourceLiteral){let n=r2(t.raw);l.push(e.text(n??i,[r.sourceLiteral.create({sourceRaw:t.raw})]))}else l.push(e.text(i));u=t.offset+t.length}}if(u<n.length){let t=n.slice(u).replaceAll(`\xA0`,` `);t&&l.push(e.text(t))}return l.length===1?l[0]:l}),r.code&&(i.inlineCode=t=>e.text(t.value,[r.code.create({sourceFenceChar:t.data?.sourceFenceChar??"`",sourceFenceLength:typeof t.data?.sourceFenceLength==`number`?t.data.sourceFenceLength:1,sourcePadded:t.data?.sourcePadded===!0})]));let a=r.strike??r.delete;if(a&&(i.delete=ZU(a,e=>({sourceDelimiter:e.data?.sourceDelimiter===`~`?`~`:`~~`}))),r.highlight&&(i.mark=ZU(r.highlight)),r.comment&&(i.comment=ZU(r.comment,e=>({sourceForm:e.data?.sourceForm??`percent`}))),n.commentBlock&&(i.commentBlock=XU(n.commentBlock,e=>({sourceForm:e.data?.sourceForm??`percent`,sourceLayout:e.data?.sourceLayout??`block`}))),r.emphasis&&(i.emphasis=ZU(r.emphasis,e=>({sourceDelimiter:e.data?.sourceDelimiter??`*`}))),r.strong&&(i.strong=ZU(r.strong,e=>({sourceDelimiter:e.data?.sourceDelimiter??`**`}))),n.heading&&(i.heading=XU(n.heading,e=>({level:e.depth,headingStyle:e.data?.sourceStyle??`atx`,sourceTrailingHashes:e.data?.sourceTrailingHashes??null,sourceUnderlineLength:e.data?.sourceUnderlineLength??null,sourceContiguousNext:e.data?.sourceContiguousNext??!1,sourceLeadingIndent:e.data?.sourceLeadingIndent??null,sourceInteriorSpacing:e.data?.sourceInteriorSpacing??null}))),n.codeBlock&&(i.code=t=>{let r=t.value?[e.text(t.value)]:[];return n.codeBlock.createAndFill({language:t.lang??null,meta:t.meta??null,fenceDelimiter:t.data?.sourceFenceChar??"`",fenceLength:t.data?.sourceFenceLength??3,sourceStyle:t.data?.sourceStyle??`fenced`,sourceClosingFenceLength:t.data?.sourceClosingFenceLength??null,sourceFenceIndent:t.data?.sourceFenceIndent??null,sourceInfoPadding:t.data?.sourceInfoPadding??null,sourceIndents:t.data?.sourceIndents??null},r)}),n.thematicBreak&&(i.thematicBreak=e=>n.thematicBreak.createAndFill({sourceRaw:e.data?.sourceRaw??`---`})),n.hardBreak&&(i.break=e=>n.hardBreak.createAndFill({hardBreakStyle:e.data?.sourceStyle??`spaces`})),n.list&&(i.list=XU(n.list,e=>({ordered:!!e.ordered,start:e.start??1,spread:!!e.spread,bulletMarker:e.data?.bulletMarker??null,listMarkerDelimiter:e.data?.listMarkerDelimiter??null}))),n.listItem&&(i.listItem=XU(n.listItem,e=>({checked:e.checked??null,spread:!!e.spread,sourceMarkerSpacing:e.data?.sourceMarkerSpacing??null,sourceOrdinal:e.data?.sourceOrdinal??null,sourceCheckboxChar:e.data?.sourceCheckboxChar??null,sourceContinuationIndent:e.data?.sourceContinuationIndent??null}))),r.link){let t=r.sourceLiteral;i.link=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[](${n.url??``})`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:n.url??``,title:n.title??null,linkStyle:n.data?.sourceStyle??`inline`,refLabel:null,sourceUrlForm:n.data?.sourceUrlForm??null,sourceTitleMarker:n.data?.sourceTitleMarker??null});return o.map(e=>e.mark(s.addToSet(e.marks)))},i.linkReference=(n,i,a)=>{if((n.children??[]).length===0){let r=typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:`[${n.label??``}][${n.identifier??``}]`;return r?t?e.text(r,[t.create({sourceRaw:r})]):e.text(r):null}let o=a.all(n).flat(),s=r.link.create({href:``,title:null,linkStyle:n.referenceType??`shortcut`,refLabel:n.label??n.identifier??null});return o.map(e=>e.mark(s.addToSet(e.marks)))}}n.htmlBlock&&(i.html=e=>n.htmlBlock.createAndFill({content:e.value??``}));let o=n.linkDefinition??n.linkRefDef;if(o){let e=!!o.spec.attrs?.url,t=!!o.spec.attrs?.href,n=!!o.spec.attrs?.identifier,r=!!o.spec.attrs?.sourceLayout,a=!!o.spec.attrs?.sourceTitleMarker;i.definition=i=>{let s={title:i.title??null};return n&&(s.identifier=i.identifier??``),s.label=i.label??i.identifier??``,e?s.url=i.url??``:t&&(s.href=i.url??``),r&&(s.sourceLayout=i.data?.sourceLayout??null),a&&(s.sourceTitleMarker=i.data?.sourceTitleMarker??null),o.createAndFill(s)}}if(n.jsxComponent){let r=e=>{if(e&&typeof e==`object`&&`sourceRaw`in e){let t=e.sourceRaw;if(typeof t==`string`)return t}};i.mdxJsxFlowElement=(e,i,a)=>{let o=e.name??``,s=n9.getOrWildcard(o),c=hne(e.attributes,s.props);if(o===`CommonMarkImage`&&typeof c.src==`string`){let e=c.src,n=W7(e,t.current.sourcePath);n!==e&&(c.src=n,c.sourceUrl=e)}let l=a.all(e).flat();return n.jsxComponent.createAndFill({componentName:o,kind:`element`,attributes:e.attributes,sourceRaw:r(e.data)??``,sourceDirty:!1,props:c},l.length?l:void 0)};let a=(e,t)=>{let n=e.attributes?.find(e=>e.type===`mdxJsxAttribute`&&e.name===t);return n&&typeof n.value==`string`?n.value:null};i.mdxJsxTextElement=t=>{if(t.name===`InlineMath`&&n.mathInline){let e=a(t,`formula`)??``,r=a(t,`id`);return n.mathInline.create({formula:e,id:r??null})}if(t.name===`Tag`&&n.tag){let e=a(t,`value`)??``;return n.tag.create({value:e})}if(n.jsxInline){let i=r(t.data)??``;return n.jsxInline.createAndFill({},i?[e.text(i)]:null)}return n.jsxComponent.createAndFill({sourceRaw:r(t.data)??``})},i.mdxFlowExpression=e=>{let t=r(e.data)??`{${e.value??``}}`;return n.jsxComponent.createAndFill({kind:`expression`,sourceRaw:t,sourceDirty:!1})},i.mdxTextExpression=t=>{let n=r(t.data)??`{${t.value??``}}`;return e.text(n)}}return n.wikiLink&&(i.wikiLink=e=>n.wikiLink.createAndFill({target:e.data?.target??``,alias:e.data?.alias??null,anchor:e.data?.anchor??null,sourceTarget:e.data?.sourceTarget??null,sourceAnchor:e.data?.sourceAnchor??null,sourceAlias:e.data?.sourceAlias??null})),n.tag&&(i.tag=e=>n.tag.createAndFill({value:e.value})),n.wikiLinkEmbed&&(i.wikiLinkEmbed=(i,a)=>{let o=i.data?.target??``,s=i.data?.alias??null,c=i.data?.anchor??null,l=b2(o),{resolveEmbed:u,sourcePath:d}=t.current,f=u&&d?u(o,d)??null:null,p=f?`/${f}`:o,m=a?.type===`paragraph`&&Array.isArray(a.children)&&a.children.length===1;if(m&&yne.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedImage`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedImage`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,alt:s??o,target:o,anchor:c,alias:s}});if(m&&H1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedVideo`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedVideo`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&W1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedAudio`))return n.jsxComponent.createAndFill({componentName:`WikiEmbedAudio`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,title:s??o,target:o,anchor:c,alias:s}});if(m&&G1.has(l)&&n.jsxComponent&&n9.has(`WikiEmbedFile`)){let{resolveSize:e}=t.current,r=e&&d?e(o,d)??null:null,i=r===null?null:t9(r);return n.jsxComponent.createAndFill({componentName:`WikiEmbedFile`,kind:`element`,attributes:[],sourceRaw:``,sourceDirty:!1,props:{src:p,target:o,anchor:c,alias:s,size:i}})}let h=s||(c?`${o}#${c}`:o);if(r.link){let t=r.link.create({href:p,title:null,linkStyle:`inline`,refLabel:null,sourceForm:`wikiembed`,target:o,anchor:c,alias:s});return e.text(h,[t])}throw Error("[wikiLinkEmbed handler] schema lacks `link` mark — cannot dispatch without violating the STOP rule against emitting PM wikiLinkEmbed server-side")}),n.mathInline&&(i.inlineMath=e=>n.mathInline.create({formula:e.value??``,sourceDelimiter:e.data?.sourceDelimiter??null})),i.math||=t=>{let r=t.value==null?`«unknown:${t.type}»`:t.value;return n.rawMdxFallback?(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled block mdast: ${t.type}`})),n.rawMdxFallback.createAndFill({reason:`Unhandled block mdast: ${t.type}`},r?[e.text(r)]:null)):null},i.inlineMath||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.type,reason:`Unhandled inline mdast: ${t.type}`})),t.value==null?e.text(`«unknown:${t.type}»`):e.text(t.value)),n.footnoteReference?i.footnoteReference=e=>n.footnoteReference.create({identifier:e.identifier,label:e.label??e.identifier}):i.footnoteReference||=t=>(console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteReference`,reason:`FootnoteReference extension missing — recovering [^id] source`})),e.text(`[^${t.label??t.identifier}]`)),n.footnoteDefinition?i.footnoteDefinition=XU(n.footnoteDefinition,e=>{let t=e;return{identifier:t.identifier,label:t.label??t.identifier}}):i.footnoteDefinition||=t=>{console.warn(JSON.stringify({event:`unknown-mdast-type`,type:`footnoteDefinition`,reason:`FootnoteDefinition extension missing — recovering [^id]: marker`}));let r=`[^${t.label??t.identifier}]: `;return n.paragraph?n.paragraph.create(null,e.text(r)):null},i.rawMdxFallbackMdast=t=>{if(!n.rawMdxFallback)return null;let r=t.position?{start:t.position.start?.offset??0,end:t.position.end?.offset??0}:{start:0,end:0};return console.warn(JSON.stringify({event:`unknown-mdast-type`,type:t.originalType,reason:`Unhandled mdast: ${t.originalType}`,unresolvedPosition:t.unresolvedPosition??!1})),n.rawMdxFallback.createAndFill({reason:`Unhandled mdast: ${t.originalType}`,originalSpan:r},t.value?[e.text(t.value)]:null)},i}function xne(e){let t={},n={},r=e.nodes,i=e.marks;r.paragraph&&(t.paragraph=nW(`paragraph`)),r.blockquote&&(t.blockquote=nW(`blockquote`,e=>{let t=e.attrs.sourceMarkerSpacings,n={};return Array.isArray(t)&&t.length>0&&(n.sourceMarkerSpacings=t),Object.keys(n).length>0?{data:n}:{}})),r.heading&&(t.heading=nW(`heading`,e=>({depth:e.attrs.level,data:{sourceStyle:e.attrs.headingStyle,sourceTrailingHashes:e.attrs.sourceTrailingHashes??void 0,sourceUnderlineLength:e.attrs.sourceUnderlineLength??void 0,sourceContiguousNext:e.attrs.sourceContiguousNext===!0?!0:void 0,sourceLeadingIndent:e.attrs.sourceLeadingIndent??void 0,sourceInteriorSpacing:e.attrs.sourceInteriorSpacing??void 0}}))),r.codeBlock&&(t.codeBlock=e=>{let t=e.attrs.sourceStyle===`indented`?`indented`:`fenced`;return{type:`code`,lang:t===`indented`?null:e.attrs.language??null,meta:t===`indented`?null:e.attrs.meta??null,value:e.textContent??``,data:{sourceFenceChar:e.attrs.fenceDelimiter,sourceFenceLength:e.attrs.fenceLength,sourceStyle:t,sourceClosingFenceLength:e.attrs.sourceClosingFenceLength??void 0,sourceFenceIndent:e.attrs.sourceFenceIndent??void 0,sourceInfoPadding:e.attrs.sourceInfoPadding??void 0,sourceIndents:e.attrs.sourceIndents??void 0}}}),r.thematicBreak&&(t.thematicBreak=e=>({type:`thematicBreak`,data:{sourceRaw:e.attrs.sourceRaw}})),r.hardBreak&&(t.hardBreak=e=>({type:`break`,data:{sourceStyle:e.attrs.hardBreakStyle}})),r.list&&(t.list=nW(`list`,e=>({ordered:e.attrs.ordered??!1,start:e.attrs.ordered?e.attrs.start??1:null,spread:e.attrs.spread??!1,data:{bulletMarker:e.attrs.bulletMarker,listMarkerDelimiter:e.attrs.listMarkerDelimiter}}))),r.listItem&&(t.listItem=(e,t,n)=>{let r=n.all(e),i=r.length>1&&vne(r[0])?r.slice(1):r,a={};return typeof e.attrs.sourceMarkerSpacing==`number`&&(a.sourceMarkerSpacing=e.attrs.sourceMarkerSpacing),typeof e.attrs.sourceOrdinal==`number`&&(a.sourceOrdinal=e.attrs.sourceOrdinal),e.attrs.sourceCheckboxChar===`X`&&(a.sourceCheckboxChar=`X`),typeof e.attrs.sourceContinuationIndent==`number`&&(a.sourceContinuationIndent=e.attrs.sourceContinuationIndent),{type:`listItem`,checked:e.attrs.checked??null,spread:e.attrs.spread??!1,...Object.keys(a).length>0?{data:a}:{},children:i}}),r.table&&(t.table=(e,t,n)=>{let r=n.all(e),i=[],a=e.firstChild;a&&a.forEach(e=>{let t=e.attrs.align;i.push(t===`left`||t===`right`||t===`center`?t:null)});let o=r.filter(e=>e.type===`tableRow`),s=e.attrs.sourceDashCounts,c={};Array.isArray(s)&&s.length>0&&(c.sourceDashCounts=s);let l=e.attrs.sourceOuterPipes;typeof l==`object`&&l&&typeof l.leading==`boolean`&&typeof l.trailing==`boolean`&&(c.sourceOuterPipes=l);let u=e.attrs.sourceAlignmentPadding;Array.isArray(u)&&u.length>0&&(c.sourceAlignmentPadding=u);let d=Object.keys(c).length>0?c:void 0,f={type:`table`,align:i,children:o};return d&&(f.data=d),f}),r.tableRow&&(t.tableRow=nW(`tableRow`));let a=e=>{let t=e.attrs.sourcePadding,n={};return typeof t==`object`&&t&&typeof t.left==`number`&&typeof t.right==`number`&&(n.sourcePadding=t),Object.keys(n).length>0?{data:n}:{}};if(r.tableCell&&(t.tableCell=nW(`tableCell`,a)),r.tableHeader&&(t.tableHeader=nW(`tableCell`,a)),r.image&&(t.image=e=>({type:`image`,url:e.attrs.sourceUrl??e.attrs.src,alt:e.attrs.alt,title:e.attrs.title})),r.imageReference&&(t.imageReference=e=>{let t=e.attrs.label??``,n=e.attrs.identifier??t;return{type:`imageReference`,alt:e.attrs.alt??``,identifier:n,label:t||n,referenceType:e.attrs.referenceType??`shortcut`}}),r.htmlBlock&&(t.htmlBlock=e=>({type:`html`,value:e.attrs.content})),r.linkDefinition??r.linkRefDef){let e=r.linkDefinition?`linkDefinition`:`linkRefDef`;t[e]=e=>{let t={},n=e.attrs.sourceLayout;(n===`multiline`||n===`inline`)&&(t.sourceLayout=n);let r=e.attrs.sourceTitleMarker;(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r);let i={type:`definition`,identifier:e.attrs.identifier??e.attrs.label??``,label:e.attrs.label??e.attrs.identifier??``,url:e.attrs.url??e.attrs.href??``,title:e.attrs.title};return Object.keys(t).length>0&&(i.data=t),i}}if(r.jsxComponent&&(t.jsxComponent=(e,t,n)=>{if(e.attrs.kind===`expression`)return{type:`html`,value:e.attrs.sourceRaw??``};let r=e.attrs.componentName||null,i=Array.isArray(e.attrs.attributes)?e.attrs.attributes:[];return!_ne(e)&&e.attrs.sourceRaw?{type:`mdxJsxFlowElement`,name:r,attributes:i,children:[],data:{sourceRaw:String(e.attrs.sourceRaw)}}:n9.getOrWildcard(r??`*`).serialize(e,{all:e=>n.all(e),registry:n9,serializeChildren:()=>{throw Error(`SerializeContext.serializeChildren is not available in the PM→mdast handler. Compat descriptors that need markdown-byte body rendering must emit a marker mdast node and let the to-markdown handler render the body via state.containerFlow.`)}})}),r.rawMdxFallback&&(t.rawMdxFallback=e=>{let t=e.textContent??``,n=typeof e.attrs.reason==`string`?e.attrs.reason:``,r=e.attrs.originalSpan;return{type:`rawMdxFallback`,value:t,data:{reason:n,originalSpan:r&&typeof r==`object`&&`start`in r&&`end`in r?{start:Number(r.start)||0,end:Number(r.end)||0}:{start:0,end:0}}}}),r.jsxInline&&(t.jsxInline=e=>{let t=e.attrs.sourceRaw||e.textContent||``;return{type:`mdxJsxTextElement`,name:null,attributes:[],children:[],data:{sourceRaw:String(t)}}}),r.mathInline&&(t.mathInline=e=>{let t=e.attrs.formula??``,n=e.attrs.id;if(typeof n==`string`&&n.length>0)return{type:`mdxJsxTextElement`,name:`InlineMath`,attributes:[{type:`mdxJsxAttribute`,name:`formula`,value:t},{type:`mdxJsxAttribute`,name:`id`,value:n}],children:[]};let r=e.attrs.sourceDelimiter;return{type:`inlineMath`,value:t,...typeof r==`string`&&r.length>0?{data:{sourceDelimiter:r}}:{}}}),r.wikiLink&&(t.wikiLink=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLink`,value:i,data:{target:t,anchor:n,alias:r,sourceTarget:typeof e.attrs.sourceTarget==`string`?e.attrs.sourceTarget:null,sourceAnchor:typeof e.attrs.sourceAnchor==`string`?e.attrs.sourceAnchor:null,sourceAlias:typeof e.attrs.sourceAlias==`string`?e.attrs.sourceAlias:null},children:[{type:`text`,value:i}]}}),r.tag&&(t.tag=e=>({type:`tag`,value:String(e.attrs.value??``)})),r.wikiLinkEmbed&&(t.wikiLinkEmbed=e=>{let t=e.attrs.target??``,n=e.attrs.anchor??null,r=e.attrs.alias??null,i=r||(n?`${t}#${n}`:t);return{type:`wikiLinkEmbed`,value:i,data:{target:t,anchor:n,alias:r},children:[{type:`text`,value:i}]}}),i.emphasis&&(n.emphasis=rW(`emphasis`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.strong&&(n.strong=rW(`strong`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter}}))),i.code&&(n.code=(e,t,n)=>{let r=e.attrs.sourceFenceChar,i=e.attrs.sourceFenceLength;return i9(n,{sourceFenceChar:r,sourceFenceLength:i,sourcePadded:e.attrs.sourcePadded===!0?!0:void 0})}),i.strike??i.delete){let e=i.strike?`strike`:`delete`;n[e]=rW(`delete`,e=>({data:{sourceDelimiter:e.attrs.sourceDelimiter===`~`?`~`:`~~`}}))}return i.highlight&&(n.highlight=rW(`mark`)),i.comment&&(n.comment=rW(`comment`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`}}))),r.commentBlock&&(t.commentBlock=nW(`commentBlock`,e=>({data:{sourceForm:e.attrs.sourceForm===`html`?`html`:`percent`,sourceLayout:e.attrs.sourceLayout===`inline`?`inline`:`block`}}))),r.footnoteReference&&(t.footnoteReference=e=>{let t=String(e.attrs.identifier??``);return{type:`footnoteReference`,identifier:t,label:e.attrs.label?String(e.attrs.label):t}}),r.footnoteDefinition&&(t.footnoteDefinition=nW(`footnoteDefinition`,e=>({identifier:String(e.attrs.identifier??``),label:e.attrs.label?String(e.attrs.label):String(e.attrs.identifier??``)}))),i.link&&(n.link=(e,t,n)=>{if(e.attrs.sourceForm===`wikiembed`){let t=typeof e.attrs.target==`string`&&e.attrs.target.length>0?e.attrs.target:e.attrs.href??``,r=typeof e.attrs.anchor==`string`&&e.attrs.anchor.length>0?e.attrs.anchor:null,i=typeof e.attrs.alias==`string`&&e.attrs.alias.length>0?e.attrs.alias:null,a=i||(r?`${t}#${r}`:t),o=n.map(e=>`value`in e&&typeof e.value==`string`?e.value:``).join(``);return o!==a&&o.trim().length>0&&!o.includes(`]]`)&&(i=o,a=o),{type:`wikiLinkEmbed`,value:a,data:{target:t,anchor:r,alias:i},children:[{type:`text`,value:a}]}}let r=e.attrs.linkStyle;if(r===`autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`autolink`}};if(r===`gfm-autolink`)return{type:`link`,url:e.attrs.href??``,title:null,children:n,data:{sourceStyle:`gfm-autolink`}};if(r===`inline`||!r){let t={};e.attrs.sourceUrlForm===`angle-bracketed`&&(t.sourceUrlForm=`angle-bracketed`);let r=e.attrs.sourceTitleMarker;return(r===`single`||r===`double`||r===`paren`)&&(t.sourceTitleMarker=r),{type:`link`,url:e.attrs.href??``,title:e.attrs.title??null,children:n,...Object.keys(t).length>0?{data:t}:{}}}return{type:`linkReference`,identifier:(e.attrs.refLabel??``).toLowerCase(),label:e.attrs.refLabel,referenceType:r,children:n}}),i.escapeMark&&(n.escapeMark=(e,t,n)=>{for(let e of n)if(e.type===`text`&&e.value){let t=e;t.data??={},t.data.escapedChars??=[];for(let e=0;e<t.value.length;e++)t.data.escapedChars.push({offset:e,char:t.value[e]})}return n.length===1?n[0]:n}),i.sourceLiteral&&(n.sourceLiteral=(e,t,n)=>{let r=typeof e.attrs.sourceRaw==`string`?e.attrs.sourceRaw:``;if(n.length===1&&n[0]?.type===`text`){let e=n[0],t=r||e.value;return a2(t,e.value)&&(e.data??={},e.data.sourceRaw=t),e}return{type:`text`,value:n.filter(e=>e.type===`text`).map(e=>e.value??``).join(``)||r}}),{nodeHandlers:t,markHandlers:n}}var Sne=/\p{M}+/gu,Cne=/[^\p{L}\p{N}]+/gu,wne=/^-+|-+$/g;function o9(e){return e.trim().normalize(`NFKD`).replace(Sne,``).toLowerCase().replace(Cne,`-`).replace(wne,``)}function Tne(e,t){let n=t.get(e)??0;return t.set(e,n+1),n===0?e:`${e}-${n}`}function Ene(e,t){let n=o9(e);return n?Tne(n,t):``}function s9(e,t){let n=o9(e);return t?`#${n}-${o9(t)}`:`#${n}`}var c9=new Set([`img`,`video`,`audio`,`mark`]),Dne=new Map(T6.flatMap(e=>e.surface===`compat`&&c9.has(e.rendersAs)?[[e.name,e]]:[]));function l9(e){let t={};for(let n of e.attributes){if(n.type!==`mdxJsxAttribute`)return null;let e=n.name.toLowerCase();if(!(e.length>=3&&e.startsWith(`on`)))if(n.value===null)t[n.name]=!0;else if(typeof n.value==`string`)t[n.name]=n.value;else return null}return t}function u9(e){let t=e.name;if(!t||!c9.has(t))return null;let n=l9(e);return n===null?null:{type:`element`,tagName:t,properties:n,children:[]}}function d9(e){let t=e.name;if(!t)return null;let n=Dne.get(t);if(!n)return null;let r=l9(e);if(r===null)return null;let i=n.translateProps(r),a={};for(let[e,t]of Object.entries(i))(typeof t==`string`||typeof t==`boolean`)&&(a[e]=t);return{type:`element`,tagName:n.rendersAs,properties:a,children:[]}}var One=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-link`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},kne=(e,t)=>{let n=t,{target:r,anchor:i,alias:a}=n.data,o={type:`element`,tagName:`a`,properties:{className:[`wiki-embed`],dataTarget:r,dataAnchor:i??``,dataAlias:a??``,href:s9(r,i)},children:n.children.length>0?e.all(n):[{type:`text`,value:n.value}]};return e.patch(t,o),e.applyData(t,o)},Ane=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i){e.patch(t,i);let n=e.applyData(t,i);return n.tagName===`img`?{type:`element`,tagName:`p`,properties:{},children:[n]}:n}let a={type:`element`,tagName:`pre`,properties:{className:[`mdx-component`]},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]}]};return e.patch(t,a),e.applyData(t,a)},jne=(e,t)=>{let n=t,r=u9(n);if(r)return n.children.length>0&&(r.children=e.all(n)),e.patch(t,r),e.applyData(t,r);let i=d9(n);if(i)return e.patch(t,i),e.applyData(t,i);let a={type:`element`,tagName:`span`,properties:{className:[`mdx-inline`],dataJsxInline:``},children:[{type:`text`,value:typeof n.data?.sourceRaw==`string`?n.data.sourceRaw:``}]};return e.patch(t,a),e.applyData(t,a)},Mne=(e,t)=>{let n=t,r=n.data.reason||`unknown`,i=n.value||``,a=r.replace(/--/g,`—`),o={type:`comment`,value:` Parse error: ${a} `},s={type:`element`,tagName:`pre`,properties:{className:[`mdx-fallback`],dataRawMdxFallback:``,dataReason:a},children:[{type:`element`,tagName:`code`,properties:{},children:[{type:`text`,value:i}]}]};return e.patch(t,s),[o,e.applyData(t,s)]},Nne=(e,t)=>{let n={type:`element`,tagName:`mark`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)};function f9(e){if(typeof e!=`object`||!e)return``;let t=e;return typeof t.value==`string`?t.value:Array.isArray(t.children)?t.children.map(f9).join(``):``}var p9={wikiLink:One,wikiLinkEmbed:kne,mdxJsxFlowElement:Ane,mdxJsxTextElement:jne,rawMdxFallback:Mne,mark:Nne,tag:(e,t)=>{let n=t.value,r={type:`element`,tagName:`a`,properties:{className:[`tag`],dataTag:n,href:`#tag/${n}`},children:[{type:`text`,value:`#${n}`}]};return e.patch(t,r),e.applyData(t,r)},comment:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},commentBlock:(e,t)=>{let n={type:`comment`,value:f9(t).replace(/--/g,`—`)};return e.patch(t,n),e.applyData(t,n)},footnoteReference:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`sup`,properties:{id:`fnref-${n}`,dataFootnoteRef:``,dataFootnoteId:n,className:[`footnote-ref`]},children:[{type:`element`,tagName:`a`,properties:{href:`#fn-${n}`,className:[`footnote-ref-link`]},children:[{type:`text`,value:`[${n}]`}]}]};return e.patch(t,r),e.applyData(t,r)},footnoteDefinition:(e,t)=>{let n=t.identifier,r={type:`element`,tagName:`aside`,properties:{id:`fn-${n}`,dataFootnoteDef:``,dataFootnoteId:n,className:[`footnote-def`]},children:[{type:`element`,tagName:`div`,properties:{className:[`footnote-body`]},children:e.all(t)},{type:`element`,tagName:`a`,properties:{href:`#fnref-${n}`,className:[`footnote-backref`],ariaLabel:`Back to reference`},children:[{type:`text`,value:`↩`}]}]};return e.patch(t,r),e.applyData(t,r)}},Pne=/url\s*\(\s*['"]?\s*(?:javascript|vbscript|data)\s*:/i,Fne=/\bexpression\s*\(/i,Ine=1e4;function Lne(e){return!(e.length>Ine||Pne.test(e)||Fne.test(e))}function m9(e){for(let t of e.split(`,`)){let e=t.trim();if(e!==``&&!k0(e.split(/\s+/)[0]??``))return!1}return!0}var Rne={a:[`href`,`title`],img:[`src`,`alt`,`title`],video:[`src`,`title`],audio:[`src`,`title`],code:[`className`]},zne=new Set([`href`,`src`]),Bne=cV(`<>`),h9=()=>e=>{IF(e,`element`,e=>{let t=Rne[e.tagName.toLowerCase()],n=e.properties;if(!(!t||!n))for(let e of t){let t=n[e];if(Array.isArray(t)){let r=t.map(e=>typeof e==`string`?U8(e):e);r.some((e,n)=>e!==t[n])&&(n[e]=r);continue}if(typeof t!=`string`)continue;let r;if(zne.has(e))if(t===`<>`||t===Bne)r=``;else{let e=U8(t);r=e===t?t:cV(e)}else r=U8(t);r!==t&&(n[e]=r)}})},g9=()=>e=>{IF(e,`element`,e=>{let t=e.tagName.toLowerCase(),n=e.properties;if(!n)return;if(t===`a`||t===`area`||t===`link`||t===`base`){let e=n.href;typeof e==`string`&&!k0(e)&&delete n.href}if(t===`img`||t===`iframe`||t===`script`||t===`embed`||t===`source`||t===`audio`||t===`video`||t===`track`){let e=n.src;typeof e==`string`&&!k0(e)&&delete n.src}if(t===`form`){let e=n.action;typeof e==`string`&&!k0(e)&&delete n.action}if(t===`img`||t===`source`){let e=n.srcSet;typeof e==`string`&&!m9(e)&&delete n.srcSet;let t=n.srcset;typeof t==`string`&&!m9(t)&&delete n.srcset}if(t===`video`){let e=n.poster;typeof e==`string`&&!k0(e)&&delete n.poster}let r=n.style;typeof r==`string`&&!Lne(r)&&delete n.style})};function Vne(e){let t=DU().use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ),n=t.runSync(e);return String(t.stringify(n))}function _9(e){let t=DU().use(TG).use(wW,[`yaml`]).use(w7).use(vU).use(R7).use(ZJ,{handlers:p9}).use(h9).use(g9).use(uJ);return String(t.processSync(e))}fq(),TK(),EK(),A({docName:d4,summary:p4,content:E().optional(),...f4}).loose(),A({docName:d4,summary:p4,markdown:E(),position:j([`append`,`prepend`,`replace`]).optional(),extension:j(T1).optional(),...f4}).loose(),A({docName:d4,summary:p4,find:E().min(1),replace:E(),offset:D().int().nonnegative().optional(),...f4}).loose(),A({docName:d4,connectionId:E().min(1),scope:j([`last`,`session`,`file`]).optional(),...f4}).loose();var v9=A({value:E(),truncatedFrom:D().int().nonnegative().optional(),hint:E().optional()}).loose(),Hne=Ua(`kind`,[A({kind:M(`inline`),content:E()}),A({kind:M(`truncated`),byteLength:D().int().nonnegative(),hint:E()})]),y9=A({kind:M(`content-divergence`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),divergenceType:E().optional(),currentState:Hne.optional(),hint:E().optional()}).loose(),Une=A({type:M(`orphan`),parentCandidates:k(E()),message:E()}).loose(),b9=A({kind:M(`disk-edit-reconciled`),intendedBytes:D().int().nonnegative(),actualBytes:D().int().nonnegative(),byteDelta:D().int(),mergeOutcome:E().optional(),hint:E().optional()}).loose(),x9=Ua(`kind`,[y9,b9]),S9=k(Ua(`kind`,[y9,b9,A({kind:M(`mermaid-parse-error`),fenceIndex:D().int().positive(),fenceFirstLine:E(),message:E(),line:D().int().positive().optional()}).loose()])).min(1);A({timestamp:E().min(1),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),hints:k(Une).optional(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({docName:E().min(1),scope:j([`last`,`session`]),undone:O()}).loose(),A({docName:d4,patch:qa(E(),Va([WQ,Ma()])),types:qa(E(),j(VQ)).optional(),summary:p4,...f4}).loose(),A({timestamp:E().min(1),subscriberCount:D().int().nonnegative(),systemSubscriberCount:D().int().nonnegative(),appliedKeys:k(E()),summary:v9.optional(),warning:x9.optional(),warnings:S9.optional()}).loose(),A({entries:k(A({level:j([`info`,`warn`,`error`]),message:E().max(N4),event:E().optional(),fields:qa(E(),Pa()).optional(),ts:D().optional(),sourceId:E().optional(),lineNumber:D().optional()}).loose()).max(100)}).loose(),A({accepted:D().int().min(0)}).loose();var Wne=A({status:E().min(1),reason:E()}).loose();A({docName:E().min(1),content:E(),lifecycle:Wne.nullable()}).loose();var C9=A({kind:j([`document`,`asset`,`folder`,`file`]).default(`document`),docName:E().min(1).optional(),docExt:E().min(1).default(`.md`),size:D().int().nonnegative(),modified:E().min(1),isSymlink:O().default(!1),canonicalDocName:E().nullable().default(null),targetPath:E().nullable().default(null),path:E().min(1).optional(),assetExt:E().min(1).optional(),mediaKind:j([`image`,`video`,`audio`,`pdf`,`text`]).nullable().optional(),referencedBy:k(E().min(1)).optional(),hasChildren:O().optional()}).loose().refine(e=>e.kind===`document`?e.docName!==void 0&&e.path===void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.kind===`folder`?e.docName===void 0&&e.path!==void 0&&e.assetExt===void 0&&e.mediaKind===void 0&&e.referencedBy===void 0:e.kind===`file`?e.path!==void 0&&e.mediaKind===void 0&&e.referencedBy===void 0&&e.hasChildren===void 0:e.path!==void 0&&e.assetExt!==void 0&&e.referencedBy!==void 0&&e.hasChildren===void 0,{message:`document/asset/folder/file kind must match its required fields (document → docName; asset → path+assetExt+referencedBy; folder → path only, no docName; file → path, no mediaKind/referencedBy/hasChildren)`}),Gne=A({documents:k(C9),truncated:O().optional()}).loose(),Kne=A({source:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),qne=A({docName:E().min(1),backlinks:k(Kne)}).loose();A({counts:qa(E().min(1),D().int().nonnegative())}).loose();var Jne=Ua(`kind`,[A({kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),title:E(),snippet:E().nullable()}).loose(),A({kind:M(`external`),url:E().min(1),title:E(),snippet:E().nullable()}).loose()]),Yne=A({docName:E().min(1),forwardLinks:k(Jne)}).loose(),Xne=Ua(`kind`,[A({id:E().min(1),kind:M(`doc`),docName:E().min(1),anchor:E().nullable(),label:E(),cluster:E().nullable(),category:E().nullable(),tags:k(E()).nullable()}).loose(),A({id:E().min(1),kind:M(`external`),url:E().min(1),label:E()}).loose()]),Zne=A({source:E().min(1),target:E().min(1)}).loose(),Qne=A({nodes:k(Xne),links:k(Zne)}).loose(),$ne=A({ts:D().int().min(0),url:E(),method:E(),ua:E().optional(),origin:E().optional(),referer:E().optional(),host:E().optional(),remote:E().optional(),secChUa:E().optional(),secChUaMobile:E().optional(),secChUaPlatform:E().optional(),secFetchSite:E().optional(),secFetchDest:E().optional(),secFetchMode:E().optional(),secFetchUser:E().optional()}).loose(),ere=A({app:Va([M(`cursor`),M(`codex`),M(`claude`),Ma()]),signals_fired:k(E())}).loose();A({entries:k($ne),count:D().int().min(0),detection:ere}).loose(),A({writers:k(A({id:E().min(1),name:E().optional(),email:E().optional()}).loose()).optional(),summary:p4,...f4}).loose(),A({checkpointRef:E().min(1)}).loose();var tre=A({v:D().int().optional(),id:E().min(1),name:E().min(1),colorSeed:E().optional(),docs:k(E()),summaries:k(E()).optional()}).loose();A({entries:k(A({sha:E().min(1),timestamp:E().min(1),author:E(),authorEmail:E(),type:j([`checkpoint`,`wip`,`upstream`,`park`]),message:E(),contributors:k(tre),checkpoint:Pa().nullable()}).loose()),total:D().int().nonnegative().optional(),truncated:O().optional(),hasMore:O().optional()}).loose(),A({sha:E().regex(/^[0-9a-f]{40}$/i),content:E(),timestamp:E(),author:E()}).loose();var nre=A({contentDir:E().min(1),pathSeparator:j([`/`,`\\`]),symlinkResolved:O()}).loose();k(Ua(`source`,[A({docName:E().min(1),timestamp:E().min(1),size:D().int().nonnegative(),source:M(`flat`)}).loose(),A({docName:E().min(1),timestamp:E().min(1),source:M(`timeline`),sha:E().min(1)}).loose()])).meta({description:"Flat array of rescue buffer entries; discriminated via `source`."});var rre=A({orphans:k(A({docName:E().min(1),title:E()}).loose())}).loose(),ire=A({hubs:k(A({docName:E().min(1),title:E(),count:D().int().nonnegative()}).loose())}).loose(),are=A({source:E().min(1),title:E(),snippet:E().nullable()}).loose();A({deadLinks:k(A({target:E().min(1),sources:k(are)}).loose())}).loose(),A({target:A({docName:E().min(1),title:E(),aliases:k(E())}).loose(),mentions:k(A({source:E().min(1),excerpt:E(),offset:D().int().nonnegative()}).loose()),truncated:O()}).loose(),A({projectPath:E().min(1)}).loose();var ore=j([`not-a-git-worktree`,`init-failed`]);Ua(`ok`,[A({ok:M(!0),projectPath:E().min(1)}).loose(),A({ok:M(!1),reason:ore,message:E().min(1)}).loose()]),A({host:E().min(1).optional()}).loose(),A({key:E().min(1)}).loose(),A({keyPresent:O()}).loose(),A({name:E().refine(e=>e.trim().length>0,{message:`name must be non-empty`}),email:E().refine(e=>e.trim().length>0,{message:`email must be non-empty`})}).loose(),A({authenticated:O()}).loose(),A({}).loose();var sre=A({stackIndex:D().int().min(0),ts:D().int().min(0),additions:D().int().min(0),deletions:D().int().min(0)}).loose(),cre=A({docName:E().min(1),additionsTotal:D().int().min(0),deletionsTotal:D().int().min(0),lastTs:D().int().min(0),bursts:k(sre)}).loose(),lre=A({displayName:E().min(1),color:E().min(1),icon:E().optional(),connectionId:E().min(1)}).loose(),ure=A({sessionAlive:O(),agent:lre.nullable(),files:k(cre)}).loose(),dre=A({diff:E(),generatedAt:D().int().min(0)}).loose();A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose(),A({}).loose();var fre=A({displayName:E().min(1),icon:E(),color:E().min(1),currentDoc:E().nullable(),mode:j([`idle`,`writing`]),ts:D().int().min(0)}).loose();A({presence:qa(E().min(1),fre)}).loose(),qa(E().min(1),O()).meta({description:`Flat boolean record keyed by agent-scheme name (claude / codex / cursor). True = installed.`}),A({path:E().min(1,`path must be non-empty`)}).loose(),A({}).loose();var pre=A({fromDocName:E().min(1),toDocName:E().min(1)}).loose(),mre=A({fromPath:E().min(1),toPath:E().min(1)}).loose();A({}).loose(),A({path:E().min(1),...f4,summary:p4}).loose();var hre=A({docName:E().min(1)}).loose();A({path:E().min(1),...f4,summary:p4}).loose();var gre=A({path:E().min(1)}).loose();A({kind:j([`file`,`folder`]),path:E().min(1),...f4,summary:p4}).loose();var _re=A({kind:j([`file`,`folder`]),path:E().min(1),duplicatedDocNames:k(E().min(1))}).loose(),vre=A({pages:k(A({docName:E().min(1),title:E(),docExt:E().min(1),size:D().int().nonnegative(),modified:E().min(1),icon:E().min(1).max(2048).optional()}).loose())}).loose(),yre=A({level:D().int().min(1).max(6),text:E(),slug:E()}).loose(),bre=A({docName:E().min(1),headings:k(yre)}).loose(),xre=A({docName:E().min(1),rewrites:D().int().nonnegative()}).loose();A({kind:j([`file`,`folder`,`asset`]),fromPath:E().min(1),toPath:E().min(1),...f4,summary:p4}).loose();var Sre=A({renamed:k(pre),renamedAssets:k(mre),rewrittenDocs:k(xre).optional(),summary:v9.optional()}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4}).loose();var Cre=A({deletedDocNames:k(E().min(1))}).loose();A({kind:j([`file`,`folder`,`asset`]),path:E().min(1),...f4,summary:p4}).loose();var wre=A({deletedDocNames:k(E().min(1))}).loose();A({docName:E().min(1),commitSha:E().regex(/^[0-9a-f]{40}$/i,{message:`commitSha must be a 40-char git SHA`}),summary:p4,...f4}).loose(),A({restoredFrom:E().min(1),timestamp:E().min(1),summary:v9.optional(),warning:y9.optional(),warnings:S9.optional()}).loose();var Tre=j([`dormant`,`idle`,`fetching`,`pulling`,`pushing`,`conflict`,`offline`,`auth-error`,`disabled`]),Ere=A({label:E().min(1),webUrl:da().nullable()}).loose(),Dre=Ua(`checkStatus`,[A({checkStatus:M(`allowed`)}).loose(),A({checkStatus:M(`denied`),deniedReason:j([`no-collaborator`,`private-no-access`,`repo-not-found`])}).loose(),A({checkStatus:M(`unknown`),unknownError:j([`network`,`timeout`,`rate-limit`,`token-invalid`,`malformed-response`]).optional()}).loose()]),w9=j([`auth-403`,`auth-401`,`auth-scope-mismatch`,`auth-no-credential`,`semantic-protected-branch`]);A({state:Tre,lastSyncUtc:E().nullable(),lastFetchUtc:E().nullable(),lastPushedSha:E().nullable(),ahead:D().int().min(0),behind:D().int().min(0),consecutiveFailures:D().int().min(0),conflictCount:D().int().min(0),hasRemote:O(),syncEnabled:O(),identityUnresolved:O(),remote:Ere.nullable().optional(),pushError:E().optional(),pushErrorCode:w9.optional(),pullError:E().optional(),pullErrorCode:w9.optional(),pausedReason:E().optional(),pushPermission:Dre.optional()}).loose(),A({op:j([`sync`,`push`,`pull`]).optional()}).loose(),A({op:j([`sync`,`push`,`pull`])}).loose(),A({conflicts:k(A({file:E().min(1),detectedAt:E().min(1),oursSha:E().optional(),theirsSha:E().optional(),baseSha:E().optional()}).loose())}).loose(),A({file:E().min(1),strategy:j([`mine`,`theirs`,`content`,`delete`]),content:E().optional()}).loose().refine(e=>e.strategy!==`content`||e.content!==void 0&&e.content!==``,{message:`content must be a non-empty string when strategy is 'content'`,path:[`content`]}),A({}).loose(),A({file:E().min(1),base:E(),ours:E(),theirs:E(),kind:j([`both-modified`,`delete-modify`,`modify-delete`]),lifecycleStatus:E().nullable()}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({plan:go(e=>e!==void 0,{message:`plan is required`})}).loose(),A({result:go(e=>e!==void 0,{message:`result is required`})}).loose();var Ore=A({path:E().min(1),summary:E().min(1)}).loose(),kre=A({files:D().int().nonnegative(),folders:D().int().nonnegative()}).loose();A({packs:k(A({id:E().min(1),name:E().min(1),description:E().min(1),defaultSubfolder:E().optional(),folders:k(Ore),entryCounts:kre}).loose())}).loose(),A({noOpen:O().optional(),out:E().min(1).optional()}).loose();var Are=A({reason:j([`unsupported-platform`,`spawn-error`]),message:E()}).loose();Ua(`status`,[A({status:M(`installed`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E()}).loose(),A({status:M(`built`),outputPath:E(),size:D().int().nonnegative(),sha256:E(),skillVersion:E(),handoffError:Are.optional()}).loose(),A({status:M(`failed`),buildError:E()}).loose(),A({status:M(`skip-current`),skillVersion:E(),recordedAt:E().optional()}).loose()]),A({tags:k(A({name:E().min(1),count:D().int().nonnegative(),isLeaf:O()}).loose())}).loose();var jre=A({docName:E().min(1),title:E(),matchingTags:k(E().min(1)),snippet:E().nullable()}).loose();A({name:E().min(1),docs:k(jre)}).loose(),A({folder:Pa(),frontmatter_local:qa(E(),Pa()).nullable()}).loose(),A({path:E(),frontmatter:qa(E(),Pa()).optional()}).loose(),A({applied:Pa()}).loose();var T9=qa(E(),Pa()).meta({description:`Free-form frontmatter map embedded in template payloads.`});A({template:A({name:E().min(1),folder:E(),scope:j([`local`,`inherited`]),path:E().min(1),frontmatter:T9,body:E()}).strict()}).strict();var Mre=A({templates:k(A({name:E().min(1),title:E().optional(),description:E().optional(),path:E().min(1),source_folder:E()}).strict()),truncated:O()}).strict();A({folder:E(),name:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({path:E().min(1),created:O(),warnings:k(E())}).strict(),A({existed:O(),path:E().min(1)}).strict(),A({fromFolder:E(),fromName:E(),toFolder:E(),toName:E(),body:E().optional(),frontmatter:T9.optional(),...f4,summary:p4}).strict(),A({from:E().min(1),to:E().min(1),committed:O()}).strict(),A({query:E().optional(),intent:j([`autocomplete`,`full_text`,`omnibar`]).optional(),ranking:j([`navigation`,`relevance`]).optional(),scopes:k(j([`page`,`folder`,`content`,`file`])).optional(),scope:E().optional(),limit:D().int().nonnegative().optional(),semantic:O().optional(),source:j([`omnibar`,`mcp`,`http`]).optional()}).loose();var Nre=A({kind:j([`page`,`folder`,`content`,`file`]),path:E().min(1),title:E(),score:D(),signals:qa(E(),Pa()),snippet:E().optional()}).loose(),Pre=A({capable:O(),applied:O(),coverage:A({embedded:D().int().nonnegative(),total:D().int().nonnegative()})}).loose();A({enabled:O(),keyPresent:O(),keySource:j([`file`,`env`]).nullable(),keyHint:E().nullable(),ready:O(),capable:O(),embedded:D().int().nonnegative(),total:D().int().nonnegative()}).loose(),A({query:E(),intent:j([`autocomplete`,`full_text`,`omnibar`]),results:k(Nre),elapsedMs:D().nonnegative(),semantic:Pre.optional(),truncated:O().optional(),ready:O().optional()}).loose();var Fre=A({version:E().min(1),recordedAt:E().min(1)}).loose();A({currentVersion:E().min(1),targets:qa(E(),Fre.nullable())}).loose();var Ire=`server-info`,Lre=`branch-switched`,Rre=`disk-ack`,zre=`config-validation-rejected`,Bre=`config-ignore-nested-error`,E9=j([`files`,`backlinks`,`graph`,`sync-status`,`session-activity`,`tags`]),Vre=A({v:M(1),ch:M(Ire),seq:D(),serverInstanceId:E().min(1),currentBranch:E().min(1).optional()}).loose(),Hre=A({v:M(1),ch:M(Lre),seq:D(),branch:E().min(1)}).loose(),Ure=A({v:M(1),ch:E9,seq:D()}).loose(),Wre=A({v:M(1),ch:M(Rre),seq:D(),docName:E().min(1),sv:E().min(1)}).loose(),Gre=A({v:M(1),ch:M(zre),seq:D(),docName:E().min(1),error:wu}).loose(),Kre=A({v:M(1),ch:M(Bre),seq:D(),path:E().min(1),error:E().min(1)}).loose(),qre={id:`string`,kind:`enum`,path:`string`,title:`string`,name:`string`,pathSegments:`string`,content:`string`,modifiedTs:`number`},D9=new WeakMap;function Jre(e){return e===void 0||!Number.isFinite(e)?20:Math.max(1,Math.min(100,Math.trunc(e)))}function O9(e){return e.trim().toLowerCase()}var Yre=/\.(?:md|mdx)$/;function Xre(e,t){if(t!==`page`)return e;let n=e.replace(Yre,``);return n.length>0?n:e}function k9(e){let t=e.split(`/`).filter(Boolean);return t[t.length-1]??e}function Zre(e){let t=k9(e.path),n=e.title?.trim()||t,r=e.modifiedTs??0,i=e.path.split(`/`).filter(Boolean),a=new Set(i),o=[...new Set((e.aliases??[]).flatMap(e=>e.split(`/`).filter(Boolean)).filter(e=>!a.has(e)))];return{id:`${e.kind}:${e.path}`,kind:e.kind,path:e.path,title:n,name:t,pathSegments:[...i,...o].join(` `),content:e.content??``,modifiedTs:Number.isFinite(r)?r:0}}function A9(e){let t=KZ({schema:qre});return e.length>0&&rQ(t,e),t}function Qre(e){let t={documents:e};return D9.set(t,A9(e)),t}function $re(e){let t=D9.get(e);if(t)return t;let n=A9(e.documents);return D9.set(e,n),n}function eie(e){return e===`autocomplete`?[`page`]:e===`full_text`?[`page`,`content`,`file`]:[`page`,`folder`,`file`]}function j9(e,t){return t.has(e.kind)?!0:e.kind===`page`&&t.has(`content`)}function tie(e,t){let n=O9(t);if(!n)return 0;let r=Xre(n,e.kind),i=O9(e.title),a=O9(e.name),o=O9(e.path),s=o.split(`/`);return i===r||a===r?700:o===r?650:i.startsWith(r)||a.startsWith(r)?600:s.some(e=>e.startsWith(r))?550:i.includes(r)||a.includes(r)?500:o.includes(r)?450:-1}var nie=.5;function M9(e,t){let n=tie(e,t);return n<=0?n:l4(e.path)?n*nie:n}var rie=60;function iie(e){return e===`file`?-rie:0}var aie=1e3,N9=50,oie=1,sie=1,cie=.001;function lie(e,t,n,r,i){let a=i>0?t/i:0,o=N9>0?n/N9:0,s=r===`file`?-cie:0,c=oie*a+sie*o+s;return e*aie+c}function P9(e,t,n,r){return e+t*20+n+iie(r)}function F9(e,t,n,r,i,a){return e===`relevance`?P9(t,n,r,i):lie(t,n,r,i,a)}function uie(e,t){return t||(e===`full_text`?`relevance`:`navigation`)}function I9(e,t){let n=0;for(let r of e){let e=t.get(r.id)??0;e>n&&(n=e)}return n}function die(e){let t=e.map(e=>e.modifiedTs).filter(e=>Number.isFinite(e)&&e>0);if(t.length===0)return new Map;let n=1/0,r=-1/0;for(let e of t)e<n&&(n=e),e>r&&(r=e);let i=Math.max(1,r-n);return new Map(e.map(e=>[e.id,e.modifiedTs>0?(e.modifiedTs-n)/i*50:0]))}function fie(e){return e===`full_text`?[`title`,`name`,`path`,`pathSegments`,`content`]:[`title`,`name`,`path`,`pathSegments`]}function pie(e){return e===`full_text`?{title:8,name:7,path:5,pathSegments:4,content:1}:e===`autocomplete`?{title:10,name:9,path:5,pathSegments:4}:{title:8,name:7,path:5,pathSegments:4}}function mie(e,t){return O9(t).length<4?0:+(e===`full_text`)}function L9(e,t,n){if(t===`relevance`)return e.slice(0,n);let r=[],i=0,a=0;for(let t of e){if(t.document.kind===`folder`){if(i>=3)continue;i+=1}else if(t.document.kind===`file`){if(a>=3)continue;a+=1}if(r.push(t),r.length>=n)break}return r}function hie(e,t,n={}){let r=n.intent??`omnibar`,i=uie(r,n.ranking),a=Jre(n.limit),o=new Set(n.scopes??eie(r)),s=e.documents.filter(e=>j9(e,o)),c=O9(t);if(!c)return s.slice().sort((e,t)=>e.path.localeCompare(t.path)).slice(0,a).map(e=>({document:e,score:0,signals:{lexical:0,fullText:0,recency:0}}));let l=NQ($re(e),{term:c,properties:fie(r),boost:pie(r),tolerance:mie(r,c),limit:Math.max(a*4,40)}),u=new Map(l.hits.filter(e=>j9(e.document,o)).map(e=>[e.document.id,e.score])),d=die(s),f=new Map;for(let e of s)M9(e,c)>=0&&f.set(e.id,e);for(let e of l.hits)j9(e.document,o)&&f.set(e.document.id,e.document);if(!n.semantic){let e=I9(f.values(),u);return L9([...f.values()].map(t=>{let n=Math.max(0,M9(t,c)),r=u.get(t.id)??0,a=d.get(t.id)??0;return{document:t,score:F9(i,n,r,a,t.kind,e),signals:{lexical:n,fullText:r,recency:a}}}).sort((e,t)=>e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score),i,a)}return L9(gie({scopedDocuments:s,candidates:f,fullTextScores:u,recency:d,normalizedQuery:c,ranking:i,semantic:n.semantic}),i,a)}function R9(e){let t=new Map;return e.forEach((e,n)=>{t.set(e,n+1)}),t}function gie(e){let{scopedDocuments:t,candidates:n,fullTextScores:r,recency:i,normalizedQuery:a,ranking:o,semantic:s}=e,c=s.rrfK??60,l=s.candidateLimit??64,u=s.similarityFloor??0,d=s.scores,f=new Map(t.map(e=>[e.id,e])),p=[...d.entries()].filter(([e,t])=>t>=u&&f.has(e)).sort((e,t)=>t[1]-e[1]||e[0].localeCompare(t[0])).slice(0,l);for(let[e]of p)if(!n.has(e)){let t=f.get(e);t&&n.set(e,t)}let m=I9(n.values(),r),h=[...n.values()].map(e=>{let t=Math.max(0,M9(e,a)),n=r.get(e.id)??0,s=i.get(e.id)??0,c=d.get(e.id),l=c!==void 0&&c>=u;return{document:e,score:t>0?F9(o,t,n,s,e.kind,m):P9(t,n,s,e.kind),signals:l?{lexical:t,fullText:n,recency:s,vector:c}:{lexical:t,fullText:n,recency:s},lexical:t,fullText:n,recency:s,cosine:c}}),g=R9(h.filter(e=>e.fullText>0).sort((e,t)=>t.fullText-e.fullText||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),_=R9(h.filter(e=>e.cosine!==void 0&&e.cosine>=u).sort((e,t)=>t.cosine-e.cosine||e.document.path.localeCompare(t.document.path)).map(e=>e.document.id)),v=e=>{let t=0,n=g.get(e);n!==void 0&&(t+=1/(c+n));let r=_.get(e);return r!==void 0&&(t+=1/(c+r)),t};return h.sort((e,t)=>{let n=+(e.lexical>0),r=+(t.lexical>0);if(n!==r)return r-n;if(n===1)return e.score===t.score?e.document.path.localeCompare(t.document.path):t.score-e.score;let i=v(e.document.id),a=v(t.document.id);return i===a?e.recency===t.recency?e.document.path.localeCompare(t.document.path):t.recency-e.recency:a-i}).map(({document:e,score:t,signals:n})=>({document:e,score:t,signals:n}))}function _ie(e){return`https://github.com/${e.owner}/${e.repo}.git`}function vie(e,t){return!e||e.length===0?`true`:t.detached?`detached`:t.currentBranch===null||t.currentBranch===e?`true`:`false`}var z9=Symbol.for(`@inkeep/open-knowledge/skill-state-field-registry`),B9=globalThis;B9[z9]===void 0&&(B9[z9]=mr());var V9=B9[z9],H9=za({version:E().regex(/^\d+\.\d+\.\d+(?:[-+][\w.-]+)?$/,`version must match /^\\d+\\.\\d+\\.\\d+(?:[-+][\\w.-]+)?$/`).register(V9,{description:`Recorded skill version for this target.`}),recordedAt:Ji().register(V9,{description:`ISO 8601 timestamp of the most recent successful write. Updated on every write, including reinstalls of the same version.`}),surface:j([`server-build-and-open`,`electron-build-and-open`,`cli-npx-skills-add`,`desktop-direct`,`cli-start`]).register(V9,{description:`Install-source surface that recorded this entry.`}).optional()});za({schema:M(1).register(V9,{description:`Schema major version. Bumped only on breaking shape changes.`}),targets:za({"claude-cowork":H9.optional(),"cli-hosts":H9.optional()}).register(V9,{description:`Per-target install-state entries. Absent target = no recorded install.`}).default({})});var U9=class extends Error{chunksCompleted;totalChunks;bytesWritten;bytesRemaining;cause;constructor(e,t){let n=e instanceof Error?e.message:typeof e==`string`?e:`unknown error`;super(`chunked insert failed after ${t.chunksCompleted}/${t.totalChunks} chunks (${t.bytesWritten} bytes written, ${t.bytesRemaining} bytes lost): ${n}`),this.name=`ChunkedInsertError`,this.chunksCompleted=t.chunksCompleted,this.totalChunks=t.totalChunks,this.bytesWritten=t.bytesWritten,this.bytesRemaining=t.bytesRemaining,this.cause=e}};async function yie(e,t,n,r,i={}){let a=i.thresholdBytes??512e3,o=i.chunkSizeBytes??51200,s=i.origin,c=i.yieldFn??bie,l=i.resolveOffset??(e=>e);if(r.length<=a){e.transact(()=>{t.insert(n,r)},s);return}let u=Math.ceil(r.length/o),d=0,f=n,p=0,m=0;for(;d<r.length;){let n=Math.min(d+o,r.length),i=r.slice(d,n);try{let n=l(f);e.transact(()=>{t.insert(n,i)},s)}catch(e){throw new U9(e,{chunksCompleted:p,totalChunks:u,bytesWritten:m,bytesRemaining:r.length-d})}p++,m+=i.length,f+=i.length,d=n,d<r.length&&await c()}}function bie(){return new Promise(e=>{let t=globalThis;t.document?.hidden!==!0&&typeof t.requestAnimationFrame==`function`?t.requestAnimationFrame(()=>e()):setTimeout(()=>e(),0)})}function xie(){let e=!1,t=``,n=0;return r=>{let i=Sie(r);return e?(i&&i.char===t&&i.len>=n&&!i.hasInfo&&(e=!1,t=``,n=0),!0):i?(e=!0,t=i.char,n=i.len,!0):!1}}function Sie(e){let t=(e.endsWith(`\r`)?e.slice(0,-1):e).match(/^ {0,3}([`~])(\1{2,})(.*)$/);return t?{char:t[1],len:1+t[2].length,hasInfo:t[3].trim()!==``}:null}function Cie(e){let t;try{t=new URL(e)}catch{return null}let n=t.pathname.match(/^\/video\/(\d+)/);if(n)return n[1]??null;let r=t.pathname.match(/^\/(\d+)/);return r?r[1]??null:null}function wie(e){if(typeof e!=`string`||e.length===0)return e;let t=Q3(e);if(t){let e=t.noCookie?`www.youtube-nocookie.com`:`www.youtube.com`,n=t.startSeconds===null?``:`?start=${t.startSeconds}`;return`https://${e}/embed/${t.id}${n}`}if(q3(e)){let t=Cie(e);return t?`https://player.vimeo.com/video/${t}`:e}let n=W3(e);if(n){let e=n.startRaw===null?``:`?t=${n.startRaw}`;return`https://www.loom.com/embed/${n.id}${e}`}return e}var Tie=[`#D97757`,`#1B1912`,`#F9F3E9`,`#7A9DFF`,`#8534F3`,`#9663F0`,`#727CF3`],Eie={claude:`#D97757`,cursor:`#1B1912`,windsurf:`#0B100F`,openai:`#7A9DFF`,github:`#8534F3`,cline:`#9663F0`,bot:`#727CF3`},Die={cursor:`#FFFFFF`,windsurf:`#FFFFFF`},W9=[`#f0ece3`,`#fff5e1`,`#f9e1db`,`#f5def7`,`#ece2fb`,`#dce8fa`,`#DBF3FB`];function Oie(e,t=Tie){let n=0;for(let t of e)n=(n<<5)-n+t.charCodeAt(0)|0;return t[Math.abs(n)%t.length]}function kie(e){let t=e.trim();if(!t)return`?`;let n=t.split(/[-\s]+/).filter(Boolean);if(!n.length)return`?`;if(n.length>=2)return n.slice(0,2).map(e=>e[0]??``).join(``).toUpperCase();let r=n[0],i=[r[0]];for(let e=1;e<r.length&&i.length<2;e++){let t=r[e-1],n=r[e];t===t.toLowerCase()&&n===n.toUpperCase()&&n!==n.toLowerCase()&&i.push(n)}return i.length>=2?i.join(``).toUpperCase():r.slice(0,2).toUpperCase()}function Aie(e){let t=e.trim();if(!t)return e;if(t.includes(` `)||!/[-_]/.test(t))return t;let n=t.split(/[-_]+/).filter(Boolean);return n.length?n.map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(` `):t}var jie={"claude-code":`claude`,"claude-ai":`claude`,cursor:`cursor`,"cursor-vscode":`cursor`,cascade:`windsurf`,codex:`openai`,"codex-mcp-client":`openai`,copilot:`github`,cline:`cline`};function Mie(e){return e?jie[e]||(e.startsWith(`local-agent-mode-`)?`claude`:`bot`):`bot`}function Nie(e){let t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255,i=Math.max(t,n,r),a=Math.min(t,n,r),o=(i+a)/2;if(i===a)return[0,0,o*100];let s=i-a,c=o>.5?s/(2-i-a):s/(i+a),l;return l=i===t?((n-r)/s+(n<r?6:0))/6:i===n?((r-t)/s+2)/6:((t-n)/s+4)/6,[l*360,c*100,o*100]}function Pie(e,t,n){let r=t/100,i=n/100,a=r*Math.min(i,1-i),o=t=>{let n=(t+e/30)%12,r=i-a*Math.max(Math.min(n-3,9-n,1),-1);return Math.round(255*r).toString(16).padStart(2,`0`)};return`#${o(0)}${o(8)}${o(4)}`}function Fie(e){let[t]=Nie(e);return Pie(t,45,32)}var Iie=[`Curious`,`Brave`,`Clever`,`Swift`,`Gentle`,`Bright`,`Wise`,`Bold`,`Calm`,`Keen`],Lie=[`Bird`,`Cat`,`Dog`,`Fish`,`Mouse`,`Rabbit`,`Shrimp`,`Snail`,`Squirrel`,`Turtle`],G9=`ok-user-name-v3`,K9=`ok-user-color-v3`;function q9(e){return e[Math.floor(Math.random()*e.length)]}function Rie(){return`${q9(Iie)} ${q9(Lie)}`}function zie(){return q9(W9)}function J9(e){try{return localStorage.getItem(e)}catch{return null}}function Y9(e,t){try{localStorage.setItem(e,t)}catch{}}function Bie(){let e=new URLSearchParams(window.location.search).get(`coeditor`)||`standalone`,t=crypto.randomUUID(),n=J9(G9),r=J9(K9);return n||(n=Rie(),Y9(G9,n)),r||(r=zie(),Y9(K9,r)),{name:n,color:r,coeditor:e,tabId:t}}function Vie(e,t){let n=e.trim();if(!n||/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=r>=0?n.slice(0,r):n,a=r>=0?n.slice(r+1):null,o=(i.split(`?`)[0]??``).trim();if(!o)return null;let s=(o.split(`/`).pop()??``).match(/\.([a-z0-9]+)$/i);if(s){let e=(s[1]??``).toLowerCase();if(e!==`md`&&e!==`mdx`)return null}let c=o.toLowerCase(),l=c.endsWith(`.mdx`)?o.slice(0,-4):c.endsWith(`.md`)?o.slice(0,-3):o,u=l.startsWith(`/`),d=u?l.slice(1):l,f=u?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of d.split(`/`))if(e===`..`){if(f.length===0)return null;f.pop()}else e!==`.`&&e!==``&&f.push(e);return f.length===0?null:{docName:f.join(`/`),anchor:a||null}}function Hie(e){throw Error(`Unhandled ClassifiedLinkTarget variant: ${JSON.stringify(e)}`)}var X9=/^[a-zA-Z][a-zA-Z\d+\-.]*:/;function Z9(e){let t=(e.split(/[?#]/)[0]??e).match(/\.([a-z0-9]+)$/i);return t?(t[1]??``).toLowerCase():null}function Q9(e){return e.split(`/`).filter(Boolean)}function $9(e){let t=e.trim();return X9.test(t)||t.startsWith(`//`)}function Uie(e,t){let n=e.trim();if(!n)return null;if(n.startsWith(`#`)){let e=n.slice(1).trim();return e?{kind:`anchor`,anchor:e}:null}if($9(n))return{kind:`external`,url:n};let r=Vie(n,t);if(r)return{kind:`doc`,docName:r.docName,anchor:r.anchor};let i=Z9(n);return i&&i!==`md`&&i!==`mdx`?{kind:`asset`,url:n,ext:i}:null}function Wie(e,t){let n=e.trim();if(!n)return null;if($9(n))return{kind:`external`,url:t?`${n}#${t}`:n};let r=Z9(n);return r&&r!==`md`&&r!==`mdx`?{kind:`asset`,url:n,ext:r}:{kind:`doc`,docName:n,anchor:t?.trim()||null}}function Gie(e,t){let n=e.trim();if(!n||X9.test(n)||n.startsWith(`//`)||n.startsWith(`#`))return null;let r=n.indexOf(`#`),i=((r>=0?n.slice(0,r):n).split(`?`)[0]??``).trim();if(!i)return null;let a=i.startsWith(`/`),o=a?i.slice(1):i,s=a?[]:t.includes(`/`)?t.split(`/`).slice(0,-1):[];for(let e of o.split(`/`))if(e===`..`){if(s.length===0)return null;s.pop()}else e!==`.`&&e!==``&&s.push(e);return s.length===0?null:s.join(`/`)}function Kie(e,t,n=null){let r=Q9(e);r.pop();let i=Q9(t),a=0;for(;a<r.length&&a<i.length&&r[a]===i[a];)a+=1;let o=r.slice(a).map(()=>`..`),s=i.slice(a),c=[...o,...s].join(`/`);return c||=i.at(-1)??t,!c.startsWith(`./`)&&!c.startsWith(`../`)&&(c=`./${c}`),`${c}.md${n?`#${n}`:``}`}function qie(e){if(!e)return{height:null,viewerFragment:``};let t=e.split(`&`).filter(e=>e.length>0),n=null,r=[];for(let e of t){let t=e.indexOf(`=`);if(t===-1){r.push(e);continue}let i=e.slice(0,t),a=e.slice(t+1);if(i===`height`){let e=Number.parseInt(a,10);!Number.isNaN(e)&&e>0&&(n=e);continue}r.push(e)}return{height:n,viewerFragment:r.join(`&`)}}function Jie(e){return e.replace(/[/\\:*?"<>|\0]/g,`-`).replace(/\s+/g,` `).replace(/-+/g,`-`).trim().replace(/^[-.\s]+|[-.\s]+$/g,``)}export{rre as $,d$ as $n,F as $r,xie as $t,C9 as A,qQ as An,Ob as Ar,W$ as At,W9 as B,_9 as Bn,av as Br,Uie as Bt,gre as C,B6 as Cn,TS as Cr,H1 as Ct,D1 as D,M6 as Dn,gb as Dr,nre as Dt,J1 as E,F6 as En,nb as Er,S2 as Et,p1 as F,P1 as Fn,hb as Fr,A2 as Ft,C0 as G,h0 as Gn,Vp as Gr,g0 as Gt,ire as H,F3 as Hn,wp as Hr,Y$ as Ht,$Q as I,A0 as In,Xb as Ir,Kie as It,P0 as J,W3 as Jn,L as Jr,z2 as Jt,w0 as K,W7 as Kn,I as Kr,Oie as Kt,E2 as L,k0 as Ln,xS as Lr,_ie as Lt,_re as M,$9 as Mn,uS as Mr,s4 as Mt,A1 as N,XQ as Nn,zy as Nr,D2 as Nt,Cre as O,L6 as On,Tb as Or,Hie as Ot,G1 as P,G3 as Pn,Dy as Pr,O2 as Pt,N1 as Q,Q3 as Qn,od as Qr,kie as Qt,w2 as R,T2 as Rn,iS as Rr,yie as Rt,u0 as S,P6 as Sn,qb as Sr,M4 as St,Y1 as T,z6 as Tn,lS as Tr,y2 as Tt,V1 as U,l0 as Un,R as Ur,X$ as Ut,j3 as V,Vne as Vn,zv as Vr,Wie as Vt,l7 as W,l1 as Wn,Rp as Wr,C1 as Wt,mne as X,I4 as Xn,Zd as Xr,R2 as Xt,Qne as Y,qie as Yn,gf as Yr,L2 as Yt,W0 as Z,_2 as Zn,P as Zr,a4 as Zt,_1 as _,P3 as _n,YT as _r,b4 as _t,W1 as a,M as ai,m1 as an,C2 as ar,j4 as at,w1 as b,H6 as bn,tS as br,Mre as bt,qne as c,g as ci,zQ as cn,o9 as cr,BQ as ct,Gre as d,Aie as dn,I2 as dr,E0 as dt,ou as ei,D6 as en,u$ as er,F1 as et,Ure as f,ZQ as fn,k9 as fr,O0 as ft,b1 as g,h1 as gn,vT as gr,x4 as gt,q$ as h,v2 as hn,IT as hr,g4 as ht,k1 as i,du as ii,M1 as in,hie as ir,A4 as it,Gne as j,O1 as jn,Jb as jr,c1 as jt,E9 as k,R6 as kn,Db as kr,n1 as kt,Hre as l,h as li,_0 as ln,L4 as lr,G0 as lt,Vre as m,Bie as mn,_te as mr,k4 as mt,Die as n,Ou as ni,Zre as nn,wie as nr,bre as nt,ure as o,A as oi,b2 as on,e$ as or,P4 as ot,Wre as p,Ene as pn,xte as pr,g1 as pt,E1 as q,g2 as qn,yp as qr,B2 as qt,L1 as r,Tu as ri,Fie as rn,Jie as rr,vre as rt,dre as s,E as si,Z9 as sn,S0 as sr,N4 as st,Eie as t,$l as ti,Qre as tn,Gie as tr,I1 as tt,Kre as u,t9 as un,s9 as ur,Sre as ut,y1 as v,Mie as vn,tE as vr,w4 as vt,hre as w,I6 as wn,SS as wr,X1 as wt,U9 as x,N6 as xn,Bx as xr,wre as xt,v1 as y,V6 as yn,KT as yr,d2 as yt,Yne as z,q3 as zn,nv as zr,vie as zt};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n}from"./compiler-runtime-Cs91PcD2.js";import{d as r,i,s as a}from"./button-CNAPefQE.js";var o=e(t(),1),s=e(r(),1),c=n(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t){let n=o.createContext(t),r=e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,c.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=o.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function f(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r),a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s){let c=s?.[e]?.[a]||i,l=o.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,p(i,...t)]}function p(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function m(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var h=globalThis?.document?o.useLayoutEffect:()=>{},g=o.useInsertionEffect||h;function _({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=v({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=y(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function v({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return g(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function y(e){return typeof e==`function`}function b(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var x=e=>{let{present:t,children:n}=e,r=S(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),s=a(r.ref,w(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:s}):null};x.displayName=`Presence`;function S(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),[s,c]=b(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{let e=C(r.current);a.current=s===`mounted`?e:`none`},[s]),h(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=C(t);e?c(`MOUNT`):o===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),h(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=C(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=C(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function C(e){return e?.animationName||`none`}function w(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T=o.useId||(()=>void 0),E=0;function D(e){let[t,n]=o.useState(T());return h(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function O(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}function k(e,t=globalThis?.document){let n=O(e);o.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var A=`DismissableLayer`,j=`dismissableLayer.update`,M=`dismissableLayer.pointerDownOutside`,N=`dismissableLayer.focusOutside`,P,F=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:d,...f}=e,p=o.useContext(F),[h,g]=o.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=o.useState({}),y=a(t,e=>g(e)),b=Array.from(p.layers),[x]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),C=h?b.indexOf(h):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,E=z(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!T||n||(i?.(e),u?.(e),e.defaultPrevented||d?.())},_),D=B(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||d?.())},_);return k(e=>{C===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},_),o.useEffect(()=>{if(h)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(P=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(h)),p.layers.add(h),V(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=P)}},[h,_,n,p]),o.useEffect(()=>()=>{h&&(p.layers.delete(h),p.layersWithOutsidePointerEventsDisabled.delete(h),V())},[h,p]),o.useEffect(()=>{let e=()=>v({});return document.addEventListener(j,e),()=>document.removeEventListener(j,e)},[]),(0,c.jsx)(l.div,{...f,ref:y,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:m(e.onFocusCapture,D.onFocusCapture),onBlurCapture:m(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:m(e.onPointerDownCapture,E.onPointerDownCapture)})});I.displayName=A;var L=`DismissableLayerBranch`,R=o.forwardRef((e,t)=>{let n=o.useContext(F),r=o.useRef(null),i=a(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(l.div,{...e,ref:i})});R.displayName=L;function z(e,t=globalThis?.document){let n=O(e),r=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){H(M,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function B(e,t=globalThis?.document){let n=O(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&H(N,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V(){let e=new CustomEvent(j);document.dispatchEvent(e)}function H(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u(i,a):i.dispatchEvent(a)}var U=`Portal`,W=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);h(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});W.displayName=U;function G(e){let[t,n]=o.useState(void 0);return h(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}export{D as a,h as c,f as d,l as f,O as i,m as l,W as n,x as o,u as p,I as r,_ as s,G as t,d as u};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n}from"./compiler-runtime-Cs91PcD2.js";import{d as r,i,s as a}from"./button-CmLxDlCv.js";var o=e(t(),1),s=e(r(),1),c=n(),l=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=i(`Primitive.${t}`),r=o.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,c.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function u(e,t){e&&s.flushSync(()=>e.dispatchEvent(t))}function d(e,t){let n=o.createContext(t),r=e=>{let{children:t,...r}=e,i=o.useMemo(()=>r,Object.values(r));return(0,c.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=o.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function f(e,t=[]){let n=[];function r(t,r){let i=o.createContext(r),a=n.length;n=[...n,r];let s=t=>{let{scope:n,children:r,...s}=t,l=n?.[e]?.[a]||i,u=o.useMemo(()=>s,Object.values(s));return(0,c.jsx)(l.Provider,{value:u,children:r})};s.displayName=t+`Provider`;function l(n,s){let c=s?.[e]?.[a]||i,l=o.useContext(c);if(l)return l;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[s,l]}let i=()=>{let t=n.map(e=>o.createContext(e));return function(n){let r=n?.[e]||t;return o.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,p(i,...t)]}function p(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return o.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}typeof window<`u`&&window.document&&window.document.createElement;function m(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}var h=globalThis?.document?o.useLayoutEffect:()=>{},g=o.useInsertionEffect||h;function _({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,s]=v({defaultProp:t,onChange:n}),c=e!==void 0,l=c?e:i;{let t=o.useRef(e!==void 0);o.useEffect(()=>{let e=t.current;e!==c&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${c?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=c},[c,r])}return[l,o.useCallback(t=>{if(c){let n=y(t)?t(e):t;n!==e&&s.current?.(n)}else a(t)},[c,e,a,s])]}function v({defaultProp:e,onChange:t}){let[n,r]=o.useState(e),i=o.useRef(n),a=o.useRef(t);return g(()=>{a.current=t},[t]),o.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function y(e){return typeof e==`function`}function b(e,t){return o.useReducer((e,n)=>t[e][n]??e,e)}var x=e=>{let{present:t,children:n}=e,r=S(t),i=typeof n==`function`?n({present:r.isPresent}):o.Children.only(n),s=a(r.ref,w(i));return typeof n==`function`||r.isPresent?o.cloneElement(i,{ref:s}):null};x.displayName=`Presence`;function S(e){let[t,n]=o.useState(),r=o.useRef(null),i=o.useRef(e),a=o.useRef(`none`),[s,c]=b(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return o.useEffect(()=>{let e=C(r.current);a.current=s===`mounted`?e:`none`},[s]),h(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=C(t);e?c(`MOUNT`):o===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),h(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=C(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},s=e=>{e.target===t&&(a.current=C(r.current))};return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}else c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:o.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function C(e){return e?.animationName||`none`}function w(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var T=o.useId||(()=>void 0),E=0;function D(e){let[t,n]=o.useState(T());return h(()=>{e||n(e=>e??String(E++))},[e]),e||(t?`radix-${t}`:``)}function O(e){let t=o.useRef(e);return o.useEffect(()=>{t.current=e}),o.useMemo(()=>(...e)=>t.current?.(...e),[])}function k(e,t=globalThis?.document){let n=O(e);o.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var A=`DismissableLayer`,j=`dismissableLayer.update`,M=`dismissableLayer.pointerDownOutside`,N=`dismissableLayer.focusOutside`,P,F=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),I=o.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:u,onDismiss:d,...f}=e,p=o.useContext(F),[h,g]=o.useState(null),_=h?.ownerDocument??globalThis?.document,[,v]=o.useState({}),y=a(t,e=>g(e)),b=Array.from(p.layers),[x]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),S=b.indexOf(x),C=h?b.indexOf(h):-1,w=p.layersWithOutsidePointerEventsDisabled.size>0,T=C>=S,E=z(e=>{let t=e.target,n=[...p.branches].some(e=>e.contains(t));!T||n||(i?.(e),u?.(e),e.defaultPrevented||d?.())},_),D=B(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(s?.(e),u?.(e),e.defaultPrevented||d?.())},_);return k(e=>{C===p.layers.size-1&&(r?.(e),!e.defaultPrevented&&d&&(e.preventDefault(),d()))},_),o.useEffect(()=>{if(h)return n&&(p.layersWithOutsidePointerEventsDisabled.size===0&&(P=_.body.style.pointerEvents,_.body.style.pointerEvents=`none`),p.layersWithOutsidePointerEventsDisabled.add(h)),p.layers.add(h),V(),()=>{n&&p.layersWithOutsidePointerEventsDisabled.size===1&&(_.body.style.pointerEvents=P)}},[h,_,n,p]),o.useEffect(()=>()=>{h&&(p.layers.delete(h),p.layersWithOutsidePointerEventsDisabled.delete(h),V())},[h,p]),o.useEffect(()=>{let e=()=>v({});return document.addEventListener(j,e),()=>document.removeEventListener(j,e)},[]),(0,c.jsx)(l.div,{...f,ref:y,style:{pointerEvents:w?T?`auto`:`none`:void 0,...e.style},onFocusCapture:m(e.onFocusCapture,D.onFocusCapture),onBlurCapture:m(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:m(e.onPointerDownCapture,E.onPointerDownCapture)})});I.displayName=A;var L=`DismissableLayerBranch`,R=o.forwardRef((e,t)=>{let n=o.useContext(F),r=o.useRef(null),i=a(t,r);return o.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,c.jsx)(l.div,{...e,ref:i})});R.displayName=L;function z(e,t=globalThis?.document){let n=O(e),r=o.useRef(!1),i=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){H(M,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function B(e,t=globalThis?.document){let n=O(e),r=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!r.current&&H(N,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function V(){let e=new CustomEvent(j);document.dispatchEvent(e)}function H(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?u(i,a):i.dispatchEvent(a)}var U=`Portal`,W=o.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=o.useState(!1);h(()=>a(!0),[]);let u=n||i&&globalThis?.document?.body;return u?s.createPortal((0,c.jsx)(l.div,{...r,ref:t}),u):null});W.displayName=U;function G(e){let[t,n]=o.useState(void 0);return h(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}export{D as a,h as c,f as d,l as f,O as i,m as l,W as n,x as o,u as p,I as r,_ as s,G as t,d as u};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n}from"./compiler-runtime-Cs91PcD2.js";import{s as r}from"./button-CNAPefQE.js";import{a as i,d as a,f as o,i as s,l as c,s as l}from"./dist-CUqyztDT.js";import{b as u,x as d}from"./tooltip-Bp4cM4E8.js";var f=e(t(),1),p=n(),m=`rovingFocusGroup.onEntryFocus`,h={bubbles:!1,cancelable:!0},g=`RovingFocusGroup`,[_,v,y]=d(g),[b,x]=a(g,[y]),[S,C]=b(g),w=f.forwardRef((e,t)=>(0,p.jsx)(_.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(_.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(T,{...e,ref:t})})}));w.displayName=g;var T=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:d,currentTabStopId:_,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:b,onEntryFocus:x,preventScrollOnEntryFocus:C=!1,...w}=e,T=f.useRef(null),E=r(t,T),D=u(d),[O,k]=l({prop:_,defaultProp:y??null,onChange:b,caller:g}),[A,M]=f.useState(!1),N=s(x),P=v(n),F=f.useRef(!1),[I,L]=f.useState(0);return f.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(m,N),()=>e.removeEventListener(m,N)},[N]),(0,p.jsx)(S,{scope:n,orientation:i,dir:D,loop:a,currentTabStopId:O,onItemFocus:f.useCallback(e=>k(e),[k]),onItemShiftTab:f.useCallback(()=>M(!0),[]),onFocusableItemAdd:f.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>L(e=>e-1),[]),children:(0,p.jsx)(o.div,{tabIndex:A||I===0?-1:0,"data-orientation":i,...w,ref:E,style:{outline:`none`,...e.style},onMouseDown:c(e.onMouseDown,()=>{F.current=!0}),onFocus:c(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(m,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);j([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),C)}}F.current=!1}),onBlur:c(e.onBlur,()=>M(!1))})})}),E=`RovingFocusGroupItem`,D=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:l,...u}=e,d=i(),m=s||d,h=C(E,n),g=h.currentTabStopId===m,y=v(n),{onFocusableItemAdd:b,onFocusableItemRemove:x,currentTabStopId:S}=h;return f.useEffect(()=>{if(r)return b(),()=>x()},[r,b,x]),(0,p.jsx)(_.ItemSlot,{scope:n,id:m,focusable:r,active:a,children:(0,p.jsx)(o.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:c(e.onMouseDown,e=>{r?h.onItemFocus(m):e.preventDefault()}),onFocus:c(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:c(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=A(e,h.orientation,h.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=y().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?M(n,r+1):n.slice(r+1)}setTimeout(()=>j(n))}}),children:typeof l==`function`?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});D.displayName=E;var O={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function k(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function A(e,t,n){let r=k(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return O[r]}function j(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function M(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var N=w,P=D;export{N as n,x as r,P as t};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n}from"./compiler-runtime-Cs91PcD2.js";import{s as r}from"./button-CmLxDlCv.js";import{a as i,d as a,f as o,i as s,l as c,s as l}from"./dist-CSynDsuh.js";import{b as u,x as d}from"./tooltip-DjrmDp0P.js";var f=e(t(),1),p=n(),m=`rovingFocusGroup.onEntryFocus`,h={bubbles:!1,cancelable:!0},g=`RovingFocusGroup`,[_,v,y]=d(g),[b,x]=a(g,[y]),[S,C]=b(g),w=f.forwardRef((e,t)=>(0,p.jsx)(_.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(_.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(T,{...e,ref:t})})}));w.displayName=g;var T=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:i,loop:a=!1,dir:d,currentTabStopId:_,defaultCurrentTabStopId:y,onCurrentTabStopIdChange:b,onEntryFocus:x,preventScrollOnEntryFocus:C=!1,...w}=e,T=f.useRef(null),E=r(t,T),D=u(d),[O,k]=l({prop:_,defaultProp:y??null,onChange:b,caller:g}),[A,M]=f.useState(!1),N=s(x),P=v(n),F=f.useRef(!1),[I,L]=f.useState(0);return f.useEffect(()=>{let e=T.current;if(e)return e.addEventListener(m,N),()=>e.removeEventListener(m,N)},[N]),(0,p.jsx)(S,{scope:n,orientation:i,dir:D,loop:a,currentTabStopId:O,onItemFocus:f.useCallback(e=>k(e),[k]),onItemShiftTab:f.useCallback(()=>M(!0),[]),onFocusableItemAdd:f.useCallback(()=>L(e=>e+1),[]),onFocusableItemRemove:f.useCallback(()=>L(e=>e-1),[]),children:(0,p.jsx)(o.div,{tabIndex:A||I===0?-1:0,"data-orientation":i,...w,ref:E,style:{outline:`none`,...e.style},onMouseDown:c(e.onMouseDown,()=>{F.current=!0}),onFocus:c(e.onFocus,e=>{let t=!F.current;if(e.target===e.currentTarget&&t&&!A){let t=new CustomEvent(m,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=P().filter(e=>e.focusable);j([e.find(e=>e.active),e.find(e=>e.id===O),...e].filter(Boolean).map(e=>e.ref.current),C)}}F.current=!1}),onBlur:c(e.onBlur,()=>M(!1))})})}),E=`RovingFocusGroupItem`,D=f.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:l,...u}=e,d=i(),m=s||d,h=C(E,n),g=h.currentTabStopId===m,y=v(n),{onFocusableItemAdd:b,onFocusableItemRemove:x,currentTabStopId:S}=h;return f.useEffect(()=>{if(r)return b(),()=>x()},[r,b,x]),(0,p.jsx)(_.ItemSlot,{scope:n,id:m,focusable:r,active:a,children:(0,p.jsx)(o.span,{tabIndex:g?0:-1,"data-orientation":h.orientation,...u,ref:t,onMouseDown:c(e.onMouseDown,e=>{r?h.onItemFocus(m):e.preventDefault()}),onFocus:c(e.onFocus,()=>h.onItemFocus(m)),onKeyDown:c(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=A(e,h.orientation,h.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=y().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=h.loop?M(n,r+1):n.slice(r+1)}setTimeout(()=>j(n))}}),children:typeof l==`function`?l({isCurrentTabStop:g,hasTabStop:S!=null}):l})})});D.displayName=E;var O={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function k(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function A(e,t,n){let r=k(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return O[r]}function j(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function M(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var N=w,P=D;export{N as n,x as r,P as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{a as t}from"./compiler-runtime-Cs91PcD2.js";import{d as n,u as r}from"./button-CNAPefQE.js";var i=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),a=e(t(),1),o=e(n(),1);function s(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var c=e=>{switch(e){case`success`:return d;case`info`:return p;case`warning`:return f;case`error`:return m;default:return null}},l=Array(12).fill(0),u=({visible:e,className:t})=>a.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},a.createElement(`div`,{className:`sonner-spinner`},l.map((e,t)=>a.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),d=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),f=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),p=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),m=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ee=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},a.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),a.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),te=()=>{let[e,t]=a.useState(document.hidden);return a.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},h=1,g=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:h++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],a.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_=(e,t)=>{let n=t?.id||h++;return g.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(_,{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});s(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var ne=3,x=`24px`,S=`16px`,C=4e3,w=356,re=14,T=45,ie=200;function E(...e){return e.filter(Boolean).join(` `)}function ae(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var D=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:o,visibleToasts:s,heights:l,index:d,toasts:f,expanded:p,removeToast:m,defaultRichColors:h,closeButton:g,style:_,cancelButtonStyle:v,actionButtonStyle:y,className:ne=``,descriptionClassName:x=``,duration:S,position:w,gap:re,expandByDefault:D,classNames:O,icons:k,closeButtonAriaLabel:A=`Close toast`}=e,[j,M]=a.useState(null),[N,oe]=a.useState(null),[P,F]=a.useState(!1),[I,L]=a.useState(!1),[R,z]=a.useState(!1),[B,se]=a.useState(!1),[ce,V]=a.useState(!1),[le,H]=a.useState(0),[ue,U]=a.useState(0),W=a.useRef(n.duration||S||C),de=a.useRef(null),G=a.useRef(null),fe=d===0,pe=d+1<=s,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=a.useMemo(()=>l.findIndex(e=>e.toastId===n.id)||0,[l,n.id]),ge=a.useMemo(()=>n.closeButton??g,[n.closeButton,g]),_e=a.useMemo(()=>n.duration||S||C,[n.duration,S]),Y=a.useRef(0),X=a.useRef(0),ve=a.useRef(0),Z=a.useRef(null),[ye,be]=w.split(`-`),xe=a.useMemo(()=>l.reduce((e,t,n)=>n>=J?e:e+t.height,0),[l,J]),Se=te(),Ce=n.invert||t,Q=K===`loading`;X.current=a.useMemo(()=>J*re+xe,[J,xe]),a.useEffect(()=>{W.current=_e},[_e]),a.useEffect(()=>{F(!0)},[]),a.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),a.useLayoutEffect(()=>{if(!P)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[P,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let $=a.useCallback(()=>{L(!0),H(X.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},ie)},[n,m,o,X]);a.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||i||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[p,i,n,K,Se,$]),a.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return k?.loading?a.createElement(`div`,{className:E(O?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},k.loading):a.createElement(u,{className:E(O?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||k?.[K]||c(K);return a.createElement(`li`,{tabIndex:0,ref:G,className:E(ne,me,O?.toast,n?.classNames?.toast,O?.default,O?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??h,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":P,"data-promise":!!n.promise,"data-swiped":ce,"data-removed":I,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":R,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":B,"data-swipe-direction":N,"data-expanded":!!(p||D&&P),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${I?le:X.current}px`,"--initial-height":D?`auto`:`${ue}px`,..._,...n.style},onDragEnd:()=>{z(!1),M(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(z(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(B||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=j===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),oe(j===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),se(!0);return}else{var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}V(!1),z(!1),M(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ae(w);!j&&(Math.abs(a)>1||Math.abs(i)>1)&&M(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(j===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(j===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&V(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?a.createElement(`button`,{"aria-label":A,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:E(O?.closeButton,n?.classNames?.closeButton)},k?.close??ee):null,(K||n.icon||n.promise)&&n.icon!==null&&(k?.[K]!==null||n.icon)?a.createElement(`div`,{"data-icon":``,className:E(O?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,a.createElement(`div`,{"data-content":``,className:E(O?.content,n?.classNames?.content)},a.createElement(`div`,{"data-title":``,className:E(O?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?a.createElement(`div`,{"data-description":``,className:E(x,he,O?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),a.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?a.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||v,onClick:e=>{b(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:E(O?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,a.isValidElement(n.action)?n.action:n.action&&b(n.action)?a.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||y,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:E(O?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function O(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function k(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?S:x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var A=a.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:ee,style:te,visibleToasts:h=ne,toastOptions:_,dir:v=O(),gap:y=re,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=a.useState([]),T=a.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),ie=a.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[E,ae]=a.useState([]),[A,j]=a.useState(!1),[M,N]=a.useState(!1),[oe,P]=a.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),F=a.useRef(null),I=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=a.useRef(null),R=a.useRef(!1),z=a.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return a.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{o.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),a.useEffect(()=>{if(p!==`system`){P(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),a.useEffect(()=>{S.length<=1&&j(!1)},[S]),a.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;j(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&j(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),a.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),a.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ie.map((t,n)=>{let[i,o]=t.split(`-`);return T.length?a.createElement(`ol`,{key:t,dir:v===`auto`?O():v,tabIndex:-1,ref:F,className:u,"data-sonner-toaster":!0,"data-sonner-theme":oe,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${w}px`,"--gap":`${y}px`,...te,...k(d,f)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{M||j(!1)},onDragEnd:()=>j(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N(!0)},onPointerUp:()=>N(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>a.createElement(D,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:m,duration:_?.duration??ee,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:h,closeButton:_?.closeButton??l,interacting:M,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:ae,expandByDefault:c,gap:y,expanded:A,swipeDirections:e.swipeDirections}))):null}))});export{y as n,i as r,A as t};
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{a as t}from"./compiler-runtime-Cs91PcD2.js";import{d as n,u as r}from"./button-CmLxDlCv.js";var i=r(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),a=e(t(),1),o=e(n(),1);function s(e){if(!e||typeof document>`u`)return;let t=document.head||document.getElementsByTagName(`head`)[0],n=document.createElement(`style`);n.type=`text/css`,t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}var c=e=>{switch(e){case`success`:return d;case`info`:return p;case`warning`:return f;case`error`:return m;default:return null}},l=Array(12).fill(0),u=({visible:e,className:t})=>a.createElement(`div`,{className:[`sonner-loading-wrapper`,t].filter(Boolean).join(` `),"data-visible":e},a.createElement(`div`,{className:`sonner-spinner`},l.map((e,t)=>a.createElement(`div`,{className:`sonner-loading-bar`,key:`spinner-bar-${t}`})))),d=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z`,clipRule:`evenodd`})),f=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z`,clipRule:`evenodd`})),p=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z`,clipRule:`evenodd`})),m=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 20 20`,fill:`currentColor`,height:`20`,width:`20`},a.createElement(`path`,{fillRule:`evenodd`,d:`M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z`,clipRule:`evenodd`})),ee=a.createElement(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`12`,height:`12`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`,strokeLinejoin:`round`},a.createElement(`line`,{x1:`18`,y1:`6`,x2:`6`,y2:`18`}),a.createElement(`line`,{x1:`6`,y1:`6`,x2:`18`,y2:`18`})),te=()=>{let[e,t]=a.useState(document.hidden);return a.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener(`visibilitychange`,e),()=>window.removeEventListener(`visibilitychange`,e)},[]),e},h=1,g=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{let{message:t,...n}=e,r=typeof e?.id==`number`||e.id?.length>0?e.id:h++,i=this.toasts.find(e=>e.id===r),a=e.dismissible===void 0?!0:e.dismissible;return this.dismissedToasts.has(r)&&this.dismissedToasts.delete(r),i?this.toasts=this.toasts.map(n=>n.id===r?(this.publish({...n,...e,id:r,title:t}),{...n,...e,id:r,dismissible:a,title:t}):n):this.addToast({title:t,...n,dismissible:a,id:r}),r},this.dismiss=e=>(e?(this.dismissedToasts.add(e),requestAnimationFrame(()=>this.subscribers.forEach(t=>t({id:e,dismiss:!0})))):this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:`error`}),this.success=(e,t)=>this.create({...t,type:`success`,message:e}),this.info=(e,t)=>this.create({...t,type:`info`,message:e}),this.warning=(e,t)=>this.create({...t,type:`warning`,message:e}),this.loading=(e,t)=>this.create({...t,type:`loading`,message:e}),this.promise=(e,t)=>{if(!t)return;let n;t.loading!==void 0&&(n=this.create({...t,promise:e,type:`loading`,message:t.loading,description:typeof t.description==`function`?void 0:t.description}));let r=Promise.resolve(e instanceof Function?e():e),i=n!==void 0,o,s=r.then(async e=>{if(o=[`resolve`,e],a.isValidElement(e))i=!1,this.create({id:n,type:`default`,message:e});else if(v(e)&&!e.ok){i=!1;let r=typeof t.error==`function`?await t.error(`HTTP error! status: ${e.status}`):t.error,o=typeof t.description==`function`?await t.description(`HTTP error! status: ${e.status}`):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(e instanceof Error){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}else if(t.success!==void 0){i=!1;let r=typeof t.success==`function`?await t.success(e):t.success,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`success`,description:o,...s})}}).catch(async e=>{if(o=[`reject`,e],t.error!==void 0){i=!1;let r=typeof t.error==`function`?await t.error(e):t.error,o=typeof t.description==`function`?await t.description(e):t.description,s=typeof r==`object`&&!a.isValidElement(r)?r:{message:r};this.create({id:n,type:`error`,description:o,...s})}}).finally(()=>{i&&(this.dismiss(n),n=void 0),t.finally==null||t.finally.call(t)}),c=()=>new Promise((e,t)=>s.then(()=>o[0]===`reject`?t(o[1]):e(o[1])).catch(t));return typeof n!=`string`&&typeof n!=`number`?{unwrap:c}:Object.assign(n,{unwrap:c})},this.custom=(e,t)=>{let n=t?.id||h++;return this.create({jsx:e(n),id:n,...t}),n},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},_=(e,t)=>{let n=t?.id||h++;return g.addToast({title:e,...t,id:n}),n},v=e=>e&&typeof e==`object`&&`ok`in e&&typeof e.ok==`boolean`&&`status`in e&&typeof e.status==`number`,y=Object.assign(_,{success:g.success,info:g.info,warning:g.warning,error:g.error,custom:g.custom,message:g.message,promise:g.promise,dismiss:g.dismiss,loading:g.loading},{getHistory:()=>g.toasts,getToasts:()=>g.getActiveToasts()});s(`[data-sonner-toaster][dir=ltr],html[dir=ltr]{--toast-icon-margin-start:-3px;--toast-icon-margin-end:4px;--toast-svg-margin-start:-1px;--toast-svg-margin-end:0px;--toast-button-margin-start:auto;--toast-button-margin-end:0;--toast-close-button-start:0;--toast-close-button-end:unset;--toast-close-button-transform:translate(-35%, -35%)}[data-sonner-toaster][dir=rtl],html[dir=rtl]{--toast-icon-margin-start:4px;--toast-icon-margin-end:-3px;--toast-svg-margin-start:0px;--toast-svg-margin-end:-1px;--toast-button-margin-start:0;--toast-button-margin-end:auto;--toast-close-button-start:unset;--toast-close-button-end:0;--toast-close-button-transform:translate(35%, -35%)}[data-sonner-toaster]{position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1:hsl(0, 0%, 99%);--gray2:hsl(0, 0%, 97.3%);--gray3:hsl(0, 0%, 95.1%);--gray4:hsl(0, 0%, 93%);--gray5:hsl(0, 0%, 90.9%);--gray6:hsl(0, 0%, 88.7%);--gray7:hsl(0, 0%, 85.8%);--gray8:hsl(0, 0%, 78%);--gray9:hsl(0, 0%, 56.1%);--gray10:hsl(0, 0%, 52.3%);--gray11:hsl(0, 0%, 43.5%);--gray12:hsl(0, 0%, 9%);--border-radius:8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:0;z-index:999999999;transition:transform .4s ease}@media (hover:none) and (pointer:coarse){[data-sonner-toaster][data-lifted=true]{transform:none}}[data-sonner-toaster][data-x-position=right]{right:var(--offset-right)}[data-sonner-toaster][data-x-position=left]{left:var(--offset-left)}[data-sonner-toaster][data-x-position=center]{left:50%;transform:translateX(-50%)}[data-sonner-toaster][data-y-position=top]{top:var(--offset-top)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--offset-bottom)}[data-sonner-toast]{--y:translateY(100%);--lift-amount:calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:0;overflow-wrap:anywhere}[data-sonner-toast][data-styled=true]{padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px rgba(0,0,0,.1);width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}[data-sonner-toast]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-y-position=top]{top:0;--y:translateY(-100%);--lift:1;--lift-amount:calc(1 * var(--gap))}[data-sonner-toast][data-y-position=bottom]{bottom:0;--y:translateY(100%);--lift:-1;--lift-amount:calc(var(--lift) * var(--gap))}[data-sonner-toast][data-styled=true] [data-description]{font-weight:400;line-height:1.4;color:#3f3f3f}[data-rich-colors=true][data-sonner-toast][data-styled=true] [data-description]{color:inherit}[data-sonner-toaster][data-sonner-theme=dark] [data-description]{color:#e8e8e8}[data-sonner-toast][data-styled=true] [data-title]{font-weight:500;line-height:1.5;color:inherit}[data-sonner-toast][data-styled=true] [data-icon]{display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}[data-sonner-toast][data-promise=true] [data-icon]>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}[data-sonner-toast][data-styled=true] [data-icon]>*{flex-shrink:0}[data-sonner-toast][data-styled=true] [data-icon] svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}[data-sonner-toast][data-styled=true] [data-content]{display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;font-weight:500;cursor:pointer;outline:0;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}[data-sonner-toast][data-styled=true] [data-button]:focus-visible{box-shadow:0 0 0 2px rgba(0,0,0,.4)}[data-sonner-toast][data-styled=true] [data-button]:first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}[data-sonner-toast][data-styled=true] [data-cancel]{color:var(--normal-text);background:rgba(0,0,0,.08)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-styled=true] [data-cancel]{background:rgba(255,255,255,.3)}[data-sonner-toast][data-styled=true] [data-close-button]{position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);background:var(--normal-bg);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast][data-styled=true] [data-close-button]:focus-visible{box-shadow:0 4px 12px rgba(0,0,0,.1),0 0 0 2px rgba(0,0,0,.2)}[data-sonner-toast][data-styled=true] [data-disabled=true]{cursor:not-allowed}[data-sonner-toast][data-styled=true]:hover [data-close-button]:hover{background:var(--gray2);border-color:var(--gray5)}[data-sonner-toast][data-swiping=true]::before{content:'';position:absolute;left:-100%;right:-100%;height:100%;z-index:-1}[data-sonner-toast][data-y-position=top][data-swiping=true]::before{bottom:50%;transform:scaleY(3) translateY(50%)}[data-sonner-toast][data-y-position=bottom][data-swiping=true]::before{top:50%;transform:scaleY(3) translateY(-50%)}[data-sonner-toast][data-swiping=false][data-removed=true]::before{content:'';position:absolute;inset:0;transform:scaleY(2)}[data-sonner-toast][data-expanded=true]::after{content:'';position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}[data-sonner-toast][data-mounted=true]{--y:translateY(0);opacity:1}[data-sonner-toast][data-expanded=false][data-front=false]{--scale:var(--toasts-before) * 0.05 + 1;--y:translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}[data-sonner-toast]>*{transition:opacity .4s}[data-sonner-toast][data-x-position=right]{right:0}[data-sonner-toast][data-x-position=left]{left:0}[data-sonner-toast][data-expanded=false][data-front=false][data-styled=true]>*{opacity:0}[data-sonner-toast][data-visible=false]{opacity:0;pointer-events:none}[data-sonner-toast][data-mounted=true][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}[data-sonner-toast][data-removed=true][data-front=true][data-swipe-out=false]{--y:translateY(calc(var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=true]{--y:translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}[data-sonner-toast][data-removed=true][data-front=false][data-swipe-out=false][data-expanded=false]{--y:translateY(40%);opacity:0;transition:transform .5s,opacity .2s}[data-sonner-toast][data-removed=true][data-front=false]::before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y,0)) translateX(var(--swipe-amount-x,0));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{from{transform:var(--y) translateX(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translateX(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{from{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width:600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-sonner-theme=light]{--normal-bg:#fff;--normal-border:var(--gray4);--normal-text:var(--gray12);--success-bg:hsl(143, 85%, 96%);--success-border:hsl(145, 92%, 87%);--success-text:hsl(140, 100%, 27%);--info-bg:hsl(208, 100%, 97%);--info-border:hsl(221, 91%, 93%);--info-text:hsl(210, 92%, 45%);--warning-bg:hsl(49, 100%, 97%);--warning-border:hsl(49, 91%, 84%);--warning-text:hsl(31, 92%, 45%);--error-bg:hsl(359, 100%, 97%);--error-border:hsl(359, 100%, 94%);--error-text:hsl(360, 100%, 45%)}[data-sonner-toaster][data-sonner-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg:#000;--normal-border:hsl(0, 0%, 20%);--normal-text:var(--gray1)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg:#fff;--normal-border:var(--gray3);--normal-text:var(--gray12)}[data-sonner-toaster][data-sonner-theme=dark]{--normal-bg:#000;--normal-bg-hover:hsl(0, 0%, 12%);--normal-border:hsl(0, 0%, 20%);--normal-border-hover:hsl(0, 0%, 25%);--normal-text:var(--gray1);--success-bg:hsl(150, 100%, 6%);--success-border:hsl(147, 100%, 12%);--success-text:hsl(150, 86%, 65%);--info-bg:hsl(215, 100%, 6%);--info-border:hsl(223, 43%, 17%);--info-text:hsl(216, 87%, 65%);--warning-bg:hsl(64, 100%, 6%);--warning-border:hsl(60, 100%, 9%);--warning-text:hsl(46, 87%, 65%);--error-bg:hsl(358, 76%, 10%);--error-border:hsl(357, 89%, 16%);--error-text:hsl(358, 100%, 81%)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-sonner-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size:16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:first-child{animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}100%{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}100%{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}100%{opacity:.15}}@media (prefers-reduced-motion){.sonner-loading-bar,[data-sonner-toast],[data-sonner-toast]>*{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}`);function b(e){return e.label!==void 0}var ne=3,x=`24px`,S=`16px`,C=4e3,w=356,re=14,T=45,ie=200;function E(...e){return e.filter(Boolean).join(` `)}function ae(e){let[t,n]=e.split(`-`),r=[];return t&&r.push(t),n&&r.push(n),r}var D=e=>{let{invert:t,toast:n,unstyled:r,interacting:i,setHeights:o,visibleToasts:s,heights:l,index:d,toasts:f,expanded:p,removeToast:m,defaultRichColors:h,closeButton:g,style:_,cancelButtonStyle:v,actionButtonStyle:y,className:ne=``,descriptionClassName:x=``,duration:S,position:w,gap:re,expandByDefault:D,classNames:O,icons:k,closeButtonAriaLabel:A=`Close toast`}=e,[j,M]=a.useState(null),[N,oe]=a.useState(null),[P,F]=a.useState(!1),[I,L]=a.useState(!1),[R,z]=a.useState(!1),[B,se]=a.useState(!1),[ce,V]=a.useState(!1),[le,H]=a.useState(0),[ue,U]=a.useState(0),W=a.useRef(n.duration||S||C),de=a.useRef(null),G=a.useRef(null),fe=d===0,pe=d+1<=s,K=n.type,q=n.dismissible!==!1,me=n.className||``,he=n.descriptionClassName||``,J=a.useMemo(()=>l.findIndex(e=>e.toastId===n.id)||0,[l,n.id]),ge=a.useMemo(()=>n.closeButton??g,[n.closeButton,g]),_e=a.useMemo(()=>n.duration||S||C,[n.duration,S]),Y=a.useRef(0),X=a.useRef(0),ve=a.useRef(0),Z=a.useRef(null),[ye,be]=w.split(`-`),xe=a.useMemo(()=>l.reduce((e,t,n)=>n>=J?e:e+t.height,0),[l,J]),Se=te(),Ce=n.invert||t,Q=K===`loading`;X.current=a.useMemo(()=>J*re+xe,[J,xe]),a.useEffect(()=>{W.current=_e},[_e]),a.useEffect(()=>{F(!0)},[]),a.useEffect(()=>{let e=G.current;if(e){let t=e.getBoundingClientRect().height;return U(t),o(e=>[{toastId:n.id,height:t,position:n.position},...e]),()=>o(e=>e.filter(e=>e.toastId!==n.id))}},[o,n.id]),a.useLayoutEffect(()=>{if(!P)return;let e=G.current,t=e.style.height;e.style.height=`auto`;let r=e.getBoundingClientRect().height;e.style.height=t,U(r),o(e=>e.find(e=>e.toastId===n.id)?e.map(e=>e.toastId===n.id?{...e,height:r}:e):[{toastId:n.id,height:r,position:n.position},...e])},[P,n.title,n.description,o,n.id,n.jsx,n.action,n.cancel]);let $=a.useCallback(()=>{L(!0),H(X.current),o(e=>e.filter(e=>e.toastId!==n.id)),setTimeout(()=>{m(n)},ie)},[n,m,o,X]);a.useEffect(()=>{if(n.promise&&K===`loading`||n.duration===1/0||n.type===`loading`)return;let e;return p||i||Se?(()=>{if(ve.current<Y.current){let e=new Date().getTime()-Y.current;W.current-=e}ve.current=new Date().getTime()})():W.current!==1/0&&(Y.current=new Date().getTime(),e=setTimeout(()=>{n.onAutoClose==null||n.onAutoClose.call(n,n),$()},W.current)),()=>clearTimeout(e)},[p,i,n,K,Se,$]),a.useEffect(()=>{n.delete&&($(),n.onDismiss==null||n.onDismiss.call(n,n))},[$,n.delete]);function we(){return k?.loading?a.createElement(`div`,{className:E(O?.loader,n?.classNames?.loader,`sonner-loader`),"data-visible":K===`loading`},k.loading):a.createElement(u,{className:E(O?.loader,n?.classNames?.loader),visible:K===`loading`})}let Te=n.icon||k?.[K]||c(K);return a.createElement(`li`,{tabIndex:0,ref:G,className:E(ne,me,O?.toast,n?.classNames?.toast,O?.default,O?.[K],n?.classNames?.[K]),"data-sonner-toast":``,"data-rich-colors":n.richColors??h,"data-styled":!(n.jsx||n.unstyled||r),"data-mounted":P,"data-promise":!!n.promise,"data-swiped":ce,"data-removed":I,"data-visible":pe,"data-y-position":ye,"data-x-position":be,"data-index":d,"data-front":fe,"data-swiping":R,"data-dismissible":q,"data-type":K,"data-invert":Ce,"data-swipe-out":B,"data-swipe-direction":N,"data-expanded":!!(p||D&&P),"data-testid":n.testId,style:{"--index":d,"--toasts-before":d,"--z-index":f.length-d,"--offset":`${I?le:X.current}px`,"--initial-height":D?`auto`:`${ue}px`,..._,...n.style},onDragEnd:()=>{z(!1),M(null),Z.current=null},onPointerDown:e=>{e.button!==2&&(Q||!q||(de.current=new Date,H(X.current),e.target.setPointerCapture(e.pointerId),e.target.tagName!==`BUTTON`&&(z(!0),Z.current={x:e.clientX,y:e.clientY})))},onPointerUp:()=>{if(B||!q)return;Z.current=null;let e=Number(G.current?.style.getPropertyValue(`--swipe-amount-x`).replace(`px`,``)||0),t=Number(G.current?.style.getPropertyValue(`--swipe-amount-y`).replace(`px`,``)||0),r=new Date().getTime()-de.current?.getTime(),i=j===`x`?e:t,a=Math.abs(i)/r;if(Math.abs(i)>=T||a>.11){H(X.current),n.onDismiss==null||n.onDismiss.call(n,n),oe(j===`x`?e>0?`right`:`left`:t>0?`down`:`up`),$(),se(!0);return}else{var o,s;(o=G.current)==null||o.style.setProperty(`--swipe-amount-x`,`0px`),(s=G.current)==null||s.style.setProperty(`--swipe-amount-y`,`0px`)}V(!1),z(!1),M(null)},onPointerMove:t=>{var n,r;if(!Z.current||!q||window.getSelection()?.toString().length>0)return;let i=t.clientY-Z.current.y,a=t.clientX-Z.current.x,o=e.swipeDirections??ae(w);!j&&(Math.abs(a)>1||Math.abs(i)>1)&&M(Math.abs(a)>Math.abs(i)?`x`:`y`);let s={x:0,y:0},c=e=>1/(1.5+Math.abs(e)/20);if(j===`y`){if(o.includes(`top`)||o.includes(`bottom`))if(o.includes(`top`)&&i<0||o.includes(`bottom`)&&i>0)s.y=i;else{let e=i*c(i);s.y=Math.abs(e)<Math.abs(i)?e:i}}else if(j===`x`&&(o.includes(`left`)||o.includes(`right`)))if(o.includes(`left`)&&a<0||o.includes(`right`)&&a>0)s.x=a;else{let e=a*c(a);s.x=Math.abs(e)<Math.abs(a)?e:a}(Math.abs(s.x)>0||Math.abs(s.y)>0)&&V(!0),(n=G.current)==null||n.style.setProperty(`--swipe-amount-x`,`${s.x}px`),(r=G.current)==null||r.style.setProperty(`--swipe-amount-y`,`${s.y}px`)}},ge&&!n.jsx&&K!==`loading`?a.createElement(`button`,{"aria-label":A,"data-disabled":Q,"data-close-button":!0,onClick:Q||!q?()=>{}:()=>{$(),n.onDismiss==null||n.onDismiss.call(n,n)},className:E(O?.closeButton,n?.classNames?.closeButton)},k?.close??ee):null,(K||n.icon||n.promise)&&n.icon!==null&&(k?.[K]!==null||n.icon)?a.createElement(`div`,{"data-icon":``,className:E(O?.icon,n?.classNames?.icon)},n.promise||n.type===`loading`&&!n.icon?n.icon||we():null,n.type===`loading`?null:Te):null,a.createElement(`div`,{"data-content":``,className:E(O?.content,n?.classNames?.content)},a.createElement(`div`,{"data-title":``,className:E(O?.title,n?.classNames?.title)},n.jsx?n.jsx:typeof n.title==`function`?n.title():n.title),n.description?a.createElement(`div`,{"data-description":``,className:E(x,he,O?.description,n?.classNames?.description)},typeof n.description==`function`?n.description():n.description):null),a.isValidElement(n.cancel)?n.cancel:n.cancel&&b(n.cancel)?a.createElement(`button`,{"data-button":!0,"data-cancel":!0,style:n.cancelButtonStyle||v,onClick:e=>{b(n.cancel)&&q&&(n.cancel.onClick==null||n.cancel.onClick.call(n.cancel,e),$())},className:E(O?.cancelButton,n?.classNames?.cancelButton)},n.cancel.label):null,a.isValidElement(n.action)?n.action:n.action&&b(n.action)?a.createElement(`button`,{"data-button":!0,"data-action":!0,style:n.actionButtonStyle||y,onClick:e=>{b(n.action)&&(n.action.onClick==null||n.action.onClick.call(n.action,e),!e.defaultPrevented&&$())},className:E(O?.actionButton,n?.classNames?.actionButton)},n.action.label):null)};function O(){if(typeof window>`u`||typeof document>`u`)return`ltr`;let e=document.documentElement.getAttribute(`dir`);return e===`auto`||!e?window.getComputedStyle(document.documentElement).direction:e}function k(e,t){let n={};return[e,t].forEach((e,t)=>{let r=t===1,i=r?`--mobile-offset`:`--offset`,a=r?S:x;function o(e){[`top`,`right`,`bottom`,`left`].forEach(t=>{n[`${i}-${t}`]=typeof e==`number`?`${e}px`:e})}typeof e==`number`||typeof e==`string`?o(e):typeof e==`object`?[`top`,`right`,`bottom`,`left`].forEach(t=>{e[t]===void 0?n[`${i}-${t}`]=a:n[`${i}-${t}`]=typeof e[t]==`number`?`${e[t]}px`:e[t]}):o(a)}),n}var A=a.forwardRef(function(e,t){let{id:n,invert:r,position:i=`bottom-right`,hotkey:s=[`altKey`,`KeyT`],expand:c,closeButton:l,className:u,offset:d,mobileOffset:f,theme:p=`light`,richColors:m,duration:ee,style:te,visibleToasts:h=ne,toastOptions:_,dir:v=O(),gap:y=re,icons:b,containerAriaLabel:x=`Notifications`}=e,[S,C]=a.useState([]),T=a.useMemo(()=>n?S.filter(e=>e.toasterId===n):S.filter(e=>!e.toasterId),[S,n]),ie=a.useMemo(()=>Array.from(new Set([i].concat(T.filter(e=>e.position).map(e=>e.position)))),[T,i]),[E,ae]=a.useState([]),[A,j]=a.useState(!1),[M,N]=a.useState(!1),[oe,P]=a.useState(p===`system`?typeof window<`u`&&window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`:p),F=a.useRef(null),I=s.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),L=a.useRef(null),R=a.useRef(!1),z=a.useCallback(e=>{C(t=>(t.find(t=>t.id===e.id)?.delete||g.dismiss(e.id),t.filter(({id:t})=>t!==e.id)))},[]);return a.useEffect(()=>g.subscribe(e=>{if(e.dismiss){requestAnimationFrame(()=>{C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t))});return}setTimeout(()=>{o.flushSync(()=>{C(t=>{let n=t.findIndex(t=>t.id===e.id);return n===-1?[e,...t]:[...t.slice(0,n),{...t[n],...e},...t.slice(n+1)]})})})}),[S]),a.useEffect(()=>{if(p!==`system`){P(p);return}if(p===`system`&&(window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?P(`dark`):P(`light`)),typeof window>`u`)return;let e=window.matchMedia(`(prefers-color-scheme: dark)`);try{e.addEventListener(`change`,({matches:e})=>{P(e?`dark`:`light`)})}catch{e.addListener(({matches:e})=>{try{P(e?`dark`:`light`)}catch(e){console.error(e)}})}},[p]),a.useEffect(()=>{S.length<=1&&j(!1)},[S]),a.useEffect(()=>{let e=e=>{if(s.every(t=>e[t]||e.code===t)){var t;j(!0),(t=F.current)==null||t.focus()}e.code===`Escape`&&(document.activeElement===F.current||F.current?.contains(document.activeElement))&&j(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]),a.useEffect(()=>{if(F.current)return()=>{L.current&&(L.current.focus({preventScroll:!0}),L.current=null,R.current=!1)}},[F.current]),a.createElement(`section`,{ref:t,"aria-label":`${x} ${I}`,tabIndex:-1,"aria-live":`polite`,"aria-relevant":`additions text`,"aria-atomic":`false`,suppressHydrationWarning:!0},ie.map((t,n)=>{let[i,o]=t.split(`-`);return T.length?a.createElement(`ol`,{key:t,dir:v===`auto`?O():v,tabIndex:-1,ref:F,className:u,"data-sonner-toaster":!0,"data-sonner-theme":oe,"data-y-position":i,"data-x-position":o,style:{"--front-toast-height":`${E[0]?.height||0}px`,"--width":`${w}px`,"--gap":`${y}px`,...te,...k(d,f)},onBlur:e=>{R.current&&!e.currentTarget.contains(e.relatedTarget)&&(R.current=!1,L.current&&=(L.current.focus({preventScroll:!0}),null))},onFocus:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||R.current||(R.current=!0,L.current=e.relatedTarget)},onMouseEnter:()=>j(!0),onMouseMove:()=>j(!0),onMouseLeave:()=>{M||j(!1)},onDragEnd:()=>j(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&e.target.dataset.dismissible===`false`||N(!0)},onPointerUp:()=>N(!1)},T.filter(e=>!e.position&&n===0||e.position===t).map((n,i)=>a.createElement(D,{key:n.id,icons:b,index:i,toast:n,defaultRichColors:m,duration:_?.duration??ee,className:_?.className,descriptionClassName:_?.descriptionClassName,invert:r,visibleToasts:h,closeButton:_?.closeButton??l,interacting:M,position:t,style:_?.style,unstyled:_?.unstyled,classNames:_?.classNames,cancelButtonStyle:_?.cancelButtonStyle,actionButtonStyle:_?.actionButtonStyle,closeButtonAriaLabel:_?.closeButtonAriaLabel,removeToast:z,toasts:T.filter(e=>e.position==n.position),heights:E.filter(e=>e.position==n.position),setHeights:ae,expandByDefault:c,gap:y,expanded:A,swipeDirections:e.swipeDirections}))):null}))});export{y as n,i as r,A as t};