import{z as d,p as h,A as p,c as l,B as y}from"./BGP0bt1i.js";const b=t=>{if(parseFloat(t)===Number(t))return Number(t);if(t==="true"||t==="")return!0;if(t==="false")return!1;if(t==="null")return null;if(t!=="undefined"){if(typeof t=="string"&&t.includes("{")&&t.includes("}")&&t.includes('"')){let a;try{a=JSON.parse(t)}catch{a=t}return a}return t}},g=["a11y","autoplay","controller","cards-effect","coverflow-effect","creative-effect","cube-effect","fade-effect","flip-effect","free-mode","grid","hash-navigation","history","keyboard","mousewheel","navigation","pagination","parallax","scrollbar","thumbs","virtual","zoom"];function P(t,a,s){const e={},r={};d(e,y);const c=[...h,"on"],m=c.map(n=>n.replace(/_/,""));c.forEach(n=>{n=n.replace("_",""),typeof t[n]<"u"&&(r[n]=t[n])});const u=[...t.attributes];return typeof a=="string"&&typeof s<"u"&&u.push({name:a,value:p(s)?{...s}:s}),u.forEach(n=>{const f=g.find(i=>n.name.startsWith(`${i}-`));if(f){const i=l(f),o=l(n.name.split(`${f}-`)[1]);typeof r[i]>"u"&&(r[i]={}),r[i]===!0&&(r[i]={enabled:!0}),r[i][o]=b(n.value)}else{const i=l(n.name);if(!m.includes(i))return;const o=b(n.value);r[i]&&g.includes(n.name)&&!p(o)?(r[i].constructor!==Object&&(r[i]={}),r[i].enabled=!!o):r[i]=o}}),d(e,r),e.navigation?e.navigation={prevEl:".swiper-button-prev",nextEl:".swiper-button-next",...e.navigation!==!0?e.navigation:{}}:e.navigation===!1&&delete e.navigation,e.scrollbar?e.scrollbar={el:".swiper-scrollbar",...e.scrollbar!==!0?e.scrollbar:{}}:e.scrollbar===!1&&delete e.scrollbar,e.pagination?e.pagination={el:".swiper-pagination",...e.pagination!==!0?e.pagination:{}}:e.pagination===!1&&delete e.pagination,{params:e,passedParams:r}}export{P as g};
