### Start Footer Initialization Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initiates the footer setup process, including version rendering, bus subscriptions, and conditional ad loading based on PII and consent status. It also loads Moat Yield Intelligence. ```javascript function startFooter(){featureFlags.show_version&&renderVersion(),addDefaultSubscriptions(cnBus,featureFlags.bus_log),"info"===queryParameters.ao_tools&&append({src:"https://ad-tools.condenastdigital.com/ads-"+queryParameters.ao_tools+"/prod/index.js",targ:document.head}),queryParameters.ap_noads||(hasPII()?onPIIDetected():(moatYieldIntelligence.load().then(function(){window.cnBus.emit("ads.moat.yield-ready")}),til(function(){return cns.pageContext},function(){shouldWaitForConsent()?onConsent(initAdsLibrary):initAdsLibrary()})))} set(window,"cns.buildDate",getConfig(window).buildDate),set(window,"cns.fastAdsFooter",version),set(window,"cns.runtimeId",queryParameters.runtimeId||runtimeId),set(window,"cns.about",about),set(window,"cns.timing.footerStart",Date.now()),set(window,"cns.addTargeting",notSetup("cns.addTargeting")),startFooter()}(); ``` -------------------------------- ### Start Development Services Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/starting-dev-server.md These commands start the necessary development services. 'task dev:services' starts the PostgreSQL database and an SMTP server for email testing. 'task py:postgres' runs the backend API configured for the local PostgreSQL database. ```bash task dev:services ``` ```bash task py:postgres ``` -------------------------------- ### Install Dependencies with Taskfile (Linux/macOS) Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/starting-dev-server.md Use the Taskfile to install Python and Node dependencies, and download the NLP model. Ensure you are in the project's root directory. ```bash # Navigate To The Root Directory cd /path/to/project # Utilize the Taskfile to Install Dependencies task setup ``` -------------------------------- ### Start Mealie Backend and Frontend Servers Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/starting-dev-server.md To start the development servers, you need two separate terminal windows. One for the backend API ('task py') and one for the frontend UI ('task ui'). ```bash # Terminal #1 task py ``` ```bash # Terminal #2 task ui ``` -------------------------------- ### Example of Google Search with Recipe Slug Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/getting-started/features.md This example demonstrates how a recipe action URL with the `${slug}` merge field is transformed into a functional Google search URL when applied to a specific recipe. ```text https://www.google.com/search?q=pasta-fagioli ``` -------------------------------- ### Install Python Packages with Pinned Dependencies Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/building-packages.md Install the built Python package and all its dependencies, pinned to the versions tested by developers. ```sh pip3 install -r dist/requirements.txt --find-links dist ``` -------------------------------- ### Configure SWAG with Docker Compose Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/community-guide/swag.md Example configuration for setting up SWAG with DuckDNS validation. ```yaml version: "3.1" services: swag: image: ghcr.io/linuxserver/swag container_name: swag cap_add: - NET_ADMIN environment: - PUID=1000 - PGID=1000 - TZ=Europe/Brussels - URL= - SUBDOMAINS=wildcard - VALIDATION=duckdns - CERTPROVIDER= #optional - DNSPLUGIN= #optional - DUCKDNSTOKEN= - EMAIL= #optional - ONLY_SUBDOMAINS=false #optional - EXTRA_DOMAINS= #optional - STAGING=false #optional volumes: - /etc/config/swag:/config ports: - 443:443 - 80:80 #optional restart: unless-stopped ``` -------------------------------- ### String.prototype.startsWith Implementation Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Provides a polyfill for String.prototype.startsWith, ensuring compatibility across different JavaScript environments. It handles the starting index for the search. ```javascript "use strict";var n,o=e(2109),i=e(1236).f,u=e(7466),a=e(3929),c=e(4488),s=e(4964),f=e(1913),l="".startsWith,p=Math.min,h=s("startsWith");o({target:"String",proto:!0,forced:!!(f||h||(n=i(String.prototype,"startsWith"),!n||n.writable))&&!h},{startsWith:function(t){var r=String(c(this));a(t);var e=u(p(arguments.length>1?arguments[1]:void 0,r.length)),n=String(t);return l?l.call(r,n,e):r.slice(e,e+n.length)===n}})} ``` -------------------------------- ### Get Configuration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Safely retrieves configuration settings from the window object, returning undefined if not found. ```javascript function getConfig(e) { return e.cns && e.cns.config } ``` -------------------------------- ### Create Start Auction Function Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Creates a function to initiate an auction process, collecting promises for slots that are eligible for auction. ```javascript function createStartAuction(e){return collectPromises(function(t){return e.startAuction(t.map(function(e){return e.slot}))})} ``` -------------------------------- ### Install Python Package with Latest Compatible Dependencies Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/building-packages.md Install a specific Mealie Python wheel file, allowing for the latest compatible dependency versions. ```sh pip3 install dist/mealie-$VERSION-py3-none-any.whl ``` -------------------------------- ### Example Secret File Structure Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/getting-started/installation/backend-config.md Illustrates a recommended directory organization for storing sensitive configuration files, separating them into accessible and restricted subdirectories. ```text .\ndocker-compose.yml └── secrets # Access restricted to anyone that can manage secrets ├── postgres-host.txt ├── postgres-port.txt └── sensitive # Access further-restricted to anyone managing service accounts ├── postgres-db-name.txt ├── postgres-password.txt └── postgres-user.txt ``` -------------------------------- ### String Starts With Polyfill Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Provides a polyfill for the String.prototype.startsWith method if it's not natively supported. ```javascript var STARTS_WITH = "startsWith", $startsWith = ""[STARTS_WITH]; _export(_export.P + _export.F * _failsIsRegexp(STARTS_WITH), "String", { startsWith: function(e) { var t = _stringContext(this, e, STARTS_WITH), n = _toLength(Math.min(arguments.length > 1 ? arguments[1] : void 0, t.length)), r = String(e); return $startsWith ? $startsWith.call(t, r, n) : t.slice(n, n + r.length) === r; } }); ``` -------------------------------- ### Get About Information Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves project build information, including build date, fast ad configurations, and runtime ID. It prioritizes runtime ID from query parameters. ```javascript function about(){return{buildDate:cns.buildDate,fastAdsHead:cns.fastAdsHead,fastAdsFooter:cns.fastAdsFooter,runtimeId:queryParameters.runtimeId||runtimeId}} ``` -------------------------------- ### Start Sentry Integration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initializes Sentry error tracking by subscribing to warning and error events. It captures messages and their payloads, and queues them for sending to Sentry. ```javascript function startSentry(e){var t=["],n=e.subscribe("#.warn",function(e,n){var r=n.topic;t.push({topic:r,payload:stringifyPayload(e),level:"warning"})}),r=e.subscribe("#.error",function(e,n){var r=n.topic;t.push({topic:r,payload:stringifyPayload(e),level:"error"})});getRaven().then(function(e){e.setTagsContext({adsLibVersion:version});for(var n=function(t){var n=t.topic,r=t.payload,i=t.level;e.captureMessage(n,{level:i,tags:{topic:n},extra:{payload:r}})},t.length;)n(t.shift());t.push=n}).catch(function(){n(),r(),t=null})} ``` -------------------------------- ### Prebid Auction Start Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Initiates Prebid.js ad auctions for a given set of ad slots. It maps slots to ad units and requests bids. ```javascript this.startAuction = function(e) { return ( o("startAuction", e.map((e) => e.getSlotElementId())), Promise.all(e.map(a)).then(() => e.map(() => ({}))) ); }; ``` -------------------------------- ### Get Base Configuration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Constructs a base configuration object including channel, platform, template type, and viewport information derived from the page context. ```javascript function getBase() { const e = getPageContext(window) || {}, t = e.templateType || ""; let n = get$1(e, "keywords.platform") || []; n = n[0] || ""; return { channel: get$1(e, "channel") || "", platform: n, template: t, viewport: getViewportTemplate(), }; } ``` -------------------------------- ### Start Mealie Containers Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/getting-started/installation/installation-checklist.md Run this command in the directory containing your docker-compose.yaml file to start Mealie services in detached mode. ```bash docker compose up -d ``` -------------------------------- ### Initialize Prebid.js Configuration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Sets up Prebid.js configuration, including consent management, user syncing, and custom targeting tags. This is typically run on page load. ```javascript window.pbjs = window.pbjs || {que: []}; const t = window.pbjs; t.que.push(() => { queryParameters.bidders && (() => { const e = (get$1(window, "cns.prebid") || {}).adunits; const n = queryParameters.bidders.split(","); Object.keys(e).forEach((r) => { Object.keys(e[r]).forEach((o) => { e[r][o].bids = e[r][o].bids.filter((e) => n.indexOf(e.bidder) > -1); }); }); })(); (() => { const e = get$1(window, "cns.prebid"); const t = e.adunits; const n = e.adunit_default; n && Object.keys(t).forEach((e) => { Object.keys(t[e]).forEach((r) => { t[e][r].bids.forEach((e) => { const t = e.bidder; n[t] && Object.assign(e.params, n[t]); }); }); }); })(); const n = get$1(window, "cns.prebid.config") || {}; Object.assign(n, (() => { const e = { usp: { cmpApi: "static", consentData: { getUSPData: { uspString: getPrivacyString() } }, timeout: 50 }, }; if (shouldApplyGDPR()) { const t = shouldReadAndWriteCookies(); e.gdpr = { cmpApi: "iab", timeout: 1e4, deviceAccess: t }; } return { consentManagement: e }; })()); Object.assign(n, l()); Object.assign(n, u()); t.setConfig(n); c(t); }); ``` -------------------------------- ### Create docker-compose.yaml File Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/getting-started/installation/installation-checklist.md Initializes a docker-compose.yaml file for Mealie configuration. ```bash touch docker-compose.yaml ``` -------------------------------- ### Object Get Prototype Helper Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves the prototype of an object, handling IE's PROTO behavior. Use to reliably get an object's prototype chain. ```javascript var IE_PROTO$2=_sharedKey("IE_PROTO"),ObjectProto=Object.prototype, _objectGpo=Object.getPrototypeOf||function(e){return e=_toObject(e),_has(e,IE_PROTO$2)?e[IE_PROTO$2]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?ObjectProto:null}; ``` -------------------------------- ### Docker Compose Secrets Configuration Example Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/documentation/getting-started/installation/backend-config.md This example demonstrates how to use Docker Compose secrets for sensitive environment variables in Mealie. Secrets take precedence over environment variables. ```yaml services: mealie: secrets: # These secrets will be loaded by Docker into the `/run/secrets` folder within the container. - postgres-host - postgres-port - postgres-db-name - postgres-user - postgres-password environment: DB_ENGINE: postgres POSTGRES_SERVER: duplicate.entry.tld # This will be ignored, due to the secret defined, below. POSTGRES_SERVER_FILE: /run/secrets/postgres-host POSTGRES_PORT_FILE: /run/secrets/postgres-port POSTGRES_DB_FILE: /run/secrets/postgres-db-name POSTGRES_USER_FILE: /run/secrets/postgres-user POSTGRES_PASSWORD_FILE: /run/secrets/postgres-password ``` -------------------------------- ### Start Mealie Footer Ad Logic Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Manages the start of the footer ad logic, including version rendering, subscriptions, and conditional ad loading based on query parameters, PII detection, and consent. ```javascript function startFooter(){ featureFlags.show_version && renderVersion(), addDefaultSubscriptions(cnBus, featureFlags.bus_log), "info"===queryParameters.ao_tools && append({src: `https://ad-tools.condenastdigital.com/ads-${queryParameters.ao_tools}/prod/index.js`, targ: document.head, }), queryParameters.ap_noads || ( hasPII() ? onPIIDetected() : (moatYieldIntelligence.load().then(()=>{ window.cnBus.emit("ads.moat.yield-ready"); }), til( ()=> cns.pageContext, ()=>{ shouldWaitForConsent() ? onConsent(initAdsLibrary) : initAdsLibrary(); })) ); } ``` -------------------------------- ### Configure and Load Notification Modules Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Initializes the notification system by checking user location and loading necessary CSS and JS assets. ```javascript require.config({ paths: { "mybbc/templates": '//mybbc.files.bbci.co.uk/notification-ui/4.2.9/templates', "mybbc/notifications": '//mybbc.files.bbci.co.uk/notification-ui/4.2.9/js' } }); require(['mybbc/notifications/NotificationsMain', 'idcta/idcta-1'], function (NotificationsMain, idcta) { var loadNotifications = function (isUK) { if (isUK) { window.bbcpage.loadCSS('//mybbc.files.bbci.co.uk/notification-ui/4.2.9/css/main.min.css').then(function() { NotificationsMain.run(idcta, '//mybbc.files.bbci.co.uk/notification-ui/4.2.9/'); }); } }; window.bbcuser.isUKCombined().then(function(isUK) { loadNotifications(isUK); }); }); ``` -------------------------------- ### Get User Segments Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves user segments stored in the 'CN_segments' cookie. ```javascript function getUserSegments(){var e=getCookie("CN\u005Fsegments");return{usr\u005Fsegments:e?e.split("|"):[]}} ``` -------------------------------- ### Initialize Searchbox Component Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Configures the searchbox path and initializes the drawer component if the user is in the UK. ```javascript if (window.SEARCHBOX.locale) { require.config({ paths: { "search/searchbox": window.SEARCHBOX.searchboxAppStaticPrefix, } }); if (bbcuser && bbcuser.isUKCombined) { bbcuser.isUKCombined().then(function (isUK) { if (isUK) { require(['search/searchbox/searchboxDrawer'], function (SearchboxDrawer) { SearchboxDrawer.run(window.SEARCHBOX); }); } }); } } ``` -------------------------------- ### Get Purposes Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves the TCF purposes consents if the TCF API is loaded. ```javascript function getPurposes() { var e = {}; return isTCFLoaded() && window.__tcfapi("getTCData", 2, function(t, n) { n && (e = get(t, "purpose.consents") || {}) }), e } ``` -------------------------------- ### Prebid.js Initialization and Configuration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initializes Prebid.js with user IDs, consent management settings (GDPR, USP), and custom ad unit configurations. It dynamically adjusts bidder configurations based on query parameters and applies default bidder parameters. ```javascript function Prebid(e){var t=1e3,n=!0,r=new EventEmitter("prebid").debug,i={filterSettings:{iframe:{bidders:"*",filter:"include"}},userIds:\[{name:"unifiedId",params:{url:"//match.adsrvr.org/track/rid?ttd_pid=3egfyfq&fmt=json"},storage:{type:"cookie",name:"pbjs-unifiedid",expires:60}}, {name:"pubCommonId",storage:{type:"cookie",name:"\_pubcid",expires:60}} ],syncDelay:3e3}; function o(e,t){var n=get(window,"cns.prebid.sequence")||\[\]; return n.indexOf(e.bidder)-n.indexOf(t.bidder)} function a(e){return new Promise(function(i){var a=getValidSizesFromSlot(e,validSizes); if(a){var s=setTimeout(function(){i()},t); window.pbjs.que.push(function(){ clearTimeout(s); var c=getPositionFromSlot(e),u=e.getSlotElementId(),l=c+"\_"+a.sort().join("\_"); window.pbjs.adUnits.filter(function(e){return e.code===l}).length<1&& window.pbjs.addAdUnits(function(e,t,n){ var r,i=getViewportTemplate(),a=get(window,"cns.prebid.adunits."+e+"."+i)|| {bids:[],mediaType:"banner"},s=a.bids,c=a.mediaType; s.sort(o); var u=sizesToArray(t); return{code:n,mediaTypes:(r={}, r\[c\]={sizes:u}, r),bids:s}} (c,a,l))}; var f=function(e,n,r){return{timeout:t,adUnitCodes: \[e\], bidsBackHandler:r,labels:n}} (l,a,function(e){r("complete."+u,e),window.pbjs.setTargetingForGPTAsync(\[l\],function(e){return function(){return e.getSlotElementId()===u}}),i()}); window.pbjs.requestBids(f),n&& (n=!1,t=2e3,emitBoomPixel("firstPrebidAuction"))} else i()})}} window.pbjs=window.pbjs|| {que:[]}; window.pbjs.que.push(function(){ var t,n; queryParameters.bidders&& (t=(get(window,"cns.prebid")|| {}).adunits,n=queryParameters.bidders.split(","),Object.keys(t).forEach(function(e){ Object.keys(t\[e\]).forEach(function(r){ t\[e\]\[r\].bids=t\[e\]\[r\].bids.filter(function(e){return n.indexOf(e.bidder)>-1})})})) ; function(){var e=get(window,"cns.prebid"),t=e.adunits,n=e.adunit_default; n&& Object.keys(t).forEach(function(e){ Object.keys(t\[e\]).forEach(function(r){ t\[e\]\[r\].bids.forEach(function(e){ var t=e.bidder; n\[t\]&& Object.assign(e.params,n\[t\])}) })})}(); var r,o,a=get(window,"cns.prebid.config")|| {}; Object.assign(a,function(){ var e={usp:{cmpApi:"static",consentData:{getUSPData:{uspString:getPrivacyString()}},timeout:50}}; if(shouldApplyGDPR()){ var t=shouldReadAndWriteCookies(); e.gdpr={cmpApi:"iab",timeout:1e4,deviceAccess:t}} return{consentManagement:e}}()), Object.assign(a,function(){ if(!shouldApplyGDPR()|| getConsentString())return function(){ var t=get(e,"plugins.lr.pid"); if(t){ var n={name:"identityLink",params:{pid:t},storage:{type:"cookie",name:"idl_env",expires:30}}; i.userIds.push(n)}} (),{userSync:i}) ``` -------------------------------- ### Define Leading Numbers Regex Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Regular expression to match a string that starts with a digit. ```javascript var leadingNumbers=/^\d/ ``` -------------------------------- ### Get Object Values Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Exports a function to retrieve the values of an object, similar to Object.values(). ```javascript _export(_export.S,"Object",{values:function(e){return $values(e)}}); ``` -------------------------------- ### Initialize Ads Library Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initializes the ads library by sending information, setting up the definer, and attaching listeners. It handles consent requirements before full initialization. ```javascript function initAdsLibrary(){sendBoomerangAdLibraryInformation();var e=new SourceOfTruth(function(){var e=getViewportTemplate();return new CompleteDefiner(getPageContext(window),null,e)});attachListeners(cnBus,e),enableCNE(cnBus)} ``` -------------------------------- ### Configure GPT Router Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initializes the GPT router with event listeners for slot rendering and impression tracking. ```javascript function GPTRouter(e,t,n,r){var i=new ContainerStyler(e.getSingleInstance().getPageDefinition().isVerso);window.googletag=window.googletag||{},window.googletag.cmd=window.googletag.cmd||[];var o=window.googletag,a=new PubadsCollector(e),s=e.getSingleInstance().getSlotStateStore();function c(){sparrowCollector.onPubadsReady(),a.emitReady(),r.emit("ads.pubadsReady")}var u={slotRenderEnded:[function(t){try{var n=t.slot.getSlotElementId(),a=t.size,c=t.isEmpty,u=t.slot,l=t.creativeId,f=getSizeFromSlotRenderEnded(t);s.setSlotState(n,{creativeId:l,renderedSize:f});var d=e.getSingleInstance().getSlotDefinitionFromGPTSlot(t.slot),g=document.getElementById(n),p=s.getSlotState(n).nodeId;isSpacerCreative(t)&&s.setSpacerCreativeId(l);var h={nodeId:p,size:a,isSpacer:s.isSpacerCreative(l),slotElementId:n};g&&i.updateContainer(g,t),shouldSetSlotSize(a,c,d)&&setSlotSize(o,u,a),stickyIsEligible(n,d,a)&&r.emit("ads.stickyBanner.hero.slotRenderEnded."+a.join("x")),c?(r.emit("ads.slotRenderEnded."+n+".empty"),p&&r.emit("ads.slotRenderEnded."+p+".empty",h)):(r.emit("ads.slotRenderEnded."+n+".filled"),p&&r.emit("ads.slotRenderEnded."+p+".filled",h))}catch(e){error("onSlotRenderEnded",{event:t,ex:e})}},t.onSlotRenderEnded,n.onSlotRenderEnded,sparrowCollector.onSlotRenderEnded,a.onSlotRenderEnded],impressionViewable:[function(t){try{var n=t.slot.getSlotElementId(),i=e.getSingleInstance().getSlotDefinitionFromGPTSlot(t.slot);"hero_0"===n&&i.isSticky&&r.emit("ads.stickyBanner.hero.impressionViewable",t)}catch(e){error("onImpressionViewable",{event:t,ex:e})}},t.onImpressionViewable,sparrowCollector.onImpressionViewable.bind(null,e),a.onImpressionViewable],slotOnload:[prebidRenderEnded,a.onSlotOnload]};o.cmd.push(function(){var t=o.pubads();setPPID(t),t.enableSingleRequest();var n=get(window,"cns.config.config.useRoadblock");if(n||t.disableInitialLoad(),t.setCentering(!0),function(e,t){Object.keys(e).forEach(function(n){e[n].forEach(function(e){return t.addEventListener(n,e)})})}(u,t),e.getSingleInstance().getPageDefinition().forChildren&&t.setTagForChildDirectedTreatment(!0),updateCorrelatorInterval(),checkPrivacySettings(),oneTrustGroupsUpdated(checkPrivacySettings),n){var r=e.getSingleInstance().getPageDefinition().lazyloadSettings;t.enableLazyLoad(r)}o.enableServices(),setTimeout(c,0)})} ``` -------------------------------- ### Get Privacy String Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves the 'usprivacy' cookie value, which is part of the CCPA consent string. ```javascript function getPrivacyString() { return getCookie("usprivacy") || "1---" } ``` -------------------------------- ### Configure Searchbox and Analytics Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Sets up the global searchbox configuration and initializes the reverb analytics script. This code should be included in the page's main script execution. ```javascript 1'\],\};require({\"shim\": {\'idcta-v2/statusbar\': idctaShim,\'idcta-v2/id-config\': idctaShim},\"map\": {\'\*\': {\'idcta/idcta-1\': \'idcta-v2/idcta-1\',\'idcta\': \'idcta-v2\',}},\"paths\": map});window.idctaBaseUrl = ENDPOINT\_URL;define('idcta/config', \['idcta-v2/config'\], function(data) {return data;});define('idcta/translations', \['idcta-v2/translations'\], function(data) {return data;});})(); // Globally available search context window.SEARCHBOX={\"variant\":\"default\",\"locale\":\"en\",\"feature\":\"akamai-idcta\",\"navSearchboxStaticPrefix\":\"https://nav.files.bbci.co.uk/searchbox/5bd951f6aac2ac491095aed2c248e936/\",\"searchboxAppStaticPrefix\":\"https://nav.files.bbci.co.uk/searchbox/5bd951f6aac2ac491095aed2c248e936/drawer\",\"searchFormHtml\":\"
search
\",\"searchScopePlaceholder\":\"\",\"searchScopeParam\":\"\",\"searchScopeTemplate\":\"\",\"searchPlaceholderWrapperStart\":\"\",\"searchPlaceholderWrapperEnd\":\"\"}; window.SEARCHBOX.searchScope = SEARCHBOX.searchScopeTemplate.split('-')[0]; if (window.require !== undefined) { require.config({ paths: { 'orb/cookies': 'https://nav.files.bbci.co.uk/orbit-webmodules/0.0.2-562.3a038b3/cookie-banner/cookie-library.min' } }); } window.__detectview={clickManagementEnabled:false}; "use strict";!function(){window.__reverbStaticLocation="https://mybbc-analytics.files.bbci.co.uk/reverb-client-js/",window.__smarttagVersion="5.22.0",window.__reverb={},window.__reverb.__reverbLoadedPromise=new Promise(function(e,n){window.__reverb.__resolveReverbLoaded=e,window.__reverb.__rejectReverbLoaded=n}),window.__reverb.__reverbTimeout=setTimeout(function(){window.__reverb.__rejectReverbLoaded()},5e3);var n=function(r,d){window.__reverb.__reverbLoadedPromise.then(function(e){if(r&&r.detail){var n=r.detail.label,t=r.detail.type,i=r.detail.elem,o=r.detail.originalEvent;r.detail.isClick&&(d=r.detail.isClick),e.userActionEvent(t,n,r.detail,i,o,d)}},function(){console.log("Reverb failed to load. Event not sent")})};document.addEventListener("bbc-user-event",function(e){n(e,!1)}),document.addEventListener("bbc-user-click",function(e){n(e,!0)}),document.addEventListener("bbc-page-updated",function(){window.__reverb.__reverbLoadedPromise.then(function(e){e.initialise().then(function(){return e.viewEvent()})},function(){console.log("Reverb failed to load. Event not sent")})})}(); window.require({ baseUrl: 'https://static.bbci.co.uk/', paths: { 'bump-3': '//emp.bbci.co.uk/emp/bump-3/bump-3', 'bump-4': '//emp.bbci.co.uk/emp/bump-4/bump-4', 'jquery-1.9': 'https://static.bbci.co.uk/frameworks/jquery/0.4.1/sharedmodules/jquery-1.9.1', }, waitSeconds: 30, }); ``` -------------------------------- ### Generate Path Options Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Prepares options object for path generation functions, consolidating various configuration parameters. ```javascript function generatePathOptions(e, t) { var n = e.positionCount, r = e.network, i = e.override, o = e.suffix, a = e.templateType, s = e.slotName, c = e.shouldUseLegacyPath, u = e.position, l = slugifyChannels(e), f = l.channel, d = l.subChannel; return { adUnit: t.adUnit, network: r, override: i, templateType: a, positionCount: n, shouldUseLegacyPath: c, slotName: s, channel: f, subChannel: d, suffix: o, contentType: t.contentType, position: u }; } ``` -------------------------------- ### Get All Own Property Names Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Retrieves an array of all own property names (enumerable or not) of an object. This is a polyfill for `Object.getOwnPropertyNames`. ```javascript var n=e(6324),o=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||,8006:function(t,r,e){var n=e(6324),o=e(748).concat("length","prototype");r.f=Object.getOwnPropertyNames||} ``` -------------------------------- ### String.prototype.trimStart Implementation Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/healthy-pasta-bake-60759.html Implements String.prototype.trimStart (also known as trimLeft), removing whitespace from the beginning of a string. This is useful for cleaning up user input or formatted text. ```javascript "use strict";var n=e(2109),o=e(3111).start,i=e(6091)("trimStart"),u=i?function(){return o(this)}:"".trimStart;n({target:"String",proto:!0,forced:i},{trimStart:u,trimLeft:u}) ``` -------------------------------- ### Get Cookie Value Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Retrieves the value of a specific cookie by its name. If the cookie is not found, it returns undefined. ```javascript function getCookie(e,t){for(var n=(t=t||document.cookie).split(";"),r=RegExp("^\\s*"+e+"=\\s*(.\*?)\\s*$"),i=0;i0&&c("lcp",[t[t.length-1]])}function o(e){if(e instanceof s&&!l){var n,t=Math.round(e.timeStamp);n=t>1e12?Date.now()-t:u.now()-t,l=!0,c("timing",["fi",t,{type:e.type,fid:n}])}}if(!("init"in NREUM&&"page_view_timing"in NREUM.init&&"enabled"in NREUM.init.page_view_timing&&NREUM.init.page_view_timing.enabled===!1)){var a,f,c=e("handle"),u=e("loader"),s=NREUM.o.EV;if("PerformanceObserver"in window&&"function"==typeof window.PerformanceObserver){a=new PerformanceObserver(r),f=new PerformanceObserver(i);try{a.observe({entryTypes:["paint"]}),f.observe({entryTypes:["largest-contentful-paint"]})}catch(p){}}if("addEventListener"in document){var l=!1,d=["click","keydown","mousedown","pointerdown","touchstart"];d.forEach(function(e){document.addEventListener(e,o,!1)})}}},{}]} ``` -------------------------------- ### Clear Targeting by Prefix Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Removes ad targeting keys from a given ad slot object that start with a specified prefix. ```javascript function clearTargetingByPrefix(e, t) { e.getTargetingKeys().forEach(function(n) { 0 === n.indexOf(t) && e.clearTargeting(n) }) } ``` -------------------------------- ### Amazon Match Buy Configuration Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Initializes Amazon Publisher Tag configuration, including publisher ID, ad server, bid timeout, and deal settings. ```javascript function AmazonMatchBuy(){var e=new EventEmitter(market),t=e.debug,n=e.warn;function r(e){return{slotID:e.getSlotElementId(),slotName:function(e){return getPositionFromSlot(e)+"/"+getViewportTemplate()}(e),sizes:getValidSizesFromSlot(e,validSizes).map(function(e){return getSizeStringAsArray(e)})}}function i(e,t){window.apstag._Q.push( ``` -------------------------------- ### Get All Keyword Targeting Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Collects and formats keyword targeting parameters. Use when preparing targeting data that includes keywords. ```javascript getAllKeywordTargeting(){let e=arguments.length > 0 && void 0 !==arguments\[0\] ? arguments\[0\] :{}; const t={}; return ( Object.keys(e).forEach((n)=>{t\[`cnt\_${n}`\]=e\[n\];}), t );} ``` -------------------------------- ### Get viewport template Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/nutty-umami-noodles-with-scallion-brown-butter-and-snow-peas-recipe.html Determines the current viewport size category ('mobile', 'tablet', 'desktop') based on window width. ```javascript function getViewportTemplate(){const e=window.innerWidth; return e < 768 ? "mobile" : e < 1024 ? "tablet" : "desktop";} ``` -------------------------------- ### Initialize Moat Yield Intelligence Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Loads Moat Yield Intelligence and sets up a callback for when it's ready. Handles potential errors if the API is unavailable. ```javascript var handleMoatYieldIntelligenceReady=function(e){try{window.moatPrebidApi.setMoatTargetingForAllSlots()}catch(t){return e({moatYieldIntelligenceUnavailable:!0})}return e({moatYieldIntelligenceLoaded:!0})},moatYieldIntelligence={load:function(){return new Promise(function(e){window.moatPrebidReady=function(){handleMoatYieldIntelligenceReady(e)}})},slotDataAvailable:function(){try{return!!window.moatPrebidApi.slotDataAvailable()}catch(e){return!1}},setMoatTargetingForSlot:function(e){window.moatPrebidApi.setMoatTargetingForSlot(e)}}; ``` -------------------------------- ### Build Docker Image from Pre-built Python Packages Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/docs/docs/contributors/developers-guide/building-packages.md Build the Docker image using pre-built Python packages located in the `dist` directory. This leverages the `packages` build context. ```sh docker build --tag mealie:dev --file docker/Dockerfile --build-arg COMMIT=$(git rev-parse HEAD) --build-context packages=dist . ``` -------------------------------- ### Get Valid Ad Slot Sizes Source: https://github.com/mealie-recipes/mealie/blob/mealie-next/tests/data/html/detroit-style-pepperoni-pizza.html Filters the sizes of an ad slot to include only those present in a list of valid sizes. ```javascript function getValidSizesFromSlot(e, t) { return intersect(getSizesFromSlot(e), t) } ```