import{h as t,c as s,r as n}from"./p-083180bf.js";import{u as a,f as o,n as r}from"./p-a7fc1e02.js";import{_ as e}from"./p-d0993bb9.js";import{g as l}from"./p-9ec99ced.js";import{u as p}from"./p-642f2c89.js";import{u as c}from"./p-d18dedd4.js";const m=({content:n,placement:a,textColor:o="var(--sqm-text)"})=>t(s,null,t("style",{type:"text/css"},`\n    sl-tab-panel::part(base) {\n      padding: ${a&&"top"!==a&&"bottom"!==a?"0 var(--sl-spacing-xx-large);":"var(--sl-spacing-x-large) 0;"};\n    }\n\n    sl-tab::part(base) {\n      color: ${o};\n      font-family: var(--sqm-primary-font);\n    }\n\n\n\n    sl-tab-group::part(tabs) {\n      border-bottom: 2px solid var(--sqm-border-color);\n      font-family: var(--sqm-primary-font);\n    }\n  `),t("sl-tab-group",{placement:a},n.tabs.map((s=>{const n=s.getAttribute("slot");return"RAISINS-PLOP-TARGET"===s.tagName?t("sl-tab",{slot:"nav"},t("div",{style:{marginTop:"10px"}},t("slot",{name:n}))):[t("sl-tab",{slot:"nav",panel:n,part:"tab",id:s.getAttribute("id")||n},s.getAttribute("header")),t("sl-tab-panel",{name:n},t("slot",{name:n}))]}))),t("div",{style:{display:"none"}},t("slot",null))),i=class{constructor(t){n(this,t),r(this)}disconnectedCallback(){}render(){const{content:s}=function(){const t=c(),s=e(),n=p(),r=a((()=>t.filter((t=>"SQM-TAB"===t.tagName||"RAISINS-PLOP-TARGET"===t.tagName)).map(((t,s)=>{if("RAISINS-PLOP-TARGET"===t.tagName){const s=t;s.style.position="absolute",s.style.left="6px";const n=t.firstElementChild.childNodes[1];n.innerHTML="＋",n.style.lineHeight="20px"}return t.setAttribute("slot","tab-"+s),t.setAttribute("id","tab-"+s),t}))),[t,n]);return o((()=>{const t=t=>{var n;const a=t.target;if(t.stopPropagation(),!a)return;const o=a.closest("sqm-tabs");if(!s.contains(a)||!o)return;const r=a.closest("sqm-tab");null===(n=o.shadowRoot.querySelector("sl-tab-group"))||void 0===n||n.show(r.id)};return s.addEventListener("sq:reveal",t),()=>{s.removeEventListener("sq:reveal",t)}}),[]),{content:{tabs:r}}}(),{placement:n,textColor:r}=l(this);return t(m,{placement:n,content:s,textColor:r},t("slot",null))}};export{i as sqm_tabs}