Files
appco_dist/.output/public/_nuxt/FVfVRvfu.js
T

2 lines
8.7 KiB
JavaScript
Raw Normal View History

2026-01-27 16:02:45 +03:30
import{U as Se}from"./ScpmmaE4.js";import{d as ne,u as we,r as t,G as re,cZ as ke,k as be,H as ue,o as ce,af as de,bb as Ce,$ as se,ae,ai as Ie,y as f,z as l,a0 as A,A as u,R as k,C as b,T as ve,D as X,a1 as V,bR as U,a5 as ie,J as o,B as $,F as q,c_ as De,d0 as Ee,d1 as Le}from"./Cbt2tPBc.js";import{B as Y}from"./_OSaw0MT.js";import{d as Te}from"./SolGyfyY.js";import{_ as He,C as Re,i as oe}from"./BGrduSck.js";import{S as $e,a as Pe}from"./mPGATRDV.js";/* empty css */import{u as ze}from"./CLMw6_SR.js";import{e as le}from"./DGFRw2HL.js";import{r as Be}from"./DRgfp1up.js";import{s as Me}from"./B1N_kU_k.js";import{_ as Ue}from"./DlAUqK2U.js";const Ae={class:"flex full_story z-400 justify-center"},Xe={key:0,class:"absolute w-full top-0 right-0 left-0 z-1000"},qe={class:"flex items-center gap-2"},Ye={class:"relative"},je={class:"w-2.5rem h-2.5rem rounded-full",alt:""},Ne={key:0,src:He,alt:"",class:"w-15px absolute right-0 bottom-0 bg-white rounded-full"},Oe={class:"text-gray-200 text-shadow text-xs"},We={class:"w-full"},Ve={key:0,class:"absolute w-full bottom-0 right-0 left-0 z-1000 flex items-center gap8 px5 functions_area"},Fe={class:"flex flex-col items-center gap-2 text-white functions-area basic-icon-old"},Ge={class:"text-xs text-red-6"},Je={class:"flex flex-col items-center gap-2 text-white functions-area basic-icon-old"},Ze={class:"text-xs"},Ke=ne({__name:"HighlightStories",props:{id:{},specifyId:{type:Boolean,default:!1},stories:{},highlightId:{},cover:{},title:{}},emits:["update:id","refresh"],setup(p,{emit:P}){const L=we();t();const h=t(null),i=t(0),n=t(0),C=t(0);t("");const c=re(),v=p,_=P,m=t([]),s=t(null),{direction:j,isSwiping:z}=ke(s);t(!1),t(!1),t(!1);const B=be(()=>{if(v.stories?.length)return v.stories[i.value]});let T;const N=ze();ue();const x=t(!1),y=t(!1);t(!1);let I,H=!1,M=0,a=!1;function w(e){c.isSeller?L.push({name:"add-story"}):L.push({name:"user_detail-id",params:{id:B.value?.id}})}function D(e){F=e.touches[0].clientY,M=e.touches[0].clientX,a=!1,H=!1,I=setTimeout(()=>{H=!0,a||fe(e)},300)}function g(e){a||setTimeout(()=>{a=!0,clearTimeout(I)},50)}function R(e){clearTimeout(I);const r=s.value?.querySelector(".account-detail-area"),d=s.value?.querySelector(".functions_area");r&&r.contains(e.target)||d&&d.contains(e.target)||(e.preventDefault(),!H&&!a?Q(e):me(e))}function fe(e){const r=s.value?.querySelector(".account-detail-area"),d=s.value?.querySelector(".functions_area");r&&r.contains(e.target)||d&&d.contains(e.target)||(e.preventDefault(),e.stopPropagation(),x.value=!0,O())}function me(e){e.preventDefault(),e.stopPropagation(),x.value&&Z(),x.value=!1}let F=0;function G(e){(e.touches[0]?.clientY??0)-F>0&&e.preventDefault()}ce(()=>{i.value=v.stories?.findIndex(e=>e?.media?.id===v.id),h.value.activeIndex=i.value,i.value===0&&J(),s.value?.addEventListener("touchstart",D),s.value?.addEventListener("touchend",R),s.value?.addEventListener("touchmove",g),s.value?.addEventListener("touchcancel",R),s.value?.addEventListener("touchmove",G,{passive:!1})}),de(()=>{s.value?.removeEventListener("touchstart",D),s.value?.removeEventListener("touchend",R),s.value?.addEventListener("touchmove",g),s.value?.removeEventListener("touchcancel",R),s.value?.removeEventListener("touchmove",G)}),Ce(()=>{z.value&&j.value==="down"&&_("update:id",void 0)}),se(i,async e=>{await J()});async function J(){C.value=v.stories?.length,m.value=[],await ae(),h.value&&(h.value.activeIndex=i.value);for(let e=0;e<C.value;e++)m.value.push(0);O(),Z()}const he=e=>{h.value=e,y.value=!0},ge=e=>{if(!y.value)return;const r=e?.activeIndex;n.value!==r&&(n.value=r)};function Z(){T=Me(()=>{n.value<m.value.length&&(m.value[n.value]+=10,m.value[n.value]>100&&K())},1e3)}function O(){clearInterval(T),T=void 0}function K(){C.value>n.value+1?n.value++:(O(),n.value=0,_e())}function pe(){n.value!==0?n.value--:xe()}function _e(){v.specifyId?_("update:id",void 0):N.users.length>i.value+1?i.value++:_("update:id",void 0)}function Q(e){if(e.target.closest(".basic-icon-old"))return;const d=s.value?.querySelector(".account-detail-area"),S=s.value?.querySelecto