@squadrules/mcp 5.23.6 → 5.23.7

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 (30) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/embed-docs/mem/adapter-migration.md +1 -1
  3. package/dist/embed-docs/mem/author-adapter.md +1 -1
  4. package/dist/embed-docs/mem/bulk-insert-adapters-via-cli.md +1 -1
  5. package/dist/embed-docs/mem/challenge-type-guide.md +1 -1
  6. package/dist/embed-docs/mem/critic-loop-guide.md +1 -1
  7. package/dist/embed-docs/mem/critic-loop.md +1 -1
  8. package/dist/embed-docs/mem/protocol-linking-guide.md +1 -1
  9. package/dist/embed-docs/mem/refine-search.md +1 -1
  10. package/dist/resources/embedded-mcp-resources.js +8 -8
  11. package/dist/runtime-lock.json +179 -179
  12. package/dist/ui/assets/{AccountPage-CpkUzlKz.js → AccountPage-Z11p_-am.js} +1 -1
  13. package/dist/ui/assets/{ErrorAlert-DyQihpL5.js → ErrorAlert-CpqG3xN8.js} +1 -1
  14. package/dist/ui/assets/{HomePage-DWUgLnYm.js → HomePage-DUe1teex.js} +1 -1
  15. package/dist/ui/assets/{NotFoundPage-BGn-oseW.js → NotFoundPage-SqExcDrY.js} +1 -1
  16. package/dist/ui/assets/{ProtocolDetailPage-DnrTYbIl.js → ProtocolDetailPage-D0MUL2RS.js} +1 -1
  17. package/dist/ui/assets/{ProtocolEditPage-CAdd8Z6w.js → ProtocolEditPage-BuJz36eu.js} +1 -1
  18. package/dist/ui/assets/{RichTextEditor-BvjJuiQH.js → RichTextEditor-B6msD7tF.js} +1 -1
  19. package/dist/ui/assets/{RunGuidedPage-DuLSyckx.js → RunGuidedPage-X_E_E42Y.js} +1 -1
  20. package/dist/ui/assets/{RunsPage-Bol98PMy.js → RunsPage-CGw60oRy.js} +1 -1
  21. package/dist/ui/assets/{SkillBundlePage-NPS2s4_y.js → SkillBundlePage-BbVG7AK1.js} +1 -1
  22. package/dist/ui/assets/{SpaceSelect-5oWHg_Dk.js → SpaceSelect-LrJMAMEk.js} +1 -1
  23. package/dist/ui/assets/{SquadrulesPage-C5Qk6o59.js → SquadrulesPage-HJ-SjQ5u.js} +1 -1
  24. package/dist/ui/assets/{StepFlowGraph-DhXjQZU7.js → StepFlowGraph-509IoD3J.js} +1 -1
  25. package/dist/ui/assets/{export-skill-zip-BJIKSTVo.js → export-skill-zip-DRU_W5EX.js} +1 -1
  26. package/dist/ui/assets/{index-Cf2gTHNR.js → index-C6Hswq0v.js} +3 -3
  27. package/dist/ui/assets/{tiptap-Xlq1S4Wz.js → tiptap-DEsERJZl.js} +1 -1
  28. package/dist/ui/assets/{vendor-CCdXVVkv.js → vendor-DEls6f-c.js} +3 -3
  29. package/dist/ui/index.html +2 -2
  30. package/package.json +12 -12
