PageSourceSearch

https://www.industryweek.com/_nuxt/useAspireContentSearch-B48eoAEr.mjs

js industryweek.com collected 2026-09-24 08:31:05 UTC 6,163 bytes, 1 lines download raw bytes

1import{a as e}from"./nuxt-Dw3LQvcO.mjs";import{Ht as t,Pt as n}from"./vue.runtime.esm-bundler-DK-ieOMu.mjs";import{f as r}from"./error-Dvy0PY9B.mjs";import{n as i}from"./state-B-1p1z1y.mjs";import{i as a}from"./useSelectOptions-sw_zPP94.mjs";import{t as o}from"./useTenantKey-BXnx4spc.mjs";import{t as s}from"./useNotification-BeE4m4aa.mjs";import{t as c}from"./useStringUtils-fZKGknBW.mjs";import{t as l}from"./body_blocks-BPDz0DQ5.mjs";n();function u(){function n(e){return e===`results`?{labels:`label`,type:`contentType`,authors:`author`,websiteSchedules:`websiteSchedule`}:{label:`labels`,contentType:`type`,author:`authors`,websiteSchedule:`websiteSchedules`}}function u(){let e={};return r()?.query?.filters&&(e=JSON.parse(r().query.filters)),e}function d(t,r,i,o){let{$cmsUser:s}=e(),c={};r?.text&&(c.searchPhrase=r.text,c.textSearchFields=i),r?.statusText?.length&&(c.statusText={values:r?.statusText,operator:`or`}),r?.status?.length&&(c.status={values:r?.status,operator:`or`}),r?.tenant?.length&&(c.tenant={values:r?.tenant,operator:`or`}),r?.contentIds?.length&&(c.contentIds=r.contentIds);let l=n(`search`);if([`blueConicClient`,`bodyBlockTypes`,`company`,`contentFlags`,`contentGating`,`labels`].forEach(e=>{r?.[e]&&(c[e]={values:[r[e]],operator:`and`})}),[`authors`,`primarySection`,`taxonomy`,`type`].forEach(e=>{let t=l?.[e]?l[e]:e;r?.[e]?.value?.length&&(c[t]={values:r[e].value,operator:r[e].andOr})}),!r?.type?.value?.length&&o?.length&&(c.type={values:a.filter(e=>!o.includes(e.value)).map(e=>e.value),operator:`or`}),r?.websiteSchedule?.value?.length){let e=r.impliedSchedules?`websiteSchedulesImplied`:`websiteSchedules`;c[e]={values:r.websiteSchedule.value,operator:r.websiteSchedule.andOr}}return r.dateSearch&&(r.dateSearch.startDate||r.dateSearch.endDate)&&(c[r.dateSearch.field]={},r.dateSearch.startDate&&(c[r.dateSearch.field].from=r.dateSearch.startDate),r.dateSearch.endDate&&(c[r.dateSearch.field].to=r.dateSearch.endDate)),t&&(c.published={to:t}),r?.myContent&&(c.userContent=s.getUserInfo().username),r?.magazineSchedule&&(c.magazineSchedules={},r?.magazineSchedule?.publication&&(c.magazineSchedules.publication=r?.magazineSchedule.publication.toString()),r?.magazineSchedule?.issue&&(c.magazineSchedules.issue=r?.magazineSchedule.issue.toString()),r?.magazineSchedule?.section&&(c.magazineSchedules.section=r?.magazineSchedule.section.toString()),r?.magazineSchedule?.mailDate&&(c.magazineSchedules.mailDate=r?.magazineSchedule.mailDate)),r?.newsletterSchedule&&(c.newsletterSchedules={},r?.newsletterSchedule?.template&&(c.newsletterSchedules.template=r?.newsletterSchedule.template.toString()),(r?.newsletterSchedule?.startDate||r?.newsletterSchedule?.endDate)&&(c.newsletterSchedules.deploymentDate={},r?.newsletterSchedule?.startDate&&(c.newsletterSchedules.deploymentDate.from=r.newsletterSchedule.startDate),r?.newsletterSchedule?.endDate&&(c.newsletterSchedules.deploymentDate.to=r.newsletterSchedule.endDate)),r?.newsletterSchedule?.unscheduled===!0&&(c.hasNewsletterSchedules=`false`)),c}function f(e){let t={};return Object.keys(e).forEach(n=>{let r=e[n];if(n===`statusText`||n===`tenant`)t[n]=r;else if(typeof r==`object`&&`value`in r&&`andOr`in r)(r.value.length>0||Object.keys(r.value).length>0)&&(t[n]=r);else if(typeof r==`object`&&`value`in r&&e[n].value.length>0)t[n]=r;else if(typeof r==`object`){let e=f(r);Object.keys(e).length>0&&(t[n]=e)}else(r?.length>0||r>0||r===!0)&&(t[n]=r)}),t}async function p(i,a,u,f,p,g,_,v){let{$gql:y}=e(),b=d(a,{...u},u.titleOnly?[`name`]:p===`public-search`?[`name`,`teaser`,`body`,`author`,`companyName`]:[`name`,`teaser`,`body`,`companyName`],v),x={sortField:g.split(`_`)[0],sortDirection:g.split(`_`)?.[1]??`desc`,limit:parseInt(_),skip:parseInt((parseInt(f)-1)*parseInt(_)),...b},S=await y.query(p===`public-search`?`searchContent/searchContentPublic`:p===`ids-only`?`searchContent/searchContentAdminIdsOnly`:p===`admin-content-select`?`searchContent/searchContentAdminContentSelect`:p===`admin-research`?`searchContent/searchContentAdminResearch`:`searchContent/searchContentAdmin`,x);S.error&&s.error(S.message);let C={facetOptions:{},results:{items:[],totalCount:[0]}};if(S.error)return s.error(S.message),C;{let e=n(`results`),a={};S.data.meta?.facet&&Object.keys(S.data.meta?.facet).map(t=>{let n=S.data.meta.facet[t];a[e[t]??t]=n.buckets.map(e=>({value:e._id,label:e._id.split(`|_|`).slice(-1).pop(),count:u[t]?.andOr===`or`?null:e.count})).sort((e,t)=>
1e.label<t.label?-1:1)});let s={...u};delete s.contentIds,p!==`admin`&&p!==`admin-newsletter`&&(delete s.contentStatus,delete s.tenant);let d=p===`admin-newsletter`?m():t({});d.value={...d.value,...s};let v=p===`admin-newsletter`?h():t({});if(v.value={limit:_>1?_:d.value.hitsPerPage,page:f,sort:g},i){let e={tenant:[o().root],statusText:[`Published`,`Draft`,`Scheduled`]},t=p===`admin`&&Number(f)===1&&g===`updated_desc`&&JSON.stringify(s)===JSON.stringify(e),n=r().path;t||(n+=`?page=`+f,n+=`&filters=${encodeURIComponent(JSON.stringify(s))}&sort=${g}`),history.pushState({},null,n)}let y=S.data.docs.map(e=>({...e,primarySection:e?.primarySection?{name:e.primarySection}:null,primaryImage:e?.primaryImage?{src:e.primaryImage}:``})),b=(a?.contentFlags??[]).map(e=>({...e,label:c.convertCamelCase(e.label)})),x=(a?.blueConicClient??[]).map(e=>({...e,label:c.convertCamelCase(e.label)})),w=(a?.bodyBlockTypes??[]).filter(e=>e.value!==`raw_html`).map(e=>({...e,label:l[e.value].label}));C={facetOptions:{author:a?.author??[],bodyBlockTypes:w,company:a?.company??[],contentFlags:b,blueConicClient:x,contentGating:a?.contentGating??[],statusText:a?.statusText??[],contentType:a?.contentType??[],label:a?.label??[],primarySection:a?.primarySection??[],tenant:a?.tenant??[],websiteSchedule:a?.websiteSchedule??[]},results:{items:y,totalCount:S.data?.meta?.count?.lowerBound??0}}}return JSON.parse(JSON.stringify(C))}function m(){return i(`contentSearchFilters`,()=>({}))}function h(){return i(`contentOptionsFilters`,()=>({}))}function g(){m().value={},h().value={}}return{search:p,getFiltersFromUrl:u,clearEmptyFilters:f,getContentSearchFilters:m,getContentOptionsFilters:h,clearContentSearchState:g}}export{u as t};

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.