@brainfish-ai/widgets-initiator 1.21.5 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -13
- package/dist/types/initIframeTrigger/index.d.ts +1 -1
- package/dist/types/utils/brainfishQueue.d.ts +2 -1
- package/dist/web.cjs.js +1 -1
- package/dist/web.js +1 -3104
- package/package.json +4 -3
package/dist/index.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
;
|
|
2
|
-
!function() {
|
|
3
|
-
try {
|
|
4
|
-
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
-
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34", e._sentryDebugIdIdentifier = "sentry-dbid-efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34");
|
|
6
|
-
} catch (e2) {
|
|
7
|
-
}
|
|
8
|
-
}();
|
|
9
|
-
import { BrainfishAnalytics, default as default2 } from "./web.js";
|
|
10
|
-
export {
|
|
11
|
-
BrainfishAnalytics,
|
|
12
|
-
default2 as default
|
|
13
|
-
};
|
|
1
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},d=(new e.Error).stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34",e._sentryDebugIdIdentifier="sentry-dbid-efb954f1-f1b0-4cc2-aaa7-5ac38d08dd34")}catch(f){}}();import{BrainfishAnalytics as e,default as d}from"./web.js";export{e as BrainfishAnalytics,d as default};
|
|
14
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Brainfish, RedirectRules } from '../types/brainfish';
|
|
2
|
-
import type { Settings } from '@brainfish-ai/widgets-common';
|
|
2
|
+
import type { Settings, Theme } from '@brainfish-ai/widgets-common';
|
|
3
3
|
import type { ClientActionHandler } from '../actions/clientAction';
|
|
4
4
|
import { ModalFormProps } from 'src/initIframeTrigger/utils/openModalForm';
|
|
5
5
|
export interface BrainfishQueue extends Brainfish {
|
|
@@ -15,6 +15,7 @@ export interface BrainfishQueue extends Brainfish {
|
|
|
15
15
|
[key: string]: any;
|
|
16
16
|
};
|
|
17
17
|
}) => Promise<void>;
|
|
18
|
+
setTheme: (theme: Theme) => void;
|
|
18
19
|
identify: (userData: Record<string, unknown>) => void;
|
|
19
20
|
setSecretAttributes: (jwe: string) => void;
|
|
20
21
|
isReady: boolean;
|
package/dist/web.cjs.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,i=Object.getOwnPropertySymbols,r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable,a=(t,n,i)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[n]=i,s=(e,t)=>{for(var n in t||(t={}))r.call(t,n)&&a(e,n,t[n]);if(i)for(var n of i(t))o.call(t,n)&&a(e,n,t[n]);return e},d=(e,i)=>t(e,n(i)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),c=(e,t,n)=>new Promise((i,r)=>{var o=e=>{try{s(n.next(e))}catch(t){r(t)}},a=e=>{try{s(n.throw(e))}catch(t){r(t)}},s=e=>e.done?i(e.value):Promise.resolve(e.value).then(o,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7e540d74-70a4-4ff6-97ad-f6f1b64ec237",e._sentryDebugIdIdentifier="sentry-dbid-7e540d74-70a4-4ff6-97ad-f6f1b64ec237")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let i=0;i<t.length;i++)n[i]=t.charCodeAt(i);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var g,h,b,m;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.21.5"},(h=g||(g={})).Sidebar="sidebar",h.Searchbar="searchbar",h.Popup="popup",g.Sidebar,g.Searchbar,g.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(m=b||(b={})).LINK="link",m.CALLBACK="callback",m.EMAIL="email",m.PHONE="phone";const w=(e,t,n,i)=>{let r=n,o={};if(t instanceof Error)try{o=JSON.parse(t.message),r+=` - ${o.message||t.message}`}catch(a){r+=` - ${t.message}`}else r+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const i=t.toJSON(),r=e||"https://app.brainfi.sh",o={error:`WebWidgetVersion: 1.21.5. ${t.message}`,stack:t.stack,cause:{message:i.message,stack:i.stack,cause:i.cause}};fetch(`${r}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(o)})})(e,new y(r,{cause:o}),i)};const v=e=>c(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return c(this,null,function*(){let i,r=0;for(;r<3;)try{const i=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!i.ok)throw new Error(`API call failed with status: ${i.status}`);const r=yield i.json();if(!r)throw new Error("Error loading config: empty response");return r}catch(o){if(i=o,r++,r>=3)throw w(e,o,"Error fetching config",n),i;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const i=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{i[e]&&(i[e]=i[e].map(e=>e.type===b.CALLBACK&&e.value?d(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),d(s({},e),{settings:i,apiHost:n,widgetMode:e.widgetType,apiKey:t})},C=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",S=e=>c(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>c(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const i=document.createElement("script");i.id="brainfish-widget",i.src=e,i.type="module",i.async=!0,i.crossOrigin="anonymous",i.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},i.onerror=t=>{const i=t,r={message:`Failed to load script: ${e}`,type:i.type,fileName:i.filename,lineNumber:i.lineno,columnNumber:i.colno,error:i.error?i.error.toString():"Unknown error"};n(new Error(JSON.stringify(r)))},document.head.appendChild(i)})}))(e);return{widget:t}}catch(i){Math.random()<.05&&w(e,i,i.message,t)}});const E=new Set,T=(e,t)=>c(null,null,function*(){const n=C(e.overrides);try{if(E.has(e.widgetKey))return;const i=yield S({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(i){const{widget:r}=i,o=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===g.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(r,o),E.add(e.widgetKey),r}}catch(i){w(n,i,i.message,e.widgetKey)}}),k=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},I=e=>{try{if(k())return window.localStorage.getItem(e)}catch(t){}return null},O=e=>{try{k()&&window.localStorage.removeItem(e)}catch(t){}};let _=!1;const W=(e,t,n,...i)=>c(null,[e,t,n,...i],function*(e,t,n,i="",r=!1,o){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!_)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===I("bf_tracking_disabled"),d=a||s;window.BrainfishAnalytics("init",{apiUrl:i,accessKey:t,trackScreenViews:!0,trackAttributes:!d,trackOutgoingLinks:!d,enableRecording:!d&&r,recordingOptions:o}),_=!0,yield((e,t)=>c(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const i=document.createElement("script");i.id="brainfish-analytics",i.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",i.type="module",i.async=!0,i.crossOrigin="anonymous",i.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},i.onerror=()=>{Math.random()<.05&&w(e,new Error(`Failed to load script: ${i.src}`),`Failed to load script: ${i.src}`,t),n(void 0)},document.head.appendChild(i)})}))(n,e)}catch(a){w(n,a,"Failed to initialize BrainfishAnalytics",e)}});function A(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}function B(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,M={exports:{}},L={exports:{}},N={exports:{}};function j(){return P||(P=1,function(e,t){function n(e){return Math.round(255*e)}function i(e,t,i){return n(e)+","+n(t)+","+n(i)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,r){if(void 0===r&&(r=i),0===t)return r(n,n,n);var o=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(o%2-1)),d=0,l=0,c=0;o>=0&&o<1?(d=a,l=s):o>=1&&o<2?(d=s,l=a):o>=2&&o<3?(l=a,c=s):o>=3&&o<4?(l=s,c=a):o>=4&&o<5?(d=s,c=a):o>=5&&o<6&&(d=a,c=s);var u=n-a/2;return r(d+u,l+u,c+u)},e.exports=t.default}(N,N.exports)),N.exports}var H,F={exports:{}};function K(){return H||(H=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(F,F.exports)),F.exports}var R,$,z,q={exports:{}};function D(){return R||(R=1,function(e,t){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var o=[null];o.push.apply(o,t);var a=new(e.bind.apply(e,o));return n&&r(a,n.prototype),a}(e,arguments,o(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),r(n,e)},n(e)}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(i=function(){return!!e})()}function r(e,t){return(r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var i,r=t[0],o=[];for(i=1;i<t.length;i+=1)o.push(t[i]);return o.forEach(function(e){r=r.replace(/%[a-z]/,e)}),r}t.default=function(e){var t,n;function i(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var i=arguments.length,r=new Array(i>1?i-1:0),o=1;o<i;o++)r[o-1]=arguments[o];n=e.call(this,s.apply(void 0,[a[t]].concat(r)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,r(t,n),i}(n(Error)),e.exports=t.default}(q,q.exports)),q.exports}function U(){return $||($=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new r.default(3);var t=(0,i.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var o=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:o}}if(t.match(d))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var g=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:g}}var h=c.exec(t);if(h)return{red:parseInt(""+h[1],10),green:parseInt(""+h[2],10),blue:parseInt(""+h[3],10)};var b=u.exec(t.substring(0,50));if(b)return{red:parseInt(""+b[1],10),green:parseInt(""+b[2],10),blue:parseInt(""+b[3],10),alpha:parseFloat(""+b[4])>1?parseFloat(""+b[4])/100:parseFloat(""+b[4])};var m=f.exec(t);if(m){var y=parseInt(""+m[1],10),w=parseInt(""+m[2],10)/100,v=parseInt(""+m[3],10)/100,x="rgb("+(0,n.default)(y,w,v)+")",C=c.exec(x);if(!C)throw new r.default(4,t,x);return{red:parseInt(""+C[1],10),green:parseInt(""+C[2],10),blue:parseInt(""+C[3],10)}}var S=p.exec(t.substring(0,50));if(S){var E=parseInt(""+S[1],10),T=parseInt(""+S[2],10)/100,k=parseInt(""+S[3],10)/100,I="rgb("+(0,n.default)(E,T,k)+")",O=c.exec(I);if(!O)throw new r.default(4,t,I);return{red:parseInt(""+O[1],10),green:parseInt(""+O[2],10),blue:parseInt(""+O[3],10),alpha:parseFloat(""+S[4])>1?parseFloat(""+S[4])/100:parseFloat(""+S[4])}}throw new r.default(5)};var n=o(j()),i=o(K()),r=o(D());function o(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,d=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,c=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(L,L.exports)),L.exports}function J(){return z||(z=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,i.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),r=n[0],o=n[1],a=n[2];return parseFloat((.2126*r+.7152*o+.0722*a).toFixed(3))};var n,i=(n=U())&&n.__esModule?n:{default:n};e.exports=t.default}(M,M.exports)),M.exports}const V=B(J());var Y,Q={exports:{}},G={exports:{}};function Z(){return Y||(Y=1,function(e,t){function n(e,t,i){return function(){var r=i.concat(Array.prototype.slice.call(arguments));return r.length>=t?e.apply(this,r):n(e,t,r)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(G,G.exports)),G.exports}var X,ee={exports:{}};function te(){return X||(X=1,e=ee,(t=ee.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),ee.exports;var e,t}var ne,ie,re={exports:{}},oe={exports:{}};function ae(){return ne||(ne=1,e=oe,(t=oe.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,i=e.green/255,r=e.blue/255,o=Math.max(n,i,r),a=Math.min(n,i,r),s=(o+a)/2;if(o===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var d=o-a,l=s>.5?d/(2-o-a):d/(o+a);switch(o){case n:t=(i-r)/d+(i<r?6:0);break;case i:t=(r-n)/d+2;break;default:t=(n-i)/d+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),oe.exports;var e,t}function se(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,i.default)((0,n.default)(e))};var n=r(U()),i=r(ae());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(re,re.exports)),re.exports}var de,le={exports:{}},ce={exports:{}},ue={exports:{}},fe={exports:{}};function pe(){return de||(de=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(fe,fe.exports)),fe.exports}var ge,he,be,me={exports:{}};function ye(){return ge||(ge=1,e=me,(t=me.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),me.exports;var e,t}function we(){return he||(he=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=o(j()),i=o(pe()),r=o(ye());function o(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,r.default)(Math.round(255*e))}function s(e,t,n){return(0,i.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,i){return(0,n.default)(e,t,i,s)},e.exports=t.default}(ue,ue.exports)),ue.exports}function ve(){return be||(be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)(e,t,r);if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new i.default(1)};var n=r(we()),i=r(D());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ce,ce.exports)),ce.exports}var xe,Ce={exports:{}};function Se(){return xe||(xe=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof o&&"number"==typeof a)return a>=1?(0,n.default)(e,t,o):"rgba("+(0,i.default)(e,t,o)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===o&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,i.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new r.default(2)};var n=o(we()),i=o(j()),r=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ce,Ce.exports)),Ce.exports}var Ee,Te={exports:{}};function ke(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o){if("number"==typeof e&&"number"==typeof t&&"number"==typeof o)return(0,n.default)("#"+(0,i.default)(e)+(0,i.default)(t)+(0,i.default)(o));if("object"==typeof e&&void 0===t&&void 0===o)return(0,n.default)("#"+(0,i.default)(e.red)+(0,i.default)(e.green)+(0,i.default)(e.blue));throw new r.default(6)};var n=o(pe()),i=o(ye()),r=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Te,Te.exports)),Te.exports}var Ie,Oe,_e,We={exports:{}};function Ae(){return Ie||(Ie=1,function(e,t){t.__esModule=!0,t.default=function(e,t,o,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof o&&"number"==typeof a)return a>=1?(0,i.default)(e,t,o):"rgba("+e+","+t+","+o+","+a+")";if("object"==typeof e&&void 0===t&&void 0===o&&void 0===a)return e.alpha>=1?(0,i.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new r.default(7)};var n=o(U()),i=o(ke()),r=o(D());function o(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(We,We.exports)),We.exports}function Be(){return Oe||(Oe=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,o.default)(e);if(d(e))return(0,r.default)(e);if(u(e))return(0,i.default)(e);if(c(e))return(0,n.default)(e);throw new a.default(8)};var n=s(ve()),i=s(Se()),r=s(ke()),o=s(Ae()),a=s(D());function s(e){return e&&e.__esModule?e:{default:e}}var d=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},c=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(le,le.exports)),le.exports}function Pe(){return _e||(_e=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Z()),i=a(te()),r=a(se()),o=a(Be());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(this,arguments)}var d=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,r.default)(t);return(0,o.default)(s({},n,{lightness:(0,i.default)(0,1,n.lightness-parseFloat(e))}))});t.default=d,e.exports=t.default}(Q,Q.exports)),Q.exports}const Me=B(Pe());var Le,Ne={exports:{}};function je(){return Le||(Le=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Z()),i=a(te()),r=a(se()),o=a(Be());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},s.apply(this,arguments)}var d=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,r.default)(t);return(0,o.default)(s({},n,{lightness:(0,i.default)(0,1,n.lightness+parseFloat(e))}))});t.default=d,e.exports=t.default}(Ne,Ne.exports)),Ne.exports}const He=B(je()),Fe="bf-iframe-container",Ke="bf-trigger-button",Re="bf-search-bar-iframe-container",$e="bf-search-bar-iframe-backdrop";function ze(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const i=V(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${Ke} { background: ${e}; }\n .${Ke}:hover {\n background: ${i?Me(.05,e):He(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class qe{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function De(e,t,n={}){const i=document.createElement(e);return i.className=t,Object.entries(n).forEach(([e,t])=>{i.setAttribute(e,t)}),i}const Ue="brainfish-search-widget";class Je{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===g.Searchbar?Re:Fe}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${$e}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,i;const r=document.querySelector(`.${this.containerClass}`),o=null==r?void 0:r.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==o?void 0:o.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==o?void 0:o.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(i=null==o?void 0:o.contentWindow)||i.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==g.Searchbar&&(null==r||r.classList.add("open"),e.position&&(null==r||r.classList.add(`position-${e.position}`),null==r||r.setAttribute("data-current-position",e.position))),null==r||r.setAttribute("aria-hidden","false"),this.widgetType!==g.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=De("div",$e);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector(Ue);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==g.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${Re}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${Fe}`))return!0}return!1}}class Ve{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===g.Popup)}static clear(){this.instances.clear()}}l(Ve,"instances",new Map);const Ye=({formUrl:e,width:t="500px",height:n="600px"})=>{const i=document.createElement("div");i.setAttribute("role","dialog"),i.setAttribute("aria-modal","true"),i.setAttribute("tabindex","-1"),i.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const r=document.createElement("button");r.innerHTML="×",r.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const o=document.createElement("iframe");o.src=e,o.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[r,o],n=document.activeElement,i=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?i<=0?t[t.length-1].focus():t[i-1].focus():i>=t.length-1?t[0].focus():t[i+1].focus()}else"Escape"===e.key&&d()},d=()=>{i.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",r.onclick=d,l.onclick=d,document.addEventListener("keydown",s),i.appendChild(r),i.appendChild(o),document.body.appendChild(l),document.body.appendChild(i),i.focus(),o.onload=()=>{o.setAttribute("tabindex","0"),r.focus()}},Qe=e=>`brainfish_conversation_${e}`,Ge={save(e,t){if(t){const n={conversationId:t,persistedAt:Date.now()};((e,t)=>{try{k()&&window.localStorage.setItem(e,t)}catch(n){}})(Qe(e),JSON.stringify(n))}else O(Qe(e))},load(e){const t=I(Qe(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>18e5?(O(Qe(e)),null):n.conversationId}catch(n){return O(Qe(e)),null}},clear(e){O(Qe(e))}};class Ze{static getIframeForInstance(e){var t,n;const i=e.widgetType===g.Searchbar?Re:Fe,r=e.widgetType===g.Searchbar?`.${i}[data-widget-key="${e.widgetKey}"]`:`.${i}`;return null!=(n=null==(t=document.querySelector(r))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,i;null==(i=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||i.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=Ye,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=Ve.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Ve.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,i={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(i.newConversation=!0),(null==n?void 0:n.trigger)&&(i.trigger=n.trigger),(null==n?void 0:n.position)&&(i.position=n.position),t.openWidget(i)}}static createNewThread(){const e=Ve.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Ve.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=Ve.getOpenInstance();if(n||(n=Ve.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const i=d(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(i)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=Ve.getOpenInstance();const n=!!t;t||(t=Ve.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=Ve.getOpenInstance())?e:Ve.getClosedPopupInstance();t?(Ge.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(Ze,"isInitialized",!1);class Xe{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case g.Searchbar:n="searchbar_widget";break;case g.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,d(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class et{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new qe(e,t),this.domController=new Je(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new Xe(t,e)}static getInstance(e){return Ve.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),Ve.register(this.widgetKey,this),Ze.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=Ge.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){Ve.unregister(this.widgetKey)}static initialize(e){const t=new et(e.widgetKey,e.widgetType);return t.initialize(e),t}}function tt({widgetUrl:e,widgetType:t,props:n}){const i=t===g.Searchbar?Re:Fe,r=De("div",i,s({id:i,"aria-live":"polite","aria-hidden":t===g.Searchbar?"false":"true"},n||{})),o=De("div","iframe-loading-indicator"),a=De("div","spinner");o.setAttribute("aria-label","Loading content"),o.setAttribute("role","status"),o.appendChild(a),r.appendChild(o);const d=De("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return d.style.opacity="0",d.addEventListener("load",()=>{o.style.display="none",d.style.opacity="1"}),d.addEventListener("error",e=>{console.error("Error loading iframe:",e),o.innerHTML="";const t=De("div","loading-error");o.appendChild(t),o.setAttribute("aria-label","Failed to load content")}),r.appendChild(d),{iframeContainer:r,iframe:d}}function nt(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const it=new Map,rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,ot=(e,t)=>c(null,null,function*(){if(it.has(e)){const r=it.get(e);if("function"!=typeof r)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield r(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(i){return{success:!1,reason:rt(e,i)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),at=new Map;function st(e,{widgetHost:t,apiHost:n,widgetKey:i,widgetType:r,signal:o,stateManager:a}){window.addEventListener("message",o=>c(null,null,function*(){var s,d;if(o.origin!==t)return;const{type:l,widgetKey:c}=o.data;if(!c||c===i){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${Fe}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=o.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{eventName:e,data:t}=o.data;a.trackCustomEvent(e,t)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:r,answer:a,conversation:s}=o.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const d=at.get(e.id);if(d&&Date.now()-d<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-d}ms ago)`);at.set(e.id,Date.now()),setTimeout(()=>at.delete(e.id),1e3);const l={query:r,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](r,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",i),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const o=document.createElement("script");o.src=t.toString(),document.head.appendChild(o),o.onload=()=>{window.__bfCallbacks[e.id](r,a,l),setTimeout(()=>{document.head.removeChild(o)},300)},o.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:i}=o.data,r=yield ot(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:i,result:r},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=o.data;r!==g.Searchbar&&Ge.save(i,e)}if("REQUEST_USER_IDENTITY"===l&&o.source===e.contentWindow&&r===g.Popup){const t=Ge.load(i);t&&(null==(d=e.contentWindow)||d.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:o})}function dt(e,t,n){let i;const r=()=>{(t=>{var i;const r={type:"UPDATE_BODY_CLASS",isMobile:t};null==(i=e.contentWindow)||i.postMessage(r,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},o=()=>{i&&clearTimeout(i),i=window.setTimeout(r,300)};r(),(()=>{const e=new ResizeObserver(o);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const lt=new Set;function ct(e,t,{isButtonHidden:n,triggerButtonIcon:i}){const r=document.createDocumentFragment();let o;if(n)o=et.initialize({isButtonHidden:n,widgetType:g.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=De("button",Ke,{id:`trigger-button-${e}`,"aria-controls":Fe,"aria-expanded":"false","data-name":Ke}),i=De("div","trigger-button-icon",{"aria-hidden":"true"});return i.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(i),{button:n,icon:i}}(e,i);r.appendChild(t),o=et.initialize({button:t,icon:n,widgetType:g.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=tt({widgetUrl:t,widgetType:g.Popup});return r.appendChild(a),{fragment:r,iframe:s,stateManager:o}}const ut=({config:e,widgetUrl:t,apiHost:n,widgetHost:i,widgetKey:r,hideTriggerButton:o})=>{const{settings:a}=e,s=null!=o?o:null==a?void 0:a.hideTriggerButton,d=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return lt.has(e)}(r))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(r))return;ze(e);const{fragment:o,iframe:a,stateManager:l}=ct(r,t,{isButtonHidden:s||!1,triggerButtonIcon:d||""}),c=new AbortController,{signal:u}=c;a.onload=()=>{setTimeout(()=>{var e;nt(a,u),st(a,{widgetHost:i,apiHost:n,widgetKey:r,widgetType:g.Popup,signal:u,stateManager:l}),dt(a,u,l);const o=Ge.load(r),s=new URL(t).searchParams.has("conversation");o&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:o},"*"))},0)},document.body?document.body.appendChild(o):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(o)},{once:!0})),lt.add(r);const f=()=>{c.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){w(e,t,t.message,n)}(n,l,r)}},ft=new Map;const pt=({config:e,widgetUrl:t,apiHost:n,widgetHost:i,widgetKey:r})=>{var o,a,s,d;const{settings:l}=e;let c=et.getInstance(r);null==(o=ft.get(r))||o.abort();const u=new AbortController;ft.set(r,u),ze(e);try{const e=document.querySelector(`.${Re}[data-widget-key="${r}"]`),o=document.querySelector(Ue);e&&o&&!o.contains(e)&&(o.appendChild(e),null==(a=o.parentElement)||a.style.setProperty("width","100%")),c||(c=et.initialize({isButtonHidden:!0,widgetType:g.Searchbar,widgetKey:r}));const{signal:l}=u,f=e=>{nt(e,l),st(e,{widgetHost:i,apiHost:n,widgetKey:r,widgetType:g.Searchbar,signal:l,stateManager:c}),dt(e,l,c)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(d=t.contentDocument)?void 0:d.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:i}=tt({widgetUrl:t,widgetType:g.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":r}});i.onload=()=>{setTimeout(()=>{f(i)},0)},e.appendChild(n),o?(o.appendChild(e),null==(s=o.parentElement)||s.style.setProperty("width","100%")):document.body.appendChild(e)}const p=()=>{u.abort(),ft.delete(r),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){w(e,t,t.message,n)}(n,f,r)}},gt=(e,t)=>{var n;const a=C(e.overrides),d=(null==(l=e.overrides)?void 0:l.widgetHost)||"https://agent.brainfi.sh";var l;const c=null==(n=e.overrides)?void 0:n.hideTriggerButton,{theme:u,settings:f}=t,p=e.overrides||{},{theme:g,redirectRules:h,regions:b,customCss:m}=p,y=((e,t)=>{var n={};for(var a in e)r.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&i)for(var a of i(e))t.indexOf(a)<0&&o.call(e,a)&&(n[a]=e[a]);return n})(p,["theme","redirectRules","regions","customCss"]),w=s(s({},u),g),v=s(s({},f),y),x=A(JSON.stringify(h)),S={theme:A(JSON.stringify(w)),settings:A(JSON.stringify(v)),redirectRules:x};b&&(S.regions=A(JSON.stringify(b))),m&&(S.customCss=A(m));const E=`${d}/?widgetKey=${e.widgetKey}#${new URLSearchParams(S).toString()}`;"Search"===t.widgetType?pt({config:t,widgetUrl:E,apiHost:a,widgetHost:d,widgetKey:e.widgetKey}):ut({config:t,widgetUrl:E,apiHost:a,widgetHost:d,widgetKey:e.widgetKey,hideTriggerButton:c})};var ht=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(ht||{});const bt=e=>c(null,null,function*(){if(e.widgetType===g.Popup){const e=window.fcWidget?ht.FRESHCHAT:null;e&&e===ht.FRESHCHAT&&(yield c(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),mt="brainfish-nudges",yt=(e,t)=>c(null,null,function*(){try{yield c(null,null,function*(){if(!document.getElementById(mt))return new Promise(e=>{const t=document.createElement("script");t.id=mt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){w(e,n,"Failed to initialize Nudge widget",t)}});let wt,vt,xt,Ct=!1;const St=e=>{null==wt||wt.abort(),wt=new AbortController;const{signal:t}=wt;let n=window.location.pathname;const i=()=>{if(t.aborted)return;const i=window.location.pathname;i!==n&&(n=i,e())};window.addEventListener("popstate",i,{signal:t}),Ct||(vt=history.pushState,xt=history.replaceState,history.pushState=function(...e){vt.apply(this,e),setTimeout(i,0)},history.replaceState=function(...e){xt.apply(this,e),setTimeout(i,0)},Ct=!0),t.addEventListener("abort",()=>{Ct&&(history.pushState=vt,history.replaceState=xt,Ct=!1)})};let Et=null;const Tt="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(Et||(Et=function(){const e=[];let t=null;function n(n,i){if(t){const e=n.split(".");let r=t;for(let t=0;t<e.length-1;t++)r=r[e[t]];const o=r[e[e.length-1]];if("function"==typeof o)return o.apply(r,i)}else e.push([n,i])}return{Widgets:{init:(...e)=>n("Widgets.init",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:i})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:i}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(i){for(t=i;e.length>0;){const[t,i]=e.shift();n(t,i)}}}}(),"undefined"!=typeof window&&(window.Brainfish=Et)),Et),kt=new Map,It=new Map;let Ot=!1;function _t(e,t,n,i){return c(this,null,function*(){var r,o,a,s,d,l,c;const u=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(o=null==t?void 0:t.settings)?void 0:o.enableRecording)||!1,f=(null==(a=e.overrides)?void 0:a.version)||(null==t?void 0:t.version);It.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:i});const p=[];(null==f?void 0:f.startsWith("2."))?(gt(e,t),Ot||(Ot=!0,St(()=>{It.forEach(({options:e,config:t})=>{var n;const i=(null==(n=e.overrides)?void 0:n.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&>(e,t)})}))):p.push(T(e,t)),p.push(W(e.widgetKey,t.trackingToken||"",n,i,u,{blocklist:null==(s=null==t?void 0:t.settings)?void 0:s.recordingBlocklist,sampleRate:null==(l=null==(d=null==t?void 0:t.settings)?void 0:d.ambientSettings)?void 0:l.sampleRate,_allowLocalhostRecording:null==(c=null==t?void 0:t.settings)?void 0:c._allowLocalhostRecording})),p.push(yt(n,e.widgetKey));const[g]=yield Promise.allSettled(p);g&&"fulfilled"===g.status&&g.value&&Tt._setRealBrainfish(g.value)})}Tt.Widgets.isReady=!1,Tt.Widgets.identify=e=>{window.BrainfishAnalytics("identify",e)},Tt.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},Tt.Widgets.init=e=>c(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=C(e.overrides),n=(null==(i=e.overrides)?void 0:i.analyticsApiHost)||"";var i;let r;if(e.config)r=JSON.parse((e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,i=new Uint8Array(n);for(let e=0;e<n;e++)i[e]=t.charCodeAt(e);return(new TextDecoder).decode(i)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")})(e.config));else{const{config:n}=yield v({widgetKey:e.widgetKey,apiHost:t});r=n}let o=kt.get(e.widgetKey);if(o||(o=_t(e,r,t,n),kt.set(e.widgetKey,o)),yield o,!Je.isWidgetDOMExisting(e.widgetKey,r)){kt.delete(e.widgetKey);const i=_t(e,r,t,n);kt.set(e.widgetKey,i),yield i}yield bt(r),Tt.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),Tt.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{it.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=Tt;
|
|
1
|
+
"use strict";var e=Object.defineProperty,t=Object.defineProperties,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o,s=(e,t)=>{for(var n in t||(t={}))i.call(t,n)&&a(e,n,t[n]);if(o)for(var n of o(t))r.call(t,n)&&a(e,n,t[n]);return e},c=(e,o)=>t(e,n(o)),l=(e,t,n)=>a(e,"symbol"!=typeof t?t+"":t,n),d=(e,t,n)=>new Promise((o,i)=>{var r=e=>{try{s(n.next(e))}catch(t){i(t)}},a=e=>{try{s(n.throw(e))}catch(t){i(t)}},s=e=>e.done?o(e.value):Promise.resolve(e.value).then(r,a);s((n=n.apply(e,t)).next())});!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4bb7cda4-11eb-412b-958d-573415808613",e._sentryDebugIdIdentifier="sentry-dbid-4bb7cda4-11eb-412b-958d-573415808613")}catch(n){}}(),Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}}),new TextEncoder;const u=new TextDecoder;const f=e=>{let t=e;t instanceof Uint8Array&&(t=u.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return(e=>{const t=atob(e),n=new Uint8Array(t.length);for(let o=0;o<t.length;o++)n[o]=t.charCodeAt(o);return n})(t)}catch(n){throw new TypeError("The input to be decoded is not correctly encoded.")}};function p(e){let t;if("string"==typeof e){const n=e.split(".");3!==n.length&&5!==n.length||([t]=n)}else if("object"==typeof e&&e){if(!("protected"in e))throw new TypeError("Token does not contain a Protected Header");t=e.protected}try{if("string"!=typeof t||!t)throw new Error;const e=JSON.parse(u.decode(f(t)));if(!function(e){if("object"!=typeof(t=e)||null===t||"[object Object]"!==Object.prototype.toString.call(e))return!1;var t;if(null===Object.getPrototypeOf(e))return!0;let n=e;for(;null!==Object.getPrototypeOf(n);)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(e)===n}(e))throw new Error;return e}catch(n){throw new TypeError("Invalid Token or Protected Header formatting")}}var h,g,m,b;("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"web-widget@1.22.0"},(g=h||(h={})).Sidebar="sidebar",g.Searchbar="searchbar",g.Popup="popup",h.Sidebar,h.Searchbar,h.Popup;class y extends Error{constructor(e,t){super(e,t),l(this,"cause"),this.name="BrainfishWidgetError",this.cause=null==t?void 0:t.cause,Error.captureStackTrace&&Error.captureStackTrace(this,y),this.cause instanceof Error&&this.cause.stack&&(this.stack=this.stack+"\nCaused by: "+this.cause.stack)}toJSON(){return{name:this.name,message:this.message,stack:this.stack,cause:this.cause instanceof Error?{name:this.cause.name,message:this.cause.message,stack:this.cause.stack}:this.cause}}}(b=m||(m={})).LINK="link",b.CALLBACK="callback",b.EMAIL="email",b.PHONE="phone";const v=(e,t,n,o)=>{let i=n,r={};if(t instanceof Error)try{r=JSON.parse(t.message),i+=` - ${r.message||t.message}`}catch(a){i+=` - ${t.message}`}else i+=` - ${String(t)}`;((e,t,n)=>{if(!navigator||navigator.userAgent.toLowerCase().includes("headless"))return;const o=t.toJSON(),i=e||"https://app.brainfi.sh",r={error:`WebWidgetVersion: 1.22.0. ${t.message}`,stack:t.stack,cause:{message:o.message,stack:o.stack,cause:o.cause}};fetch(`${i}/api/trackError.widget.create`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n},body:JSON.stringify(r)})})(e,new y(i,{cause:r}),o)};const w=e=>d(null,[e],function*({widgetKey:e,apiHost:t}){return function(e,t,n){return d(this,null,function*(){let o,i=0;for(;i<3;)try{const o=yield fetch(`${e}${t}`,{method:"POST",headers:{"Content-Type":"application/json","api-key":n}});if(!o.ok)throw new Error(`API call failed with status: ${o.status}`);const i=yield o.json();if(!i)throw new Error("Error loading config: empty response");return i}catch(r){if(o=r,i++,i>=3)throw v(e,r,"Error fetching config",n),o;yield new Promise(e=>setTimeout(e,500))}})}(t,"/api/searchWidgets.getConfigByKey",e)}),x=({config:e,apiKey:t,apiHost:n})=>{const o=e.settings||{};return["bodyActionButtons","footerActionButtons","nextBestActions"].forEach(e=>{o[e]&&(o[e]=o[e].map(e=>e.type===m.CALLBACK&&e.value?c(s({},e),{value:new Function(`return ${e.value}`)()}):e))}),c(s({},e),{settings:o,apiHost:n,widgetMode:e.widgetType,apiKey:t})},S=e=>(null==e?void 0:e.apiHost)||"https://app.brainfi.sh",C=e=>d(null,[e],function*({apiHost:e,widgetKey:t,version:n}){try{const e=`https://cdn.jsdelivr.net/npm/@brainfish-ai/search-widget@${n}/dist/web.js`,t=yield(e=>d(null,null,function*(){return document.getElementById("brainfish-widget")?window.Brainfish:new Promise((t,n)=>{const o=document.createElement("script");o.id="brainfish-widget",o.src=e,o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{const e=window.Brainfish;e?t(e):n(new Error("Failed to load Brainfish module"))},200)},o.onerror=t=>{const o=t,i={message:`Failed to load script: ${e}`,type:o.type,fileName:o.filename,lineNumber:o.lineno,columnNumber:o.colno,error:o.error?o.error.toString():"Unknown error"};n(new Error(JSON.stringify(i)))},document.head.appendChild(o)})}))(e);return{widget:t}}catch(o){Math.random()<.05&&v(e,o,o.message,t)}});const k=new Set,E=(e,t)=>d(null,null,function*(){const n=S(e.overrides);try{if(k.has(e.widgetKey))return;const o=yield C({apiHost:n,widgetKey:e.widgetKey,version:t.version||"latest"});if(o){const{widget:i}=o,r=x({config:t,apiKey:e.widgetKey,apiHost:n});return e.overrides&&t.settings&&Object.entries(e.overrides).forEach(([e,n])=>{t.settings&&e in t.settings&&(t.settings[e]=((e=[],t)=>{const n=new Map(e.map(e=>[e.label,e]));return t.forEach(e=>n.set(e.label,e)),Array.from(n.values())})(t.settings[e],n))}),function(e,t){t.widgetType===h.Searchbar||"Search"===t.widgetType?e.SearchWidget.initStandard(t):e.HelpWidget.initPopup(t)}(i,r),k.add(e.widgetKey),i}}catch(o){v(n,o,o.message,e.widgetKey)}}),I=()=>{try{if("undefined"==typeof window||!("localStorage"in window)||null===window.localStorage)return!1;const e="__brainfish_storage_test__";return window.localStorage.setItem(e,e),window.localStorage.removeItem(e),!0}catch(e){return e instanceof DOMException&&"QuotaExceededError"===e.name}},L=e=>{try{if(I())return window.localStorage.getItem(e)}catch(t){}return null},W=e=>{try{I()&&window.localStorage.removeItem(e)}catch(t){}};let T=!1;const M=(e,t,n,...o)=>d(null,[e,t,n,...o],function*(e,t,n,o="",i=!1,r){if(t||void 0!==console.warn&&console.warn("[Brainfish] BrainfishAnalytics not initialized. Access key is required."),!T)try{const a=(()=>{if("undefined"==typeof window||"undefined"==typeof navigator)return!1;const e=navigator,t=window,n=(e.doNotTrack||t.doNotTrack||e.msDoNotTrack||"0").toString().toLowerCase();return["1","yes","true"].includes(n)})(),s="true"===L("bf_tracking_disabled"),c=a||s;window.BrainfishAnalytics("init",{apiUrl:o,accessKey:t,trackScreenViews:!0,trackAttributes:!c,trackOutgoingLinks:!c,enableRecording:!c&&i,recordingOptions:r}),T=!0,yield((e,t)=>d(null,null,function*(){return document.getElementById("brainfish-analytics")?window.BrainfishAnalytics:new Promise(n=>{const o=document.createElement("script");o.id="brainfish-analytics",o.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/web-tracker@latest/dist/tracker.js",o.type="module",o.async=!0,o.crossOrigin="anonymous",o.onload=()=>{setTimeout(()=>{n(window.BrainfishAnalytics)},200)},o.onerror=()=>{Math.random()<.05&&v(e,new Error(`Failed to load script: ${o.src}`),`Failed to load script: ${o.src}`,t),n(void 0)},document.head.appendChild(o)})}))(n,e)}catch(a){v(n,a,"Failed to initialize BrainfishAnalytics",e)}});function _(e){const t=(new TextEncoder).encode(e);if("undefined"!=typeof window&&"function"==typeof window.btoa){const e=Array.from(t,e=>String.fromCharCode(e)).join("");return btoa(e)}if("undefined"!=typeof Buffer)return Buffer.from(t).toString("base64");throw new Error("[utils.base64Encode]: Unsupported environment")}const A=e=>{if("undefined"!=typeof window&&"function"==typeof window.atob){const t=atob(e),n=t.length,o=new Uint8Array(n);for(let e=0;e<n;e++)o[e]=t.charCodeAt(e);return(new TextDecoder).decode(o)}if("undefined"!=typeof Buffer)return Buffer.from(e,"base64").toString("utf-8");throw new Error("[utils.base64Decode]: Unsupported environment")};function O(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P,R={exports:{}},F={exports:{}},B={exports:{}};function V(){return P||(P=1,function(e,t){function n(e){return Math.round(255*e)}function o(e,t,o){return n(e)+","+n(t)+","+n(o)}t.__esModule=!0,t.default=void 0,t.default=function(e,t,n,i){if(void 0===i&&(i=o),0===t)return i(n,n,n);var r=(e%360+360)%360/60,a=(1-Math.abs(2*n-1))*t,s=a*(1-Math.abs(r%2-1)),c=0,l=0,d=0;r>=0&&r<1?(c=a,l=s):r>=1&&r<2?(c=s,l=a):r>=2&&r<3?(l=a,d=s):r>=3&&r<4?(l=s,d=a):r>=4&&r<5?(c=s,d=a):r>=5&&r<6&&(c=a,d=s);var u=n-a/2;return i(c+u,l+u,d+u)},e.exports=t.default}(B,B.exports)),B.exports}var j,N={exports:{}};function H(){return j||(j=1,function(e,t){t.__esModule=!0,t.default=void 0;var n={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"00ffff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"0000ff",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"ff00ff",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"639",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"};t.default=function(e){if("string"!=typeof e)return e;var t=e.toLowerCase();return n[t]?"#"+n[t]:e},e.exports=t.default}(N,N.exports)),N.exports}var Z,D,G,z={exports:{}};function Y(){return Z||(Z=1,function(e,t){function n(e){var t="function"==typeof Map?new Map:void 0;return n=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return function(e,t,n){if(o())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var a=new(e.bind.apply(e,r));return n&&i(a,n.prototype),a}(e,arguments,r(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),i(n,e)},n(e)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(o=function(){return!!e})()}function i(e,t){return(i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}t.__esModule=!0,t.default=void 0;var a={1:"Passed invalid arguments to hsl, please pass multiple numbers e.g. hsl(360, 0.75, 0.4) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75 }).\n\n",2:"Passed invalid arguments to hsla, please pass multiple numbers e.g. hsla(360, 0.75, 0.4, 0.7) or an object e.g. rgb({ hue: 255, saturation: 0.4, lightness: 0.75, alpha: 0.7 }).\n\n",3:"Passed an incorrect argument to a color function, please pass a string representation of a color.\n\n",4:"Couldn't generate valid rgb string from %s, it returned %s.\n\n",5:"Couldn't parse the color string. Please provide the color as a string in hex, rgb, rgba, hsl or hsla notation.\n\n",6:"Passed invalid arguments to rgb, please pass multiple numbers e.g. rgb(255, 205, 100) or an object e.g. rgb({ red: 255, green: 205, blue: 100 }).\n\n",7:"Passed invalid arguments to rgba, please pass multiple numbers e.g. rgb(255, 205, 100, 0.75) or an object e.g. rgb({ red: 255, green: 205, blue: 100, alpha: 0.75 }).\n\n",8:"Passed invalid argument to toColorString, please pass a RgbColor, RgbaColor, HslColor or HslaColor object.\n\n",9:"Please provide a number of steps to the modularScale helper.\n\n",10:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",11:'Invalid value passed as base to modularScale, expected number or em string but got "%s"\n\n',12:'Expected a string ending in "px" or a number passed as the first argument to %s(), got "%s" instead.\n\n',13:'Expected a string ending in "px" or a number passed as the second argument to %s(), got "%s" instead.\n\n',14:'Passed invalid pixel value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',15:'Passed invalid base value ("%s") to %s(), please pass a value like "12px" or 12.\n\n',16:"You must provide a template to this method.\n\n",17:"You passed an unsupported selector state to this method.\n\n",18:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",19:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",20:"expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",21:"expects the objects in the first argument array to have the properties `prop`, `fromSize`, and `toSize`.\n\n",22:"expects the first argument object to have the properties `prop`, `fromSize`, and `toSize`.\n\n",23:"fontFace expects a name of a font-family.\n\n",24:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",25:"fontFace expects localFonts to be an array.\n\n",26:"fontFace expects fileFormats to be an array.\n\n",27:"radialGradient requries at least 2 color-stops to properly render.\n\n",28:"Please supply a filename to retinaImage() as the first argument.\n\n",29:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",30:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",31:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation\n\n",32:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s')\n\n",33:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation\n\n",34:"borderRadius expects a radius value as a string or number as the second argument.\n\n",35:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',36:"Property must be a string value.\n\n",37:"Syntax Error at %s.\n\n",38:"Formula contains a function that needs parentheses at %s.\n\n",39:"Formula is missing closing parenthesis at %s.\n\n",40:"Formula has too many closing parentheses at %s.\n\n",41:"All values in a formula must have the same unit or be unitless.\n\n",42:"Please provide a number of steps to the modularScale helper.\n\n",43:"Please pass a number or one of the predefined scales to the modularScale helper as the ratio.\n\n",44:"Invalid value passed as base to modularScale, expected number or em/rem string but got %s.\n\n",45:"Passed invalid argument to hslToColorString, please pass a HslColor or HslaColor object.\n\n",46:"Passed invalid argument to rgbToColorString, please pass a RgbColor or RgbaColor object.\n\n",47:"minScreen and maxScreen must be provided as stringified numbers with the same units.\n\n",48:"fromSize and toSize must be provided as stringified numbers with the same units.\n\n",49:"Expects either an array of objects or a single object with the properties prop, fromSize, and toSize.\n\n",50:"Expects the objects in the first argument array to have the properties prop, fromSize, and toSize.\n\n",51:"Expects the first argument object to have the properties prop, fromSize, and toSize.\n\n",52:"fontFace expects either the path to the font file(s) or a name of a local copy.\n\n",53:"fontFace expects localFonts to be an array.\n\n",54:"fontFace expects fileFormats to be an array.\n\n",55:"fontFace expects a name of a font-family.\n\n",56:"linearGradient requries at least 2 color-stops to properly render.\n\n",57:"radialGradient requries at least 2 color-stops to properly render.\n\n",58:"Please supply a filename to retinaImage() as the first argument.\n\n",59:"Passed invalid argument to triangle, please pass correct pointingDirection e.g. 'right'.\n\n",60:"Passed an invalid value to `height` or `width`. Please provide a pixel based unit.\n\n",61:"Property must be a string value.\n\n",62:"borderRadius expects a radius value as a string or number as the second argument.\n\n",63:'borderRadius expects one of "top", "bottom", "left" or "right" as the first argument.\n\n',64:"The animation shorthand only takes 8 arguments. See the specification for more information: http://mdn.io/animation.\n\n",65:"To pass multiple animations please supply them in arrays, e.g. animation(['rotate', '2s'], ['move', '1s'])\\nTo pass a single animation please supply them in simple values, e.g. animation('rotate', '2s').\n\n",66:"The animation shorthand arrays can only have 8 elements. See the specification for more information: http://mdn.io/animation.\n\n",67:"You must provide a template to this method.\n\n",68:"You passed an unsupported selector state to this method.\n\n",69:'Expected a string ending in "px" or a number passed as the first argument to %s(), got %s instead.\n\n',70:'Expected a string ending in "px" or a number passed as the second argument to %s(), got %s instead.\n\n',71:'Passed invalid pixel value %s to %s(), please pass a value like "12px" or 12.\n\n',72:'Passed invalid base value %s to %s(), please pass a value like "12px" or 12.\n\n',73:"Please provide a valid CSS variable.\n\n",74:"CSS variable not found and no default was provided.\n\n",75:"important requires a valid style object, got a %s instead.\n\n",76:"fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",77:'remToPx expects a value in "rem" but you provided it in "%s".\n\n',78:'base must be set in "px" or "%" but you set it in "%s".\n'};function s(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];var o,i=t[0],r=[];for(o=1;o<t.length;o+=1)r.push(t[o]);return r.forEach(function(e){i=i.replace(/%[a-z]/,e)}),i}t.default=function(e){var t,n;function o(t){var n;if("production"===process.env.NODE_ENV)n=e.call(this,"An error occurred. See https://github.com/styled-components/polished/blob/main/src/internalHelpers/errors.md#"+t+" for more information.")||this;else{for(var o=arguments.length,i=new Array(o>1?o-1:0),r=1;r<o;r++)i[r-1]=arguments[r];n=e.call(this,s.apply(void 0,[a[t]].concat(i)))||this}return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(n)}return n=e,(t=o).prototype=Object.create(n.prototype),t.prototype.constructor=t,i(t,n),o}(n(Error)),e.exports=t.default}(z,z.exports)),z.exports}function $(){return D||(D=1,function(e,t){t.__esModule=!0,t.default=function(e){if("string"!=typeof e)throw new i.default(3);var t=(0,o.default)(e);if(t.match(a))return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16)};if(t.match(s)){var r=parseFloat((parseInt(""+t[7]+t[8],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[2],16),green:parseInt(""+t[3]+t[4],16),blue:parseInt(""+t[5]+t[6],16),alpha:r}}if(t.match(c))return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16)};if(t.match(l)){var h=parseFloat((parseInt(""+t[4]+t[4],16)/255).toFixed(2));return{red:parseInt(""+t[1]+t[1],16),green:parseInt(""+t[2]+t[2],16),blue:parseInt(""+t[3]+t[3],16),alpha:h}}var g=d.exec(t);if(g)return{red:parseInt(""+g[1],10),green:parseInt(""+g[2],10),blue:parseInt(""+g[3],10)};var m=u.exec(t.substring(0,50));if(m)return{red:parseInt(""+m[1],10),green:parseInt(""+m[2],10),blue:parseInt(""+m[3],10),alpha:parseFloat(""+m[4])>1?parseFloat(""+m[4])/100:parseFloat(""+m[4])};var b=f.exec(t);if(b){var y=parseInt(""+b[1],10),v=parseInt(""+b[2],10)/100,w=parseInt(""+b[3],10)/100,x="rgb("+(0,n.default)(y,v,w)+")",S=d.exec(x);if(!S)throw new i.default(4,t,x);return{red:parseInt(""+S[1],10),green:parseInt(""+S[2],10),blue:parseInt(""+S[3],10)}}var C=p.exec(t.substring(0,50));if(C){var k=parseInt(""+C[1],10),E=parseInt(""+C[2],10)/100,I=parseInt(""+C[3],10)/100,L="rgb("+(0,n.default)(k,E,I)+")",W=d.exec(L);if(!W)throw new i.default(4,t,L);return{red:parseInt(""+W[1],10),green:parseInt(""+W[2],10),blue:parseInt(""+W[3],10),alpha:parseFloat(""+C[4])>1?parseFloat(""+C[4])/100:parseFloat(""+C[4])}}throw new i.default(5)};var n=r(V()),o=r(H()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}var a=/^#[a-fA-F0-9]{6}$/,s=/^#[a-fA-F0-9]{8}$/,c=/^#[a-fA-F0-9]{3}$/,l=/^#[a-fA-F0-9]{4}$/,d=/^rgb\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*\)$/i,u=/^rgb(?:a)?\(\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,)?\s*(\d{1,3})\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i,f=/^hsl\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*\)$/i,p=/^hsl(?:a)?\(\s*(\d{0,3}[.]?[0-9]+(?:deg)?)\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,)?\s*(\d{1,3}[.]?[0-9]?)%\s*(?:,|\/)\s*([-+]?\d*[.]?\d+[%]?)\s*\)$/i;e.exports=t.default}(F,F.exports)),F.exports}function X(){return G||(G=1,function(e,t){t.__esModule=!0,t.default=function(e){if("transparent"===e)return 0;var t=(0,o.default)(e),n=Object.keys(t).map(function(e){var n=t[e]/255;return n<=.03928?n/12.92:Math.pow((n+.055)/1.055,2.4)}),i=n[0],r=n[1],a=n[2];return parseFloat((.2126*i+.7152*r+.0722*a).toFixed(3))};var n,o=(n=$())&&n.__esModule?n:{default:n};e.exports=t.default}(R,R.exports)),R.exports}const J=O(X());var K,U={exports:{}},q={exports:{}};function Q(){return K||(K=1,function(e,t){function n(e,t,o){return function(){var i=o.concat(Array.prototype.slice.call(arguments));return i.length>=t?e.apply(this,i):n(e,t,i)}}t.__esModule=!0,t.default=function(e){return n(e,e.length,[])},e.exports=t.default}(q,q.exports)),q.exports}var ee,te={exports:{}};function ne(){return ee||(ee=1,e=te,(t=te.exports).__esModule=!0,t.default=void 0,t.default=function(e,t,n){return Math.max(e,Math.min(t,n))},e.exports=t.default),te.exports;var e,t}var oe,ie,re={exports:{}},ae={exports:{}};function se(){return oe||(oe=1,e=ae,(t=ae.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t,n=e.red/255,o=e.green/255,i=e.blue/255,r=Math.max(n,o,i),a=Math.min(n,o,i),s=(r+a)/2;if(r===a)return void 0!==e.alpha?{hue:0,saturation:0,lightness:s,alpha:e.alpha}:{hue:0,saturation:0,lightness:s};var c=r-a,l=s>.5?c/(2-r-a):c/(r+a);switch(r){case n:t=(o-i)/c+(o<i?6:0);break;case o:t=(i-n)/c+2;break;default:t=(n-o)/c+4}return t*=60,void 0!==e.alpha?{hue:t,saturation:l,lightness:s,alpha:e.alpha}:{hue:t,saturation:l,lightness:s}},e.exports=t.default),ae.exports;var e,t}function ce(){return ie||(ie=1,function(e,t){t.__esModule=!0,t.default=function(e){return(0,o.default)((0,n.default)(e))};var n=i($()),o=i(se());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(re,re.exports)),re.exports}var le,de={exports:{}},ue={exports:{}},fe={exports:{}},pe={exports:{}};function he(){return le||(le=1,function(e,t){t.__esModule=!0,t.default=void 0;t.default=function(e){return 7===e.length&&e[1]===e[2]&&e[3]===e[4]&&e[5]===e[6]?"#"+e[1]+e[3]+e[5]:e},e.exports=t.default}(pe,pe.exports)),pe.exports}var ge,me,be,ye={exports:{}};function ve(){return ge||(ge=1,e=ye,(t=ye.exports).__esModule=!0,t.default=void 0,t.default=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},e.exports=t.default),ye.exports;var e,t}function we(){return me||(me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=r(V()),o=r(he()),i=r(ve());function r(e){return e&&e.__esModule?e:{default:e}}function a(e){return(0,i.default)(Math.round(255*e))}function s(e,t,n){return(0,o.default)("#"+a(e)+a(t)+a(n))}t.default=function(e,t,o){return(0,n.default)(e,t,o,s)},e.exports=t.default}(fe,fe.exports)),fe.exports}function xe(){return be||(be=1,function(e,t){t.__esModule=!0,t.default=function(e,t,i){if("number"==typeof e&&"number"==typeof t&&"number"==typeof i)return(0,n.default)(e,t,i);if("object"==typeof e&&void 0===t&&void 0===i)return(0,n.default)(e.hue,e.saturation,e.lightness);throw new o.default(1)};var n=i(we()),o=i(Y());function i(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(ue,ue.exports)),ue.exports}var Se,Ce={exports:{}};function ke(){return Se||(Se=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,n.default)(e,t,r):"rgba("+(0,o.default)(e,t,r)+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,n.default)(e.hue,e.saturation,e.lightness):"rgba("+(0,o.default)(e.hue,e.saturation,e.lightness)+","+e.alpha+")";throw new i.default(2)};var n=r(we()),o=r(V()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ce,Ce.exports)),Ce.exports}var Ee,Ie={exports:{}};function Le(){return Ee||(Ee=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r){if("number"==typeof e&&"number"==typeof t&&"number"==typeof r)return(0,n.default)("#"+(0,o.default)(e)+(0,o.default)(t)+(0,o.default)(r));if("object"==typeof e&&void 0===t&&void 0===r)return(0,n.default)("#"+(0,o.default)(e.red)+(0,o.default)(e.green)+(0,o.default)(e.blue));throw new i.default(6)};var n=r(he()),o=r(ve()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(Ie,Ie.exports)),Ie.exports}var We,Te,Me,_e={exports:{}};function Ae(){return We||(We=1,function(e,t){t.__esModule=!0,t.default=function(e,t,r,a){if("string"==typeof e&&"number"==typeof t){var s=(0,n.default)(e);return"rgba("+s.red+","+s.green+","+s.blue+","+t+")"}if("number"==typeof e&&"number"==typeof t&&"number"==typeof r&&"number"==typeof a)return a>=1?(0,o.default)(e,t,r):"rgba("+e+","+t+","+r+","+a+")";if("object"==typeof e&&void 0===t&&void 0===r&&void 0===a)return e.alpha>=1?(0,o.default)(e.red,e.green,e.blue):"rgba("+e.red+","+e.green+","+e.blue+","+e.alpha+")";throw new i.default(7)};var n=r($()),o=r(Le()),i=r(Y());function r(e){return e&&e.__esModule?e:{default:e}}e.exports=t.default}(_e,_e.exports)),_e.exports}function Oe(){return Te||(Te=1,function(e,t){t.__esModule=!0,t.default=function(e){if("object"!=typeof e)throw new a.default(8);if(l(e))return(0,r.default)(e);if(c(e))return(0,i.default)(e);if(u(e))return(0,o.default)(e);if(d(e))return(0,n.default)(e);throw new a.default(8)};var n=s(xe()),o=s(ke()),i=s(Le()),r=s(Ae()),a=s(Y());function s(e){return e&&e.__esModule?e:{default:e}}var c=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&("number"!=typeof e.alpha||void 0===e.alpha)},l=function(e){return"number"==typeof e.red&&"number"==typeof e.green&&"number"==typeof e.blue&&"number"==typeof e.alpha},d=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&("number"!=typeof e.alpha||void 0===e.alpha)},u=function(e){return"number"==typeof e.hue&&"number"==typeof e.saturation&&"number"==typeof e.lightness&&"number"==typeof e.alpha};e.exports=t.default}(de,de.exports)),de.exports}function Pe(){return Me||(Me=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),o=a(ne()),i=a(ce()),r=a(Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness-parseFloat(e))}))});t.default=c,e.exports=t.default}(U,U.exports)),U.exports}const Re=O(Pe());var Fe,Be={exports:{}};function Ve(){return Fe||(Fe=1,function(e,t){t.__esModule=!0,t.default=void 0;var n=a(Q()),o=a(ne()),i=a(ce()),r=a(Oe());function a(e){return e&&e.__esModule?e:{default:e}}function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},s.apply(this,arguments)}var c=(0,n.default)(function(e,t){if("transparent"===t)return t;var n=(0,i.default)(t);return(0,r.default)(s({},n,{lightness:(0,o.default)(0,1,n.lightness+parseFloat(e))}))});t.default=c,e.exports=t.default}(Be,Be.exports)),Be.exports}const je=O(Ve()),Ne="bf-iframe-container",He="bf-trigger-button",Ze="bf-search-bar-iframe-container",De="bf-search-bar-iframe-backdrop";function Ge(e){var t,n;if(!document.querySelector("style[data-widget-styles]")){!function(e="#000",t="FFF"){const n=document.createElement("style");n.attributes.setNamedItem(document.createAttribute("data-widget-styles"));const o=J(e)>.5;n.textContent=`\n .bf-trigger-button{position:fixed;bottom:16px;right:16px;width:36px;height:36px;border-radius:50%;border:none;box-shadow:0 1px 6px #0000000f,0 2px 32px #00000029;transition:transform 167ms cubic-bezier(.33,0,0,1);box-sizing:content-box;display:flex;align-items:center;justify-content:center;cursor:pointer;z-index:1000;padding:12px;gap:10px;overflow:hidden}.bf-trigger-button.hidden{display:none}.trigger-button-icon{display:flex;align-items:center;justify-content:center;width:36px;height:36px;position:relative}.trigger-button-icon svg{width:100%;height:100%;position:absolute;inset:0}.trigger-button-icon>svg>path{transition:transform .3s ease,opacity .3s ease;transform:scale(.5);transform-origin:center;opacity:0}.trigger-button-icon .fish-icon{display:none}.trigger-button-icon .fish-icon.visible{display:block;max-width:36px;max-height:36px}.trigger-button-icon svg.visible{display:block}.trigger-button-icon>svg.visible>path{opacity:1;transform:scale(1)}.trigger-iframe{position:relative;width:100%;height:100%;border:none;outline:none;transform:translateZ(0);overflow:hidden}.bf-iframe-container{visibility:hidden;position:fixed;z-index:2147483000000;background-color:#fff;bottom:0;right:0;width:100vw;height:calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));border:none;overflow:hidden;opacity:0;pointer-events:none;transform:translateY(20px);transition:opacity .3s ease,transform .3s ease,width .2s ease-in-out,height .2s ease-in-out,visibility 0s .3s}.bf-iframe-container.open{visibility:visible;opacity:1;transform:translateY(0);pointer-events:auto;top:env(safe-area-inset-top);left:0;transition-delay:0s}@media (min-width: 576px){.bf-iframe-container{bottom:80px;right:24px;width:448px;height:min(750px,calc(100vh - 80px));border-radius:8px;border:1px solid var(--Dark-300, #d4d4d4);box-shadow:0 20px 25px -5px #1212171a,0 10px 10px -5px #1212170a}.bf-iframe-container.open{top:unset;left:unset}.bf-iframe-container.position-bottom-left{right:auto;left:24px}.bf-iframe-container.position-top-left{inset:80px auto auto 24px}.bf-iframe-container.position-top-right{bottom:auto;top:80px;right:24px}.bf-iframe-container.expanded{width:min(calc(448px * 1.35),calc(100vw - 16px));height:min(calc(750px * 1.35),calc(100vh - 80px))}}.bf-search-bar-iframe-container{position:relative;width:100%;min-height:200px;background-color:#fff;border:1px solid var(--dark-300, #d4d4d4);border-radius:8px;overflow:hidden;pointer-events:auto;transition:height .2s ease-in-out}.iframe-loading-indicator{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;z-index:10}.spinner{width:24px;height:24px;border:2px solid rgba(0,0,0,.1);border-radius:50%;border-top-color:#3498db;animation:spin 1s ease-in-out infinite}@keyframes spin{to{transform:rotate(360deg)}}.loading-error{width:24px;height:24px;position:relative;display:flex;align-items:center;justify-content:center}.loading-error:before,.loading-error:after{content:"";position:absolute;width:16px;height:2px;background-color:#e74c3c;border-radius:2px}.loading-error:before{transform:rotate(45deg)}.loading-error:after{transform:rotate(-45deg)}\n .${He} { background: ${e}; }\n .${He}:hover {\n background: ${o?Re(.05,e):je(.05,e)};\n }\n .trigger-button-icon { color: ${t}; }\n `,document.head.appendChild(n)}((null==(t=null==e?void 0:e.theme)?void 0:t.inputButtonBgColor)||"#007bff",(null==(n=null==e?void 0:e.theme)?void 0:n.textBaseColor)||"#ffffff")}}class ze{constructor(e,t){l(this,"isOpen",!1),this.widgetKey=e,this.widgetType=t}get isWidgetOpen(){return this.isOpen}openWidget(){this.isOpen=!0}closeWidget(){this.isOpen=!1}toggleWidget(){return this.isOpen=!this.isOpen,this.isOpen}}function Ye(e,t,n={}){const o=document.createElement(e);return o.className=t,Object.entries(n).forEach(([e,t])=>{o.setAttribute(e,t)}),o}const $e="brainfish-search-widget";class Xe{constructor(e){l(this,"button",null),l(this,"icon",null),l(this,"closeCallback",null),this.widgetType=e}setCloseCallback(e){this.closeCallback=e}get containerClass(){return this.widgetType===h.Searchbar?Ze:Ne}get container(){return document.querySelector(`.${this.containerClass}`)}get iframe(){var e;return null==(e=this.container)?void 0:e.querySelector("iframe")}get backdrop(){return document.querySelector(`.${De}`)}setElements(e,t){this.button=e||null,this.icon=t||null}openWidget(e={}){var t,n,o;const i=document.querySelector(`.${this.containerClass}`),r=null==i?void 0:i.querySelector("iframe");if(e.newConversation&&e.contextualQuestion?null==(t=null==r?void 0:r.contentWindow)||t.postMessage({type:"CONTEXTUAL_QUESTION",question:e.contextualQuestion},"*"):e.newConversation&&(null==(n=null==r?void 0:r.contentWindow)||n.postMessage({type:"NEW_CONVERSATION"},"*")),null==(o=null==r?void 0:r.contentWindow)||o.postMessage({type:"FOCUS_SEARCH_FIELD"},"*"),this.widgetType!==h.Searchbar&&(null==i||i.classList.add("open"),e.position&&(null==i||i.classList.add(`position-${e.position}`),null==i||i.setAttribute("data-current-position",e.position))),null==i||i.setAttribute("aria-hidden","false"),this.widgetType!==h.Searchbar&&document.body.clientWidth>=962&&null===this.backdrop){const e=Ye("div",De);this.closeCallback&&e.addEventListener("click",this.closeCallback),document.body.appendChild(e)}this.updateButtonForOpen()}focusNextElement(){const e=document.querySelector($e);if(e){const t=Array.from(document.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])')).filter(e=>!e.hasAttribute("disabled")),n=t.indexOf(e);if(-1!==n){const e=t[n+1];e&&e.focus()}}}closeWidget(){const e=this.container;if(!e)return;const t=e.dataset.currentPosition;if(t){const n=()=>{e.dataset.currentPosition===t&&(e.classList.remove(`position-${t}`),delete e.dataset.currentPosition)};e.addEventListener("transitionend",n,{once:!0})}e.classList.remove("open"),e.setAttribute("aria-hidden","true"),this.backdrop&&(this.backdrop.remove(),this.focusNextElement()),this.updateButtonForClose()}updateButtonForOpen(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","true"),null==e||e.classList.remove("visible"),null==t||t.classList.add("visible"),this.isMobile()&&this.hideTriggerButton()}updateButtonForClose(){if(!this.button||!this.icon)return;const e=this.icon.querySelector(".fish-icon"),t=this.icon.querySelector(".close-icon");this.button.setAttribute("aria-expanded","false"),null==e||e.classList.add("visible"),null==t||t.classList.remove("visible"),this.isMobile()&&this.showTriggerButton()}showTriggerButton(){var e;null==(e=this.button)||e.classList.remove("hidden")}hideTriggerButton(){var e;null==(e=this.button)||e.classList.add("hidden")}resizeContainer(e){if(this.widgetType!==h.Searchbar)return;if(!this.container||!this.iframe)return;const t=Math.max(e,200);this.container.style.height=`${t}px`,this.iframe.style.height=`${t}px`}isMobile(){return document.body.clientWidth<=576}setupButtonClickListener(e){this.button&&this.button.addEventListener("click",e)}static isWidgetDOMExisting(e,t){const n=document.querySelector(`.${Ze}[data-widget-key="${e}"]`);if(n){const e=document.querySelector("brainfish-search-widget");return!e||e.contains(n)}if(document.getElementById(`trigger-button-${e}`))return!0;if("Search"!==t.widgetType){if(document.querySelector(`.${Ne}`))return!0}return!1}}class Je{static register(e,t){this.instances.set(e,t)}static getInstance(e){return this.instances.get(e)}static unregister(e){this.instances.delete(e)}static getAllInstances(){return Array.from(this.instances.values())}static getOpenInstance(){return this.getAllInstances().find(e=>e.isWidgetOpen)}static getClosedPopupInstance(){return this.getAllInstances().find(e=>!e.isWidgetOpen&&e.widgetType===h.Popup)}static clear(){this.instances.clear()}}l(Je,"instances",new Map);const Ke=({formUrl:e,width:t="500px",height:n="600px"})=>{const o=document.createElement("div");o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("tabindex","-1"),o.style.cssText="\n position: fixed;\n top: 50%;\n left: 50%;\n transform: translate(-50%, -50%);\n background: white;\n padding: 20px;\n border-radius: 8px;\n box-shadow: 0 2px 10px rgba(0,0,0,0.1);\n z-index: 300000000;\n ";const i=document.createElement("button");i.innerHTML="×",i.style.cssText="\n position: absolute;\n right: -16px;\n top: -16px;\n width: 32px;\n height: 32px;\n border: 2px solid #666;\n border-radius: 50%;\n background: #FFF;\n font-size: 20px;\n cursor: pointer;\n ";const r=document.createElement("iframe");r.src=e,r.style.cssText=`width: ${t}; height: ${n}; border: none;`;const a=document.activeElement,s=e=>{if("Tab"===e.key){const t=[i,r],n=document.activeElement,o=n?t.indexOf(n):-1;e.preventDefault(),e.shiftKey?o<=0?t[t.length-1].focus():t[o-1].focus():o>=t.length-1?t[0].focus():t[o+1].focus()}else"Escape"===e.key&&c()},c=()=>{o.remove(),l.remove(),document.removeEventListener("keydown",s),null==a||a.focus()},l=document.createElement("div");l.style.cssText="\n position: fixed;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background: rgba(0,0,0,0.5);\n z-index: 299999999;\n ",i.onclick=c,l.onclick=c,document.addEventListener("keydown",s),o.appendChild(i),o.appendChild(r),document.body.appendChild(l),document.body.appendChild(o),o.focus(),r.onload=()=>{r.setAttribute("tabindex","0"),i.focus()}},Ue=e=>`brainfish_conversation_${e}`,qe={save(e,t){if(t){const o=L(Ue(e));let i=Date.now();if(o)try{const e=JSON.parse(o);e.conversationId===t&&(i=e.persistedAt)}catch(n){}const r={conversationId:t,persistedAt:i};((e,t)=>{try{I()&&window.localStorage.setItem(e,t)}catch(n){}})(Ue(e),JSON.stringify(r))}else W(Ue(e))},load(e){const t=L(Ue(e));if(!t)return null;try{const n=JSON.parse(t);return Date.now()-n.persistedAt>72e5?(W(Ue(e)),null):n.conversationId}catch(n){return W(Ue(e)),null}},clear(e){W(Ue(e))}};class Qe{static getIframeForInstance(e){var t,n;const o=e.widgetType===h.Searchbar?Ze:Ne,i=e.widgetType===h.Searchbar?`.${o}[data-widget-key="${e.widgetKey}"]`:`.${o}`;return null!=(n=null==(t=document.querySelector(i))?void 0:t.querySelector("iframe"))?n:null}static postMessageToInstance(e,t){var n,o;null==(o=null==(n=this.getIframeForInstance(e))?void 0:n.contentWindow)||o.postMessage(t,"*")}static initialize(){this.isInitialized||(this.setupDeprecatedAPI(),this.setupNewAPI(),this.isInitialized=!0)}static setupDeprecatedAPI(){var e;(null==(e=window.Brainfish)?void 0:e.HelpWidget)&&(window.Brainfish.HelpWidget.close=e=>this.closeCurrentlyOpenWidget(),window.Brainfish.HelpWidget.open=e=>this.openCurrentlyClosedPopupWidget(e))}static setupNewAPI(){var e;(null==(e=window.Brainfish)?void 0:e.Widgets)&&(window.Brainfish.Widgets.open=e=>this.openCurrentlyClosedPopupWidget(e),window.Brainfish.Widgets.close=()=>this.closeCurrentlyOpenWidget(),window.Brainfish.Widgets.createNewThread=()=>this.createNewThread(),window.Brainfish.Widgets.openModalForm=Ke,window.Brainfish.Widgets.onContextHelp=(e,t)=>this.openContextualHelp(e,t),window.Brainfish.Widgets.restoreConversation=e=>this.restoreConversation(e),window.Brainfish.Widgets.clearConversation=()=>this.clearConversation())}static closeCurrentlyOpenWidget(){const e=Je.getOpenInstance();e&&e.closeWidget()}static openCurrentlyClosedPopupWidget(e){const t=Je.getClosedPopupInstance();if(t){const n="string"==typeof e?{trigger:e}:e,o={};(!0===(null==n?void 0:n.newConversation)||(null==n?void 0:n.trigger))&&(o.newConversation=!0),(null==n?void 0:n.trigger)&&(o.trigger=n.trigger),(null==n?void 0:n.position)&&(o.position=n.position),t.openWidget(o)}}static createNewThread(){const e=Je.getOpenInstance();if(e)return void this.postMessageToInstance(e,{type:"NEW_CONVERSATION"});const t=Je.getClosedPopupInstance();t&&t.openWidget({newConversation:!0})}static openContextualHelp(e,t={}){if(!e||"string"!=typeof e||0===e.trim().length)return void console.warn("Brainfish.Widgets.onContextHelp: Invalid question provided");let n=Je.getOpenInstance();if(n||(n=Je.getClosedPopupInstance()),!n)return void console.warn("Brainfish.Widgets.onContextHelp: No popup widget available");const o=c(s({},t),{newConversation:!0,trigger:"contextual-help",contextualQuestion:e.trim()});n.openWidget(o)}static restoreConversation(e){if(!e||"string"!=typeof e)return void console.warn("Brainfish.Widgets.restoreConversation: Invalid conversationId provided");let t=Je.getOpenInstance();const n=!!t;t||(t=Je.getClosedPopupInstance()),t?(n||t.openWidget({newConversation:!1}),this.postMessageToInstance(t,{type:"RESTORE_CONVERSATION",conversationId:e})):console.warn("Brainfish.Widgets.restoreConversation: No popup widget available")}static clearConversation(){var e;const t=null!=(e=Je.getOpenInstance())?e:Je.getClosedPopupInstance();t?(qe.clear(t.widgetKey),this.postMessageToInstance(t,{type:"NEW_CONVERSATION"})):console.warn("Brainfish.Widgets.clearConversation: No popup widget available")}}l(Qe,"isInitialized",!1);class et{constructor(e,t){this.widgetType=e,this.widgetKey=t}trackOpenWidget(e,t){this.dispatchEvent("onBrainfishWidgetOpen"),"contextual-help"===e?this.trackAnalytics("Open Widget - Contextual Help",{trigger:e,question:t}):e?this.trackAnalytics("Open Widget - Custom Trigger",{trigger:e}):this.trackAnalytics("Open Widget")}trackCloseWidget(){this.dispatchEvent("onBrainfishWidgetClose"),this.trackAnalytics("Close Widget")}trackCustomEvent(e,t={}){this.trackAnalytics(e,t)}dispatchEvent(e){window.dispatchEvent(new Event(e))}trackAnalytics(e,t={}){if(window.BrainfishAnalytics){let n;switch(this.widgetType){case h.Searchbar:n="searchbar_widget";break;case h.Sidebar:default:n="search_widget"}window.BrainfishAnalytics("track",e,c(s({},t),{widgetKey:this.widgetKey}),{source:n,widgetKey:this.widgetKey})}}}class tt{constructor(e,t){l(this,"state"),l(this,"domController"),l(this,"analyticsTracker"),this.state=new ze(e,t),this.domController=new Xe(t),this.domController.setCloseCallback(()=>this.closeWidget()),this.analyticsTracker=new et(t,e)}static getInstance(e){return Je.getInstance(e)}get widgetKey(){return this.state.widgetKey}get widgetType(){return this.state.widgetType}get isWidgetOpen(){return this.state.isWidgetOpen}get containerClass(){return this.domController.containerClass}initialize({button:e,icon:t,isButtonHidden:n}){this.domController.setElements(e,t),this.domController.setupButtonClickListener(()=>this.toggleIframeVisibility()),Je.register(this.widgetKey,this),Qe.initialize()}toggleIframeVisibility(){this.state.toggleWidget()?this.openWidget():this.closeWidget()}openWidget(e={}){var t,n;if(this.state.openWidget(),this.domController.openWidget(e),void 0===(null==e?void 0:e.newConversation)){const e=qe.load(this.widgetKey);e&&(null==(n=null==(t=this.domController.iframe)?void 0:t.contentWindow)||n.postMessage({type:"RESTORE_CONVERSATION",conversationId:e},"*"))}this.analyticsTracker.trackOpenWidget(e.trigger,e.contextualQuestion)}closeWidget(){this.state.closeWidget(),this.domController.closeWidget(),this.analyticsTracker.trackCloseWidget()}showTriggerButton(){this.domController.showTriggerButton()}hideTriggerButton(){this.domController.hideTriggerButton()}resizeContainer(e){this.domController.resizeContainer(e)}trackCustomEvent(e,t={}){this.analyticsTracker.trackCustomEvent(e,t)}destroy(){Je.unregister(this.widgetKey)}static initialize(e){const t=new tt(e.widgetKey,e.widgetType);return t.initialize(e),t}}function nt({widgetUrl:e,widgetType:t,props:n}){const o=t===h.Searchbar?Ze:Ne,i=Ye("div",o,s({id:o,"aria-live":"polite","aria-hidden":t===h.Searchbar?"false":"true"},n||{})),r=Ye("div","iframe-loading-indicator"),a=Ye("div","spinner");r.setAttribute("aria-label","Loading content"),r.setAttribute("role","status"),r.appendChild(a),i.appendChild(r);const c=Ye("iframe","trigger-iframe",{src:e,sandbox:"allow-scripts allow-same-origin allow-popups allow-forms",allow:"clipboard-write",role:"dialog"});return c.style.opacity="0",c.addEventListener("load",()=>{r.style.display="none",c.style.opacity="1"}),c.addEventListener("error",e=>{console.error("Error loading iframe:",e),r.innerHTML="";const t=Ye("div","loading-error");r.appendChild(t),r.setAttribute("aria-label","Failed to load content")}),i.appendChild(c),{iframeContainer:i,iframe:c}}function ot(e,t){const n=()=>{(t=>{var n;null==(n=e.contentWindow)||n.postMessage({type:"UPDATE_BODY_CLASS",isDarkMode:t},"*")})(document.body.classList.contains("dark"))};n(),(()=>{const e=new MutationObserver(n);e.observe(document.body,{attributes:!0,attributeFilter:["class"]}),t.addEventListener("abort",()=>e.disconnect())})()}const it=new Map,rt=(e,t)=>`Error executing Client Action with key ${e}. Details: ${t instanceof Error?t.message:String(t)}`,at=(e,t)=>d(null,null,function*(){if(it.has(e)){const i=it.get(e);if("function"!=typeof i)return{success:!1,reason:`Client Action registered with key ${e} is not a function`};try{const e=yield i(t);if(n=e,"[object Object]"!==Object.prototype.toString.call(n))throw new TypeError("Invalid result, expecting object type");return{success:!0,data:e}}catch(o){return{success:!1,reason:rt(e,o)}}}var n;return{success:!1,reason:`No Client Action registered with key ${e}`}}),st=new Map,ct=new Set;function lt(e,{widgetHost:t,apiHost:n,widgetKey:o,widgetType:i,signal:r,stateManager:a}){window.addEventListener("message",r=>d(null,null,function*(){var s,c;if(r.origin!==t)return;const{type:l,widgetKey:d}=r.data;if(!d||d===o){if("TOGGLE_WIDGET_SIZE"===l&&function(){const e=document.querySelector(`.${Ne}`);e.classList.contains("expanded")?e.classList.remove("expanded"):e.classList.add("expanded")}(),"RESIZE_IFRAME"===l){const{height:e}=r.data;a.resizeContainer(e)}if("TRACK_EVENT"===l){const{messageId:e,eventName:t,data:n}=r.data;if(e){if(ct.has(e))return void console.warn(`[Brainfish] Duplicate TRACK_EVENT suppressed for "${t}" (messageId: ${e})`);ct.add(e),setTimeout(()=>ct.delete(e),5e3)}a.trackCustomEvent(t,n)}if("CLOSE_WIDGET"===l&&a.closeWidget(),"NEXT_BEST_ACTION_CLICKED"===l){const{action:e,searchQueryId:t,query:i,answer:a,conversation:s}=r.data;if(!["function","callback"].includes(e.type))return void console.error("[Brainfish] Invalid action type:",e);const c=st.get(e.id);if(c&&Date.now()-c<1e3)return void console.warn(`[Brainfish] Duplicate NEXT_BEST_ACTION_CLICKED suppressed for action "${e.id}" (fired ${Date.now()-c}ms ago)`);st.set(e.id,Date.now()),setTimeout(()=>st.delete(e.id),1e3),qe.clear(o);const l={query:i,answer:a,searchIntentId:e.searchIntentId,actionId:e.id,conversationId:(null==s?void 0:s.conversationId)||"",searchQueryId:t,metadata:e.metadata||{},conversation:s||null};try{if(window.__bfCallbacks=window.__bfCallbacks||{},window.__bfCallbacks[e.id])return void window.__bfCallbacks[e.id](i,a,l);const t=new URL(`${n}/api/searchWidgets.callback.codeblocks`);t.searchParams.set("apiKey",o),t.searchParams.set("codeblockId",e.id),l.searchIntentId&&t.searchParams.set("searchIntentId",l.searchIntentId);const r=document.createElement("script");r.src=t.toString(),document.head.appendChild(r),r.onload=()=>{window.__bfCallbacks[e.id](i,a,l),setTimeout(()=>{document.head.removeChild(r)},300)},r.onerror=()=>{console.error("[Brainfish] Failed to load callback script from server")}}catch(u){console.error("[Brainfish] Error executing callback:",u)}}if("CLIENT_EXECUTION"===l){const{actionKey:t,inputs:n,messageId:o}=r.data,i=yield at(t,n);null==(s=e.contentWindow)||s.postMessage({type:"CLIENT_EXECUTION_RESULT",messageId:o,result:i},"*")}if("CONVERSATION_CHANGED"===l){const{conversationId:e}=r.data;i!==h.Searchbar&&qe.save(o,e)}if("REQUEST_USER_IDENTITY"===l&&r.source===e.contentWindow&&i===h.Popup){const t=qe.load(o);t&&(null==(c=e.contentWindow)||c.postMessage({type:"RESTORE_CONVERSATION",conversationId:t},"*"))}}}),{signal:r})}function dt(e,t,n){let o;const i=()=>{(t=>{var o;const i={type:"UPDATE_BODY_CLASS",isMobile:t};null==(o=e.contentWindow)||o.postMessage(i,"*"),t&&(n.isWidgetOpen?n.hideTriggerButton():n.showTriggerButton())})(document.body.clientWidth<=576)},r=()=>{o&&clearTimeout(o),o=window.setTimeout(i,300)};i(),(()=>{const e=new ResizeObserver(r);e.observe(document.body),t.addEventListener("abort",()=>e.disconnect())})()}const ut=new Set;function ft(e,t,{isButtonHidden:n,triggerButtonIcon:o}){const i=document.createDocumentFragment();let r;if(n)r=tt.initialize({isButtonHidden:n,widgetType:h.Popup,widgetKey:e});else{const{button:t,icon:n}=function(e,t){const n=Ye("button",He,{id:`trigger-button-${e}`,"aria-controls":Ne,"aria-expanded":"false","data-name":He}),o=Ye("div","trigger-button-icon",{"aria-hidden":"true"});return o.innerHTML=t?`\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <img src="${t}" class="fish-icon visible" alt="Trigger button icon" aria-hidden="true" aria-label="help button icon" />\n `:'\n <svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" fill="currentColor" viewBox="0 0 256 256" class="close-icon">\n <path d="M213.66,101.66l-80,80a8,8,0,0,1-11.32,0l-80-80A8,8,0,0,1,53.66,90.34L128,164.69l74.34-74.35a8,8,0,0,1,11.32,11.32Z"></path>\n </svg>\n <svg width="24" height="14" viewBox="0 0 24 14" fill="none" xmlns="http://www.w3.org/2000/svg" class="fish-icon visible">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M1.71844 10.3882L4.60606 6.98384L1.71844 3.58375C1.4014 3.21362 1.44424 2.65841 1.81269 2.33993C1.97978 2.1979 2.65242 1.98701 3.04657 2.43461L5.78425 5.65824C6.14281 5.29523 6.51693 4.95924 6.90479 4.65114C8.88976 3.07437 11.2345 2.22803 13.6931 2.22803C16.9492 2.22803 20.0039 3.71718 22.2917 6.41142C22.5702 6.74282 22.5702 7.22916 22.2917 7.56056C20.0039 10.2591 16.9492 11.744 13.6931 11.744C11.2348 11.744 8.89035 10.8948 6.90554 9.31995C6.51741 9.01199 6.14304 8.67628 5.78425 8.31374L3.04657 11.5374C2.72953 11.9075 2.18114 11.9505 1.81269 11.632C1.44852 11.3179 1.40568 10.7584 1.71844 10.3882ZM5.93026 10.4683C8.17161 12.2599 10.8546 13.25 13.6931 13.25C17.4881 13.25 21.019 11.4034 23.4447 8.52942C24.1873 7.64571 24.1843 6.31801 23.4397 5.43663C20.8944 2.43919 17.4337 0.722025 13.6931 0.722025C10.8555 0.722025 8.17194 1.70845 5.92952 3.50276L4.17682 1.43933C3.57943 0.760929 2.79325 0.630009 2.25286 0.662947C1.98116 0.679506 1.73125 0.736852 1.51895 0.811846C1.26839 0.900352 1.03017 1.02718 0.827835 1.20058C-0.165283 2.05903 -0.283916 3.561 0.574656 4.56345L2.63075 6.98445L0.568104 9.41623C-0.272133 10.4106 -0.166523 11.9125 0.827835 12.7714C1.81372 13.6243 3.34308 13.5062 4.19036 12.5171L5.93026 10.4683Z" fill="currentColor"/>\n </svg>\n ',n.setAttribute("aria-label","Open Brainfish widget"),n.appendChild(o),{button:n,icon:o}}(e,o);i.appendChild(t),r=tt.initialize({button:t,icon:n,widgetType:h.Popup,widgetKey:e})}const{iframeContainer:a,iframe:s}=nt({widgetUrl:t,widgetType:h.Popup});return i.appendChild(a),{fragment:i,iframe:s,stateManager:r}}const pt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i,hideTriggerButton:r})=>{const{settings:a}=e,s=null!=r?r:null==a?void 0:a.hideTriggerButton,c=null==a?void 0:a.triggerButtonIcon;try{if(function(e){return ut.has(e)}(i))return;if(function(e){return!!document.getElementById(`trigger-button-${e}`)}(i))return;Ge(e);const{fragment:r,iframe:a,stateManager:l}=ft(i,t,{isButtonHidden:s||!1,triggerButtonIcon:c||""}),d=new AbortController,{signal:u}=d;a.onload=()=>{setTimeout(()=>{var e;ot(a,u),lt(a,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Popup,signal:u,stateManager:l}),dt(a,u,l);const r=qe.load(i),s=new URL(t).searchParams.has("conversation");r&&!s&&(null==(e=a.contentWindow)||e.postMessage({type:"RESTORE_CONVERSATION",conversationId:r},"*"))},0)},document.body?document.body.appendChild(r):(console.warn("[Brainfish] document.body not ready. Widget initialization deferred."),document.addEventListener("DOMContentLoaded",()=>{document.body.appendChild(r)},{once:!0})),ut.add(i);const f=()=>{d.abort(),window.removeEventListener("beforeunload",f)};return void window.addEventListener("beforeunload",f)}catch(l){!function(e,t,n){v(e,t,t.message,n)}(n,l,i)}},ht=new Map;const gt=({config:e,widgetUrl:t,apiHost:n,widgetHost:o,widgetKey:i})=>{var r,a,s,c;const{settings:l}=e;let d=tt.getInstance(i);null==(r=ht.get(i))||r.abort();const u=new AbortController;ht.set(i,u),Ge(e);try{const e=document.querySelector(`.${Ze}[data-widget-key="${i}"]`),r=document.querySelector($e);e&&r&&!r.contains(e)&&(r.appendChild(e),null==(a=r.parentElement)||a.style.setProperty("width","100%")),d||(d=tt.initialize({isButtonHidden:!0,widgetType:h.Searchbar,widgetKey:i}));const{signal:l}=u,f=e=>{ot(e,l),lt(e,{widgetHost:o,apiHost:n,widgetKey:i,widgetType:h.Searchbar,signal:l,stateManager:d}),dt(e,l,d)};if(e){const t=e.querySelector("iframe");t&&("complete"===(null==(c=t.contentDocument)?void 0:c.readyState)?setTimeout(()=>{f(t)},0):t.onload=()=>{setTimeout(()=>{f(t)},0)})}else{const e=document.createDocumentFragment(),{iframeContainer:n,iframe:o}=nt({widgetUrl:t,widgetType:h.Searchbar,props:{"data-widget-type":"searchbar","data-widget-key":i}});o.onload=()=>{setTimeout(()=>{f(o)},0)},e.appendChild(n),r?(r.appendChild(e),null==(s=r.parentElement)||s.style.setProperty("width","100%")):document.body.appendChild(e)}const p=()=>{u.abort(),ht.delete(i),window.removeEventListener("beforeunload",p)};return void window.addEventListener("beforeunload",p)}catch(f){!function(e,t,n){v(e,t,t.message,n)}(n,f,i)}},mt=(e,t,n)=>{var a;const c=S(e.overrides),l=(null==(d=e.overrides)?void 0:d.widgetHost)||"https://agent.brainfi.sh";var d;const u=null==(a=e.overrides)?void 0:a.hideTriggerButton,{theme:f,settings:p}=t,h=e.overrides||{},{theme:g,redirectRules:m,regions:b,customCss:y}=h,v=((e,t)=>{var n={};for(var a in e)i.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&o)for(var a of o(e))t.indexOf(a)<0&&r.call(e,a)&&(n[a]=e[a]);return n})(h,["theme","redirectRules","regions","customCss"]),w=s(s({},f),g),x=s(s({},p),v),C=_(JSON.stringify(m)),k={theme:_(JSON.stringify(w)),settings:_(JSON.stringify(x)),redirectRules:C};b&&(k.regions=_(JSON.stringify(b))),y&&(k.customCss=_(y)),n&&(k.fingerprint=_(n));const E=`${l}/?widgetKey=${e.widgetKey}#${new URLSearchParams(k).toString()}`;"Search"===t.widgetType?gt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey}):pt({config:t,widgetUrl:E,apiHost:c,widgetHost:l,widgetKey:e.widgetKey,hideTriggerButton:u})};var bt=(e=>(e.FRESHCHAT="freshchat",e.INTERCOM="intercom",e.ZENDESK="zendesk",e.HELPSCOUT="helpscout",e))(bt||{});const yt=e=>d(null,null,function*(){if(e.widgetType===h.Popup){const e=window.fcWidget?bt.FRESHCHAT:null;e&&e===bt.FRESHCHAT&&(yield d(null,null,function*(){window.fcWidget||(yield new Promise(e=>setTimeout(e,100))),window.fcWidget.hide(),window.fcWidget.on("widget:closed",()=>{window.fcWidget.hide()})}))}}),vt="brainfish-nudges",wt=(e,t)=>d(null,null,function*(){try{yield d(null,null,function*(){if(!document.getElementById(vt))return new Promise(e=>{const t=document.createElement("script");t.id=vt,t.src="https://cdn.jsdelivr.net/npm/@brainfish-ai/nudge-widget@latest/dist/index.es.js",t.type="module",t.async=!0,t.crossOrigin="anonymous",t.onerror=()=>{Math.random()<.05&&void 0!==console.warn&&console.warn("[Brainfish] Nudge widget failed to load. This may be due to CSP or network restrictions."),e(void 0)},t.onload=()=>{setTimeout(()=>{e(!0)},200)},document.head.appendChild(t)})})}catch(n){v(e,n,"Failed to initialize Nudge widget",t)}});let xt,St,Ct,kt=!1;const Et=e=>{null==xt||xt.abort(),xt=new AbortController;const{signal:t}=xt;let n=window.location.pathname;const o=()=>{if(t.aborted)return;const o=window.location.pathname;o!==n&&(n=o,e())};window.addEventListener("popstate",o,{signal:t}),kt||(St=history.pushState,Ct=history.replaceState,history.pushState=function(...e){St.apply(this,e),setTimeout(o,0)},history.replaceState=function(...e){Ct.apply(this,e),setTimeout(o,0)},kt=!0),t.addEventListener("abort",()=>{kt&&(history.pushState=St,history.replaceState=Ct,kt=!1)})};var It="5.2.0";function Lt(e,t){return new Promise(n=>setTimeout(n,e,t))}function Wt(){return new Promise(e=>{const t=new MessageChannel;t.port1.onmessage=()=>e(),t.port2.postMessage(null)})}function Tt(e){return!!e&&"function"==typeof e.then}function Mt(e,t){try{const n=e();Tt(n)?n.then(e=>t(!0,e),e=>t(!1,e)):t(!0,n)}catch(n){t(!1,n)}}function _t(e,t,n=16){return d(this,null,function*(){const o=Array(e.length);let i=Date.now();for(let r=0;r<e.length;++r){o[r]=t(e[r],r);const a=Date.now();a>=i+n&&(i=a,yield Wt())}return o})}function At(e){return e.then(void 0,()=>{}),e}function Ot(e){return parseInt(e)}function Pt(e){return parseFloat(e)}function Rt(e,t){return"number"==typeof e&&isNaN(e)?t:e}function Ft(e){return e.reduce((e,t)=>e+(t?1:0),0)}function Bt(e,t=1){if(Math.abs(t)>=1)return Math.round(e/t)*t;{const n=1/t;return Math.round(e*n)/n}}function Vt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16;let l=0,d=0,u=0,f=0;f+=r+(65535&t[1]),u+=f>>>16,f&=65535,u+=i+c,d+=u>>>16,u&=65535,d+=o+s,l+=d>>>16,d&=65535,l+=n+a,l&=65535,e[0]=l<<16|d,e[1]=u<<16|f}function jt(e,t){const n=e[0]>>>16,o=65535&e[0],i=e[1]>>>16,r=65535&e[1],a=t[0]>>>16,s=65535&t[0],c=t[1]>>>16,l=65535&t[1];let d=0,u=0,f=0,p=0;p+=r*l,f+=p>>>16,p&=65535,f+=i*l,u+=f>>>16,f&=65535,f+=r*c,u+=f>>>16,f&=65535,u+=o*l,d+=u>>>16,u&=65535,u+=i*c,d+=u>>>16,u&=65535,u+=r*s,d+=u>>>16,u&=65535,d+=n*l+o*c+i*s+r*a,d&=65535,e[0]=d<<16|u,e[1]=f<<16|p}function Nt(e,t){const n=e[0];32===(t%=64)?(e[0]=e[1],e[1]=n):t<32?(e[0]=n<<t|e[1]>>>32-t,e[1]=e[1]<<t|n>>>32-t):(t-=32,e[0]=e[1]<<t|n>>>32-t,e[1]=n<<t|e[1]>>>32-t)}function Ht(e,t){0!==(t%=64)&&(t<32?(e[0]=e[1]>>>32-t,e[1]=e[1]<<t):(e[0]=e[1]<<t-32,e[1]=0))}function Zt(e,t){e[0]^=t[0],e[1]^=t[1]}const Dt=[4283543511,3981806797],Gt=[3301882366,444984403];function zt(e){const t=[0,e[0]>>>1];Zt(e,t),jt(e,Dt),t[1]=e[0]>>>1,Zt(e,t),jt(e,Gt),t[1]=e[0]>>>1,Zt(e,t)}const Yt=[2277735313,289559509],$t=[1291169091,658871167],Xt=[0,5],Jt=[0,1390208809],Kt=[0,944331445];function Ut(e,t){const n=function(e){const t=new Uint8Array(e.length);for(let n=0;n<e.length;n++){const o=e.charCodeAt(n);if(o>127)return(new TextEncoder).encode(e);t[n]=o}return t}(e);t=t||0;const o=[0,n.length],i=o[1]%16,r=o[1]-i,a=[0,t],s=[0,t],c=[0,0],l=[0,0];let d;for(d=0;d<r;d+=16)c[0]=n[d+4]|n[d+5]<<8|n[d+6]<<16|n[d+7]<<24,c[1]=n[d]|n[d+1]<<8|n[d+2]<<16|n[d+3]<<24,l[0]=n[d+12]|n[d+13]<<8|n[d+14]<<16|n[d+15]<<24,l[1]=n[d+8]|n[d+9]<<8|n[d+10]<<16|n[d+11]<<24,jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c),Nt(a,27),Vt(a,s),jt(a,Xt),Vt(a,Jt),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l),Nt(s,31),Vt(s,a),jt(s,Xt),Vt(s,Kt);c[0]=0,c[1]=0,l[0]=0,l[1]=0;const u=[0,0];switch(i){case 15:u[1]=n[d+14],Ht(u,48),Zt(l,u);case 14:u[1]=n[d+13],Ht(u,40),Zt(l,u);case 13:u[1]=n[d+12],Ht(u,32),Zt(l,u);case 12:u[1]=n[d+11],Ht(u,24),Zt(l,u);case 11:u[1]=n[d+10],Ht(u,16),Zt(l,u);case 10:u[1]=n[d+9],Ht(u,8),Zt(l,u);case 9:u[1]=n[d+8],Zt(l,u),jt(l,$t),Nt(l,33),jt(l,Yt),Zt(s,l);case 8:u[1]=n[d+7],Ht(u,56),Zt(c,u);case 7:u[1]=n[d+6],Ht(u,48),Zt(c,u);case 6:u[1]=n[d+5],Ht(u,40),Zt(c,u);case 5:u[1]=n[d+4],Ht(u,32),Zt(c,u);case 4:u[1]=n[d+3],Ht(u,24),Zt(c,u);case 3:u[1]=n[d+2],Ht(u,16),Zt(c,u);case 2:u[1]=n[d+1],Ht(u,8),Zt(c,u);case 1:u[1]=n[d],Zt(c,u),jt(c,Yt),Nt(c,31),jt(c,$t),Zt(a,c)}return Zt(a,o),Zt(s,o),Vt(a,s),Vt(s,a),zt(a),zt(s),Vt(a,s),Vt(s,a),("00000000"+(a[0]>>>0).toString(16)).slice(-8)+("00000000"+(a[1]>>>0).toString(16)).slice(-8)+("00000000"+(s[0]>>>0).toString(16)).slice(-8)+("00000000"+(s[1]>>>0).toString(16)).slice(-8)}function qt(e,t,n,o){const i=Object.keys(e).filter(e=>!function(e,t){for(let n=0,o=e.length;n<o;++n)if(e[n]===t)return!0;return!1}(n,e)),r=At(_t(i,n=>function(e,t){const n=At(new Promise(n=>{const o=Date.now();Mt(e.bind(null,t),(...e)=>{const t=Date.now()-o;if(!e[0])return n(()=>({error:e[1],duration:t}));const i=e[1];if(function(e){return"function"!=typeof e}(i))return n(()=>({value:i,duration:t}));n(()=>new Promise(e=>{const n=Date.now();Mt(i,(...o)=>{const i=t+Date.now()-n;if(!o[0])return e({error:o[1],duration:i});e({value:o[1],duration:i})})}))})}));return function(){return n.then(e=>e())}}(e[n],t),o));return function(){return d(this,null,function*(){const e=yield r,t=yield _t(e,e=>At(e()),o),n=yield Promise.all(t),a={};for(let o=0;o<i.length;++o)a[i[o]]=n[o];return a})}}function Qt(){const e=window,t=navigator;return Ft(["MSCSSMatrix"in e,"msSetImmediate"in e,"msIndexedDB"in e,"msMaxTouchPoints"in t,"msPointerEnabled"in t])>=4}function en(){const e=window,t=navigator;return Ft(["webkitPersistentStorage"in t,"webkitTemporaryStorage"in t,0===(t.vendor||"").indexOf("Google"),"webkitResolveLocalFileSystemURL"in e,"BatteryManager"in e,"webkitMediaStream"in e,"webkitSpeechGrammar"in e])>=5}function tn(){const e=window;return Ft(["ApplePayError"in e,"CSSPrimitiveValue"in e,"Counter"in e,0===navigator.vendor.indexOf("Apple"),"RGBColor"in e,"WebKitMediaKeys"in e])>=4}function nn(){const e=window,{HTMLElement:t,Document:n}=e;return Ft(["safari"in e,!("ongestureend"in e),!("TouchEvent"in e),!("orientation"in e),t&&!("autocapitalize"in t.prototype),n&&"pointerLockElement"in n.prototype])>=4}function on(){const e=window;return t=e.print,/^function\s.*?\{\s*\[native code]\s*}$/.test(String(t))&&"[object WebPageNamespace]"===String(e.browser);var t}function rn(){var e,t;const n=window;return Ft(["buildID"in navigator,"MozAppearance"in(null!==(t=null===(e=document.documentElement)||void 0===e?void 0:e.style)&&void 0!==t?t:{}),"onmozfullscreenchange"in n,"mozInnerScreenX"in n,"CSSMozDocumentRule"in n,"CanvasCaptureMediaStream"in n])>=4}function an(){const{CSS:e}=window;return Ft([e.supports("selector(::details-content)"),e.supports("selector(::before::marker)"),e.supports("selector(::after::marker)"),!("locale"in CompositionEvent.prototype)])>=3}function sn(){const e=window,t=navigator,{CSS:n,HTMLButtonElement:o}=e;return Ft([!("getStorageUpdates"in t),o&&"popover"in o.prototype,"CSSCounterStyleRule"in e,n.supports("font-size-adjust: ex-height 0.5"),n.supports("text-transform: full-width")])>=4}function cn(){const e=en(),t=rn(),n=window,o=navigator,i="connection";return e?Ft([!("SharedWorker"in n),o[i]&&"ontypechange"in o[i],!("sinkId"in new Audio)])>=2:!!t&&Ft(["onorientationchange"in n,"orientation"in n,/android/i.test(o.appVersion)])>=2}function ln(e){const t=new Error(e);return t.name=e,t}function dn(e,t,n=50){return d(this,null,function*(){var o,i,r;const a=document;for(;!a.body;)yield Lt(n);const s=a.createElement("iframe");try{for((yield new Promise((e,n)=>{let o=!1;const i=()=>{o=!0,e()};s.onload=i,s.onerror=e=>{o=!0,n(e)};const{style:r}=s;r.setProperty("display","block","important"),r.position="absolute",r.top="0",r.left="0",r.visibility="hidden",t&&"srcdoc"in s?s.srcdoc=t:s.src="about:blank",a.body.appendChild(s);const c=()=>{var e,t;o||("complete"===(null===(t=null===(e=s.contentWindow)||void 0===e?void 0:e.document)||void 0===t?void 0:t.readyState)?i():setTimeout(c,10))};c()}));!(null===(i=null===(o=s.contentWindow)||void 0===o?void 0:o.document)||void 0===i?void 0:i.body);)yield Lt(n);return yield e(s,s.contentWindow)}finally{null===(r=s.parentNode)||void 0===r||r.removeChild(s)}})}function un(e){const[t,n]=function(e){var t,n;const o=`Unexpected syntax '${e}'`,i=/^\s*([a-z-]*)(.*)$/i.exec(e),r=i[1]||void 0,a={},s=/([.:#][\w-]+|\[.+?\])/gi,c=(e,t)=>{a[e]=a[e]||[],a[e].push(t)};for(;;){const e=s.exec(i[2]);if(!e)break;const r=e[0];switch(r[0]){case".":c("class",r.slice(1));break;case"#":c("id",r.slice(1));break;case"[":{const e=/^\[([\w-]+)([~|^$*]?=("(.*?)"|([\w-]+)))?(\s+[is])?\]$/.exec(r);if(!e)throw new Error(o);c(e[1],null!==(n=null!==(t=e[4])&&void 0!==t?t:e[5])&&void 0!==n?n:"");break}default:throw new Error(o)}}return[r,a]}(e),o=document.createElement(null!=t?t:"div");for(const i of Object.keys(n)){const e=n[i].join(" ");"style"===i?fn(o.style,e):o.setAttribute(i,e)}return o}function fn(e,t){for(const n of t.split(";")){const t=/^\s*([\w-]+)\s*:\s*(.+?)(\s*!([\w-]+))?\s*$/.exec(n);if(t){const[,n,o,,i]=t;e.setProperty(n,o,i||"")}}}const pn=["monospace","sans-serif","serif"],hn=["sans-serif-thin","ARNO PRO","Agency FB","Arabic Typesetting","Arial Unicode MS","AvantGarde Bk BT","BankGothic Md BT","Batang","Bitstream Vera Sans Mono","Calibri","Century","Century Gothic","Clarendon","EUROSTILE","Franklin Gothic","Futura Bk BT","Futura Md BT","GOTHAM","Gill Sans","HELV","Haettenschweiler","Helvetica Neue","Humanst521 BT","Leelawadee","Letter Gothic","Levenim MT","Lucida Bright","Lucida Sans","Menlo","MS Mincho","MS Outlook","MS Reference Specialty","MS UI Gothic","MT Extra","MYRIAD PRO","Marlett","Meiryo UI","Microsoft Uighur","Minion Pro","Monotype Corsiva","PMingLiU","Pristina","SCRIPTINA","Segoe UI Light","Serifa","SimHei","Small Fonts","Staccato222 BT","TRAJAN PRO","Univers CE 55 Medium","Vrinda","ZWAdobeF"];function gn(e){return e.toDataURL()}let mn,bn;function yn(){return function(){if(void 0!==bn)return;const e=()=>{const t=vn();wn(t)?bn=setTimeout(e,2500):(mn=t,bn=void 0)};e()}(),()=>d(null,null,function*(){let e=vn();if(wn(e)){if(mn)return[...mn];(function(){const e=document;return e.fullscreenElement||e.msFullscreenElement||e.mozFullScreenElement||e.webkitFullscreenElement||null})()&&(yield function(){const e=document;return(e.exitFullscreen||e.msExitFullscreen||e.mozCancelFullScreen||e.webkitExitFullscreen).call(e)}(),e=vn())}return wn(e)||(mn=e),e})}function vn(){const e=screen;return[Rt(Pt(e.availTop),null),Rt(Pt(e.width)-Pt(e.availWidth)-Rt(Pt(e.availLeft),0),null),Rt(Pt(e.height)-Pt(e.availHeight)-Rt(Pt(e.availTop),0),null),Rt(Pt(e.availLeft),null)]}function wn(e){for(let t=0;t<4;++t)if(e[t])return!1;return!0}function xn(e){e.style.setProperty("visibility","hidden","important"),e.style.setProperty("display","block","important")}function Sn(e){return matchMedia(`(inverted-colors: ${e})`).matches}function Cn(e){return matchMedia(`(forced-colors: ${e})`).matches}function kn(e){return matchMedia(`(prefers-contrast: ${e})`).matches}function En(e){return matchMedia(`(prefers-reduced-motion: ${e})`).matches}function In(e){return matchMedia(`(prefers-reduced-transparency: ${e})`).matches}function Ln(e){return matchMedia(`(dynamic-range: ${e})`).matches}const Wn=Math,Tn=()=>0;const Mn="mmMwWLliI0fiflO&1",_n={default:[],apple:[{font:"-apple-system-body"}],serif:[{fontFamily:"serif"}],sans:[{fontFamily:"sans-serif"}],mono:[{fontFamily:"monospace"}],min:[{fontSize:"1px"}],system:[{fontFamily:"system-ui"}]};function An(e){const t=cn()?0:3,n=Math.pow(10,t);return Math.floor(e*n)/n}const On=function(){let e=window;for(;;){const n=e.parent;if(!n||n===e)return!1;try{if(n.location.origin!==e.location.origin)return!0}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return!0;throw t}e=n}};const Pn=new Set([10752,2849,2884,2885,2886,2928,2929,2930,2931,2932,2960,2961,2962,2963,2964,2965,2966,2967,2968,2978,3024,3042,3088,3089,3106,3107,32773,32777,32777,32823,32824,32936,32937,32938,32939,32968,32969,32970,32971,3317,33170,3333,3379,3386,33901,33902,34016,34024,34076,3408,3410,3411,3412,3413,3414,3415,34467,34816,34817,34818,34819,34877,34921,34930,35660,35661,35724,35738,35739,36003,36004,36005,36347,36348,36349,37440,37441,37443,7936,7937,7938]),Rn=new Set([34047,35723,36063,34852,34853,34854,34229,36392,36795,38449]),Fn=["FRAGMENT_SHADER","VERTEX_SHADER"],Bn=["LOW_FLOAT","MEDIUM_FLOAT","HIGH_FLOAT","LOW_INT","MEDIUM_INT","HIGH_INT"],Vn="WEBGL_debug_renderer_info";function jn(e){if(e.webgl)return e.webgl.context;const t=document.createElement("canvas");let n;t.addEventListener("webglCreateContextError",()=>n=void 0);for(const i of["webgl","experimental-webgl"]){try{n=t.getContext(i)}catch(o){}if(n)break}return e.webgl={context:n},n}function Nn(e,t,n){const o=e.getShaderPrecisionFormat(e[t],e[n]);return o?[o.rangeMin,o.rangeMax,o.precision]:[]}function Hn(e){return Object.keys(e.__proto__).filter(Zn)}function Zn(e){return"string"==typeof e&&!e.match(/[^A-Z0-9_x]/)}function Dn(){return rn()}function Gn(){return en()||tn()}function zn(e){return"function"==typeof e.getParameter}const Yn={userAgentData:function(){return d(this,null,function*(){const e=navigator.userAgentData;if(!e)return;const t=e.brands.filter(({brand:e})=>!function(e){return/not/i.test(e)}(e)).map(({brand:e})=>e),n={brands:t.length>1?t.filter(e=>"Chromium"!==e):t,mobile:e.mobile,platform:e.platform};if(e.getHighEntropyValues)try{const t=yield e.getHighEntropyValues(["architecture","bitness","model","platformVersion"]);n.architecture=t.architecture,n.bitness=t.bitness,n.model=t.model,n.platformVersion=t.platformVersion}catch(o){if(!(o instanceof DOMException&&"NotAllowedError"===o.name))throw o;n.highEntropyStatus="not_allowed"}return n})},fonts:function(){return dn((e,t)=>d(null,[e,t],function*(e,{document:t}){const n=t.body;n.style.fontSize="48px";const o=t.createElement("div");o.style.setProperty("visibility","hidden","important");const i={},r={},a=e=>{const n=t.createElement("span"),{style:i}=n;return i.position="absolute",i.top="0",i.left="0",i.fontFamily=e,n.textContent="mmMwWLliI0O&1",o.appendChild(n),n},s=(e,t)=>a(`'${e}',${t}`),c=pn.map(a),l=(()=>{const e={};for(const t of hn)e[t]=pn.map(e=>s(t,e));return e})();n.appendChild(o);for(let d=0;d<pn.length;d++)i[pn[d]]=c[d].offsetWidth,r[pn[d]]=c[d].offsetHeight;return hn.filter(e=>{return t=l[e],pn.some((e,n)=>t[n].offsetWidth!==i[e]||t[n].offsetHeight!==r[e]);var t})}))},domBlockers:function(){return d(this,arguments,function*({debug:e}={}){if(!tn()&&!cn())return;const t=function(){const e=atob;return{abpIndo:["#Iklan-Melayang","#Kolom-Iklan-728","#SidebarIklan-wrapper",'[title="ALIENBOLA" i]',e("I0JveC1CYW5uZXItYWRz")],abpvn:[".quangcao","#mobileCatfish",e("LmNsb3NlLWFkcw=="),'[id^="bn_bottom_fixed_"]',"#pmadv"],adBlockFinland:[".mainostila",e("LnNwb25zb3JpdA=="),".ylamainos",e("YVtocmVmKj0iL2NsaWNrdGhyZ2guYXNwPyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hcHAucmVhZHBlYWsuY29tL2FkcyJd")],adBlockPersian:["#navbar_notice_50",".kadr",'TABLE[width="140px"]',"#divAgahi",e("YVtocmVmXj0iaHR0cDovL2cxLnYuZndtcm0ubmV0L2FkLyJd")],adBlockWarningRemoval:["#adblock-honeypot",".adblocker-root",".wp_adblock_detect",e("LmhlYWRlci1ibG9ja2VkLWFk"),e("I2FkX2Jsb2NrZXI=")],adGuardAnnoyances:[".hs-sosyal","#cookieconsentdiv",'div[class^="app_gdpr"]',".as-oil",'[data-cypress="soft-push-notification-modal"]'],adGuardBase:[".BetterJsPopOverlay",e("I2FkXzMwMFgyNTA="),e("I2Jhbm5lcmZsb2F0MjI="),e("I2NhbXBhaWduLWJhbm5lcg=="),e("I0FkLUNvbnRlbnQ=")],adGuardChinese:[e("LlppX2FkX2FfSA=="),e("YVtocmVmKj0iLmh0aGJldDM0LmNvbSJd"),"#widget-quan",e("YVtocmVmKj0iLzg0OTkyMDIwLnh5eiJd"),e("YVtocmVmKj0iLjE5NTZobC5jb20vIl0=")],adGuardFrench:["#pavePub",e("LmFkLWRlc2t0b3AtcmVjdGFuZ2xl"),".mobile_adhesion",".widgetadv",e("LmFkc19iYW4=")],adGuardGerman:['aside[data-portal-id="leaderboard"]'],adGuardJapanese:["#kauli_yad_1",e("YVtocmVmXj0iaHR0cDovL2FkMi50cmFmZmljZ2F0ZS5uZXQvIl0="),e("Ll9wb3BJbl9pbmZpbml0ZV9hZA=="),e("LmFkZ29vZ2xl"),e("Ll9faXNib29zdFJldHVybkFk")],adGuardMobile:[e("YW1wLWF1dG8tYWRz"),e("LmFtcF9hZA=="),'amp-embed[type="24smi"]',"#mgid_iframe1",e("I2FkX2ludmlld19hcmVh")],adGuardRussian:[e("YVtocmVmXj0iaHR0cHM6Ly9hZC5sZXRtZWFkcy5jb20vIl0="),e("LnJlY2xhbWE="),'div[id^="smi2adblock"]',e("ZGl2W2lkXj0iQWRGb3hfYmFubmVyXyJd"),"#psyduckpockeball"],adGuardSocial:[e("YVtocmVmXj0iLy93d3cuc3R1bWJsZXVwb24uY29tL3N1Ym1pdD91cmw9Il0="),e("YVtocmVmXj0iLy90ZWxlZ3JhbS5tZS9zaGFyZS91cmw/Il0="),".etsy-tweet","#inlineShare",".popup-social"],adGuardSpanishPortuguese:["#barraPublicidade","#Publicidade","#publiEspecial","#queTooltip",".cnt-publi"],adGuardTrackingProtection:["#qoo-counter",e("YVtocmVmXj0iaHR0cDovL2NsaWNrLmhvdGxvZy5ydS8iXQ=="),e("YVtocmVmXj0iaHR0cDovL2hpdGNvdW50ZXIucnUvdG9wL3N0YXQucGhwIl0="),e("YVtocmVmXj0iaHR0cDovL3RvcC5tYWlsLnJ1L2p1bXAiXQ=="),"#top100counter"],adGuardTurkish:["#backkapat",e("I3Jla2xhbWk="),e("YVtocmVmXj0iaHR0cDovL2Fkc2Vydi5vbnRlay5jb20udHIvIl0="),e("YVtocmVmXj0iaHR0cDovL2l6bGVuemkuY29tL2NhbXBhaWduLyJd"),e("YVtocmVmXj0iaHR0cDovL3d3dy5pbnN0YWxsYWRzLm5ldC8iXQ==")],bulgarian:[e("dGQjZnJlZW5ldF90YWJsZV9hZHM="),"#ea_intext_div",".lapni-pop-over","#xenium_hot_offers"],easyList:[".yb-floorad",e("LndpZGdldF9wb19hZHNfd2lkZ2V0"),e("LnRyYWZmaWNqdW5reS1hZA=="),".textad_headline",e("LnNwb25zb3JlZC10ZXh0LWxpbmtz")],easyListChina:[e("LmFwcGd1aWRlLXdyYXBbb25jbGljayo9ImJjZWJvcy5jb20iXQ=="),e("LmZyb250cGFnZUFkdk0="),"#taotaole","#aafoot.top_box",".cfa_popup"],easyListCookie:[".ezmob-footer",".cc-CookieWarning","[data-cookie-number]",e("LmF3LWNvb2tpZS1iYW5uZXI="),".sygnal24-gdpr-modal-wrap"],easyListCzechSlovak:["#onlajny-stickers",e("I3Jla2xhbW5pLWJveA=="),e("LnJla2xhbWEtbWVnYWJvYXJk"),".sklik",e("W2lkXj0ic2tsaWtSZWtsYW1hIl0=")],easyListDutch:[e("I2FkdmVydGVudGll"),e("I3ZpcEFkbWFya3RCYW5uZXJCbG9jaw=="),".adstekst",e("YVtocmVmXj0iaHR0cHM6Ly94bHR1YmUubmwvY2xpY2svIl0="),"#semilo-lrectangle"],easyListGermany:["#SSpotIMPopSlider",e("LnNwb25zb3JsaW5rZ3J1ZW4="),e("I3dlcmJ1bmdza3k="),e("I3Jla2xhbWUtcmVjaHRzLW1pdHRl"),e("YVtocmVmXj0iaHR0cHM6Ly9iZDc0Mi5jb20vIl0=")],easyListItaly:[e("LmJveF9hZHZfYW5udW5jaQ=="),".sb-box-pubbliredazionale",e("YVtocmVmXj0iaHR0cDovL2FmZmlsaWF6aW9uaWFkcy5zbmFpLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZHNlcnZlci5odG1sLml0LyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9hZmZpbGlhemlvbmlhZHMuc25haS5pdC8iXQ==")],easyListLithuania:[e("LnJla2xhbW9zX3RhcnBhcw=="),e("LnJla2xhbW9zX251b3JvZG9z"),e("aW1nW2FsdD0iUmVrbGFtaW5pcyBza3lkZWxpcyJd"),e("aW1nW2FsdD0iRGVkaWt1b3RpLmx0IHNlcnZlcmlhaSJd"),e("aW1nW2FsdD0iSG9zdGluZ2FzIFNlcnZlcmlhaS5sdCJd")],estonian:[e("QVtocmVmKj0iaHR0cDovL3BheTRyZXN1bHRzMjQuZXUiXQ==")],fanboyAnnoyances:["#ac-lre-player",".navigate-to-top","#subscribe_popup",".newsletter_holder","#back-top"],fanboyAntiFacebook:[".util-bar-module-firefly-visible"],fanboyEnhancedTrackers:[".open.pushModal","#issuem-leaky-paywall-articles-zero-remaining-nag","#sovrn_container",'div[class$="-hide"][zoompage-fontsize][style="display: block;"]',".BlockNag__Card"],fanboySocial:["#FollowUs","#meteored_share","#social_follow",".article-sharer",".community__social-desc"],frellwitSwedish:[e("YVtocmVmKj0iY2FzaW5vcHJvLnNlIl1bdGFyZ2V0PSJfYmxhbmsiXQ=="),e("YVtocmVmKj0iZG9rdG9yLXNlLm9uZWxpbmsubWUiXQ=="),"article.category-samarbete",e("ZGl2LmhvbGlkQWRz"),"ul.adsmodern"],greekAdBlock:[e("QVtocmVmKj0iYWRtYW4ub3RlbmV0LmdyL2NsaWNrPyJd"),e("QVtocmVmKj0iaHR0cDovL2F4aWFiYW5uZXJzLmV4b2R1cy5nci8iXQ=="),e("QVtocmVmKj0iaHR0cDovL2ludGVyYWN0aXZlLmZvcnRobmV0LmdyL2NsaWNrPyJd"),"DIV.agores300","TABLE.advright"],hungarian:["#cemp_doboz",".optimonk-iframe-container",e("LmFkX19tYWlu"),e("W2NsYXNzKj0iR29vZ2xlQWRzIl0="),"#hirdetesek_box"],iDontCareAboutCookies:['.alert-info[data-block-track*="CookieNotice"]',".ModuleTemplateCookieIndicator",".o--cookies--container","#cookies-policy-sticky","#stickyCookieBar"],icelandicAbp:[e("QVtocmVmXj0iL2ZyYW1ld29yay9yZXNvdXJjZXMvZm9ybXMvYWRzLmFzcHgiXQ==")],latvian:[e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiAxMjBweDsgaGVpZ2h0OiA0MHB4OyBvdmVyZmxvdzogaGlkZGVuOyBwb3NpdGlvbjogcmVsYXRpdmU7Il0="),e("YVtocmVmPSJodHRwOi8vd3d3LnNhbGlkemluaS5sdi8iXVtzdHlsZT0iZGlzcGxheTogYmxvY2s7IHdpZHRoOiA4OHB4OyBoZWlnaHQ6IDMxcHg7IG92ZXJmbG93OiBoaWRkZW47IHBvc2l0aW9uOiByZWxhdGl2ZTsiXQ==")],listKr:[e("YVtocmVmKj0iLy9hZC5wbGFuYnBsdXMuY28ua3IvIl0="),e("I2xpdmVyZUFkV3JhcHBlcg=="),e("YVtocmVmKj0iLy9hZHYuaW1hZHJlcC5jby5rci8iXQ=="),e("aW5zLmZhc3R2aWV3LWFk"),".revenue_unit_item.dable"],listeAr:[e("LmdlbWluaUxCMUFk"),".right-and-left-sponsers",e("YVtocmVmKj0iLmFmbGFtLmluZm8iXQ=="),e("YVtocmVmKj0iYm9vcmFxLm9yZyJd"),e("YVtocmVmKj0iZHViaXp6bGUuY29tL2FyLz91dG1fc291cmNlPSJd")],listeFr:[e("YVtocmVmXj0iaHR0cDovL3Byb21vLnZhZG9yLmNvbS8iXQ=="),e("I2FkY29udGFpbmVyX3JlY2hlcmNoZQ=="),e("YVtocmVmKj0id2Vib3JhbWEuZnIvZmNnaS1iaW4vIl0="),".site-pub-interstitiel",'div[id^="crt-"][data-criteo-id]'],officialPolish:["#ceneo-placeholder-ceneo-12",e("W2hyZWZePSJodHRwczovL2FmZi5zZW5kaHViLnBsLyJd"),e("YVtocmVmXj0iaHR0cDovL2Fkdm1hbmFnZXIudGVjaGZ1bi5wbC9yZWRpcmVjdC8iXQ=="),e("YVtocmVmXj0iaHR0cDovL3d3dy50cml6ZXIucGwvP3V0bV9zb3VyY2UiXQ=="),e("ZGl2I3NrYXBpZWNfYWQ=")],ro:[e("YVtocmVmXj0iLy9hZmZ0cmsuYWx0ZXgucm8vQ291bnRlci9DbGljayJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ibGFja2ZyaWRheXNhbGVzLnJvL3Ryay9zaG9wLyJd"),e("YVtocmVmXj0iaHR0cHM6Ly9ldmVudC4ycGVyZm9ybWFudC5jb20vZXZlbnRzL2NsaWNrIl0="),e("YVtocmVmXj0iaHR0cHM6Ly9sLnByb2ZpdHNoYXJlLnJvLyJd"),'a[href^="/url/"]'],ruAd:[e("YVtocmVmKj0iLy9mZWJyYXJlLnJ1LyJd"),e("YVtocmVmKj0iLy91dGltZy5ydS8iXQ=="),e("YVtocmVmKj0iOi8vY2hpa2lkaWtpLnJ1Il0="),"#pgeldiz",".yandex-rtb-block"],thaiAds:["a[href*=macau-uta-popup]",e("I2Fkcy1nb29nbGUtbWlkZGxlX3JlY3RhbmdsZS1ncm91cA=="),e("LmFkczMwMHM="),".bumq",".img-kosana"],webAnnoyancesUltralist:["#mod-social-share-2","#social-tools",e("LmN0cGwtZnVsbGJhbm5lcg=="),".zergnet-recommend",".yt.btn-link.btn-md.btn"]}}(),n=Object.keys(t),o=[].concat(...n.map(e=>t[e])),i=yield function(e){return d(this,null,function*(){var t;const n=document,o=n.createElement("div"),i=new Array(e.length),r={};xn(o);for(let a=0;a<e.length;++a){const t=un(e[a]);"DIALOG"===t.tagName&&t.show();const r=n.createElement("div");xn(r),r.appendChild(t),o.appendChild(r),i[a]=t}for(;!n.body;)yield Lt(50);n.body.appendChild(o);try{for(let t=0;t<e.length;++t)i[t].offsetParent||(r[e[t]]=!0)}finally{null===(t=o.parentNode)||void 0===t||t.removeChild(o)}return r})}(o);e&&function(e,t){let n="DOM blockers debug:\n```";for(const o of Object.keys(e)){n+=`\n${o}:`;for(const i of e[o])n+=`\n ${t[i]?"🚫":"➡️"} ${i}`}console.log(`${n}\n\`\`\``)}(t,i);const r=n.filter(e=>{const n=t[e];return Ft(n.map(e=>i[e]))>.6*n.length});return r.sort(),r})},fontPreferences:function(){return function(e,t=4e3){return dn((n,o)=>{const i=o.document,r=i.body,a=r.style;a.width=`${t}px`,a.webkitTextSizeAdjust=a.textSizeAdjust="none",en()?r.style.zoom=""+1/o.devicePixelRatio:tn()&&(r.style.zoom="reset");const s=i.createElement("div");return s.textContent=[...Array(t/20|0)].map(()=>"word").join(" "),r.appendChild(s),e(i,r,o)},'<!doctype html><html><head><meta name="viewport" content="width=device-width, initial-scale=1">')}((e,t,n)=>{const o={},i={};for(const a of Object.keys(_n)){const[n={},i=Mn]=_n[a],r=e.createElement("span");r.textContent=i,r.style.whiteSpace="nowrap";for(const e of Object.keys(n)){const t=n[e];void 0!==t&&(r.style[e]=t)}o[a]=r,t.append(e.createElement("br"),r)}const r=en()&&function(){const e=window,t=document,{CSS:n,Promise:o,AudioContext:i}=e;return Ft([o&&"try"in o,"caretPositionFromPoint"in t,i&&"onerror"in i.prototype,n.supports("ruby-align","space-around")])>=3}();for(const a of Object.keys(_n)){const e=o[a].getBoundingClientRect().width;i[a]=r?An(e*n.devicePixelRatio):e}return i})},audio:function(){return tn()&&sn()&&on()||en()&&function(){const e=navigator,t=window,n=Audio.prototype,{visualViewport:o}=t;return Ft(["srLatency"in n,"srChannelCount"in n,"devicePosture"in e,o&&"segments"in o,"getTextInformation"in Image.prototype])>=3}()&&function(){const e=window,{URLPattern:t}=e;return Ft(["union"in Set.prototype,"Iterator"in e,t&&"hasRegExpGroups"in t.prototype,"RGB8"in WebGLRenderingContext.prototype])>=3}()?-4:function(){const e=window,t=e.OfflineAudioContext||e.webkitOfflineAudioContext;if(!t)return-2;if(tn()&&!nn()&&!function(){const e=window;return Ft(["DOMRectList"in e,"RTCPeerConnectionIceEvent"in e,"SVGGeometryElement"in e,"ontransitioncancel"in e])>=3}())return-1;const n=4500,o=new t(1,5e3,44100),i=o.createOscillator();i.type="triangle",i.frequency.value=1e4;const r=o.createDynamicsCompressor();r.threshold.value=-50,r.knee.value=40,r.ratio.value=12,r.attack.value=0,r.release.value=.25,i.connect(r),r.connect(o.destination),i.start(0);const[a,s]=function(e){const t=3,n=500,o=500,i=5e3;let r=()=>{};const a=new Promise((a,s)=>{let c=!1,l=0,d=0;e.oncomplete=e=>a(e.renderedBuffer);const u=()=>{setTimeout(()=>s(ln("timeout")),Math.min(o,d+i-Date.now()))},f=()=>{try{const o=e.startRendering();switch(Tt(o)&&At(o),e.state){case"running":d=Date.now(),c&&u();break;case"suspended":document.hidden||l++,c&&l>=t?s(ln("suspended")):setTimeout(f,n)}}catch(o){s(o)}};f(),r=()=>{c||(c=!0,d>0&&u())}});return[a,r]}(o),c=At(a.then(e=>function(e){let t=0;for(let n=0;n<e.length;++n)t+=Math.abs(e[n]);return t}(e.getChannelData(0).subarray(n)),e=>{if("timeout"===e.name||"suspended"===e.name)return-3;throw e}));return()=>(s(),c)}()},screenFrame:function(){const e=tn()&&sn()&&on(),t=rn()&&an();if(e||t)return()=>Promise.resolve(void 0);const n=yn();return()=>d(null,null,function*(){const e=yield n(),t=e=>null===e?null:Bt(e,10);return[t(e[0]),t(e[1]),t(e[2]),t(e[3])]})},canvas:function(){return function(e){let t,n,o=!1;const[i,r]=function(){const e=document.createElement("canvas");return e.width=1,e.height=1,[e,e.getContext("2d")]}();!function(e,t){return!(!t||!e.toDataURL)}(i,r)?t=n="unsupported":(o=function(e){return e.rect(0,0,10,10),e.rect(2,2,6,6),!e.isPointInPath(5,5,"evenodd")}(r),e?t=n="skipped":[t,n]=function(e,t){!function(e,t){e.width=240,e.height=60,t.textBaseline="alphabetic",t.fillStyle="#f60",t.fillRect(100,1,62,20),t.fillStyle="#069",t.font='11pt "Times New Roman"';const n=`Cwm fjordbank gly ${String.fromCharCode(55357,56835)}`;t.fillText(n,2,15),t.fillStyle="rgba(102, 204, 0, 0.2)",t.font="18pt Arial",t.fillText(n,4,45)}(e,t);const n=gn(e),o=gn(e);if(n!==o)return["unstable","unstable"];!function(e,t){e.width=122,e.height=110,t.globalCompositeOperation="multiply";for(const[n,o,i]of[["#f2f",40,40],["#2ff",80,40],["#ff2",60,80]])t.fillStyle=n,t.beginPath(),t.arc(o,i,40,0,2*Math.PI,!0),t.closePath(),t.fill();t.fillStyle="#f9c",t.arc(60,60,60,0,2*Math.PI,!0),t.arc(60,60,20,0,2*Math.PI,!0),t.fill("evenodd")}(e,t);const i=gn(e);return[i,n]}(i,r));return{winding:o,geometry:t,text:n}}(function(){const e=tn()&&sn()&&on(),t=rn()&&function(){const e=window,t=navigator,{CSS:n}=e;return Ft(["userActivation"in t,n.supports("color","light-dark(#000, #fff)"),n.supports("height","1lh"),"globalPrivacyControl"in t])>=3}();return e||t}())},osCpu:function(){return navigator.oscpu},languages:function(){const e=navigator,t=[],n=e.language||e.userLanguage||e.browserLanguage||e.systemLanguage;if(void 0!==n&&t.push([n]),Array.isArray(e.languages))en()&&function(){const e=window;return Ft([!("MediaSettingsRange"in e),"RTCEncodedAudioFrame"in e,""+e.Intl=="[object Intl]",""+e.Reflect=="[object Reflect]"])>=3}()||t.push(e.languages);else if("string"==typeof e.languages){const n=e.languages;n&&t.push(n.split(","))}return t},colorDepth:function(){return window.screen.colorDepth},deviceMemory:function(){return Rt(Pt(navigator.deviceMemory),void 0)},screenResolution:function(){if(!(tn()&&sn()&&on()))return function(){const e=screen,t=e=>Rt(Ot(e),null),n=[t(e.width),t(e.height)];return n.sort().reverse(),n}()},hardwareConcurrency:function(){const e=Rt(Ot(navigator.hardwareConcurrency),void 0);return void 0!==e&&rn()&&an()?e>=8?8:4:e},timezone:function(){var e;const t=null===(e=window.Intl)||void 0===e?void 0:e.DateTimeFormat;if(t){const e=(new t).resolvedOptions().timeZone;if(e)return e}const n=-function(){const e=(new Date).getFullYear();return Math.max(Pt(new Date(e,0,1).getTimezoneOffset()),Pt(new Date(e,6,1).getTimezoneOffset()))}();return`UTC${n>=0?"+":""}${n}`},sessionStorage:function(){try{return!!window.sessionStorage}catch(e){return!0}},localStorage:function(){try{return!!window.localStorage}catch(e){return!0}},indexedDB:function(){if(!Qt()&&!function(){const e=window,t=navigator;return Ft(["msWriteProfilerMark"in e,"MSStream"in e,"msLaunchUri"in t,"msSaveBlob"in t])>=3&&!Qt()}())try{return!!window.indexedDB}catch(e){return!0}},openDatabase:function(){return!!window.openDatabase},cpuClass:function(){return navigator.cpuClass},platform:function(){const{platform:e}=navigator;return"MacIntel"===e&&tn()&&!nn()?function(){if("iPad"===navigator.platform)return!0;const e=screen,t=e.width/e.height;return Ft(["MediaSource"in window,!!Element.prototype.webkitRequestFullscreen,t>.65&&t<1.53])>=2}()?"iPad":"iPhone":e},plugins:function(){const e=navigator.plugins;if(!e)return;const t=[];for(let n=0;n<e.length;++n){const o=e[n];if(!o)continue;const i=[];for(let e=0;e<o.length;++e){const t=o[e];i.push({type:t.type,suffixes:t.suffixes})}t.push({name:o.name,description:o.description,mimeTypes:i})}return t},touchSupport:function(){const e=navigator;let t,n=0;void 0!==e.maxTouchPoints?n=Ot(e.maxTouchPoints):void 0!==e.msMaxTouchPoints&&(n=e.msMaxTouchPoints);try{document.createEvent("TouchEvent"),t=!0}catch(o){t=!1}return{maxTouchPoints:n,touchEvent:t,touchStart:"ontouchstart"in window}},vendor:function(){return navigator.vendor||""},vendorFlavors:function(){const e=[];for(const t of["chrome","safari","__crWeb","__gCrWeb","yandex","__yb","__ybro","__firefox__","__edgeTrackingPreventionStatistics","webkit","oprt","samsungAr","ucweb","UCShellJava","puffinDevice"]){const n=window[t];n&&"object"==typeof n&&e.push(t)}return e.sort()},cookiesEnabled:function(){const e=document;try{e.cookie="cookietest=1; SameSite=Strict;";const t=-1!==e.cookie.indexOf("cookietest=");return e.cookie="cookietest=1; SameSite=Strict; expires=Thu, 01-Jan-1970 00:00:01 GMT",t}catch(t){return!1}},colorGamut:function(){for(const e of["rec2020","p3","srgb"])if(matchMedia(`(color-gamut: ${e})`).matches)return e},invertedColors:function(){return!!Sn("inverted")||!Sn("none")&&void 0},forcedColors:function(){return!!Cn("active")||!Cn("none")&&void 0},monochrome:function(){if(matchMedia("(min-monochrome: 0)").matches){for(let e=0;e<=100;++e)if(matchMedia(`(max-monochrome: ${e})`).matches)return e;throw new Error("Too high value")}},contrast:function(){return kn("no-preference")?0:kn("high")||kn("more")?1:kn("low")||kn("less")?-1:kn("forced")?10:void 0},reducedMotion:function(){return!!En("reduce")||!En("no-preference")&&void 0},reducedTransparency:function(){return!!In("reduce")||!In("no-preference")&&void 0},hdr:function(){return!!Ln("high")||!Ln("standard")&&void 0},math:function(){const e=Wn.acos||Tn,t=Wn.acosh||Tn,n=Wn.asin||Tn,o=Wn.asinh||Tn,i=Wn.atanh||Tn,r=Wn.atan||Tn,a=Wn.sin||Tn,s=Wn.sinh||Tn,c=Wn.cos||Tn,l=Wn.cosh||Tn,d=Wn.tan||Tn,u=Wn.tanh||Tn,f=Wn.exp||Tn,p=Wn.expm1||Tn,h=Wn.log1p||Tn;return{acos:e(.12312423423423424),acosh:t(1e308),acoshPf:(g=1e154,Wn.log(g+Wn.sqrt(g*g-1))),asin:n(.12312423423423424),asinh:o(1),asinhPf:(e=>Wn.log(e+Wn.sqrt(e*e+1)))(1),atanh:i(.5),atanhPf:(e=>Wn.log((1+e)/(1-e))/2)(.5),atan:r(.5),sin:a(-1e300),sinh:s(1),sinhPf:(e=>Wn.exp(e)-1/Wn.exp(e)/2)(1),cos:c(10.000000000123),cosh:l(1),coshPf:(e=>(Wn.exp(e)+1/Wn.exp(e))/2)(1),tan:d(-1e300),tanh:u(1),tanhPf:(e=>(Wn.exp(2*e)-1)/(Wn.exp(2*e)+1))(1),exp:f(1),expm1:p(1),expm1Pf:(e=>Wn.exp(e)-1)(1),log1p:h(10),log1pPf:(e=>Wn.log(1+e))(10),powPI:(e=>Wn.pow(Wn.PI,e))(-100)};var g},pdfViewerEnabled:function(){return navigator.pdfViewerEnabled},architecture:function(){const e=new Float32Array(1),t=new Uint8Array(e.buffer);return e[0]=1/0,e[0]=e[0]-e[0],t[3]},applePay:function(){const{ApplePaySession:e}=window;if("function"!=typeof(null==e?void 0:e.canMakePayments))return-1;if(On())return-3;try{return e.canMakePayments()?1:0}catch(t){return function(e){if(e instanceof Error&&"InvalidAccessError"===e.name&&/\bfrom\b.*\binsecure\b/i.test(e.message))return-2;throw e}(t)}},privateClickMeasurement:function(){var e;const t=document.createElement("a"),n=null!==(e=t.attributionSourceId)&&void 0!==e?e:t.attributionsourceid;return void 0===n?void 0:String(n)},audioBaseLatency:function(){if(!(cn()||tn()))return-2;if(!window.AudioContext)return-1;const e=(new AudioContext).baseLatency;return null==e?-1:isFinite(e)?e:-3},dateTimeLocale:function(){if(!window.Intl)return-1;const e=window.Intl.DateTimeFormat;if(!e)return-2;const t=e().resolvedOptions().locale;return t||""===t?t:-3},webGlBasics:function({cache:e}){var t,n,o,i,r,a;const s=jn(e);if(!s)return-1;if(!zn(s))return-2;const c=Dn()?null:s.getExtension(Vn);return{version:(null===(t=s.getParameter(s.VERSION))||void 0===t?void 0:t.toString())||"",vendor:(null===(n=s.getParameter(s.VENDOR))||void 0===n?void 0:n.toString())||"",vendorUnmasked:c?null===(o=s.getParameter(c.UNMASKED_VENDOR_WEBGL))||void 0===o?void 0:o.toString():"",renderer:(null===(i=s.getParameter(s.RENDERER))||void 0===i?void 0:i.toString())||"",rendererUnmasked:c?null===(r=s.getParameter(c.UNMASKED_RENDERER_WEBGL))||void 0===r?void 0:r.toString():"",shadingLanguageVersion:(null===(a=s.getParameter(s.SHADING_LANGUAGE_VERSION))||void 0===a?void 0:a.toString())||""}},webGlExtensions:function({cache:e}){const t=jn(e);if(!t)return-1;if(!zn(t))return-2;const n=t.getSupportedExtensions(),o=t.getContextAttributes(),i=[],r=[],a=[],s=[],c=[];if(o)for(const d of Object.keys(o))r.push(`${d}=${o[d]}`);const l=Hn(t);for(const d of l){const e=t[d];a.push(`${d}=${e}${Pn.has(e)?`=${t.getParameter(e)}`:""}`)}if(n)for(const d of n){if(d===Vn&&Dn()||"WEBGL_polygon_mode"===d&&Gn())continue;const e=t.getExtension(d);if(e)for(const n of Hn(e)){const o=e[n];s.push(`${n}=${o}${Rn.has(o)?`=${t.getParameter(o)}`:""}`)}else i.push(d)}for(const d of Fn)for(const e of Bn){const n=Nn(t,d,e);c.push(`${d}.${e}=${n.join(",")}`)}return s.sort(),a.sort(),{contextAttributes:r,parameters:a,shaderPrecisions:c,extensions:n,extensionParameters:s,unsupportedExtensions:i}}};function $n(e){const t=function(e){if(cn())return.4;if(tn())return!nn()||sn()&&on()?.3:.5;const t="value"in e.platform?e.platform.value:"";if(/^Win/.test(t))return.6;if(/^Mac/.test(t))return.5;return.7}(e),n=function(e){return Bt(.99+.01*e,1e-4)}(t);return{score:t,comment:"$ if upgrade to Pro: https://fingerprint.com/github/?utm_source=oss&utm_medium=referral&utm_campaign=confidence_score".replace(/\$/g,`${n}`)}}function Xn(e){return JSON.stringify(e,(e,t)=>{return t instanceof Error?s({name:(n=t).name,message:n.message,stack:null===(o=n.stack)||void 0===o?void 0:o.split("\n")},n):t;var n,o},2)}function Jn(e){return Ut(function(e){let t="";for(const n of Object.keys(e).sort()){const o=e[n],i="error"in o?"error":JSON.stringify(o.value);t+=`${t?"|":""}${n.replace(/([:|\\])/g,"\\$1")}:${i}`}return t}(e))}function Kn(e=50){return function(e,t=1/0){const{requestIdleCallback:n}=window;return n?new Promise(e=>n.call(window,()=>e(),{timeout:t})):Lt(Math.min(e,t))}(e,2*e)}function Un(e,t){const n=Date.now();return{get(o){return d(this,null,function*(){const i=Date.now(),r=yield e(),a=function(e){let t;const n=$n(e);return{get visitorId(){return void 0===t&&(t=Jn(this.components)),t},set visitorId(e){t=e},confidence:n,components:e,version:It}}(r);return(t||(null==o?void 0:o.debug))&&console.log(`Copy the text below to get the debug data:\n\n\`\`\`\nversion: ${a.version}\nuserAgent: ${navigator.userAgent}\ntimeBetweenLoadAndGet: ${i-n}\nvisitorId: ${a.visitorId}\ncomponents: ${Xn(r)}\n\`\`\``),a})}}}var qn={load:function(){return d(this,arguments,function*(e={}){const{delayFallback:t,debug:n,monitoring:o=!0}=e;o&&function(){if(!(window.__fpjs_d_m||Math.random()>=.001))try{const e=new XMLHttpRequest;e.open("get",`https://m1.openfpcdn.io/fingerprintjs/v${It}/npm-monitoring`,!0),e.send()}catch(e){console.error(e)}}(),yield Kn(t);const i=function(e){return qt(Yn,e,[])}({cache:{},debug:n});return Un(i,n)})},hashComponents:Jn,componentsToDebugString:Xn};let Qn=null;const eo="undefined"!=typeof window&&window.Brainfish?window.Brainfish:(Qn||(Qn=function(){const e=[];let t=null;function n(n,o){if(t){const e=n.split(".");let i=t;for(let t=0;t<e.length-1;t++)i=i[e[t]];const r=i[e[e.length-1]];if("function"==typeof r)return r.apply(i,o)}else e.push([n,o])}return{Widgets:{init:(...e)=>n("Widgets.init",e),setTheme:(...e)=>n("Widgets.setTheme",e),identify:(...e)=>n("Widgets.identify",e),setSecretAttributes:(...e)=>n("Widgets.setSecretAttributes",e),open:()=>n("Widgets.open",[]),close:()=>n("Widgets.close",[]),createNewThread:()=>n("Widgets.createNewThread",[]),openModalForm:({formUrl:e,width:t,height:o})=>n("Widgets.openModalForm",[{formUrl:e,width:t,height:o}]),registerClientActionHandler:(...e)=>n("Widgets.registerClientActionHandler",e),onContextHelp:(...e)=>n("Widgets.onContextHelp",e),restoreConversation:(...e)=>n("Widgets.restoreConversation",e),clearConversation:()=>n("Widgets.clearConversation",[]),isReady:!1},SearchWidget:{initStandard:(...e)=>n("SearchWidget.initStandard",e)},HelpWidget:{initPopup:(...e)=>n("HelpWidget.initPopup",e),close:(...e)=>n("HelpWidget.close",e),open:(...e)=>n("HelpWidget.open",e),toggle:(...e)=>n("HelpWidget.toggle",e)},_setRealBrainfish(o){for(t=o;e.length>0;){const[t,o]=e.shift();n(t,o)}}}}(),"undefined"!=typeof window&&(window.Brainfish=Qn)),Qn),to=new Map,no=new Map;let oo=!1;function io(e,t,n,o,i){return d(this,null,function*(){var r,a,s,c,l,d,u;const f=(null==(r=e.overrides)?void 0:r.enableRecording)||(null==(a=null==t?void 0:t.settings)?void 0:a.enableRecording)||!1,p=(null==(s=e.overrides)?void 0:s.version)||(null==t?void 0:t.version);no.set(e.widgetKey,{options:e,config:t,apiHost:n,analyticsApiHost:o,fingerprint:i});const h=[];(null==p?void 0:p.startsWith("2."))?(mt(e,t,i),oo||(oo=!0,Et(()=>{no.forEach(({options:e,config:t,fingerprint:n})=>{var o;const i=(null==(o=e.overrides)?void 0:o.version)||(null==t?void 0:t.version);(null==i?void 0:i.startsWith("2."))&&mt(e,t,n)})}))):h.push(E(e,t)),h.push(M(e.widgetKey,t.trackingToken||"",n,o,f,{blocklist:null==(c=null==t?void 0:t.settings)?void 0:c.recordingBlocklist,sampleRate:null==(d=null==(l=null==t?void 0:t.settings)?void 0:l.ambientSettings)?void 0:d.sampleRate,_allowLocalhostRecording:null==(u=null==t?void 0:t.settings)?void 0:u._allowLocalhostRecording})),h.push(wt(n,e.widgetKey));const[g]=yield Promise.allSettled(h);g&&"fulfilled"===g.status&&g.value&&eo._setRealBrainfish(g.value)})}eo.Widgets.isReady=!1,eo.Widgets.identify=e=>{window.BrainfishAnalytics("identify",e)},eo.Widgets.setSecretAttributes=e=>{try{const{alg:t}=p(e);if("dir"!==t)throw new Error("Invalid algorithm")}catch(n){return void console.error("[Brainfish] Invalid JWE provided to setSecretAttributes:",n)}const t=document.querySelector("#bf-iframe-container .trigger-iframe");if(t){const n=()=>{t.contentWindow&&t.contentWindow.postMessage({type:"SET_SECRET_ATTRIBUTES",secretAttributes:e},"*")};t.contentWindow&&n(),t.addEventListener("load",n)}},eo.Widgets.init=e=>d(null,null,function*(){window&&(window.BrainfishAnalytics=window.BrainfishAnalytics||function(...e){(window.BrainfishAnalytics.q=window.BrainfishAnalytics.q||[]).push(e)});const t=S(e.overrides),n=(null==(o=e.overrides)?void 0:o.analyticsApiHost)||"";var o;let i,r;try{const e=yield qn.load();i=(yield e.get()).visitorId}catch(s){console.warn("[Brainfish] Error loading fingerprint:",s)}if(e.config)r=JSON.parse(A(e.config));else{const{config:n}=yield w({widgetKey:e.widgetKey,apiHost:t});r=n}let a=to.get(e.widgetKey);if(a||(a=io(e,r,t,n,i),to.set(e.widgetKey,a)),yield a,!Xe.isWidgetDOMExisting(e.widgetKey,r)){to.delete(e.widgetKey);const o=io(e,r,t,n,i);to.set(e.widgetKey,o),yield o}yield yt(r),eo.Widgets.isReady=!0,window.dispatchEvent(new Event("onBrainfishReady"))}),eo.Widgets.setTheme=e=>{var t;const n=document.querySelector("#bf-iframe-container .trigger-iframe");if(n){const o=new URL(n.src),i=new URLSearchParams(o.hash.substring(1)),r=i.get("theme");let a;r&&(a=JSON.parse(A(r)));const c=s(s({},a),e);null==(t=n.contentWindow)||t.postMessage({type:"SET_THEME",theme:c},"*");const l=_(JSON.stringify(c));i.set("theme",l),o.hash=`#${i.toString()}`,n.src=o.toString()}},eo.Widgets.registerClientActionHandler=(e,t)=>{((e,t)=>{it.set(e,t)})(e,t)};exports.BrainfishAnalytics=(...e)=>{"undefined"!=typeof window&&window.BrainfishAnalytics&&window.BrainfishAnalytics(...e)},exports.default=eo;
|
|
2
2
|
//# sourceMappingURL=web.cjs.js.map
|