PageSourceSearch

https://asthma.net/_nuxt/B7hmZjMN.js

js asthma.net collected 2026-10-03 21:30:23 UTC 2,708 bytes, 10 lines download raw bytes

1import{aa as u,_ as b,o as k,c as i,b as p,n,f as h,t as y,q as m,y as s,S as r,aF as B,a6 as _,m as c,k as T}from"./Bv6rD22K.js";const g=u`
2  mutation updateBookmark($assocId: NexusId!, $assocType: Bookmarkable!, $isDelete: Boolean) {
3    updateBookmark(assocId: $assocId, assocType: $assocType, isDelete: $isDelete) {
4      assocId
5      assocType
6      id
7      insertedAt
8    }
9  }
10`,f={name:"BookmarkButton",props:{bookmarkable:{type:Object,required:!0},showText:{type:Boolean,default:!1}},computed:{...c(s,["user","userIsLoggedIn"]),...c(T,["siteHasFeature"]),isBookmarked(){return this.userIsLoggedIn&&this.user.bookmarks?.length?this.user.bookmarks.filter(t=>t.assocType===this.bookmarkPayload.assocType&&t.assocId===this.bookmarkPayload.assocId).length>0:!1},bookmarkPayload(){return{assocType:this.bookmarkableType.toUpperCase(),assocId:this.bookmarkable.id}},bookmarkableType(){return this.bookmarkable.type?this.bookmarkable.type.toUpperCase():"THREAD"},buttonText(){return this.isBookmarked?"Saved":"Save"}},methods:{...B(_,["openRegisterDialog"]),tryToBookmark(o){if(!this.userIsLoggedIn){this.openRegisterDialog({dialogText:"Create an account to bookmark this article."});return}this.$snowplow.trackButtonEvent({data:{type:`${this.isBookmarked?"unbookmark":"bookmark"}`,text:o.target.textContent.trim(),classes:o.target.classList,id:o.target.id}}),this.handleBookmarking()},handleBookmarking(){this.$apollo.mutate({mutation:g,variables:{assocId:this.bookmarkable.id,assocType:this.bookmarkableType,isDelete:this.isBookmarked},update(o){const t=Object.keys(o.data.data.ROOT_QUERY).filter(e=>/^bookmarkList/.test(e));t.length&&t.forEach(e=>{delete o.data.data.ROOT_QUERY[e]})}}).then(()=>{this.isBookmarked?(s().removeBookmarkFromCurrentUser(this.bookmarkPayload),r().addToastNotification({toastType:"success",description:"Your bookmark has been removed.",type:"Bookmarking"})):(s().addBookmarkToCurrentUser(this.bookmarkPayload),r().addToastNotification({toastType:"success",description:"Bookmarked!",type:"Bookmarking"}))}).catch(()=>{r().addGenericErrorNotification()})}}},I={key:0,class:"bookmark-button__text"};function x(o,t,e,C,S,a){const d=h;return o.siteHasFeature("Accounts")?(k(),i("button",{key:0,class:n(["bookmark-button text-button",{"bookmark-button--with-text":e.showText}]),onClick:t[0]||(t[0]=(...l)=>a.tryToBookmark&&a.tryToBookmark(...l))},[p(d,{name:"ribbon",title:"Bookmark for later",class:n(["bookmark-button__icon",{"bookmark-button__icon--filled":a.isBookmarked}])},null,8,["class"]),e.showText?(k(),i("p",I,y(a.buttonText),1)):m("",!0)],2)):m("",!0)}const O=Object.assign(b(f,[["render",x],["__scopeId","data-v-46176523"]]),{__name:"BookmarkButton"});export{O as _};

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.