// @bun
var{defineProperty:D,getOwnPropertyNames:F,getOwnPropertyDescriptor:G}=Object,H=Object.prototype.hasOwnProperty;function I(h){return this[h]}var W=(h)=>{var j=(E??=new WeakMap).get(h),q;if(j)return j;if(j=D({},"__esModule",{value:!0}),h&&typeof h==="object"||typeof h==="function"){for(var z of F(h))if(!H.call(j,z))D(j,z,{get:I.bind(h,z),enumerable:!(q=G(h,z))||q.enumerable})}return E.set(h,j),j},E;var J=(h)=>h;function K(h,j){this[h]=J.bind(null,j)}var X=(h,j)=>{for(var q in j)D(h,q,{get:j[q],enumerable:!0,configurable:!0,set:K.bind(j,q)})};var Y=(h,j)=>()=>(h&&(j=h(h=0)),j);var Z=import.meta.require;var C=new Map;function B(h){if(C.has(h.id))console.warn(`Addon "${h.id}" is already registered, overwriting...`);C.set(h.id,h)}function $(h){return C.delete(h)}function f(){return Array.from(C.values())}function k(h){return C.get(h)}async function v(h){for(let j of C.values())if(j.init)await j.init(h)}function w(h,j){let q=h;for(let z of C.values())if(z.decorator)q=z.decorator(q,j);return q}function R(){let h=[];for(let j of C.values())if(j.panel)h.push(j.panel);return h}function b(){let h=[];for(let j of C.values())if(j.toolbar)h.push(...j.toolbar);return h}var L={name:"Actions",id:"actions",panel:{id:"actions-panel",title:"Actions",icon:"ph:lightning",render:(h)=>{return`
        <div class="addon-actions">
          <div class="addon-actions-header">
            <span>Event Log</span>
            <button onclick="window.__stxStory.clearActions()">Clear</button>
          </div>
          <div class="addon-actions-list" id="actions-list">
            <div class="addon-actions-empty">No actions logged yet</div>
          </div>
        </div>
      `}}},M={name:"Viewport",id:"viewport",toolbar:[{id:"viewport-select",title:"Viewport",icon:"ph:device-mobile",render:(h)=>{return`
          <select id="viewport-select" onchange="window.__stxStory.setViewport(this.value)">
            <option value="">Responsive</option>
            ${h.storyContext.config.responsivePresets.map((z)=>`<option value="${z.width}">${z.label}</option>`).join("")}
          </select>
        `}}]},N={name:"Backgrounds",id:"backgrounds",toolbar:[{id:"background-select",title:"Background",icon:"ph:paint-bucket",render:(h)=>{return`
          <select id="background-select" onchange="window.__stxStory.setBackground(this.value)">
            ${h.storyContext.config.backgroundPresets.map((z)=>`<option value="${z.color}">${z.label}</option>`).join("")}
          </select>
        `}}]},O={name:"Docs",id:"docs",panel:{id:"docs-panel",title:"Docs",icon:"ph:book-open",render:(h)=>{return`
        <div class="addon-docs">
          <div class="addon-docs-content" id="docs-content">
            Select a story to view documentation
          </div>
        </div>
      `}}},P={name:"Measure",id:"measure",toolbar:[{id:"measure-toggle",title:"Measure",icon:"ph:ruler",render:()=>{return`
          <button
            class="toolbar-btn"
            onclick="window.__stxStory.toggleMeasure()"
            title="Toggle measure overlay"
          >
            \uD83D\uDCCF
          </button>
        `}}]},Q={name:"Outline",id:"outline",toolbar:[{id:"outline-toggle",title:"Outline",icon:"ph:bounding-box",render:()=>{return`
          <button
            class="toolbar-btn"
            onclick="window.__stxStory.toggleOutline()"
            title="Toggle outline overlay"
          >
            \u2B1C
          </button>
        `}}]},S={name:"i18n",id:"i18n",toolbar:[{id:"locale-select",title:"Locale",icon:"ph:globe",render:()=>{return`
          <select id="locale-select" onchange="window.__stxStory.setLocale(this.value)">
            ${["en","es","fr","de","ja","zh"].map((q)=>`<option value="${q}">${q.toUpperCase()}</option>`).join("")}
          </select>
        `}}]},T={name:"Performance",id:"performance",panel:{id:"performance-panel",title:"Performance",icon:"ph:timer",render:()=>{return`
        <div class="addon-performance">
          <div class="addon-performance-metrics" id="perf-metrics">
            <div class="perf-metric">
              <span class="perf-label">Render Time</span>
              <span class="perf-value" id="perf-render">-</span>
            </div>
            <div class="perf-metric">
              <span class="perf-label">DOM Nodes</span>
              <span class="perf-value" id="perf-nodes">-</span>
            </div>
            <div class="perf-metric">
              <span class="perf-label">Memory</span>
              <span class="perf-value" id="perf-memory">-</span>
            </div>
            <div class="perf-metric">
              <span class="perf-label">Re-renders</span>
              <span class="perf-value" id="perf-rerenders">0</span>
            </div>
          </div>
          <button onclick="window.__stxStory.measurePerformance()">Measure</button>
        </div>
      `}}},U={name:"State",id:"state",panel:{id:"state-panel",title:"State",icon:"ph:database",render:()=>{return`
        <div class="addon-state">
          <div class="addon-state-header">
            <span>Component State</span>
            <button onclick="window.__stxStory.refreshState()">Refresh</button>
          </div>
          <div class="addon-state-tree" id="state-tree">
            <pre>// Select a story to inspect state</pre>
          </div>
        </div>
      `}}},V={name:"Accessibility",id:"a11y",panel:{id:"a11y-panel",title:"A11y",icon:"ph:wheelchair",render:()=>{return`
        <div class="addon-a11y">
          <div class="addon-a11y-header">
            <span>Accessibility Audit</span>
            <button onclick="window.__stxStory.runA11yAudit()">Run Audit</button>
          </div>
          <div class="addon-a11y-results" id="a11y-results">
            <div class="a11y-empty">Click "Run Audit" to check accessibility</div>
          </div>
        </div>
      `}}};function y(){B(L),B(M),B(N),B(O),B(P),B(Q),B(S),B(T),B(U),B(V)}export{M as viewportAddon,$ as unregisterAddon,U as stateAddon,y as registerBuiltinAddons,B as registerAddon,T as performanceAddon,Q as outlineAddon,P as measureAddon,v as initializeAddons,S as i18nAddon,b as getToolbarItems,f as getAddons,R as getAddonPanels,k as getAddon,O as docsAddon,N as backgroundsAddon,w as applyDecorators,L as actionsAddon,V as a11yAddon};
