window.ComponentRegistry.register('umformer_ac_ac', {
    folder: 'verbraucher', 
    title: 'Umformer AC/AC',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Grundgehäuse -->
            <rect x="30" y="40" width="60" height="80" fill="none" stroke="black" stroke-width="2"/>
            <!-- Diagonale Trennlinie -->
            <line x1="30" y1="120" x2="90" y2="40" stroke="black" stroke-width="1.5"/>
            
            <!-- Symbole -->
            <text x="45" y="65" font-size="14" font-family="Arial">~</text>
            <text x="75" y="105" font-size="14" font-family="Arial">~</text>
            
            <!-- Anschlüsse Oben -->
            <line x1="45" y1="20" x2="45" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="20" r="4" fill="red" class="port"/>
            <line x1="75" y1="20" x2="75" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="20" r="4" fill="red" class="port"/>
            
            <!-- Anschlüsse Unten -->
            <line x1="45" y1="120" x2="45" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="140" r="4" fill="red" class="port"/>
            <line x1="75" y1="120" x2="75" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="140" r="4" fill="red" class="port"/>
        </svg>
    `
});

window.ComponentRegistry.register('umformer_ac_dc', {
    folder: 'verbraucher', 
    title: 'Umformer AC/DC (Gleichrichter)',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Grundgehäuse -->
            <rect x="30" y="40" width="60" height="80" fill="none" stroke="black" stroke-width="2"/>
            <!-- Diagonale Trennlinie -->
            <line x1="30" y1="120" x2="90" y2="40" stroke="black" stroke-width="1.5"/>
            
            <!-- Symbole -->
            <text x="45" y="65" font-size="14" font-family="Arial">~</text>
            <text x="75" y="105" font-size="14" font-family="Arial">=</text>
            
            <!-- Anschlüsse Oben (AC) -->
            <line x1="45" y1="20" x2="45" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="20" r="4" fill="red" class="port"/>
            <line x1="75" y1="20" x2="75" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="20" r="4" fill="red" class="port"/>
            
            <!-- Anschlüsse Unten (DC) -->
            <line x1="45" y1="120" x2="45" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="140" r="4" fill="red" class="port"/>
            <line x1="75" y1="120" x2="75" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="140" r="4" fill="red" class="port"/>
        </svg>
    `
});

window.ComponentRegistry.register('netzteil_ac_dc_din', {
    folder: 'verbraucher', 
    title: 'Netzteil AC/DC (mit PE)',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Grundgehäuse -->
            <rect x="30" y="40" width="60" height="80" fill="none" stroke="black" stroke-width="2"/>
            <!-- Diagonale Trennlinie -->
            <line x1="30" y1="120" x2="90" y2="40" stroke="black" stroke-width="1.5"/>
            
            <!-- Symbole -->
            <text x="45" y="65" font-size="14" font-family="Arial">~</text>
            <text x="75" y="105" font-size="14" font-family="Arial">=</text>
            
            <!-- Anschlüsse Oben (AC) -->
            <line x1="45" y1="20" x2="45" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="20" r="4" fill="red" class="port"/>
            <text x="35" y="25" font-size="9" font-family="Arial">L</text>
            
            <line x1="75" y1="20" x2="75" y2="40" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="20" r="4" fill="red" class="port"/>
            <text x="82" y="25" font-size="9" font-family="Arial">N</text>
            
            <!-- Anschlüsse Unten (DC) -->
            <line x1="45" y1="120" x2="45" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="45" cy="140" r="4" fill="red" class="port"/>
            <text x="35" y="135" font-size="11" font-weight="bold" font-family="Arial">+</text>
            
            <line x1="75" y1="120" x2="75" y2="140" stroke="black" stroke-width="2"/>
            <circle cx="75" cy="140" r="4" fill="red" class="port"/>
            <text x="82" y="135" font-size="14" font-weight="bold" font-family="Arial">-</text>
            
            <!-- Anschluss Links (PE / Schirmung) -->
            <line x1="10" y1="80" x2="30" y2="80" stroke="black" stroke-width="2"/>
            <circle cx="10" cy="80" r="4" fill="red" class="port"/>
            <text x="12" y="75" font-size="8" font-family="Arial">PE</text>
        </svg>
    `
});



window.ComponentRegistry.register('3_phasen_motor', {
    folder: 'verbraucher', 
    title: '3_phasen_motor',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <text x="52" y="82" font-size="20" font-family="Arial" fill="black" class="">M</text>
            <circle cx="60" cy="76" r="25" stroke="black" stroke-width="2" fill="none" class=""/>
            <line x1="40" y1="122" x2="40" y2="122" stroke="black" stroke-width="2"/>
            <line x1="78" y1="124" x2="78" y2="124" stroke="black" stroke-width="2"/>
            <line x1="40" y1="30" x2="40" y2="62" stroke="black" stroke-width="2"/>
            <line x1="60" y1="32" x2="60" y2="52" stroke="black" stroke-width="2"/>
            <line x1="80" y1="30" x2="80" y2="60" stroke="black" stroke-width="2"/>
            <line x1="90" y1="48" x2="90" y2="48" stroke="black" stroke-width="2"/>
            <circle cx="40" cy="30" r="4" fill="red" class="port"/>
            <text x="46" y="33" font-size="9" font-family="Arial">1</text>
            <circle cx="60" cy="30" r="4" fill="red" class="port"/>
            <text x="66" y="33" font-size="9" font-family="Arial">2</text>
            <circle cx="80" cy="30" r="4" fill="red" class="port"/>
            <text x="86" y="33" font-size="9" font-family="Arial">3</text>
        </svg>
    `
});


