@sitecore-feaas/clientside 0.3.13 → 0.3.15

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.
Files changed (48) hide show
  1. package/build/components/FEAASComponent.js +2 -0
  2. package/build/components/FEAASComponent.js.map +1 -1
  3. package/build/ui/FEAASExternal.js +6 -2
  4. package/build/ui/FEAASExternal.js.map +1 -1
  5. package/build/ui/react.js +2 -0
  6. package/build/ui/react.js.map +1 -1
  7. package/dist/browser/headless.cjs +1 -1
  8. package/dist/browser/headless.cjs.map +2 -2
  9. package/dist/browser/headless.esm.js +1 -1
  10. package/dist/browser/headless.esm.js.map +1 -1
  11. package/dist/browser/index.cjs +1 -1
  12. package/dist/browser/index.cjs.map +2 -2
  13. package/dist/browser/index.esm.js +1 -1
  14. package/dist/browser/index.esm.js.map +1 -1
  15. package/dist/browser/react.cjs +5 -5
  16. package/dist/browser/react.cjs.map +2 -2
  17. package/dist/browser/react.esm.js +5 -5
  18. package/dist/browser/react.esm.js.map +1 -1
  19. package/dist/node/headless.cjs +4 -4
  20. package/dist/node/headless.cjs.map +3 -3
  21. package/dist/node/headless.esm.js +4 -4
  22. package/dist/node/headless.esm.js.map +3 -3
  23. package/dist/node/index.cjs +1 -1
  24. package/dist/node/index.cjs.map +2 -2
  25. package/dist/node/index.esm.js +1 -1
  26. package/dist/node/index.esm.js.map +2 -2
  27. package/dist/node/react.cjs +4 -4
  28. package/dist/node/react.cjs.map +2 -2
  29. package/dist/node/react.esm.js +4 -4
  30. package/dist/node/react.esm.js.map +2 -2
  31. package/headless.cjs +4 -4
  32. package/headless.cjs.map +3 -3
  33. package/headless.js +4 -4
  34. package/headless.js.map +3 -3
  35. package/package.json +1 -1
  36. package/react.cjs +5 -5
  37. package/react.cjs.map +2 -2
  38. package/react.js +5 -5
  39. package/react.js.map +2 -2
  40. package/src/components/FEAASComponent.tsx +2 -1
  41. package/src/ui/FEAASExternal.tsx +9 -2
  42. package/src/ui/react.tsx +2 -0
  43. package/test/ServerComponent.test.tsx +8 -8
  44. package/types/components/FEAASComponent.d.ts.map +1 -1
  45. package/types/tsbuildinfo +1 -1
  46. package/types/ui/FEAASExternal.d.ts.map +1 -1
  47. package/types/ui/react.d.ts.map +1 -1
  48. package/types/ui/tsbuildinfo +1 -1
