1import{Ht as Ps,Pt as Os,Vr as lr,dr as fe,in as T,mi as re,nt as Kg}from"./chunk-CkQR0-vI.js";import{d as we}from"./chunk-DvMSyca6.js";import{t as C}from"./chunk-B9877VhL.js";import{q as d}from"./main-MATL2IVW.js";import{t as c$1}from"./chunk-DjLYP8ni.js";import{t as tc}from"./chunk-Csi67zpD.js";var b=()=>fe(([t,e])=>t.sections.map(i=>{return{attributes:i,articles:e.articles.filter(n=>n.section_id===i.id&&n.draft===!1)}}));var c=class t{http=T(we);apiPath=`https://vivivit.zendesk.com/api/v2/help_center/ja`;userCategoryId=900000259766;companyCategoryId=900000259746;fetchArticlesForUser(){return Kg([this.fetchCategorySections(this.userCategoryId),this.fetchCategoryArticles(this.userCategoryId)]).pipe(b())}fetchArticlesForCompany(){return Kg([this.fetchCategorySections(this.companyCategoryId),this.fetchCategoryArticles(this.companyCategoryId)]).pipe(b())}fetchCategorySections(e){return this.http.get(`${this.apiPath}/categories/${e}/sections`)}fetchCategoryArticles(e){return this.http.get(`${this.apiPath}/categories/${e}/articles?per_page=50`)}static ɵfac=function(i){return new(i||t)};static ɵprov=re({token:t,factory:t.ɵfac,providedIn:`root`})};var l={notifications:[],totalCount:0};var U=class t{notificationService=T(c$1);zendeskHelpCenterService=T(c);customUserIdService=T(d);contentfulService=T(tc);_referringUrl;_landingUrl;_headerNotifications$=new lr(l);_zendeskArticlesForUser$=new lr([]);_zendeskArticlesForCompany$=new lr([]);_vivivitNotifications$=new lr([]);_notificationStatus={fetched:!1,checked:!1,loading:!1};_zendeskArticlesForUserFetched=!1;_zendeskArticlesForCompanyFetched=!1;_vivivitNotificationsFetched=!1;_customUserId$=new lr(null);_customUserIdFetched=!1;_isCustomUserIdLoading$=new lr(!1);constructor(){this.setTrackingUrl()}get referringUrl(){return this._referringUrl}get landingUrl(){return this._landingUrl}get headerNotification$(){return this._notificationStatus.fetched||this.fetchHeaderNotifications(),this._notificationStatus.checked?Os(l):this._headerNotifications$.asObservable()}get vivivitNotifications$(){return this._notificationStatus.checked?Os([]):this._vivivitNotifications$.asObservable()}get zendeskArticlesForUser$(){return this._zendeskArticlesForUserFetched||this.fetchSectionArticlesForUser(),this._zendeskArticlesForUser$.asObservable()}get zendeskArticlesForCompany$(){return this._zendeskArticlesForCompanyFetched||this.fetchSectionArticlesForCompany(),this._zendeskArticlesForCompany$.asObservable()}get customUserId$(){return this._customUserIdFetched||this.fetchCustomUserId(),this._customUserId$.asObservable()}get isCustomUserIdLoading$(){return this._isCustomUserIdLoading$.asObservable()}checkedNotifications(){this._notificationStatus.checked=!0}resetState(){this._headerNotifications$.next(l),this._vivivitNotifications$.next([]),this._notificationStatus={fetched:!1,checked:!1,loading:!1},this._customUserId$.next(null),this._customUserIdFetched=!1}fetchVivivitNotifications(e){if(this._vivivitNotificationsFetched)return;let i=C(e)?`users`:`organizations`,d=e.attributes.last_notification_viewed_at??e.attributes.created_at;this.contentfulService.getVivivitNotifications(i,d,{limit:15}).then(n=>{this._vivivitNotificationsFetched=!0,this._vivivitNotifications$.next(n.items)})}updateCustomUserId(e){this._customUserId$.next(e)}fetchHeaderNotifications(){this._notificationStatus.loading||(this._notificationStatus.loading=!0,this.notificationService.fetchNotifications({page:{number:1,size:15},filtering:[{path:`apply_last_checked_filter`,value:!0}]}).pipe(Ps(e=>Os({data:[],meta:{total_count:0}}))).subscribe(e=>{this._notificationStatus.loading=!1,this._notificationStatus.fetched=!0,this._headerNotifications$.next({notifications:e.data,totalCount:e.meta.total_count})}))}fetchSectionArticlesForUser(){this.zendeskHelpCenterService.fetchArticlesForUser().subscribe(e=>{this._zendeskArticlesForUserFetched=!0,this._zendeskArticlesForUser$.next(e)})}fetchSectionArticlesForCompany(){this.zendeskHelpCenterService.fetchArticlesForCompany().subscribe(e=>{this._zendeskArticlesForCompanyFetched=!0,this._zendeskArticlesForCompany$.next(e)})}fetchCustomUserId(){this._isCustomUserIdLoading$.value||(this._isCustomUserIdLoading$.next(!0),this.customUserIdService.fetchCustomUserId().subscribe(e=>{this._customUserIdFetched=!0,this._customUserId$.next(e?.data),this._isCustomUserIdLoading$.next(!1)}))}setTrackingUrl(){this._referringUrl=document.referrer,this._landingUrl=location.href}static ɵfac=function(i){return new(i||t)};static ɵprov=re({token:t,factory:t.ɵfac,providedIn:`root`})};export{U as t}; 2//# debugId=fc1b9657-53a6-579f-966d-f2fd2e307210
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.