@@ -1,8 +1,8 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-DWUgLnYm.js","assets/vendor-CCdXVVkv.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/SpaceSelect-5oWHg_Dk.js","assets/api-BgTb-tmJ.js","assets/SurfaceCard-DJ6PVBPM.js","assets/SquadrulesPage-C5Qk6o59.js","assets/ErrorAlert-DyQihpL5.js","assets/RunsPage-Bol98PMy.js","assets/useRunSession-Cg4iouK8.js","assets/ProtocolEditPage-CAdd8Z6w.js","assets/export-skill-zip-BJIKSTVo.js","assets/RichTextEditor-BvjJuiQH.js","assets/tiptap-Xlq1S4Wz.js","assets/ChallengeCard-BJf8kp0k.js","assets/RunGuidedPage-DuLSyckx.js","assets/StepFlowGraph-DhXjQZU7.js","assets/SkillBundlePage-NPS2s4_y.js","assets/ProtocolDetailPage-DnrTYbIl.js","assets/AccountPage-CpkUzlKz.js","assets/NotFoundPage-BGn-oseW.js"])))=>i.map(i=>d[i]);
2
- import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{_ as t,b as n,c as r,d as i,g as a,i as o,l as s,o as c,u as l,v as u,y as d}from"./vendor-CCdXVVkv.js";import{i as f,n as p,t as m}from"./react-C1iE8mnY.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),n.use(d).init({lng:`en`,fallbackLng:`en`,ns:[`translation`],defaultNS:`translation`,resources:{en:{translation:{"nav.home":`Home`,"nav.squadrules":`Browse`,"nav.create":`Create`,"nav.runs":`Test Run`,"nav.account":`Account`,"layout.squadrulesVersion":`SQUADRULES v{{version}}`,skipToMain:`Skip to main content`,"home.title":`Home`,"home.tagline":`Start from a clear task: browse protocols, create a new workflow, or continue protocol testing.`,"home.findCardTitle":`Find the right protocol`,"home.findCardSubtitle":`Home stays lightweight. Search and deeper discovery live in Browse.`,"home.goToBrowse":`Go to Browse`,"home.cardBrowseTitle":`Browse protocols`,"home.cardBrowseSubtitle":`Search or browse by label.`,"home.cardBrowseCta":`Open Browse`,"home.cardCreateTitle":`Create protocol`,"home.cardCreateSubtitle":`Use the rendered editor to draft a new workflow.`,"home.cardCreateCta":`Create new`,"home.cardRunsTitle":`Test Run`,"home.cardRunsSubtitle":`Resume a saved test run from this device.`,"home.cardRunsCta":`Open Test Run`,"home.spacesHeading":`Spaces`,"home.searchLabel":`Search protocols`,"home.searchPlaceholder":`e.g. deploy and test`,"home.searchHint":`Enter a query to find the best matching protocol. Results open in Browse.`,"home.statsLabel":`Space and protocol counts`,"home.stats.personalProtocols":`—`,"home.stats.personalProtocolsLabel":`Personal protocols`,"home.stats.squadrulesApp":`—`,"home.stats.squadrulesAppLabel":`Squadrules app`,"home.stats.spaces":`—`,"home.stats.spacesLabel":`Spaces`,"home.stats.protocolCount":`{{count}} protocol`,"home.stats.protocolCount_plural":`{{count}} protocols`,"home.ctaPre":`Search and manage protocols in`,"home.ctaSuffix":`.`,"squadrules.title":`Browse`,"squadrules.searchLabel":`Activation query`,"squadrules.searchPlaceholder":`e.g. deploy and test`,"squadrules.searchHint":`Search or browse by label. The default view lists protocols by their label.`,"squadrules.searchHintShort":`Run an activation query to rank the best matches, or browse the list below.`,"squadrules.browseByLabel":`Browse by label`,"squadrules.browseByLetterHint":`Click a letter to list protocols whose title starts with that letter (A–Z).`,"squadrules.letterCount":`Letter {{letter}}, {{count}} protocols`,"squadrules.labelsStartingWith":`Labels starting with {{letter}}`,"squadrules.noLabelsForLetter":`No protocols starting with this letter.`,"squadrules.browseFlatListHint":`Protocols listed by label. This is the default view when you open Browse.`,"squadrules.browseEmpty":`No protocols found in your spaces yet.`,"squadrules.enterQueryHint":`Enter an activation query above to find the best matching protocol. Results appear below.`,"spaces.filterAll":`All spaces`,"spaces.type.personal":`Personal`,"spaces.type.group":`Group`,"spaces.type.app":`App`,"spaces.type.other":`Other`,"squadrules.scopeSpaceLabel":`Limit search to a space`,"squadrules.spaceLabel":`Space`,"squadrules.search":`Activate`,"squadrules.loading":`Activating…`,"squadrules.empty":`No matching protocols found`,"squadrules.foundMatches":`Found {{count}} activation choices (top confidence: {{top}}%). View one, refine the query, or create a new protocol.`,"squadrules.resultsLabel":`Activation results`,"squadrules.score":`Score`,"squadrules.version":`Version`,"squadrules.tagsLabel":`Tags`,"squadrules.refineMeta":`Refine query`,"squadrules.createMeta":`Start from scratch`,"squadrules.view":`View`,"squadrules.viewProtocol":`View {{title}}`,"squadrules.refineSearch":`Refine query`,"squadrules.createNew":`Create new`,"protocol.loading":`Loading protocol…`,"protocol.notFound":`Protocol not found`,"protocol.uri":`URI`,"protocol.spaceLabel":`Space`,"protocol.readOnly":`Read-only`,"protocol.copyUri":`Copy URI`,"protocol.download":`Download`,"protocol.downloadAsMarkdown":`Download as Markdown`,"protocol.downloadAsSkill":`Download as Skill`,"protocol.editAsSkill":`Edit as Skill`,"protocol.expand":`Expand`,"protocol.collapse":`Collapse`,"protocol.edit":`Edit`,"protocol.duplicate":`Duplicate`,"protocol.runGuided":`Test Run`,"protocol.steps":`Steps`,"protocol.stepFlow":`Step flow`,"protocol.exportCardTitle":`Export`,"protocol.exportCardSubtitle":`Clear language replaces internal dump terminology.`,"protocol.exportFooter":`Skill export prepares a portable bundle for external AI tools.`,"protocol.triggers":`Activation patterns`,"protocol.completion":`Reward signal`,"protocol.howToUse":`How to use this protocol`,"protocol.howToUseInProduct":`The public UI helps people read, edit, export, and manually test protocol steps. Live AI execution still happens through MCP or CLI tooling.`,"protocol.howToUseCopy":`Use Test Run from the button above to step through this protocol in the browser. For agents or CLI, use Cursor (MCP) or the command line. See`,"protocol.docsLink":`documentation`,"runs.title":`Test Run`,"runs.subtitle":`Continue a test run you started earlier on this device.`,"runs.empty":`No runs yet.`,"runs.listLabel":`Test Run list`,"runs.status":`Status`,"runs.updated":`Updated`,"runs.stepsDone":`{{count}} steps completed`,"runs.resume":`Resume`,"runs.remove":`Remove`,"run.title":`Test Run`,"run.guidedIntro":`Step through the saved run in the browser and submit the same data the current run flow expects.`,"run.progressHeading":`Progress`,"run.currentStepHeading":`Current step`,"run.challengeHeading":`Challenge`,"run.stepProgress":`Step {{current}} of {{total}}`,"run.sessionBadge":`Active manual test session`,"run.flowStepN":`{{n}}`,"run.copyShellCommand":`Copy command`,"run.adapterUri":`Adapter URI`,"run.backToProtocol":`Back to adapter`,"run.start":`Start run`,"run.starting":`Starting…`,"run.safety.title":`Safe by default`,"run.safety.copy":`This guided run never executes shell commands in your browser. For shell challenges, run the command yourself and paste the real results.`,"run.serverMessage":`Server message`,"run.currentLayer":`Current layer`,"run.layerUri":`Layer URI`,"run.noLayerContent":`(No layer content)`,"run.contract":`Contract`,"run.contractType":`Type`,"run.advanced":`Advanced`,"run.nonce":`Nonce`,"run.proofHash":`Challenge proof_hash`,"run.previousProofHash":`Previous proof_hash`,"run.copy":`Copy`,"run.copied":`Copied`,"run.solution":`Solution`,"run.solutionFormLabel":`Submit solution`,"run.submitStep":`Submit step`,"run.shell.command":`Command`,"run.shell.invocation":`Invocation`,"run.shell.exitCode":`Exit code`,"run.shell.stdout":`Stdout`,"run.shell.stderr":`Stderr`,"run.forward.target":`Target`,"run.forward.targetMissing":`(Missing target URI)`,"run.forward.success":`Success`,"run.userInput.prompt":`Prompt`,"run.userInput.promptMissing":`(Missing prompt)`,"run.userInput.confirmation":`User confirmation`,"run.comment.minLength":`Minimum {{count}} characters`,"run.comment.count":`{{count}} typed`,"run.comment.text":`Comment`,"run.reward.title":`Reward completion`,"run.reward.subtitle":`Finalize the run outcome for reward and export quality.`,"run.reward.outcomeLabel":`Outcome`,"run.reward.success":`Success`,"run.reward.failure":`Failure`,"run.reward.feedback":`Feedback`,"run.reward.submit":`Submit reward`,"run.reward.submitting":`Submitting…`,"run.reward.defaultFeedback":`Completed guided run.`,"run.stepperProgress":`{{completed}} step(s) completed`,"run.history":`History`,"run.historyLabel":`Run history`,"run.completed":`Run completed`,"run.missingUri":`Missing adapter URI.`,"protocolEdit.newTitle":`New protocol`,"protocolEdit.editTitle":`Edit protocol`,"protocolEdit.hint":`Write as a human. The editor renders text on input and output while keeping the saved format compatible with generic Markdown.`,"protocolEdit.stepHeading":`Step {{n}}`,"protocolEdit.stepEditorHint":`Human-friendly editor with Markdown-safe formatting.`,"protocolEdit.triggersEditorHint":`Shown to humans as rendered text and serialized as Markdown-compatible content.`,"protocolEdit.previewRenderedTitle":`Rendered preview`,"protocolEdit.previewRenderedSubtitle":`Reading flow is fully rendered. Editing keeps a Markdown-safe rich text surface and this card previews section structure.`,"protocolEdit.previewStepLine":`Step {{n}}: {{label}}`,"protocolEdit.skillShortcutTitle":`Skill bundle shortcut`,"protocolEdit.skillShortcutSubtitle":`Authors can turn a protocol into a reusable skill bundle without learning repo-internal file names.`,"protocolEdit.formLabel":`Protocol form`,"protocolEdit.protocolLabel":`Protocol label`,"protocolEdit.triggersLabel":`Activation patterns`,"protocolEdit.triggersHint":`Describe when this protocol should run (e.g. deploy and test).`,"protocolEdit.stepLabel":`Step label`,"protocolEdit.stepContent":`Step content`,"protocolEdit.challengeType":`Challenge type`,"protocolEdit.addStep":`Add step`,"protocolEdit.removeStep":`Remove step`,"protocolEdit.completionLabel":`Reward signal`,"protocolEdit.challengeShell":`Shell command`,"protocolEdit.challengeForward":`Forward link`,"protocolEdit.challengeUserInput":`User input`,"protocolEdit.challengeComment":`Comment`,"protocolEdit.shellCmd":`Command`,"protocolEdit.shellTimeout":`Timeout (seconds)`,"protocolEdit.shellInterpreter":`Interpreter`,"protocolEdit.shellInterpreterPlaceholder":`Select an interpreter`,"protocolEdit.shellInterpreterHint":`Required. One of: bash, sh, python3, python, node.`,"protocolEdit.shellFlags":`Flags (one per line, optional)`,"protocolEdit.shellArgs":`Args (one per line, optional)`,"protocolEdit.shellWorkdir":`Workdir (optional)`,"protocolEdit.forwardTarget":`Target URI`,"protocolEdit.userInputPrompt":`Prompt`,"protocolEdit.commentMinLength":`Minimum length (characters)`,"protocolEdit.importCardTitle":`Import existing content`,"protocolEdit.uploadHint":"Uploading a `.md` file fills this editor form. It does not publish or overwrite anything until you save.","protocolEdit.contentLabel":`Protocol content (markdown)`,"protocolEdit.previewLabel":`Protocol preview`,"protocolEdit.previewTitle":`Live preview`,"protocolEdit.previewSteps":`Steps`,"protocolEdit.previewNoSteps":`No steps yet.`,"protocolEdit.previewSections":`Key sections`,"protocolEdit.present":`present`,"protocolEdit.missing":`missing`,"protocolEdit.insertTemplate":`Insert template`,"protocolEdit.upload":`Upload .md file`,"skill.title":`Edit as Skill`,"skill.subtitle":`Prepare a skill bundle for external AI tools before downloading the zip. Protocol content stays connected to the original workflow.`,"skill.bundleContentsTitle":`Bundle contents`,"skill.bundleContentsSubtitle":`Optional protocol references can be included in a dedicated folder.`,"skill.chipReadme":`Include README snippet`,"skill.chipPrompts":`Include example prompts`,"skill.comingSoon":`Coming soon`,"skill.bundlePreviewTitle":`Bundle preview`,"skill.bundlePreviewSubtitle":`Zip root contains the skill folder so users can upload it directly.`,"skill.whyExportTitle":`Why this export exists`,"skill.whyExportSubtitle":`The bundle is for human-friendly reuse, not an internal raw dump.`,"skill.whyExportBody":`Authors can package a protocol as a portable skill with polished naming and usage guidance, then download the final zip in one step.`,"skill.skillName":`Skill name`,"skill.description":`Skill description`,"skill.descriptionHint":`Describe what the skill does and when an AI assistant should use it.`,"skill.whenToUse":`When to use it`,"skill.includeReferences":`Include references folder`,"skill.downloadAsSkill":`Download as Skill`,"skill.backToProtocol":`Back to protocol`,"protocolEdit.placeholder":`# Protocol title
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/HomePage-DUe1teex.js","assets/vendor-DEls6f-c.js","assets/rolldown-runtime-XKyaHtl9.js","assets/react-C1iE8mnY.js","assets/SpaceSelect-LrJMAMEk.js","assets/api-BgTb-tmJ.js","assets/SurfaceCard-DJ6PVBPM.js","assets/SquadrulesPage-HJ-SjQ5u.js","assets/ErrorAlert-CpqG3xN8.js","assets/RunsPage-CGw60oRy.js","assets/useRunSession-Cg4iouK8.js","assets/ProtocolEditPage-BuJz36eu.js","assets/export-skill-zip-DRU_W5EX.js","assets/RichTextEditor-B6msD7tF.js","assets/tiptap-DEsERJZl.js","assets/ChallengeCard-BJf8kp0k.js","assets/RunGuidedPage-X_E_E42Y.js","assets/StepFlowGraph-509IoD3J.js","assets/SkillBundlePage-BbVG7AK1.js","assets/ProtocolDetailPage-D0MUL2RS.js","assets/AccountPage-Z11p_-am.js","assets/NotFoundPage-SqExcDrY.js"])))=>i.map(i=>d[i]);
2
+ import{r as e}from"./rolldown-runtime-XKyaHtl9.js";import{_ as t,b as n,c as r,d as i,g as a,i as o,l as s,o as c,u as l,v as u,y as d}from"./vendor-DEls6f-c.js";import{i as f,n as p,t as m}from"./react-C1iE8mnY.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})(),n.use(d).init({lng:`en`,fallbackLng:`en`,ns:[`translation`],defaultNS:`translation`,resources:{en:{translation:{"nav.home":`Home`,"nav.squadrules":`Browse`,"nav.create":`Create`,"nav.runs":`Test Run`,"nav.account":`Account`,"layout.squadrulesVersion":`SQUADRULES v{{version}}`,skipToMain:`Skip to main content`,"home.title":`Home`,"home.tagline":`Start from a clear task: browse protocols, create a new workflow, or continue protocol testing.`,"home.findCardTitle":`Find the right protocol`,"home.findCardSubtitle":`Home stays lightweight. Search and deeper discovery live in Browse.`,"home.goToBrowse":`Go to Browse`,"home.cardBrowseTitle":`Browse protocols`,"home.cardBrowseSubtitle":`Search or browse by label.`,"home.cardBrowseCta":`Open Browse`,"home.cardCreateTitle":`Create protocol`,"home.cardCreateSubtitle":`Use the rendered editor to draft a new workflow.`,"home.cardCreateCta":`Create new`,"home.cardRunsTitle":`Test Run`,"home.cardRunsSubtitle":`Resume a saved test run from this device.`,"home.cardRunsCta":`Open Test Run`,"home.spacesHeading":`Spaces`,"home.searchLabel":`Search protocols`,"home.searchPlaceholder":`e.g. deploy and test`,"home.searchHint":`Enter a query to find the best matching protocol. Results open in Browse.`,"home.statsLabel":`Space and protocol counts`,"home.stats.personalProtocols":`—`,"home.stats.personalProtocolsLabel":`Personal protocols`,"home.stats.squadrulesApp":`—`,"home.stats.squadrulesAppLabel":`Squadrules app`,"home.stats.spaces":`—`,"home.stats.spacesLabel":`Spaces`,"home.stats.protocolCount":`{{count}} protocol`,"home.stats.protocolCount_plural":`{{count}} protocols`,"home.ctaPre":`Search and manage protocols in`,"home.ctaSuffix":`.`,"squadrules.title":`Browse`,"squadrules.searchLabel":`Activation query`,"squadrules.searchPlaceholder":`e.g. deploy and test`,"squadrules.searchHint":`Search or browse by label. The default view lists protocols by their label.`,"squadrules.searchHintShort":`Run an activation query to rank the best matches, or browse the list below.`,"squadrules.browseByLabel":`Browse by label`,"squadrules.browseByLetterHint":`Click a letter to list protocols whose title starts with that letter (A–Z).`,"squadrules.letterCount":`Letter {{letter}}, {{count}} protocols`,"squadrules.labelsStartingWith":`Labels starting with {{letter}}`,"squadrules.noLabelsForLetter":`No protocols starting with this letter.`,"squadrules.browseFlatListHint":`Protocols listed by label. This is the default view when you open Browse.`,"squadrules.browseEmpty":`No protocols found in your spaces yet.`,"squadrules.enterQueryHint":`Enter an activation query above to find the best matching protocol. Results appear below.`,"spaces.filterAll":`All spaces`,"spaces.type.personal":`Personal`,"spaces.type.group":`Group`,"spaces.type.app":`App`,"spaces.type.other":`Other`,"squadrules.scopeSpaceLabel":`Limit search to a space`,"squadrules.spaceLabel":`Space`,"squadrules.search":`Activate`,"squadrules.loading":`Activating…`,"squadrules.empty":`No matching protocols found`,"squadrules.foundMatches":`Found {{count}} activation choices (top confidence: {{top}}%). View one, refine the query, or create a new protocol.`,"squadrules.resultsLabel":`Activation results`,"squadrules.score":`Score`,"squadrules.version":`Version`,"squadrules.tagsLabel":`Tags`,"squadrules.refineMeta":`Refine query`,"squadrules.createMeta":`Start from scratch`,"squadrules.view":`View`,"squadrules.viewProtocol":`View {{title}}`,"squadrules.refineSearch":`Refine query`,"squadrules.createNew":`Create new`,"protocol.loading":`Loading protocol…`,"protocol.notFound":`Protocol not found`,"protocol.uri":`URI`,"protocol.spaceLabel":`Space`,"protocol.readOnly":`Read-only`,"protocol.copyUri":`Copy URI`,"protocol.download":`Download`,"protocol.downloadAsMarkdown":`Download as Markdown`,"protocol.downloadAsSkill":`Download as Skill`,"protocol.editAsSkill":`Edit as Skill`,"protocol.expand":`Expand`,"protocol.collapse":`Collapse`,"protocol.edit":`Edit`,"protocol.duplicate":`Duplicate`,"protocol.runGuided":`Test Run`,"protocol.steps":`Steps`,"protocol.stepFlow":`Step flow`,"protocol.exportCardTitle":`Export`,"protocol.exportCardSubtitle":`Clear language replaces internal dump terminology.`,"protocol.exportFooter":`Skill export prepares a portable bundle for external AI tools.`,"protocol.triggers":`Activation patterns`,"protocol.completion":`Reward signal`,"protocol.howToUse":`How to use this protocol`,"protocol.howToUseInProduct":`The public UI helps people read, edit, export, and manually test protocol steps. Live AI execution still happens through MCP or CLI tooling.`,"protocol.howToUseCopy":`Use Test Run from the button above to step through this protocol in the browser. For agents or CLI, use Cursor (MCP) or the command line. See`,"protocol.docsLink":`documentation`,"runs.title":`Test Run`,"runs.subtitle":`Continue a test run you started earlier on this device.`,"runs.empty":`No runs yet.`,"runs.listLabel":`Test Run list`,"runs.status":`Status`,"runs.updated":`Updated`,"runs.stepsDone":`{{count}} steps completed`,"runs.resume":`Resume`,"runs.remove":`Remove`,"run.title":`Test Run`,"run.guidedIntro":`Step through the saved run in the browser and submit the same data the current run flow expects.`,"run.progressHeading":`Progress`,"run.currentStepHeading":`Current step`,"run.challengeHeading":`Challenge`,"run.stepProgress":`Step {{current}} of {{total}}`,"run.sessionBadge":`Active manual test session`,"run.flowStepN":`{{n}}`,"run.copyShellCommand":`Copy command`,"run.adapterUri":`Adapter URI`,"run.backToProtocol":`Back to adapter`,"run.start":`Start run`,"run.starting":`Starting…`,"run.safety.title":`Safe by default`,"run.safety.copy":`This guided run never executes shell commands in your browser. For shell challenges, run the command yourself and paste the real results.`,"run.serverMessage":`Server message`,"run.currentLayer":`Current layer`,"run.layerUri":`Layer URI`,"run.noLayerContent":`(No layer content)`,"run.contract":`Contract`,"run.contractType":`Type`,"run.advanced":`Advanced`,"run.nonce":`Nonce`,"run.proofHash":`Challenge proof_hash`,"run.previousProofHash":`Previous proof_hash`,"run.copy":`Copy`,"run.copied":`Copied`,"run.solution":`Solution`,"run.solutionFormLabel":`Submit solution`,"run.submitStep":`Submit step`,"run.shell.command":`Command`,"run.shell.invocation":`Invocation`,"run.shell.exitCode":`Exit code`,"run.shell.stdout":`Stdout`,"run.shell.stderr":`Stderr`,"run.forward.target":`Target`,"run.forward.targetMissing":`(Missing target URI)`,"run.forward.success":`Success`,"run.userInput.prompt":`Prompt`,"run.userInput.promptMissing":`(Missing prompt)`,"run.userInput.confirmation":`User confirmation`,"run.comment.minLength":`Minimum {{count}} characters`,"run.comment.count":`{{count}} typed`,"run.comment.text":`Comment`,"run.reward.title":`Reward completion`,"run.reward.subtitle":`Finalize the run outcome for reward and export quality.`,"run.reward.outcomeLabel":`Outcome`,"run.reward.success":`Success`,"run.reward.failure":`Failure`,"run.reward.feedback":`Feedback`,"run.reward.submit":`Submit reward`,"run.reward.submitting":`Submitting…`,"run.reward.defaultFeedback":`Completed guided run.`,"run.stepperProgress":`{{completed}} step(s) completed`,"run.history":`History`,"run.historyLabel":`Run history`,"run.completed":`Run completed`,"run.missingUri":`Missing adapter URI.`,"protocolEdit.newTitle":`New protocol`,"protocolEdit.editTitle":`Edit protocol`,"protocolEdit.hint":`Write as a human. The editor renders text on input and output while keeping the saved format compatible with generic Markdown.`,"protocolEdit.stepHeading":`Step {{n}}`,"protocolEdit.stepEditorHint":`Human-friendly editor with Markdown-safe formatting.`,"protocolEdit.triggersEditorHint":`Shown to humans as rendered text and serialized as Markdown-compatible content.`,"protocolEdit.previewRenderedTitle":`Rendered preview`,"protocolEdit.previewRenderedSubtitle":`Reading flow is fully rendered. Editing keeps a Markdown-safe rich text surface and this card previews section structure.`,"protocolEdit.previewStepLine":`Step {{n}}: {{label}}`,"protocolEdit.skillShortcutTitle":`Skill bundle shortcut`,"protocolEdit.skillShortcutSubtitle":`Authors can turn a protocol into a reusable skill bundle without learning repo-internal file names.`,"protocolEdit.formLabel":`Protocol form`,"protocolEdit.protocolLabel":`Protocol label`,"protocolEdit.triggersLabel":`Activation patterns`,"protocolEdit.triggersHint":`Describe when this protocol should run (e.g. deploy and test).`,"protocolEdit.stepLabel":`Step label`,"protocolEdit.stepContent":`Step content`,"protocolEdit.challengeType":`Challenge type`,"protocolEdit.addStep":`Add step`,"protocolEdit.removeStep":`Remove step`,"protocolEdit.completionLabel":`Reward signal`,"protocolEdit.challengeShell":`Shell command`,"protocolEdit.challengeForward":`Forward link`,"protocolEdit.challengeUserInput":`User input`,"protocolEdit.challengeComment":`Comment`,"protocolEdit.shellCmd":`Command`,"protocolEdit.shellTimeout":`Timeout (seconds)`,"protocolEdit.shellInterpreter":`Interpreter`,"protocolEdit.shellInterpreterPlaceholder":`Select an interpreter`,"protocolEdit.shellInterpreterHint":`Required. One of: bash, sh, python3, python, node.`,"protocolEdit.shellFlags":`Flags (one per line, optional)`,"protocolEdit.shellArgs":`Args (one per line, optional)`,"protocolEdit.shellWorkdir":`Workdir (optional)`,"protocolEdit.forwardTarget":`Target URI`,"protocolEdit.userInputPrompt":`Prompt`,"protocolEdit.commentMinLength":`Minimum length (characters)`,"protocolEdit.importCardTitle":`Import existing content`,"protocolEdit.uploadHint":"Uploading a `.md` file fills this editor form. It does not publish or overwrite anything until you save.","protocolEdit.contentLabel":`Protocol content (markdown)`,"protocolEdit.previewLabel":`Protocol preview`,"protocolEdit.previewTitle":`Live preview`,"protocolEdit.previewSteps":`Steps`,"protocolEdit.previewNoSteps":`No steps yet.`,"protocolEdit.previewSections":`Key sections`,"protocolEdit.present":`present`,"protocolEdit.missing":`missing`,"protocolEdit.insertTemplate":`Insert template`,"protocolEdit.upload":`Upload .md file`,"skill.title":`Edit as Skill`,"skill.subtitle":`Prepare a skill bundle for external AI tools before downloading the zip. Protocol content stays connected to the original workflow.`,"skill.bundleContentsTitle":`Bundle contents`,"skill.bundleContentsSubtitle":`Optional protocol references can be included in a dedicated folder.`,"skill.chipReadme":`Include README snippet`,"skill.chipPrompts":`Include example prompts`,"skill.comingSoon":`Coming soon`,"skill.bundlePreviewTitle":`Bundle preview`,"skill.bundlePreviewSubtitle":`Zip root contains the skill folder so users can upload it directly.`,"skill.whyExportTitle":`Why this export exists`,"skill.whyExportSubtitle":`The bundle is for human-friendly reuse, not an internal raw dump.`,"skill.whyExportBody":`Authors can package a protocol as a portable skill with polished naming and usage guidance, then download the final zip in one step.`,"skill.skillName":`Skill name`,"skill.description":`Skill description`,"skill.descriptionHint":`Describe what the skill does and when an AI assistant should use it.`,"skill.whenToUse":`When to use it`,"skill.includeReferences":`Include references folder`,"skill.downloadAsSkill":`Download as Skill`,"skill.backToProtocol":`Back to protocol`,"protocolEdit.placeholder":`# Protocol title
3
3
 
