1var b=Object.defineProperty;var r=(s,e)=>b(s,"name",{value:e,configurable:!0});export const PLACEMENTS=Object.freeze([{group:"Learn articles",items:[{key:"learnTop",label:"Banner after the second section",slot:"article-top"},{key:"learnEarly",label:"Rectangle at 40%, long articles only",slot:"article-mid1"},{key:"learnMid",label:"Rectangle at two-thirds",slot:"article-mid"},{key:"learnEnd",label:"Banner before \u201CContinue your journey\u201D",slot:"article-end"}]},{group:"Library and company pages",items:[{key:"libraryMid",label:"Banner in the middle",slot:"libdoc-mid"},{key:"libraryEnd",label:"Banner at the end",slot:"libdoc-end"}]},{group:"Home, collections and the blog",items:[{key:"mediaBanner",label:"Banner above the grid",slot:"media-banner"},{key:"infeed",label:"Cards inside the grid",slot:"grid-card"},{key:"explicit",label:"Slots written into a page\u2019s markup",slot:"explicit"}]},{group:"Search",items:[{key:"searchStrip",label:"Strip under the results",slot:"search-results"}]},{group:"Every other page",items:[{key:"pageEnd",label:"Banner at the end of the page",slot:"main-end"}]},{group:"Floating panels",items:[{key:"kitMenu",label:"Menu kit",slot:"kit-menu"},{key:"kitAdvanced",label:"Advanced kit",slot:"kit-advanced"},{key:"kitFeature",label:"Feature kit",slot:"kit-feature"},{key:"spotlight",label:"Spotlight search",slot:"spotlight"}]}]),PLACEMENT_KEYS=Object.freeze(PLACEMENTS.flatMap(s=>s.items.map(e=>e.key))),NETWORKS=Object.freeze([{key:"direct",label:"Your campaigns",note:"Campaigns made in this console. First in line."},{key:"google",label:"Google AdSense",note:"Only with marketing consent, and never on your own browsing."},{key:"house",label:"Built-in campaigns",note:"The site\u2019s own ads. Last in line, so a slot is never left empty."}]),LIMITS=Object.freeze({maxInline:{min:0,max:6,label:"Ads in the body of a page",note:"In-feed cards and floating panels do not count."},sessionUnits:{min:0,max:400,label:"Ads drawn per visit",note:"After this many, no new ad is drawn until the visitor comes back. 0 = no limit."},perSlotImpressions:{min:0,max:50,label:"Times one slot is shown per visit",note:"A slot a visitor has seen this often stops appearing. 0 = no limit."},refreshSeconds:{min:0,max:600,label:"Refresh a visible ad every",note:"Seconds. 0 = never. Anything under 30 is raised to 30; only ads on screen in a focused tab refresh."}}),DEFAULT_AD_SETTINGS=Object.freeze({enabled:!0,networks:Object.freeze({direct:!0,google:!0,house:!0}),placements:Object.freeze(Object.fromEntries(PLACEMENT_KEYS.map(s=>[s,!0]))),maxInline:4,feedPositions:Object.freeze([3,11,19]),sessionUnits:80,perSlotImpressions:4,refreshSeconds:0,mobileStripBelow:600,excludedPaths:Object.freeze([])});const a=r((s,{min:e,max:n},o)=>{const i=Math.round(Number(s));return Number.isFinite(i)?Math.max(e,Math.min(n,i)):o},"clampInt");export function normalizeAdSettings(s){const e=s&&typeof s=="object"?s:{},n=DEFAULT_AD_SETTINGS,o={};for(const t of NETWORKS)o[t.key]=typeof e.networks?.[t.key]=="boolean"?e.networks[t.key]:n.networks[t.key];const i={};for(const t of PLACEMENT_KEYS)i[t]=typeof e.placements?.[t]=="boolean"?e.placements[t]:n.placements[t];const d=Array.isArray(e.feedPositions)?e.feedPositions:n.feedPositions,c=[...new Set(d.map(t=>Math.round(Number(t))).filter(t=>t>=1&&t<=60))].sort((t,p)=>t-p).slice(0,5),m=[...new Set((Array.isArray(e.excludedPaths)?e.excludedPaths:[]).map(t=>String(t||"").trim().toLowerCase()).filter(t=>/^\/(?!\/)[a-z0-9\-._~%/]*$/.test(t)&&t.length<=120))].slice(0,50);let l=a(e.refreshSeconds,LIMITS.refreshSeconds,n.refreshSeconds);return l>0&&l<30&&(l=30),{enabled:typeof e.enabled=="boolean"?e.enabled:n.enabled,networks:o,placements:i,maxInline:a(e.maxInline,LIMITS.maxInline,n.maxInline),feedPositions:c.length?c:[...n.feedPositions],sessionUnits:a(e.sessionUnits,LIMITS.sessionUnits,n.sessionUnits),perSlotImpressions:a(e.perSlotImpressions,LIMITS.perSlotImpressions,n.perSlotImpressions),refreshSeconds:l,mobileStripBelow:a(e.mobileStripBelow,{min:0,max:1200},n.mobileStripBelow),excludedPaths:m}}r(normalizeAdSettings,"normalizeAdSettings");export function isExcludedPath(s,e){const n=String(e||"/").toLowerCase();return(s?.excludedPaths||[]).some(o=>n===o||n.startsWith(o.endsWith("/")?o:`${o}/`))}r(isExcludedPath,"isExcludedPath");export function placementOfSlot(s,e=""){const n=String(s||""),o=e&&n.endsWith(`-${e}`)?n.slice(0,-(e.length+1)):n;if(o.startsWith("explicit-"))return`explicit-${o.split("-").pop()}`;const i=/^grid-card-(\d+)/.exec(o);return i?`grid-card-${i[1]}`:o.replace(/-\/.*$/,"")}r(placementOfSlot,"placementOfSlot");
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.