1import{h as ne,a as r,o as a,b as e,n as z,d as m,e as p,t as l,g as n,$ as oe,l as ae,m as re,c as J,a0 as ie,F as _,i as G,w as le,v as ue,f as K,x as de,aa as me,k as pe}from"./voWHtEk9.js";import{s as k,t as c}from"./BBhbi0l8.js";import{f as ce,p as we}from"./B2uZP99Z.js";import{t as ge,o as fe}from"./CCU57DXy.js";import{u as he}from"./DkcorGZH.js";import{u as _e,a as ke}from"./BSe5gUgm.js";const be={class:"rounded-lg flex items-end gap-2 w-full"},ve={key:0,class:"relative h-6 mb-2"},ye=["innerHTML"],xe={class:"text-sm mt-3 flex items-center justify-between gap-3"},Ce={class:"text-xs font-semibold opacity-60 flex items-center"},$e={class:"font-semibold text-xs"},He=["datetime"],Ne={class:"flex items-center justify-end gap-3"},Ae={key:0,class:"flex items-center space-x-1 gap-1.5 text-black bg-gray-200 px-2 rounded-full pt-0.5"},Ve={key:0},Le={key:1,class:"flex items-center space-x-1 gap-1.5 text-black bg-gray-200 px-2 rounded-full pt-0.5"},Pe={key:0},Te={class:"w-9 h-9 bg-pink-600 rounded-full flex-shrink-0 text-white flex items-center justify-center"},Me={key:0,class:"text-xs font-bold"},je={key:1,class:"text-sm font-medium"},Se=ne({__name:"AnswerItem",props:{answer:{},parentAnswer:{}},setup(W){const w=t=>new Date(t).toISOString();return(t,u)=>{var g,h;return a(),r("article",be,[e("div",{class:z([{"bg-[#f0f8ee] !border-[#e2f7de]":t.answer.is_boosted},"bg-[#F9F9F9] border border-[#ebebeb] rounded-xl rounded-bl-none text-x text-black p-2 pt-2 relative flex-1"])},[t.parentAnswer?(a(),r("div",ve,[e("div",{class:z([{"bg-emerald-100 !border-emerald-500":t.parentAnswer.is_boosted},"border-s-2 px-1 items-center justify-between whitespace-nowrap text-sm rounded-md text-ellipsis max-w-full overflow-hidden absolute inset-0 opacity-75"])},[u[0]||(u[0]=e("span",{class:"font-medium"},"در پاسخ بÙ:",-1)),p(" "+l(("stripHTML"in t?t.stripHTML:n(k))(t.parentAnswer.answer,160)),1)],2)])):m("",!0),e("div",{class:"text-sm leading-loose whitespace-pre-line break-words",innerHTML:t.answer.answer},null,8,ye),e("footer",xe,[e("div",Ce,[e("p",$e,l(t.answer.user.first_name||t.answer.user.last_name?`${t.answer.user.first_name} ${t.answer.user.last_name}`:"کاربر ÙØ§Ø´Ùاس")+" - ",1),t.answer.created_at?(a(),r("time",{key:0,datetime:w(t.answer.created_at)},l(("toPersianNumbers"in t?t.toPersianNumbers:n(c))(("formatTimeAgo"in t?t.formatTimeAgo:n(ce))(("parseToUnixTimestamp"in t?t.parseToUnixTimestamp:n(we))(t.answer.created_at)))),9,He)):m("",!0)]),e("div",Ne,[t.answer.like_count&&t.answer.like_count>0?(a(),r("span",Ae,[u[1]||(u[1]=p(" ð ")),t.answer.like_count>1?(a(),r("span",Ve,l(("toPersianNumbers"in t?t.toPersianNumbers:n(c))(String(t.answer.like_count))),1)):m("",!0)])):m("",!0),t.answer.dislike_count&&t.answer.dislike_count>0?(a(),r("span",Le,[u[2]||(u[2]=p(" ð ")),t.answer.dislike_count>1?(a(),r("span",Pe,l(("toPersianNumbers"in t?t.toPersianNumbers:n(c))(String(t.answer.dislike_count))),1)):m("",!0)])):m("",!0)])])],2),e("div",Te,[t.answer.user.first_name||t.answer.user.last_name?(a(),r("span",Me,[p(l(((g=t.answer.user.first_name)==null?void 0:g[0])||"")+" ",1),u[3]||(u[3]=e("span",{class:"w-[0.5px] inline-block"},null,-1)),p(" "+l(((h=t.answer.user.last_name)==null?void 0:h[0])||""),1)])):(a(),r("span",je,"?"))])])}}}),De={class:"pt-3 bg-[#f7f7f7] min-h-[80vh]"},qe={class:"max-w-4xl md:mx-auto"},Be={class:"relative pt-9 pb-5 px-4 bg-white lg:rounded-2xl"},Ie={key:0,class:"text-xl font-bold text-gray-800"},Re={class:"text-xs mt-1 font-normal text-gray-500"},Ue=["datetime"],Ze={class:"absolute top-0 z-10 left-10 -mt-2"},Fe={class:"mt-3"},Oe=["innerHTML"],Ee={class:"mt-2 mb-2"},Qe={class:"px-6 py-1 flex justify-between items-center text-sm text-[#444]"},ze={class:"flex flex-1 gap-1"},Je={class:"flex items-center justify-end gap-1"},Ge={class:"flex flex-1 items-center justify-end gap-3"},Ke={class:"flex items-center gap-0.5"},We={class:"flex items-center gap-0.5"},Xe={class:"relative pt-5 pb-5 px-3 bg-white lg:rounded-2xl"},Ye={class:"min-h-scree flex flex-col gap-6"},et={key:0},b="پرسش ٠پاسخâÙØ§Û کاربرا٠| ÙÙ
دÙ
",v="پرØ
1³Ø´ ٠پاسخâÙØ§Û کاربرا٠در Ø³Ø§ÛØª ÙÙ
دÙ
Ø Ø¨Ù ÙÙ
را٠پاسخâÙØ§Û Ù
Ø´Ø§ÙØ±Ø§Ù ٠کاربراÙ.",it={__name:"[slug]",async setup(W){var $,H,N,A,V,L,P,T,M,j,S,D,q,B,I,R,U,Z,F;let w,t;const u=oe(),g=u.params.slug,h=me(),{$api:y}=ae(),{data:x}=([w,t]=re(async()=>he(`question-${g}-page`,async()=>{const[o,i]=await Promise.all([y(h.public.PORSAN_BASE_URL+`questions/questions/${g}/`,{method:"get"}),y(h.public.PORSAN_BASE_URL+`questions/questions/${g}/answers/`,{method:"get"})]);return{question:o,answers:i}})),w=await w,t(),w),s=J(()=>x.value.question),d=J(()=>x.value.answers.results),X=o=>new Date(o).toISOString(),Y=o=>new Date(o).toLocaleDateString("fa-IR",{year:"numeric",month:"long",day:"numeric"}),ee=`https://hamdamapp.ir/question/${u.params.slug}`;try{_e({title:(($=s.value)==null?void 0:$.title)||b,description:k((H=s.value)==null?void 0:H.content,160)||v,ogTitle:((N=s.value)==null?void 0:N.title)||b,ogDescription:k((A=s.value)==null?void 0:A.content,160)||v,ogType:"article",ogUrl:ee,ogImage:((L=(V=s.value)==null?void 0:V.category_object)==null?void 0:L.icon)||fe,twitterCard:"summary_large_image",twitterTitle:((P=s.value)==null?void 0:P.title)||b,twitterDescription:k((T=s.value)==null?void 0:T.content,160)||v,twitterImage:((j=(M=s.value)==null?void 0:M.category_object)==null?void 0:j.icon)||ge}),ke({htmlAttrs:{lang:"fa"},link:[{rel:"icon",type:"image/png",href:"/favicon/android-chrome-192x192.png"}],script:[{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"QAPage",mainEntity:{"@type":"Question",name:((S=s.value)==null?void 0:S.title)||"Ø³ÙØ§Ù بدÙ٠عÙÙØ§Ù",text:k((D=s.value)==null?void 0:D.content,160)||"بدÙÙ ØªÙØ¶ÛØØ§Øª",dateCreated:((q=s.value)==null?void 0:q.created_at)||"",author:{"@type":"Person",name:(B=s.value)!=null&&B.is_anonymouse?"کاربر ÙØ§Ø´Ùاس":`کاربر ${(R=(I=s.value)==null?void 0:I.user)==null?void 0:R.id}`},answerCount:((U=d.value)==null?void 0:U.length)||0,acceptedAnswer:(Z=d.value)!=null&&Z.length?{"@type":"Answer",text:d.value[0].answer,dateCreated:d.value[0].created_at,upvoteCount:d.value[0].like_count||0,author:{"@type":"Person",name:`${d.value[0].user.first_name} ${d.value[0].user.last_name}`}}:null,suggestedAnswer:(F=d.value)==null?void 0:F.slice(1).map(o=>({"@type":"Answer",text:o.answer,dateCreated:o.created_at,upvoteCount:o.like_count||0,author:{"@type":"Person",name:`${o.user.first_name} ${o.user.last_name}`}}))}})}]})}catch(o){console.log(o)}const C=ie(),te=()=>{window.history.length>2?C.back():C.push("/questions")};return(o,i)=>{var E;const se=de,O=Se;return a(),r("main",De,[e("div",qe,[e("div",{class:"flex items-center justify-between mb-3 mx-3"},[e("button",{class:"flex items-center text-sm text-pink-700 hover:text-pink-800 transition-colors duration-300",onClick:te},i[0]||(i[0]=[e("svg",{xmlns:"http://www.w3.org/2000/svg",class:"h-5 w-5 ml-1 rotate-180",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor"},[e("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 19l-7-7 7-7"})],-1),e("span",null,"بازگشت",-1)]))]),e("article",null,[e("div",Be,[e("header",null,[n(s).title?(a(),r("h1",Ie,l(n(s).title),1)):m("",!0),e("div",Re,[e("span",null,[n(s).user.first_name?(a(),r(_,{key:0},[p(l(n(s).user.first_name),1)],64)):(a(),r(_,{key:1},[p(" ÙØ§Ø´Ùاس ")],64))]),n(s).created_at?(a(),r("time",{key:0,datetime:X(n(s).created_at)}," در "+l(Y(n(s).created_at)),9,Ue)):m("",!0)]),e("div",Ze,[i[1]||(i[1]=e("div",{class:"w-full h-2 rounded-t-full right-5 bg-[#6c0365]"},null,-1)),G(se,{prefetch:!1,to:`/questions?category=${n(s).category_object.slug}`,class:"block bg-[#b3096f] -mt-2 text-white font-bold rounded-b-xl px-5 pt-1.5 pb-1.5 mx-2.5 text-base"},{default:le(()=>[p(l(n(s).category_object.title),1)]),_:1},8,["to"])])]),e("div",Fe,[e("p",{class:"text-gray-900 font-normal text-[15px] leading-7",innerHTML:n(s).content},null,8,Oe)])]),e("footer",Ee,[e("div",Qe,[e("div",ze,[i[2]||(i[2]=ue('<svg width="18" height="18" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M3 8C3 7.44772 3.44772 7 4 7V7C4.55228 7 5 7.44772 5 8V22H3V8Z" fill="#444444"></path>
1<path d="M8 14C8 13.4477 8.44772 13 9 13V13C9.55228 13 10 13.4477 10 14V22H8V14Z" fill="#444444"></path><path d="M13 4C13 3.44771 13.4477 3 14 3V3C14.5523 3 15 3.44772 15 4V22H13V4Z" fill="#444444"></path><path d="M18 11C18 10.4477 18.4477 10 19 10V10C19.5523 10 20 10.4477 20 11V22H18V11Z" fill="#444444"></path></svg>',1)),e("span",null,l(("toPersianNumbers"in o?o.toPersianNumbers:n(c))(n(s).views_count)),1)]),e("div",Je,[i[3]||(i[3]=e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M8.5 19H8C4 19 2 18 2 13V8C2 4 4 2 8 2H16C20 2 22 4 22 8V13C22 17 20 19 16 19H15.5C15.19 19 14.89 19.15 14.7 19.4L13.2 21.4C12.54 22.28 11.46 22.28 10.8 21.4L9.3 19.4C9.14 19.18 8.77 19 8.5 19Z",stroke:"#444444","stroke-width":"1.5","stroke-miterlimit":"10","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M7 8H17",stroke:"#444444","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M7 13H13",stroke:"#444444","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("span",null,l(("toPersianNumbers"in o?o.toPersianNumbers:n(c))(n(s).comment_count)),1)]),e("div",Ge,[e("button",Ke,[i[4]||(i[4]=e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M7.48047 17.35L10.5805 19.75C10.9805 20.15 11.8805 20.35 12.4805 20.35H16.2805C17.4805 20.35 18.7805 19.45 19.0805 18.25L21.4805 10.95C21.9805 9.55 21.0805 8.34997 19.5805 8.34997H15.5805C14.9805 8.34997 14.4805 7.84997 14.5805 7.14997L15.0805 3.94997C15.2805 3.04997 14.6805 2.04997 13.7805 1.74997C12.9805 1.44997 11.9805 1.84997 11.5805 2.44997L7.48047 8.54997",stroke:"#444444","stroke-width":"1.5","stroke-miterlimit":"10"}),e("path",{d:"M2.37988 17.3499V7.5499C2.37988 6.1499 2.97988 5.6499 4.37988 5.6499H5.37988C6.77988 5.6499 7.37988 6.1499 7.37988 7.5499V17.3499C7.37988 18.7499 6.77988 19.2499 5.37988 19.2499H4.37988C2.97988 19.2499 2.37988 18.7499 2.37988 17.3499Z",stroke:"#444444","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("span",null,l(("toPersianNumbers"in o?o.toPersianNumbers:n(c))(n(s).like_count)),1)]),e("button",We,[i[5]||(i[5]=e("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[e("path",{d:"M16.5197 6.6499L13.4197 4.2499C13.0197 3.8499 12.1197 3.6499 11.5197 3.6499H7.71973C6.51973 3.6499 5.21973 4.5499 4.91973 5.7499L2.51973 13.0499C2.01973 14.4499 2.91973 15.6499 4.41973 15.6499H8.41973C9.01973 15.6499 9.51973 16.1499 9.41973 16.8499L8.91973 20.0499C8.71973 20.9499 9.31973 21.9499 10.2197 22.2499C11.0197 22.5499 12.0197 22.1499 12.4197 21.5499L16.5197 15.4499",stroke:"#444444","stroke-width":"1.5","stroke-miterlimit":"10"}),e("path",{d:"M21.6201 6.65V16.45C21.6201 17.85 21.0201 18.35 19.6201 18.35H18.6201C17.2201 18.35 16.6201 17.85 16.6201 16.45V6.65C16.6201 5.25 17.2201 4.75 18.6201 4.75H19.6201C21.0201 4.75 21.6201 5.25 21.6201 6.65Z",stroke:"#444444","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"})],-1)),e("span",null,l(("toPersianNumbers"in o?o.toPersianNumbers:n(c))(n(s).dislike_count)),1)])])])])]),e("div",Xe,[e("section",Ye,[((E=n(d))==null?void 0:E.length)>0?(a(!0),r(_,{key:0},K(n(d),f=>(a(),r("div",{key:f.id},[G(O,{answer:f},null,8,["answer"]),Array.isArray(f.child_answers)&&f.child_answers.length>0?(a(),r("div",et,[(a(!0),r(_,null,K(f.child_answers,Q=>(a(),pe(O,{key:Q.id,class:"mt-2 w-full",answer:Q,"parent-answer":f},null,8,["answer","parent-answer"]))),128))])):m("",!0)]))),128)):(a(),r(_,{key:1},[p(" Ù¾Ø§Ø³Ø®Û ÙØ¬Ùد ÙØ¯Ø§Ø±Ø¯ ")],64))])])])])}}};export{it 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.