import{d as T,S as k}from"./Ddgf_VTc.js";import{d as w,r as c,s as h,o as u,a as m,b as l,e as o,t as y,A as C,z as $,l as v,X as x,Y as N,n as b}from"./DGtjvSSZ.js";const S={class:"flex text-white/0"},V={key:0},I={key:1,class:"i-mdi-loading animate-spin"},R=w({__name:"Visits.client",props:{postId:{}},setup(t){const g=t,i=c(0),a=T("posts-visited",new Array(20),{serializer:k.object});async function p(){const s=g.postId,e=a.value.findIndex(n=>(n==null?void 0:n.id)===s),r=new Date().getTime();if(e===-1){a.value.unshift({id:s,ts:r}),a.value.splice(20),i.value=await $fetch(`/api/nc/visits/${s}?mode=hit`,{method:"POST"});return}if(a.value[e].ts+6e4<r){a.value[e].ts=r,i.value=await $fetch(`/api/nc/visits/${s}?mode=hit`,{method:"POST"});return}i.value=await $fetch(`/api/nc/visits/${s}?mode=read`,{method:"POST"})}return h(()=>{p()}),(s,e)=>(u(),m("div",S,[e[0]||(e[0]=l("p",{class:"mr-2"},"Visitas:",-1)),o(i)>=1?(u(),m("div",V,y(o(i)),1)):(u(),m("div",I))]))}}),F={class:"facebook-comments"},q={class:"facebook-comments-loading-spinner",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid",width:"30"},B=["data-href","data-numposts","data-width"],L=w({__name:"FacebookComments.client",props:{href:{},numposts:{default:5},width:{default:"100%"}},setup(t){const g=t,i=c(!1),a=c(!1),p=c(null),s=c(5),e=C(()=>g.href);$(a,()=>{a.value&&(i.value=!0,FB.XFBML.parse(p.value,()=>{i.value=!1}))}),h(()=>{let d=navigator.userAgent,n,f=d.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];if(/trident/i.test(f[1]))return n=/\brv[ :]+(\d+)/g.exec(d)||[],`IE ${n[1]||""}`;if(f[1]==="Chrome"&&(n=d.match(/\b(OPR|Edge)\/(\d+)/),n!=null))return n.slice(1).join(" ").replace("OPR","Opera");f=f[2]?[f[1],f[2]]:[navigator.appName,navigator.appVersion,"-?"],(n=d.match(/version\/(\d+)/i))!=null&&f.splice(1,1,n[1]),f.join(" ").includes("Safari")&&(s.value=30)});function r(){a.value=!0}return(d,n)=>(u(),m("div",null,[v(l("button",{type:"button",class:"mx-auto max-w-460px w-full flex justify-center rounded-8px bg-orange-color p-16px text-2.75 font-semibold leading-11px tracking-widest uppercase text-white",onClick:r}," mostrar comentarios ",512),[[x,!o(a)]]),v(l("div",F,[v((u(),m("svg",q,n[0]||(n[0]=[N('<g transform="translate(80,50)"><g transform="rotate(0)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="1" transform="scale(0.96457 0.96457)"><animateTransform attributeName="transform" type="scale" begin="-0.875s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.875s"></animate></circle></g></g><g transform="translate(71.21320343559643,71.21320343559643)"><g transform="rotate(45)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.875" transform="scale(0.95832 0.95832)"><animateTransform attributeName="transform" type="scale" begin="-0.75s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.75s"></animate></circle></g></g><g transform="translate(50,80)"><g transform="rotate(90)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.75" transform="scale(0.95207 0.95207)"><animateTransform attributeName="transform" type="scale" begin="-0.625s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.625s"></animate></circle></g></g><g transform="translate(28.786796564403577,71.21320343559643)"><g transform="rotate(135)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.625" transform="scale(0.99582 0.99582)"><animateTransform attributeName="transform" type="scale" begin="-0.5s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.5s"></animate></circle></g></g><g transform="translate(20,50.00000000000001)"><g transform="rotate(180)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.5" transform="scale(0.98957 0.98957)"><animateTransform attributeName="transform" type="scale" begin="-0.375s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.375s"></animate></circle></g></g><g transform="translate(28.78679656440357,28.786796564403577)"><g transform="rotate(225)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.375" transform="scale(0.98332 0.98332)"><animateTransform attributeName="transform" type="scale" begin="-0.25s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.25s"></animate></circle></g></g><g transform="translate(49.99999999999999,20)"><g transform="rotate(270)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.25" transform="scale(0.97707 0.97707)"><animateTransform attributeName="transform" type="scale" begin="-0.125s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="-0.125s"></animate></circle></g></g><g transform="translate(71.21320343559643,28.78679656440357)"><g transform="rotate(315)"><circle cx="0" cy="0" r="10" fill="#007aff" fill-opacity="0.125" transform="scale(0.97082 0.97082)"><animateTransform attributeName="transform" type="scale" begin="0s" values="0.95 0.95;1 1" keyTimes="0;1" dur="1s" repeatCount="indefinite"></animateTransform><animate attributeName="fill-opacity" keyTimes="0;1" dur="1s" repeatCount="indefinite" values="1;0" begin="0s"></animate></circle></g></g>',8)]),512)),[[x,o(i)]]),v(l("div",{ref_key:"fbComments",ref:p,class:"facebook-comments-container"},[l("div",{class:"fb-comments","data-href":o(e),"data-numposts":o(s),"data-width":d.width},null,8,B)],512),[[x,o(a)]])],512),[[x,o(a)]])]))}}),P={class:"relative my-10px w-full"},O=["for"],M={key:0},j=["id","type","value"],z=["id","type","value"],A=["id","type","value","autocomplete"],X=w({__name:"CbbInput",props:{modelValue:{required:!0},labelText:{type:String,required:!0},inputType:{type:String,required:!0},error:{type:String,required:!1},elementId:{type:String,required:!0},autocomplete:{type:Boolean,required:!1}},emits:["update:modelValue"],setup(t,{emit:g}){const i=c(!1),a=c(!1);function p(){a.value?a.value=!1:a.value=!0}return(s,e)=>(u(),m("div",P,[l("label",{for:t.elementId,class:b(["pointer-events-none absolute left-16px bg-light-50 text-16px font-medium text-black transition-top",[o(i)||t.modelValue?"-top-15% !text-11px px-8px":"top-14px"]])},y(t.labelText),11,O),t.inputType=="password"?(u(),m("div",M,[l("div",{class:"absolute right-7px top-8px m-auto h-36px w-36px cursor-pointer bg-light-50 text-18px text-black",onClick:p},[l("i",{class:b(["absolute bottom-0 left-0 right-0 top-0 m-auto block",[o(a)?"i-carbon-view-off-filled":"i-carbon-view-filled"]])},null,2)]),l("input",{id:t.elementId,type:[o(a)?"text":"password"],class:b(["box-border h-50px w-full border border-blue-gray-300 rounded-lg px-16px pr-40px text-15px font-medium text-black",[t.error?"border border-red-500 shadow-input-error outline-none":"focus:border focus:border-indigo-600 focus:shadow-input focus:outline-none"]]),minlength:"8",maxlength:"50",value:t.modelValue,onInput:e[0]||(e[0]=r=>s.$emit("update:modelValue",r.target.value)),onFocusin:e[1]||(e[1]=r=>i.value=!0),onFocusout:e[2]||(e[2]=r=>i.value=!1)},null,42,j)])):t.inputType=="textarea"?(u(),m("textarea",{key:1,id:t.elementId,type:t.inputType,class:b(["box-border h-100px w-full border border-blue-gray-300 rounded-lg px-16px pt-10px text-15px font-medium text-black",[t.error?"border border-red-500 shadow-input-error outline-none":"focus:border focus:border-orange-600 focus:shadow-input focus:outline-none"]]),maxlength:"500",value:t.modelValue,required:"",onInput:e[3]||(e[3]=r=>s.$emit("update:modelValue",r.target.value)),onFocusin:e[4]||(e[4]=r=>i.value=!0),onFocusout:e[5]||(e[5]=r=>i.value=!1)},null,42,z)):(u(),m("input",{key:2,id:t.elementId,type:t.inputType,class:b(["box-border h-50px w-full border border-blue-gray-300 rounded-lg px-16px text-15px font-medium text-black",[t.error?"border border-red-500 shadow-input-error outline-none":"focus:border focus:border-orange-600 focus:shadow-input focus:outline-none"]]),maxlength:"50",value:t.modelValue,autocomplete:t.autocomplete?"off":"",required:"",onInput:e[6]||(e[6]=r=>s.$emit("update:modelValue",r.target.value)),onFocusin:e[7]||(e[7]=r=>i.value=!0),onFocusout:e[8]||(e[8]=r=>i.value=!1)},null,42,A)),l("div",{class:b(["text-14px font-medium text-red-500",[t.error?"visible":"invisible"]])},y(t.error),3)]))}});export{X as _,R as a,L as b};