window.ComponentRegistry.register('dahlander_motor_6_terminals', {
    folder: 'verbraucher', 
    title: 'dahlander_motor_6_terminals',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <text x="52" y="82" font-size="20" font-family="Arial" fill="black" class="">M</text>
            <circle cx="60" cy="76" r="25" stroke="black" stroke-width="2" fill="none" class=""/>
            <line x1="40" y1="122" x2="40" y2="122" stroke="black" stroke-width="2"/>
            <line x1="78" y1="124" x2="78" y2="124" stroke="black" stroke-width="2"/>
            <line x1="40" y1="30" x2="40" y2="62" stroke="black" stroke-width="2"/>
            <line x1="60" y1="32" x2="60" y2="52" stroke="black" stroke-width="2"/>
            <line x1="80" y1="30" x2="80" y2="60" stroke="black" stroke-width="2"/>
            <line x1="90" y1="48" x2="90" y2="48" stroke="black" stroke-width="2"/>
            <line x1="40" y1="90" x2="40" y2="120" stroke="black" stroke-width="2"/>
            <line x1="60" y1="102" x2="60" y2="120" stroke="black" stroke-width="2"/>
            <line x1="80" y1="92" x2="80" y2="118" stroke="black" stroke-width="2"/>
            <line x1="94" y1="94" x2="94" y2="94" stroke="black" stroke-width="2"/>
            <circle cx="40" cy="30" r="4" fill="red" class="port"/>
            <text x="46" y="33" font-size="9" font-family="Arial">1</text>
            <circle cx="60" cy="30" r="4" fill="red" class="port"/>
            <text x="66" y="33" font-size="9" font-family="Arial">3</text>
            <circle cx="80" cy="30" r="4" fill="red" class="port"/>
            <text x="86" y="33" font-size="9" font-family="Arial">5</text>
            <circle cx="40" cy="120" r="4" fill="red" class="port"/>
            <text x="46" y="123" font-size="9" font-family="Arial">2</text>
            <circle cx="60" cy="120" r="4" fill="red" class="port"/>
            <text x="66" y="123" font-size="9" font-family="Arial">4</text>
            <circle cx="80" cy="120" r="4" fill="red" class="port"/>
            <text x="86" y="123" font-size="9" font-family="Arial">6</text>
        </svg>
    `
});

window.ComponentRegistry.register('lampe', {
    folder: 'verbraucher', 
    title: 'Lampe',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <line x1="62" y1="34" x2="62" y2="34" stroke="black" stroke-width="2"/>
            <line x1="106" y1="62" x2="106" y2="62" stroke="black" stroke-width="2"/>
            <circle cx="58" cy="78" r="16" stroke="black" stroke-width="2" fill="none" class=""/>
            <line x1="58" y1="62" x2="58" y2="46" stroke="black" stroke-width="2"/>
            <line x1="58" y1="94" x2="58" y2="110" stroke="black" stroke-width="2"/>
            <line x1="70" y1="66" x2="46" y2="88" stroke="black" stroke-width="2"/>
            <line x1="48" y1="66" x2="70" y2="90" stroke="black" stroke-width="2"/>
            <circle cx="58" cy="46" r="4" fill="red" class="port"/>
            <text x="64" y="49" font-size="9" font-family="Arial">1</text>
            <circle cx="58" cy="110" r="4" fill="red" class="port"/>
            <text x="64" y="113" font-size="9" font-family="Arial">2</text>
        </svg>
    `
});