@@ -1,7 +1,7 @@
1
- var ir=Object.defineProperty;var rt=(e,t)=>{for(var r in t)ir(e,r,{get:t[r],enumerable:!0})};var ee={};rt(ee,{Component:()=>pt,ComponentProps:()=>Ie,Context:()=>q,ControlledPromise:()=>F,DEFAULT_CDN_URL:()=>M,DOM:()=>St,DataPath:()=>Ct,DataScope:()=>Et,DataSettings:()=>R,Element:()=>x,FEAASComponent:()=>pt,FEAASComponentsProps:()=>Ie,FEAASContext:()=>q,FEAASContextProps:()=>Ye,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ke,FEAASElement:()=>x,FEAASLoader:()=>ft,FEAASLoaderProps:()=>Ue,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ge,FEAASStylesheet:()=>Ot,FEAASStylesheetProps:()=>Be,InvalidResponse:()=>Rt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>At,Picker:()=>vt,Stylesheet:()=>Ot,Thumbnail:()=>kt,WebComponent:()=>bt,adjustNumbers:()=>xe,autoloadScripts:()=>be,cleanCollectionBit:()=>lt,clearFetchCache:()=>xr,createStylesheet:()=>Le,fetchAndRevalidate:()=>ut,fetchAndRevalidateComponent:()=>X,fetchAndRevalidateStylesheet:()=>_t,fetchBypassingCache:()=>Dt,fetchCache:()=>ct,fetchComponent:()=>Kt,fetchData:()=>Zt,fetchToValidateCache:()=>dt,fetchWithCacheAwareness:()=>V,findStylesheet:()=>Me,getComponentSource:()=>Cr,getComponentURL:()=>ht,getFetchCache:()=>Pe,getFramePosition:()=>qe,getHumanizedLabel:()=>Ce,getLastPathBit:()=>Se,getQualifier:()=>we,getStylesheetSource:()=>qt,getStylesheetURL:()=>J,loadScript:()=>at,loadStylesheet:()=>Ft,loadStylesheetAllowStale:()=>Gt,normalizeCollectionScope:()=>xt,observeDOMElement:()=>ye,parseComponentSource:()=>z,parseLimit:()=>Ae,parseRange:()=>Ee,parseStylesheetSource:()=>Y,queryObject:()=>G,queryObjectRaw:()=>Vt,queryScopes:()=>st,renderComponent:()=>Yt,renderComponentElement:()=>Rr,renderComponentPromise:()=>$e,renderDOMContent:()=>H,renderDOMElement:()=>N,renderHTMLContent:()=>Oe,renderStylesheet:()=>Sr,renderStylesheetPromise:()=>Te,serializeCH1RichText:()=>U,setDOMAttribute:()=>W});function F(e,t=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,u)=>{i=c=>{e==null||e(c),l(c)},o=u});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}var bt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends bt{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=F(t=>{this.payload=t}),this.whenRendered=F(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.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(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${t.tagName} Error:`,s,a),t.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[s,a]=n.useReducer(l=>l+1,0);return t.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.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(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),o=this.props[r],s=i?JSON.stringify(o):String(o),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),u=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c=this.getAttribute(u);try{var n=i?JSON.stringify(JSON.parse(c)):c}catch(p){var n=null}o==null||s===l?this.removeAttribute(u):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=s&&this.setAttribute(u,s)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var K=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},At=class extends K{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};At.observedAttributes=["counter"];var St={};rt(St,{renderDOMContent:()=>H,renderDOMElement:()=>N,renderHTMLContent:()=>Oe,setDOMAttribute:()=>W});var Et={};rt(Et,{JSONPath:()=>f,queryObject:()=>G,queryObjectRaw:()=>Vt,queryScopes:()=>st,serializeCH1RichText:()=>U});function T(e){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(e)}function pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fe(e,t,r){return t&&he(e.prototype,t),r&&he(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function or(e,t){if(typeof t!="function"&&t!==null)throw new 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&&ot(e,t)}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},it(e)}function ot(e,t){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ot(e,t)}function me(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nt(e,t,r){return me()?nt=Reflect.construct.bind():nt=function(i,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(i,a),u=new l;return s&&ot(u,s.prototype),u},nt.apply(null,arguments)}function sr(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ut(e){var t=typeof Map=="function"?new Map:void 0;return Ut=function(n){if(n===null||!sr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return nt(n,arguments,it(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ot(i,n)},Ut(e)}function ar(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lr(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ar(e)}function cr(e){var t=me();return function(){var n=it(e),i;if(t){var o=it(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return lr(this,i)}}function ur(e){return dr(e)||hr(e)||ve(e)||pr()}function dr(e){if(Array.isArray(e))return Bt(e)}function hr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ve(e,t){if(e){if(typeof e=="string")return Bt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(e,t)}}function Bt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var ir=Object.defineProperty;var rt=(e,t)=>{for(var r in t)ir(e,r,{get:t[r],enumerable:!0})};var ee={};rt(ee,{Component:()=>pt,ComponentProps:()=>Ie,Context:()=>q,ControlledPromise:()=>_,DEFAULT_CDN_URL:()=>M,DOM:()=>St,DataPath:()=>Ct,DataScope:()=>Et,DataSettings:()=>R,Element:()=>x,FEAASComponent:()=>pt,FEAASComponentsProps:()=>Ie,FEAASContext:()=>q,FEAASContextProps:()=>Ye,FEAASEditor:()=>mt,FEAASEditorProps:()=>Ke,FEAASElement:()=>x,FEAASLoader:()=>ft,FEAASLoaderProps:()=>Ue,FEAASPicker:()=>vt,FEAASPickerProps:()=>Ge,FEAASStylesheet:()=>Ot,FEAASStylesheetProps:()=>Be,InvalidResponse:()=>Rt,JSONPath:()=>f,Loader:()=>ft,MyComponent:()=>At,Picker:()=>vt,Stylesheet:()=>Ot,Thumbnail:()=>kt,WebComponent:()=>bt,adjustNumbers:()=>xe,autoloadScripts:()=>be,cleanCollectionBit:()=>lt,clearFetchCache:()=>xr,createStylesheet:()=>Le,fetchAndRevalidate:()=>ut,fetchAndRevalidateComponent:()=>X,fetchAndRevalidateStylesheet:()=>Ft,fetchBypassingCache:()=>Dt,fetchCache:()=>ct,fetchComponent:()=>Kt,fetchData:()=>Zt,fetchToValidateCache:()=>dt,fetchWithCacheAwareness:()=>V,findStylesheet:()=>Me,getComponentSource:()=>Cr,getComponentURL:()=>ht,getFetchCache:()=>Pe,getFramePosition:()=>qe,getHumanizedLabel:()=>Ce,getLastPathBit:()=>Se,getQualifier:()=>we,getStylesheetSource:()=>qt,getStylesheetURL:()=>J,loadScript:()=>at,loadStylesheet:()=>_t,loadStylesheetAllowStale:()=>Gt,normalizeCollectionScope:()=>xt,observeDOMElement:()=>ye,parseComponentSource:()=>z,parseLimit:()=>Ae,parseRange:()=>Ee,parseStylesheetSource:()=>Y,queryObject:()=>G,queryObjectRaw:()=>Vt,queryScopes:()=>st,renderComponent:()=>Yt,renderComponentElement:()=>Rr,renderComponentPromise:()=>$e,renderDOMContent:()=>H,renderDOMElement:()=>N,renderHTMLContent:()=>Oe,renderStylesheet:()=>Sr,renderStylesheetPromise:()=>Te,serializeCH1RichText:()=>U,setDOMAttribute:()=>W});function _(e,t=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((l,u)=>{i=c=>{e==null||e(c),l(c)},o=u});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(t),a};return n()}var bt=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,x=class extends bt{getProps(t){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=_(t=>{this.payload=t}),this.whenRendered=_(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(t,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let t=this.getParent();if(t&&!t.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(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(t){this.onError(t)}}dispatchEventIndirectly(t){this.dispatchEvent(t);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(t,"target",{value:this,writable:!1}),Object.defineProperty(t,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(t))}isJSONAttribute(t){return!1}log(...t){if(typeof process!="undefined"&&process.env.TESTING)return;let r=t[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+t.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...t.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(t=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!t||r.tagName.startsWith("FEAAS-"))return r;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}getElements(t=this.getRoot(),r=!0){return Array.from(t.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(t){let r=t.composedPath()[0];switch(t.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(t){let r=this.descendants.indexOf(t);r!=-1&&(this.log("FEAAS: Unnest",this,t),this.descendants.splice(r,1),this.refs[t.getComponentName()]=null,t.refs.parent==this&&(t.refs.parent=null),t.refs.top==this&&(t.refs.top=t.refs.parent))}nestedCallback(t){var r,n;if(this.descendants.indexOf(t)==-1&&(this.descendants.push(t),this.log("FEAAS: Nest",this,t),this.refs[t.getComponentName()]=t,t.refs.top=this,(r=t.refs).parent||(r.parent=this),t.render))for(var o=t.refs.parent;o;o=o.refs.parent)o.render&&((n=t.refs).parentReact||(n.parentReact=o),t.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(t,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:t});if(this.dispatchEventIndirectly(i),this.whenLoaded.reject(t),!i.defaultPrevented&&!n){this.whenRendered.reject(t);try{this.unmount()}catch(o){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let t=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(t),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(t){this.onError(t)}}flush(){var t,r;if(!this.connected)return;let n=(r=(t=this.payload)===null||t===void 0?void 0:t.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var t,r,n;if(this.payload==null||!this.render)return;let{React:i,ReactDOM:o,ReactDOMClient:s}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!o)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?s?(this.reactRoot||(this.reactRoot=s.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):o.render(this.getReactElement(),this.getReactRootElement()):this.forceUpdateReact?(t=this.forceUpdateReact)===null||t===void 0||t.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r))}invokeReactRendering(){let{React:t,ReactDOM:r}=this.payload||{};if(!this.connected)return null;let n=this.descendants.filter(i=>i.refs.parentReact==this&&i.payload).map((i,o)=>this.getReactElement(i));return this.render({...this.props,children:n},this.payload)}getReactErrorBoundary(t=this,r=t.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=t.payload||{};return this.reactErrorBoundary||(this.reactErrorBoundary=class extends n.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromError(s){return{error:s}}componentDidCatch(s,a){console.error(`FEAAS: ${t.tagName} Error:`,s,a),t.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(t=this,r=t.tagName){if(t.reactWrapper)return t.reactWrapper;let{React:n,ReactDOM:i}=t.payload||{};return t.reactWrapper=o=>{if(t.render){let[s,a]=n.useReducer(l=>l+1,0);return t.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,t.invokeReactRendering()),t.getReactRootElement())}else return t.update()},Object.assign(t.reactWrapper,{key:t.tagName+"-"+t.getUID(),displayName:r}),t.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(t){try{this.scheduleRender(),this.overrides={...this.overrides,...t},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let i=this.isJSONAttribute(r),o=this.props[r],s=i?JSON.stringify(o):String(o),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),u=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),c=this.getAttribute(u);try{var n=i?JSON.stringify(JSON.parse(c)):c}catch(p){var n=null}o==null||s===l?this.removeAttribute(u):(typeof o=="string"||typeof o=="number"||typeof o=="boolean"||i)&&n!=s&&this.setAttribute(u,s)}}catch(i){this.whenRendered.reject(i),this.onError(i,"set")}return this}import(t){return import( /*@vite-ignore*/ /* webpackIgnore: true */ t)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(t=>{})})}formatURL(t,r){return typeof t=="string"&&t.match(/^\/[^\/]/)?r+t:t}getContextAttribute(t,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(t)!=null)return n.getAttribute(t);return this.getAttribute(t)}static register(t,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(t)&&r.customElements.define(t,this)}};var K=class extends x{load(){return Promise.all([import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react"),import( /*@vite-ignore*/ /* webpackIgnore: true */ "https://cdn.skypack.dev/react-dom")]).then(([t,r])=>({React:t,ReactDOM:r}))}render({},{React:t}){return t.createElement(t.Fragment,null)}},At=class extends K{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:t},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[t]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",t),r.createElement("p",null,"Triggered updates: ",n))}};At.observedAttributes=["counter"];var St={};rt(St,{renderDOMContent:()=>H,renderDOMElement:()=>N,renderHTMLContent:()=>Oe,setDOMAttribute:()=>W});var Et={};rt(Et,{JSONPath:()=>f,queryObject:()=>G,queryObjectRaw:()=>Vt,queryScopes:()=>st,serializeCH1RichText:()=>U});function T(e){return T=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},T(e)}function pe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function he(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fe(e,t,r){return t&&he(e.prototype,t),r&&he(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function or(e,t){if(typeof t!="function"&&t!==null)throw new 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&&ot(e,t)}function it(e){return it=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},it(e)}function ot(e,t){return ot=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},ot(e,t)}function me(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function nt(e,t,r){return me()?nt=Reflect.construct.bind():nt=function(i,o,s){var a=[null];a.push.apply(a,o);var l=Function.bind.apply(i,a),u=new l;return s&&ot(u,s.prototype),u},nt.apply(null,arguments)}function sr(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ut(e){var t=typeof Map=="function"?new Map:void 0;return Ut=function(n){if(n===null||!sr(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(n))return t.get(n);t.set(n,i)}function i(){return nt(n,arguments,it(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),ot(i,n)},Ut(e)}function ar(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function lr(e,t){if(t&&(typeof t=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ar(e)}function cr(e){var t=me();return function(){var n=it(e),i;if(t){var o=it(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return lr(this,i)}}function ur(e){return dr(e)||hr(e)||ve(e)||pr()}function dr(e){if(Array.isArray(e))return Bt(e)}function hr(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ve(e,t){if(e){if(typeof e=="string")return Bt(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(e,t)}}function Bt(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pr(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
2
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fr(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=ve(e))||t&&e&&typeof e.length=="number"){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(l){throw l},f:i}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var D=Object.prototype.hasOwnProperty;function I(e,t){return e=e.slice(),e.push(t),e}function Wt(e,t){return t=t.slice(),t.unshift(e),t}var mr=function(e){or(r,e);var t=cr(r);function r(n){var i;return pe(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return fe(r)}(Ut(Error));function f(e,t,r,n,i){if(!(this instanceof f))try{return new f(e,t,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&T(e)==="object";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=D.call(e,"wrap")?e.wrap:!0,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 new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:o?e.path:t};o?"json"in e&&(s.json=e.json):s.json=r;var a=this.evaluate(s);if(!a||T(a)!=="object")throw new mr(a);return a}}f.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,s=this.parentProperty,a=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,e&&T(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!D.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var u=e;t=u.json,a=D.call(e,"flatten")?e.flatten:a,this.currResultType=D.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=D.call(e,"sandbox")?e.sandbox:this.currSandbox,l=D.call(e,"wrap")?e.wrap:l,this.currPreventEval=D.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=D.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=D.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=D.call(e,"parent")?e.parent:o,s=D.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(o=o||null,s=s||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 p=this._trace(c,t,["$"],o,s,r).filter(function(d){return d&&!d.isParentSelector});return p.length?!l&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(d,h){var g=i._getPreferredOutput(h);return a&&Array.isArray(g)?d=d.concat(g):d.push(g),d},[]):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=typeof e.path=="string"?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 new TypeError("Unknown result type")}};f.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:f.toPathString(e.path),t(n,r,e)}};f.prototype._trace=function(e,t,r,n,i,o,s,a){var l=this,u;if(!e.length)return u={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(u,o,"value"),u;var c=e[0],p=e.slice(1),d=[];function h(A){Array.isArray(A)?A.forEach(function(b){d.push(b)}):d.push(A)}if((typeof c!="string"||a)&&t&&D.call(t,c))h(this._trace(p,t[c],I(r,c),t,c,o,s));else if(c==="*")this._walk(t,function(A){h(l._trace(p,t[A],I(r,A),t,A,o,!0,!0))});else if(c==="..")h(this._trace(p,t,r,n,i,o,s)),this._walk(t,function(A){T(t[A])==="object"&&h(l._trace(e.slice(),t[A],I(r,A),t,A,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return u={path:I(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(u,o,"property"),u;if(c==="$")h(this._trace(p,t,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))h(this._slice(c,p,t,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var g=c.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(A){l._eval(g,t[A],A,r,n,i)&&h(l._trace(p,t[A],I(r,A),t,A,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Wt(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),p),t,r,n,i,o,s))}else if(c[0]==="@"){var m=!1,w=c.slice(1,-2);switch(w){case"scalar":(!t||!["object","function"].includes(T(t)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":T(t)===w&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(m=!0);break;case"object":t&&T(t)===w&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+w)}if(m)return u={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(u,o,"value"),u}else if(c[0]==="`"&&t&&D.call(t,c.slice(1))){var C=c.slice(1);h(this._trace(p,t[C],I(r,C),t,C,o,s,!0))}else if(c.includes(",")){var j=c.split(","),L=fr(j),$;try{for(L.s();!($=L.n()).done;){var yt=$.value;h(this._trace(Wt(yt,p),t,r,n,i,o,!0))}}catch(A){L.e(A)}finally{L.f()}}else!a&&t&&D.call(t,c)&&h(this._trace(p,t[c],I(r,c),t,c,o,s,!0))}if(this._hasParentSelector)for(var y=0;y<d.length;y++){var _=d[y];if(_&&_.isParentSelector){var O=this._trace(_.expr,t,_.path,n,i,o,s);if(Array.isArray(O)){d[y]=O[0];for(var Lt=O.length,Z=1;Z<Lt;Z++)y++,d.splice(y,0,O[Z])}else d[y]=O}}return d};f.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&T(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};f.prototype._slice=function(e,t,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,l=e.split(":"),u=l[2]&&Number.parseInt(l[2])||1,c=l[0]&&Number.parseInt(l[0])||0,p=l[1]&&Number.parseInt(l[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var d=[],h=c;h<p;h+=u){var g=this._trace(Wt(h,t),r,n,i,o,s,!0);g.forEach(function(m){d.push(m)})}return d}};f.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var s=e.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+e;if(!f.cache[a]){var l=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");s&&(l=l.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(u){throw new Error("jsonPath: "+u.message+": "+e)}};f.cache={};f.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};f.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(e){var t=f.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return t[e]=i,t[e].concat()};var vr=function(t,r,n){for(var i=t.length,o=0;o<i;o++){var s=t[o];n(s)&&r.push(t.splice(o--,1)[0])}},gr=function(){function e(t){pe(this,e),this.code=t}return fe(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];vr(i,o,function(c){return typeof r[c]=="function"});var s=i.map(function(c,p){return r[c]}),a=o.reduce(function(c,p){var d=r[p].toString();return/function/.test(d)||(d="function "+d),"var "+p+"="+d+";"+c},"");n=a+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var l=n.lastIndexOf(";"),u=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return nt(Function,i.concat([u])).apply(void 0,ur(s))}}]),e}();f.prototype.vm={Script:gr};function Vt(e,t){try{return f({path:t,json:e})}catch(r){return[]}}function G(e,t){var r;return((r=Vt(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function st(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of o)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}i=t.substring(a.length+1),n=e[a];break}var s=G(n,i);return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((a,l,u)=>u.indexOf(a)===l).reduce((a,l)=>a.length>0?a:G(n,l),[])),r&&Array.isArray(s)?s[0]:s}function Ht(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${U(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):U(e)}function U(e){var t;if(Array.isArray(e))return e.map(U).join(`
4
- `).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return Ht(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>Ht(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return Ht(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var B=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new B(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return zt(this.childNodes)}set innerHTML(t){this.childNodes=wt(String(t!=null?t:""))}get outerHTML(){return zt([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(ge(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(ge(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+t;o>=0&&o<n.length;o+=t){let s=n[o];if(!r||s.nodeType===1)return s}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new B(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ge(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],s=i[3],a=t.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function wt(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let s=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(c=>{let[p,d,,h]=c.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:br(h||"")}}))||[],u=new B(s,1);if(u.attributes=l,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);n.push(u),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let s=e.indexOf("<"),a=e.slice(0,s!==-1?s:void 0),l=new B("#text",3);if(l.textContent=a,n.length>0){let u=n[n.length-1];u.childNodes.push(l),l.parentNode=u}else r.push(l);e=e.slice(a.length)}}return r}function yr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function br(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function zt(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:s,value:a})=>` ${s}="${yr(String(a))}"`).join(""),o=zt(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Ar(e,t,r){return Jt(e,t,r)[0].outerHTML}function Jt(e,t,r){var n;let i=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,e,t))||e;return wt(i).map(s=>N(s,t,r))}function ye(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&at(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&be(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function be(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];at(i,i.getAttribute("data-embed-src"))}if(t)return ye(e)}function at(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var Ct={};rt(Ct,{adjustNumbers:()=>xe,cleanCollectionBit:()=>lt,getHumanizedLabel:()=>Ce,getLastPathBit:()=>Se,getQualifier:()=>we,normalizeCollectionScope:()=>xt,parseLimit:()=>Ae,parseRange:()=>Ee});var Ae=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ee=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},we=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function lt(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function xt(e){return lt(e)+".*"}function xe(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function Ce(e,t=2){var r=lt(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function Se(e){return lt(e).split(".").pop()}var Er=["January","February","March","April","May","June","July","August","September","October","November","December"],Re=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=Er[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},De=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function Fe(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 wr(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=Fe(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var u=s;u<t;u++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var u=Math.max(1,t);u<s;u++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function W(e,t,r,n){var i,o;if(!e)return;var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=U(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let m=Array.from(e.children).find(w=>w.localName=="picture")||e;s=e.localName=="img"?e:m.querySelector("img, video")}else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")at(e,r);else if(t=="data-path-attributes"){let m=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var u=r[l];W(e,l,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var c=0;c<m.length;c++)(r==null||!(m[c]in r))&&W(e,m[c],null,n);W(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!s)return;if((a=="innerHTML"||a=="src")&&(r==null||r==="")){var d=String((o=e.getAttribute("data-path-placeholder")||s[a])!==null&&o!==void 0?o:s.getAttribute(a));a=="innerHTML"?s.innerHTML=d:d?s.setAttribute(a,d):s.removeAttribute(a)}else if(r!=null)if(a=="innerHTML"){for(var h=String(r),g=s;g.parentElement&&g.localName.match(/^(a|var|strong|em|i|b)$/);)g=g.parentElement;g.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(g.getAttribute("class")).includes("-inline--time")&&De(h)&&(h=Re(new Date(h))),s.innerHTML!=h&&(s.innerHTML=h)}else s.getAttribute(a)!=r&&s.setAttribute(a,r);else s.removeAttribute(a)}var _e=["data-attributes-keys","data-path-attributes","data-path-scope"];function N(e,t,r,n){var i,o,s;let a=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,t))||t),a.nodeType==1){let c=a.getAttribute("data-path-scope");if(c){let d=Fe(a),h=st(t,c,!1);d==0&&wr(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,h))===!1?1:h.length,r),t={...t,[xt(c)]:h[d]}}let p=Array.prototype.slice.call(a.attributes).sort((d,h)=>_e.indexOf(d.name)-_e.indexOf(h.name));for(var l=0;l<p.length;l++){let{name:d,value:h}=p[l];d.startsWith("data-path")&&d!="data-path-scope"&&W(a,d,st(t,h,!0),r),d=="data-embed-src"&&W(a,d,a.getAttribute(d),r)}}for(var l=0,u;u=a.childNodes[l++];)Ne(u)&&N(u,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function Ne(e){return e.nodeType==1}function H(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)Ne(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return N(e,r,n)}function Oe(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let s=wt(o);return N(s[0],t,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,N(s,t,r),s.innerHTML}}var ke=["initial","check","updated"],ct={};function xr(){ct={}}async function ut(e,t,r,n,i=ct){return V({url:e,options:t,validator:r,callback:n,cache:i}).then(dt).then(o=>o.response)}function Pe(e,t=!1){let r=String(e).replace("?head","");var n=ct[r];return!n&&!t&&(n=ct[r]={phase:null,initial:F(),check:F(),updated:F(),final:F()}),n}var Rt=class extends Error{};async function V({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=Pe(e);if(ke.indexOf(a.phase)>=ke.indexOf(o))var l=a[o];else a.phase=o}let u=await(l||fetch(e,t));if(!l&&a&&(u.ok?a[o].resolve(u):a[o].reject(new Error("Fetch failed"))),!u.ok)throw new Error("Fetch failed");let c=new Date(u.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(u,c))===!1)throw new Rt("Response is not valid");return await(n==null?void 0:n(u,o,c)),{url:e,options:t,isCached:c,response:u,validator:r,callback:n,cache:i}}async function dt(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:s}=e;if(r){let{response:a}=await V({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return Dt(e)}return e}async function Dt(e){return V({...e,options:{...e.options,cache:"reload"}},"updated")}var M="https://feaas.blob.core.windows.net";function z(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function Cr(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=M?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function qt(e){return`${e.cdn&&e.cdn!=M?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function Y(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=z(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function ht(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...z(e.src)}),`${e.cdn||e.hostname||M}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function J(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...Y(e.src)}),`${e.cdn||e.hostname||M}/styles/${e.library}/${e.revision||"published"}.css`}async function X(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),o=await Promise.all([e.instance&&V({options:{headers:{Accept:"text/html"},credentials:"omit"},url:ht({...e,version:e.instance}),validator:n}).catch(a=>a),V({url:ht(e),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:dt({...s,callback:i}).catch(a=>{if(o[0]==s&&(Dt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),dt({...o[1],callback:i});throw a})}async function Kt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await X(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function _t(e,t){return typeof e=="string"&&(e={src:e}),ut(J(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Sr(e,t){return Te(e,t||(t=document.createElement("style"))),t}function Te(e,t){return t||(t=document.createElement("style")),_t(e,(r,n)=>{t.textContent=r}).then(()=>t)}function Ft(e,t){var r=Me(e);if(!r)var n=Le(e);return _t(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function Gt(e){return new Promise((t,r)=>{Ft(e,t).catch(r)})}function Me(e){return document.head.querySelector(`style[data-href="${J(e)}"]`)}function Le(e){let t=J(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Rr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return N(n,t),r}function Yt(e,t){return $e(e,t||(t=document.createElement("div"))),t}async function $e(e,t){return t||(t=document.createElement("div")),t.childNodes.length?N(t,e.data,e):"template"in e?H(t,e.template,e.data,e):X(e,r=>H(t,r,e.data,e)).then(()=>t)}function Dr(e){let{params:t,method:r,headers:n,body:i,url:o}=R(e);var s={url:o},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(s.headers=a),r!=="GET"&&(s.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(s.body=i),Object.keys(t).length>0&&(s={...s,params:t}),s}var Nt=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function je(e){let{url:t,headers:r,params:n,method:i,body:o}=R(e),s,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((u,c)=>(u.append(c,o[c]),u),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:s,method:i}]}function R(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var Xt=async e=>{try{let[t,r]=je(e),i=await(await R.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?G(i,e.jsonpath):i}catch(t){return{}}};async function Zt(e){if(!e)return e;if(Nt(e))return Xt(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>Nt(e[n])?Xt(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:Nt(e[i])?r.shift():e[i]}),{})}R.clean=Dr;R.toFetchArguments=je;R.fetchOne=Xt;R.fetch=Zt;R.isDataSettings=Nt;R.fetchImplementation=(...e)=>fetch(...e);function Ie(e){var t,r,n,i,o,s,a,l;let u,c=e.getAttribute("src");if(c){let C=z(c);if(!C)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:p,library:d,component:h,version:g,revision:m}=C}let w=e.getAttribute("data");if(w!=null&&w!="")try{u=typeof w=="string"?JSON.parse(w):{}}catch(C){console.error(C)}return{data:u||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:M,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:h,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:g)!==null&&s!==void 0?s:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:m)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var pt=class extends x{setData(t){this.set({data:t})}getProps(){return Ie(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await R.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=F(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:M,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Gt({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),X(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)N(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;H(this,this.payload,this.readyData)}}};pt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];pt.register("feaas-component");function Ue(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var ft=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ue(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var o=!0,s=!1,a;return{s:function(){r=r.call(e)},n:function(){var l=r.next();return o=l.done,l},e:function(l){s=!0,a=l},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var D=Object.prototype.hasOwnProperty;function I(e,t){return e=e.slice(),e.push(t),e}function Wt(e,t){return t=t.slice(),t.unshift(e),t}var mr=function(e){or(r,e);var t=cr(r);function r(n){var i;return pe(this,r),i=t.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),i.avoidNew=!0,i.value=n,i.name="NewError",i}return fe(r)}(Ut(Error));function f(e,t,r,n,i){if(!(this instanceof f))try{return new f(e,t,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&T(e)==="object";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=D.call(e,"wrap")?e.wrap:!0,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 new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},e.autostart!==!1){var s={path:o?e.path:t};o?"json"in e&&(s.json=e.json):s.json=r;var a=this.evaluate(s);if(!a||T(a)!=="object")throw new mr(a);return a}}f.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,s=this.parentProperty,a=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,e&&T(e)==="object"&&!Array.isArray(e)){if(!e.path&&e.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!D.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var u=e;t=u.json,a=D.call(e,"flatten")?e.flatten:a,this.currResultType=D.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=D.call(e,"sandbox")?e.sandbox:this.currSandbox,l=D.call(e,"wrap")?e.wrap:l,this.currPreventEval=D.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=D.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=D.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=D.call(e,"parent")?e.parent:o,s=D.call(e,"parentProperty")?e.parentProperty:s,e=e.path}if(o=o||null,s=s||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 p=this._trace(c,t,["$"],o,s,r).filter(function(d){return d&&!d.isParentSelector});return p.length?!l&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(d,h){var g=i._getPreferredOutput(h);return a&&Array.isArray(g)?d=d.concat(g):d.push(g),d},[]):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=typeof e.path=="string"?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 new TypeError("Unknown result type")}};f.prototype._handleCallback=function(e,t,r){if(t){var n=this._getPreferredOutput(e);e.path=typeof e.path=="string"?e.path:f.toPathString(e.path),t(n,r,e)}};f.prototype._trace=function(e,t,r,n,i,o,s,a){var l=this,u;if(!e.length)return u={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(u,o,"value"),u;var c=e[0],p=e.slice(1),d=[];function h(A){Array.isArray(A)?A.forEach(function(b){d.push(b)}):d.push(A)}if((typeof c!="string"||a)&&t&&D.call(t,c))h(this._trace(p,t[c],I(r,c),t,c,o,s));else if(c==="*")this._walk(t,function(A){h(l._trace(p,t[A],I(r,A),t,A,o,!0,!0))});else if(c==="..")h(this._trace(p,t,r,n,i,o,s)),this._walk(t,function(A){T(t[A])==="object"&&h(l._trace(e.slice(),t[A],I(r,A),t,A,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return u={path:I(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(u,o,"property"),u;if(c==="$")h(this._trace(p,t,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))h(this._slice(c,p,t,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var g=c.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(A){l._eval(g,t[A],A,r,n,i)&&h(l._trace(p,t[A],I(r,A),t,A,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Wt(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),p),t,r,n,i,o,s))}else if(c[0]==="@"){var m=!1,w=c.slice(1,-2);switch(w){case"scalar":(!t||!["object","function"].includes(T(t)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":T(t)===w&&(m=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(m=!0);break;case"number":Number.isFinite(t)&&(m=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(m=!0);break;case"object":t&&T(t)===w&&(m=!0);break;case"array":Array.isArray(t)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+w)}if(m)return u={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(u,o,"value"),u}else if(c[0]==="`"&&t&&D.call(t,c.slice(1))){var C=c.slice(1);h(this._trace(p,t[C],I(r,C),t,C,o,s,!0))}else if(c.includes(",")){var j=c.split(","),L=fr(j),$;try{for(L.s();!($=L.n()).done;){var yt=$.value;h(this._trace(Wt(yt,p),t,r,n,i,o,!0))}}catch(A){L.e(A)}finally{L.f()}}else!a&&t&&D.call(t,c)&&h(this._trace(p,t[c],I(r,c),t,c,o,s,!0))}if(this._hasParentSelector)for(var y=0;y<d.length;y++){var F=d[y];if(F&&F.isParentSelector){var O=this._trace(F.expr,t,F.path,n,i,o,s);if(Array.isArray(O)){d[y]=O[0];for(var Lt=O.length,Z=1;Z<Lt;Z++)y++,d.splice(y,0,O[Z])}else d[y]=O}}return d};f.prototype._walk=function(e,t){if(Array.isArray(e))for(var r=e.length,n=0;n<r;n++)t(n);else e&&T(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};f.prototype._slice=function(e,t,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,l=e.split(":"),u=l[2]&&Number.parseInt(l[2])||1,c=l[0]&&Number.parseInt(l[0])||0,p=l[1]&&Number.parseInt(l[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var d=[],h=c;h<p;h+=u){var g=this._trace(Wt(h,t),r,n,i,o,s,!0);g.forEach(function(m){d.push(m)})}return d}};f.prototype._eval=function(e,t,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=t;var s=e.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+e;if(!f.cache[a]){var l=e.replace(/@parentProperty/g,"_$_parentProperty").replace(/@parent/g,"_$_parent").replace(/@property/g,"_$_property").replace(/@root/g,"_$_root").replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1");s&&(l=l.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(u){throw new Error("jsonPath: "+u.message+": "+e)}};f.cache={};f.toPathString=function(e){for(var t=e,r=t.length,n="$",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+=/^[\*0-9]+$/.test(t[i])?"["+t[i]+"]":"['"+t[i]+"']");return n};f.toPointer=function(e){for(var t=e,r=t.length,n="",i=1;i<r;i++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(t[i])||(n+="/"+t[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(e){var t=f.cache;if(t[e])return t[e].concat();var r=[],n=e.replace(/@(?:null|boolean|number|string|integer|undefined|nonFinite|scalar|array|object|function|other)\(\)/g,";$&;").replace(/['\[](\??\((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\))['\]]/g,function(o,s){return"[#"+(r.push(s)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,s){return"['"+s.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,s){return";"+s.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var s=o.match(/#([0-9]+)/);return!s||!s[1]?o:r[s[1]]});return t[e]=i,t[e].concat()};var vr=function(t,r,n){for(var i=t.length,o=0;o<i;o++){var s=t[o];n(s)&&r.push(t.splice(o--,1)[0])}},gr=function(){function e(t){pe(this,e),this.code=t}return fe(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];vr(i,o,function(c){return typeof r[c]=="function"});var s=i.map(function(c,p){return r[c]}),a=o.reduce(function(c,p){var d=r[p].toString();return/function/.test(d)||(d="function "+d),"var "+p+"="+d+";"+c},"");n=a+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var l=n.lastIndexOf(";"),u=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return nt(Function,i.concat([u])).apply(void 0,ur(s))}}]),e}();f.prototype.vm={Script:gr};function Vt(e,t){try{return f({path:t,json:e})}catch(r){return[]}}function G(e,t){var r;return((r=Vt(e,t))===null||r===void 0?void 0:r.flat(1/0))||[]}function st(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((a,l)=>l.length-a.length);for(let a of o)if(t.startsWith(a)){if(a==t){if(r)return e[a];continue}i=t.substring(a.length+1),n=e[a];break}var s=G(n,i);return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((a,l,u)=>u.indexOf(a)===l).reduce((a,l)=>a.length>0?a:G(n,l),[])),r&&Array.isArray(s)?s[0]:s}function Ht(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${U(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):U(e)}function U(e){var t;if(Array.isArray(e))return e.map(U).join(`
4
+ `).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return Ht(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>Ht(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return Ht(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var B=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new B(i)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return zt(this.childNodes)}set innerHTML(t){this.childNodes=wt(String(t!=null?t:""))}get outerHTML(){return zt([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(ge(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(ge(s,o)){n.push(o);break}for(let s of o.childNodes)i(s)};for(let o of this.childNodes)i(o);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+t;o>=0&&o<n.length;o+=t){let s=n[o];if(!r||s.nodeType===1)return s}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new B(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function ge(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],s=i[3],a=t.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function wt(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let s=i[1],l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(c=>{let[p,d,,h]=c.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:br(h||"")}}))||[],u=new B(s,1);if(u.attributes=l,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);n.push(u),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let s=e.indexOf("<"),a=e.slice(0,s!==-1?s:void 0),l=new B("#text",3);if(l.textContent=a,n.length>0){let u=n[n.length-1];u.childNodes.push(l),l.parentNode=u}else r.push(l);e=e.slice(a.length)}}return r}function yr(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function br(e){return e.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function zt(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:s,value:a})=>` ${s}="${yr(String(a))}"`).join(""),o=zt(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Ar(e,t,r){return Jt(e,t,r)[0].outerHTML}function Jt(e,t,r){var n;let i=((n=r==null?void 0:r.processTemplate)===null||n===void 0?void 0:n.call(r,null,e,t))||e;return wt(i).map(s=>N(s,t,r))}function ye(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&at(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&be(s,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function be(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];at(i,i.getAttribute("data-embed-src"))}if(t)return ye(e)}function at(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var Ct={};rt(Ct,{adjustNumbers:()=>xe,cleanCollectionBit:()=>lt,getHumanizedLabel:()=>Ce,getLastPathBit:()=>Se,getQualifier:()=>we,normalizeCollectionScope:()=>xt,parseLimit:()=>Ae,parseRange:()=>Ee});var Ae=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},Ee=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},we=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function lt(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function xt(e){return lt(e)+".*"}function xe(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function Ce(e,t=2){var r=lt(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function Se(e){return lt(e).split(".").pop()}var Er=["January","February","March","April","May","June","July","August","September","October","November","December"],Re=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=Er[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},De=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function _e(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 wr(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=_e(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var s=i+1,a=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(s++,a=l);for(var u=s;u<t;u++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var u=Math.max(1,t);u<s;u++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function W(e,t,r,n){var i,o;if(!e)return;var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=U(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var a=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let m=Array.from(e.children).find(w=>w.localName=="picture")||e;s=e.localName=="img"?e:m.querySelector("img, video")}else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")a="innerHTML";else if(t=="data-embed-src")at(e,r);else if(t=="data-path-attributes"){let m=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var u=r[l];W(e,l,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var c=0;c<m.length;c++)(r==null||!(m[c]in r))&&W(e,m[c],null,n);W(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!s)return;if((a=="innerHTML"||a=="src")&&(r==null||r==="")){var d=String((o=e.getAttribute("data-path-placeholder")||s[a])!==null&&o!==void 0?o:s.getAttribute(a));a=="innerHTML"?s.innerHTML=d:d?s.setAttribute(a,d):s.removeAttribute(a)}else if(r!=null)if(a=="innerHTML"){for(var h=String(r),g=s;g.parentElement&&g.localName.match(/^(a|var|strong|em|i|b)$/);)g=g.parentElement;g.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(g.getAttribute("class")).includes("-inline--time")&&De(h)&&(h=Re(new Date(h))),s.innerHTML!=h&&(s.innerHTML=h)}else s.getAttribute(a)!=r&&s.setAttribute(a,r);else s.removeAttribute(a)}var Fe=["data-attributes-keys","data-path-attributes","data-path-scope"];function N(e,t,r,n){var i,o,s;let a=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,t))||t),a.nodeType==1){let c=a.getAttribute("data-path-scope");if(c){let d=_e(a),h=st(t,c,!1);d==0&&wr(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,h))===!1?1:h.length,r),t={...t,[xt(c)]:h[d]}}let p=Array.prototype.slice.call(a.attributes).sort((d,h)=>Fe.indexOf(d.name)-Fe.indexOf(h.name));for(var l=0;l<p.length;l++){let{name:d,value:h}=p[l];d.startsWith("data-path")&&d!="data-path-scope"&&W(a,d,st(t,h,!0),r),d=="data-embed-src"&&W(a,d,a.getAttribute(d),r)}}for(var l=0,u;u=a.childNodes[l++];)Ne(u)&&N(u,t,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,t),a}function Ne(e){return e.nodeType==1}function H(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var a=0,l;l=e.childNodes[a++];)Ne(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return N(e,r,n)}function Oe(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let s=wt(o);return N(s[0],t,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,N(s,t,r),s.innerHTML}}var ke=["initial","check","updated"],ct={};function xr(){ct={}}async function ut(e,t,r,n,i=ct){return V({url:e,options:t,validator:r,callback:n,cache:i}).then(dt).then(o=>o.response)}function Pe(e,t=!1){let r=String(e).replace("?head","");var n=ct[r];return!n&&!t&&(n=ct[r]={phase:null,initial:_(),check:_(),updated:_(),final:_()}),n}var Rt=class extends Error{};async function V({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=Pe(e);if(ke.indexOf(a.phase)>=ke.indexOf(o))var l=a[o];else a.phase=o}let u=await(l||fetch(e,t));if(!l&&a&&(u.ok?a[o].resolve(u):a[o].reject(new Error("Fetch failed"))),!u.ok)throw new Error("Fetch failed");let c=new Date(u.headers.get("date"))<s||l&&o=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(u,c))===!1)throw new Rt("Response is not valid");return await(n==null?void 0:n(u,o,c)),{url:e,options:t,isCached:c,response:u,validator:r,callback:n,cache:i}}async function dt(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:s}=e;if(r){let{response:a}=await V({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:s},"check");if(a.headers.get("last-modified")!=o.headers.get("last-modified"))return Dt(e)}return e}async function Dt(e){return V({...e,options:{...e.options,cache:"reload"}},"updated")}var M="https://feaas.blob.core.windows.net";function z(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,s]=t;return{cdn:r,library:n,component:i,version:o,revision:s}}}function Cr(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=M?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function qt(e){return`${e.cdn&&e.cdn!=M?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function Y(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=z(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function ht(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...z(e.src)}),`${e.cdn||e.hostname||M}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function J(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...Y(e.src)}),`${e.cdn||e.hostname||M}/styles/${e.library}/${e.revision||"published"}.css`}async function X(e,t,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(t),o=await Promise.all([e.instance&&V({options:{headers:{Accept:"text/html"},credentials:"omit"},url:ht({...e,version:e.instance}),validator:n}).catch(a=>a),V({url:ht(e),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:dt({...s,callback:i}).catch(a=>{if(o[0]==s&&(Dt({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),dt({...o[1],callback:i});throw a})}async function Kt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await X(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function Ft(e,t){return typeof e=="string"&&(e={src:e}),ut(J(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function Sr(e,t){return Te(e,t||(t=document.createElement("style"))),t}function Te(e,t){return t||(t=document.createElement("style")),Ft(e,(r,n)=>{t.textContent=r}).then(()=>t)}function _t(e,t){var r=Me(e);if(!r)var n=Le(e);return Ft(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function Gt(e){return new Promise((t,r)=>{_t(e,t).catch(r)})}function Me(e){return document.head.querySelector(`style[data-href="${J(e)}"]`)}function Le(e){let t=J(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function Rr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return N(n,t),r}function Yt(e,t){return $e(e,t||(t=document.createElement("div"))),t}async function $e(e,t){return t||(t=document.createElement("div")),t.childNodes.length?N(t,e.data,e):"template"in e?H(t,e.template,e.data,e):X(e,r=>H(t,r,e.data,e)).then(()=>t)}function Dr(e){let{params:t,method:r,headers:n,body:i,url:o}=R(e);var s={url:o},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(s.headers=a),r!=="GET"&&(s.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(s.body=i),Object.keys(t).length>0&&(s={...s,params:t}),s}var Nt=e=>{if(typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function je(e){let{url:t,headers:r,params:n,method:i,body:o}=R(e),s,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(s=JSON.stringify(o)),a==="multipart/form-data"&&(s=Object.keys(o).reduce((u,c)=>(u.append(c,o[c]),u),new FormData)),a==="application/x-www-form-urlencoded"&&(s=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:s,method:i}]}function R(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var Xt=async e=>{try{let[t,r]=je(e),i=await(await R.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?G(i,e.jsonpath):i}catch(t){return{}}};async function Zt(e){if(!e)return e;if(Nt(e))return Xt(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>Nt(e[n])?Xt(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:Nt(e[i])?r.shift():e[i]}),{})}R.clean=Dr;R.toFetchArguments=je;R.fetchOne=Xt;R.fetch=Zt;R.isDataSettings=Nt;R.fetchImplementation=(...e)=>fetch(...e);function Ie(e){var t,r,n,i,o,s,a,l;let u,c=e.getAttribute("src");if(c){let C=z(c);if(!C)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:p,library:d,component:h,version:g,revision:m}=C}let w=e.getAttribute("data");if(w!=null&&w!="")try{u=typeof w=="string"?JSON.parse(w):{}}catch(C){console.error(C)}return{data:u||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:p)!==null&&r!==void 0?r:M,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:h,version:(s=(o=e.getAttribute("version"))!==null&&o!==void 0?o:g)!==null&&s!==void 0?s:"responsive",revision:(l=(a=e.getAttribute("revision"))!==null&&a!==void 0?a:m)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),withStylesheet:e.getAttribute("with-stylesheet")!="false"}}var pt=class extends x{setData(t){this.set({data:t})}getProps(){return Ie(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(t,r,n),t==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await R.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=_(t=>this.readyData=t,t=>this.onError(t)),this.defaultProps={cdn:M,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=t=>{this.payload=t,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){if(this.getOriginal())return;let t=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Gt({...this.props,revision:"published"}).then(()=>{r=null,t()});return Promise.all([r,this.whenDataReady.then(()=>t()),X(this.props,n=>{this.payload=n,t()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.getAttribute("hydrate")!="false")if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)N(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;H(this,this.payload,this.readyData)}}};pt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];pt.register("feaas-component");function Ue(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var ft=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ue(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
5
5
  #loader {
6
6
  position: absolute;
7
7
  top: 0;
@@ -65,10 +65,10 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
65
65
  style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
66
66
  ></circle>
67
67
  </svg>
68
- </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};ft.observedAttributes=["hidden","opacity"];ft.register("feaas-loader");function Be(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:s,library:a,revision:l}=Y(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:M}}var Ot=class extends x{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Be(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return Ft(this.props,this.onLoad)}};Ot.register("feaas-stylesheet");var kt={};rt(kt,{convertBase64toBlob:()=>We,generate:()=>ze,get:()=>_r,getVersionForThumbnail:()=>He,load:()=>Ve,responseToImage:()=>Qt,upload:()=>Je});var We=e=>fetch(e).then(t=>t.blob()),Qt=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function He(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function _r(e,t,r){try{if(!e.isNew)return await Ve(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await ze(e,t);return r==null||r(n,!1),n&&!e.isNew&&We(n.src).then(i=>Je(e,t,i)),n}async function Ve(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var s;return await ut(n,{},(a,l)=>{let u=Math.abs(Number(new Date(a.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return l&&!u&&Qt(a).then(c=>{s=c,r(c,l)}),u},(a,l,u)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),Qt(a).then(c=>{s=c,r(c,u)})},null),s}async function ze(e,t){let r=t||(e.isNew?null:await He(e));if(!r||r.isViewEmpty())return null;let{stylesheet:n}=e.library,{datasources:i}=e.sdk;return await Fr(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((s,a)=>Object.assign(s,{[a.id]:a.sample}),{}),n.css,e.sdk)}function Fr(e,t,r,n,i,o){let s=document.createElement("iframe");return s.style.position="absolute",s.style.top="-2000px",s.style.left="-2000px",s.style.width=t.props.minWidth+"px",s.style.height="720px",s.style.zIndex="100011",document.body.appendChild(s),new Promise((a,l)=>{let u=document.createElement("script");u.onerror=l,u.src=o.frontend+"/assets/html2canvas.js",u.onload=()=>{var h;(((h=s.contentWindow.document.fonts)===null||h===void 0?void 0:h.ready)||Promise.resolve()).then(function(){return s.contentWindow.html2canvas(d,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,d.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(g=>{let m=g.toDataURL("image/jpeg",.6);s.parentElement.removeChild(s);let w=new Image;w.onload=()=>{a(w)},w.onerror=l,w.src=m})})},s.contentWindow.document.head.appendChild(u);let c=s.contentWindow.document.createElement("style");c.textContent=`
68
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};ft.observedAttributes=["hidden","opacity"];ft.register("feaas-loader");function Be(e){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:s,library:a,revision:l}=Y(o);return{library:e==null?void 0:e.getContextAttribute("library"),revision:(r=(t=e==null?void 0:e.getAttribute("revision"))!==null&&t!==void 0?t:l)!==null&&r!==void 0?r:"published",cdn:(i=(n=e==null?void 0:e.getContextAttribute("cdn"))!==null&&n!==void 0?n:e==null?void 0:e.getContextAttribute("hostname"))!==null&&i!==void 0?i:M}}var Ot=class extends x{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Be(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return _t(this.props,this.onLoad)}};Ot.register("feaas-stylesheet");var kt={};rt(kt,{convertBase64toBlob:()=>We,generate:()=>ze,get:()=>Fr,getVersionForThumbnail:()=>He,load:()=>Ve,responseToImage:()=>Qt,upload:()=>Je});var We=e=>fetch(e).then(t=>t.blob()),Qt=e=>e.blob().then(t=>new Promise((r,n)=>{let i=new Image;i.onerror=n,i.onload=()=>{r(i)},i.src=URL.createObjectURL(t)}));async function He(e){return e.versions.length||await e.versions.fetch(),e.getVersionForWidth(800)}async function Fr(e,t,r){try{if(!e.isNew)return await Ve(e,t,r)}catch(i){e.sdk.log(`FEAAS: Thumbnail ${e.id}, version: ${(t==null?void 0:t.id)||"responsive"}, status: generating ${status}, reason: ${i}`)}let n=await ze(e,t);return r==null||r(n,!1),n&&!e.isNew&&We(n.src).then(i=>Je(e,t,i)),n}async function Ve(e,t,r){let n=t?t.getThumbnailURL():e.getThumbnailURL(),i=e.library.stylesheet,o=new Date(Math.max(Number(e.modifiedAt),Number(i.modifiedAt)));e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, loading`);var s;return await ut(n,{},(a,l)=>{let u=Math.abs(Number(new Date(a.headers.get("x-ms-meta-componentRenderedAt")))-Number(o))<2e3;return l&&!u&&Qt(a).then(c=>{s=c,r(c,l)}),u},(a,l,u)=>{e.sdk.log(`FEAAS: Thumbnail ${e.id}/${(t==null?void 0:t.id)||"responsive"}, status: ${l}`),Qt(a).then(c=>{s=c,r(c,u)})},null),s}async function ze(e,t){let r=t||(e.isNew?null:await He(e));if(!r||r.isViewEmpty())return null;let{stylesheet:n}=e.library,{datasources:i}=e.sdk;return await _r(r.classList,n.getBreakpointForWidth(800,r.getBreakpoints()),r.view,i.reduce((s,a)=>Object.assign(s,{[a.id]:a.sample}),{}),n.css,e.sdk)}function _r(e,t,r,n,i,o){let s=document.createElement("iframe");return s.style.position="absolute",s.style.top="-2000px",s.style.left="-2000px",s.style.width=t.props.minWidth+"px",s.style.height="720px",s.style.zIndex="100011",document.body.appendChild(s),new Promise((a,l)=>{let u=document.createElement("script");u.onerror=l,u.src=o.frontend+"/assets/html2canvas.js",u.onload=()=>{var h;(((h=s.contentWindow.document.fonts)===null||h===void 0?void 0:h.ready)||Promise.resolve()).then(function(){return s.contentWindow.html2canvas(d,{scale:Math.max(1.1,1e3/Math.min(1401,Math.max(320,t.props.minWidth))),width:Math.min(1401,Math.max(320,t.props.minWidth)),height:Math.max(1,Math.min(2e3,d.offsetHeight)),windowWidth:t.props.minWidth+"px",windowHeight:1e3,proxy:o.backend+"/proxy/media",backgroundColor:"#ffffff"}).then(g=>{let m=g.toDataURL("image/jpeg",.6);s.parentElement.removeChild(s);let w=new Image;w.onload=()=>{a(w)},w.onerror=l,w.src=m})})},s.contentWindow.document.head.appendChild(u);let c=s.contentWindow.document.createElement("style");c.textContent=`
69
69
  ${i}
70
70
  body, html { padding: 0; margin: 0; overflow: hidden }
71
71
  `;let p=s.contentWindow.document.createElement("style");p.textContent=`
72
72
  body, html { padding: 0; margin: 0; overflow: hidden }
73
- `,s.contentWindow.document.head.appendChild(c),s.contentWindow.document.head.appendChild(p);let d=Yt({template:r,data:n});d.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),s.contentWindow.document.body.appendChild(d)})}async function Je(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(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var te;typeof window!="undefined"&&(window.FEAASReactElement=K,(te=window.FEAASLoading)!==null&&te!==void 0||(window.FEAASLoading=Promise.resolve()));function qe(e){let t=[];if(e){let r=e.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let o=0;o<n.frames.length;o++)if(n.frames[o]===r){for(let s of n.document.getElementsByTagName("iframe"))if(s.contentWindow===r){i=s.getBoundingClientRect();let a=s.contentWindow.getComputedStyle(s);t.push({left:i.left+parseInt(a.borderLeftWidth),top:i.top+parseInt(a.borderTopWidth)})}r=n;break}}}return t.reduce((r,n)=>({left:r.left+n.left,top:r.top+n.top}),{left:0,top:0})}function Ke(e){var t;return{context:HTMLElement,frontend:e==null?void 0:e.getContextAttribute("frontend"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/editor.js",library:e==null?void 0:e.getAttribute("library"),component:e==null?void 0:e.getAttribute("component"),version:e==null?void 0:e.getAttribute("version"),instance:e==null?void 0:e.getAttribute("instance"),forked:e==null?void 0:e.getAttribute("forked"),revision:(e==null?void 0:e.getAttribute("revision"))||"saved",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,for:e==null?void 0:e.getAttribute("for"),state:(e==null?void 0:e.getAttribute("state"))||"idle",changed:(e==null?void 0:e.getAttribute("changed"))!=null}}var mt=class extends x{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=(t,r={component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),instance:t.getAttribute("instance")})=>{if(!this.closing&&(!this.target||t==null))return this.set(r),this.target=t,!0},this.onChromeMeasureElement=(t,r=t.getBoundingClientRect())=>t.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=t=>{t.memoized.focusable&&(this.framePoint=qe(t.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:t,root:r})=>{!this.chrome||this.props.hidden||(t?(this.chrome.wrapper.style.width=t.width+16*2+"px",this.chrome.wrapper.style.height=t.height+16*1+64+"px",this.chrome.wrapper.style.left=t.left-16+"px",this.chrome.wrapper.style.top=t.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=t=>{var r;switch((r=t.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let n=this.getPlaceholder();this.setTarget(n.editable,t.data)&&(this.loader=n.loader,document.body.appendChild(n.clipper),this.editedUID=t.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=t.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var t;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"),!((t=this.target)===null||t===void 0)&&t.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(t,r)=>{this.versionContext=t,this.setVersionContext=r},this.onEditorStateChange=(t,r)=>{this.editorContext=t,this.setEditorContext=r,t.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Ke(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),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ 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(t){this.iframe=t}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 t=this.iframe.clientWidth,r=this.iframe.clientHeight,n=this.iframe.getBoundingClientRect(),i=this.getPlaceholder(),o=document.body.getBoundingClientRect(),s=this.measurements[this.editedUID];s&&(Object.assign(i.clipper.style,{position:"absolute",top:n.top+this.iframe.clientTop-o.top+"px",left:n.left+this.iframe.clientLeft-o.left+"px",width:t+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(i.positionable.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(i.loader.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",height:s.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?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(t,r,n){r!==n&&(t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(t){return t.forkOriginId==null&&this.props.instance!=null}cleanup(){var t;this.placeholder&&((t=this.placeholder.clipper)===null||t===void 0||t.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(t){console.log("Editor is not ready")}setEditorContext(t){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:t,component:r,version:n,instance:i},{Editor:o,VersionStatusList:s,VersionStatusButton:a,Version:l,VersionMenu:u,EditorUIUndo:c,EditorUIMode:p,React:{useEffect:d,useMemo:h,useState:g,useContext:m},Chakra:{HStack:w,Box:C,Button:j,MenuItem:L},Chrome:$,ReactDOM:yt,useSDK:y,useLibrary:_,useSlots:O,useModelObserver:Lt,ConfirmationContext:Z,VersionContext:A}){if(!this.payload)return;let{React:b}=this.payload,le=y(),ce=_(),[S,ue]=g(),{setConfirm:$t}=m(Z),Q=i||n;S&&(this.component=S),d(()=>{if(this.props.hidden)return;let P=ce.components.getItem(r).clone();return P.versions.search({ids:[n,i].filter(Boolean),componentIds:[r]}).then(jt=>{P.versions.setItems(jt);let k=P.findVersion(i,["staged","published"]),et=P.findVersion(n,["staged","published"]);if(k)k.deletedAt?(k.getDraft().changeAndNotify(et.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",k.id));else if(this.removeAttribute("forked"),this.shouldFork(et)){console.error("FEAAS Editor: Forking");let It=et.fork(i).id;this.setAttribute("instance",It)}else console.error("FEAAS Editor: Regular");ue(P)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),ue(null)},400)}},[n,this.props.hidden]);let de=Lt(S==null?void 0:S.versions,[]).filter(P=>P.id==Q),tt=de[0];tt&&!this.props.hidden&&(this.version=tt),d(()=>(this.unfork=()=>{$t({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let P=S.findVersion(n,["staged","published"]);S.findVersion(i).unstage().unpublish().changeAndNotify(P.toProperties()),S.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(S.findVersion(Q).revert(),S.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{$t({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=()=>{$t({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:()=>{S.findVersion(Q).commitData({view:this.editorContext.editor.getData({rootName:Q}),model:""}).stage().publish(),this.removeAttribute("changed"),this.setAttribute("forked",Q),S.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[S]);let nr=h(()=>this.target,[S]);return h(()=>S&&O(t,({picker:P,children:jt})=>b.createElement(C,{ref:k=>{this.chrome=k?{positionable:k,wrapper:k.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},b.createElement(C,{className:"editor-wrapper",position:"absolute",left:0,top:0},b.createElement(o,{datasources:le.datasources,sdk:le,library:ce,component:S,versions:de,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:jt,chrome:({editor:k})=>k&&b.createElement($,null),children:({isArchivedDisplayed:k,editor:et,status:It})=>b.createElement(C,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},b.createElement(C,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),tt&&b.createElement(l,{version:tt,node:nr,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:b.createElement(w,{justifyContent:"space-between"},b.createElement(c,{size:"sm",editor:It=="ready"?et:null}),b.createElement(p,{size:"sm"})),middle:(Br,Wr)=>[!1],right:b.createElement(b.Fragment,null,b.createElement(j,{variant:"secondary",size:"sm",onClick:this.close},"Close"),b.createElement(j,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),b.createElement(u,{isDisabled:!this.props.forked&&!this.props.changed},b.createElement(L,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),b.createElement(L,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[tt,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};mt.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];mt.register("feaas-editor");function Ge(e){var t,r;return{part:(e==null?void 0:e.getAttribute("part"))||"picker",slot:(e==null?void 0:e.getAttribute("part"))||"picker",mode:e==null?void 0:e.getAttribute("mode"),dialog:e==null?void 0:e.getAttribute("dialog"),placeholder:(e==null?void 0:e.getAttribute("placeholder"))||"No theme",frontend:(t=e==null?void 0:e.getContextAttribute("frontend"))!==null&&t!==void 0?t:"https://components.sitecorecloud.io",src:(r=e==null?void 0:e.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,variant:e==null?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var vt=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ge(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:t,context:r,mode:n,dialog:i,children:o,variant:s},{Picker:a,React:l,useLibrary:u,useSDK:c}){let[p,d]=l.useReducer(y=>y+1,0),h=u("collections"),g=u("components"),m=c("datasources"),w=u("stylesheet.styles"),C=g.find(y=>y.id==(r==null?void 0:r.getAttribute("component"))),j=r==null?void 0:r.getAttribute("data-external-id"),L=c("externalComponents").find(y=>y.name==j);var $=r==null?void 0:r.getAttribute("data");if($)try{$=JSON.parse($)}catch(y){}let yt=n=="datasources"?m.find(y=>y.id==i):null;return l.createElement(a,{rules:w,collections:h,themeContext:r,placeholder:t,component:C,externalComponent:L,datasource:yt,data:$,versionId:r==null?void 0:r.getAttribute("version"),mode:n||(C?"component":j?"external":null),setAttribute:(y,_,O)=>{_=="data"&&O&&(O=JSON.stringify(O)),this.props.setAttribute(y,_,O),d()},getAttribute:(y,_)=>r==null?void 0:r.getAttribute(_),dialog:i,context:r,variant:s,onModeChange:(y,_)=>{this.set({mode:y,dialog:_})}},o)}};vt.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];vt.register("feaas-picker");function Ye(e){var t,r,n,i,o;return{library:e==null?void 0:e.getAttribute("library"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/context.js",environment:(r=e==null?void 0:e.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(n=e==null?void 0:e.getAttribute("frontend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io",backend:(i=e==null?void 0:e.getAttribute("backend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io/api",cdn:(o=e==null?void 0:e.getAttribute("cdn"))!==null&&o!==void 0?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(e==null?void 0:e.getAttribute("isolate"))==null||(e==null?void 0:e.getAttribute("isolate"))=="true"}}var q=class extends x{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(t,r)=>{t=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=F(t=>{this.sdk=t})}getProps(){return Ye(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(t){return t}getRoot(){return this.getAttribute("isolate")==="false"?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(t=>{this.getRoot().appendChild(t)}),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:t,library:r},{AppContext:n,Chakra:{Button:i,Tooltip:o},React:s}){let a={containerRef:{current:this.getPortalRoot()}};return o.defaultProps={hasArrow:!0,placement:"top",portalProps:a},s.createElement(n,{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}}},t)}};q.observedAttributes=["library","component","version","revision","hostname","template"];q.register("feaas-context");q.prototype.clientside=ee;import E from"react";import Xe from"react";import Nr from"react-dom";function re(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return e.replace(t,function(r){return"-"+r.toLowerCase()})}function gt(e){let t=/-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;return e.replace(t,function(r){return r.slice(1).toUpperCase()})}var Or=e=>Object.keys(e).reduce((t,r)=>{if(e[r].title)t[r]=e[r];else{let n=r.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");t[r]={...e[r],title:n}}return t},{}),Pt=(e={})=>Object.keys(e).reduce((t,r)=>(t[re(r)]=e[r],t),{}),kr=e=>{if(!e)return;if(!e.properties)return e;let t,r;return t=Pt(e.properties),r=(e.required||[]).map(i=>re(i)),t=Or(t),{...e,properties:t,required:r,title:void 0}},Pr=(e,t)=>{if(!e||!t)return;let r;return r=Pt(e),Object.keys(t).filter(i=>/(integer|number)/.test(t[i].type)).forEach(i=>{r[i]?r[i]["ui:widget"]||(r[i]["ui:widget"]="updown"):r[i]={"ui:widget":"updown"}}),r},Tr=(e,t,r)=>{var n;switch((n=r==null?void 0:r[e])===null||n===void 0?void 0:n.type){case"string":return t;case"object":try{return typeof t=="object"&&t!=null?t:JSON.parse(t)}catch(i){return null}case"array":try{return Array.isArray(t)?t:JSON.parse(t)}catch(i){return null}case"number":return parseFloat(t);case"integer":return parseInt(t);case"boolean":return t=="true"||t=="1";default:return t}};function Mr(e){let t=Array.from(e.attributes).reduce((r,{name:n,value:i})=>Object.assign(r,{[n]:i}),{});return Tt(t["data-external-id"],t)}function Tt(e,t){var r;let n=(r=v.registered[e])===null||r===void 0?void 0:r.schema;return Object.keys(t).reduce((i,o)=>{let s=t[o];return!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...i,[gt(o)]:Tr(gt(o),s,n==null?void 0:n.properties)}:i},{})}var v=class extends x{load(){return Promise.resolve({React:Xe,ReactDOM:Nr})}update(){var t;let{dataExternalId:r}=this.props;if(!(!(!((t=v.registered[r])===null||t===void 0)&&t.component)&&this.getAttribute("hydrate")=="false"))return super.update()}render(t,{React:r}){var n;let{dataExternalId:i}=t,o=(n=v.registered[i])===null||n===void 0?void 0:n.component;return o||console.warn(`FEAASExternal: \`${i}\` is not registered`),r.createElement(r.Fragment,null,o&&r.createElement(o,{...t}))}getProps(){return Mr(this)}static registerComponent(t,r){if(!r.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(r));let n=r.name,{thumbnail:i,group:o,ui:s,...a}=r,l={...a,type:"object"};v.registered[n]={component:t,name:n,schema:l,uiSchema:s,thumbnail:i,group:o,title:(l==null?void 0:l.title)||n},v.setRegistrationCallback()}static setRegistrationCallback(){clearTimeout(v.registrationCallback),v.registrationCallback=setTimeout(()=>{var t;if(typeof window!="undefined"){let r=Object.keys(v.registered).map(n=>{var i;return{...v.registered[n],name:n,schema:kr(v.registered[n].schema),uiSchema:Pr(v.registered[n].uiSchema,(i=v.registered[n].schema)===null||i===void 0?void 0:i.properties)}});(t=window.parent)===null||t===void 0||t.postMessage(JSON.stringify({action:"register-components",data:r}),"*")}},30)}static Preview(t){var r;let n=(t==null?void 0:t.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return n?Xe.createElement(Ze,{src:n,...t}):null}static linkComponents(t){return()=>t.map(r=>null)}static getComponent(t){return v.registered[t]}};v.registered={};var ne=class extends bt{connectedCallback(){try{JSON.parse(this.getAttribute("components")).forEach(t=>{v.registerComponent(null,t)})}catch(t){}}static register(t){return x.register.call(this,t)}};typeof window!="undefined"&&window&&Object.defineProperty(window,"FEAASExternalComponents",{get:()=>v.registered});v.register("feaas-external");v.setRegistrationCallback();ne.register("feaas-registration");var{getComponent:Mt,linkComponents:Lr,registerComponent:$r}=v;var jr=e=>("src"in e&&(e=Y(e.src)),E.createElement("link",{rel:"stylesheet",href:qt(e)})),Ir=async({...e})=>{let t=await R.fetch((e==null?void 0:e.data)||{}),r={...e};if(("src"in e||"component"in e)&&(e==null?void 0:e.template)==null){let n=await Kt(e);r.template=n.template,r.lastModified=n.lastModified}return Qe({...r,data:t})};function Qe({data:e,...t}){let r=null,n;return"template"in t&&t.template&&(n=Jt(t.template,e||{}).map((i,o)=>tr(i,(s,a)=>{if(s.localName=="feaas-external"){let u={};for(var l in a){let c=l=="data-external-id"?"componentName":gt(l);u[c]=a[l]}return[rr,u]}},o))),"src"in t&&(t={...z(t.src),...t}),E.createElement(E.Fragment,null,"preload"in t&&r===!0&&"src"in t&&E.createElement(E.Fragment,null,E.createElement("link",{rel:"preload",as:"fetch",href:ht(t.src),crossOrigin:"anonymous"}),E.createElement("link",{rel:"preload",as:"style",href:J(t.src),crossOrigin:"anonymous"})),E.createElement("feaas-component",{...t,suppressHydrationWarning:!0,template:null,data:typeof e=="string"?e:e?JSON.stringify(e):null,hydrate:"false"},n))}function oe(e){var t;let{componentName:r,fallback:n,...i}=e,o=(t=Mt(r))===null||t===void 0?void 0:t.component;if(!o&&n||!r)return E.createElement("feaas-external",{"data-external-id":r,suppressHydrationWarning:!0,hydrate:"false"},n);let s=Tt(r,i);return delete s.suppressHydrationWarning,E.createElement(E.Fragment,null,E.createElement("feaas-external",{...Pt(s),"data-external-id":r,suppressHydrationWarning:!0,hydrate:"false"},o==null?null:E.createElement(o,{...s})))}function tr(e,t,r){if(e.nodeType===3)return e.textContent;let n=Array.from(e.childNodes).map((l,u)=>tr(l,t,u)),i={};for(let l=0;l<e.attributes.length;l++){let{name:u,value:c}=e.attributes[l];u=="style"?i[u]=String(c||"").trim().split(/\s*;\s*/).reduce((p,d)=>{let[h,g]=d.split(":");return{...p,[h]:g}},{}):u=="class"?i.className=c:i[u]=c}let o=t==null?void 0:t(e,i),s=(o==null?void 0:o[0])||e.nodeName.toLowerCase(),a=Object.assign({key:r,suppressHydrationWarning:!0},(o==null?void 0:o[1])||i);return E.createElement(s,a,["img","br","input"].includes(s)?null:n)}var ie=new Map,se=null,ae=null;function er(e){var t;let{componentName:r,...n}=e,i=(t=Mt(r))===null||t===void 0?void 0:t.component;if(!ie.get(r)){let s=ae(()=>Promise.resolve(se),{ssr:!1,loading:()=>E.createElement(oe,{...n,componentName:r})});ie.set(r,s)}let o=ie.get(r);return E.createElement(o,{...e,fallback:i?E.createElement(i,{...e}):null})}function Ci(e,t){return ae=e,se=t,t}function rr(e){if(Object.keys(e).length!=0)return ae?er(e):oe(e)}function Ur(){return E.createElement(E.Fragment,null,E.createElement("feaas-registration",{components:JSON.stringify(Object.values(v.registered)),suppressHydrationWarning:!0}),E.createElement(se,null))}var Si=Ur,Ri=rr,Di=oe,_i=er,Ze=Qe,Fi=Ir,Ni=jr;export{Ze as Component,Ie as ComponentProps,q as Context,F as ControlledPromise,M as DEFAULT_CDN_URL,St as DOM,Ct as DataPath,Et as DataScope,R as DataSettings,x as Element,v as External,Ri as ExternalComponent,Si as ExternalComponentBundle,pt as FEAASComponent,Ie as FEAASComponentsProps,q as FEAASContext,Ye as FEAASContextProps,mt as FEAASEditor,Ke as FEAASEditorProps,x as FEAASElement,rr as FEAASExternalComponent,Tt as FEAASExternalPropsObject,ft as FEAASLoader,Ue as FEAASLoaderProps,er as FEAASNextExternalComponent,vt as FEAASPicker,Ge as FEAASPickerProps,Qe as FEAASReactComponent,oe as FEAASReactExternalComponent,Ur as FEAASReactExternalComponentBundle,Ir as FEAASReactServerComponent,jr as FEAASReactStylesheet,Ot as FEAASStylesheet,Be as FEAASStylesheetProps,tr as HTMLNodeToReact,Rt as InvalidResponse,f as JSONPath,ft as Loader,At as MyComponent,_i as NextExternalComponent,vt as Picker,Di as ReactExternalComponent,Fi as ServerComponent,Ni as Stylesheet,kt as Thumbnail,bt as WebComponent,xe as adjustNumbers,be as autoloadScripts,lt as cleanCollectionBit,xr as clearFetchCache,Le as createStylesheet,Ci as enableNextClientsideComponents,ut as fetchAndRevalidate,X as fetchAndRevalidateComponent,_t as fetchAndRevalidateStylesheet,Dt as fetchBypassingCache,ct as fetchCache,Kt as fetchComponent,Zt as fetchData,dt as fetchToValidateCache,V as fetchWithCacheAwareness,Me as findStylesheet,Mt as getComponent,Cr as getComponentSource,ht as getComponentURL,Pe as getFetchCache,qe as getFramePosition,Ce as getHumanizedLabel,Se as getLastPathBit,we as getQualifier,qt as getStylesheetSource,J as getStylesheetURL,Lr as linkComponents,at as loadScript,Ft as loadStylesheet,Gt as loadStylesheetAllowStale,xt as normalizeCollectionScope,ye as observeDOMElement,z as parseComponentSource,Ae as parseLimit,Ee as parseRange,Y as parseStylesheetSource,G as queryObject,Vt as queryObjectRaw,st as queryScopes,$r as registerComponent,Yt as renderComponent,Rr as renderComponentElement,$e as renderComponentPromise,H as renderDOMContent,N as renderDOMElement,Ar as renderHTMLContent,Sr as renderStylesheet,Te as renderStylesheetPromise,U as serializeCH1RichText,W as setDOMAttribute};
73
+ `,s.contentWindow.document.head.appendChild(c),s.contentWindow.document.head.appendChild(p);let d=Yt({template:r,data:n});d.classList.add(...e,"-feaas--preview","-emulate--"+t.details.slug),s.contentWindow.document.body.appendChild(d)})}async function Je(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(o){e.sdk.log("FEAAS: Thumbnail failed to upload",n,o)}return n}var te;typeof window!="undefined"&&(window.FEAASReactElement=K,(te=window.FEAASLoading)!==null&&te!==void 0||(window.FEAASLoading=Promise.resolve()));function qe(e){let t=[];if(e){let r=e.ownerDocument.defaultView,n,i;for(;r!==window.top;){n=r.parent;for(let o=0;o<n.frames.length;o++)if(n.frames[o]===r){for(let s of n.document.getElementsByTagName("iframe"))if(s.contentWindow===r){i=s.getBoundingClientRect();let a=s.contentWindow.getComputedStyle(s);t.push({left:i.left+parseInt(a.borderLeftWidth),top:i.top+parseInt(a.borderTopWidth)})}r=n;break}}}return t.reduce((r,n)=>({left:r.left+n.left,top:r.top+n.top}),{left:0,top:0})}function Ke(e){var t;return{context:HTMLElement,frontend:e==null?void 0:e.getContextAttribute("frontend"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/editor.js",library:e==null?void 0:e.getAttribute("library"),component:e==null?void 0:e.getAttribute("component"),version:e==null?void 0:e.getAttribute("version"),instance:e==null?void 0:e.getAttribute("instance"),forked:e==null?void 0:e.getAttribute("forked"),revision:(e==null?void 0:e.getAttribute("revision"))||"saved",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,for:e==null?void 0:e.getAttribute("for"),state:(e==null?void 0:e.getAttribute("state"))||"idle",changed:(e==null?void 0:e.getAttribute("changed"))!=null}}var mt=class extends x{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=(t,r={component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),instance:t.getAttribute("instance")})=>{if(!this.closing&&(!this.target||t==null))return this.set(r),this.target=t,!0},this.onChromeMeasureElement=(t,r=t.getBoundingClientRect())=>t.ownerDocument==document?{left:r.left-this.bodyRect.left,top:r.top-this.bodyRect.top,width:r.width,height:r.height}:{left:r.left+this.framePoint.left-this.bodyRect.left,top:r.top+this.framePoint.top-this.bodyRect.top,width:r.width,height:r.height},this.onBeforeMeasure=t=>{t.memoized.focusable&&(this.framePoint=qe(t.memoized.focusable)),this.chrome&&(this.wrapperRect=this.chrome.positionable.getBoundingClientRect(),this.bodyRect=this.chrome.positionable.ownerDocument.body.parentElement.getBoundingClientRect())},this.onMeasure=()=>{},this.onPosition=({focusable:t,root:r})=>{!this.chrome||this.props.hidden||(t?(this.chrome.wrapper.style.width=t.width+16*2+"px",this.chrome.wrapper.style.height=t.height+16*1+64+"px",this.chrome.wrapper.style.left=t.left-16+"px",this.chrome.wrapper.style.top=t.top-64+"px",this.chrome.wrapper.style.opacity="1",this.chrome.absolute=this.querySelector(".ui.overlays"),this.chrome.absolute&&(this.chrome.absolute.style.left=r.left+"px",this.chrome.absolute.style.top=r.top+"px")):(this.chrome.wrapper.style.opacity="0",this.chrome.wrapper.style.left="-1000px",this.chrome.wrapper.style.top="-1000px"))},this.onWindowMessage=t=>{var r;switch((r=t.data)===null||r===void 0?void 0:r.type){case"feaasEdit":let n=this.getPlaceholder();this.setTarget(n.editable,t.data)&&(this.loader=n.loader,document.body.appendChild(n.clipper),this.editedUID=t.data.id,this.setPlaceholder(),this.open());break;case"feaasMeasurements":this.measurements=t.data.measurements,this.props.hidden||this.setPlaceholder();break}},this.onContentChange=()=>{this.setAttribute("changed","changed"),requestAnimationFrame(()=>{this.setIframeComponentContent()})},this.onClose=()=>{var t;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"),!((t=this.target)===null||t===void 0)&&t.parentNode&&(this.target.outerHTML=this.target.outerHTML),this.setTarget(null,{component:null,version:null,instance:null,revision:null}),this.setEditorContext({isFocused:!1})},this.onVersionStateChange=(t,r)=>{this.versionContext=t,this.setVersionContext=r},this.onEditorStateChange=(t,r)=>{this.editorContext=t,this.setEditorContext=r,t.editor&&this.props.state=="loading"&&!this.props.hidden&&(this.setAttribute("state","ready"),this.ownerDocument.fonts.ready.then(()=>setTimeout(()=>{this.setReadyState(),this.setIframeComponentContent()},100)))}}getProps(){return Ke(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),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative"))}hideLoader(){this.loader&&(this.loader.setAttribute("hidden","hidden"),this.target.tagName=="FEAAS-COMPONENT"&&(this.target.style.position="relative",this.target.style.position=""))}load(){return import( /*@vite-ignore*/ /* webpackIgnore: true */ 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(t){this.iframe=t}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 t=this.iframe.clientWidth,r=this.iframe.clientHeight,n=this.iframe.getBoundingClientRect(),i=this.getPlaceholder(),o=document.body.getBoundingClientRect(),s=this.measurements[this.editedUID];s&&(Object.assign(i.clipper.style,{position:"absolute",top:n.top+this.iframe.clientTop-o.top+"px",left:n.left+this.iframe.clientLeft-o.left+"px",width:t+"px",height:r+"px",pointerEvents:"none",zIndex:1,overflow:"hidden"}),Object.assign(i.positionable.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",zIndex:2,transition:"opacity 0.4s",pointerEvents:this.props.hidden?"none":"all"}),Object.assign(i.loader.style,{position:"absolute",top:s.top+"px",left:s.left+"px",width:s.width+"px",height:s.height+"px",filter:"opacity(0.6)",zIndex:3,pointerEvents:"none"}),document.dispatchEvent(new Event("feaasRefresh",{bubbles:!0})))}getPlaceholder(){return this.placeholder?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(t,r,n){r!==n&&(t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n))}open(){clearTimeout(this.closing),this.removeAttribute("hidden"),this.removeAttribute("changed"),this.setLoadingState()}shouldFork(t){return t.forkOriginId==null&&this.props.instance!=null}cleanup(){var t;this.placeholder&&((t=this.placeholder.clipper)===null||t===void 0||t.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(t){console.log("Editor is not ready")}setEditorContext(t){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:t,component:r,version:n,instance:i},{Editor:o,VersionStatusList:s,VersionStatusButton:a,Version:l,VersionMenu:u,EditorUIUndo:c,EditorUIMode:p,React:{useEffect:d,useMemo:h,useState:g,useContext:m},Chakra:{HStack:w,Box:C,Button:j,MenuItem:L},Chrome:$,ReactDOM:yt,useSDK:y,useLibrary:F,useSlots:O,useModelObserver:Lt,ConfirmationContext:Z,VersionContext:A}){if(!this.payload)return;let{React:b}=this.payload,le=y(),ce=F(),[S,ue]=g(),{setConfirm:$t}=m(Z),Q=i||n;S&&(this.component=S),d(()=>{if(this.props.hidden)return;let P=ce.components.getItem(r).clone();return P.versions.search({ids:[n,i].filter(Boolean),componentIds:[r]}).then(jt=>{P.versions.setItems(jt);let k=P.findVersion(i,["staged","published"]),et=P.findVersion(n,["staged","published"]);if(k)k.deletedAt?(k.getDraft().changeAndNotify(et.toProperties()).restore(),console.error("FEAAS Editor: Restoring fork")):(console.error("FEAAS Editor: Pre-forked"),this.setAttribute("forked",k.id));else if(this.removeAttribute("forked"),this.shouldFork(et)){console.error("FEAAS Editor: Forking");let It=et.fork(i).id;this.setAttribute("instance",It)}else console.error("FEAAS Editor: Regular");ue(P)}),()=>{this.closing=setTimeout(()=>{this.closing=null,this.cleanup(),ue(null)},400)}},[n,this.props.hidden]);let de=Lt(S==null?void 0:S.versions,[]).filter(P=>P.id==Q),tt=de[0];tt&&!this.props.hidden&&(this.version=tt),d(()=>(this.unfork=()=>{$t({title:"Reverting component customizations",button:"Discard",body:"Are you sure to reset component to its original state? All changes will be lost.",action:()=>{let P=S.findVersion(n,["staged","published"]);S.findVersion(i).unstage().unpublish().changeAndNotify(P.toProperties()),S.saveVersions(!1),this.setVersionContext({needsWrite:!0}),this.removeAttribute("forked"),requestAnimationFrame(this.onClose)}})},this.discard=()=>{this.props.changed&&(S.findVersion(Q).revert(),S.saveVersions(!1),this.setVersionContext({needsWrite:!0}))},this.close=()=>{$t({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=()=>{$t({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:()=>{S.findVersion(Q).commitData({view:this.editorContext.editor.getData({rootName:Q}),model:""}).stage().publish(),this.removeAttribute("changed"),this.setAttribute("forked",Q),S.saveVersions(!1)}})},()=>{delete this.unfork,delete this.discard,delete this.save,delete this.editorContext,delete this.versionContext,delete this.setEditorContext,delete this.setVersionContext}),[S]);let nr=h(()=>this.target,[S]);return h(()=>S&&O(t,({picker:P,children:jt})=>b.createElement(C,{ref:k=>{this.chrome=k?{positionable:k,wrapper:k.querySelector(".editor-chrome"),absolute:this.querySelector(".ui.overlays")}:null}},b.createElement(C,{className:"editor-wrapper",position:"absolute",left:0,top:0},b.createElement(o,{datasources:le.datasources,sdk:le,library:ce,component:S,versions:de,context:{isAutosaveEnabled:!1,onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition,onContentChange:this.onContentChange}},{exports:this.onEditorStateChange,after:jt,chrome:({editor:k})=>k&&b.createElement($,null),children:({isArchivedDisplayed:k,editor:et,status:It})=>b.createElement(C,{position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none",opacity:0,transition:"opacity 0.3s"},b.createElement(C,{left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),b.createElement(C,{bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),tt&&b.createElement(l,{version:tt,node:nr,ignoreBreakpoints:!0,deps:[this.props.forked,this.props.changed]},{exports:this.onVersionStateChange,left:b.createElement(w,{justifyContent:"space-between"},b.createElement(c,{size:"sm",editor:It=="ready"?et:null}),b.createElement(p,{size:"sm"})),middle:(Br,Wr)=>[!1],right:b.createElement(b.Fragment,null,b.createElement(j,{variant:"secondary",size:"sm",onClick:this.close},"Close"),b.createElement(j,{variant:"primary",size:"sm",onClick:this.save,isDisabled:!this.props.changed},this.props.changed?this.props.forked?"Save":"Save customization":"Up to date"),b.createElement(u,{isDisabled:!this.props.forked&&!this.props.changed},b.createElement(L,{onClick:this.unfork,isDisabled:!this.props.forked},"Unfork"),b.createElement(L,{onClick:this.discard,isDisabled:!this.props.changed},"Discard")))}))})))),[tt,this.props.forked,this.props.changed])}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null&&!this.props.hidden}};mt.observedAttributes=["library","component","version","revision","hidden","state","changed","forked"];mt.register("feaas-editor");function Ge(e){var t,r;return{part:(e==null?void 0:e.getAttribute("part"))||"picker",slot:(e==null?void 0:e.getAttribute("part"))||"picker",mode:e==null?void 0:e.getAttribute("mode"),dialog:e==null?void 0:e.getAttribute("dialog"),placeholder:(e==null?void 0:e.getAttribute("placeholder"))||"No theme",frontend:(t=e==null?void 0:e.getContextAttribute("frontend"))!==null&&t!==void 0?t:"https://components.sitecorecloud.io",src:(r=e==null?void 0:e.getAttribute("src"))!==null&&r!==void 0?r:"/picker.js",hidden:(e==null?void 0:e.getAttribute("hidden"))!=null,variant:e==null?void 0:e.getAttribute("variant"),context:void 0,onClose:void 0,setAttribute:void 0,getAttribute:void 0}}var vt=class extends x{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ge(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}connectedCallback(){this.setAttribute("feaas-role","ui"),super.connectedCallback()}render({placeholder:t,context:r,mode:n,dialog:i,children:o,variant:s},{Picker:a,React:l,useLibrary:u,useSDK:c}){let[p,d]=l.useReducer(y=>y+1,0),h=u("collections"),g=u("components"),m=c("datasources"),w=u("stylesheet.styles"),C=g.find(y=>y.id==(r==null?void 0:r.getAttribute("component"))),j=r==null?void 0:r.getAttribute("data-external-id"),L=c("externalComponents").find(y=>y.name==j);var $=r==null?void 0:r.getAttribute("data");if($)try{$=JSON.parse($)}catch(y){}let yt=n=="datasources"?m.find(y=>y.id==i):null;return l.createElement(a,{rules:w,collections:h,themeContext:r,placeholder:t,component:C,externalComponent:L,datasource:yt,data:$,versionId:r==null?void 0:r.getAttribute("version"),mode:n||(C?"component":j?"external":null),setAttribute:(y,F,O)=>{F=="data"&&O&&(O=JSON.stringify(O)),this.props.setAttribute(y,F,O),d()},getAttribute:(y,F)=>r==null?void 0:r.getAttribute(F),dialog:i,context:r,variant:s,onModeChange:(y,F)=>{this.set({mode:y,dialog:F})}},o)}};vt.observedAttributes=["library","mode","frontend","src","hidden","variant","dialog"];vt.register("feaas-picker");function Ye(e){var t,r,n,i,o;return{library:e==null?void 0:e.getAttribute("library"),src:(t=e==null?void 0:e.getAttribute("src"))!==null&&t!==void 0?t:"/context.js",environment:(r=e==null?void 0:e.getAttribute("environment"))!==null&&r!==void 0?r:void 0,frontend:(n=e==null?void 0:e.getAttribute("frontend"))!==null&&n!==void 0?n:"https://components.sitecorecloud.io",backend:(i=e==null?void 0:e.getAttribute("backend"))!==null&&i!==void 0?i:"https://components.sitecorecloud.io/api",cdn:(o=e==null?void 0:e.getAttribute("cdn"))!==null&&o!==void 0?o:"https://feaas.blob.core.windows.net",auth:null,isolate:(e==null?void 0:e.getAttribute("isolate"))==null||(e==null?void 0:e.getAttribute("isolate"))=="true"}}var q=class extends x{constructor(){super(...arguments),this.defaultProps={isolate:!0},this.onStatusChange=(t,r)=>{t=="ready"&&(this.whenSDKReady.resolve(r),this.dispatchEvent(new CustomEvent("feaasReady",{bubbles:!0,composed:!0,detail:r})))},this.whenSDKReady=_(t=>{this.sdk=t})}getProps(){return Ye(this)}load(){return this.import( /*@vite-ignore*/ /* webpackIgnore: true */ this.formatURL(this.props.src,this.props.frontend))}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null}getTheme(t){return t}getRoot(){return this.getAttribute("isolate")==="false"?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(t=>{this.getRoot().appendChild(t)}),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:t,library:r},{AppContext:n,Chakra:{Button:i,Tooltip:o},React:s}){let a={containerRef:{current:this.getPortalRoot()}};return o.defaultProps={hasArrow:!0,placement:"top",portalProps:a},s.createElement(n,{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}}},t)}};q.observedAttributes=["library","component","version","revision","hostname","template"];q.register("feaas-context");q.prototype.clientside=ee;import E from"react";import Xe from"react";import Nr from"react-dom";function re(e){let t=/[A-Z\u00C0-\u00D6\u00D8-\u00DE]/g;return e.replace(t,function(r){return"-"+r.toLowerCase()})}function gt(e){let t=/-[a-z\u00E0-\u00F6\u00F8-\u00FE]/g;return e.replace(t,function(r){return r.slice(1).toUpperCase()})}var Or=e=>Object.keys(e).reduce((t,r)=>{if(e[r].title)t[r]=e[r];else{let n=r.split("-").map(i=>i.charAt(0).toUpperCase()+i.slice(1).toLowerCase()).join(" ");t[r]={...e[r],title:n}}return t},{}),Pt=(e={})=>Object.keys(e).reduce((t,r)=>(t[re(r)]=e[r],t),{}),kr=e=>{if(!e)return;if(!e.properties)return e;let t,r;return t=Pt(e.properties),r=(e.required||[]).map(i=>re(i)),t=Or(t),{...e,properties:t,required:r,title:void 0}},Pr=(e,t)=>{if(!e||!t)return;let r;return r=Pt(e),Object.keys(t).filter(i=>/(integer|number)/.test(t[i].type)).forEach(i=>{r[i]?r[i]["ui:widget"]||(r[i]["ui:widget"]="updown"):r[i]={"ui:widget":"updown"}}),r},Tr=(e,t,r)=>{var n;switch((n=r==null?void 0:r[e])===null||n===void 0?void 0:n.type){case"string":return t;case"object":try{return typeof t=="object"&&t!=null?t:JSON.parse(t)}catch(i){return null}case"array":try{return Array.isArray(t)?t:JSON.parse(t)}catch(i){return null}case"number":return parseFloat(t);case"integer":return parseInt(t);case"boolean":return t=="true"||t=="1";default:return t}};function Mr(e){let t=Array.from(e.attributes).reduce((r,{name:n,value:i})=>Object.assign(r,{[n]:i}),{});return Tt(t["data-external-id"],t)}function Tt(e,t){var r;let n=(r=v.registered[e])===null||r===void 0?void 0:r.schema;return Object.keys(t).reduce((i,o)=>{let s=t[o];return!o.startsWith("data-attribute")&&!["class","id","contenteditable"].includes(o)?{...i,[gt(o)]:Tr(gt(o),s,n==null?void 0:n.properties)}:i},{})}var v=class extends x{load(){return Promise.resolve({React:Xe,ReactDOM:Nr})}update(){var t;let{dataExternalId:r}=this.props;if(!(!(!((t=v.registered[r])===null||t===void 0)&&t.component)&&this.getAttribute("hydrate")=="false"))return super.update()}render(t,{React:r}){var n;let{dataExternalId:i}=t,o=(n=v.registered[i])===null||n===void 0?void 0:n.component;return o||console.warn(`FEAASExternal: \`${i}\` is not registered`),r.createElement(r.Fragment,null,o&&r.createElement(o,{...t}))}getProps(){return Mr(this)}static registerComponent(t,r){if(!r.name)throw new Error("Could not register external component. Please make sure you provide a name in the options"+JSON.stringify(r));let n=r.name,{thumbnail:i,group:o,ui:s,...a}=r,l={...a,type:"object"};v.registered[n]={component:t,name:n,schema:l,uiSchema:s,thumbnail:i,group:o,title:(l==null?void 0:l.title)||n},v.setRegistrationCallback()}static setRegistrationCallback(){clearTimeout(v.registrationCallback),v.registrationCallback=setTimeout(()=>{var t;if(typeof window!="undefined"){let r=Object.keys(v.registered).map(n=>{var i;return{...v.registered[n],name:n,schema:kr(v.registered[n].schema),uiSchema:Pr(v.registered[n].uiSchema,(i=v.registered[n].schema)===null||i===void 0?void 0:i.properties)}});(t=window.parent)===null||t===void 0||t.postMessage(JSON.stringify({action:"register-components",data:r}),"*")}},30)}static Preview(t){var r;let n=(t==null?void 0:t.src)||(typeof window!="undefined"?(r=window.location.search.match(/feaasSrc=([^&]+)/))===null||r===void 0?void 0:r[1]:null);return n?Xe.createElement(Ze,{src:n,...t}):null}static linkComponents(t){return()=>t.map(r=>null)}static getComponent(t){return v.registered[t]}};v.registered={};var ne=class extends bt{connectedCallback(){try{JSON.parse(this.getAttribute("components")).forEach(t=>{v.registerComponent(null,t)})}catch(t){}}static register(t){return x.register.call(this,t)}};typeof window!="undefined"&&window&&("FEAASExternalComponents"in window?location.hostname.startsWith("xmc-")||console.error("FEAAS Clientside is loaded twice into the bundle. This can lead to unexpected problems and needs to be resolved"):Object.defineProperty(window,"FEAASExternalComponents",{get:()=>v.registered}));v.register("feaas-external");v.setRegistrationCallback();ne.register("feaas-registration");var{getComponent:Mt,linkComponents:Lr,registerComponent:$r}=v;var jr=e=>("src"in e&&(e=Y(e.src)),E.createElement("link",{rel:"stylesheet",href:qt(e)})),Ir=async({...e})=>{let t=await R.fetch((e==null?void 0:e.data)||{}),r={...e};if(("src"in e||"component"in e)&&(e==null?void 0:e.template)==null){let n=await Kt(e);r.template=n.template,r.lastModified=n.lastModified,r.hydrate=!1}return Qe({...r,data:t})};function Qe({data:e,...t}){let r=null,n;return"template"in t&&t.template&&(n=Jt(t.template,e||{}).map((i,o)=>tr(i,(s,a)=>{if(s.localName=="feaas-external"){let u={};for(var l in a){let c=l=="data-external-id"?"componentName":gt(l);u[c]=a[l]}return[rr,u]}},o))),"src"in t&&(t={...z(t.src),...t}),E.createElement(E.Fragment,null,"preload"in t&&r===!0&&"src"in t&&E.createElement(E.Fragment,null,E.createElement("link",{rel:"preload",as:"fetch",href:ht(t.src),crossOrigin:"anonymous"}),E.createElement("link",{rel:"preload",as:"style",href:J(t.src),crossOrigin:"anonymous"})),E.createElement("feaas-component",{...t,suppressHydrationWarning:!0,template:null,data:typeof e=="string"?e:e?JSON.stringify(e):null,hydrate:"false"},n))}function oe(e){var t;let{componentName:r,fallback:n,...i}=e,o=(t=Mt(r))===null||t===void 0?void 0:t.component;if(!o&&n||!r)return E.createElement("feaas-external",{"data-external-id":r,suppressHydrationWarning:!0,hydrate:"false"},n);let s=Tt(r,i);return delete s.suppressHydrationWarning,E.createElement(E.Fragment,null,E.createElement("feaas-external",{...Pt(s),"data-external-id":r,suppressHydrationWarning:!0,hydrate:"false"},o==null?null:E.createElement(o,{...s})))}function tr(e,t,r){if(e.nodeType===3)return e.textContent;let n=Array.from(e.childNodes).map((l,u)=>tr(l,t,u)),i={};for(let l=0;l<e.attributes.length;l++){let{name:u,value:c}=e.attributes[l];u=="style"?i[u]=String(c||"").trim().split(/\s*;\s*/).reduce((p,d)=>{let[h,g]=d.split(":");return{...p,[h]:g}},{}):u=="class"?i.className=c:i[u]=c}let o=t==null?void 0:t(e,i),s=(o==null?void 0:o[0])||e.nodeName.toLowerCase(),a=Object.assign({key:r,suppressHydrationWarning:!0},(o==null?void 0:o[1])||i);return E.createElement(s,a,["img","br","input"].includes(s)?null:n)}var ie=new Map,se=null,ae=null;function er(e){var t;let{componentName:r,...n}=e,i=(t=Mt(r))===null||t===void 0?void 0:t.component;if(!ie.get(r)){let s=ae(()=>Promise.resolve(se),{ssr:!1,loading:()=>E.createElement(oe,{...n,componentName:r})});ie.set(r,s)}let o=ie.get(r);return E.createElement(o,{...e,fallback:i?E.createElement(i,{...e}):null})}function Ci(e,t){return ae=e,se=t,t}function rr(e){if(Object.keys(e).length!=0)return ae?er(e):oe(e)}function Ur(){return E.createElement(E.Fragment,null,E.createElement("feaas-registration",{components:JSON.stringify(Object.values(v.registered)),suppressHydrationWarning:!0}),E.createElement(se,null))}var Si=Ur,Ri=rr,Di=oe,Fi=er,Ze=Qe,_i=Ir,Ni=jr;export{Ze as Component,Ie as ComponentProps,q as Context,_ as ControlledPromise,M as DEFAULT_CDN_URL,St as DOM,Ct as DataPath,Et as DataScope,R as DataSettings,x as Element,v as External,Ri as ExternalComponent,Si as ExternalComponentBundle,pt as FEAASComponent,Ie as FEAASComponentsProps,q as FEAASContext,Ye as FEAASContextProps,mt as FEAASEditor,Ke as FEAASEditorProps,x as FEAASElement,rr as FEAASExternalComponent,Tt as FEAASExternalPropsObject,ft as FEAASLoader,Ue as FEAASLoaderProps,er as FEAASNextExternalComponent,vt as FEAASPicker,Ge as FEAASPickerProps,Qe as FEAASReactComponent,oe as FEAASReactExternalComponent,Ur as FEAASReactExternalComponentBundle,Ir as FEAASReactServerComponent,jr as FEAASReactStylesheet,Ot as FEAASStylesheet,Be as FEAASStylesheetProps,tr as HTMLNodeToReact,Rt as InvalidResponse,f as JSONPath,ft as Loader,At as MyComponent,Fi as NextExternalComponent,vt as Picker,Di as ReactExternalComponent,_i as ServerComponent,Ni as Stylesheet,kt as Thumbnail,bt as WebComponent,xe as adjustNumbers,be as autoloadScripts,lt as cleanCollectionBit,xr as clearFetchCache,Le as createStylesheet,Ci as enableNextClientsideComponents,ut as fetchAndRevalidate,X as fetchAndRevalidateComponent,Ft as fetchAndRevalidateStylesheet,Dt as fetchBypassingCache,ct as fetchCache,Kt as fetchComponent,Zt as fetchData,dt as fetchToValidateCache,V as fetchWithCacheAwareness,Me as findStylesheet,Mt as getComponent,Cr as getComponentSource,ht as getComponentURL,Pe as getFetchCache,qe as getFramePosition,Ce as getHumanizedLabel,Se as getLastPathBit,we as getQualifier,qt as getStylesheetSource,J as getStylesheetURL,Lr as linkComponents,at as loadScript,_t as loadStylesheet,Gt as loadStylesheetAllowStale,xt as normalizeCollectionScope,ye as observeDOMElement,z as parseComponentSource,Ae as parseLimit,Ee as parseRange,Y as parseStylesheetSource,G as queryObject,Vt as queryObjectRaw,st as queryScopes,$r as registerComponent,Yt as renderComponent,Rr as renderComponentElement,$e as renderComponentPromise,H as renderDOMContent,N as renderDOMElement,Ar as renderHTMLContent,Sr as renderStylesheet,Te as renderStylesheetPromise,U as serializeCH1RichText,W as setDOMAttribute};
74
74
  //# sourceMappingURL=react.esm.js.map