@avocadostudio-ai/cli 0.3.0 → 0.3.2

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.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PuckPrototypeRoute-DLvPOyWm.js","assets/PuckPrototypeRoute-JfYCb1Z5.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PuckPrototypeRoute-dMA7e2BV.js","assets/PuckPrototypeRoute-JfYCb1Z5.css"])))=>i.map(i=>d[i]);
2
2
  var zP=Object.defineProperty;var PP=(e,t,n)=>t in e?zP(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Se=(e,t,n)=>PP(e,typeof t!="symbol"?t+"":t,n);function LP(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const i in r)if(i!=="default"&&!(i in e)){const s=Object.getOwnPropertyDescriptor(r,i);s&&Object.defineProperty(e,i,s.get?s:{enumerable:!0,get:()=>r[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=n(i);fetch(i.href,s)}})();function fd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var k1={exports:{}},df={};/**
3
3
  * @license React
4
4
  * react-jsx-runtime.production.js
@@ -333,8 +333,8 @@ Error generating stack: `+g.message+`
333
333
  * This source code is licensed under the ISC license.
334
334
  * See the LICENSE file in the root directory of this source tree.
335
335
  */const $9=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]],j_=pt("zoom-in",$9),U9={"header.siteSettings":"Site settings","header.syncFromSite":"Pull from site","header.syncFromSiteTitle":"Pull latest content from this site's source","header.allSites":"All sites","header.page":"Page","header.language":"Language","header.pagesWithoutLanguage":"Not language-specific","header.viewAllSites":"View all sites","header.limited":"Limited","header.demoMode":"Demo mode","demo.bannerTitle":"You're in demo mode","demo.bannerBody":"This is a live playground. You can edit the Hero section with plain language — everything else is locked for now.","demo.tryExample1":'Change the hero headline to "Welcome to my new site"',"demo.tryExample2":"Make the hero subheading sound more playful","demo.tryExample3":'Update the hero CTA to "Get Started"',"demo.placeholder":"Try: change the hero headline to …","demoGuide.title":"Getting started","demoGuide.try":"Try it","demoGuide.dismiss":"Dismiss","demoGuide.step1Title":"Rewrite the hero heading & subheading","demoGuide.step1Prompt":"Rewrite the hero heading and subheading to be more compelling and benefit-driven","demoGuide.step2Title":"Add a stats band","demoGuide.step2Prompt":"Add a stats band below the hero with a few impressive numbers","demoGuide.step3Title":"Swap the hero image","demoGuide.step3Prompt":"Give the whole site a warm, earthy green color theme","demoGuide.step4Title":"Translate the page","demoGuide.step4Prompt":"Translate the whole page into German","header.moreOptions":"More options","header.publish":"Publish","header.publishing":"Publishing","header.unpublishedTooltip":"{{count}} unpublished change(s) since the last deploy.","header.viewDeploy":"View deploy","header.openLiveSite":"Open live site","header.openImmersive":"Open in immersive mode","header.syncedPage":"Pulled 1 page from site.","header.syncedPages":"Pulled {{count}} pages from site.","header.syncFailedNetwork":"Couldn't reach this site. Check that it's running and try again.","header.syncFailedEmpty":"This site has no source content to pull from.","tabs.chat":"Chat","tabs.properties":"Properties","stream.shapingUpdate":"Shaping your update...","stream.gettingReady":"Getting things ready...","stream.updating":"Updating...","stream.thinking":"Thinking","chat.thinking.streaming":"Thinking…","chat.thinking.doneSeconds":"Thought for {{seconds}}s","chat.thinking.done":"Thought process","chat.thinking.showMore":"Show thinking","chat.thinking.showLess":"Hide thinking","chat.expandDetails":"Expand details","chat.copied":"Copied","chat.copyDebug":"Copy debug bubble","chat.copy":"Copy","chat.undone":"Undone","chat.undo":"Undo","chat.appliedDraft":"Applied to your draft","chat.keep":"Keep","chat.revert":"Revert","chat.reverted":"Reverted","chat.kept":"Kept","chat.redo":"Redo","chat.undoTooltip":"Undo (Ctrl+Z)","chat.redoTooltip":"Redo (Ctrl+Y)","history.title":"Version History","history.loading":"Loading history...","history.empty":"No changes yet.","history.operation":"operation","history.operations":"operations","history.tooltip":"Version history","history.restore":"Revert to this","history.restoring":"Reverting...","history.current":"Current","history.showDetails":"Show details","history.hideDetails":"Hide details","history.version":"Version","history.page":"Page","history.changes":"Changes","history.publish":"Publish","history.deploying":"Deploying…","history.live":"Live","history.deployFailed":"Failed","history.viewDeploy":"View deploy","history.pagesPublished":"{{count}} pages","history.pagePublished":"1 page","history.pagesChanged":"{{changed}} of {{total}} pages changed","history.noContentChanges":"No content changes · {{count}} pages live","chat.goodResponse":"Good response","chat.badResponse":"Bad response","chat.feedbackThanks":"Thanks!","chat.feedbackNoted":"Noted","chat.feedbackPlaceholder":"What went wrong? (optional)","chat.feedbackSend":"Send","variation.title":"Choose a Variation","variation.close":"Close variation picker","variation.applying":"Applying...","variation.apply":'Apply "{{title}}"',"addBlock.title":"Add block","addBlock.close":"Close add block picker","addBlock.insertAbove":"Select block type to insert above the selected section.","addBlock.insertBelow":"Select block type to insert below the selected section.","addBlock.searchPlaceholder":"Search block types","resize.inputPanel":"Resize input panel","resize.chatPanel":"Resize chat panel","preview.title":"Live preview","preview.loading":"Loading preview…","settings.title":"Settings","settings.devTitle":"Developer mode","settings.developerMode":"Developer mode","settings.streaming":"Streaming","settings.nestedLabels":"Nested labels","settings.fieldDraftTelemetry":"Field draft telemetry","settings.darkMode":"Dark mode","settings.autoScrollTracking":"Follow generated content","settings.debugMode":"Debug mode","settings.model":"Model","settings.advanced":"Advanced","settings.clearChat":"Clear chat","settings.language":"Language","password.title":"Editor Access","password.placeholder":"Password","password.incorrect":"Incorrect password","password.checking":"Checking…","password.continue":"Continue","sites.title":"Sites","sites.subtitle":"Choose a site to edit.","sites.addSite":"Add site","sites.addSiteTitle":"Add Site","sites.close":"Close","sites.siteName":"Site name","sites.siteNamePlaceholder":"My Site","sites.previewUrl":"Preview URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Use visual editor (Puck)","sites.editorialBrief":"Editorial brief","sites.overview":"Overview","sites.tone":"Tone","sites.constraints":"Constraints","sites.templates":"Templates","sites.overviewPlaceholder":"What this site is for.","sites.tonePlaceholder":"How the writing should sound.","sites.constraintsPlaceholder":`Rules for content output.
336
- One per line.`,"sites.templateName":"Template name (e.g. Campaign Landing Page)","sites.templateDescription":"Describe the page structure: which sections, in what order, with what content focus.","sites.settings":"Settings","sites.openEditor":"Open editor","sites.deleteSite":"Delete","sites.confirmDelete":'Remove "{{name}}" from your site list?',"sites.confirmDeleteTitle":"Remove site","sites.confirmDeleteBody":'This removes "{{name}}" from your local site list. The site itself is not deleted.',"sites.switchingTo":"Switching to","sites.switchInFlight":"A chat request is still in progress. Switch sites anyway and discard it?","sites.allOffline":"No reachable sites","sites.allOfflineHint":'All sites in your list failed a quick reachability check. Toggle "Show offline sites" to see them, or check that the sites are running.',"sites.previewUrlOverride":"Overridden by ?previewUrl= in the current URL.","sites.orchestratorUrl":"Orchestrator URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Only for a site that runs the orchestrator itself (library mode). Leave empty to use the editor's own orchestrator.","sites.cancel":"Cancel","sites.create":"Create","sites.siteConfig":"Site Config","sites.general":"General","sites.media":"Media","sites.hosting":"Hosting","sites.brief":"Brief","sites.deploy":"Deploy","sites.coreSettings":"Core settings","sites.header":"Header","sites.siteHeaderName":"Site header name","sites.logoUrl":"Logo URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Page templates","sites.pageTemplatesHint":"Define reusable page structures. The AI will match templates by name or intent when creating pages.","sites.removeTemplate":"Remove","sites.addTemplate":"+ Add template","sites.preferredTone":"Preferred tone","sites.writingConstraints":"Writing constraints","sites.hostingPlaceholder":"Vercel production site","sites.vercelProjectId":"Vercel project ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel team ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel production URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel deploy hook URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google Drive folder ID","sites.googleDrivePlaceholder":"e.g. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Testing...","sites.test":"Test","sites.driveConnectedImages":"Connected (images found)","sites.driveConnectedEmpty":"Connected (folder empty)","sites.driveError":"Could not reach orchestrator","sites.cmsMedia":"CMS Media","sites.provider":"Provider","sites.none":"None","sites.spaceId":"Space ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery Token","sites.deliveryTokenPlaceholder":"Content Delivery API token","sites.projectId":"Project ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API Token","sites.apiTokenPlaceholder":"Read-only API token","sites.versionHistory":"Version History","sites.restoreDescription":"Restore a previous published snapshot into","sites.snapshotVersion":"Snapshot version","sites.loadingSnapshots":"Loading snapshots...","sites.restoring":"Restoring...","sites.restore":"Restore","sites.noSnapshots":"No snapshots available yet.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Pages","sites.snapshotHeading":"Heading","sites.snapshotDate":"Date","sites.checkingManifest":"Checking manifest...","sites.limitedEditing":"Limited editing","sites.editingReady":"Editing ready","sites.checking":"Checking...","chatInput.placeholder":"Ask anything","chatInput.listening":"Listening","chatInput.transcribing":"Transcribing...","chatInput.attachFile":"Attach file","chatInput.removeAttachment":"Remove attachment","chatInput.exitSelector":"Exit selector mode","chatInput.selectElement":"Select an element","chatInput.editingBlock":"Editing: {{block}}","chatInput.clearSelection":"Clear selection","chatInput.voiceActions":"Voice and send actions","chatInput.cancelVoice":"Cancel voice input","chatInput.sendRecorded":"Send recorded message","chatInput.startVoice":"Start voice input","chatInput.stopGeneration":"Stop generation","chatInput.sendMessage":"Send message","chatInput.speechUnsupported":"Speech input is not supported in this browser.","chatInput.noSpeechDetected":"No speech detected. Try recording again.","chatInput.micBlocked":"Microphone access is blocked. Please allow mic permissions and try again.","chatInput.unsupportedFile":"Only images and PDF files are supported.","chatInput.attachmentOnlyMessage":"Use the attached file(s).","chatInput.uploadFailed":"Upload failed. Please try again.","chatInput.transcribeFailed":"Failed to transcribe audio.","imagePicker.title":"Asset Manager","imagePicker.close":"Close","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Search media library…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Upload","imagePicker.generate":"Generate","imagePicker.searchDrive":"Search Drive images...","imagePicker.searchUnsplash":"Search Unsplash photos...","imagePicker.search":"Search...","imagePicker.refreshDrive":"Refresh from Drive","imagePicker.searching":"Searching...","imagePicker.typeToSearch":"Type to search Unsplash","imagePicker.noImages":"No images found","imagePicker.loadMore":"Load more","imagePicker.loading":"Loading...","imagePicker.uploadFromComputer":"Upload from computer","imagePicker.uploading":"Uploading...","imagePicker.chooseDifferent":"Choose different file","imagePicker.orPasteUrl":"or paste a URL","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Uploaded image","imagePicker.examplePrompt":"Make it warmer","imagePicker.editPrompt":"Describe how to change this image…","imagePicker.generatePrompt":"Describe the image you want…","imagePicker.followUpPrompt":"Ask for changes…","imagePicker.refine":"Refine","imagePicker.edit":"Edit","imagePicker.closePreview":"Close preview","imagePicker.ready":"Ready","imagePicker.editThisImage":"Edit this image","imagePicker.editThisImageDesc":"Describe changes to the current image","imagePicker.generateNew":"Generate new","imagePicker.generateNewDesc":"Create a completely new image from scratch","imagePicker.useImage":"Use image","imagePicker.applyUrl":"Apply URL","imagePicker.removeReference":"Remove reference","imagePicker.attachReference":"Attach example images for AI to reference (up to {{max}})","imagePicker.showOriginal":"Show original","imagePicker.showEdited":"Show edited","propertyPanel.loading":"Loading...","propertyPanel.loadFailed":"Failed to load block properties","propertyPanel.loadFailedMissing":"This block is not in the page the orchestrator returned","propertyPanel.loadFailedMissingHint":"The preview and the orchestrator may be pointed at different sites. Check the site's Orchestrator URL in its settings.","propertyPanel.loadFailedNoPage":"This page is not in the draft","propertyPanel.loadFailedNoPageHint":"The orchestrator answered, but it has no page at this address for this session — either the editor is on a page this draft does not have, or it is asking an orchestrator that does not host this site.","propertyPanel.loadFailedUnreachableHint":"Nothing answered at this address. Check that the orchestrator is running.","propertyPanel.retry":"Try again","orchestratorMismatch.title":"You are editing another site's content","orchestratorMismatch.detail":"{{orchestrator}} does not host this site, so the pages, preview and properties on this screen belong to whatever it does host.","orchestratorMismatch.detailHosts":"{{orchestrator}} hosts {{hosted}} — not this site — so the pages, preview and properties on this screen are that site's, under this site's name.","orchestratorMismatch.useDefault":"Use the editor's own orchestrator","propertyPanel.unknownBlock":"Unknown block type:","propertyPanel.page":"Page","propertyPanel.close":"Close properties","propertyPanel.navLabel":"Nav label","propertyPanel.change":"Change","propertyPanel.chooseImage":"Choose image","propertyPanel.remove":"Remove","propertyPanel.altText":"Alt text","propertyPanel.altPlaceholder":"Describe what's in this image","propertyPanel.navPlaceholder":"Page","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO title","propertyPanel.seoTitlePlaceholder":"Defaults to page title","propertyPanel.metaDescription":"Meta description","propertyPanel.metaDescPlaceholder":"Defaults to generated description","propertyPanel.ogImage":"Open Graph image URL","welcome.greeting":"Welcome to {{name}}! Tell me what you'd like to change — I can add sections, rewrite copy, create new pages, and more. Browse the [component catalogue](https://avocado-site.vercel.app/catalogue) used on the demo site to see what's available.","welcome.greetingFallback":"Let's shape your site into something people remember. Tell me what you'd like to change.","welcome.greetingDemo":"Welcome to {{name}} — this is a demo site so you can try things out. Edit anything you like, browse the [component catalogue]({{catalogueUrl}}) to see what's available, and when you're ready, [onboard your own site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Rewrite the hero headline","suggestion.addTestimonials":"Add a testimonials section","suggestion.addFaq":"Add an FAQ section","suggestion.addCta":"Add a call-to-action","suggestion.changeHeadline":"Change the headline and subheading","suggestion.addSection":"Add a new section","suggestion.rewriteTone":"Rewrite the copy to sound more {{tone}}","suggestion.createFromTemplate":"Create a new {{name}} page","suggestion.createAbout":"Create a new /about page","suggestion.demoTranslate":"Translate the whole page to German","suggestion.demoAddFaq":"Add an FAQ section","suggestion.demoHeroCta":"Turn the hero into a bold call-to-action","streamError.failed":"Streaming request failed.","streamError.retrying":"Streaming failed, retrying with standard request...","streamError.canceling":"Canceling...","streamError.canceled":"Stopped this request.","streamError.structuralDisabled":"Structural edits are disabled for this site context.","streamError.demoQuotaExhausted":"This live demo is shared by everyone and has reached its usage limit for now. Please try again in a few minutes — anything you've already created is still here.","ops.addedItem":"Added list item.","ops.deletedBlock":"Deleted block.","ops.changedImage":"Changed image.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Couldn't change the image. Please try again.","ops.imageSwap.pickAnother":"Change","ops.imageSwap.retry":"Try again","ops.continueNext":"Continue to next step","plan.apply":"Apply","plan.applyDestructive":"Apply changes","plan.deletePage":"Delete page","plan.deletePages":"Delete {{count}} pages","plan.discard":"Discard","fieldAi.generateAlt":"Generate alt text","fieldAi.improveAccessibility":"Improve accessibility","fieldAi.makeDescriptive":"Make more descriptive","fieldAi.optimizeSearch":"Optimize for search ranking","fieldAi.fitTitle":"Fit within 60 characters","fieldAi.addKeyword":"Add primary keyword","fieldAi.suggest3":"Suggest 3 alternatives","fieldAi.optimizeCtr":"Optimize for click-through rate","fieldAi.fitDescription":"Fit within 160 characters","fieldAi.addCallToAction":"Add a call to action","fieldAi.simplifyLanguage":"Simplify language","fieldAi.expandDetail":"Expand with more detail","fieldAi.makeConcise":"Make more concise","fieldAi.improveClarity":"Improve clarity","fieldAi.adjustTone":"Adjust tone to be more professional","error.heading":"Something went wrong","error.message":"An unexpected error occurred while loading this page. Please try again.","error.tryAgain":"Try again","notFound.code":"404","notFound.heading":"Page not found","notFound.message":"The page you're looking for doesn't exist or has been moved.","notFound.backHome":"Back to home","theme.switchLight":"Switch site to light mode","theme.switchDark":"Switch site to dark mode","theme.light":"Light mode","theme.dark":"Dark mode","sitesAgent.title":"Onboarding agent","sitesAgent.clear":"Clear chat","sitesAgent.welcome":"I can create a new site from scratch, migrate an existing website from its URL, or integrate the editor into your Next.js project. Heads up: this is early — treat my first pass as a draft you'll refine in the editor, especially for migrations of complex sites. What would you like to do?","sitesAgent.placeholder":"Ask me anything...","sitesAgent.suggestion1":"Create a new site from scratch","sitesAgent.suggestion1Desc":"Describe your site's purpose and I'll scaffold it","sitesAgent.suggestion2":"Migrate a website from URL","sitesAgent.suggestion2Desc":"Give me a URL and I'll analyze and recreate it","sitesAgent.suggestion3":"Integrate using a GitHub project","sitesAgent.suggestion3Desc":"Connect the editor to your existing Next.js app","sitesAgent.stop":"Stop","sitesAgent.showMore":"Show more","sitesAgent.showLess":"Show less"},H9={"header.siteSettings":"Seiteneinstellungen","header.syncFromSite":"Von Seite laden","header.syncFromSiteTitle":"Neueste Inhalte aus der Quelle dieser Seite laden","header.allSites":"Alle Seiten","header.page":"Seite","header.language":"Sprache","header.pagesWithoutLanguage":"Ohne Sprachzuordnung","header.viewAllSites":"Alle Websites anzeigen","header.limited":"Eingeschränkt","header.demoMode":"Demomodus","demo.bannerTitle":"Du bist im Demomodus","demo.bannerBody":"Das ist ein Live-Playground. Du kannst die Hero-Sektion per Klartext bearbeiten — alles andere ist vorerst gesperrt.","demo.tryExample1":'Ändere die Hero-Überschrift zu "Willkommen auf meiner neuen Seite"',"demo.tryExample2":"Lass die Hero-Unterzeile verspielter klingen","demo.tryExample3":'Aktualisiere den Hero-CTA zu "Jetzt starten"',"demo.placeholder":"Versuch: ändere die Hero-Überschrift zu …","demoGuide.title":"Erste Schritte","demoGuide.try":"Ausprobieren","demoGuide.dismiss":"Schließen","demoGuide.step1Title":"Hero-Überschrift & Unterzeile neu schreiben","demoGuide.step1Prompt":"Schreibe die Hero-Überschrift und Unterzeile überzeugender und nutzenorientierter","demoGuide.step2Title":"Statistik-Leiste hinzufügen","demoGuide.step2Prompt":"Füge unter dem Hero eine Statistik-Leiste mit ein paar beeindruckenden Zahlen hinzu","demoGuide.step3Title":"Hero-Bild austauschen","demoGuide.step3Prompt":"Gib der ganzen Seite ein warmes, erdiges grünes Farbthema","demoGuide.step4Title":"Seite übersetzen","demoGuide.step4Prompt":"Übersetze die ganze Seite ins Deutsche","header.moreOptions":"Weitere Optionen","header.publish":"Veröffentlichen","header.publishing":"Wird veröffentlicht","header.unpublishedTooltip":"{{count}} unveröffentlichte Änderung(en) seit der letzten Veröffentlichung.","header.viewDeploy":"Deployment ansehen","header.openLiveSite":"Live-Seite öffnen","header.openImmersive":"Im Immersive-Modus öffnen","header.syncedPage":"1 Seite von der Website geladen.","header.syncedPages":"{{count}} Seiten von der Website geladen.","header.syncFailedNetwork":"Diese Seite ist nicht erreichbar. Prüfe, ob sie läuft, und versuch es erneut.","header.syncFailedEmpty":"Diese Seite hat keine Quellinhalte zum Laden.","tabs.chat":"Chat","tabs.properties":"Eigenschaften","stream.shapingUpdate":"Änderung wird vorbereitet…","stream.gettingReady":"Wird vorbereitet…","stream.updating":"Wird aktualisiert…","stream.thinking":"Denkt nach","chat.thinking.streaming":"Denkt nach…","chat.thinking.doneSeconds":"{{seconds}} s nachgedacht","chat.thinking.done":"Gedankengang","chat.thinking.showMore":"Gedanken anzeigen","chat.thinking.showLess":"Gedanken ausblenden","chat.expandDetails":"Details anzeigen","chat.copied":"Kopiert","chat.copyDebug":"Debug-Nachricht kopieren","chat.copy":"Kopieren","chat.undone":"Rückgängig gemacht","chat.undo":"Rückgängig","chat.appliedDraft":"Auf deinen Entwurf angewendet","chat.keep":"Behalten","chat.revert":"Zurücksetzen","chat.reverted":"Zurückgesetzt","chat.kept":"Behalten","chat.redo":"Wiederherstellen","chat.undoTooltip":"Rückgängig (Strg+Z)","chat.redoTooltip":"Wiederherstellen (Strg+Y)","history.title":"Versionshistorie","history.loading":"Historie wird geladen...","history.empty":"Noch keine Änderungen.","history.operation":"Operation","history.operations":"Operationen","history.tooltip":"Versionshistorie","history.restore":"Auf diese zurücksetzen","history.restoring":"Wird zurückgesetzt...","history.current":"Aktuell","history.showDetails":"Details anzeigen","history.hideDetails":"Details ausblenden","history.version":"Version","history.page":"Seite","history.changes":"Änderungen","history.publish":"Veröffentlichung","history.deploying":"Wird bereitgestellt…","history.live":"Live","history.deployFailed":"Fehlgeschlagen","history.viewDeploy":"Deploy ansehen","history.pagesPublished":"{{count}} Seiten","history.pagePublished":"1 Seite","history.pagesChanged":"{{changed}} von {{total}} Seiten geändert","history.noContentChanges":"Keine inhaltlichen Änderungen · {{count}} Seiten live","chat.goodResponse":"Gute Antwort","chat.badResponse":"Schlechte Antwort","chat.feedbackThanks":"Danke!","chat.feedbackNoted":"Notiert","chat.feedbackPlaceholder":"Was war falsch? (optional)","chat.feedbackSend":"Senden","variation.title":"Variante wählen","variation.close":"Variantenauswahl schließen","variation.applying":"Wird angewendet…","variation.apply":'"{{title}}" anwenden',"addBlock.title":"Block hinzufügen","addBlock.close":"Blockauswahl schließen","addBlock.insertAbove":"Blocktyp auswählen, der oberhalb des ausgewählten Bereichs eingefügt wird.","addBlock.insertBelow":"Blocktyp auswählen, der unterhalb des ausgewählten Bereichs eingefügt wird.","addBlock.searchPlaceholder":"Blocktypen durchsuchen","resize.inputPanel":"Eingabebereich skalieren","resize.chatPanel":"Chatbereich skalieren","preview.title":"Live-Vorschau","preview.loading":"Vorschau wird geladen…","settings.title":"Einstellungen","settings.devTitle":"Entwicklermodus","settings.developerMode":"Entwicklermodus","settings.streaming":"Streaming","settings.nestedLabels":"Verschachtelte Labels","settings.fieldDraftTelemetry":"Feld-Entwurfs-Telemetrie","settings.darkMode":"Dunkler Modus","settings.autoScrollTracking":"Generiertem Inhalt folgen","settings.debugMode":"Debug-Modus","settings.model":"Modell","settings.advanced":"Erweitert","settings.clearChat":"Chat leeren","settings.language":"Sprache","password.title":"Editor-Zugang","password.placeholder":"Passwort","password.incorrect":"Falsches Passwort","password.checking":"Wird geprüft…","password.continue":"Weiter","sites.title":"Websites","sites.subtitle":"Wähle eine Website zum Bearbeiten.","sites.addSite":"Website hinzufügen","sites.addSiteTitle":"Website hinzufügen","sites.close":"Schließen","sites.siteName":"Seitenname","sites.siteNamePlaceholder":"Meine Website","sites.previewUrl":"Vorschau-URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Visuellen Editor (Puck) verwenden","sites.editorialBrief":"Redaktionelles Briefing","sites.overview":"Übersicht","sites.tone":"Tonalität","sites.constraints":"Einschränkungen","sites.templates":"Vorlagen","sites.overviewPlaceholder":"Wofür diese Seite gedacht ist.","sites.tonePlaceholder":"Wie der Text klingen soll.","sites.constraintsPlaceholder":`Regeln für die Inhaltsausgabe.
337
- Eine pro Zeile.`,"sites.templateName":"Vorlagenname (z. B. Kampagnen-Landingpage)","sites.templateDescription":"Beschreibe die Seitenstruktur: welche Bereiche, in welcher Reihenfolge, mit welchem inhaltlichen Fokus.","sites.settings":"Einstellungen","sites.openEditor":"Editor öffnen","sites.deleteSite":"Löschen","sites.confirmDelete":'"{{name}}" aus der Siteliste entfernen?',"sites.confirmDeleteTitle":"Site entfernen","sites.confirmDeleteBody":'Damit wird "{{name}}" aus deiner lokalen Siteliste entfernt. Die Site selbst wird nicht gelöscht.',"sites.switchingTo":"Wechsle zu","sites.switchInFlight":"Eine Chat-Anfrage läuft noch. Trotzdem die Site wechseln und sie verwerfen?","sites.allOffline":"Keine erreichbaren Sites","sites.allOfflineHint":'Alle Sites in deiner Liste haben den Erreichbarkeitstest nicht bestanden. Aktiviere "Offline-Sites anzeigen" oder prüfe, ob die Sites laufen.',"sites.previewUrlOverride":"Wird durch ?previewUrl= in der aktuellen URL überschrieben.","sites.orchestratorUrl":"Orchestrator-URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Nur für Sites, die den Orchestrator selbst betreiben (Library-Modus). Leer lassen, um den Orchestrator des Editors zu verwenden.","sites.cancel":"Abbrechen","sites.create":"Erstellen","sites.siteConfig":"Seitenkonfiguration","sites.general":"Allgemein","sites.media":"Medien","sites.hosting":"Hosting","sites.brief":"Briefing","sites.deploy":"Deployment","sites.coreSettings":"Grundeinstellungen","sites.header":"Kopfzeile","sites.siteHeaderName":"Name in der Kopfzeile","sites.logoUrl":"Logo-URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Seitenvorlagen","sites.pageTemplatesHint":"Definiere wiederverwendbare Seitenstrukturen. Die KI ordnet Vorlagen bei der Seitenerstellung nach Name oder Absicht zu.","sites.removeTemplate":"Entfernen","sites.addTemplate":"+ Vorlage hinzufügen","sites.preferredTone":"Bevorzugte Tonalität","sites.writingConstraints":"Schreibregeln","sites.hostingPlaceholder":"Vercel-Produktionsseite","sites.vercelProjectId":"Vercel-Projekt-ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel-Team-ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel-Produktions-URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel-Deploy-Hook-URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google-Drive-Ordner-ID","sites.googleDrivePlaceholder":"z. B. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Wird getestet…","sites.test":"Testen","sites.driveConnectedImages":"Verbunden (Bilder gefunden)","sites.driveConnectedEmpty":"Verbunden (Ordner leer)","sites.driveError":"Orchestrator nicht erreichbar","sites.cmsMedia":"CMS-Medien","sites.provider":"Anbieter","sites.none":"Keiner","sites.spaceId":"Space-ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery-Token","sites.deliveryTokenPlaceholder":"Content-Delivery-API-Token","sites.projectId":"Projekt-ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi-URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API-Token","sites.apiTokenPlaceholder":"Nur-Lese-API-Token","sites.versionHistory":"Versionshistorie","sites.restoreDescription":"Einen früheren veröffentlichten Snapshot wiederherstellen in","sites.snapshotVersion":"Snapshot-Version","sites.loadingSnapshots":"Snapshots werden geladen…","sites.restoring":"Wird wiederhergestellt…","sites.restore":"Wiederherstellen","sites.noSnapshots":"Noch keine Snapshots vorhanden.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Seiten","sites.snapshotHeading":"Überschrift","sites.snapshotDate":"Datum","sites.checkingManifest":"Manifest wird geprüft…","sites.limitedEditing":"Eingeschränktes Bearbeiten","sites.editingReady":"Bearbeitung bereit","sites.checking":"Wird geprüft…","chatInput.placeholder":"Frag mich etwas","chatInput.listening":"Hört zu","chatInput.transcribing":"Wird transkribiert…","chatInput.attachFile":"Datei anhängen","chatInput.removeAttachment":"Anhang entfernen","chatInput.exitSelector":"Auswahlmodus beenden","chatInput.selectElement":"Element auswählen","chatInput.editingBlock":"Bearbeiten: {{block}}","chatInput.clearSelection":"Auswahl aufheben","chatInput.voiceActions":"Sprach- und Sendeaktionen","chatInput.cancelVoice":"Spracheingabe abbrechen","chatInput.sendRecorded":"Aufgenommene Nachricht senden","chatInput.startVoice":"Spracheingabe starten","chatInput.stopGeneration":"Generierung stoppen","chatInput.sendMessage":"Nachricht senden","chatInput.speechUnsupported":"Spracheingabe wird in diesem Browser nicht unterstützt.","chatInput.noSpeechDetected":"Keine Sprache erkannt. Bitte erneut aufnehmen.","chatInput.micBlocked":"Mikrofonzugriff ist blockiert. Bitte Mikrofonberechtigungen erlauben und erneut versuchen.","chatInput.unsupportedFile":"Nur Bilder und PDF-Dateien werden unterstützt.","chatInput.attachmentOnlyMessage":"Verwende die angehängte(n) Datei(en).","chatInput.uploadFailed":"Upload fehlgeschlagen. Bitte erneut versuchen.","chatInput.transcribeFailed":"Audiotranskription fehlgeschlagen.","imagePicker.title":"Asset-Manager","imagePicker.close":"Schließen","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Medienbibliothek durchsuchen…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Hochladen","imagePicker.generate":"Generieren","imagePicker.searchDrive":"Drive-Bilder durchsuchen…","imagePicker.searchUnsplash":"Unsplash-Fotos durchsuchen…","imagePicker.search":"Suchen…","imagePicker.refreshDrive":"Von Drive aktualisieren","imagePicker.searching":"Wird gesucht…","imagePicker.typeToSearch":"Suchbegriff eingeben","imagePicker.noImages":"Keine Bilder gefunden","imagePicker.loadMore":"Mehr laden","imagePicker.loading":"Wird geladen…","imagePicker.uploadFromComputer":"Vom Computer hochladen","imagePicker.uploading":"Wird hochgeladen…","imagePicker.chooseDifferent":"Andere Datei wählen","imagePicker.orPasteUrl":"oder URL einfügen","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Hochgeladenes Bild","imagePicker.examplePrompt":"Wärmer machen","imagePicker.editPrompt":"Beschreibe, wie das Bild geändert werden soll…","imagePicker.generatePrompt":"Beschreibe das gewünschte Bild…","imagePicker.followUpPrompt":"Änderungen beschreiben…","imagePicker.refine":"Verfeinern","imagePicker.edit":"Bearbeiten","imagePicker.closePreview":"Vorschau schließen","imagePicker.ready":"Fertig","imagePicker.editThisImage":"Dieses Bild bearbeiten","imagePicker.editThisImageDesc":"Änderungen am aktuellen Bild beschreiben","imagePicker.generateNew":"Neu generieren","imagePicker.generateNewDesc":"Ein komplett neues Bild von Grund auf erstellen","imagePicker.useImage":"Bild verwenden","imagePicker.applyUrl":"URL anwenden","imagePicker.removeReference":"Referenz entfernen","imagePicker.attachReference":"Beispielbilder als Referenz anhängen (bis zu {{max}})","imagePicker.showOriginal":"Original anzeigen","imagePicker.showEdited":"Bearbeitet anzeigen","propertyPanel.loading":"Wird geladen…","propertyPanel.loadFailed":"Blockeigenschaften konnten nicht geladen werden","propertyPanel.loadFailedMissing":"Dieser Block ist nicht in der Seite, die der Orchestrator zurückgegeben hat","propertyPanel.loadFailedMissingHint":"Vorschau und Orchestrator zeigen möglicherweise auf verschiedene Sites. Prüfe die Orchestrator-URL in den Einstellungen der Site.","propertyPanel.loadFailedNoPage":"Diese Seite ist nicht im Entwurf","propertyPanel.loadFailedNoPageHint":"Der Orchestrator hat geantwortet, kennt aber unter dieser Adresse keine Seite für diese Session — entweder ist der Editor auf einer Seite, die dieser Entwurf nicht hat, oder er fragt einen Orchestrator, der diese Site nicht bereitstellt.","propertyPanel.loadFailedUnreachableHint":"Unter dieser Adresse hat nichts geantwortet. Prüfe, ob der Orchestrator läuft.","propertyPanel.retry":"Erneut versuchen","orchestratorMismatch.title":"Du bearbeitest die Inhalte einer anderen Site","orchestratorMismatch.detail":"{{orchestrator}} stellt diese Site nicht bereit — Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu der Site, die dort tatsächlich liegt.","orchestratorMismatch.detailHosts":"{{orchestrator}} stellt {{hosted}} bereit — nicht diese Site. Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu jener Site, unter dem Namen dieser.","orchestratorMismatch.useDefault":"Orchestrator des Editors verwenden","propertyPanel.unknownBlock":"Unbekannter Blocktyp:","propertyPanel.page":"Seite","propertyPanel.close":"Eigenschaften schließen","propertyPanel.navLabel":"Nav-Label","propertyPanel.change":"Ändern","propertyPanel.chooseImage":"Bild wählen","propertyPanel.remove":"Entfernen","propertyPanel.altText":"Alt-Text","propertyPanel.altPlaceholder":"Beschreibe, was auf dem Bild zu sehen ist","propertyPanel.navPlaceholder":"Seite","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO-Titel","propertyPanel.seoTitlePlaceholder":"Standardmäßig der Seitentitel","propertyPanel.metaDescription":"Meta-Beschreibung","propertyPanel.metaDescPlaceholder":"Standardmäßig generierte Beschreibung","propertyPanel.ogImage":"Open-Graph-Bild-URL","welcome.greeting":"Willkommen bei {{name}}! Sag mir, was du ändern möchtest — ich kann Bereiche hinzufügen, Texte umschreiben, neue Seiten erstellen und mehr. Schau dir den [Komponenten-Katalog](https://avocado-site.vercel.app/catalogue) der Demo-Site an, um zu sehen, was verfügbar ist.","welcome.greetingFallback":"Lass uns deine Seite in etwas Besonderes verwandeln. Ich kann Bereiche hinzufügen, Texte umschreiben, Blöcke umordnen, neue Seiten erstellen und mehr. Klicke auf etwas in der Vorschau oder sag mir, was du ändern möchtest.","welcome.greetingDemo":"Willkommen bei {{name}} — das ist eine Demo-Site zum Ausprobieren. Bearbeite, was du willst, schau dir den [Komponenten-Katalog]({{catalogueUrl}}) an, um zu sehen, was verfügbar ist, und wenn du bereit bist, [onboarde deine eigene Site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Hero-Überschrift umschreiben","suggestion.addTestimonials":"Einen Testimonial-Bereich hinzufügen","suggestion.addFaq":"Einen FAQ-Bereich hinzufügen","suggestion.addCta":"Einen Call-to-Action hinzufügen","suggestion.changeHeadline":"Überschrift und Untertitel ändern","suggestion.addSection":"Neuen Bereich hinzufügen","suggestion.rewriteTone":"Text umschreiben: mehr {{tone}}","suggestion.createFromTemplate":"Neue {{name}}-Seite erstellen","suggestion.createAbout":"Eine neue /about-Seite erstellen","suggestion.demoTranslate":"Übersetze die ganze Seite ins Deutsche","suggestion.demoAddFaq":"Einen FAQ-Bereich hinzufügen","suggestion.demoHeroCta":"Mach aus dem Hero einen starken Call-to-Action","streamError.failed":"Streaming-Anfrage fehlgeschlagen.","streamError.retrying":"Streaming fehlgeschlagen, wird mit Standardanfrage wiederholt…","streamError.canceling":"Wird abgebrochen…","streamError.canceled":"Vorgang gestoppt.","streamError.structuralDisabled":"Strukturelle Bearbeitungen sind für diesen Seitenkontext deaktiviert.","streamError.demoQuotaExhausted":"Diese Live-Demo wird von allen genutzt und hat vorerst ihr Nutzungslimit erreicht. Bitte versuchen Sie es in ein paar Minuten erneut – alles, was Sie bereits erstellt haben, bleibt erhalten.","ops.addedItem":"Listenelement hinzugefügt.","ops.deletedBlock":"Block gelöscht.","ops.changedImage":"Bild geändert.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Bild konnte nicht geändert werden. Bitte erneut versuchen.","ops.imageSwap.pickAnother":"Ändern","ops.imageSwap.retry":"Erneut versuchen","ops.continueNext":"Weiter zum nächsten Schritt","plan.apply":"Übernehmen","plan.applyDestructive":"Änderungen übernehmen","plan.deletePage":"Seite löschen","plan.deletePages":"{{count}} Seiten löschen","plan.discard":"Verwerfen","fieldAi.generateAlt":"Alt-Text generieren","fieldAi.improveAccessibility":"Barrierefreiheit verbessern","fieldAi.makeDescriptive":"Beschreibender gestalten","fieldAi.optimizeSearch":"Für Suchranking optimieren","fieldAi.fitTitle":"Auf 60 Zeichen kürzen","fieldAi.addKeyword":"Primäres Schlüsselwort hinzufügen","fieldAi.suggest3":"3 Alternativen vorschlagen","fieldAi.optimizeCtr":"Für Klickrate optimieren","fieldAi.fitDescription":"Auf 160 Zeichen kürzen","fieldAi.addCallToAction":"Handlungsaufforderung hinzufügen","fieldAi.simplifyLanguage":"Sprache vereinfachen","fieldAi.expandDetail":"Mit mehr Details erweitern","fieldAi.makeConcise":"Prägnanter formulieren","fieldAi.improveClarity":"Verständlichkeit verbessern","fieldAi.adjustTone":"Ton professioneller gestalten","error.heading":"Etwas ist schiefgelaufen","error.message":"Beim Laden dieser Seite ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.","error.tryAgain":"Erneut versuchen","notFound.code":"404","notFound.heading":"Seite nicht gefunden","notFound.message":"Die gesuchte Seite existiert nicht oder wurde verschoben.","notFound.backHome":"Zurück zur Startseite","theme.switchLight":"Seite in den hellen Modus wechseln","theme.switchDark":"Seite in den dunklen Modus wechseln","theme.light":"Heller Modus","theme.dark":"Dunkler Modus","sitesAgent.title":"Onboarding-Agent","sitesAgent.clear":"Chat leeren","sitesAgent.welcome":"Ich kann eine neue Seite erstellen, eine bestehende Website von ihrer URL migrieren oder den Editor in dein Next.js-Projekt integrieren. Hinweis: Das ist noch früh — behandle meinen ersten Wurf als Entwurf, den du im Editor verfeinerst, besonders bei Migrationen komplexer Seiten. Was möchtest du tun?","sitesAgent.placeholder":"Frag mich etwas...","sitesAgent.suggestion1":"Neue Seite von Grund auf erstellen","sitesAgent.suggestion1Desc":"Beschreibe den Zweck deiner Seite und ich erstelle sie","sitesAgent.suggestion2":"Website von URL migrieren","sitesAgent.suggestion2Desc":"Gib mir eine URL und ich analysiere und erstelle sie neu","sitesAgent.suggestion3":"Über ein GitHub-Projekt integrieren","sitesAgent.suggestion3Desc":"Verbinde den Editor mit deiner bestehenden Next.js-App","sitesAgent.stop":"Stopp","sitesAgent.showMore":"Mehr anzeigen","sitesAgent.showLess":"Weniger anzeigen"},fv={en:U9,de:H9},iD="editor-locale",sD={en:"English",de:"Deutsch"};function oD(){try{const e=localStorage.getItem(iD);if(e&&e in fv)return e}catch{}return"en"}function aD(e){return(t,n)=>{let r=fv[e][t]??fv.en[t]??t;if(n)for(const[i,s]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(s));return r}}function V9(e){return aD(e)}const lD=E.createContext(null);function q9({children:e}){const[t,n]=E.useState(oD),r=E.useCallback(o=>{try{localStorage.setItem(iD,o)}catch{}n(o)},[]),i=E.useMemo(()=>aD(t),[t]),s=E.useMemo(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return m.jsx(lD,{value:s,children:e})}function yr(){const e=E.useContext(lD);if(!e)throw new Error("useT must be used within <LocaleProvider>");return e}const O_=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const b=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,b))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,l);return l},G9=(e=>e?O_(e):O_),Z9=e=>e;function W9(e,t=Z9){const n=kn.useSyncExternalStore(e.subscribe,kn.useCallback(()=>t(e.getState()),[e,t]),kn.useCallback(()=>t(e.getInitialState()),[e,t]));return kn.useDebugValue(n),n}const z_=e=>{const t=G9(e),n=r=>W9(t,r);return Object.assign(n,t),n},uD=(e=>e?z_(e):z_),K9=e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=((o,l,c)=>{let d=o;if(l){const h=(c==null?void 0:c.equalityFn)||Object.is;let p=o(r.getState());d=b=>{const y=o(b);if(!h(p,y)){const x=p;l(p=y,x)}},c!=null&&c.fireImmediately&&l(p,p)}return i(d)}),e(t,n,r)},Y9=K9,P_="__ai_justification__:",L_="__ai_performance__:",cD="editor-debug-mode-v1",dD="editor-model-key-v1",fD="editor-provider-v1",sg="editor-chat-theme-v1",hv="editor-dev-options-v1",pv="editor-chat-width-v1",mv="editor-props-width-v1",B_=340,J9=720,F_=300,X9=560;function gv(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(B_,Math.min(J9,n*.5));return Math.max(B_,Math.min(e,r))}function Q9(){if(typeof window>"u")return null;const e=window.localStorage.getItem(pv);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:gv(t)}function bv(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(F_,Math.min(X9,n*.4));return Math.max(F_,Math.min(e,r))}function eB(){if(typeof window>"u")return null;const e=window.localStorage.getItem(mv);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:bv(t)}function tB(){const e=/^(1|true|yes|on)$/i.test("");if(typeof window>"u")return e;const n=new URLSearchParams(window.location.search).get("dev");if(n!==null){const i=/^(1|true|yes|on)$/i.test(n);try{window.localStorage.setItem(hv,i?"1":"0")}catch{}return i}const r=window.localStorage.getItem(hv);return r==="1"?!0:r==="0"?!1:e}const nB={desktop:1200};function nh(){return`${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function rB(){if(/^(1|true|yes|on)$/i.test(""))return!0;if(typeof window>"u")return!1;const t=window.localStorage.getItem(cD);return/^(1|true|yes|on)$/i.test(t??"")}const iB=new Set(["fast","balanced","reasoning","codex"]),sB=new Set(["openai","anthropic","gemini"]);function oB(){if(typeof window>"u")return"balanced";const e=window.localStorage.getItem(dD);return e&&iB.has(e)?e:"balanced"}function aB(){if(typeof window>"u")return"anthropic";const e=window.localStorage.getItem(fD);return e&&sB.has(e)?e:"anthropic"}function lB(){var t,n;if(typeof window>"u")return!1;const e=window.sessionStorage.getItem(sg)??window.localStorage.getItem(sg);return e==="dark"?!0:e==="light"?!1:((n=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-color-scheme: dark)"))==null?void 0:n.matches)??!1}const uB="editor-anchored-composer-v1",hD="editor-auto-scroll-tracking-v1";function cB(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(hD);return!(e==="0"||e==="false")}function dB(){if(/^(0|false|no|off)$/i.test(""))return!1;if(/^(1|true|yes|on)$/i.test("")||typeof window>"u")return!0;const t=window.localStorage.getItem(uB);return!(t==="0"||t==="false")}function fB(e,t){return{...e,...t}}function hB(e){const t=Array.isArray(e)?e:[];let n,r;const i=[];for(const s of t)if(typeof s=="string"&&/\w/.test(s)){if(s.startsWith(P_)){const o=s.slice(P_.length).trim();o&&(n=o);continue}if(s.startsWith(L_)){const o=s.slice(L_.length).trim();o&&(r=o);continue}i.push(s)}return{changes:i,aiJustification:n,aiPerformanceNote:r}}function pB(){if(typeof window>"u")return"/";const e=new URLSearchParams(window.location.search).get("slug");if(!e)return"/";const t=e.trim();return!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`}function mB(e){if(!e)return[];if(Array.isArray(e))return e.map(String);const t=Object.values(e.fieldErrors??{}).flat().map(String);return[...(e.formErrors??[]).map(String),...t]}const ge=uD()(Y9(e=>({activeBlockId:void 0,activeBlockType:void 0,activeEditablePath:void 0,slug:pB(),availableSlugs:["/"],isLoadingSlugs:!1,chatLog:[],chatAttachments:[],isLoading:!1,streamStatus:null,streamingText:null,streamingChanges:[],streamingThinking:null,streamSteps:[],opChecklist:[],streamTokenCount:0,latestStreamFocusBlockId:null,imageProgress:null,continuationChainId:null,pendingPlanId:null,plannerBadgeState:"checking",variationModal:null,isApplyingVariation:!1,composerHeight:56,chatWidth:Q9(),propsWidth:eB(),activeTab:"chat",showSettingsModal:!1,showDebugDetails:rB(),addBlockPicker:null,addBlockSearch:"",isAddingBlock:!1,imagePickerTarget:null,chatDarkMode:lB(),selectionModeEnabled:!1,anchorRect:null,anchoredExpanded:!1,selectedVariationId:null,showSiteSwitcher:!1,copiedDebugEntryId:null,feedbackNoteEntryId:null,feedbackNoteText:"",siteConfigTab:"overview",configModalTab:"general",modelKey:oB(),provider:aB(),availableProviders:[],useStreaming:!0,autoScrollTrackingEnabled:cB(),autoScrollSuppressed:!1,backendFeatures:{},fieldDraftDebugEnabled:!1,fieldDraftDebug:{eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null},setActiveBlock:(t,n)=>e(r=>{const i=n===void 0&&t===r.activeBlockId?r.activeBlockType:n;return r.activeBlockId===t&&r.activeBlockType===i?r:{...r,activeBlockId:t,activeBlockType:i}}),setActiveEditablePath:t=>e(n=>n.activeEditablePath===t?n:{...n,activeEditablePath:t}),setSlug:t=>e(n=>n.slug===t?n:{...n,slug:t}),setAvailableSlugs:t=>e({availableSlugs:t}),setIsLoadingSlugs:t=>e(n=>n.isLoadingSlugs===t?n:{...n,isLoadingSlugs:t}),setChatLog:t=>e(n=>({...n,chatLog:typeof t=="function"?t(n.chatLog):t})),appendChatEntry:t=>e(n=>({...n,chatLog:[...n.chatLog,t]})),setChatAttachments:t=>e(n=>({...n,chatAttachments:typeof t=="function"?t(n.chatAttachments):t})),setIsLoading:t=>e(n=>n.isLoading===t?n:{...n,isLoading:t}),setStreamStatus:t=>e({streamStatus:t}),setStreamingText:t=>e(n=>({...n,streamingText:typeof t=="function"?t(n.streamingText):t})),setStreamingChanges:t=>e(n=>({...n,streamingChanges:typeof t=="function"?t(n.streamingChanges):t})),setStreamingThinking:t=>e(n=>({...n,streamingThinking:typeof t=="function"?t(n.streamingThinking):t})),setStreamSteps:t=>e(n=>({...n,streamSteps:typeof t=="function"?t(n.streamSteps):t})),setOpChecklist:t=>e(n=>({...n,opChecklist:typeof t=="function"?t(n.opChecklist):t})),setStreamTokenCount:t=>e(n=>({...n,streamTokenCount:typeof t=="function"?t(n.streamTokenCount):t})),setLatestStreamFocusBlockId:t=>e({latestStreamFocusBlockId:t}),setImageProgress:t=>e({imageProgress:t}),setContinuationChainId:t=>e({continuationChainId:t}),setPendingPlanId:t=>e({pendingPlanId:t}),setPlannerBadgeState:t=>e({plannerBadgeState:t}),setVariationModal:t=>e({variationModal:t}),setIsApplyingVariation:t=>e({isApplyingVariation:t}),patchVariationOption:(t,n)=>e(r=>{if(!r.variationModal)return r;const i=r.variationModal.options.map(s=>s.id===t?{...s,patch:n.patch,changedKeys:n.changedKeys,imagePending:!1}:s);return{...r,variationModal:{...r.variationModal,options:i}}}),setComposerHeight:t=>e(n=>{const r=typeof t=="function"?t(n.composerHeight):t;return n.composerHeight===r?n:{...n,composerHeight:r}}),setChatWidth:t=>e(n=>{const r=typeof t=="function"?t(n.chatWidth):t;return n.chatWidth===r?n:{...n,chatWidth:r}}),setPropsWidth:t=>e(n=>{const r=typeof t=="function"?t(n.propsWidth):t;return n.propsWidth===r?n:{...n,propsWidth:r}}),setActiveTab:t=>e(n=>n.activeTab===t?n:{...n,activeTab:t}),setShowSettingsModal:t=>e({showSettingsModal:t}),setShowDebugDetails:t=>e({showDebugDetails:t}),setAddBlockPicker:t=>e({addBlockPicker:t}),setAddBlockSearch:t=>e({addBlockSearch:t}),setIsAddingBlock:t=>e({isAddingBlock:t}),setImagePickerTarget:t=>e({imagePickerTarget:t}),setChatDarkMode:t=>e(n=>n.chatDarkMode===t?n:{...n,chatDarkMode:t}),setSelectionModeEnabled:t=>e({selectionModeEnabled:t}),setAnchorRect:t=>e({anchorRect:t}),setAnchoredExpanded:t=>e({anchoredExpanded:t}),setSelectedVariationId:t=>e({selectedVariationId:t}),setShowSiteSwitcher:t=>e({showSiteSwitcher:t}),setCopiedDebugEntryId:t=>e({copiedDebugEntryId:t}),setFeedbackNoteEntryId:t=>e({feedbackNoteEntryId:t}),setFeedbackNoteText:t=>e({feedbackNoteText:t}),setSiteConfigTab:t=>e({siteConfigTab:t}),setConfigModalTab:t=>e({configModalTab:t}),setModelKey:t=>e(n=>n.modelKey===t?n:{...n,modelKey:t}),setProvider:t=>e(n=>n.provider===t?n:{...n,provider:t}),setAvailableProviders:t=>e({availableProviders:t}),setUseStreaming:t=>e({useStreaming:t}),setAutoScrollTrackingEnabled:t=>e(n=>n.autoScrollTrackingEnabled===t?n:{...n,autoScrollTrackingEnabled:t}),setAutoScrollSuppressed:t=>e(n=>n.autoScrollSuppressed===t?n:{...n,autoScrollSuppressed:t}),setBackendFeatures:t=>e({backendFeatures:t}),setFieldDraftDebugEnabled:t=>e({fieldDraftDebugEnabled:t}),setFieldDraftDebug:t=>e({fieldDraftDebug:t}),pushAssistantFromResult:(t,n)=>{const r=mB(t.validationErrors),i=hB(t.changes),s={id:nh(),role:"assistant",text:t.summary??t.error??"Request failed.",status:t.status,canUndo:(n==null?void 0:n.canUndo)??!1,wasUndone:!1,undoSlug:n==null?void 0:n.undoSlug,changes:i.changes,mentionedSlugs:Array.isArray(t.mentionedSlugs)?t.mentionedSlugs.filter(o=>typeof o=="string"):[],suggestions:t.suggestions??[],variations:t.variations,errors:r,meta:t.modelUsed?`${t.modelUsed}${t.modelKey?` (${t.modelKey})`:""}`:void 0,debug:t.debug,aiJustification:i.aiJustification,aiPerformanceNote:i.aiPerformanceNote,pendingPlanId:typeof t.pendingPlanId=="string"?t.pendingPlanId:void 0,planApplied:t.planApplied===!0?!0:void 0,planPreview:t.planPreview??void 0,destructiveReasons:Array.isArray(t.destructiveReasons)?t.destructiveReasons.filter(o=>typeof o=="string"):void 0,continuation:t.continuation??void 0,imageSwap:n==null?void 0:n.imageSwap,thinking:n==null?void 0:n.thinking};e(o=>{if(!s.canUndo)return{...o,chatLog:[...o.chatLog,s]};const l=o.chatLog.map(c=>c.canUndo?{...c,canUndo:!1,wasUndone:!1}:c);return{...o,chatLog:[...l,s]}})}})));ge.subscribe(e=>e.chatDarkMode,e=>{if(typeof window>"u")return;window.document.documentElement.classList.toggle("editor-dark",e),window.sessionStorage.setItem(sg,e?"dark":"light"),window.localStorage.setItem(sg,e?"dark":"light")});ge.subscribe(e=>e.modelKey,e=>{typeof window>"u"||window.localStorage.setItem(dD,e)});ge.subscribe(e=>e.provider,e=>{typeof window>"u"||window.localStorage.setItem(fD,e)});ge.subscribe(e=>e.showDebugDetails,e=>{typeof window>"u"||window.localStorage.setItem(cD,e?"1":"0")});ge.subscribe(e=>e.chatWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(pv):window.localStorage.setItem(pv,String(Math.round(e))))});ge.subscribe(e=>e.propsWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(mv):window.localStorage.setItem(mv,String(Math.round(e))))});ge.subscribe(e=>e.autoScrollTrackingEnabled,e=>{typeof window>"u"||window.localStorage.setItem(hD,e?"1":"0")});const jc={sessionId:"dev",siteId:"",editorOrigin:"",orchestratorUrl:""};function ji(){return jc.sessionId}function Oi(){return jc.siteId}function gB(e){jc.sessionId=e.sessionId,jc.siteId=e.siteId,jc.editorOrigin=e.editorOrigin,jc.orchestratorUrl=e.orchestratorUrl}const bB="image/png,image/jpeg,image/webp,image/gif,application/pdf";function $_(e){return e.type.startsWith("image/")||e.type==="application/pdf"}function yB(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${r.toString().padStart(2,"0")}`}function pD(e){const{message:t,isLoading:n,onMessageChange:r,onSubmit:i,onCancel:s,onTranscribeAudio:o,onUploadAttachment:l,attachments:c,onAttachmentsChange:d,onAutoHeightChange:h,selectionModeEnabled:p,onToggleSelectionMode:b,compact:y}=e,{t:x}=yr(),k=ge(re=>re.backendFeatures.audioTranscription)!==!1,[S,C]=E.useState(!1),[_,A]=E.useState(0),[M,R]=E.useState(!1),[D,j]=E.useState([]),[I,G]=E.useState(null),[L,H]=E.useState(null),V=E.useRef(null),Z=E.useRef(null),K=E.useRef(null),q=E.useRef(null),B=E.useRef(null),W=E.useRef([]),ee=E.useRef(null);function ue(){const re=Z.current;if(!re)return;const X=V.current;if(X){X.style.height="0px",X.style.overflowY="hidden";const Be=X.scrollHeight,kt=Math.min(220,Math.max(20,Be));X.style.height=`${kt}px`,X.style.overflowY=Be>kt?"auto":"hidden"}const je=re.closest(".composer"),ze=je?je.scrollHeight:re.scrollHeight;h(ze)}E.useEffect(()=>()=>{var re,X;try{(re=q.current)==null||re.stop()}catch{}(X=B.current)==null||X.getTracks().forEach(je=>je.stop()),q.current=null,B.current=null},[]),E.useLayoutEffect(()=>{ue()},[t,S,M,D,c,I,L,h]),E.useEffect(()=>{var je;const re=requestAnimationFrame(()=>ue());let X=!1;return typeof document<"u"&&((je=document.fonts)!=null&&je.ready)&&document.fonts.ready.then(()=>{X||ue()}).catch(()=>{}),()=>{cancelAnimationFrame(re),X=!0}},[]),E.useEffect(()=>{const re=()=>ue();return window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[]),E.useEffect(()=>{const re=Z.current;if(!re)return;const X=re.closest(".composer");let je;typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>ue()),je.observe(re),X&&je.observe(X));let ze;return X&&typeof MutationObserver<"u"&&(ze=new MutationObserver(()=>ue()),ze.observe(X,{childList:!0})),()=>{je==null||je.disconnect(),ze==null||ze.disconnect()}},[]),E.useEffect(()=>{if(!S){A(0);return}const re=performance.now();A(0);const X=window.setInterval(()=>{A(performance.now()-re)},250);return()=>window.clearInterval(X)},[S]);function z(){var re;return typeof window<"u"&&typeof window.MediaRecorder<"u"&&!!((re=navigator.mediaDevices)!=null&&re.getUserMedia)}function F(re){const X=re.trim();if(!X)return;const je=t.trim().length>0?`${t.trim()} `:"";r(`${je}${X}`.trim())}async function $(re){if(re.length===0)return;H(null);const X=[];let je=!1;for(const ze of re)$_(ze)?X.push(ze):je=!0;je&&H(x("chatInput.unsupportedFile")),X.length!==0&&await Promise.all(X.map(async ze=>{j(Be=>[...Be,ze.name]);try{const Be=await l(ze);d(Ze=>[...Ze,Be])}catch(Be){const Ze=Be instanceof Error?Be.message:x("chatInput.uploadFailed");H(Ze)}finally{j(Be=>{const Ze=Be.indexOf(ze.name);return Ze===-1?Be:[...Be.slice(0,Ze),...Be.slice(Ze+1)]})}}))}function O(re){d(X=>X.filter(je=>je.id!==re))}async function te(){var re;if(G(null),!z()){G(x("chatInput.speechUnsupported"));return}if(!(n||M)){if(S){(re=q.current)==null||re.stop(),C(!1);return}try{const X=await navigator.mediaDevices.getUserMedia({audio:!0});B.current=X;const je=new MediaRecorder(X);q.current=je,W.current=[],je.ondataavailable=ze=>{ze.data&&ze.data.size>0&&W.current.push(ze.data)},je.onstop=async()=>{const ze=ee.current;ee.current=null;const Be=je.mimeType||"audio/webm",Ze=W.current;if(W.current=[],X.getTracks().forEach(kt=>kt.stop()),B.current=null,q.current=null,C(!1),!(ze==="cancel"||Ze.length===0)){R(!0);try{const kt=new Blob(Ze,{type:Be}),qe=(await o(kt,Be)).trim();if(!qe){G(x("chatInput.noSpeechDetected"));return}const Wt=[t.trim(),qe].filter(Boolean).join(" ").trim();ze==="confirm"?i(Wt):F(qe)}catch(kt){const it=kt instanceof Error?kt.message:x("chatInput.transcribeFailed");G(it)}finally{R(!1)}}},je.start(),C(!0)}catch{G(x("chatInput.micBlocked"))}}}function se(){var re;S&&(ee.current="cancel",(re=q.current)==null||re.stop(),W.current=[])}function de(){var re;S&&(ee.current="confirm",(re=q.current)==null||re.stop())}const le=S||M,Ae=D.length>0,Te=c.length>0,Oe=!n&&!le&&!Ae&&(t.trim().length>0||Te);return m.jsxs("div",{className:`composer-shell${n?" is-loading":""}`,ref:Z,children:[m.jsx("input",{ref:K,type:"file",multiple:!0,accept:bB,style:{display:"none"},onChange:re=>{const X=Array.from(re.target.files??[]);re.target.value="",$(X)}}),m.jsxs("div",{className:"composer-input-area",children:[(Te||Ae)&&!S?m.jsxs("div",{className:"composer-attachments",children:[c.map(re=>m.jsxs("div",{className:"composer-attachment-chip",title:re.name,children:[re.kind==="image"?m.jsx("img",{className:"composer-attachment-thumb",src:re.url,alt:""}):m.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:m.jsx(OL,{size:14})}),m.jsx("span",{className:"composer-attachment-name",children:re.name??(re.kind==="pdf"?"document.pdf":"image")}),m.jsx("button",{type:"button",className:"composer-attachment-remove",onClick:()=>O(re.id),"aria-label":x("chatInput.removeAttachment"),children:m.jsx(xo,{size:12})})]},re.id)),D.map((re,X)=>m.jsxs("div",{className:"composer-attachment-chip is-uploading",title:re,children:[m.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:m.jsx(s9,{size:14,className:"composer-spin"})}),m.jsx("span",{className:"composer-attachment-name",children:re})]},`uploading-${X}-${re}`))]}):null,!S&&m.jsx("textarea",{ref:V,placeholder:x("chatInput.placeholder"),value:t,onChange:re=>{r(re.target.value),ue()},onInput:()=>ue(),onPaste:re=>{var ze;const X=(ze=re.clipboardData)==null?void 0:ze.items;if(!X)return;const je=[];for(const Be of X){if(Be.kind!=="file")continue;const Ze=Be.getAsFile();Ze&&$_(Ze)&&je.push(Ze)}je.length!==0&&(re.preventDefault(),$(je))},onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&!le&&!Ae&&(re.preventDefault(),i())},rows:1}),S?m.jsxs("div",{className:"composer-input-note composer-input-note-listening",children:[m.jsx("span",{className:"composer-rec-dot","aria-hidden":"true"}),m.jsx("span",{className:"composer-rec-label",children:x("chatInput.listening")}),m.jsx("span",{className:"composer-rec-timer","aria-hidden":"true",children:yB(_)})]}):null,M?m.jsx("div",{className:"composer-input-note",children:x("chatInput.transcribing")}):null,I?m.jsx("div",{className:"composer-input-note composer-input-note-error",children:I}):null,L?m.jsx("div",{className:"composer-input-note composer-input-note-error",children:L}):null]}),m.jsxs("div",{className:"composer-actions",children:[!y&&!S&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"composer-ghost-btn composer-plus-btn",onClick:()=>{var re;return(re=K.current)==null?void 0:re.click()},disabled:n||Ae,"aria-label":x("chatInput.attachFile"),"data-tooltip":x("chatInput.attachFile"),children:m.jsx(m9,{size:16})}),b&&m.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn${p?" is-active":""}`,onClick:b,"aria-label":x(p?"chatInput.exitSelector":"chatInput.selectElement"),"data-tooltip":x(p?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":p,children:m.jsx(u9,{size:16})})]}),m.jsx("div",{className:"composer-actions-spacer"}),m.jsx("div",{className:"composer-actions-right",role:"group","aria-label":x("chatInput.voiceActions"),children:!y&&S?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"composer-ghost-btn composer-cancel-btn",onClick:se,disabled:n||M,"aria-label":x("chatInput.cancelVoice"),children:m.jsx(xo,{size:16})}),m.jsx("button",{type:"button",className:"composer-send-btn",onClick:de,disabled:n||M,"aria-label":x("chatInput.sendRecorded"),children:m.jsx(Dh,{size:16})})]}):m.jsxs(m.Fragment,{children:[!y&&k&&m.jsx("button",{type:"button",className:"composer-ghost-btn",onClick:()=>void te(),disabled:n||M,"aria-label":x("chatInput.startVoice"),children:m.jsx(a9,{size:16})}),m.jsxs("button",{type:"button",className:`composer-send-btn${n&&s?" is-stop":""}`,onClick:n&&s?s:()=>i(),disabled:!(n&&s)&&!Oe,"aria-label":x(n&&s?"chatInput.stopGeneration":"chatInput.sendMessage"),children:[m.jsx("span",{className:"icon-send",children:m.jsx(Gk,{size:16,strokeWidth:2.8})}),m.jsx("span",{className:"icon-stop",children:m.jsx(Zk,{size:12,fill:"currentColor"})})]})]})})]})]})}function xB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SB={};function U_(e,t){return(SB.jsx?kB:vB).test(e)}const wB=/[ \t\n\f\r]/g;function CB(e){return typeof e=="object"?e.type==="text"?H_(e.value):!1:H_(e)}function H_(e){return e.replace(wB,"")===""}let Rh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Rh.prototype.normal={};Rh.prototype.property={};Rh.prototype.space=void 0;function mD(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rh(n,r,t)}function yv(e){return e.toLowerCase()}class Fi{constructor(t,n){this.attribute=n,this.property=t}}Fi.prototype.attribute="";Fi.prototype.booleanish=!1;Fi.prototype.boolean=!1;Fi.prototype.commaOrSpaceSeparated=!1;Fi.prototype.commaSeparated=!1;Fi.prototype.defined=!1;Fi.prototype.mustUseProperty=!1;Fi.prototype.number=!1;Fi.prototype.overloadedBoolean=!1;Fi.prototype.property="";Fi.prototype.spaceSeparated=!1;Fi.prototype.space=void 0;let EB=0;const Tt=Iu(),mr=Iu(),xv=Iu(),Ie=Iu(),An=Iu(),Bc=Iu(),ns=Iu();function Iu(){return 2**++EB}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Tt,booleanish:mr,commaOrSpaceSeparated:ns,commaSeparated:Bc,number:Ie,overloadedBoolean:xv,spaceSeparated:An},Symbol.toStringTag,{value:"Module"})),T1=Object.keys(vv);class Kk extends Fi{constructor(t,n,r,i){let s=-1;if(super(t,n),V_(this,"space",i),typeof r=="number")for(;++s<T1.length;){const o=T1[s];V_(this,T1[s],(r&vv[o])===vv[o])}}}Kk.prototype.defined=!0;function V_(e,t,n){n&&(e[t]=n)}function pd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Kk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[yv(r)]=r,n[yv(s.attribute)]=r}return new Rh(t,n,e.space)}const gD=pd({properties:{ariaActiveDescendant:null,ariaAtomic:mr,ariaAutoComplete:null,ariaBusy:mr,ariaChecked:mr,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:An,ariaCurrent:null,ariaDescribedBy:An,ariaDetails:null,ariaDisabled:mr,ariaDropEffect:An,ariaErrorMessage:null,ariaExpanded:mr,ariaFlowTo:An,ariaGrabbed:mr,ariaHasPopup:null,ariaHidden:mr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:An,ariaLevel:Ie,ariaLive:null,ariaModal:mr,ariaMultiLine:mr,ariaMultiSelectable:mr,ariaOrientation:null,ariaOwns:An,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:mr,ariaReadOnly:mr,ariaRelevant:null,ariaRequired:mr,ariaRoleDescription:An,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:mr,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bD(e,t){return t in e?e[t]:t}function yD(e,t){return bD(e,t.toLowerCase())}const _B=pd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bc,acceptCharset:An,accessKey:An,action:null,allow:null,allowFullScreen:Tt,allowPaymentRequest:Tt,allowUserMedia:Tt,alt:null,as:null,async:Tt,autoCapitalize:null,autoComplete:An,autoFocus:Tt,autoPlay:Tt,blocking:An,capture:null,charSet:null,checked:Tt,cite:null,className:An,cols:Ie,colSpan:null,content:null,contentEditable:mr,controls:Tt,controlsList:An,coords:Ie|Bc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Tt,defer:Tt,dir:null,dirName:null,disabled:Tt,download:xv,draggable:mr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Tt,formTarget:null,headers:An,height:Ie,hidden:xv,high:Ie,href:null,hrefLang:null,htmlFor:An,httpEquiv:An,id:null,imageSizes:null,imageSrcSet:null,inert:Tt,inputMode:null,integrity:null,is:null,isMap:Tt,itemId:null,itemProp:An,itemRef:An,itemScope:Tt,itemType:An,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Tt,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:Tt,muted:Tt,name:null,nonce:null,noModule:Tt,noValidate:Tt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Tt,optimum:Ie,pattern:null,ping:An,placeholder:null,playsInline:Tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Tt,referrerPolicy:null,rel:An,required:Tt,reversed:Tt,rows:Ie,rowSpan:Ie,sandbox:An,scope:null,scoped:Tt,seamless:Tt,selected:Tt,shadowRootClonable:Tt,shadowRootDelegatesFocus:Tt,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:mr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:Tt,useMap:null,value:mr,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:An,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Tt,declare:Tt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:Tt,noHref:Tt,noShade:Tt,noWrap:Tt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:mr,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Tt,disableRemotePlayback:Tt,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:yD}),TB=pd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ns,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:An,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:Tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bc,g2:Bc,glyphName:Bc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:ns,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:An,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ns,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ns,rev:ns,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ns,requiredFeatures:ns,requiredFonts:ns,requiredFormats:ns,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:ns,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ns,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ns,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bD}),xD=pd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vD=pd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yD}),kD=pd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NB=/[A-Z]/g,q_=/-[a-z]/g,MB=/^data[-\w.:]+$/i;function DB(e,t){const n=yv(t);let r=t,i=Fi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&MB.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(q_,IB);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!q_.test(s)){let o=s.replace(NB,RB);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Kk}return new i(r,t)}function RB(e){return"-"+e.toLowerCase()}function IB(e){return e.charAt(1).toUpperCase()}const jB=mD([gD,_B,xD,vD,kD],"html"),Yk=mD([gD,TB,xD,vD,kD],"svg");function OB(e){return e.join(" ").trim()}var kc={},A1,G_;function zB(){if(G_)return A1;G_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
336
+ One per line.`,"sites.templateName":"Template name (e.g. Campaign Landing Page)","sites.templateDescription":"Describe the page structure: which sections, in what order, with what content focus.","sites.settings":"Settings","sites.openEditor":"Open editor","sites.deleteSite":"Delete","sites.confirmDelete":'Remove "{{name}}" from your site list?',"sites.confirmDeleteTitle":"Remove site","sites.confirmDeleteBody":'This removes "{{name}}" from your local site list. The site itself is not deleted.',"sites.switchingTo":"Switching to","sites.switchInFlight":"A chat request is still in progress. Switch sites anyway and discard it?","sites.allOffline":"No reachable sites","sites.allOfflineHint":'All sites in your list failed a quick reachability check. Toggle "Show offline sites" to see them, or check that the sites are running.',"sites.previewUrlOverride":"Overridden by ?previewUrl= in the current URL.","sites.orchestratorUrl":"Orchestrator URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Only for a site that runs the orchestrator itself (library mode). Leave empty to use the editor's own orchestrator.","sites.cancel":"Cancel","sites.create":"Create","sites.siteConfig":"Site Config","sites.general":"General","sites.media":"Media","sites.hosting":"Hosting","sites.brief":"Brief","sites.deploy":"Deploy","sites.coreSettings":"Core settings","sites.header":"Header","sites.siteHeaderName":"Site header name","sites.logoUrl":"Logo URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Page templates","sites.pageTemplatesHint":"Define reusable page structures. The AI will match templates by name or intent when creating pages.","sites.removeTemplate":"Remove","sites.addTemplate":"+ Add template","sites.preferredTone":"Preferred tone","sites.writingConstraints":"Writing constraints","sites.hostingPlaceholder":"Vercel production site","sites.vercelProjectId":"Vercel project ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel team ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel production URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel deploy hook URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google Drive folder ID","sites.googleDrivePlaceholder":"e.g. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Testing...","sites.test":"Test","sites.driveConnectedImages":"Connected (images found)","sites.driveConnectedEmpty":"Connected (folder empty)","sites.driveError":"Could not reach orchestrator","sites.cmsMedia":"CMS Media","sites.provider":"Provider","sites.none":"None","sites.spaceId":"Space ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery Token","sites.deliveryTokenPlaceholder":"Content Delivery API token","sites.projectId":"Project ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API Token","sites.apiTokenPlaceholder":"Read-only API token","sites.versionHistory":"Version History","sites.restoreDescription":"Restore a previous published snapshot into","sites.snapshotVersion":"Snapshot version","sites.loadingSnapshots":"Loading snapshots...","sites.restoring":"Restoring...","sites.restore":"Restore","sites.noSnapshots":"No snapshots available yet.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Pages","sites.snapshotHeading":"Heading","sites.snapshotDate":"Date","sites.checkingManifest":"Checking manifest...","sites.limitedEditing":"Limited editing","sites.editingReady":"Editing ready","sites.checking":"Checking...","chatInput.placeholder":"Ask anything","chatInput.listening":"Listening","chatInput.transcribing":"Transcribing...","chatInput.attachFile":"Attach file","chatInput.removeAttachment":"Remove attachment","chatInput.exitSelector":"Exit selector mode","chatInput.selectElement":"Select an element","chatInput.editingBlock":"Editing: {{block}}","chatInput.clearSelection":"Clear selection","chatInput.voiceActions":"Voice and send actions","chatInput.cancelVoice":"Cancel voice input","chatInput.sendRecorded":"Send recorded message","chatInput.startVoice":"Start voice input","chatInput.stopGeneration":"Stop generation","chatInput.sendMessage":"Send message","chatInput.speechUnsupported":"Speech input is not supported in this browser.","chatInput.noSpeechDetected":"No speech detected. Try recording again.","chatInput.micBlocked":"Microphone access is blocked. Please allow mic permissions and try again.","chatInput.unsupportedFile":"Only images and PDF files are supported.","chatInput.attachmentOnlyMessage":"Use the attached file(s).","chatInput.uploadFailed":"Upload failed. Please try again.","chatInput.transcribeFailed":"Failed to transcribe audio.","imagePicker.title":"Asset Manager","imagePicker.close":"Close","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Search media library…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Upload","imagePicker.generate":"Generate","imagePicker.searchDrive":"Search Drive images...","imagePicker.searchUnsplash":"Search Unsplash photos...","imagePicker.search":"Search...","imagePicker.refreshDrive":"Refresh from Drive","imagePicker.searching":"Searching...","imagePicker.typeToSearch":"Type to search Unsplash","imagePicker.noImages":"No images found","imagePicker.loadMore":"Load more","imagePicker.loading":"Loading...","imagePicker.uploadFromComputer":"Upload from computer","imagePicker.uploading":"Uploading...","imagePicker.chooseDifferent":"Choose different file","imagePicker.orPasteUrl":"or paste a URL","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Uploaded image","imagePicker.examplePrompt":"Make it warmer","imagePicker.editPrompt":"Describe how to change this image…","imagePicker.generatePrompt":"Describe the image you want…","imagePicker.followUpPrompt":"Ask for changes…","imagePicker.refine":"Refine","imagePicker.edit":"Edit","imagePicker.closePreview":"Close preview","imagePicker.ready":"Ready","imagePicker.editThisImage":"Edit this image","imagePicker.editThisImageDesc":"Describe changes to the current image","imagePicker.generateNew":"Generate new","imagePicker.generateNewDesc":"Create a completely new image from scratch","imagePicker.useImage":"Use image","imagePicker.applyUrl":"Apply URL","imagePicker.removeReference":"Remove reference","imagePicker.attachReference":"Attach example images for AI to reference (up to {{max}})","imagePicker.showOriginal":"Show original","imagePicker.showEdited":"Show edited","propertyPanel.loading":"Loading...","propertyPanel.loadFailed":"Failed to load block properties","propertyPanel.loadFailedMissing":"This block is not in the page the orchestrator returned","propertyPanel.loadFailedMissingHint":"The preview and the orchestrator may be pointed at different sites. Check the site's Orchestrator URL in its settings.","propertyPanel.loadFailedNoPage":"This page is not in the draft","propertyPanel.loadFailedNoPageHint":"The orchestrator answered, but it has no page at this address for this session — either the editor is on a page this draft does not have, or it is asking an orchestrator that does not host this site.","propertyPanel.loadFailedUnreachableHint":"Nothing answered at this address. Check that the orchestrator is running.","propertyPanel.retry":"Try again","orchestratorMismatch.title":"You are editing another site's content","orchestratorMismatch.detail":"{{orchestrator}} does not host this site, so the pages, preview and properties on this screen belong to whatever it does host.","orchestratorMismatch.detailHosts":"{{orchestrator}} hosts {{hosted}} — not this site — so the pages, preview and properties on this screen are that site's, under this site's name.","orchestratorMismatch.useDefault":"Use the editor's own orchestrator","propertyPanel.unknownBlock":"Unknown block type:","propertyPanel.page":"Page","propertyPanel.close":"Close properties","propertyPanel.navLabel":"Nav label","propertyPanel.change":"Change","propertyPanel.chooseImage":"Choose image","propertyPanel.remove":"Remove","propertyPanel.altText":"Alt text","propertyPanel.altPlaceholder":"Describe what's in this image","propertyPanel.navPlaceholder":"Page","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO title","propertyPanel.seoTitlePlaceholder":"Defaults to page title","propertyPanel.metaDescription":"Meta description","propertyPanel.metaDescPlaceholder":"Defaults to generated description","propertyPanel.ogImage":"Open Graph image URL","welcome.greeting":"Welcome to {{name}}! Tell me what you'd like to change — I can add sections, rewrite copy, create new pages, and more.","welcome.greetingFallback":"Let's shape your site into something people remember. Tell me what you'd like to change.","welcome.greetingDemo":"Welcome to {{name}} — this is a demo site so you can try things out. Edit anything you like, browse the [component catalogue]({{catalogueUrl}}) to see what's available, and when you're ready, [onboard your own site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Rewrite the hero headline","suggestion.addTestimonials":"Add a testimonials section","suggestion.addFaq":"Add an FAQ section","suggestion.addCta":"Add a call-to-action","suggestion.changeHeadline":"Change the headline and subheading","suggestion.addSection":"Add a new section","suggestion.rewriteTone":"Rewrite the copy to sound more {{tone}}","suggestion.createFromTemplate":"Create a new {{name}} page","suggestion.createAbout":"Create a new /about page","suggestion.demoTranslate":"Translate the whole page to German","suggestion.demoAddFaq":"Add an FAQ section","suggestion.demoHeroCta":"Turn the hero into a bold call-to-action","streamError.failed":"Streaming request failed.","streamError.retrying":"Streaming failed, retrying with standard request...","streamError.canceling":"Canceling...","streamError.canceled":"Stopped this request.","streamError.structuralDisabled":"Structural edits are disabled for this site context.","streamError.demoQuotaExhausted":"This live demo is shared by everyone and has reached its usage limit for now. Please try again in a few minutes — anything you've already created is still here.","ops.addedItem":"Added list item.","ops.deletedBlock":"Deleted block.","ops.changedImage":"Changed image.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Couldn't change the image. Please try again.","ops.imageSwap.pickAnother":"Change","ops.imageSwap.retry":"Try again","ops.continueNext":"Continue to next step","plan.apply":"Apply","plan.applyDestructive":"Apply changes","plan.deletePage":"Delete page","plan.deletePages":"Delete {{count}} pages","plan.discard":"Discard","fieldAi.generateAlt":"Generate alt text","fieldAi.improveAccessibility":"Improve accessibility","fieldAi.makeDescriptive":"Make more descriptive","fieldAi.optimizeSearch":"Optimize for search ranking","fieldAi.fitTitle":"Fit within 60 characters","fieldAi.addKeyword":"Add primary keyword","fieldAi.suggest3":"Suggest 3 alternatives","fieldAi.optimizeCtr":"Optimize for click-through rate","fieldAi.fitDescription":"Fit within 160 characters","fieldAi.addCallToAction":"Add a call to action","fieldAi.simplifyLanguage":"Simplify language","fieldAi.expandDetail":"Expand with more detail","fieldAi.makeConcise":"Make more concise","fieldAi.improveClarity":"Improve clarity","fieldAi.adjustTone":"Adjust tone to be more professional","error.heading":"Something went wrong","error.message":"An unexpected error occurred while loading this page. Please try again.","error.tryAgain":"Try again","notFound.code":"404","notFound.heading":"Page not found","notFound.message":"The page you're looking for doesn't exist or has been moved.","notFound.backHome":"Back to home","theme.switchLight":"Switch site to light mode","theme.switchDark":"Switch site to dark mode","theme.light":"Light mode","theme.dark":"Dark mode","sitesAgent.title":"Onboarding agent","sitesAgent.clear":"Clear chat","sitesAgent.welcome":"I can create a new site from scratch, migrate an existing website from its URL, or integrate the editor into your Next.js project. Heads up: this is early — treat my first pass as a draft you'll refine in the editor, especially for migrations of complex sites. What would you like to do?","sitesAgent.placeholder":"Ask me anything...","sitesAgent.suggestion1":"Create a new site from scratch","sitesAgent.suggestion1Desc":"Describe your site's purpose and I'll scaffold it","sitesAgent.suggestion2":"Migrate a website from URL","sitesAgent.suggestion2Desc":"Give me a URL and I'll analyze and recreate it","sitesAgent.suggestion3":"Integrate using a GitHub project","sitesAgent.suggestion3Desc":"Connect the editor to your existing Next.js app","sitesAgent.stop":"Stop","sitesAgent.showMore":"Show more","sitesAgent.showLess":"Show less"},H9={"header.siteSettings":"Seiteneinstellungen","header.syncFromSite":"Von Seite laden","header.syncFromSiteTitle":"Neueste Inhalte aus der Quelle dieser Seite laden","header.allSites":"Alle Seiten","header.page":"Seite","header.language":"Sprache","header.pagesWithoutLanguage":"Ohne Sprachzuordnung","header.viewAllSites":"Alle Websites anzeigen","header.limited":"Eingeschränkt","header.demoMode":"Demomodus","demo.bannerTitle":"Du bist im Demomodus","demo.bannerBody":"Das ist ein Live-Playground. Du kannst die Hero-Sektion per Klartext bearbeiten — alles andere ist vorerst gesperrt.","demo.tryExample1":'Ändere die Hero-Überschrift zu "Willkommen auf meiner neuen Seite"',"demo.tryExample2":"Lass die Hero-Unterzeile verspielter klingen","demo.tryExample3":'Aktualisiere den Hero-CTA zu "Jetzt starten"',"demo.placeholder":"Versuch: ändere die Hero-Überschrift zu …","demoGuide.title":"Erste Schritte","demoGuide.try":"Ausprobieren","demoGuide.dismiss":"Schließen","demoGuide.step1Title":"Hero-Überschrift & Unterzeile neu schreiben","demoGuide.step1Prompt":"Schreibe die Hero-Überschrift und Unterzeile überzeugender und nutzenorientierter","demoGuide.step2Title":"Statistik-Leiste hinzufügen","demoGuide.step2Prompt":"Füge unter dem Hero eine Statistik-Leiste mit ein paar beeindruckenden Zahlen hinzu","demoGuide.step3Title":"Hero-Bild austauschen","demoGuide.step3Prompt":"Gib der ganzen Seite ein warmes, erdiges grünes Farbthema","demoGuide.step4Title":"Seite übersetzen","demoGuide.step4Prompt":"Übersetze die ganze Seite ins Deutsche","header.moreOptions":"Weitere Optionen","header.publish":"Veröffentlichen","header.publishing":"Wird veröffentlicht","header.unpublishedTooltip":"{{count}} unveröffentlichte Änderung(en) seit der letzten Veröffentlichung.","header.viewDeploy":"Deployment ansehen","header.openLiveSite":"Live-Seite öffnen","header.openImmersive":"Im Immersive-Modus öffnen","header.syncedPage":"1 Seite von der Website geladen.","header.syncedPages":"{{count}} Seiten von der Website geladen.","header.syncFailedNetwork":"Diese Seite ist nicht erreichbar. Prüfe, ob sie läuft, und versuch es erneut.","header.syncFailedEmpty":"Diese Seite hat keine Quellinhalte zum Laden.","tabs.chat":"Chat","tabs.properties":"Eigenschaften","stream.shapingUpdate":"Änderung wird vorbereitet…","stream.gettingReady":"Wird vorbereitet…","stream.updating":"Wird aktualisiert…","stream.thinking":"Denkt nach","chat.thinking.streaming":"Denkt nach…","chat.thinking.doneSeconds":"{{seconds}} s nachgedacht","chat.thinking.done":"Gedankengang","chat.thinking.showMore":"Gedanken anzeigen","chat.thinking.showLess":"Gedanken ausblenden","chat.expandDetails":"Details anzeigen","chat.copied":"Kopiert","chat.copyDebug":"Debug-Nachricht kopieren","chat.copy":"Kopieren","chat.undone":"Rückgängig gemacht","chat.undo":"Rückgängig","chat.appliedDraft":"Auf deinen Entwurf angewendet","chat.keep":"Behalten","chat.revert":"Zurücksetzen","chat.reverted":"Zurückgesetzt","chat.kept":"Behalten","chat.redo":"Wiederherstellen","chat.undoTooltip":"Rückgängig (Strg+Z)","chat.redoTooltip":"Wiederherstellen (Strg+Y)","history.title":"Versionshistorie","history.loading":"Historie wird geladen...","history.empty":"Noch keine Änderungen.","history.operation":"Operation","history.operations":"Operationen","history.tooltip":"Versionshistorie","history.restore":"Auf diese zurücksetzen","history.restoring":"Wird zurückgesetzt...","history.current":"Aktuell","history.showDetails":"Details anzeigen","history.hideDetails":"Details ausblenden","history.version":"Version","history.page":"Seite","history.changes":"Änderungen","history.publish":"Veröffentlichung","history.deploying":"Wird bereitgestellt…","history.live":"Live","history.deployFailed":"Fehlgeschlagen","history.viewDeploy":"Deploy ansehen","history.pagesPublished":"{{count}} Seiten","history.pagePublished":"1 Seite","history.pagesChanged":"{{changed}} von {{total}} Seiten geändert","history.noContentChanges":"Keine inhaltlichen Änderungen · {{count}} Seiten live","chat.goodResponse":"Gute Antwort","chat.badResponse":"Schlechte Antwort","chat.feedbackThanks":"Danke!","chat.feedbackNoted":"Notiert","chat.feedbackPlaceholder":"Was war falsch? (optional)","chat.feedbackSend":"Senden","variation.title":"Variante wählen","variation.close":"Variantenauswahl schließen","variation.applying":"Wird angewendet…","variation.apply":'"{{title}}" anwenden',"addBlock.title":"Block hinzufügen","addBlock.close":"Blockauswahl schließen","addBlock.insertAbove":"Blocktyp auswählen, der oberhalb des ausgewählten Bereichs eingefügt wird.","addBlock.insertBelow":"Blocktyp auswählen, der unterhalb des ausgewählten Bereichs eingefügt wird.","addBlock.searchPlaceholder":"Blocktypen durchsuchen","resize.inputPanel":"Eingabebereich skalieren","resize.chatPanel":"Chatbereich skalieren","preview.title":"Live-Vorschau","preview.loading":"Vorschau wird geladen…","settings.title":"Einstellungen","settings.devTitle":"Entwicklermodus","settings.developerMode":"Entwicklermodus","settings.streaming":"Streaming","settings.nestedLabels":"Verschachtelte Labels","settings.fieldDraftTelemetry":"Feld-Entwurfs-Telemetrie","settings.darkMode":"Dunkler Modus","settings.autoScrollTracking":"Generiertem Inhalt folgen","settings.debugMode":"Debug-Modus","settings.model":"Modell","settings.advanced":"Erweitert","settings.clearChat":"Chat leeren","settings.language":"Sprache","password.title":"Editor-Zugang","password.placeholder":"Passwort","password.incorrect":"Falsches Passwort","password.checking":"Wird geprüft…","password.continue":"Weiter","sites.title":"Websites","sites.subtitle":"Wähle eine Website zum Bearbeiten.","sites.addSite":"Website hinzufügen","sites.addSiteTitle":"Website hinzufügen","sites.close":"Schließen","sites.siteName":"Seitenname","sites.siteNamePlaceholder":"Meine Website","sites.previewUrl":"Vorschau-URL","sites.previewUrlPlaceholder":"http://localhost:3000","sites.enablePuck":"Visuellen Editor (Puck) verwenden","sites.editorialBrief":"Redaktionelles Briefing","sites.overview":"Übersicht","sites.tone":"Tonalität","sites.constraints":"Einschränkungen","sites.templates":"Vorlagen","sites.overviewPlaceholder":"Wofür diese Seite gedacht ist.","sites.tonePlaceholder":"Wie der Text klingen soll.","sites.constraintsPlaceholder":`Regeln für die Inhaltsausgabe.
337
+ Eine pro Zeile.`,"sites.templateName":"Vorlagenname (z. B. Kampagnen-Landingpage)","sites.templateDescription":"Beschreibe die Seitenstruktur: welche Bereiche, in welcher Reihenfolge, mit welchem inhaltlichen Fokus.","sites.settings":"Einstellungen","sites.openEditor":"Editor öffnen","sites.deleteSite":"Löschen","sites.confirmDelete":'"{{name}}" aus der Siteliste entfernen?',"sites.confirmDeleteTitle":"Site entfernen","sites.confirmDeleteBody":'Damit wird "{{name}}" aus deiner lokalen Siteliste entfernt. Die Site selbst wird nicht gelöscht.',"sites.switchingTo":"Wechsle zu","sites.switchInFlight":"Eine Chat-Anfrage läuft noch. Trotzdem die Site wechseln und sie verwerfen?","sites.allOffline":"Keine erreichbaren Sites","sites.allOfflineHint":'Alle Sites in deiner Liste haben den Erreichbarkeitstest nicht bestanden. Aktiviere "Offline-Sites anzeigen" oder prüfe, ob die Sites laufen.',"sites.previewUrlOverride":"Wird durch ?previewUrl= in der aktuellen URL überschrieben.","sites.orchestratorUrl":"Orchestrator-URL","sites.orchestratorUrlPlaceholder":"https://example.com/api/avocado","sites.orchestratorUrlHint":"Nur für Sites, die den Orchestrator selbst betreiben (Library-Modus). Leer lassen, um den Orchestrator des Editors zu verwenden.","sites.cancel":"Abbrechen","sites.create":"Erstellen","sites.siteConfig":"Seitenkonfiguration","sites.general":"Allgemein","sites.media":"Medien","sites.hosting":"Hosting","sites.brief":"Briefing","sites.deploy":"Deployment","sites.coreSettings":"Grundeinstellungen","sites.header":"Kopfzeile","sites.siteHeaderName":"Name in der Kopfzeile","sites.logoUrl":"Logo-URL","sites.logoUrlPlaceholder":"https://example.com/logo.svg","sites.pageTemplates":"Seitenvorlagen","sites.pageTemplatesHint":"Definiere wiederverwendbare Seitenstrukturen. Die KI ordnet Vorlagen bei der Seitenerstellung nach Name oder Absicht zu.","sites.removeTemplate":"Entfernen","sites.addTemplate":"+ Vorlage hinzufügen","sites.preferredTone":"Bevorzugte Tonalität","sites.writingConstraints":"Schreibregeln","sites.hostingPlaceholder":"Vercel-Produktionsseite","sites.vercelProjectId":"Vercel-Projekt-ID","sites.vercelProjectIdPlaceholder":"prj_...","sites.vercelTeamId":"Vercel-Team-ID","sites.vercelTeamIdPlaceholder":"team_...","sites.vercelProductionUrl":"Vercel-Produktions-URL","sites.vercelProductionUrlPlaceholder":"https://example.vercel.app","sites.vercelDeployHook":"Vercel-Deploy-Hook-URL","sites.vercelDeployHookPlaceholder":"https://api.vercel.com/v1/integrations/deploy/...","sites.googleDrive":"Google Drive","sites.googleDriveFolderId":"Google-Drive-Ordner-ID","sites.googleDrivePlaceholder":"z. B. 1aBcDeFgHiJkLmNoPqRsTuVwXyZ","sites.testing":"Wird getestet…","sites.test":"Testen","sites.driveConnectedImages":"Verbunden (Bilder gefunden)","sites.driveConnectedEmpty":"Verbunden (Ordner leer)","sites.driveError":"Orchestrator nicht erreichbar","sites.cmsMedia":"CMS-Medien","sites.provider":"Anbieter","sites.none":"Keiner","sites.spaceId":"Space-ID","sites.spaceIdPlaceholder":"abc123","sites.deliveryToken":"Delivery-Token","sites.deliveryTokenPlaceholder":"Content-Delivery-API-Token","sites.projectId":"Projekt-ID","sites.dataset":"Dataset","sites.datasetPlaceholder":"production","sites.strapiUrl":"Strapi-URL","sites.strapiUrlPlaceholder":"http://localhost:1337","sites.apiToken":"API-Token","sites.apiTokenPlaceholder":"Nur-Lese-API-Token","sites.versionHistory":"Versionshistorie","sites.restoreDescription":"Einen früheren veröffentlichten Snapshot wiederherstellen in","sites.snapshotVersion":"Snapshot-Version","sites.loadingSnapshots":"Snapshots werden geladen…","sites.restoring":"Wird wiederhergestellt…","sites.restore":"Wiederherstellen","sites.noSnapshots":"Noch keine Snapshots vorhanden.","sites.snapshotCommit":"Commit","sites.snapshotPages":"Seiten","sites.snapshotHeading":"Überschrift","sites.snapshotDate":"Datum","sites.checkingManifest":"Manifest wird geprüft…","sites.limitedEditing":"Eingeschränktes Bearbeiten","sites.editingReady":"Bearbeitung bereit","sites.checking":"Wird geprüft…","chatInput.placeholder":"Frag mich etwas","chatInput.listening":"Hört zu","chatInput.transcribing":"Wird transkribiert…","chatInput.attachFile":"Datei anhängen","chatInput.removeAttachment":"Anhang entfernen","chatInput.exitSelector":"Auswahlmodus beenden","chatInput.selectElement":"Element auswählen","chatInput.editingBlock":"Bearbeiten: {{block}}","chatInput.clearSelection":"Auswahl aufheben","chatInput.voiceActions":"Sprach- und Sendeaktionen","chatInput.cancelVoice":"Spracheingabe abbrechen","chatInput.sendRecorded":"Aufgenommene Nachricht senden","chatInput.startVoice":"Spracheingabe starten","chatInput.stopGeneration":"Generierung stoppen","chatInput.sendMessage":"Nachricht senden","chatInput.speechUnsupported":"Spracheingabe wird in diesem Browser nicht unterstützt.","chatInput.noSpeechDetected":"Keine Sprache erkannt. Bitte erneut aufnehmen.","chatInput.micBlocked":"Mikrofonzugriff ist blockiert. Bitte Mikrofonberechtigungen erlauben und erneut versuchen.","chatInput.unsupportedFile":"Nur Bilder und PDF-Dateien werden unterstützt.","chatInput.attachmentOnlyMessage":"Verwende die angehängte(n) Datei(en).","chatInput.uploadFailed":"Upload fehlgeschlagen. Bitte erneut versuchen.","chatInput.transcribeFailed":"Audiotranskription fehlgeschlagen.","imagePicker.title":"Asset-Manager","imagePicker.close":"Schließen","imagePicker.drive":"Drive","imagePicker.cms":"CMS","imagePicker.searchCms":"Medienbibliothek durchsuchen…","imagePicker.unsplash":"Unsplash","imagePicker.upload":"Hochladen","imagePicker.generate":"Generieren","imagePicker.searchDrive":"Drive-Bilder durchsuchen…","imagePicker.searchUnsplash":"Unsplash-Fotos durchsuchen…","imagePicker.search":"Suchen…","imagePicker.refreshDrive":"Von Drive aktualisieren","imagePicker.searching":"Wird gesucht…","imagePicker.typeToSearch":"Suchbegriff eingeben","imagePicker.noImages":"Keine Bilder gefunden","imagePicker.loadMore":"Mehr laden","imagePicker.loading":"Wird geladen…","imagePicker.uploadFromComputer":"Vom Computer hochladen","imagePicker.uploading":"Wird hochgeladen…","imagePicker.chooseDifferent":"Andere Datei wählen","imagePicker.orPasteUrl":"oder URL einfügen","imagePicker.urlPlaceholder":"https://example.com/image.jpg","imagePicker.uploadedImage":"Hochgeladenes Bild","imagePicker.examplePrompt":"Wärmer machen","imagePicker.editPrompt":"Beschreibe, wie das Bild geändert werden soll…","imagePicker.generatePrompt":"Beschreibe das gewünschte Bild…","imagePicker.followUpPrompt":"Änderungen beschreiben…","imagePicker.refine":"Verfeinern","imagePicker.edit":"Bearbeiten","imagePicker.closePreview":"Vorschau schließen","imagePicker.ready":"Fertig","imagePicker.editThisImage":"Dieses Bild bearbeiten","imagePicker.editThisImageDesc":"Änderungen am aktuellen Bild beschreiben","imagePicker.generateNew":"Neu generieren","imagePicker.generateNewDesc":"Ein komplett neues Bild von Grund auf erstellen","imagePicker.useImage":"Bild verwenden","imagePicker.applyUrl":"URL anwenden","imagePicker.removeReference":"Referenz entfernen","imagePicker.attachReference":"Beispielbilder als Referenz anhängen (bis zu {{max}})","imagePicker.showOriginal":"Original anzeigen","imagePicker.showEdited":"Bearbeitet anzeigen","propertyPanel.loading":"Wird geladen…","propertyPanel.loadFailed":"Blockeigenschaften konnten nicht geladen werden","propertyPanel.loadFailedMissing":"Dieser Block ist nicht in der Seite, die der Orchestrator zurückgegeben hat","propertyPanel.loadFailedMissingHint":"Vorschau und Orchestrator zeigen möglicherweise auf verschiedene Sites. Prüfe die Orchestrator-URL in den Einstellungen der Site.","propertyPanel.loadFailedNoPage":"Diese Seite ist nicht im Entwurf","propertyPanel.loadFailedNoPageHint":"Der Orchestrator hat geantwortet, kennt aber unter dieser Adresse keine Seite für diese Session — entweder ist der Editor auf einer Seite, die dieser Entwurf nicht hat, oder er fragt einen Orchestrator, der diese Site nicht bereitstellt.","propertyPanel.loadFailedUnreachableHint":"Unter dieser Adresse hat nichts geantwortet. Prüfe, ob der Orchestrator läuft.","propertyPanel.retry":"Erneut versuchen","orchestratorMismatch.title":"Du bearbeitest die Inhalte einer anderen Site","orchestratorMismatch.detail":"{{orchestrator}} stellt diese Site nicht bereit — Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu der Site, die dort tatsächlich liegt.","orchestratorMismatch.detailHosts":"{{orchestrator}} stellt {{hosted}} bereit — nicht diese Site. Seiten, Vorschau und Eigenschaften auf diesem Bildschirm gehören zu jener Site, unter dem Namen dieser.","orchestratorMismatch.useDefault":"Orchestrator des Editors verwenden","propertyPanel.unknownBlock":"Unbekannter Blocktyp:","propertyPanel.page":"Seite","propertyPanel.close":"Eigenschaften schließen","propertyPanel.navLabel":"Nav-Label","propertyPanel.change":"Ändern","propertyPanel.chooseImage":"Bild wählen","propertyPanel.remove":"Entfernen","propertyPanel.altText":"Alt-Text","propertyPanel.altPlaceholder":"Beschreibe, was auf dem Bild zu sehen ist","propertyPanel.navPlaceholder":"Seite","propertyPanel.seo":"SEO","propertyPanel.seoTitle":"SEO-Titel","propertyPanel.seoTitlePlaceholder":"Standardmäßig der Seitentitel","propertyPanel.metaDescription":"Meta-Beschreibung","propertyPanel.metaDescPlaceholder":"Standardmäßig generierte Beschreibung","propertyPanel.ogImage":"Open-Graph-Bild-URL","welcome.greeting":"Willkommen bei {{name}}! Sag mir, was du ändern möchtest — ich kann Bereiche hinzufügen, Texte umschreiben, neue Seiten erstellen und mehr.","welcome.greetingFallback":"Lass uns deine Seite in etwas Besonderes verwandeln. Ich kann Bereiche hinzufügen, Texte umschreiben, Blöcke umordnen, neue Seiten erstellen und mehr. Klicke auf etwas in der Vorschau oder sag mir, was du ändern möchtest.","welcome.greetingDemo":"Willkommen bei {{name}} — das ist eine Demo-Site zum Ausprobieren. Bearbeite, was du willst, schau dir den [Komponenten-Katalog]({{catalogueUrl}}) an, um zu sehen, was verfügbar ist, und wenn du bereit bist, [onboarde deine eigene Site](https://docs.avocadostudio.dev/sites).","suggestion.rewriteHero":"Hero-Überschrift umschreiben","suggestion.addTestimonials":"Einen Testimonial-Bereich hinzufügen","suggestion.addFaq":"Einen FAQ-Bereich hinzufügen","suggestion.addCta":"Einen Call-to-Action hinzufügen","suggestion.changeHeadline":"Überschrift und Untertitel ändern","suggestion.addSection":"Neuen Bereich hinzufügen","suggestion.rewriteTone":"Text umschreiben: mehr {{tone}}","suggestion.createFromTemplate":"Neue {{name}}-Seite erstellen","suggestion.createAbout":"Eine neue /about-Seite erstellen","suggestion.demoTranslate":"Übersetze die ganze Seite ins Deutsche","suggestion.demoAddFaq":"Einen FAQ-Bereich hinzufügen","suggestion.demoHeroCta":"Mach aus dem Hero einen starken Call-to-Action","streamError.failed":"Streaming-Anfrage fehlgeschlagen.","streamError.retrying":"Streaming fehlgeschlagen, wird mit Standardanfrage wiederholt…","streamError.canceling":"Wird abgebrochen…","streamError.canceled":"Vorgang gestoppt.","streamError.structuralDisabled":"Strukturelle Bearbeitungen sind für diesen Seitenkontext deaktiviert.","streamError.demoQuotaExhausted":"Diese Live-Demo wird von allen genutzt und hat vorerst ihr Nutzungslimit erreicht. Bitte versuchen Sie es in ein paar Minuten erneut – alles, was Sie bereits erstellt haben, bleibt erhalten.","ops.addedItem":"Listenelement hinzugefügt.","ops.deletedBlock":"Block gelöscht.","ops.changedImage":"Bild geändert.","ops.replacedImageAt":"{{block}} · {{field}}","ops.imageChangeFailed":"Bild konnte nicht geändert werden. Bitte erneut versuchen.","ops.imageSwap.pickAnother":"Ändern","ops.imageSwap.retry":"Erneut versuchen","ops.continueNext":"Weiter zum nächsten Schritt","plan.apply":"Übernehmen","plan.applyDestructive":"Änderungen übernehmen","plan.deletePage":"Seite löschen","plan.deletePages":"{{count}} Seiten löschen","plan.discard":"Verwerfen","fieldAi.generateAlt":"Alt-Text generieren","fieldAi.improveAccessibility":"Barrierefreiheit verbessern","fieldAi.makeDescriptive":"Beschreibender gestalten","fieldAi.optimizeSearch":"Für Suchranking optimieren","fieldAi.fitTitle":"Auf 60 Zeichen kürzen","fieldAi.addKeyword":"Primäres Schlüsselwort hinzufügen","fieldAi.suggest3":"3 Alternativen vorschlagen","fieldAi.optimizeCtr":"Für Klickrate optimieren","fieldAi.fitDescription":"Auf 160 Zeichen kürzen","fieldAi.addCallToAction":"Handlungsaufforderung hinzufügen","fieldAi.simplifyLanguage":"Sprache vereinfachen","fieldAi.expandDetail":"Mit mehr Details erweitern","fieldAi.makeConcise":"Prägnanter formulieren","fieldAi.improveClarity":"Verständlichkeit verbessern","fieldAi.adjustTone":"Ton professioneller gestalten","error.heading":"Etwas ist schiefgelaufen","error.message":"Beim Laden dieser Seite ist ein unerwarteter Fehler aufgetreten. Bitte versuche es erneut.","error.tryAgain":"Erneut versuchen","notFound.code":"404","notFound.heading":"Seite nicht gefunden","notFound.message":"Die gesuchte Seite existiert nicht oder wurde verschoben.","notFound.backHome":"Zurück zur Startseite","theme.switchLight":"Seite in den hellen Modus wechseln","theme.switchDark":"Seite in den dunklen Modus wechseln","theme.light":"Heller Modus","theme.dark":"Dunkler Modus","sitesAgent.title":"Onboarding-Agent","sitesAgent.clear":"Chat leeren","sitesAgent.welcome":"Ich kann eine neue Seite erstellen, eine bestehende Website von ihrer URL migrieren oder den Editor in dein Next.js-Projekt integrieren. Hinweis: Das ist noch früh — behandle meinen ersten Wurf als Entwurf, den du im Editor verfeinerst, besonders bei Migrationen komplexer Seiten. Was möchtest du tun?","sitesAgent.placeholder":"Frag mich etwas...","sitesAgent.suggestion1":"Neue Seite von Grund auf erstellen","sitesAgent.suggestion1Desc":"Beschreibe den Zweck deiner Seite und ich erstelle sie","sitesAgent.suggestion2":"Website von URL migrieren","sitesAgent.suggestion2Desc":"Gib mir eine URL und ich analysiere und erstelle sie neu","sitesAgent.suggestion3":"Über ein GitHub-Projekt integrieren","sitesAgent.suggestion3Desc":"Verbinde den Editor mit deiner bestehenden Next.js-App","sitesAgent.stop":"Stopp","sitesAgent.showMore":"Mehr anzeigen","sitesAgent.showLess":"Weniger anzeigen"},fv={en:U9,de:H9},iD="editor-locale",sD={en:"English",de:"Deutsch"};function oD(){try{const e=localStorage.getItem(iD);if(e&&e in fv)return e}catch{}return"en"}function aD(e){return(t,n)=>{let r=fv[e][t]??fv.en[t]??t;if(n)for(const[i,s]of Object.entries(n))r=r.replaceAll(`{{${i}}}`,String(s));return r}}function V9(e){return aD(e)}const lD=E.createContext(null);function q9({children:e}){const[t,n]=E.useState(oD),r=E.useCallback(o=>{try{localStorage.setItem(iD,o)}catch{}n(o)},[]),i=E.useMemo(()=>aD(t),[t]),s=E.useMemo(()=>({locale:t,setLocale:r,t:i}),[t,r,i]);return m.jsx(lD,{value:s,children:e})}function yr(){const e=E.useContext(lD);if(!e)throw new Error("useT must be used within <LocaleProvider>");return e}const O_=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const b=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,b))}},i=()=>t,l={setState:r,getState:i,getInitialState:()=>c,subscribe:d=>(n.add(d),()=>n.delete(d))},c=t=e(r,i,l);return l},G9=(e=>e?O_(e):O_),Z9=e=>e;function W9(e,t=Z9){const n=kn.useSyncExternalStore(e.subscribe,kn.useCallback(()=>t(e.getState()),[e,t]),kn.useCallback(()=>t(e.getInitialState()),[e,t]));return kn.useDebugValue(n),n}const z_=e=>{const t=G9(e),n=r=>W9(t,r);return Object.assign(n,t),n},uD=(e=>e?z_(e):z_),K9=e=>(t,n,r)=>{const i=r.subscribe;return r.subscribe=((o,l,c)=>{let d=o;if(l){const h=(c==null?void 0:c.equalityFn)||Object.is;let p=o(r.getState());d=b=>{const y=o(b);if(!h(p,y)){const x=p;l(p=y,x)}},c!=null&&c.fireImmediately&&l(p,p)}return i(d)}),e(t,n,r)},Y9=K9,P_="__ai_justification__:",L_="__ai_performance__:",cD="editor-debug-mode-v1",dD="editor-model-key-v1",fD="editor-provider-v1",sg="editor-chat-theme-v1",hv="editor-dev-options-v1",pv="editor-chat-width-v1",mv="editor-props-width-v1",B_=340,J9=720,F_=300,X9=560;function gv(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(B_,Math.min(J9,n*.5));return Math.max(B_,Math.min(e,r))}function Q9(){if(typeof window>"u")return null;const e=window.localStorage.getItem(pv);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:gv(t)}function bv(e,t){const n=typeof window<"u"?window.innerWidth:1440,r=Math.max(F_,Math.min(X9,n*.4));return Math.max(F_,Math.min(e,r))}function eB(){if(typeof window>"u")return null;const e=window.localStorage.getItem(mv);if(!e)return null;const t=Number.parseInt(e,10);return!Number.isFinite(t)||t<=0?null:bv(t)}function tB(){const e=/^(1|true|yes|on)$/i.test("");if(typeof window>"u")return e;const n=new URLSearchParams(window.location.search).get("dev");if(n!==null){const i=/^(1|true|yes|on)$/i.test(n);try{window.localStorage.setItem(hv,i?"1":"0")}catch{}return i}const r=window.localStorage.getItem(hv);return r==="1"?!0:r==="0"?!1:e}const nB={desktop:1200};function nh(){return`${Date.now()}-${Math.random().toString(36).slice(2,7)}`}function rB(){if(/^(1|true|yes|on)$/i.test(""))return!0;if(typeof window>"u")return!1;const t=window.localStorage.getItem(cD);return/^(1|true|yes|on)$/i.test(t??"")}const iB=new Set(["fast","balanced","reasoning","codex"]),sB=new Set(["openai","anthropic","gemini"]);function oB(){if(typeof window>"u")return"balanced";const e=window.localStorage.getItem(dD);return e&&iB.has(e)?e:"balanced"}function aB(){if(typeof window>"u")return"anthropic";const e=window.localStorage.getItem(fD);return e&&sB.has(e)?e:"anthropic"}function lB(){var t,n;if(typeof window>"u")return!1;const e=window.sessionStorage.getItem(sg)??window.localStorage.getItem(sg);return e==="dark"?!0:e==="light"?!1:((n=(t=window.matchMedia)==null?void 0:t.call(window,"(prefers-color-scheme: dark)"))==null?void 0:n.matches)??!1}const uB="editor-anchored-composer-v1",hD="editor-auto-scroll-tracking-v1";function cB(){if(typeof window>"u")return!0;const e=window.localStorage.getItem(hD);return!(e==="0"||e==="false")}function dB(){if(/^(0|false|no|off)$/i.test(""))return!1;if(/^(1|true|yes|on)$/i.test("")||typeof window>"u")return!0;const t=window.localStorage.getItem(uB);return!(t==="0"||t==="false")}function fB(e,t){return{...e,...t}}function hB(e){const t=Array.isArray(e)?e:[];let n,r;const i=[];for(const s of t)if(typeof s=="string"&&/\w/.test(s)){if(s.startsWith(P_)){const o=s.slice(P_.length).trim();o&&(n=o);continue}if(s.startsWith(L_)){const o=s.slice(L_.length).trim();o&&(r=o);continue}i.push(s)}return{changes:i,aiJustification:n,aiPerformanceNote:r}}function pB(){if(typeof window>"u")return"/";const e=new URLSearchParams(window.location.search).get("slug");if(!e)return"/";const t=e.trim();return!t||t==="/"?"/":t.startsWith("/")?t:`/${t}`}function mB(e){if(!e)return[];if(Array.isArray(e))return e.map(String);const t=Object.values(e.fieldErrors??{}).flat().map(String);return[...(e.formErrors??[]).map(String),...t]}const ge=uD()(Y9(e=>({activeBlockId:void 0,activeBlockType:void 0,activeEditablePath:void 0,slug:pB(),availableSlugs:["/"],isLoadingSlugs:!1,chatLog:[],chatAttachments:[],isLoading:!1,streamStatus:null,streamingText:null,streamingChanges:[],streamingThinking:null,streamSteps:[],opChecklist:[],streamTokenCount:0,latestStreamFocusBlockId:null,imageProgress:null,continuationChainId:null,pendingPlanId:null,plannerBadgeState:"checking",variationModal:null,isApplyingVariation:!1,composerHeight:56,chatWidth:Q9(),propsWidth:eB(),activeTab:"chat",showSettingsModal:!1,showDebugDetails:rB(),addBlockPicker:null,addBlockSearch:"",isAddingBlock:!1,imagePickerTarget:null,chatDarkMode:lB(),selectionModeEnabled:!1,anchorRect:null,anchoredExpanded:!1,selectedVariationId:null,showSiteSwitcher:!1,copiedDebugEntryId:null,feedbackNoteEntryId:null,feedbackNoteText:"",siteConfigTab:"overview",configModalTab:"general",modelKey:oB(),provider:aB(),availableProviders:[],useStreaming:!0,autoScrollTrackingEnabled:cB(),autoScrollSuppressed:!1,backendFeatures:{},fieldDraftDebugEnabled:!1,fieldDraftDebug:{eventsPerSecond:0,charsPerSecond:0,totalEvents:0,totalChars:0,typingLagChars:0,activeTarget:null},setActiveBlock:(t,n)=>e(r=>{const i=n===void 0&&t===r.activeBlockId?r.activeBlockType:n;return r.activeBlockId===t&&r.activeBlockType===i?r:{...r,activeBlockId:t,activeBlockType:i}}),setActiveEditablePath:t=>e(n=>n.activeEditablePath===t?n:{...n,activeEditablePath:t}),setSlug:t=>e(n=>n.slug===t?n:{...n,slug:t}),setAvailableSlugs:t=>e({availableSlugs:t}),setIsLoadingSlugs:t=>e(n=>n.isLoadingSlugs===t?n:{...n,isLoadingSlugs:t}),setChatLog:t=>e(n=>({...n,chatLog:typeof t=="function"?t(n.chatLog):t})),appendChatEntry:t=>e(n=>({...n,chatLog:[...n.chatLog,t]})),setChatAttachments:t=>e(n=>({...n,chatAttachments:typeof t=="function"?t(n.chatAttachments):t})),setIsLoading:t=>e(n=>n.isLoading===t?n:{...n,isLoading:t}),setStreamStatus:t=>e({streamStatus:t}),setStreamingText:t=>e(n=>({...n,streamingText:typeof t=="function"?t(n.streamingText):t})),setStreamingChanges:t=>e(n=>({...n,streamingChanges:typeof t=="function"?t(n.streamingChanges):t})),setStreamingThinking:t=>e(n=>({...n,streamingThinking:typeof t=="function"?t(n.streamingThinking):t})),setStreamSteps:t=>e(n=>({...n,streamSteps:typeof t=="function"?t(n.streamSteps):t})),setOpChecklist:t=>e(n=>({...n,opChecklist:typeof t=="function"?t(n.opChecklist):t})),setStreamTokenCount:t=>e(n=>({...n,streamTokenCount:typeof t=="function"?t(n.streamTokenCount):t})),setLatestStreamFocusBlockId:t=>e({latestStreamFocusBlockId:t}),setImageProgress:t=>e({imageProgress:t}),setContinuationChainId:t=>e({continuationChainId:t}),setPendingPlanId:t=>e({pendingPlanId:t}),setPlannerBadgeState:t=>e({plannerBadgeState:t}),setVariationModal:t=>e({variationModal:t}),setIsApplyingVariation:t=>e({isApplyingVariation:t}),patchVariationOption:(t,n)=>e(r=>{if(!r.variationModal)return r;const i=r.variationModal.options.map(s=>s.id===t?{...s,patch:n.patch,changedKeys:n.changedKeys,imagePending:!1}:s);return{...r,variationModal:{...r.variationModal,options:i}}}),setComposerHeight:t=>e(n=>{const r=typeof t=="function"?t(n.composerHeight):t;return n.composerHeight===r?n:{...n,composerHeight:r}}),setChatWidth:t=>e(n=>{const r=typeof t=="function"?t(n.chatWidth):t;return n.chatWidth===r?n:{...n,chatWidth:r}}),setPropsWidth:t=>e(n=>{const r=typeof t=="function"?t(n.propsWidth):t;return n.propsWidth===r?n:{...n,propsWidth:r}}),setActiveTab:t=>e(n=>n.activeTab===t?n:{...n,activeTab:t}),setShowSettingsModal:t=>e({showSettingsModal:t}),setShowDebugDetails:t=>e({showDebugDetails:t}),setAddBlockPicker:t=>e({addBlockPicker:t}),setAddBlockSearch:t=>e({addBlockSearch:t}),setIsAddingBlock:t=>e({isAddingBlock:t}),setImagePickerTarget:t=>e({imagePickerTarget:t}),setChatDarkMode:t=>e(n=>n.chatDarkMode===t?n:{...n,chatDarkMode:t}),setSelectionModeEnabled:t=>e({selectionModeEnabled:t}),setAnchorRect:t=>e({anchorRect:t}),setAnchoredExpanded:t=>e({anchoredExpanded:t}),setSelectedVariationId:t=>e({selectedVariationId:t}),setShowSiteSwitcher:t=>e({showSiteSwitcher:t}),setCopiedDebugEntryId:t=>e({copiedDebugEntryId:t}),setFeedbackNoteEntryId:t=>e({feedbackNoteEntryId:t}),setFeedbackNoteText:t=>e({feedbackNoteText:t}),setSiteConfigTab:t=>e({siteConfigTab:t}),setConfigModalTab:t=>e({configModalTab:t}),setModelKey:t=>e(n=>n.modelKey===t?n:{...n,modelKey:t}),setProvider:t=>e(n=>n.provider===t?n:{...n,provider:t}),setAvailableProviders:t=>e({availableProviders:t}),setUseStreaming:t=>e({useStreaming:t}),setAutoScrollTrackingEnabled:t=>e(n=>n.autoScrollTrackingEnabled===t?n:{...n,autoScrollTrackingEnabled:t}),setAutoScrollSuppressed:t=>e(n=>n.autoScrollSuppressed===t?n:{...n,autoScrollSuppressed:t}),setBackendFeatures:t=>e({backendFeatures:t}),setFieldDraftDebugEnabled:t=>e({fieldDraftDebugEnabled:t}),setFieldDraftDebug:t=>e({fieldDraftDebug:t}),pushAssistantFromResult:(t,n)=>{const r=mB(t.validationErrors),i=hB(t.changes),s={id:nh(),role:"assistant",text:t.summary??t.error??"Request failed.",status:t.status,canUndo:(n==null?void 0:n.canUndo)??!1,wasUndone:!1,undoSlug:n==null?void 0:n.undoSlug,changes:i.changes,mentionedSlugs:Array.isArray(t.mentionedSlugs)?t.mentionedSlugs.filter(o=>typeof o=="string"):[],suggestions:t.suggestions??[],variations:t.variations,errors:r,meta:t.modelUsed?`${t.modelUsed}${t.modelKey?` (${t.modelKey})`:""}`:void 0,debug:t.debug,aiJustification:i.aiJustification,aiPerformanceNote:i.aiPerformanceNote,pendingPlanId:typeof t.pendingPlanId=="string"?t.pendingPlanId:void 0,planApplied:t.planApplied===!0?!0:void 0,planPreview:t.planPreview??void 0,destructiveReasons:Array.isArray(t.destructiveReasons)?t.destructiveReasons.filter(o=>typeof o=="string"):void 0,continuation:t.continuation??void 0,imageSwap:n==null?void 0:n.imageSwap,thinking:n==null?void 0:n.thinking};e(o=>{if(!s.canUndo)return{...o,chatLog:[...o.chatLog,s]};const l=o.chatLog.map(c=>c.canUndo?{...c,canUndo:!1,wasUndone:!1}:c);return{...o,chatLog:[...l,s]}})}})));ge.subscribe(e=>e.chatDarkMode,e=>{if(typeof window>"u")return;window.document.documentElement.classList.toggle("editor-dark",e),window.sessionStorage.setItem(sg,e?"dark":"light"),window.localStorage.setItem(sg,e?"dark":"light")});ge.subscribe(e=>e.modelKey,e=>{typeof window>"u"||window.localStorage.setItem(dD,e)});ge.subscribe(e=>e.provider,e=>{typeof window>"u"||window.localStorage.setItem(fD,e)});ge.subscribe(e=>e.showDebugDetails,e=>{typeof window>"u"||window.localStorage.setItem(cD,e?"1":"0")});ge.subscribe(e=>e.chatWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(pv):window.localStorage.setItem(pv,String(Math.round(e))))});ge.subscribe(e=>e.propsWidth,e=>{typeof window>"u"||(e==null?window.localStorage.removeItem(mv):window.localStorage.setItem(mv,String(Math.round(e))))});ge.subscribe(e=>e.autoScrollTrackingEnabled,e=>{typeof window>"u"||window.localStorage.setItem(hD,e?"1":"0")});const jc={sessionId:"dev",siteId:"",editorOrigin:"",orchestratorUrl:""};function ji(){return jc.sessionId}function Oi(){return jc.siteId}function gB(e){jc.sessionId=e.sessionId,jc.siteId=e.siteId,jc.editorOrigin=e.editorOrigin,jc.orchestratorUrl=e.orchestratorUrl}const bB="image/png,image/jpeg,image/webp,image/gif,application/pdf";function $_(e){return e.type.startsWith("image/")||e.type==="application/pdf"}function yB(e){const t=Math.floor(e/1e3),n=Math.floor(t/60),r=t%60;return`${n}:${r.toString().padStart(2,"0")}`}function pD(e){const{message:t,isLoading:n,onMessageChange:r,onSubmit:i,onCancel:s,onTranscribeAudio:o,onUploadAttachment:l,attachments:c,onAttachmentsChange:d,onAutoHeightChange:h,selectionModeEnabled:p,onToggleSelectionMode:b,compact:y}=e,{t:x}=yr(),k=ge(re=>re.backendFeatures.audioTranscription)!==!1,[S,C]=E.useState(!1),[_,A]=E.useState(0),[M,R]=E.useState(!1),[D,j]=E.useState([]),[I,G]=E.useState(null),[L,H]=E.useState(null),V=E.useRef(null),Z=E.useRef(null),K=E.useRef(null),q=E.useRef(null),B=E.useRef(null),W=E.useRef([]),ee=E.useRef(null);function ue(){const re=Z.current;if(!re)return;const X=V.current;if(X){X.style.height="0px",X.style.overflowY="hidden";const Be=X.scrollHeight,kt=Math.min(220,Math.max(20,Be));X.style.height=`${kt}px`,X.style.overflowY=Be>kt?"auto":"hidden"}const je=re.closest(".composer"),ze=je?je.scrollHeight:re.scrollHeight;h(ze)}E.useEffect(()=>()=>{var re,X;try{(re=q.current)==null||re.stop()}catch{}(X=B.current)==null||X.getTracks().forEach(je=>je.stop()),q.current=null,B.current=null},[]),E.useLayoutEffect(()=>{ue()},[t,S,M,D,c,I,L,h]),E.useEffect(()=>{var je;const re=requestAnimationFrame(()=>ue());let X=!1;return typeof document<"u"&&((je=document.fonts)!=null&&je.ready)&&document.fonts.ready.then(()=>{X||ue()}).catch(()=>{}),()=>{cancelAnimationFrame(re),X=!0}},[]),E.useEffect(()=>{const re=()=>ue();return window.addEventListener("resize",re),()=>window.removeEventListener("resize",re)},[]),E.useEffect(()=>{const re=Z.current;if(!re)return;const X=re.closest(".composer");let je;typeof ResizeObserver<"u"&&(je=new ResizeObserver(()=>ue()),je.observe(re),X&&je.observe(X));let ze;return X&&typeof MutationObserver<"u"&&(ze=new MutationObserver(()=>ue()),ze.observe(X,{childList:!0})),()=>{je==null||je.disconnect(),ze==null||ze.disconnect()}},[]),E.useEffect(()=>{if(!S){A(0);return}const re=performance.now();A(0);const X=window.setInterval(()=>{A(performance.now()-re)},250);return()=>window.clearInterval(X)},[S]);function z(){var re;return typeof window<"u"&&typeof window.MediaRecorder<"u"&&!!((re=navigator.mediaDevices)!=null&&re.getUserMedia)}function F(re){const X=re.trim();if(!X)return;const je=t.trim().length>0?`${t.trim()} `:"";r(`${je}${X}`.trim())}async function $(re){if(re.length===0)return;H(null);const X=[];let je=!1;for(const ze of re)$_(ze)?X.push(ze):je=!0;je&&H(x("chatInput.unsupportedFile")),X.length!==0&&await Promise.all(X.map(async ze=>{j(Be=>[...Be,ze.name]);try{const Be=await l(ze);d(Ze=>[...Ze,Be])}catch(Be){const Ze=Be instanceof Error?Be.message:x("chatInput.uploadFailed");H(Ze)}finally{j(Be=>{const Ze=Be.indexOf(ze.name);return Ze===-1?Be:[...Be.slice(0,Ze),...Be.slice(Ze+1)]})}}))}function O(re){d(X=>X.filter(je=>je.id!==re))}async function te(){var re;if(G(null),!z()){G(x("chatInput.speechUnsupported"));return}if(!(n||M)){if(S){(re=q.current)==null||re.stop(),C(!1);return}try{const X=await navigator.mediaDevices.getUserMedia({audio:!0});B.current=X;const je=new MediaRecorder(X);q.current=je,W.current=[],je.ondataavailable=ze=>{ze.data&&ze.data.size>0&&W.current.push(ze.data)},je.onstop=async()=>{const ze=ee.current;ee.current=null;const Be=je.mimeType||"audio/webm",Ze=W.current;if(W.current=[],X.getTracks().forEach(kt=>kt.stop()),B.current=null,q.current=null,C(!1),!(ze==="cancel"||Ze.length===0)){R(!0);try{const kt=new Blob(Ze,{type:Be}),qe=(await o(kt,Be)).trim();if(!qe){G(x("chatInput.noSpeechDetected"));return}const Wt=[t.trim(),qe].filter(Boolean).join(" ").trim();ze==="confirm"?i(Wt):F(qe)}catch(kt){const it=kt instanceof Error?kt.message:x("chatInput.transcribeFailed");G(it)}finally{R(!1)}}},je.start(),C(!0)}catch{G(x("chatInput.micBlocked"))}}}function se(){var re;S&&(ee.current="cancel",(re=q.current)==null||re.stop(),W.current=[])}function de(){var re;S&&(ee.current="confirm",(re=q.current)==null||re.stop())}const le=S||M,Ae=D.length>0,Te=c.length>0,Oe=!n&&!le&&!Ae&&(t.trim().length>0||Te);return m.jsxs("div",{className:`composer-shell${n?" is-loading":""}`,ref:Z,children:[m.jsx("input",{ref:K,type:"file",multiple:!0,accept:bB,style:{display:"none"},onChange:re=>{const X=Array.from(re.target.files??[]);re.target.value="",$(X)}}),m.jsxs("div",{className:"composer-input-area",children:[(Te||Ae)&&!S?m.jsxs("div",{className:"composer-attachments",children:[c.map(re=>m.jsxs("div",{className:"composer-attachment-chip",title:re.name,children:[re.kind==="image"?m.jsx("img",{className:"composer-attachment-thumb",src:re.url,alt:""}):m.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:m.jsx(OL,{size:14})}),m.jsx("span",{className:"composer-attachment-name",children:re.name??(re.kind==="pdf"?"document.pdf":"image")}),m.jsx("button",{type:"button",className:"composer-attachment-remove",onClick:()=>O(re.id),"aria-label":x("chatInput.removeAttachment"),children:m.jsx(xo,{size:12})})]},re.id)),D.map((re,X)=>m.jsxs("div",{className:"composer-attachment-chip is-uploading",title:re,children:[m.jsx("span",{className:"composer-attachment-icon","aria-hidden":"true",children:m.jsx(s9,{size:14,className:"composer-spin"})}),m.jsx("span",{className:"composer-attachment-name",children:re})]},`uploading-${X}-${re}`))]}):null,!S&&m.jsx("textarea",{ref:V,placeholder:x("chatInput.placeholder"),value:t,onChange:re=>{r(re.target.value),ue()},onInput:()=>ue(),onPaste:re=>{var ze;const X=(ze=re.clipboardData)==null?void 0:ze.items;if(!X)return;const je=[];for(const Be of X){if(Be.kind!=="file")continue;const Ze=Be.getAsFile();Ze&&$_(Ze)&&je.push(Ze)}je.length!==0&&(re.preventDefault(),$(je))},onKeyDown:re=>{re.key==="Enter"&&!re.shiftKey&&!le&&!Ae&&(re.preventDefault(),i())},rows:1}),S?m.jsxs("div",{className:"composer-input-note composer-input-note-listening",children:[m.jsx("span",{className:"composer-rec-dot","aria-hidden":"true"}),m.jsx("span",{className:"composer-rec-label",children:x("chatInput.listening")}),m.jsx("span",{className:"composer-rec-timer","aria-hidden":"true",children:yB(_)})]}):null,M?m.jsx("div",{className:"composer-input-note",children:x("chatInput.transcribing")}):null,I?m.jsx("div",{className:"composer-input-note composer-input-note-error",children:I}):null,L?m.jsx("div",{className:"composer-input-note composer-input-note-error",children:L}):null]}),m.jsxs("div",{className:"composer-actions",children:[!y&&!S&&m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"composer-ghost-btn composer-plus-btn",onClick:()=>{var re;return(re=K.current)==null?void 0:re.click()},disabled:n||Ae,"aria-label":x("chatInput.attachFile"),"data-tooltip":x("chatInput.attachFile"),children:m.jsx(m9,{size:16})}),b&&m.jsx("button",{type:"button",className:`composer-ghost-btn composer-selector-btn${p?" is-active":""}`,onClick:b,"aria-label":x(p?"chatInput.exitSelector":"chatInput.selectElement"),"data-tooltip":x(p?"chatInput.exitSelector":"chatInput.selectElement"),"aria-pressed":p,children:m.jsx(u9,{size:16})})]}),m.jsx("div",{className:"composer-actions-spacer"}),m.jsx("div",{className:"composer-actions-right",role:"group","aria-label":x("chatInput.voiceActions"),children:!y&&S?m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"composer-ghost-btn composer-cancel-btn",onClick:se,disabled:n||M,"aria-label":x("chatInput.cancelVoice"),children:m.jsx(xo,{size:16})}),m.jsx("button",{type:"button",className:"composer-send-btn",onClick:de,disabled:n||M,"aria-label":x("chatInput.sendRecorded"),children:m.jsx(Dh,{size:16})})]}):m.jsxs(m.Fragment,{children:[!y&&k&&m.jsx("button",{type:"button",className:"composer-ghost-btn",onClick:()=>void te(),disabled:n||M,"aria-label":x("chatInput.startVoice"),children:m.jsx(a9,{size:16})}),m.jsxs("button",{type:"button",className:`composer-send-btn${n&&s?" is-stop":""}`,onClick:n&&s?s:()=>i(),disabled:!(n&&s)&&!Oe,"aria-label":x(n&&s?"chatInput.stopGeneration":"chatInput.sendMessage"),children:[m.jsx("span",{className:"icon-send",children:m.jsx(Gk,{size:16,strokeWidth:2.8})}),m.jsx("span",{className:"icon-stop",children:m.jsx(Zk,{size:12,fill:"currentColor"})})]})]})})]})]})}function xB(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const vB=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kB=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,SB={};function U_(e,t){return(SB.jsx?kB:vB).test(e)}const wB=/[ \t\n\f\r]/g;function CB(e){return typeof e=="object"?e.type==="text"?H_(e.value):!1:H_(e)}function H_(e){return e.replace(wB,"")===""}let Rh=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};Rh.prototype.normal={};Rh.prototype.property={};Rh.prototype.space=void 0;function mD(e,t){const n={},r={};for(const i of e)Object.assign(n,i.property),Object.assign(r,i.normal);return new Rh(n,r,t)}function yv(e){return e.toLowerCase()}class Fi{constructor(t,n){this.attribute=n,this.property=t}}Fi.prototype.attribute="";Fi.prototype.booleanish=!1;Fi.prototype.boolean=!1;Fi.prototype.commaOrSpaceSeparated=!1;Fi.prototype.commaSeparated=!1;Fi.prototype.defined=!1;Fi.prototype.mustUseProperty=!1;Fi.prototype.number=!1;Fi.prototype.overloadedBoolean=!1;Fi.prototype.property="";Fi.prototype.spaceSeparated=!1;Fi.prototype.space=void 0;let EB=0;const Tt=Iu(),mr=Iu(),xv=Iu(),Ie=Iu(),An=Iu(),Bc=Iu(),ns=Iu();function Iu(){return 2**++EB}const vv=Object.freeze(Object.defineProperty({__proto__:null,boolean:Tt,booleanish:mr,commaOrSpaceSeparated:ns,commaSeparated:Bc,number:Ie,overloadedBoolean:xv,spaceSeparated:An},Symbol.toStringTag,{value:"Module"})),T1=Object.keys(vv);class Kk extends Fi{constructor(t,n,r,i){let s=-1;if(super(t,n),V_(this,"space",i),typeof r=="number")for(;++s<T1.length;){const o=T1[s];V_(this,T1[s],(r&vv[o])===vv[o])}}}Kk.prototype.defined=!0;function V_(e,t,n){n&&(e[t]=n)}function pd(e){const t={},n={};for(const[r,i]of Object.entries(e.properties)){const s=new Kk(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),t[r]=s,n[yv(r)]=r,n[yv(s.attribute)]=r}return new Rh(t,n,e.space)}const gD=pd({properties:{ariaActiveDescendant:null,ariaAtomic:mr,ariaAutoComplete:null,ariaBusy:mr,ariaChecked:mr,ariaColCount:Ie,ariaColIndex:Ie,ariaColSpan:Ie,ariaControls:An,ariaCurrent:null,ariaDescribedBy:An,ariaDetails:null,ariaDisabled:mr,ariaDropEffect:An,ariaErrorMessage:null,ariaExpanded:mr,ariaFlowTo:An,ariaGrabbed:mr,ariaHasPopup:null,ariaHidden:mr,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:An,ariaLevel:Ie,ariaLive:null,ariaModal:mr,ariaMultiLine:mr,ariaMultiSelectable:mr,ariaOrientation:null,ariaOwns:An,ariaPlaceholder:null,ariaPosInSet:Ie,ariaPressed:mr,ariaReadOnly:mr,ariaRelevant:null,ariaRequired:mr,ariaRoleDescription:An,ariaRowCount:Ie,ariaRowIndex:Ie,ariaRowSpan:Ie,ariaSelected:mr,ariaSetSize:Ie,ariaSort:null,ariaValueMax:Ie,ariaValueMin:Ie,ariaValueNow:Ie,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function bD(e,t){return t in e?e[t]:t}function yD(e,t){return bD(e,t.toLowerCase())}const _B=pd({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Bc,acceptCharset:An,accessKey:An,action:null,allow:null,allowFullScreen:Tt,allowPaymentRequest:Tt,allowUserMedia:Tt,alt:null,as:null,async:Tt,autoCapitalize:null,autoComplete:An,autoFocus:Tt,autoPlay:Tt,blocking:An,capture:null,charSet:null,checked:Tt,cite:null,className:An,cols:Ie,colSpan:null,content:null,contentEditable:mr,controls:Tt,controlsList:An,coords:Ie|Bc,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Tt,defer:Tt,dir:null,dirName:null,disabled:Tt,download:xv,draggable:mr,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Tt,formTarget:null,headers:An,height:Ie,hidden:xv,high:Ie,href:null,hrefLang:null,htmlFor:An,httpEquiv:An,id:null,imageSizes:null,imageSrcSet:null,inert:Tt,inputMode:null,integrity:null,is:null,isMap:Tt,itemId:null,itemProp:An,itemRef:An,itemScope:Tt,itemType:An,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Tt,low:Ie,manifest:null,max:null,maxLength:Ie,media:null,method:null,min:null,minLength:Ie,multiple:Tt,muted:Tt,name:null,nonce:null,noModule:Tt,noValidate:Tt,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Tt,optimum:Ie,pattern:null,ping:An,placeholder:null,playsInline:Tt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Tt,referrerPolicy:null,rel:An,required:Tt,reversed:Tt,rows:Ie,rowSpan:Ie,sandbox:An,scope:null,scoped:Tt,seamless:Tt,selected:Tt,shadowRootClonable:Tt,shadowRootDelegatesFocus:Tt,shadowRootMode:null,shape:null,size:Ie,sizes:null,slot:null,span:Ie,spellCheck:mr,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Ie,step:null,style:null,tabIndex:Ie,target:null,title:null,translate:null,type:null,typeMustMatch:Tt,useMap:null,value:mr,width:Ie,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:An,axis:null,background:null,bgColor:null,border:Ie,borderColor:null,bottomMargin:Ie,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Tt,declare:Tt,event:null,face:null,frame:null,frameBorder:null,hSpace:Ie,leftMargin:Ie,link:null,longDesc:null,lowSrc:null,marginHeight:Ie,marginWidth:Ie,noResize:Tt,noHref:Tt,noShade:Tt,noWrap:Tt,object:null,profile:null,prompt:null,rev:null,rightMargin:Ie,rules:null,scheme:null,scrolling:mr,standby:null,summary:null,text:null,topMargin:Ie,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Ie,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Tt,disableRemotePlayback:Tt,prefix:null,property:null,results:Ie,security:null,unselectable:null},space:"html",transform:yD}),TB=pd({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:ns,accentHeight:Ie,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Ie,amplitude:Ie,arabicForm:null,ascent:Ie,attributeName:null,attributeType:null,azimuth:Ie,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Ie,by:null,calcMode:null,capHeight:Ie,className:An,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:Ie,diffuseConstant:Ie,direction:null,display:null,dur:null,divisor:Ie,dominantBaseline:null,download:Tt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Ie,enableBackground:null,end:null,event:null,exponent:Ie,externalResourcesRequired:null,fill:null,fillOpacity:Ie,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Bc,g2:Bc,glyphName:Bc,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Ie,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Ie,horizOriginX:Ie,horizOriginY:Ie,id:null,ideographic:Ie,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Ie,k:Ie,k1:Ie,k2:Ie,k3:Ie,k4:Ie,kernelMatrix:ns,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Ie,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:Ie,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:Ie,overlineThickness:Ie,paintOrder:null,panose1:null,path:null,pathLength:Ie,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:An,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Ie,pointsAtY:Ie,pointsAtZ:Ie,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ns,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ns,rev:ns,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ns,requiredFeatures:ns,requiredFonts:ns,requiredFormats:ns,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:Ie,specularExponent:Ie,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Ie,strikethroughThickness:Ie,string:null,stroke:null,strokeDashArray:ns,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Ie,strokeOpacity:Ie,strokeWidth:null,style:null,surfaceScale:Ie,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ns,tabIndex:Ie,tableValues:null,target:null,targetX:Ie,targetY:Ie,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ns,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Ie,underlineThickness:Ie,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Ie,values:null,vAlphabetic:Ie,vMathematical:Ie,vectorEffect:null,vHanging:Ie,vIdeographic:Ie,version:null,vertAdvY:Ie,vertOriginX:Ie,vertOriginY:Ie,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Ie,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:bD}),xD=pd({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),vD=pd({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:yD}),kD=pd({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AB={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},NB=/[A-Z]/g,q_=/-[a-z]/g,MB=/^data[-\w.:]+$/i;function DB(e,t){const n=yv(t);let r=t,i=Fi;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&MB.test(t)){if(t.charAt(4)==="-"){const s=t.slice(5).replace(q_,IB);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=t.slice(4);if(!q_.test(s)){let o=s.replace(NB,RB);o.charAt(0)!=="-"&&(o="-"+o),t="data"+o}}i=Kk}return new i(r,t)}function RB(e){return"-"+e.toLowerCase()}function IB(e){return e.charAt(1).toUpperCase()}const jB=mD([gD,_B,xD,vD,kD],"html"),Yk=mD([gD,TB,xD,vD,kD],"svg");function OB(e){return e.join(" ").trim()}var kc={},A1,G_;function zB(){if(G_)return A1;G_=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,i=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,o=/^[;\s]*/,l=/^\s+|\s+$/g,c=`
338
338
  `,d="/",h="*",p="",b="comment",y="declaration";function x(S,C){if(typeof S!="string")throw new TypeError("First argument must be a string");if(!S)return[];C=C||{};var _=1,A=1;function M(K){var q=K.match(t);q&&(_+=q.length);var B=K.lastIndexOf(c);A=~B?K.length-B:A+K.length}function R(){var K={line:_,column:A};return function(q){return q.position=new D(K),G(),q}}function D(K){this.start=K,this.end={line:_,column:A},this.source=C.source}D.prototype.content=S;function j(K){var q=new Error(C.source+":"+_+":"+A+": "+K);if(q.reason=K,q.filename=C.source,q.line=_,q.column=A,q.source=S,!C.silent)throw q}function I(K){var q=K.exec(S);if(q){var B=q[0];return M(B),S=S.slice(B.length),q}}function G(){I(n)}function L(K){var q;for(K=K||[];q=H();)q!==!1&&K.push(q);return K}function H(){var K=R();if(!(d!=S.charAt(0)||h!=S.charAt(1))){for(var q=2;p!=S.charAt(q)&&(h!=S.charAt(q)||d!=S.charAt(q+1));)++q;if(q+=2,p===S.charAt(q-1))return j("End of comment missing");var B=S.slice(2,q-2);return A+=2,M(B),S=S.slice(q),A+=2,K({type:b,comment:B})}}function V(){var K=R(),q=I(r);if(q){if(H(),!I(i))return j("property missing ':'");var B=I(s),W=K({type:y,property:k(q[0].replace(e,p)),value:B?k(B[0].replace(e,p)):p});return I(o),W}}function Z(){var K=[];L(K);for(var q;q=V();)q!==!1&&(K.push(q),L(K));return K}return G(),Z()}function k(S){return S?S.replace(l,p):p}return A1=x,A1}var Z_;function PB(){if(Z_)return kc;Z_=1;var e=kc&&kc.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(kc,"__esModule",{value:!0}),kc.default=n;const t=e(zB());function n(r,i){let s=null;if(!r||typeof r!="string")return s;const o=(0,t.default)(r),l=typeof i=="function";return o.forEach(c=>{if(c.type!=="declaration")return;const{property:d,value:h}=c;l?i(d,h,c):h&&(s=s||{},s[d]=h)}),s}return kc}var hf={},W_;function LB(){if(W_)return hf;W_=1,Object.defineProperty(hf,"__esModule",{value:!0}),hf.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,i=/^-(ms)-/,s=function(d){return!d||n.test(d)||e.test(d)},o=function(d,h){return h.toUpperCase()},l=function(d,h){return"".concat(h,"-")},c=function(d,h){return h===void 0&&(h={}),s(d)?d:(d=d.toLowerCase(),h.reactCompat?d=d.replace(i,l):d=d.replace(r,l),d.replace(t,o))};return hf.camelCase=c,hf}var pf,K_;function BB(){if(K_)return pf;K_=1;var e=pf&&pf.__importDefault||function(i){return i&&i.__esModule?i:{default:i}},t=e(PB()),n=LB();function r(i,s){var o={};return!i||typeof i!="string"||(0,t.default)(i,function(l,c){l&&c&&(o[(0,n.camelCase)(l,s)]=c)}),o}return r.default=r,pf=r,pf}var FB=BB();const $B=fd(FB),SD=wD("end"),Jk=wD("start");function wD(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function UB(e){const t=Jk(e),n=SD(e);if(t&&n)return{start:t,end:n}}function jf(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Y_(e.position):"start"in e||"end"in e?Y_(e):"line"in e||"column"in e?kv(e):""}function kv(e){return J_(e&&e.line)+":"+J_(e&&e.column)}function Y_(e){return kv(e&&e.start)+"-"+kv(e&&e.end)}function J_(e){return e&&typeof e=="number"?e:1}class li extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let i="",s={},o=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?i=t:!s.cause&&t&&(o=!0,i=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?s.ruleId=r:(s.source=r.slice(0,c),s.ruleId=r.slice(c+1))}if(!s.place&&s.ancestors&&s.ancestors){const c=s.ancestors[s.ancestors.length-1];c&&(s.place=c.position)}const l=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=l?l.column:void 0,this.fatal=void 0,this.file="",this.message=i,this.line=l?l.line:void 0,this.name=jf(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=o&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}li.prototype.file="";li.prototype.name="";li.prototype.reason="";li.prototype.message="";li.prototype.stack="";li.prototype.column=void 0;li.prototype.line=void 0;li.prototype.ancestors=void 0;li.prototype.cause=void 0;li.prototype.fatal=void 0;li.prototype.place=void 0;li.prototype.ruleId=void 0;li.prototype.source=void 0;const Xk={}.hasOwnProperty,HB=new Map,VB=/[A-Z]/g,qB=new Set(["table","tbody","thead","tfoot","tr"]),GB=new Set(["td","th"]),CD="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function ZB(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=tF(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=eF(n,t.jsx,t.jsxs)}const i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Yk:jB,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},s=ED(i,e,void 0);return s&&typeof s!="string"?s:i.create(e,i.Fragment,{children:s||void 0},void 0)}function ED(e,t,n){if(t.type==="element")return WB(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return KB(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return JB(e,t,n);if(t.type==="mdxjsEsm")return YB(e,t);if(t.type==="root")return XB(e,t,n);if(t.type==="text")return QB(e,t)}function WB(e,t,n){const r=e.schema;let i=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(i=Yk,e.schema=i),e.ancestors.push(t);const s=TD(e,t.tagName,!1),o=nF(e,t);let l=eS(e,t);return qB.has(t.tagName)&&(l=l.filter(function(c){return typeof c=="string"?!CB(c):!0})),_D(e,o,s,t),Qk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function KB(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}rh(e,t.position)}function YB(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);rh(e,t.position)}function JB(e,t,n){const r=e.schema;let i=r;t.name==="svg"&&r.space==="html"&&(i=Yk,e.schema=i),e.ancestors.push(t);const s=t.name===null?e.Fragment:TD(e,t.name,!0),o=rF(e,t),l=eS(e,t);return _D(e,o,s,t),Qk(o,l),e.ancestors.pop(),e.schema=r,e.create(t,s,o,n)}function XB(e,t,n){const r={};return Qk(r,eS(e,t)),e.create(t,e.Fragment,r,n)}function QB(e,t){return t.value}function _D(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Qk(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function eF(e,t,n){return r;function r(i,s,o,l){const d=Array.isArray(o.children)?n:t;return l?d(s,o,l):d(s,o)}}function tF(e,t){return n;function n(r,i,s,o){const l=Array.isArray(s.children),c=Jk(r);return t(i,s,o,l,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function nF(e,t){const n={};let r,i;for(i in t.properties)if(i!=="children"&&Xk.call(t.properties,i)){const s=iF(e,i,t.properties[i]);if(s){const[o,l]=s;e.tableCellAlignToStyle&&o==="align"&&typeof l=="string"&&GB.has(t.tagName)?r=l:n[o]=l}}if(r){const s=n.style||(n.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function rF(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const o=s.expression;o.type;const l=o.properties[0];l.type,Object.assign(n,e.evaluater.evaluateExpression(l.argument))}else rh(e,t.position);else{const i=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const l=r.value.data.estree.body[0];l.type,s=e.evaluater.evaluateExpression(l.expression)}else rh(e,t.position);else s=r.value===null?!0:r.value;n[i]=s}return n}function eS(e,t){const n=[];let r=-1;const i=e.passKeys?new Map:HB;for(;++r<t.children.length;){const s=t.children[r];let o;if(e.passKeys){const c=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(c){const d=i.get(c)||0;o=c+"-"+d,i.set(c,d+1)}}const l=ED(e,s,o);l!==void 0&&n.push(l)}return n}function iF(e,t,n){const r=DB(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xB(n):OB(n)),r.property==="style"){let i=typeof n=="object"?n:sF(e,String(n));return e.stylePropertyNameCase==="css"&&(i=oF(i)),["style",i]}return[e.elementAttributeNameCase==="react"&&r.space?AB[r.property]||r.property:r.attribute,n]}}function sF(e,t){try{return $B(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,i=new li("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw i.file=e.filePath||void 0,i.url=CD+"#cannot-parse-style-attribute",i}}function TD(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const i=t.split(".");let s=-1,o;for(;++s<i.length;){const l=U_(i[s])?{type:"Identifier",name:i[s]}:{type:"Literal",value:i[s]};o=o?{type:"MemberExpression",object:o,property:l,computed:!!(s&&l.type==="Literal"),optional:!1}:l}r=o}else r=U_(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const i=r.value;return Xk.call(e.components,i)?e.components[i]:i}if(e.evaluater)return e.evaluater.evaluateExpression(r);rh(e)}function rh(e,t){const n=new li("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=CD+"#cannot-handle-mdx-estrees-without-createevaluater",n}function oF(e){const t={};let n;for(n in e)Xk.call(e,n)&&(t[aF(n)]=e[n]);return t}function aF(e){let t=e.replace(VB,lF);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lF(e){return"-"+e.toLowerCase()}const N1={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},uF={};function tS(e,t){const n=uF,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,i=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return AD(e,r,i)}function AD(e,t,n){if(cF(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return X_(e.children,t,n)}return Array.isArray(e)?X_(e,t,n):""}function X_(e,t,n){const r=[];let i=-1;for(;++i<e.length;)r[i]=AD(e[i],t,n);return r.join("")}function cF(e){return!!(e&&typeof e=="object")}const Q_=document.createElement("i");function nS(e){const t="&"+e+";";Q_.innerHTML=t;const n=Q_.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ss(e,t,n,r){const i=e.length;let s=0,o;if(t<0?t=-t>i?0:i+t:t=t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);s<r.length;)o=r.slice(s,s+1e4),o.unshift(t,0),e.splice(...o),s+=1e4,t+=1e4}function As(e,t){return e.length>0?(ss(e,e.length,0,t),e):t}const eT={}.hasOwnProperty;function ND(e){const t={};let n=-1;for(;++n<e.length;)dF(t,e[n]);return t}function dF(e,t){let n;for(n in t){const i=(eT.call(e,n)?e[n]:void 0)||(e[n]={}),s=t[n];let o;if(s)for(o in s){eT.call(i,o)||(i[o]=[]);const l=s[o];fF(i[o],Array.isArray(l)?l:l?[l]:[])}}}function fF(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);ss(e,0,0,r)}function MD(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Zs(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const bi=El(/[A-Za-z]/),si=El(/[\dA-Za-z]/),hF=El(/[#-'*+\--9=?A-Z^-~]/);function og(e){return e!==null&&(e<32||e===127)}const Sv=El(/\d/),pF=El(/[\dA-Fa-f]/),mF=El(/[!-/:-@[-`{-~]/);function dt(e){return e!==null&&e<-2}function Sn(e){return e!==null&&(e<0||e===32)}function Bt(e){return e===-2||e===-1||e===32}const N0=El(new RegExp("\\p{P}|\\p{S}","u")),ku=El(/\s/);function El(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function md(e){const t=[];let n=-1,r=0,i=0;for(;++n<e.length;){const s=e.charCodeAt(n);let o="";if(s===37&&si(e.charCodeAt(n+1))&&si(e.charCodeAt(n+2)))i=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(o=String.fromCharCode(s));else if(s>55295&&s<57344){const l=e.charCodeAt(n+1);s<56320&&l>56319&&l<57344?(o=String.fromCharCode(s,l),i=1):o="�"}else o=String.fromCharCode(s);o&&(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,o=""),i&&(n+=i,i=0)}return t.join("")+e.slice(r)}function Zt(e,t,n,r){const i=r?r-1:Number.POSITIVE_INFINITY;let s=0;return o;function o(c){return Bt(c)?(e.enter(n),l(c)):t(c)}function l(c){return Bt(c)&&s++<i?(e.consume(c),l):(e.exit(n),t(c))}}const gF={tokenize:bF};function bF(e){const t=e.attempt(this.parser.constructs.contentInitial,r,i);let n;return t;function r(l){if(l===null){e.consume(l);return}return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Zt(e,t,"linePrefix")}function i(l){return e.enter("paragraph"),s(l)}function s(l){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,o(l)}function o(l){if(l===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(l);return}return dt(l)?(e.consume(l),e.exit("chunkText"),s):(e.consume(l),o)}}const yF={tokenize:xF},tT={tokenize:vF};function xF(e){const t=this,n=[];let r=0,i,s,o;return l;function l(A){if(r<n.length){const M=n[r];return t.containerState=M[1],e.attempt(M[0].continuation,c,d)(A)}return d(A)}function c(A){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&_();const M=t.events.length;let R=M,D;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){D=t.events[R][1].end;break}C(r);let j=M;for(;j<t.events.length;)t.events[j][1].end={...D},j++;return ss(t.events,R+1,0,t.events.slice(M)),t.events.length=j,d(A)}return l(A)}function d(A){if(r===n.length){if(!i)return b(A);if(i.currentConstruct&&i.currentConstruct.concrete)return x(A);t.interrupt=!!(i.currentConstruct&&!i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(tT,h,p)(A)}function h(A){return i&&_(),C(r),b(A)}function p(A){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,x(A)}function b(A){return t.containerState={},e.attempt(tT,y,x)(A)}function y(A){return r++,n.push([t.currentConstruct,t.containerState]),b(A)}function x(A){if(A===null){i&&_(),C(0),e.consume(A);return}return i=i||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:i,contentType:"flow",previous:s}),k(A)}function k(A){if(A===null){S(e.exit("chunkFlow"),!0),C(0),e.consume(A);return}return dt(A)?(e.consume(A),S(e.exit("chunkFlow")),r=0,t.interrupt=void 0,l):(e.consume(A),k)}function S(A,M){const R=t.sliceStream(A);if(M&&R.push(null),A.previous=s,s&&(s.next=A),s=A,i.defineSkip(A.start),i.write(R),t.parser.lazy[A.start.line]){let D=i.events.length;for(;D--;)if(i.events[D][1].start.offset<o&&(!i.events[D][1].end||i.events[D][1].end.offset>o))return;const j=t.events.length;let I=j,G,L;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){if(G){L=t.events[I][1].end;break}G=!0}for(C(r),D=j;D<t.events.length;)t.events[D][1].end={...L},D++;ss(t.events,I+1,0,t.events.slice(j)),t.events.length=D}}function C(A){let M=n.length;for(;M-- >A;){const R=n[M];t.containerState=R[1],R[0].exit.call(t,e)}n.length=A}function _(){i.write([null]),s=void 0,i=void 0,t.containerState._closeFlow=void 0}}function vF(e,t,n){return Zt(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Kc(e){if(e===null||Sn(e)||ku(e))return 1;if(N0(e))return 2}function M0(e,t,n){const r=[];let i=-1;for(;++i<e.length;){const s=e[i].resolveAll;s&&!r.includes(s)&&(t=s(t,n),r.push(s))}return t}const wv={name:"attention",resolveAll:kF,tokenize:SF};function kF(e,t){let n=-1,r,i,s,o,l,c,d,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},b={...e[n][1].start};nT(p,-c),nT(b,c),o={type:c>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},l={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},s={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},i={type:c>1?"strong":"emphasis",start:{...o.start},end:{...l.end}},e[r][1].end={...o.start},e[n][1].start={...l.end},d=[],e[r][1].end.offset-e[r][1].start.offset&&(d=As(d,[["enter",e[r][1],t],["exit",e[r][1],t]])),d=As(d,[["enter",i,t],["enter",o,t],["exit",o,t],["enter",s,t]]),d=As(d,M0(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),d=As(d,[["exit",s,t],["enter",l,t],["exit",l,t],["exit",i,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,d=As(d,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,ss(e,r-1,n-r+3,d),n=r+d.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function SF(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=Kc(r);let s;return o;function o(c){return s=c,e.enter("attentionSequence"),l(c)}function l(c){if(c===s)return e.consume(c),l;const d=e.exit("attentionSequence"),h=Kc(c),p=!h||h===2&&i||n.includes(c),b=!i||i===2&&h||n.includes(r);return d._open=!!(s===42?p:p&&(i||!b)),d._close=!!(s===42?b:b&&(h||!p)),t(c)}}function nT(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wF={name:"autolink",tokenize:CF};function CF(e,t,n){let r=0;return i;function i(y){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(y){return bi(y)?(e.consume(y),o):y===64?n(y):d(y)}function o(y){return y===43||y===45||y===46||si(y)?(r=1,l(y)):d(y)}function l(y){return y===58?(e.consume(y),r=0,c):(y===43||y===45||y===46||si(y))&&r++<32?(e.consume(y),l):(r=0,d(y))}function c(y){return y===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):y===null||y===32||y===60||og(y)?n(y):(e.consume(y),c)}function d(y){return y===64?(e.consume(y),h):hF(y)?(e.consume(y),d):n(y)}function h(y){return si(y)?p(y):n(y)}function p(y){return y===46?(e.consume(y),r=0,h):y===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(y),e.exit("autolinkMarker"),e.exit("autolink"),t):b(y)}function b(y){if((y===45||si(y))&&r++<63){const x=y===45?b:p;return e.consume(y),x}return n(y)}}const Ih={partial:!0,tokenize:EF};function EF(e,t,n){return r;function r(s){return Bt(s)?Zt(e,i,"linePrefix")(s):i(s)}function i(s){return s===null||dt(s)?t(s):n(s)}}const DD={continuation:{tokenize:TF},exit:AF,name:"blockQuote",tokenize:_F};function _F(e,t,n){const r=this;return i;function i(o){if(o===62){const l=r.containerState;return l.open||(e.enter("blockQuote",{_container:!0}),l.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(o),e.exit("blockQuoteMarker"),s}return n(o)}function s(o){return Bt(o)?(e.enter("blockQuotePrefixWhitespace"),e.consume(o),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(o))}}function TF(e,t,n){const r=this;return i;function i(o){return Bt(o)?Zt(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o):s(o)}function s(o){return e.attempt(DD,t,n)(o)}}function AF(e){e.exit("blockQuote")}const RD={name:"characterEscape",tokenize:NF};function NF(e,t,n){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),i}function i(s){return mF(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(s)}}const ID={name:"characterReference",tokenize:MF};function MF(e,t,n){const r=this;let i=0,s,o;return l;function l(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),c}function c(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),d):(e.enter("characterReferenceValue"),s=31,o=si,h(p))}function d(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,o=pF,h):(e.enter("characterReferenceValue"),s=7,o=Sv,h(p))}function h(p){if(p===59&&i){const b=e.exit("characterReferenceValue");return o===si&&!nS(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return o(p)&&i++<s?(e.consume(p),h):n(p)}}const rT={partial:!0,tokenize:RF},iT={concrete:!0,name:"codeFenced",tokenize:DF};function DF(e,t,n){const r=this,i={partial:!0,tokenize:R};let s=0,o=0,l;return c;function c(D){return d(D)}function d(D){const j=r.events[r.events.length-1];return s=j&&j[1].type==="linePrefix"?j[2].sliceSerialize(j[1],!0).length:0,l=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(D)}function h(D){return D===l?(o++,e.consume(D),h):o<3?n(D):(e.exit("codeFencedFenceSequence"),Bt(D)?Zt(e,p,"whitespace")(D):p(D))}function p(D){return D===null||dt(D)?(e.exit("codeFencedFence"),r.interrupt?t(D):e.check(rT,k,M)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(D))}function b(D){return D===null||dt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(D)):Bt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Zt(e,y,"whitespace")(D)):D===96&&D===l?n(D):(e.consume(D),b)}function y(D){return D===null||dt(D)?p(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),x(D))}function x(D){return D===null||dt(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(D)):D===96&&D===l?n(D):(e.consume(D),x)}function k(D){return e.attempt(i,M,S)(D)}function S(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),C}function C(D){return s>0&&Bt(D)?Zt(e,_,"linePrefix",s+1)(D):_(D)}function _(D){return D===null||dt(D)?e.check(rT,k,M)(D):(e.enter("codeFlowValue"),A(D))}function A(D){return D===null||dt(D)?(e.exit("codeFlowValue"),_(D)):(e.consume(D),A)}function M(D){return e.exit("codeFenced"),t(D)}function R(D,j,I){let G=0;return L;function L(q){return D.enter("lineEnding"),D.consume(q),D.exit("lineEnding"),H}function H(q){return D.enter("codeFencedFence"),Bt(q)?Zt(D,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):V(q)}function V(q){return q===l?(D.enter("codeFencedFenceSequence"),Z(q)):I(q)}function Z(q){return q===l?(G++,D.consume(q),Z):G>=o?(D.exit("codeFencedFenceSequence"),Bt(q)?Zt(D,K,"whitespace")(q):K(q)):I(q)}function K(q){return q===null||dt(q)?(D.exit("codeFencedFence"),j(q)):I(q)}}}function RF(e,t,n){const r=this;return i;function i(o){return o===null?n(o):(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}const M1={name:"codeIndented",tokenize:jF},IF={partial:!0,tokenize:OF};function jF(e,t,n){const r=this;return i;function i(d){return e.enter("codeIndented"),Zt(e,s,"linePrefix",5)(d)}function s(d){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?o(d):n(d)}function o(d){return d===null?c(d):dt(d)?e.attempt(IF,o,c)(d):(e.enter("codeFlowValue"),l(d))}function l(d){return d===null||dt(d)?(e.exit("codeFlowValue"),o(d)):(e.consume(d),l)}function c(d){return e.exit("codeIndented"),t(d)}}function OF(e,t,n){const r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):dt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),i):Zt(e,s,"linePrefix",5)(o)}function s(o){const l=r.events[r.events.length-1];return l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):dt(o)?i(o):n(o)}}const zF={name:"codeText",previous:LF,resolve:PF,tokenize:BF};function PF(e){let t=e.length-4,n=3,r,i;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(i=r):(r===t||e[r][1].type==="lineEnding")&&(e[i][1].type="codeTextData",r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function LF(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function BF(e,t,n){let r=0,i,s;return o;function o(p){return e.enter("codeText"),e.enter("codeTextSequence"),l(p)}function l(p){return p===96?(e.consume(p),r++,l):(e.exit("codeTextSequence"),c(p))}function c(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),c):p===96?(s=e.enter("codeTextSequence"),i=0,h(p)):dt(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),c):(e.enter("codeTextData"),d(p))}function d(p){return p===null||p===32||p===96||dt(p)?(e.exit("codeTextData"),c(p)):(e.consume(p),d)}function h(p){return p===96?(e.consume(p),i++,h):i===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(s.type="codeTextData",d(p))}}class FF{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const i=n||0;this.setCursor(Math.trunc(t));const s=this.right.splice(this.right.length-i,Number.POSITIVE_INFINITY);return r&&mf(this.left,r),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),mf(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),mf(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);mf(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);mf(this.left,n.reverse())}}}function mf(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function jD(e){const t={};let n=-1,r,i,s,o,l,c,d;const h=new FF(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,s=0,s<c.length&&c[s][1].type==="lineEndingBlank"&&(s+=2),s<c.length&&c[s][1].type==="content"))for(;++s<c.length&&c[s][1].type!=="content";)c[s][1].type==="chunkText"&&(c[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,$F(h,n)),n=t[n],d=!0);else if(r[1]._container){for(s=n,i=void 0;s--;)if(o=h.get(s),o[1].type==="lineEnding"||o[1].type==="lineEndingBlank")o[0]==="enter"&&(i&&(h.get(i)[1].type="lineEndingBlank"),o[1].type="lineEnding",i=s);else if(!(o[1].type==="linePrefix"||o[1].type==="listItemIndent"))break;i&&(r[1].end={...h.get(i)[1].start},l=h.slice(i,n),l.unshift(r),h.splice(i,n-i+1,l))}}return ss(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!d}function $F(e,t){const n=e.get(t)[1],r=e.get(t)[2];let i=t-1;const s=[];let o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));const l=o.events,c=[],d={};let h,p,b=-1,y=n,x=0,k=0;const S=[k];for(;y;){for(;e.get(++i)[1]!==y;);s.push(i),y._tokenizer||(h=r.sliceStream(y),y.next||h.push(null),p&&o.defineSkip(y.start),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(h),y._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),p=y,y=y.next}for(y=n;++b<l.length;)l[b][0]==="exit"&&l[b-1][0]==="enter"&&l[b][1].type===l[b-1][1].type&&l[b][1].start.line!==l[b][1].end.line&&(k=b+1,S.push(k),y._tokenizer=void 0,y.previous=void 0,y=y.next);for(o.events=[],y?(y._tokenizer=void 0,y.previous=void 0):S.pop(),b=S.length;b--;){const C=l.slice(S[b],S[b+1]),_=s.pop();c.push([_,_+C.length-1]),e.splice(_,2,C)}for(c.reverse(),b=-1;++b<c.length;)d[x+c[b][0]]=x+c[b][1],x+=c[b][1]-c[b][0]-1;return d}const UF={resolve:VF,tokenize:qF},HF={partial:!0,tokenize:GF};function VF(e){return jD(e),e}function qF(e,t){let n;return r;function r(l){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),i(l)}function i(l){return l===null?s(l):dt(l)?e.check(HF,o,s)(l):(e.consume(l),i)}function s(l){return e.exit("chunkContent"),e.exit("content"),t(l)}function o(l){return e.consume(l),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,i}}function GF(e,t,n){const r=this;return i;function i(o){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Zt(e,s,"linePrefix")}function s(o){if(o===null||dt(o))return n(o);const l=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&l&&l[1].type==="linePrefix"&&l[2].sliceSerialize(l[1],!0).length>=4?t(o):e.interrupt(r.parser.constructs.flow,n,t)(o)}}function OD(e,t,n,r,i,s,o,l,c){const d=c||Number.POSITIVE_INFINITY;let h=0;return p;function p(C){return C===60?(e.enter(r),e.enter(i),e.enter(s),e.consume(C),e.exit(s),b):C===null||C===32||C===41||og(C)?n(C):(e.enter(r),e.enter(o),e.enter(l),e.enter("chunkString",{contentType:"string"}),k(C))}function b(C){return C===62?(e.enter(s),e.consume(C),e.exit(s),e.exit(i),e.exit(r),t):(e.enter(l),e.enter("chunkString",{contentType:"string"}),y(C))}function y(C){return C===62?(e.exit("chunkString"),e.exit(l),b(C)):C===null||C===60||dt(C)?n(C):(e.consume(C),C===92?x:y)}function x(C){return C===60||C===62||C===92?(e.consume(C),y):y(C)}function k(C){return!h&&(C===null||C===41||Sn(C))?(e.exit("chunkString"),e.exit(l),e.exit(o),e.exit(r),t(C)):h<d&&C===40?(e.consume(C),h++,k):C===41?(e.consume(C),h--,k):C===null||C===32||C===40||og(C)?n(C):(e.consume(C),C===92?S:k)}function S(C){return C===40||C===41||C===92?(e.consume(C),k):k(C)}}function zD(e,t,n,r,i,s){const o=this;let l=0,c;return d;function d(y){return e.enter(r),e.enter(i),e.consume(y),e.exit(i),e.enter(s),h}function h(y){return l>999||y===null||y===91||y===93&&!c||y===94&&!l&&"_hiddenFootnoteSupport"in o.parser.constructs?n(y):y===93?(e.exit(s),e.enter(i),e.consume(y),e.exit(i),e.exit(r),t):dt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===null||y===91||y===93||dt(y)||l++>999?(e.exit("chunkString"),h(y)):(e.consume(y),c||(c=!Bt(y)),y===92?b:p)}function b(y){return y===91||y===92||y===93?(e.consume(y),l++,p):p(y)}}function PD(e,t,n,r,i,s){let o;return l;function l(b){return b===34||b===39||b===40?(e.enter(r),e.enter(i),e.consume(b),e.exit(i),o=b===40?41:b,c):n(b)}function c(b){return b===o?(e.enter(i),e.consume(b),e.exit(i),e.exit(r),t):(e.enter(s),d(b))}function d(b){return b===o?(e.exit(s),c(o)):b===null?n(b):dt(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),Zt(e,d,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(b))}function h(b){return b===o||b===null||dt(b)?(e.exit("chunkString"),d(b)):(e.consume(b),b===92?p:h)}function p(b){return b===o||b===92?(e.consume(b),h):h(b)}}function Of(e,t){let n;return r;function r(i){return dt(i)?(e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),n=!0,r):Bt(i)?Zt(e,r,n?"linePrefix":"lineSuffix")(i):t(i)}}const ZF={name:"definition",tokenize:KF},WF={partial:!0,tokenize:YF};function KF(e,t,n){const r=this;let i;return s;function s(y){return e.enter("definition"),o(y)}function o(y){return zD.call(r,e,l,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(y)}function l(y){return i=Zs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),c):n(y)}function c(y){return Sn(y)?Of(e,d)(y):d(y)}function d(y){return OD(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(y)}function h(y){return e.attempt(WF,p,p)(y)}function p(y){return Bt(y)?Zt(e,b,"whitespace")(y):b(y)}function b(y){return y===null||dt(y)?(e.exit("definition"),r.parser.defined.push(i),t(y)):n(y)}}function YF(e,t,n){return r;function r(l){return Sn(l)?Of(e,i)(l):n(l)}function i(l){return PD(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(l)}function s(l){return Bt(l)?Zt(e,o,"whitespace")(l):o(l)}function o(l){return l===null||dt(l)?t(l):n(l)}}const JF={name:"hardBreakEscape",tokenize:XF};function XF(e,t,n){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),i}function i(s){return dt(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}const QF={name:"headingAtx",resolve:e$,tokenize:t$};function e$(e,t){let n=e.length-2,r=3,i,s;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(i={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},s={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},ss(e,r,n-r+1,[["enter",i,t],["enter",s,t],["exit",s,t],["exit",i,t]])),e}function t$(e,t,n){let r=0;return i;function i(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),o(h)}function o(h){return h===35&&r++<6?(e.consume(h),o):h===null||Sn(h)?(e.exit("atxHeadingSequence"),l(h)):n(h)}function l(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||dt(h)?(e.exit("atxHeading"),t(h)):Bt(h)?Zt(e,l,"whitespace")(h):(e.enter("atxHeadingText"),d(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),l(h))}function d(h){return h===null||h===35||Sn(h)?(e.exit("atxHeadingText"),l(h)):(e.consume(h),d)}}const n$=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],sT=["pre","script","style","textarea"],r$={concrete:!0,name:"htmlFlow",resolveTo:o$,tokenize:a$},i$={partial:!0,tokenize:u$},s$={partial:!0,tokenize:l$};function o$(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function a$(e,t,n){const r=this;let i,s,o,l,c;return d;function d(O){return h(O)}function h(O){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),b):O===47?(e.consume(O),s=!0,k):O===63?(e.consume(O),i=3,r.interrupt?t:z):bi(O)?(e.consume(O),o=String.fromCharCode(O),S):n(O)}function b(O){return O===45?(e.consume(O),i=2,y):O===91?(e.consume(O),i=5,l=0,x):bi(O)?(e.consume(O),i=4,r.interrupt?t:z):n(O)}function y(O){return O===45?(e.consume(O),r.interrupt?t:z):n(O)}function x(O){const te="CDATA[";return O===te.charCodeAt(l++)?(e.consume(O),l===te.length?r.interrupt?t:V:x):n(O)}function k(O){return bi(O)?(e.consume(O),o=String.fromCharCode(O),S):n(O)}function S(O){if(O===null||O===47||O===62||Sn(O)){const te=O===47,se=o.toLowerCase();return!te&&!s&&sT.includes(se)?(i=1,r.interrupt?t(O):V(O)):n$.includes(o.toLowerCase())?(i=6,te?(e.consume(O),C):r.interrupt?t(O):V(O)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(O):s?_(O):A(O))}return O===45||si(O)?(e.consume(O),o+=String.fromCharCode(O),S):n(O)}function C(O){return O===62?(e.consume(O),r.interrupt?t:V):n(O)}function _(O){return Bt(O)?(e.consume(O),_):L(O)}function A(O){return O===47?(e.consume(O),L):O===58||O===95||bi(O)?(e.consume(O),M):Bt(O)?(e.consume(O),A):L(O)}function M(O){return O===45||O===46||O===58||O===95||si(O)?(e.consume(O),M):R(O)}function R(O){return O===61?(e.consume(O),D):Bt(O)?(e.consume(O),R):A(O)}function D(O){return O===null||O===60||O===61||O===62||O===96?n(O):O===34||O===39?(e.consume(O),c=O,j):Bt(O)?(e.consume(O),D):I(O)}function j(O){return O===c?(e.consume(O),c=null,G):O===null||dt(O)?n(O):(e.consume(O),j)}function I(O){return O===null||O===34||O===39||O===47||O===60||O===61||O===62||O===96||Sn(O)?R(O):(e.consume(O),I)}function G(O){return O===47||O===62||Bt(O)?A(O):n(O)}function L(O){return O===62?(e.consume(O),H):n(O)}function H(O){return O===null||dt(O)?V(O):Bt(O)?(e.consume(O),H):n(O)}function V(O){return O===45&&i===2?(e.consume(O),B):O===60&&i===1?(e.consume(O),W):O===62&&i===4?(e.consume(O),F):O===63&&i===3?(e.consume(O),z):O===93&&i===5?(e.consume(O),ue):dt(O)&&(i===6||i===7)?(e.exit("htmlFlowData"),e.check(i$,$,Z)(O)):O===null||dt(O)?(e.exit("htmlFlowData"),Z(O)):(e.consume(O),V)}function Z(O){return e.check(s$,K,$)(O)}function K(O){return e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),q}function q(O){return O===null||dt(O)?Z(O):(e.enter("htmlFlowData"),V(O))}function B(O){return O===45?(e.consume(O),z):V(O)}function W(O){return O===47?(e.consume(O),o="",ee):V(O)}function ee(O){if(O===62){const te=o.toLowerCase();return sT.includes(te)?(e.consume(O),F):V(O)}return bi(O)&&o.length<8?(e.consume(O),o+=String.fromCharCode(O),ee):V(O)}function ue(O){return O===93?(e.consume(O),z):V(O)}function z(O){return O===62?(e.consume(O),F):O===45&&i===2?(e.consume(O),z):V(O)}function F(O){return O===null||dt(O)?(e.exit("htmlFlowData"),$(O)):(e.consume(O),F)}function $(O){return e.exit("htmlFlow"),t(O)}}function l$(e,t,n){const r=this;return i;function i(o){return dt(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),s):n(o)}function s(o){return r.parser.lazy[r.now().line]?n(o):t(o)}}function u$(e,t,n){return r;function r(i){return e.enter("lineEnding"),e.consume(i),e.exit("lineEnding"),e.attempt(Ih,t,n)}}const c$={name:"htmlText",tokenize:d$};function d$(e,t,n){const r=this;let i,s,o;return l;function l(z){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(z),c}function c(z){return z===33?(e.consume(z),d):z===47?(e.consume(z),R):z===63?(e.consume(z),A):bi(z)?(e.consume(z),I):n(z)}function d(z){return z===45?(e.consume(z),h):z===91?(e.consume(z),s=0,x):bi(z)?(e.consume(z),_):n(z)}function h(z){return z===45?(e.consume(z),y):n(z)}function p(z){return z===null?n(z):z===45?(e.consume(z),b):dt(z)?(o=p,W(z)):(e.consume(z),p)}function b(z){return z===45?(e.consume(z),y):p(z)}function y(z){return z===62?B(z):z===45?b(z):p(z)}function x(z){const F="CDATA[";return z===F.charCodeAt(s++)?(e.consume(z),s===F.length?k:x):n(z)}function k(z){return z===null?n(z):z===93?(e.consume(z),S):dt(z)?(o=k,W(z)):(e.consume(z),k)}function S(z){return z===93?(e.consume(z),C):k(z)}function C(z){return z===62?B(z):z===93?(e.consume(z),C):k(z)}function _(z){return z===null||z===62?B(z):dt(z)?(o=_,W(z)):(e.consume(z),_)}function A(z){return z===null?n(z):z===63?(e.consume(z),M):dt(z)?(o=A,W(z)):(e.consume(z),A)}function M(z){return z===62?B(z):A(z)}function R(z){return bi(z)?(e.consume(z),D):n(z)}function D(z){return z===45||si(z)?(e.consume(z),D):j(z)}function j(z){return dt(z)?(o=j,W(z)):Bt(z)?(e.consume(z),j):B(z)}function I(z){return z===45||si(z)?(e.consume(z),I):z===47||z===62||Sn(z)?G(z):n(z)}function G(z){return z===47?(e.consume(z),B):z===58||z===95||bi(z)?(e.consume(z),L):dt(z)?(o=G,W(z)):Bt(z)?(e.consume(z),G):B(z)}function L(z){return z===45||z===46||z===58||z===95||si(z)?(e.consume(z),L):H(z)}function H(z){return z===61?(e.consume(z),V):dt(z)?(o=H,W(z)):Bt(z)?(e.consume(z),H):G(z)}function V(z){return z===null||z===60||z===61||z===62||z===96?n(z):z===34||z===39?(e.consume(z),i=z,Z):dt(z)?(o=V,W(z)):Bt(z)?(e.consume(z),V):(e.consume(z),K)}function Z(z){return z===i?(e.consume(z),i=void 0,q):z===null?n(z):dt(z)?(o=Z,W(z)):(e.consume(z),Z)}function K(z){return z===null||z===34||z===39||z===60||z===61||z===96?n(z):z===47||z===62||Sn(z)?G(z):(e.consume(z),K)}function q(z){return z===47||z===62||Sn(z)?G(z):n(z)}function B(z){return z===62?(e.consume(z),e.exit("htmlTextData"),e.exit("htmlText"),t):n(z)}function W(z){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),ee}function ee(z){return Bt(z)?Zt(e,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):ue(z)}function ue(z){return e.enter("htmlTextData"),o(z)}}const rS={name:"labelEnd",resolveAll:m$,resolveTo:g$,tokenize:b$},f$={tokenize:y$},h$={tokenize:x$},p$={tokenize:v$};function m$(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const i=r.type==="labelImage"?4:2;r.type="data",t+=i}}return e.length!==n.length&&ss(e,0,e.length,n),e}function g$(e,t){let n=e.length,r=0,i,s,o,l;for(;n--;)if(i=e[n][1],s){if(i.type==="link"||i.type==="labelLink"&&i._inactive)break;e[n][0]==="enter"&&i.type==="labelLink"&&(i._inactive=!0)}else if(o){if(e[n][0]==="enter"&&(i.type==="labelImage"||i.type==="labelLink")&&!i._balanced&&(s=n,i.type!=="labelLink")){r=2;break}}else i.type==="labelEnd"&&(o=n);const c={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},d={type:"label",start:{...e[s][1].start},end:{...e[o][1].end}},h={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[o-2][1].start}};return l=[["enter",c,t],["enter",d,t]],l=As(l,e.slice(s+1,s+r+3)),l=As(l,[["enter",h,t]]),l=As(l,M0(t.parser.constructs.insideSpan.null,e.slice(s+r+4,o-3),t)),l=As(l,[["exit",h,t],e[o-2],e[o-1],["exit",d,t]]),l=As(l,e.slice(o+1)),l=As(l,[["exit",c,t]]),ss(e,s,e.length,l),e}function b$(e,t,n){const r=this;let i=r.events.length,s,o;for(;i--;)if((r.events[i][1].type==="labelImage"||r.events[i][1].type==="labelLink")&&!r.events[i][1]._balanced){s=r.events[i][1];break}return l;function l(b){return s?s._inactive?p(b):(o=r.parser.defined.includes(Zs(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),c):n(b)}function c(b){return b===40?e.attempt(f$,h,o?h:p)(b):b===91?e.attempt(h$,h,o?d:p)(b):o?h(b):p(b)}function d(b){return e.attempt(p$,h,p)(b)}function h(b){return t(b)}function p(b){return s._balanced=!0,n(b)}}function y$(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),i}function i(p){return Sn(p)?Of(e,s)(p):s(p)}function s(p){return p===41?h(p):OD(e,o,l,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function o(p){return Sn(p)?Of(e,c)(p):h(p)}function l(p){return n(p)}function c(p){return p===34||p===39||p===40?PD(e,d,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):h(p)}function d(p){return Sn(p)?Of(e,h)(p):h(p)}function h(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function x$(e,t,n){const r=this;return i;function i(l){return zD.call(r,e,s,o,"reference","referenceMarker","referenceString")(l)}function s(l){return r.parser.defined.includes(Zs(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(l):n(l)}function o(l){return n(l)}}function v$(e,t,n){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),i}function i(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),t):n(s)}}const k$={name:"labelStartImage",resolveAll:rS.resolveAll,tokenize:S$};function S$(e,t,n){const r=this;return i;function i(l){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(l),e.exit("labelImageMarker"),s}function s(l){return l===91?(e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelImage"),o):n(l)}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const w$={name:"labelStartLink",resolveAll:rS.resolveAll,tokenize:C$};function C$(e,t,n){const r=this;return i;function i(o){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelLink"),s}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const D1={name:"lineEnding",tokenize:E$};function E$(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Zt(e,t,"linePrefix")}}const Km={name:"thematicBreak",tokenize:_$};function _$(e,t,n){let r=0,i;return s;function s(d){return e.enter("thematicBreak"),o(d)}function o(d){return i=d,l(d)}function l(d){return d===i?(e.enter("thematicBreakSequence"),c(d)):r>=3&&(d===null||dt(d))?(e.exit("thematicBreak"),t(d)):n(d)}function c(d){return d===i?(e.consume(d),r++,c):(e.exit("thematicBreakSequence"),Bt(d)?Zt(e,l,"whitespace")(d):l(d))}}const Ii={continuation:{tokenize:M$},exit:R$,name:"list",tokenize:N$},T$={partial:!0,tokenize:I$},A$={partial:!0,tokenize:D$};function N$(e,t,n){const r=this,i=r.events[r.events.length-1];let s=i&&i[1].type==="linePrefix"?i[2].sliceSerialize(i[1],!0).length:0,o=0;return l;function l(y){const x=r.containerState.type||(y===42||y===43||y===45?"listUnordered":"listOrdered");if(x==="listUnordered"?!r.containerState.marker||y===r.containerState.marker:Sv(y)){if(r.containerState.type||(r.containerState.type=x,e.enter(x,{_container:!0})),x==="listUnordered")return e.enter("listItemPrefix"),y===42||y===45?e.check(Km,n,d)(y):d(y);if(!r.interrupt||y===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(y)}return n(y)}function c(y){return Sv(y)&&++o<10?(e.consume(y),c):(!r.interrupt||o<2)&&(r.containerState.marker?y===r.containerState.marker:y===41||y===46)?(e.exit("listItemValue"),d(y)):n(y)}function d(y){return e.enter("listItemMarker"),e.consume(y),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||y,e.check(Ih,r.interrupt?n:h,e.attempt(T$,b,p))}function h(y){return r.containerState.initialBlankLine=!0,s++,b(y)}function p(y){return Bt(y)?(e.enter("listItemPrefixWhitespace"),e.consume(y),e.exit("listItemPrefixWhitespace"),b):n(y)}function b(y){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(y)}}function M$(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ih,i,s);function i(l){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Zt(e,t,"listItemIndent",r.containerState.size+1)(l)}function s(l){return r.containerState.furtherBlankLines||!Bt(l)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(l)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(A$,t,o)(l))}function o(l){return r.containerState._closeFlow=!0,r.interrupt=void 0,Zt(e,e.attempt(Ii,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l)}}function D$(e,t,n){const r=this;return Zt(e,i,"listItemIndent",r.containerState.size+1);function i(s){const o=r.events[r.events.length-1];return o&&o[1].type==="listItemIndent"&&o[2].sliceSerialize(o[1],!0).length===r.containerState.size?t(s):n(s)}}function R$(e){e.exit(this.containerState.type)}function I$(e,t,n){const r=this;return Zt(e,i,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function i(s){const o=r.events[r.events.length-1];return!Bt(s)&&o&&o[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}const oT={name:"setextUnderline",resolveTo:j$,tokenize:O$};function j$(e,t){let n=e.length,r,i,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(i=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);const o={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[i][1].type="setextHeadingText",s?(e.splice(i,0,["enter",o,t]),e.splice(s+1,0,["exit",e[r][1],t]),e[r][1].end={...e[s][1].end}):e[r][1]=o,e.push(["exit",o,t]),e}function O$(e,t,n){const r=this;let i;return s;function s(d){let h=r.events.length,p;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){p=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),i=d,o(d)):n(d)}function o(d){return e.enter("setextHeadingLineSequence"),l(d)}function l(d){return d===i?(e.consume(d),l):(e.exit("setextHeadingLineSequence"),Bt(d)?Zt(e,c,"lineSuffix")(d):c(d))}function c(d){return d===null||dt(d)?(e.exit("setextHeadingLine"),t(d)):n(d)}}const z$={tokenize:P$};function P$(e){const t=this,n=e.attempt(Ih,r,e.attempt(this.parser.constructs.flowInitial,i,Zt(e,e.attempt(this.parser.constructs.flow,i,e.attempt(UF,i)),"linePrefix")));return n;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function i(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const L$={resolveAll:BD()},B$=LD("string"),F$=LD("text");function LD(e){return{resolveAll:BD(e==="text"?$$:void 0),tokenize:t};function t(n){const r=this,i=this.parser.constructs[e],s=n.attempt(i,o,l);return o;function o(h){return d(h)?s(h):l(h)}function l(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return d(h)?(n.exit("data"),s(h)):(n.consume(h),c)}function d(h){if(h===null)return!0;const p=i[h];let b=-1;if(p)for(;++b<p.length;){const y=p[b];if(!y.previous||y.previous.call(r,r.previous))return!0}return!1}}}function BD(e){return t;function t(n,r){let i=-1,s;for(;++i<=n.length;)s===void 0?n[i]&&n[i][1].type==="data"&&(s=i,i++):(!n[i]||n[i][1].type!=="data")&&(i!==s+2&&(n[s][1].end=n[i-1][1].end,n.splice(s+2,i-s-2),i=s+2),s=void 0);return e?e(n,r):n}}function $$(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],i=t.sliceStream(r);let s=i.length,o=-1,l=0,c;for(;s--;){const d=i[s];if(typeof d=="string"){for(o=d.length;d.charCodeAt(o-1)===32;)l++,o--;if(o)break;o=-1}else if(d===-2)c=!0,l++;else if(d!==-1){s++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(l=0),l){const d={type:n===e.length||c||l<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?o:r.start._bufferIndex+o,_index:r.start._index+s,line:r.end.line,column:r.end.column-l,offset:r.end.offset-l},end:{...r.end}};r.end={...d.start},r.start.offset===r.end.offset?Object.assign(r,d):(e.splice(n,0,["enter",d,t],["exit",d,t]),n+=2)}n++}return e}const U$={42:Ii,43:Ii,45:Ii,48:Ii,49:Ii,50:Ii,51:Ii,52:Ii,53:Ii,54:Ii,55:Ii,56:Ii,57:Ii,62:DD},H$={91:ZF},V$={[-2]:M1,[-1]:M1,32:M1},q$={35:QF,42:Km,45:[oT,Km],60:r$,61:oT,95:Km,96:iT,126:iT},G$={38:ID,92:RD},Z$={[-5]:D1,[-4]:D1,[-3]:D1,33:k$,38:ID,42:wv,60:[wF,c$],91:w$,92:[JF,RD],93:rS,95:wv,96:zF},W$={null:[wv,L$]},K$={null:[42,95]},Y$={null:[]},J$=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:K$,contentInitial:H$,disable:Y$,document:U$,flow:q$,flowInitial:V$,insideSpan:W$,string:G$,text:Z$},Symbol.toStringTag,{value:"Module"}));function X$(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const i={},s=[];let o=[],l=[];const c={attempt:j(R),check:j(D),consume:_,enter:A,exit:M,interrupt:j(D,{interrupt:!0})},d={code:null,containerState:{},defineSkip:k,events:[],now:x,parser:e,previous:null,sliceSerialize:b,sliceStream:y,write:p};let h=t.tokenize.call(d,c);return t.resolveAll&&s.push(t),d;function p(H){return o=As(o,H),S(),o[o.length-1]!==null?[]:(I(t,0),d.events=M0(s,d.events,d),d.events)}function b(H,V){return e7(y(H),V)}function y(H){return Q$(o,H)}function x(){const{_bufferIndex:H,_index:V,line:Z,column:K,offset:q}=r;return{_bufferIndex:H,_index:V,line:Z,column:K,offset:q}}function k(H){i[H.line]=H.column,L()}function S(){let H;for(;r._index<o.length;){const V=o[r._index];if(typeof V=="string")for(H=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===H&&r._bufferIndex<V.length;)C(V.charCodeAt(r._bufferIndex));else C(V)}}function C(H){h=h(H)}function _(H){dt(H)?(r.line++,r.column=1,r.offset+=H===-3?2:1,L()):H!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),d.previous=H}function A(H,V){const Z=V||{};return Z.type=H,Z.start=x(),d.events.push(["enter",Z,d]),l.push(Z),Z}function M(H){const V=l.pop();return V.end=x(),d.events.push(["exit",V,d]),V}function R(H,V){I(H,V.from)}function D(H,V){V.restore()}function j(H,V){return Z;function Z(K,q,B){let W,ee,ue,z;return Array.isArray(K)?$(K):"tokenize"in K?$([K]):F(K);function F(de){return le;function le(Ae){const Te=Ae!==null&&de[Ae],Oe=Ae!==null&&de.null,re=[...Array.isArray(Te)?Te:Te?[Te]:[],...Array.isArray(Oe)?Oe:Oe?[Oe]:[]];return $(re)(Ae)}}function $(de){return W=de,ee=0,de.length===0?B:O(de[ee])}function O(de){return le;function le(Ae){return z=G(),ue=de,de.partial||(d.currentConstruct=de),de.name&&d.parser.constructs.disable.null.includes(de.name)?se():de.tokenize.call(V?Object.assign(Object.create(d),V):d,c,te,se)(Ae)}}function te(de){return H(ue,z),q}function se(de){return z.restore(),++ee<W.length?O(W[ee]):B}}}function I(H,V){H.resolveAll&&!s.includes(H)&&s.push(H),H.resolve&&ss(d.events,V,d.events.length-V,H.resolve(d.events.slice(V),d)),H.resolveTo&&(d.events=H.resolveTo(d.events,d))}function G(){const H=x(),V=d.previous,Z=d.currentConstruct,K=d.events.length,q=Array.from(l);return{from:K,restore:B};function B(){r=H,d.previous=V,d.currentConstruct=Z,d.events.length=K,l=q,L()}}function L(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function Q$(e,t){const n=t.start._index,r=t.start._bufferIndex,i=t.end._index,s=t.end._bufferIndex;let o;if(n===i)o=[e[n].slice(r,s)];else{if(o=e.slice(n,i),r>-1){const l=o[0];typeof l=="string"?o[0]=l.slice(r):o.shift()}s>0&&o.push(e[i].slice(0,s))}return o}function e7(e,t){let n=-1;const r=[];let i;for(;++n<e.length;){const s=e[n];let o;if(typeof s=="string")o=s;else switch(s){case-5:{o="\r";break}case-4:{o=`
339
339
  `;break}case-3:{o=`\r
340
340
  `;break}case-2:{o=t?" ":" ";break}case-1:{if(!t&&i)continue;o=" ";break}default:o=String.fromCharCode(s)}i=s===-2,r.push(o)}return r.join("")}function t7(e){const r={constructs:ND([J$,...(e||{}).extensions||[]]),content:i(gF),defined:[],document:i(yF),flow:i(z$),lazy:{},string:i(B$),text:i(F$)};return r;function i(s){return o;function o(l){return X$(r,s,l)}}}function n7(e){for(;!jD(e););return e}const aT=/[\0\t\n\r]/g;function r7(){let e=1,t="",n=!0,r;return i;function i(s,o,l){const c=[];let d,h,p,b,y;for(s=t+(typeof s=="string"?s.toString():new TextDecoder(o||void 0).decode(s)),p=0,t="",n&&(s.charCodeAt(0)===65279&&p++,n=void 0);p<s.length;){if(aT.lastIndex=p,d=aT.exec(s),b=d&&d.index!==void 0?d.index:s.length,y=s.charCodeAt(b),!d){t=s.slice(p);break}if(y===10&&p===b&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),p<b&&(c.push(s.slice(p,b)),e+=b-p),y){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return l&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const i7=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function s7(e){return e.replace(i7,o7)}function o7(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const i=n.charCodeAt(1),s=i===120||i===88;return MD(n.slice(s?2:1),s?16:10)}return nS(n)||e}const FD={}.hasOwnProperty;function a7(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),l7(n)(n7(t7(n).document().write(r7()(e,t,!0))))}function l7(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(qe),autolinkProtocol:G,autolinkEmail:G,atxHeading:s(Be),blockQuote:s(Oe),characterEscape:G,characterReference:G,codeFenced:s(re),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:s(re,o),codeText:s(X,o),codeTextData:G,data:G,codeFlowValue:G,definition:s(je),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:s(ze),hardBreakEscape:s(Ze),hardBreakTrailing:s(Ze),htmlFlow:s(kt,o),htmlFlowData:G,htmlText:s(kt,o),htmlTextData:G,image:s(it),label:o,link:s(qe),listItem:s(Kn),listItemValue:b,listOrdered:s(Wt,p),listUnordered:s(Wt),paragraph:s(Yn),reference:O,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:s(Be),strong:s(St),thematicBreak:s(Cn)},exit:{atxHeading:c(),atxHeadingSequence:R,autolink:c(),autolinkEmail:Te,autolinkProtocol:Ae,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:se,characterReferenceMarkerNumeric:se,characterReferenceValue:de,characterReference:le,codeFenced:c(S),codeFencedFence:k,codeFencedFenceInfo:y,codeFencedFenceMeta:x,codeFlowValue:L,codeIndented:c(C),codeText:c(q),codeTextData:L,data:L,definition:c(),definitionDestinationString:M,definitionLabelString:_,definitionTitleString:A,emphasis:c(),hardBreakEscape:c(V),hardBreakTrailing:c(V),htmlFlow:c(Z),htmlFlowData:L,htmlText:c(K),htmlTextData:L,image:c(W),label:ue,labelText:ee,lineEnding:H,link:c(B),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:te,resourceDestinationString:z,resourceTitleString:F,resource:$,setextHeading:c(I),setextHeadingLineSequence:j,setextHeadingText:D,strong:c(),thematicBreak:c()}};$D(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(fe){let pe={type:"root",children:[]};const Ue={stack:[pe],tokenStack:[],config:t,enter:l,exit:d,buffer:o,resume:h,data:n},nt=[];let oe=-1;for(;++oe<fe.length;)if(fe[oe][1].type==="listOrdered"||fe[oe][1].type==="listUnordered")if(fe[oe][0]==="enter")nt.push(oe);else{const Pe=nt.pop();oe=i(fe,Pe,oe)}for(oe=-1;++oe<fe.length;){const Pe=t[fe[oe][0]];FD.call(Pe,fe[oe][1].type)&&Pe[fe[oe][1].type].call(Object.assign({sliceSerialize:fe[oe][2].sliceSerialize},Ue),fe[oe][1])}if(Ue.tokenStack.length>0){const Pe=Ue.tokenStack[Ue.tokenStack.length-1];(Pe[1]||lT).call(Ue,void 0,Pe[0])}for(pe.position={start:Ga(fe.length>0?fe[0][1].start:{line:1,column:1,offset:0}),end:Ga(fe.length>0?fe[fe.length-2][1].end:{line:1,column:1,offset:0})},oe=-1;++oe<t.transforms.length;)pe=t.transforms[oe](pe)||pe;return pe}function i(fe,pe,Ue){let nt=pe-1,oe=-1,Pe=!1,st,lt,Le,ut;for(;++nt<=Ue;){const $e=fe[nt];switch($e[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{$e[0]==="enter"?oe++:oe--,ut=void 0;break}case"lineEndingBlank":{$e[0]==="enter"&&(st&&!ut&&!oe&&!Le&&(Le=nt),ut=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:ut=void 0}if(!oe&&$e[0]==="enter"&&$e[1].type==="listItemPrefix"||oe===-1&&$e[0]==="exit"&&($e[1].type==="listUnordered"||$e[1].type==="listOrdered")){if(st){let It=nt;for(lt=void 0;It--;){const At=fe[It];if(At[1].type==="lineEnding"||At[1].type==="lineEndingBlank"){if(At[0]==="exit")continue;lt&&(fe[lt][1].type="lineEndingBlank",Pe=!0),At[1].type="lineEnding",lt=It}else if(!(At[1].type==="linePrefix"||At[1].type==="blockQuotePrefix"||At[1].type==="blockQuotePrefixWhitespace"||At[1].type==="blockQuoteMarker"||At[1].type==="listItemIndent"))break}Le&&(!lt||Le<lt)&&(st._spread=!0),st.end=Object.assign({},lt?fe[lt][1].start:$e[1].end),fe.splice(lt||nt,0,["exit",st,$e[2]]),nt++,Ue++}if($e[1].type==="listItemPrefix"){const It={type:"listItem",_spread:!1,start:Object.assign({},$e[1].start),end:void 0};st=It,fe.splice(nt,0,["enter",It,$e[2]]),nt++,Ue++,Le=void 0,ut=!0}}}return fe[pe][1]._spread=Pe,Ue}function s(fe,pe){return Ue;function Ue(nt){l.call(this,fe(nt),nt),pe&&pe.call(this,nt)}}function o(){this.stack.push({type:"fragment",children:[]})}function l(fe,pe,Ue){this.stack[this.stack.length-1].children.push(fe),this.stack.push(fe),this.tokenStack.push([pe,Ue||void 0]),fe.position={start:Ga(pe.start),end:void 0}}function c(fe){return pe;function pe(Ue){fe&&fe.call(this,Ue),d.call(this,Ue)}}function d(fe,pe){const Ue=this.stack.pop(),nt=this.tokenStack.pop();if(nt)nt[0].type!==fe.type&&(pe?pe.call(this,fe,nt[0]):(nt[1]||lT).call(this,fe,nt[0]));else throw new Error("Cannot close `"+fe.type+"` ("+jf({start:fe.start,end:fe.end})+"): it’s not open");Ue.position.end=Ga(fe.end)}function h(){return tS(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(fe){if(this.data.expectingFirstListItemValue){const pe=this.stack[this.stack.length-2];pe.start=Number.parseInt(this.sliceSerialize(fe),10),this.data.expectingFirstListItemValue=void 0}}function y(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.lang=fe}function x(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.meta=fe}function k(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function S(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=fe.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=fe.replace(/(\r?\n|\r)$/g,"")}function _(fe){const pe=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=pe,Ue.identifier=Zs(this.sliceSerialize(fe)).toLowerCase()}function A(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=fe}function M(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=fe}function R(fe){const pe=this.stack[this.stack.length-1];if(!pe.depth){const Ue=this.sliceSerialize(fe).length;pe.depth=Ue}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function j(fe){const pe=this.stack[this.stack.length-1];pe.depth=this.sliceSerialize(fe).codePointAt(0)===61?1:2}function I(){this.data.setextHeadingSlurpLineEnding=void 0}function G(fe){const Ue=this.stack[this.stack.length-1].children;let nt=Ue[Ue.length-1];(!nt||nt.type!=="text")&&(nt=xt(),nt.position={start:Ga(fe.start),end:void 0},Ue.push(nt)),this.stack.push(nt)}function L(fe){const pe=this.stack.pop();pe.value+=this.sliceSerialize(fe),pe.position.end=Ga(fe.end)}function H(fe){const pe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Ue=pe.children[pe.children.length-1];Ue.position.end=Ga(fe.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(pe.type)&&(G.call(this,fe),L.call(this,fe))}function V(){this.data.atHardBreak=!0}function Z(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=fe}function K(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=fe}function q(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.value=fe}function B(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=pe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function W(){const fe=this.stack[this.stack.length-1];if(this.data.inReference){const pe=this.data.referenceType||"shortcut";fe.type+="Reference",fe.referenceType=pe,delete fe.url,delete fe.title}else delete fe.identifier,delete fe.label;this.data.referenceType=void 0}function ee(fe){const pe=this.sliceSerialize(fe),Ue=this.stack[this.stack.length-2];Ue.label=s7(pe),Ue.identifier=Zs(pe).toLowerCase()}function ue(){const fe=this.stack[this.stack.length-1],pe=this.resume(),Ue=this.stack[this.stack.length-1];if(this.data.inReference=!0,Ue.type==="link"){const nt=fe.children;Ue.children=nt}else Ue.alt=pe}function z(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.url=fe}function F(){const fe=this.resume(),pe=this.stack[this.stack.length-1];pe.title=fe}function $(){this.data.inReference=void 0}function O(){this.data.referenceType="collapsed"}function te(fe){const pe=this.resume(),Ue=this.stack[this.stack.length-1];Ue.label=pe,Ue.identifier=Zs(this.sliceSerialize(fe)).toLowerCase(),this.data.referenceType="full"}function se(fe){this.data.characterReferenceType=fe.type}function de(fe){const pe=this.sliceSerialize(fe),Ue=this.data.characterReferenceType;let nt;Ue?(nt=MD(pe,Ue==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):nt=nS(pe);const oe=this.stack[this.stack.length-1];oe.value+=nt}function le(fe){const pe=this.stack.pop();pe.position.end=Ga(fe.end)}function Ae(fe){L.call(this,fe);const pe=this.stack[this.stack.length-1];pe.url=this.sliceSerialize(fe)}function Te(fe){L.call(this,fe);const pe=this.stack[this.stack.length-1];pe.url="mailto:"+this.sliceSerialize(fe)}function Oe(){return{type:"blockquote",children:[]}}function re(){return{type:"code",lang:null,meta:null,value:""}}function X(){return{type:"inlineCode",value:""}}function je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function ze(){return{type:"emphasis",children:[]}}function Be(){return{type:"heading",depth:0,children:[]}}function Ze(){return{type:"break"}}function kt(){return{type:"html",value:""}}function it(){return{type:"image",title:null,url:"",alt:null}}function qe(){return{type:"link",title:null,url:"",children:[]}}function Wt(fe){return{type:"list",ordered:fe.type==="listOrdered",start:null,spread:fe._spread,children:[]}}function Kn(fe){return{type:"listItem",spread:fe._spread,checked:null,children:[]}}function Yn(){return{type:"paragraph",children:[]}}function St(){return{type:"strong",children:[]}}function xt(){return{type:"text",value:""}}function Cn(){return{type:"thematicBreak"}}}function Ga(e){return{line:e.line,column:e.column,offset:e.offset}}function $D(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?$D(e,r):u7(e,r)}}function u7(e,t){let n;for(n in t)if(FD.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function lT(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+jf({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+jf({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+jf({start:t.start,end:t.end})+") is still open")}function c7(e){const t=this;t.parser=n;function n(r){return a7(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function d7(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function f7(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
@@ -693,7 +693,7 @@ ${n.innerHTML}
693
693
  `),e.text(t.textContent,!1),e.ensureNewLine(),e.write("```"),e.closeBlock(t)},parse:{setup(e){var t;e.set({langPrefix:(t=this.options.languageClassPrefix)!==null&&t!==void 0?t:"language-"})},updateDOM(e){e.innerHTML=e.innerHTML.replace(/\n<\/code><\/pre>/g,"</code></pre>")}}}}}}),Rbe=rn.create({name:"hardBreak"}),e8=Rbe.extend({addStorage(){return{markdown:{serialize(e,t,n,r){for(let i=r+1;i<n.childCount;i++)if(n.child(i).type!=t.type){e.write(e.inTable?kb.storage.markdown.serialize.call(this,e,t,n):`\\
694
694
  `);return}},parse:{}}}}}),Ibe=rn.create({name:"heading"}),jbe=Ibe.extend({addStorage(){return{markdown:{serialize:To.nodes.heading,parse:{}}}}}),Obe=rn.create({name:"horizontalRule"}),zbe=Obe.extend({addStorage(){return{markdown:{serialize:To.nodes.horizontal_rule,parse:{}}}}}),Pbe=rn.create({name:"image"}),Lbe=Pbe.extend({addStorage(){return{markdown:{serialize:To.nodes.image,parse:{}}}}}),Bbe=rn.create({name:"listItem"}),Fbe=Bbe.extend({addStorage(){return{markdown:{serialize:To.nodes.list_item,parse:{}}}}}),$be=rn.create({name:"orderedList"});function Ube(e,t,n){let r=0;for(;n-r>0&&t.child(n-r-1).type.name===e.type.name;r++);return r}const Hbe=$be.extend({addStorage(){return{markdown:{serialize(e,t,n,r){const i=t.attrs.start||1,s=String(i+t.childCount-1).length,o=e.repeat(" ",s+2),c=Ube(t,n,r)%2?") ":". ";e.renderList(t,o,d=>{const h=String(i+d);return e.repeat(" ",s-h.length)+h+c})},parse:{}}}}}),Vbe=rn.create({name:"paragraph"}),qbe=Vbe.extend({addStorage(){return{markdown:{serialize:To.nodes.paragraph,parse:{}}}}});function uv(e){var t,n;return(t=e==null||(n=e.content)===null||n===void 0?void 0:n.content)!==null&&t!==void 0?t:[]}const Gbe=rn.create({name:"table"}),Zbe=Gbe.extend({addStorage(){return{markdown:{serialize(e,t,n){if(!Wbe(t)){kb.storage.markdown.serialize.call(this,e,t,n);return}e.inTable=!0,t.forEach((r,i,s)=>{if(e.write("| "),r.forEach((o,l,c)=>{c&&e.write(" | ");const d=o.firstChild;d.textContent.trim()&&e.renderInline(d)}),e.write(" |"),e.ensureNewLine(),!s){const o=Array.from({length:r.childCount}).map(()=>"---").join(" | ");e.write(`| ${o} |`),e.ensureNewLine()}}),e.closeBlock(t),e.inTable=!1},parse:{}}}}});function $M(e){return e.attrs.colspan>1||e.attrs.rowspan>1}function Wbe(e){const t=uv(e),n=t[0],r=t.slice(1);return!(uv(n).some(i=>i.type.name!=="tableHeader"||$M(i)||i.childCount>1)||r.some(i=>uv(i).some(s=>s.type.name==="tableHeader"||$M(s)||s.childCount>1)))}const Kbe=rn.create({name:"taskItem"}),Ybe=Kbe.extend({addStorage(){return{markdown:{serialize(e,t){const n=t.attrs.checked?"[x]":"[ ]";e.write(`${n} `),e.renderContent(t)},parse:{updateDOM(e){[...e.querySelectorAll(".task-list-item")].forEach(t=>{const n=t.querySelector("input");t.setAttribute("data-type","taskItem"),n&&(t.setAttribute("data-checked",n.checked),n.remove())})}}}}}}),Jbe=rn.create({name:"taskList"}),Xbe=Jbe.extend({addStorage(){return{markdown:{serialize:Qz.storage.markdown.serialize,parse:{setup(e){e.use(pbe)},updateDOM(e){[...e.querySelectorAll(".contains-task-list")].forEach(t=>{t.setAttribute("data-type","taskList")})}}}}}}),Qbe=rn.create({name:"text"}),eye=Qbe.extend({addStorage(){return{markdown:{serialize(e,t){e.text(Sbe(t.text))},parse:{}}}}}),tye=wi.create({name:"bold"}),nye=tye.extend({addStorage(){return{markdown:{serialize:To.marks.strong,parse:{}}}}}),rye=wi.create({name:"code"}),iye=rye.extend({addStorage(){return{markdown:{serialize:To.marks.code,parse:{}}}}}),sye=wi.create({name:"italic"}),oye=sye.extend({addStorage(){return{markdown:{serialize:To.marks.em,parse:{}}}}}),aye=wi.create({name:"link"}),lye=aye.extend({addStorage(){return{markdown:{serialize:To.marks.link,parse:{}}}}}),uye=wi.create({name:"strike"}),cye=uye.extend({addStorage(){return{markdown:{serialize:{open:"~~",close:"~~",expelEnclosingWhitespace:!0},parse:{}}}}}),dye=[Abe,Qz,Dbe,e8,jbe,zbe,kb,Lbe,Fbe,Hbe,qbe,Zbe,Ybe,Xbe,eye,nye,iye,Xz,oye,lye,cye];function A0(e){var t,n;const r=(t=e.storage)===null||t===void 0?void 0:t.markdown,i=(n=dye.find(s=>s.name===e.name))===null||n===void 0?void 0:n.storage.markdown;return r||i?{...i,...r}:null}class fye{constructor(t){T0(this,"editor",null),this.editor=t}serialize(t){const n=new kbe(this.nodes,this.marks,{hardBreakNodeName:e8.name});return n.renderContent(t),n.out}get nodes(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.nodes).map(n=>[n,this.serializeNode(kb)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="node"&&this.serializeNode(n)).map(n=>[n.name,this.serializeNode(n)]))!==null&&t!==void 0?t:[])}}get marks(){var t;return{...Object.fromEntries(Object.keys(this.editor.schema.marks).map(n=>[n,this.serializeMark(Xz)])),...Object.fromEntries((t=this.editor.extensionManager.extensions.filter(n=>n.type==="mark"&&this.serializeMark(n)).map(n=>[n.name,this.serializeMark(n)]))!==null&&t!==void 0?t:[])}}serializeNode(t){var n;return(n=A0(t))===null||n===void 0||(n=n.serialize)===null||n===void 0?void 0:n.bind({editor:this.editor,options:t.options})}serializeMark(t){var n;const r=(n=A0(t))===null||n===void 0?void 0:n.serialize;return r?{...r,open:typeof r.open=="function"?r.open.bind({editor:this.editor,options:t.options}):r.open,close:typeof r.close=="function"?r.close.bind({editor:this.editor,options:t.options}):r.close}:null}}class hye{constructor(t,n){T0(this,"editor",null),T0(this,"md",null);let{html:r,linkify:i,breaks:s}=n;this.editor=t,this.md=this.withPatchedRenderer(Bi({html:r,linkify:i,breaks:s}))}parse(t){let{inline:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(typeof t=="string"){this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=A0(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.setup)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},this.md)});const r=this.md.render(t),i=Qw(r);return this.editor.extensionManager.extensions.forEach(s=>{var o;return(o=A0(s))===null||o===void 0||(o=o.parse)===null||o===void 0||(o=o.updateDOM)===null||o===void 0?void 0:o.call({editor:this.editor,options:s.options},i)}),this.normalizeDOM(i,{inline:n,content:t}),i.innerHTML}return t}normalizeDOM(t,n){let{inline:r,content:i}=n;return this.normalizeBlocks(t),t.querySelectorAll("*").forEach(s=>{var o;((o=s.nextSibling)===null||o===void 0?void 0:o.nodeType)===Node.TEXT_NODE&&!s.closest("pre")&&(s.nextSibling.textContent=s.nextSibling.textContent.replace(/^\n/,""))}),r&&this.normalizeInline(t,i),t}normalizeBlocks(t){const r=Object.values(this.editor.schema.nodes).filter(i=>i.isBlock).map(i=>{var s;return(s=i.spec.parseDOM)===null||s===void 0?void 0:s.map(o=>o.tag)}).flat().filter(Boolean).join(",");r&&[...t.querySelectorAll(r)].forEach(i=>{i.parentElement.matches("p")&&wbe(i)})}normalizeInline(t,n){var r;if((r=t.firstElementChild)!==null&&r!==void 0&&r.matches("p")){var i,s,o,l;const c=t.firstElementChild,{nextElementSibling:d}=c,h=(i=(s=n.match(/^\s+/))===null||s===void 0?void 0:s[0])!==null&&i!==void 0?i:"",p=d?"":(o=(l=n.match(/\s+$/))===null||l===void 0?void 0:l[0])!==null&&o!==void 0?o:"";if(n.match(/^\n\n/)){c.innerHTML=`${c.innerHTML}${p}`;return}Cbe(c),t.innerHTML=`${h}${t.innerHTML}${p}`}}withPatchedRenderer(t){const n=r=>function(){const i=r(...arguments);return i===`
695
695
  `?i:i[i.length-1]===`
696
- `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const pye=On.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Vn({key:new vr("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return oa.fromSchema(this.editor.schema).parseSlice(Qw(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),mye=On.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=R5.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new hye(this.editor,this.options),serializer:new fye(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[bbe.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),pye.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),t8=lz.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),anchor:{default:null},uuid:{default:null},linktype:{default:null}}}}).configure({openOnClick:!1}),n8=wi.create({name:"textStyle",addAttributes(){return{color:{default:null}}},parseHTML(){return[{tag:"span",getAttrs:e=>{var t;return(t=e.style)!=null&&t.color?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["span",sr(e),0]}}),r8=On.create({name:"avocadoBlockKeys",addGlobalAttributes(){return[{types:["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock"],attributes:{_key:{default:null,rendered:!1}}}]}});function gye(e){if(e&&typeof e=="object"){const t=e;for(const n of["_type","nodeType","type"])if(typeof t[n]=="string")return t[n]}return"Embedded content"}const bye=rn.create({name:"avocadoUnknownBlock",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{data:{default:null,rendered:!1},_key:{default:null,rendered:!1}}},parseHTML(){return[{tag:"div[data-avocado-unknown-block]"}]},renderHTML({node:e,HTMLAttributes:t}){return["div",sr(t,{"data-avocado-unknown-block":"",class:"rte-unknown-block"}),gye(e.attrs.data)]}}),yye=[Vw.configure({heading:{levels:[1,2,3,4,5,6]},link:!1}),t8,n8,r8,bye],xye=rn.create({name:"doc",topNode:!0,content:"paragraph"}),vye=[Vw.configure({document:!1,heading:!1,bulletList:!1,orderedList:!1,listItem:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,link:!1}),xye,t8,n8,r8],kye=new Set(["bold","italic","strike","code","underline","link","textStyle"]);function Sye(e){return wi.create({name:e,parseHTML(){return[{tag:`span[data-decorator="${e}"]`}]},renderHTML(){return["span",{"data-decorator":e,class:"rte-decorator"},0]}})}function wye(e=[],t={}){const n=new Set(kye),r=[];for(const s of e){const o=s==null?void 0:s.name;typeof o!="string"||o.length===0||n.has(o)||(n.add(o),r.push(Sye(o)))}const i=t.inline?vye:yye;return r.length>0?[...i,...r]:i}const ea=14,Cye=[Vw.configure({heading:{levels:[2,3,4,5,6]},link:!1,underline:!1}),lz.configure({openOnClick:!1}),mye.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})];function Eye(e){var n,r;const t=(r=(n=e.storage.markdown)==null?void 0:n.getMarkdown)==null?void 0:r.call(n);return typeof t=="string"?t:""}function oo({active:e,onClick:t,title:n,className:r,children:i}){return m.jsx("button",{type:"button",className:`rte-toolbar-btn${e?" is-active":""}${r?` ${r}`:""}`,onClick:t,title:n,onMouseDown:s=>s.preventDefault(),children:i})}function i8({editor:e,trailing:t,decorators:n,inline:r}){const i=E.useCallback(()=>{const s=e.getAttributes("link").href??"",o=window.prompt("URL",s);o!==null&&(o===""?e.chain().focus().extendMarkRange("link").unsetLink().run():e.chain().focus().extendMarkRange("link").setLink({href:o}).run())},[e]);return m.jsxs("div",{className:`rte-toolbar${t?" rte-toolbar--with-trailing":""}`,children:[m.jsx(oo,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold",children:m.jsx(pL,{size:ea})}),m.jsx(oo,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic",children:m.jsx(JL,{size:ea})}),m.jsx(oo,{active:e.isActive("strike"),onClick:()=>e.chain().focus().toggleStrike().run(),title:"Strikethrough",children:m.jsx(M9,{size:ea})}),!r&&m.jsx("span",{className:"rte-toolbar-sep"}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:m.jsx($L,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:m.jsx(qL,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:4}),onClick:()=>e.chain().focus().toggleHeading({level:4}).run(),title:"Heading 4",children:m.jsx(HL,{size:ea})}),!r&&m.jsx("span",{className:"rte-toolbar-sep"}),!r&&m.jsx(oo,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:m.jsx(r9,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:m.jsx(t9,{size:ea})}),m.jsx("span",{className:"rte-toolbar-sep"}),m.jsx(oo,{active:e.isActive("link"),onClick:i,title:"Link",children:m.jsx(QL,{size:ea})}),(n??[]).map(s=>m.jsx(oo,{className:"rte-toolbar-btn--tag",active:e.isActive(s.name),onClick:()=>e.chain().focus().toggleMark(s.name).run(),title:s.title??s.name,children:s.title??s.name},s.name)),t?m.jsx("div",{className:"rte-toolbar-trailing",children:t}):null]})}function _ye({value:e,onChange:t,onFocus:n,onBlur:r,trailing:i}){const s=E.useRef(!1),o=E.useRef(e),l=W5({extensions:Cye,content:EA(e),onUpdate:({editor:c})=>{if(s.current)return;const d=Eye(c);o.current=d,t(d)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()});return E.useEffect(()=>{if(!l||l.isDestroyed||e===o.current)return;o.current=e,s.current=!0;const{from:c,to:d}=l.state.selection;l.commands.setContent(EA(e));const h=l.state.doc.content.size,p=Math.min(c,h),b=Math.min(d,h);try{l.commands.setTextSelection({from:p,to:b})}catch{}s.current=!1},[e,l]),l?m.jsxs("div",{className:"rte-wrap",children:[m.jsx(i8,{editor:l,trailing:i}),m.jsx(Dw,{editor:l,className:"rte-content"})]}):null}function Tye({value:e,onChange:t,onFocus:n,onBlur:r,decorators:i,inline:s}){const o=E.useRef(!1),l=E.useRef(JSON.stringify(e)),c=`${s?"inline":"block"}:${(i??[]).map(p=>p.name).join(",")}`,d=E.useMemo(()=>wye(i??[],{inline:s}),[c]),h=W5({extensions:d,content:e,onUpdate:({editor:p})=>{if(o.current)return;const b=p.getJSON();l.current=JSON.stringify(b),t(b)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()},[c]);return E.useEffect(()=>{if(!h||h.isDestroyed)return;const p=JSON.stringify(e);if(p===l.current)return;l.current=p,o.current=!0;const{from:b,to:y}=h.state.selection;h.commands.setContent(e);const x=h.state.doc.content.size;try{h.commands.setTextSelection({from:Math.min(b,x),to:Math.min(y,x)})}catch{}o.current=!1},[e,h]),h?m.jsxs("div",{className:`rte-wrap${s?" rte-wrap--inline":""}`,children:[m.jsx(i8,{editor:h,decorators:i,inline:s}),m.jsx(Dw,{editor:h,className:"rte-content"})]}):null}const UM=new Set(["text","richtext","imageAlt"]),Aye=()=>{};function Nye(e,t){const n=E.useRef(null),r=E.useRef(void 0);return E.useEffect(()=>{if(!e||!t||t!==e){r.current=t;return}if(r.current===t)return;r.current=t;const i=n.current;if(!i)return;i.scrollIntoView({behavior:"smooth",block:"nearest"}),i.classList.add("property-field--flash");const s=setTimeout(()=>i.classList.remove("property-field--flash"),1800);return()=>{clearTimeout(s),i.classList.remove("property-field--flash")}},[e,t]),n}const Mye=kn.memo(function({style:t,blockId:n,blockType:r,props:i,status:s,failure:o,failedSlug:l,failedOrigin:c,onRetry:d,onFieldChange:h,onImageClick:p,onAiAssist:b,slug:y,pageName:x,navLabel:k,onNavLabelChange:S,pageMeta:C,onPageMetaChange:_,onDeselectBlock:A,onPageAiAssist:M,onAiQuickAction:R,onPageAiQuickAction:D,aiLoading:j,aiLoadingPath:I,onAddListItem:G,onRemoveListItem:L,highlightPath:H,manifestByType:V,siteOrigin:Z,onClose:K}){const q=ge(re=>re.activeBlockId),B=ge(re=>re.activeBlockType),W=ge(re=>re.slug),ee=ge(re=>re.isLoading),ue=ge(re=>re.activeEditablePath),z=n??q,F=r??B,$=y??W,O=j??ee,te=I??ue,se=H??ue,{t:de}=yr(),le=K?m.jsx("button",{type:"button",className:"property-panel-context-close",onClick:K,"aria-label":de("propertyPanel.close"),title:de("propertyPanel.close"),children:m.jsx(xo,{size:16})}):null,Ae=m.jsxs("div",{className:"property-panel-context property-panel-context--page",children:[m.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M3.5 1.5h6L13 5v9a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),m.jsx("path",{d:"M9.5 1.5V5h3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]}),m.jsx("div",{className:"property-panel-context-text",children:m.jsx("span",{className:"property-panel-context-breadcrumb",children:m.jsx("span",{className:"property-panel-context-breadcrumb-current",children:de("propertyPanel.page")})})}),le]});if(!z||!F)return m.jsxs("div",{className:"property-panel",style:t,children:[Ae,$&&$!=="/"&&S?m.jsx(Lye,{slug:$,navLabel:k??"",onNavLabelChange:S,onAiAssist:M,onAiQuickAction:D,aiLoading:O,fieldShimmer:O===!0&&te==="Nav label"}):null,$&&_?m.jsx(Bye,{pageMeta:C??{},onPageMetaChange:_,onAiAssist:M,onAiQuickAction:D,aiLoading:O,aiLoadingPath:te}):null]});let Oe=au()[F];if(V){const re=V.get(F);if(re){const X=sne(re);if(!Oe)Oe={displayName:re.displayName??F,fields:X.fields,listFields:Object.keys(X.listFields).length>0?X.listFields:void 0};else{const je={};for(const[Be,Ze]of Object.entries(X.fields))je[Be]=Be in Oe.fields?Oe.fields[Be]:Ze;const ze={};for(const[Be,Ze]of Object.entries(X.listFields))if(Oe.listFields&&Be in Oe.listFields){const kt=Oe.listFields[Be].itemFields,it={};for(const[qe,Wt]of Object.entries(Ze.itemFields))it[qe]=qe in kt?kt[qe]:Wt;ze[Be]={label:Oe.listFields[Be].label??Ze.label,itemFields:it}}else ze[Be]=Ze;Oe={...Oe,displayName:re.displayName??Oe.displayName,fields:je,listFields:Object.keys(ze).length>0?ze:void 0}}}}return Oe?m.jsxs("div",{className:"property-panel",style:t,children:[m.jsxs("div",{className:"property-panel-context property-panel-context--component",children:[m.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[m.jsx("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"})]}),m.jsx("div",{className:"property-panel-context-text",children:m.jsxs("span",{className:"property-panel-context-breadcrumb",children:[m.jsx("button",{type:"button",className:"property-panel-context-breadcrumb-link",onClick:A,children:de("propertyPanel.page")}),m.jsx("span",{className:"property-panel-context-breadcrumb-sep","aria-hidden":"true",children:"›"}),m.jsx("span",{className:"property-panel-context-breadcrumb-current",children:Oe.displayName})]})}),le]}),(s==="loading"||s==="idle"&&!i)&&!i?m.jsx("div",{className:"property-panel-empty",children:de("propertyPanel.loading")}):s==="error"?m.jsx(Dye,{failure:o??"unreachable",slug:l??$,origin:c,onRetry:d}):i?m.jsxs("div",{className:"property-panel-fields",children:[s8(Object.entries(Oe.fields),i,"",F,h,p,b,R,O,te,se,Z),Oe.listFields?Object.entries(Oe.listFields).map(([re,X])=>{const je=Array.isArray(i[re])?i[re]:[];return m.jsx(Oye,{listKey:re,listField:X,items:je,blockType:F,onFieldChange:h,onImageClick:p,onAiAssist:b,onAiQuickAction:R,aiLoading:O,aiLoadingPath:te,highlightPath:se,onAddItem:G?()=>G(re):void 0,onRemoveItem:L?ze=>L(re,ze):void 0,siteOrigin:Z},re)}):null]}):null]}):m.jsxs("div",{className:"property-panel",style:t,children:[Ae,m.jsxs("div",{className:"property-panel-empty",children:[de("propertyPanel.unknownBlock"),": ",F]})]})});function Dye({failure:e,slug:t,origin:n,onRetry:r}){const{t:i}=yr(),s=i(e==="blockMissing"?"propertyPanel.loadFailedMissing":e==="pageMissing"?"propertyPanel.loadFailedNoPage":"propertyPanel.loadFailed"),o=i(e==="blockMissing"?"propertyPanel.loadFailedMissingHint":e==="pageMissing"?"propertyPanel.loadFailedNoPageHint":"propertyPanel.loadFailedUnreachableHint");return m.jsxs("div",{className:"property-panel-empty",children:[s,m.jsx("div",{className:"sites-form-hint",style:{marginTop:8},children:o}),e!=="unreachable"||n?m.jsxs("div",{className:"sites-form-hint",style:{marginTop:8},children:[m.jsx("code",{children:t}),n?m.jsxs(m.Fragment,{children:[" · ",m.jsx("code",{children:n})]}):null]}):null,r?m.jsx("button",{type:"button",className:"property-panel-retry",onClick:r,style:{marginTop:12},children:i("propertyPanel.retry")}):null]})}function HM(e,t){return!!(e==="imageUrl"&&t==="imageAlt"||e==="src"&&t==="alt"||e.endsWith(".src")&&t===e.replace(/\.src$/,".alt"))}function Rye(e){try{const n=new URL(e,"http://localhost").pathname.split("/").pop()||"";return n.length>30?n.slice(0,27)+"...":n||"(image)"}catch{return e.length>30?e.slice(0,27)+"...":e||"(empty)"}}function s8(e,t,n,r,i,s,o,l,c,d,h,p){const b=new Set;for(let x=0;x<e.length;x++){const[k,S]=e[x];if(S.kind==="image")for(const[C,_]of e)_.kind==="imageAlt"&&HM(k,C)&&b.add(C)}const y=[];for(const[x,k]of e)if(!b.has(x))if(k.kind==="image"){const S=e.find(([A,M])=>M.kind==="imageAlt"&&HM(x,A)),C=S==null?void 0:S[0],_=C?t[C]==null?"":String(t[C]):void 0;y.push(m.jsx(jye,{label:k.label??x,blockType:r,imageUrl:t[x]==null?"":String(t[x]),altText:_,onChangeClick:()=>s==null?void 0:s(n+x,t[x]==null?"":String(t[x])),onRemove:()=>{i(n+x,""),C&&i(n+C,"")},onAltCommit:C?A=>i(n+C,A):void 0,onAltAiAssist:C&&o?()=>o(n+C,"Alt text","imageAlt",_??""):void 0,onAltAiQuickAction:C&&l?A=>l(n+C,"Alt text","imageAlt",_??"",A):void 0,aiLoading:c,fieldShimmer:c===!0&&C!=null&&d===n+C,siteOrigin:p},x))}else y.push(m.jsx(Pye,{fieldKey:x,field:k,value:t[x],blockType:r,onCommit:S=>i(n+x,S),onAiAssist:UM.has(k.kind)&&o?()=>o(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x])):void 0,onAiQuickAction:UM.has(k.kind)&&l?S=>l(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x]),S):void 0,aiLoading:c,fieldShimmer:c===!0&&d===n+x,highlightPath:h,fieldPath:n+x},x));return y}function Nh({onClick:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,onQuickAction:s,onCustomPrompt:o,aiLoading:l,variant:c="overlay"}){const[d,h]=E.useState(null),p=y=>{s&&t&&n&&r!==void 0?h(y.currentTarget.getBoundingClientRect()):e()},b=c==="toolbar"?"rte-toolbar-ai-btn":"property-field-ai-btn";return m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:`${b}${l?` ${b}--loading`:""}`,onClick:p,onMouseDown:y=>y.preventDefault(),title:"AI suggestions",children:l?m.jsx(th,{size:14,"aria-hidden":"true"}):m.jsx(rD,{size:14,"aria-hidden":"true"})}),d&&t&&n&&r!==void 0&&m.jsx(Iye,{anchorRect:d,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i??"",aiLoading:l,onSelect:y=>{h(null),s==null||s(y)},onCustomPrompt:()=>{h(null),(o??e)()},onDismiss:()=>h(null)})]})}function Iye({anchorRect:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,aiLoading:s,onSelect:o,onCustomPrompt:l,onDismiss:c}){const d=Nae(t,n,r,i),p=window.innerHeight-e.bottom<160,b=p?void 0:e.bottom+4,y=p?window.innerHeight-e.top+4:void 0,x=window.innerWidth-e.right;return E.useEffect(()=>{const k=S=>{S.key==="Escape"&&c()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[c]),m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"ai-quick-actions-backdrop",onClick:c}),m.jsxs("div",{className:"ai-quick-actions-menu",style:{top:b,bottom:y,right:x},children:[d.map(k=>m.jsxs("button",{type:"button",className:"ai-quick-actions-item",disabled:s,onClick:()=>o(k),children:[m.jsx(rD,{size:12,"aria-hidden":"true"}),k]},k)),m.jsx("div",{className:"ai-quick-actions-divider"}),m.jsxs("button",{type:"button",className:"ai-quick-actions-item ai-quick-actions-item--custom",onClick:l,children:[m.jsx(h9,{size:12,"aria-hidden":"true"}),"Custom prompt..."]})]})]})}function o8(e,t){return!e||!t||/^https?:\/\//i.test(e)?e:e.startsWith("/")?`${t}${e}`:e}function jye({label:e,blockType:t,imageUrl:n,altText:r,onChangeClick:i,onRemove:s,onAltCommit:o,onAltAiAssist:l,onAltAiQuickAction:c,aiLoading:d,fieldShimmer:h,siteOrigin:p}){const{t:b}=yr(),[y,x]=E.useState(r??""),[k,S]=E.useState(!1),[C,_]=E.useState(!1),A=k?y:r??"",{debouncedCommit:M,flushCommit:R}=tb(o??Aye,400);return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:e})}),m.jsxs("div",{className:"property-field-image-widget",children:[n&&!C?m.jsxs("div",{className:"property-field-image-preview",children:[m.jsx("img",{className:"property-field-image-thumb",src:o8(n,p),alt:"",onError:()=>_(!0)}),m.jsxs("div",{className:"property-field-image-actions",children:[m.jsxs("button",{type:"button",className:"property-field-image-change",onClick:i,children:[m.jsx(v9,{size:13})," ",b("propertyPanel.change")]}),s?m.jsxs("button",{type:"button",className:"property-field-image-remove",onClick:s,children:[m.jsx(Wk,{size:13})," ",b("propertyPanel.remove")]}):null]})]}):m.jsxs("button",{type:"button",className:"property-field-image-empty",onClick:i,children:[m.jsx(ZL,{size:18,"aria-hidden":"true"}),m.jsx("span",{children:b("propertyPanel.chooseImage")})]}),o!==void 0&&m.jsxs("div",{className:"property-field-image-alt-group",children:[m.jsx("div",{className:"property-field-image-alt-label",children:m.jsx("span",{children:b("propertyPanel.altText")})}),m.jsxs("div",{className:`property-field-input-wrap${h?" property-field-input-wrap--ai-loading":""}`,children:[m.jsx("input",{type:"text",className:"property-field-image-alt",placeholder:b("propertyPanel.altPlaceholder"),value:A,onFocus:()=>{x(r??""),S(!0)},onChange:D=>{x(D.target.value),M(D.target.value)},onBlur:()=>{S(!1),R()}}),l?m.jsx(Nh,{onClick:l,fieldKind:"imageAlt",fieldLabel:b("propertyPanel.altText"),blockType:t??"",currentValue:r??"",onQuickAction:c,onCustomPrompt:l,aiLoading:h}):null]})]})]})]})}function Oye({listKey:e,listField:t,items:n,blockType:r,onFieldChange:i,onImageClick:s,onAiAssist:o,onAiQuickAction:l,aiLoading:c,aiLoadingPath:d,highlightPath:h,onAddItem:p,onRemoveItem:b,siteOrigin:y}){const[x,k]=E.useState(null),S=t.label??e;return E.useEffect(()=>{if(!h)return;const C=`${e}[`;if(!h.startsWith(C))return;const _=h.slice(C.length),A=_.indexOf("]");if(A<0)return;const M=Number(_.slice(0,A));!Number.isNaN(M)&&M>=0&&M<n.length&&k(M)},[h,e,n.length]),m.jsxs("div",{className:"property-list-section",children:[m.jsxs("div",{className:"property-list-header",children:[S," (",n.length,")"]}),n.map((C,_)=>{var Z;const A=x===_,M=t.discriminator?String(C[t.discriminator]??""):"",R=((Z=t.itemFieldsByType)==null?void 0:Z[M])??t.itemFields,D=Object.keys(R).find(K=>R[K].kind==="text"||R[K].kind==="richtext"),j=Object.keys(R).find(K=>R[K].kind==="image"),I=j&&C[j]!=null?String(C[j]):"",L=(D&&C[D]!=null?String(C[D]):"")||(I?Rye(I):`Item ${_+1}`),H=M?`[${M}] ${L}`:L,V=H.length>40?H.slice(0,40)+"...":H;return m.jsxs("div",{className:"property-list-item",children:[m.jsxs("button",{type:"button",className:`property-list-item-toggle ${A?"is-expanded":""}`,onClick:()=>k(A?null:_),children:[m.jsx("span",{className:"property-list-item-chevron","aria-hidden":"true"}),I?m.jsx("img",{className:"property-list-item-thumb",src:o8(I,y),alt:"",loading:"lazy"}):null,m.jsx("span",{className:"property-list-item-preview",children:V})]}),A?m.jsxs("div",{className:"property-list-item-fields",children:[s8(Object.entries(R),C,`${e}[${_}].`,r,i,s,o,l,c,d,h,y),b?m.jsxs("button",{type:"button",className:"property-list-item-remove-btn",onClick:()=>b(_),children:[m.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:m.jsx("path",{d:"M2.5 4h11M6 4V2.5h4V4M5 4l.5 9h5l.5-9M6.5 6.5v4M9.5 6.5v4"})}),"Remove item"]}):null]}):null]},_)}),p?m.jsxs("button",{type:"button",className:"property-list-add-btn",onClick:p,children:[m.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:m.jsx("path",{d:"M8 3v10M3 8h10"})}),"Add"]}):null]})}const zye={h1:"H1 — Page title",h2:"H2 — Section",h3:"H3 — Subsection",h4:"H4",h5:"H5",h6:"H6"};function Pye({fieldKey:e,field:t,value:n,blockType:r,onCommit:i,onAiAssist:s,onAiQuickAction:o,aiLoading:l,fieldShimmer:c,highlightPath:d,fieldPath:h}){const p=n==null?"":String(n),[b,y]=E.useState(p),[x,k]=E.useState(!1),{debouncedCommit:S,flushCommit:C}=tb(i,400),_=Nye(h,d),A=x?b:p,M=t.label??e,R=()=>{y(p),k(!0)},D=()=>{k(!1),C()};if(t.kind==="headingLevel"){const L=(r&&OI[r])??"h2",H=p&&/^h[1-6]$/.test(p)?p:"";return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsxs("select",{className:"property-field-input property-field-select",value:H,onChange:V=>i(V.target.value),children:[m.jsxs("option",{value:"",children:["Auto (",L.toUpperCase(),")"]}),["h1","h2","h3","h4","h5","h6"].map(V=>m.jsx("option",{value:V,children:zye[V]},V))]})]})}if(t.kind==="image")return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsx("div",{className:"property-field-image-url",title:p,children:p||"(empty)"})]});if(t.kind==="enum"&&t.options){const L=t.options.includes(p);return m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsxs("select",{className:"property-field-input property-field-select",value:p,onChange:H=>i(H.target.value),children:[!L&&m.jsx("option",{value:p,children:p||"—"}),t.options.map(H=>m.jsx("option",{value:H,children:H},H))]})]})}if(t.kind==="boolean"){const L=p==="true"||p==="1";return m.jsx("div",{className:"property-field property-field--inline",ref:_,children:m.jsxs("div",{className:"property-field-label",children:[m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]}),m.jsx("button",{type:"button",role:"switch","aria-checked":L,"aria-label":M,className:`property-field-switch${L?" is-on":""}`,onClick:()=>i(L?"false":"true"),children:m.jsx("span",{className:"property-field-switch-knob","aria-hidden":"true"})})]})})}if(t.kind==="color")return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsx("input",{type:"color",className:"property-field-color",value:p||"#000000",onChange:L=>i(L.target.value)})]});if(t.kind==="richtext")return n!==null&&typeof n=="object"?m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsx("div",{className:"property-field-input-wrap",children:m.jsx(Tye,{value:n,onChange:L=>S(L),onFocus:R,onBlur:D,decorators:t.decorators,inline:t.inline})})]}):m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsx("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:m.jsx(_ye,{value:p,onChange:L=>{y(L),S(L)},onFocus:R,onBlur:D,trailing:s?m.jsx(Nh,{variant:"toolbar",onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null})})]});const j=t.multiline===!0,I=t.kind==="number"?"number":t.kind==="url"?"url":"text",G={value:A,onFocus:R,onChange:L=>{y(L.target.value),S(L.target.value)},onBlur:D};return m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsxs("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:[j?m.jsx("textarea",{className:"property-field-textarea",rows:3,...G}):m.jsx("input",{type:I,className:"property-field-input",...G}),s?m.jsx(Nh,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null]})]})}function Lye({slug:e,navLabel:t,onNavLabelChange:n,onAiAssist:r,onAiQuickAction:i,aiLoading:s,fieldShimmer:o}){const{t:l}=yr(),[c,d]=E.useState(t),[h,p]=E.useState(!1),b=h?c:t,{debouncedCommit:y,flushCommit:x}=tb(k=>n(e,k),400);return m.jsx("div",{className:"property-panel-page-section",children:m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:l("propertyPanel.navLabel")})}),m.jsxs("div",{className:`property-field-input-wrap${o?" property-field-input-wrap--ai-loading":""}`,children:[m.jsx("input",{type:"text",className:"property-field-input",placeholder:l("propertyPanel.navPlaceholder"),value:b,onFocus:()=>{d(t),p(!0)},onChange:k=>{d(k.target.value),y(k.target.value)},onBlur:()=>{p(!1),x()}}),r?m.jsx(Nh,{onClick:()=>r("Nav label","text",t),fieldKind:"text",fieldLabel:"Nav label",blockType:"Page",currentValue:t,onQuickAction:i?k=>i("Nav label","text",t,k):void 0,onCustomPrompt:()=>r("Nav label","text",t),aiLoading:o}):null]})]})})}function Bye({pageMeta:e,onPageMetaChange:t,onAiAssist:n,onAiQuickAction:r,aiLoading:i,aiLoadingPath:s}){const{t:o}=yr();return m.jsxs("div",{className:"property-panel-page-section",children:[m.jsx("div",{className:"property-panel-block-name",children:o("propertyPanel.seo")}),m.jsx(cv,{label:o("propertyPanel.seoTitle"),fieldKind:"text",blockType:"Page",value:e.title??"",placeholder:o("propertyPanel.seoTitlePlaceholder"),multiline:!0,autosizeRows:{min:2,max:2},recommendedMax:60,onCommit:l=>t("title",l),onAiAssist:n?()=>n("SEO title","text",e.title??""):void 0,onAiQuickAction:r?l=>r("SEO title","text",e.title??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="SEO title"}),m.jsx(cv,{label:o("propertyPanel.metaDescription"),fieldKind:"richtext",blockType:"Page",value:e.description??"",placeholder:o("propertyPanel.metaDescPlaceholder"),multiline:!0,autosizeRows:{min:3,max:6},recommendedMax:160,onCommit:l=>t("description",l),onAiAssist:n?()=>n("Meta description","richtext",e.description??""):void 0,onAiQuickAction:r?l=>r("Meta description","richtext",e.description??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="Meta description"}),m.jsx(cv,{label:o("propertyPanel.ogImage"),fieldKind:"url",blockType:"Page",value:e.ogImage??"",placeholder:"https://...",onCommit:l=>t("ogImage",l)})]})}function cv({label:e,fieldKind:t,blockType:n,value:r,placeholder:i,multiline:s,autosizeRows:o,recommendedMax:l,onCommit:c,onAiAssist:d,onAiQuickAction:h,aiLoading:p,fieldShimmer:b}){const[y,x]=E.useState(r),[k,S]=E.useState(!1),C=E.useRef(null),_=k?y:r,{debouncedCommit:A,flushCommit:M}=tb(c,400),R=s===!0&&o!=null,D=E.useCallback(()=>{if(!R||!C.current||!o)return;const G=C.current,L=getComputedStyle(G),H=Number.parseFloat(L.lineHeight),V=Number.parseFloat(L.fontSize)||15,Z=Number.isFinite(H)?H:V*1.2,K=(Number.parseFloat(L.paddingTop)||0)+(Number.parseFloat(L.paddingBottom)||0),q=(Number.parseFloat(L.borderTopWidth)||0)+(Number.parseFloat(L.borderBottomWidth)||0),B=o.min*Z+K+q,W=o.max*Z+K+q;G.style.height="0px";const ee=G.scrollHeight,ue=Math.max(B,Math.min(W,ee));G.style.height=`${ue}px`,G.style.overflowY=ee>W?"auto":"hidden"},[R,o]);E.useLayoutEffect(()=>{D()},[D,_,k,r]),E.useEffect(()=>{if(!R)return;const G=()=>D();return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[R,D]);const j={placeholder:i,value:_,onFocus:()=>{x(r),S(!0)},onChange:G=>{x(G.target.value),A(G.target.value)},onBlur:()=>{S(!1),M()}},I=(k?y:r).length;return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:e})}),m.jsxs("div",{className:`property-field-input-wrap${b?" property-field-input-wrap--ai-loading":""}`,children:[s?m.jsx("textarea",{ref:R?C:void 0,className:`property-field-textarea${R?" property-field-textarea--autosize":""}`,rows:(o==null?void 0:o.min)??3,...j}):m.jsx("input",{type:"text",className:"property-field-input",...j}),d?m.jsx(Nh,{onClick:d,fieldKind:t,fieldLabel:e,blockType:n,currentValue:k?y:r,onQuickAction:h,onCustomPrompt:d,aiLoading:b}):null]}),l!=null&&m.jsxs("span",{className:`property-field-char-count${I>l?" property-field-char-count--over":""}`,children:[I," / ",l]})]})}class VM extends E.Component{constructor(){super(...arguments);Se(this,"state",{error:null});Se(this,"reset",()=>{var n,r;(r=(n=this.props).onReset)==null||r.call(n),this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,s;console.error("[editor] Uncaught error in component tree:",n,r.componentStack),(s=(i=this.props).onError)==null||s.call(i,n,r)}render(){return this.state.error?m.jsxs("div",{style:this.props.style,className:"flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground h-full",children:[m.jsx("p",{className:"font-medium text-foreground",children:this.props.fallbackLabel??"Something went wrong"}),m.jsx("p",{className:"max-w-xs opacity-70 text-xs",children:this.state.error.message}),m.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md border px-3 py-1.5 text-xs hover:bg-accent transition-colors",children:"Try again"})]}):this.props.children}}function Fye({siteId:e,orchestratorUrl:t,hostedIds:n}){const{t:r}=yr(),i=()=>{dae(e),window.location.href=fae(window.location.href)};return m.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[m.jsxs("div",{className:"orchestrator-mismatch-body",children:[m.jsx("strong",{children:r("orchestratorMismatch.title")}),m.jsx("span",{children:n.length>0?r("orchestratorMismatch.detailHosts",{orchestrator:t,hosted:n.join(", ")}):r("orchestratorMismatch.detail",{orchestrator:t})})]}),m.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:i,children:r("orchestratorMismatch.useDefault")})]})}const Wm=3e3;function $ye(e){const[t,n]=E.useState({status:"loading",blocks:[],manifest:null});E.useEffect(()=>{let i=!0,s=null;const o=async()=>{try{const c=await fetch(`${e||gd}/api/editor/blocks`);if(!c.ok){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:`Manifest endpoint returned ${c.status}`}),s=setTimeout(()=>{i&&o()},Wm);return}const d=await c.json(),h=PI.safeParse(d);if(!h.success){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:"Manifest response shape is invalid"}),s=setTimeout(()=>{i&&o()},Wm);return}const p=FI(h.data.blocks);if(p){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:p}),s=setTimeout(()=>{i&&o()},Wm);return}if(!i)return;n({status:"ready",blocks:h.data.blocks,version:h.data.version,manifest:h.data})}catch(l){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:l instanceof Error?l.message:"Manifest fetch failed"}),s=setTimeout(()=>{i&&o()},Wm)}};return o(),()=>{i=!1,s&&clearTimeout(s)}},[e]);const r=E.useMemo(()=>{const i=new Map;for(const s of t.blocks)i.set(s.type,s);return i},[t.blocks]);return{...t,byType:r,siteCapabilities:{allowStructuralEdits:t.status==="ready",manifestStatus:t.status,reason:t.reason,manifestVersion:t.version,blockCount:t.blocks.length,checkedAt:new Date().toISOString()},allowStructuralEdits:t.status==="ready"}}function Uye(e){return null}function Hye(){const e=Uye();return e||"text"}const Vye=/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/i;let _f;function qye(e){if(!Vye.test(e))return!1;if(_f===void 0)try{_f=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"})}catch{_f=null}if(!_f)return!1;try{return typeof _f.of(e)=="string"}catch{return!1}}function e2(e){return e.split("/").filter(Boolean)}function Gye(e){const t={},n=[];for(const o of e){const l=e2(o)[0];if(l&&qye(l)){const c=l.toLowerCase();(t[c]||(t[c]=[])).push(o)}else n.push(o)}const r=Object.keys(t).sort();if(r.length<2)return null;const i=new Map;for(const o of r)for(const l of new Set(t[o].map(c=>t2(c,o))))i.set(l,(i.get(l)??0)+1);if(![...i.values()].some(o=>o>=2))return null;for(const o of r){const l=`/${o}`;t[o].sort((c,d)=>c===l?-1:d===l?1:0)}return{locales:r,byLocale:t,shared:n}}function a8(e,t){var r;const n=(r=e2(e)[0])==null?void 0:r.toLowerCase();return n&&t.byLocale[n]?n:void 0}function t2(e,t){var i;if(!t)return e;const n=e2(e);if(((i=n[0])==null?void 0:i.toLowerCase())!==t.toLowerCase())return e;const r=n.slice(1);return r.length===0?"/":`/${r.join("/")}`}function Zye(e,t){return`${C6(t2(e,t))} (${e})`}function Wye(e,t,n){const r=n.byLocale[t];if(!r||r.length===0)return e;const i=t2(e,a8(e,n)),s=i==="/"?`/${t}`:`/${t}${i}`;return r.includes(s)?s:r[0]}function Kye(e){try{const t=new Intl.DisplayNames([e],{type:"language"}).of(e);if(t&&t.toLowerCase()!==e.toLowerCase())return t.charAt(0).toUpperCase()+t.slice(1)}catch{}return e.toUpperCase()}const qM=Hye(),Yye=tB(),Jye=E.lazy(()=>oL(()=>import("./PuckPrototypeRoute-DLvPOyWm.js").then(e=>e.P),__vite__mapDeps([0,1])).then(e=>({default:e.PuckPrototypeRoute}))),Xye=new Set(["/editor/puck","/editor/puck/"]),Qye=3e4,l8="site-reachable-v1:";function u8(e){if(typeof sessionStorage>"u")return null;try{const t=sessionStorage.getItem(l8+e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.ts>Qye?null:n.ok}catch{return null}}function GM(e,t){if(!(typeof sessionStorage>"u"))try{sessionStorage.setItem(l8+e,JSON.stringify({ok:t,ts:Date.now()}))}catch{}}function e1e({name:e,origin:t,statusClass:n,active:r,dimmed:i,onSelect:s}){const o=t.replace(/^https?:\/\//,"");return m.jsxs("button",{type:"button",role:"menuitem",className:`site-switcher-item${r?" is-active":""}${i?" is-dimmed":""}`,onClick:s,title:t,children:[m.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${n}`,"aria-hidden":"true"}),m.jsxs("span",{className:"site-switcher-item-body",children:[m.jsx("span",{className:"site-switcher-item-name",children:e}),m.jsx("span",{className:"site-switcher-item-origin",children:o})]}),r?m.jsx(Dh,{size:12,"aria-hidden":"true"}):null]})}function ZM(e){if(typeof sessionStorage>"u")return null;const t=new Set;let n=!1;for(const r of e){const i=u8(r);i!==null&&(n=!0,i&&t.add(r))}return n?t:null}function t1e(e,t){if(e===t)return!0;if(!e||!t||e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function n1e(){const e=typeof window<"u"?window.location.pathname:"/",t=e==="/"||e==="/editor"||e==="/editor/",n=Xye.has(e),r=e==="/sites"||e==="/sites/";ge(d=>d.chatDarkMode);const i=ge(d=>d.setChatDarkMode),s=E.useMemo(()=>iq(),[]),o=E.useMemo(()=>D6(),[]),l=E.useRef(!1);if(!l.current){l.current=!0;const d=typeof window<"u"?window.location.origin:"http://localhost:4100";gB({sessionId:s,siteId:o,editorOrigin:d,orchestratorUrl:Ve})}const c=pae(o,s);return E.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),h=p=>i(p.matches);return d.addEventListener("change",h),()=>d.removeEventListener("change",h)},[i]),n?m.jsx(E.Suspense,{fallback:m.jsx("div",{style:{height:"100vh",display:"grid",placeItems:"center"},children:"Loading prototype…"}),children:m.jsx(Jye,{})}):r?m.jsx(k3,{sites:c,session:s}):t?m.jsx(s1e,{sites:c}):m.jsx(k3,{sites:c,session:s})}const r1e=new Set(["avocado-hub","avocado-stories","avocado-magic","avocado-odyssey"]);function i1e(e){return e.split(".").map(t=>{const n=t.match(/^([a-zA-Z_]+)\[(\d+)\]$/);return n?`${WM(n[1])} ${Number(n[2])+1}`:WM(t)}).join(" · ")}function WM(e){const n=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s*url\s*$/i,"").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function s1e({sites:e}){var lp,up,cp;const{t}=yr(),n=ji(),r=Oi(),i=ge(T=>T.chatDarkMode),s=ge(T=>T.setChatDarkMode),{activeSiteConfig:o}=e,l=E.useMemo(()=>pu(o),[o]),c=$ye(l),d=typeof window<"u"?window.location.origin:"http://localhost:4100",h=ge(T=>T.slug),p=ge(T=>T.setSlug),b=ge(T=>T.availableSlugs);ge(T=>T.setAvailableSlugs);const y=ge(T=>T.isLoadingSlugs),x=ge(T=>T.modelKey),k=ge(T=>T.setModelKey),S=ge(T=>T.provider),C=ge(T=>T.setProvider),_=ge(T=>T.availableProviders),A=ge(T=>T.setAvailableProviders),[M,R]=E.useState(""),D=ge(T=>T.activeBlockId),j=ge(T=>T.activeBlockType),I=ge(T=>T.activeEditablePath),G=T=>ge.getState().setActiveBlock(T),L=T=>{const Y=ge.getState();Y.setActiveBlock(Y.activeBlockId,T)},H=(T,Y)=>ge.getState().setActiveBlock(T,Y),V=ge(T=>T.setActiveEditablePath),Z=ge(T=>T.useStreaming),K=ge(T=>T.setUseStreaming),q=ge(T=>T.autoScrollTrackingEnabled),B=ge(T=>T.setAutoScrollTrackingEnabled),[W,ee]=E.useState(!1),[ue,z]=E.useState(Yye),F=E.useCallback(T=>{z(T);try{window.localStorage.setItem(hv,T?"1":"0")}catch{}},[]),$=E.useMemo(()=>!0,[]),O=$&&ue,[te,se]=E.useState(!1),[de,le]=E.useState(0),Ae=E.useCallback(()=>le(T=>T+1),[]),Te=ge(T=>T.showSettingsModal),Oe=ge(T=>T.setShowSettingsModal),re=ge(T=>T.showDebugDetails),X=ge(T=>T.setShowDebugDetails),je=ge(T=>T.composerHeight),ze=ge(T=>T.setComposerHeight),Be=ge(T=>T.addBlockPicker),Ze=ge(T=>T.setAddBlockPicker),kt=ge(T=>T.addBlockSearch),it=ge(T=>T.setAddBlockSearch),qe=ge(T=>T.isAddingBlock),Wt=ge(T=>T.setIsAddingBlock),Kn=ge(T=>T.copiedDebugEntryId),Yn=ge(T=>T.setCopiedDebugEntryId),St=ge(T=>T.feedbackNoteEntryId),xt=ge(T=>T.setFeedbackNoteEntryId),Cn=ge(T=>T.feedbackNoteText),fe=ge(T=>T.setFeedbackNoteText),pe=ge(T=>T.selectedVariationId),Ue=ge(T=>T.setSelectedVariationId),nt=ge(T=>T.imagePickerTarget),oe=ge(T=>T.setImagePickerTarget),Pe=nt!==null,st=ge(T=>T.backendFeatures),lt=ge(T=>T.setBackendFeatures),Le=ge(T=>T.selectionModeEnabled),ut=ge(T=>T.setSelectionModeEnabled),$e=ge(T=>T.anchorRect),It=ge(T=>T.setAnchorRect),At=ge(T=>T.anchoredExpanded),zr=ge(T=>T.setAnchoredExpanded),Ar=ge(T=>T.activeTab),Ee=ge(T=>T.setActiveTab),[Ye,gt]=E.useState(!1),[Et,Ot]=E.useState(!1),zt=E.useRef(null);E.useEffect(()=>{if(!Et)return;const T=ye=>{zt.current&&!zt.current.contains(ye.target)&&Ot(!1)},Y=ye=>{ye.key==="Escape"&&Ot(!1)};return document.addEventListener("mousedown",T),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",Y)}},[Et]);const[yn,Pr]=E.useState(()=>ZM(e.siteList.map(T=>T.id))),Lr=E.useCallback(T=>{Pr(Y=>t1e(Y,T)?Y:T)},[]);E.useEffect(()=>{if(!Et)return;Lr(ZM(e.siteList.map(ye=>ye.id)));let T=!0;return(async()=>{let ye=!0;const Ne=await Promise.all(e.siteList.map(async Me=>{const we=u8(Me.id);if(we!==null)return{id:Me.id,ok:we};ye=!1;const et=pu(Me);try{const Nt=await fetch(`${et}/api/editor/blocks?siteId=${encodeURIComponent(Me.id)}`,{signal:AbortSignal.timeout(2500)});return GM(Me.id,Nt.ok),{id:Me.id,ok:Nt.ok}}catch{return GM(Me.id,!1),{id:Me.id,ok:!1}}}));T&&!ye&&Lr(new Set(Ne.filter(Me=>Me.ok).map(Me=>Me.id)))})(),()=>{T=!1}},[Et,e.siteList,Lr]);const Mn=E.useMemo(()=>{const T=yn===null;return e.siteList.map(Y=>{const ye=T||Y.id===r||yn.has(Y.id);return{site:Y,origin:pu(Y),online:ye,probing:T}}).sort((Y,ye)=>Y.site.id===r?-1:ye.site.id===r?1:Y.online!==ye.online?Y.online?-1:1:Y.site.name.localeCompare(ye.site.name))},[yn,e.siteList,r]),{onlineEntries:fs,activeEntry:Br}=E.useMemo(()=>({onlineEntries:Mn.filter(T=>T.online),activeEntry:Mn.find(T=>T.site.id===r)}),[Mn,r]),Ui=E.useRef(null),Fr=E.useRef(null),kr=E.useRef(!0),Nr=E.useRef(!1),ga=E.useRef(null),Sr=E.useRef(void 0),tn=E.useRef(!1),zn=E.useRef(null),Pn=E.useRef(!1),fn=E.useRef(0),qn=E.useRef(null),Ci=E.useRef(null),ei=ge(T=>T.chatWidth),$r=ge(T=>T.setChatWidth),Ei=ge(T=>T.propsWidth),Ur=ge(T=>T.setPropsWidth),ci=E.useRef(null),di=E.useRef(null),[fi,Dn]=E.useState(1),Ao=E.useRef(null),Qs=E.useRef(null),ti=E.useRef(!1),Hr=E.useRef(!1);E.useEffect(()=>{if(!Hr.current&&!(y||b.length===0)){if(h!=="/"||b.includes("/")){Hr.current=!0;return}Hr.current=!0,tn.current=!1,p(b[0])}},[b,y,h,p]);const Hi=E.useMemo(()=>{const T=Array.from(new Set([...b,h].filter(Boolean)));return T.includes("/")?["/",...T.filter(Y=>Y!=="/")]:T},[b,h]),Jn=E.useMemo(()=>Gye(Hi),[Hi]),_i=Jn?a8(h,Jn)??Jn.locales[0]:void 0,$u=E.useMemo(()=>!Jn||!_i?Hi:Jn.byLocale[_i]??[],[Jn,_i,Hi]),Os=E.useMemo(()=>{if(!c.allowStructuralEdits)return[];if(c.blocks.length>0)return c.blocks.map(Y=>({type:Y.type,label:Y.displayName??Y.type,category:"content"})).sort((Y,ye)=>Y.label.localeCompare(ye.label));const T=au();return[...Jv].map(Y=>{var ye,Ne;return{type:Y,label:((ye=T[Y])==null?void 0:ye.displayName)??Y,category:((Ne=T[Y])==null?void 0:Ne.category)??"content"}}).sort((Y,ye)=>Y.label.localeCompare(ye.label))},[c.allowStructuralEdits,c.blocks]),hs=E.useMemo(()=>{const T=kt.trim().toLowerCase(),Y=T?Os.filter(Me=>Me.label.toLowerCase().includes(T)||Me.type.toLowerCase().includes(T)):Os,ye=new Map;for(const Me of Y){const we=Me.category||"content",et=ye.get(we);et?et.push(Me):ye.set(we,[Me])}const Ne=["content","layout","conversion","navigation","media"];return[...ye.entries()].sort((Me,we)=>{const et=Ne.indexOf(Me[0]),Nt=Ne.indexOf(we[0]),on=et===-1?Number.MAX_SAFE_INTEGER:et,Tn=Nt===-1?Number.MAX_SAFE_INTEGER:Nt;return on!==Tn?on-Tn:Me[0].localeCompare(we[0])}).map(([Me,we])=>({category:Me,options:we}))},[kt,Os]),Xn=()=>{const T=Date.now();T-fn.current<1200||(fn.current=T,Fe.pushAssistantFromResult({status:"needs_clarification",summary:t("streamError.structuralDisabled"),changes:Lj(c.reason)}))},xn=E.useCallback(T=>{ge.getState().slug!==T&&(Pn.current=!0,p(T))},[p]),jl=E.useMemo(()=>({onBlockClicked:(T,Y,ye,Ne,Me,we)=>{xn(T),H(Y,ye),V(Ne),It(Y?we:null),ge.getState().setActiveTab(Y?"properties":"chat")},onRouteChanged:T=>{ge.getState().slug!==T&&H(void 0,void 0),xn(T),V(void 0),It(null),Vi.current("setSelectionMode",{enabled:ge.getState().selectionModeEnabled})},onBlockReordered:(T,Y,ye)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.reorderBlock(T,Y,ye)},onBlockDeleteRequested:(T,Y)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.deleteBlock(T,Y)},onBlockAddRequested:(T,Y)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),!(!Y.afterBlockId&&!Y.beforeBlockId)&&Ze({slug:T,afterBlockId:Y.afterBlockId,beforeBlockId:Y.beforeBlockId})},onListItemAddRequested:(T,Y,ye,Ne,Me)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.addListItem(T,Y,ye,Ne,Me)},onListItemRemoveRequested:(T,Y,ye,Ne,Me)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.removeListItem(T,Y,ye,Ne,Me)},onListItemMoveRequested:(T,Y,ye,Ne,Me,we)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.moveListItem(T,Y,ye,Ne,Me,we)},onOpenImagePicker:(T,Y,ye,Ne,Me)=>{oe({slug:T,blockId:Y,editablePath:ye,currentUrl:Ne,blockType:Me??(Y===D?j:void 0)})},onEditBlockRequested:(T,Y)=>{zr(!0)},onInlineTextCommitted:(T,Y,ye,Ne)=>{T!==h&&xn(T),ye&&V(ye),Fe.inlineEditCommit(T,Y,ye,Ne)},onIframeScrolled:()=>{It(null),ge.getState().isLoading&&ge.getState().setAutoScrollSuppressed(!0)}}),[c.allowStructuralEdits,xn,h]);E.useCallback(async()=>{var T;try{const Y=`${Ve}/draft/pages?session=${encodeURIComponent(n)}&siteId=${encodeURIComponent(r)}&slug=${encodeURIComponent(h)}`,ye=await fetch(Y,{cache:"no-store"});if(!ye.ok)return;const Me=((await ye.json()).blocks??[]).find(we=>we.type==="Hero");if(!Me)return;H(Me.id,Me.type),oe({slug:h,blockId:Me.id,editablePath:"imageUrl",currentUrl:typeof((T=Me.props)==null?void 0:T.imageUrl)=="string"?Me.props.imageUrl:void 0,blockType:Me.type})}catch{}},[n,r,h,oe]);const Xt=mae(h,jl,l),Vi=E.useRef(Xt.postToSite);E.useEffect(()=>{Vi.current=Xt.postToSite},[Xt.postToSite]);const zs=E.useCallback(T=>{const Y=T??!Le;ut(Y),Xt.postToSite("setSelectionMode",{enabled:Y})},[Le,Xt]);E.useEffect(()=>{const T=Y=>{Y.key==="Escape"&&Le&&zs(!1)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Le,zs]),E.useEffect(()=>{if(Ar!=="history")return;const T=Y=>{Y.key==="Escape"&&ge.getState().setActiveTab("chat")};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Ar]);const qi=E.useCallback((T,Y)=>{(T==="draftUpdated"||T==="liveDraft")&&Ae(),Xt.postToSite(T,Y)},[Xt,Ae]),Ps=E.useCallback((T,Y,ye,Ne)=>(Ae(),Xt.postPatchToSite(T,Y,ye,Ne)),[Xt,Ae]),Fe=kae({activeSiteConfig:o,postToSite:qi,postPatchToSite:Ps,componentManifest:c.manifest,siteCapabilities:c.siteCapabilities,allowStructuralEdits:c.allowStructuralEdits,getBlockDefaultProps:T=>{var Y;return((Y=c.byType.get(T))==null?void 0:Y.defaultProps)??null},onApplied:()=>{var T;(T=Sr.current)==null||T.call(Sr)},agentModeEnabled:st.agentMode??!1}),Gi=ge(T=>T.chatLog),No=ge(T=>T.chatAttachments),Mo=ge(T=>T.setChatAttachments),hn=ge(T=>T.isLoading),wr=ge(T=>T.streamStatus),ba=ge(T=>T.streamingText),eo=ge(T=>T.streamingChanges),ya=ge(T=>T.streamSteps),Ol=ge(T=>T.streamTokenCount),Do=ge(T=>T.latestStreamFocusBlockId),Gn=ge(T=>T.imageProgress),xa=ge(T=>T.plannerBadgeState),Zi=ge(T=>T.setPlannerBadgeState),va=ge(T=>T.pendingPlanId),Qe=ge(T=>T.variationModal),mt=ge(T=>T.isApplyingVariation),ke=ge(T=>T.setVariationModal),Gt=ge(T=>T.continuationChainId),Cr=ge(T=>T.fieldDraftDebugEnabled),Ls=ge(T=>T.setFieldDraftDebugEnabled),Er=ge(T=>T.fieldDraftDebug);E.useEffect(()=>{r1e.has(r)||(k("balanced"),Fe.clearChat())},[r]);async function Ti(T){var Y,ye;gt(!0);try{const Me=await(await fetch(`${Ve}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,targetVersion:T})})).json();Me.status==="applied"&&(typeof Me.navigateToSlug=="string"&&Me.navigateToSlug.length>0&&Me.navigateToSlug!==h&&p(Me.navigateToSlug),typeof Me.canUndo=="boolean"&&((Y=Fe.setCanUndoServer)==null||Y.call(Fe,Me.canUndo)),typeof Me.canRedo=="boolean"&&((ye=Fe.setCanRedoServer)==null||ye.call(Fe,Me.canRedo)),Xt.postToSite("draftUpdated",{focusBlockId:null}),Ae())}catch{}finally{gt(!1)}}const We=wae(n,r,l,de),Je=Sae(n,r,hn,Fe.pushAssistantFromResult,l,()=>{Xt.postToSite("draftUpdated",{focusBlockId:null}),We.markPublished()}),Qn=We.summary?We.summary.total>0:!0,sn=Cae(),En=Ar==="properties"&&Fe.hasBootstrapped,vt=Tae(n,r,h,D,En),Ft=Aae(n,r,h,En);Sr.current=()=>{vt.refetch(),Ft.refetch(),Ae()};const[ni,pn]=E.useState(()=>Iv(h,{session:n,siteId:r,editorOrigin:d},l)),[Ro,Uu]=E.useState(!1);E.useEffect(()=>{Uu(!1)},[ni]),E.useEffect(()=>{zn.current!==l&&(zn.current=l,tn.current=!1);const T={session:n,siteId:r,editorOrigin:d};if(Pn.current){Pn.current=!1;return}if(fg&&tn.current){Xt.postToSite("navigate",{href:jv(h,T)});return}const Y=Iv(h,T,l);pn(ye=>ye===Y?ye:Y)},[l,d,n,r,h]);const _n=E.useMemo(()=>{var ye;const T=(ye=o.vercelProductionUrl)==null?void 0:ye.trim(),Y=T&&/^https?:\/\//i.test(T)?T:l;try{const Ne=new URL(Y);return Ne.origin===l?aq(h,{},l):(Ne.pathname=h==="/"?"/":h,Ne.search="",Ne.hash="",Ne.toString())}catch{return}},[o.vercelProductionUrl,l,h]),hi=E.useMemo(()=>l?`${l}${jv(h,{session:n,siteId:r,editorOrigin:d,immersive:"1"})}`:void 0,[l,d,n,r,h]);E.useEffect(()=>{let T=!0;const Y=async()=>{const Ne=[`${Ve}/status/planner`];Ve.includes("localhost")&&Ne.push(`${Ve.replace("localhost","127.0.0.1")}/status/planner`);try{for(const Me of Ne){const we=await fetch(Me);if(!we.ok)continue;const et=await we.json();if(!T)return;if(et.features&&lt(et.features),Array.isArray(et.availableProviders)&&et.availableProviders.length>0&&(A(et.availableProviders),et.availableProviders.includes(S)||C(et.availableProviders[0])),et.plannerSource==="openai"||et.plannerSource==="anthropic"||et.plannerSource==="gemini"||et.plannerSource==="demo"){Zi(et.plannerSource);return}}T&&Zi("error")}catch{T&&Zi("error")}};Y();const ye=window.setInterval(()=>{Y()},1e4);return()=>{T=!1,window.clearInterval(ye)}},[]);const Bs=E.useRef(0),ka=E.useRef(0);E.useEffect(()=>{const T=Fr.current;if(!T)return;const Y=()=>{const ye=Math.abs(T.scrollHeight-T.scrollTop-T.clientHeight)<2||T.scrollHeight<=T.clientHeight;!ye&&T.scrollTop<Bs.current?kr.current=!1:ye&&(kr.current=!0),Bs.current=T.scrollTop};return T.addEventListener("scroll",Y,{passive:!0}),()=>{T.removeEventListener("scroll",Y)}},[]),E.useEffect(()=>{const T=Fr.current;if(!T||!(Gi.length>0||!!wr||!!ba))return;const ye=Gi.reduce((Nt,on)=>on.role==="user"?Nt+1:Nt,0);ye>ka.current&&(kr.current=!0),ka.current=ye;const Ne=!Nr.current,Me=Gi.some(Nt=>Nt.role==="user");if(Ne&&!Me&&!wr&&!ba){Nr.current=!0,kr.current=!1;return}if(!Ne&&!kr.current)return;const et=window.requestAnimationFrame(()=>{T.scrollTop=T.scrollHeight,kr.current=!0,Nr.current=!0});return()=>window.cancelAnimationFrame(et)},[Gi.length,wr,ba,ya.length,eo.length]),E.useEffect(()=>{Xt.postToSite("setNestedLabelsVisibility",{visible:W})},[W]),E.useEffect(()=>{const T=Vi.current;if(!hn){ti.current&&T("aiFieldLoading",{blockId:"",active:!1}),Qs.current=null,ti.current=!1;return}const Y=Do??D??"",Ne=Y&&Y===(D??"")?I??"":"";T("aiFieldLoading",{blockId:Y,editablePath:Ne,active:!0}),Qs.current={blockId:Y,editablePath:Ne},ti.current=!0},[hn,Do,D,I]),E.useEffect(()=>{if(!hn)return;const T=window.setInterval(()=>{const Y=Qs.current;Y&&Vi.current("aiFieldLoading",{blockId:Y.blockId,editablePath:Y.editablePath,active:!0})},1200);return()=>window.clearInterval(T)},[hn]),E.useEffect(()=>{D&&Xt.postToSite("highlightBlock",{blockId:D,editablePath:I??null})},[D,I]),E.useEffect(()=>{Fe.clearFieldAiContext()},[D]),E.useEffect(()=>{D||It(null)},[D]),E.useEffect(()=>{zr(!1)},[$e]),E.useEffect(()=>{const T=()=>It(null);return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const Sb=dB(),to=E.useMemo(()=>{if(!Sb||!$e||!Le||!D||typeof window>"u"||window.innerWidth<=1040)return null;const T=Xt.iframeRef.current;if(!T)return null;const Y=T.getBoundingClientRect(),ye=380,Ne=36,Me=26,we=8,et=Y.top+$e.top*fi;if(et+$e.height*fi<Y.top||et>Y.bottom)return null;const on=et+we-(Ne-Me)/2;let Tn=Y.left+($e.left+$e.width)*fi-Ne-we;return Tn=Math.max(Y.left+we,Math.min(Tn,Y.right-Ne-we)),{top:on,left:Tn,width:ye}},[$e,Le,D,Xt.iframeRef,fi]);E.useEffect(()=>{to&&At&&requestAnimationFrame(()=>{var T,Y;(Y=(T=Ao.current)==null?void 0:T.querySelector("textarea"))==null||Y.focus()})},[!!to,At]);const Cd=E.useCallback((T,Y,ye,Ne)=>{var on;if(!D||!j)return;const we=((on=au()[j])==null?void 0:on.displayName)??j;V(T);const et=ck(ye,Y,j,Ne),Nt={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${we} → ${Y}`,fieldAiContext:{blockId:D,blockType:j,fieldPath:T,fieldLabel:Y,blockDisplayName:we},suggestions:et};Fe.setFieldAiContext(Nt)},[D,j]),zl=E.useCallback((T,Y,ye)=>{const Ne=ck(Y,T,"Page",ye),Me={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"},suggestions:Ne};Fe.setFieldAiContext(Me)},[]),Hu=E.useCallback((T,Y,ye,Ne,Me)=>{var on;if(!D||!j)return;const et=((on=au()[j])==null?void 0:on.displayName)??j;V(T),Xt.postToSite("aiFieldLoading",{blockId:D,editablePath:T,active:!0}),Qs.current={blockId:D,editablePath:T},ti.current=!0;const Nt={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${et} → ${Y}`,fieldAiContext:{blockId:D,blockType:j,fieldPath:T,fieldLabel:Y,blockDisplayName:et}};Fe.setFieldAiContext(Nt),Fe.submitChat(Me)},[D,j]),Yh=E.useCallback((T,Y,ye,Ne)=>{V(T);const Me={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"}};Fe.setFieldAiContext(Me),Fe.submitChat(Ne)},[]);E.useEffect(()=>{Fe.refreshRouteSlugs()},[n,r]);const Ed=T=>{const ye=Ui.current,Ne=Fr.current;if(!ye||!Ne)return Math.max(56,T);const Me=120,we=10,et=Ne.offsetTop,Nt=Math.max(56,ye.clientHeight-et-we-Me);return Math.min(Nt,Math.max(56,T))},wb=E.useCallback(T=>{ze(Y=>{const ye=Ed(T);return ye===Y?Y:ye})},[]);E.useEffect(()=>{const T=ye=>{const Ne=qn.current;if(Ne){const we=ye.clientY-Ne.y,et=Ed(Ne.composerHeight-we);ze(et)}const Me=Ci.current;if(Me){const we=ye.clientX-Me.x;Me.target==="chat"?$r(gv(Me.width+we)):Ur(bv(Me.width-we))}},Y=()=>{const ye=!!Ci.current;qn.current=null,Ci.current=null,document.body.style.userSelect="",ye&&document.body.classList.remove("panel-resizing")};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",Y),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",Y),document.body.style.userSelect="",document.body.classList.remove("panel-resizing")}},[]),E.useEffect(()=>{const T=()=>{ze(Y=>Ed(Y)),$r(Y=>Y&&gv(Y)),Ur(Y=>Y&&bv(Y))};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[$r,Ur]),E.useEffect(()=>{if(!Qe)return;const T=Y=>{Y.key==="Escape"&&!mt&&ke(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Qe,mt]),E.useEffect(()=>{Qe!=null&&Qe.options.length?Ue(Qe.options[0].id):Ue(null)},[Qe]),E.useEffect(()=>{Be||it("")},[Be]),E.useEffect(()=>{if(!Be)return;const T=Y=>{Y.key==="Escape"&&!qe&&Ze(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Be,qe]);const _d=wr?/failed|error/i.test(wr):!1,[Vu,Jh]=E.useState(0),Cb=Gn==null?void 0:Gn.stage;E.useEffect(()=>{if(Jh(0),!hn)return;const T=window.setInterval(()=>Jh(Y=>Y+1),1e3);return()=>window.clearInterval(T)},[hn,wr,Cb]);const Xh=hn&&!_d&&Vu>=5?` · ${Vu}s`:"",Eb=(Gn?Gn.stage:wr??(Ol>0?t("stream.shapingUpdate"):t("stream.gettingReady")))+Xh,Qh=(Gn?Gn.stage:wr??(Ol>0?t("stream.updating"):t("stream.thinking")))+Xh,ps=(wr==null?void 0:wr.match(/reconnecting(?:\s+agent\s+stream)?(?:\s+\((\d+)\/(\d+)\))?/i))??null,ep=ps!=null&&ps[1]?Number(ps[1]):null,tp=ps!=null&&ps[2]?Number(ps[2]):null,qu=ps?ep&&tp?`Reconnect ${ep}/${tp}`:"Reconnecting":null,np=`field_draft ${Er.eventsPerSecond}/s · chars ${Er.charsPerSecond}/s · lag ${Er.typingLagChars}`,Td={"--composer-height":`${je}px`},Io=Ar==="properties",Pl=Ar==="history",rp=E.useCallback(()=>{G(void 0),L(void 0),Ee("chat")},[]);E.useLayoutEffect(()=>{const T=di.current,Y=Xt.iframeRef.current;if(!T||!Y)return;const ye=we=>{var ms;if(we?Y.classList.remove("preview-iframe-no-transition"):Y.classList.add("preview-iframe-no-transition"),!Io){Y.style.removeProperty("width"),Y.style.removeProperty("height"),Y.style.removeProperty("transform"),Dn(Wi=>Wi===1?Wi:1);return}const et=T.offsetWidth,Nt=((ms=ci.current)==null?void 0:ms.offsetWidth)??0;if(et<=0||Nt<=0)return;const on=et+Nt,Tn=et/on;Y.style.width=`${on}px`,Y.style.height=`${100/Tn}%`,Y.style.transform=`scale(${Tn})`,Dn(Wi=>Math.abs(Wi-Tn)<5e-4?Wi:Tn)};ye(!0);const Ne=new ResizeObserver(()=>ye(!1)),Me=window.setTimeout(()=>{Ne.observe(T);const we=ci.current;we&&Ne.observe(we)},240);return()=>{window.clearTimeout(Me),Y.classList.remove("preview-iframe-no-transition"),Ne.disconnect()}},[Io,Xt.iframeRef]);const ip={...ei?{"--chat-width":`${ei}px`}:{},...Ei?{"--props-width":`${Ei}px`}:{}},sp=Gi.some(T=>T.role==="user"),op=E.useCallback(T=>{const Y=[];T.text&&Y.push(T.text),T.status&&!T.canUndo&&T.status!=="needs_clarification"&&T.status!=="plan_ready"&&Y.push(`status: ${T.status}`);const ye=(T.changes??[]).filter(Ne=>!E6(T.text,Ne));if(ye.length>0&&Y.push(`changes: ${ye.join(`
696
+ `?i.slice(0,-1):i};return t.renderer.rules.hardbreak=n(t.renderer.rules.hardbreak),t.renderer.rules.softbreak=n(t.renderer.rules.softbreak),t.renderer.rules.fence=n(t.renderer.rules.fence),t.renderer.rules.code_block=n(t.renderer.rules.code_block),t.renderer.renderToken=n(t.renderer.renderToken.bind(t.renderer)),t}}const pye=On.create({name:"markdownClipboard",addOptions(){return{transformPastedText:!1,transformCopiedText:!1}},addProseMirrorPlugins(){return[new Vn({key:new vr("markdownClipboard"),props:{clipboardTextParser:(e,t,n)=>{if(n||!this.options.transformPastedText)return null;const r=this.editor.storage.markdown.parser.parse(e,{inline:!0});return oa.fromSchema(this.editor.schema).parseSlice(Qw(r),{preserveWhitespace:!0,context:t})},clipboardTextSerializer:e=>this.options.transformCopiedText?this.editor.storage.markdown.serializer.serialize(e.content):null}})]}}),mye=On.create({name:"markdown",priority:50,addOptions(){return{html:!0,tightLists:!0,tightListClass:"tight",bulletListMarker:"-",linkify:!1,breaks:!1,transformPastedText:!1,transformCopiedText:!1}},addCommands(){const e=R5.Commands.config.addCommands();return{setContent:(t,n)=>r=>e.setContent(r.editor.storage.markdown.parser.parse(t),n)(r),insertContentAt:(t,n,r)=>i=>e.insertContentAt(t,i.editor.storage.markdown.parser.parse(n,{inline:!0}),r)(i)}},onBeforeCreate(){this.editor.storage.markdown={options:{...this.options},parser:new hye(this.editor,this.options),serializer:new fye(this.editor),getMarkdown:()=>this.editor.storage.markdown.serializer.serialize(this.editor.state.doc)},this.editor.options.initialContent=this.editor.options.content,this.editor.options.content=this.editor.storage.markdown.parser.parse(this.editor.options.content)},onCreate(){this.editor.options.content=this.editor.options.initialContent,delete this.editor.options.initialContent},addStorage(){return{}},addExtensions(){return[bbe.configure({tight:this.options.tightLists,tightClass:this.options.tightListClass}),pye.configure({transformPastedText:this.options.transformPastedText,transformCopiedText:this.options.transformCopiedText})]}}),t8=lz.extend({addAttributes(){var e;return{...(e=this.parent)==null?void 0:e.call(this),anchor:{default:null},uuid:{default:null},linktype:{default:null}}}}).configure({openOnClick:!1}),n8=wi.create({name:"textStyle",addAttributes(){return{color:{default:null}}},parseHTML(){return[{tag:"span",getAttrs:e=>{var t;return(t=e.style)!=null&&t.color?{}:!1}}]},renderHTML({HTMLAttributes:e}){return["span",sr(e),0]}}),r8=On.create({name:"avocadoBlockKeys",addGlobalAttributes(){return[{types:["paragraph","heading","bulletList","orderedList","listItem","blockquote","codeBlock"],attributes:{_key:{default:null,rendered:!1}}}]}});function gye(e){if(e&&typeof e=="object"){const t=e;for(const n of["_type","nodeType","type"])if(typeof t[n]=="string")return t[n]}return"Embedded content"}const bye=rn.create({name:"avocadoUnknownBlock",group:"block",atom:!0,selectable:!0,draggable:!0,addAttributes(){return{data:{default:null,rendered:!1},_key:{default:null,rendered:!1}}},parseHTML(){return[{tag:"div[data-avocado-unknown-block]"}]},renderHTML({node:e,HTMLAttributes:t}){return["div",sr(t,{"data-avocado-unknown-block":"",class:"rte-unknown-block"}),gye(e.attrs.data)]}}),yye=[Vw.configure({heading:{levels:[1,2,3,4,5,6]},link:!1}),t8,n8,r8,bye],xye=rn.create({name:"doc",topNode:!0,content:"paragraph"}),vye=[Vw.configure({document:!1,heading:!1,bulletList:!1,orderedList:!1,listItem:!1,blockquote:!1,codeBlock:!1,horizontalRule:!1,link:!1}),xye,t8,n8,r8],kye=new Set(["bold","italic","strike","code","underline","link","textStyle"]);function Sye(e){return wi.create({name:e,parseHTML(){return[{tag:`span[data-decorator="${e}"]`}]},renderHTML(){return["span",{"data-decorator":e,class:"rte-decorator"},0]}})}function wye(e=[],t={}){const n=new Set(kye),r=[];for(const s of e){const o=s==null?void 0:s.name;typeof o!="string"||o.length===0||n.has(o)||(n.add(o),r.push(Sye(o)))}const i=t.inline?vye:yye;return r.length>0?[...i,...r]:i}const ea=14,Cye=[Vw.configure({heading:{levels:[2,3,4,5,6]},link:!1,underline:!1}),lz.configure({openOnClick:!1}),mye.configure({html:!1,transformPastedText:!0,transformCopiedText:!0})];function Eye(e){var n,r;const t=(r=(n=e.storage.markdown)==null?void 0:n.getMarkdown)==null?void 0:r.call(n);return typeof t=="string"?t:""}function oo({active:e,onClick:t,title:n,className:r,children:i}){return m.jsx("button",{type:"button",className:`rte-toolbar-btn${e?" is-active":""}${r?` ${r}`:""}`,onClick:t,title:n,onMouseDown:s=>s.preventDefault(),children:i})}function i8({editor:e,trailing:t,decorators:n,inline:r}){const i=E.useCallback(()=>{const s=e.getAttributes("link").href??"",o=window.prompt("URL",s);o!==null&&(o===""?e.chain().focus().extendMarkRange("link").unsetLink().run():e.chain().focus().extendMarkRange("link").setLink({href:o}).run())},[e]);return m.jsxs("div",{className:`rte-toolbar${t?" rte-toolbar--with-trailing":""}`,children:[m.jsx(oo,{active:e.isActive("bold"),onClick:()=>e.chain().focus().toggleBold().run(),title:"Bold",children:m.jsx(pL,{size:ea})}),m.jsx(oo,{active:e.isActive("italic"),onClick:()=>e.chain().focus().toggleItalic().run(),title:"Italic",children:m.jsx(JL,{size:ea})}),m.jsx(oo,{active:e.isActive("strike"),onClick:()=>e.chain().focus().toggleStrike().run(),title:"Strikethrough",children:m.jsx(M9,{size:ea})}),!r&&m.jsx("span",{className:"rte-toolbar-sep"}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:2}),onClick:()=>e.chain().focus().toggleHeading({level:2}).run(),title:"Heading 2",children:m.jsx($L,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:3}),onClick:()=>e.chain().focus().toggleHeading({level:3}).run(),title:"Heading 3",children:m.jsx(qL,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("heading",{level:4}),onClick:()=>e.chain().focus().toggleHeading({level:4}).run(),title:"Heading 4",children:m.jsx(HL,{size:ea})}),!r&&m.jsx("span",{className:"rte-toolbar-sep"}),!r&&m.jsx(oo,{active:e.isActive("bulletList"),onClick:()=>e.chain().focus().toggleBulletList().run(),title:"Bullet list",children:m.jsx(r9,{size:ea})}),!r&&m.jsx(oo,{active:e.isActive("orderedList"),onClick:()=>e.chain().focus().toggleOrderedList().run(),title:"Ordered list",children:m.jsx(t9,{size:ea})}),m.jsx("span",{className:"rte-toolbar-sep"}),m.jsx(oo,{active:e.isActive("link"),onClick:i,title:"Link",children:m.jsx(QL,{size:ea})}),(n??[]).map(s=>m.jsx(oo,{className:"rte-toolbar-btn--tag",active:e.isActive(s.name),onClick:()=>e.chain().focus().toggleMark(s.name).run(),title:s.title??s.name,children:s.title??s.name},s.name)),t?m.jsx("div",{className:"rte-toolbar-trailing",children:t}):null]})}function _ye({value:e,onChange:t,onFocus:n,onBlur:r,trailing:i}){const s=E.useRef(!1),o=E.useRef(e),l=W5({extensions:Cye,content:EA(e),onUpdate:({editor:c})=>{if(s.current)return;const d=Eye(c);o.current=d,t(d)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()});return E.useEffect(()=>{if(!l||l.isDestroyed||e===o.current)return;o.current=e,s.current=!0;const{from:c,to:d}=l.state.selection;l.commands.setContent(EA(e));const h=l.state.doc.content.size,p=Math.min(c,h),b=Math.min(d,h);try{l.commands.setTextSelection({from:p,to:b})}catch{}s.current=!1},[e,l]),l?m.jsxs("div",{className:"rte-wrap",children:[m.jsx(i8,{editor:l,trailing:i}),m.jsx(Dw,{editor:l,className:"rte-content"})]}):null}function Tye({value:e,onChange:t,onFocus:n,onBlur:r,decorators:i,inline:s}){const o=E.useRef(!1),l=E.useRef(JSON.stringify(e)),c=`${s?"inline":"block"}:${(i??[]).map(p=>p.name).join(",")}`,d=E.useMemo(()=>wye(i??[],{inline:s}),[c]),h=W5({extensions:d,content:e,onUpdate:({editor:p})=>{if(o.current)return;const b=p.getJSON();l.current=JSON.stringify(b),t(b)},onFocus:()=>n==null?void 0:n(),onBlur:()=>r==null?void 0:r()},[c]);return E.useEffect(()=>{if(!h||h.isDestroyed)return;const p=JSON.stringify(e);if(p===l.current)return;l.current=p,o.current=!0;const{from:b,to:y}=h.state.selection;h.commands.setContent(e);const x=h.state.doc.content.size;try{h.commands.setTextSelection({from:Math.min(b,x),to:Math.min(y,x)})}catch{}o.current=!1},[e,h]),h?m.jsxs("div",{className:`rte-wrap${s?" rte-wrap--inline":""}`,children:[m.jsx(i8,{editor:h,decorators:i,inline:s}),m.jsx(Dw,{editor:h,className:"rte-content"})]}):null}const UM=new Set(["text","richtext","imageAlt"]),Aye=()=>{};function Nye(e,t){const n=E.useRef(null),r=E.useRef(void 0);return E.useEffect(()=>{if(!e||!t||t!==e){r.current=t;return}if(r.current===t)return;r.current=t;const i=n.current;if(!i)return;i.scrollIntoView({behavior:"smooth",block:"nearest"}),i.classList.add("property-field--flash");const s=setTimeout(()=>i.classList.remove("property-field--flash"),1800);return()=>{clearTimeout(s),i.classList.remove("property-field--flash")}},[e,t]),n}const Mye=kn.memo(function({style:t,blockId:n,blockType:r,props:i,status:s,failure:o,failedSlug:l,failedOrigin:c,onRetry:d,onFieldChange:h,onImageClick:p,onAiAssist:b,slug:y,pageName:x,navLabel:k,onNavLabelChange:S,pageMeta:C,onPageMetaChange:_,onDeselectBlock:A,onPageAiAssist:M,onAiQuickAction:R,onPageAiQuickAction:D,aiLoading:j,aiLoadingPath:I,onAddListItem:G,onRemoveListItem:L,highlightPath:H,manifestByType:V,siteOrigin:Z,onClose:K}){const q=ge(re=>re.activeBlockId),B=ge(re=>re.activeBlockType),W=ge(re=>re.slug),ee=ge(re=>re.isLoading),ue=ge(re=>re.activeEditablePath),z=n??q,F=r??B,$=y??W,O=j??ee,te=I??ue,se=H??ue,{t:de}=yr(),le=K?m.jsx("button",{type:"button",className:"property-panel-context-close",onClick:K,"aria-label":de("propertyPanel.close"),title:de("propertyPanel.close"),children:m.jsx(xo,{size:16})}):null,Ae=m.jsxs("div",{className:"property-panel-context property-panel-context--page",children:[m.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[m.jsx("path",{d:"M3.5 1.5h6L13 5v9a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5v-12a.5.5 0 0 1 .5-.5Z",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),m.jsx("path",{d:"M9.5 1.5V5h3.5",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})]}),m.jsx("div",{className:"property-panel-context-text",children:m.jsx("span",{className:"property-panel-context-breadcrumb",children:m.jsx("span",{className:"property-panel-context-breadcrumb-current",children:de("propertyPanel.page")})})}),le]});if(!z||!F)return m.jsxs("div",{className:"property-panel",style:t,children:[Ae,$&&$!=="/"&&S?m.jsx(Lye,{slug:$,navLabel:k??"",onNavLabelChange:S,onAiAssist:M,onAiQuickAction:D,aiLoading:O,fieldShimmer:O===!0&&te==="Nav label"}):null,$&&_?m.jsx(Bye,{pageMeta:C??{},onPageMetaChange:_,onAiAssist:M,onAiQuickAction:D,aiLoading:O,aiLoadingPath:te}):null]});let Oe=au()[F];if(V){const re=V.get(F);if(re){const X=sne(re);if(!Oe)Oe={displayName:re.displayName??F,fields:X.fields,listFields:Object.keys(X.listFields).length>0?X.listFields:void 0};else{const je={};for(const[Be,Ze]of Object.entries(X.fields))je[Be]=Be in Oe.fields?Oe.fields[Be]:Ze;const ze={};for(const[Be,Ze]of Object.entries(X.listFields))if(Oe.listFields&&Be in Oe.listFields){const kt=Oe.listFields[Be].itemFields,it={};for(const[qe,Wt]of Object.entries(Ze.itemFields))it[qe]=qe in kt?kt[qe]:Wt;ze[Be]={label:Oe.listFields[Be].label??Ze.label,itemFields:it}}else ze[Be]=Ze;Oe={...Oe,displayName:re.displayName??Oe.displayName,fields:je,listFields:Object.keys(ze).length>0?ze:void 0}}}}return Oe?m.jsxs("div",{className:"property-panel",style:t,children:[m.jsxs("div",{className:"property-panel-context property-panel-context--component",children:[m.jsxs("svg",{className:"property-panel-context-icon",viewBox:"0 0 16 16",width:"16",height:"16",fill:"none","aria-hidden":"true",children:[m.jsx("rect",{x:"1.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"9.5",y:"1.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"1.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"}),m.jsx("rect",{x:"9.5",y:"9.5",width:"5",height:"5",rx:"1",stroke:"currentColor",strokeWidth:"1.2"})]}),m.jsx("div",{className:"property-panel-context-text",children:m.jsxs("span",{className:"property-panel-context-breadcrumb",children:[m.jsx("button",{type:"button",className:"property-panel-context-breadcrumb-link",onClick:A,children:de("propertyPanel.page")}),m.jsx("span",{className:"property-panel-context-breadcrumb-sep","aria-hidden":"true",children:"›"}),m.jsx("span",{className:"property-panel-context-breadcrumb-current",children:Oe.displayName})]})}),le]}),(s==="loading"||s==="idle"&&!i)&&!i?m.jsx("div",{className:"property-panel-empty",children:de("propertyPanel.loading")}):s==="error"?m.jsx(Dye,{failure:o??"unreachable",slug:l??$,origin:c,onRetry:d}):i?m.jsxs("div",{className:"property-panel-fields",children:[s8(Object.entries(Oe.fields),i,"",F,h,p,b,R,O,te,se,Z),Oe.listFields?Object.entries(Oe.listFields).map(([re,X])=>{const je=Array.isArray(i[re])?i[re]:[];return m.jsx(Oye,{listKey:re,listField:X,items:je,blockType:F,onFieldChange:h,onImageClick:p,onAiAssist:b,onAiQuickAction:R,aiLoading:O,aiLoadingPath:te,highlightPath:se,onAddItem:G?()=>G(re):void 0,onRemoveItem:L?ze=>L(re,ze):void 0,siteOrigin:Z},re)}):null]}):null]}):m.jsxs("div",{className:"property-panel",style:t,children:[Ae,m.jsxs("div",{className:"property-panel-empty",children:[de("propertyPanel.unknownBlock"),": ",F]})]})});function Dye({failure:e,slug:t,origin:n,onRetry:r}){const{t:i}=yr(),s=i(e==="blockMissing"?"propertyPanel.loadFailedMissing":e==="pageMissing"?"propertyPanel.loadFailedNoPage":"propertyPanel.loadFailed"),o=i(e==="blockMissing"?"propertyPanel.loadFailedMissingHint":e==="pageMissing"?"propertyPanel.loadFailedNoPageHint":"propertyPanel.loadFailedUnreachableHint");return m.jsxs("div",{className:"property-panel-empty",children:[s,m.jsx("div",{className:"sites-form-hint",style:{marginTop:8},children:o}),e!=="unreachable"||n?m.jsxs("div",{className:"sites-form-hint",style:{marginTop:8},children:[m.jsx("code",{children:t}),n?m.jsxs(m.Fragment,{children:[" · ",m.jsx("code",{children:n})]}):null]}):null,r?m.jsx("button",{type:"button",className:"property-panel-retry",onClick:r,style:{marginTop:12},children:i("propertyPanel.retry")}):null]})}function HM(e,t){return!!(e==="imageUrl"&&t==="imageAlt"||e==="src"&&t==="alt"||e.endsWith(".src")&&t===e.replace(/\.src$/,".alt"))}function Rye(e){try{const n=new URL(e,"http://localhost").pathname.split("/").pop()||"";return n.length>30?n.slice(0,27)+"...":n||"(image)"}catch{return e.length>30?e.slice(0,27)+"...":e||"(empty)"}}function s8(e,t,n,r,i,s,o,l,c,d,h,p){const b=new Set;for(let x=0;x<e.length;x++){const[k,S]=e[x];if(S.kind==="image")for(const[C,_]of e)_.kind==="imageAlt"&&HM(k,C)&&b.add(C)}const y=[];for(const[x,k]of e)if(!b.has(x))if(k.kind==="image"){const S=e.find(([A,M])=>M.kind==="imageAlt"&&HM(x,A)),C=S==null?void 0:S[0],_=C?t[C]==null?"":String(t[C]):void 0;y.push(m.jsx(jye,{label:k.label??x,blockType:r,imageUrl:t[x]==null?"":String(t[x]),altText:_,onChangeClick:()=>s==null?void 0:s(n+x,t[x]==null?"":String(t[x])),onRemove:()=>{i(n+x,""),C&&i(n+C,"")},onAltCommit:C?A=>i(n+C,A):void 0,onAltAiAssist:C&&o?()=>o(n+C,"Alt text","imageAlt",_??""):void 0,onAltAiQuickAction:C&&l?A=>l(n+C,"Alt text","imageAlt",_??"",A):void 0,aiLoading:c,fieldShimmer:c===!0&&C!=null&&d===n+C,siteOrigin:p},x))}else y.push(m.jsx(Pye,{fieldKey:x,field:k,value:t[x],blockType:r,onCommit:S=>i(n+x,S),onAiAssist:UM.has(k.kind)&&o?()=>o(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x])):void 0,onAiQuickAction:UM.has(k.kind)&&l?S=>l(n+x,k.label??x,k.kind,t[x]==null?"":String(t[x]),S):void 0,aiLoading:c,fieldShimmer:c===!0&&d===n+x,highlightPath:h,fieldPath:n+x},x));return y}function Nh({onClick:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,onQuickAction:s,onCustomPrompt:o,aiLoading:l,variant:c="overlay"}){const[d,h]=E.useState(null),p=y=>{s&&t&&n&&r!==void 0?h(y.currentTarget.getBoundingClientRect()):e()},b=c==="toolbar"?"rte-toolbar-ai-btn":"property-field-ai-btn";return m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:`${b}${l?` ${b}--loading`:""}`,onClick:p,onMouseDown:y=>y.preventDefault(),title:"AI suggestions",children:l?m.jsx(th,{size:14,"aria-hidden":"true"}):m.jsx(rD,{size:14,"aria-hidden":"true"})}),d&&t&&n&&r!==void 0&&m.jsx(Iye,{anchorRect:d,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i??"",aiLoading:l,onSelect:y=>{h(null),s==null||s(y)},onCustomPrompt:()=>{h(null),(o??e)()},onDismiss:()=>h(null)})]})}function Iye({anchorRect:e,fieldKind:t,fieldLabel:n,blockType:r,currentValue:i,aiLoading:s,onSelect:o,onCustomPrompt:l,onDismiss:c}){const d=Nae(t,n,r,i),p=window.innerHeight-e.bottom<160,b=p?void 0:e.bottom+4,y=p?window.innerHeight-e.top+4:void 0,x=window.innerWidth-e.right;return E.useEffect(()=>{const k=S=>{S.key==="Escape"&&c()};return window.addEventListener("keydown",k),()=>window.removeEventListener("keydown",k)},[c]),m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"ai-quick-actions-backdrop",onClick:c}),m.jsxs("div",{className:"ai-quick-actions-menu",style:{top:b,bottom:y,right:x},children:[d.map(k=>m.jsxs("button",{type:"button",className:"ai-quick-actions-item",disabled:s,onClick:()=>o(k),children:[m.jsx(rD,{size:12,"aria-hidden":"true"}),k]},k)),m.jsx("div",{className:"ai-quick-actions-divider"}),m.jsxs("button",{type:"button",className:"ai-quick-actions-item ai-quick-actions-item--custom",onClick:l,children:[m.jsx(h9,{size:12,"aria-hidden":"true"}),"Custom prompt..."]})]})]})}function o8(e,t){return!e||!t||/^https?:\/\//i.test(e)?e:e.startsWith("/")?`${t}${e}`:e}function jye({label:e,blockType:t,imageUrl:n,altText:r,onChangeClick:i,onRemove:s,onAltCommit:o,onAltAiAssist:l,onAltAiQuickAction:c,aiLoading:d,fieldShimmer:h,siteOrigin:p}){const{t:b}=yr(),[y,x]=E.useState(r??""),[k,S]=E.useState(!1),[C,_]=E.useState(!1),A=k?y:r??"",{debouncedCommit:M,flushCommit:R}=tb(o??Aye,400);return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:e})}),m.jsxs("div",{className:"property-field-image-widget",children:[n&&!C?m.jsxs("div",{className:"property-field-image-preview",children:[m.jsx("img",{className:"property-field-image-thumb",src:o8(n,p),alt:"",onError:()=>_(!0)}),m.jsxs("div",{className:"property-field-image-actions",children:[m.jsxs("button",{type:"button",className:"property-field-image-change",onClick:i,children:[m.jsx(v9,{size:13})," ",b("propertyPanel.change")]}),s?m.jsxs("button",{type:"button",className:"property-field-image-remove",onClick:s,children:[m.jsx(Wk,{size:13})," ",b("propertyPanel.remove")]}):null]})]}):m.jsxs("button",{type:"button",className:"property-field-image-empty",onClick:i,children:[m.jsx(ZL,{size:18,"aria-hidden":"true"}),m.jsx("span",{children:b("propertyPanel.chooseImage")})]}),o!==void 0&&m.jsxs("div",{className:"property-field-image-alt-group",children:[m.jsx("div",{className:"property-field-image-alt-label",children:m.jsx("span",{children:b("propertyPanel.altText")})}),m.jsxs("div",{className:`property-field-input-wrap${h?" property-field-input-wrap--ai-loading":""}`,children:[m.jsx("input",{type:"text",className:"property-field-image-alt",placeholder:b("propertyPanel.altPlaceholder"),value:A,onFocus:()=>{x(r??""),S(!0)},onChange:D=>{x(D.target.value),M(D.target.value)},onBlur:()=>{S(!1),R()}}),l?m.jsx(Nh,{onClick:l,fieldKind:"imageAlt",fieldLabel:b("propertyPanel.altText"),blockType:t??"",currentValue:r??"",onQuickAction:c,onCustomPrompt:l,aiLoading:h}):null]})]})]})]})}function Oye({listKey:e,listField:t,items:n,blockType:r,onFieldChange:i,onImageClick:s,onAiAssist:o,onAiQuickAction:l,aiLoading:c,aiLoadingPath:d,highlightPath:h,onAddItem:p,onRemoveItem:b,siteOrigin:y}){const[x,k]=E.useState(null),S=t.label??e;return E.useEffect(()=>{if(!h)return;const C=`${e}[`;if(!h.startsWith(C))return;const _=h.slice(C.length),A=_.indexOf("]");if(A<0)return;const M=Number(_.slice(0,A));!Number.isNaN(M)&&M>=0&&M<n.length&&k(M)},[h,e,n.length]),m.jsxs("div",{className:"property-list-section",children:[m.jsxs("div",{className:"property-list-header",children:[S," (",n.length,")"]}),n.map((C,_)=>{var Z;const A=x===_,M=t.discriminator?String(C[t.discriminator]??""):"",R=((Z=t.itemFieldsByType)==null?void 0:Z[M])??t.itemFields,D=Object.keys(R).find(K=>R[K].kind==="text"||R[K].kind==="richtext"),j=Object.keys(R).find(K=>R[K].kind==="image"),I=j&&C[j]!=null?String(C[j]):"",L=(D&&C[D]!=null?String(C[D]):"")||(I?Rye(I):`Item ${_+1}`),H=M?`[${M}] ${L}`:L,V=H.length>40?H.slice(0,40)+"...":H;return m.jsxs("div",{className:"property-list-item",children:[m.jsxs("button",{type:"button",className:`property-list-item-toggle ${A?"is-expanded":""}`,onClick:()=>k(A?null:_),children:[m.jsx("span",{className:"property-list-item-chevron","aria-hidden":"true"}),I?m.jsx("img",{className:"property-list-item-thumb",src:o8(I,y),alt:"",loading:"lazy"}):null,m.jsx("span",{className:"property-list-item-preview",children:V})]}),A?m.jsxs("div",{className:"property-list-item-fields",children:[s8(Object.entries(R),C,`${e}[${_}].`,r,i,s,o,l,c,d,h,y),b?m.jsxs("button",{type:"button",className:"property-list-item-remove-btn",onClick:()=>b(_),children:[m.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:m.jsx("path",{d:"M2.5 4h11M6 4V2.5h4V4M5 4l.5 9h5l.5-9M6.5 6.5v4M9.5 6.5v4"})}),"Remove item"]}):null]}):null]},_)}),p?m.jsxs("button",{type:"button",className:"property-list-add-btn",onClick:p,children:[m.jsx("svg",{viewBox:"0 0 16 16",width:"14",height:"14",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round","aria-hidden":"true",children:m.jsx("path",{d:"M8 3v10M3 8h10"})}),"Add"]}):null]})}const zye={h1:"H1 — Page title",h2:"H2 — Section",h3:"H3 — Subsection",h4:"H4",h5:"H5",h6:"H6"};function Pye({fieldKey:e,field:t,value:n,blockType:r,onCommit:i,onAiAssist:s,onAiQuickAction:o,aiLoading:l,fieldShimmer:c,highlightPath:d,fieldPath:h}){const p=n==null?"":String(n),[b,y]=E.useState(p),[x,k]=E.useState(!1),{debouncedCommit:S,flushCommit:C}=tb(i,400),_=Nye(h,d),A=x?b:p,M=t.label??e,R=()=>{y(p),k(!0)},D=()=>{k(!1),C()};if(t.kind==="headingLevel"){const L=(r&&OI[r])??"h2",H=p&&/^h[1-6]$/.test(p)?p:"";return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsxs("select",{className:"property-field-input property-field-select",value:H,onChange:V=>i(V.target.value),children:[m.jsxs("option",{value:"",children:["Auto (",L.toUpperCase(),")"]}),["h1","h2","h3","h4","h5","h6"].map(V=>m.jsx("option",{value:V,children:zye[V]},V))]})]})}if(t.kind==="image")return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsx("div",{className:"property-field-image-url",title:p,children:p||"(empty)"})]});if(t.kind==="enum"&&t.options){const L=t.options.includes(p);return m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsxs("select",{className:"property-field-input property-field-select",value:p,onChange:H=>i(H.target.value),children:[!L&&m.jsx("option",{value:p,children:p||"—"}),t.options.map(H=>m.jsx("option",{value:H,children:H},H))]})]})}if(t.kind==="boolean"){const L=p==="true"||p==="1";return m.jsx("div",{className:"property-field property-field--inline",ref:_,children:m.jsxs("div",{className:"property-field-label",children:[m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]}),m.jsx("button",{type:"button",role:"switch","aria-checked":L,"aria-label":M,className:`property-field-switch${L?" is-on":""}`,onClick:()=>i(L?"false":"true"),children:m.jsx("span",{className:"property-field-switch-knob","aria-hidden":"true"})})]})})}if(t.kind==="color")return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:M})}),m.jsx("input",{type:"color",className:"property-field-color",value:p||"#000000",onChange:L=>i(L.target.value)})]});if(t.kind==="richtext")return n!==null&&typeof n=="object"?m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsx("div",{className:"property-field-input-wrap",children:m.jsx(Tye,{value:n,onChange:L=>S(L),onFocus:R,onBlur:D,decorators:t.decorators,inline:t.inline})})]}):m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsx("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:m.jsx(_ye,{value:p,onChange:L=>{y(L),S(L)},onFocus:R,onBlur:D,trailing:s?m.jsx(Nh,{variant:"toolbar",onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null})})]});const j=t.multiline===!0,I=t.kind==="number"?"number":t.kind==="url"?"url":"text",G={value:A,onFocus:R,onChange:L=>{y(L.target.value),S(L.target.value)},onBlur:D};return m.jsxs("div",{className:"property-field",ref:_,children:[m.jsx("div",{className:"property-field-label",children:m.jsxs("span",{children:[M,t.required&&m.jsx("span",{className:"property-field-required",children:"*"})]})}),m.jsxs("div",{className:`property-field-input-wrap${c?" property-field-input-wrap--ai-loading":""}`,children:[j?m.jsx("textarea",{className:"property-field-textarea",rows:3,...G}):m.jsx("input",{type:I,className:"property-field-input",...G}),s?m.jsx(Nh,{onClick:s,fieldKind:t.kind,fieldLabel:t.label??e,blockType:r??"",currentValue:p,onQuickAction:o,onCustomPrompt:s,aiLoading:c}):null]})]})}function Lye({slug:e,navLabel:t,onNavLabelChange:n,onAiAssist:r,onAiQuickAction:i,aiLoading:s,fieldShimmer:o}){const{t:l}=yr(),[c,d]=E.useState(t),[h,p]=E.useState(!1),b=h?c:t,{debouncedCommit:y,flushCommit:x}=tb(k=>n(e,k),400);return m.jsx("div",{className:"property-panel-page-section",children:m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:l("propertyPanel.navLabel")})}),m.jsxs("div",{className:`property-field-input-wrap${o?" property-field-input-wrap--ai-loading":""}`,children:[m.jsx("input",{type:"text",className:"property-field-input",placeholder:l("propertyPanel.navPlaceholder"),value:b,onFocus:()=>{d(t),p(!0)},onChange:k=>{d(k.target.value),y(k.target.value)},onBlur:()=>{p(!1),x()}}),r?m.jsx(Nh,{onClick:()=>r("Nav label","text",t),fieldKind:"text",fieldLabel:"Nav label",blockType:"Page",currentValue:t,onQuickAction:i?k=>i("Nav label","text",t,k):void 0,onCustomPrompt:()=>r("Nav label","text",t),aiLoading:o}):null]})]})})}function Bye({pageMeta:e,onPageMetaChange:t,onAiAssist:n,onAiQuickAction:r,aiLoading:i,aiLoadingPath:s}){const{t:o}=yr();return m.jsxs("div",{className:"property-panel-page-section",children:[m.jsx("div",{className:"property-panel-block-name",children:o("propertyPanel.seo")}),m.jsx(cv,{label:o("propertyPanel.seoTitle"),fieldKind:"text",blockType:"Page",value:e.title??"",placeholder:o("propertyPanel.seoTitlePlaceholder"),multiline:!0,autosizeRows:{min:2,max:2},recommendedMax:60,onCommit:l=>t("title",l),onAiAssist:n?()=>n("SEO title","text",e.title??""):void 0,onAiQuickAction:r?l=>r("SEO title","text",e.title??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="SEO title"}),m.jsx(cv,{label:o("propertyPanel.metaDescription"),fieldKind:"richtext",blockType:"Page",value:e.description??"",placeholder:o("propertyPanel.metaDescPlaceholder"),multiline:!0,autosizeRows:{min:3,max:6},recommendedMax:160,onCommit:l=>t("description",l),onAiAssist:n?()=>n("Meta description","richtext",e.description??""):void 0,onAiQuickAction:r?l=>r("Meta description","richtext",e.description??"",l):void 0,aiLoading:i,fieldShimmer:i===!0&&s==="Meta description"}),m.jsx(cv,{label:o("propertyPanel.ogImage"),fieldKind:"url",blockType:"Page",value:e.ogImage??"",placeholder:"https://...",onCommit:l=>t("ogImage",l)})]})}function cv({label:e,fieldKind:t,blockType:n,value:r,placeholder:i,multiline:s,autosizeRows:o,recommendedMax:l,onCommit:c,onAiAssist:d,onAiQuickAction:h,aiLoading:p,fieldShimmer:b}){const[y,x]=E.useState(r),[k,S]=E.useState(!1),C=E.useRef(null),_=k?y:r,{debouncedCommit:A,flushCommit:M}=tb(c,400),R=s===!0&&o!=null,D=E.useCallback(()=>{if(!R||!C.current||!o)return;const G=C.current,L=getComputedStyle(G),H=Number.parseFloat(L.lineHeight),V=Number.parseFloat(L.fontSize)||15,Z=Number.isFinite(H)?H:V*1.2,K=(Number.parseFloat(L.paddingTop)||0)+(Number.parseFloat(L.paddingBottom)||0),q=(Number.parseFloat(L.borderTopWidth)||0)+(Number.parseFloat(L.borderBottomWidth)||0),B=o.min*Z+K+q,W=o.max*Z+K+q;G.style.height="0px";const ee=G.scrollHeight,ue=Math.max(B,Math.min(W,ee));G.style.height=`${ue}px`,G.style.overflowY=ee>W?"auto":"hidden"},[R,o]);E.useLayoutEffect(()=>{D()},[D,_,k,r]),E.useEffect(()=>{if(!R)return;const G=()=>D();return window.addEventListener("resize",G),()=>window.removeEventListener("resize",G)},[R,D]);const j={placeholder:i,value:_,onFocus:()=>{x(r),S(!0)},onChange:G=>{x(G.target.value),A(G.target.value)},onBlur:()=>{S(!1),M()}},I=(k?y:r).length;return m.jsxs("div",{className:"property-field",children:[m.jsx("div",{className:"property-field-label",children:m.jsx("span",{children:e})}),m.jsxs("div",{className:`property-field-input-wrap${b?" property-field-input-wrap--ai-loading":""}`,children:[s?m.jsx("textarea",{ref:R?C:void 0,className:`property-field-textarea${R?" property-field-textarea--autosize":""}`,rows:(o==null?void 0:o.min)??3,...j}):m.jsx("input",{type:"text",className:"property-field-input",...j}),d?m.jsx(Nh,{onClick:d,fieldKind:t,fieldLabel:e,blockType:n,currentValue:k?y:r,onQuickAction:h,onCustomPrompt:d,aiLoading:b}):null]}),l!=null&&m.jsxs("span",{className:`property-field-char-count${I>l?" property-field-char-count--over":""}`,children:[I," / ",l]})]})}class VM extends E.Component{constructor(){super(...arguments);Se(this,"state",{error:null});Se(this,"reset",()=>{var n,r;(r=(n=this.props).onReset)==null||r.call(n),this.setState({error:null})})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var i,s;console.error("[editor] Uncaught error in component tree:",n,r.componentStack),(s=(i=this.props).onError)==null||s.call(i,n,r)}render(){return this.state.error?m.jsxs("div",{style:this.props.style,className:"flex flex-col items-center justify-center gap-3 p-6 text-center text-sm text-muted-foreground h-full",children:[m.jsx("p",{className:"font-medium text-foreground",children:this.props.fallbackLabel??"Something went wrong"}),m.jsx("p",{className:"max-w-xs opacity-70 text-xs",children:this.state.error.message}),m.jsx("button",{type:"button",onClick:this.reset,className:"rounded-md border px-3 py-1.5 text-xs hover:bg-accent transition-colors",children:"Try again"})]}):this.props.children}}function Fye({siteId:e,orchestratorUrl:t,hostedIds:n}){const{t:r}=yr(),i=()=>{dae(e),window.location.href=fae(window.location.href)};return m.jsxs("div",{className:"orchestrator-mismatch",role:"alert",children:[m.jsxs("div",{className:"orchestrator-mismatch-body",children:[m.jsx("strong",{children:r("orchestratorMismatch.title")}),m.jsx("span",{children:n.length>0?r("orchestratorMismatch.detailHosts",{orchestrator:t,hosted:n.join(", ")}):r("orchestratorMismatch.detail",{orchestrator:t})})]}),m.jsx("button",{type:"button",className:"orchestrator-mismatch-action",onClick:i,children:r("orchestratorMismatch.useDefault")})]})}const Wm=3e3;function $ye(e){const[t,n]=E.useState({status:"loading",blocks:[],manifest:null});E.useEffect(()=>{let i=!0,s=null;const o=async()=>{try{const c=await fetch(`${e||gd}/api/editor/blocks`);if(!c.ok){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:`Manifest endpoint returned ${c.status}`}),s=setTimeout(()=>{i&&o()},Wm);return}const d=await c.json(),h=PI.safeParse(d);if(!h.success){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:"Manifest response shape is invalid"}),s=setTimeout(()=>{i&&o()},Wm);return}const p=FI(h.data.blocks);if(p){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:p}),s=setTimeout(()=>{i&&o()},Wm);return}if(!i)return;n({status:"ready",blocks:h.data.blocks,version:h.data.version,manifest:h.data})}catch(l){if(!i)return;n({status:"degraded",blocks:[],manifest:null,reason:l instanceof Error?l.message:"Manifest fetch failed"}),s=setTimeout(()=>{i&&o()},Wm)}};return o(),()=>{i=!1,s&&clearTimeout(s)}},[e]);const r=E.useMemo(()=>{const i=new Map;for(const s of t.blocks)i.set(s.type,s);return i},[t.blocks]);return{...t,byType:r,siteCapabilities:{allowStructuralEdits:t.status==="ready",manifestStatus:t.status,reason:t.reason,manifestVersion:t.version,blockCount:t.blocks.length,checkedAt:new Date().toISOString()},allowStructuralEdits:t.status==="ready"}}function Uye(e){return null}function Hye(){const e=Uye();return e||"text"}const Vye=/^[a-z]{2}(?:-[a-z0-9]{2,8})?$/i;let _f;function qye(e){if(!Vye.test(e))return!1;if(_f===void 0)try{_f=new Intl.DisplayNames(["en"],{type:"language",fallback:"none"})}catch{_f=null}if(!_f)return!1;try{return typeof _f.of(e)=="string"}catch{return!1}}function e2(e){return e.split("/").filter(Boolean)}function Gye(e){const t={},n=[];for(const o of e){const l=e2(o)[0];if(l&&qye(l)){const c=l.toLowerCase();(t[c]||(t[c]=[])).push(o)}else n.push(o)}const r=Object.keys(t).sort();if(r.length<2)return null;const i=new Map;for(const o of r)for(const l of new Set(t[o].map(c=>t2(c,o))))i.set(l,(i.get(l)??0)+1);if(![...i.values()].some(o=>o>=2))return null;for(const o of r){const l=`/${o}`;t[o].sort((c,d)=>c===l?-1:d===l?1:0)}return{locales:r,byLocale:t,shared:n}}function a8(e,t){var r;const n=(r=e2(e)[0])==null?void 0:r.toLowerCase();return n&&t.byLocale[n]?n:void 0}function t2(e,t){var i;if(!t)return e;const n=e2(e);if(((i=n[0])==null?void 0:i.toLowerCase())!==t.toLowerCase())return e;const r=n.slice(1);return r.length===0?"/":`/${r.join("/")}`}function Zye(e,t){return`${C6(t2(e,t))} (${e})`}function Wye(e,t,n){const r=n.byLocale[t];if(!r||r.length===0)return e;const i=t2(e,a8(e,n)),s=i==="/"?`/${t}`:`/${t}${i}`;return r.includes(s)?s:r[0]}function Kye(e){try{const t=new Intl.DisplayNames([e],{type:"language"}).of(e);if(t&&t.toLowerCase()!==e.toLowerCase())return t.charAt(0).toUpperCase()+t.slice(1)}catch{}return e.toUpperCase()}const qM=Hye(),Yye=tB(),Jye=E.lazy(()=>oL(()=>import("./PuckPrototypeRoute-dMA7e2BV.js").then(e=>e.P),__vite__mapDeps([0,1])).then(e=>({default:e.PuckPrototypeRoute}))),Xye=new Set(["/editor/puck","/editor/puck/"]),Qye=3e4,l8="site-reachable-v1:";function u8(e){if(typeof sessionStorage>"u")return null;try{const t=sessionStorage.getItem(l8+e);if(!t)return null;const n=JSON.parse(t);return Date.now()-n.ts>Qye?null:n.ok}catch{return null}}function GM(e,t){if(!(typeof sessionStorage>"u"))try{sessionStorage.setItem(l8+e,JSON.stringify({ok:t,ts:Date.now()}))}catch{}}function e1e({name:e,origin:t,statusClass:n,active:r,dimmed:i,onSelect:s}){const o=t.replace(/^https?:\/\//,"");return m.jsxs("button",{type:"button",role:"menuitem",className:`site-switcher-item${r?" is-active":""}${i?" is-dimmed":""}`,onClick:s,title:t,children:[m.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${n}`,"aria-hidden":"true"}),m.jsxs("span",{className:"site-switcher-item-body",children:[m.jsx("span",{className:"site-switcher-item-name",children:e}),m.jsx("span",{className:"site-switcher-item-origin",children:o})]}),r?m.jsx(Dh,{size:12,"aria-hidden":"true"}):null]})}function ZM(e){if(typeof sessionStorage>"u")return null;const t=new Set;let n=!1;for(const r of e){const i=u8(r);i!==null&&(n=!0,i&&t.add(r))}return n?t:null}function t1e(e,t){if(e===t)return!0;if(!e||!t||e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function n1e(){const e=typeof window<"u"?window.location.pathname:"/",t=e==="/"||e==="/editor"||e==="/editor/",n=Xye.has(e),r=e==="/sites"||e==="/sites/";ge(d=>d.chatDarkMode);const i=ge(d=>d.setChatDarkMode),s=E.useMemo(()=>iq(),[]),o=E.useMemo(()=>D6(),[]),l=E.useRef(!1);if(!l.current){l.current=!0;const d=typeof window<"u"?window.location.origin:"http://localhost:4100";gB({sessionId:s,siteId:o,editorOrigin:d,orchestratorUrl:Ve})}const c=pae(o,s);return E.useEffect(()=>{if(typeof window>"u")return;const d=window.matchMedia("(prefers-color-scheme: dark)"),h=p=>i(p.matches);return d.addEventListener("change",h),()=>d.removeEventListener("change",h)},[i]),n?m.jsx(E.Suspense,{fallback:m.jsx("div",{style:{height:"100vh",display:"grid",placeItems:"center"},children:"Loading prototype…"}),children:m.jsx(Jye,{})}):r?m.jsx(k3,{sites:c,session:s}):t?m.jsx(s1e,{sites:c}):m.jsx(k3,{sites:c,session:s})}const r1e=new Set(["avocado-hub","avocado-stories","avocado-magic","avocado-odyssey"]);function i1e(e){return e.split(".").map(t=>{const n=t.match(/^([a-zA-Z_]+)\[(\d+)\]$/);return n?`${WM(n[1])} ${Number(n[2])+1}`:WM(t)}).join(" · ")}function WM(e){const n=e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").replace(/\s*url\s*$/i,"").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):e}function s1e({sites:e}){var lp,up,cp;const{t}=yr(),n=ji(),r=Oi(),i=ge(T=>T.chatDarkMode),s=ge(T=>T.setChatDarkMode),{activeSiteConfig:o}=e,l=E.useMemo(()=>pu(o),[o]),c=$ye(l),d=typeof window<"u"?window.location.origin:"http://localhost:4100",h=ge(T=>T.slug),p=ge(T=>T.setSlug),b=ge(T=>T.availableSlugs);ge(T=>T.setAvailableSlugs);const y=ge(T=>T.isLoadingSlugs),x=ge(T=>T.modelKey),k=ge(T=>T.setModelKey),S=ge(T=>T.provider),C=ge(T=>T.setProvider),_=ge(T=>T.availableProviders),A=ge(T=>T.setAvailableProviders),[M,R]=E.useState(""),D=ge(T=>T.activeBlockId),j=ge(T=>T.activeBlockType),I=ge(T=>T.activeEditablePath),G=T=>ge.getState().setActiveBlock(T),L=T=>{const Y=ge.getState();Y.setActiveBlock(Y.activeBlockId,T)},H=(T,Y)=>ge.getState().setActiveBlock(T,Y),V=ge(T=>T.setActiveEditablePath),Z=ge(T=>T.useStreaming),K=ge(T=>T.setUseStreaming),q=ge(T=>T.autoScrollTrackingEnabled),B=ge(T=>T.setAutoScrollTrackingEnabled),[W,ee]=E.useState(!1),[ue,z]=E.useState(Yye),F=E.useCallback(T=>{z(T);try{window.localStorage.setItem(hv,T?"1":"0")}catch{}},[]),$=E.useMemo(()=>!0,[]),O=$&&ue,[te,se]=E.useState(!1),[de,le]=E.useState(0),Ae=E.useCallback(()=>le(T=>T+1),[]),Te=ge(T=>T.showSettingsModal),Oe=ge(T=>T.setShowSettingsModal),re=ge(T=>T.showDebugDetails),X=ge(T=>T.setShowDebugDetails),je=ge(T=>T.composerHeight),ze=ge(T=>T.setComposerHeight),Be=ge(T=>T.addBlockPicker),Ze=ge(T=>T.setAddBlockPicker),kt=ge(T=>T.addBlockSearch),it=ge(T=>T.setAddBlockSearch),qe=ge(T=>T.isAddingBlock),Wt=ge(T=>T.setIsAddingBlock),Kn=ge(T=>T.copiedDebugEntryId),Yn=ge(T=>T.setCopiedDebugEntryId),St=ge(T=>T.feedbackNoteEntryId),xt=ge(T=>T.setFeedbackNoteEntryId),Cn=ge(T=>T.feedbackNoteText),fe=ge(T=>T.setFeedbackNoteText),pe=ge(T=>T.selectedVariationId),Ue=ge(T=>T.setSelectedVariationId),nt=ge(T=>T.imagePickerTarget),oe=ge(T=>T.setImagePickerTarget),Pe=nt!==null,st=ge(T=>T.backendFeatures),lt=ge(T=>T.setBackendFeatures),Le=ge(T=>T.selectionModeEnabled),ut=ge(T=>T.setSelectionModeEnabled),$e=ge(T=>T.anchorRect),It=ge(T=>T.setAnchorRect),At=ge(T=>T.anchoredExpanded),zr=ge(T=>T.setAnchoredExpanded),Ar=ge(T=>T.activeTab),Ee=ge(T=>T.setActiveTab),[Ye,gt]=E.useState(!1),[Et,Ot]=E.useState(!1),zt=E.useRef(null);E.useEffect(()=>{if(!Et)return;const T=ye=>{zt.current&&!zt.current.contains(ye.target)&&Ot(!1)},Y=ye=>{ye.key==="Escape"&&Ot(!1)};return document.addEventListener("mousedown",T),document.addEventListener("keydown",Y),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",Y)}},[Et]);const[yn,Pr]=E.useState(()=>ZM(e.siteList.map(T=>T.id))),Lr=E.useCallback(T=>{Pr(Y=>t1e(Y,T)?Y:T)},[]);E.useEffect(()=>{if(!Et)return;Lr(ZM(e.siteList.map(ye=>ye.id)));let T=!0;return(async()=>{let ye=!0;const Ne=await Promise.all(e.siteList.map(async Me=>{const we=u8(Me.id);if(we!==null)return{id:Me.id,ok:we};ye=!1;const et=pu(Me);try{const Nt=await fetch(`${et}/api/editor/blocks?siteId=${encodeURIComponent(Me.id)}`,{signal:AbortSignal.timeout(2500)});return GM(Me.id,Nt.ok),{id:Me.id,ok:Nt.ok}}catch{return GM(Me.id,!1),{id:Me.id,ok:!1}}}));T&&!ye&&Lr(new Set(Ne.filter(Me=>Me.ok).map(Me=>Me.id)))})(),()=>{T=!1}},[Et,e.siteList,Lr]);const Mn=E.useMemo(()=>{const T=yn===null;return e.siteList.map(Y=>{const ye=T||Y.id===r||yn.has(Y.id);return{site:Y,origin:pu(Y),online:ye,probing:T}}).sort((Y,ye)=>Y.site.id===r?-1:ye.site.id===r?1:Y.online!==ye.online?Y.online?-1:1:Y.site.name.localeCompare(ye.site.name))},[yn,e.siteList,r]),{onlineEntries:fs,activeEntry:Br}=E.useMemo(()=>({onlineEntries:Mn.filter(T=>T.online),activeEntry:Mn.find(T=>T.site.id===r)}),[Mn,r]),Ui=E.useRef(null),Fr=E.useRef(null),kr=E.useRef(!0),Nr=E.useRef(!1),ga=E.useRef(null),Sr=E.useRef(void 0),tn=E.useRef(!1),zn=E.useRef(null),Pn=E.useRef(!1),fn=E.useRef(0),qn=E.useRef(null),Ci=E.useRef(null),ei=ge(T=>T.chatWidth),$r=ge(T=>T.setChatWidth),Ei=ge(T=>T.propsWidth),Ur=ge(T=>T.setPropsWidth),ci=E.useRef(null),di=E.useRef(null),[fi,Dn]=E.useState(1),Ao=E.useRef(null),Qs=E.useRef(null),ti=E.useRef(!1),Hr=E.useRef(!1);E.useEffect(()=>{if(!Hr.current&&!(y||b.length===0)){if(h!=="/"||b.includes("/")){Hr.current=!0;return}Hr.current=!0,tn.current=!1,p(b[0])}},[b,y,h,p]);const Hi=E.useMemo(()=>{const T=Array.from(new Set([...b,h].filter(Boolean)));return T.includes("/")?["/",...T.filter(Y=>Y!=="/")]:T},[b,h]),Jn=E.useMemo(()=>Gye(Hi),[Hi]),_i=Jn?a8(h,Jn)??Jn.locales[0]:void 0,$u=E.useMemo(()=>!Jn||!_i?Hi:Jn.byLocale[_i]??[],[Jn,_i,Hi]),Os=E.useMemo(()=>{if(!c.allowStructuralEdits)return[];if(c.blocks.length>0)return c.blocks.map(Y=>({type:Y.type,label:Y.displayName??Y.type,category:"content"})).sort((Y,ye)=>Y.label.localeCompare(ye.label));const T=au();return[...Jv].map(Y=>{var ye,Ne;return{type:Y,label:((ye=T[Y])==null?void 0:ye.displayName)??Y,category:((Ne=T[Y])==null?void 0:Ne.category)??"content"}}).sort((Y,ye)=>Y.label.localeCompare(ye.label))},[c.allowStructuralEdits,c.blocks]),hs=E.useMemo(()=>{const T=kt.trim().toLowerCase(),Y=T?Os.filter(Me=>Me.label.toLowerCase().includes(T)||Me.type.toLowerCase().includes(T)):Os,ye=new Map;for(const Me of Y){const we=Me.category||"content",et=ye.get(we);et?et.push(Me):ye.set(we,[Me])}const Ne=["content","layout","conversion","navigation","media"];return[...ye.entries()].sort((Me,we)=>{const et=Ne.indexOf(Me[0]),Nt=Ne.indexOf(we[0]),on=et===-1?Number.MAX_SAFE_INTEGER:et,Tn=Nt===-1?Number.MAX_SAFE_INTEGER:Nt;return on!==Tn?on-Tn:Me[0].localeCompare(we[0])}).map(([Me,we])=>({category:Me,options:we}))},[kt,Os]),Xn=()=>{const T=Date.now();T-fn.current<1200||(fn.current=T,Fe.pushAssistantFromResult({status:"needs_clarification",summary:t("streamError.structuralDisabled"),changes:Lj(c.reason)}))},xn=E.useCallback(T=>{ge.getState().slug!==T&&(Pn.current=!0,p(T))},[p]),jl=E.useMemo(()=>({onBlockClicked:(T,Y,ye,Ne,Me,we)=>{xn(T),H(Y,ye),V(Ne),It(Y?we:null),ge.getState().setActiveTab(Y?"properties":"chat")},onRouteChanged:T=>{ge.getState().slug!==T&&H(void 0,void 0),xn(T),V(void 0),It(null),Vi.current("setSelectionMode",{enabled:ge.getState().selectionModeEnabled})},onBlockReordered:(T,Y,ye)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.reorderBlock(T,Y,ye)},onBlockDeleteRequested:(T,Y)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.deleteBlock(T,Y)},onBlockAddRequested:(T,Y)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),!(!Y.afterBlockId&&!Y.beforeBlockId)&&Ze({slug:T,afterBlockId:Y.afterBlockId,beforeBlockId:Y.beforeBlockId})},onListItemAddRequested:(T,Y,ye,Ne,Me)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.addListItem(T,Y,ye,Ne,Me)},onListItemRemoveRequested:(T,Y,ye,Ne,Me)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.removeListItem(T,Y,ye,Ne,Me)},onListItemMoveRequested:(T,Y,ye,Ne,Me,we)=>{if(!c.allowStructuralEdits){Xn();return}T!==h&&xn(T),V(void 0),Fe.moveListItem(T,Y,ye,Ne,Me,we)},onOpenImagePicker:(T,Y,ye,Ne,Me)=>{oe({slug:T,blockId:Y,editablePath:ye,currentUrl:Ne,blockType:Me??(Y===D?j:void 0)})},onEditBlockRequested:(T,Y)=>{zr(!0)},onInlineTextCommitted:(T,Y,ye,Ne)=>{T!==h&&xn(T),ye&&V(ye),Fe.inlineEditCommit(T,Y,ye,Ne)},onIframeScrolled:()=>{It(null),ge.getState().isLoading&&ge.getState().setAutoScrollSuppressed(!0)}}),[c.allowStructuralEdits,xn,h]);E.useCallback(async()=>{var T;try{const Y=`${Ve}/draft/pages?session=${encodeURIComponent(n)}&siteId=${encodeURIComponent(r)}&slug=${encodeURIComponent(h)}`,ye=await fetch(Y,{cache:"no-store"});if(!ye.ok)return;const Me=((await ye.json()).blocks??[]).find(we=>we.type==="Hero");if(!Me)return;H(Me.id,Me.type),oe({slug:h,blockId:Me.id,editablePath:"imageUrl",currentUrl:typeof((T=Me.props)==null?void 0:T.imageUrl)=="string"?Me.props.imageUrl:void 0,blockType:Me.type})}catch{}},[n,r,h,oe]);const Xt=mae(h,jl,l),Vi=E.useRef(Xt.postToSite);E.useEffect(()=>{Vi.current=Xt.postToSite},[Xt.postToSite]);const zs=E.useCallback(T=>{const Y=T??!Le;ut(Y),Xt.postToSite("setSelectionMode",{enabled:Y})},[Le,Xt]);E.useEffect(()=>{const T=Y=>{Y.key==="Escape"&&Le&&zs(!1)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Le,zs]),E.useEffect(()=>{if(Ar!=="history")return;const T=Y=>{Y.key==="Escape"&&ge.getState().setActiveTab("chat")};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Ar]);const qi=E.useCallback((T,Y)=>{(T==="draftUpdated"||T==="liveDraft")&&Ae(),Xt.postToSite(T,Y)},[Xt,Ae]),Ps=E.useCallback((T,Y,ye,Ne)=>(Ae(),Xt.postPatchToSite(T,Y,ye,Ne)),[Xt,Ae]),Fe=kae({activeSiteConfig:o,postToSite:qi,postPatchToSite:Ps,componentManifest:c.manifest,siteCapabilities:c.siteCapabilities,allowStructuralEdits:c.allowStructuralEdits,getBlockDefaultProps:T=>{var Y;return((Y=c.byType.get(T))==null?void 0:Y.defaultProps)??null},onApplied:()=>{var T;(T=Sr.current)==null||T.call(Sr)},agentModeEnabled:st.agentMode??!1}),Gi=ge(T=>T.chatLog),No=ge(T=>T.chatAttachments),Mo=ge(T=>T.setChatAttachments),hn=ge(T=>T.isLoading),wr=ge(T=>T.streamStatus),ba=ge(T=>T.streamingText),eo=ge(T=>T.streamingChanges),ya=ge(T=>T.streamSteps),Ol=ge(T=>T.streamTokenCount),Do=ge(T=>T.latestStreamFocusBlockId),Gn=ge(T=>T.imageProgress),xa=ge(T=>T.plannerBadgeState),Zi=ge(T=>T.setPlannerBadgeState),va=ge(T=>T.pendingPlanId),Qe=ge(T=>T.variationModal),mt=ge(T=>T.isApplyingVariation),ke=ge(T=>T.setVariationModal),Gt=ge(T=>T.continuationChainId),Cr=ge(T=>T.fieldDraftDebugEnabled),Ls=ge(T=>T.setFieldDraftDebugEnabled),Er=ge(T=>T.fieldDraftDebug);E.useEffect(()=>{r1e.has(r)||(k("balanced"),Fe.clearChat())},[r]);async function Ti(T){var Y,ye;gt(!0);try{const Me=await(await fetch(`${Ve}/history/restore`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,targetVersion:T})})).json();Me.status==="applied"&&(typeof Me.navigateToSlug=="string"&&Me.navigateToSlug.length>0&&Me.navigateToSlug!==h&&p(Me.navigateToSlug),typeof Me.canUndo=="boolean"&&((Y=Fe.setCanUndoServer)==null||Y.call(Fe,Me.canUndo)),typeof Me.canRedo=="boolean"&&((ye=Fe.setCanRedoServer)==null||ye.call(Fe,Me.canRedo)),Xt.postToSite("draftUpdated",{focusBlockId:null}),Ae())}catch{}finally{gt(!1)}}const We=wae(n,r,l,de),Je=Sae(n,r,hn,Fe.pushAssistantFromResult,l,()=>{Xt.postToSite("draftUpdated",{focusBlockId:null}),We.markPublished()}),Qn=We.summary?We.summary.total>0:!0,sn=Cae(),En=Ar==="properties"&&Fe.hasBootstrapped,vt=Tae(n,r,h,D,En),Ft=Aae(n,r,h,En);Sr.current=()=>{vt.refetch(),Ft.refetch(),Ae()};const[ni,pn]=E.useState(()=>Iv(h,{session:n,siteId:r,editorOrigin:d},l)),[Ro,Uu]=E.useState(!1);E.useEffect(()=>{Uu(!1)},[ni]),E.useEffect(()=>{zn.current!==l&&(zn.current=l,tn.current=!1);const T={session:n,siteId:r,editorOrigin:d};if(Pn.current){Pn.current=!1;return}if(fg&&tn.current){Xt.postToSite("navigate",{href:jv(h,T)});return}const Y=Iv(h,T,l);pn(ye=>ye===Y?ye:Y)},[l,d,n,r,h]);const _n=E.useMemo(()=>{var ye;const T=(ye=o.vercelProductionUrl)==null?void 0:ye.trim(),Y=T&&/^https?:\/\//i.test(T)?T:l;try{const Ne=new URL(Y);return Ne.origin===l?aq(h,{},l):(Ne.pathname=h==="/"?"/":h,Ne.search="",Ne.hash="",Ne.toString())}catch{return}},[o.vercelProductionUrl,l,h]),hi=E.useMemo(()=>l?`${l}${jv(h,{session:n,siteId:r,editorOrigin:d,immersive:"1"})}`:void 0,[l,d,n,r,h]);E.useEffect(()=>{let T=!0;const Y=async()=>{const Ne=[`${Ve}/status/planner`];Ve.includes("localhost")&&Ne.push(`${Ve.replace("localhost","127.0.0.1")}/status/planner`);try{for(const Me of Ne){const we=await fetch(Me);if(!we.ok)continue;const et=await we.json();if(!T)return;if(et.features&&lt(et.features),Array.isArray(et.availableProviders)&&et.availableProviders.length>0&&(A(et.availableProviders),et.availableProviders.includes(S)||C(et.availableProviders[0])),et.plannerSource==="openai"||et.plannerSource==="anthropic"||et.plannerSource==="gemini"||et.plannerSource==="demo"){Zi(et.plannerSource);return}}T&&Zi("error")}catch{T&&Zi("error")}};Y();const ye=window.setInterval(()=>{Y()},1e4);return()=>{T=!1,window.clearInterval(ye)}},[]);const Bs=E.useRef(0),ka=E.useRef(0);E.useEffect(()=>{const T=Fr.current;if(!T)return;const Y=()=>{const ye=Math.abs(T.scrollHeight-T.scrollTop-T.clientHeight)<2||T.scrollHeight<=T.clientHeight;!ye&&T.scrollTop<Bs.current?kr.current=!1:ye&&(kr.current=!0),Bs.current=T.scrollTop};return T.addEventListener("scroll",Y,{passive:!0}),()=>{T.removeEventListener("scroll",Y)}},[]),E.useEffect(()=>{const T=Fr.current;if(!T||!(Gi.length>0||!!wr||!!ba))return;const ye=Gi.reduce((Nt,on)=>on.role==="user"?Nt+1:Nt,0);ye>ka.current&&(kr.current=!0),ka.current=ye;const Ne=!Nr.current,Me=Gi.some(Nt=>Nt.role==="user");if(Ne&&!Me&&!wr&&!ba){Nr.current=!0,kr.current=!1;return}if(!Ne&&!kr.current)return;const et=window.requestAnimationFrame(()=>{T.scrollTop=T.scrollHeight,kr.current=!0,Nr.current=!0});return()=>window.cancelAnimationFrame(et)},[Gi.length,wr,ba,ya.length,eo.length]),E.useEffect(()=>{Xt.postToSite("setNestedLabelsVisibility",{visible:W})},[W]),E.useEffect(()=>{const T=Vi.current;if(!hn){ti.current&&T("aiFieldLoading",{blockId:"",active:!1}),Qs.current=null,ti.current=!1;return}const Y=Do??D??"",Ne=Y&&Y===(D??"")?I??"":"";T("aiFieldLoading",{blockId:Y,editablePath:Ne,active:!0}),Qs.current={blockId:Y,editablePath:Ne},ti.current=!0},[hn,Do,D,I]),E.useEffect(()=>{if(!hn)return;const T=window.setInterval(()=>{const Y=Qs.current;Y&&Vi.current("aiFieldLoading",{blockId:Y.blockId,editablePath:Y.editablePath,active:!0})},1200);return()=>window.clearInterval(T)},[hn]),E.useEffect(()=>{D&&Xt.postToSite("highlightBlock",{blockId:D,editablePath:I??null})},[D,I]),E.useEffect(()=>{Fe.clearFieldAiContext()},[D]),E.useEffect(()=>{D||It(null)},[D]),E.useEffect(()=>{zr(!1)},[$e]),E.useEffect(()=>{const T=()=>It(null);return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const Sb=dB(),to=E.useMemo(()=>{if(!Sb||!$e||!Le||!D||typeof window>"u"||window.innerWidth<=1040)return null;const T=Xt.iframeRef.current;if(!T)return null;const Y=T.getBoundingClientRect(),ye=380,Ne=36,Me=26,we=8,et=Y.top+$e.top*fi;if(et+$e.height*fi<Y.top||et>Y.bottom)return null;const on=et+we-(Ne-Me)/2;let Tn=Y.left+($e.left+$e.width)*fi-Ne-we;return Tn=Math.max(Y.left+we,Math.min(Tn,Y.right-Ne-we)),{top:on,left:Tn,width:ye}},[$e,Le,D,Xt.iframeRef,fi]);E.useEffect(()=>{to&&At&&requestAnimationFrame(()=>{var T,Y;(Y=(T=Ao.current)==null?void 0:T.querySelector("textarea"))==null||Y.focus()})},[!!to,At]);const Cd=E.useCallback((T,Y,ye,Ne)=>{var on;if(!D||!j)return;const we=((on=au()[j])==null?void 0:on.displayName)??j;V(T);const et=ck(ye,Y,j,Ne),Nt={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${we} → ${Y}`,fieldAiContext:{blockId:D,blockType:j,fieldPath:T,fieldLabel:Y,blockDisplayName:we},suggestions:et};Fe.setFieldAiContext(Nt)},[D,j]),zl=E.useCallback((T,Y,ye)=>{const Ne=ck(Y,T,"Page",ye),Me={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"},suggestions:Ne};Fe.setFieldAiContext(Me)},[]),Hu=E.useCallback((T,Y,ye,Ne,Me)=>{var on;if(!D||!j)return;const et=((on=au()[j])==null?void 0:on.displayName)??j;V(T),Xt.postToSite("aiFieldLoading",{blockId:D,editablePath:T,active:!0}),Qs.current={blockId:D,editablePath:T},ti.current=!0;const Nt={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: ${et} → ${Y}`,fieldAiContext:{blockId:D,blockType:j,fieldPath:T,fieldLabel:Y,blockDisplayName:et}};Fe.setFieldAiContext(Nt),Fe.submitChat(Me)},[D,j]),Yh=E.useCallback((T,Y,ye,Ne)=>{V(T);const Me={id:`field-ai-${Date.now()}`,role:"assistant",text:`Editing: Page → ${T}`,fieldAiContext:{blockId:"__page__",blockType:"__page__",fieldPath:T,fieldLabel:T,blockDisplayName:"Page"}};Fe.setFieldAiContext(Me),Fe.submitChat(Ne)},[]);E.useEffect(()=>{Fe.refreshRouteSlugs()},[n,r]);const Ed=T=>{const ye=Ui.current,Ne=Fr.current;if(!ye||!Ne)return Math.max(56,T);const Me=120,we=10,et=Ne.offsetTop,Nt=Math.max(56,ye.clientHeight-et-we-Me);return Math.min(Nt,Math.max(56,T))},wb=E.useCallback(T=>{ze(Y=>{const ye=Ed(T);return ye===Y?Y:ye})},[]);E.useEffect(()=>{const T=ye=>{const Ne=qn.current;if(Ne){const we=ye.clientY-Ne.y,et=Ed(Ne.composerHeight-we);ze(et)}const Me=Ci.current;if(Me){const we=ye.clientX-Me.x;Me.target==="chat"?$r(gv(Me.width+we)):Ur(bv(Me.width-we))}},Y=()=>{const ye=!!Ci.current;qn.current=null,Ci.current=null,document.body.style.userSelect="",ye&&document.body.classList.remove("panel-resizing")};return window.addEventListener("pointermove",T),window.addEventListener("pointerup",Y),()=>{window.removeEventListener("pointermove",T),window.removeEventListener("pointerup",Y),document.body.style.userSelect="",document.body.classList.remove("panel-resizing")}},[]),E.useEffect(()=>{const T=()=>{ze(Y=>Ed(Y)),$r(Y=>Y&&gv(Y)),Ur(Y=>Y&&bv(Y))};return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[$r,Ur]),E.useEffect(()=>{if(!Qe)return;const T=Y=>{Y.key==="Escape"&&!mt&&ke(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Qe,mt]),E.useEffect(()=>{Qe!=null&&Qe.options.length?Ue(Qe.options[0].id):Ue(null)},[Qe]),E.useEffect(()=>{Be||it("")},[Be]),E.useEffect(()=>{if(!Be)return;const T=Y=>{Y.key==="Escape"&&!qe&&Ze(null)};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[Be,qe]);const _d=wr?/failed|error/i.test(wr):!1,[Vu,Jh]=E.useState(0),Cb=Gn==null?void 0:Gn.stage;E.useEffect(()=>{if(Jh(0),!hn)return;const T=window.setInterval(()=>Jh(Y=>Y+1),1e3);return()=>window.clearInterval(T)},[hn,wr,Cb]);const Xh=hn&&!_d&&Vu>=5?` · ${Vu}s`:"",Eb=(Gn?Gn.stage:wr??(Ol>0?t("stream.shapingUpdate"):t("stream.gettingReady")))+Xh,Qh=(Gn?Gn.stage:wr??(Ol>0?t("stream.updating"):t("stream.thinking")))+Xh,ps=(wr==null?void 0:wr.match(/reconnecting(?:\s+agent\s+stream)?(?:\s+\((\d+)\/(\d+)\))?/i))??null,ep=ps!=null&&ps[1]?Number(ps[1]):null,tp=ps!=null&&ps[2]?Number(ps[2]):null,qu=ps?ep&&tp?`Reconnect ${ep}/${tp}`:"Reconnecting":null,np=`field_draft ${Er.eventsPerSecond}/s · chars ${Er.charsPerSecond}/s · lag ${Er.typingLagChars}`,Td={"--composer-height":`${je}px`},Io=Ar==="properties",Pl=Ar==="history",rp=E.useCallback(()=>{G(void 0),L(void 0),Ee("chat")},[]);E.useLayoutEffect(()=>{const T=di.current,Y=Xt.iframeRef.current;if(!T||!Y)return;const ye=we=>{var ms;if(we?Y.classList.remove("preview-iframe-no-transition"):Y.classList.add("preview-iframe-no-transition"),!Io){Y.style.removeProperty("width"),Y.style.removeProperty("height"),Y.style.removeProperty("transform"),Dn(Wi=>Wi===1?Wi:1);return}const et=T.offsetWidth,Nt=((ms=ci.current)==null?void 0:ms.offsetWidth)??0;if(et<=0||Nt<=0)return;const on=et+Nt,Tn=et/on;Y.style.width=`${on}px`,Y.style.height=`${100/Tn}%`,Y.style.transform=`scale(${Tn})`,Dn(Wi=>Math.abs(Wi-Tn)<5e-4?Wi:Tn)};ye(!0);const Ne=new ResizeObserver(()=>ye(!1)),Me=window.setTimeout(()=>{Ne.observe(T);const we=ci.current;we&&Ne.observe(we)},240);return()=>{window.clearTimeout(Me),Y.classList.remove("preview-iframe-no-transition"),Ne.disconnect()}},[Io,Xt.iframeRef]);const ip={...ei?{"--chat-width":`${ei}px`}:{},...Ei?{"--props-width":`${Ei}px`}:{}},sp=Gi.some(T=>T.role==="user"),op=E.useCallback(T=>{const Y=[];T.text&&Y.push(T.text),T.status&&!T.canUndo&&T.status!=="needs_clarification"&&T.status!=="plan_ready"&&Y.push(`status: ${T.status}`);const ye=(T.changes??[]).filter(Ne=>!E6(T.text,Ne));if(ye.length>0&&Y.push(`changes: ${ye.join(`
697
697
  `)}`),(T.errors??[]).length>0&&Y.push(`errors: ${(T.errors??[]).join(`
698
698
  `)}`),T.debug){if(Y.push(""),Y.push("Debug"),T.debug.traceId&&Y.push(`traceId: ${T.debug.traceId}`),T.debug.promptHash&&Y.push(`promptHash: ${T.debug.promptHash}`),T.debug.outcome&&Y.push(`outcome: ${T.debug.outcome}`),T.debug.reasonCategory&&Y.push(`reason: ${T.debug.reasonCategory}`),T.debug.reason&&T.debug.reason!==T.debug.reasonCategory&&Y.push(`reasonDetail: ${T.debug.reason}`),T.debug.intent&&Y.push(`intent: ${T.debug.intent}`),T.debug.plannerTier&&Y.push(`plannerTier: ${T.debug.plannerTier}`),T.debug.modelUsed&&Y.push(`model: ${T.debug.modelUsed}${T.debug.plannerSource?` (${T.debug.plannerSource})`:""}`),typeof T.debug.planningAttempts=="number"&&T.debug.planningAttempts>1&&Y.push(`planningAttempts: ${T.debug.planningAttempts}`),typeof T.debug.opCount=="number"&&Y.push(`opCount: ${T.debug.opCount}`),Array.isArray(T.debug.skippedOps)&&T.debug.skippedOps.length>0){const Me=T.debug.skippedOps.map(we=>`[${we.index}] ${we.op} ${we.pageSlug??""}${we.blockId?"#"+we.blockId:""}: ${we.reason}`).join(", ");Y.push(`skippedOps: ${Me}`)}else typeof T.debug.skippedOpCount=="number"&&T.debug.skippedOpCount>0&&Y.push(`skippedOps: ${T.debug.skippedOpCount}`);if(Array.isArray(T.debug.opTypes)&&T.debug.opTypes.length>0&&Y.push(`ops: ${T.debug.opTypes.join(", ")}`),typeof T.debug.totalTokens=="number"&&Y.push(`tokens: in:${T.debug.inputTokens??"?"} out:${T.debug.outputTokens??"?"} total:${T.debug.totalTokens}`),typeof T.debug.estimatedUsd=="number"&&Y.push(`cost: $${T.debug.estimatedUsd.toFixed(4)}`),Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0){const Me=T.debug.timeline.map(we=>`${we.stage}:${we.atMs}ms`).join(" -> ");Y.push(`timeline: ${Me}`)}T.debug.promptExcerpt&&Y.push(`prompt: ${T.debug.promptExcerpt}`);const Ne=[];T.debug.currentPage&&Ne.push(`page: ${T.debug.currentPage}`),T.debug.siteId&&Ne.push(`site: ${T.debug.siteId}`),T.debug.activeBlockId&&Ne.push(`block: ${T.debug.activeBlockId}`),T.debug.activeEditablePath&&Ne.push(`path: ${T.debug.activeEditablePath}`),Ne.length>0&&Y.push(`context: ${Ne.join(", ")}`)}return Y.join(`
699
699
  `)},[]),_b=E.useCallback(async T=>{const Y=op(T);if(Y.trim())try{await navigator.clipboard.writeText(Y),Yn(T.id),window.setTimeout(()=>{ge.getState().copiedDebugEntryId===T.id&&Yn(null)},1400)}catch{}},[op]),Tb=E.useCallback(T=>{var ye;if(!T.debug)return t("chat.expandDetails");const Y=[];if(T.debug.outcome&&Y.push(T.debug.outcome.replace(/_/g," ")),typeof T.debug.opCount=="number"){const Ne=T.debug.opCount;Y.push(`${Ne} op${Ne===1?"":"s"}`)}if(T.debug.intent&&Y.push(`intent: ${T.debug.intent.replace(/_/g," ")}`),T.debug.plannerTier&&Y.push(T.debug.plannerTier.replace(/_/g," ")),Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0){const Ne=(ye=T.debug.timeline[T.debug.timeline.length-1])==null?void 0:ye.atMs;typeof Ne=="number"&&Y.push(`${Ne}ms`)}return Y.join(" · ")||t("chat.expandDetails")},[t]),ap=m.jsxs("div",{className:"chat-header-slug-actions",children:[m.jsx("button",{type:"button",className:`chat-header-icon-btn${Io?" is-active":""}`,"aria-label":t("tabs.properties"),title:t("tabs.properties"),"aria-pressed":Io,onClick:()=>{Io?rp():(G(void 0),L(void 0),Ee("properties"))},children:m.jsx(_9,{size:14,"aria-hidden":"true"})}),m.jsx("button",{type:"button",className:`chat-header-icon-btn${Pl?" is-active":""}`,"aria-label":t("history.tooltip"),title:t("history.tooltip"),"aria-pressed":Pl,onClick:()=>Ee(Pl?"chat":"history"),children:m.jsx(wL,{size:14,"aria-hidden":"true"})}),hi?m.jsx("a",{className:"chat-header-icon-btn",href:hi,target:"_blank",rel:"noreferrer","aria-label":t("header.openImmersive"),title:t("header.openImmersive"),children:m.jsx(PL,{size:14,"aria-hidden":"true"})}):null,$?m.jsx("button",{type:"button",className:"chat-header-icon-btn","aria-label":t("header.moreOptions"),onClick:()=>Oe(!0),children:m.jsx(AL,{size:14,"aria-hidden":"true"})}):null]});return m.jsxs("div",{className:`layout${Io?" layout--props-open":""}${e.siteHosting==="notHosted"?" layout--banner":""}`,style:ip,children:[e.siteHosting==="notHosted"?m.jsx(Fye,{siteId:r,orchestratorUrl:Ve,hostedIds:e.hostedSiteIds??[]}):null,m.jsxs("aside",{className:"chat-panel",ref:Ui,style:Td,children:[m.jsxs("header",{className:"chat-header",children:[m.jsxs("div",{className:"chat-header-top",children:[m.jsxs("div",{className:"chat-header-site-name",ref:zt,children:[e.siteList.length>1?m.jsxs("button",{type:"button",className:`site-switcher-trigger${Et?" is-open":""}`,onClick:()=>Ot(T=>!T),"aria-expanded":Et,"aria-haspopup":"menu",children:[m.jsx("span",{className:`site-switcher-item-dot site-switcher-item-dot-${Br!=null&&Br.probing?"probing":Br!=null&&Br.online?"online":"offline"}`,"aria-hidden":"true"}),m.jsx("span",{className:"site-switcher-trigger-label",children:o.name}),m.jsx(hd,{size:12,className:`site-switcher-chevron${Et?" is-open":""}`,"aria-hidden":"true"})]}):m.jsx("span",{className:"site-switcher-trigger-label",children:o.name}),Et&&m.jsxs("div",{className:"site-switcher-dropdown",role:"menu","aria-label":t("header.allSites"),children:[m.jsxs("div",{className:"site-switcher-header",children:[m.jsx("span",{children:t("header.allSites")}),m.jsxs("a",{href:"/sites",className:"site-switcher-add-link",onClick:()=>Ot(!1),children:["+ ",t("sites.addSite")]})]}),m.jsx("div",{className:"site-switcher-list",children:fs.map(T=>m.jsx(e1e,{name:T.site.name,origin:T.origin,statusClass:T.probing?"probing":"online",active:T.site.id===r,onSelect:()=>{T.site.id!==r&&e.openEditorForSite(T.site.id),Ot(!1)}},T.site.id))}),m.jsxs("div",{className:"site-switcher-actions",role:"group",children:[m.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",onClick:()=>{Ot(!1),e.setConfigSiteId(r)},children:[m.jsx(C9,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:t("header.siteSettings")})]}),Fe.siteHasCmsContent!==!1&&m.jsxs("button",{type:"button",role:"menuitem",className:"site-switcher-action",title:t("header.syncFromSiteTitle"),disabled:hn,onClick:async()=>{Ot(!1);const T=await Fe.syncFromSite();T.ok&&T.count>0?Fe.pushAssistantFromResult({status:"applied",summary:T.count===1?t("header.syncedPage"):t("header.syncedPages",{count:T.count}),changes:[]}):T.ok||Fe.pushAssistantFromResult({status:"error",summary:T.reason==="network"?t("header.syncFailedNetwork"):t("header.syncFailedEmpty"),changes:[]})},children:[m.jsx(nD,{size:14,"aria-hidden":"true"}),m.jsx("span",{children:t("header.syncFromSite")})]})]}),m.jsxs("a",{href:"/sites",className:"site-switcher-footer",onClick:()=>Ot(!1),children:[t("header.viewAllSites"),m.jsx(R_,{size:11,"aria-hidden":"true"})]})]})]}),m.jsxs("div",{className:"chat-header-right",children:[c.status==="degraded"?m.jsx("span",{className:"planner-badge",title:c.reason??"Components unavailable",children:t("header.limited")}):null,xa==="demo"?m.jsx("span",{className:"planner-badge planner-badge-demo",children:t("header.demoMode")}):null,Qn||Je.publishInProgress?m.jsxs("button",{type:"button",className:"publish-preview-btn",onClick:()=>se(!0),disabled:hn||Je.isPublishing,title:We.summary&&We.summary.total>0?t("header.unpublishedTooltip",{count:String(We.summary.total)}):void 0,children:[Je.publishInProgress?m.jsx("span",{className:"publish-spinner","aria-hidden":"true"}):null,Je.publishInProgress?t("header.publishing"):t("header.publish"),We.summary&&We.summary.total>0?m.jsx("span",{className:"publish-preview-badge","aria-hidden":"true",children:We.summary.total}):null]}):null,Je.publishStatus?m.jsxs(m.Fragment,{children:[Je.publishStatus.inspectUrl?m.jsx("a",{className:"publish-view-link",href:Je.publishStatus.inspectUrl,target:"_blank",rel:"noreferrer",children:t("header.viewDeploy")}):null,_n?m.jsx("a",{className:"live-site-icon-btn",href:_n,target:"_blank",rel:"noreferrer","aria-label":t("header.openLiveSite"),title:t("header.openLiveSite"),children:m.jsx(R_,{size:16,"aria-hidden":"true"})}):null]}):null]})]}),Jn&&_i?m.jsxs("div",{className:"chat-header-lang-row",children:[m.jsx("label",{className:"chat-header-lang",children:m.jsx("select",{value:_i,"aria-label":t("header.language"),title:t("header.language"),onChange:T=>p(Wye(h,T.target.value,Jn)),disabled:y,children:Jn.locales.map(T=>m.jsx("option",{value:T,children:Kye(T)},T))})}),ap]}):null,m.jsxs("div",{className:"chat-header-slug-row",children:[m.jsx("label",{className:"chat-header-slug",children:m.jsx("select",{value:h,"aria-label":t("header.page"),onChange:T=>p(T.target.value||"/"),disabled:y,children:Jn&&_i?m.jsxs(m.Fragment,{children:[$u.map(T=>m.jsx("option",{value:T,children:Zye(T,_i)},T)),Jn.shared.length>0?m.jsx("optgroup",{label:t("header.pagesWithoutLanguage"),children:Jn.shared.map(T=>m.jsx("option",{value:T,children:V1(T)},T))}):null]}):Hi.map(T=>m.jsx("option",{value:T,children:V1(T)},T))})}),Jn&&_i?null:ap]})]}),m.jsxs("div",{className:"chat-thread-region",children:[null,m.jsx(VM,{fallbackLabel:"Chat unavailable — try refreshing",onReset:()=>window.location.reload(),children:m.jsx(lq,{ref:Fr,className:"chat-thread",streamStatusLabel:Qh,undoInFlightEntryId:Fe.undoInFlightEntryId,onSuggestionClick:T=>void Fe.submitChat(T),onUndo:T=>void Fe.applyUndoHistory(T),undoLabel:t("chat.undo"),undoneLabel:t("chat.undone"),appliedDraftLabel:t("chat.appliedDraft"),keepLabel:t("chat.keep"),revertLabel:t("chat.revert"),revertedLabel:t("chat.reverted"),keptLabel:t("chat.kept"),renderEntryExtras:T=>{var Y,ye,Ne,Me;return m.jsxs(m.Fragment,{children:[T.variations&&Array.isArray(T.variations.options)&&T.variations.options.length>0?m.jsx("div",{className:"msg-variations",children:T.variations.options.map((we,et)=>m.jsxs("button",{type:"button",className:"msg-variation-card",disabled:hn,onClick:async()=>{const Nt=T.variations;try{(await fetch(`${Ve}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_props",pageSlug:Nt.pageSlug,blockId:Nt.blockId,patch:we.patch}]})})).ok&&(Xt.postToSite("draftUpdated",{focusBlockId:Nt.blockId}),Ae(),Fe.pushAssistantFromResult({status:"applied",summary:`Applied variation: ${we.title}`,changes:[we.summary]}))}catch{}},children:[m.jsx("div",{className:"msg-variation-preview-wrap",children:m.jsx(c3,{block:{id:T.variations.blockId,type:T.variations.blockType,props:{...T.variations.baseProps,...we.patch}},virtualWidth:1280})}),m.jsxs("div",{className:"msg-variation-meta",children:[m.jsx("span",{className:"msg-variation-badge",children:String.fromCharCode(65+et)}),m.jsxs("div",{className:"msg-variation-content",children:[m.jsx("span",{className:"msg-variation-title",children:we.title}),m.jsx("span",{className:"msg-variation-summary",children:we.summary})]})]})]},we.id??`${T.id}-v-${et}`))}):null,T.status==="plan_ready"&&T.pendingPlanId?m.jsxs("div",{className:"msg-plan-actions",children:[T.planPreview?m.jsx(cre,{preview:T.planPreview}):null,T.destructiveReasons&&T.destructiveReasons.length>0?m.jsx("div",{className:"msg-destructive-warning",role:"alert",children:T.destructiveReasons.map((we,et)=>m.jsxs("div",{className:"msg-destructive-warning-line",children:["⚠ ",we]},et))}):null,(()=>{var ms;const we=T.pendingPlanId,et=hn||va!==we,Nt=!!(T.destructiveReasons&&T.destructiveReasons.length>0),on=((ms=T.planPreview)==null?void 0:ms.diff.pages.filter(Wi=>Wi.status==="removed").length)??0,Tn=on===1?t("plan.deletePage"):on>1?t("plan.deletePages",{count:on}):t(Nt?"plan.applyDestructive":"plan.apply");return m.jsxs("div",{className:"msg-plan-btn-row",children:[m.jsx("button",{type:"button",className:`primary-btn msg-plan-btn${Nt?" is-destructive":""}`,onClick:()=>void Fe.approvePendingPlan(we),disabled:et,children:Tn}),m.jsx("button",{type:"button",className:"secondary-btn msg-plan-btn",onClick:()=>void Fe.stopPendingPlan(we),disabled:et,children:t("plan.discard")})]})})()]}):null,T.imageSwap?(()=>{const we=T.imageSwap,et=/^image$/i.test((we.fieldLabel??"").trim()),Nt=we.fieldLabel&&!(we.blockDisplayName&&et),on=we.blockDisplayName??(Nt?we.fieldLabel:null),Tn=we.blockDisplayName&&Nt?we.fieldLabel:null;return m.jsxs("button",{type:"button",className:"msg-image-swap-card",onClick:()=>{oe({slug:we.slug,blockId:we.blockId,editablePath:we.editablePath,currentUrl:we.imageUrl,blockType:D===we.blockId?j:void 0})},title:t("ops.imageSwap.pickAnother"),children:[m.jsx("img",{src:we.imageUrl,alt:we.altText??""}),m.jsxs("div",{className:"msg-image-swap-meta",children:[on?m.jsx("span",{className:"msg-image-swap-block",children:on}):null,Tn?m.jsx("span",{className:"msg-image-swap-field",children:Tn}):null,m.jsx("span",{className:"msg-image-swap-action",children:t("ops.imageSwap.pickAnother")})]})]})})():null,T.continuation?m.jsx("div",{className:"msg-plan-actions",children:m.jsxs("button",{type:"button",className:"primary-btn msg-plan-btn",onClick:()=>void Fe.continueChain(T.continuation.chainId),disabled:hn||Gt!==T.continuation.chainId,children:["Continue: ",T.continuation.nextStepLabel," (",T.continuation.currentStep," of ",T.continuation.totalSteps,")"]})}):null,(()=>{if(T.wasUndone)return null;const we=(T.mentionedSlugs??[]).filter(et=>et!==h);return we.length===0?null:m.jsx("div",{className:"msg-suggestions msg-page-links",children:we.map((et,Nt)=>m.jsxs("button",{type:"button",className:"msg-suggestion msg-page-link",onClick:()=>{p(et)},disabled:hn,children:["Open ",et]},`${T.id}-route-${Nt}`))})})(),(T.errors??[]).length>0?m.jsx("ul",{className:"msg-errors",children:(Y=T.errors)==null?void 0:Y.map((we,et)=>m.jsx("li",{children:we},et))}):null,re&&T.role==="assistant"&&T.debug?m.jsxs("div",{className:"msg-debug-shell",children:[m.jsxs("details",{className:"msg-debug-details",children:[m.jsxs("summary",{className:"msg-debug-summary",children:[m.jsxs("span",{className:"msg-debug-summary-left",children:[m.jsx("span",{className:"msg-debug-title",children:"Debug"}),m.jsx("span",{className:"msg-debug-summary-text",children:Tb(T)})]}),m.jsx("span",{className:"msg-debug-chevron","aria-hidden":"true"})]}),m.jsx("div",{className:"msg-debug",children:m.jsxs("ul",{children:[T.debug.traceId?m.jsxs("li",{children:["traceId: ",T.debug.traceId]}):null,T.debug.promptHash?m.jsxs("li",{children:["promptHash: ",T.debug.promptHash]}):null,T.debug.outcome?m.jsxs("li",{children:["outcome: ",T.debug.outcome]}):null,T.debug.reasonCategory?m.jsxs("li",{children:["reason: ",T.debug.reasonCategory]}):null,T.debug.reason&&T.debug.reason!==T.debug.reasonCategory?m.jsxs("li",{children:["reasonDetail: ",T.debug.reason]}):null,T.debug.intent?m.jsxs("li",{children:["intent: ",T.debug.intent]}):null,T.debug.plannerTier?m.jsxs("li",{children:["plannerTier: ",T.debug.plannerTier]}):null,T.debug.modelUsed?m.jsxs("li",{children:["model: ",T.debug.modelUsed,T.debug.plannerSource?` (${T.debug.plannerSource})`:""]}):null,typeof T.debug.planningAttempts=="number"&&T.debug.planningAttempts>1?m.jsxs("li",{children:["planningAttempts: ",T.debug.planningAttempts]}):null,typeof T.debug.opCount=="number"?m.jsxs("li",{children:["opCount: ",T.debug.opCount]}):null,Array.isArray(T.debug.skippedOps)&&T.debug.skippedOps.length>0?m.jsxs("li",{children:["skippedOps: ",T.debug.skippedOps.map(we=>`[${we.index}] ${we.op} ${we.pageSlug??""}${we.blockId?"#"+we.blockId:""}: ${we.reason}`).join(", ")]}):typeof T.debug.skippedOpCount=="number"&&T.debug.skippedOpCount>0?m.jsxs("li",{children:["skippedOps: ",T.debug.skippedOpCount]}):null,Array.isArray(T.debug.opTypes)&&T.debug.opTypes.length>0?m.jsxs("li",{children:["ops: ",T.debug.opTypes.join(", ")]}):null,typeof T.debug.totalTokens=="number"?m.jsxs("li",{children:["tokens: in:",T.debug.inputTokens??"?"," out:",T.debug.outputTokens??"?"," total:",T.debug.totalTokens]}):null,typeof T.debug.estimatedUsd=="number"?m.jsxs("li",{children:["cost: $",T.debug.estimatedUsd.toFixed(4)]}):null,Array.isArray(T.debug.timeline)&&T.debug.timeline.length>0?m.jsxs("li",{children:["timeline: ",T.debug.timeline.map(we=>`${we.stage}:${we.atMs}ms`).join(" -> ")]}):null,T.debug.promptExcerpt?m.jsxs("li",{children:["prompt: ",T.debug.promptExcerpt]}):null,T.debug.currentPage||T.debug.siteId||T.debug.activeBlockId||T.debug.activeEditablePath?m.jsxs("li",{children:["context: ",[T.debug.currentPage?`page: ${T.debug.currentPage}`:null,T.debug.siteId?`site: ${T.debug.siteId}`:null,T.debug.activeBlockId?`block: ${T.debug.activeBlockId}`:null,T.debug.activeEditablePath?`path: ${T.debug.activeEditablePath}`:null].filter(Boolean).join(", ")]}):null]})})]}),m.jsx("button",{type:"button",className:"msg-debug-copy-btn",onClick:()=>void _b(T),"aria-label":Kn===T.id?t("chat.copied"):t("chat.copyDebug"),title:Kn===T.id?t("chat.copied"):t("chat.copy"),children:Kn===T.id?m.jsx(Dh,{"aria-hidden":"true",size:14}):m.jsx(tD,{"aria-hidden":"true",size:14})})]}):null,T.role==="assistant"&&((ye=T.debug)!=null&&ye.traceId)&&T.id!=="welcome"?m.jsxs("div",{className:"msg-feedback-row",children:[m.jsx("button",{type:"button",className:`msg-feedback-btn ${((Ne=T.feedback)==null?void 0:Ne.rating)==="up"?"msg-feedback-btn--active":""}`,onClick:()=>{T.feedback||Fe.submitFeedback(T.id,"up")},disabled:!!T.feedback,title:t("chat.goodResponse"),children:m.jsx(j9,{"aria-hidden":"true",size:13})}),m.jsx("button",{type:"button",className:`msg-feedback-btn ${((Me=T.feedback)==null?void 0:Me.rating)==="down"?"msg-feedback-btn--active":""}`,onClick:()=>{T.feedback||(xt(St===T.id?null:T.id),fe(""))},disabled:!!T.feedback,title:t("chat.badResponse"),children:m.jsx(R9,{"aria-hidden":"true",size:13})}),T.feedback?m.jsxs("span",{className:"msg-feedback-label",children:[T.feedback.rating==="up"?t("chat.feedbackThanks"):t("chat.feedbackNoted"),T.feedback.note?` — "${T.feedback.note}"`:""]}):null,St===T.id&&!T.feedback?m.jsxs("form",{className:"msg-feedback-note-form",onSubmit:we=>{we.preventDefault(),Fe.submitFeedback(T.id,"down",Cn||void 0),xt(null),fe("")},children:[m.jsx("input",{className:"msg-feedback-note-input",placeholder:t("chat.feedbackPlaceholder"),value:Cn,onChange:we=>fe(we.target.value),autoFocus:!0}),m.jsx("button",{type:"submit",className:"msg-feedback-note-submit",children:t("chat.feedbackSend")})]}):null]}):null]})},renderStreamingExtras:()=>m.jsxs(m.Fragment,{children:[qu?m.jsx("span",{className:"stream-reconnect-badge stream-reconnect-badge-inline",title:wr??void 0,children:qu}):null,re&&Cr?m.jsx("div",{className:"streaming-debug-inline",children:np}):null]}),renderStreamStatusFallback:()=>m.jsxs("div",{className:`streaming-pill ${_d?"is-error":"is-active"} ${qM==="text"?"is-text":"is-legacy"}`,children:[qM==="text"?m.jsx("span",{className:"streaming-pill-status streaming-pill-status-text",children:Qh}):m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"streaming-pill-title",children:m.jsx("span",{className:"streaming-pill-sparkle",children:"✦"})}),m.jsx("span",{className:"streaming-pill-status",children:Eb}),_d?null:m.jsxs("span",{className:"streaming-dots","aria-hidden":"true",children:[m.jsx("i",{}),m.jsx("i",{}),m.jsx("i",{})]})]}),qu?m.jsx("span",{className:"stream-reconnect-badge",title:wr??void 0,children:qu}):null,Gn?m.jsx("div",{className:"image-gen-progress",children:m.jsx("div",{className:"image-gen-progress-fill",style:{width:`${Gn.percent}%`}})}):null,Do?m.jsx("button",{type:"button",className:"streaming-jump-btn",onClick:()=>Xt.postToSite("highlightBlock",{blockId:Do,editablePath:null,scrollIntoView:!0}),children:"Jump to latest change"}):null,re&&Cr?m.jsx("div",{className:"streaming-debug-inline",children:np}):null]})})})]}),m.jsx("div",{ref:ga,className:"composer-splitter",role:"separator","aria-orientation":"horizontal","aria-label":t("resize.inputPanel"),onPointerDown:T=>{qn.current={y:T.clientY,composerHeight:je},document.body.style.userSelect="none"}}),m.jsx(uq,{className:"composer",message:M,isLoading:hn,hasUserEntry:sp,onMessageChange:R,onSubmit:T=>{R(""),Fe.submitChat(T,M)},onTranscribeAudio:sn.transcribeAudio,onUploadAttachment:sn.uploadAttachment,attachments:No,onAttachmentsChange:Mo,onCancel:Fe.cancelChat,onAutoHeightChange:wb,selectionModeEnabled:Le,onToggleSelectionMode:()=>zs(),canUndoServer:Fe.canUndoServer,canRedoServer:Fe.canRedoServer,onGlobalUndo:()=>void Fe.applyGlobalUndo(),onGlobalRedo:()=>void Fe.applyGlobalRedo(),undoTooltip:t("chat.undoTooltip"),redoTooltip:t("chat.redoTooltip"),contextChip:D&&j?{label:t("chatInput.editingBlock",{block:((lp=au()[j])==null?void 0:lp.displayName)??j}),clearLabel:t("chatInput.clearSelection"),onClear:()=>{G(void 0),L(void 0)}}:null})]}),m.jsx("div",{className:"panel-splitter",role:"separator","aria-orientation":"vertical","aria-label":t("resize.chatPanel"),onPointerDown:T=>{const Y=Ui.current;Y&&(Ci.current={x:T.clientX,width:Y.offsetWidth,target:"chat"},document.body.style.userSelect="none",document.body.classList.add("panel-resizing"))}}),m.jsx("div",{className:"preview",children:m.jsxs("div",{className:"preview-canvas",ref:di,children:[Ro?null:m.jsx("div",{className:"preview-loading",role:"status","aria-label":t("preview.loading"),children:m.jsx("span",{className:"preview-loading-spinner","aria-hidden":"true"})}),m.jsx("iframe",{ref:Xt.iframeRef,title:t("preview.title"),src:ni,style:{colorScheme:"light dark"},onLoad:()=>{Uu(!0),fg&&!tn.current&&(tn.current=!0,zn.current=l),Xt.postToSite("setNestedLabelsVisibility",{visible:W})}})]})}),Io?m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"panel-splitter panel-splitter--props",role:"separator","aria-orientation":"vertical","aria-label":t("resize.chatPanel"),onPointerDown:T=>{const Y=ci.current;Y&&(Ci.current={x:T.clientX,width:Y.offsetWidth,target:"props"},document.body.style.userSelect="none",document.body.classList.add("panel-resizing"))}}),m.jsx("aside",{className:"props-panel",ref:ci,children:m.jsx(VM,{fallbackLabel:"Properties panel unavailable — try refreshing",children:m.jsx(Mye,{props:vt.props,status:vt.status,failure:vt.failure,failedSlug:vt.failedSlug,failedOrigin:vt.failedOrigin,onRetry:vt.retry,pageName:V1(h),onDeselectBlock:()=>{G(void 0),L(void 0)},onClose:rp,navLabel:((up=e.headerConfig.navLabels)==null?void 0:up[h])??"",onNavLabelChange:(T,Y)=>{e.updateHeaderConfig({navLabels:{[T]:Y}}),Xt.postToSite("draftUpdated",{}),Ae()},pageMeta:Ft.meta,onPageMetaChange:(T,Y)=>{const ye={...Ft.meta,[T]:Y};Ft.setMeta(ye),(async()=>{try{const Ne=await fetch(`${Ve}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({session:n,siteId:r,ops:[{op:"update_page_meta",pageSlug:h,patch:{[T]:Y}}]})}),Me=await Ne.json();if(!Ne.ok||Me.status!=="applied"){Ft.refetch();return}Xt.postToSite("draftUpdated",{}),Ae()}catch{Ft.refetch()}})()},onFieldChange:async(T,Y)=>{await Fe.inlineEditCommit(h,D,T,Y,{silent:!0}),vt.refetch()},onImageClick:(T,Y)=>{D&&oe({slug:h,blockId:D,editablePath:T,currentUrl:Y,blockType:j})},onAiAssist:Cd,onPageAiAssist:zl,onAiQuickAction:Hu,onPageAiQuickAction:Yh,onAddListItem:D&&j?T=>{Fe.addListItem(h,D,j,T).then(()=>vt.refetch())}:void 0,onRemoveListItem:D&&j?(T,Y)=>{Fe.removeListItem(h,D,j,T,Y).then(()=>vt.refetch())}:void 0,manifestByType:c.byType,siteOrigin:l})})})]}):null,Pl?m.jsx("div",{className:"history-drawer-backdrop",onClick:()=>Ee("chat"),children:m.jsx("aside",{className:"history-drawer",role:"dialog","aria-label":t("history.title"),onClick:T=>T.stopPropagation(),children:m.jsx(fq,{session:n,siteId:r,slug:h,visible:Pl,onRestore:Ti,isRestoring:Ye,onClose:()=>Ee("chat")})})}):null,to&&At?m.jsx("div",{ref:Ao,className:"composer--anchored is-expanded",style:{top:to.top,left:to.left,width:to.width},children:m.jsx(pD,{message:M,isLoading:hn,hasUserEntry:sp,onMessageChange:R,onSubmit:T=>{R(""),Fe.submitChat(T,M)},onTranscribeAudio:sn.transcribeAudio,onUploadAttachment:sn.uploadAttachment,attachments:No,onAttachmentsChange:Mo,onCancel:Fe.cancelChat,onAutoHeightChange:()=>{},compact:!0})}):null,Qe?(()=>{const T=Qe,Y=T.options.find(ye=>ye.id===pe)??null;return m.jsx("div",{className:"variation-modal-backdrop",onClick:()=>{mt||ke(null)},children:m.jsxs("div",{className:"variation-modal",role:"dialog","aria-modal":"true","aria-label":t("variation.title"),onClick:ye=>ye.stopPropagation(),children:[m.jsxs("div",{className:"variation-modal-header",children:[m.jsx("h2",{children:"Choose a Variation"}),m.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("variation.close"),onClick:()=>ke(null),disabled:mt,children:"×"})]}),m.jsx("div",{className:"variation-modal-body",children:T.options.map((ye,Ne)=>m.jsxs("article",{className:`variation-card${ye.id===pe?" is-selected":""}`,onClick:()=>Ue(ye.id),children:[m.jsxs("div",{className:"variation-card-preview-wrap",children:[m.jsx("span",{className:"variation-card-badge",children:String.fromCharCode(65+Ne)}),m.jsx(c3,{virtualWidth:nB.desktop,block:{id:T.blockId,type:T.blockType,props:fB(T.baseProps,ye.patch)}}),ye.imagePending?m.jsxs("div",{className:"variation-card-image-pending","aria-live":"polite",children:[m.jsx("span",{className:"variation-card-image-pending-spinner","aria-hidden":"true"}),m.jsx("span",{className:"variation-card-image-pending-label",children:"Generating image…"})]}):null]}),m.jsx("h3",{className:"variation-card-title",children:ye.title}),m.jsx("p",{className:"variation-card-summary",children:ye.summary})]},ye.id))}),m.jsx("div",{className:"variation-modal-footer",children:m.jsx("button",{type:"button",className:"publish-preview-btn variation-apply-btn",onClick:()=>{Y&&Fe.applyVariation(Y)},disabled:mt||!Y,children:mt?t("variation.applying"):t("variation.apply",{title:(Y==null?void 0:Y.title)??""})})})]})})})():null,Be?m.jsx("div",{className:"add-block-modal-backdrop",onClick:()=>{qe||Ze(null)},children:m.jsxs("div",{className:"add-block-modal",role:"dialog","aria-modal":"true","aria-label":t("addBlock.title"),onClick:T=>T.stopPropagation(),children:[m.jsxs("div",{className:"add-block-modal-header",children:[m.jsx("h2",{children:"Add block"}),m.jsx("p",{children:Be.beforeBlockId&&!Be.afterBlockId?t("addBlock.insertAbove"):t("addBlock.insertBelow")}),m.jsx("button",{type:"button",className:"settings-close-btn","aria-label":t("addBlock.close"),onClick:()=>Ze(null),disabled:qe,children:"×"})]}),m.jsxs("div",{className:"add-block-modal-body",children:[m.jsx("label",{className:"add-block-search",children:m.jsx("input",{type:"search",value:kt,onChange:T=>it(T.target.value),placeholder:t("addBlock.searchPlaceholder"),disabled:qe})}),hs.length===0?m.jsx("p",{className:"add-block-empty",children:"No block types match your search."}):m.jsx("div",{className:"add-block-flat-list",children:hs.flatMap(T=>T.options).map(T=>m.jsxs("button",{type:"button",className:"add-block-option",disabled:qe,onClick:async()=>{var Ne;if(!Be||qe)return;Wt(!0);const Y=(Ne=c.byType.get(T.type))==null?void 0:Ne.defaultProps,ye=await Fe.addBlockAfter(Be.slug,Be.afterBlockId,T.type,Be.beforeBlockId,Y);Wt(!1),ye&&Ze(null)},children:[m.jsx("span",{className:"add-block-option-label",children:T.label}),m.jsx("span",{className:"add-block-option-actions","aria-hidden":"true",children:m.jsx("span",{className:"add-block-option-plus",children:"+"})})]},T.type))})]})]})}):null,m.jsx(QK,{open:Te,onOpenChange:Oe,useStreaming:Z,onStreamingChange:K,showNestedLabels:W,onNestedLabelsChange:ee,chatDarkMode:i,onDarkModeChange:s,showDebugDetails:re,onDebugDetailsChange:X,fieldDraftDebugEnabled:Cr,onFieldDraftDebugChange:Ls,autoScrollTrackingEnabled:q,onAutoScrollTrackingChange:B,provider:S,modelKey:x,availableProviders:_,onModelChange:(T,Y)=>{C(T),k(Y)},onClearChat:Fe.clearChat,agentModeEnabled:st.agentMode??!1,showDevOptions:O,onShowDevOptionsChange:$?F:void 0}),m.jsx(bY,{open:te,onOpenChange:se,onConfirm:()=>void Je.publishSite(),chatLog:Gi,isPublishing:Je.isPublishing,session:n,siteId:r,siteOrigin:l}),m.jsx(HI,{sites:e,onPreviewRefresh:()=>{Xt.postToSite("draftUpdated",{}),Ae()}}),m.jsx(uae,{open:Pe,features:{...st,googleDrive:st.googleDrive||!!((cp=o.gdriveFolderId)!=null&&cp.trim())},currentUrl:nt==null?void 0:nt.currentUrl,gdriveFolderId:o.gdriveFolderId,cmsMedia:o.cmsMedia,siteOrigin:l,onClose:()=>oe(null),onSelect:(T,Y)=>{var Sa;if(!nt)return;const{slug:ye,blockId:Ne,editablePath:Me,currentUrl:we,blockType:et}=nt,Nt=yY(Me),on=Me.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/),Tn=Nt!==Me?Nt.match(/^([a-zA-Z_]+)\[(\d+)\]\.(.+)$/):null;let ms,Wi;if(on){const[,Vr,wa,Ll]=on,Nd={[Ll]:T};Tn&&(Nd[Tn[3]]=Y),ms=[{op:"update_item",pageSlug:ye,blockId:Ne,listKey:Vr,index:Number(wa),patch:Nd}],Wi=`${Vr}[${wa}].${Ll}`}else{const Vr={[Me]:T};Nt!==Me&&(Vr[Nt]=Y),ms=[{op:"update_props",pageSlug:ye,blockId:Ne,patch:Vr}],Wi=Me}const Ad=et??(Ne===D?j:void 0)??(Ne===D&&vt.blockType?vt.blockType:void 0),dp=Ad?((Sa=au()[Ad])==null?void 0:Sa.displayName)??Ad:void 0,Gu={imageUrl:T,previousUrl:we,altText:Y,slug:ye,blockId:Ne,editablePath:Me,blockDisplayName:dp,fieldLabel:i1e(Wi)};(async()=>{try{const Vr=await fetch(`${Ve}/ops`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(_s({session:n,siteId:r,ops:ms},c.manifest))}),wa=await Vr.json();Vr.ok&&wa.status==="applied"?(Xt.postToSite("draftUpdated",{focusBlockId:Ne}),Ae(),Fe.pushAssistantFromResult({status:"applied",summary:t("ops.changedImage")},{canUndo:!0,imageSwap:Gu}),vt.refetch()):(console.error("[ImagePicker] ops failed:",Vr.status,wa.error,wa.details??"","ops:",JSON.stringify(ms)),Fe.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...Gu,imageUrl:we??T}}))}catch(Vr){console.error("[ImagePicker] ops failed:",Vr),Fe.pushAssistantFromResult({status:"error",summary:t("ops.imageChangeFailed")},{imageSwap:{...Gu,imageUrl:we??T}})}})()}}),null]})}const KM=Ve;function o1e({children:e}){const{t}=yr(),[n,r]=E.useState(null),[i,s]=E.useState(""),[o,l]=E.useState(!1),[c,d]=E.useState(!1);E.useEffect(()=>{fetch(`${KM}/auth/status`).then(p=>p.json()).then(p=>{if(!p.gateEnabled)hx(),r(!0);else{const b=!!localStorage.getItem(ik),y=qS().length>0;r(b&&y)}}).catch(()=>{r(!0)})},[]);const h=async p=>{p.preventDefault(),d(!0),l(!1);try{const b=await fetch(`${KM}/auth/verify`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:i.trim()})}),y=await b.json().catch(()=>({}));b.ok?(localStorage.setItem(ik,"1"),uie(y.accessToken??""),r(!0)):(hx(),l(!0))}catch{hx(),l(!0)}d(!1)};return n===null?null:n?m.jsx(m.Fragment,{children:e}):m.jsx("div",{style:{position:"fixed",inset:0,display:"flex",alignItems:"center",justifyContent:"center",background:"#0a0a0a",fontFamily:"system-ui, sans-serif",zIndex:99999},children:m.jsxs("form",{onSubmit:h,style:{display:"flex",flexDirection:"column",gap:12,width:320,padding:32,borderRadius:12,background:"#18181b",border:"1px solid #27272a"},children:[m.jsx("h2",{style:{margin:0,color:"#fafafa",fontSize:18},children:t("password.title")}),m.jsx("input",{type:"password",value:i,onChange:p=>s(p.target.value),placeholder:t("password.placeholder"),autoFocus:!0,style:{padding:"10px 12px",borderRadius:8,border:o?"1px solid #ef4444":"1px solid #3f3f46",background:"#09090b",color:"#fafafa",fontSize:14,outline:"none"}}),o&&m.jsx("span",{style:{color:"#ef4444",fontSize:13},children:t("password.incorrect")}),m.jsx("button",{type:"submit",disabled:c||!i.trim(),style:{padding:"10px 16px",borderRadius:8,border:"none",background:"#3b82f6",color:"#fff",fontSize:14,fontWeight:500,cursor:"pointer",opacity:c||!i.trim()?.5:1},children:t(c?"password.checking":"password.continue")})]})})}fie();ZP.createRoot(document.getElementById("root")).render(m.jsx(E.StrictMode,{children:m.jsxs(q9,{children:[m.jsx(o1e,{children:m.jsx(n1e,{})}),m.jsx(rL,{})]})}));export{c1e as $,uW as A,f1e as B,cW as C,mS as D,au as E,gS as F,b9 as G,u1e as H,Oh as I,Cae as J,uq as K,uae as L,Ve as M,sh as N,D6 as O,cn as P,V1 as Q,lW as R,Fre as S,gd as T,P9 as U,fq as V,Rv as W,aB as X,oB as Y,O6 as Z,oL as _,$c as a,Dv as a0,ge as a1,kae as a2,Sae as a3,oa as a4,hl as a5,Bu as a6,Vn as a7,vr as a8,yt as a9,wO as aA,rb as aB,Ele as aC,_le as aD,Nle as aE,TO as aF,$le as aG,EO as aH,ls as aI,kO as aJ,CO as aK,Ile as aL,zle as aM,Ole as aN,sN as aO,Vle as aP,aa as aQ,He as aR,Ple as aS,Lle as aT,Rr as aU,jr as aV,Dt as aa,ct as ab,kpe as ac,aM as ad,Fw as ae,oz as af,S4 as ag,whe as ah,vhe as ai,L6 as aj,ow as ak,Dl as al,rw as am,mO as an,Lc as ao,c5 as ap,jce as aq,Gs as ar,_e as as,Sd as at,_O as au,lw as av,Mle as aw,Tle as ax,Ale as ay,xO as az,Fn as b,pt as c,Jt as d,j0 as e,bS as f,L4 as g,e4 as h,yS as i,m as j,Lh as k,Yc as l,q6 as m,dW as n,kn as o,fd as p,W9 as q,E as r,uD as s,Y9 as t,hg as u,Ph as v,G9 as w,sne as x,YR as y,KR as z};