window.ComponentRegistry.register('gleichstrom_motor', {
    folder: 'verbraucher', 
    title: 'Gleichstrommotor (DC)',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Kreis -->
            <circle cx="60" cy="80" r="25" fill="none" stroke="black" stroke-width="2"/>
            <!-- M (klein, wie gewünscht) -->
            <text x="60" y="85" font-size="14" font-family="Arial" text-anchor="middle">M</text>
            
            <!-- Bürsten (Rechtecke oben und unten am Motor) -->
            <rect x="52" y="51" width="16" height="4" fill="black" stroke="black"/>
            <rect x="52" y="105" width="16" height="4" fill="black" stroke="black"/>
            
            <!-- Leitungen -->
            <line x1="60" y1="20" x2="60" y2="51" stroke="black" stroke-width="2"/>
            <line x1="60" y1="140" x2="60" y2="109" stroke="black" stroke-width="2"/>
            
            <!-- Anschlüsse & Labels -->
            <circle cx="60" cy="20" r="4" fill="red" class="port"/>
            <text x="66" y="25" font-size="9" font-family="Arial">1</text>
            <circle cx="60" cy="140" r="4" fill="red" class="port"/>
            <text x="66" y="135" font-size="9" font-family="Arial">2</text>
        </svg>
    `
});

window.ComponentRegistry.register('wechselstrom_motor_1ph', {
    folder: 'verbraucher', 
    title: 'Wechselstrommotor (1-phasig)',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Kreis -->
            <circle cx="60" cy="85" r="25" fill="none" stroke="black" stroke-width="2"/>
            <!-- M (klein) und 1~ -->
            <text x="60" y="86" font-size="14" font-family="Arial" text-anchor="middle">M</text>
            <text x="60" y="100" font-size="10" font-family="Arial" text-anchor="middle">1~</text>
            
            <!-- Leitungen (2 Anschlüsse von oben) -->
            <line x1="45" y1="20" x2="45" y2="65" stroke="black" stroke-width="2"/>
            <line x1="75" y1="20" x2="75" y2="65" stroke="black" stroke-width="2"/>
            
            <!-- Anschlüsse & Labels -->
            <circle cx="45" cy="20" r="4" fill="red" class="port"/>
            <text x="32" y="25" font-size="9" font-family="Arial">U1</text>
            <circle cx="75" cy="20" r="4" fill="red" class="port"/>
            <text x="82" y="25" font-size="9" font-family="Arial">N</text>
        </svg>
    `
});

window.ComponentRegistry.register('heizwiderstand', {
    folder: 'verbraucher', 
    title: 'Heizwiderstand',
    defaultData: {},
    svg: `
        <svg viewBox="0 0 120 160" class="symbol">
            <!-- Äußeres Rechteck -->
            <rect x="45" y="45" width="30" height="70" fill="none" stroke="black" stroke-width="2"/>
            
            <!-- Interne Welle (Rechteckig) für Heizung -->
            <polyline points="45,55 75,55 75,65 45,65 45,75 75,75 75,85 45,85 45,95 75,95 75,105 45,105" fill="none" stroke="black" stroke-width="1.5"/>
            
            <!-- Leitungen vertikal -->
            <line x1="60" y1="20" x2="60" y2="45" stroke="black" stroke-width="2"/>
            <line x1="60" y1="140" x2="60" y2="115" stroke="black" stroke-width="2"/>
            
            <!-- Anschlüsse & Labels -->
            <circle cx="60" cy="20" r="4" fill="red" class="port"/>
            <text x="66" y="25" font-size="9" font-family="Arial">1</text>
            <circle cx="60" cy="140" r="4" fill="red" class="port"/>
            <text x="66" y="135" font-size="9" font-family="Arial">2</text>
        </svg>
    `
});