@sitecore-feaas/clientside 0.1.45 → 0.1.47

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 (60) hide show
  1. package/build/dom/html.js +287 -0
  2. package/build/dom/html.js.map +1 -0
  3. package/build/dom/rendering.js +4 -4
  4. package/build/dom/rendering.js.map +1 -1
  5. package/build/dom/scripts.js +2 -2
  6. package/build/dom/scripts.js.map +1 -1
  7. package/build/ui/FEAASContext.js +2 -2
  8. package/build/ui/FEAASContext.js.map +1 -1
  9. package/build/ui/react.js +3 -1
  10. package/build/ui/react.js.map +1 -1
  11. package/dist/browser/headless.cjs +5 -5
  12. package/dist/browser/headless.cjs.map +4 -4
  13. package/dist/browser/headless.esm.js +5 -5
  14. package/dist/browser/headless.esm.js.map +1 -1
  15. package/dist/browser/index.cjs +5 -5
  16. package/dist/browser/index.cjs.map +4 -4
  17. package/dist/browser/index.esm.js +5 -5
  18. package/dist/browser/index.esm.js.map +1 -1
  19. package/dist/browser/react.cjs +5 -5
  20. package/dist/browser/react.cjs.map +4 -4
  21. package/dist/browser/react.esm.js +5 -5
  22. package/dist/browser/react.esm.js.map +1 -1
  23. package/dist/node/headless.cjs +3 -3
  24. package/dist/node/headless.cjs.map +4 -4
  25. package/dist/node/headless.esm.js +3 -3
  26. package/dist/node/headless.esm.js.map +4 -4
  27. package/dist/node/index.cjs +3 -3
  28. package/dist/node/index.cjs.map +4 -4
  29. package/dist/node/index.esm.js +3 -3
  30. package/dist/node/index.esm.js.map +4 -4
  31. package/dist/node/react.cjs +3 -3
  32. package/dist/node/react.cjs.map +4 -4
  33. package/dist/node/react.esm.js +3 -3
  34. package/dist/node/react.esm.js.map +4 -4
  35. package/headless.cjs +3 -3
  36. package/headless.cjs.map +4 -4
  37. package/headless.js +3 -3
  38. package/headless.js.map +4 -4
  39. package/package.json +1 -4
  40. package/react.cjs +5 -5
  41. package/react.cjs.map +4 -4
  42. package/react.js +5 -5
  43. package/react.js.map +4 -4
  44. package/scripts/build.js +1 -9
  45. package/src/dom/html.ts +322 -0
  46. package/src/dom/rendering.ts +5 -5
  47. package/src/dom/scripts.ts +3 -3
  48. package/src/ui/FEAASContext.tsx +2 -2
  49. package/src/ui/react.tsx +4 -1
  50. package/test/FEAASComponent.react.test.tsx +109 -0
  51. package/test/FEAASContext.test.tsx +2 -2
  52. package/test/dom.test.ts +48 -25
  53. package/types/dom/html.d.ts +45 -0
  54. package/types/dom/html.d.ts.map +1 -0
  55. package/types/dom/rendering.d.ts +1 -1
  56. package/types/dom/rendering.d.ts.map +1 -1
  57. package/types/tsbuildinfo +1 -1
  58. package/types/tsbuildinfo_ui +1 -1
  59. package/types/ui/react.d.ts +2 -0
  60. package/types/ui/react.d.ts.map +1 -1
