@sitecore-feaas/clientside 0.3.13 → 0.3.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/FEAASComponent.js +2 -0
- package/build/components/FEAASComponent.js.map +1 -1
- package/build/ui/FEAASExternal.js +6 -2
- package/build/ui/FEAASExternal.js.map +1 -1
- package/build/ui/react.js +2 -0
- package/build/ui/react.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 +5 -5
- package/dist/browser/react.cjs.map +2 -2
- package/dist/browser/react.esm.js +5 -5
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +4 -4
- package/dist/node/headless.cjs.map +3 -3
- package/dist/node/headless.esm.js +4 -4
- package/dist/node/headless.esm.js.map +3 -3
- 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 +4 -4
- package/dist/node/react.cjs.map +2 -2
- package/dist/node/react.esm.js +4 -4
- package/dist/node/react.esm.js.map +2 -2
- package/headless.cjs +4 -4
- package/headless.cjs.map +3 -3
- package/headless.js +4 -4
- package/headless.js.map +3 -3
- package/package.json +1 -1
- package/react.cjs +5 -5
- package/react.cjs.map +2 -2
- package/react.js +5 -5
- package/react.js.map +2 -2
- package/src/components/FEAASComponent.tsx +2 -1
- package/src/ui/FEAASExternal.tsx +9 -2
- package/src/ui/react.tsx +2 -0
- package/test/ServerComponent.test.tsx +8 -8
- package/types/components/FEAASComponent.d.ts.map +1 -1
- package/types/tsbuildinfo +1 -1
- package/types/ui/FEAASExternal.d.ts.map +1 -1
- package/types/ui/react.d.ts.map +1 -1
- package/types/ui/tsbuildinfo +1 -1
package/dist/browser/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var Lt=Object.defineProperty;var Ve=Object.getOwnPropertyDescriptor;var ze=Object.getOwnPropertyNames;var Je=Object.prototype.hasOwnProperty;var J=(t,e)=>{for(var r in e)Lt(t,r,{get:e[r],enumerable:!0})},qe=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ze(e))!Je.call(t,i)&&i!==r&&Lt(t,i,{get:()=>e[i],enumerable:!(n=Ve(e,i))||n.enumerable});return t};var Ge=t=>qe(Lt({},"__esModule",{value:!0}),t);var mr={};J(mr,{Component:()=>rt,ComponentProps:()=>oe,Context:()=>U,ControlledPromise:()=>C,DEFAULT_CDN_URL:()=>N,DOM:()=>yt,DataPath:()=>vt,DataScope:()=>ft,DataSettings:()=>R,Element:()=>E,FEAASComponent:()=>rt,FEAASComponentsProps:()=>oe,FEAASContext:()=>U,FEAASContextProps:()=>pe,FEAASEditor:()=>it,FEAASEditorProps:()=>ce,FEAASElement:()=>E,FEAASLoader:()=>nt,FEAASLoaderProps:()=>se,FEAASPicker:()=>ot,FEAASPickerProps:()=>he,FEAASStylesheet:()=>xt,FEAASStylesheetProps:()=>ae,InvalidResponse:()=>gt,JSONPath:()=>f,Loader:()=>nt,MyComponent:()=>ut,Picker:()=>ot,Stylesheet:()=>xt,Thumbnail:()=>Ct,WebComponent:()=>$t,adjustNumbers:()=>Kt,autoloadScripts:()=>zt,cleanCollectionBit:()=>Y,clearFetchCache:()=>Ne,createStylesheet:()=>re,fetchAndRevalidate:()=>X,fetchAndRevalidateComponent:()=>z,fetchAndRevalidateStylesheet:()=>wt,fetchBypassingCache:()=>bt,fetchCache:()=>Q,fetchComponent:()=>Te,fetchData:()=>Nt,fetchToValidateCache:()=>Z,fetchWithCacheAwareness:()=>I,findStylesheet:()=>ee,getComponentSource:()=>Oe,getComponentURL:()=>_t,getFetchCache:()=>Zt,getFramePosition:()=>ue,getHumanizedLabel:()=>Yt,getLastPathBit:()=>Qt,getQualifier:()=>Gt,getStylesheetSource:()=>Pe,getStylesheetURL:()=>et,loadScript:()=>K,loadStylesheet:()=>Et,loadStylesheetAllowStale:()=>Dt,normalizeCollectionScope:()=>mt,observeDOMElement:()=>Vt,parseComponentSource:()=>tt,parseLimit:()=>Jt,parseRange:()=>qt,parseStylesheetSource:()=>At,queryObject:()=>H,queryObjectRaw:()=>Rt,queryScopes:()=>G,renderComponent:()=>Ft,renderComponentElement:()=>Le,renderComponentPromise:()=>ne,renderDOMContent:()=>j,renderDOMElement:()=>D,renderHTMLContent:()=>Xt,renderStylesheet:()=>Me,renderStylesheetPromise:()=>te,serializeCH1RichText:()=>L,setDOMAttribute:()=>$});module.exports=Ge(mr);var fe={};J(fe,{Component:()=>rt,ComponentProps:()=>oe,Context:()=>U,ControlledPromise:()=>C,DEFAULT_CDN_URL:()=>N,DOM:()=>yt,DataPath:()=>vt,DataScope:()=>ft,DataSettings:()=>R,Element:()=>E,FEAASComponent:()=>rt,FEAASComponentsProps:()=>oe,FEAASContext:()=>U,FEAASContextProps:()=>pe,FEAASEditor:()=>it,FEAASEditorProps:()=>ce,FEAASElement:()=>E,FEAASLoader:()=>nt,FEAASLoaderProps:()=>se,FEAASPicker:()=>ot,FEAASPickerProps:()=>he,FEAASStylesheet:()=>xt,FEAASStylesheetProps:()=>ae,InvalidResponse:()=>gt,JSONPath:()=>f,Loader:()=>nt,MyComponent:()=>ut,Picker:()=>ot,Stylesheet:()=>xt,Thumbnail:()=>Ct,WebComponent:()=>$t,adjustNumbers:()=>Kt,autoloadScripts:()=>zt,cleanCollectionBit:()=>Y,clearFetchCache:()=>Ne,createStylesheet:()=>re,fetchAndRevalidate:()=>X,fetchAndRevalidateComponent:()=>z,fetchAndRevalidateStylesheet:()=>wt,fetchBypassingCache:()=>bt,fetchCache:()=>Q,fetchComponent:()=>Te,fetchData:()=>Nt,fetchToValidateCache:()=>Z,fetchWithCacheAwareness:()=>I,findStylesheet:()=>ee,getComponentSource:()=>Oe,getComponentURL:()=>_t,getFetchCache:()=>Zt,getFramePosition:()=>ue,getHumanizedLabel:()=>Yt,getLastPathBit:()=>Qt,getQualifier:()=>Gt,getStylesheetSource:()=>Pe,getStylesheetURL:()=>et,loadScript:()=>K,loadStylesheet:()=>Et,loadStylesheetAllowStale:()=>Dt,normalizeCollectionScope:()=>mt,observeDOMElement:()=>Vt,parseComponentSource:()=>tt,parseLimit:()=>Jt,parseRange:()=>qt,parseStylesheetSource:()=>At,queryObject:()=>H,queryObjectRaw:()=>Rt,queryScopes:()=>G,renderComponent:()=>Ft,renderComponentElement:()=>Le,renderComponentPromise:()=>ne,renderDOMContent:()=>j,renderDOMElement:()=>D,renderHTMLContent:()=>Xt,renderStylesheet:()=>Me,renderStylesheetPromise:()=>te,serializeCH1RichText:()=>L,setDOMAttribute:()=>$});function C(t,e=r=>{}){var r;let n=()=>{var i,s;let o=new Promise((l,u)=>{i=d=>{t==null||t(d),l(d)},s=u});var a=Object.assign(o,{resolve:i,reject:s,restart:n,first:r});return r=a,a.catch(e),a};return n()}var $t=typeof HTMLElement=="undefined"?typeof windowJSDOM!="undefined"?windowJSDOM.HTMLElement:class{}:HTMLElement,E=class extends $t{getProps(e){return{}}constructor(){super(),this.defaultProps={},this.connected=!1,this.refs={},this.descendants=[],this.whenLoaded=C(e=>{this.payload=e}),this.whenRendered=C(()=>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.dispatchEventIndirectly(new Event("feaasMount",{bubbles:!0,composed:!0})),this.getElements().map(r=>{var n;return(n=r.mount)===null||n===void 0?void 0:n.call(r)}),this.set()}catch(e){this.onError(e)}}dispatchEventIndirectly(e){this.dispatchEvent(e);let r=this.getParent();r&&!r.contains(this)&&(Object.defineProperty(e,"target",{value:this,writable:!1}),Object.defineProperty(e,"composedPath",{value:()=>[this],writable:!1}),r.handleEvent(e))}isJSONAttribute(e){return!1}log(...e){if(typeof process!="undefined"&&process.env.TESTING)return;let r=e[0];(typeof location!="undefined"&&(location!=null&&location.hostname.startsWith("components-"))||localStorage["Sitecore.Components.Debug"])&&console.log(r+" "+e.slice(1).map(n=>n&&typeof n=="object"?"%O":"%s").join(" "),...e.slice(1))}unmount(){this.connected&&(this.log("FEAAS: Unmount",this),this.dispatchEventIndirectly(new Event("feaasUnmount",{bubbles:!0,composed:!0})),this.connected=!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;if(this.tagName!="FEAAS-CONTEXT")return document.querySelector("feaas-context")}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 s=e.refs.parent;s;s=s.refs.parent)s.render&&((n=e.refs).parentReact||(n.parentReact=s),e.refs.topReact=s)}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.dispatchEventIndirectly(i),this.whenLoaded.reject(e),!i.defaultPrevented&&!n){this.whenRendered.reject(e);try{this.unmount()}catch(s){}return!0}return!1}shouldUpdateOnLoad(){return!0}async advance(){try{if(this.payload===void 0){if(!this.isReadyToLoad())return;this.payload=null,this.dispatchEventIndirectly(new Event("feaasLoad",{bubbles:!0,composed:!0}));let 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;if(!this.connected)return;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:s,ReactDOMClient:o}=this.payload||{};if(!i)throw new Error(`${this.tagName}: React is not present in payload`);if(!s)throw new Error(`${this.tagName}: ReactDOM is not present in payload`);this.getAttribute("hydrate")!="false"&&(!this.refs.topReact&&!this.forceUpdateReact?o?(this.reactRoot||(this.reactRoot=o.createRoot(this.getReactRootElement())),this.reactRoot.render(this.getReactElement())):s.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,s)=>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(o){return{error:o}}componentDidCatch(o,a){console.error(`FEAAS: ${e.tagName} Error:`,o,a),e.onError(o,"react")}render(){if(!this.state.error)return this.props.children}})}getReactElement(e=this,r){let{React:n,ReactDOM:i}=e.payload||{},s=this.getReactErrorBoundary(),o=this.getReactWrapper(e);return n.createElement(s,{key:e.tagName+"-"+e.getUID(),slot:e.getAttribute("slot")},n.createElement(o,null))}getReactWrapper(e=this,r=e.tagName){if(e.reactWrapper)return e.reactWrapper;let{React:n,ReactDOM:i}=e.payload||{};return e.reactWrapper=s=>{if(e.render){let[o,a]=n.useReducer(l=>l+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 i=this.isJSONAttribute(r),s=this.props[r],o=i?JSON.stringify(s):String(s),a=this.defaultProps[r],l=i?JSON.stringify(a):String(a),u=r.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),d=this.getAttribute(u);try{var n=i?JSON.stringify(JSON.parse(d)):d}catch(p){var n=null}s==null||o===l?this.removeAttribute(u):(typeof s=="string"||typeof s=="number"||typeof s=="boolean"||i)&&n!=o&&this.setAttribute(u,o)}}catch(i){this.whenRendered.reject(i),this.onError(i,"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 q=class extends E{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)}},ut=class extends q{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(s=>s+1)},[e]),r.createElement(r.Fragment,null,r.createElement("p",null,"Rendering attribute: ",e),r.createElement("p",null,"Triggered updates: ",n))}};ut.observedAttributes=["counter"];var yt={};J(yt,{renderDOMContent:()=>j,renderDOMElement:()=>D,renderHTMLContent:()=>Xt,setDOMAttribute:()=>$});var ft={};J(ft,{JSONPath:()=>f,queryObject:()=>H,queryObjectRaw:()=>Rt,queryScopes:()=>G,serializeCH1RichText:()=>L});function P(t){return P=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},P(t)}function Ae(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function be(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 we(t,e,r){return e&&be(t.prototype,e),r&&be(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&&pt(t,e)}function ht(t){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},ht(t)}function pt(t,e){return pt=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},pt(t,e)}function Ee(){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 ct(t,e,r){return Ee()?ct=Reflect.construct.bind():ct=function(i,s,o){var a=[null];a.push.apply(a,s);var l=Function.bind.apply(i,a),u=new l;return o&&pt(u,o.prototype),u},ct.apply(null,arguments)}function Ye(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function jt(t){var e=typeof Map=="function"?new Map:void 0;return jt=function(n){if(n===null||!Ye(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 ct(n,arguments,ht(this).constructor)}return i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),pt(i,n)},jt(t)}function Qe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Xe(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 Qe(t)}function Ze(t){var e=Ee();return function(){var n=ht(t),i;if(e){var s=ht(this).constructor;i=Reflect.construct(n,arguments,s)}else i=n.apply(this,arguments);return Xe(this,i)}}function tr(t){return er(t)||rr(t)||xe(t)||nr()}function er(t){if(Array.isArray(t))return It(t)}function rr(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function xe(t,e){if(t){if(typeof t=="string")return It(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 It(t,e)}}function It(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 nr(){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 ir(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=xe(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(l){throw l},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 s=!0,o=!1,a;return{s:function(){r=r.call(t)},n:function(){var l=r.next();return s=l.done,l},e:function(l){o=!0,a=l},f:function(){try{!s&&r.return!=null&&r.return()}finally{if(o)throw a}}}}var S=Object.prototype.hasOwnProperty;function W(t,e){return t=t.slice(),t.push(e),t}function Ut(t,e){return e=e.slice(),e.unshift(t),e}var or=function(t){Ke(r,t);var e=Ze(r);function r(n){var i;return Ae(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 we(r)}(jt(Error));function f(t,e,r,n,i){if(!(this instanceof f))try{return new f(t,e,r,n,i)}catch(l){if(!l.avoidNew)throw l;return l.value}typeof t=="string"&&(i=n,n=r,r=e,e=t,t=null);var s=t&&P(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=S.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 o={path:s?t.path:e};s?"json"in t&&(o.json=t.json):o.json=r;var a=this.evaluate(o);if(!a||P(a)!=="object")throw new or(a);return a}}f.prototype.evaluate=function(t,e,r,n){var i=this,s=this.parent,o=this.parentProperty,a=this.flatten,l=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,r=r||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,e=e||this.json,t=t||this.path,t&&P(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(!S.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var u=t;e=u.json,a=S.call(t,"flatten")?t.flatten:a,this.currResultType=S.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=S.call(t,"sandbox")?t.sandbox:this.currSandbox,l=S.call(t,"wrap")?t.wrap:l,this.currPreventEval=S.call(t,"preventEval")?t.preventEval:this.currPreventEval,r=S.call(t,"callback")?t.callback:r,this.currOtherTypeCallback=S.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,s=S.call(t,"parent")?t.parent:s,o=S.call(t,"parentProperty")?t.parentProperty:o,t=t.path}if(s=s||null,o=o||null,Array.isArray(t)&&(t=f.toPathString(t)),!(!t&&t!==""||!e)){var d=f.toPathArray(t);d[0]==="$"&&d.length>1&&d.shift(),this._hasParentSelector=null;var p=this._trace(d,e,["$"],s,o,r).filter(function(c){return c&&!c.isParentSelector});return p.length?!l&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(c,h){var y=i._getPreferredOutput(h);return a&&Array.isArray(y)?c=c.concat(y):c.push(y),c},[]):l?[]: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,s,o,a){var l=this,u;if(!t.length)return u={path:r,value:e,parent:n,parentProperty:i,hasArrExpr:o},this._handleCallback(u,s,"value"),u;var d=t[0],p=t.slice(1),c=[];function h(b){Array.isArray(b)?b.forEach(function(g){c.push(g)}):c.push(b)}if((typeof d!="string"||a)&&e&&S.call(e,d))h(this._trace(p,e[d],W(r,d),e,d,s,o));else if(d==="*")this._walk(e,function(b){h(l._trace(p,e[b],W(r,b),e,b,s,!0,!0))});else if(d==="..")h(this._trace(p,e,r,n,i,s,o)),this._walk(e,function(b){P(e[b])==="object"&&h(l._trace(t.slice(),e[b],W(r,b),e,b,s,!0))});else{if(d==="^")return this._hasParentSelector=!0,{path:r.slice(0,-1),expr:p,isParentSelector:!0};if(d==="~")return u={path:W(r,d),value:i,parent:n,parentProperty:null},this._handleCallback(u,s,"property"),u;if(d==="$")h(this._trace(p,e,r,null,null,s,o));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(d))h(this._slice(d,p,e,r,n,i,s));else if(d.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");var y=d.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(b){l._eval(y,e[b],b,r,n,i)&&h(l._trace(p,e[b],W(r,b),e,b,s,!0))})}else if(d[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");h(this._trace(Ut(this._eval(d,e,r[r.length-1],r.slice(0,-1),n,i),p),e,r,n,i,s,o))}else if(d[0]==="@"){var m=!1,A=d.slice(1,-2);switch(A){case"scalar":(!e||!["object","function"].includes(P(e)))&&(m=!0);break;case"boolean":case"string":case"undefined":case"function":P(e)===A&&(m=!0);break;case"integer":Number.isFinite(e)&&!(e%1)&&(m=!0);break;case"number":Number.isFinite(e)&&(m=!0);break;case"nonFinite":typeof e=="number"&&!Number.isFinite(e)&&(m=!0);break;case"object":e&&P(e)===A&&(m=!0);break;case"array":Array.isArray(e)&&(m=!0);break;case"other":m=this.currOtherTypeCallback(e,r,n,i);break;case"null":e===null&&(m=!0);break;default:throw new TypeError("Unknown value type "+A)}if(m)return u={path:r,value:e,parent:n,parentProperty:i},this._handleCallback(u,s,"value"),u}else if(d[0]==="`"&&e&&S.call(e,d.slice(1))){var w=d.slice(1);h(this._trace(p,e[w],W(r,w),e,w,s,o,!0))}else if(d.includes(",")){var B=d.split(","),T=ir(B),M;try{for(T.s();!(M=T.n()).done;){var St=M.value;h(this._trace(Ut(St,p),e,r,n,i,s,!0))}}catch(b){T.e(b)}finally{T.f()}}else!a&&e&&S.call(e,d)&&h(this._trace(p,e[d],W(r,d),e,d,s,o,!0))}if(this._hasParentSelector)for(var v=0;v<c.length;v++){var _=c[v];if(_&&_.isParentSelector){var F=this._trace(_.expr,e,_.path,n,i,s,o);if(Array.isArray(F)){c[v]=F[0];for(var Ot=F.length,st=1;st<Ot;st++)v++,c.splice(v,0,F[st])}else c[v]=F}}return c};f.prototype._walk=function(t,e){if(Array.isArray(t))for(var r=t.length,n=0;n<r;n++)e(n);else t&&P(t)==="object"&&Object.keys(t).forEach(function(i){e(i)})};f.prototype._slice=function(t,e,r,n,i,s,o){if(Array.isArray(r)){var a=r.length,l=t.split(":"),u=l[2]&&Number.parseInt(l[2])||1,d=l[0]&&Number.parseInt(l[0])||0,p=l[1]&&Number.parseInt(l[1])||a;d=d<0?Math.max(0,d+a):Math.min(a,d),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var c=[],h=d;h<p;h+=u){var y=this._trace(Ut(h,e),r,n,i,s,o,!0);y.forEach(function(m){c.push(m)})}return c}};f.prototype._eval=function(t,e,r,n,i,s){this.currSandbox._$_parentProperty=s,this.currSandbox._$_parent=i,this.currSandbox._$_property=r,this.currSandbox._$_root=this.json,this.currSandbox._$_v=e;var o=t.includes("@path");o&&(this.currSandbox._$_path=f.toPathString(n.concat([r])));var a="script:"+t;if(!f.cache[a]){var l=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");o&&(l=l.replace(/@path/g,"_$_path")),f.cache[a]=new this.vm.Script(l)}try{return f.cache[a].runInNewContext(this.currSandbox)}catch(u){throw new Error("jsonPath: "+u.message+": "+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(s,o){return"[#"+(r.push(o)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(s,o){return"['"+o.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(s,o){return";"+o.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),i=n.split(";").map(function(s){var o=s.match(/#([0-9]+)/);return!o||!o[1]?s:r[o[1]]});return e[t]=i,e[t].concat()};var sr=function(e,r,n){for(var i=e.length,s=0;s<i;s++){var o=e[s];n(o)&&r.push(e.splice(s--,1)[0])}},ar=function(){function t(e){Ae(this,t),this.code=e}return we(t,[{key:"runInNewContext",value:function(r){var n=this.code,i=Object.keys(r),s=[];sr(i,s,function(d){return typeof r[d]=="function"});var o=i.map(function(d,p){return r[d]}),a=s.reduce(function(d,p){var c=r[p].toString();return/function/.test(c)||(c="function "+c),"var "+p+"="+c+";"+d},"");n=a+n,!/(["'])use strict\1/.test(n)&&!i.includes("arguments")&&(n="var arguments = undefined;"+n),n=n.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var l=n.lastIndexOf(";"),u=l>-1?n.slice(0,l+1)+" return "+n.slice(l+1):" return "+n;return ct(Function,i.concat([u])).apply(void 0,tr(o))}}]),t}();f.prototype.vm={Script:ar};function Rt(t,e){try{return f({path:e,json:t})}catch(r){return[]}}function H(t,e){var r;return((r=Rt(t,e))===null||r===void 0?void 0:r.flat(1/0))||[]}function G(t,e,r=!1,n=t){var i=e;let s=Object.keys(t).sort((a,l)=>l.length-a.length);for(let a of s)if(e.startsWith(a)){if(a==e){if(r)return t[a];continue}i=e.substring(a.length+1),n=t[a];break}var o=H(n,i);return Array.isArray(o)&&(o==null?void 0:o.length)==0&&(o=[i.replace(/^.*?\./,"_."),i.replace(/^.*?\./,""),i.replace(/^([^.]+).*?\.\$([\.\[])/,"$1$2"),i.replace(/^.*?\.\$([\.\[])/,"_$1"),i.replace(/^.*?\.\$([\.\[])/,"$$$1"),i.replace(/^[^.]+$/,"_")].filter((a,l,u)=>u.indexOf(a)===l).reduce((a,l)=>a.length>0?a:H(n,l),[])),r&&Array.isArray(o)?o[0]:o}function Bt(t,e={},r){return r?`<${r}${Object.entries(e).map(([n,i])=>i!=null&&` ${n}="${i}"`).filter(Boolean).join("")}>${L(t)}</${r}>`.replace(/^<([a-z0-9][^>]*)><\/[^>]+>$/,"<$1 />"):L(t)}function L(t){var e;if(Array.isArray(t))return t.map(L).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 Bt(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,s)=>Bt(i,s.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[s.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return Bt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var V=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new V(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 localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return Wt(this.childNodes)}set innerHTML(e){this.childNodes=Ht(String(e!=null?e:""))}get outerHTML(){return Wt([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Ce(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=s=>{for(let o of r)if(Ce(o,s)){n.push(s);break}for(let o of s.childNodes)i(o)};for(let s of this.childNodes)i(s);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 s=i+e;s>=0&&s<n.length;s+=e){let o=n[s];if(!r||o.nodeType===1)return o}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 V(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 Ce(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 s=i[1],o=i[3],a=e.getAttribute(s);if(typeof o=="undefined"){if(a===void 0)return!1}else if(a!==o)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function Ht(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),s=t.match(/^<\/([\w-]+)>/);if(i){let o=i[1],l=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(d=>{let[p,c,,h]=d.match(/([\w-]+)(="([^"]*)")?/);return{name:c,value:dr(h||"")}}))||[],u=new V(o,1);if(u.attributes=l,n.length>0){let d=n[n.length-1];d.childNodes.push(u),u.parentNode=d}else r.push(u);n.push(u),t=t.slice(i[0].length)}else if(s)n.pop(),t=t.slice(s[0].length);else{let o=t.indexOf("<"),a=t.slice(0,o!==-1?o:void 0),l=new V("#text",3);if(l.textContent=a,n.length>0){let u=n[n.length-1];u.childNodes.push(l),l.parentNode=u}else r.push(l);t=t.slice(a.length)}}return r}function lr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Wt(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:o,value:a})=>` ${o}="${lr(String(a))}"`).join(""),s=Wt(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function Vt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&K(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&zt(o,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function zt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];K(i,i.getAttribute("data-embed-src"))}if(e)return Vt(t)}function K(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 s=r.ownerDocument.createElement("script");s.setAttribute("type","module"),s.setAttribute("src",e),r.appendChild(s);break}}var vt={};J(vt,{adjustNumbers:()=>Kt,cleanCollectionBit:()=>Y,getHumanizedLabel:()=>Yt,getLastPathBit:()=>Qt,getQualifier:()=>Gt,normalizeCollectionScope:()=>mt,parseLimit:()=>Jt,parseRange:()=>qt});var Jt=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},qt=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Gt=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function Y(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function mt(t){return Y(t)+".*"}function Kt(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+e)))}function Yt(t,e=2){var r=Y(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-e).join(" ")}function Qt(t){return Y(t).split(".").pop()}var ur=["January","February","March","April","May","June","July","August","September","October","November","December"],Se=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=ur[t.getMonth()],n=t.getDate();return`${r} ${n}, ${e}`},Re=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function De(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 cr(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=De(t);if(i!=0)return;let s=t.parentNode;if(s!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var o=i+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(o++,a=l);for(var u=o;u<e;u++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var u=Math.max(1,e);u<o;u++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function $(t,e,r,n){var i,s;if(!t)return;var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=L(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let m=Array.from(t.children).find(A=>A.localName=="picture")||t;o=t.localName=="img"?t:m.querySelector("img, video")}else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")K(t,r);else if(e=="data-path-attributes"){let m=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var u=r[l];$(t,l,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var d=0;d<m.length;d++)(r==null||!(m[d]in r))&&$(t,m[d],null,n);$(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!o)return;if((a=="innerHTML"||a=="src")&&(r==null||r==="")){var c=String((s=t.getAttribute("data-path-placeholder")||o[a])!==null&&s!==void 0?s:o.getAttribute(a));a=="innerHTML"?o.innerHTML=c:c?o.setAttribute(a,c):o.removeAttribute(a)}else if(r!=null)if(a=="innerHTML"){for(var h=String(r),y=o;y.parentElement&&y.localName.match(/^(a|var|strong|em|i|b)$/);)y=y.parentElement;y.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(y.getAttribute("class")).includes("-inline--time")&&Re(h)&&(h=Se(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(a)!=r&&o.setAttribute(a,r);else o.removeAttribute(a)}var _e=["data-attributes-keys","data-path-attributes","data-path-scope"];function D(t,e,r,n){var i,s,o;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 d=a.getAttribute("data-path-scope");if(d){let c=De(a),h=G(e,d,!1);c==0&&cr(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,h))===!1?1:h.length,r),e={...e,[mt(d)]:h[c]}}let p=Array.prototype.slice.call(a.attributes).sort((c,h)=>_e.indexOf(c.name)-_e.indexOf(h.name));for(var l=0;l<p.length;l++){let{name:c,value:h}=p[l];c.startsWith("data-path")&&c!="data-path-scope"&&$(a,c,G(e,h,!0),r),c=="data-embed-src"&&$(a,c,a.getAttribute(c),r)}}for(var l=0,u;u=a.childNodes[l++];)Fe(u)&&D(u,e,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,e),a}function Fe(t){return t.nodeType==1}function j(t,e,r,n){var i;let s=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=s,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,l;l=t.childNodes[a++];)Fe(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return D(t,r,n)}function Xt(t,e,r,n=!1){var i;let s=((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 o=Ht(s);return D(o[0],e,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,D(o,e,r),o.innerHTML}}var ke=["initial","check","updated"],Q={};function Ne(){Q={}}async function X(t,e,r,n,i=Q){return I({url:t,options:e,validator:r,callback:n,cache:i}).then(Z).then(s=>s.response)}function Zt(t,e=!1){let r=String(t).replace("?head","");var n=Q[r];return!n&&!e&&(n=Q[r]={phase:null,initial:C(),check:C(),updated:C(),final:C()}),n}var gt=class extends Error{};async function I({url:t,options:e,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=Zt(t);if(ke.indexOf(a.phase)>=ke.indexOf(s))var l=a[s];else a.phase=s}let u=await(l||fetch(t,e));if(!l&&a&&(u.ok?a[s].resolve(u):a[s].reject(new Error("Fetch failed"))),!u.ok)throw new Error("Fetch failed");let d=new Date(u.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(u,d))===!1)throw new gt("Response is not valid");return await(n==null?void 0:n(u,s,d)),{url:t,options:e,isCached:d,response:u,validator:r,callback:n,cache:i}}async function Z(t){let{url:e,isCached:r,options:n,validator:i,response:s,cache:o}=t;if(r){let{response:a}=await I({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(a.headers.get("last-modified")!=s.headers.get("last-modified"))return bt(t)}return t}async function bt(t){return I({...t,options:{...t.options,cache:"reload"}},"updated")}var N="https://feaas.blob.core.windows.net";function tt(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,s,o]=e;return{cdn:r,library:n,component:i,version:s,revision:o}}}function Oe(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=N?`${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 Pe(t){return`${t.cdn&&t.cdn!=N?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function At(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 s=tt(t);if(s){var{cdn:r,library:n,revision:i}=s;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function _t(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...tt(t.src)}),`${t.cdn||t.hostname||N}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function et(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...At(t.src)}),`${t.cdn||t.hostname||N}/styles/${t.library}/${t.revision||"published"}.css`}async function z(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),s=await Promise.all([t.instance&&I({options:{headers:{Accept:"text/html"},credentials:"omit"},url:_t({...t,version:t.instance}),validator:n}).catch(a=>a),I({url:_t(t),validator:n}).catch(a=>a)]),o=s.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw s.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return s[0]==o&&console.log("Using fork!",s),await i(o.response),r?o:Z({...o,callback:i}).catch(a=>{if(s[0]==o&&(bt({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),Z({...s[1],callback:i});throw a})}async function Te(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await z(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function wt(t,e){return typeof t=="string"&&(t={src:t}),X(et(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 Me(t,e){return te(t,e||(e=document.createElement("style"))),e}function te(t,e){return e||(e=document.createElement("style")),wt(t,(r,n)=>{e.textContent=r}).then(()=>e)}function Et(t,e){var r=ee(t);if(!r)var n=re(t);return wt(t,(i,s)=>{n&&(n.textContent=i),e==null||e(i,s)}).then(()=>r||n)}function Dt(t){return new Promise((e,r)=>{Et(t,e).catch(r)})}function ee(t){return document.head.querySelector(`style[data-href="${et(t)}"]`)}function re(t){let e=et(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function Le(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return D(n,e),r}function Ft(t,e){return ne(t,e||(e=document.createElement("div"))),e}async function ne(t,e){return e||(e=document.createElement("div")),e.childNodes.length?D(e,t.data,t):"template"in t?j(e,t.template,t.data,t):z(t,r=>j(e,r,t.data,t)).then(()=>e)}function hr(t){let{params:e,method:r,headers:n,body:i,url:s}=R(t);var o={url:s},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(o.headers=a),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(e).length>0&&(o={...o,params:e}),o}var kt=t=>{if(typeof t.url!="string")return!1;for(var e in t)if(!(e=="body"||e=="params"||e=="headers"||e=="url"||e==="method"||e=="jsonpath"&&typeof t[e]=="string"))return!1;return!0};function $e(t){let{url:e,headers:r,params:n,method:i,body:s}=R(t),o,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(o=JSON.stringify(s)),a==="multipart/form-data"&&(o=Object.keys(s).reduce((u,d)=>(u.append(d,s[d]),u),new FormData)),a==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(s)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${e}${l}`,{headers:r,body:o,method:i}]}function R(t){let e={};for(let r in(t==null?void 0:t.headers)||{})if(t.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());e[n]=t.headers[r]}return e.Accept||(e.Accept="application/json"),{params:(t==null?void 0:t.params)||{},headers:e,jsonpath:String((t==null?void 0:t.jsonpath)||"$"),method:((t==null?void 0:t.method)||"GET").toUpperCase(),body:(t==null?void 0:t.body)||{},url:String((t==null?void 0:t.url)||"")}}var ie=async t=>{try{let[e,r]=$e(t),i=await(await R.fetchImplementation(e,{...r,method:r.method.toLowerCase()})).json();return t.jsonpath&&t.jsonpath!="$"?H(i,t.jsonpath):i}catch(e){return{}}};async function Nt(t){if(!t)return t;if(kt(t))return ie(t);let e=Object.keys(t),r=await Promise.all(e.map(n=>kt(t[n])?ie(t[n]):null).filter(Boolean));return e.reduce((n,i)=>({...n,[i]:kt(t[i])?r.shift():t[i]}),{})}R.clean=hr;R.toFetchArguments=$e;R.fetchOne=ie;R.fetch=Nt;R.isDataSettings=kt;R.fetchImplementation=(...t)=>fetch(...t);function oe(t){var e,r,n,i,s,o,a,l;let u,d=t.getAttribute("src");if(d){let w=tt(d);if(!w)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:c,component:h,version:y,revision:m}=w}let A=t.getAttribute("data");if(A!=null&&A!="")try{u=typeof A=="string"?JSON.parse(A):{}}catch(w){console.error(w)}return{data:u||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:p)!==null&&r!==void 0?r:N,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:c,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:h,version:(o=(s=t.getAttribute("version"))!==null&&s!==void 0?s:y)!==null&&o!==void 0?o:"responsive",revision:(l=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:m)!==null&&l!==void 0?l:"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 rt=class extends E{setData(e){this.set({data:e})}getProps(){return oe(this)}isJSONAttribute(e){return e=="data"}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),e==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await R.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(e),r&&this.advance()}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=C(e=>this.readyData=e,e=>this.onError(e)),this.defaultProps={cdn:N,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=e=>{this.payload=e,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),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())return;let e=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Dt({...this.props,revision:"published"}).then(()=>{r=null,e()});return Promise.all([r,this.whenDataReady.then(()=>e()),z(this.props,n=>{this.payload=n,e()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)D(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;j(this,this.payload,this.readyData)}}};rt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];rt.register("feaas-component");function se(t){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 nt=class extends E{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return se(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=`
|
|
4
|
+
`).trim();if(typeof t=="string")return t;if(t==null)return"";switch(t.type){case"heading":let{level:r,...n}=t.attrs;return Bt(t.content,n,"h"+r);case"text":return(t.marks||[]).reduce((i,s)=>Bt(i,s.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[s.type]),(e=t.text)===null||e===void 0?void 0:e.replace(/\s+/," "));default:return Bt(t.content||t.text,t.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[t.type])}}var V=class{constructor(e,r=1,n){this.ownerDocument={createElement(i){return new V(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 localName(){var e;return(e=this.nodeName)===null||e===void 0?void 0:e.toLowerCase()}get innerHTML(){return Wt(this.childNodes)}set innerHTML(e){this.childNodes=Ht(String(e!=null?e:""))}get outerHTML(){return Wt([this])}get children(){return this.childNodes.filter(e=>e.nodeType==1)}closest(e){let r=this;for(;r;){if(Ce(e,r))return r;r=r.parentNode}return null}querySelectorAll(e){let r=e.split(/\s*,\s*/),n=[],i=s=>{for(let o of r)if(Ce(o,s)){n.push(s);break}for(let o of s.childNodes)i(o)};for(let s of this.childNodes)i(s);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 s=i+e;s>=0&&s<n.length;s+=e){let o=n[s];if(!r||o.nodeType===1)return o}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 V(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 Ce(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 s=i[1],o=i[3],a=e.getAttribute(s);if(typeof o=="undefined"){if(a===void 0)return!1}else if(a!==o)return!1}else return!1}else if(e.nodeName!==n)return!1;return!0}function Ht(t){var e;let r=[],n=[];for(;t;){let i=t.match(/^<([\w-]+)(\s[^>]*)?>/),s=t.match(/^<\/([\w-]+)>/);if(i){let o=i[1],l=((e=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||e===void 0?void 0:e.map(d=>{let[p,c,,h]=d.match(/([\w-]+)(="([^"]*)")?/);return{name:c,value:dr(h||"")}}))||[],u=new V(o,1);if(u.attributes=l,n.length>0){let d=n[n.length-1];d.childNodes.push(u),u.parentNode=d}else r.push(u);n.push(u),t=t.slice(i[0].length)}else if(s)n.pop(),t=t.slice(s[0].length);else{let o=t.indexOf("<"),a=t.slice(0,o!==-1?o:void 0),l=new V("#text",3);if(l.textContent=a,n.length>0){let u=n[n.length-1];u.childNodes.push(l),l.parentNode=u}else r.push(l);t=t.slice(a.length)}}return r}function lr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function dr(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function Wt(t){return t.map(e=>{if(e.nodeType===3)return e.textContent||"";let{nodeName:r,attributes:n}=e,i=n.map(({name:o,value:a})=>` ${o}="${lr(String(a))}"`).join(""),s=Wt(e.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${s}</${r}>`}).join("")}function Vt(t){let e=new t.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,s=i.getAttribute("data-embed-src");s&&K(i,s),n.addedNodes&&n.addedNodes.forEach(o=>{o.nodeType==1&&zt(o,!1)})})});return e.observe(t,{attributes:!0,subtree:!0,childList:!0}),e}function zt(t,e=!0){let r=t.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];K(i,i.getAttribute("data-embed-src"))}if(e)return Vt(t)}function K(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 s=r.ownerDocument.createElement("script");s.setAttribute("type","module"),s.setAttribute("src",e),r.appendChild(s);break}}var vt={};J(vt,{adjustNumbers:()=>Kt,cleanCollectionBit:()=>Y,getHumanizedLabel:()=>Yt,getLastPathBit:()=>Qt,getQualifier:()=>Gt,normalizeCollectionScope:()=>mt,parseLimit:()=>Jt,parseRange:()=>qt});var Jt=t=>{var e;let r=parseInt((e=t==null?void 0:t.match(/\[0:(\d+)\]/))===null||e===void 0?void 0:e[1],10);return!isNaN(r)&&r>0?String(r):null},qt=t=>{var e;let r=(e=t==null?void 0:t.match(/\[([^\]]+)\]/))===null||e===void 0?void 0:e[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},Gt=t=>{var e;return(e=t==null?void 0:t.match(/(\.\*|\[[^\]]*\])$/))===null||e===void 0?void 0:e[0]};function Y(t){return t.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function mt(t){return Y(t)+".*"}function Kt(t,e){return t==null?void 0:t.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+e)))}function Yt(t,e=2){var r=Y(t).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-e).join(" ")}function Qt(t){return Y(t).split(".").pop()}var ur=["January","February","March","April","May","June","July","August","September","October","November","December"],Se=t=>{if(!t||typeof t.getDay!="function")return;let e=t.getFullYear(),r=ur[t.getMonth()],n=t.getDate();return`${r} ${n}, ${e}`},Re=function(t){return String(new Date(t))!=="Invalid Date"&&!isNaN(Number(new Date(t)))};function De(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 cr(t,e,r){let n=t.getAttribute("data-path-scope");if(n==null)return;var i=De(t);if(i!=0)return;let s=t.parentNode;if(s!=null){e==0?t.setAttribute("hidden","hidden"):t.getAttribute("hidden")!=null&&t.removeAttribute("hidden");for(var o=i+1,a=t,l=t;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(o++,a=l);for(var u=o;u<e;u++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var u=Math.max(1,e);u<o;u++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function $(t,e,r,n){var i,s;if(!t)return;var o=t;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=L(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(t,e,r));var a=e.replace("data-path-","");if(e=="data-path-src"||e=="data-path-alt"){let m=Array.from(t.children).find(A=>A.localName=="picture")||t;o=t.localName=="img"?t:m.querySelector("img, video")}else if(e=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(e=="data-path-hidden")r=r?null:!0;else if(e=="data-path"||e=="data-embed-html"||e=="html")a="innerHTML";else if(e=="data-embed-src")K(t,r);else if(e=="data-path-attributes"){let m=((i=t.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var l in r){var u=r[l];$(t,l,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var d=0;d<m.length;d++)(r==null||!(m[d]in r))&&$(t,m[d],null,n);$(t,"data-attributes-keys",Object.keys(r||{}).join(","));return}if(typeof r=="boolean"&&(r=r?"":null),!o)return;if((a=="innerHTML"||a=="src")&&(r==null||r==="")){var c=String((s=t.getAttribute("data-path-placeholder")||o[a])!==null&&s!==void 0?s:o.getAttribute(a));a=="innerHTML"?o.innerHTML=c:c?o.setAttribute(a,c):o.removeAttribute(a)}else if(r!=null)if(a=="innerHTML"){for(var h=String(r),y=o;y.parentElement&&y.localName.match(/^(a|var|strong|em|i|b)$/);)y=y.parentElement;y.localName.match(/p|h\d|button|time|li/)&&(h=h.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(y.getAttribute("class")).includes("-inline--time")&&Re(h)&&(h=Se(new Date(h))),o.innerHTML!=h&&(o.innerHTML=h)}else o.getAttribute(a)!=r&&o.setAttribute(a,r);else o.removeAttribute(a)}var _e=["data-attributes-keys","data-path-attributes","data-path-scope"];function D(t,e,r,n){var i,s,o;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 d=a.getAttribute("data-path-scope");if(d){let c=De(a),h=G(e,d,!1);c==0&&cr(a,((s=r==null?void 0:r.shouldRepeat)===null||s===void 0?void 0:s.call(r,a,h))===!1?1:h.length,r),e={...e,[mt(d)]:h[c]}}let p=Array.prototype.slice.call(a.attributes).sort((c,h)=>_e.indexOf(c.name)-_e.indexOf(h.name));for(var l=0;l<p.length;l++){let{name:c,value:h}=p[l];c.startsWith("data-path")&&c!="data-path-scope"&&$(a,c,G(e,h,!0),r),c=="data-embed-src"&&$(a,c,a.getAttribute(c),r)}}for(var l=0,u;u=a.childNodes[l++];)Fe(u)&&D(u,e,r,!0);return n||(o=r==null?void 0:r.onRender)===null||o===void 0||o.call(r,a,e),a}function Fe(t){return t.nodeType==1}function j(t,e,r,n){var i;let s=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,t,e,r))||e;if(t.innerHTML=s,t.classList.add("-feaas"),(t.closest(".component.feaas")||t).className.includes("-theme--"))for(var a=0,l;l=t.childNodes[a++];)Fe(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return D(t,r,n)}function Xt(t,e,r,n=!1){var i;let s=((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 o=Ht(s);return D(o[0],e,r).outerHTML}else{let o=document.createElement("div");return o.innerHTML=s,D(o,e,r),o.innerHTML}}var ke=["initial","check","updated"],Q={};function Ne(){Q={}}async function X(t,e,r,n,i=Q){return I({url:t,options:e,validator:r,callback:n,cache:i}).then(Z).then(s=>s.response)}function Zt(t,e=!1){let r=String(t).replace("?head","");var n=Q[r];return!n&&!e&&(n=Q[r]={phase:null,initial:C(),check:C(),updated:C(),final:C()}),n}var gt=class extends Error{};async function I({url:t,options:e,validator:r,callback:n,cache:i},s="initial"){let o=new Date;if(i!=null){var a=Zt(t);if(ke.indexOf(a.phase)>=ke.indexOf(s))var l=a[s];else a.phase=s}let u=await(l||fetch(t,e));if(!l&&a&&(u.ok?a[s].resolve(u):a[s].reject(new Error("Fetch failed"))),!u.ok)throw new Error("Fetch failed");let d=new Date(u.headers.get("date"))<o||l&&s=="initial"&&(a.phase=="updated"||a.phase=="check");if((r==null?void 0:r(u,d))===!1)throw new gt("Response is not valid");return await(n==null?void 0:n(u,s,d)),{url:t,options:e,isCached:d,response:u,validator:r,callback:n,cache:i}}async function Z(t){let{url:e,isCached:r,options:n,validator:i,response:s,cache:o}=t;if(r){let{response:a}=await I({url:e+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:o},"check");if(a.headers.get("last-modified")!=s.headers.get("last-modified"))return bt(t)}return t}async function bt(t){return I({...t,options:{...t.options,cache:"reload"}},"updated")}var N="https://feaas.blob.core.windows.net";function tt(t){let e=t.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(e){var[,r,n,i,s,o]=e;return{cdn:r,library:n,component:i,version:s,revision:o}}}function Oe(t){if(!t||!t.library||!t.component)throw new Error("Component requires `library` and `component` properties");return`${t.cdn&&t.cdn!=N?`${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 Pe(t){return`${t.cdn&&t.cdn!=N?`${t.cdn}/styles/`:""}${t.library}/${!t.revision||t.revision=="published"?"":t.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function At(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 s=tt(t);if(s){var{cdn:r,library:n,revision:i}=s;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function _t(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...tt(t.src)}),`${t.cdn||t.hostname||N}/components/${t.library}/${t.component}/${t.version}/${t.revision||"published"}.html`}function et(t){return typeof t=="string"&&(t={src:t}),"src"in t&&(t={...At(t.src)}),`${t.cdn||t.hostname||N}/styles/${t.library}/${t.revision||"published"}.css`}async function z(t,e,r=!1){let n=a=>a.headers.get("x-ms-meta-versionDeletedAt")==null,i=a=>a.clone().text().then(e),s=await Promise.all([t.instance&&I({options:{headers:{Accept:"text/html"},credentials:"omit"},url:_t({...t,version:t.instance}),validator:n}).catch(a=>a),I({url:_t(t),validator:n}).catch(a=>a)]),o=s.find(a=>a&&"isCached"in a&&a);if(!o||o instanceof Error)throw s.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return s[0]==o&&console.log("Using fork!",s),await i(o.response),r?o:Z({...o,callback:i}).catch(a=>{if(s[0]==o&&(bt({...o,callback:null,validator:null}),console.log("Fork was deleted"),!(s[1]instanceof Error)))return i(s[1].response),Z({...s[1],callback:i});throw a})}async function Te(t){typeof t=="string"&&(t={src:t});var e;let{response:r}=await z(t,n=>{e=n},!0);return{...t,template:e,lastModified:r.headers.get("last-modified")}}async function wt(t,e){return typeof t=="string"&&(t={src:t}),X(et(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 Me(t,e){return te(t,e||(e=document.createElement("style"))),e}function te(t,e){return e||(e=document.createElement("style")),wt(t,(r,n)=>{e.textContent=r}).then(()=>e)}function Et(t,e){var r=ee(t);if(!r)var n=re(t);return wt(t,(i,s)=>{n&&(n.textContent=i),e==null||e(i,s)}).then(()=>r||n)}function Dt(t){return new Promise((e,r)=>{Et(t,e).catch(r)})}function ee(t){return document.head.querySelector(`style[data-href="${et(t)}"]`)}function re(t){let e=et(t),r=document.createElement("style");return r.setAttribute("data-href",e),document.head.appendChild(r),r}function Le(t,e){let r=document.createElement("div");r.innerHTML=t;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return D(n,e),r}function Ft(t,e){return ne(t,e||(e=document.createElement("div"))),e}async function ne(t,e){return e||(e=document.createElement("div")),e.childNodes.length?D(e,t.data,t):"template"in t?j(e,t.template,t.data,t):z(t,r=>j(e,r,t.data,t)).then(()=>e)}function hr(t){let{params:e,method:r,headers:n,body:i,url:s}=R(t);var o={url:s},a={...n};return n["Content-Type"]==="application/json"&&delete a["Content-Type"],n.Accept==="application/json"&&delete a.Accept,Object.keys(a).length>0&&(o.headers=a),r!=="GET"&&(o.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(o.body=i),Object.keys(e).length>0&&(o={...o,params:e}),o}var kt=t=>{if(typeof t.url!="string")return!1;for(var e in t)if(!(e=="body"||e=="params"||e=="headers"||e=="url"||e==="method"||e=="jsonpath"&&typeof t[e]=="string"))return!1;return!0};function $e(t){let{url:e,headers:r,params:n,method:i,body:s}=R(t),o,a=r["Content-Type"];i!="GET"&&i!="HEAD"&&(a==="application/json"&&(o=JSON.stringify(s)),a==="multipart/form-data"&&(o=Object.keys(s).reduce((u,d)=>(u.append(d,s[d]),u),new FormData)),a==="application/x-www-form-urlencoded"&&(o=new URLSearchParams(s)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${e}${l}`,{headers:r,body:o,method:i}]}function R(t){let e={};for(let r in(t==null?void 0:t.headers)||{})if(t.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());e[n]=t.headers[r]}return e.Accept||(e.Accept="application/json"),{params:(t==null?void 0:t.params)||{},headers:e,jsonpath:String((t==null?void 0:t.jsonpath)||"$"),method:((t==null?void 0:t.method)||"GET").toUpperCase(),body:(t==null?void 0:t.body)||{},url:String((t==null?void 0:t.url)||"")}}var ie=async t=>{try{let[e,r]=$e(t),i=await(await R.fetchImplementation(e,{...r,method:r.method.toLowerCase()})).json();return t.jsonpath&&t.jsonpath!="$"?H(i,t.jsonpath):i}catch(e){return{}}};async function Nt(t){if(!t)return t;if(kt(t))return ie(t);let e=Object.keys(t),r=await Promise.all(e.map(n=>kt(t[n])?ie(t[n]):null).filter(Boolean));return e.reduce((n,i)=>({...n,[i]:kt(t[i])?r.shift():t[i]}),{})}R.clean=hr;R.toFetchArguments=$e;R.fetchOne=ie;R.fetch=Nt;R.isDataSettings=kt;R.fetchImplementation=(...t)=>fetch(...t);function oe(t){var e,r,n,i,s,o,a,l;let u,d=t.getAttribute("src");if(d){let w=tt(d);if(!w)throw new Error(`Could not parse FEAAS Component source: ${d}`);var{cdn:p,library:c,component:h,version:y,revision:m}=w}let A=t.getAttribute("data");if(A!=null&&A!="")try{u=typeof A=="string"?JSON.parse(A):{}}catch(w){console.error(w)}return{data:u||{},cdn:(r=(e=t.getContextAttribute("cdn"))!==null&&e!==void 0?e:p)!==null&&r!==void 0?r:N,library:(n=t.getAttribute("library"))!==null&&n!==void 0?n:c,component:(i=t.getAttribute("component"))!==null&&i!==void 0?i:h,version:(o=(s=t.getAttribute("version"))!==null&&s!==void 0?s:y)!==null&&o!==void 0?o:"responsive",revision:(l=(a=t.getAttribute("revision"))!==null&&a!==void 0?a:m)!==null&&l!==void 0?l:"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 rt=class extends E{setData(e){this.set({data:e})}getProps(){return oe(this)}isJSONAttribute(e){return e=="data"}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),e==="data"&&this.fetchData())}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let e=await R.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(e),r&&this.advance()}getEditor(){var e;return(e=document.querySelector("feaas-context"))===null||e===void 0?void 0:e.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=C(e=>this.readyData=e,e=>this.onError(e)),this.defaultProps={cdn:N,revision:"published",version:"responsive",withStylesheet:!0,editable:!1,suspended:!1,data:{}},this.onLoad=e=>{this.payload=e,this.advance()},this.getAttribute("data")||this.whenDataReady.resolve({}),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())return;let e=()=>{this.payload&&(r||this.readyData&&this.onLoad(this.payload))};if(this.props.withStylesheet)var r=Dt({...this.props,revision:"published"}).then(()=>{r=null,e()});return Promise.all([r,this.whenDataReady.then(()=>e()),z(this.props,n=>{this.payload=n,e()})]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,this.getAttribute("hydrate")!="false")if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)D(this,this.readyData);else{if(this.needsRefresh=!0,this.getOriginal())return;j(this,this.payload,this.readyData)}}};rt.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];rt.register("feaas-component");function se(t){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 nt=class extends E{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return se(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;
|