const i={title:"Mixins/Ready Mixin",tags:["autodocs"],parameters:{docs:{description:{component:`
\`ReadyMixin\` ensures the DOM is fully loaded **before initializing web
components**.

Prevents components from querying or manipulating DOM elements before
they're available by deferring \`super.connectedCallback()\` until the DOM
is ready.

<h3>What ReadyMixin Does</h3>
<ul>
    <li>Checks document.readyState when connectedCallback() is called</li>
    <li>DOM is ready: calls \`super.connectedCallback()\` immediately</li>
    <li>If DOM is loading: waits for <b>DOMContentLoaded</b> event, then calls \`super.connectedCallback()\`</li>
</ul>

<h3>Mixin Composition</h3>

<p>Place ReadyMixin close to LitElement in the composition chain:</p>

<p> ✅ Correct - ReadyMixin near the base
ComponentStatesMixin(EventEmitterMixin(ReadyMixin(LitElement)))</p>

<p> ❌ Incorrect - ReadyMixin too far out
ReadyMixin(ComponentStatesMixin(EventEmitterMixin(LitElement)))</p>

<p>This ensures the DOM-ready check happens before other mixins'
initialization logic.</p>

<h3>Usage</h3>
 \`\`\`typescript
  import { ReadyMixin } from './ReadyMixin'

  // Basic usage
  class MyComponent extends ReadyMixin(LitElement) {
    connectedCallback() {
      super.connectedCallback()
      // DOM is guaranteed to be ready here
      const child = this.querySelector('.child')
    }
  }

  // With multiple mixins
  class NavRail extends EventEmitterMixin(ReadyMixin(LitElement)) {
    // All mixins benefit from DOM-ready guarantee
  }
        `}}}},e={parameters:{docs:{description:{story:"ReadyMixin provides lifecycle behavior only. It has no visual output, so this story is empty."}}},render:()=>""};e.parameters={...e.parameters,docs:{...e.parameters?.docs,source:{originalSource:`{
  parameters: {
    docs: {
      description: {
        story: 'ReadyMixin provides lifecycle behavior only. It has no visual output, so this story is empty.'
      }
    }
  },
  render: () => ''
}`,...e.parameters?.docs?.source}}};const t=["ReadyMixin"];export{e as ReadyMixin,t as __namedExportsOrder,i as default};
