PageSourceSearch

https://sp-arte.com/build/assets/FeatureEditorials-Ca3JU1kz.js

js sp-arte.com collected 2026-10-02 03:11:45 UTC 4,621 bytes, 1 lines download raw bytes

1import{r as c,j as e}from"./app-Dfd-ZCC0.js";import{M as f}from"./ModalError-DZGB5SAH.js";import{F as h,a as g,b as j}from"./PhotoIcon-DH7F72LY.js";import"./Button-COCdFP5a.js";import"./Modal-A1x988WJ.js";import"./transition-B13YxkUg.js";import"./keyboard-wOqzMbnR.js";const w=({editorial:s})=>{const[i,o]=c.useState(!1),[n,m]=c.useState(!1),d=()=>{o(!1)},u=()=>{if(!s.feature_media_src){label=window.lang=="pt"?s.name:s.name_en;const r=label.split(" ").map(a=>a.charAt(0).toUpperCase()).join("");return e.jsx("div",{className:"flex justify-center items-center w-full h-[200px] md:h-[435px] bg-gray-200",children:e.jsx("span",{className:"text-[60px] font-semibold text-white truncate",children:r})})}var t=JSON.parse(s.feature_media_src);switch(s.feature_media_type){case"image":return t.sources.length>0?e.jsxs("picture",{children:[t.sources.map((r,a)=>e.jsx("source",{srcSet:r.srcSet,media:r.media},a)),e.jsx("img",{src:t.mediaSrc,alt:s[`credit_${window.lang}`],className:"object-cover w-full h-[200px] md:h-[435px]"})]}):"";case"video":return s.feature_media_src&&e.jsx("video",{src:t.mediaSrc,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,controls:!1,className:"object-cover w-full h-[200px] md:h-[435px]",children:"Your browser does not support the video tag."});case"gif":return s.feature_media_src&&e.jsx("img",{src:t.mediaSrc,alt:item[`credit_${window.lang}`],className:"object-cover w-full h-[200px] md:h-[435px]"});default:return null}},l=()=>{if(!s.feature_media_src_vert){label=window.lang=="pt"?s.name:s.name_en;const r=label.split(" ").map(a=>a.charAt(0).toUpperCase()).join("");return e.jsx("div",{className:"flex justify-center items-center w-full h-[200px] md:h-[435px] bg-gray-200",children:e.jsx("span",{className:"text-[60px] font-semibold text-white truncate",children:r})})}var t=JSON.parse(s.feature_media_src_vert);switch(s.feature_media_type_vert){case"image":return t.sources.length>0?e.jsxs("picture",{children:[t.sources.map((r,a)=>e.jsx("source",{srcSet:r.srcSet,media:r.media},a)),e.jsx("img",{src:t.mediaSrc,alt:s[`credit_${window.lang}`],className:"object-cover w-full h-[200px] md:h-[435px]"})]}):"";case"video":return e.jsx("video",{src:t.mediaSrc,autoPlay:!0,loop:!0,muted:!0,playsInline:!0,controls:!1,className:"object-cover w-full h-[200px] md:h-[435px]",children:"Your browser does not support the video tag."});case"gif":return e.jsx("img",{src:t.mediaSrc,alt:item[`credit_${window.lang}`],className:"object-cover w-full h-[200px] md:h-[435px]"});default:return null}};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex flex-col justify-between w-full",children:e.jsxs("a",{href:route("editorial.slug",{slug:window.lang=="pt"?s.slug:s.slug_en}),className:"relative",children:[s.vertical?l():u(),e.jsx("div",{className:"flex justify-between items-start mt-4",children:e.jsxs("div",{className:"w-[90%]",children:[e.jsx("h5",{className:"text-gray-400 text-[16px]",children:window.lang=="pt"?s.hat:s.hat_en}),e.jsx("p",{className:"text-base text-gray-800 text-wrap line-clamp-4 pt-[10px] min-h-[104px]",children:window.lang=="pt"?s.pill_title:s.pill_title_en}),e.jsx("h6",{className:"text-gray-400 text-[16px] pt-2",children:s.publish_at})]})})]})}),e.jsx(f,{openModal:i,errorMsg:n,closeModal:d})]})},M=({qtdToShow:s,pageId:i=null})=>{const[o,n]=c.useState([]),[m,d]=c.useState(!0);c.useEffect(()=>{u()},[]);const u=async()=>{try{const l=route("page.editorials.featureds",[s,i]),t=await fetch(l);if(!t.ok)throw new Error("Erro na requisição: "+t.statusText);let r=1;const a=await t.json();a.editorials.map((p,x)=>{x==0?p.vertical=!1:r<=4?(p.vertical=!0,r++):(p.vertical=!1,r>4&&r<6?r++:r=1)}),n(a.editorials)}catch(l){console.error("Erro ao carregar os editoriais:",l),n([])}finally{d(!1)}};return m?e.jsx("div",{className:"flex items-center justify-center h-screen",children:e.jsxs("div",{className:"text-center text-gray-600 flex items-center",children:[e.jsx("span",{children:window.lang==="pt"?"Carregando":"Loading"}),e.jsx(h,{className:"ml-2 h-6 w-6 animate-pulse"}),e.jsx(g,{className:"ml-2 h-6 w-6 animate-pulse"}),e.jsx(j,{className:"ml-2 h-6 w-6 animate-pulse"})]})}):e.jsx("div",{className:"px-4 pb-[78px]",children:e.jsxs("div",{className:"mt-4",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-
15",children:o.map(l=>e.jsx("div",{className:`py-4 ${l.vertical?"":"col-span-2"}`,children:e.jsx(w,{editorial:l})},l.id))}),m&&currentPage>1&&e.jsx("div",{className:"flex items-center justify-center animate-pulse",children:e.jsxs("span",{children:[window.lang==="pt"?"Carregando":"Loading","..."]})})]})})};export{M as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.