@builder.io/react 8.2.3 → 8.2.4

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.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@builder.io/react",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BuilderReact={})}(this,(function(exports){"use strict";var SDK_VERSION$1="8.2.3",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsXSmallBreakpoint:!0,supportsGlobalSymbols:!0,blockLevelPersonalization:!0,version:SDK_VERSION$1}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function __decorate(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function pad$1(e,t){for(;e.length<t;)e="0"+e;return e}function fold$1(e,t){var n,r;if(0===t.length)return e;for(n=0,r=t.length;n<r;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e<0?-2*e:e}function foldObject$1(e,t,n){return Object.keys(t).sort().reduce((function(e,r){return foldValue$1(e,t[r],r,n)}),e)}function foldValue$1(e,t,n,r){var i=fold$1(fold$1(fold$1(e,n),toString$2(t)),typeof t);if(null===t)return fold$1(i,"null");if(void 0===t)return fold$1(i,"undefined");if("object"==typeof t||"function"==typeof t){if(-1!==r.indexOf(t))return fold$1(i,"[Circular]"+n);r.push(t);var o=foldObject$1(i,t,r);if(!("valueOf"in t)||"function"!=typeof t.valueOf)return o;try{return fold$1(o,String(t.valueOf()))}catch(e){return fold$1(o,"[valueOf exception]"+(e.stack||e.message))}}return fold$1(i,t.toString())}function toString$2(e){return Object.prototype.toString.call(e)}function sum$1(e){return pad$1(foldValue$1(0,e,"",[]).toString(16),8)}"function"==typeof SuppressedError&&SuppressedError;var hashSum$1=sum$1;!function(){if("undefined"==typeof window||"function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}}();var isSafari="undefined"!=typeof window&&/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),isClient="undefined"!=typeof window;function nextTick$1(e){if(isClient&&!isSafari&&"undefined"!=typeof MutationObserver){var t=0,n=new MutationObserver((function(){return e()})),r=document.createTextNode("");n.observe(r,{characterData:!0}),r.data=String(t=++t)}else setTimeout(e)}var PROPERTY_NAME_DENY_LIST=Object.freeze(["__proto__","prototype","constructor"]),QueryString=function(){function e(){}return e.parseDeep=function(e){var t=this.parse(e);return this.deepen(t)},e.stringifyDeep=function(e){var t=this.flatten(e);return this.stringify(t)},e.parse=function(e){for(var t={},n=("?"===e[0]?e.substr(1):e).split("&"),r=0;r<n.length;r++){var i=n[r].split("=");try{t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]||"")}catch(e){}}return t},e.stringify=function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(r)}return t},e.deepen=function(e){var t={};for(var n in e){for(var r=t,i=n.split("."),o=i.pop(),a=0,s=i;a<s.length;a++){var l=s[a];assertAllowedPropertyName(l),r=r[l]=r[l]||{}}r[o]=e[n]}return t},e.flatten=function(e,t,n){for(var r in void 0===n&&(n={}),e){var i=e[r],o=t?t+"."+r:r;i&&"object"==typeof i?this.flatten(i,o,n):n[o]=i}return n},e}();function assertAllowedPropertyName(e){if(PROPERTY_NAME_DENY_LIST.indexOf(e)>=0)throw new Error('Property name "'.concat(e,'" is not allowed'))}var Subscription=function(){function e(e,t){this.listeners=e,this.listener=t,this.unsubscribed=!1,this.otherSubscriptions=[]}return Object.defineProperty(e.prototype,"closed",{get:function(){return this.unsubscribed},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this.otherSubscriptions.push(e)},e.prototype.unsubscribe=function(){if(!this.unsubscribed){if(this.listener&&this.listeners){var e=this.listeners.indexOf(this.listener);e>-1&&this.listeners.splice(e,1)}this.otherSubscriptions.forEach((function(e){return e.unsubscribe()})),this.unsubscribed=!0}},e}(),BehaviorSubject=function(){function e(e){var t=this;this.value=e,this.listeners=[],this.errorListeners=[],this.then=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(e=t.toPromise()).then.apply(e,n)}}return e.prototype.next=function(e){this.value=e;for(var t=0,n=this.listeners;t<n.length;t++){(0,n[t])(e)}},e.prototype.map=function(t){var n=new e(t(this.value));return this.subscribe((function(e){n.next(t(e))})),this.catch((function(e){n.error(e)})),n},e.prototype.catch=function(e){return this.errorListeners.push(e),new Subscription(this.errorListeners,e)},e.prototype.error=function(e){for(var t=0,n=this.errorListeners;t<n.length;t++){(0,n[t])(e)}},e.prototype.subscribe=function(e,t){return this.listeners.push(e),t&&this.errorListeners.push(t),new Subscription(this.listeners,e)},e.prototype.toPromise=function(){var e=this;return new Promise((function(t,n){var r=e.subscribe((function(e){t(e),r.unsubscribe()}),(function(e){n(e),r.unsubscribe()}))}))},e.prototype.promise=function(){return this.toPromise()},e}(),State={Pending:"Pending",Fulfilled:"Fulfilled",Rejected:"Rejected"};function isFunction(e){return e&&"function"==typeof e}function isObject(e){return e&&"object"==typeof e}var TinyPromise=function(){function e(e){this._state=State.Pending,this._handlers=[],this._value=null,e(this._resolve.bind(this),this._reject.bind(this))}return e.prototype._resolve=function(t){var n=this;if(t instanceof e)t.then(this._resolve.bind(this),this._reject.bind(this));else if(isObject(t)||isFunction(t)){var r=!1;try{var i=t.then;isFunction(i)?i.call(t,(function(e){r||n._resolve(e),r=!0}),(function(e){r||n._reject(e),r=!0})):this._fulfill(t)}catch(e){r||this._reject(e)}}else this._fulfill(t)},e.prototype._fulfill=function(e){var t=this;this._state=State.Fulfilled,this._value=e,this._handlers.forEach((function(e){return t._callHandler(e)}))},e.prototype._reject=function(e){var t=this;this._state=State.Rejected,this._value=e,this._handlers.forEach((function(e){return t._callHandler(e)}))},e.prototype._isPending=function(){return this._state===State.Pending},e.prototype._isFulfilled=function(){return this._state===State.Fulfilled},e.prototype._isRejected=function(){return this._state===State.Rejected},e.prototype._addHandler=function(e,t){this._handlers.push({onFulfilled:e,onRejected:t})},e.prototype._callHandler=function(e){this._isFulfilled()&&isFunction(e.onFulfilled)?e.onFulfilled(this._value):this._isRejected()&&isFunction(e.onRejected)&&e.onRejected(this._value)},e.prototype.then=function(t,n){var r=this;switch(this._state){case State.Pending:return new e((function(e,i){r._addHandler((function(n){nextTick$1((function(){try{isFunction(t)?e(t(n)):e(n)}catch(e){i(e)}}))}),(function(t){nextTick$1((function(){try{isFunction(n)?e(n(t)):i(t)}catch(e){i(e)}}))}))}));case State.Fulfilled:return new e((function(e,n){nextTick$1((function(){try{isFunction(t)?e(t(r._value)):e(r._value)}catch(e){n(e)}}))}));case State.Rejected:return new e((function(e,t){nextTick$1((function(){try{isFunction(n)?e(n(r._value)):t(r._value)}catch(e){t(e)}}))}))}},e}(),Promise$1="undefined"!=typeof Promise?Promise:TinyPromise,serverOnlyRequire;try{serverOnlyRequire=eval("require")}catch(e){serverOnlyRequire=function(){return null}}var serverOnlyRequire$1=serverOnlyRequire;function promiseResolve(e){return new Promise$1((function(t){return t(e)}))}function tinyFetch(e,t){return void 0===t&&(t={}),new Promise$1((function(n,r){var i=new XMLHttpRequest;if(i.open(t.method||"get",e,!0),t.headers)for(var o in t.headers)i.setRequestHeader(o,t.headers[o]);function a(){var e=[],t=[],n={},r=void 0;return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,o,a){var s=o;return e.push(s=s.toLowerCase()),t.push([s,a]),r=n[s],n[s]=r?"".concat(r,",").concat(a):a,""})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:a,text:function(){return promiseResolve(i.responseText)},json:function(){return promiseResolve(i.responseText).then(JSON.parse)},blob:function(){return promiseResolve(new Blob([i.response]))},headers:{keys:function(){return e},entries:function(){return t},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"===t.credentials,i.onload=function(){n(a())},i.onerror=r,i.send(t.body)}))}function getFetch(){var e=void 0;if(globalThis.fetch)null!=e||(e=globalThis.fetch);else if("undefined"==typeof window)try{null!=e||(e=serverOnlyRequire$1("node-fetch"))}catch(e){console.warn("node-fetch is not installed. consider polyfilling fetch or installing node-fetch."),console.warn(e)}return null!=e?e:tinyFetch}function assign(e){for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}function throttle$1(e,t,n){var r,i,o;void 0===n&&(n={});var a=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return r=this,i=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),s=u,o=e.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}}var camelCaseToKebabCase$1=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},Animator=function(){function e(){}return e.prototype.bindAnimations=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];switch(r.trigger){case"pageLoad":this.triggerAnimation(r);break;case"hover":this.bindHoverAnimation(r);break;case"scrollInView":this.bindScrollInViewAnimation(r)}}},e.prototype.warnElementNotPresent=function(e){console.warn("Cannot animate element: element with ID ".concat(e," not found!"))},e.prototype.augmentAnimation=function(e,t){for(var n=this.getAllStylesUsed(e),r=getComputedStyle(t),i=0,o=[e.steps[0].styles,e.steps[e.steps.length-1].styles];i<o.length;i++)for(var a=o[i],s=0,l=n;s<l.length;s++){var u=l[s];u in a||(a[u]=r[u])}},e.prototype.getAllStylesUsed=function(e){for(var t=[],n=0,r=e.steps;n<r.length;n++){var i=r[n];for(var o in i.styles)-1===t.indexOf(o)&&t.push(o)}return t},e.prototype.triggerAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout((function(){n.style.transition="",n.style.transitionDelay=""}),1e3*(e.delay||0)+1e3*e.duration+100)}))})):this.warnElementNotPresent(e.elementId||e.id||"")},e.prototype.bindHoverAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n);var r=e.steps[0].styles,i=e.steps[1].styles;function o(){assign(n.style,r)}o(),n.addEventListener("mouseenter",(function(){assign(n.style,i)})),n.addEventListener("mouseleave",o),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s")}))})):this.warnElementNotPresent(e.elementId||e.id||"")},e.prototype.bindScrollInViewAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n);var r=!1,i=!1;function o(){!r&&s(n)?(r=!0,i=!0,setTimeout((function(){assign(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",a),setTimeout((function(){i=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")}),1e3*(e.duration+(e.delay||0))+100)}))):e.repeat&&r&&!i&&!s(n)&&(r=!1,assign(n.style,e.steps[0].styles))}var a=throttle$1(o,200,{leading:!1});function s(t){var n=t.getBoundingClientRect(),r=window.innerHeight,i=(e.thresholdPercent||0)/100*r;return n.bottom>i&&n.top<r-i}var l=e.steps[0].styles;assign(n.style,l),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s")})),document.addEventListener("scroll",a,{capture:!0,passive:!0}),o()})):this.warnElementNotPresent(e.elementId||e.id||"")},e}(),fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Cookies=function(){function e(e,t){this.request=e,this.response=t}return e.prototype.get=function(e){var t=this.request.headers.cookie;if(t){var n=t.match(getPattern(e));if(n)return n[1]}},e.prototype.set=function(e,t,n){var r=this.response,i=this.request,o=r.getHeader("Set-Cookie")||[],a=void 0!==this.secure?!!this.secure:"https"===i.protocol||i.connection.encrypted,s=new Cookie(e,t,n);if("string"==typeof o&&(o=[o]),!a&&n&&n.secure)throw new Error("Cannot send secure cookie over unencrypted connection");return s.secure=a,n&&"secure"in n&&(s.secure=!!n.secure),pushCookie(o,s),r.setHeader.call(r,"Set-Cookie",o),this},e}(),Cookie=function(){function e(e,t,n){if(this.path="/",this.domain=void 0,this.httpOnly=!0,this.sameSite=!1,this.secure=!1,this.overwrite=!1,this.name="",this.value="",!fieldContentRegExp.test(e))throw new TypeError("argument name is invalid");if(t&&!fieldContentRegExp.test(t))throw new TypeError("argument value is invalid");t||(this.expires=new Date(0)),this.name=e,this.value=t||"",n.expires&&(this.expires=n.expires),n.secure&&(this.secure=n.secure)}return e.prototype.toString=function(){return"".concat(this.name,"=").concat(this.value)},e.prototype.toHeader=function(){var e=this.toString();return this.maxAge&&(this.expires=new Date(Date.now()+this.maxAge)),this.path&&(e+="; path=".concat(this.path)),this.expires&&(e+="; expires=".concat(this.expires.toUTCString())),this.domain&&(e+="; domain=".concat(this.domain)),e+="; SameSite=".concat(!0===this.sameSite?"strict":"None"),this.secure&&(e+="; secure"),this.httpOnly&&(e+="; httponly"),e},e}();function getPattern(e){return new RegExp("(?:^|;) *".concat(e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"=([^;]*)"))}function pushCookie(e,t){if(t.overwrite)for(var n=e.length-1;n>=0;n--)0===e[n].indexOf("".concat(t.name,"="))&&e.splice(n,1);e.push(t.toHeader())}function omit$3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=Object.assign({},e),i=0,o=t;i<o.length;i++){var a=o[i];delete r[a]}return r}function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}function uuid(){return uuidv4().replace(/-/g,"")}function emptyUrl(){return{query:null,port:null,auth:null,hash:null,host:null,hostname:null,href:null,path:null,pathname:null,protocol:null,search:null,slashes:null}}function parse$1(e){var t,n,r=emptyUrl();return""===e||"/"===e[0]?(n=new URL(e,"http://0.0.0.0/"),r.href=n.href,r.href=null===(t=r.href)||void 0===t?void 0:t.slice(14)):(n=new URL(e),r.href=n.href,r.port=""===n.port?null:n.port,r.hash=""===n.hash?null:n.hash,r.host=n.host,r.hostname=n.hostname,r.href=n.href,r.pathname=n.pathname,r.protocol=n.protocol,r.slashes="/"===e[n.protocol.length]),r.search=n.search,r.query=n.search.slice(1),r.path="".concat(n.pathname).concat(n.search),r.pathname=n.pathname,r}function toError$1(e){return e instanceof Error?e:new Error(String(e))}var DEFAULT_API_VERSION="v3",SDK_VERSION="6.0.9";function datePlusMinutes(e){return void 0===e&&(e=30),new Date(Date.now()+6e4*e)}var isPositiveNumber=function(e){return"number"==typeof e&&!isNaN(e)&&e>=0},isReactNative="object"==typeof navigator&&"ReactNative"===navigator.product,validEnvList=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"];function getQueryParam(e,t){for(var n=(e.split("?")[1]||"").split("&"),r=0;r<n.length;r++){var i=n[r].split("=");if(decodeURIComponent(i[0])===t)return decodeURIComponent(i[1])}return null}var urlParser={parse:function(e){var t=document.createElement("a");t.href=e;for(var n={},r=0,i=["username","password","host","hostname","port","protocol","origin","pathname","search","hash"];r<i.length;r++){var o=i[r];n[o]=t[o]}return!n.pathname&&""!==n.pathname||"string"!=typeof n.pathname||0===n.pathname.indexOf("/")||(n.pathname="/"+n.pathname),n}},parse=isReactNative?function(){return emptyUrl()}:"object"==typeof window?urlParser.parse:parse$1;function setCookie(e,t,n){try{var r="";n&&(r="; expires="+n.toUTCString());var i=!isBrowser$3||"https:"===location.protocol;document.cookie=e+"="+(t||"")+r+"; path=/"+(i?"; secure; SameSite=None":"")}catch(e){console.warn("Could not set cookie",e)}}function getCookie(e){try{return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null}catch(e){console.warn("Could not get cookie",e)}}function size$2(e){return Object.keys(e).length}function find(e,t){for(var n=e,r=n.length>>>0,i=arguments[1],o=0;o<r;o++){var a=n[o];if(t.call(i,a,o,n))return a}}var sessionStorageKey="builderSessionId",localStorageKey="builderVisitorId",isBrowser$3="undefined"!=typeof window&&!isReactNative,isIframe=isBrowser$3&&window.top!==window.self,Builder=function(){function e(t,n,r,i,o,a){void 0===t&&(t=null),void 0===i&&(i=!1),void 0===o&&(o=null);var s=this;if(this.request=n,this.response=r,this.eventsQueue=[],this.throttledClearEventsQueue=throttle$1((function(){s.processEventsQueue(),s.setCookie(sessionStorageKey,s.sessionId,datePlusMinutes(30))}),5),this.env="production",this.sessionId=this.getSessionId(),this.targetContent=!0,this.contentPerRequest=1,this.allowCustomFonts=!0,this.cookies=null,this.cachebust=!1,this.overrideParams="",this.noCache=!1,this.preview=!1,this.apiEndpoint$=new BehaviorSubject("query"),this.apiVersion$=new BehaviorSubject(void 0),this.canTrack$=new BehaviorSubject(!this.browserTrackingDisabled),this.hasOverriddenCanTrack=!1,this.apiKey$=new BehaviorSubject(null),this.authToken$=new BehaviorSubject(null),this.userAttributesChanged=new BehaviorSubject(null),this.editingMode$=new BehaviorSubject(isIframe),this.editingModel$=new BehaviorSubject(null),this.userAgent="object"==typeof navigator&&navigator.userAgent||"",this.trackingHooks=[],this.visitorId=this.getVisitorId(),this.autoTrack=!!e.isBrowser&&!(this.isDevelopmentEnv||e.isBrowser&&-1!==location.search.indexOf("builder.preview=")),this.trackingUserAttributes={},this.blockContentLoading="",this.observersByKey={},this.noEditorUpdates={},this.overrides={},this.queryOptions={},this.getContentQueue=null,this.priorContentQueue=null,this.testCookiePrefix="builder.tests",this.cookieQueue=[],e.isBrowser&&!i&&e.singletonInstance)return e.singletonInstance;if(this.request&&this.response&&(this.setUserAgent(this.request.headers["user-agent"]||""),this.cookies=new Cookies(this.request,this.response)),t&&(this.apiKey=t),a&&(this.apiVersion=a),o&&(this.authToken=o),isBrowser$3&&e.isEditing&&(this.bindMessageListeners(),parent.postMessage({type:"builder.animatorOptions",data:{options:{version:2}}},"*")),isIframe&&this.messageFrameLoaded(),this.canTrack$.subscribe((function(e){if(e){if("undefined"!=typeof sessionStorage)try{sessionStorage.getItem(sessionStorageKey)||sessionStorage.setItem(sessionStorageKey,s.sessionId)}catch(e){console.debug("Session storage error",e)}s.eventsQueue.length&&s.throttledClearEventsQueue(),s.cookieQueue.length&&(s.cookieQueue.forEach((function(e){s.setCookie(e[0],e[1])})),s.cookieQueue.length=0)}})),isBrowser$3){this.setTestsFromUrl(),this.getOverridesFromQueryString();var l=this.getCookie(e.attributesCookieName);if(l)try{var u=JSON.parse(l);this.setUserAttributes(u)}catch(e){console.debug("Error parsing user attributes cookie",e)}}}return e.register=function(t,n){"plugin"===t&&(n=this.serializeIncludingFunctions(n,!0));var r=this.registry[t];if(r||(r=this.registry[t]=[]),r.push(n),e.isBrowser){var i={type:"builder.register",data:{type:t,info:n}};try{parent.postMessage(i,"*"),parent!==window&&window.postMessage(i,"*")}catch(e){console.debug("Could not postmessage",e)}}this.registryChange.next(this.registry)},e.registerEditor=function(t){if(e.isBrowser){window.postMessage({type:"builder.registerEditor",data:omit$3(t,"component")},"*");var n=location.hostname;e.isTrustedHost(n)||console.error("Builder.registerEditor() called in the wrong environment! You cannot load custom editors from your app, they must be loaded through the Builder.io app itself. Follow the readme here for more details: https://github.com/builderio/builder/tree/master/plugins/cloudinary or contact chat us in our Spectrum community for help: https://spectrum.chat/builder")}this.editors.push(t)},e.registerPlugin=function(e){this.plugins.push(e)},e.registerAction=function(t){var n;if(this.actions.push(t),e.isBrowser){var r=JSON.parse(JSON.stringify(t));t.action&&(r.action=t.action.toString()),null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.registerAction",data:r},"*")}},e.registerTrustedHost=function(e){this.trustedHosts.push(e)},e.setServerContext=function(e){this.serverContext=e},e.isTrustedHost=function(e){return this.trustedHosts.findIndex((function(t){return t.startsWith("*.")?e.endsWith(t.slice(1)):t===e}))>-1},e.isTrustedHostForEvent=function(t){if("null"===t.origin)return!1;var n=parse(t.origin);return n.hostname&&e.isTrustedHost(n.hostname)},e.runAction=function(e){if(!("string"==typeof e?find(this.actions,(function(t){return t.name===e})):e))throw new Error("Action not found: ".concat(e))},e.fields=function(e,t){var n;null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.fields",data:{name:e,fields:t}},"*")},e.set=function(t){e.register("editor.settings",t)},e.import=function(t){if(e.isBrowser){var n=window.System;if(n)return n.import("https://cdn.builder.io/systemjs/".concat(t));console.warn("System.js not available. Please include System.js when using Builder.import")}else console.warn("Builder.import used on the server - this should only be used in the browser")},Object.defineProperty(e,"editingPage",{get:function(){return this._editingPage},set:function(e){this._editingPage=e,isBrowser$3&&isIframe&&(e?document.body.classList.add("builder-editing-page"):document.body.classList.remove("builder-editing-page"))},enumerable:!1,configurable:!0}),e.serializeIncludingFunctions=function(e,t){var n=JSON.parse(JSON.stringify(e,(function(e,n){var r,i,o;return"function"!=typeof n||t&&"onSave"===e?n:(r=n.toString().trim(),i=/^[a-zA-Z0-9_]+\s*=>/i.test(r),o=!(r.startsWith("function")||r.startsWith("async")||r.startsWith("(")||i),"return (".concat(o?"function ":"").concat(r,").apply(this, arguments)"))})));return t&&(n.onSave=e.onSave),n},e.prepareComponentSpecToSend=function(e){return __assign(__assign({},this.serializeIncludingFunctions(e)),{class:void 0})},e.registerBlock=function(e,t){this.registerComponent(e,t)},e.registerComponent=function(e,t){var n,r=__assign(__assign({class:e},e.builderOptions),t);if(this.addComponent(r),t.models&&this.singletonInstance.editingModel?isBrowser$3&&t.models.includes(this.singletonInstance.editingModel):isBrowser$3){var i=this.prepareComponentSpecToSend(r);null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.registerComponent",data:i},"*")}},e.addComponent=function(e){var t=find(this.components,(function(t){return t.name===e.name}));if(t){if(t.class&&!e.class)return;this.components.splice(this.components.indexOf(t),1,e)}else this.components.push(e)},e.component=function(e){var t=this;return void 0===e&&(e={}),function(n){var r,i=__assign(__assign({},e),{class:n});i.name||(i.name=n.name),t.addComponent(i);var o=t.prepareComponentSpecToSend(i);return isBrowser$3&&(null===(r=window.parent)||void 0===r||r.postMessage({type:"builder.registerComponent",data:o},"*")),n}},Object.defineProperty(e,"Component",{get:function(){return this.component},enumerable:!1,configurable:!0}),e.prototype.processEventsQueue=function(){if(this.eventsQueue.length){var t=this.eventsQueue;this.eventsQueue=[];for(var n=__assign(__assign({},e.overrideUserAttributes),this.trackingUserAttributes),r=0,i=t;r<i.length;r++){var o=i[r];o.data.metadata||(o.data.metadata={}),o.data.metadata.user||(o.data.metadata.user={}),Object.assign(o.data.metadata.user,n,o.data.metadata.user)}var a=this.host;getFetch()("".concat(a,"/api/v1/track"),{method:"POST",body:JSON.stringify({events:t}),headers:__assign({"content-type":"application/json"},this.getSdkHeaders()),mode:"cors"}).catch((function(){}))}},Object.defineProperty(e.prototype,"browserTrackingDisabled",{get:function(){return e.isBrowser&&Boolean(window.builderNoTrack||!navigator.cookieEnabled)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canTrack",{get:function(){return this.canTrack$.value},set:function(e){this.hasOverriddenCanTrack=!0,this.canTrack!==e&&this.canTrack$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiVersion",{get:function(){return this.apiVersion$.value},set:function(e){this.apiVersion!==e&&this.apiVersion$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiEndpoint",{get:function(){return this.apiEndpoint$.value},set:function(e){this.apiEndpoint!==e&&this.apiEndpoint$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"editingMode",{get:function(){return this.editingMode$.value},set:function(e){e!==this.editingMode&&this.editingMode$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"editingModel",{get:function(){return this.editingModel$.value},set:function(e){e!==this.editingModel&&this.editingModel$.next(e)},enumerable:!1,configurable:!0}),e.prototype.findParentElement=function(e,t,n){if(void 0===n&&(n=!0),!(e instanceof HTMLElement))return null;var r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},e.prototype.findBuilderParent=function(e){return this.findParentElement(e,(function(e){var t=e.getAttribute("builder-id")||e.id;return Boolean(t&&0===t.indexOf("builder-"))}))},e.prototype.setUserAgent=function(e){this.userAgent=e||""},e.prototype.setTrackingHook=function(e){this.trackingHooks.push(e)},e.prototype.track=function(t,n,r){if(void 0===n&&(n={}),!isIframe&&isBrowser$3&&!e.isPreviewing){var i=this.apiKey;if(i){for(var o=JSON.parse(JSON.stringify({type:t,data:__assign(__assign({},omit$3(n,"meta")),{metadata:__assign(__assign({sdkVersion:e.VERSION,url:location.href},n.meta),n.metadata),ownerId:i,userAttributes:this.getUserAttributes(),sessionId:this.sessionId,visitorId:this.visitorId})})),a=0,s=this.trackingHooks;a<s.length;a++){var l=(0,s[a])(o,r||{});l&&(o=l)}this.eventsQueue.push(o),this.canTrack&&this.throttledClearEventsQueue()}else console.error('Builder integration error: Looks like the Builder SDK has not been initialized properly (your API key has not been set). Make sure you are calling `builder.init("«YOUR-API-KEY»");` as early as possible in your application\'s code.')}},e.prototype.getSessionId=function(){var t=this,n=null;try{e.isBrowser&&"undefined"!=typeof sessionStorage&&(n=this.getCookie(sessionStorageKey))}catch(e){console.debug("Session storage error",e)}return n||(n=uuid()),e.isBrowser&&setTimeout((function(){try{t.canTrack&&t.setCookie(sessionStorageKey,n,datePlusMinutes(30))}catch(e){console.debug("Cookie setting error",e)}})),n},e.prototype.getVisitorId=function(){var t=this;if(this.visitorId)return this.visitorId;var n=null;try{e.isBrowser&&"undefined"!=typeof localStorage&&(n=localStorage.getItem(localStorageKey))}catch(e){console.debug("Local storage error",e)}return n||(n=uuid()),this.visitorId=n,e.isBrowser&&setTimeout((function(){try{t.canTrack&&"undefined"!=typeof localStorage&&n&&localStorage.setItem(localStorageKey,n)}catch(e){console.debug("Session storage error",e)}})),n},e.prototype.trackImpression=function(t,n,r,i){isIframe||!isBrowser$3||e.isPreviewing||this.track("impression",{contentId:t,variationId:n!==t?n:void 0,metadata:r},i)},e.prototype.trackConversion=function(t,n,r,i,o){if(!isIframe&&isBrowser$3&&!e.isPreviewing){var a="object"==typeof n?n:i,s="string"==typeof n?n:void 0;this.track("conversion",{amount:t,variationId:r,meta:a,contentId:s},o)}},Object.defineProperty(e.prototype,"isDevelopmentEnv",{get:function(){return e.isIframe||e.isBrowser&&("localhost"===location.hostname||""!==location.port)||"production"!==this.env},enumerable:!1,configurable:!0}),e.prototype.trackInteraction=function(t,n,r,i,o){if(void 0===r&&(r=!1),!isIframe&&isBrowser$3&&!e.isPreviewing){var a=i&&i.target,s=a&&this.findBuilderParent(a),l={};if(i){var u=i.clientX,c=i.clientY;if(a){var d=u-(m=a.getBoundingClientRect()).left,p=c-m.top,f=v(d/m.width),h=v(p/m.height);l.targetOffset={x:f,y:h}}if(s){var m;d=u-(m=s.getBoundingClientRect()).left,p=c-m.top,f=v(d/m.width),h=v(p/m.height);l.builderTargetOffset={x:f,y:h}}}var g=s&&(s.getAttribute("builder-id")||s.id);g&&s&&(l.builderElementIndex=[].slice.call(document.getElementsByClassName(g)).indexOf(s)),this.track("click",{contentId:t,metadata:l,variationId:n!==t?n:void 0,unique:!r,targetBuilderElement:g||void 0},o)}function v(e){return Math.round(1e3*e)/1e3}},e.prototype.component=function(t){return void 0===t&&(t={}),e.component(t)},Object.defineProperty(e.prototype,"apiKey",{get:function(){return this.apiKey$.value},set:function(e){this.apiKey$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"authToken",{get:function(){return this.authToken$.value},set:function(e){this.authToken$.next(e)},enumerable:!1,configurable:!0}),e.prototype.modifySearch=function(e){return e.replace(/(^|&|\?)(builder_.*?)=/gi,(function(e,t,n){return t+n.replace(/_/g,".")+"="}))},e.prototype.setTestsFromUrl=function(){var e=this.getLocation().search;try{var t=QueryString.parseDeep(this.modifySearch(e||"").substr(1)),n=t.builder&&t.builder.tests;if(n&&"object"==typeof n)for(var r in n)n.hasOwnProperty(r)&&this.setTestCookie(r,n[r])}catch(e){console.debug("Error parsing tests from URL",e)}},e.prototype.resetOverrides=function(){e.overrideUserAttributes={},this.cachebust=!1,this.noCache=!1,this.preview=!1,this.editingModel=null,this.overrides={},this.env="production",this.userAgent="",this.request=void 0,this.response=void 0},e.prototype.getOverridesFromQueryString=function(){var t=this.getLocation();try{var n=QueryString.parseDeep(this.modifySearch(t.search||"").substr(1)),r=n.builder;if(r){var i=r.userAttributes,o=r.overrides,a=r.env,s=(r.host,r.api),l=r.cachebust,u=r.noCache,c=r.preview,d=r.editing,p=r.frameEditing,f=r.options,h=r.params;if(i&&this.setUserAttributes(i),f&&(this.queryOptions=__assign(__assign(__assign({},f.locale&&{locale:f.locale}),f.includeRefs&&{includeRefs:f.includeRefs}),f.enrich&&{enrich:f.enrich})),o&&(this.overrides=o),validEnvList.indexOf(a||s)>-1&&(this.env=a||s),e.isEditing){var m=p||d||c;m&&"true"!==m&&(this.editingModel=m)}l&&(this.cachebust=!0),u&&(this.noCache=!0),c&&(this.preview=!0),n&&(this.overrideParams=h)}}catch(e){console.debug("Error parsing overrides from URL",e)}},e.prototype.messageFrameLoaded=function(){var e;null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.loaded",data:{value:!0}},"*")},e.prototype.bindMessageListeners=function(){var t=this;addEventListener("message",(function(n){var r,i,o,a;if(e.isTrustedHostForEvent(n)){var s=n.data;if(s)switch(s.type){case"builder.ping":null===(r=window.parent)||void 0===r||r.postMessage({type:"builder.pong",data:{}},"*");break;case"builder.register":if(n.source===window)break;var l=s.data;if(!l)break;var u=l.type,c=l.info,d=e.registry[u];d||(d=e.registry[u]=[]),d.push(c),e.registryChange.next(e.registry);break;case"builder.settingsChange":if(n.source===window)break;var p=s.data;if(!p)break;Object.assign(e.settings,p),e.settingsChange.next(e.settings);break;case"builder.registerEditor":if(n.source===window)break;var f=s.data;if(!f)break;var h=!!f.component;e.editors.every((function(t,n){return f.name!==t.name||(t.component&&!h||(e.editors[n]=t),!1)}));break;case"builder.triggerAnimation":e.animator.triggerAnimation(s.data);break;case"builder.contentUpdate":var m=s.data.key||s.data.alias||s.data.entry||s.data.modelName,g=s.data.data,v=t.observersByKey[m];v&&!t.noEditorUpdates[m]&&v.next([g]);break;case"builder.getComponents":null===(i=window.parent)||void 0===i||i.postMessage({type:"builder.components",data:e.components.map((function(t){return e.prepareComponentSpecToSend(t)}))},"*");break;case"builder.editingModel":t.editingModel=s.data.model;break;case"builder.registerComponent":var b=s.data;e.addComponent(b);break;case"builder.blockContentLoading":"string"==typeof s.data.model&&(t.blockContentLoading=s.data.model);break;case"builder.editingMode":s.data?(t.editingMode=!0,document.body.classList.add("builder-editing")):(t.editingMode=!1,document.body.classList.remove("builder-editing"));break;case"builder.editingPageMode":var y=s.data;e.editingPage=y;break;case"builder.overrideUserAttributes":var k=s.data;assign(e.overrideUserAttributes,k),t.flushGetContentQueue(!0);break;case"builder.overrideTestGroup":var w=s.data,S=w.variationId,_=w.contentId;S&&_&&(t.setTestCookie(_,S),t.flushGetContentQueue(!0));break;case"builder.evaluate":var x=s.data.text,C=s.data.arguments||[],E=s.data.id,B=new Function(x),T=void 0,P=null;try{T=B.apply(t,C)}catch(e){P=toError$1(e)}P?null===(o=window.parent)||void 0===o||o.postMessage({type:"builder.evaluateError",data:{id:E,error:P.message}},"*"):T&&"function"==typeof T.then?T.then((function(e){var t;null===(t=window.parent)||void 0===t||t.postMessage({type:"builder.evaluateResult",data:{id:E,result:e}},"*")})).catch(console.error):null===(a=window.parent)||void 0===a||a.postMessage({type:"builder.evaluateResult",data:{result:T,id:E}},"*")}}}))},Object.defineProperty(e.prototype,"defaultCanTrack",{get:function(){return Boolean(e.isBrowser&&navigator.userAgent.trim()&&!navigator.userAgent.match(/bot|crawler|spider|robot|crawling|prerender|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex|phantom|headless|selenium|puppeteer/i)&&!this.browserTrackingDisabled)},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t,n,r,i,o){return void 0===t&&(t=this.defaultCanTrack),n&&(this.request=n),r&&(this.response=r),this.hasOverriddenCanTrack||(this.canTrack=t),this.apiKey=e,i&&(this.authToken=i),o&&(this.apiVersion=o),this},Object.defineProperty(e.prototype,"previewingModel",{get:function(){var e=this.getLocation().search;return QueryString.parse((e||"").substr(1))["builder.preview"]},enumerable:!1,configurable:!0}),e.prototype.getLocation=function(){var e,t={};return this.request?t=parse(null!==(e=this.request.url)&&void 0!==e?e:""):"object"==typeof location&&(t=parse(location.href)),""===t.pathname&&(t.pathname="/"),t},e.prototype.getUserAttributes=function(t){void 0===t&&(t=this.userAgent||"");var n={Android:function(){return t.match(/Android/i)},BlackBerry:function(){return t.match(/BlackBerry/i)},iOS:function(){return t.match(/iPhone|iPod/i)},Opera:function(){return t.match(/Opera Mini/i)},Windows:function(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any:function(){return n.Android()||n.BlackBerry()||n.iOS()||n.Opera()||n.Windows()}},r=t.match(/Tablet|iPad/i),i=this.getLocation();return __assign({urlPath:i.pathname,host:i.host||i.hostname,device:r?"tablet":n.any()?"mobile":"desktop"},e.overrideUserAttributes)},e.prototype.setUserAttributes=function(t){assign(e.overrideUserAttributes,t),this.canTrack&&this.setCookie(e.attributesCookieName,JSON.stringify(this.getUserAttributes())),this.userAttributesChanged.next(t)},e.prototype.setTrackingUserAttributes=function(e){assign(this.trackingUserAttributes,e)},e.prototype.get=function(t,n){var r;void 0===n&&(n={});var i=this,o=n.locale||(null===(r=n.userAttributes)||void 0===r?void 0:r.locale)||this.getUserAttributes().locale;"noTraverse"in n||(n.noTraverse=!1);var a=__assign(__assign({},n),o&&{locale:String(o),userAttributes:__assign({locale:String(o)},n.userAttributes)});return e.isBrowser?(n.apiKey&&!this.apiKey&&(this.apiKey=n.apiKey),n.authToken&&!this.authToken&&(this.authToken=n.authToken),n.apiVersion&&!this.apiVersion&&(this.apiVersion=n.apiVersion)):((i=new e(n.apiKey||this.apiKey,n.req,n.res,void 0,n.authToken||this.authToken,n.apiVersion||this.apiVersion)).apiEndpoint=this.apiEndpoint,i.setUserAttributes(this.getUserAttributes())),i.queueGetContent(t,a).map((function(t){var n=t&&t[0];if(e.isStatic)return n;var r=n&&n.data;return r?(void 0!==r.blocksString&&(r.blocks=JSON.parse(r.blocksString),delete r.blocksString),{data:r,id:n.id,variationId:n.testVariationId||n.variationId||null,testVariationId:n.testVariationId||n.variationId||null,testVariationName:n.testVariationName||null,lastUpdated:n.lastUpdated||null}):null}))},e.prototype.queueGetContent=function(t,n){var r=this;void 0===n&&(n={});var i=n.key||n.alias||t,o=this.editingModel===t,a=this.observersByKey[i];"DEMO"!==this.apiKey||this.overrides[i]||n.initialContent||(n.initialContent=[]);var s=n.initialContent;if(a&&(!a.value||n.cache))return a.value&&nextTick$1((function(){a.next(a.value)})),a;if(o&&e.isBrowser&&parent.postMessage({type:"builder.updateContent",data:{options:n}},"*"),!s)if(this.getContentQueue||(this.getContentQueue=[]),this.getContentQueue.push(__assign(__assign({},n),{model:t,key:i})),this.getContentQueue&&this.getContentQueue.length>=this.contentPerRequest){var l=this.getContentQueue.slice();this.getContentQueue=[],nextTick$1((function(){r.flushGetContentQueue(!1,l)}))}else nextTick$1((function(){r.flushGetContentQueue()}));var u=new BehaviorSubject(null);return this.observersByKey[i]=u,n.noEditorUpdates&&(this.noEditorUpdates[i]=!0),s&&nextTick$1((function(){u.next(s)})),u},e.prototype.requestUrl=function(e,t){return getFetch()(e,this.addSdkHeaders(t)).then((function(e){return e.json()}))},Object.defineProperty(e.prototype,"host",{get:function(){switch(this.env){case"qa":return"https://qa.builder.io";case"test":return"https://builder-io-test.web.app";case"fast":return"https://fast.builder.io";case"cloud":return"https://cloud.builder.io";case"cdn2":return"https://cdn2.builder.io";case"cdn-qa":return"https://cdn-qa.builder.io";case"development":case"dev":return"http://localhost:5000";case"cdn-prod":return"https://cdn.builder.io";default:return e.overrideHost||"https://cdn.builder.io"}},enumerable:!1,configurable:!0}),e.prototype.getSdkHeaders=function(){return e.sdkInfo?{"X-Builder-SDK":e.sdkInfo.name,"X-Builder-SDK-GEN":"1","X-Builder-SDK-Version":e.sdkInfo.version}:{}},e.prototype.addSdkHeaders=function(e){return __assign(__assign({},e),{headers:__assign(__assign({},e.headers),this.getSdkHeaders())})},e.prototype.makeFetchApiCall=function(e,t){return getFetch()(e,this.addSdkHeaders(t))},e.prototype.flattenMongoQuery=function(e,t,n){for(var r in void 0===n&&(n={}),e){var i=e[r],o=t?t+"."+r:r;!i||"object"!=typeof i||Array.isArray(i)||Object.keys(i).find((function(e){return e.startsWith("$")}))?n[o]=i:this.flattenMongoQuery(i,o,n)}return n},e.prototype.flushGetContentQueue=function(t,n){var r,i,o=this;if(void 0===t&&(t=!1),!this.apiKey)throw new Error("Fetching content failed, expected apiKey to be defined instead got: ".concat(this.apiKey));if(this.apiVersion){if(!["v1","v3"].includes(this.apiVersion))throw new Error("Invalid apiVersion: expected 'v1' or 'v3', received '".concat(this.apiVersion,"'"))}else this.apiVersion=DEFAULT_API_VERSION;if(t||this.getContentQueue){var a=n||(t?this.priorContentQueue:this.getContentQueue)||[];this.getOverridesFromQueryString();var s=__assign(__assign({omit:null!==(r=a[0].omit)&&void 0!==r?r:"meta.componentsUsed",apiKey:this.apiKey},a[0].options),this.queryOptions);a[0].locale&&(s.locale=a[0].locale),a[0].fields&&(s.fields=a[0].fields),a[0].format&&(s.format=a[0].format),"noTraverse"in a[0]&&(s.noTraverse=a[0].noTraverse),"includeUnpublished"in a[0]&&(s.includeUnpublished=a[0].includeUnpublished),a[0].sort&&(s.sort=a[0].sort);var l=("undefined"!=typeof location?QueryString.parseDeep(location.search.substr(1)):void 0)||{},u=a&&a[0].userAttributes?a[0].userAttributes:this.targetContent?this.getUserAttributes():{urlPath:this.getLocation().pathname};if(a.find((function(e){return!!e.includeUrl}))){var c=this.getLocation();c.origin&&(s.url="".concat(c.origin).concat(c.pathname).concat(c.search))}var d=null==n?void 0:n.find((function(e){return e.url}));if((null==d?void 0:d.url)&&(u.urlPath=d.url.split("?")[0]),s.userAttributes=JSON.stringify(u),t||n||(this.priorContentQueue=a,this.getContentQueue=null),(this.cachebust||isIframe||l.cachebust||l["builder.cachebust"]||"production"!==this.env)&&(s.cachebust=!0),e.isEditing&&(s.isEditing=!0),(this.noCache||"production"!==this.env)&&(s.noCache=!0),size$2(this.overrides))for(var p in this.overrides)this.overrides.hasOwnProperty(p)&&(s["overrides.".concat(p)]=this.overrides[p]);for(var f=0,h=a;f<h.length;f++){var m=h[f],g=m.format;g&&(s.format=g),m.static&&(s.static=m.static),m.cachebust&&(s.cachebust=m.cachebust),isPositiveNumber(m.cacheSeconds)&&(s.cacheSeconds=m.cacheSeconds),isPositiveNumber(m.staleCacheSeconds)&&(s.staleCacheSeconds=m.staleCacheSeconds),"content"===this.apiEndpoint&&(s.includeRefs=!0);for(var v=0,b=["prerender","extractCss","limit","offset","query","preview","model","entry","rev","static","includeRefs"];v<b.length;v++){var y=m[p=b[v]];void 0!==y&&("query"===this.apiEndpoint?(s.options=s.options||{},s.options[m.key]=s.options[m.key]||{},s.options[m.key][p]=JSON.stringify(y)):s[p]=JSON.stringify(y))}}this.preview&&this.previewingModel===(null===(i=null==a?void 0:a[0])||void 0===i?void 0:i.model)&&(s.preview="true");var k=Object.keys(s).length>0,w=this.host,S=a.map((function(e){return encodeURIComponent(e.key)})).join(",");if(this.overrideParams)assign(s,omit$3(QueryString.parse(this.overrideParams),"apiKey"));var _=s.format,x="solid"===_||"react"===_,C=x||"query"===this.apiEndpoint;if("content"===this.apiEndpoint&&a[0].query){var E=this.flattenMongoQuery({query:a[0].query});for(var p in E)s[p]=E[p];delete s.query}var B,T=QueryString.stringifyDeep(s),P=__assign({headers:{}},a[0].fetchOptions);return this.authToken&&(P.headers=__assign(__assign({},P.headers),{Authorization:"Bearer ".concat(this.authToken)})),B=x?"".concat(w,"/api/v1/codegen/").concat(this.apiKey,"/").concat(S):"query"===this.apiEndpoint?"".concat(w,"/api/v3/query/").concat(this.apiKey,"/").concat(S):"".concat(w,"/api/v3/content/").concat(a[0].model),B+=s&&k?"?".concat(T):"",this.makeFetchApiCall(B,P).then((function(e){return e.json()})).then((function(t){for(var n=0,r=a;n<r.length;n++){var i=r[n],s=i.key;if(i.model!==o.blockContentLoading||i.noEditorUpdates){o.editingModel===i.model&&e.isEditing&&parent.postMessage({type:"builder.updateContent",data:{options:i}},"*");var l=o.observersByKey[s];if(!l)return;var u=C?t[s]:t.results,c=u;if(u){var d=e.isServer?c:o.processResultsForTests(c);l.next(d)}else{if((o.getLocation().search||"").includes("builder.preview="+i.model)){l.next([{id:"preview",name:"Preview",data:{}}])}l.next([])}}}}),(function(e){for(var t=0,n=a;t<n.length;t++){var r=n[t],i=o.observersByKey[r.key];if(!i)return;i.error(e)}}))}},e.prototype.processResultsForTests=function(e){var t,n=this,r=e.map((function(e){if(!e.variations)return e;var t=n.getTestCookie(e.id),r=t===e.id?e:e.variations[t];if(r)return __assign(__assign({},e),{data:r.data,variationId:t,testVariationId:t,testVariationName:r.name});if(n.canTrack&&e.variations&&size$2(e.variations)){var i=0,o=Math.random();for(var a in e.variations){var s=e.variations[a];if(o<(i+=s.testRatio)){n.setTestCookie(e.id,s.id);var l=s.name||(s.id===e.id?"Default variation":"");return __assign(__assign({},e),{data:s.data,variationId:s.id,testVariationId:s.id,variationName:l,testVariationName:l})}}n.setTestCookie(e.id,e.id)}return __assign(__assign(__assign({},e),{variationId:e.id}),e.variations&&size$2(e.variations)&&{testVariationId:e.id,testVariationName:"Default variation"})}));return isIframe&&(null===(t=window.parent)||void 0===t||t.postMessage({type:"builder.contentResults",data:{results:r}},"*")),r},e.prototype.getTestCookie=function(e){return this.getCookie("".concat(this.testCookiePrefix,".").concat(e))},e.prototype.setTestCookie=function(e,t){if(this.canTrack){var n=new Date;return n.setDate(n.getDate()+30),this.setCookie("".concat(this.testCookiePrefix,".").concat(e),t,n)}this.cookieQueue.push([e,t])},e.prototype.getCookie=function(t){return this.cookies?this.cookies.get(t):e.isBrowser&&getCookie(t)},e.prototype.setCookie=function(t,n,r){return!this.cookies||e.isServer&&e.isStatic?e.isBrowser&&setCookie(t,n,r):this.cookies.set(t,n,{expires:r,secure:"https:"===this.getLocation().protocol})},e.prototype.getContent=function(e,t){if(void 0===t&&(t={}),!this.apiKey)throw new Error("Fetching content from model ".concat(e," failed, expected apiKey to be defined instead got: ").concat(this.apiKey));return this.queueGetContent(e,t)},e.prototype.getAll=function(t,n){void 0===n&&(n={});var r=this;return e.isBrowser?(n.apiKey&&!this.apiKey&&(this.apiKey=n.apiKey),n.authToken&&!this.authToken&&(this.authToken=n.authToken),n.apiVersion&&!this.apiVersion&&(this.apiVersion=n.apiVersion)):(r=new e(n.apiKey||this.apiKey,n.req,n.res,!1,n.authToken||this.authToken,n.apiVersion||this.apiVersion)).setUserAttributes(this.getUserAttributes()),"noTraverse"in n||(n.noTraverse=!0),r.getContent(t,__assign(__assign({limit:30},n),{key:n.key||e.isBrowser?"".concat(t,":").concat(hashSum$1(omit$3(n,"initialContent","req","res"))):void 0})).promise()},e.VERSION=SDK_VERSION,e.components=[],e.isStatic=!0,e.animator=new Animator,e.nextTick=nextTick$1,e.throttle=throttle$1,e.editors=[],e.trustedHosts=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"],e.plugins=[],e.actions=[],e.registry={},e.attributesCookieName="builder.userAttributes",e.registryChange=new BehaviorSubject({}),e._editingPage=!1,e.isIframe=isIframe,e.isBrowser=isBrowser$3,e.isReactNative=isReactNative,e.isServer=!isBrowser$3&&!isReactNative,e.previewingModel=e.isBrowser&&getQueryParam(location.href,"builder.preview"),e.settings={},e.settingsChange=new BehaviorSubject({}),e.isEditing=Boolean(isIframe&&(document.referrer&&document.referrer.match(/builder\.io|localhost:1234/)||-1!==location.search.indexOf("builder.frameEditing="))),e.isPreviewing=Boolean(isBrowser$3&&(-1!==location.search.indexOf("builder.preview=")||-1!==location.search.indexOf("builder.frameEditing="))),e.isReact=!1,e.sdkInfo=void 0,e.overrideUserAttributes={},e}(),builder=new Builder(null,void 0,void 0,!0);function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define("@builder.io/react",["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).BuilderReact={})}(this,(function(exports){"use strict";var SDK_VERSION$1="8.2.4",_a;"undefined"!=typeof window&&(null===(_a=window.parent)||void 0===_a||_a.postMessage({type:"builder.isReactSdk",data:{value:!0,supportsPatchUpdates:"v4",supportsCustomBreakpoints:!0,supportsXSmallBreakpoint:!0,supportsGlobalSymbols:!0,blockLevelPersonalization:!0,version:SDK_VERSION$1}},"*"));var extendStatics=function(e,t){return(extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var __assign=function(){return(__assign=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function __rest(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function __decorate(e,t,n,r){var i,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(a=(o<3?i(a):o>3?i(t,n,a):i(t,n))||a);return o>3&&a&&Object.defineProperty(t,n,a),a}function __metadata(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function __awaiter(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{l(r.next(e))}catch(e){o(e)}}function s(e){try{l(r.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}l((r=r.apply(e,t||[])).next())}))}function __generator(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __spreadArray(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}function pad$1(e,t){for(;e.length<t;)e="0"+e;return e}function fold$1(e,t){var n,r;if(0===t.length)return e;for(n=0,r=t.length;n<r;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e<0?-2*e:e}function foldObject$1(e,t,n){return Object.keys(t).sort().reduce((function(e,r){return foldValue$1(e,t[r],r,n)}),e)}function foldValue$1(e,t,n,r){var i=fold$1(fold$1(fold$1(e,n),toString$2(t)),typeof t);if(null===t)return fold$1(i,"null");if(void 0===t)return fold$1(i,"undefined");if("object"==typeof t||"function"==typeof t){if(-1!==r.indexOf(t))return fold$1(i,"[Circular]"+n);r.push(t);var o=foldObject$1(i,t,r);if(!("valueOf"in t)||"function"!=typeof t.valueOf)return o;try{return fold$1(o,String(t.valueOf()))}catch(e){return fold$1(o,"[valueOf exception]"+(e.stack||e.message))}}return fold$1(i,t.toString())}function toString$2(e){return Object.prototype.toString.call(e)}function sum$1(e){return pad$1(foldValue$1(0,e,"",[]).toString(16),8)}"function"==typeof SuppressedError&&SuppressedError;var hashSum$1=sum$1;!function(){if("undefined"==typeof window||"function"==typeof window.CustomEvent)return!1;window.CustomEvent=function(e,t){t=t||{bubbles:!1,cancelable:!1,detail:null};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}}();var isSafari="undefined"!=typeof window&&/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent),isClient="undefined"!=typeof window;function nextTick$1(e){if(isClient&&!isSafari&&"undefined"!=typeof MutationObserver){var t=0,n=new MutationObserver((function(){return e()})),r=document.createTextNode("");n.observe(r,{characterData:!0}),r.data=String(t=++t)}else setTimeout(e)}var PROPERTY_NAME_DENY_LIST=Object.freeze(["__proto__","prototype","constructor"]),QueryString=function(){function e(){}return e.parseDeep=function(e){var t=this.parse(e);return this.deepen(t)},e.stringifyDeep=function(e){var t=this.flatten(e);return this.stringify(t)},e.parse=function(e){for(var t={},n=("?"===e[0]?e.substr(1):e).split("&"),r=0;r<n.length;r++){var i=n[r].split("=");try{t[decodeURIComponent(i[0])]=decodeURIComponent(i[1]||"")}catch(e){}}return t},e.stringify=function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];t&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(r)}return t},e.deepen=function(e){var t={};for(var n in e){for(var r=t,i=n.split("."),o=i.pop(),a=0,s=i;a<s.length;a++){var l=s[a];assertAllowedPropertyName(l),r=r[l]=r[l]||{}}r[o]=e[n]}return t},e.flatten=function(e,t,n){for(var r in void 0===n&&(n={}),e){var i=e[r],o=t?t+"."+r:r;i&&"object"==typeof i?this.flatten(i,o,n):n[o]=i}return n},e}();function assertAllowedPropertyName(e){if(PROPERTY_NAME_DENY_LIST.indexOf(e)>=0)throw new Error('Property name "'.concat(e,'" is not allowed'))}var Subscription=function(){function e(e,t){this.listeners=e,this.listener=t,this.unsubscribed=!1,this.otherSubscriptions=[]}return Object.defineProperty(e.prototype,"closed",{get:function(){return this.unsubscribed},enumerable:!1,configurable:!0}),e.prototype.add=function(e){this.otherSubscriptions.push(e)},e.prototype.unsubscribe=function(){if(!this.unsubscribed){if(this.listener&&this.listeners){var e=this.listeners.indexOf(this.listener);e>-1&&this.listeners.splice(e,1)}this.otherSubscriptions.forEach((function(e){return e.unsubscribe()})),this.unsubscribed=!0}},e}(),BehaviorSubject=function(){function e(e){var t=this;this.value=e,this.listeners=[],this.errorListeners=[],this.then=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];return(e=t.toPromise()).then.apply(e,n)}}return e.prototype.next=function(e){this.value=e;for(var t=0,n=this.listeners;t<n.length;t++){(0,n[t])(e)}},e.prototype.map=function(t){var n=new e(t(this.value));return this.subscribe((function(e){n.next(t(e))})),this.catch((function(e){n.error(e)})),n},e.prototype.catch=function(e){return this.errorListeners.push(e),new Subscription(this.errorListeners,e)},e.prototype.error=function(e){for(var t=0,n=this.errorListeners;t<n.length;t++){(0,n[t])(e)}},e.prototype.subscribe=function(e,t){return this.listeners.push(e),t&&this.errorListeners.push(t),new Subscription(this.listeners,e)},e.prototype.toPromise=function(){var e=this;return new Promise((function(t,n){var r=e.subscribe((function(e){t(e),r.unsubscribe()}),(function(e){n(e),r.unsubscribe()}))}))},e.prototype.promise=function(){return this.toPromise()},e}(),State={Pending:"Pending",Fulfilled:"Fulfilled",Rejected:"Rejected"};function isFunction(e){return e&&"function"==typeof e}function isObject(e){return e&&"object"==typeof e}var TinyPromise=function(){function e(e){this._state=State.Pending,this._handlers=[],this._value=null,e(this._resolve.bind(this),this._reject.bind(this))}return e.prototype._resolve=function(t){var n=this;if(t instanceof e)t.then(this._resolve.bind(this),this._reject.bind(this));else if(isObject(t)||isFunction(t)){var r=!1;try{var i=t.then;isFunction(i)?i.call(t,(function(e){r||n._resolve(e),r=!0}),(function(e){r||n._reject(e),r=!0})):this._fulfill(t)}catch(e){r||this._reject(e)}}else this._fulfill(t)},e.prototype._fulfill=function(e){var t=this;this._state=State.Fulfilled,this._value=e,this._handlers.forEach((function(e){return t._callHandler(e)}))},e.prototype._reject=function(e){var t=this;this._state=State.Rejected,this._value=e,this._handlers.forEach((function(e){return t._callHandler(e)}))},e.prototype._isPending=function(){return this._state===State.Pending},e.prototype._isFulfilled=function(){return this._state===State.Fulfilled},e.prototype._isRejected=function(){return this._state===State.Rejected},e.prototype._addHandler=function(e,t){this._handlers.push({onFulfilled:e,onRejected:t})},e.prototype._callHandler=function(e){this._isFulfilled()&&isFunction(e.onFulfilled)?e.onFulfilled(this._value):this._isRejected()&&isFunction(e.onRejected)&&e.onRejected(this._value)},e.prototype.then=function(t,n){var r=this;switch(this._state){case State.Pending:return new e((function(e,i){r._addHandler((function(n){nextTick$1((function(){try{isFunction(t)?e(t(n)):e(n)}catch(e){i(e)}}))}),(function(t){nextTick$1((function(){try{isFunction(n)?e(n(t)):i(t)}catch(e){i(e)}}))}))}));case State.Fulfilled:return new e((function(e,n){nextTick$1((function(){try{isFunction(t)?e(t(r._value)):e(r._value)}catch(e){n(e)}}))}));case State.Rejected:return new e((function(e,t){nextTick$1((function(){try{isFunction(n)?e(n(r._value)):t(r._value)}catch(e){t(e)}}))}))}},e}(),Promise$1="undefined"!=typeof Promise?Promise:TinyPromise,serverOnlyRequire;try{serverOnlyRequire=eval("require")}catch(e){serverOnlyRequire=function(){return null}}var serverOnlyRequire$1=serverOnlyRequire;function promiseResolve(e){return new Promise$1((function(t){return t(e)}))}function tinyFetch(e,t){return void 0===t&&(t={}),new Promise$1((function(n,r){var i=new XMLHttpRequest;if(i.open(t.method||"get",e,!0),t.headers)for(var o in t.headers)i.setRequestHeader(o,t.headers[o]);function a(){var e=[],t=[],n={},r=void 0;return i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(i,o,a){var s=o;return e.push(s=s.toLowerCase()),t.push([s,a]),r=n[s],n[s]=r?"".concat(r,",").concat(a):a,""})),{ok:2==(i.status/100|0),status:i.status,statusText:i.statusText,url:i.responseURL,clone:a,text:function(){return promiseResolve(i.responseText)},json:function(){return promiseResolve(i.responseText).then(JSON.parse)},blob:function(){return promiseResolve(new Blob([i.response]))},headers:{keys:function(){return e},entries:function(){return t},get:function(e){return n[e.toLowerCase()]},has:function(e){return e.toLowerCase()in n}}}}i.withCredentials="include"===t.credentials,i.onload=function(){n(a())},i.onerror=r,i.send(t.body)}))}function getFetch(){var e=void 0;if(globalThis.fetch)null!=e||(e=globalThis.fetch);else if("undefined"==typeof window)try{null!=e||(e=serverOnlyRequire$1("node-fetch"))}catch(e){console.warn("node-fetch is not installed. consider polyfilling fetch or installing node-fetch."),console.warn(e)}return null!=e?e:tinyFetch}function assign(e){for(var t=Object(e),n=1;n<arguments.length;n++){var r=arguments[n];if(null!=r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t}function throttle$1(e,t,n){var r,i,o;void 0===n&&(n={});var a=null,s=0,l=function(){s=!1===n.leading?0:Date.now(),a=null,o=e.apply(r,i),a||(r=i=null)};return function(){var u=Date.now();s||!1!==n.leading||(s=u);var c=t-(u-s);return r=this,i=arguments,c<=0||c>t?(a&&(clearTimeout(a),a=null),s=u,o=e.apply(r,i),a||(r=i=null)):a||!1===n.trailing||(a=setTimeout(l,c)),o}}var camelCaseToKebabCase$1=function(e){return e?e.replace(/([A-Z])/g,(function(e){return"-".concat(e[0].toLowerCase())})):""},Animator=function(){function e(){}return e.prototype.bindAnimations=function(e){for(var t=0,n=e;t<n.length;t++){var r=n[t];switch(r.trigger){case"pageLoad":this.triggerAnimation(r);break;case"hover":this.bindHoverAnimation(r);break;case"scrollInView":this.bindScrollInViewAnimation(r)}}},e.prototype.warnElementNotPresent=function(e){console.warn("Cannot animate element: element with ID ".concat(e," not found!"))},e.prototype.augmentAnimation=function(e,t){for(var n=this.getAllStylesUsed(e),r=getComputedStyle(t),i=0,o=[e.steps[0].styles,e.steps[e.steps.length-1].styles];i<o.length;i++)for(var a=o[i],s=0,l=n;s<l.length;s++){var u=l[s];u in a||(a[u]=r[u])}},e.prototype.getAllStylesUsed=function(e){for(var t=[],n=0,r=e.steps;n<r.length;n++){var i=r[n];for(var o in i.styles)-1===t.indexOf(o)&&t.push(o)}return t},e.prototype.triggerAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n),n.style.transition="none",n.style.transitionDelay="0",assign(n.style,e.steps[0].styles),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s"),assign(n.style,e.steps[1].styles),setTimeout((function(){n.style.transition="",n.style.transitionDelay=""}),1e3*(e.delay||0)+1e3*e.duration+100)}))})):this.warnElementNotPresent(e.elementId||e.id||"")},e.prototype.bindHoverAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n);var r=e.steps[0].styles,i=e.steps[1].styles;function o(){assign(n.style,r)}o(),n.addEventListener("mouseenter",(function(){assign(n.style,i)})),n.addEventListener("mouseleave",o),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s")}))})):this.warnElementNotPresent(e.elementId||e.id||"")},e.prototype.bindScrollInViewAnimation=function(e){var t=this,n=Array.prototype.slice.call(document.getElementsByClassName(e.elementId||e.id||""));n.length?Array.from(n).forEach((function(n){t.augmentAnimation(e,n);var r=!1,i=!1;function o(){!r&&s(n)?(r=!0,i=!0,setTimeout((function(){assign(n.style,e.steps[1].styles),e.repeat||document.removeEventListener("scroll",a),setTimeout((function(){i=!1,e.repeat||(n.style.transition="",n.style.transitionDelay="")}),1e3*(e.duration+(e.delay||0))+100)}))):e.repeat&&r&&!i&&!s(n)&&(r=!1,assign(n.style,e.steps[0].styles))}var a=throttle$1(o,200,{leading:!1});function s(t){var n=t.getBoundingClientRect(),r=window.innerHeight,i=(e.thresholdPercent||0)/100*r;return n.bottom>i&&n.top<r-i}var l=e.steps[0].styles;assign(n.style,l),setTimeout((function(){n.style.transition="all ".concat(e.duration,"s ").concat(camelCaseToKebabCase$1(e.easing)),e.delay&&(n.style.transitionDelay=e.delay+"s")})),document.addEventListener("scroll",a,{capture:!0,passive:!0}),o()})):this.warnElementNotPresent(e.elementId||e.id||"")},e}(),fieldContentRegExp=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Cookies=function(){function e(e,t){this.request=e,this.response=t}return e.prototype.get=function(e){var t=this.request.headers.cookie;if(t){var n=t.match(getPattern(e));if(n)return n[1]}},e.prototype.set=function(e,t,n){var r=this.response,i=this.request,o=r.getHeader("Set-Cookie")||[],a=void 0!==this.secure?!!this.secure:"https"===i.protocol||i.connection.encrypted,s=new Cookie(e,t,n);if("string"==typeof o&&(o=[o]),!a&&n&&n.secure)throw new Error("Cannot send secure cookie over unencrypted connection");return s.secure=a,n&&"secure"in n&&(s.secure=!!n.secure),pushCookie(o,s),r.setHeader.call(r,"Set-Cookie",o),this},e}(),Cookie=function(){function e(e,t,n){if(this.path="/",this.domain=void 0,this.httpOnly=!0,this.sameSite=!1,this.secure=!1,this.overwrite=!1,this.name="",this.value="",!fieldContentRegExp.test(e))throw new TypeError("argument name is invalid");if(t&&!fieldContentRegExp.test(t))throw new TypeError("argument value is invalid");t||(this.expires=new Date(0)),this.name=e,this.value=t||"",n.expires&&(this.expires=n.expires),n.secure&&(this.secure=n.secure)}return e.prototype.toString=function(){return"".concat(this.name,"=").concat(this.value)},e.prototype.toHeader=function(){var e=this.toString();return this.maxAge&&(this.expires=new Date(Date.now()+this.maxAge)),this.path&&(e+="; path=".concat(this.path)),this.expires&&(e+="; expires=".concat(this.expires.toUTCString())),this.domain&&(e+="; domain=".concat(this.domain)),e+="; SameSite=".concat(!0===this.sameSite?"strict":"None"),this.secure&&(e+="; secure"),this.httpOnly&&(e+="; httponly"),e},e}();function getPattern(e){return new RegExp("(?:^|;) *".concat(e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),"=([^;]*)"))}function pushCookie(e,t){if(t.overwrite)for(var n=e.length-1;n>=0;n--)0===e[n].indexOf("".concat(t.name,"="))&&e.splice(n,1);e.push(t.toHeader())}function omit$3(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];for(var r=Object.assign({},e),i=0,o=t;i<o.length;i++){var a=o[i];delete r[a]}return r}function uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))}function uuid(){return uuidv4().replace(/-/g,"")}function emptyUrl(){return{query:null,port:null,auth:null,hash:null,host:null,hostname:null,href:null,path:null,pathname:null,protocol:null,search:null,slashes:null}}function parse$1(e){var t,n,r=emptyUrl();return""===e||"/"===e[0]?(n=new URL(e,"http://0.0.0.0/"),r.href=n.href,r.href=null===(t=r.href)||void 0===t?void 0:t.slice(14)):(n=new URL(e),r.href=n.href,r.port=""===n.port?null:n.port,r.hash=""===n.hash?null:n.hash,r.host=n.host,r.hostname=n.hostname,r.href=n.href,r.pathname=n.pathname,r.protocol=n.protocol,r.slashes="/"===e[n.protocol.length]),r.search=n.search,r.query=n.search.slice(1),r.path="".concat(n.pathname).concat(n.search),r.pathname=n.pathname,r}function toError$1(e){return e instanceof Error?e:new Error(String(e))}var DEFAULT_API_VERSION="v3",SDK_VERSION="6.1.0";function datePlusMinutes(e){return void 0===e&&(e=30),new Date(Date.now()+6e4*e)}var isPositiveNumber=function(e){return"number"==typeof e&&!isNaN(e)&&e>=0},isReactNative="object"==typeof navigator&&"ReactNative"===navigator.product,validEnvList=["production","qa","test","development","dev","cdn-qa","cloud","fast","cdn2","cdn-prod"];function getQueryParam(e,t){for(var n=(e.split("?")[1]||"").split("&"),r=0;r<n.length;r++){var i=n[r].split("=");if(decodeURIComponent(i[0])===t)return decodeURIComponent(i[1])}return null}var urlParser={parse:function(e){var t=document.createElement("a");t.href=e;for(var n={},r=0,i=["username","password","host","hostname","port","protocol","origin","pathname","search","hash"];r<i.length;r++){var o=i[r];n[o]=t[o]}return!n.pathname&&""!==n.pathname||"string"!=typeof n.pathname||0===n.pathname.indexOf("/")||(n.pathname="/"+n.pathname),n}},parse=isReactNative?function(){return emptyUrl()}:"object"==typeof window?urlParser.parse:parse$1;function setCookie(e,t,n){try{var r="";n&&(r="; expires="+n.toUTCString());var i=!isBrowser$3||"https:"===location.protocol;document.cookie=e+"="+(t||"")+r+"; path=/"+(i?"; secure; SameSite=None":"")}catch(e){console.warn("Could not set cookie",e)}}function getCookie(e){try{return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*"+encodeURIComponent(e).replace(/[\-\.\+\*]/g,"\\$&")+"\\s*\\=\\s*([^;]*).*$)|^.*$"),"$1"))||null}catch(e){console.warn("Could not get cookie",e)}}function size$2(e){return Object.keys(e).length}function find(e,t){for(var n=e,r=n.length>>>0,i=arguments[1],o=0;o<r;o++){var a=n[o];if(t.call(i,a,o,n))return a}}var sessionStorageKey="builderSessionId",localStorageKey="builderVisitorId",isBrowser$3="undefined"!=typeof window&&!isReactNative,isIframe=isBrowser$3&&window.top!==window.self,Builder=function(){function e(t,n,r,i,o,a){void 0===t&&(t=null),void 0===i&&(i=!1),void 0===o&&(o=null);var s=this;if(this.request=n,this.response=r,this.eventsQueue=[],this.throttledClearEventsQueue=throttle$1((function(){s.processEventsQueue(),s.setCookie(sessionStorageKey,s.sessionId,datePlusMinutes(30))}),5),this.env="production",this.sessionId=this.getSessionId(),this.targetContent=!0,this.contentPerRequest=1,this.allowCustomFonts=!0,this.cookies=null,this.cachebust=!1,this.overrideParams="",this.noCache=!1,this.preview=!1,this.apiEndpoint$=new BehaviorSubject("query"),this.apiVersion$=new BehaviorSubject(void 0),this.canTrack$=new BehaviorSubject(!this.browserTrackingDisabled),this.hasOverriddenCanTrack=!1,this.apiKey$=new BehaviorSubject(null),this.authToken$=new BehaviorSubject(null),this.userAttributesChanged=new BehaviorSubject(null),this.editingMode$=new BehaviorSubject(isIframe),this.editingModel$=new BehaviorSubject(null),this.userAgent="object"==typeof navigator&&navigator.userAgent||"",this.trackingHooks=[],this.visitorId=this.getVisitorId(),this.autoTrack=!!e.isBrowser&&!(this.isDevelopmentEnv||e.isBrowser&&-1!==location.search.indexOf("builder.preview=")),this.trackingUserAttributes={},this.blockContentLoading="",this.observersByKey={},this.noEditorUpdates={},this.overrides={},this.queryOptions={},this.getContentQueue=null,this.priorContentQueue=null,this.testCookiePrefix="builder.tests",this.cookieQueue=[],e.isBrowser&&!i&&e.singletonInstance)return e.singletonInstance;if(this.request&&this.response&&(this.setUserAgent(this.request.headers["user-agent"]||""),this.cookies=new Cookies(this.request,this.response)),t&&(this.apiKey=t),a&&(this.apiVersion=a),o&&(this.authToken=o),isBrowser$3&&e.isEditing&&(this.bindMessageListeners(),parent.postMessage({type:"builder.animatorOptions",data:{options:{version:2}}},"*")),isIframe&&this.messageFrameLoaded(),this.canTrack$.subscribe((function(e){if(e){if("undefined"!=typeof sessionStorage)try{sessionStorage.getItem(sessionStorageKey)||sessionStorage.setItem(sessionStorageKey,s.sessionId)}catch(e){console.debug("Session storage error",e)}s.eventsQueue.length&&s.throttledClearEventsQueue(),s.cookieQueue.length&&(s.cookieQueue.forEach((function(e){s.setCookie(e[0],e[1])})),s.cookieQueue.length=0)}})),isBrowser$3){this.setTestsFromUrl(),this.getOverridesFromQueryString();var l=this.getCookie(e.attributesCookieName);if(l)try{var u=JSON.parse(l);this.setUserAttributes(u)}catch(e){console.debug("Error parsing user attributes cookie",e)}}}return e.register=function(t,n){"plugin"===t&&(n=this.serializeIncludingFunctions(n,!0));var r=this.registry[t];if(r||(r=this.registry[t]=[]),r.push(n),e.isBrowser){var i={type:"builder.register",data:{type:t,info:n}};try{parent.postMessage(i,"*"),parent!==window&&window.postMessage(i,"*")}catch(e){console.debug("Could not postmessage",e)}}this.registryChange.next(this.registry)},e.registerEditor=function(t){if(e.isBrowser){window.postMessage({type:"builder.registerEditor",data:omit$3(t,"component")},"*");var n=location.hostname;e.isTrustedHost(n)||console.error("Builder.registerEditor() called in the wrong environment! You cannot load custom editors from your app, they must be loaded through the Builder.io app itself. Follow the readme here for more details: https://github.com/builderio/builder/tree/master/plugins/cloudinary or contact chat us in our Spectrum community for help: https://spectrum.chat/builder")}this.editors.push(t)},e.registerPlugin=function(e){this.plugins.push(e)},e.registerAction=function(t){var n;if(this.actions.push(t),e.isBrowser){var r=JSON.parse(JSON.stringify(t));t.action&&(r.action=t.action.toString()),null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.registerAction",data:r},"*")}},e.registerTrustedHost=function(e){this.trustedHosts.push(e)},e.setServerContext=function(e){this.serverContext=e},e.isTrustedHost=function(e){return this.trustedHosts.findIndex((function(t){return t.startsWith("*.")?e.endsWith(t.slice(1)):t===e}))>-1},e.isTrustedHostForEvent=function(t){if("null"===t.origin)return!1;var n=parse(t.origin);return n.hostname&&e.isTrustedHost(n.hostname)},e.runAction=function(e){if(!("string"==typeof e?find(this.actions,(function(t){return t.name===e})):e))throw new Error("Action not found: ".concat(e))},e.fields=function(e,t){var n;null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.fields",data:{name:e,fields:t}},"*")},e.set=function(t){e.register("editor.settings",t)},e.import=function(t){if(e.isBrowser){var n=window.System;if(n)return n.import("https://cdn.builder.io/systemjs/".concat(t));console.warn("System.js not available. Please include System.js when using Builder.import")}else console.warn("Builder.import used on the server - this should only be used in the browser")},Object.defineProperty(e,"editingPage",{get:function(){return this._editingPage},set:function(e){this._editingPage=e,isBrowser$3&&isIframe&&(e?document.body.classList.add("builder-editing-page"):document.body.classList.remove("builder-editing-page"))},enumerable:!1,configurable:!0}),e.serializeIncludingFunctions=function(e,t){var n=JSON.parse(JSON.stringify(e,(function(e,n){var r,i,o;return"function"!=typeof n||t&&"onSave"===e?n:(r=n.toString().trim(),i=/^[a-zA-Z0-9_]+\s*=>/i.test(r),o=!(r.startsWith("function")||r.startsWith("async")||r.startsWith("(")||i),"return (".concat(o?"function ":"").concat(r,").apply(this, arguments)"))})));return t&&(n.onSave=e.onSave),n},e.prepareComponentSpecToSend=function(e){return __assign(__assign({},this.serializeIncludingFunctions(e)),{class:void 0})},e.registerBlock=function(e,t){this.registerComponent(e,t)},e.registerComponent=function(e,t){var n,r=__assign(__assign({class:e},e.builderOptions),t);if(this.addComponent(r),t.models&&this.singletonInstance.editingModel?isBrowser$3&&t.models.includes(this.singletonInstance.editingModel):isBrowser$3){var i=this.prepareComponentSpecToSend(r);null===(n=window.parent)||void 0===n||n.postMessage({type:"builder.registerComponent",data:i},"*")}},e.addComponent=function(e){var t=find(this.components,(function(t){return t.name===e.name}));if(t){if(t.class&&!e.class)return;this.components.splice(this.components.indexOf(t),1,e)}else this.components.push(e)},e.component=function(e){var t=this;return void 0===e&&(e={}),function(n){var r,i=__assign(__assign({},e),{class:n});i.name||(i.name=n.name),t.addComponent(i);var o=t.prepareComponentSpecToSend(i);return isBrowser$3&&(null===(r=window.parent)||void 0===r||r.postMessage({type:"builder.registerComponent",data:o},"*")),n}},Object.defineProperty(e,"Component",{get:function(){return this.component},enumerable:!1,configurable:!0}),e.prototype.processEventsQueue=function(){if(this.eventsQueue.length){var t=this.eventsQueue;this.eventsQueue=[];for(var n=__assign(__assign({},e.overrideUserAttributes),this.trackingUserAttributes),r=0,i=t;r<i.length;r++){var o=i[r];o.data.metadata||(o.data.metadata={}),o.data.metadata.user||(o.data.metadata.user={}),Object.assign(o.data.metadata.user,n,o.data.metadata.user)}var a=this.host;getFetch()("".concat(a,"/api/v1/track"),{method:"POST",body:JSON.stringify({events:t}),headers:__assign({"content-type":"application/json"},this.getSdkHeaders()),mode:"cors"}).catch((function(){}))}},Object.defineProperty(e.prototype,"browserTrackingDisabled",{get:function(){return e.isBrowser&&Boolean(window.builderNoTrack||!navigator.cookieEnabled)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"canTrack",{get:function(){return this.canTrack$.value},set:function(e){this.hasOverriddenCanTrack=!0,this.canTrack!==e&&this.canTrack$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiVersion",{get:function(){return this.apiVersion$.value},set:function(e){this.apiVersion!==e&&this.apiVersion$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"apiEndpoint",{get:function(){return this.apiEndpoint$.value},set:function(e){this.apiEndpoint!==e&&this.apiEndpoint$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"editingMode",{get:function(){return this.editingMode$.value},set:function(e){e!==this.editingMode&&this.editingMode$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"editingModel",{get:function(){return this.editingModel$.value},set:function(e){e!==this.editingModel&&this.editingModel$.next(e)},enumerable:!1,configurable:!0}),e.prototype.findParentElement=function(e,t,n){if(void 0===n&&(n=!0),!(e instanceof HTMLElement))return null;var r=n?e:e.parentElement;do{if(!r)return null;if(t(r))return r}while(r=r.parentElement);return null},e.prototype.findBuilderParent=function(e){return this.findParentElement(e,(function(e){var t=e.getAttribute("builder-id")||e.id;return Boolean(t&&0===t.indexOf("builder-"))}))},e.prototype.setUserAgent=function(e){this.userAgent=e||""},e.prototype.setTrackingHook=function(e){this.trackingHooks.push(e)},e.prototype.track=function(t,n,r){if(void 0===n&&(n={}),!isIframe&&isBrowser$3&&!e.isPreviewing){var i=this.apiKey;if(i){for(var o=JSON.parse(JSON.stringify({type:t,data:__assign(__assign({},omit$3(n,"meta")),{metadata:__assign(__assign({sdkVersion:e.VERSION,url:location.href},n.meta),n.metadata),ownerId:i,userAttributes:this.getUserAttributes(),sessionId:this.sessionId,visitorId:this.visitorId})})),a=0,s=this.trackingHooks;a<s.length;a++){var l=(0,s[a])(o,r||{});l&&(o=l)}this.eventsQueue.push(o),this.canTrack&&this.throttledClearEventsQueue()}else console.error('Builder integration error: Looks like the Builder SDK has not been initialized properly (your API key has not been set). Make sure you are calling `builder.init("«YOUR-API-KEY»");` as early as possible in your application\'s code.')}},e.prototype.getSessionId=function(){var t=this,n=null;try{e.isBrowser&&"undefined"!=typeof sessionStorage&&(n=this.getCookie(sessionStorageKey))}catch(e){console.debug("Session storage error",e)}return n||(n=uuid()),e.isBrowser&&setTimeout((function(){try{t.canTrack&&t.setCookie(sessionStorageKey,n,datePlusMinutes(30))}catch(e){console.debug("Cookie setting error",e)}})),n},e.prototype.getVisitorId=function(){var t=this;if(this.visitorId)return this.visitorId;var n=null;try{e.isBrowser&&"undefined"!=typeof localStorage&&(n=localStorage.getItem(localStorageKey))}catch(e){console.debug("Local storage error",e)}return n||(n=uuid()),this.visitorId=n,e.isBrowser&&setTimeout((function(){try{t.canTrack&&"undefined"!=typeof localStorage&&n&&localStorage.setItem(localStorageKey,n)}catch(e){console.debug("Session storage error",e)}})),n},e.prototype.trackImpression=function(t,n,r,i){isIframe||!isBrowser$3||e.isPreviewing||this.track("impression",{contentId:t,variationId:n!==t?n:void 0,metadata:r},i)},e.prototype.trackConversion=function(t,n,r,i,o){if(!isIframe&&isBrowser$3&&!e.isPreviewing){var a="object"==typeof n?n:i,s="string"==typeof n?n:void 0;this.track("conversion",{amount:t,variationId:r,meta:a,contentId:s},o)}},Object.defineProperty(e.prototype,"isDevelopmentEnv",{get:function(){return e.isIframe||e.isBrowser&&("localhost"===location.hostname||""!==location.port)||"production"!==this.env},enumerable:!1,configurable:!0}),e.prototype.trackInteraction=function(t,n,r,i,o){if(void 0===r&&(r=!1),!isIframe&&isBrowser$3&&!e.isPreviewing){var a=i&&i.target,s=a&&this.findBuilderParent(a),l={};if(i){var u=i.clientX,c=i.clientY;if(a){var d=u-(m=a.getBoundingClientRect()).left,p=c-m.top,f=v(d/m.width),h=v(p/m.height);l.targetOffset={x:f,y:h}}if(s){var m;d=u-(m=s.getBoundingClientRect()).left,p=c-m.top,f=v(d/m.width),h=v(p/m.height);l.builderTargetOffset={x:f,y:h}}}var g=s&&(s.getAttribute("builder-id")||s.id);g&&s&&(l.builderElementIndex=[].slice.call(document.getElementsByClassName(g)).indexOf(s)),this.track("click",{contentId:t,metadata:l,variationId:n!==t?n:void 0,unique:!r,targetBuilderElement:g||void 0},o)}function v(e){return Math.round(1e3*e)/1e3}},e.prototype.component=function(t){return void 0===t&&(t={}),e.component(t)},Object.defineProperty(e.prototype,"apiKey",{get:function(){return this.apiKey$.value},set:function(e){this.apiKey$.next(e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"authToken",{get:function(){return this.authToken$.value},set:function(e){this.authToken$.next(e)},enumerable:!1,configurable:!0}),e.prototype.modifySearch=function(e){return e.replace(/(^|&|\?)(builder_.*?)=/gi,(function(e,t,n){return t+n.replace(/_/g,".")+"="}))},e.prototype.setTestsFromUrl=function(){var e=this.getLocation().search;try{var t=QueryString.parseDeep(this.modifySearch(e||"").substr(1)),n=t.builder&&t.builder.tests;if(n&&"object"==typeof n)for(var r in n)n.hasOwnProperty(r)&&this.setTestCookie(r,n[r])}catch(e){console.debug("Error parsing tests from URL",e)}},e.prototype.resetOverrides=function(){e.overrideUserAttributes={},this.cachebust=!1,this.noCache=!1,this.preview=!1,this.editingModel=null,this.overrides={},this.env="production",this.userAgent="",this.request=void 0,this.response=void 0},e.prototype.getOverridesFromQueryString=function(){var t=this.getLocation();try{var n=QueryString.parseDeep(this.modifySearch(t.search||"").substr(1)),r=n.builder;if(r){var i=r.userAttributes,o=r.overrides,a=r.env,s=(r.host,r.api),l=r.cachebust,u=r.noCache,c=r.preview,d=r.editing,p=r.frameEditing,f=r.options,h=r.params;if(i&&this.setUserAttributes(i),f&&(this.queryOptions=__assign(__assign(__assign({},f.locale&&{locale:f.locale}),f.includeRefs&&{includeRefs:f.includeRefs}),f.enrich&&{enrich:f.enrich})),o&&(this.overrides=o),validEnvList.indexOf(a||s)>-1&&(this.env=a||s),e.isEditing){var m=p||d||c;m&&"true"!==m&&(this.editingModel=m)}l&&(this.cachebust=!0),u&&(this.noCache=!0),c&&(this.preview=!0),n&&(this.overrideParams=h)}}catch(e){console.debug("Error parsing overrides from URL",e)}},e.prototype.messageFrameLoaded=function(){var e;null===(e=window.parent)||void 0===e||e.postMessage({type:"builder.loaded",data:{value:!0}},"*")},e.prototype.bindMessageListeners=function(){var t=this;addEventListener("message",(function(n){var r,i,o,a;if(e.isTrustedHostForEvent(n)){var s=n.data;if(s)switch(s.type){case"builder.ping":null===(r=window.parent)||void 0===r||r.postMessage({type:"builder.pong",data:{}},"*");break;case"builder.register":if(n.source===window)break;var l=s.data;if(!l)break;var u=l.type,c=l.info,d=e.registry[u];d||(d=e.registry[u]=[]),d.push(c),e.registryChange.next(e.registry);break;case"builder.settingsChange":if(n.source===window)break;var p=s.data;if(!p)break;Object.assign(e.settings,p),e.settingsChange.next(e.settings);break;case"builder.registerEditor":if(n.source===window)break;var f=s.data;if(!f)break;var h=!!f.component;e.editors.every((function(t,n){return f.name!==t.name||(t.component&&!h||(e.editors[n]=t),!1)}));break;case"builder.triggerAnimation":e.animator.triggerAnimation(s.data);break;case"builder.contentUpdate":var m=s.data.key||s.data.alias||s.data.entry||s.data.modelName,g=s.data.data,v=t.observersByKey[m];v&&!t.noEditorUpdates[m]&&v.next([g]);break;case"builder.getComponents":null===(i=window.parent)||void 0===i||i.postMessage({type:"builder.components",data:e.components.map((function(t){return e.prepareComponentSpecToSend(t)}))},"*");break;case"builder.editingModel":t.editingModel=s.data.model;break;case"builder.registerComponent":var b=s.data;e.addComponent(b);break;case"builder.blockContentLoading":"string"==typeof s.data.model&&(t.blockContentLoading=s.data.model);break;case"builder.editingMode":s.data?(t.editingMode=!0,document.body.classList.add("builder-editing")):(t.editingMode=!1,document.body.classList.remove("builder-editing"));break;case"builder.editingPageMode":var y=s.data;e.editingPage=y;break;case"builder.overrideUserAttributes":var k=s.data;assign(e.overrideUserAttributes,k),t.flushGetContentQueue(!0);break;case"builder.overrideTestGroup":var w=s.data,S=w.variationId,_=w.contentId;S&&_&&(t.setTestCookie(_,S),t.flushGetContentQueue(!0));break;case"builder.evaluate":var x=s.data.text,C=s.data.arguments||[],E=s.data.id,B=new Function(x),T=void 0,P=null;try{T=B.apply(t,C)}catch(e){P=toError$1(e)}P?null===(o=window.parent)||void 0===o||o.postMessage({type:"builder.evaluateError",data:{id:E,error:P.message}},"*"):T&&"function"==typeof T.then?T.then((function(e){var t;null===(t=window.parent)||void 0===t||t.postMessage({type:"builder.evaluateResult",data:{id:E,result:e}},"*")})).catch(console.error):null===(a=window.parent)||void 0===a||a.postMessage({type:"builder.evaluateResult",data:{result:T,id:E}},"*")}}}))},Object.defineProperty(e.prototype,"defaultCanTrack",{get:function(){return Boolean(e.isBrowser&&navigator.userAgent.trim()&&!navigator.userAgent.match(/bot|crawler|spider|robot|crawling|prerender|google|baidu|bing|msn|duckduckbot|teoma|slurp|yandex|phantom|headless|selenium|puppeteer/i)&&!this.browserTrackingDisabled)},enumerable:!1,configurable:!0}),e.prototype.init=function(e,t,n,r,i,o){return void 0===t&&(t=this.defaultCanTrack),n&&(this.request=n),r&&(this.response=r),this.hasOverriddenCanTrack||(this.canTrack=t),this.apiKey=e,i&&(this.authToken=i),o&&(this.apiVersion=o),this},Object.defineProperty(e.prototype,"previewingModel",{get:function(){var e=this.getLocation().search;return QueryString.parse((e||"").substr(1))["builder.preview"]},enumerable:!1,configurable:!0}),e.prototype.getLocation=function(){var e,t={};return this.request?t=parse(null!==(e=this.request.url)&&void 0!==e?e:""):"object"==typeof location&&(t=parse(location.href)),""===t.pathname&&(t.pathname="/"),t},e.prototype.getUserAttributes=function(t){void 0===t&&(t=this.userAgent||"");var n={Android:function(){return t.match(/Android/i)},BlackBerry:function(){return t.match(/BlackBerry/i)},iOS:function(){return t.match(/iPhone|iPod/i)},Opera:function(){return t.match(/Opera Mini/i)},Windows:function(){return t.match(/IEMobile/i)||t.match(/WPDesktop/i)},any:function(){return n.Android()||n.BlackBerry()||n.iOS()||n.Opera()||n.Windows()}},r=t.match(/Tablet|iPad/i),i=this.getLocation();return __assign({urlPath:i.pathname,host:i.host||i.hostname,device:r?"tablet":n.any()?"mobile":"desktop"},e.overrideUserAttributes)},e.prototype.setUserAttributes=function(t){assign(e.overrideUserAttributes,t),this.canTrack&&this.setCookie(e.attributesCookieName,JSON.stringify(this.getUserAttributes())),this.userAttributesChanged.next(t)},e.prototype.setTrackingUserAttributes=function(e){assign(this.trackingUserAttributes,e)},e.prototype.get=function(t,n){var r;void 0===n&&(n={});var i=this,o=n.locale||(null===(r=n.userAttributes)||void 0===r?void 0:r.locale)||this.getUserAttributes().locale;"noTraverse"in n||(n.noTraverse=!1);var a=__assign(__assign({},n),o&&{locale:String(o),userAttributes:__assign({locale:String(o)},n.userAttributes)});return e.isBrowser?(n.apiKey&&!this.apiKey&&(this.apiKey=n.apiKey),n.authToken&&!this.authToken&&(this.authToken=n.authToken),n.apiVersion&&!this.apiVersion&&(this.apiVersion=n.apiVersion)):((i=new e(n.apiKey||this.apiKey,n.req,n.res,void 0,n.authToken||this.authToken,n.apiVersion||this.apiVersion)).apiEndpoint=this.apiEndpoint,i.setUserAttributes(this.getUserAttributes())),i.queueGetContent(t,a).map((function(t){var n=t&&t[0];if(e.isStatic)return n;var r=n&&n.data;return r?(void 0!==r.blocksString&&(r.blocks=JSON.parse(r.blocksString),delete r.blocksString),{data:r,id:n.id,variationId:n.testVariationId||n.variationId||null,testVariationId:n.testVariationId||n.variationId||null,testVariationName:n.testVariationName||null,lastUpdated:n.lastUpdated||null}):null}))},e.prototype.queueGetContent=function(t,n){var r=this;void 0===n&&(n={});var i=n.key||n.alias||t,o=this.editingModel===t,a=this.observersByKey[i];"DEMO"!==this.apiKey||this.overrides[i]||n.initialContent||(n.initialContent=[]);var s=n.initialContent;if(a&&(!a.value||n.cache))return a.value&&nextTick$1((function(){a.next(a.value)})),a;if(o&&e.isBrowser&&parent.postMessage({type:"builder.updateContent",data:{options:n}},"*"),!s)if(this.getContentQueue||(this.getContentQueue=[]),this.getContentQueue.push(__assign(__assign({},n),{model:t,key:i})),this.getContentQueue&&this.getContentQueue.length>=this.contentPerRequest){var l=this.getContentQueue.slice();this.getContentQueue=[],nextTick$1((function(){r.flushGetContentQueue(!1,l)}))}else nextTick$1((function(){r.flushGetContentQueue()}));var u=new BehaviorSubject(null);return this.observersByKey[i]=u,n.noEditorUpdates&&(this.noEditorUpdates[i]=!0),s&&nextTick$1((function(){u.next(s)})),u},e.prototype.requestUrl=function(e,t){return getFetch()(e,this.addSdkHeaders(t)).then((function(e){return e.json()}))},Object.defineProperty(e.prototype,"host",{get:function(){switch(this.env){case"qa":return"https://qa.builder.io";case"test":return"https://builder-io-test.web.app";case"fast":return"https://fast.builder.io";case"cloud":return"https://cloud.builder.io";case"cdn2":return"https://cdn2.builder.io";case"cdn-qa":return"https://cdn-qa.builder.io";case"development":case"dev":return"http://localhost:5000";case"cdn-prod":return"https://cdn.builder.io";default:return e.overrideHost||"https://cdn.builder.io"}},enumerable:!1,configurable:!0}),e.prototype.getSdkHeaders=function(){return e.sdkInfo?{"X-Builder-SDK":e.sdkInfo.name,"X-Builder-SDK-GEN":"1","X-Builder-SDK-Version":e.sdkInfo.version}:{}},e.prototype.addSdkHeaders=function(e){return __assign(__assign({},e),{headers:__assign(__assign({},e.headers),this.getSdkHeaders())})},e.prototype.makeFetchApiCall=function(e,t){return getFetch()(e,this.addSdkHeaders(t))},e.prototype.flattenMongoQuery=function(e,t,n){for(var r in void 0===n&&(n={}),e){var i=e[r],o=t?t+"."+r:r;!i||"object"!=typeof i||Array.isArray(i)||Object.keys(i).find((function(e){return e.startsWith("$")}))?n[o]=i:this.flattenMongoQuery(i,o,n)}return n},e.prototype.flushGetContentQueue=function(t,n){var r,i,o=this;if(void 0===t&&(t=!1),!this.apiKey)throw new Error("Fetching content failed, expected apiKey to be defined instead got: ".concat(this.apiKey));if(this.apiVersion){if(!["v1","v3"].includes(this.apiVersion))throw new Error("Invalid apiVersion: expected 'v1' or 'v3', received '".concat(this.apiVersion,"'"))}else this.apiVersion=DEFAULT_API_VERSION;if(t||this.getContentQueue){var a=n||(t?this.priorContentQueue:this.getContentQueue)||[];this.getOverridesFromQueryString();var s=__assign(__assign({omit:null!==(r=a[0].omit)&&void 0!==r?r:"meta.componentsUsed",apiKey:this.apiKey},a[0].options),this.queryOptions);a[0].locale&&(s.locale=a[0].locale),a[0].fields&&(s.fields=a[0].fields),a[0].format&&(s.format=a[0].format),"noTraverse"in a[0]&&(s.noTraverse=a[0].noTraverse),"includeUnpublished"in a[0]&&(s.includeUnpublished=a[0].includeUnpublished),a[0].sort&&(s.sort=a[0].sort);var l=("undefined"!=typeof location?QueryString.parseDeep(location.search.substr(1)):void 0)||{},u=a&&a[0].userAttributes?a[0].userAttributes:this.targetContent?this.getUserAttributes():{urlPath:this.getLocation().pathname};if(a.find((function(e){return!!e.includeUrl}))){var c=this.getLocation();c.origin&&(s.url="".concat(c.origin).concat(c.pathname).concat(c.search))}var d=null==n?void 0:n.find((function(e){return e.url}));if((null==d?void 0:d.url)&&(u.urlPath=d.url.split("?")[0]),s.userAttributes=JSON.stringify(u),t||n||(this.priorContentQueue=a,this.getContentQueue=null),(this.cachebust||isIframe||l.cachebust||l["builder.cachebust"]||"production"!==this.env)&&(s.cachebust=!0),e.isEditing&&(s.isEditing=!0),(this.noCache||"production"!==this.env)&&(s.noCache=!0),size$2(this.overrides))for(var p in this.overrides)this.overrides.hasOwnProperty(p)&&(s["overrides.".concat(p)]=this.overrides[p]);for(var f=0,h=a;f<h.length;f++){var m=h[f],g=m.format;g&&(s.format=g),m.static&&(s.static=m.static),m.cachebust&&(s.cachebust=m.cachebust),isPositiveNumber(m.cacheSeconds)&&(s.cacheSeconds=m.cacheSeconds),isPositiveNumber(m.staleCacheSeconds)&&(s.staleCacheSeconds=m.staleCacheSeconds),"content"===this.apiEndpoint&&(s.includeRefs=!0);for(var v=0,b=["prerender","extractCss","limit","offset","query","preview","model","entry","rev","static","includeRefs"];v<b.length;v++){var y=m[p=b[v]];void 0!==y&&("query"===this.apiEndpoint?(s.options=s.options||{},s.options[m.key]=s.options[m.key]||{},s.options[m.key][p]=JSON.stringify(y)):s[p]=JSON.stringify(y))}}this.preview&&this.previewingModel===(null===(i=null==a?void 0:a[0])||void 0===i?void 0:i.model)&&(s.preview="true");var k=Object.keys(s).length>0,w=this.host,S=a.map((function(e){return encodeURIComponent(e.key)})).join(",");if(this.overrideParams)assign(s,omit$3(QueryString.parse(this.overrideParams),"apiKey"));var _=s.format,x="solid"===_||"react"===_,C=x||"query"===this.apiEndpoint;if("content"===this.apiEndpoint&&a[0].query){var E=this.flattenMongoQuery({query:a[0].query});for(var p in E)s[p]=E[p];delete s.query}var B,T=QueryString.stringifyDeep(s),P=__assign({headers:{}},a[0].fetchOptions);return this.authToken&&(P.headers=__assign(__assign({},P.headers),{Authorization:"Bearer ".concat(this.authToken)})),B=x?"".concat(w,"/api/v1/codegen/").concat(this.apiKey,"/").concat(S):"query"===this.apiEndpoint?"".concat(w,"/api/v3/query/").concat(this.apiKey,"/").concat(S):"".concat(w,"/api/v3/content/").concat(a[0].model),B+=s&&k?"?".concat(T):"",this.makeFetchApiCall(B,P).then((function(e){return e.json()})).then((function(t){for(var n=0,r=a;n<r.length;n++){var i=r[n],s=i.key;if(i.model!==o.blockContentLoading||i.noEditorUpdates){o.editingModel===i.model&&e.isEditing&&parent.postMessage({type:"builder.updateContent",data:{options:i}},"*");var l=o.observersByKey[s];if(!l)return;var u=C?t[s]:t.results,c=u;if(u){var d=e.isServer?c:o.processResultsForTests(c);l.next(d)}else{if((o.getLocation().search||"").includes("builder.preview="+i.model)){l.next([{id:"preview",name:"Preview",data:{}}])}l.next([])}}}}),(function(e){for(var t=0,n=a;t<n.length;t++){var r=n[t],i=o.observersByKey[r.key];if(!i)return;i.error(e)}}))}},e.prototype.processResultsForTests=function(e){var t,n=this,r=e.map((function(e){if(!e.variations)return e;var t=n.getTestCookie(e.id),r=t===e.id?e:e.variations[t];if(r)return __assign(__assign({},e),{data:r.data,variationId:t,testVariationId:t,testVariationName:r.name});if(n.canTrack&&e.variations&&size$2(e.variations)){var i=0,o=Math.random();for(var a in e.variations){var s=e.variations[a];if(o<(i+=s.testRatio)){n.setTestCookie(e.id,s.id);var l=s.name||(s.id===e.id?"Default variation":"");return __assign(__assign({},e),{data:s.data,variationId:s.id,testVariationId:s.id,variationName:l,testVariationName:l})}}n.setTestCookie(e.id,e.id)}return __assign(__assign(__assign({},e),{variationId:e.id}),e.variations&&size$2(e.variations)&&{testVariationId:e.id,testVariationName:"Default variation"})}));return isIframe&&(null===(t=window.parent)||void 0===t||t.postMessage({type:"builder.contentResults",data:{results:r}},"*")),r},e.prototype.getTestCookie=function(e){return this.getCookie("".concat(this.testCookiePrefix,".").concat(e))},e.prototype.setTestCookie=function(e,t){if(this.canTrack){var n=new Date;return n.setDate(n.getDate()+30),this.setCookie("".concat(this.testCookiePrefix,".").concat(e),t,n)}this.cookieQueue.push([e,t])},e.prototype.getCookie=function(t){return this.cookies?this.cookies.get(t):e.isBrowser&&getCookie(t)},e.prototype.setCookie=function(t,n,r){return!this.cookies||e.isServer&&e.isStatic?e.isBrowser&&setCookie(t,n,r):this.cookies.set(t,n,{expires:r,secure:"https:"===this.getLocation().protocol})},e.prototype.getContent=function(e,t){if(void 0===t&&(t={}),!this.apiKey)throw new Error("Fetching content from model ".concat(e," failed, expected apiKey to be defined instead got: ").concat(this.apiKey));return this.queueGetContent(e,t)},e.prototype.getAll=function(t,n){void 0===n&&(n={});var r=this;return e.isBrowser?(n.apiKey&&!this.apiKey&&(this.apiKey=n.apiKey),n.authToken&&!this.authToken&&(this.authToken=n.authToken),n.apiVersion&&!this.apiVersion&&(this.apiVersion=n.apiVersion)):(r=new e(n.apiKey||this.apiKey,n.req,n.res,!1,n.authToken||this.authToken,n.apiVersion||this.apiVersion)).setUserAttributes(this.getUserAttributes()),"noTraverse"in n||(n.noTraverse=!0),r.getContent(t,__assign(__assign({limit:30},n),{key:n.key||e.isBrowser?"".concat(t,":").concat(hashSum$1(omit$3(n,"initialContent","req","res"))):void 0})).promise()},e.VERSION=SDK_VERSION,e.components=[],e.isStatic=!0,e.animator=new Animator,e.nextTick=nextTick$1,e.throttle=throttle$1,e.editors=[],e.trustedHosts=["*.beta.builder.io","beta.builder.io","builder.io","localhost","qa.builder.io"],e.plugins=[],e.actions=[],e.registry={},e.attributesCookieName="builder.userAttributes",e.registryChange=new BehaviorSubject({}),e._editingPage=!1,e.isIframe=isIframe,e.isBrowser=isBrowser$3,e.isReactNative=isReactNative,e.isServer=!isBrowser$3&&!isReactNative,e.previewingModel=e.isBrowser&&getQueryParam(location.href,"builder.preview"),e.settings={},e.settingsChange=new BehaviorSubject({}),e.isEditing=Boolean(isIframe&&(document.referrer&&document.referrer.match(/builder\.io|localhost:1234/)||-1!==location.search.indexOf("builder.frameEditing="))),e.isPreviewing=Boolean(isBrowser$3&&(-1!==location.search.indexOf("builder.preview=")||-1!==location.search.indexOf("builder.frameEditing="))),e.isReact=!1,e.sdkInfo=void 0,e.overrideUserAttributes={},e}(),builder=new Builder(null,void 0,void 0,!0);function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function _inheritsLoose(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,_setPrototypeOf(e,t)}function unwrapExports(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function createCommonjsModule(e,t){return e(t={exports:{}},t.exports),t.exports
2
2
  /**
3
3
  * @license React
4
4
  * react.production.min.js