4
4
  ## Activation Patterns
5
5
  ...
6
6
 
7
7
  ## Step 1
8
- ...`,"protocolEdit.contentHint":`Include: Activation Patterns (first H2), steps (H2 + optional challenge block), Reward Signal (last H2).`,"protocolEdit.targetSpaceLabel":`Save to space`,"protocolEdit.targetSpaceHint":`New protocols are stored in the space you pick (default: Personal).`,"protocolEdit.forkSourceLabel":`Fork from adapter (optional)`,"protocolEdit.forkSourcePlaceholder":`squadrules://adapter/{slug}`,"protocolEdit.forkSourceHint":`Leave empty for a brand-new protocol, or paste an adapter URI to copy its markdown into the target space as a new adapter.`,"protocolEdit.forkUriInvalid":`Fork source must be a squadrules://adapter/{slug} URI.`,"protocolEdit.moveSpaceLabel":`Space for this protocol`,"protocolEdit.moveSpaceHint":`Change the space and save to move every layer to the selected space (same as tune with a space parameter).`,"protocolEdit.save":`Save`,"protocolEdit.saving":`Saving…`,"protocolEdit.cancel":`Cancel`,"account.title":`Account`,"account.intro":`You are signed in. Sign out below or use the options to manage your profile.`,"account.loading":`Loading…`,"account.notSignedIn":`You are not signed in.`,"account.signIn":`Sign in`,"account.name":`Name`,"account.username":`Username`,"account.email":`Email`,"account.emailVerified":`verified`,"account.accountType":`Account type`,"account.realm":`Realm`,"account.identityProvider":`Login provider`,"account.groups":`Groups`,"account.themeTitle":`Theme`,"account.themeDescription":`Choose how SQUADRULES UI appearance should be rendered.`,"account.themePreferenceLabel":`Theme preference`,"account.themeOptionLight":`Light`,"account.themeOptionDark":`Dark`,"account.themeOptionSystem":`Match system`,"account.logOut":`Log out`,"notFound.title":`Page not found`,"notFound.message":`The page you requested could not be found.`,"notFound.goHome":`Go to Home`,"error.title":`Something went wrong`,"error.retry":`Retry`,"error.goBack":`Go to Home`,"error.support":`Support`}}},interpolation:{escapeValue:!1}});var h=e(f(),1),g=p(),_=`/ui/assets/squadrules-mcp-Qc5pokoj.svg`,v=m(),y=e=>e.startsWith(`/protocols`)||e.startsWith(`/runs`);function b(){let{t:e}=u(),t=i().pathname,n=({isActive:e})=>`min-h-[var(--layout-touch-target)] flex items-center px-4 py-3 text-[var(--color-text)] no-underline border-l-[3px] border-transparent outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-heading)] ${e?`font-semibold text-[var(--color-primary)] border-l-[var(--color-primary)] bg-[var(--color-surface)]`:``}`,a=y(t)?`min(100%, var(--layout-main-max), var(--layout-main-wide))`:`min(100%, var(--layout-main-max), var(--layout-main-narrow))`;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`a`,{href:`#main`,className:`skip-link`,children:e(`skipToMain`)}),(0,v.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,v.jsxs)(`aside`,{className:`flex min-h-screen w-[var(--layout-sidebar-width)] flex-shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface-elevated)] py-4`,"aria-label":`Main navigation`,children:[(0,v.jsx)(`div`,{className:`px-4 pb-4`,children:(0,v.jsxs)(c,{to:`/`,end:!0,className:`flex min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] items-center gap-3 rounded-md outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`,children:[(0,v.jsx)(`img`,{src:_,alt:``,className:`h-10 w-10 flex-shrink-0 rounded-lg object-contain`,width:`40`,height:`40`}),(0,v.jsxs)(`span`,{className:`flex flex-col leading-tight`,children:[(0,v.jsx)(`span`,{className:`font-bold text-[var(--color-text-heading)] text-lg`,children:`Squadrules`}),(0,v.jsx)(`span`,{className:`font-bold text-[var(--color-text-muted)] text-xs uppercase tracking-wide`,children:`MCP`})]})]})}),(0,v.jsxs)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5`,children:[(0,v.jsx)(c,{to:`/`,end:!0,"aria-current":t===`/`?`page`:void 0,className:n,children:e(`nav.home`)}),(0,v.jsx)(c,{to:`/squadrules`,"aria-current":t===`/squadrules`?`page`:void 0,className:n,children:e(`nav.squadrules`)}),(0,v.jsx)(c,{to:`/protocols/new`,"aria-current":t===`/protocols/new`?`page`:void 0,className:n,children:e(`nav.create`)}),(0,v.jsx)(c,{to:`/runs`,"aria-current":t===`/runs`?`page`:void 0,className:n,children:e(`nav.runs`)}),(0,v.jsx)(c,{to:`/account`,"aria-current":t===`/account`?`page`:void 0,className:n,children:e(`nav.account`)})]}),(0,v.jsx)(`div`,{className:`mt-auto border-t border-[var(--color-border)] px-4 pt-3`,children:(0,v.jsx)(`p`,{className:`m-0 text-xs text-[var(--color-text-muted)]`,children:e(`layout.squadrulesVersion`,{version:`5.23.6`})})})]}),(0,v.jsx)(`main`,{id:`main`,className:`flex-1 mx-auto w-full py-[var(--layout-main-padding-y)] px-[var(--layout-main-padding-x)]`,style:{maxWidth:a},tabIndex:-1,children:(0,v.jsx)(r,{})})]})]})}var x=`modulepreload`,S=function(e){return`/ui/`+e},C={},w=function(e){return e.pathname.endsWith(`.css`)},T=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},E=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=S(t,n);let r=s(t),i=w(r);return T(C,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:x,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},D=(0,h.lazy)(()=>E(()=>import(`./HomePage-DWUgLnYm.js`).then(e=>({default:e.HomePage})),__vite__mapDeps([0,1,2,3,4,5,6]))),O=(0,h.lazy)(()=>E(()=>import(`./SquadrulesPage-C5Qk6o59.js`).then(e=>({default:e.SquadrulesPage})),__vite__mapDeps([7,2,3,1,5,4,8]))),k=(0,h.lazy)(()=>E(()=>import(`./RunsPage-Bol98PMy.js`).then(e=>({default:e.RunsPage})),__vite__mapDeps([9,1,2,3,10]))),A=(0,h.lazy)(()=>E(()=>import(`./ProtocolEditPage-CAdd8Z6w.js`).then(e=>({default:e.ProtocolEditPage})),__vite__mapDeps([11,2,3,1,12,5,13,14,4,6,15]))),j=(0,h.lazy)(()=>E(()=>import(`./RunGuidedPage-DuLSyckx.js`).then(e=>({default:e.RunGuidedPage})),__vite__mapDeps([16,2,3,1,15,17,6,8,5,10]))),M=(0,h.lazy)(()=>E(()=>import(`./SkillBundlePage-NPS2s4_y.js`).then(e=>({default:e.SkillBundlePage})),__vite__mapDeps([18,2,3,1,12,5,13,14,6]))),N=(0,h.lazy)(()=>E(()=>import(`./ProtocolDetailPage-DnrTYbIl.js`).then(e=>({default:e.ProtocolDetailPage})),__vite__mapDeps([19,2,3,1,12,5,15,17,6]))),P=(0,h.lazy)(()=>E(()=>import(`./AccountPage-CpkUzlKz.js`).then(e=>({default:e.AccountPage})),__vite__mapDeps([20,1,2,3,5]))),F=(0,h.lazy)(()=>E(()=>import(`./NotFoundPage-BGn-oseW.js`).then(e=>({default:e.NotFoundPage})),__vite__mapDeps([21,1,2,3,8])));function I(){return(0,v.jsx)(`div`,{className:`flex min-h-[12rem] items-center justify-center text-[var(--color-text-muted)]`,"aria-busy":`true`,children:`Loading…`})}function L(){return(0,v.jsx)(l,{children:(0,v.jsxs)(s,{path:`/`,element:(0,v.jsx)(b,{}),children:[(0,v.jsx)(s,{index:!0,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(D,{})})}),(0,v.jsx)(s,{path:`squadrules`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(O,{})})}),(0,v.jsx)(s,{path:`runs`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(k,{})})}),(0,v.jsx)(s,{path:`protocols/new`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(A,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/edit`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(A,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/run`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(j,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/skill`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(M,{})})}),(0,v.jsx)(s,{path:`protocols/:uri`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(N,{})})}),(0,v.jsx)(s,{path:`account`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(P,{})})}),(0,v.jsx)(s,{path:`*`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(F,{})})})]})})}function R(){return(0,v.jsx)(o,{basename:`/ui`,children:(0,v.jsx)(L,{})})}var z=[`light`,`dark`],B=`squadrules:ui:theme-preference`,V=`(prefers-color-scheme: dark)`,H=`system`;function U(e){return e===null?!1:e===`system`||z.includes(e)}function W(e,t){return e===`system`?t?`dark`:`light`:e}function G(){if(typeof window>`u`)return H;try{let e=window.localStorage.getItem(B);return U(e)?e:H}catch{return H}}function K(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(V).matches}function q(e){if(typeof document>`u`)return;let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e===`light`?`light`:`dark`}function J(){let[e,t]=(0,h.useState)(()=>G()),[n,r]=(0,h.useState)(()=>K()),i=(0,h.useMemo)(()=>W(e,n),[e,n]);return(0,h.useEffect)(()=>{q(i)},[i]),(0,h.useEffect)(()=>{if(typeof window>`u`||e!==`system`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(V);r(t.matches);let n=e=>{r(e.matches)};return typeof t.addEventListener==`function`?(t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)):(t.addListener(n),()=>t.removeListener(n))},[e]),(0,h.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`squadrules:ui:theme-preference`&&t(U(e.newValue)?e.newValue:H)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{preference:e,effectiveTheme:i,setPreference:(0,h.useCallback)(e=>{if(t(e),typeof window<`u`)try{window.localStorage.setItem(B,e)}catch{}},[])}}var Y=(0,h.createContext)(null);function X({children:e}){let t=J();return(0,v.jsx)(Y.Provider,{value:t,children:e})}function Z(){let e=(0,h.useContext)(Y);if(!e)throw Error(`useThemePreferenceContext must be used within ThemeProvider`);return e}var Q=new a;(0,g.createRoot)(document.getElementById(`root`)).render((0,v.jsx)(h.StrictMode,{children:(0,v.jsx)(t,{client:Q,children:(0,v.jsx)(X,{children:(0,v.jsx)(R,{})})})}));export{U as n,Z as r,z as t};
8
+ ...`,"protocolEdit.contentHint":`Include: Activation Patterns (first H2), steps (H2 + optional challenge block), Reward Signal (last H2).`,"protocolEdit.targetSpaceLabel":`Save to space`,"protocolEdit.targetSpaceHint":`New protocols are stored in the space you pick (default: Personal).`,"protocolEdit.forkSourceLabel":`Fork from adapter (optional)`,"protocolEdit.forkSourcePlaceholder":`squadrules://adapter/{slug}`,"protocolEdit.forkSourceHint":`Leave empty for a brand-new protocol, or paste an adapter URI to copy its markdown into the target space as a new adapter.`,"protocolEdit.forkUriInvalid":`Fork source must be a squadrules://adapter/{slug} URI.`,"protocolEdit.moveSpaceLabel":`Space for this protocol`,"protocolEdit.moveSpaceHint":`Change the space and save to move every layer to the selected space (same as tune with a space parameter).`,"protocolEdit.save":`Save`,"protocolEdit.saving":`Saving…`,"protocolEdit.cancel":`Cancel`,"account.title":`Account`,"account.intro":`You are signed in. Sign out below or use the options to manage your profile.`,"account.loading":`Loading…`,"account.notSignedIn":`You are not signed in.`,"account.signIn":`Sign in`,"account.name":`Name`,"account.username":`Username`,"account.email":`Email`,"account.emailVerified":`verified`,"account.accountType":`Account type`,"account.realm":`Realm`,"account.identityProvider":`Login provider`,"account.groups":`Groups`,"account.themeTitle":`Theme`,"account.themeDescription":`Choose how SQUADRULES UI appearance should be rendered.`,"account.themePreferenceLabel":`Theme preference`,"account.themeOptionLight":`Light`,"account.themeOptionDark":`Dark`,"account.themeOptionSystem":`Match system`,"account.logOut":`Log out`,"notFound.title":`Page not found`,"notFound.message":`The page you requested could not be found.`,"notFound.goHome":`Go to Home`,"error.title":`Something went wrong`,"error.retry":`Retry`,"error.goBack":`Go to Home`,"error.support":`Support`}}},interpolation:{escapeValue:!1}});var h=e(f(),1),g=p(),_=`/ui/assets/squadrules-mcp-Qc5pokoj.svg`,v=m(),y=e=>e.startsWith(`/protocols`)||e.startsWith(`/runs`);function b(){let{t:e}=u(),t=i().pathname,n=({isActive:e})=>`min-h-[var(--layout-touch-target)] flex items-center px-4 py-3 text-[var(--color-text)] no-underline border-l-[3px] border-transparent outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)] hover:bg-[var(--color-surface)] hover:text-[var(--color-text-heading)] ${e?`font-semibold text-[var(--color-primary)] border-l-[var(--color-primary)] bg-[var(--color-surface)]`:``}`,a=y(t)?`min(100%, var(--layout-main-max), var(--layout-main-wide))`:`min(100%, var(--layout-main-max), var(--layout-main-narrow))`;return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`a`,{href:`#main`,className:`skip-link`,children:e(`skipToMain`)}),(0,v.jsxs)(`div`,{className:`flex min-h-screen`,children:[(0,v.jsxs)(`aside`,{className:`flex min-h-screen w-[var(--layout-sidebar-width)] flex-shrink-0 flex-col border-r border-[var(--color-border)] bg-[var(--color-surface-elevated)] py-4`,"aria-label":`Main navigation`,children:[(0,v.jsx)(`div`,{className:`px-4 pb-4`,children:(0,v.jsxs)(c,{to:`/`,end:!0,className:`flex min-h-[var(--layout-touch-target)] min-w-[var(--layout-touch-target)] items-center gap-3 rounded-md outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[var(--color-focus-ring)]`,children:[(0,v.jsx)(`img`,{src:_,alt:``,className:`h-10 w-10 flex-shrink-0 rounded-lg object-contain`,width:`40`,height:`40`}),(0,v.jsxs)(`span`,{className:`flex flex-col leading-tight`,children:[(0,v.jsx)(`span`,{className:`font-bold text-[var(--color-text-heading)] text-lg`,children:`Squadrules`}),(0,v.jsx)(`span`,{className:`font-bold text-[var(--color-text-muted)] text-xs uppercase tracking-wide`,children:`MCP`})]})]})}),(0,v.jsxs)(`nav`,{className:`flex min-h-0 flex-1 flex-col gap-0.5`,children:[(0,v.jsx)(c,{to:`/`,end:!0,"aria-current":t===`/`?`page`:void 0,className:n,children:e(`nav.home`)}),(0,v.jsx)(c,{to:`/squadrules`,"aria-current":t===`/squadrules`?`page`:void 0,className:n,children:e(`nav.squadrules`)}),(0,v.jsx)(c,{to:`/protocols/new`,"aria-current":t===`/protocols/new`?`page`:void 0,className:n,children:e(`nav.create`)}),(0,v.jsx)(c,{to:`/runs`,"aria-current":t===`/runs`?`page`:void 0,className:n,children:e(`nav.runs`)}),(0,v.jsx)(c,{to:`/account`,"aria-current":t===`/account`?`page`:void 0,className:n,children:e(`nav.account`)})]}),(0,v.jsx)(`div`,{className:`mt-auto border-t border-[var(--color-border)] px-4 pt-3`,children:(0,v.jsx)(`p`,{className:`m-0 text-xs text-[var(--color-text-muted)]`,children:e(`layout.squadrulesVersion`,{version:`5.23.7`})})})]}),(0,v.jsx)(`main`,{id:`main`,className:`flex-1 mx-auto w-full py-[var(--layout-main-padding-y)] px-[var(--layout-main-padding-x)]`,style:{maxWidth:a},tabIndex:-1,children:(0,v.jsx)(r,{})})]})]})}var x=`modulepreload`,S=function(e){return`/ui/`+e},C={},w=function(e){return e.pathname.endsWith(`.css`)},T=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},E=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=S(t,n);let r=s(t),i=w(r);return T(C,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:x,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{let i=a=>{t.removeEventListener(`load`,i),t.removeEventListener(`error`,i),a.type===`error`?n(Error(`Unable to preload CSS for ${r}`)):e(a)};t.addEventListener(`load`,i),t.addEventListener(`error`,i)})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},D=(0,h.lazy)(()=>E(()=>import(`./HomePage-DUe1teex.js`).then(e=>({default:e.HomePage})),__vite__mapDeps([0,1,2,3,4,5,6]))),O=(0,h.lazy)(()=>E(()=>import(`./SquadrulesPage-HJ-SjQ5u.js`).then(e=>({default:e.SquadrulesPage})),__vite__mapDeps([7,2,3,1,5,4,8]))),k=(0,h.lazy)(()=>E(()=>import(`./RunsPage-CGw60oRy.js`).then(e=>({default:e.RunsPage})),__vite__mapDeps([9,1,2,3,10]))),A=(0,h.lazy)(()=>E(()=>import(`./ProtocolEditPage-BuJz36eu.js`).then(e=>({default:e.ProtocolEditPage})),__vite__mapDeps([11,2,3,1,12,5,13,14,4,6,15]))),j=(0,h.lazy)(()=>E(()=>import(`./RunGuidedPage-X_E_E42Y.js`).then(e=>({default:e.RunGuidedPage})),__vite__mapDeps([16,2,3,1,15,17,6,8,5,10]))),M=(0,h.lazy)(()=>E(()=>import(`./SkillBundlePage-BbVG7AK1.js`).then(e=>({default:e.SkillBundlePage})),__vite__mapDeps([18,2,3,1,12,5,13,14,6]))),N=(0,h.lazy)(()=>E(()=>import(`./ProtocolDetailPage-D0MUL2RS.js`).then(e=>({default:e.ProtocolDetailPage})),__vite__mapDeps([19,2,3,1,12,5,15,17,6]))),P=(0,h.lazy)(()=>E(()=>import(`./AccountPage-Z11p_-am.js`).then(e=>({default:e.AccountPage})),__vite__mapDeps([20,1,2,3,5]))),F=(0,h.lazy)(()=>E(()=>import(`./NotFoundPage-SqExcDrY.js`).then(e=>({default:e.NotFoundPage})),__vite__mapDeps([21,1,2,3,8])));function I(){return(0,v.jsx)(`div`,{className:`flex min-h-[12rem] items-center justify-center text-[var(--color-text-muted)]`,"aria-busy":`true`,children:`Loading…`})}function L(){return(0,v.jsx)(l,{children:(0,v.jsxs)(s,{path:`/`,element:(0,v.jsx)(b,{}),children:[(0,v.jsx)(s,{index:!0,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(D,{})})}),(0,v.jsx)(s,{path:`squadrules`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(O,{})})}),(0,v.jsx)(s,{path:`runs`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(k,{})})}),(0,v.jsx)(s,{path:`protocols/new`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(A,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/edit`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(A,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/run`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(j,{})})}),(0,v.jsx)(s,{path:`protocols/:uri/skill`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(M,{})})}),(0,v.jsx)(s,{path:`protocols/:uri`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(N,{})})}),(0,v.jsx)(s,{path:`account`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(P,{})})}),(0,v.jsx)(s,{path:`*`,element:(0,v.jsx)(h.Suspense,{fallback:(0,v.jsx)(I,{}),children:(0,v.jsx)(F,{})})})]})})}function R(){return(0,v.jsx)(o,{basename:`/ui`,children:(0,v.jsx)(L,{})})}var z=[`light`,`dark`],B=`squadrules:ui:theme-preference`,V=`(prefers-color-scheme: dark)`,H=`system`;function U(e){return e===null?!1:e===`system`||z.includes(e)}function W(e,t){return e===`system`?t?`dark`:`light`:e}function G(){if(typeof window>`u`)return H;try{let e=window.localStorage.getItem(B);return U(e)?e:H}catch{return H}}function K(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(V).matches}function q(e){if(typeof document>`u`)return;let t=document.documentElement;t.setAttribute(`data-theme`,e),t.style.colorScheme=e===`light`?`light`:`dark`}function J(){let[e,t]=(0,h.useState)(()=>G()),[n,r]=(0,h.useState)(()=>K()),i=(0,h.useMemo)(()=>W(e,n),[e,n]);return(0,h.useEffect)(()=>{q(i)},[i]),(0,h.useEffect)(()=>{if(typeof window>`u`||e!==`system`||typeof window.matchMedia!=`function`)return;let t=window.matchMedia(V);r(t.matches);let n=e=>{r(e.matches)};return typeof t.addEventListener==`function`?(t.addEventListener(`change`,n),()=>t.removeEventListener(`change`,n)):(t.addListener(n),()=>t.removeListener(n))},[e]),(0,h.useEffect)(()=>{if(typeof window>`u`)return;let e=e=>{e.key===`squadrules:ui:theme-preference`&&t(U(e.newValue)?e.newValue:H)};return window.addEventListener(`storage`,e),()=>window.removeEventListener(`storage`,e)},[]),{preference:e,effectiveTheme:i,setPreference:(0,h.useCallback)(e=>{if(t(e),typeof window<`u`)try{window.localStorage.setItem(B,e)}catch{}},[])}}var Y=(0,h.createContext)(null);function X({children:e}){let t=J();return(0,v.jsx)(Y.Provider,{value:t,children:e})}function Z(){let e=(0,h.useContext)(Y);if(!e)throw Error(`useThemePreferenceContext must be used within ThemeProvider`);return e}var Q=new a;(0,g.createRoot)(document.getElementById(`root`)).render((0,v.jsx)(h.StrictMode,{children:(0,v.jsx)(t,{client:Q,children:(0,v.jsx)(X,{children:(0,v.jsx)(R,{})})})}));export{U as n,Z as r,z as t};
@@ -93,7 +93,7 @@ img.ProseMirror-separator {
93
93
  display: block;
94
94
  }`,wp=class extends tf{constructor(e={}){super(),this.css=null,this.className=`tiptap`,this.editorView=null,this.isFocused=!1,this.destroyed=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.hasWarnedStaleDecorationRead=!1,this.options={element:typeof document<`u`?document.createElement(`div`):null,content:``,injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:e})=>{throw e},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:pd,createMappablePosition:md},this.setOptions(e),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on(`beforeCreate`,this.options.onBeforeCreate),this.emit(`beforeCreate`,{editor:this}),this.on(`mount`,this.options.onMount),this.on(`unmount`,this.options.onUnmount),this.on(`contentError`,this.options.onContentError),this.on(`create`,this.options.onCreate),this.on(`update`,this.options.onUpdate),this.on(`selectionUpdate`,this.options.onSelectionUpdate),this.on(`transaction`,this.options.onTransaction),this.on(`focus`,this.options.onFocus),this.on(`blur`,this.options.onBlur),this.on(`destroy`,this.options.onDestroy),this.on(`drop`,({event:e,slice:t,moved:n})=>this.options.onDrop(e,t,n)),this.on(`paste`,({event:e,slice:t})=>this.options.onPaste(e,t)),this.on(`delete`,this.options.onDelete);let t=this.createDoc();if(!this.editorState){let e=yl(t,this.options.autofocus);this.editorState=Bn.create({doc:t,schema:this.schema,selection:e||void 0})}xp(this.schema),this.options.element&&this.mount(this.options.element)}mount(e){if(typeof document>`u`)throw Error(`[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.`);this.createView(e),this.emit(`mount`,{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit(`create`,{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){this.editorState=this.editorView.state;let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove==`function`?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(e){console.warn(`Failed to remove CSS element:`,e)}this.css=null,this.emit(`unmount`,{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager?this.commandManager.chain():qc.createFakeChain()}can(){return this.commandManager?this.commandManager.can():qc.createFallbackCan()}injectCSS(){this.options.injectCSS&&typeof document<`u`&&(this.css=Tf(Cp,this.options.injectNonce))}setOptions(e={}){this.options={...this.options,...e},this.editorView&&this.state&&!this.isDestroyed&&(this.options.editorProps&&this.view.setProps({...this.options.editorProps,attributes:this.getEditorViewAttributes()}),this.view.updateState(this.state))}setEditable(e,t=!0){this.setOptions({editable:e}),t&&this.emit(`update`,{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:e=>{this.editorState=e},dispatch:e=>{this.dispatchTransaction(e)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(e,t)=>{if(this.editorView)return this.editorView[t];if(t===`state`)return this.editorState;if(t in e)return Reflect.get(e,t);throw Error(`[tiptap error]: The editor view is not available. Cannot access view['${t}']. The editor may not be mounted yet.`)}})}get state(){return nf&&!this.hasWarnedStaleDecorationRead&&ef(this)&&(this.hasWarnedStaleDecorationRead=!0,console.warn("[tiptap warn]: `editor.state` was read while decoration `create()` was running. It returns the pre-transaction document. Use the `state` argument passed to `create()` instead. Helpers like `editor.isActive()` read `editor.state` too, so pass `state` to their standalone versions instead of calling them on the editor.")),this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(e,t){let n=Du(t)?t(e,[...this.state.plugins]):[...this.state.plugins,e],r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}unregisterPlugin(e){if(this.isDestroyed)return;let t=this.state.plugins,n=t;if([].concat(e).forEach(e=>{let t=typeof e==`string`?`${e}$`:e.key;n=n.filter(e=>!e.key.startsWith(t))}),t.length===n.length)return;let r=this.state.reconfigure({plugins:n});return this.view.updateState(r),r}createExtensionManager(){var e,t;let n=[...this.options.enableCoreExtensions?[fp,cp.configure({blockSeparator:(e=this.options.coreExtensionOptions)==null||(e=e.clipboardTextSerializer)==null?void 0:e.blockSeparator}),lp,mp,gp,vp.configure({value:(t=this.options.coreExtensionOptions)==null||(t=t.tabindex)==null?void 0:t.value}),dp,_p,up,yp.configure({direction:this.options.textDirection})].filter(e=>typeof this.options.enableCoreExtensions!=`object`||this.options.enableCoreExtensions[e.name]!==!1):[],...this.options.extensions].filter(e=>[`extension`,`node`,`mark`].includes(e?.type));this.extensionManager=new sp(n,this)}createCommandManager(){this.commandManager=new qc({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let e;try{e=cu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||![`[tiptap error]: Invalid JSON content`,`[tiptap error]: Invalid HTML content`].includes(e.message))throw e;let t=cu(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1});return this.editorState=Bn.create({doc:t,schema:this.schema,selection:yl(t,this.options.autofocus)||void 0}),this.emit(`contentError`,{editor:this,error:e,disableCollaboration:()=>{`collaboration`in this.storage&&typeof this.storage.collaboration==`object`&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(e=>e.name!==`collaboration`),this.createExtensionManager()}}),this.editorState.doc}return e}getEditorViewAttributes(){let e=this.options.editorProps?.attributes;return Du(e)?t=>({role:`textbox`,...e(t)}):{role:`textbox`,...e}}createView(e){let{editorProps:t,enableExtensionDispatchTransaction:n}=this.options,r=t.dispatchTransaction||this.dispatchTransaction.bind(this),i=n?this.extensionManager.dispatchTransaction(r):r,a=t.transformPastedHTML,o=this.extensionManager.transformPastedHTML(a);this.editorView=new $s(e,{...t,attributes:this.getEditorViewAttributes(),dispatchTransaction:i,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});let s=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(s),this.prependClass(),this.injectCSS();let c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(e){this.isCapturingTransaction=!0,e(),this.isCapturingTransaction=!1;let t=this.capturedTransaction;return this.capturedTransaction=null,t}dispatchTransaction(e){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=e;return}e.steps.forEach(e=>this.capturedTransaction?.step(e));return}let{state:t,transactions:n}=this.state.applyTransaction(e),r=!this.state.selection.eq(t.selection),i=n.includes(e),a=this.state;if(this.emit(`beforeTransaction`,{editor:this,transaction:e,nextState:t}),!i)return;this.view.updateState(t),this.emit(`transaction`,{editor:this,transaction:e,appendedTransactions:n.slice(1)}),r&&this.emit(`selectionUpdate`,{editor:this,transaction:e});let o=n.findLast(e=>e.getMeta(`focus`)||e.getMeta(`blur`)),s=o?.getMeta(`focus`),c=o?.getMeta(`blur`);s&&this.emit(`focus`,{editor:this,event:s.event,transaction:o}),c&&this.emit(`blur`,{editor:this,event:c.event,transaction:o}),e.getMeta(`preventUpdate`)||!n.some(e=>e.docChanged)||a.doc.eq(t.doc)||this.emit(`update`,{editor:this,transaction:e,appendedTransactions:n.slice(1)})}getAttributes(e){return Ku(this.state,e)}isActive(e,t){let n=typeof e==`string`?e:null,r=typeof e==`string`?t:e;return rd(this.state,n,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return gu(this.state.doc.content,this.schema)}getText(e){let{blockSeparator:t=`
95
95
 
96
- `,textSerializers:n={}}=e||{};return Uu(this.state.doc,{blockSeparator:t,textSerializers:{...Wu(this.schema),...n}})}get isEmpty(){return cd(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Sp(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Tp(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=V(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Xu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Ep(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=V(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);e>s?e=s:s=e+r[1].length;let t=r[0][r[0].length-1];a.insertText(t,o+r[0].length-1),a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Dp(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=V(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Op(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=V(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&It(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Jt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var W=class e extends $f{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function kp(e){return new tp({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=V(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Xu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:Ap,getOwnPropertySymbols:jp}=Object,{hasOwnProperty:Mp}=Object.prototype;function Np(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Pp(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Fp(e){return e?.[Symbol.toStringTag]}function Ip(e){return Ap(e).concat(jp(e))}var Lp=Object.hasOwn||((e,t)=>Mp.call(e,t));function Rp(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var zp=`__v`,Bp=`__o`,Vp=`_owner`,{getOwnPropertyDescriptor:Hp,keys:Up}=Object,Wp=Hp(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Gp(e,t){return e.byteLength===t.byteLength&&im(new Uint8Array(e),new Uint8Array(t))}function Kp(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function qp(e,t){return e.byteLength===t.byteLength&&im(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Jp(e,t){return Rp(e.getTime(),t.getTime())}function Yp(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,`cause`,`cause`,e,t,n)}function Xp(e,t){return e===t}function Zp(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Qp=Rp;function $p(e,t,n){let r=Up(e),i=r.length;if(Up(t).length!==i)return!1;for(;i-->0;)if(!cm(e,t,n,r[i]))return!1;return!0}function em(e,t,n){let r=Ip(e),i=r.length;if(Ip(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!cm(e,t,n,a)||(o=Hp(e,a),s=Hp(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function tm(e,t){return Rp(e.valueOf(),t.valueOf())}function nm(e,t){return e.source===t.source&&e.flags===t.flags}function rm(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function im(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;let r=Wp.call(e);if(r===`Float64Array`||r===`Float32Array`||r===`Float16Array`){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function am(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&om(e.searchParams,t.searchParams)}function om(e,t){let n=e.toString(),r=t.toString();return n===r||sm(n)===sm(r)}function sm(e){return e.split(`&`).sort().join(`&`)}function cm(e,t,n,r){return(r===Vp||r===Bp||r===zp)&&(e.$$typeof||t.$$typeof)?!0:Lp(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var lm=`[object ArrayBuffer]`,um=`[object Arguments]`,dm=`[object Boolean]`,fm=`[object DataView]`,pm=`[object Date]`,mm=`[object Error]`,hm=`[object Map]`,gm=`[object Number]`,_m=`[object Object]`,vm=`[object RegExp]`,ym=`[object Set]`,bm=`[object String]`,xm={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Sm=`[object URL]`,Cm=Object.prototype.toString;function wm({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=Cm.call(h);if(b===pm)return r(h,g,_);if(b===vm)return u(h,g,_);if(b===hm)return o(h,g,_);if(b===ym)return d(h,g,_);if(b===_m)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Sm)return p(h,g,_);if(b===mm)return i(h,g,_);if(b===um)return c(h,g,_);if(xm[b])return f(h,g,_);if(b===lm)return e(h,g,_);if(b===fm)return n(h,g,_);if(b===dm||b===gm||b===bm)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Fp(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Tm({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Gp,areArraysEqual:n?em:Kp,areDataViewsEqual:qp,areDatesEqual:Jp,areErrorsEqual:n?Np(Yp,em):Np(Yp,$p),areFunctionsEqual:Xp,areMapsEqual:n?Np(Zp,em):Zp,areNumbersEqual:Qp,areObjectsEqual:n?em:$p,arePrimitiveWrappersEqual:tm,areRegExpsEqual:nm,areSetsEqual:n?Np(rm,em):rm,areTypedArraysEqual:n?Np(im,em):im,areUrlsEqual:am,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Pp(r.areArraysEqual),t=Pp(r.areErrorsEqual),n=Pp(r.areMapsEqual),i=Pp(r.areObjectsEqual),a=Pp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function Em(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Dm({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}km(),km({strict:!0});var Om=km({circular:!0});km({circular:!0,strict:!0}),km({createInternalComparator:()=>Rp}),km({strict:!0,createInternalComparator:()=>Rp}),km({circular:!0,createInternalComparator:()=>Rp}),km({circular:!0,createInternalComparator:()=>Rp,strict:!0});function km(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=wm(Tm(e));return Dm({circular:t,comparator:a,createState:r,equals:n?n(a):Em(a),strict:i})}var Am=t((e=>{var t=n(),r=Gn();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),jm=t(((e,t)=>{t.exports=Am()}))();function Mm(e,t){if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!==`insertParagraph`&&t.inputType!==`insertLineBreak`||!xl()&&!bl())return;let n=e.view,r=n.root,i=(r.getSelection?.call(r)??n.dom.ownerDocument.getSelection())?.anchorNode,a=(i?.nodeType===1?i:i?.parentElement)?.closest(`[data-node-view-content-react]`);if(!a||!n.dom.contains(a))return;let o=n.input.lastKeyCode;o===13&&(n.input.lastKeyCode=null),n.domObserver.forceFlush(),n.domObserver.flush();let s=new KeyboardEvent(`keydown`,{key:`Enter`,code:`Enter`,keyCode:13,shiftKey:t.inputType===`insertLineBreak`,bubbles:!0,cancelable:!0});n.someProp(`handleKeyDown`,e=>e(n,s))?(t.preventDefault(),n.input.lastIOSEnter=0,clearTimeout(n.input.lastIOSEnterFallbackTimeout)):o===13&&(n.input.lastKeyCode=o)}var Nm=new O(`reactMobileEnter`),Pm=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Fm=({contentComponent:e})=>{let t=(0,qn.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Br.jsx)(Br.Fragment,{children:Object.values(t)})};function Im(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:Kn.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var Lm=class extends k.Component{constructor(e){super(e),this.editorContentRef=k.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.view.updateRoot(),e.setOptions({element:t}),e.contentComponent=Im(),e.createNodeViews(),e.registerPlugin(new D({key:Nm,props:{handleDOMEvents:{beforeinput:(t,n)=>Mm(e,n)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(Nm),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Br.jsxs)(Br.Fragment,{children:[(0,Br.jsx)(`div`,{ref:Pm(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Br.jsx)(Fm,{contentComponent:e.contentComponent})]})}},Rm=(0,k.forwardRef)((e,t)=>{let n=k.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return k.createElement(Lm,{key:n,innerRef:t,...e})}),zm=k.memo(Rm),Bm=typeof window<`u`?k.useLayoutEffect:k.useEffect,Vm=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{(t?.transaction===void 0||t.transaction!==e)&&(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function Hm(e){let[t]=(0,k.useState)(()=>new Vm(e.editor)),n=(0,jm.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Om);return Bm(()=>t.watch(e.editor),[e.editor,t]),(0,k.useDebugValue)(n),n}var Um=typeof window>`u`,Wm=Um||!!(typeof window<`u`&&window.next),Gm=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(Um||Wm&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new wp({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Km(e={},t=[]){let n=(0,k.useRef)(e);n.current=e;let[r]=(0,k.useState)(()=>new Gm(n)),i=(0,qn.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,k.useDebugValue)(i),(0,k.useEffect)(r.onRender(t)),Hm({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var qm=(0,k.createContext)({editor:null});qm.Consumer;var Jm=(0,k.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ym=()=>(0,k.useContext)(Jm);k.forwardRef((e,t)=>{let{onDragStart:n}=Ym(),r=e.as||`div`;return(0,Br.jsx)(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),k.createContext({markViewContentRef:()=>{}});var Xm=(0,k.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Xm.displayName=`TiptapContext`;var Zm=()=>(0,k.useContext)(Xm);function Qm({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,k.useMemo)(()=>({editor:n}),[n]),i=(0,k.useMemo)(()=>({editor:n}),[n]);return(0,Br.jsx)(qm.Provider,{value:i,children:(0,Br.jsx)(Xm.Provider,{value:r,children:e})})}Qm.displayName=`Tiptap`;function $m({...e}){let{editor:t}=Zm();return(0,Br.jsx)(zm,{editor:t,...e})}$m.displayName=`Tiptap.Content`,Object.assign(Qm,{Content:$m});var eh=new WeakSet,th=new WeakSet;function nh(e){let t=e;return eh.add(t),t}function rh(e){return Array.isArray(e)&&eh.has(e)}function ih(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&th.has(e)&&!rh(e)?ih(e):[e])}function ah(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!rh(n)&&!th.has(n)?nh(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(rh(n))return nh([e,r,n]);if(n.length===0)return nh([e,r]);let t=ih(n);return t.length===0?nh([e,r]):nh([e,r,...t])}return nh(n==null?[e,r]:[e,r,n])}var oh=(e,t)=>ah(e,t),sh=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new g(n,0,0);return e.replace(l,i.after(),r),e.setSelection(T.create(e.doc,l)),e.scrollIntoView(),t(e),!0})},ch=/^\s*>\s$/,lh=W.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return oh(`blockquote`,{...H(this.options.HTMLAttributes,e),children:oh(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
96
+ `,textSerializers:n={}}=e||{};return Uu(this.state.doc,{blockSeparator:t,textSerializers:{...Wu(this.schema),...n}})}get isEmpty(){return cd(this.state.doc)}destroy(){this.destroyed||(this.destroyed=!0,this.emit(`destroy`),this.unmount(),this.removeAllListeners(),this.extensionManager.destroy(),this.extensionManager=null,this.schema=null,this.commandManager=null,this.extensionStorage={})}get isDestroyed(){return this.editorView?.isDestroyed??!0}$node(e,t){return this.$doc?.querySelector(e,t)||null}$nodes(e,t){return this.$doc?.querySelectorAll(e,t)||null}$pos(e){let t=this.state.doc.resolve(e),n=e>0&&t.nodeAfter&&!t.nodeAfter.isText&&t.nodeAfter.isAtom?t.nodeAfter:null;return new Sp(t,this,!1,n)}get $doc(){return this.$pos(0)}};function Tp(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=V(e.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:a}=t,o=r[r.length-1],s=r[0];if(o){let r=s.search(/\S/),c=n.from+s.indexOf(o),l=c+o.length;if(Xu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>c).length)return null;l<n.to&&a.delete(l,n.to),c>n.from&&a.delete(n.from+r,c);let u=n.from+r+o.length;a.addMark(n.from+r,u,e.type.create(i||{})),a.removeStoredMark(e.type)}},undoable:e.undoable})}function Ep(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=V(e.getAttributes,void 0,r)||{},{tr:a}=t,o=n.from,s=n.to,c=e.type.create(i);if(r[1]){let e=o+r[0].lastIndexOf(r[1]);if(e>s?e=s:s=e+r[1].length,n.to-n.from<r[0].length){let e=r[0][r[0].length-1];a.insertText(e,o+r[0].length-1)}a.replaceWith(e,s,c)}else if(r[0]){let t=e.type.isInline?o:o-1;a.insert(t,e.type.create(i)).delete(a.mapping.map(o),a.mapping.map(s))}a.scrollIntoView()},undoable:e.undoable})}function Dp(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r})=>{let i=t.doc.resolve(n.from),a=V(e.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),e.type))return null;t.tr.delete(n.from,n.to).setBlockType(n.from,n.from,e.type,a)},undoable:e.undoable})}function Op(e){return new Kf({find:e.find,handler:({state:t,range:n,match:r,chain:i})=>{let a=V(e.getAttributes,void 0,r)||{},o=t.tr.delete(n.from,n.to),s=o.doc.resolve(n.from).blockRange(),c=s&&It(s,e.type,a);if(!c)return null;if(o.wrap(s,c),e.keepMarks&&e.editor){let{selection:n,storedMarks:r}=t,{splittableMarks:i}=e.editor.extensionManager,a=r||n.$to.parentOffset&&n.$from.marks();if(a){let e=a.filter(e=>i.includes(e.type.name));o.ensureMarks(e)}}if(e.keepAttributes){let t=e.type.name===`bulletList`||e.type.name===`orderedList`?`listItem`:`taskList`;i().updateAttributes(t,a).run()}let l=o.doc.resolve(n.from-1).nodeBefore;l&&l.type===e.type&&Jt(o.doc,n.from-1)&&(!e.joinPredicate||e.joinPredicate(r,l))&&o.join(n.from-1)},undoable:e.undoable})}var W=class e extends $f{constructor(...e){super(...e),this.type=`node`}static create(t={}){let n=typeof t==`function`?t():t;return new e(n)}configure(e){return super.configure(e)}extend(e){let t=typeof e==`function`?e():e;return super.extend(t)}};function kp(e){return new tp({find:e.find,handler:({state:t,range:n,match:r,pasteEvent:i})=>{let a=V(e.getAttributes,void 0,r,i);if(a===!1||a===null)return null;let{tr:o}=t,s=r[r.length-1],c=r[0],l=n.to;if(s){let i=c.search(/\S/),u=n.from+c.indexOf(s),d=u+s.length;if(Xu(n.from,n.to,t.doc).filter(t=>t.mark.type.excluded.find(n=>n===e.type&&n!==t.mark.type)).filter(e=>e.to>u).length)return null;d<n.to&&o.delete(d,n.to),u>n.from&&o.delete(n.from+i,u),l=n.from+i+s.length,o.addMark(n.from+i,l,e.type.create(a||{})),r.index!==void 0&&r.input!==void 0&&r.index+r[0].length>=r.input.length||o.removeStoredMark(e.type)}}})}var{getOwnPropertyNames:Ap,getOwnPropertySymbols:jp}=Object,{hasOwnProperty:Mp}=Object.prototype;function Np(e,t){return function(n,r,i){return e(n,r,i)&&t(n,r,i)}}function Pp(e){return function(t,n,r){if(!t||!n||typeof t!=`object`||typeof n!=`object`)return e(t,n,r);let{cache:i}=r,a=i.get(t),o=i.get(n);if(a&&o)return a===n&&o===t;i.set(t,n),i.set(n,t);let s=e(t,n,r);return i.delete(t),i.delete(n),s}}function Fp(e){return e?.[Symbol.toStringTag]}function Ip(e){return Ap(e).concat(jp(e))}var Lp=Object.hasOwn||((e,t)=>Mp.call(e,t));function Rp(e,t){return e===t||!e&&!t&&e!==e&&t!==t}var zp=`__v`,Bp=`__o`,Vp=`_owner`,{getOwnPropertyDescriptor:Hp,keys:Up}=Object,Wp=Hp(Object.getPrototypeOf(Int8Array.prototype),Symbol.toStringTag).get;function Gp(e,t){return e.byteLength===t.byteLength&&im(new Uint8Array(e),new Uint8Array(t))}function Kp(e,t,n){let r=e.length;if(t.length!==r)return!1;for(;r-->0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function qp(e,t){return e.byteLength===t.byteLength&&im(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}function Jp(e,t){return Rp(e.getTime(),t.getTime())}function Yp(e,t,n){return e.name===t.name&&e.message===t.message&&e.stack===t.stack&&n.equals(e.cause,t.cause,`cause`,`cause`,e,t,n)}function Xp(e,t){return e===t}function Zp(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.entries(),o,s,c=0;for(;(o=a.next())&&!o.done;){let r=t.entries(),a=!1,l=0;for(;(s=r.next())&&!s.done;){if(i[l]){l++;continue}let r=o.value,u=s.value;if(n.equals(r[0],u[0],c,l,e,t,n)&&n.equals(r[1],u[1],r[0],u[0],e,t,n)){a=i[l]=!0;break}l++}if(!a)return!1;c++}return!0}var Qp=Rp;function $p(e,t,n){let r=Up(e),i=r.length;if(Up(t).length!==i)return!1;for(;i-->0;)if(!cm(e,t,n,r[i]))return!1;return!0}function em(e,t,n){let r=Ip(e),i=r.length;if(Ip(t).length!==i)return!1;let a,o,s;for(;i-->0;)if(a=r[i],!cm(e,t,n,a)||(o=Hp(e,a),s=Hp(t,a),(o||s)&&(!o||!s||o.configurable!==s.configurable||o.enumerable!==s.enumerable||o.writable!==s.writable)))return!1;return!0}function tm(e,t){return Rp(e.valueOf(),t.valueOf())}function nm(e,t){return e.source===t.source&&e.flags===t.flags}function rm(e,t,n){let r=e.size;if(r!==t.size)return!1;if(!r)return!0;let i=Array(r),a=e.values(),o,s;for(;(o=a.next())&&!o.done;){let r=t.values(),a=!1,c=0;for(;(s=r.next())&&!s.done;){if(!i[c]&&n.equals(o.value,s.value,o.value,s.value,e,t,n)){a=i[c]=!0;break}c++}if(!a)return!1}return!0}function im(e,t){let n=e.length;if(t.length!==n||e.byteOffset!==t.byteOffset)return!1;let r=Wp.call(e);if(r===`Float64Array`||r===`Float32Array`||r===`Float16Array`){for(;n-->0;)if(e[n]!==t[n]&&(e[n]===e[n]||t[n]===t[n]))return!1;return!0}for(;n-->0;)if(e[n]!==t[n])return!1;return!0}function am(e,t){return e.href===t.href||e.protocol===t.protocol&&e.username===t.username&&e.password===t.password&&e.host===t.host&&e.pathname===t.pathname&&e.hash===t.hash&&om(e.searchParams,t.searchParams)}function om(e,t){let n=e.toString(),r=t.toString();return n===r||sm(n)===sm(r)}function sm(e){return e.split(`&`).sort().join(`&`)}function cm(e,t,n,r){return(r===Vp||r===Bp||r===zp)&&(e.$$typeof||t.$$typeof)?!0:Lp(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var lm=`[object ArrayBuffer]`,um=`[object Arguments]`,dm=`[object Boolean]`,fm=`[object DataView]`,pm=`[object Date]`,mm=`[object Error]`,hm=`[object Map]`,gm=`[object Number]`,_m=`[object Object]`,vm=`[object RegExp]`,ym=`[object Set]`,bm=`[object String]`,xm={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},Sm=`[object URL]`,Cm=Object.prototype.toString;function wm({areArrayBuffersEqual:e,areArraysEqual:t,areDataViewsEqual:n,areDatesEqual:r,areErrorsEqual:i,areFunctionsEqual:a,areMapsEqual:o,areNumbersEqual:s,areObjectsEqual:c,arePrimitiveWrappersEqual:l,areRegExpsEqual:u,areSetsEqual:d,areTypedArraysEqual:f,areUrlsEqual:p,unknownTagComparators:m}){return function(h,g,_){if(h===g)return!0;if(h==null||g==null)return!1;let v=typeof h;if(v!==typeof g)return!1;if(v!==`object`)return v===`number`?s(h,g,_):v===`function`&&a(h,g,_);let y=h.constructor;if(y!==g.constructor)return!1;if(y===Object)return c(h,g,_);if(Array.isArray(h))return t(h,g,_);if(y===Date)return r(h,g,_);if(y===RegExp)return u(h,g,_);if(y===Map)return o(h,g,_);if(y===Set)return d(h,g,_);if(y==null)return c(h,g,_);let b=Cm.call(h);if(b===pm)return r(h,g,_);if(b===vm)return u(h,g,_);if(b===hm)return o(h,g,_);if(b===ym)return d(h,g,_);if(b===_m)return typeof h.then!=`function`&&typeof g.then!=`function`&&c(h,g,_);if(b===Sm)return p(h,g,_);if(b===mm)return i(h,g,_);if(b===um)return c(h,g,_);if(xm[b])return f(h,g,_);if(b===lm)return e(h,g,_);if(b===fm)return n(h,g,_);if(b===dm||b===gm||b===bm)return l(h,g,_);if(m){let e=m[b];if(!e){let t=Fp(h);t&&(e=m[t])}if(e)return e(h,g,_)}return!1}}function Tm({circular:e,createCustomConfig:t,strict:n}){let r={areArrayBuffersEqual:Gp,areArraysEqual:n?em:Kp,areDataViewsEqual:qp,areDatesEqual:Jp,areErrorsEqual:n?Np(Yp,em):Np(Yp,$p),areFunctionsEqual:Xp,areMapsEqual:n?Np(Zp,em):Zp,areNumbersEqual:Qp,areObjectsEqual:n?em:$p,arePrimitiveWrappersEqual:tm,areRegExpsEqual:nm,areSetsEqual:n?Np(rm,em):rm,areTypedArraysEqual:n?Np(im,em):im,areUrlsEqual:am,unknownTagComparators:void 0};if(t&&(r=Object.assign({},r,t(r))),e){let e=Pp(r.areArraysEqual),t=Pp(r.areErrorsEqual),n=Pp(r.areMapsEqual),i=Pp(r.areObjectsEqual),a=Pp(r.areSetsEqual);r=Object.assign({},r,{areArraysEqual:e,areErrorsEqual:t,areMapsEqual:n,areObjectsEqual:i,areSetsEqual:a})}return r}function Em(e){return function(t,n,r,i,a,o,s){return e(t,n,s)}}function Dm({circular:e,comparator:t,createState:n,equals:r,strict:i}){if(n)return function(a,o){let{cache:s=e?new WeakMap:void 0,meta:c}=n();return t(a,o,{cache:s,equals:r,meta:c,strict:i})};if(e)return function(e,n){return t(e,n,{cache:new WeakMap,equals:r,meta:void 0,strict:i})};let a={cache:void 0,equals:r,meta:void 0,strict:i};return function(e,n){return t(e,n,a)}}km(),km({strict:!0});var Om=km({circular:!0});km({circular:!0,strict:!0}),km({createInternalComparator:()=>Rp}),km({strict:!0,createInternalComparator:()=>Rp}),km({circular:!0,createInternalComparator:()=>Rp}),km({circular:!0,createInternalComparator:()=>Rp,strict:!0});function km(e={}){let{circular:t=!1,createInternalComparator:n,createState:r,strict:i=!1}=e,a=wm(Tm(e));return Dm({circular:t,comparator:a,createState:r,equals:n?n(a):Em(a),strict:i})}var Am=t((e=>{var t=n(),r=Gn();function i(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var a=typeof Object.is==`function`?Object.is:i,o=r.useSyncExternalStore,s=t.useRef,c=t.useEffect,l=t.useMemo,u=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=s(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=l(function(){function e(e){if(!o){if(o=!0,s=e,e=r(e),i!==void 0&&f.hasValue){var t=f.value;if(i(t,e))return c=t}return c=e}if(t=c,a(s,e))return t;var n=r(e);return i!==void 0&&i(t,n)?(s=e,t):(s=e,c=n)}var o=!1,s,c,l=n===void 0?null:n;return[function(){return e(t())},l===null?void 0:function(){return e(l())}]},[t,n,r,i]);var p=o(e,d[0],d[1]);return c(function(){f.hasValue=!0,f.value=p},[p]),u(p),p}})),jm=t(((e,t)=>{t.exports=Am()}))();function Mm(e,t){if(e.isDestroyed||t.defaultPrevented||!t.cancelable||!e.isEditable||t.inputType!==`insertParagraph`&&t.inputType!==`insertLineBreak`||!xl()&&!bl())return;let n=e.view,r=n.root,i=(r.getSelection?.call(r)??n.dom.ownerDocument.getSelection())?.anchorNode,a=(i?.nodeType===1?i:i?.parentElement)?.closest(`[data-node-view-content-react]`);if(!a||!n.dom.contains(a))return;let o=n.input.lastKeyCode;o===13&&(n.input.lastKeyCode=null),n.domObserver.forceFlush(),n.domObserver.flush();let s=new KeyboardEvent(`keydown`,{key:`Enter`,code:`Enter`,keyCode:13,shiftKey:t.inputType===`insertLineBreak`,bubbles:!0,cancelable:!0});n.someProp(`handleKeyDown`,e=>e(n,s))?(t.preventDefault(),n.input.lastIOSEnter=0,clearTimeout(n.input.lastIOSEnterFallbackTimeout)):o===13&&(n.input.lastKeyCode=o)}var Nm=new O(`reactMobileEnter`),Pm=(...e)=>t=>{e.forEach(e=>{typeof e==`function`?e(t):e&&(e.current=t)})},Fm=({contentComponent:e})=>{let t=(0,qn.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getServerSnapshot);return(0,Br.jsx)(Br.Fragment,{children:Object.values(t)})};function Im(){let e=new Set,t={},n=!1,r=()=>{!n&&e.size&&(n=!0,queueMicrotask(()=>{n=!1,e.forEach(e=>e())}))};return{subscribe(t){return e.add(t),()=>{e.delete(t)}},getSnapshot(){return t},getServerSnapshot(){return t},setRenderer(e,n){t={...t,[e]:Kn.createPortal(n.reactElement,n.element,e)},r()},removeRenderer(e){let n={...t};delete n[e],t=n,r()}}}var Lm=class extends k.Component{constructor(e){super(e),this.editorContentRef=k.createRef()}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){let e=this.props.editor;if(e&&!e.isDestroyed&&e.view.dom?.parentNode){if(e.contentComponent)return;let t=this.editorContentRef.current;t.append(...e.view.dom.parentNode.childNodes),e.view.updateRoot(),e.setOptions({element:t}),e.contentComponent=Im(),e.createNodeViews(),e.registerPlugin(new D({key:Nm,props:{handleDOMEvents:{beforeinput:(t,n)=>Mm(e,n)}}})),e.isEditorContentInitialized=!0,this.forceUpdate()}}componentWillUnmount(){let e=this.props.editor;if(e){e.isEditorContentInitialized=!1,e.isDestroyed||(e.unregisterPlugin(Nm),e.view.setProps({nodeViews:{}})),e.contentComponent=null;try{if(!e.view.dom?.parentNode)return;let t=document.createElement(`div`);t.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:t})}catch{}}}render(){let{editor:e,innerRef:t,...n}=this.props;return(0,Br.jsxs)(Br.Fragment,{children:[(0,Br.jsx)(`div`,{ref:Pm(t,this.editorContentRef),...n}),e?.contentComponent&&(0,Br.jsx)(Fm,{contentComponent:e.contentComponent})]})}},Rm=(0,k.forwardRef)((e,t)=>{let n=k.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[e.editor]);return k.createElement(Lm,{key:n,innerRef:t,...e})}),zm=k.memo(Rm),Bm=typeof window<`u`?k.useLayoutEffect:k.useEffect,Vm=class{constructor(e){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=e,this.lastSnapshot={editor:e,transactionNumber:0},this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber||(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber}),this.lastSnapshot}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(e){return this.subscribers.add(e),()=>{this.subscribers.delete(e)}}watch(e){if(this.editor=e,this.editor){let e,t=t=>{(t?.transaction===void 0||t.transaction!==e)&&(e=t?.transaction,this.transactionNumber+=1,this.subscribers.forEach(e=>e()))},n=this.editor;return n.on(`transaction`,t),n.on(`update`,t),()=>{n.off(`transaction`,t),n.off(`update`,t)}}}};function Hm(e){let[t]=(0,k.useState)(()=>new Vm(e.editor)),n=(0,jm.useSyncExternalStoreWithSelector)(t.subscribe,t.getSnapshot,t.getServerSnapshot,e.selector,e.equalityFn??Om);return Bm(()=>t.watch(e.editor),[e.editor,t]),(0,k.useDebugValue)(n),n}var Um=typeof window>`u`,Wm=Um||!!(typeof window<`u`&&window.next),Gm=class e{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId=``,this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(e=>e())}getInitialEditor(){let e=this.options.current.immediatelyRender,t=e??!0;return(Um||Wm&&e===void 0)&&(t=!1),t?this.createEditor():null}createEditor(){return new wp({...this.options.current,onBeforeCreate:(...e)=>{var t;return(t=this.options.current).onBeforeCreate?.call(t,...e)},onBlur:(...e)=>{var t;return(t=this.options.current).onBlur?.call(t,...e)},onCreate:(...e)=>{var t;return(t=this.options.current).onCreate?.call(t,...e)},onDestroy:(...e)=>{var t;return(t=this.options.current).onDestroy?.call(t,...e)},onFocus:(...e)=>{var t;return(t=this.options.current).onFocus?.call(t,...e)},onSelectionUpdate:(...e)=>{var t;return(t=this.options.current).onSelectionUpdate?.call(t,...e)},onTransaction:(...e)=>{var t;return(t=this.options.current).onTransaction?.call(t,...e)},onUpdate:(...e)=>{var t;return(t=this.options.current).onUpdate?.call(t,...e)},onContentError:(...e)=>{var t;return(t=this.options.current).onContentError?.call(t,...e)},onDrop:(...e)=>{var t;return(t=this.options.current).onDrop?.call(t,...e)},onPaste:(...e)=>{var t;return(t=this.options.current).onPaste?.call(t,...e)},onDelete:(...e)=>{var t;return(t=this.options.current).onDelete?.call(t,...e)},onMount:(...e)=>{var t;return(t=this.options.current).onMount?.call(t,...e)},onUnmount:(...e)=>{var t;return(t=this.options.current).onUnmount?.call(t,...e)}})}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,t){return Object.keys(e).every(n=>[`onCreate`,`onBeforeCreate`,`onDestroy`,`onUpdate`,`onTransaction`,`onFocus`,`onBlur`,`onSelectionUpdate`,`onContentError`,`onDrop`,`onPaste`].includes(n)?!0:n===`extensions`&&e.extensions&&t.extensions?e.extensions.length===t.extensions.length&&e.extensions.every((e,n)=>e===t.extensions?.[n]):e[n]===t[n])}onRender(t){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&t.length===0?e.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}):this.refreshEditorInstance(t),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((t,n)=>t===e[n]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){let e=this.instanceId,t=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{this.isComponentMounted&&this.instanceId===e?t&&t.setOptions(this.options.current):t&&!t.isDestroyed&&(t.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function Km(e={},t=[]){let n=(0,k.useRef)(e);n.current=e;let[r]=(0,k.useState)(()=>new Gm(n)),i=(0,qn.useSyncExternalStore)(r.subscribe,r.getEditor,r.getServerSnapshot);return(0,k.useDebugValue)(i),(0,k.useEffect)(r.onRender(t)),Hm({editor:i,selector:({transactionNumber:t})=>e.shouldRerenderOnTransaction===!1||e.shouldRerenderOnTransaction===void 0?null:e.immediatelyRender&&t===0?0:t+1}),i}var qm=(0,k.createContext)({editor:null});qm.Consumer;var Jm=(0,k.createContext)({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),Ym=()=>(0,k.useContext)(Jm);k.forwardRef((e,t)=>{let{onDragStart:n}=Ym(),r=e.as||`div`;return(0,Br.jsx)(r,{...e,ref:t,"data-node-view-wrapper":``,onDragStart:n,style:{whiteSpace:`normal`,...e.style}})}),k.createContext({markViewContentRef:()=>{}});var Xm=(0,k.createContext)({get editor(){throw Error(`useTiptap must be used within a <Tiptap> provider`)}});Xm.displayName=`TiptapContext`;var Zm=()=>(0,k.useContext)(Xm);function Qm({children:e,...t}){let n=`editor`in t?t.editor:t.instance;if(!n)throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");let r=(0,k.useMemo)(()=>({editor:n}),[n]),i=(0,k.useMemo)(()=>({editor:n}),[n]);return(0,Br.jsx)(qm.Provider,{value:i,children:(0,Br.jsx)(Xm.Provider,{value:r,children:e})})}Qm.displayName=`Tiptap`;function $m({...e}){let{editor:t}=Zm();return(0,Br.jsx)(zm,{editor:t,...e})}$m.displayName=`Tiptap.Content`,Object.assign(Qm,{Content:$m});var eh=new WeakSet,th=new WeakSet;function nh(e){let t=e;return eh.add(t),t}function rh(e){return Array.isArray(e)&&eh.has(e)}function ih(e){return e.flatMap(e=>e==null?[]:Array.isArray(e)&&th.has(e)&&!rh(e)?ih(e):[e])}function ah(e,t){if(e===`slot`)return 0;if(e instanceof Function){let n=e(t);return Array.isArray(n)&&!rh(n)&&!th.has(n)?nh(n):n}let{children:n,...r}=t??{};if(e===`svg`)throw Error(`SVG elements are not supported in the JSX syntax, use the array syntax instead`);if(Array.isArray(n)){if(rh(n))return nh([e,r,n]);if(n.length===0)return nh([e,r]);let t=ih(n);return t.length===0?nh([e,r]):nh([e,r,...t])}return nh(n==null?[e,r]:[e,r,n])}var oh=(e,t)=>ah(e,t),sh=(e,t)=>{let{state:n}=e,{selection:r}=n;if(!r.empty)return!1;let{$from:i}=r;if(i.parentOffset!==0)return!1;let a=i.depth-1;if(a<0)return!1;let o=i.node(a),s=i.index(a);if(s===0)return!1;if(o.type===t)return e.commands.lift(t.name);let c=o.child(s-1);if(c.type!==t||!c.lastChild?.isTextblock)return!1;let l=i.before()-1-1;return e.commands.command(({tr:e,dispatch:t})=>{if(!t)return!0;let n=i.parent.content,r=new g(n,0,0);return e.replace(l,i.after(),r),e.setSelection(T.create(e.doc,l)),e.scrollIntoView(),t(e),!0})},ch=/^\s*>\s$/,lh=W.create({name:`blockquote`,addOptions(){return{HTMLAttributes:{}}},content:`block+`,group:`block`,defining:!0,parseHTML(){return[{tag:`blockquote`}]},renderHTML({HTMLAttributes:e}){return oh(`blockquote`,{...H(this.options.HTMLAttributes,e),children:oh(`slot`,{})})},parseMarkdown:(e,t)=>{let n=t.parseBlockChildren??t.parseChildren;return t.createNode(`blockquote`,void 0,n(e.tokens||[]))},renderMarkdown:(e,t)=>{if(!e.content)return``;let n=[];return e.content.forEach((e,r)=>{let i=(t.renderChild?.call(t,e,r)??t.renderChildren([e])).split(`
97
97
  `).map(e=>e.trim()===``?`>`:`> ${e}`);n.push(i.join(`
98
98
  `))}),n.join(`
99
99
  >