1import{d as N,b as _,k as $,C as I,f as a,u as t,g as i,a2 as L,a as v,o as s}from"./vendor.ab282fad.js";import{f as C,h as E,c as m,_ as p,r as h}from"../main.ae189850.js";import"./preload-helper.ae39bab8.js";const F={class:"c-bookmark__container"},R={key:0,class:"c-form__field c-field"},U={class:"c-field__wrapper"},B=["onClick"],q=["id","name","value","disabled","checked"],A={key:0,class:"c-loading__container"},G=["for"],S={key:1,class:"u-mtxs u-align-center"},T=["href"],O=N({props:{contentId:null,contentName:null},setup(n){const o=n,{loginURL:b}=C(),{isLogged:l}=E(),g=_(()=>k.loading||u.loading||f.loading),c=$(!1),d=_(()=>({following:`/api/${o.contentName}/${o.contentId}/following/`,follow:`/api/${o.contentName}/${o.contentId}/follow/`,unfollow:`/api/${o.contentName}/${o.contentId}/unfollow/`})),r=e=>new URL(e,window.location.href).toString(),k=m(async()=>{const e=r(d.value.following);return(await h(e)).following===!0},{success:e=>{c.value=e}}),u=m(async()=>{const e=r(d.value.follow);await h(e,{method:"GET"})},{success:()=>{c.value=!0}}),f=m(async()=>{const e=r(d.value.unfollow);await h(e,{method:"GET"})},{success:()=>{c.value=!1}}),x=()=>c.value?f.exec():u.exec(),y=_(()=>u.loading?!0:f.loading?!1:c.value);return I([l],async()=>{l.value&&await k.exec()},{immediate:!0}),(e,w)=>(s(),a("div",F,[t(l)?(s(),a("div",R,[i("div",U,[i("div",{class:"c-field__choice u-mt0",onClick:L(x,["prevent"])},[i("input",{id:"c-bookmark__checkbox-"+n.contentId,type:"checkbox",class:"c-bookmark__checkbox",name:n.contentName,value:n.contentName,disabled:!t(l)||t(g),checked:t(y)},null,8,q),t(g)?(s(),a("div",A,[v(p,{class:"loading-icon",width:"24",height:"24",name:"loading"})])):(s(),a("label",{key:1,for:"c-bookmark__checkbox-"+n.contentId,class:"c-bookmark__label"},null,8,G))],8,B)])])):(s(),a("div",S,[i("a",{href:t(b)},[v(p,{class:"c-button__icon",name:"star-empty"})],8,T)]))]))}});export{O as default}; 2//# sourceMappingURL=Bookmark.ce.b55b7c9d.js.map
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.