@sitecore-feaas/clientside 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/FEAASBase.js +1 -1
- package/build/components/FEAASBase.js.map +1 -1
- package/dist/browser/headless.cjs +1 -1
- package/dist/browser/headless.cjs.map +2 -2
- package/dist/browser/headless.esm.js +1 -1
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.cjs.map +2 -2
- package/dist/browser/index.esm.js +1 -1
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +1 -1
- package/dist/browser/react.cjs.map +2 -2
- package/dist/browser/react.esm.js +1 -1
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +1 -1
- package/dist/node/headless.cjs.map +2 -2
- package/dist/node/headless.esm.js +1 -1
- package/dist/node/headless.esm.js.map +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.esm.js +1 -1
- package/dist/node/index.esm.js.map +2 -2
- package/dist/node/react.cjs +1 -1
- package/dist/node/react.cjs.map +2 -2
- package/dist/node/react.esm.js +1 -1
- package/dist/node/react.esm.js.map +2 -2
- package/headless.cjs +1 -1
- package/headless.cjs.map +2 -2
- package/headless.js +1 -1
- package/headless.js.map +2 -2
- package/package.json +1 -6
- package/react.cjs +1 -1
- package/react.cjs.map +2 -2
- package/react.js +1 -1
- package/react.js.map +2 -2
- package/src/components/FEAASBase.tsx +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/tsbuildinfo_ui +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});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 Fe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,b=class extends Fe{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!=null&&r.customElements.get(t)||r.customElements.define(t,this)}};var C=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)}},G=class extends C{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))}};G.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 ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function se(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 ce(e,t,r){return t&&se(e.prototype,t),r&&se(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xe(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&&$(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(e)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$(e,t)}function le(){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 P(e,t,r){return le()?P=Reflect.construct.bind():P=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&$(l,a.prototype),l},P.apply(null,arguments)}function Re(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Y(e){var t=typeof Map=="function"?new Map:void 0;return Y=function(n){if(n===null||!Re(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 P(n,arguments,k(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),$(i,n)},Y(e)}function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(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 Ce(e)}function Oe(e){var t=le();return function(){var n=k(e),i;if(t){var o=k(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return De(this,i)}}function Pe(e){return ke(e)||$e(e)||de(e)||Te()}function ke(e){if(Array.isArray(e))return V(e)}function $e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function de(e,t){if(e){if(typeof e=="string")return V(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 V(e,t)}}function V(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 Te(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1
|
+
var _e=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')});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 Fe=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,b=class extends Fe{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 C=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)}},G=class extends C{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))}};G.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 ue(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function se(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 ce(e,t,r){return t&&se(e.prototype,t),r&&se(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function xe(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&&$(e,t)}function k(e){return k=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},k(e)}function $(e,t){return $=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},$(e,t)}function le(){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 P(e,t,r){return le()?P=Reflect.construct.bind():P=function(i,o,a){var s=[null];s.push.apply(s,o);var u=Function.bind.apply(i,s),l=new u;return a&&$(l,a.prototype),l},P.apply(null,arguments)}function Re(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Y(e){var t=typeof Map=="function"?new Map:void 0;return Y=function(n){if(n===null||!Re(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 P(n,arguments,k(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),$(i,n)},Y(e)}function Ce(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function De(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 Ce(e)}function Oe(e){var t=le();return function(){var n=k(e),i;if(t){var o=k(this).constructor;i=Reflect.construct(n,arguments,o)}else i=n.apply(this,arguments);return De(this,i)}}function Pe(e){return ke(e)||$e(e)||de(e)||Te()}function ke(e){if(Array.isArray(e))return V(e)}function $e(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function de(e,t){if(e){if(typeof e=="string")return V(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 V(e,t)}}function V(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 Te(){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 Me(e,t){var r=typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=de(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
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 Z(e,t){return t=t.slice(),t.unshift(e),t}var Le=function(e){xe(r,e);var t=Oe(r);function r(n){var i;return ue(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 ce(r)}(Y(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 Le(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 A=i._getPreferredOutput(p);return s&&Array.isArray(A)?d=d.concat(A):d.push(A),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(Se){d.push(Se)}):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 A=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(A,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(Z(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,w=c.slice(1,-2);switch(w){case"scalar":(!t||!["object","function"].includes(g(t)))&&(v=!0);break;case"boolean":case"string":case"undefined":case"function":g(t)===w&&(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)===w&&(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 "+w)}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 Ae=c.split(","),B=Me(Ae),ae;try{for(B.s();!(ae=B.n()).done;){var we=ae.value;p(this._trace(Z(we,h),t,r,n,i,o,!0))}}catch(y){B.e(y)}finally{B.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 j=d[x];if(j&&j.isParentSelector){var O=this._trace(j.expr,t,j.path,n,i,o,a);if(Array.isArray(O)){d[x]=O[0];for(var Ee=O.length,K=1;K<Ee;K++)x++,d.splice(x,0,O[K])}else d[x]=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&&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 A=this._trace(Z(p,t),r,n,i,o,a,!0);A.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 Ne=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])}},Be=function(){function e(t){ue(this,e),this.code=t}return ce(e,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),o=[];Ne(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 P(Function,i.concat([l])).apply(void 0,Pe(a))}}]),e}();f.prototype.vm={Script:Be};function je(e){return e.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function he(e){return je(e)+".*"}function X(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 Q(e,t={},r){return r?`<${r}${Object.entries(t).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${T(e)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):T(e)}function T(e){var t;if(Array.isArray(e))return e.map(T).join(`
|
|
4
4
|
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return Q(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>Q(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 Q(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}function Ue(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&U(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&Ie(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function Ie(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];U(i,i.getAttribute("data-embed-src"))}if(t)return Ue(e)}function U(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 pe(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 He(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=pe(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 M(e,t,r,n){var i;if(e){var o=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=T(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")U(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];M(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))&&M(e,h[l],null,n);M(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 fe=["data-attributes-keys","data-path-attributes","data-path-scope"];function E(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=pe(s),p=X(t,c,!1)||[];d==0&&He(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,[he(c)]:p[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,p)=>fe.indexOf(d.name)-fe.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"&&M(s,d,X(t,p,!0),r),d=="data-embed-src"&&M(s,d,s.getAttribute(d),r)}}for(var u=0,l;l=s.childNodes[u++];)ye(l)&&E(l,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function ye(e){return e.nodeType==1}function L(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++];)ye(u)&&(u.className=u.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return E(e,r,n)}function dt(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}=_e("linkedom"),{document:s}=a(o);return E(s,t,r).toString()}else{let a=document.createElement("div");return a.innerHTML=o,E(a,t,r),a.innerHTML}}var ve=["initial","check","updated"],I={};function pt(){I={}}async function me(e,t,r,n,i=I){return D({url:e,options:t,validator:r,callback:n,cache:i}).then(H).then(o=>o.response)}function We(e,t=!1){let r=String(e).replace("?head","");var n=I[r];return!n&&!t&&(n=I[r]={phase:null,initial:_(),check:_(),updated:_(),final:_()}),n}async function D({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=We(e);if(ve.indexOf(s.phase)>=ve.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 H(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:s}=await D({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 ee(e)}return e}async function ee(e){return D({...e,options:{...e.options,cache:"reload"}},"updated")}var S="https://feaas.blob.core.windows.net";function W(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 mt(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=S?`${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 bt(e){return`${e.cdn&&e.cdn!=S?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function te(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=W(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 be(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...W(e.src)}),`${e.cdn||e.hostname||S}/components/${e.library}/${e.component}/${e.version}/${e.revision||"published"}.html`}function z(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...te(e.src)}),`${e.cdn||e.hostname||S}/styles/${e.library}/${e.revision||"published"}.css`}async function N(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&&D({options:{headers:{Accept:"text/html"},credentials:"omit"},url:be({...e,version:e.instance}),validator:n}).catch(s=>s),D({url:be(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:H({...a,callback:i}).catch(s=>{if(o[0]==a&&(ee({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),H({...o[1],callback:i});throw s})}async function gt(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await N(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function re(e,t){return typeof e=="string"&&(e={src:e}),me(z(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 Et(e,t){return ze(e,t||(t=document.createElement("style"))),t}function ze(e,t){return t||(t=document.createElement("style")),re(e,(r,n)=>{t.textContent=r}).then(()=>t)}function ne(e,t){var r=Je(e);if(!r)var n=qe(e);return re(e,(i,o)=>{n&&(n.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function ge(e){return new Promise((t,r)=>{ne(e,t).catch(r)})}function Je(e){return document.head.querySelector(`style[data-href="${z(e)}"]`)}function qe(e){let t=z(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function xt(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return E(n,t),r}function Rt(e,t){return Ke(e,t||(t=document.createElement("div"))),t}async function Ke(e,t){return t||(t=document.createElement("div")),t.childNodes.length?E(t,e.data,e):"template"in e?L(t,e.template,e.data,e):N(e,r=>L(t,r,e.data,e)).then(()=>t)}function Ge(e=this){var t,r,n,i,o,a,s,u;let l,c=e.getAttribute("src");if(c){let F=W(c);if(!F)throw new Error(`Could not parse FEAAS Component source: ${c}`);var{cdn:h,library:d,component:p,version:A,revision:v}=F}let w=e.getAttribute("data");if(w!=null&&w!="")try{l=typeof w=="string"?JSON.parse(w):{}}catch(F){}return{data:l||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:S,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:A)!==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 J=class extends b{setData(t){this.set({data:t})}getProps(){return Ge(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:S,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=ge({...this.props,revision:"published"}).then(()=>{t=null,this.payload&&this.onLoad(this.payload)});return Promise.all([t,N(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)E(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;L(this,this.payload,this.props.data)}}};J.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];J.register("feaas-component");function Ye(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 q=class extends b{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Ye(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=`
|