@@ -1,7 +1,7 @@
1
- var te=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var Ne=Object.getOwnPropertyNames;var Be=Object.prototype.hasOwnProperty;var je=(e,t)=>{for(var r in t)te(e,r,{get:t[r],enumerable:!0})},Ue=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ne(t))!Be.call(e,i)&&i!==r&&te(e,i,{get:()=>t[i],enumerable:!(n=Le(t,i))||n.enumerable});return e};var Ie=e=>Ue(te({},"__esModule",{value:!0}),e);var dt={};je(dt,{Base:()=>b,Component:()=>W,ComponentProps:()=>De,DEFAULT_CDN_URL:()=>w,FEAASBase:()=>b,FEAASComponent:()=>W,FEAASComponentsProps:()=>De,FEAASLoader:()=>z,FEAASLoaderProps:()=>Oe,FEAASStylesheet:()=>X,FEAASStylesheetProps:()=>Pe,JSONPath:()=>f,Loader:()=>z,MyComponent:()=>K,Stylesheet:()=>X,autoloadScripts:()=>ge,cleanCollectionBit:()=>me,clearFetchCache:()=>it,createStylesheet:()=>Re,fetchAndRevalidate:()=>se,fetchAndRevalidateComponent:()=>$,fetchAndRevalidateStylesheet:()=>Z,fetchBypassingCache:()=>Y,fetchCache:()=>j,fetchComponent:()=>st,fetchToValidateCache:()=>U,fetchWithCacheAwareness:()=>C,findStylesheet:()=>xe,getComponentSource:()=>ot,getComponentURL:()=>ue,getFetchCache:()=>_e,getStylesheetSource:()=>at,getStylesheetURL:()=>H,loadScript:()=>B,loadStylesheet:()=>Q,loadStylesheetAllowStale:()=>ce,normalizeCollectionScope:()=>ae,observeDOMElement:()=>be,parseComponentSource:()=>I,parseStylesheetSource:()=>V,queryScopes:()=>G,renderComponent:()=>lt,renderComponentElement:()=>ct,renderComponentPromise:()=>Ce,renderDOMContent:()=>k,renderDOMElement:()=>A,renderHTMLContent:()=>nt,renderStylesheet:()=>ut,renderStylesheetPromise:()=>Fe,serializeCH1RichText:()=>O,setDOMAttribute:()=>P});module.exports=Ie(dt);function _(e,t=r=>{}){var r;let n=()=>{var i,o;let a=new Promise((u,l)=>{i=c=>{e==null||e(c),u(c)},o=l});var s=Object.assign(a,{resolve:i,reject:o,restart:n,first:r});return r=s,s.catch(t),s};return n()}var He=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,b=class extends He{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.dispatchEvent(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)}}log(...t){console.log(...t)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(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}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.dispatchEvent(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.dispatchEvent(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;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:a}=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.refs.topReact&&!this.forceUpdateReact?a?(this.reactRoot||(this.reactRoot=a.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(a){return{error:a}}componentDidCatch(a,s){console.error(`FEAAS: ${t.tagName} Error:`,a,s),t.onError(a,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(t=this,r){let{React:n,ReactDOM:i}=t.payload||{},o=this.getReactErrorBoundary(),a=this.getReactWrapper(t);return n.createElement(o,{key:t.tagName+"-"+t.getUID(),slot:t.getAttribute("slot")},n.createElement(a,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[a,s]=n.useReducer(u=>u+1,0);return t.forceUpdateReact=s,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 n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"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 D=class extends b{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)}},K=class extends D{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))}};K.observedAttributes=["counter"];function g(e){return g=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},g(e)}function fe(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 pe(e,t,r){return t&&he(e.prototype,t),r&&he(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function We(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&&N(e,t)}function L(e){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(e)}function N(e,t){return N=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},N(e,t)}function ye(){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 M(e,t,r){return ye()?M=Reflect.construct.bind():M=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&N(l,a.prototype),l},M.apply(null,arguments)}function ze(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function re(e){var t=typeof Map=="function"?new Map:void 0;return re=function(n){if(n===null||!ze(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 M(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),N(i,n)},re(e)}function Je(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function qe(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 Je(e)}function Ke(e){var t=ye();return function(){var n=L(e),i;if(t){var o=L(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return qe(this,i)}}function Ge(e){return Ye(e)||Ve(e)||ve(e)||Ze()}function Ye(e){if(Array.isArray(e))return ne(e)}function Ve(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 ne(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 ne(e,t)}}function ne(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 Ze(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qe(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(u){throw u},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,a=!1,s;return{s:function(){r=r.call(e)},n:function(){var u=r.next();return o=u.done,u},e:function(u){a=!0,s=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(a)throw s}}}}var m=Object.prototype.hasOwnProperty;function R(e,t){return e=e.slice(),e.push(t),e}function ie(e,t){return t=t.slice(),t.unshift(e),t}var Xe=function(e){We(r,e);var t=Ke(r);function r(n){var i;return fe(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 pe(r)}(re(Error));function f(e,t,r,n,i){if(!(this instanceof f))try{return new f(e,t,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof e=="string"&&(i=n,n=r,r=t,t=e,e=null);var o=e&&g(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=m.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 a={path:o?e.path:t};o?"json"in e&&(a.json=e.json):a.json=r;var s=this.evaluate(a);if(!s||g(s)!=="object")throw new Xe(s);return s}}f.prototype.evaluate=function(e,t,r,n){var i=this,o=this.parent,a=this.parentProperty,s=this.flatten,u=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&&g(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(!m.call(e,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=e;t=l.json,s=m.call(e,"flatten")?e.flatten:s,this.currResultType=m.call(e,"resultType")?e.resultType:this.currResultType,this.currSandbox=m.call(e,"sandbox")?e.sandbox:this.currSandbox,u=m.call(e,"wrap")?e.wrap:u,this.currPreventEval=m.call(e,"preventEval")?e.preventEval:this.currPreventEval,r=m.call(e,"callback")?e.callback:r,this.currOtherTypeCallback=m.call(e,"otherTypeCallback")?e.otherTypeCallback:this.currOtherTypeCallback,o=m.call(e,"parent")?e.parent:o,a=m.call(e,"parentProperty")?e.parentProperty:a,e=e.path}if(o=o||null,a=a||null,Array.isArray(e)&&(e=f.toPathString(e)),!(!e&&e!==""||!t)){var c=f.toPathArray(e);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var h=this._trace(c,t,["$"],o,a,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!u&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,p){var E=i._getPreferredOutput(p);return s&&Array.isArray(E)?d=d.concat(E):d.push(E),d},[]):u?[]: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,a,s){var u=this,l;if(!e.length)return l={path:r,value:t,parent:n,parentProperty:i,hasArrExpr:a},this._handleCallback(l,o,"value"),l;var c=e[0],h=e.slice(1),d=[];function p(y){Array.isArray(y)?y.forEach(function(Me){d.push(Me)}):d.push(y)}if((typeof c!="string"||s)&&t&&m.call(t,c))p(this._trace(h,t[c],R(r,c),t,c,o,a));else if(c==="*")this._walk(t,function(y){p(u._trace(h,t[y],R(r,y),t,y,o,!0,!0))});else if(c==="..")p(this._trace(h,t,r,n,i,o,a)),this._walk(t,function(y){g(t[y])==="object"&&p(u._trace(e.slice(),t[y],R(r,y),t,y,o,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(c==="~")return l={path:R(r,c),value:i,parent:n,parentProperty:null},this._handleCallback(l,o,"property"),l;if(c==="$")p(this._trace(h,t,r,null,null,o,a));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))p(this._slice(c,h,t,r,n,i,o));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var E=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(y){u._eval(E,t[y],y,r,n,i)&&p(u._trace(h,t[y],R(r,y),t,y,o,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(ie(this._eval(c,t,r[r.length-1],r.slice(0,-1),n,i),h),t,r,n,i,o,a))}else if(c[0]==="@"){var v=!1,S=c.slice(1,-2);switch(S){case"scalar":(!t||!["object","function"].includes(g(t)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===S&&(v=!0);break;case"integer":Number.isFinite(t)&&!(t%1)&&(v=!0);break;case"number":Number.isFinite(t)&&(v=!0);break;case"nonFinite":typeof t=="number"&&!Number.isFinite(t)&&(v=!0);break;case"object":t&&g(t)===S&&(v=!0);break;case"array":Array.isArray(t)&&(v=!0);break;case"other":v=this.currOtherTypeCallback(t,r,n,i);break;case"null":t===null&&(v=!0);break;default:throw new TypeError("Unknown value type "+S)}if(v)return l={path:r,value:t,parent:n,parentProperty:i},this._handleCallback(l,o,"value"),l}else if(c[0]==="`"&&t&&m.call(t,c.slice(1))){var F=c.slice(1);p(this._trace(h,t[F],R(r,F),t,F,o,a,!0))}else if(c.includes(",")){var ke=c.split(","),J=Qe(ke),de;try{for(J.s();!(de=J.n()).done;){var $e=de.value;p(this._trace(ie($e,h),t,r,n,i,o,!0))}}catch(y){J.e(y)}finally{J.f()}}else!s&&t&&m.call(t,c)&&p(this._trace(h,t[c],R(r,c),t,c,o,a,!0))}if(this._hasParentSelector)for(var x=0;x<d.length;x++){var q=d[x];if(q&&q.isParentSelector){var T=this._trace(q.expr,t,q.path,n,i,o,a);if(Array.isArray(T)){d[x]=T[0];for(var Te=T.length,ee=1;ee<Te;ee++)x++,d.splice(x,0,T[ee])}else d[x]=T}}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&&g(e)==="object"&&Object.keys(e).forEach(function(i){t(i)})};f.prototype._slice=function(e,t,r,n,i,o,a){if(Array.isArray(r)){var s=r.length,u=e.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,h=u[1]&&Number.parseInt(u[1])||s;c=c<0?Math.max(0,c+s):Math.min(s,c),h=h<0?Math.max(0,h+s):Math.min(s,h);for(var d=[],p=c;p<h;p+=l){var E=this._trace(ie(p,t),r,n,i,o,a,!0);E.forEach(function(v){d.push(v)})}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 a=e.includes("@path");a&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var s="script:"+e;if(!f.cache[s]){var u=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");a&&(u=u.replace(/@path/g,"_$_path")),f.cache[s]=new this.vm.Script(u)}try{return f.cache[s].runInNewContext(this.currSandbox)}catch(l){throw new Error("jsonPath: "+l.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,a){return"[#"+(r.push(a)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(o,a){return"['"+a.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(o,a){return";"+a.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(o){var a=o.match(/#([0-9]+)/);return!a||!a[1]?o:r[a[1]]});return t[e]=i,t[e].concat()};var et=function(t,r,n){for(var i=t.length,o=0;o<i;o++){var a=t[o];n(a)&&r.push(t.splice(o--,1)[0])}},tt=function(){function e(t){fe(this,e),this.code=t}return pe(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];et(i,o,function(c){return typeof r[c]=="function"});var a=i.map(function(c,h){return r[c]}),s=o.reduce(function(c,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+c},"");n=s+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 u=n.lastIndexOf(";"),l=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return M(Function,i.concat([l])).apply(void 0,Ge(a))}}]),e}();f.prototype.vm={Script:tt};function me(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ae(e){return me(e)+".*"}function G(e,t,r=!1,n=e){var i=t;let o=Object.keys(e).sort((s,u)=>u.length-s.length);for(let s of o)if(t.startsWith(s)){if(s==t){if(r)return e[s];continue}i=t.substring(s.length+1),n=e[s];break}var a=f({path:i,json:n});return Array.isArray(a)&&(a==null?void 0:a.length)==0&&(a=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((s,u,l)=>l.indexOf(s)===u).reduce((s,u)=>s.length>0?s:f({path:u,json:n}),[])),r&&Array.isArray(a)?a[0]:a}function oe(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${O(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):O(e)}function O(e){var t;if(Array.isArray(e))return e.map(O).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 oe(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>oe(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 oe(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function be(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&B(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&ge(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function ge(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];B(i,i.getAttribute("data-embed-src"))}if(t)return be(e)}function B(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.type="module",o.src=t,r.appendChild(o);break}}function we(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 rt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=we(e);if(i!=0)return;let o=e.parentElement;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var a=i+1,s=e,u=e;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(a++,s=u);for(var l=a;l<t;l++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var l=Math.max(1,t);l<a;l++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function P(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=O(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")o=e.tagName=="IMG"?e:e.querySelector("img, video");else if(t=="data-path-href")o=e.querySelector("a")||e.closest("a");else if(t=="data-path-alt")o=e.querySelector("img, picture");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")B(e,r);else if(t=="data-path-attributes"){let h=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var s in r){var u=r[s];P(e,s,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var l=0;l<h.length;l++)(r==null||!(h[l]in r))&&P(e,h[l],null,n);P(e,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var c=String(e.getAttribute("data-path-placeholder")||o[a]);r!=null?a=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(a)!=r&&o.setAttribute(a,r):a=="innerHTML"?o.innerHTML=c:o.removeAttribute(a)}}}var Ae=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,o,a;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let c=s.getAttribute("data-path-scope");if(c){let d=we(s),p=G(t,c,!1)||[];d==0&&rt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,p))===!1?1:p.length,r),t={...t,[ae(c)]:p[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,p)=>Ae.indexOf(d.name)-Ae.indexOf(p.name));for(var u=0;u<h.length;u++){let{name:d,value:p}=h[u];d.startsWith("data-path")&&d!="data-path-scope"&&P(s,d,G(t,p,!0),r),d=="data-embed-src"&&P(s,d,s.getAttribute(d),r)}}for(var u=0,l;l=s.childNodes[u++];)Ee(l)&&A(l,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function Ee(e){return e.nodeType==1}function k(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 s=0,u;u=e.childNodes[s++];)Ee(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function nt(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{parseHTML:a}=require("linkedom"),{document:s}=a(o);return A(s,t,r).toString()}else{let a=document.createElement("div");return a.innerHTML=o,A(a,t,r),a.innerHTML}}var Se=["initial","check","updated"],j={};function it(){j={}}async function se(e,t,r,n,i=j){return C({url:e,options:t,validator:r,callback:n,cache:i}).then(U).then(o=>o.response)}function _e(e,t=!1){let r=String(e).replace("?head","");var n=j[r];return!n&&!t&&(n=j[r]={phase:null,initial:_(),check:_(),updated:_(),final:_()}),n}async function C({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=_e(e);if(Se.indexOf(s.phase)>=Se.indexOf(o))var u=s[o];else s.phase=o}let l=await(u||fetch(e,t));if(!u&&s&&(l.ok?s[o].resolve(l):s[o].reject(new Error("Fetch failed"))),!l.ok)throw new Error("Fetch failed");if((r==null?void 0:r(l))===!1)throw new Error("Response is not valid");let c=new Date(l.headers.get("date"))<a||u&&o=="initial"&&(s.phase=="updated"||s.phase=="check");return await(n==null?void 0:n(l,o,c)),{url:e,options:t,isCached:c,response:l,validator:r,callback:n,cache:i}}async function U(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:s}=await C({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return Y(e)}return e}async function Y(e){return C({...e,options:{...e.options,cache:"reload"}},"updated")}var w="https://feaas.blob.core.windows.net";function I(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,a]=t;return{cdn:r,library:n,component:i,version:o,revision:a}}}function ot(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=w?`${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 at(e){return`${e.cdn&&e.cdn!=w?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function V(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=I(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 ue(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...I(e.src)}),`${e.cdn||e.hostname||w}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function H(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...V(e.src)}),`${e.cdn||e.hostname||w}/styles/${e.library}/${e.revision||"published"}.css`}async function $(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),o=await Promise.all([e.instance&&C({options:{headers:{Accept:"text/html"},credentials:"omit"},url:ue({...e,version:e.instance}),validator:n}).catch(s=>s),C({url:ue(e),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:U({...a,callback:i}).catch(s=>{if(o[0]==a&&(Y({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),U({...o[1],callback:i});throw s})}async function st(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await $(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function Z(e,t){return typeof e=="string"&&(e={src:e}),se(H(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 ut(e,t){return Fe(e,t||(t=document.createElement("style"))),t}function Fe(e,t){return t||(t=document.createElement("style")),Z(e,(r,n)=>{t.textContent=r}).then(()=>t)}function Q(e,t){var r=xe(e);if(!r)var n=Re(e);return Z(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function ce(e){return new Promise((t,r)=>{Q(e,t).catch(r)})}function xe(e){return document.head.querySelector(`style[data-href="${H(e)}"]`)}function Re(e){let t=H(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function ct(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function lt(e,t){return Ce(e,t||(t=document.createElement("div"))),t}async function Ce(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?k(t,e.template,e.data,e):$(e,r=>k(t,r,e.data,e)).then(()=>t)}function De(e=this){var t,r,n,i,o,a,s,u;let l,c=e.getAttribute("src");if(c){let F=I(c);if(!F)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:h,library:d,component:p,version:E,revision:v}=F}let S=e.getAttribute("data");if(S!=null&&S!="")try{l=typeof S=="string"?JSON.parse(S):{}}catch(F){}return{data:l||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:w,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:p,version:(a=(o=e.getAttribute("version"))!==null&&o!==void 0?o:E)!==null&&a!==void 0?a:"responsive",revision:(u=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:v)!==null&&u!==void 0?u:"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 W=class extends b{setData(t){this.set({data:t})}getProps(){return De(this)}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))}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.defaultProps={cdn:w,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=t=>{this.payload=t,this.advance()},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()){if(this.props.withStylesheet)var t=ce({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,$(this.props,r=>{this.payload=r,t||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;k(this,this.payload,this.props.data)}}};W.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];W.register("feaas-component");function Oe(e=this){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 z=class extends b{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Oe(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=`
1
+ var re=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var Ie=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var We=(t,e)=>{for(var r in e)re(t,r,{get:e[r],enumerable:!0})},ze=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ie(e))!He.call(t,i)&&i!==r&&re(t,i,{get:()=>e[i],enumerable:!(n=Ue(e,i))||n.enumerable});return t};var Je=t=>ze(re({},"__esModule",{value:!0}),t);var mt={};We(mt,{Base:()=>b,Component:()=>z,ComponentProps:()=>ke,DEFAULT_CDN_URL:()=>w,FEAASBase:()=>b,FEAASComponent:()=>z,FEAASComponentsProps:()=>ke,FEAASLoader:()=>J,FEAASLoaderProps:()=>$e,FEAASStylesheet:()=>ee,FEAASStylesheetProps:()=>Te,JSONPath:()=>f,Loader:()=>J,MyComponent:()=>G,Stylesheet:()=>ee,autoloadScripts:()=>Ee,cleanCollectionBit:()=>Ae,clearFetchCache:()=>ct,createStylesheet:()=>Ne,fetchAndRevalidate:()=>ce,fetchAndRevalidateComponent:()=>$,fetchAndRevalidateStylesheet:()=>Q,fetchBypassingCache:()=>Y,fetchCache:()=>U,fetchComponent:()=>ft,fetchToValidateCache:()=>I,fetchWithCacheAwareness:()=>D,findStylesheet:()=>Oe,getComponentSource:()=>dt,getComponentURL:()=>de,getFetchCache:()=>Re,getStylesheetSource:()=>ht,getStylesheetURL:()=>W,loadScript:()=>j,loadStylesheet:()=>X,loadStylesheetAllowStale:()=>he,normalizeCollectionScope:()=>ae,observeDOMElement:()=>Se,parseComponentSource:()=>H,parseStylesheetSource:()=>Z,queryScopes:()=>V,renderComponent:()=>vt,renderComponentElement:()=>yt,renderComponentPromise:()=>Pe,renderDOMContent:()=>k,renderDOMElement:()=>g,renderHTMLContent:()=>lt,renderStylesheet:()=>pt,renderStylesheetPromise:()=>De,serializeCH1RichText:()=>N,setDOMAttribute:()=>P});module.exports=Je(mt);function x(t,e=r=>{}){var r;let n=()=>{var i,o;let s=new Promise((u,c)=>{i=l=>{t==null||t(l),u(l)},o=c});var a=Object.assign(s,{resolve:i,reject:o,restart:n,first:r});return r=a,a.catch(e),a};return n()}var qe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,b=class extends qe{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=x(e=>{this.payload=e}),this.whenRendered=x(()=>this.initialized=!0,()=>cancelAnimationFrame(this.nextRender)),this.addEventListener("feaasMount",this),this.addEventListener("feaasUnmount",this)}getRoot(){return this}attributeChangedCallback(e,r,n){this.set()}connectedCallback(){this.mount()}disconnectedCallback(){this.unmount()}mount(){try{let e=this.getParent();if(e&&!e.connected||this.connected)return;this.connected=!0,this.log("FEAAS: Mount",this.tagName,this),this.dispatchEvent(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(e){this.onError(e)}}log(...e){console.log(...e)}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEvent(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!1)}getParent(e=!0){for(var r=this;r=r.parentElement||(r.parentNode instanceof ShadowRoot?r.parentNode.host:null);)if(!e||r.tagName.startsWith("FEAAS-"))return r}getElements(e=this.getRoot(),r=!0){return Array.from(e.querySelectorAll("*")).map(n=>[!r||n.tagName.startsWith("FEAAS-")?n:null,n.shadowRoot?this.getElements(n.shadowRoot,r):null]).flat().filter(Boolean)}handleEvent(e){let r=e.composedPath()[0];switch(e.type){case"feaasMount":r!=this&&this.nestedCallback(r);break;case"feaasUnmount":r!=this&&this.unnestedCallback(r);break}}unnestedCallback(e){let r=this.descendants.indexOf(e);r!=-1&&(this.log("FEAAS: Unnest",this,e),this.descendants.splice(r,-1),this.refs[e.getComponentName()]=null,e.refs.parent==this&&(e.refs.parent=null),e.refs.top==this&&(e.refs.top=e.refs.parent))}nestedCallback(e){var r,n;if(this.descendants.indexOf(e)==-1&&(this.descendants.push(e),this.log("FEAAS: Nest",this,e),this.refs[e.getComponentName()]=e,e.refs.top=this,(r=e.refs).parent||(r.parent=this),e.render))for(var o=e.refs.parent;o;o=o.refs.parent)o.render&&((n=e.refs).parentReact||(n.parentReact=o),e.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}onError(e,r="uncaught",n=!1){let i=new CustomEvent("feaasError",{bubbles:!0,composed:!0,detail:e});if(this.dispatchEvent(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);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.dispatchEvent(new Event("feaasLoad",{bubbles:!0,composed:!0}));let e=await this.load().catch(r=>{throw this.payload=void 0,r});if(this.whenLoaded.resolve(e),this.onLoad)return}else if(this.payload==null)return;this.flush(),this.whenRendered.resolve(this)}catch(e){this.onError(e)}}flush(){var e,r;let n=(r=(e=this.payload)===null||e===void 0?void 0:e.ReactDOM)===null||r===void 0?void 0:r.flushSync;n?n(()=>this.update()):this.update()}load(){return Promise.resolve(null)}update(){var e,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.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?(e=this.forceUpdateReact)===null||e===void 0||e.call(this):(n=(r=this.refs.topReact).forceUpdateReact)===null||n===void 0||n.call(r)}invokeReactRendering(){let{React:e,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(e=this,r=e.tagName){if(this.reactErrorBoundary)return this.reactErrorBoundary;let{React:n,ReactDOM:i}=e.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: ${e.tagName} Error:`,s,a),e.onError(s,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},o=this.getReactErrorBoundary(),s=this.getReactWrapper(e);return n.createElement(o,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(s,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=o=>{if(e.render){let[s,a]=n.useReducer(u=>u+1,0);return e.forceUpdateReact=a,i.createPortal(n.createElement(n.Fragment,null,e.invokeReactRendering()),e.getReactRootElement())}else return e.update()},Object.assign(e.reactWrapper,{key:e.tagName+"-"+e.getUID(),displayName:r}),e.reactWrapper}getUID(){return this.uid||(this.uid=String(Math.random()))}getShadowRoot(){return this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot}getReactRootElement(){return this.useShadowRoot?this.getShadowRoot():this.getRoot()}set(e){try{this.scheduleRender(),this.overrides={...this.overrides,...e},this.props={...this.getProps(),...this.overrides};for(var r in this.props){let n=this.props[r],i=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();n==null||n===this.defaultProps[r]?this.removeAttribute(i):(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&this.getAttribute(i)!=String(n)&&this.setAttribute(i,String(n))}}catch(n){this.whenRendered.reject(n),this.onError(n,"set")}return this}import(e){return import( /*@vite-ignore*/ /* webpackIgnore: true */ e)}scheduleRender(){this.nextRender==null&&(this.whenRendered=this.whenRendered.restart()),cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.nextRender=null,this.advance().catch(e=>{})})}formatURL(e,r){return typeof e=="string"&&e.match(/^\/[^\/]/)?r+e:e}getContextAttribute(e,r=this){for(var n=this;n=n.parentElement||(n.parentNode instanceof ShadowRoot?n.parentNode.host:null);)if(n.getAttribute(e)!=null)return n.getAttribute(e);return this.getAttribute(e)}static register(e,r){r==null&&(r=typeof window!="undefined"?window:null),r&&!r.customElements.get(e)&&r.customElements.define(e,this)}};var O=class extends b{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(([e,r])=>({React:e,ReactDOM:r}))}render({},{React:e}){return e.createElement(e.Fragment,null)}},G=class extends O{constructor(){super(...arguments),this.useShadowRoot=!0}getProps(){return{counter:parseFloat(this.getAttribute("counter"))}}render({counter:e},{React:r}){let[n,i]=r.useState(0);return r.useEffect(()=>{i(o=>o+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};G.observedAttributes=["counter"];function A(t){return A=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},A(t)}function ve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function ye(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function me(t,e,r){return e&&ye(t.prototype,e),r&&ye(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Ke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&B(t,e)}function L(t){return L=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},L(t)}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},B(t,e)}function be(){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 M(t,e,r){return be()?M=Reflect.construct.bind():M=function(i,o,s){var a=[null];a.push.apply(a,o);var u=Function.bind.apply(i,a),c=new u;return s&&B(c,s.prototype),c},M.apply(null,arguments)}function Ge(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function ne(t){var e=typeof Map=="function"?new Map:void 0;return ne=function(n){if(n===null||!Ge(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(n))return e.get(n);e.set(n,i)}function i(){return M(n,arguments,L(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),B(i,n)},ne(t)}function Ve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ye(t,e){if(e&&(typeof e=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ve(t)}function Ze(t){var e=be();return function(){var n=L(t),i;if(e){var o=L(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return Ye(this,i)}}function Qe(t){return Xe(t)||et(t)||ge(t)||tt()}function Xe(t){if(Array.isArray(t))return ie(t)}function et(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ge(t,e){if(t){if(typeof t=="string")return ie(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ie(t,e)}}function ie(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function tt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rt(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=ge(t))||e&&t&&typeof t.length=="number"){r&&(t=r);var n=0,i=function(){};return{s:i,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},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(t)},n:function(){var u=r.next();return o=u.done,u},e:function(u){s=!0,a=u},f:function(){try{!o&&r.return!=null&&r.return()}finally{if(s)throw a}}}}var m=Object.prototype.hasOwnProperty;function C(t,e){return t=t.slice(),t.push(e),t}function oe(t,e){return e=e.slice(),e.unshift(t),e}var nt=function(t){Ke(r,t);var e=Ze(r);function r(n){var i;return ve(this,r),i=e.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 me(r)}(ne(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(t,e,r,n,i)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var o=t&&A(t)==="object";if(t=t||{},this.json=t.json||r,this.path=t.path||e,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=m.call(t,"wrap")?t.wrap:!0,this.sandbox=t.sandbox||{},this.preventEval=t.preventEval||!1,this.parent=t.parent||null,this.parentProperty=t.parentProperty||null,this.callback=t.callback||n||null,this.otherTypeCallback=t.otherTypeCallback||i||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var s={path:o?t.path:e};o?"json"in t&&(s.json=t.json):s.json=r;var a=this.evaluate(s);if(!a||A(a)!=="object")throw new nt(a);return a}}f.prototype.evaluate=function(t,e,r,n){var i=this,o=this.parent,s=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&A(t)==="object"&&!Array.isArray(t)){if(!t.path&&t.path!=="")throw new TypeError('You must supply a "path" property when providing an object argument to JSONPath.evaluate().');if(!m.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var c=t;e=c.json,a=m.call(t,"flatten")?t.flatten:a,this.currResultType=m.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=m.call(t,"sandbox")?t.sandbox:this.currSandbox,u=m.call(t,"wrap")?t.wrap:u,this.currPreventEval=m.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=m.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=m.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,o=m.call(t,"parent")?t.parent:o,s=m.call(t,"parentProperty")?t.parentProperty:s,t=t.path}if(o=o||null,s=s||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!e)){var l=f.toPathArray(t);l[0]==="$"&&l.length>1&&l.shift(),this._hasParentSelector=null;var h=this._trace(l,e,["$"],o,s,r).filter(function(d){return d&&!d.isParentSelector});return h.length?!u&&h.length===1&&!h[0].hasArrExpr?this._getPreferredOutput(h[0]):h.reduce(function(d,p){var S=i._getPreferredOutput(p);return a&&Array.isArray(S)?d=d.concat(S):d.push(S),d},[]):u?[]:void 0}};f.prototype._getPreferredOutput=function(t){var e=this.currResultType;switch(e){case"all":{var r=Array.isArray(t.path)?t.path:f.toPathArray(t.path);return t.pointer=f.toPointer(r),t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[e];case"path":return f.toPathString(t[e]);case"pointer":return f.toPointer(t.path);default:throw new TypeError("Unknown result type")}};f.prototype._handleCallback=function(t,e,r){if(e){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:f.toPathString(t.path),e(n,r,t)}};f.prototype._trace=function(t,e,r,n,i,o,s,a){var u=this,c;if(!t.length)return c={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:s},this._handleCallback(c,o,"value"),c;var l=t[0],h=t.slice(1),d=[];function p(y){Array.isArray(y)?y.forEach(function(je){d.push(je)}):d.push(y)}if((typeof l!="string"||a)&&e&&m.call(e,l))p(this._trace(h,e[l],C(r,l),e,l,o,s));else if(l==="*")this._walk(e,function(y){p(u._trace(h,e[y],C(r,y),e,y,o,!0,!0))});else if(l==="..")p(this._trace(h,e,r,n,i,o,s)),this._walk(e,function(y){A(e[y])==="object"&&p(u._trace(t.slice(),e[y],C(r,y),e,y,o,!0))});else{if(l==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:h,isParentSelector:!0};if(l==="~")return c={path:C(r,l),value:i,parent:n,parentProperty:null},this._handleCallback(c,o,"property"),c;if(l==="$")p(this._trace(h,e,r,null,null,o,s));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(l))p(this._slice(l,h,e,r,n,i,o));else if(l.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var S=l.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(e,function(y){u._eval(S,e[y],y,r,n,i)&&p(u._trace(h,e[y],C(r,y),e,y,o,!0))})}else if(l[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");p(this._trace(oe(this._eval(l,e,r[r.length-1],r.slice(0,-1),n,i),h),e,r,n,i,o,s))}else if(l[0]==="@"){var v=!1,E=l.slice(1,-2);switch(E){case"scalar":(!e||!["object","function"].includes(A(e)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":A(e)===E&&(v=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(v=!0);break;case"number":Number.isFinite(e)&&(v=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(v=!0);break;case"object":e&&A(e)===E&&(v=!0);break;case"array":Array.isArray(e)&&(v=!0);break;case"other":v=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(v=!0);break;default:throw new TypeError("Unknown value type "+E)}if(v)return c={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(c,o,"value"),c}else if(l[0]==="`"&&e&&m.call(e,l.slice(1))){var _=l.slice(1);p(this._trace(h,e[_],C(r,_),e,_,o,s,!0))}else if(l.includes(",")){var Me=l.split(","),q=rt(Me),pe;try{for(q.s();!(pe=q.n()).done;){var Le=pe.value;p(this._trace(oe(Le,h),e,r,n,i,o,!0))}}catch(y){q.e(y)}finally{q.f()}}else!a&&e&&m.call(e,l)&&p(this._trace(h,e[l],C(r,l),e,l,o,s,!0))}if(this._hasParentSelector)for(var F=0;F<d.length;F++){var K=d[F];if(K&&K.isParentSelector){var T=this._trace(K.expr,e,K.path,n,i,o,s);if(Array.isArray(T)){d[F]=T[0];for(var Be=T.length,te=1;te<Be;te++)F++,d.splice(F,0,T[te])}else d[F]=T}}return d};f.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&A(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};f.prototype._slice=function(t,e,r,n,i,o,s){if(Array.isArray(r)){var a=r.length,u=t.split(":"),c=u[2]&&Number.parseInt(u[2])||1,l=u[0]&&Number.parseInt(u[0])||0,h=u[1]&&Number.parseInt(u[1])||a;l=l<0?Math.max(0,l+a):Math.min(a,l),h=h<0?Math.max(0,h+a):Math.min(a,h);for(var d=[],p=l;p<h;p+=c){var S=this._trace(oe(p,e),r,n,i,o,s,!0);S.forEach(function(v){d.push(v)})}return d}};f.prototype._eval=function(t,e,r,n,i,o){this.currSandbox._$_parentProperty=o,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var s=t.includes("@path");s&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+t;if(!f.cache[a]){var u=t.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&&(u=u.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(u)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(c){throw new Error("jsonPath: "+c.message+": "+t)}};f.cache={};f.toPathString=function(t){for(var e=t,r=e.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(e[i])||(n+=/^[\*0-9]+$/.test(e[i])?"["+e[i]+"]":"['"+e[i]+"']");return n};f.toPointer=function(t){for(var e=t,r=e.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(e[i])||(n+="/"+e[i].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};f.toPathArray=function(t){var e=f.cache;if(e[t])return e[t].concat();var r=[],n=t.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 e[t]=i,e[t].concat()};var it=function(e,r,n){for(var i=e.length,o=0;o<i;o++){var s=e[o];n(s)&&r.push(e.splice(o--,1)[0])}},ot=function(){function t(e){ve(this,t),this.code=e}return me(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];it(i,o,function(l){return typeof r[l]=="function"});var s=i.map(function(l,h){return r[l]}),a=o.reduce(function(l,h){var d=r[h].toString();return/function/.test(d)||(d="function "+d),"var "+h+"="+d+";"+l},"");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 u=n.lastIndexOf(";"),c=u>-1?n.slice(0,u+1)+" return "+n.slice(u+1):" return "+n;return M(Function,i.concat([c])).apply(void 0,Qe(s))}}]),t}();f.prototype.vm={Script:ot};function Ae(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function ae(t){return Ae(t)+".*"}function V(t,e,r=!1,n=t){var i=e;let o=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of o)if(e.startsWith(a)){if(a==e){if(r)return t[a];continue}i=e.substring(a.length+1),n=t[a];break}var s=f({path:i,json:n});return Array.isArray(s)&&(s==null?void 0:s.length)==0&&(s=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$\./,"$1."),i.replace(/^.*?\.\$\./,"_."),i.replace(/^.*?\.\$\./,""),i.replace(/^[^.]+$/,"_")].filter((a,u,c)=>c.indexOf(a)===u).reduce((a,u)=>a.length>0?a:f({path:u,json:n}),[])),r&&Array.isArray(s)?s[0]:s}function se(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${N(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):N(t)}function N(t){var e;if(Array.isArray(t))return t.map(N).join(`
4
+ `).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return se(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,o)=>se(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return se(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var R=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new R(i)}},this.nodeName=e,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(e,r){let n=this.attributes.find(i=>i.name===e);n?n.value=r:this.attributes.push({name:e,value:r})}getAttribute(e){let r=this.attributes.find(n=>n.name===e);return r?r.value:void 0}insertBefore(e,r){if(e.parentNode=this,r===null)this.childNodes.push(e);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,e)}}removeAttribute(e){let r=this.attributes.findIndex(n=>n.name===e);r!==-1&&this.attributes.splice(r,1)}appendChild(e){e.parentNode=this,this.childNodes.push(e)}get tagName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toUpperCase()}get innerHTML(){return ue(this.childNodes)}set innerHTML(e){this.childNodes=le(String(e!=null?e:""))}get outerHTML(){return ue([this])}closest(e){let r=this;for(;r;){if(we(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=o=>{for(let s of r)if(we(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(e){return this.querySelectorAll(e)[0]}findSibling(e,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+e;o>=0&&o<n.length;o+=e){let s=n[o];if(!r||s.nodeType===1)return s}return null}removeChild(e){let r=this.childNodes.indexOf(e);if(r!==-1)return this.childNodes.splice(r,1),e.parentNode=void 0,e}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(e=!1){let r=new R(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),e)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.nodeType)==1?this.parentNode:null}};function we(t,e){let r=t.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(e.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(e.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=e.getAttribute(o);if(typeof s=="undefined"){if(a===void 0)return!1}else if(a!==s)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function le(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),o=t.match(/^<\/([\w-]+)>/);if(i){let s=i[1],u=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(l=>{let[h,d,,p]=l.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:at(p||"")}}))||[],c=new R(s,1);if(c.attributes=u,n.length>0){let l=n[n.length-1];l.childNodes.push(c),c.parentNode=l}else r.push(c);n.push(c),t=t.slice(i[0].length)}else if(o)n.pop(),t=t.slice(o[0].length);else{let s=t.indexOf("<"),a=t.slice(0,s!==-1?s:void 0),u=new R("#text",3);if(u.textContent=a,n.length>0){let c=n[n.length-1];c.childNodes.push(u),u.parentNode=c}else r.push(u);t=t.slice(a.length)}}return r}function st(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function at(t){return t.replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#x27;/g,"'")}function ue(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:s,value:a})=>` ${s}="${st(String(a))}"`).join(""),o=ue(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function Se(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&j(i,o),n.addedNodes&&n.addedNodes.forEach(s=>{s.nodeType==1&&Ee(s,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function Ee(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];j(i,i.getAttribute("data-embed-src"))}if(e)return Se(t)}function j(t,e){for(var r=t;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")==e)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",e),r.appendChild(o);break}}function _e(t){let e=t.getAttribute("data-path-scope");for(var r=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==e&&r++;return r}function ut(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=_e(t);if(i!=0)return;let o=t.parentNode;if(o!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var s=i+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(s++,a=u);for(var c=s;c<e;c++)o.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var c=Math.max(1,e);c<s;c++)a=a.previousElementSibling,o.removeChild(a.nextElementSibling)}}function P(t,e,r,n){var i;if(t){var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=N(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var s=e.replace("data-path-","");if(e=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-alt")o=t.querySelector("img, picture");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")s="innerHTML";else if(e=="data-embed-src")j(t,r);else if(e=="data-path-attributes"){let h=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var a in r){var u=r[a];P(t,a,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var c=0;c<h.length;c++)(r==null||!(h[c]in r))&&P(t,h[c],null,n);P(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);r!=null?s=="innerHTML"?o.innerHTML!=r&&(o.innerHTML=r):o.getAttribute(s)!=r&&o.setAttribute(s,r):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}var xe=["data-attributes-keys","data-path-attributes","data-path-scope"];function g(t,e,r,n){var i,o,s;let a=t;if(n||(e=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,a,e))||e),a.nodeType==1){let l=a.getAttribute("data-path-scope");if(l){let d=_e(a),p=V(e,l,!1)||[];d==0&&ut(a,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,a,p))===!1?1:p.length,r),e={...e,[ae(l)]:p[d]}}let h=Array.prototype.slice.call(a.attributes).sort((d,p)=>xe.indexOf(d.name)-xe.indexOf(p.name));for(var u=0;u<h.length;u++){let{name:d,value:p}=h[u];d.startsWith("data-path")&&d!="data-path-scope"&&P(a,d,V(e,p,!0),r),d=="data-embed-src"&&P(a,d,a.getAttribute(d),r)}}for(var u=0,c;c=a.childNodes[u++];)Fe(c)&&g(c,e,r,!0);return n||(s=r==null?void 0:r.onRender)===null||s===void 0||s.call(r,a,e),a}function Fe(t){return t.nodeType==1}function k(t,e,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=o,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,u;u=t.childNodes[a++];)Fe(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return g(t,r,n)}function lt(t,e,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,t,e))||t;if(typeof document=="undefined"||n){let s=le(o);return g(s[0],e,r).outerHTML}else{let s=document.createElement("div");return s.innerHTML=o,g(s,e,r),s.innerHTML}}var Ce=["initial","check","updated"],U={};function ct(){U={}}async function ce(t,e,r,n,i=U){return D({url:t,options:e,validator:r,callback:n,cache:i}).then(I).then(o=>o.response)}function Re(t,e=!1){let r=String(t).replace("?head","");var n=U[r];return!n&&!e&&(n=U[r]={phase:null,initial:x(),check:x(),updated:x(),final:x()}),n}async function D({url:t,options:e,validator:r,callback:n,cache:i},o="initial"){let s=new Date;if(i!=null){var a=Re(t);if(Ce.indexOf(a.phase)>=Ce.indexOf(o))var u=a[o];else a.phase=o}let c=await(u||fetch(t,e));if(!u&&a&&(c.ok?a[o].resolve(c):a[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");if((r==null?void 0:r(c))===!1)throw new Error("Response is not valid");let l=new Date(c.headers.get("date"))<s||u&&o=="initial"&&(a.phase=="updated"||a.phase=="check");return await(n==null?void 0:n(c,o,l)),{url:t,options:e,isCached:l,response:c,validator:r,callback:n,cache:i}}async function I(t){let{url:e,isCached:r,options:n,validator:i,response:o,cache:s}=t;if(r){let{response:a}=await D({url:e+"?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 Y(t)}return t}async function Y(t){return D({...t,options:{...t.options,cache:"reload"}},"updated")}var w="https://feaas.blob.core.windows.net";function H(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,o,s]=e;return{cdn:r,library:n,component:i,version:o,revision:s}}}function dt(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=w?`${t.cdn}/components`:""}/${t.library}/${t.component}/${!t.version||t.version=="responsive"&&(!t.revision||t.revision=="published")?"":t.version}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function ht(t){return`${t.cdn&&t.cdn!=w?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function Z(t){let e=t.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(e){var[,r,n,i]=e;return{cdn:r,library:n,revision:i}}else{let o=H(t);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 de(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...H(t.src)}),`${t.cdn||t.hostname||w}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function W(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...Z(t.src)}),`${t.cdn||t.hostname||w}/styles/${t.library}/${t.revision||"published"}.css`}async function $(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),o=await Promise.all([t.instance&&D({options:{headers:{Accept:"text/html"},credentials:"omit"},url:de({...t,version:t.instance}),validator:n}).catch(a=>a),D({url:de(t),validator:n}).catch(a=>a)]),s=o.find(a=>a&&"isCached"in a&&a);if(!s||s instanceof Error)throw o.find(u=>u&&u instanceof Error)||new Error("Can not fetch component");return o[0]==s&&console.log("Using fork!",o),await i(s.response),r?s:I({...s,callback:i}).catch(a=>{if(o[0]==s&&(Y({...s,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),I({...o[1],callback:i});throw a})}async function ft(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await $(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function Q(t,e){return typeof t=="string"&&(t={src:t}),ce(W(t),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>e(i,n)))}function pt(t,e){return De(t,e||(e=document.createElement("style"))),e}function De(t,e){return e||(e=document.createElement("style")),Q(t,(r,n)=>{e.textContent=r}).then(()=>e)}function X(t,e){var r=Oe(t);if(!r)var n=Ne(t);return Q(t,(i,o)=>{n&&(n.textContent=i),e==null||e(i,o)}).then(()=>r||n)}function he(t){return new Promise((e,r)=>{X(t,e).catch(r)})}function Oe(t){return document.head.querySelector(`style[data-href="${W(t)}"]`)}function Ne(t){let e=W(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function yt(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return g(n,e),r}function vt(t,e){return Pe(t,e||(e=document.createElement("div"))),e}async function Pe(t,e){return e||(e=document.createElement("div")),e.childNodes.length?g(e,t.data,t):"template"in t?k(e,t.template,t.data,t):$(t,r=>k(e,r,t.data,t)).then(()=>e)}function ke(t=this){var e,r,n,i,o,s,a,u;let c,l=t.getAttribute("src");if(l){let _=H(l);if(!_)throw new Error(`Could not parse FEAAS Component source: ${l}`);var{cdn:h,library:d,component:p,version:S,revision:v}=_}let E=t.getAttribute("data");if(E!=null&&E!="")try{c=typeof E=="string"?JSON.parse(E):{}}catch(_){}return{data:c||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:h)!==null&&r!==void 0?r:w,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:p,version:(s=(o=t.getAttribute("version"))!==null&&o!==void 0?o:S)!==null&&s!==void 0?s:"responsive",revision:(u=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:v)!==null&&u!==void 0?u:"published",hostname:t.getAttribute("hostname"),template:t.getAttribute("template"),instance:t.getAttribute("instance"),editable:t.getAttribute("editable")!=null,suspended:t.getAttribute("suspended")!=null,lastModified:t.getAttribute("last-modified"),withStylesheet:t.getAttribute("with-stylesheet")!="false"}}var z=class extends b{setData(e){this.set({data:e})}getProps(){return ke(this)}attributeChangedCallback(e,r,n){r!==n&&((e=="library"||e=="component"||e=="revision"||e=="version")&&(this.payload=void 0),this.needsRefresh=!0,super.attributeChangedCallback(e,r,n))}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.defaultProps={cdn:w,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1},this.onLoad=e=>{this.payload=e,this.advance()},this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let e=this.getEditor();if(e!=null&&e.setTarget(this))return e.open(),!0}getOriginal(){let e=this.getAttribute("data-path-scope");if(e){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==e;)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()){if(this.props.withStylesheet)var e=he({...this.props,revision:"published"}).then(()=>{e=null,this.payload&&this.onLoad(this.payload)});return Promise.all([e,$(this.props,r=>{this.payload=r,e||this.onLoad(r)})]).then(()=>this.payload)}}update(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)g(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;k(this,this.payload,this.props.data)}}};z.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];z.register("feaas-component");function $e(t=this){return{opacity:t!=null&&t.getAttribute("opacity")?parseFloat(t==null?void 0:t.getAttribute("opacity")):1,hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var J=class extends b{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return $e(this)}attributeChangedCallback(e,r,n){if(r!==n)return e=="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(e,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,5 +65,5 @@ 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)}};z.observedAttributes=["hidden","opacity"];z.register("feaas-loader");function Pe(e=this){var t,r,n,i;let o=e.getAttribute("src");if(o)var{cdn:a,library:s,revision:u}=V(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:u)!==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:w}}var X=class extends b{constructor(){super(...arguments),this.onLoad=t=>{this.payload=t,this.advance()}}getProps(){return Pe(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return Q(this.props,this.onLoad)}};X.register("feaas-stylesheet");var le;typeof window!="undefined"&&(window.FEAASElement=D,(le=window.FEAASLoading)!==null&&le!==void 0||(window.FEAASLoading=Promise.resolve()));
68
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}update(){this.loader.style.opacity=String(this.props.opacity)}};J.observedAttributes=["hidden","opacity"];J.register("feaas-loader");function Te(t=this){var e,r,n,i;let o=t.getAttribute("src");if(o)var{cdn:s,library:a,revision:u}=Z(o);return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=(e=t==null?void 0:t.getAttribute("revision"))!==null&&e!==void 0?e:u)!==null&&r!==void 0?r:"published",cdn:(i=(n=t==null?void 0:t.getContextAttribute("cdn"))!==null&&n!==void 0?n:t==null?void 0:t.getContextAttribute("hostname"))!==null&&i!==void 0?i:w}}var ee=class extends b{constructor(){super(...arguments),this.onLoad=e=>{this.payload=e,this.advance()}}getProps(){return Te(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return X(this.props,this.onLoad)}};ee.register("feaas-stylesheet");var fe;typeof window!="undefined"&&(window.FEAASElement=O,(fe=window.FEAASLoading)!==null&&fe!==void 0||(window.FEAASLoading=Promise.resolve()));
69
69
  //# sourceMappingURL=headless.cjs.map