(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[330],{21201:function(e,t,r){"use strict";r.d(t,{Qb:function(){return d},R7:function(){return u},sy:function(){return c}});var n=r(67294),i=r(45697),o=r.n(i),a=r(21879),s=r.n(a),l=r(61539);let c=n.createContext({}),u=n.createContext({});class d extends n.Component{constructor(e){var t,r,n,i;super(e),this.setContext=e=>{this.setState({context:e.sitecore?this.constructContext(e):Object.assign({},e)})};let o=this.constructContext(e.layoutData),a=e.api;(null===(r=null===(t=e.api)||void 0===t?void 0:t.edge)||void 0===r?void 0:r.contextId)&&!(null===(i=null===(n=e.api)||void 0===n?void 0:n.edge)||void 0===i?void 0:i.edgeUrl)&&(a=Object.assign(Object.assign({},e.api),{edge:Object.assign(Object.assign({},e.api.edge),{edgeUrl:l.BT})})),this.state={context:o,setContext:this.setContext,api:a}}constructContext(e){var t;return e?Object.assign({route:e.sitecore.route,itemId:null===(t=e.sitecore.route)||void 0===t?void 0:t.itemId},e.sitecore.context):{pageEditing:!1}}componentDidUpdate(e){if(!s()(e.layoutData,this.props.layoutData)){this.setContext(this.props.layoutData);return}}render(){return n.createElement(u.Provider,{value:this.props.componentFactory},n.createElement(c.Provider,{value:this.state},this.props.children))}}d.propTypes={children:o().any.isRequired,componentFactory:o().func,layoutData:o().shape({sitecore:o().shape({context:o().any,route:o().any})})},d.displayName="SitecoreContext"},61539:function(e,t,r){"use strict";var n,i;r.d(t,{BT:function(){return a},QU:function(){return o},kb:function(){return s}}),(i=n||(n={})).JssApp="061cba1554744b918a0617903b102b82",i.DictionaryEntry="6d1cd89719364a3aa511289a94c2a7b1";let o={CONNECTED:"connected",DISCONNECTED:"disconnected"},a="https://edge-platform.sitecorecloud.io",s="Hidden Rendering"},21879:function(e){"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t instanceof Map&&r instanceof Map){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;for(i of t.entries())if(!e(i[1],r.get(i[0])))return!1;return!0}if(t instanceof Set&&r instanceof Set){if(t.size!==r.size)return!1;for(i of t.entries())if(!r.has(i[0]))return!1;return!0}if(ArrayBuffer.isView(t)&&ArrayBuffer.isView(r)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(t[i]!==r[i])return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var n,i,o,a=o[i];if(("_owner"!==a||!t.$$typeof)&&!e(t[a],r[a]))return!1}return!0}return t!=t&&r!=r}},82322:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return s},noSSR:function(){return a}});let n=r(10260);r(85893),r(67294);let i=n._(r(46543));function o(e){return{default:(null==e?void 0:e.default)||e}}function a(e,t){return delete t.webpack,delete t.modules,e(t)}function s(e,t){let r=i.default,n={loading:e=>{let{error:t,isLoading:r,pastDelay:n}=e;return null}};e instanceof Promise?n.loader=()=>e:"function"==typeof e?n.loader=e:"object"==typeof e&&(n={...n,...e});let s=(n={...n,...t}).loader;return(n.loadableGenerated&&(n={...n,...n.loadableGenerated},delete n.loadableGenerated),"boolean"!=typeof n.ssr||n.ssr)?r({...n,loader:()=>null!=s?s().then(o):Promise.resolve(o(()=>null))}):(delete n.webpack,delete n.modules,a(r,n))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},20262:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"LoadableContext",{enumerable:!0,get:function(){return n}});let n=r(10260)._(r(67294)).default.createContext(null)},46543:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return p}});let n=r(10260)._(r(67294)),i=r(20262),o=[],a=[],s=!1;function l(e){let t=e(),r={loading:!0,loaded:null,error:null};return r.promise=t.then(e=>(r.loading=!1,r.loaded=e,e)).catch(e=>{throw r.loading=!1,r.error=e,e}),r}class c{promise(){return this._res.promise}retry(){this._clearTimeouts(),this._res=this._loadFn(this._opts.loader),this._state={pastDelay:!1,timedOut:!1};let{_res:e,_opts:t}=this;e.loading&&("number"==typeof t.delay&&(0===t.delay?this._state.pastDelay=!0:this._delay=setTimeout(()=>{this._update({pastDelay:!0})},t.delay)),"number"==typeof t.timeout&&(this._timeout=setTimeout(()=>{this._update({timedOut:!0})},t.timeout))),this._res.promise.then(()=>{this._update({}),this._clearTimeouts()}).catch(e=>{this._update({}),this._clearTimeouts()}),this._update({})}_update(e){this._state={...this._state,error:this._res.error,loaded:this._res.loaded,loading:this._res.loading,...e},this._callbacks.forEach(e=>e())}_clearTimeouts(){clearTimeout(this._delay),clearTimeout(this._timeout)}getCurrentValue(){return this._state}subscribe(e){return this._callbacks.add(e),()=>{this._callbacks.delete(e)}}constructor(e,t){this._loadFn=e,this._opts=t,this._callbacks=new Set,this._delay=null,this._timeout=null,this.retry()}}function u(e){return function(e,t){let r=Object.assign({loader:null,loading:null,delay:200,timeout:null,webpack:null,modules:null},t),o=null;function l(){if(!o){let t=new c(e,r);o={getCurrentValue:t.getCurrentValue.bind(t),subscribe:t.subscribe.bind(t),retry:t.retry.bind(t),promise:t.promise.bind(t)}}return o.promise()}if(!s){let e=r.webpack?r.webpack():r.modules;e&&a.push(t=>{for(let r of e)if(t.includes(r))return l()})}function u(e,t){!function(){l();let e=n.default.useContext(i.LoadableContext);e&&Array.isArray(r.modules)&&r.modules.forEach(t=>{e(t)})}();let a=n.default.useSyncExternalStore(o.subscribe,o.getCurrentValue,o.getCurrentValue);return n.default.useImperativeHandle(t,()=>({retry:o.retry}),[]),n.default.useMemo(()=>{var t;return a.loading||a.error?n.default.createElement(r.loading,{isLoading:a.loading,pastDelay:a.pastDelay,timedOut:a.timedOut,error:a.error,retry:o.retry}):a.loaded?n.default.createElement((t=a.loaded)&&t.default?t.default:t,e):null},[e,a])}return u.preload=()=>l(),u.displayName="LoadableComponent",n.default.forwardRef(u)}(l,e)}function d(e,t){let r=[];for(;e.length;){let n=e.pop();r.push(n(t))}return Promise.all(r).then(()=>{if(e.length)return d(e,t)})}u.preloadAll=()=>new Promise((e,t)=>{d(o).then(e,t)}),u.preloadReady=e=>(void 0===e&&(e=[]),new Promise(t=>{let r=()=>(s=!0,t());d(a,e).then(r,r)})),window.__NEXT_PRELOADREADY=u.preloadReady;let p=u},5152:function(e,t,r){e.exports=r(82322)},92703:function(e,t,r){"use strict";var n=r(50414);function i(){}function o(){}o.resetWarningCache=i,e.exports=function(){function e(e,t,r,i,o,a){if(a!==n){var s=Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var r={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:o,resetWarningCache:i};return r.PropTypes=r,r}},45697:function(e,t,r){e.exports=r(92703)()},50414:function(e){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},64351:function(e,t,r){"use strict";r.d(t,{wA:function(){return tg},sY:function(){return ep},Jp:function(){return tm},cd:function(){return tf},v4:function(){return tp},hj:function(){return e$},Xq:function(){return th},he:function(){return td}});var n,i=r(53143),o=r(67294),a=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},s=null,l=null;function c(e){return 0==Object.keys(e).length?o.createElement(o.Fragment,null):l&&!e._dynamic?function(e){let{componentName:t,clientFallback:r}=e,n=a(e,["componentName","clientFallback"]),c=null===(h=(0,i.Xr)(t))||void 0===h?void 0:h.component,d=o.useMemo(()=>o.createElement(u,Object.assign({},n,{componentName:t})),[]),p=o.useMemo(()=>l(()=>Promise.resolve(s),{ssr:!1,loading:()=>d}),[]);var h,f="undefined"==typeof window?JSON.parse(JSON.stringify(n)):n;return o.createElement(p,Object.assign({},f,{componentName:t,fallbackWrapper:!c,fallback:c?d:r?o.createElement(l(()=>Promise.resolve(()=>r),{ssr:!1})):e.fallback}))}(Object.assign({_dynamic:!0},e)):u(e)}function u(e){let{componentName:t,fallback:r,fallbackWrapper:n}=e,a=(0,i.Xr)(t),s=null==a?void 0:a.component,{attributes:l,properties:c,merged:u}=(0,i.zB)(e);if(!s&&r||!t)return!1===n?o.createElement(o.Fragment,null,r):o.createElement("feaas-external",Object.assign({},l,{hydrate:"false"}),r);if(a&&s&&(0,i.Rj)(s)){let e="byoc-"+(0,i.mA)(a.id);return o.createElement(e,Object.assign(Object.assign({},l),{ref:t=>{var r;t&&"undefined"!=typeof window&&(null===(r=window.customElements)||void 0===r||r.whenDefined(e).then(()=>{var e;null===(e=t.sitecoreContextCallback)||void 0===e||e.call(t,Object.assign({},u))}))}}))}return o.createElement(o.Fragment,null,o.createElement("feaas-external",Object.assign({},l,{hydrate:"false"}),null==s?null:o.createElement(s,Object.assign({},u))))}var d=r(73935),p=Object.defineProperty,h=(e,t)=>{for(var r in t)p(e,r,{get:t[r],enumerable:!0})},f={};h(f,{renderDOMContent:()=>ei,renderDOMElement:()=>er,renderHTMLContent:()=>eo,setDOMAttribute:()=>ee});var m={};function g(e){return(g="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function b(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function y(e,t){for(var r=0;r"u"||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function C(e,t,r){return(C=E()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&A(i,r.prototype),i}).apply(null,arguments)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if("u">typeof t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return C(e,arguments,w(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),A(r,e)})(e)}function S(e,t){if(e){if("string"==typeof e)return x(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x(e,t)}}function x(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);rF,queryObject:()=>_,queryObjectRaw:()=>T,queryScopes:()=>L,serializeCH1RichText:()=>$});var k=Object.prototype.hasOwnProperty;function j(e,t){return(e=e.slice()).push(t),e}function R(e,t){return(t=t.slice()).unshift(e),t}var N=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&A(e,t)}(n,e);var t,r=(t=E(),function(){var e,r=w(n);return e=t?Reflect.construct(r,arguments,w(this).constructor):r.apply(this,arguments),function(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,e)});function n(e){var t;return b(this,n),(t=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)')).avoidNew=!0,t.value=e,t.name="NewError",t}return v(n)}(O(Error));function F(e,t,r,n,i){if(!(this instanceof F))try{return new F(e,t,r,n,i)}catch(e){if(!e.avoidNew)throw e;return e.value}"string"==typeof e&&(i=n,n=r,r=t,t=e,e=null);var o=e&&"object"===g(e);if(e=e||{},this.json=e.json||r,this.path=e.path||t,this.resultType=e.resultType||"value",this.flatten=e.flatten||!1,this.wrap=!k.call(e,"wrap")||e.wrap,this.sandbox=e.sandbox||{},this.preventEval=e.preventEval||!1,this.parent=e.parent||null,this.parentProperty=e.parentProperty||null,this.callback=e.callback||n||null,this.otherTypeCallback=e.otherTypeCallback||i||function(){throw TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},!1!==e.autostart){var a={path:o?e.path:t};o?"json"in e&&(a.json=e.json):a.json=r;var s=this.evaluate(a);if(!s||"object"!==g(s))throw new N(s);return s}}F.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,l=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,t=t||this.json,(e=e||this.path)&&"object"===g(e)&&!Array.isArray(e)){if(!e.path&&""!==e.path)throw TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!k.call(e,"json"))throw TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');t=e.json,s=k.call(e,"flatten")?e.flatten:s,this.currResultType=k.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=k.call(e,"sandbox")?e.sandbox:this.currSandbox,l=k.call(e,"wrap")?e.wrap:l,this.currPreventEval=k.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=k.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=k.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=k.call(e,"parent")?e.parent:o,a=k.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=F.toPathString(e)),!(!e&&""!==e||!t)){var c=F.toPathArray(e);"$"===c[0]&&c.length>1&&c.shift(),this._hasParentSelector=null;var u=this._trace(c,t,["$"],o,a,r).filter(function(e){return e&&!e.isParentSelector});return u.length?l||1!==u.length||u[0].hasArrExpr?u.reduce(function(e,t){var r=i._getPreferredOutput(t);return s&&Array.isArray(r)?e=e.concat(r):e.push(r),e},[]):this._getPreferredOutput(u[0]):l?[]:void 0}},F.prototype._getPreferredOutput=function(e){var t=this.currResultType;switch(t){case"all":var r=Array.isArray(e.path)?e.path:F.toPathArray(e.path);return e.pointer=F.toPointer(r),e.path="string"==typeof e.path?e.path:F.toPathString(e.path),e;case"value":case"parent":case"parentProperty":return e[t];case"path":return F.toPathString(e[t]);case"pointer":return F.toPointer(e.path);default:throw TypeError("Unknown result type")}},F.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path="string"==typeof e.path?e.path:F.toPathString(e.path),t(n,r,e)}},F.prototype._trace=function(e,t,r,n,i,o,a,s){var l,c=this;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(l,o,"value"),l;var u=e[0],d=e.slice(1),p=[];function h(e){Array.isArray(e)?e.forEach(function(e){p.push(e)}):p.push(e)}if(("string"!=typeof u||s)&&t&&k.call(t,u))h(this._trace(d,t[u],j(r,u),t,u,o,a));else if("*"===u)this._walk(t,function(e){h(c._trace(d,t[e],j(r,e),t,e,o,!0,!0))});else if(".."===u)h(this._trace(d,t,r,n,i,o,a)),this._walk(t,function(n){"object"===g(t[n])&&h(c._trace(e.slice(),t[n],j(r,n),t,n,o,!0))});else{if("^"===u)return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:d,isParentSelector:!0};if("~"===u)return l={path:j(r,u),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if("$"===u)h(this._trace(d,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(u))h(this._slice(u,d,t,r,n,i,o));else if(0===u.indexOf("?(")){if(this.currPreventEval)throw Error("Eval [?(expr)] prevented in JSONPath expression.");var f=u.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1");this._walk(t,function(e){c._eval(f,t[e],e,r,n,i)&&h(c._trace(d,t[e],j(r,e),t,e,o,!0))})}else if("("===u[0]){if(this.currPreventEval)throw Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(R(this._eval(u,t,r[r.length-1],r.slice(0,-1),n,i),d),t,r,n,i,o,a))}else if("@"===u[0]){var m=!1,b=u.slice(1,-2);switch(b){case"scalar":t&&["object","function"].includes(g(t))||(m=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===b&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":"number"!=typeof t||Number.isFinite(t)||(m=!0);break;case"object":t&&g(t)===b&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":null===t&&(m=!0);break;default:throw TypeError("Unknown value type "+b)}if(m)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if("`"===u[0]&&t&&k.call(t,u.slice(1))){var y=u.slice(1);h(this._trace(d,t[y],j(r,y),t,y,o,a,!0))}else if(u.includes(",")){var v,w=function(e,t){var r="u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=S(e))){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(u.split(","));try{for(w.s();!(v=w.n()).done;){var A=v.value;h(this._trace(R(A,d),t,r,n,i,o,!0))}}catch(e){w.e(e)}finally{w.f()}}else!s&&t&&k.call(t,u)&&h(this._trace(d,t[u],j(r,u),t,u,o,a,!0))}if(this._hasParentSelector)for(var E=0;E-1?t.slice(0,o+1)+" return "+t.slice(o+1):" return "+t;return C(Function,r.concat([a])).apply(void 0,function(e){if(Array.isArray(e))return x(e)}(i)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||S(i)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())}}]),e}();function T(e,t){try{return F({path:t,json:e})}catch(e){return[]}}function _(e,t,r=!0){let n=T(e,t)||[];return r?n.flat(1/0):n}function L(e,t,r=!1,n=e,i=!0){var o=t;for(let i of Object.keys(e).sort((e,t)=>t.length-e.length))if(t.startsWith(i)){if(i==t){if(r)return e[i];continue}o=t.substring(i.length+1),n=e[i];break}var a=_(n,o,i);return 0==a.length&&(a=[o.replace(/^.*?\./,"_."),o.replace(/^.*?\./,""),o.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),o.replace(/^.*?\.\$([\.\[])/,"_$1"),o.replace(/^.*?\.\$([\.\[])/,"$$$1"),o.replace(/^[^.]+$/,"_")].filter((e,t,r)=>r.indexOf(e)===t).reduce((e,t)=>e.length>0?e:_(n,t,i),[])),r?a[0]:a}function M(e,t={},r){return r?`<${r}${Object.entries(t).map(([e,t])=>null!=t&&` ${e}="${t}"`).filter(Boolean).join("")}>${$(e)}`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):$(e)}function $(e){var t;if(Array.isArray(e))return e.map($).join(` `).trim();if("string"==typeof e)return e;if(null==e)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return M(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((e,t)=>M(e,t.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[t.type]),null===(t=e.text)||void 0===t?void 0:t.replace(/\s+/," "));default:return M(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function I(e){let t=new e.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(e=>{let t=e.target,r=t.getAttribute("data-embed-src");r&&U(t,r),e.addedNodes&&e.addedNodes.forEach(e=>{1==e.nodeType&&B(e,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function B(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;nX,cleanCollectionBit:()=>z,getHumanizedLabel:()=>Y,getLastPathBit:()=>G,getQualifier:()=>J,normalizeCollectionScope:()=>V,parseLimit:()=>W,parseRange:()=>q});var W=e=>{var t;let r=parseInt(null===(t=null==e?void 0:e.match(/\[0:(\d+)\]/))||void 0===t?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},q=e=>{var t;let r=null===(t=null==e?void 0:e.match(/\[([^\]]+)\]/))||void 0===t?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(e=>{if(e.match(/^-?\d+$/))return e;let t=e.match(/^(\d+):(\d+)$/);return t&&parseInt(t[1],10){var t;return null===(t=null==e?void 0:e.match(/(\.\*|\[[^\]]*\])$/))||void 0===t?void 0:t[0]};function z(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function V(e){return z(e)+".*"}function X(e,t){return null==e?void 0:e.replace(/(.|^)(\d+)/g,(e,r,n)=>r+(":"==r?n:String(parseInt(n)+t)))}function Y(e,t=2){var r=z(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return(r=r.filter(e=>isNaN(parseInt(e)))).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).slice(-t).join(" ")}function G(e){return z(e).split(".").pop()}var Q=["January","February","March","April","May","June","July","August","September","October","November","December"],K=e=>{if(!e||"function"!=typeof e.getDay)return;let t=e.getFullYear(),r=Q[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`};function Z(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function ee(e,t,r,n){if(e){var i,o,a,s=e;(null==r?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=$(r)),null!=n&&n.processValue&&(r=null==n?void 0:n.processValue(e,t,r));var l=t.replace("data-path-","");if("data-path-src"==t||"data-path-alt"==t){let t=Array.from(e.children).find(e=>"picture"==e.localName)||e;s="img"==e.localName?e:t.querySelector("img, video")}else if("data-path-href"==t)s=e.querySelector("a")||e.closest("a");else if("data-path-hidden"==t)r=!r||null;else if("data-path"==t||"data-embed-html"==t||"html"==t)l="innerHTML";else if("data-embed-src"==t)U(e,r);else if("data-path-attributes"==t){if(!Array.isArray(r)){let t=(null===(i=e.getAttribute("data-attributes-keys"))||void 0===i?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var u=r[c];ee(e,c,"object"==typeof u&&u?JSON.stringify(u):u,n)}for(var d=0;d]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(m.getAttribute("class")).includes("-inline--time")&&"Invalid Date"!==String(new Date(h=f))&&!isNaN(Number(new Date(h)))&&(f=K(new Date(f))),s.innerHTML!=f&&(s.innerHTML=f)}else s.getAttribute(l)!=r&&s.setAttribute(l,r)}else s.removeAttribute(l)}}}var et=["data-attributes-keys","data-path-attributes","data-path-scope"];function er(e,t,r,n){if(n||(t=(null===(o=null==r?void 0:r.processData)||void 0===o?void 0:o.call(r,e,t))||t),1==e.nodeType){let n=e.getAttribute("data-path-scope");if(n){let i=Z(e),o=L(t,n,!1);0==i&&function(e,t,r){let n=e.getAttribute("data-path-scope");if(null==n)return;var i=Z(e);if(0!=i)return;let o=e.parentNode;if(null!=o){0==t?e.setAttribute("hidden","hidden"):null!=e.getAttribute("hidden")&&e.removeAttribute("hidden");for(var a=i+1,s=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(a++,s=l);for(var c=a;cet.indexOf(e.name)-et.indexOf(t.name));for(var i=0;inew ea(e),createDocumentFragment:()=>new ea(null,11)},this.nodeName=e,this.nodeType=t,this.textContent=r,this.attributes=[],this.childNodes=[]}setAttribute(e,t){let r=this.attributes.find(t=>t.name===e);r?r.value=t:this.attributes.push({name:e,value:t})}getAttribute(e){let t=this.attributes.find(t=>t.name===e);return t?t.value:void 0}insertBefore(e,t){if(e.parentNode=this,null===t)this.childNodes.push(e);else{let r=this.childNodes.indexOf(t);-1!==r&&this.childNodes.splice(r,0,e)}}removeAttribute(e){let t=this.attributes.findIndex(t=>t.name===e);-1!==t&&this.attributes.splice(t,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return null===(e=this.nodeName)||void 0===e?void 0:e.toUpperCase()}get localName(){var e;return null===(e=this.nodeName)||void 0===e?void 0:e.toLowerCase()}get innerHTML(){return ec(this.childNodes)}set innerHTML(e){this.childNodes=el(String(null!=e?e:""))}get outerHTML(){return ec([this])}get children(){return this.childNodes.filter(e=>1==e.nodeType)}closest(e){let t=this;for(;t;){if(es(e,t))return t;t=t.parentNode}return null}querySelectorAll(e){let t=e.split(/\s*,\s*/),r=[],n=e=>{for(let n of t)if(es(n,e)){r.push(e);break}for(let t of e.childNodes)n(t)};for(let e of this.childNodes)n(e);return r}querySelector(e){return this.querySelectorAll(e)[0]}findSibling(e,t){if(!this.parentNode)return null;let r=this.parentNode.childNodes,n=r.indexOf(this);if(-1===n)return null;for(let i=n+e;i>=0&&i]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let o=i[1].toLowerCase(),a=(null===(t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))||void 0===t?void 0:t.map(e=>{let[t,r,,n]=e.match(/([\w-]+)(="([^"]*)")?/);return{name:r,value:(n||"").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}}))||[],s=new ea(o,1);if(s.attributes=a,n.length>0){let e=n[n.length-1];e.childNodes.push(s),s.parentNode=e}else r.push(s);["img","input","br"].includes(o)||n.push(s),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let t=e.indexOf("<"),i=e.slice(0,-1!==t?t:void 0),o=new ea("#text",3);if(o.textContent=i,n.length>0){let e=n[n.length-1];e.childNodes.push(o),o.parentNode=e}else r.push(o);e=e.slice(i.length)}}return r}function ec(e){return e.map(e=>{if(3===e.nodeType)return e.textContent||"";let{nodeName:t,attributes:r}=e,n=r.map(({name:e,value:t})=>` ${e}="${String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}"`).join(""),i=ec(e.childNodes);return["img","input","br"].includes(t)?`<${t}${n} />`:`<${t}${n}>${i}`}).join("")}var eu=e=>{if(!e||"string"!=typeof e.url)return!1;for(var t in e)if(!("body"==t||"params"==t||"headers"==t||"url"==t||"method"===t||"jsonpath"==t&&"string"==typeof e[t]))return!1;return!0};function ed(e){let{url:t,headers:r,params:n,method:i,body:o}=ep(e),a,s=r["Content-Type"];"GET"!=i&&"HEAD"!=i&&("application/json"===s&&(a=JSON.stringify(o)),"multipart/form-data"===s&&(a=Object.keys(o).reduce((e,t)=>(e.append(t,o[t]),e),new FormData)),"application/x-www-form-urlencoded"===s&&(a=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:a,method:i}]}function ep(e){let t={};for(let r in(null==e?void 0:e.headers)||{})e.headers.hasOwnProperty(r)&&(t[r.replace(/^[a-z]|\-[a-z]/g,e=>e.toUpperCase())]=e.headers[r]);return t.Accept||(t.Accept="application/json"),{params:(null==e?void 0:e.params)||{},headers:t,jsonpath:String((null==e?void 0:e.jsonpath)||"$"),method:((null==e?void 0:e.method)||"GET").toUpperCase(),body:(null==e?void 0:e.body)||{},url:String((null==e?void 0:e.url)||"")}}var eh=async(e,t)=>{let r=(0,i.t$)(t,e);if(r instanceof Promise)return r;let n=e;r&&(n=ep(r));try{let[e,t]=ed(n),r=await (await ep.fetchImplementation(e,{...t,method:t.method.toLowerCase()})).json();return n.jsonpath&&"$"!=n.jsonpath?_(r,n.jsonpath):r}catch(e){return{}}};async function ef(e){if(!e)return e;if(eu(e))return eh(e);let t=Object.keys(e),r=await Promise.all(t.map(t=>eu(e[t])?eh(e[t],t):null).filter(Boolean));return t.reduce((t,n)=>({...t,[n]:eu(e[n])?r.shift():e[n]}),{})}ep.clean=function(e){let{params:t,method:r,headers:n,body:i,url:o}=ep(e);var a={url:o},s={...n};return"application/json"===n["Content-Type"]&&delete s["Content-Type"],"application/json"===n.Accept&&delete s.Accept,Object.keys(s).length>0&&(a.headers=s),"GET"!==r&&(a.method=r),"GET"===r||"HEAD"===r||0===Object.keys(i).length||(a.body=i),Object.keys(t).length>0&&(a={...a,params:t}),a},ep.toFetchArguments=ed,ep.fetchOne=eh,ep.fetch=ef,ep.isDataSettings=eu,ep.hasDataSettings=function(e){return!!e&&(eu(e)||Object.values(e).some(eu))},ep.fetchImplementation=(...e)=>fetch(...e);var em={};function eg(e,t=e=>{}){var r;let n=()=>{var i,o,a=Object.assign(new Promise((t,r)=>{i=r=>{null==e||e(r),t(r)},o=r}),{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}h(em,{Component:()=>eQ,ComponentProps:()=>eG,Context:()=>ta,ControlledPromise:()=>eg,DEFAULT_CDN_URL:()=>eN,DOM:()=>f,DataPath:()=>H,DataScope:()=>m,DataSettings:()=>ep,Element:()=>ey,FEAASComponent:()=>eQ,FEAASComponentsProps:()=>eG,FEAASContext:()=>ta,FEAASContextProps:()=>to,FEAASEditor:()=>tr,FEAASEditorProps:()=>tt,FEAASElement:()=>ey,FEAASLoader:()=>eZ,FEAASLoaderProps:()=>eK,FEAASPicker:()=>ti,FEAASPickerProps:()=>tn,FEAASStylesheet:()=>e1,FEAASStylesheetProps:()=>e0,InvalidResponse:()=>ek,JSONPath:()=>F,Loader:()=>eZ,MyComponent:()=>ew,Picker:()=>ti,Stylesheet:()=>e1,Thumbnail:()=>e2,WebComponent:()=>eb,adjustNumbers:()=>X,autoloadScripts:()=>B,cleanCollectionBit:()=>z,clearFetchCache:()=>eC,createStylesheet:()=>ez,customizeDataSettings:()=>i.t$,fetchAndRevalidate:()=>eO,fetchAndRevalidateComponent:()=>eM,fetchAndRevalidateStylesheet:()=>eI,fetchBypassingCache:()=>eR,fetchCache:()=>eE,fetchComponent:()=>e$,fetchData:()=>ef,fetchToValidateCache:()=>ej,fetchWithCacheAwareness:()=>eS,findStylesheet:()=>eJ,getComponent:()=>i.Xr,getComponentSource:()=>eD,getComponentURL:()=>e_,getFetchCache:()=>ex,getFramePosition:()=>te,getHumanizedLabel:()=>Y,getLastPathBit:()=>G,getQualifier:()=>J,getStylesheetSource:()=>eP,getStylesheetURL:()=>eL,loadScript:()=>U,loadStylesheet:()=>eW,loadStylesheetAllowStale:()=>eq,normalizeCollectionScope:()=>V,observeDOMElement:()=>I,parseComponentSource:()=>eF,parseLimit:()=>W,parseRange:()=>q,parseStylesheetSource:()=>eT,queryObject:()=>_,queryObjectRaw:()=>T,queryScopes:()=>L,registerComponent:()=>i.RM,registerDatasource:()=>i.VQ,renderComponent:()=>eX,renderComponentElement:()=>eV,renderComponentPromise:()=>eY,renderDOMContent:()=>ei,renderDOMElement:()=>er,renderHTMLContent:()=>eo,renderStylesheet:()=>eB,renderStylesheetPromise:()=>eU,serializeCH1RichText:()=>$,setDOMAttribute:()=>ee});var eb="undefined"==typeof HTMLElement?"undefined"!=typeof windowJSDOM?windowJSDOM.HTMLElement:class{}:HTMLElement,ey=class extends eb{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=eg(e=>{this.payload=e}),this.whenRendered=eg(()=>this.initialized=!0,()=>this.cancelRender()),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,t,r){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(e=>{var t;return null===(t=e.mount)||void 0===t?void 0:t.call(e)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let t=this.getParent();t&&!t.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),t.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){let t=e[0];("undefined"!=typeof location&&null!=location&&location.hostname.startsWith("components-")||localStorage["Sitecore.Components.Debug"])&&console.log(t+" "+e.slice(1).map(e=>e&&"object"==typeof e?"%O":"%s").join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected&&this.initialized&&this.render&&this.update(),this.cancelRender(),this.connected=!1,this.initialized&&this.render&&this.update())}getParent(e=!0){for(var t=this;t=t.parentElement||(t.parentNode instanceof ShadowRoot?t.parentNode.host:null);)if(!e||t.tagName.startsWith("FEAAS-"))return t;if("FEAAS-CONTEXT"!=this.tagName)return document.querySelector("feaas-context")}getElements(e=this.getRoot(),t=!0){return Array.from(e.querySelectorAll("*")).map(e=>[!t||e.tagName.startsWith("FEAAS-")?e:null,e.shadowRoot?this.getElements(e.shadowRoot,t):null]).flat().filter(Boolean)}handleEvent(e){let t=e.composedPath()[0];switch(e.type){case"feaasMount":t!=this&&this.nestedCallback(t);break;case"feaasUnmount":t!=this&&this.unnestedCallback(t)}}unnestedCallback(e){let t=this.descendants.indexOf(e);-1!=t&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(t,1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var t,r;if(-1==this.descendants.indexOf(e)&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(t=e.refs).parent||(t.parent=this),e.render))for(var n=e.refs.parent;n;n=n.refs.parent)n.render&&((r=e.refs).parentReact||(r.parentReact=n),e.refs.topReact=n)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return void 0===this.payload&&null==this.getAttribute("hidden")}onError(e,t="uncaught",r=!1){let n=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEventIndirectly(n),this.whenLoaded.reject(e),!n.defaultPrevented&&!r){this.whenRendered.reject(e);try{this.unmount()}catch(e){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(void 0===this.payload){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(e=>{throw this.payload=void 0,e});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(null==this.payload)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,t;if(!this.connected)return;let r=null===(t=null===(e=this.payload)||void 0===e?void 0:e.ReactDOM)||void 0===t?void 0:t.flushSync;r?r(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,t,r;if(null==this.payload||!this.render)return;let{React:n,ReactDOM:i,ReactDOMClient:o}=this.payload||{};if(!n)throw Error(`${this.tagName}: React is not present in payload`);if(!i)throw Error(`${this.tagName}: ReactDOM is not present in payload`);"false"==this.getAttribute("hydrate")&&this.firstElementChild||(this.refs.topReact||this.forceUpdateReact?this.forceUpdateReact&&this.connected?null===(e=this.forceUpdateReact)||void 0===e||e.call(this):null===(r=null===(t=this.refs.topReact)||void 0===t?void 0:t.forceUpdateReact)||void 0===r||r.call(t):o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):i.render(this.getReactElement(),this.getReactRootElement()))}invokeReactRendering(){let{React:e,ReactDOM:t}=this.payload||{};if(!this.connected)return null;let r=this.descendants.filter(e=>e.refs.parentReact==this&&e.payload&&e.connected).map((e,t)=>this.getReactElement(e));return this.render({...this.props,children:r},this.payload)}getReactErrorBoundary(e=this,t=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:r,ReactDOM:n}=e.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends r.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(t,r){console.error(`FEAAS: ${e.tagName} Error:`,t,r),e.onError(t,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,t){let{React:r,ReactDOM:n}=e.payload||{},i=this.getReactErrorBoundary(),o=this.getReactWrapper(e);return r.createElement(i,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},r.createElement(o,null))}getReactWrapper(e=this,t=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:r,ReactDOM:n}=e.payload||{};return e.reactWrapper=t=>{if(!e.render)return e.update();{let[t,i]=r.useReducer(e=>e+1,0);return e.forceUpdateReact=i,n.createPortal(r.createElement(r.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:t}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{for(var t in this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides},this.props){let e=this.isJSONAttribute(t),n=this.props[t],i=e?JSON.stringify(n):String(n),o=this.defaultProps[t],a=e?JSON.stringify(o):String(o),s=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),l=this.getAttribute(s);try{var r=e?JSON.stringify(JSON.parse(l)):l}catch(e){var r=null}null==n||i===a?this.removeAttribute(s):("string"==typeof n||"number"==typeof n||"boolean"==typeof n||e)&&r!=i&&this.setAttribute(s,i)}}catch(e){this.whenRendered.reject(e),this.onError(e,"set")}return this}import(e){return import(e)}scheduleRender(){null==this.nextRender&&(this.whenRendered=this.whenRendered.restart()),this.cancelRender(),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}cancelRender(){cancelAnimationFrame(this.nextRender)}formatURL(e,t){return"string"==typeof e&&e.match(/^\/[^\/]/)?t+e:e}getContextAttribute(e,t=this){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(null!=r.getAttribute(e))return r.getAttribute(e);return this.getAttribute(e)}static register(e,t){null==t&&(t="undefined"!=typeof window?window:null),t&&!t.customElements.get(e)&&t.customElements.define(e,this)}},ev=class extends ey{load(){return Promise.all([import("https://cdn.skypack.dev/react"),import("https://cdn.skypack.dev/react-dom")]).then(([e,t])=>({React:e,ReactDOM:t}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},ew=class extends ev{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:t}){let[r,n]=t.useState(0);return t.useEffect(()=>{n(e=>e+1)},[e]),t.createElement(t.Fragment,null,t.createElement("p",null,"Rendering attribute: ",e),t.createElement("p",null,"Triggered updates: ",r))}};ew.observedAttributes=["counter"];var eA=["initial","check","updated"],eE={};function eC(){eE={}}async function eO(e,t,r,n,i=eE){return eS({url:e,options:t,validator:r,callback:n,cache:i}).then(ej).then(e=>e.response)}async function eS({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(null!=i){var s=ex(e);if(eA.indexOf(s.phase)>=eA.indexOf(o))var l=s[o];else s.phase=o}let c=await (l||fetch(e,t));if(!l&&s&&(c.ok?s[o].resolve(c):s[o].reject(Error("Fetch failed"))),!c.ok)throw Error("Fetch failed");let u=new Date(c.headers.get("date"))null==e.headers.get("x-ms-meta-versionDeletedAt"),i=e=>e.clone().text().then(t),o=await Promise.all([e.instance&&eS({options:{headers:{Accept:"text/html"},credentials:"omit"},url:e_({...e,version:e.instance}),validator:n}).catch(e=>e),eS({url:e_(e),validator:n}).catch(e=>e)]),a=o.find(e=>e&&"isCached"in e&&e);if(!a||a instanceof Error)throw o.find(e=>e&&e instanceof Error)||Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:ej({...a,callback:i}).catch(e=>{if(o[0]==a&&(eR({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),ej({...o[1],callback:i});throw e})}async function e$(e){var t;"string"==typeof e&&(e={src:e});let{response:r}=await eM(e,e=>{t=e},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function eI(e,t){return eO(eL(e),{headers:{Accept:"text/css"},credentials:"omit"},e=>null==e.headers.get("x-ms-meta-deletedAt"),(e,r)=>e.clone().text().then(e=>t(e,r)))}function eB(e,t){return eU(e,t||(t=document.createElement("style"))),t}function eU(e,t){return t||(t=document.createElement("style")),eI(e,(e,r)=>{t.textContent=e}).then(()=>t)}var eH=new WeakSet;function eW(e,t){var r,n=eJ(e);if(n){if(eH.has(n))return Promise.resolve(n);e=n.getAttribute("data-href")||n.getAttribute("href")}return eI(e,(i,o)=>{"initial"==o&&n||(r||(r=n&&"LINK"!=n.tagName?n:ez(e)),r.textContent=i),null==t||t(i,o)}).then(()=>r||n)}function eq(e){return new Promise((t,r)=>{eW(e,t).catch(r)})}function eJ(e){let t=eL(e),{library:r}=eT(t),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${t}"], link[rel="stylesheet"][href="${t}"], style[data-href*="${n}"], link[rel="stylesheet"][href*="${n}"]`)}function ez(e){let t=eL(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function eV(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return er(n,t),r}function eX(e,t){return eY(e,t||(t=document.createElement("div"))),t}async function eY(e,t){return t||(t=document.createElement("div")),t.childNodes.length?er(t,e.data,e):"template"in e?ei(t,e.template,e.data,e):eM(e,r=>ei(t,r,e.data,e)).then(()=>t)}function eG(e){var t,r,n,i,o,a,s,l;let c,u=e.getAttribute("src");if(u){let e=eF(u);if(!e)throw Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:d,library:p,component:h,version:f,revision:m}=e}let g=e.getAttribute("data");if(null!=g&&""!=g)try{c="string"==typeof g?JSON.parse(g):{}}catch(e){console.error(e)}let b=e.getAttribute("fetch");return{data:c||{},cdn:null!==(r=null!==(t=e.getContextAttribute("cdn"))&&void 0!==t?t:d)&&void 0!==r?r:eN,library:null!==(n=e.getAttribute("library"))&&void 0!==n?n:p,component:null!==(i=e.getAttribute("component"))&&void 0!==i?i:h,version:null!==(a=null!==(o=e.getAttribute("version"))&&void 0!==o?o:f)&&void 0!==a?a:"responsive",revision:null!==(l=null!==(s=e.getAttribute("revision"))&&void 0!==s?s:m)&&void 0!==l?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:null!=e.getAttribute("editable"),suspended:null!=e.getAttribute("suspended"),lastModified:e.getAttribute("last-modified"),fetch:"false"==b||null==b&&e.hasAttribute("fetch")?[]:null==b||"true"==b?["data","template","stylesheet"]:b.split(/(\s+|\-)+/g).filter(Boolean)}}var eQ=class extends ey{setData(e){this.set({data:e})}getProps(){return eG(this)}isJSONAttribute(e){return"data"==e}attributeChangedCallback(e,t,r){t!==r&&(("library"==e||"component"==e||"revision"==e||"version"==e)&&(this.payload=void 0,this.alreadyRendered&&this.connected&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(e,t,r),"data"==e&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!ep.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await ep.fetch(this.props.data),t=this.alreadyRendered;await this.whenDataReady.resolve(e),t&&this.advance()}getEditor(){var e;return null===(e=document.querySelector("feaas-context"))||void 0===e?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=eg(e=>this.readyData=e,e=>this.onError(e)),this.defaultProps={cdn:eN,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=e=>{this.payload=e,this.advance()},this.getAttribute("data"),this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let e=this.getEditor();if(null!=e&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var t=this;(t=t.previousElementSibling)&&t.getAttribute("data-path-scope")==e;)var r=t;return r}}isReadyToLoad(){return super.isReadyToLoad()&&null!=this.props.library&&null!=this.props.component&&null!=this.props.version}async load(){var e;if(this.getOriginal())return;let t=()=>{null!=this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var r=eq({...this.props}).then(()=>{r=null,t()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var n=eM(this.props,e=>{this.payload=e,this.needsRefresh=!0,t()})}else this.payload=null!==(e=this.props.template)&&void 0!==e?e:this.innerHTML;return Promise.all([r,this.whenDataReady.then(()=>t()),n]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh)){if(Array.from(this.children).filter(e=>"BR"!=e.tagName).length>0&&!this.needsRefresh)er(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;ei(this,this.payload,this.readyData)}}}};function eK(e){return{opacity:null!=e&&e.getAttribute("opacity")?parseFloat(null==e?void 0:e.getAttribute("opacity")):1,hidden:(null==e?void 0:e.getAttribute("hidden"))!=null}}eQ.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet","fetch"],eQ.register("feaas-component");var eZ=class extends ey{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return eK(this)}attributeChangedCallback(e,t,r){if(t!==r)return"hidden"==e&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),r?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,t,r)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=` #loader { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; align-items: center; justify-content: center; background: #f6f6ff; z-index: 1000; } @keyframes loader-circular-track { 0% { stroke-dasharray: 1, 400; stroke-dashoffset: 0; } 50% { stroke-dasharray: 400, 400; stroke-dashoffset: -100; } 100% { stroke-dasharray: 400, 400; stroke-dashoffset: -260; } } @keyframes loader-circular-spinner { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } #loader .spinner { width: 48px; height: 48px; } `,this.loader=document.createElement("div"),this.loader.id="loader",this.loader.innerHTML=`
`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};function e0(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:a,library:s,revision:l}=eT(o);return{library:null==e?void 0:e.getContextAttribute("library"),revision:null!==(r=null!==(t=null==e?void 0:e.getAttribute("revision"))&&void 0!==t?t:l)&&void 0!==r?r:"published",cdn:null!==(i=null!==(n=null==e?void 0:e.getContextAttribute("cdn"))&&void 0!==n?n:null==e?void 0:e.getContextAttribute("hostname"))&&void 0!==i?i:eN}}eZ.observedAttributes=["hidden","opacity"],eZ.register("feaas-loader");var e1=class extends ey{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return e0(this)}isReadyToLoad(){return null!=this.props.library&&null!=this.props.revision&&null!=this.props.cdn}load(){return eW(this.props,this.onLoad)}};e1.register("feaas-stylesheet");var e2={};h(e2,{convertBase64toBlob:()=>e4,generate:()=>e5,get:()=>e6,getVersionForThumbnail:()=>e8,load:()=>e9,responseToImage:()=>e3,upload:()=>e7});var e4=e=>fetch(e).then(e=>e.blob()),e3=e=>e.blob().then(e=>new Promise((t,r)=>{let n=new Image;n.onerror=r,n.onload=()=>{t(n)},n.src=URL.createObjectURL(e)}));async function e8(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function e6(e,t,r){try{if(!e.isNew)return await e9(e,t,r)}catch(r){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(null==t?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${r}`)}let n=await e5(e,t);return null==r||r(n,!1),n&&!e.isNew&&e4(n.src).then(r=>e7(e,t,r)),n}async function e9(e,t,r){var n;let i=t?t.getThumbnailURL():e.getThumbnailURL(),o=e.library.stylesheet,a=new Date(Math.max(Number(e.modifiedAt),Number(o.modifiedAt)));return e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(null==t?void 0:t.id)||"responsive"}, loading`),await eO(i,{},(e,t)=>{let i=2e3>Math.abs(Number(new Date(e.headers.get("x-ms-meta-componentRenderedAt")))-Number(a));return t&&!i&&e3(e).then(e=>{n=e,r(e,t)}),i},(i,o,a)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(null==t?void 0:t.id)||"responsive"}, status: ${o}`),e3(i).then(e=>{n=e,r(e,a)})},null),n}async function e5(e,t,r){var n,i,o,a,s,l;let c,u=t||(e.isNew?null:await e8(e));if(!u||u.isViewEmpty())return null;let d=r||e.library.stylesheets.first,{datasources:p}=e.sdk;return await (n=u.classList,i=d.getBreakpointForWidth(800,u.getBreakpoints()),o=u.view,a=p.reduce((e,t)=>Object.assign(e,{[t.id]:t.sample}),{}),s=d.css,l=e.sdk,(c=document.createElement("iframe")).style.position="absolute",c.style.top="-2000px",c.style.left="-2000px",c.style.width=i.props.minWidth+"px",c.style.height="720px",c.style.zIndex="100011",document.body.appendChild(c),new Promise((e,t)=>{let r=document.createElement("script");r.onerror=t,r.src=l.frontend+"/assets/html2canvas.js",r.onload=()=>{var r;((null===(r=c.contentWindow.document.fonts)||void 0===r?void 0:r.ready)||Promise.resolve()).then(function(){return c.contentWindow.html2canvas(p,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,i.props.minWidth))),width:Math.min(1401,Math.max(320,i.props.minWidth)),height:Math.max(1,Math.min(2e3,p.offsetHeight)),windowWidth:i.props.minWidth||i.props.maxWidth+"px",windowHeight:1e3,proxy:l.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(r=>{let n=r.toDataURL("image/jpeg",.6);c.parentElement.removeChild(c);let i=new Image;i.onload=()=>{e(i)},i.onerror=t,i.src=n})})},c.contentWindow.document.head.appendChild(r);let u=c.contentWindow.document.createElement("style");u.textContent=` ${s} body, html { padding: 0; margin: 0; overflow: hidden } `;let d=c.contentWindow.document.createElement("style");d.textContent=` body, html { padding: 0; margin: 0; overflow: hidden } `,c.contentWindow.document.head.appendChild(u),c.contentWindow.document.head.appendChild(d);let p=eX({template:o,data:a});p.classList.add(...n,"-feaas--preview","-emulate--"+i.details.slug),c.contentWindow.document.body.appendChild(p)}))}async function e7(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=new Date(Math.max(Number(e.modifiedAt),Number(e.library.stylesheet.modifiedAt)));try{await e.sdk.uploadBlob("thumbnails",n.split(/\/thumbnails\//)[1],r,{headers:{"x-ms-blob-content-type":"image/jpg","x-ms-blob-cache-control":"public,max-age=31536000,immutable","x-ms-meta-versionId":t?t.id:null,"x-ms-meta-versionRevision":t?t.revision.toString():null,"x-ms-meta-componentId":e.id,"x-ms-meta-componentRenderedAt":i.toUTCString(),"x-ms-meta-componentModifiedAt":e.modifiedAt.toUTCString(),"x-ms-meta-componentCreatedAt":e.createdAt.toUTCString(),"x-ms-meta-modifiedAt":e.modifiedAt.toUTCString()}}),fetch(n,{cache:"no-cache"}).then(()=>{e.sdk.log("FEAAS: Thumbnail uploaded",n)})}catch(t){e.sdk.log("FEAAS: Thumbnail failed to upload",n,t)}return n}function te(e){let t=[];if(e){let r=e.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let e=0;e({left:e.left+t.left,top:e.top+t.top}),{left:0,top:0})}function tt(e){var t;return{context:HTMLElement,frontend:null==e?void 0:e.getContextAttribute("frontend"),src:null!==(t=null==e?void 0:e.getAttribute("src"))&&void 0!==t?t:"/editor.js",library:null==e?void 0:e.getAttribute("library"),component:null==e?void 0:e.getAttribute("component"),version:null==e?void 0:e.getAttribute("version"),instance:null==e?void 0:e.getAttribute("instance"),forked:null==e?void 0:e.getAttribute("forked"),revision:(null==e?void 0:e.getAttribute("revision"))||"saved",hidden:(null==e?void 0:e.getAttribute("hidden"))!=null,for:null==e?void 0:e.getAttribute("for"),state:(null==e?void 0:e.getAttribute("state"))||"idle",changed:(null==e?void 0:e.getAttribute("changed"))!=null}}"undefined"!=typeof window&&(window.FEAASReactElement=ev,null!==(n=window.FEAASLoading)&&void 0!==n||(window.FEAASLoading=Promise.resolve()));var tr=class extends ey{constructor(){super(...arguments),this.framePoint={top:0,left:0},this.wrapperRect={top:0,left:0,width:0,height:0},this.bodyRect={top:0,left:0,width:0,height:0},this.defaultProps={hidden:!1},this.setTarget=(e,t={component:e.getAttribute("component"),version:e.getAttribute("version"),revision:e.getAttribute("revision"),instance:e.getAttribute("instance")})=>{if(!this.closing&&(!this.target||null==e))return this.set(t),this.target=e,!0},this.onChromeMeasureElement=(e,t=e.getBoundingClientRect())=>e.ownerDocument==document?{left:t.left-this.bodyRect.left,top:t.top-this.bodyRect.top,width:t.width,height:t.height}:{left:t.left+this.framePoint.left-this.bodyRect.left,top:t.top+this.framePoint.top-this.bodyRect.top,width:t.width,height:t.height},this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=te(e.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:e,root:t})=>{!this.chrome||this.props.hidden||(e?(this.chrome.wrapper.style.width=e.width+32+"px",this.chrome.wrapper.style.height=e.height+16+64+"px",this.chrome.wrapper.style.left=e.left-16+"px",this.chrome.wrapper.style.top=e.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=t.left+"px",this.chrome.absolute.style.top=t.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=e=>{var t;switch(null===(t=e.data)||void 0===t?void 0:t.type){case"feaasEdit":let r=this.getPlaceholder();this.setTarget(r.editable,e.data)&&(this.loader=r.loader,document.body.appendChild(r.clipper),this.editedUID=e.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=e.data.measurements,this.props.hidden||this.setPlaceholder()}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var e;this.setAttribute("hidden","hidden"),this.placeholder&&(this.placeholder.positionable.style.opacity="0",this.placeholder.positionable.style.pointerEvents="none"),this.chrome&&(this.chrome.wrapper.style.opacity="0"),!(null===(e=this.target)||void 0===e)&&e.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(e,t)=>{this.versionContext=e,this.setVersionContext=t},this.onEditorStateChange=(e,t)=>{this.editorContext=e,this.setEditorContext=t,e.editor&&"loading"==this.props.state&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return tt(this)}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}showLoader(){this.loader||(this.loader=document.createElement("feaas-loader"),this.loader.setAttribute("opacity","0.6"),this.loader.style.zIndex="1000",this.target.appendChild(this.loader),"FEAAS-COMPONENT"==this.target.tagName&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),"FEAAS-COMPONENT"==this.target.tagName&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import(this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){super.connectedCallback(),window.addEventListener("message",this.onWindowMessage)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("message",this.onWindowMessage)}setIframe(e){this.iframe=e}setIframeComponentContent(){this.placeholder&&this.iframe&&this.placeholder.editable.innerHTML&&this.iframe.contentWindow.postMessage({type:"feaasUpdate",id:this.editedUID,content:this.placeholder.editable.innerHTML})}setPlaceholder(){if(!this.iframe)return;let e=this.iframe.clientWidth,t=this.iframe.clientHeight,r=this.iframe.getBoundingClientRect(),n=this.getPlaceholder(),i=document.body.getBoundingClientRect(),o=this.measurements[this.editedUID];o&&(Object.assign(n.clipper.style,{position:"absolute",top:r.top+this.iframe.clientTop-i.top+"px",left:r.left+this.iframe.clientLeft-i.left+"px",width:e+"px",height:t+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(n.positionable.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(n.loader.style,{position:"absolute",top:o.top+"px",left:o.left+"px",width:o.width+"px",height:o.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder||(this.placeholder={clipper:document.createElement("div"),positionable:document.createElement("div"),editable:Object.assign(document.createElement("div"),{className:"-feaas"}),loader:document.createElement("feaas-loader")},this.placeholder.clipper.appendChild(this.placeholder.positionable),this.placeholder.positionable.appendChild(this.placeholder.editable),this.placeholder.clipper.appendChild(this.placeholder.loader)),this.placeholder}attributeChangedCallback(e,t,r){t!==r&&("hidden"==e&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),r?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(e,t,r))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(e){return null==e.forkOriginId&&null!=this.props.instance}cleanup(){var e;this.placeholder&&(null===(e=this.placeholder.clipper)||void 0===e||e.remove(),this.placeholder=null)}close(){console.log("Editor is not ready")}unfork(){console.log("Editor is not ready")}discard(){console.log("Editor is not ready")}save(){console.log("Editor is not ready")}setVersionContext(e){console.log("Editor is not ready")}setEditorContext(e){console.log("Editor is not ready")}setLoadingState(){this.showLoader(),this.setAttribute("state","loading")}setReadyState(){this.hideLoader(),this.setEditorContext({activeVersionId:this.component.versions[0].id}),this.setAttribute("state","ready")}render({children:e,component:t,version:r,instance:n},{Editor:i,VersionStatusList:o,VersionStatusButton:a,Version:s,VersionMenu:l,EditorUIUndo:c,EditorUIMode:u,React:{useEffect:d,useMemo:p,useState:h,useContext:f},Chakra:{HStack:m,Box:g,Button:b,MenuItem:y},Chrome:v,ReactDOM:w,useSDK:A,useLibrary:E,useSlots:C,useModelObserver:O,ConfirmationContext:S,VersionContext:x}){if(!this.payload)return;let{React:k}=this.payload,j=A(),R=E(),[N,F]=h(),{setConfirm:D}=f(S),P=n||r;N&&(this.component=N),d(()=>{if(this.props.hidden)return;let e=R.components.getItem(t).clone();return e.versions.search({ids:[r,n].filter(Boolean),componentIds:[t]}).then(t=>{e.versions.setItems(t);let i=e.findVersion(n,["staged","published"]),o=e.findVersion(r,["staged","published"]);if(i)i.deletedAt?(i.getDraft().changeAndNotify(o.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",i.id));else if(this.removeAttribute("forked"),this.shouldFork(o)){console.error("FEAAS Editor: Forking");let e=o.fork(n).id;this.setAttribute("instance",e)}else console.error("FEAAS Editor: Regular");F(e)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),F(null)},400)}},[r,this.props.hidden]);let T=O(null==N?void 0:N.versions,[]).filter(e=>e.id==P),_=T[0];_&&!this.props.hidden&&(this.version=_),d(()=>(this.unfork=()=>{D({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let e=N.findVersion(r,["staged","published"]);N.findVersion(n).unstage().unpublish().changeAndNotify(e.toProperties()),N.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(N.findVersion(P).revert(),N.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{D({title:"Component has unsaved changes",button:"Discard",body:"Are you sure to close editor and discard changes?",bypass:!this.props.changed,action:()=>{this.discard(),requestAnimationFrame(this.onClose)}})},this.save=()=>{D({bypass:!!this.props.forked,title:"Customizing component",button:"Save",body:"Changes to the component will only be visible on that page. Changes to component done in Component Builder will not be reflected here. It will be possible to revert the customization.",action:()=>{var e,t;null===(t=null===(e=N.findVersion(P).commitData({view:this.editorContext.editor.getData({rootName:P}),model:""}))||void 0===e?void 0:e.stage())||void 0===t||t.publish(),this.removeAttribute("changed"),this.setAttribute("forked",P),N.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[N]);let L=p(()=>this.target,[N]);return p(()=>N&&C(e,({picker:e,children:t})=>k.createElement(g,{ref:e=>{this.chrome=e?{positionable:e,wrapper:e.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},k.createElement(g,{className:"editor-wrapper",position:"absolute",left:0,top:0},k.createElement(i,{datasources:j.datasources,sdk:j,library:R,component:N,versions:T,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:t,chrome:({editor:e})=>e&&k.createElement(v,null),children:({isArchivedDisplayed:e,editor:t,status:r})=>k.createElement(g,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},k.createElement(g,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),k.createElement(g,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),k.createElement(g,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),k.createElement(g,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),_&&k.createElement(s,{version:_,node:L,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:k.createElement(m,{justifyContent:"space-between"},k.createElement(c,{size:"sm",editor:"ready"==r?t:null}),k.createElement(u,{size:"sm"})),middle:(e,t)=>[!1],right:k.createElement(k.Fragment,null,k.createElement(b,{variant:"secondary",size:"sm",onClick:this.close},"Close"),k.createElement(b,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),k.createElement(l,{isDisabled:!this.props.forked&&!this.props.changed},k.createElement(y,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),k.createElement(y,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[_,this.props.forked,this.props.changed])}isReadyToLoad(){return null!=this.props.component&&null!=this.props.version&&!this.props.hidden}};function tn(e){var t,r;return{part:(null==e?void 0:e.getAttribute("part"))||"picker",slot:(null==e?void 0:e.getAttribute("part"))||"picker",mode:null==e?void 0:e.getAttribute("mode"),dialog:null==e?void 0:e.getAttribute("dialog"),placeholder:(null==e?void 0:e.getAttribute("placeholder"))||"No theme",frontend:null!==(t=null==e?void 0:e.getContextAttribute("frontend"))&&void 0!==t?t:"https://components.sitecorecloud.io",src:null!==(r=null==e?void 0:e.getAttribute("src"))&&void 0!==r?r:"/picker.js",hidden:(null==e?void 0:e.getAttribute("hidden"))!=null,variant:null==e?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}tr.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"],tr.register("feaas-editor");var ti=class extends ey{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return tn(this)}load(){return this.import(this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:e,context:t,mode:r,dialog:n,children:i,variant:o},{Picker:a,React:s,useContext:l,EnvironmentContext:c,useLibrary:u,useSDK:d,BYOC:p}){let[h,f]=s.useReducer(e=>e+1,0),m=d(),g=l(c),b=u("collections"),y=u("components"),v=d("datasources"),w=u(),A=(null===(O=null===(C=w.stylesheets)||void 0===C?void 0:C.first)||void 0===O?void 0:O.rules)||(null===(S=null==w?void 0:w.stylesheet)||void 0===S?void 0:S.styles),E=d("renderingHost.expandedComponents");var C,O,S,x=null==t?void 0:t.getAttribute("data");if(x)try{x=JSON.parse(x)}catch(e){}if(t)var k=m.ExternalComponent.getDefinition(t),j=k&&!k.getConfiguration(t),R=(null==k?void 0:k.type)=="feaas"?y.find(e=>e.id==t.getAttribute("component")):null==p?void 0:p.getComponent(String(t.getAttribute("data-external-id")));return s.createElement(a,{cdn:g.cdn,rules:A,collections:b,themeContext:t,placeholder:e,embed:R,externalComponents:E,datasources:v,data:x,versionId:null==t?void 0:t.getAttribute("version"),mode:r||(j?"library":R?"context":null),setAttribute:(e,t,r)=>{"data"==t&&r&&(r=JSON.stringify(r)),this.props.setAttribute(e,t,r),f()},getAttribute:(e,r)=>null==t?void 0:t.getAttribute(r),dialog:n,context:t,variant:o,onModeChange:(e,t)=>{this.set({mode:e,dialog:t})}},i)}};function to(e){var t,r,n,i,o;return{library:null==e?void 0:e.getAttribute("library"),src:null!==(t=null==e?void 0:e.getAttribute("src"))&&void 0!==t?t:"/context.js",environment:null!==(r=null==e?void 0:e.getAttribute("environment"))&&void 0!==r?r:void 0,frontend:null!==(n=null==e?void 0:e.getAttribute("frontend"))&&void 0!==n?n:"https://components.sitecorecloud.io",backend:null!==(i=null==e?void 0:e.getAttribute("backend"))&&void 0!==i?i:"https://components.sitecorecloud.io/api",cdn:null!==(o=null==e?void 0:e.getAttribute("cdn"))&&void 0!==o?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(null==e?void 0:e.getAttribute("isolate"))==null||(null==e?void 0:e.getAttribute("isolate"))=="true"}}ti.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"],ti.register("feaas-picker");var ta=class extends ey{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(e,t)=>{"ready"==e&&(this.whenSDKReady.resolve(t),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:t})))},this.whenSDKReady=eg(e=>{this.sdk=e})}getProps(){return to(this)}load(){return this.import(this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&null!=this.props.library}getTheme(e){return e}getRoot(){return"false"===this.getAttribute("isolate")?this:this.shadowRoot||this.attachShadow({mode:"open"})}getReactRootElement(){return this.reactRootElement||(this.reactRootElement=document.createElement("div"),this.getRoot().appendChild(this.reactRootElement)),this.reactRootElement}connectedCallback(){this.setAttribute("feaas-role","ui"),Array.from(this.children).forEach(e=>{this.getRoot().appendChild(e)}),document.addEventListener("feaasMount",this),document.addEventListener("feaasUnmount",this),super.connectedCallback()}disconnectedCallback(){document.removeEventListener("feaasMount",this),document.removeEventListener("feaasUnmount",this),super.disconnectedCallback()}getPortalRoot(){return this.getRoot()}render({children:e,library:t},{AppContext:r,Chakra:{Button:n,Tooltip:i},React:o}){let a={containerRef:{current:this.getPortalRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:a},o.createElement(r,{environment:this.props.environment,backend:this.props.backend,libraryId:this.props.library,container:this.getRoot(),auth:this.props.auth,getTheme:this.getTheme,onStatusChange:this.onStatusChange,modalProps:{portalProps:a},chakraProps:{resetScope:':where([feaas-role="ui"])',cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:a}}},e)}};ta.observedAttributes=["library","component","version","revision","hostname","template"],ta.register("feaas-context"),ta.prototype.clientside=em;var ts=i.zB,tl=class extends ey{load(){return Promise.resolve({React:o,ReactDOM:d})}connectedCallback(){this._setAttribute||(this._setAttribute=this.setAttribute,this.setAttribute=function(e,t){let r=this.getAttribute(t);this._setAttribute(e,t),this.attributeChangedCallback(e,r,t)}),super.connectedCallback()}update(){var e;if(!(!(!(null===(e=i.Xr(this.getComponentName()))||void 0===e)&&e.component)&&"false"==this.getAttribute("hydrate")))return super.update()}render(e,{React:t}){var r;let n=null===(r=i.Xr(this.getComponentName()))||void 0===r?void 0:r.component;return n||console.warn(`FEAASExternal: \`${this.getComponentName()}\` is not registered`),t.createElement(t.Fragment,null,n&&t.createElement(n,{componentName:this.getComponentName(),...e}))}getComponentName(){return this.getAttribute("data-external-id")}getProps(){return ts(i.hN(Array.from(this.attributes).reduce((e,{name:t,value:r})=>("data-external-id"==t&&(t="component-name"),Object.assign(e,{[t]:r})),{}))).merged}static Preview(e){var t;let r=(null==e?void 0:e.src)||("undefined"!=typeof window?null===(t=window.location.search.match(/feaasSrc=([^&]+)/))||void 0===t?void 0:t[1]:null);return r?o.createElement(tg,{src:r,...e}):null}static linkComponents(e){return()=>e.map(e=>null)}};tl.registered=i.Gw,tl.registerComponent=i.RM,tl.setRegistrationCallback=i.FS,tl.getComponent=i.Xr,tl.register("feaas-external");var{linkComponents:tc}=tl,tu={};function td(e,t){tu[e]=t}var tp=function(e,t){return l=e,s=t,t},th=i.Xq,tf=function(){return o.createElement(o.Fragment,null,o.createElement("byoc-registration",{components:JSON.stringify(Object.values(i.Gw)),datasources:JSON.stringify(Object.values(i.Qe)),suppressHydrationWarning:!0}),o.createElement(s,null))},tm=c,tg=function({data:e,lastModified:t,fetchedData:r,renderNode:n,...a}){var s,l,u,d;let p;"template"in a&&a.template&&(p=(s=a.template,l=r||e||{},el(s).map(e=>er(e,l,u))).map((e,t)=>(function e(t,r,n){var a;if(3===t.nodeType)return t.textContent;let s=Array.from(t.childNodes).map((t,n)=>e(t,r,n)),l={};for(let e=0;e{let[r,n]=t.split(":");return{...e,[i.zW(r)]:n}},{}):"class"==r?l.className=n:l[r]=n}let c=null==r?void 0:r(t,l),u=(null==c?void 0:c[0])||t.nodeName.toLowerCase();"style"==u&&(l.dangerouslySetInnerHTML={__html:s.join(` `)});let d=Object.assign({key:n,suppressHydrationWarning:!0},(null==c?void 0:c[1])||l),p=(null===(a=null==c?void 0:c[1])||void 0===a?void 0:a.children)||s;return o.createElement(u,d,["img","br","input","style"].includes(u)?null:p)})(e,(e,t)=>{if(n){let r=null==n?void 0:n(e,t);if(null!=r&&"type"in r)return[r.type,r.props];t={...t,...r}}if(tu[e.localName])return[tu[e.localName],t];if("feaas-external"==e.localName){let e={};for(var r in t)e["data-external-id"==r?"componentName":i.zW(r)]=t[r];return[c,e]}},t))),"src"in a&&(a={...eF(a.src),...a});let h=null==(d=a.fetch)||!0===d?["template","stylesheet","data"]:[].concat(d||[]),f=h.includes("data")?e:h.includes("template")?r||e:null;return o.createElement(o.Fragment,null,"preload"in a&&!1,o.createElement("feaas-component",{class:"-feaas",...a,"last-modified":t?String(t):null,fetch:null==a.fetch?a.fetch:[].concat(a.fetch).join(" "),suppressHydrationWarning:!0,template:null,data:"string"==typeof f?f:f?JSON.stringify(f):null},p))}},53143:function(e,t,r){"use strict";r.d(t,{FS:function(){return R},Gw:function(){return O},Qe:function(){return g},RM:function(){return S},Rj:function(){return x},VQ:function(){return b},Xq:function(){return D},Xr:function(){return k},hN:function(){return i},mA:function(){return o},t$:function(){return v},zB:function(){return j},zW:function(){return a}});var n=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[o(r)]:e[r]}),{}),i=(e={})=>Object.keys(e).reduce((t,r)=>Object.assign(t,{[a(r)]:e[r]}),{});function o(e){return a(e).replace(/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g,function(e){return"-"+e.toLowerCase()})}function a(e){return(e=(e=e.replace(/[-_ ]+/g," ")).charAt(0).toLowerCase()+e.slice(1)).split(/\s+/).map((e,t)=>0===t?e:e.charAt(0).toUpperCase()+e.slice(1)).join("")}var s=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},l={},c=e=>{var{properties:t}=e;return Object.assign(Object.assign({},s(e,["properties"])),{type:"object",properties:{name:{type:"string"},displayName:{type:"string"},id:{type:"string"},url:{type:"string"},fields:u(t)}})};function u(e={}){return{type:"object",properties:Object.keys(e).reduce((t,r)=>{let n=e[r],{title:i}=n;return s(n,["title"]),Object.assign(Object.assign({},t),{[r]:{type:"object",properties:{value:Object.assign({title:i||r},e[r])}}})},{})}}var d={Link:()=>({type:"object",properties:{href:{required:!0,type:"string",title:"URL",description:"The URL of the link, except for media items, for which the Url property contains the path to the media item relative to /Sitecore/Media Library."},text:{type:"string",title:"Text",description:"The text content of the HTML element."},linktype:{type:"string",enum:["internal","external","media","anchor","mailto","javascript"],default:"internal",title:"Target",description:"The target attribute of the HTML element."},title:{type:"string",title:"Title",description:"The title attribute of the HTML element."},class:{type:"string",title:"Class Name",description:"The class attribute of the HTML element."},target:{type:"string",title:"Target",description:"The target attribute of the HTML element.",enum:["","_blank","_self","_parent","_top"]},anchor:{type:"string",title:"Anchor",description:"The name attribute of the HTML element, without the leading hash character (“#”)."},querystring:{type:"string",title:"Query String",description:"Query string parameters to add to the URL."}}}),DropLink:c,DropTree:c,File:()=>({type:"object",properties:{src:{type:"string",title:"Source",description:"The URL of the file."},title:{type:"string",title:"Title",description:"Title of a file"},displayName:{type:"string",title:"Display name",description:"Display name of a file"}}}),Date:()=>({type:"string",format:"date"}),Datetime:()=>({type:"string",format:"date-time"}),RichText:()=>({type:"string"}),Image:e=>({type:"object",properties:Object.assign({src:{type:"string"}},e.properties)}),SingleLineText:()=>{},MultiLineText:()=>({type:"string"}),Checkbox:()=>({type:"boolean"}),String:()=>({type:"string"}),Number:()=>({type:"number"}),Boolean:()=>({type:"boolean"}),Item:c,List:e=>{var{properties:t}=e;return Object.assign(Object.assign({},s(e,["properties"])),{type:"array",items:{type:"object",properties:{name:{type:"string"},displayName:{type:"string"},id:{type:"string"},url:{type:"string"},fields:u(t)}}})}};function p(e,t={}){return function e(t,r){var n={};for(var i in t){let o=t[i];o&&"object"==typeof o?Array.isArray(o)?n[i]=o.map(t=>"object"==typeof t&&t?e(t,r):t):n[i]=e(r(o),r):n[i]=t[i]}return n}(e=h(Object.assign({type:"object",properties:{},required:[]},e)),e=>e.properties?h(e,t):e)}function h(e,t={}){var r;let n=Object.assign({},e);return n.properties&&(n.required=(null===(r=e.required)||void 0===r?void 0:r.slice())||[],n.properties=Object.keys(n.properties).reduce((e,r)=>{var i;let a=n.properties[r],s=null===(i=l[null==a?void 0:a.type])||void 0===i?void 0:i.call(l,a),c=Object.assign(Object.assign(Object.assign({},s),a),{type:(null==s?void 0:s.type)||a.type,default:t.hasOwnProperty(r)?t[r]:a.default,title:a.title||o(r).split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")});return(null!=a&&a.properties||null!=s&&s.properties)&&(c.properties=Object.assign({},(null==s?void 0:s.properties)||(null==a?void 0:a.properties)),Object.keys((null==s?void 0:s.properties)||{}).forEach(e=>{var t,r;c.properties[e]=Object.assign(Object.assign({},null===(t=null==s?void 0:s.properties)||void 0===t?void 0:t[e]),null===(r=null==a?void 0:a.properties)||void 0===r?void 0:r[e])})),(null!=a&&a.items||null!=s&&s.items)&&(c.items=(null==s?void 0:s.items)||(null==a?void 0:a.items)),void 0===c.default&&delete c.default,"required"in c&&"boolean"==typeof c.required&&(-1==n.required.indexOf(r)&&n.required.push(r),delete c.required),Object.assign(e,{[r]:c})},{})),Object.assign({type:"object"},n)}Object.keys(d).forEach(e=>{!function(e,{name:t}){if(t.charAt(0)!=t.charAt(0).toUpperCase())throw Error("Custom types must start with a capital letter");l[t]=e}(d[e],{name:e})});var f=(e,t)=>{var r,n,i,o;let a=Object.assign({},e);for(var s in t)"object"==typeof t[s]&&t[s]&&(((null===(r=t[s])||void 0===r?void 0:r.type)=="integer"||(null===(n=t[s])||void 0===n?void 0:n.type)=="number")&&(a[s]=Object.assign(Object.assign({},a[s]),{"ui:options":{widget:"updown"}})),!(null===(i=t[s])||void 0===i)&&i.ui&&(a[s]=Object.assign(Object.assign({},a[s]),{"ui:options":Object.assign(Object.assign({},null===(o=a[s])||void 0===o?void 0:o["ui:options"]),t[s].ui)})),a=Object.assign(Object.assign({},a),{[s]:t[s].items?{items:f(a[s],t[s].items.properties)}:f(a[s],t[s].properties||{})}));return a};function m(e,t){switch(t){case"string":return e;case"object":try{return"object"==typeof e&&null!=e?e:JSON.parse(e)}catch(e){return null}case"array":try{return Array.isArray(e)?e:JSON.parse(e)}catch(e){return null}case"number":return parseFloat(e);case"integer":return parseInt(e);case"boolean":return"true"==e||"1"==e;default:return e}}var g="undefined"!=typeof window?window.BYOCDatasources||(window.BYOCDatasources={}):{};function b(e,t){if("function"!=typeof e)throw Error("The first argument of registerDatasource must be a function returning DataSettings or Promise of data");if(!t.id)throw Error("Missing 'id' property in input");if(!/^[a-zA-Z0-9-_]+$/.test(t.id))throw Error("Invalid 'id' property in input. 'id' should only contain alphanumeric characters, hyphens, and underscores.");g[t.id]=Object.assign(Object.assign({},function(e){let{id:t,name:r,title:n,properties:i,sample:o,schema:a,description:s=null,type:l="object"}=e;return{id:t,description:s,sample:o,name:r||n||t,handler:e=>e,schema:a||i?p(Object.assign(Object.assign({},a||{properties:i,type:l}),{title:(null==a?void 0:a.title)||n||r})):void 0}}(t)),{handler:e}),y()}function y(){clearTimeout(w),"undefined"!=typeof window&&window.parent!==window&&(w=setTimeout(()=>{var e;null===(e=window.parent)||void 0===e||e.postMessage(JSON.stringify({action:"register-datasources",data:Object.values(g)}),"*")},30))}function v(e,t){let r=g[e];return null!=r&&r.handler?r.handler(t):t}y();var w,A,E=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},C="undefined"!=typeof HTMLElement?HTMLElement:"undefined"!=typeof windowJSDOM?windowJSDOM.HTMLElement:class{setAttribute(){}},O="undefined"!=typeof window?window.BYOCComponents||(window.BYOCComponents={}):{};function S(e,t,r={}){if(!(null!=t&&t.name))throw Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(t));let n=function(e,t,r){let{thumbnail:n="https://feaasstatic.blob.core.windows.net/assets/thumbnails/byoc.svg",name:i,id:o=e.name,group:a=null,ui:s,isHidden:l=!1,datasourceIds:c=[],links:u={},meta:d={},uiSchema:h,schema:m}=e,g=E(e,["thumbnail","name","id","group","ui","isHidden","datasourceIds","links","meta","uiSchema","schema"]),b=p(Object.assign(Object.assign({description:"External component"},m||g||{}),{type:"object"}),r),y=f(h||s||{},b.properties||{});return{component:t||(()=>null),name:i,schema:b,uiSchema:y,thumbnail:n,group:a||"Default collection",isHidden:l,id:o,datasourceIds:c,links:u,meta:d,title:(null==b?void 0:b.title)||(null==g?void 0:g.title)||i}}(t,e,r);O[n.id]=n,x(e)&&N.register("byoc-"+o(t.name),void 0,e),R()}function x(e){return e&&"prototype"in e&&"setAttribute"in e.prototype}function k(e){if("string"!=typeof e){if(e&&"schema"in e)return e;throw Error(`Component name should be a string, got ${typeof e}`)}let[t,r]=e.split("?");var n=O[t];if(r){let t=O[e];if(!t&&!n)return null;t&&(n=Object.assign(Object.assign(Object.assign({},n),t),{component:t.component||(null==n?void 0:n.component)})),r.split(/\&/g).forEach(e=>{var t,r,i;let[o,a]=e.split("="),s=(null===(t=n.schema.properties)||void 0===t?void 0:t[o])||{type:"string"};n=Object.assign(Object.assign({},n),{schema:Object.assign(Object.assign({},n.schema),{properties:Object.assign(Object.assign({},n.schema.properties),{[o]:Object.assign(Object.assign({},s),{default:m(decodeURIComponent(a),s.type)})})}),uiSchema:Object.assign(Object.assign({},n.uiSchema),{[o]:Object.assign(Object.assign({},n.uiSchema[o]),{"ui:widget":null!==(i=null===(r=n.uiSchema[o])||void 0===r?void 0:r["ui:widget"])&&void 0!==i?i:"hidden"})})})})}return n}function j(e){let{componentName:t,className:r,fallbackWrapper:i,fallback:s,suppressHydrationWarning:l,_dynamic:c,datasources:u}=e,d=E(e,["componentName","className","fallbackWrapper","fallback","suppressHydrationWarning","_dynamic","datasources"]);try{var p="string"==typeof u?JSON.parse(u):u}catch(e){}let h=Object.values(p||{}).find(e=>e&&!Array.isArray(e)&&Object.keys(e).length>0),f=Object.assign(Object.assign(Object.assign({},h),function(e,t={}){var r;let n=null===(r=k(e))||void 0===r?void 0:r.schema;return n?Object.assign(Object.assign({},Object.keys(n.properties).reduce((e,t)=>{var r,i;return(null===(r=n.properties[t])||void 0===r?void 0:r.default)!=null?Object.assign(Object.assign({},e),{[t]:null===(i=n.properties[t])||void 0===i?void 0:i.default}):e},{})),Object.keys(t).reduce((e,r)=>{let i=t[r],o=a(r),s=null==n?void 0:n.properties[o],l=m(i,null==s?void 0:s.type);return null==l||r.startsWith("data-attribute")||["class","id","contenteditable"].includes(r)?e:Object.assign(Object.assign({},e),{[o]:l})},{})):t}(t,Object.assign(Object.assign({},h),d))),p?{datasources:p}:{}),g=Object.assign(Object.assign({"data-external-id":t},n(f)),{suppressHydrationWarning:!0,class:r});return P.forEach(e=>{Object.assign(g,{[o(e)]:F[e]})}),Object.keys(g).forEach(e=>{let t=g[e];if(t&&"object"==typeof t&&"class"!=e&&"children"!=e)try{Object.assign(g,{[e]:JSON.stringify(t)})}catch(t){delete g[e]}("function"==typeof t||null==t)&&delete g[e]}),{attributes:g,properties:f,merged:Object.assign(Object.assign({},F),f)}}function R(){clearTimeout(A),"undefined"!=typeof window&&window.parent!==window&&(A=setTimeout(()=>{var e;null===(e=window.parent)||void 0===e||e.postMessage(JSON.stringify({action:"register-components",data:Object.values(O)}),"*")},30))}R();var N=class extends C{connectedCallback(){try{JSON.parse(String(this.getAttribute("components"))).forEach(e=>{k(e.id)||S(null,e)}),JSON.parse(String(this.getAttribute("datasources"))).forEach(e=>{g[e.id]||b(e=>e,e)})}catch(e){}}static register(e,t,r=this){null==t&&(t="undefined"!=typeof window?window:void 0),t&&!t.customElements.get(e)&&t.customElements.define(e,class extends r{})}},F={};function D(e){F=e}var P=["sitecoreEdgeUrl","sitecoreEdgeContextId"];N.register("byoc-registration")},37708:function(e,t,r){"use strict";var n,i;r(53143),(i=n||(n={})).Preview="preview",i.Edit="edit",i.Normal="normal"}}]);