{"version":3,"file":"Layout.9NuN0267.mjs","names":["useState","useCallback","__esmMin","ne","init_ssg_sandbox_shims","init_npm_react_18_3_1","window","ce","init_jsx_runtime","p","_e","getRedirectMapFromEvent","event","getWebchatRoot","id","root","applyWebchatCustomizations","attempt","link","BOTPRESS_STYLESHEET_URL","style","attachAutoScroll","autoScrollAttached","scrollToBottom","list","mutations","m","n","normalizeRedirectLabel","value","attachRedirectHandler","redirectHandlerAttached","path","e","node","btn","btnText","redirectMap","getRedirectMap","matchedKey","normalizedLabel","label","botpressScriptLoaded","latestRedirectMap","CONNECTION_LOST_PATTERN","BotpressChat","init_BotpressChat","clientId","botId","isBotInitialized","setIsBotInitialized","isLoading","setIsLoading","hasError","setHasError","errorMessage","setErrorMessage","errorHandler","message","error","initializeBotPress","directUrl","webchatRoot","tryHideComposer","composer","script","init_BotpressChat_4Hrew7","Layout","children","init_Layout"],"sources":["https:/framerusercontent.com/modules/L4dPv4MNovXZh6m0dZLi/wmNhH6PM84OaIgF12GuQ/BotpressChat.js","https:/framer.com/m/BotpressChat-4Hrew7.js@wmNhH6PM84OaIgF12GuQ","https:/framerusercontent.com/modules/O5dYVAKVjbZBQts8NEA7/aImnEEGpALLbojoQbmcm/Layout.js"],"sourcesContent":["/* eslint-disable */import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{useEffect,useState,useCallback}from\"react\";let botpressScriptLoaded=false;let redirectHandlerAttached=false;// Module-level so the one-time click listener reads the latest map even after the component remounts.\nlet latestRedirectMap={};const CONNECTION_LOST_PATTERN=/connection to conversation lost/i;function getRedirectMapFromEvent(event){return event?.payload?.redirectMap||event?.data?.payload?.redirectMap||event?.data?.event?.payload?.redirectMap||event?.data?.data?.event?.payload?.redirectMap||null;}// Webchat v5 mounts inside an open shadow root; v3 used an iframe, kept as a fallback.\nfunction getWebchatRoot(){for(const id of[\"fab-root\",\"webchat-root\"]){const root=document.getElementById(id)?.shadowRoot;if(root)return root;}const iframe=document.querySelector(\"iframe.bpWebchat, iframe.bpOpen.bpWebchat.bpReset\");return iframe?.contentDocument||null;}const BOTPRESS_STYLESHEET_URL=\"https://files.bpcontent.cloud/2025/01/09/10/20250109102146-6X3JNFKF.css?v=2\";// v5 ignores additionalStylesheetUrl, so load the hosted stylesheet into the webchat shadow root ourselves.\n// webchat:opened does not exist in v5; this runs on webchat:ready and retries until the shadow root is mounted.\nfunction applyWebchatCustomizations(attempt=0){const root=getWebchatRoot();if(!(root instanceof ShadowRoot)){if(attempt<20)setTimeout(()=>applyWebchatCustomizations(attempt+1),300);return;}if(!root.getElementById(\"cf-bp-stylesheet\")){const link=document.createElement(\"link\");link.id=\"cf-bp-stylesheet\";link.rel=\"stylesheet\";link.href=BOTPRESS_STYLESHEET_URL;root.appendChild(link);}// v5 defaults to solid quick replies and darker greys; restyle to the light theme the v3 widget had.\nif(!root.getElementById(\"cf-bp-theme\")){const style=document.createElement(\"style\");style.id=\"cf-bp-theme\";style.textContent=`\n        :host, * { --button-bg: var(--bpPrimary-200) !important; --button-text: var(--bpPrimary-800) !important; --button-bg-hover: var(--bpPrimary-300) !important; }\n        .bpMessageBlocksBubble[data-direction=\"incoming\"] { background-color: var(--bpGray-100) !important; }\n        .bpContainer { background-color: var(--bpGray-1) !important; }\n        .bpComposerContainer { background-color: var(--bpGray-50) !important; }\n        /* Logo, name and description stay in the header only; hide the duplicate intro card at the top of the message list. */\n        .bpMessageListMarqueeContainer { display: none !important; }\n        /* The header floats over the list (position: absolute, 64px); the hidden intro card used to supply this top space, so add it back or the first message ends up under the header. */\n        .bpMessageListViewport { padding-top: 80px !important; }\n        /* Hide the \"Today\" date separator (a system message). */\n        .bpMessageContainer[data-direction=\"system\"] { display: none !important; }\n        /* Mobile: the site navbar is position:fixed with a high z-index and covered the full-screen chat header; v5 gives the window only 9999. */\n        .bpWebchat { z-index: 100000 !important; }\n        `;root.appendChild(style);}attachAutoScroll(root);}let autoScrollAttached=false;// v5 sometimes stops short of the newest reply (seen on the first message); scroll the list down whenever a message is added.\nfunction attachAutoScroll(root){if(autoScrollAttached)return;autoScrollAttached=true;const scrollToBottom=()=>{const list=root.querySelector(\".bpMessageListContainer\");if(list)list.scrollTo({top:list.scrollHeight,behavior:\"smooth\"});};new MutationObserver(mutations=>{const messageAdded=mutations.some(m=>[...m.addedNodes].some(n=>n.nodeType===1&&(n.matches(\".bpMessageContainer\")||n.querySelector(\".bpMessageContainer\"))));if(!messageAdded)return;requestAnimationFrame(scrollToBottom);// Buttons and images in the reply render after the bubble, so scroll again once layout settles.\nsetTimeout(scrollToBottom,400);}).observe(root,{childList:true,subtree:true});}function normalizeRedirectLabel(value){return(value||\"\").toLowerCase().replace(RegExp(\"[^\\\\p{L}\\\\p{N}]+\",\"gu\"),\" \").trim().replace(/\\s+/g,\" \");}// v5 renders in a shadow DOM (no iframe), so one document-level listener finds the clicked button via composedPath().\nfunction attachRedirectHandler(getRedirectMap){if(redirectHandlerAttached)return;redirectHandlerAttached=true;document.addEventListener(\"click\",e=>{const path=e.composedPath();const inWebchat=path.some(node=>node.id===\"fab-root\"||node.id===\"webchat-root\");if(!inWebchat)return;const btn=path.find(node=>node.tagName===\"BUTTON\");if(!btn)return;// Icon-only buttons (close, back) have no text and would match the first label via includes().\nconst btnText=normalizeRedirectLabel(btn.textContent);if(!btnText)return;const redirectMap=getRedirectMap();const matchedKey=Object.keys(redirectMap||{}).find(label=>{const normalizedLabel=normalizeRedirectLabel(label);return btnText===normalizedLabel||btnText.includes(normalizedLabel)||normalizedLabel.includes(btnText);});if(!matchedKey)return;window.open(redirectMap[matchedKey],\"_blank\",\"noopener,noreferrer\");},true);}const BotpressChat=()=>{const pathname=typeof window!==\"undefined\"?window.location.pathname:\"/\";// Your credentials are here\nconst clientId=\"4522b144-cdf2-46a2-bc37-413fac236509\";const botId=\"4e9183e9-7f12-498e-9287-0f89eec93142\";const[isBotInitialized,setIsBotInitialized]=useState(false);const[isLoading,setIsLoading]=useState(true);const[hasError,setHasError]=useState(false);const[errorMessage,setErrorMessage]=useState(\"\");const errorHandler=useCallback(error=>{const message=error?.message||\"Unknown error occurred\";// v5 reconnects on its own after \"Connection to conversation lost\", so only report it.\nif(CONNECTION_LOST_PATTERN.test(message)){console.warn(\"Botpress connection lost:\",message);// Assumes Sentry's browser SDK is loaded globally on this site — adjust if this Framer project's setup differs.\nif(typeof window!==\"undefined\"&&window.Sentry?.captureException){window.Sentry.captureException(error,{tags:{label:\"botpress_connection_lost\",componentName:\"BotpressChat\"}});}return;}setIsLoading(false);setHasError(true);setErrorMessage(message);console.error(\"Botpress error:\",error);},[]);const initializeBotPress=useCallback(()=>{if(!isBotInitialized&&window.botpress&&typeof window.botpress.init===\"function\"){try{window.botpress.init({botId,configuration:{botName:\"Cashfree\",botAvatar:\"https://cashfreelogo.cashfree.com/website/botpress/dark.png?v=20260907\",botDescription:\"Kickstart Your Payments Journey\",website:{title:\"https://www.cashfree.com\",link:\"https://www.cashfree.com\"},color:\"#6930CA\",variant:\"soft\",themeMode:\"light\",fontFamily:\"inter\",radius:1,footer:\"\",showPoweredBy:false,additionalStylesheetUrl:BOTPRESS_STYLESHEET_URL},hideWidget:true,clientId,showOpenButton:false});const attachEvents=()=>{window.botpress.on(\"error\",error=>errorHandler(error));window.botpress.on(\"customEvent\",event=>{const redirectMap=getRedirectMapFromEvent(event);if(redirectMap){latestRedirectMap=redirectMap;}const directUrl=event?.payload?.url||event?.data?.payload?.url||event?.data?.event?.payload?.url||event?.data?.data?.event?.payload?.url||null;if(directUrl){window.open(directUrl,\"_blank\",\"noopener,noreferrer\");}});window.botpress.on(\"webchat:ready\",()=>{applyWebchatCustomizations();});window.botpress.on(\"webchat:opened\",()=>{applyWebchatCustomizations();const webchatRoot=getWebchatRoot();if(webchatRoot){const tryHideComposer=()=>{try{const composer=webchatRoot.querySelector(\".bpComposerContainer\");if(composer)composer.style.display=\"block\";else requestAnimationFrame(tryHideComposer);}catch(e){console.error(e);}};tryHideComposer();}});};// v5 ignores conversationHistory inside init(); set it afterwards so the header back arrow (New conversation) shows.\nwindow.botpress.config({configuration:{conversationHistory:true}});attachEvents();attachRedirectHandler(()=>latestRedirectMap);setIsBotInitialized(true);setIsLoading(false);setHasError(false);}catch(error){errorHandler(error);}}},[isBotInitialized,errorHandler,botId,clientId]);useEffect(()=>{if(!botpressScriptLoaded){if(!clientId||!botId){setIsLoading(false);setHasError(true);setErrorMessage(\"Bot configuration missing\");return;}const script=document.createElement(\"script\");script.src=\"https://cdn.botpress.cloud/webchat/v5.0/inject.js\";script.async=true;script.onload=()=>{botpressScriptLoaded=true;initializeBotPress();};script.onerror=()=>errorHandler({message:\"Failed to load Botpress script\"});document.head.appendChild(script);}else{initializeBotPress();}},[initializeBotPress,clientId,botId,errorHandler]);if(isLoading)return /*#__PURE__*/_jsx(\"div\",{className:\"botpress-loader\",children:\"Loading chat...\"});if(hasError){return /*#__PURE__*/_jsxs(\"div\",{className:\"botpress-error\",children:[/*#__PURE__*/_jsx(\"p\",{children:errorMessage}),/*#__PURE__*/_jsx(\"button\",{onClick:()=>window.location.reload(),children:\"Try Again\"})]});}return null;};export default BotpressChat;\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"function\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./BotpressChat.map","/*\n * BotpressChat\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/L4dPv4MNovXZh6m0dZLi/wmNhH6PM84OaIgF12GuQ/BotpressChat.js\"\nexport { default } from \"https://framerusercontent.com/modules/L4dPv4MNovXZh6m0dZLi/wmNhH6PM84OaIgF12GuQ/BotpressChat.js\"\n","// @ts-ignore External Framer module URL import\nimport{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import BotpressChat from\"https://framer.com/m/BotpressChat-4Hrew7.js@wmNhH6PM84OaIgF12GuQ\";export default function Layout({children}){return /*#__PURE__*/_jsxs(\"div\",{style:{minHeight:\"100vh\"},children:[children,/*#__PURE__*/_jsx(BotpressChat,{})]});}\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Layout\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Layout.map"],"mappings":"A,gJAC0F,SAASW,EAAwB,EAAM,CAAC,OAAOC,GAAO,SAAS,aAAaA,GAAO,MAAM,SAAS,aAAaA,GAAO,MAAM,OAAO,SAAS,aAAaA,GAAO,MAAM,MAAM,OAAO,SAAS,aAAa,IAAK,CACxS,SAASC,GAAgB,CAAC,IAAI,IAAMC,IAAK,CAAC,WAAW,cAAc,EAAE,CAAC,IAAMC,EAAK,SAAS,eAAeD,CAAE,CAAC,EAAE,WAAW,GAAGC,EAAK,OAAOA,CAAK,CAA0F,OAA5E,SAAS,cAAc,mDAAiE,CAAC,EAAE,iBAAiB,IAAK,CAE5Q,SAASC,EAA2B,EAAQ,EAAE,CAAC,IAAMD,EAAKF,EAAe,EAAE,GAAG,EAAEE,aAAgB,YAAgBE,EAAQ,IAAG,eAAeD,EAA2BC,EAAQ,CAAC,EAAE,GAAG,MAAU,IAAG,CAACF,EAAK,eAAe,kBAAkB,EAAE,CAAC,IAAMG,EAAK,SAAS,cAAc,MAAM,EAAE,EAAK,GAAG,mBAAmB,EAAK,IAAI,aAAa,EAAK,KAAKC,EAAwBJ,EAAK,YAAYG,CAAI,CAAE,CAC9X,GAAG,CAACH,EAAK,eAAe,aAAa,EAAE,CAAC,IAAMK,EAAM,SAAS,cAAc,OAAO,EAAE,EAAM,GAAG,cAAc,EAAM,YAAY;;;;;;;;;;;;;UAanHL,EAAK,YAAYK,CAAK,CAAE,CAACC,EAAiBN,CAAI,CAdsU,CAcpU,CAC1D,SAASM,EAAiB,EAAK,CAAC,GAAGC,EAAmB,OAAO,EAAmB,GAAK,IAAMC,MAAmB,CAAC,IAAMC,EAAKT,EAAK,cAAc,y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