You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2 lines
30 KiB
2 lines
30 KiB
import{j as r}from"./markdown-vendor-BZI_VWzW.js";import{r as o,a as M,u as Y}from"./data-vendor-BOGugMqL.js";import{g as G,s as Z,f as fe,S as pe}from"./swiper-vendor-Bs-UmCJ7.js";/* empty css */import{u as me,c as ge,o as he,d as ae,b as re,a as xe,g as _e,R as W,e as J}from"./index-RTMDNWJ5.js";import{c as ve}from"./imageDragTransfer-apm0lmHd.js";import{b as be}from"./react-vendor-CmPQC3tV.js";import"./arco-vendor-gN7EHfgO.js";function Se({swiper:e,extendParams:n,on:a,emit:t,params:i}){e.autoplay={running:!1,paused:!1,timeLeft:0},n({autoplay:{enabled:!1,delay:3e3,waitForTransition:!0,disableOnInteraction:!1,stopOnLastSlide:!1,reverseDirection:!1,pauseOnMouseEnter:!1}});let u,f,h=i&&i.autoplay?i.autoplay.delay:3e3,l=i&&i.autoplay?i.autoplay.delay:3e3,s,p=new Date().getTime(),g,j,E,O,C,c;function d(v){!e||e.destroyed||!e.wrapperEl||v.target===e.wrapperEl&&(e.wrapperEl.removeEventListener("transitionend",d),!(c||v.detail&&v.detail.bySwiperTouchMove)&&_())}const N=()=>{if(e.destroyed||!e.autoplay.running)return;e.autoplay.paused?g=!0:g&&(l=s,g=!1);const v=e.autoplay.paused?s:p+l-new Date().getTime();e.autoplay.timeLeft=v,t("autoplayTimeLeft",v,v/h),f=requestAnimationFrame(()=>{N()})},x=()=>{let v;return e.virtual&&e.params.virtual.enabled?v=e.slides.find(I=>I.classList.contains("swiper-slide-active")):v=e.slides[e.activeIndex],v?parseInt(v.getAttribute("data-swiper-autoplay"),10):void 0},b=()=>{let v=e.params.autoplay.delay;const S=x();return!Number.isNaN(S)&&S>0&&(v=S),v},P=v=>{if(e.destroyed||!e.autoplay.running)return;cancelAnimationFrame(f),N();let S=v;typeof S>"u"&&(S=b(),h=S,l=S),s=S;const I=e.params.speed,V=()=>{!e||e.destroyed||(e.params.autoplay.reverseDirection?!e.isBeginning||e.params.loop||e.params.rewind?(e.slidePrev(I,!0,!0),t("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(e.slides.length-1,I,!0,!0),t("autoplay")):!e.isEnd||e.params.loop||e.params.rewind?(e.slideNext(I,!0,!0),t("autoplay")):e.params.autoplay.stopOnLastSlide||(e.slideTo(0,I,!0,!0),t("autoplay")),e.params.cssMode&&(p=new Date().getTime(),requestAnimationFrame(()=>{P()})))};return S>0?(clearTimeout(u),u=setTimeout(()=>{V()},S)):requestAnimationFrame(()=>{V()}),S},R=()=>{p=new Date().getTime(),e.autoplay.running=!0,P(),t("autoplayStart")},T=()=>{e.autoplay.running=!1,clearTimeout(u),cancelAnimationFrame(f),t("autoplayStop")},m=(v,S)=>{if(e.destroyed||!e.autoplay.running)return;clearTimeout(u),v||(C=!0);const I=()=>{t("autoplayPause"),e.params.autoplay.waitForTransition?e.wrapperEl.addEventListener("transitionend",d):_()};if(e.autoplay.paused=!0,S){I();return}s=(s||e.params.autoplay.delay)-(new Date().getTime()-p),!(e.isEnd&&s<0&&!e.params.loop)&&(s<0&&(s=0),I())},_=()=>{e.isEnd&&s<0&&!e.params.loop||e.destroyed||!e.autoplay.running||(p=new Date().getTime(),C?(C=!1,P(s)):P(),e.autoplay.paused=!1,t("autoplayResume"))},L=()=>{if(e.destroyed||!e.autoplay.running)return;const v=G();v.visibilityState==="hidden"&&(C=!0,m(!0)),v.visibilityState==="visible"&&_()},y=v=>{v.pointerType==="mouse"&&(C=!0,c=!0,!(e.animating||e.autoplay.paused)&&m(!0))},A=v=>{v.pointerType==="mouse"&&(c=!1,e.autoplay.paused&&_())},w=()=>{e.params.autoplay.pauseOnMouseEnter&&(e.el.addEventListener("pointerenter",y),e.el.addEventListener("pointerleave",A))},D=()=>{e.el&&typeof e.el!="string"&&(e.el.removeEventListener("pointerenter",y),e.el.removeEventListener("pointerleave",A))},B=()=>{G().addEventListener("visibilitychange",L)},F=()=>{G().removeEventListener("visibilitychange",L)};a("init",()=>{e.params.autoplay.enabled&&(w(),B(),R())}),a("destroy",()=>{D(),F(),e.autoplay.running&&T()}),a("_freeModeStaticRelease",()=>{(E||C)&&_()}),a("_freeModeNoMomentumRelease",()=>{e.params.autoplay.disableOnInteraction?T():m(!0,!0)}),a("beforeTransitionStart",(v,S,I)=>{e.destroyed||!e.autoplay.running||(I||!e.params.autoplay.disableOnInteraction?m(!0,!0):T())}),a("sliderFirstMove",()=>{if(!(e.destroyed||!e.autoplay.running)){if(e.params.autoplay.disableOnInteraction){T();return}j=!0,E=!1,C=!1,O=setTimeout(()=>{C=!0,E=!0,m(!0)},200)}}),a("touchEnd",()=>{if(!(e.destroyed||!e.autoplay.running||!j)){if(clearTimeout(O),clearTimeout(u),e.params.autoplay.disableOnInteraction){E=!1,j=!1;return}E&&e.params.cssMode&&_(),E=!1,j=!1}}),a("slideChange",()=>{e.destroyed||!e.autoplay.running||e.autoplay.paused&&(s=b(),h=b())}),Object.assign(e.autoplay,{start:R,stop:T,pause:m,resume:_})}const ne=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesBounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function U(e){return typeof e=="object"&&e!==null&&e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function $(e,n){const a=["__proto__","constructor","prototype"];Object.keys(n).filter(t=>a.indexOf(t)<0).forEach(t=>{typeof e[t]>"u"?e[t]=n[t]:U(n[t])&&U(e[t])&&Object.keys(n[t]).length>0?n[t].__swiper__?e[t]=n[t]:$(e[t],n[t]):e[t]=n[t]})}function le(e={}){return e.navigation&&typeof e.navigation.nextEl>"u"&&typeof e.navigation.prevEl>"u"}function se(e={}){return e.pagination&&typeof e.pagination.el>"u"}function oe(e={}){return e.scrollbar&&typeof e.scrollbar.el>"u"}function ie(e=""){const n=e.split(" ").map(t=>t.trim()).filter(t=>!!t),a=[];return n.forEach(t=>{a.indexOf(t)<0&&a.push(t)}),a.join(" ")}function ye(e=""){return e?e.includes("swiper-wrapper")?e:`swiper-wrapper ${e}`:"swiper-wrapper"}function Ce({swiper:e,slides:n,passedParams:a,changedParams:t,nextEl:i,prevEl:u,scrollbarEl:f,paginationEl:h}){const l=t.filter(m=>m!=="children"&&m!=="direction"&&m!=="wrapperClass"),{params:s,pagination:p,navigation:g,scrollbar:j,virtual:E,thumbs:O}=e;let C,c,d,N,x,b,P,R;t.includes("thumbs")&&a.thumbs&&a.thumbs.swiper&&!a.thumbs.swiper.destroyed&&s.thumbs&&(!s.thumbs.swiper||s.thumbs.swiper.destroyed)&&(C=!0),t.includes("controller")&&a.controller&&a.controller.control&&s.controller&&!s.controller.control&&(c=!0),t.includes("pagination")&&a.pagination&&(a.pagination.el||h)&&(s.pagination||s.pagination===!1)&&p&&!p.el&&(d=!0),t.includes("scrollbar")&&a.scrollbar&&(a.scrollbar.el||f)&&(s.scrollbar||s.scrollbar===!1)&&j&&!j.el&&(N=!0),t.includes("navigation")&&a.navigation&&(a.navigation.prevEl||u)&&(a.navigation.nextEl||i)&&(s.navigation||s.navigation===!1)&&g&&!g.prevEl&&!g.nextEl&&(x=!0);const T=m=>{e[m]&&(e[m].destroy(),m==="navigation"?(e.isElement&&(e[m].prevEl.remove(),e[m].nextEl.remove()),s[m].prevEl=void 0,s[m].nextEl=void 0,e[m].prevEl=void 0,e[m].nextEl=void 0):(e.isElement&&e[m].el.remove(),s[m].el=void 0,e[m].el=void 0))};t.includes("loop")&&e.isElement&&(s.loop&&!a.loop?b=!0:!s.loop&&a.loop?P=!0:R=!0),l.forEach(m=>{if(U(s[m])&&U(a[m]))Object.assign(s[m],a[m]),(m==="navigation"||m==="pagination"||m==="scrollbar")&&"enabled"in a[m]&&!a[m].enabled&&T(m);else{const _=a[m];(_===!0||_===!1)&&(m==="navigation"||m==="pagination"||m==="scrollbar")?_===!1&&T(m):s[m]=a[m]}}),l.includes("controller")&&!c&&e.controller&&e.controller.control&&s.controller&&s.controller.control&&(e.controller.control=s.controller.control),t.includes("children")&&n&&E&&s.virtual.enabled?(E.slides=n,E.update(!0)):t.includes("virtual")&&E&&s.virtual.enabled&&(n&&(E.slides=n),E.update(!0)),t.includes("children")&&n&&s.loop&&(R=!0),C&&O.init()&&O.update(!0),c&&(e.controller.control=s.controller.control),d&&(e.isElement&&(!h||typeof h=="string")&&(h=document.createElement("div"),h.classList.add("swiper-pagination"),h.part.add("pagination"),e.el.appendChild(h)),h&&(s.pagination.el=h),p.init(),p.render(),p.update()),N&&(e.isElement&&(!f||typeof f=="string")&&(f=document.createElement("div"),f.classList.add("swiper-scrollbar"),f.part.add("scrollbar"),e.el.appendChild(f)),f&&(s.scrollbar.el=f),j.init(),j.updateSize(),j.setTranslate()),x&&(e.isElement&&((!i||typeof i=="string")&&(i=document.createElement("div"),i.classList.add("swiper-button-next"),Z(i,e.navigation.arrowSvg),i.part.add("button-next"),e.el.appendChild(i)),(!u||typeof u=="string")&&(u=document.createElement("div"),u.classList.add("swiper-button-prev"),Z(u,e.navigation.arrowSvg),u.part.add("button-prev"),e.el.appendChild(u))),i&&(s.navigation.nextEl=i),u&&(s.navigation.prevEl=u),g.init(),g.update()),t.includes("allowSlideNext")&&(e.allowSlideNext=a.allowSlideNext),t.includes("allowSlidePrev")&&(e.allowSlidePrev=a.allowSlidePrev),t.includes("direction")&&e.changeDirection(a.direction,!1),(b||R)&&e.loopDestroy(),(P||R)&&e.loopCreate(),e.update()}function Ne(e={},n=!0){const a={on:{}},t={},i={};$(a,fe),a._emitClasses=!0,a.init=!1;const u={},f=ne.map(l=>l.replace(/_/,"")),h=Object.assign({},e);return Object.keys(h).forEach(l=>{typeof e[l]>"u"||(f.indexOf(l)>=0?U(e[l])?(a[l]={},i[l]={},$(a[l],e[l]),$(i[l],e[l])):(a[l]=e[l],i[l]=e[l]):l.search(/on[A-Z]/)===0&&typeof e[l]=="function"?n?t[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:a.on[`${l[2].toLowerCase()}${l.substr(3)}`]=e[l]:u[l]=e[l])}),["navigation","pagination","scrollbar"].forEach(l=>{a[l]===!0&&(a[l]={}),a[l]===!1&&delete a[l]}),{params:a,passedParams:i,rest:u,events:t}}function Ee({el:e,nextEl:n,prevEl:a,paginationEl:t,scrollbarEl:i,swiper:u},f){le(f)&&n&&a&&(u.params.navigation.nextEl=n,u.originalParams.navigation.nextEl=n,u.params.navigation.prevEl=a,u.originalParams.navigation.prevEl=a),se(f)&&t&&(u.params.pagination.el=t,u.originalParams.pagination.el=t),oe(f)&&i&&(u.params.scrollbar.el=i,u.originalParams.scrollbar.el=i),u.init(e)}function je(e,n,a,t,i){const u=[];if(!n)return u;const f=l=>{u.indexOf(l)<0&&u.push(l)};if(a&&t){const l=t.map(i),s=a.map(i);l.join("")!==s.join("")&&f("children"),t.length!==a.length&&f("children")}return ne.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in e&&l in n)if(U(e[l])&&U(n[l])){const s=Object.keys(e[l]),p=Object.keys(n[l]);s.length!==p.length?f(l):(s.forEach(g=>{e[l][g]!==n[l][g]&&f(l)}),p.forEach(g=>{e[l][g]!==n[l][g]&&f(l)}))}else e[l]!==n[l]&&f(l)}),u}const Pe=e=>{!e||e.destroyed||!e.params.virtual||e.params.virtual&&!e.params.virtual.enabled||(e.updateSlides(),e.updateProgress(),e.updateSlidesClasses(),e.emit("_virtualUpdated"),e.parallax&&e.params.parallax&&e.params.parallax.enabled&&e.parallax.setTranslate())};function q(){return q=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t])}return e},q.apply(this,arguments)}function ce(e){return e.type&&e.type.displayName&&e.type.displayName.includes("SwiperSlide")}function de(e){const n=[];return M.Children.toArray(e).forEach(a=>{ce(a)?n.push(a):a.props&&a.props.children&&de(a.props.children).forEach(t=>n.push(t))}),n}function Te(e){const n=[],a={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return M.Children.toArray(e).forEach(t=>{if(ce(t))n.push(t);else if(t.props&&t.props.slot&&a[t.props.slot])a[t.props.slot].push(t);else if(t.props&&t.props.children){const i=de(t.props.children);i.length>0?i.forEach(u=>n.push(u)):a["container-end"].push(t)}else a["container-end"].push(t)}),{slides:n,slots:a}}function Re(e,n,a){if(!a)return null;const t=p=>{let g=p;return p<0?g=n.length+p:g>=n.length&&(g=g-n.length),g},i=e.isHorizontal()?{[e.rtlTranslate?"right":"left"]:`${a.offset}px`}:{top:`${a.offset}px`},{from:u,to:f}=a,h=e.params.loop?-n.length:0,l=e.params.loop?n.length*2:n.length,s=[];for(let p=h;p<l;p+=1)p>=u&&p<=f&&s.push(n[t(p)]);return s.map((p,g)=>M.cloneElement(p,{swiper:e,style:i,key:p.props.virtualIndex||p.key||`slide-${g}`}))}function H(e,n){return typeof window>"u"?o.useEffect(e,n):o.useLayoutEffect(e,n)}const Q=o.createContext(null),Le=o.createContext(null),ue=o.forwardRef(({className:e,tag:n="div",wrapperTag:a="div",children:t,onSwiper:i,...u}={},f)=>{let h=!1;const[l,s]=o.useState("swiper"),[p,g]=o.useState(null),[j,E]=o.useState(!1),O=o.useRef(!1),C=o.useRef(null),c=o.useRef(null),d=o.useRef(null),N=o.useRef(null),x=o.useRef(null),b=o.useRef(null),P=o.useRef(null),R=o.useRef(null),{params:T,passedParams:m,rest:_,events:L}=Ne(u),{slides:y,slots:A}=Te(t),w=()=>{E(!j)};Object.assign(T.on,{_containerClasses(S,I){s(I)}});const D=()=>{Object.assign(T.on,L),h=!0;const S={...T};if(delete S.wrapperClass,c.current=new pe(S),c.current.virtual&&c.current.params.virtual.enabled){c.current.virtual.slides=y;const I={cache:!1,slides:y,renderExternal:g,renderExternalUpdate:!1};$(c.current.params.virtual,I),$(c.current.originalParams.virtual,I)}};C.current||D(),c.current&&c.current.on("_beforeBreakpoint",w);const B=()=>{h||!L||!c.current||Object.keys(L).forEach(S=>{c.current.on(S,L[S])})},F=()=>{!L||!c.current||Object.keys(L).forEach(S=>{c.current.off(S,L[S])})};o.useEffect(()=>()=>{c.current&&c.current.off("_beforeBreakpoint",w)}),o.useEffect(()=>{!O.current&&c.current&&(c.current.emitSlidesClasses(),O.current=!0)}),H(()=>{if(f&&(f.current=C.current),!!C.current)return c.current.destroyed&&D(),Ee({el:C.current,nextEl:x.current,prevEl:b.current,paginationEl:P.current,scrollbarEl:R.current,swiper:c.current},T),i&&!c.current.destroyed&&i(c.current),()=>{c.current&&!c.current.destroyed&&c.current.destroy(!0,!1)}},[]),H(()=>{B();const S=je(m,d.current,y,N.current,I=>I.key);return d.current=m,N.current=y,S.length&&c.current&&!c.current.destroyed&&Ce({swiper:c.current,slides:y,passedParams:m,changedParams:S,nextEl:x.current,prevEl:b.current,scrollbarEl:R.current,paginationEl:P.current}),()=>{F()}}),H(()=>{Pe(c.current)},[p]);function v(){return T.virtual?Re(c.current,y,p):y.map((S,I)=>M.cloneElement(S,{swiper:c.current,swiperSlideIndex:I}))}return M.createElement(n,q({ref:C,className:ie(`${l}${e?` ${e}`:""}`)},_),M.createElement(Le.Provider,{value:c.current},A["container-start"],M.createElement(a,{className:ye(T.wrapperClass)},A["wrapper-start"],v(),A["wrapper-end"]),le(T)&&M.createElement(M.Fragment,null,M.createElement("div",{ref:b,className:"swiper-button-prev"}),M.createElement("div",{ref:x,className:"swiper-button-next"})),oe(T)&&M.createElement("div",{ref:R,className:"swiper-scrollbar"}),se(T)&&M.createElement("div",{ref:P,className:"swiper-pagination"}),A["container-end"]))});ue.displayName="Swiper";const K=o.forwardRef(({tag:e="div",children:n,className:a="",swiper:t,zoom:i,lazy:u,virtualIndex:f,swiperSlideIndex:h,...l}={},s)=>{const p=o.useRef(null),[g,j]=o.useState("swiper-slide"),[E,O]=o.useState(!1);function C(x,b,P){b===p.current&&j(P)}H(()=>{if(typeof h<"u"&&(p.current.swiperSlideIndex=h),s&&(s.current=p.current),!(!p.current||!t)){if(t.destroyed){g!=="swiper-slide"&&j("swiper-slide");return}return t.on("_slideClass",C),()=>{t&&t.off("_slideClass",C)}}}),H(()=>{t&&p.current&&!t.destroyed&&j(t.getSlideClasses(p.current))},[t]);const c={isActive:g.indexOf("swiper-slide-active")>=0,isVisible:g.indexOf("swiper-slide-visible")>=0,isPrev:g.indexOf("swiper-slide-prev")>=0,isNext:g.indexOf("swiper-slide-next")>=0},d=()=>typeof n=="function"?n(c):n,N=()=>{O(!0)};return M.createElement(e,q({ref:p,className:ie(`${g}${a?` ${a}`:""}`),"data-swiper-slide-index":f,onLoad:N},l),i&&M.createElement(Q.Provider,{value:c},M.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof i=="number"?i:void 0},d(),u&&!E&&M.createElement("div",{className:"swiper-lazy-preloader",ref:x=>{x&&(x.lazyPreloaderManaged=!0)}}))),!i&&M.createElement(Q.Provider,{value:c},d(),u&&!E&&M.createElement("div",{className:"swiper-lazy-preloader",ref:x=>{x&&(x.lazyPreloaderManaged=!0)}})))});K.displayName="SwiperSlide";const X=100;function k(e){return e<=400?1:e<=720?2:e<=1080?3:e<=1360?4:e<=1680?5:6}function ee(e){const a=e.type===2?e.cover:e.images?.[0];return typeof a=="string"?a:""}function z(e){const n=Number(e);return Number.isFinite(n)&&n>0?n:void 0}function Ie(e){const n=e,a=z(n.width)??z(n.imageWidth)??z(n.coverWidth),t=z(n.height)??z(n.imageHeight)??z(n.coverHeight);return a!=null&&t!=null?t/a:e.type===2?1.2:1.55}function Me(e,n){const a=Math.max(1,n),t=Array.from({length:a},()=>[]),i=Array.from({length:a},()=>0);for(const u of e){let f=0;for(let h=1;h<a;h+=1)i[h]<i[f]&&(f=h);t[f].push(u),i[f]+=Ie(u.post)}return t}function Oe(e){let n=e?.parentElement??null;for(;n!=null;){const t=window.getComputedStyle(n).overflowY;if((t==="auto"||t==="scroll")&&n.scrollHeight>n.clientHeight)return n;n=n.parentElement}return null}function Ae(){const{t:e}=Y(),n=me(_=>_.requestMakeSame),[a,t]=o.useState([]),[i,u]=o.useState(1),[f,h]=o.useState(!0),[l,s]=o.useState(!1),[p,g]=o.useState(!1),[j,E]=o.useState(null),[O,C]=o.useState(()=>typeof window>"u"?6:k(window.innerWidth)),c=o.useRef(!1),d=o.useRef(null),N=o.useRef(!1),x=o.useRef(new Set),b=o.useCallback(async(_,L)=>{if(!(L&&(N.current||x.current.has(_)))){L&&(N.current=!0),L?g(!0):(x.current.clear(),s(!0)),E(null);try{const y=await ge({page:_,pageSize:X}),A=Array.isArray(y?.data?.list)?y.data.list:[],w=A.map((D,B)=>({key:`${String(D.id??"p")}-${_}-${B}`,post:D})).filter(({post:D})=>ee(D)!=="");t(D=>{if(!L)return w;const B=new Set(D.map(v=>v.key)),F=w.filter(v=>!B.has(v.key));return F.length===0?D:[...D,...F]}),h(A.length>=X),u(_),x.current.add(_)}catch(y){const A=y instanceof Error?y.message:e("pages.explore.feed.loadFailed");E(A),L||t([]),h(!1)}finally{L?(N.current=!1,g(!1)):s(!1)}}},[e]);o.useEffect(()=>{c.current||(c.current=!0,b(1,!1))},[b]),o.useEffect(()=>{const _=()=>{C(k(window.innerWidth))};return window.addEventListener("resize",_),()=>{window.removeEventListener("resize",_)}},[]);const P=l||p,R=Me(a,O);o.useEffect(()=>{if(!f||P)return;const _=d.current;if(_==null)return;const L=Oe(_),y=new IntersectionObserver(A=>{A.some(w=>w.isIntersecting)&&(N.current||b(i+1,!0))},{root:L,rootMargin:"1040px 0px",threshold:0});return y.observe(_),()=>y.disconnect()},[f,P,i,b]);const T=o.useCallback(_=>{he({assetId:_.id})},[]),m=o.useCallback(_=>{if(!(_.id==null||_.id==="")){if(_.type==4){n(_.id,"template");return}n(_.id)}},[n]);return r.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-explore",role:"tabpanel","aria-labelledby":"explore-feed-tab-explore",children:[j!=null?r.jsx("p",{className:"explorePage__feedError",role:"alert",children:j}):null,l&&a.length===0?r.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,r.jsx("div",{className:"explorePage__feedGrid explorePage__feedGrid--masonry",children:R.map((_,L)=>r.jsx("div",{className:"explorePage__feedMasonryColumn",children:_.map(({post:y,key:A})=>{y.type;const w=ee(y);return r.jsxs("article",{className:"explorePage__feedCard",onClick:()=>T(y),children:[r.jsx("div",{className:"explorePage__feedCardMedia",children:r.jsx("img",{src:w,loading:"lazy",decoding:"async"})}),r.jsxs("div",{className:"explorePage__feedCardBottom",children:[r.jsxs("div",{className:"explorePage__feedCardFooter explorePage__feedCardFooter--video",children:[r.jsxs("div",{className:"explorePage__feedCardUser",children:[r.jsx("div",{className:"explorePage__feedCardAvatar",children:y.userAvatar?r.jsx("img",{src:y.userAvatar}):r.jsx("span",{className:"explorePage__feedCardAvatarPh","aria-hidden":!0})}),r.jsx("span",{className:"explorePage__feedCardName",children:y.userName})]}),r.jsxs("div",{className:"explorePage__feedCardStats",children:[r.jsxs("span",{className:"explorePage__feedCardStat",children:[r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_look-B3mblBMS.png",import.meta.url).href}),r.jsx("span",{className:"explorePage__feedCardStatNum",children:y.lookNum})]}),r.jsxs("span",{className:"explorePage__feedCardStat",children:[y.userLiked?r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_active-C1GDW4GU.png",import.meta.url).href}):r.jsx("img",{className:"explorePage__feedStatIcon",src:new URL("/assets/ic_like_white-DdFasbWY.png",import.meta.url).href}),r.jsx("span",{className:"explorePage__feedCardStatNum",children:y.likeNum})]})]})]}),r.jsx("div",{className:"explorePage__feedCardCta",role:"presentation",onClick:D=>{D.stopPropagation(),D.preventDefault(),m(y)},children:e("pages.assetDetails.makeSame")})]})]},A)})},`col-${L}`))}),f&&a.length>0?r.jsx("div",{className:"explorePage__feedSentinel",ref:d,"aria-hidden":!0}):null,p?r.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}const te=50;function De(){const{t:e}=Y(),n=ae(x=>x.requestTemplateSelect),[a,t]=o.useState([]),[i,u]=o.useState(1),[f,h]=o.useState(!0),[l,s]=o.useState(!1),[p,g]=o.useState(!1),[j,E]=o.useState(null),O=o.useRef(!1),C=o.useRef(null),c=o.useCallback(async(x,b)=>{b?g(!0):s(!0),E(null);try{const R=(await re({page:x,pageSize:te}))?.data?.list??[];t(T=>b?[...T,...R]:R),h(R.length>=te),u(x)}catch(P){const R=P instanceof Error?P.message:e("pages.explore.feed.loadFailed");E(R),b||t([]),h(!1)}finally{b?g(!1):s(!1)}},[e]);o.useEffect(()=>{O.current||(O.current=!0,c(1,!1))},[c]);const d=l||p,N=o.useCallback(x=>{const b=x?.id;b==null||b===""||n(b)},[n]);return o.useEffect(()=>{if(!f||d)return;const x=C.current;if(x==null)return;const b=new IntersectionObserver(P=>{P.some(R=>R.isIntersecting)&&c(i+1,!0)},{root:null,rootMargin:"240px",threshold:0});return b.observe(x),()=>b.disconnect()},[f,d,i,c]),r.jsxs("div",{className:"explorePage__feedPanel",id:"explore-feed-panel-template",role:"tabpanel","aria-labelledby":"explore-feed-tab-template",children:[j!=null?r.jsx("p",{className:"explorePage__feedError",role:"alert",children:j}):null,l&&a.length===0?r.jsx("p",{className:"explorePage__feedLoading",children:e("common.loading")}):null,r.jsx("div",{className:"explorePage__feedGrid",children:a.map(x=>r.jsxs("article",{className:"explorePage__tplCard",children:[r.jsx("div",{className:"explorePage__tplCardMedia",children:r.jsx("img",{src:x.coverUrl,loading:"lazy",decoding:"async"})}),r.jsxs("div",{className:"explorePage__tplCardOverlay",children:[r.jsxs("div",{className:"explorePage__tplCardChip",children:[r.jsx("img",{className:"explorePage__tplCardChipIcon",src:new URL("/assets/ic_template_chip-CWZEuWV8.png",import.meta.url).href,width:12,height:12}),r.jsx("p",{className:"explorePage__tplCardChipText",children:x.title})]}),r.jsx("div",{className:"explorePage__tplCardCtaRow",children:r.jsx("div",{className:"explorePage__tplCardCta",role:"button",tabIndex:0,onClick:()=>N(x),onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&(b.preventDefault(),N(x))},children:e("pages.create.inspiration.templateLibrary.useTemplate")})})]})]},x.id))}),f&&a.length>0?r.jsx("div",{className:"explorePage__feedSentinel",ref:C,"aria-hidden":!0}):null,p?r.jsx("p",{className:"explorePage__feedLoading explorePage__feedLoading--more",children:e("pages.explore.feed.loadingMore")}):null]})}function Ve(){const{t:e}=Y(),n=ae(d=>d.requestTemplateSelect),a=be(),[t,i]=o.useState([]),[u,f]=o.useState([]),[h,l]=o.useState("template"),[s,p]=o.useState(""),g=o.useMemo(()=>ve(),[]);o.useEffect(()=>{xe({type:1,page:1,pageSize:9}).then(d=>{const N=d?.data?.list??d?.list??[];i(N.slice(0,9))}).catch(()=>{i([])})},[]),o.useEffect(()=>{re({page:1,pageSize:3}).then(d=>{f((d?.data?.list??[]).slice(0,3))}).catch(()=>{f([])})},[]),o.useEffect(()=>{_e().then(d=>{p(d?.systemConfig?.usageTutorialPageUrl??"")}).catch(()=>{p("")})},[]),o.useEffect(()=>{g.warmupPreviewImages(t.map(d=>d?.threeViewImage))},[g,t]),o.useEffect(()=>()=>{g.dispose()},[g]);const j=t.slice(0,4),E=t.slice(4,9),O=()=>{l("template"),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.getElementById("explore-feed-panel-template")?.scrollIntoView({behavior:"smooth",block:"start"})})})},C=()=>{window.open("https://www.douyin.com/user/MS4wLjABAAAAkjUYHoR-6ZcKI4HEMtHrrzCR6xfsragqmo6eJmshyz0fimmsdY9v6UtHPdjnFQTQ","_blank")},c=(d,N)=>{g.startImageDrag({evt:d,dragUrl:N,previewUrl:N})};return r.jsxs("div",{className:"explorePage",children:[r.jsx("section",{className:"explorePage__hero",children:r.jsxs(ue,{className:"explorePage__heroSwiper",modules:[Se],slidesPerView:1,loop:!0,autoplay:{delay:1e5,disableOnInteraction:!1},children:[r.jsx(K,{className:"explorePage__heroSlide",children:r.jsxs("div",{className:"heroSlideItem1",style:{backgroundImage:`url(${new URL("/assets/hero-image1-CKYMumeE.png",import.meta.url).href})`},children:[r.jsx("img",{className:"heroSlideItem1Icon",src:new URL("/assets/heroTitleIcon1-BJUREaJu.png",import.meta.url).href}),r.jsx("p",{className:"heroSlideItem1Desc",children:e("pages.explore.hero.banner1Desc")}),r.jsx("button",{className:"heroSlideItem1Btn",type:"button",onClick:()=>{s&&window.open(s,"_blank")},children:e("pages.explore.hero.watchTutorial")})]})}),r.jsx(K,{className:"explorePage__heroSlide",children:r.jsxs("div",{className:"heroSlideItem2",style:{backgroundImage:`url(${new URL("/assets/hero-image2-CxuiT-yq.png",import.meta.url).href})`},children:[r.jsx("img",{className:"heroSlideItem2Icon",src:new URL("/assets/heroTitleIcon2-CLoPUkJh.png",import.meta.url).href}),r.jsx("p",{className:"heroSlideItem2Desc",children:e("pages.explore.hero.banner2Desc")}),r.jsx("div",{className:"flex items-center gap-5",children:r.jsx("button",{className:"heroSlideItem2Btn",type:"button",onClick:()=>{a(W.CHARACTERS_CREATE)},children:e("index.hero.cta_create")})})]})})]})}),r.jsxs("section",{className:"explorePage__content",children:[r.jsxs("div",{className:"explorePage__leftColumn",children:[r.jsxs("div",{className:"explorePage__sectionHeader",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.officialRoles")}),r.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:()=>a(W.CHARACTERS),children:e("index.explore_more")})]}),r.jsxs("div",{className:"explorePage__officialTop",children:[r.jsx("article",{className:"explorePage__officialMainCard",children:r.jsx("img",{src:new URL("/assets/official-main-card-cBbbpmco.png",import.meta.url).href,draggable:!1})}),r.jsx("div",{className:"explorePage__officialTopGrid",children:j.map((d,N)=>r.jsxs("article",{className:"explorePage__roleCard",draggable:!0,onMouseEnter:()=>{g.ensurePreviewImage(d.threeViewImage)},onDragStart:x=>{c(x,d.threeViewImage)},onClick:()=>{J({id:d.id})},children:[r.jsx("img",{src:d.avatar,draggable:!1}),r.jsx("div",{className:"explorePage__roleTag",title:d.title,children:d.title})]},d?.id??`top-${N}`))})]}),r.jsx("div",{className:"explorePage__officialBottomGrid",children:E.map((d,N)=>r.jsxs("article",{className:"explorePage__roleCard",draggable:!0,onMouseEnter:()=>{g.ensurePreviewImage(d.threeViewImage)},onDragStart:x=>{c(x,d.threeViewImage)},onClick:()=>{J({id:d.id})},children:[r.jsx("img",{src:d.avatar,draggable:!1}),r.jsx("div",{className:"explorePage__roleTag",title:d.title,children:d.title})]},d?.id??`bottom-${N}`))})]}),r.jsxs("div",{className:"explorePage__rightColumn",children:[r.jsxs("div",{className:"explorePage__bannerGrid",children:[r.jsxs("section",{className:"explorePage__bannerGroup",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.diyRole")}),r.jsx("article",{className:"explorePage__bannerCard",onClick:()=>a(W.CHARACTERS_CREATE),children:r.jsx("img",{src:new URL("/assets/diy-role-card-BoNp16Az.png",import.meta.url).href})})]}),r.jsxs("section",{className:"explorePage__bannerGroup",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("pages.explore.sections.socialCases")}),r.jsx("article",{className:"explorePage__bannerCard",onClick:C,children:r.jsx("img",{src:new URL("/assets/social-media-card-CKmno838.png",import.meta.url).href})})]})]}),r.jsxs("div",{className:"explorePage__sectionHeader explorePage__sectionHeader--templates",children:[r.jsx("h2",{className:"explorePage__sectionTitle",children:e("index.ai_template_section.title")}),r.jsx("button",{className:"explorePage__moreBtn",type:"button",onClick:O,children:e("index.explore_more")})]}),r.jsx("div",{className:"explorePage__templateList",children:u.map(d=>r.jsxs("article",{className:"explorePage__templateCard",children:[r.jsx("img",{className:"explorePage__templateThumb",src:d.coverUrl}),r.jsxs("div",{className:"explorePage__templateBody",children:[r.jsx("h3",{className:"explorePage__templateTitle",children:d.title}),r.jsx("p",{className:"explorePage__templateDesc",title:d.desp,children:d.desp})]}),r.jsx("button",{className:"explorePage__templateAction",type:"button",onClick:()=>{n(d.id)},children:e("pages.explore.feed.makeNow")})]},d.id))})]})]}),r.jsxs("section",{className:"explorePage__feed","aria-label":e("pages.explore.feed.ariaSquare"),children:[r.jsxs("div",{className:"explorePage__feedTabs",role:"tablist",children:[r.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-template","aria-selected":h==="template","aria-controls":"explore-feed-panel-template",className:`explorePage__feedTab ${h==="template"?"explorePage__feedTab--active":""}`,onClick:()=>l("template"),children:e("pages.create.filters.template")}),r.jsx("button",{type:"button",role:"tab",id:"explore-feed-tab-explore","aria-selected":h==="explore","aria-controls":"explore-feed-panel-explore",className:`explorePage__feedTab ${h==="explore"?"explorePage__feedTab--active":""}`,onClick:()=>l("explore"),children:e("layout.nav.explore")})]}),r.jsxs("div",{className:"explorePage__feedTabPanels",children:[r.jsx("div",{className:"explorePage__feedTabPanel",hidden:h!=="explore",children:r.jsx(Ae,{})}),r.jsx("div",{className:"explorePage__feedTabPanel",hidden:h!=="template",children:r.jsx(De,{})})]})]})]})}export{Ve as default};
|
|
//# sourceMappingURL=index-BtiMA41K.js.map
|
|
|