@goperigon/perigon-ts
Version:
Typescript client for Perigon API
1 lines • 82.7 kB
JavaScript
'use strict';var Nn="https://api.perigon.io".replace(/\/+$/,""),oe=class{constructor(n={}){this.configuration=n;}set config(n){this.configuration=n;}get basePath(){return this.configuration.basePath??Nn}get fetchApi(){return this.configuration.fetchApi}get middleware(){return this.configuration.middleware||[]}get queryParamsStringify(){return this.configuration.queryParamsStringify||me}get accessToken(){let n=this.configuration.apiKey;return n?typeof n=="function"?n:async()=>n:void 0}get headers(){return this.configuration.headers}get credentials(){return this.configuration.credentials}},On=new oe,U=class U{constructor(n=On){this.configuration=n;this.fetchApi=async(n,o)=>{let t={url:n,init:o};for(let l of this.middleware)l.pre&&(t=await l.pre({fetch:this.fetchApi,...t})||t);let r;try{r=await(this.configuration.fetchApi||fetch)(t.url,t.init);}catch(l){for(let i of this.middleware)i.onError&&(r=await i.onError({fetch:this.fetchApi,url:t.url,init:t.init,error:l,response:r?r.clone():void 0})||r);if(r===void 0)throw l instanceof Error?new ie(l,"The request failed and the interceptors did not return an alternative response"):l}for(let l of this.middleware)l.post&&(r=await l.post({fetch:this.fetchApi,url:t.url,init:t.init,response:r.clone()})||r);return r};this.middleware=n.middleware;}withMiddleware(...n){let o=this.clone();return o.middleware=o.middleware.concat(...n),o}withPreMiddleware(...n){let o=n.map(t=>({pre:t}));return this.withMiddleware(...o)}withPostMiddleware(...n){let o=n.map(t=>({post:t}));return this.withMiddleware(...o)}isJsonMime(n){return n?U.jsonRegex.test(n):false}async request(n,o){let{url:t,init:r}=await this.createFetchParams(n,o),l=await this.fetchApi(t,r);if(l&&l.status>=200&&l.status<300)return l;throw new re(l,"Response returned an error code")}async createFetchParams(n,o){let t=this.configuration.basePath+n.path;n.query!==void 0&&Object.keys(n.query).length!==0&&(t+="?"+this.configuration.queryParamsStringify(n.query));let r=Object.assign({},this.configuration.headers,n.headers);Object.keys(r).forEach(de=>r[de]===void 0?delete r[de]:{});let l=typeof o=="function"?o:async()=>o,i={method:n.method,headers:r,body:n.body,credentials:this.configuration.credentials},a={...i,...await l({init:i,context:n})},_;An(a.body)||a.body instanceof URLSearchParams||Rn(a.body)?_=a.body:this.isJsonMime(r["Content-Type"])?_=JSON.stringify(a.body):_=a.body;let xn={...a,body:_};return {url:t,init:xn}}clone(){let n=this.constructor,o=new n(this.configuration);return o.middleware=this.middleware.slice(),o}};U.jsonRegex=new RegExp("^(:?application/json|[^;/ ]+/[^;/ ]+[+]json)[ ]*(:?;.*)?$","i");var B=U;function Rn(e){return typeof Blob<"u"&&e instanceof Blob}function An(e){return typeof FormData<"u"&&e instanceof FormData}var re=class extends Error{constructor(o,t){super(t);this.response=o;this.name="ResponseError";}},ie=class extends Error{constructor(o,t){super(t);this.cause=o;this.name="FetchError";}},x=class extends Error{constructor(o,t){super(t);this.field=o;this.name="RequiredError";}},Vo={csv:",",ssv:" ",tsv:" ",pipes:"|"};function me(e,n=""){return Object.keys(e).map(o=>fe(o,e[o],n)).filter(o=>o.length>0).join("&")}function fe(e,n,o=""){let t=o+(o.length?`[${e}]`:e);if(n instanceof Array){let r=n.map(l=>encodeURIComponent(String(l))).join(`&${encodeURIComponent(t)}=`);return `${encodeURIComponent(t)}=${r}`}if(n instanceof Set){let r=Array.from(n);return fe(e,r,o)}return n instanceof Date?`${encodeURIComponent(t)}=${encodeURIComponent(n.toISOString())}`:n instanceof Object?me(n,t):`${encodeURIComponent(t)}=${encodeURIComponent(String(n))}`}function Go(e,n){let o=e[n];return o!=null}function Qo(e,n){let o={};for(let t of Object.keys(e))o[t]=n(e[t]);return o}function Ko(e){for(let n of e)if(n.contentType==="multipart/form-data")return true;return false}var d=class{constructor(n,o=t=>t){this.raw=n;this.transformer=o;}async value(){return this.transformer(await this.raw.json())}},se=class{constructor(n){this.raw=n;}async value(){}},pe=class{constructor(n){this.raw=n;}async value(){return await this.raw.blob()}},ye=class{constructor(n){this.raw=n;}async value(){return await this.raw.text()}};var le={Relevance:"relevance",Date:"date",ReverseDate:"reverseDate",ReverseAddDate:"reverseAddDate",AddDate:"addDate",PubDate:"pubDate",RefreshDate:"refreshDate"};function Yo(e){for(let n in le)if(Object.prototype.hasOwnProperty.call(le,n)&&le[n]===e)return true;return false}function $o(e){return Cn(e)}function Cn(e,n){return e}function Po(e){return e}function Xo(e,n){return e}function qo(e){return true}function N(e){return bn(e)}function bn(e,n){return e==null?e:{name:e.name==null?void 0:e.name,count:e.count==null?void 0:e.count}}function O(e){return In(e,false)}function In(e,n=false){return e==null?e:{name:e.name,count:e.count}}function jo(e){return true}function R(e){return Jn(e)}function Jn(e,n){return e==null?e:{country:e.country==null?void 0:e.country,state:e.state==null?void 0:e.state,county:e.county==null?void 0:e.county,city:e.city==null?void 0:e.city,area:e.area==null?void 0:e.area}}function A(e){return En(e,false)}function En(e,n=false){return e==null?e:{country:e.country,state:e.state,county:e.county,city:e.city,area:e.area}}function ar(e){return true}function h(e){return Fn(e)}function Fn(e,n){return e==null?e:{id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,fullName:e.fullName==null?void 0:e.fullName,headline:e.headline==null?void 0:e.headline,description:e.description==null?void 0:e.description,title:e.title==null?void 0:e.title,locations:e.locations==null?void 0:e.locations.map(R),updatedAt:e.updatedAt==null?void 0:e.updatedAt,topTopics:e.topTopics==null?void 0:e.topTopics.map(N),topSources:e.topSources==null?void 0:e.topSources.map(N),topCategories:e.topCategories==null?void 0:e.topCategories.map(N),topLabels:e.topLabels==null?void 0:e.topLabels.map(N),topCountries:e.topCountries==null?void 0:e.topCountries.map(N),avgMonthlyPosts:e.avgMonthlyPosts==null?void 0:e.avgMonthlyPosts,twitterHandle:e.twitterHandle==null?void 0:e.twitterHandle,twitterBio:e.twitterBio==null?void 0:e.twitterBio,imageUrl:e.imageUrl==null?void 0:e.imageUrl,linkedinUrl:e.linkedinUrl==null?void 0:e.linkedinUrl,linkedinConnections:e.linkedinConnections==null?void 0:e.linkedinConnections,linkedinFollowers:e.linkedinFollowers==null?void 0:e.linkedinFollowers,facebookUrl:e.facebookUrl==null?void 0:e.facebookUrl,instagramUrl:e.instagramUrl==null?void 0:e.instagramUrl,websiteUrl:e.websiteUrl==null?void 0:e.websiteUrl,blogUrl:e.blogUrl==null?void 0:e.blogUrl,tumblrUrl:e.tumblrUrl==null?void 0:e.tumblrUrl,youtubeUrl:e.youtubeUrl==null?void 0:e.youtubeUrl}}function W(e){return Hn(e,false)}function Hn(e,n=false){return e==null?e:{id:e.id,name:e.name,fullName:e.fullName,headline:e.headline,description:e.description,title:e.title,locations:e.locations==null?void 0:e.locations.map(A),updatedAt:e.updatedAt,topTopics:e.topTopics==null?void 0:e.topTopics.map(O),topSources:e.topSources==null?void 0:e.topSources.map(O),topCategories:e.topCategories==null?void 0:e.topCategories.map(O),topLabels:e.topLabels==null?void 0:e.topLabels.map(O),topCountries:e.topCountries==null?void 0:e.topCountries.map(O),avgMonthlyPosts:e.avgMonthlyPosts,twitterHandle:e.twitterHandle,twitterBio:e.twitterBio,imageUrl:e.imageUrl,linkedinUrl:e.linkedinUrl,linkedinConnections:e.linkedinConnections,linkedinFollowers:e.linkedinFollowers,facebookUrl:e.facebookUrl,instagramUrl:e.instagramUrl,websiteUrl:e.websiteUrl,blogUrl:e.blogUrl,tumblrUrl:e.tumblrUrl,youtubeUrl:e.youtubeUrl}}function cr(e){return true}function z(e){return Dn(e)}function Dn(e,n){return e==null?e:{lat:e.lat==null?void 0:e.lat,lon:e.lon==null?void 0:e.lon}}function V(e){return kn(e,false)}function kn(e,n=false){return e==null?e:{lat:e.lat,lon:e.lon}}function mr(e){return true}function G(e){return wn(e)}function wn(e,n){return e==null?e:{country:e.country==null?void 0:e.country,state:e.state==null?void 0:e.state,county:e.county==null?void 0:e.county,city:e.city==null?void 0:e.city,coordinates:e.coordinates==null?void 0:z(e.coordinates)}}function Q(e){return Mn(e,false)}function Mn(e,n=false){return e==null?e:{country:e.country,state:e.state,county:e.county,city:e.city,coordinates:V(e.coordinates)}}function xr(e){return true}function K(e){return Ln(e)}function Ln(e,n){return e==null?e:{domain:e.domain==null?void 0:e.domain,paywall:e.paywall==null?void 0:e.paywall,location:e.location==null?void 0:G(e.location)}}function Y(e){return _n(e,false)}function _n(e,n=false){return e==null?e:{domain:e.domain,paywall:e.paywall,location:Q(e.location)}}function Or(e){return true}function $(e){return Bn(e)}function Bn(e,n){return e==null?e:{id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,domains:e.domains==null?void 0:e.domains,symbols:e.symbols==null?void 0:e.symbols}}function P(e){return Un(e,false)}function Un(e,n=false){return e==null?e:{id:e.id,name:e.name,domains:e.domains,symbols:e.symbols}}function Ar(e){return true}function Se(e){return Wn(e)}function Wn(e,n){return e==null?e:{data:e.data==null?void 0:e.data,type:e.type==null?void 0:e.type,mentions:e.mentions==null?void 0:e.mentions}}function Te(e){return zn(e,false)}function zn(e,n=false){return e==null?e:{data:e.data,type:e.type,mentions:e.mentions}}function Cr(e){return true}function I(e){return Vn(e)}function Vn(e,n){return e==null?e:{name:e.name==null?void 0:e.name}}function J(e){return Gn(e,false)}function Gn(e,n=false){return e==null?e:{name:e.name}}function Ir(e){return true}function X(e){return Qn(e)}function Qn(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,name:e.name==null?void 0:e.name}}function Z(e){return Kn(e,false)}function Kn(e,n=false){return e==null?e:{wikidataId:e.wikidataId,name:e.name}}function Er(e){return true}function ge(e){return Yn(e)}function Yn(e,n){return e==null?e:{name:e.name==null?void 0:e.name}}function xe(e){return $n(e,false)}function $n(e,n=false){return e==null?e:{name:e.name}}function Hr(e){return true}function E(e){return Pn(e)}function Pn(e,n){return e==null?e:{name:e.name==null?void 0:e.name,count:e.count==null?void 0:e.count}}function F(e){return Xn(e,false)}function Xn(e,n=false){return e==null?e:{name:e.name,count:e.count}}function kr(e){return true}function Ne(e){return Zn(e)}function Zn(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,name:e.name==null?void 0:e.name,count:e.count==null?void 0:e.count}}function Oe(e){return qn(e,false)}function qn(e,n=false){return e==null?e:{wikidataId:e.wikidataId,name:e.name,count:e.count}}function Mr(e){return true}function Re(e){return vn(e)}function vn(e,n){return e==null?e:{state:e.state==null?void 0:e.state,county:e.county==null?void 0:e.county,city:e.city==null?void 0:e.city,area:e.area==null?void 0:e.area,count:e.count==null?void 0:e.count}}function Ae(e){return jn(e,false)}function jn(e,n=false){return e==null?e:{state:e.state,county:e.county,city:e.city,area:e.area,count:e.count}}function _r(e){return true}function he(e){return et(e)}function et(e,n){return e==null?e:{id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,domains:e.domains==null?void 0:e.domains,symbols:e.symbols==null?void 0:e.symbols,count:e.count==null?void 0:e.count}}function Ce(e){return nt(e,false)}function nt(e,n=false){return e==null?e:{id:e.id,name:e.name,domains:e.domains,symbols:e.symbols,count:e.count}}function Ur(e){return true}function be(e){return tt(e)}function tt(e,n){return e==null?e:{point:e.point==null?void 0:e.point,references:e.references==null?void 0:e.references}}function Ie(e){return ot(e,false)}function ot(e,n=false){return e==null?e:{point:e.point,references:e.references}}function zr(e){return true}function q(e){return rt(e)}function rt(e,n){return e==null?e:{name:e.name==null?void 0:e.name}}function v(e){return it(e,false)}function it(e,n=false){return e==null?e:{name:e.name}}function Gr(e){return true}function Je(e){return lt(e)}function lt(e,n){return e==null?e:{question:e.question==null?void 0:e.question,answer:e.answer==null?void 0:e.answer,references:e.references==null?void 0:e.references}}function Ee(e){return at(e,false)}function at(e,n=false){return e==null?e:{question:e.question,answer:e.answer,references:e.references}}function Kr(e){return true}function j(e){return ut(e)}function ut(e,n){return e==null?e:{positive:e.positive==null?void 0:e.positive,negative:e.negative==null?void 0:e.negative,neutral:e.neutral==null?void 0:e.neutral}}function ee(e){return ct(e,false)}function ct(e,n=false){return e==null?e:{positive:e.positive,negative:e.negative,neutral:e.neutral}}function Mi(e){return true}function ne(e){return dt(e)}function dt(e,n){return e==null?e:{createdAt:e.createdAt==null?void 0:e.createdAt,updatedAt:e.updatedAt==null?void 0:e.updatedAt,initializedAt:e.initializedAt==null?void 0:e.initializedAt,id:e.id==null?void 0:e.id,duplicateOf:e.duplicateOf==null?void 0:e.duplicateOf,slug:e.slug==null?void 0:e.slug,name:e.name==null?void 0:e.name,summary:e.summary==null?void 0:e.summary,shortSummary:e.shortSummary==null?void 0:e.shortSummary,summaryReferences:e.summaryReferences==null?void 0:e.summaryReferences,imageSource:e.imageSource==null?void 0:K(e.imageSource),imageUrl:e.imageUrl==null?void 0:e.imageUrl,keyPoints:e.keyPoints==null?void 0:e.keyPoints.map(be),questions:e.questions==null?void 0:e.questions.map(Je),uniqueSources:e.uniqueSources==null?void 0:e.uniqueSources,selectedArticles:e.selectedArticles==null?void 0:e.selectedArticles.map(T),sentiment:e.sentiment==null?void 0:j(e.sentiment),uniqueCount:e.uniqueCount==null?void 0:e.uniqueCount,reprintCount:e.reprintCount==null?void 0:e.reprintCount,totalCount:e.totalCount==null?void 0:e.totalCount,countries:e.countries==null?void 0:e.countries.map(E),topCountries:e.topCountries==null?void 0:e.topCountries,topics:e.topics==null?void 0:e.topics.map(E),topTopics:e.topTopics==null?void 0:e.topTopics.map(q),categories:e.categories==null?void 0:e.categories.map(E),topCategories:e.topCategories==null?void 0:e.topCategories.map(I),taxonomies:e.taxonomies==null?void 0:e.taxonomies.map(E),topTaxonomies:e.topTaxonomies==null?void 0:e.topTaxonomies.map(I),people:e.people==null?void 0:e.people.map(Ne),topPeople:e.topPeople==null?void 0:e.topPeople.map(X),companies:e.companies==null?void 0:e.companies.map(he),topCompanies:e.topCompanies==null?void 0:e.topCompanies.map($),locations:e.locations==null?void 0:e.locations.map(Re),topLocations:e.topLocations==null?void 0:e.topLocations.map(R),highlights:e.highlights==null?void 0:e.highlights}}function te(e){return st(e,false)}function st(e,n=false){return e==null?e:{createdAt:e.createdAt,updatedAt:e.updatedAt,initializedAt:e.initializedAt,id:e.id,duplicateOf:e.duplicateOf,slug:e.slug,name:e.name,summary:e.summary,shortSummary:e.shortSummary,summaryReferences:e.summaryReferences,imageSource:Y(e.imageSource),imageUrl:e.imageUrl,keyPoints:e.keyPoints==null?void 0:e.keyPoints.map(Ie),questions:e.questions==null?void 0:e.questions.map(Ee),uniqueSources:e.uniqueSources,selectedArticles:e.selectedArticles==null?void 0:e.selectedArticles.map(g),sentiment:ee(e.sentiment),uniqueCount:e.uniqueCount,reprintCount:e.reprintCount,totalCount:e.totalCount,countries:e.countries==null?void 0:e.countries.map(F),topCountries:e.topCountries,topics:e.topics==null?void 0:e.topics.map(F),topTopics:e.topTopics==null?void 0:e.topTopics.map(v),categories:e.categories==null?void 0:e.categories.map(F),topCategories:e.topCategories==null?void 0:e.topCategories.map(J),taxonomies:e.taxonomies==null?void 0:e.taxonomies.map(F),topTaxonomies:e.topTaxonomies==null?void 0:e.topTaxonomies.map(J),people:e.people==null?void 0:e.people.map(Oe),topPeople:e.topPeople==null?void 0:e.topPeople.map(Z),companies:e.companies==null?void 0:e.companies.map(Ce),topCompanies:e.topCompanies==null?void 0:e.topCompanies.map(P),locations:e.locations==null?void 0:e.locations.map(Ae),topLocations:e.topLocations==null?void 0:e.topLocations.map(A),highlights:e.highlights}}function _i(e){return true}function Fe(e){return pt(e)}function pt(e,n){return e==null?e:{name:e.name==null?void 0:e.name,weight:e.weight==null?void 0:e.weight}}function He(e){return yt(e,false)}function yt(e,n=false){return e==null?e:{name:e.name,weight:e.weight}}function Ui(e){return true}function De(e){return mt(e)}function mt(e,n){return e==null?e:{name:e.name==null?void 0:e.name,type:e.type==null?void 0:e.type}}function ke(e){return ft(e,false)}function ft(e,n=false){return e==null?e:{name:e.name,type:e.type}}function zi(e){return true}function we(e){return St(e)}function St(e,n){return e==null?e:{name:e.name==null?void 0:e.name,score:e.score==null?void 0:e.score}}function Me(e){return Tt(e,false)}function Tt(e,n=false){return e==null?e:{name:e.name,score:e.score}}function Yi(e){return true}function Le(e){return gt(e)}function gt(e,n){return e==null?e:{osmId:e.osmId==null?void 0:e.osmId,road:e.road==null?void 0:e.road,quarter:e.quarter==null?void 0:e.quarter,suburb:e.suburb==null?void 0:e.suburb,city:e.city==null?void 0:e.city,town:e.town==null?void 0:e.town,county:e.county==null?void 0:e.county,stateDistrict:e.stateDistrict==null?void 0:e.stateDistrict,state:e.state==null?void 0:e.state,postcode:e.postcode==null?void 0:e.postcode,country:e.country==null?void 0:e.country,countryCode:e.countryCode==null?void 0:e.countryCode,amenity:e.amenity==null?void 0:e.amenity,neighbourhood:e.neighbourhood==null?void 0:e.neighbourhood,coordinates:e.coordinates==null?void 0:z(e.coordinates)}}function _e(e){return xt(e,false)}function xt(e,n=false){return e==null?e:{osmId:e.osmId,road:e.road,quarter:e.quarter,suburb:e.suburb,city:e.city,town:e.town,county:e.county,stateDistrict:e.stateDistrict,state:e.state,postcode:e.postcode,country:e.country,countryCode:e.countryCode,amenity:e.amenity,neighbourhood:e.neighbourhood,coordinates:V(e.coordinates)}}function Pi(e){return true}function Be(e){return Nt(e)}function Nt(e,n){return e==null?e:{id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name}}function Ue(e){return Ot(e,false)}function Ot(e,n=false){return e==null?e:{id:e.id,name:e.name}}function Ql(e){return true}function T(e){return Rt(e)}function Rt(e,n){return e==null?e:{url:e.url==null?void 0:e.url,authorsByline:e.authorsByline==null?void 0:e.authorsByline,articleId:e.articleId==null?void 0:e.articleId,clusterId:e.clusterId==null?void 0:e.clusterId,source:e.source==null?void 0:K(e.source),imageUrl:e.imageUrl==null?void 0:e.imageUrl,country:e.country==null?void 0:e.country,language:e.language==null?void 0:e.language,pubDate:e.pubDate==null?void 0:e.pubDate,addDate:e.addDate==null?void 0:e.addDate,refreshDate:e.refreshDate==null?void 0:e.refreshDate,score:e.score==null?void 0:e.score,title:e.title==null?void 0:e.title,description:e.description==null?void 0:e.description,content:e.content==null?void 0:e.content,medium:e.medium==null?void 0:e.medium,links:e.links==null?void 0:e.links,labels:e.labels==null?void 0:e.labels.map(ge),eventTypes:e.eventTypes==null?void 0:e.eventTypes.map(De),matchedAuthors:e.matchedAuthors==null?void 0:e.matchedAuthors.map(Be),claim:e.claim==null?void 0:e.claim,verdict:e.verdict==null?void 0:e.verdict,keywords:e.keywords==null?void 0:e.keywords.map(Fe),topics:e.topics==null?void 0:e.topics.map(q),categories:e.categories==null?void 0:e.categories.map(I),taxonomies:e.taxonomies==null?void 0:e.taxonomies.map(we),entities:e.entities==null?void 0:e.entities.map(Se),companies:e.companies==null?void 0:e.companies.map($),sentiment:e.sentiment==null?void 0:j(e.sentiment),summary:e.summary==null?void 0:e.summary,shortSummary:e.shortSummary==null?void 0:e.shortSummary,translation:e.translation==null?void 0:e.translation,translatedTitle:e.translatedTitle==null?void 0:e.translatedTitle,translatedDescription:e.translatedDescription==null?void 0:e.translatedDescription,translatedSummary:e.translatedSummary==null?void 0:e.translatedSummary,locations:e.locations==null?void 0:e.locations.map(R),reprint:e.reprint==null?void 0:e.reprint,reprintGroupId:e.reprintGroupId==null?void 0:e.reprintGroupId,places:e.places==null?void 0:e.places.map(Le),people:e.people==null?void 0:e.people.map(X),cluster:e.cluster==null?void 0:ne(e.cluster),journalists:e.journalists==null?void 0:e.journalists.map(h),highlights:e.highlights==null?void 0:e.highlights}}function g(e){return At(e,false)}function At(e,n=false){return e==null?e:{url:e.url,authorsByline:e.authorsByline,articleId:e.articleId,clusterId:e.clusterId,source:Y(e.source),imageUrl:e.imageUrl,country:e.country,language:e.language,pubDate:e.pubDate,addDate:e.addDate,refreshDate:e.refreshDate,score:e.score,title:e.title,description:e.description,content:e.content,medium:e.medium,links:e.links,labels:e.labels==null?void 0:e.labels.map(xe),eventTypes:e.eventTypes==null?void 0:e.eventTypes.map(ke),matchedAuthors:e.matchedAuthors==null?void 0:e.matchedAuthors.map(Ue),claim:e.claim,verdict:e.verdict,keywords:e.keywords==null?void 0:e.keywords.map(He),topics:e.topics==null?void 0:e.topics.map(v),categories:e.categories==null?void 0:e.categories.map(J),taxonomies:e.taxonomies==null?void 0:e.taxonomies.map(Me),entities:e.entities==null?void 0:e.entities.map(Te),companies:e.companies==null?void 0:e.companies.map(P),sentiment:ee(e.sentiment),summary:e.summary,shortSummary:e.shortSummary,translation:e.translation,translatedTitle:e.translatedTitle,translatedDescription:e.translatedDescription,translatedSummary:e.translatedSummary,locations:e.locations==null?void 0:e.locations.map(A),reprint:e.reprint,reprintGroupId:e.reprintGroupId,places:e.places==null?void 0:e.places.map(_e),people:e.people==null?void 0:e.people.map(Z),cluster:te(e.cluster),journalists:e.journalists==null?void 0:e.journalists.map(W),highlights:e.highlights}}function Yl(e){return true}function ae(e){return ht(e)}function ht(e,n){return e==null?e:{lat:e.lat==null?void 0:e.lat,lon:e.lon==null?void 0:e.lon,radius:e.radius==null?void 0:e.radius}}function ue(e){return Ct(e,false)}function Ct(e,n=false){return e==null?e:{lat:e.lat,lon:e.lon,radius:e.radius}}function ql(e){return true}function H(e){return bt(e)}function bt(e,n){return e==null?e:{articleId:e.articleId==null?void 0:e.articleId,clusterId:e.clusterId==null?void 0:e.clusterId,source:e.source==null?void 0:e.source,excludeSource:e.excludeSource==null?void 0:e.excludeSource,sourceGroup:e.sourceGroup==null?void 0:e.sourceGroup,language:e.language==null?void 0:e.language,excludeLanguage:e.excludeLanguage==null?void 0:e.excludeLanguage,label:e.label==null?void 0:e.label,excludeLabel:e.excludeLabel==null?void 0:e.excludeLabel,taxonomy:e.taxonomy==null?void 0:e.taxonomy,category:e.category==null?void 0:e.category,topic:e.topic==null?void 0:e.topic,excludeTopic:e.excludeTopic==null?void 0:e.excludeTopic,country:e.country==null?void 0:e.country,excludeCountry:e.excludeCountry==null?void 0:e.excludeCountry,locationsCountry:e.locationsCountry==null?void 0:e.locationsCountry,excludeLocationsCountry:e.excludeLocationsCountry==null?void 0:e.excludeLocationsCountry,state:e.state==null?void 0:e.state,excludeState:e.excludeState==null?void 0:e.excludeState,county:e.county==null?void 0:e.county,excludeCounty:e.excludeCounty==null?void 0:e.excludeCounty,city:e.city==null?void 0:e.city,excludeCity:e.excludeCity==null?void 0:e.excludeCity,sourceCountry:e.sourceCountry==null?void 0:e.sourceCountry,sourceState:e.sourceState==null?void 0:e.sourceState,sourceCounty:e.sourceCounty==null?void 0:e.sourceCounty,sourceCity:e.sourceCity==null?void 0:e.sourceCity,coordinates:e.coordinates==null?void 0:ae(e.coordinates),sourceCoordinates:e.sourceCoordinates==null?void 0:ae(e.sourceCoordinates),companyId:e.companyId==null?void 0:e.companyId,excludeCompanyId:e.excludeCompanyId==null?void 0:e.excludeCompanyId,companyDomain:e.companyDomain==null?void 0:e.companyDomain,excludeCompanyDomain:e.excludeCompanyDomain==null?void 0:e.excludeCompanyDomain,companySymbol:e.companySymbol==null?void 0:e.companySymbol,excludeCompanySymbol:e.excludeCompanySymbol==null?void 0:e.excludeCompanySymbol,companyName:e.companyName==null?void 0:e.companyName,personWikidataId:e.personWikidataId==null?void 0:e.personWikidataId,excludePersonWikidataId:e.excludePersonWikidataId==null?void 0:e.excludePersonWikidataId,personName:e.personName==null?void 0:e.personName,excludePersonName:e.excludePersonName==null?void 0:e.excludePersonName,aND:e.AND==null?void 0:e.AND.map(H),oR:e.OR==null?void 0:e.OR.map(H),nOT:e.NOT==null?void 0:e.NOT.map(H)}}function D(e){return It(e,false)}function It(e,n=false){return e==null?e:{articleId:e.articleId,clusterId:e.clusterId,source:e.source,excludeSource:e.excludeSource,sourceGroup:e.sourceGroup,language:e.language,excludeLanguage:e.excludeLanguage,label:e.label,excludeLabel:e.excludeLabel,taxonomy:e.taxonomy,category:e.category,topic:e.topic,excludeTopic:e.excludeTopic,country:e.country,excludeCountry:e.excludeCountry,locationsCountry:e.locationsCountry,excludeLocationsCountry:e.excludeLocationsCountry,state:e.state,excludeState:e.excludeState,county:e.county,excludeCounty:e.excludeCounty,city:e.city,excludeCity:e.excludeCity,sourceCountry:e.sourceCountry,sourceState:e.sourceState,sourceCounty:e.sourceCounty,sourceCity:e.sourceCity,coordinates:ue(e.coordinates),sourceCoordinates:ue(e.sourceCoordinates),companyId:e.companyId,excludeCompanyId:e.excludeCompanyId,companyDomain:e.companyDomain,excludeCompanyDomain:e.excludeCompanyDomain,companySymbol:e.companySymbol,excludeCompanySymbol:e.excludeCompanySymbol,companyName:e.companyName,personWikidataId:e.personWikidataId,excludePersonWikidataId:e.excludePersonWikidataId,personName:e.personName,excludePersonName:e.excludePersonName,AND:e.aND==null?void 0:e.aND.map(D),OR:e.oR==null?void 0:e.oR.map(D),NOT:e.nOT==null?void 0:e.nOT.map(D)}}function ta(e){return !(!("prompt"in e)||e.prompt===void 0)}function oa(e){return Jt(e)}function Jt(e,n){return e==null?e:{prompt:e.prompt,filter:e.filter==null?void 0:H(e.filter),pubDateFrom:e.pubDateFrom==null?void 0:new Date(e.pubDateFrom),pubDateTo:e.pubDateTo==null?void 0:new Date(e.pubDateTo),showReprints:e.showReprints==null?void 0:e.showReprints,size:e.size==null?void 0:e.size,page:e.page==null?void 0:e.page}}function We(e){return Et(e,false)}function Et(e,n=false){return e==null?e:{prompt:e.prompt,filter:D(e.filter),pubDateFrom:e.pubDateFrom==null?void 0:e.pubDateFrom.toISOString(),pubDateTo:e.pubDateTo==null?void 0:e.pubDateTo.toISOString(),showReprints:e.showReprints,size:e.size,page:e.page}}function ia(e){return true}function u(e){return Ft(e)}function Ft(e,n){return e==null?e:{classLoaderName:e.classLoaderName==null?void 0:e.classLoaderName,moduleName:e.moduleName==null?void 0:e.moduleName,moduleVersion:e.moduleVersion==null?void 0:e.moduleVersion,methodName:e.methodName==null?void 0:e.methodName,fileName:e.fileName==null?void 0:e.fileName,lineNumber:e.lineNumber==null?void 0:e.lineNumber,nativeMethod:e.nativeMethod==null?void 0:e.nativeMethod,className:e.className==null?void 0:e.className}}function c(e){return Ht(e,false)}function Ht(e,n=false){return e==null?e:{classLoaderName:e.classLoaderName,moduleName:e.moduleName,moduleVersion:e.moduleVersion,methodName:e.methodName,fileName:e.fileName,lineNumber:e.lineNumber,nativeMethod:e.nativeMethod,className:e.className}}function da(e){return true}function s(e){return Dt(e)}function Dt(e,n){return e==null?e:{stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),message:e.message==null?void 0:e.message,localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function p(e){return kt(e,false)}function kt(e,n=false){return e==null?e:{stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),message:e.message,localizedMessage:e.localizedMessage}}function fa(e){return true}function y(e){return wt(e)}function wt(e,n){return e==null?e:{stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),message:e.message==null?void 0:e.message,localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function m(e){return Mt(e,false)}function Mt(e,n=false){return e==null?e:{stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),message:e.message,localizedMessage:e.localizedMessage}}var ba={_100Continue:"100 CONTINUE",_101SwitchingProtocols:"101 SWITCHING_PROTOCOLS",_102Processing:"102 PROCESSING",_103Checkpoint:"103 CHECKPOINT",_200Ok:"200 OK",_201Created:"201 CREATED",_202Accepted:"202 ACCEPTED",_203NonAuthoritativeInformation:"203 NON_AUTHORITATIVE_INFORMATION",_204NoContent:"204 NO_CONTENT",_205ResetContent:"205 RESET_CONTENT",_206PartialContent:"206 PARTIAL_CONTENT",_207MultiStatus:"207 MULTI_STATUS",_208AlreadyReported:"208 ALREADY_REPORTED",_226ImUsed:"226 IM_USED",_300MultipleChoices:"300 MULTIPLE_CHOICES",_301MovedPermanently:"301 MOVED_PERMANENTLY",_302Found:"302 FOUND",_302MovedTemporarily:"302 MOVED_TEMPORARILY",_303SeeOther:"303 SEE_OTHER",_304NotModified:"304 NOT_MODIFIED",_305UseProxy:"305 USE_PROXY",_307TemporaryRedirect:"307 TEMPORARY_REDIRECT",_308PermanentRedirect:"308 PERMANENT_REDIRECT",_400BadRequest:"400 BAD_REQUEST",_401Unauthorized:"401 UNAUTHORIZED",_402PaymentRequired:"402 PAYMENT_REQUIRED",_403Forbidden:"403 FORBIDDEN",_404NotFound:"404 NOT_FOUND",_405MethodNotAllowed:"405 METHOD_NOT_ALLOWED",_406NotAcceptable:"406 NOT_ACCEPTABLE",_407ProxyAuthenticationRequired:"407 PROXY_AUTHENTICATION_REQUIRED",_408RequestTimeout:"408 REQUEST_TIMEOUT",_409Conflict:"409 CONFLICT",_410Gone:"410 GONE",_411LengthRequired:"411 LENGTH_REQUIRED",_412PreconditionFailed:"412 PRECONDITION_FAILED",_413PayloadTooLarge:"413 PAYLOAD_TOO_LARGE",_413RequestEntityTooLarge:"413 REQUEST_ENTITY_TOO_LARGE",_414UriTooLong:"414 URI_TOO_LONG",_414RequestUriTooLong:"414 REQUEST_URI_TOO_LONG",_415UnsupportedMediaType:"415 UNSUPPORTED_MEDIA_TYPE",_416RequestedRangeNotSatisfiable:"416 REQUESTED_RANGE_NOT_SATISFIABLE",_417ExpectationFailed:"417 EXPECTATION_FAILED",_418IAmATeapot:"418 I_AM_A_TEAPOT",_419InsufficientSpaceOnResource:"419 INSUFFICIENT_SPACE_ON_RESOURCE",_420MethodFailure:"420 METHOD_FAILURE",_421DestinationLocked:"421 DESTINATION_LOCKED",_422UnprocessableEntity:"422 UNPROCESSABLE_ENTITY",_423Locked:"423 LOCKED",_424FailedDependency:"424 FAILED_DEPENDENCY",_425TooEarly:"425 TOO_EARLY",_426UpgradeRequired:"426 UPGRADE_REQUIRED",_428PreconditionRequired:"428 PRECONDITION_REQUIRED",_429TooManyRequests:"429 TOO_MANY_REQUESTS",_431RequestHeaderFieldsTooLarge:"431 REQUEST_HEADER_FIELDS_TOO_LARGE",_451UnavailableForLegalReasons:"451 UNAVAILABLE_FOR_LEGAL_REASONS",_500InternalServerError:"500 INTERNAL_SERVER_ERROR",_501NotImplemented:"501 NOT_IMPLEMENTED",_502BadGateway:"502 BAD_GATEWAY",_503ServiceUnavailable:"503 SERVICE_UNAVAILABLE",_504GatewayTimeout:"504 GATEWAY_TIMEOUT",_505HttpVersionNotSupported:"505 HTTP_VERSION_NOT_SUPPORTED",_506VariantAlsoNegotiates:"506 VARIANT_ALSO_NEGOTIATES",_507InsufficientStorage:"507 INSUFFICIENT_STORAGE",_508LoopDetected:"508 LOOP_DETECTED",_509BandwidthLimitExceeded:"509 BANDWIDTH_LIMIT_EXCEEDED",_510NotExtended:"510 NOT_EXTENDED",_511NetworkAuthenticationRequired:"511 NETWORK_AUTHENTICATION_REQUIRED"};function Ia(e){return true}function Ja(e){return Lt(e)}function Lt(e,n){return e==null?e:{cause:e.cause==null?void 0:s(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),statusCode:e.statusCode==null?void 0:e.statusCode,message:e.message==null?void 0:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(y),localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function Ea(e){return _t(e,false)}function _t(e,n=false){return e==null?e:{cause:p(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),statusCode:e.statusCode,message:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(m),localizedMessage:e.localizedMessage}}function Ha(e){return true}function ze(e){return Bt(e)}function Bt(e,n){return e==null?e:{symbol:e.symbol==null?void 0:e.symbol,exchange:e.exchange==null?void 0:e.exchange,exchangeShortName:e.exchangeShortName==null?void 0:e.exchangeShortName,ipoDate:e.ipoDate==null?void 0:e.ipoDate}}function Ve(e){return Ut(e,false)}function Ut(e,n=false){return e==null?e:{symbol:e.symbol,exchange:e.exchange,exchangeShortName:e.exchangeShortName,ipoDate:e.ipoDate}}function ka(e){return true}function Ge(e){return Wt(e)}function Wt(e,n){return e==null?e:{careers:e.careers==null?void 0:e.careers,about:e.about==null?void 0:e.about,blog:e.blog==null?void 0:e.blog,events:e.events==null?void 0:e.events,sitemap:e.sitemap==null?void 0:e.sitemap,updates:e.updates==null?void 0:e.updates,linkedin:e.linkedin==null?void 0:e.linkedin,facebook:e.facebook==null?void 0:e.facebook,instagram:e.instagram==null?void 0:e.instagram,medium:e.medium==null?void 0:e.medium,reddit:e.reddit==null?void 0:e.reddit,threads:e.threads==null?void 0:e.threads,tiktok:e.tiktok==null?void 0:e.tiktok,x:e.x==null?void 0:e.x,wellfound:e.wellfound==null?void 0:e.wellfound,youtube:e.youtube==null?void 0:e.youtube,wikipedia:e.wikipedia==null?void 0:e.wikipedia}}function Qe(e){return zt(e,false)}function zt(e,n=false){return e==null?e:{careers:e.careers,about:e.about,blog:e.blog,events:e.events,sitemap:e.sitemap,updates:e.updates,linkedin:e.linkedin,facebook:e.facebook,instagram:e.instagram,medium:e.medium,reddit:e.reddit,threads:e.threads,tiktok:e.tiktok,x:e.x,wellfound:e.wellfound,youtube:e.youtube,wikipedia:e.wikipedia}}function za(e){return true}function Ke(e){return Vt(e)}function Vt(e,n){return e==null?e:{id:e.id==null?void 0:e.id,name:e.name==null?void 0:e.name,updatedAt:e.updatedAt==null?void 0:e.updatedAt,primaryRecordId:e.primaryRecordId==null?void 0:e.primaryRecordId,altNames:e.altNames==null?void 0:e.altNames,domains:e.domains==null?void 0:e.domains,monthlyVisits:e.monthlyVisits==null?void 0:e.monthlyVisits,globalRank:e.globalRank==null?void 0:e.globalRank,description:e.description==null?void 0:e.description,ceo:e.ceo==null?void 0:e.ceo,industry:e.industry==null?void 0:e.industry,sector:e.sector==null?void 0:e.sector,country:e.country==null?void 0:e.country,fullTimeEmployees:e.fullTimeEmployees==null?void 0:e.fullTimeEmployees,address:e.address==null?void 0:e.address,city:e.city==null?void 0:e.city,state:e.state==null?void 0:e.state,zip:e.zip==null?void 0:e.zip,logo:e.logo==null?void 0:e.logo,favicon:e.favicon==null?void 0:e.favicon,isEtf:e.isEtf==null?void 0:e.isEtf,isActivelyTrading:e.isActivelyTrading==null?void 0:e.isActivelyTrading,isFund:e.isFund==null?void 0:e.isFund,isAdr:e.isAdr==null?void 0:e.isAdr,symbols:e.symbols==null?void 0:e.symbols.map(ze),naics:e.naics==null?void 0:e.naics,sic:e.sic==null?void 0:e.sic,yearFounded:e.yearFounded==null?void 0:e.yearFounded,revenue:e.revenue==null?void 0:e.revenue,webResources:e.webResources==null?void 0:Ge(e.webResources)}}function Ye(e){return Gt(e,false)}function Gt(e,n=false){return e==null?e:{id:e.id,name:e.name,updatedAt:e.updatedAt,primaryRecordId:e.primaryRecordId,altNames:e.altNames,domains:e.domains,monthlyVisits:e.monthlyVisits,globalRank:e.globalRank,description:e.description,ceo:e.ceo,industry:e.industry,sector:e.sector,country:e.country,fullTimeEmployees:e.fullTimeEmployees,address:e.address,city:e.city,state:e.state,zip:e.zip,logo:e.logo,favicon:e.favicon,isEtf:e.isEtf,isActivelyTrading:e.isActivelyTrading,isFund:e.isFund,isAdr:e.isAdr,symbols:e.symbols==null?void 0:e.symbols.map(Ve),naics:e.naics,sic:e.sic,yearFounded:e.yearFounded,revenue:e.revenue,webResources:Qe(e.webResources)}}function Ya(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("results"in e)||e.results===void 0)}function $e(e){return Qt(e)}function Qt(e,n){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(Ke)}}function $a(e){return Kt(e,false)}function Kt(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(Ye)}}function ru(e){return true}function iu(e){return Yt(e)}function Yt(e,n){return e==null?e:{cause:e.cause==null?void 0:s(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),message:e.message==null?void 0:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(y),localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function lu(e){return $t(e,false)}function $t(e,n=false){return e==null?e:{cause:p(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),message:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(m),localizedMessage:e.localizedMessage}}function uu(e){return true}function C(e){return Pt(e)}function Pt(e,n){return e==null?e:{url:e.url==null?void 0:e.url}}function b(e){return Xt(e,false)}function Xt(e,n=false){return e==null?e:{url:e.url}}function xu(e){return true}function Nu(e){return Zt(e)}function Zt(e,n){return e==null?e:{cause:e.cause==null?void 0:s(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),message:e.message==null?void 0:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(y),localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function Ou(e){return qt(e,false)}function qt(e,n=false){return e==null?e:{cause:p(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),message:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(m),localizedMessage:e.localizedMessage}}function bu(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("results"in e)||e.results===void 0)}function Pe(e){return vt(e)}function vt(e,n){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(h)}}function Iu(e){return jt(e,false)}function jt(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(W)}}function Bu(e){return true}function Uu(e){return eo(e)}function eo(e,n){return e==null?e:{cause:e.cause==null?void 0:s(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(u),message:e.message==null?void 0:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(y),localizedMessage:e.localizedMessage==null?void 0:e.localizedMessage}}function Wu(e){return no(e,false)}function no(e,n=false){return e==null?e:{cause:p(e.cause),stackTrace:e.stackTrace==null?void 0:e.stackTrace.map(c),message:e.message,suppressed:e.suppressed==null?void 0:e.suppressed.map(m),localizedMessage:e.localizedMessage}}function Vu(e){return true}function f(e){return to(e)}function to(e,n){return e==null?e:{time:e.time==null?void 0:e.time,precision:e.precision==null?void 0:e.precision}}function S(e){return oo(e,false)}function oo(e,n=false){return e==null?e:{time:e.time,precision:e.precision}}function $u(e){return true}function Xe(e){return ro(e)}function ro(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,label:e.label==null?void 0:e.label,startTime:e.startTime==null?void 0:f(e.startTime),endTime:e.endTime==null?void 0:f(e.endTime)}}function Ze(e){return io(e,false)}function io(e,n=false){return e==null?e:{wikidataId:e.wikidataId,label:e.label,startTime:S(e.startTime),endTime:S(e.endTime)}}function Xu(e){return true}function k(e){return lo(e)}function lo(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,label:e.label==null?void 0:e.label}}function w(e){return ao(e,false)}function ao(e,n=false){return e==null?e:{wikidataId:e.wikidataId,label:e.label}}function oc(e){return true}function qe(e){return uo(e)}function uo(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,label:e.label==null?void 0:e.label,startTime:e.startTime==null?void 0:f(e.startTime),endTime:e.endTime==null?void 0:f(e.endTime),employer:e.employer==null?void 0:k(e.employer)}}function ve(e){return co(e,false)}function co(e,n=false){return e==null?e:{wikidataId:e.wikidataId,label:e.label,startTime:S(e.startTime),endTime:S(e.endTime),employer:w(e.employer)}}function Nc(e){return true}function je(e){return so(e)}function so(e,n){return e==null?e:{wikidataId:e.wikidataId==null?void 0:e.wikidataId,createdAt:e.createdAt==null?void 0:e.createdAt,updatedAt:e.updatedAt==null?void 0:e.updatedAt,name:e.name==null?void 0:e.name,gender:e.gender==null?void 0:k(e.gender),dateOfBirth:e.dateOfBirth==null?void 0:f(e.dateOfBirth),dateOfDeath:e.dateOfDeath==null?void 0:f(e.dateOfDeath),description:e.description==null?void 0:e.description,aliases:e.aliases==null?void 0:e.aliases,occupation:e.occupation==null?void 0:e.occupation.map(k),position:e.position==null?void 0:e.position.map(qe),politicalParty:e.politicalParty==null?void 0:e.politicalParty.map(Xe),image:e.image==null?void 0:C(e.image),_abstract:e.abstract==null?void 0:e.abstract}}function en(e){return po(e,false)}function po(e,n=false){return e==null?e:{wikidataId:e.wikidataId,createdAt:e.createdAt,updatedAt:e.updatedAt,name:e.name,gender:w(e.gender),dateOfBirth:S(e.dateOfBirth),dateOfDeath:S(e.dateOfDeath),description:e.description,aliases:e.aliases,occupation:e.occupation==null?void 0:e.occupation.map(w),position:e.position==null?void 0:e.position.map(ve),politicalParty:e.politicalParty==null?void 0:e.politicalParty.map(Ze),image:b(e.image),abstract:e._abstract}}function Cc(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("results"in e)||e.results===void 0)}function nn(e){return yo(e)}function yo(e,n){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(je)}}function bc(e){return mo(e,false)}function mo(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(en)}}function Hc(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("articles"in e)||e.articles===void 0)}function tn(e){return fo(e)}function fo(e,n){return e==null?e:{status:e.status,numResults:e.numResults,articles:e.articles.map(T)}}function Dc(e){return So(e,false)}function So(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,articles:e.articles.map(g)}}function _c(e){return true}function on(e){return To(e)}function To(e,n){return e==null?e:{score:e.score==null?void 0:e.score,data:e.data==null?void 0:T(e.data)}}function rn(e){return go(e,false)}function go(e,n=false){return e==null?e:{score:e.score,data:g(e.data)}}var ce={CreatedAt:"createdAt",UpdatedAt:"updatedAt",Relevance:"relevance",Count:"count",TotalCount:"totalCount"};function Uc(e){for(let n in ce)if(Object.prototype.hasOwnProperty.call(ce,n)&&ce[n]===e)return true;return false}function Wc(e){return xo(e)}function xo(e,n){return e}function zc(e){return e}function Vc(e,n){return e}function Qc(e){return true}function M(e){return No(e)}function No(e,n){return e==null?e:{name:e.name==null?void 0:e.name,count:e.count==null?void 0:e.count}}function L(e){return Oo(e,false)}function Oo(e,n=false){return e==null?e:{name:e.name,count:e.count}}function nd(e){return true}function ln(e){return Ro(e)}function Ro(e,n){return e==null?e:{id:e.id==null?void 0:e.id,domain:e.domain==null?void 0:e.domain,name:e.name==null?void 0:e.name,primaryRecordId:e.primaryRecordId==null?void 0:e.primaryRecordId,updatedAt:e.updatedAt==null?void 0:e.updatedAt,altNames:e.altNames==null?void 0:e.altNames,description:e.description==null?void 0:e.description,avgMonthlyPosts:e.avgMonthlyPosts==null?void 0:e.avgMonthlyPosts,paywall:e.paywall==null?void 0:e.paywall,location:e.location==null?void 0:G(e.location),topCategories:e.topCategories==null?void 0:e.topCategories.map(M),topTopics:e.topTopics==null?void 0:e.topTopics.map(M),topCountries:e.topCountries==null?void 0:e.topCountries.map(M),topLabels:e.topLabels==null?void 0:e.topLabels.map(M),avgBiasRating:e.avgBiasRating==null?void 0:e.avgBiasRating,adFontesBiasRating:e.adFontesBiasRating==null?void 0:e.adFontesBiasRating,allSidesBiasRating:e.allSidesBiasRating==null?void 0:e.allSidesBiasRating,mbfcBiasRating:e.mbfcBiasRating==null?void 0:e.mbfcBiasRating,monthlyVisits:e.monthlyVisits==null?void 0:e.monthlyVisits,globalRank:e.globalRank==null?void 0:e.globalRank,logoLarge:e.logoLarge==null?void 0:C(e.logoLarge),logoFavIcon:e.logoFavIcon==null?void 0:C(e.logoFavIcon),logoSquare:e.logoSquare==null?void 0:C(e.logoSquare)}}function an(e){return Ao(e,false)}function Ao(e,n=false){return e==null?e:{id:e.id,domain:e.domain,name:e.name,primaryRecordId:e.primaryRecordId,updatedAt:e.updatedAt,altNames:e.altNames,description:e.description,avgMonthlyPosts:e.avgMonthlyPosts,paywall:e.paywall,location:Q(e.location),topCategories:e.topCategories==null?void 0:e.topCategories.map(L),topTopics:e.topTopics==null?void 0:e.topTopics.map(L),topCountries:e.topCountries==null?void 0:e.topCountries.map(L),topLabels:e.topLabels==null?void 0:e.topLabels.map(L),avgBiasRating:e.avgBiasRating,adFontesBiasRating:e.adFontesBiasRating,allSidesBiasRating:e.allSidesBiasRating,mbfcBiasRating:e.mbfcBiasRating,monthlyVisits:e.monthlyVisits,globalRank:e.globalRank,logoLarge:b(e.logoLarge),logoFavIcon:b(e.logoFavIcon),logoSquare:b(e.logoSquare)}}function ld(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("results"in e)||e.results===void 0)}function un(e){return ho(e)}function ho(e,n){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(ln)}}function ad(e){return Co(e,false)}function Co(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(an)}}function pd(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("results"in e)||e.results===void 0)}function cn(e){return bo(e)}function bo(e,n){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(ne)}}function yd(e){return Io(e,false)}function Io(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,results:e.results.map(te)}}var fd={Title:"TITLE",Content:"CONTENT",Summary:"SUMMARY"},Sd={Articles:"ARTICLES",Clusters:"CLUSTERS"},Td={Gpt4o:"gpt-4o",Gpt4oMini:"gpt-4o-mini",Gpt41:"gpt-4.1",Gpt41Mini:"gpt-4.1-mini",Gpt41Nano:"gpt-4.1-nano",Llama3370bVersatile:"llama-3.3-70b-versatile",DeepseekR1DistillLlama70b:"deepseek-r1-distill-llama-70b"};function gd(e){return true}function xd(e){return Jo(e)}function Jo(e,n){return e==null?e:{prompt:e.prompt==null?void 0:e.prompt,maxArticleCount:e.maxArticleCount==null?void 0:e.maxArticleCount,returnedArticleCount:e.returnedArticleCount==null?void 0:e.returnedArticleCount,summarizeFields:e.summarizeFields==null?void 0:e.summarizeFields,method:e.method==null?void 0:e.method,model:e.model==null?void 0:e.model,temperature:e.temperature==null?void 0:e.temperature,topP:e.topP==null?void 0:e.topP,maxTokens:e.maxTokens==null?void 0:e.maxTokens}}function dn(e){return Eo(e,false)}function Eo(e,n=false){return e==null?e:{prompt:e.prompt,maxArticleCount:e.maxArticleCount,returnedArticleCount:e.returnedArticleCount,summarizeFields:e.summarizeFields,method:e.method,model:e.model,temperature:e.temperature,topP:e.topP,maxTokens:e.maxTokens}}function hd(e){return !(!("status"in e)||e.status===void 0||!("numResults"in e)||e.numResults===void 0||!("summary"in e)||e.summary===void 0||!("results"in e)||e.results===void 0)}function sn(e){return Fo(e)}function Fo(e,n){return e==null?e:{status:e.status,numResults:e.numResults,summary:e.summary,results:e.results.map(T)}}function Cd(e){return Ho(e,false)}function Ho(e,n=false){return e==null?e:{status:e.status,numResults:e.numResults,summary:e.summary,results:e.results.map(g)}}var Ld={_100Continue:"100 CONTINUE",_101SwitchingProtocols:"101 SWITCHING_PROTOCOLS",_102Processing:"102 PROCESSING",_103Checkpoint:"103 CHECKPOINT",_200Ok:"200 OK",_201Created:"201 CREATED",_202Accepted:"202 ACCEPTED",_203NonAuthoritativeInformation:"203 NON_AUTHORITATIVE_INFORMATION",_204NoContent:"204 NO_CONTENT",_205ResetContent:"205 RESET_CONTENT",_206PartialContent:"206 PARTIAL_CONTENT",_207MultiStatus:"207 MULTI_STATUS",_208AlreadyReported:"208 ALREADY_REPORTED",_226ImUsed:"226 IM_USED",_300MultipleChoices:"300 MULTIPLE_CHOICES",_301MovedPermanently:"301 MOVED_PERMANENTLY",_302Found:"302 FOUND",_302MovedTemporarily:"302 MOVED_TEMPORARILY",_303SeeOther:"303 SEE_OTHER",_304NotModified:"304 NOT_MODIFIED",_305UseProxy:"305 USE_PROXY",_307TemporaryRedirect:"307 TEMPORARY_REDIRECT",_308PermanentRedirect:"308 PERMANENT_REDIRECT",_400BadRequest:"400 BAD_REQUEST",_401Unauthorized:"401 UNAUTHORIZED",_402PaymentRequired:"402 PAYMENT_REQUIRED",_403Forbidden:"403 FORBIDDEN",_404NotFound:"404 NOT_FOUND",_405MethodNotAllowed:"405 METHOD_NOT_ALLOWED",_406NotAcceptable:"406 NOT_ACCEPTABLE",_407ProxyAuthenticationRequired:"407 PROXY_AUTHENTICATION_REQUIRED",_408RequestTimeout:"408 REQUEST_TIMEOUT",_409Conflict:"409 CONFLICT",_410Gone:"410 GONE",_411LengthRequired:"411 LENGTH_REQUIRED",_412PreconditionFailed:"412 PRECONDITION_FAILED",_413PayloadTooLarge:"413 PAYLOAD_TOO_LARGE",_413RequestEntityTooLarge:"413 REQUEST_ENTITY_TOO_LARGE",_414UriTooLong:"414 URI_TOO_LONG",_414RequestUriTooLong:"414 REQUEST_URI_TOO_LONG",_415UnsupportedMediaType:"415 UNSUPPORTED_MEDIA_TYPE",_416RequestedRangeNotSatisfiable:"416 REQUESTED_RANGE_NOT_SATISFIABLE",_417ExpectationFailed:"417 EXPECTATION_FAILED",_418IAmATeapot:"418 I_AM_A_TEAPOT",_419InsufficientSpaceOnResource:"419 INSUFFICIENT_SPACE_ON_RESOURCE",_420MethodFailure:"420 METHOD_FAILURE",_421DestinationLocked:"421 DESTINATION_LOCKED",_422UnprocessableEntity:"422 UNPROCESSABLE_ENTITY",_423Locked:"423 LOCKED",_424FailedDependency:"424 FAILED_DEPENDENCY",_425TooEarly:"425 TOO_EARLY",_426UpgradeRequired:"426 UPGRADE_REQUIRED",_428PreconditionRequired:"428 PRECONDITION_REQUIRED",_429TooManyRequests:"429 TOO_MANY_REQUESTS",_431RequestHeaderFieldsTooLarge:"431 REQUEST_HEADER_FIELDS_TOO_LARGE",_451UnavailableForLegalReasons:"451 UNAVAILABLE_FOR_LEGAL_REASONS",_500InternalServerError:"500 INTERNAL_SERVER_ERROR",_501NotImplemented:"501 NOT_IMPLEMENTED",_502BadGateway:"502 BAD_GATEWAY",_503ServiceUnavailable:"503 SERVICE_UNAVAILABLE",_504GatewayTimeout:"504 GATEWAY_TIMEOUT",_505HttpVersionNotSupported:"505 HTTP_VERSION_NOT_SUPPORTED",_506Variant