1"use strict";(self.webpackChunkwebpack=self.webpackChunkwebpack||[]).push([[383],{10383:function(t,e,a){a.r(e);var o=a(42799),s=a(72717),i=a(6910);class r extends o.o{constructor(t){super(t),this.wcBtnEvent="wc-bt-interactive-click",this.wcBtnSelector="wc-btn-interactive",this.init()}init(){r.bookmarkNextInstances.push(this),!0===this.parm.isBookmarkingEnabled&&this.parm.bookmarkType&&this.parm.bookmarkType.length>0&&(this.favoritesManager=s.Z.getInstance(this.parm.bookmarkType),this.myAccountManager=i.I.getInstance(),this.bindButtons(),this.fetchFavorites(),this.reInitCompsOnDomChangeFor(this.element),this.parm.isAuthenticated&&this.processPendingBookmark())}bindButtons(){const t=document.querySelectorAll(`[data-bookmark-type='${this.parm.bookmarkType}']`);t&&t.forEach((t=>{t.addEventListener(this.wcBtnEvent,(t=>{t.stopImmediatePropagation(),this.toggleBookmark(t,t.detail.dataID)}))}))}static refreshNeeded(){r.bookmarkNextInstances.forEach((t=>{t.bindButtons(),t.fetchFavorites(!0)}))}fetchFavorites(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.favoritesManager&&this.parm.isAuthenticated&&(!t&&r.bookmarks&&r.bookmarks.has(this.parm.bookmarkType)||r.isFetchingBookmarks.get(this.parm.bookmarkType)||(r.isFetchingBookmarks.set(this.parm.bookmarkType,!0),this.favoritesManager.listFavorites((t=>{t&&t.clone().json().then((t=>{const e=t;r.bookmarks.set(this.parm.bookmarkType,e),this.bindBookmarkStatus(),r.isFetchingBookmarks.set(this.parm.bookmarkType,!1)}))}))))}bindBookmarkStatus(){const t=r.bookmarks.get(this.parm.bookmarkType);document.querySelectorAll(`[data-bookmark-type='${this.parm.bookmarkType}'] ${this.wcBtnSelector}`).forEach((e=>{t.includes(e.dataset.id)?e.setAttribute("active","true"):e.removeAttribute("active")}))}toggleBookmark(t,e){if(!this.favoritesManager||!this.myAccountManager)return;if(!this.myAccountManager.isAuthenticated){sessionStorage.setItem("pendingBookmark",JSON.stringify({itemId:e,bookmarkType:this.parm.bookmarkType})),this.myAccountManager.login(t);const a=document.querySelector(`[data-bookmark-type='${this.parm.bookmarkType}'] ${this.wcBtnSelector}[data-id='${e}']`);return void requestAnimationFrame((()=>{a&&a.removeAttribute("active")}))}let a=r.bookmarks.get(this.parm.bookmarkType)??[];a.includes(e)?(a=a.filter((t=>t!==e)),this.favoritesManager.deleteFavorite(e,(t=>this.fetchFavorites(!0)))):(a.push(e),this.favoritesManager.addFavorite(e,(t=>this.fetchFavorites(!0)))),r.bookmarks.set(this.parm.bookmarkType,a)}processPendingBookmark(){const t=sessionStorage.getItem("pendingBookmark");if(t)try{const{itemId:e,bookmarkType:a}=JSON.parse(t);a===this.parm.bookmarkType&&(sessionStorage.removeItem("pendingBookmark"),this.favoritesManager.addFavorite(e,(()=>{this.fetchFavorites(!0)})))}catch(t){sessionStorage.removeItem("pendingBookmark")}}}r.bookmarks=new Map,r.bookmarkNextInstances=[],r.isFetchingBookmarks=new Map,e.default=r},72717:function(t,e,a){var o=a(42799),s=a(79234);class i extends o.o{constructor(t,e){super(t),this.init(),this.type=e}init(){}static getInstance(t){if(!i.instance[t]){let e=document.querySelector("[data-component-class='FavoritesManager']");i.instance[t]=e?new i(e,t):null}return i.instance[t]}addFavorite(t,e){const a=this.parm.addFavoriteUrl+"?ts="+(new Date).getTime();let o={id:t,type:this.type},i=new s.o(a,o,!1);this.ajaxWrapper.doFetch(i).then((t=>e(t)))}addFavorites(t,e){const a=this.parm.addFavoritesUrl+"?ts="+(new Date).getTime();let o={ids:t,type:this.type},i=new s.o(a,o,!1);this.ajaxWrapper.doFetch(i).then((t=>e(t)))}deleteFavorite(t,e){const a=this.parm.deleteFavoriteUrl+"?ts="+(new Date).getTime();let o={id:t,type:this.type},i=new s.o(a,o,!1);this.ajaxWrapper.doFetch(i).then((t=>e(t)))}deleteFavorites(t,e){const a=this.parm.deleteFavoritesUrl+"?ts="+(new Date).getTime();let o={ids:t,type:this.type},i=new s.o(a,o,!1);this.ajaxWrapper.doFetch(i).then((t=>e(t)))}listFavorites(t){const e=this.parm.listFavoritesUrl+"?ts="+(new Date).getTime();let a={type:this.type},o=new s.o(e,a,!1);this.ajaxWrapper.doFetch(o).then((e=>t(e)))}}i.instance=[],e.Z=i}}]);
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.