PageSourceSearch

https://cortefiel.com/on/demandware.static/Sites-CTF-Site/-/es_ES/…shopperAgent.74b2f05ab9ac4ea2f941.bundle.js

js cortefiel.com collected 2026-09-24 11:13:41 UTC 5,569 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunktendamLibtendamglobalfoundation=self.webpackChunktendamLibtendamglobalfoundation||[]).push([[189],{8193:(e,n,t)=>{t.r(n),t.d(n,{init:()=>r});var o=t(5239),i=t(954);let r=()=>{window.addEventListener("onEmbeddedMessagingReady",s),window.addEventListener("message",g),"complete"===document.readyState||"interactive"===document.readyState?setTimeout(s,100):document.addEventListener("DOMContentLoaded",function(){setTimeout(s,100)})};async function a(){var e,n;if((null==(e=window)?void 0:e.shopperAgentConfig)!==void 0)return Promise.resolve();let t=null==(n=window.sitePreferences)?void 0:n.SA_agentConfigsURL;return window.Promise&&window.fetch&&t?fetch(t,{credentials:"same-origin"}).then(function(e){if(e.ok)return -1!==(e.headers.get("content-type")||"").indexOf("application/json")?e.json():e.text().then(function(e){try{return JSON.parse(e)}catch(e){return{}}})}).then(function(e){e&&(null==e?void 0:e.agentConfigs)&&(window.shopperAgentConfig={...e.agentConfigs});var n=document.querySelector(".shopper-agent-wrapper");if(n&&!n.classList.contains("hidden")){var t=document.createElement("div");for(t.innerHTML=e.html,n.innerHTML="";t.firstChild;){var o=t.firstChild;if("SCRIPT"===o.tagName){var i=document.createElement("script");o.src&&(i.src=o.src),o.textContent&&(i.textContent=o.textContent),Array.prototype.slice.call(o.attributes).forEach(function(e){i.setAttribute(e.name,e.value)}),n.appendChild(i),t.removeChild(o)}else n.appendChild(o)}e.abAnalyticsData&&n.setAttribute("data-analytics",JSON.stringify(e.abAnalyticsData))}}).catch(function(){window.shopperAgentConfig={}}):(window.shopperAgentConfig={},Promise.resolve())}let s=e=>{a().then(function(){if(window.shopperAgentConfig&&window.embeddedservice_bootstrap&&window.embeddedservice_bootstrap.prechatAPI)try{window.embeddedservice_bootstrap.settings={...window.embeddedservice_bootstrap.settings,language:window.shopperAgentConfig.sfLanguage,disableStreamingResponses:!0,enableUserInputForConversationWithBot:!1,shouldMinimizeWindowOnNewTab:!0,hideChatButtonOnLoad:!0},window.embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields({SiteId:window.shopperAgentConfig.siteId,Locale:window.shopperAgentConfig.locale,UsId:window.shopperAgentConfig.usId,RefreshToken:window.shopperAgentConfig.refreshToken,OrganizationId:window.shopperAgentConfig.commerceOrgId,IsCartMgmtSupported:window.shopperAgentConfig.isCartMgmtSupported,Currency:window.shopperAgentConfig.currency,Language:window.shopperAgentConfig.sfLanguage,DomainUrl:window.shopperAgentConfig.domainUrl}),c()}catch(e){}})},d=e=>{let n=e.target;try{var t;null==n||n.classList.toggle("chatLoading",!window.agentForceConversationStarted),null==(t=window.embeddedservice_bootstrap)||t.utilAPI.launchChat().catch(function(e){(0,i.Terror)(e,i.Levels.ERROR)})}catch(e){}},c=()=>{var e,n,t,i,r;let a;if(null!==document.querySelector(".shopperAgentCustomButton"))return;let s=document.createElement("button");s.classList="shopperAgentCustomButton";let c=null==(n=window)||null==(e=n.sitePreferences)?void 0:e.SA_chatIcon;c?((a=document.createElement("img")).src=c,a.classList="iconImage"):(a=document.createElement("div")).classList="iconImage tndmIcon tndmIcon-icon-chat-writting tndmIconColor0";let l=document.createElement("div");l.classList="iconImage loading tndmIcon tndmIcon-icon-spinner tndmIconColor0",s.appendChild(a),s.appendChild(l),document.body.appendChild(s),s.addEventListener("click",d);try{void 0===window.cleanSessionAtStart&&(null==(r=window)||null==(i=r.embeddedservice_bootstrap)||null==(t=i.userVerificationAPI)||t.clearSession(!0).then(()=>{window.cleanSessionAtStart=!0}).catch(e=>{}).finally(()=>{}))}catch(e){window.console.error(e)}let g=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];window.agentForceChatOpened=!e,s.classList.toggle("chatHidden",!e),s.classList.toggle("chatLoading",n),s.removeAttribute("data-pending-messages")},w=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];window.agentForceConversationStarted=e};o.B.listen(o.B.events.SHOPPER_AGENT.CHAT_MAXIMIZED,()=>{w(!0),g(!1,!1)},window),o.B.listen(o.B.events.SHOPPER_AGENT.CHAT_MINIMIZED,g.bind(null,!0,!1),window),o.B.listen(o.B.events.SHOPPER_AGENT.CHAT_CLOSED,g.bind(null,!0,!1),window),o.B.listen(o.B.events.SHOPPER_AGENT.CONVERSATION_CLOSED,w.bind(null,!1),window),o.B.listen(o.B.events.SHOPPER_AGENT.MESSAGE_SENT,()=>{if(window.agentForceChatOpened)s.removeAttribute("data-pending-messages");else{let e=s.getAttribute("data-pending-messages"),n=isNaN(Number(e))?1:Number(e)+1;s.setAttribute("data-pending-messages",n)}},window)},l=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};try{let t=document.querySelector("div.embedded-messaging iframe");
1if(!t)return;let o=new URL(t.src).origin;t.contentWindow.postMessage({type:e,payload:n},o)}catch(e){}},g=e=>{if(e.source&&e.source!==window)try{if("lwc.getConversationContext"===e.data.type)if(!0===window.shopperAgentConfig.enableConversationContext||"true"===window.shopperAgentConfig.enableConversationContext){let e=window.shopperAgentConfig.conversationContext?window.shopperAgentConfig.conversationContext.split(",").map(e=>e.trim()).filter(Boolean):[];l("conversational.actualConversationContext",{conversationContext:e})}else l("conversational.actualConversationContext",{conversationContext:[]});"lwc.getDomainUrl"===e.data.type&&l("conversational.domainUrl",{domainUrl:window.shopperAgentConfig.domainUrl})}catch(e){}}}}]);

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.