@sitecore-feaas/clientside 0.1.7 → 0.1.10

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.
@@ -1,6 +1,6 @@
1
- var bt=Object.defineProperty,gt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var At=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var ct=(t,r,e)=>r in t?bt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,F=(t,r)=>{for(var e in r||(r={}))At.call(r,e)&&ct(t,e,r[e]);if(ut)for(var e of ut(r))Et.call(r,e)&&ct(t,e,r[e]);return t},L=(t,r)=>gt(t,mt(r));var v=(t,r,e)=>new Promise((n,o)=>{var s=u=>{try{a(e.next(u))}catch(l){o(l)}},i=u=>{try{a(e.throw(u))}catch(l){o(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,i);a((e=e.apply(t,r)).next())});function P(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(r){return typeof r}:P=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},P(t)}function vt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function St(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&W(t,r)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(t)}function W(t,r){return W=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},W(t,r)}function lt(){if(typeof Reflect=="undefined"||!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(t){return!1}}function N(t,r,e){return lt()?N=Reflect.construct:N=function(o,s,i){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(o,a),l=new u;return i&&W(l,i.prototype),l},N.apply(null,arguments)}function Ft(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function tt(t){var r=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!Ft(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return N(n,arguments,j(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),W(o,n)},tt(t)}function Pt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Rt(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Pt(t)}function wt(t){var r=lt();return function(){var n=j(t),o;if(r){var s=j(this).constructor;o=Reflect.construct(n,arguments,s)}else o=n.apply(this,arguments);return Rt(this,o)}}function pt(t){return Ct(t)||xt(t)||ht(t)||Tt()}function Ct(t){if(Array.isArray(t))return et(t)}function xt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ht(t,r){if(!!t){if(typeof t=="string")return et(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return et(t,r)}}function et(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Tt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
1
+ var bt=Object.defineProperty,gt=Object.defineProperties;var mt=Object.getOwnPropertyDescriptors;var ut=Object.getOwnPropertySymbols;var At=Object.prototype.hasOwnProperty,Et=Object.prototype.propertyIsEnumerable;var ct=(t,r,e)=>r in t?bt(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,F=(t,r)=>{for(var e in r||(r={}))At.call(r,e)&&ct(t,e,r[e]);if(ut)for(var e of ut(r))Et.call(r,e)&&ct(t,e,r[e]);return t},L=(t,r)=>gt(t,mt(r));var v=(t,r,e)=>new Promise((n,o)=>{var s=u=>{try{a(e.next(u))}catch(l){o(l)}},i=u=>{try{a(e.throw(u))}catch(l){o(l)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(s,i);a((e=e.apply(t,r)).next())});function P(t){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?P=function(r){return typeof r}:P=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},P(t)}function vt(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function St(t,r){if(typeof r!="function"&&r!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),r&&W(t,r)}function j(t){return j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},j(t)}function W(t,r){return W=Object.setPrototypeOf||function(n,o){return n.__proto__=o,n},W(t,r)}function lt(){if(typeof Reflect=="undefined"||!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(t){return!1}}function N(t,r,e){return lt()?N=Reflect.construct:N=function(o,s,i){var a=[null];a.push.apply(a,s);var u=Function.bind.apply(o,a),l=new u;return i&&W(l,i.prototype),l},N.apply(null,arguments)}function Ft(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function tt(t){var r=typeof Map=="function"?new Map:void 0;return tt=function(n){if(n===null||!Ft(n))return n;if(typeof n!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(n))return r.get(n);r.set(n,o)}function o(){return N(n,arguments,j(this).constructor)}return o.prototype=Object.create(n.prototype,{constructor:{value:o,enumerable:!1,writable:!0,configurable:!0}}),W(o,n)},tt(t)}function Pt(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function wt(t,r){return r&&(typeof r=="object"||typeof r=="function")?r:Pt(t)}function Rt(t){var r=lt();return function(){var n=j(t),o;if(r){var s=j(this).constructor;o=Reflect.construct(n,arguments,s)}else o=n.apply(this,arguments);return wt(this,o)}}function pt(t){return Ct(t)||xt(t)||ht(t)||Tt()}function Ct(t){if(Array.isArray(t))return et(t)}function xt(t){if(typeof Symbol!="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function ht(t,r){if(!!t){if(typeof t=="string")return et(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor&&(e=t.constructor.name),e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return et(t,r)}}function et(t,r){(r==null||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function Tt(){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 kt(t,r){var e=typeof Symbol!="undefined"&&t[Symbol.iterator]||t["@@iterator"];if(!e){if(Array.isArray(t)||(e=ht(t))||r&&t&&typeof t.length=="number"){e&&(t=e);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,i=!1,a;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return s=u.done,u},e:function(u){i=!0,a=u},f:function(){try{!s&&e.return!=null&&e.return()}finally{if(i)throw a}}}}var A=Object.prototype.hasOwnProperty;function $(t,r){return t=t.slice(),t.push(r),t}function H(t,r){return r=r.slice(),r.unshift(t),r}var Mt=function(t){St(e,t);var r=wt(e);function e(n){var o;return vt(this,e),o=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),o.avoidNew=!0,o.value=n,o.name="NewError",o}return e}(tt(Error));function d(t,r,e,n,o){if(!(this instanceof d))try{return new d(t,r,e,n,o)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(o=n,n=e,e=r,r=t,t=null);var s=t&&P(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=A.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||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var i={path:s?t.path:r};s?"json"in t&&(i.json=t.json):i.json=e;var a=this.evaluate(i);if(!a||P(a)!=="object")throw new Mt(a);return a}}d.prototype.evaluate=function(t,r,e,n){var o=this,s=this.parent,i=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||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(!A.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=t;r=l.json,a=A.call(t,"flatten")?t.flatten:a,this.currResultType=A.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=A.call(t,"sandbox")?t.sandbox:this.currSandbox,u=A.call(t,"wrap")?t.wrap:u,this.currPreventEval=A.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=A.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=A.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,s=A.call(t,"parent")?t.parent:s,i=A.call(t,"parentProperty")?t.parentProperty:i,t=t.path}if(s=s||null,i=i||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!r)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var p=this._trace(c,r,["$"],s,i,e).filter(function(h){return h&&!h.isParentSelector});return p.length?!u&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(h,y){var f=o._getPreferredOutput(y);return a&&Array.isArray(f)?h=h.concat(f):h.push(f),h},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(e),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return d.toPathString(t[r]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),r(n,e,t)}};d.prototype._trace=function(t,r,e,n,o,s,i,a){var u=this,l;if(!t.length)return l={path:e,value:r,parent:n,parentProperty:o,hasArrExpr:i},this._handleCallback(l,s,"value"),l;var c=t[0],p=t.slice(1),h=[];function y(b){Array.isArray(b)?b.forEach(function(R){h.push(R)}):h.push(b)}if((typeof c!="string"||a)&&r&&A.call(r,c))y(this._trace(p,r[c],$(e,c),r,c,s,i));else if(c==="*")this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){y(u._trace(H(b,M),E,k,D,S,w,!0,!0))});else if(c==="..")y(this._trace(p,r,e,n,o,s,i)),this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){P(E[b])==="object"&&y(u._trace(H(R,M),E[b],$(k,b),E,b,w,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return l={path:$(e,c),value:o,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")y(this._trace(p,r,e,null,null,s,i));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,p,r,e,n,o,s));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(c,p,r,e,n,o,s,function(b,R,M,E,k,D,S,w){u._eval(R.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),E[b],b,k,D,S)&&y(u._trace(H(b,M),E,k,D,S,w,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(H(this._eval(c,r,e[e.length-1],e.slice(0,-1),n,o),p),r,e,n,o,s,i))}else if(c[0]==="@"){var f=!1,C=c.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(P(r)))&&(f=!0);break;case"boolean":case"string":case"undefined":case"function":P(r)===C&&(f=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(f=!0);break;case"number":Number.isFinite(r)&&(f=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(f=!0);break;case"object":r&&P(r)===C&&(f=!0);break;case"array":Array.isArray(r)&&(f=!0);break;case"other":f=this.currOtherTypeCallback(r,e,n,o);break;case"null":r===null&&(f=!0);break;default:throw new TypeError("Unknown value type "+C)}if(f)return l={path:e,value:r,parent:n,parentProperty:o},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&r&&A.call(r,c.slice(1))){var U=c.slice(1);y(this._trace(p,r[U],$(e,U),r,U,s,i,!0))}else if(c.includes(",")){var Q=c.split(","),_=kt(Q),J;try{for(_.s();!(J=_.n()).done;){var I=J.value;y(this._trace(H(I,p),r,e,n,o,s,!0))}}catch(b){_.e(b)}finally{_.f()}}else!a&&r&&A.call(r,c)&&y(this._trace(p,r[c],$(e,c),r,c,s,i,!0))}if(this._hasParentSelector)for(var g=0;g<h.length;g++){var O=h[g];if(O&&O.isParentSelector){var x=this._trace(O.expr,r,O.path,n,o,s,i);if(Array.isArray(x)){h[g]=x[0];for(var Z=x.length,T=1;T<Z;T++)g++,h.splice(g,0,x[T])}else h[g]=x}}return h};d.prototype._walk=function(t,r,e,n,o,s,i,a){if(Array.isArray(e))for(var u=e.length,l=0;l<u;l++)a(l,t,r,e,n,o,s,i);else e&&P(e)==="object"&&Object.keys(e).forEach(function(c){a(c,t,r,e,n,o,s,i)})};d.prototype._slice=function(t,r,e,n,o,s,i){if(!!Array.isArray(e)){var a=e.length,u=t.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,p=u[1]&&Number.parseInt(u[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var h=[],y=c;y<p;y+=l){var f=this._trace(H(y,r),e,n,o,s,i,!0);f.forEach(function(C){h.push(C)})}return h}};d.prototype._eval=function(t,r,e,n,o,s){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=s,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=o,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(i){throw console.log(i),new Error("jsonPath: "+i.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var r=t,e=r.length,n="$",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+=/^[\*0-9]+$/.test(r[o])?"["+r[o]+"]":"['"+r[o]+"']");return n};d.toPointer=function(t){for(var r=t,e=r.length,n="",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+="/"+r[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var r=d.cache;if(r[t])return r[t].concat();var e=[],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,i){return"[#"+(e.push(i)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(s,i){return"['"+i.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(s,i){return";"+i.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),o=n.split(";").map(function(s){var i=s.match(/#([0-9]+)/);return!i||!i[1]?s:e[i[1]]});return r[t]=o,r[t].concat()};var Dt=function(r,e,n){for(var o=r.length,s=0;s<o;s++){var i=r[s];n(i)&&e.push(r.splice(s--,1)[0])}};d.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),o=[];Dt(n,o,function(l){return typeof e[l]=="function"});var s=n.map(function(l,c){return e[l]}),i=o.reduce(function(l,c){var p=e[c].toString();return/function/.test(p)||(p="function "+p),"var "+c+"="+p+";"+l},"");r=i+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var a=r.lastIndexOf(";"),u=a>-1?r.slice(0,a+1)+" return "+r.slice(a+1):" return "+r;return N(Function,pt(n).concat([u])).apply(void 0,pt(s))}};function rt(t,r,e,n){return v(this,null,function*(){let o=new Date,s=yield fetch(t,r);if(!s.ok)throw new Error("Fetch failed");let i=new Date(s.headers.get("date"));var a=s;if(n(s,"cached"),i<o){let u=yield fetch(t+"?"+Math.random(),L(F({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=s.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");a=yield fetch(t,L(F({},r),{cache:"reload"}))}}if(e(a)===!1)throw new Error("Response is not valid");return s!==a&&n(a,"valid"),a})}function Lt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:o,revision:s="published"}){return`${t||r}/components/${e}/${n}/${o}/${s}.html`}function _t({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function q(t,r){return v(this,null,function*(){return rt(Lt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function V(t,r){return v(this,null,function*(){return rt(_t(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function oe(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return B(n,r),e}function Ot(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Ht(t){return Ot(t)+".*"}function yt(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function Bt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var o=yt(t);if(o!=0)return;let s=t.parentElement;if(s!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var i=o+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(i++,a=u);for(var l=i;l<r;l++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var l=Math.max(1,r);l<i;l++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function dt(t,r,e=!1,n=t){var o=r;let s=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of s)if(r.startsWith(a)){if(a==r){if(e)return t[a];continue}o=r.substring(a.length+1),n=t[a];break}let i=d({path:o,json:n});return e&&i&&Array.isArray(i)?i[0]:i}function z(t,r,e,n){var c;if(!!t){var o=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var s=r.replace("data-path-","");if(r=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")o=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")s="innerHTML";else if(r=="data-embed-src")nt(t,e);else if(r=="data-path-attributes"){let p=((c=t.getAttribute("data-attributes-keys"))==null?void 0:c.split(",").filter(Boolean))||[];for(var i in e){var a=e[i];z(t,i,typeof a=="object"&&a?JSON.stringify(a):a,n)}for(var u=0;u<p.length;u++)(e==null||!(p[u]in e))&&z(t,p[u],null,n);z(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);e!=null?s=="innerHTML"?o.innerHTML!=e&&(o.innerHTML=e):o.getAttribute(s)!=e&&o.setAttribute(s,e):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}function It(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let o=n.target,s=o.getAttribute("data-embed-src");s&&nt(o,s),n.addedNodes&&n.addedNodes.forEach(i=>{i.nodeType==1&&$t(i,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function $t(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let o=e[n];nt(o,o.getAttribute("data-embed-src"))}if(r)return It(t)}function nt(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let o=e.querySelectorAll("script");for(var n=0;n<o.length;n++)if(o[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let s=e.ownerDocument.createElement("script");s.type="module",s.src=r,e.appendChild(s);break}}var ft=["data-attributes-keys","data-path-attributes","data-path-scope"];function B(t,r,e,n){var i,a,u;let o=t;if(n||(r=((i=e==null?void 0:e.processData)==null?void 0:i.call(e,o,r))||r),o.nodeType==1){let l=o.getAttribute("data-path-scope");if(l){let p=yt(o),h=dt(r,l,!1)||[];p==0&&Bt(o,((a=e==null?void 0:e.shouldRepeat)==null?void 0:a.call(e,o,h))===!1?1:h.length,e),r=L(F({},r),{[Ht(l)]:h[p]})}let c=Array.prototype.slice.call(o.attributes).sort((p,h)=>ft.indexOf(p.name)-ft.indexOf(h.name));for(var s=0;s<c.length;s++){let{name:p,value:h}=c[s];p.startsWith("data-path")&&p!="data-path-scope"&&z(o,p,dt(r,h,!0),e),p=="data-embed-src"&&z(o,p,o.getAttribute(p),e)}}for(var s=0;s<o.children.length;s++)B(o.children[s],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,o,r),o}function X(t,r,e,n){var s;let o=((s=n==null?void 0:n.processTemplate)==null?void 0:s.call(n,t,r,e))||r;return t.innerHTML=o,t.classList.add("-feaas"),B(t,e,n)}function se(t,r){return Nt(t,r||(r=document.createElement("style"))),r}function Nt(t,r){return r||(r=document.createElement("style")),V(t,e=>{r.textContent=e}).then(()=>r)}function ie(t,r){return jt(t,r||(r=document.createElement("div"))),r}function jt(t,r){return v(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?B(r,t.data,t):"template"in t?X(r,t.template,t.data,t):q(t,e=>X(r,e,t.data,t)).then(()=>r)})}var m=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,o){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],o=this.descendants.indexOf(n);o!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(o,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var s,i;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(s=n.refs).parent||(s.parent=this),n.renderReact)for(var o=n.refs.parent;o;o=o.refs.parent)o.renderReact&&((i=n.refs).parentReact||(i.parentReact=o),n.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return v(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var s,i,a;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:o}=this.payload||{};if(!n)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?o.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(s=this.forceUpdateReact)==null||s.call(this):(a=(i=this.refs.topReact).forceUpdateReact)==null||a.call(i)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},o=this.descendants.filter(s=>s.refs.parentReact==this&&s.payload).map((s,i)=>e.createElement(this.getReactWrapper(s),{key:this.tagName+"-"+i,slot:s.getAttribute("slot")}));return this.renderReact(L(F({},this.props),{children:o}),this.payload)}getReactWrapper(e=this,n=e.tagName){let o=e.reactWrapper||(e.reactWrapper=s=>{if(e.renderReact){let{React:i,ReactDOM:a}=e.payload||{},[u,l]=i.useReducer(c=>c+1,0);return e.forceUpdateReact=l,a.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(o,{displayName:n}),o}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=F(F({},this.overrides),e),this.props=F(F({},this.getProps()),this.overrides);for(var n in this.props){let o=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof o=="string"||typeof o=="number")&&this.getAttribute(n)!=String(o)&&this.setAttribute(n,String(o))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/^\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var o,s;return(s=(o=n.closest(`[${e}]`))==null?void 0:o.getAttribute(e))!=null?s:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function pe(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var K=class extends m{attributeChangedCallback(e,n,o){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),o?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,i=!1,a;return{s:function(){e=e.call(t)},n:function(){var u=e.next();return s=u.done,u},e:function(u){i=!0,a=u},f:function(){try{!s&&e.return!=null&&e.return()}finally{if(i)throw a}}}}var A=Object.prototype.hasOwnProperty;function $(t,r){return t=t.slice(),t.push(r),t}function H(t,r){return r=r.slice(),r.unshift(t),r}var Mt=function(t){St(e,t);var r=Rt(e);function e(n){var o;return vt(this,e),o=r.call(this,'JSONPath should not be called with "new" (it prevents return of (unwrapped) scalar values)'),o.avoidNew=!0,o.value=n,o.name="NewError",o}return e}(tt(Error));function d(t,r,e,n,o){if(!(this instanceof d))try{return new d(t,r,e,n,o)}catch(u){if(!u.avoidNew)throw u;return u.value}typeof t=="string"&&(o=n,n=e,e=r,r=t,t=null);var s=t&&P(t)==="object";if(t=t||{},this.json=t.json||e,this.path=t.path||r,this.resultType=t.resultType||"value",this.flatten=t.flatten||!1,this.wrap=A.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||o||function(){throw new TypeError("You must supply an otherTypeCallback callback option with the @other() operator.")},t.autostart!==!1){var i={path:s?t.path:r};s?"json"in t&&(i.json=t.json):i.json=e;var a=this.evaluate(i);if(!a||P(a)!=="object")throw new Mt(a);return a}}d.prototype.evaluate=function(t,r,e,n){var o=this,s=this.parent,i=this.parentProperty,a=this.flatten,u=this.wrap;if(this.currResultType=this.resultType,this.currPreventEval=this.preventEval,this.currSandbox=this.sandbox,e=e||this.callback,this.currOtherTypeCallback=n||this.otherTypeCallback,r=r||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(!A.call(t,"json"))throw new TypeError('You must supply a "json" property when providing an object argument to JSONPath.evaluate().');var l=t;r=l.json,a=A.call(t,"flatten")?t.flatten:a,this.currResultType=A.call(t,"resultType")?t.resultType:this.currResultType,this.currSandbox=A.call(t,"sandbox")?t.sandbox:this.currSandbox,u=A.call(t,"wrap")?t.wrap:u,this.currPreventEval=A.call(t,"preventEval")?t.preventEval:this.currPreventEval,e=A.call(t,"callback")?t.callback:e,this.currOtherTypeCallback=A.call(t,"otherTypeCallback")?t.otherTypeCallback:this.currOtherTypeCallback,s=A.call(t,"parent")?t.parent:s,i=A.call(t,"parentProperty")?t.parentProperty:i,t=t.path}if(s=s||null,i=i||null,Array.isArray(t)&&(t=d.toPathString(t)),!(!t&&t!==""||!r)){var c=d.toPathArray(t);c[0]==="$"&&c.length>1&&c.shift(),this._hasParentSelector=null;var p=this._trace(c,r,["$"],s,i,e).filter(function(h){return h&&!h.isParentSelector});return p.length?!u&&p.length===1&&!p[0].hasArrExpr?this._getPreferredOutput(p[0]):p.reduce(function(h,y){var f=o._getPreferredOutput(y);return a&&Array.isArray(f)?h=h.concat(f):h.push(f),h},[]):u?[]:void 0}};d.prototype._getPreferredOutput=function(t){var r=this.currResultType;switch(r){case"all":{var e=Array.isArray(t.path)?t.path:d.toPathArray(t.path);return t.pointer=d.toPointer(e),t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),t}case"value":case"parent":case"parentProperty":return t[r];case"path":return d.toPathString(t[r]);case"pointer":return d.toPointer(t.path);default:throw new TypeError("Unknown result type")}};d.prototype._handleCallback=function(t,r,e){if(r){var n=this._getPreferredOutput(t);t.path=typeof t.path=="string"?t.path:d.toPathString(t.path),r(n,e,t)}};d.prototype._trace=function(t,r,e,n,o,s,i,a){var u=this,l;if(!t.length)return l={path:e,value:r,parent:n,parentProperty:o,hasArrExpr:i},this._handleCallback(l,s,"value"),l;var c=t[0],p=t.slice(1),h=[];function y(b){Array.isArray(b)?b.forEach(function(w){h.push(w)}):h.push(b)}if((typeof c!="string"||a)&&r&&A.call(r,c))y(this._trace(p,r[c],$(e,c),r,c,s,i));else if(c==="*")this._walk(c,p,r,e,n,o,s,function(b,w,M,E,k,D,S,R){y(u._trace(H(b,M),E,k,D,S,R,!0,!0))});else if(c==="..")y(this._trace(p,r,e,n,o,s,i)),this._walk(c,p,r,e,n,o,s,function(b,w,M,E,k,D,S,R){P(E[b])==="object"&&y(u._trace(H(w,M),E[b],$(k,b),E,b,R,!0))});else{if(c==="^")return this._hasParentSelector=!0,{path:e.slice(0,-1),expr:p,isParentSelector:!0};if(c==="~")return l={path:$(e,c),value:o,parent:n,parentProperty:null},this._handleCallback(l,s,"property"),l;if(c==="$")y(this._trace(p,r,e,null,null,s,i));else if(/^(\x2D?[0-9]*):(\x2D?[0-9]*):?([0-9]*)$/.test(c))y(this._slice(c,p,r,e,n,o,s));else if(c.indexOf("?(")===0){if(this.currPreventEval)throw new Error("Eval [?(expr)] prevented in JSONPath expression.");this._walk(c,p,r,e,n,o,s,function(b,w,M,E,k,D,S,R){u._eval(w.replace(/^\?\(((?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?)\)$/,"$1"),E[b],b,k,D,S)&&y(u._trace(H(b,M),E,k,D,S,R,!0))})}else if(c[0]==="("){if(this.currPreventEval)throw new Error("Eval [(expr)] prevented in JSONPath expression.");y(this._trace(H(this._eval(c,r,e[e.length-1],e.slice(0,-1),n,o),p),r,e,n,o,s,i))}else if(c[0]==="@"){var f=!1,C=c.slice(1,-2);switch(C){case"scalar":(!r||!["object","function"].includes(P(r)))&&(f=!0);break;case"boolean":case"string":case"undefined":case"function":P(r)===C&&(f=!0);break;case"integer":Number.isFinite(r)&&!(r%1)&&(f=!0);break;case"number":Number.isFinite(r)&&(f=!0);break;case"nonFinite":typeof r=="number"&&!Number.isFinite(r)&&(f=!0);break;case"object":r&&P(r)===C&&(f=!0);break;case"array":Array.isArray(r)&&(f=!0);break;case"other":f=this.currOtherTypeCallback(r,e,n,o);break;case"null":r===null&&(f=!0);break;default:throw new TypeError("Unknown value type "+C)}if(f)return l={path:e,value:r,parent:n,parentProperty:o},this._handleCallback(l,s,"value"),l}else if(c[0]==="`"&&r&&A.call(r,c.slice(1))){var U=c.slice(1);y(this._trace(p,r[U],$(e,U),r,U,s,i,!0))}else if(c.includes(",")){var Q=c.split(","),_=kt(Q),J;try{for(_.s();!(J=_.n()).done;){var I=J.value;y(this._trace(H(I,p),r,e,n,o,s,!0))}}catch(b){_.e(b)}finally{_.f()}}else!a&&r&&A.call(r,c)&&y(this._trace(p,r[c],$(e,c),r,c,s,i,!0))}if(this._hasParentSelector)for(var g=0;g<h.length;g++){var O=h[g];if(O&&O.isParentSelector){var x=this._trace(O.expr,r,O.path,n,o,s,i);if(Array.isArray(x)){h[g]=x[0];for(var Z=x.length,T=1;T<Z;T++)g++,h.splice(g,0,x[T])}else h[g]=x}}return h};d.prototype._walk=function(t,r,e,n,o,s,i,a){if(Array.isArray(e))for(var u=e.length,l=0;l<u;l++)a(l,t,r,e,n,o,s,i);else e&&P(e)==="object"&&Object.keys(e).forEach(function(c){a(c,t,r,e,n,o,s,i)})};d.prototype._slice=function(t,r,e,n,o,s,i){if(!!Array.isArray(e)){var a=e.length,u=t.split(":"),l=u[2]&&Number.parseInt(u[2])||1,c=u[0]&&Number.parseInt(u[0])||0,p=u[1]&&Number.parseInt(u[1])||a;c=c<0?Math.max(0,c+a):Math.min(a,c),p=p<0?Math.max(0,p+a):Math.min(a,p);for(var h=[],y=c;y<p;y+=l){var f=this._trace(H(y,r),e,n,o,s,i,!0);f.forEach(function(C){h.push(C)})}return h}};d.prototype._eval=function(t,r,e,n,o,s){t.includes("@parentProperty")&&(this.currSandbox._$_parentProperty=s,t=t.replace(/@parentProperty/g,"_$_parentProperty")),t.includes("@parent")&&(this.currSandbox._$_parent=o,t=t.replace(/@parent/g,"_$_parent")),t.includes("@property")&&(this.currSandbox._$_property=e,t=t.replace(/@property/g,"_$_property")),t.includes("@path")&&(this.currSandbox._$_path=d.toPathString(n.concat([e])),t=t.replace(/@path/g,"_$_path")),t.includes("@root")&&(this.currSandbox._$_root=this.json,t=t.replace(/@root/g,"_$_root")),/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/.test(t)&&(this.currSandbox._$_v=r,t=t.replace(/@([\t-\r \)\.\[\xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])/g,"_$_v$1"));try{return this.vm.runInNewContext(t,this.currSandbox)}catch(i){throw console.log(i),new Error("jsonPath: "+i.message+": "+t)}};d.cache={};d.toPathString=function(t){for(var r=t,e=r.length,n="$",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+=/^[\*0-9]+$/.test(r[o])?"["+r[o]+"]":"['"+r[o]+"']");return n};d.toPointer=function(t){for(var r=t,e=r.length,n="",o=1;o<e;o++)/^(~|\^|@(?:[\0-\t\x0B\f\x0E-\u2027\u202A-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*?\(\))$/.test(r[o])||(n+="/"+r[o].toString().replace(/~/g,"~0").replace(/\//g,"~1"));return n};d.toPathArray=function(t){var r=d.cache;if(r[t])return r[t].concat();var e=[],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,i){return"[#"+(e.push(i)-1)+"]"}).replace(/\[["']((?:(?!['\]])[\s\S])*)["']\]/g,function(s,i){return"['"+i.replace(/\./g,"%@%").replace(/~/g,"%%@@%%")+"']"}).replace(/~/g,";~;").replace(/["']?\.["']?(?!(?:(?!\[)[\s\S])*\])|\[["']?/g,";").replace(/%@%/g,".").replace(/%%@@%%/g,"~").replace(/(?:;)?(\^+)(?:;)?/g,function(s,i){return";"+i.split("").join(";")+";"}).replace(/;;;|;;/g,";..;").replace(/;$|'?\]|'$/g,""),o=n.split(";").map(function(s){var i=s.match(/#([0-9]+)/);return!i||!i[1]?s:e[i[1]]});return r[t]=o,r[t].concat()};var Dt=function(r,e,n){for(var o=r.length,s=0;s<o;s++){var i=r[s];n(i)&&e.push(r.splice(s--,1)[0])}};d.prototype.vm={runInNewContext:function(r,e){var n=Object.keys(e),o=[];Dt(n,o,function(l){return typeof e[l]=="function"});var s=n.map(function(l,c){return e[l]}),i=o.reduce(function(l,c){var p=e[c].toString();return/function/.test(p)||(p="function "+p),"var "+c+"="+p+";"+l},"");r=i+r,!/(["'])use strict\1/.test(r)&&!n.includes("arguments")&&(r="var arguments = undefined;"+r),r=r.replace(/;[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF]*$/,"");var a=r.lastIndexOf(";"),u=a>-1?r.slice(0,a+1)+" return "+r.slice(a+1):" return "+r;return N(Function,pt(n).concat([u])).apply(void 0,pt(s))}};function rt(t,r,e,n){return v(this,null,function*(){let o=new Date,s=yield fetch(t,r);if(!s.ok)throw new Error("Fetch failed");let i=new Date(s.headers.get("date"));var a=s;if(n(s,"cached"),i<o){let u=yield fetch(t+"?"+Math.random(),L(F({},r),{method:"HEAD",cache:"no-cache"}));if(u.headers.get("last-modified")!=s.headers.get("last-modified")){if(e(u)===!1)throw new Error("Response is stale");a=yield fetch(t,L(F({},r),{cache:"reload"}))}}if(e(a)===!1)throw new Error("Response is not valid");return s!==a&&n(a,"valid"),a})}function Lt({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,component:n,version:o,revision:s="published"}){return`${t||r}/components/${e}/${n}/${o}/${s}.html`}function _t({cdn:t="https://feaascomponentsapidev.blob.core.windows.net",hostname:r,library:e,revision:n="published"}){return`${t||r}/styles/${e}/${n}.css`}function q(t,r){return v(this,null,function*(){return rt(Lt(t),{},e=>e.headers.get("x-ms-meta-versionDeletedAt")==null,e=>{e.text().then(r)})})}function V(t,r){return v(this,null,function*(){return rt(_t(t),{},e=>e.headers.get("x-ms-meta-deletedAt")==null,e=>{e.text().then(r)})})}function oe(t,r){let e=document.createElement("div");e.innerHTML=t;let n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.firstChild);return B(n,r),e}function Ot(t){return t.replace(/(\[[^\]\[]+\]|\.\*)$/g,"")}function Ht(t){return Ot(t)+".*"}function yt(t){let r=t.getAttribute("data-path-scope");for(var e=0,n=t;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==r&&e++;return e}function Bt(t,r,e){let n=t.getAttribute("data-path-scope");if(n==null)return;var o=yt(t);if(o!=0)return;let s=t.parentElement;if(s!=null){r==0?t.style.display="none":t.style.display&&(t.style.display="",t.getAttribute("style")==""&&t.removeAttribute("style"));for(var i=o+1,a=t,u=t;u=u.nextElementSibling;)u.getAttribute("data-path-scope")==n&&(i++,a=u);for(var l=i;l<r;l++)s.insertBefore(a.cloneNode(!0),a.nextElementSibling);for(var l=Math.max(1,r);l<i;l++)a=a.previousElementSibling,s.removeChild(a.nextElementSibling)}}function dt(t,r,e=!1,n=t){var o=r;let s=Object.keys(t).sort((a,u)=>u.length-a.length);for(let a of s)if(r.startsWith(a)){if(a==r){if(e)return t[a];continue}o=r.substring(a.length+1),n=t[a];break}let i=d({path:o,json:n});return e&&i&&Array.isArray(i)?i[0]:i}function z(t,r,e,n){var c;if(!!t){var o=t;n!=null&&n.processValue&&(e=n==null?void 0:n.processValue(t,r,e));var s=r.replace("data-path-","");if(r=="data-path-src")o=t.tagName=="IMG"?t:t.querySelector("img, video");else if(r=="data-path-href")o=t.querySelector("a")||t.closest("a");else if(r=="data-path-alt")o=t.querySelector("img, picture");else if(r=="data-path-hidden")e=e?null:!0;else if(r=="data-path"||r=="data-embed-html"||r=="html")s="innerHTML";else if(r=="data-embed-src")nt(t,e);else if(r=="data-path-attributes"){let p=((c=t.getAttribute("data-attributes-keys"))==null?void 0:c.split(",").filter(Boolean))||[];for(var i in e){var a=e[i];z(t,i,typeof a=="object"&&a?JSON.stringify(a):a,n)}for(var u=0;u<p.length;u++)(e==null||!(p[u]in e))&&z(t,p[u],null,n);z(t,"data-attributes-keys",Object.keys(e||{}).join(","));return}if(typeof e=="boolean"&&(e=e?"":null),!!o){var l=String(t.getAttribute("data-path-placeholder")||o[s]);e!=null?s=="innerHTML"?o.innerHTML!=e&&(o.innerHTML=e):o.getAttribute(s)!=e&&o.setAttribute(s,e):s=="innerHTML"?o.innerHTML=l:o.removeAttribute(s)}}}function It(t){let r=new t.ownerDocument.defaultView.MutationObserver(e=>{e.forEach(n=>{let o=n.target,s=o.getAttribute("data-embed-src");s&&nt(o,s),n.addedNodes&&n.addedNodes.forEach(i=>{i.nodeType==1&&$t(i,!1)})})});return r.observe(t,{attributes:!0,subtree:!0,childList:!0}),r}function $t(t,r=!0){let e=t.querySelectorAll("[data-embed-src]");for(var n=0;n<e.length;n++){let o=e[n];nt(o,o.getAttribute("data-embed-src"))}if(r)return It(t)}function nt(t,r){for(var e=t;e;e=e.parentElement)if(!e.parentElement){let o=e.querySelectorAll("script");for(var n=0;n<o.length;n++)if(o[n].getAttribute("src")==r)return!0;e.tagName=="HTML"&&(e=e.querySelector("head")||e);let s=e.ownerDocument.createElement("script");s.type="module",s.src=r,e.appendChild(s);break}}var ft=["data-attributes-keys","data-path-attributes","data-path-scope"];function B(t,r,e,n){var i,a,u;let o=t;if(n||(r=((i=e==null?void 0:e.processData)==null?void 0:i.call(e,o,r))||r),o.nodeType==1){let l=o.getAttribute("data-path-scope");if(l){let p=yt(o),h=dt(r,l,!1)||[];p==0&&Bt(o,((a=e==null?void 0:e.shouldRepeat)==null?void 0:a.call(e,o,h))===!1?1:h.length,e),r=L(F({},r),{[Ht(l)]:h[p]})}let c=Array.prototype.slice.call(o.attributes).sort((p,h)=>ft.indexOf(p.name)-ft.indexOf(h.name));for(var s=0;s<c.length;s++){let{name:p,value:h}=c[s];p.startsWith("data-path")&&p!="data-path-scope"&&z(o,p,dt(r,h,!0),e),p=="data-embed-src"&&z(o,p,o.getAttribute(p),e)}}for(var s=0;s<o.children.length;s++)B(o.children[s],r,e,!0);return n||(u=e==null?void 0:e.onRender)==null||u.call(e,o,r),o}function X(t,r,e,n){var s;let o=((s=n==null?void 0:n.processTemplate)==null?void 0:s.call(n,t,r,e))||r;return t.innerHTML=o,t.classList.add("-feaas"),B(t,e,n)}function se(t,r){return Nt(t,r||(r=document.createElement("style"))),r}function Nt(t,r){return r||(r=document.createElement("style")),V(t,e=>{r.textContent=e}).then(()=>r)}function ie(t,r){return jt(t,r||(r=document.createElement("div"))),r}function jt(t,r){return v(this,null,function*(){return r||(r=document.createElement("div")),r.childNodes.length?B(r,t.data,t):"template"in t?X(r,t.template,t.data,t):q(t,e=>X(r,e,t.data,t)).then(()=>r)})}var m=class extends HTMLElement{constructor(){super(...arguments);this.connected=null;this.refs={};this.descendants=[];this.onLoad=e=>{e!=null&&(this.payload=e,this.render())}}getProps(e){return{}}getRoot(){return this}attributeChangedCallback(e,n,o){this.set()}connectedCallback(){console.log("FEAAS: Connected",this),this.connected=new Event("feaasConnected",{bubbles:!0,composed:!0}),this.dispatchEvent(this.connected),this.addEventListener("feaasConnected",this),this.addEventListener("feaasDisconnected",this),this.set()}disconnectedCallback(){console.log("FEAAS: Disconnected",this),this.removeEventListener("feaasConnected",this),this.removeEventListener("feaasDisconnected",this),this.dispatchEvent(new Event("feaasDisconnected",{bubbles:!0,composed:!0})),this.connected=null}handleEvent(e){switch(e.type){case"feaasConnected":this.adoptedCallback(e);break;case"feaasDisconnected":this.orphanCallback(e);break}}orphanCallback(e){let n=e.composedPath()[0],o=this.descendants.indexOf(n);o!=-1&&(console.log("FEAAS: Orphaning",this,n),this.descendants.splice(o,-1),this.refs[n.getComponentName()]=null,n.refs.parent==this&&(n.refs.parent=null),n.refs.top==this&&(n.refs.top=n.refs.parent))}adoptedCallback(e){var s,i;let n=e.composedPath()[0];if(this.descendants.push(n),console.log("FEAAS: Adopting",this,n),this.refs[n.getComponentName()]=n,n.refs.top=this,(s=n.refs).parent||(s.parent=this),n.renderReact)for(var o=n.refs.parent;o;o=o.refs.parent)o.renderReact&&((i=n.refs).parentReact||(i.parentReact=o),n.refs.topReact=o)}getComponentName(){return this.tagName.replace("FEAAS-","").toLowerCase()}isReadyToLoad(){return this.payload===void 0&&this.getAttribute("hidden")==null}reify(){return v(this,null,function*(){this.payload!==void 0?this.render():this.isReadyToLoad()&&(this.payload=null,this.load().then(this.onLoad))})}load(){return Promise.resolve(null)}render(e=!1){var s,i,a;if(console.log("FEAAS: React",this.tagName,this.payload),this.payload==null)return;let{React:n,ReactDOM:o}=this.payload||{};if(!n)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?o.render(n.createElement(this.getReactWrapper()),this.getReactRoot()):this.forceUpdateReact?(s=this.forceUpdateReact)==null||s.call(this):(a=(i=this.refs.topReact).forceUpdateReact)==null||a.call(i)}invokeReactRendering(){let{React:e,ReactDOM:n}=this.payload||{},o=this.descendants.filter(s=>s.refs.parentReact==this&&s.payload).map((s,i)=>e.createElement(this.getReactWrapper(s),{key:this.tagName+"-"+i,slot:s.getAttribute("slot")}));return this.renderReact(L(F({},this.props),{children:o}),this.payload)}getReactWrapper(e=this,n=e.tagName){let o=e.reactWrapper||(e.reactWrapper=s=>{if(e.renderReact){let{React:i,ReactDOM:a}=e.payload||{},[u,l]=i.useReducer(c=>c+1,0);return e.forceUpdateReact=l,a.createPortal(i.createElement(i.Fragment,null,e.invokeReactRendering()),e.getReactRoot())}else return e.render()});return Object.assign(o,{displayName:n}),o}getUID(){return this.uid||(this.uid=String(Math.random()))}getReactRoot(){return this.getRoot()}set(e){this.overrides=F(F({},this.overrides),e),this.props=F(F({},this.getProps()),this.overrides);for(var n in this.props){let o=this.props[n];this.props[n]==null?this.removeAttribute(n):(typeof o=="string"||typeof o=="number")&&this.getAttribute(n)!=String(o)&&this.setAttribute(n,String(o))}this.scheduleRender()}scheduleRender(){cancelAnimationFrame(this.nextRender),this.nextRender=requestAnimationFrame(()=>{this.reify()})}formatURL(e,n){return typeof e=="string"&&e.match(/^\/[^\/]/)?n+e:e}getContextAttribute(e,n=this){var o,s;return(s=(o=n.closest(`[${e}]`))==null?void 0:o.getAttribute(e))!=null?s:this.getAttribute(e)}static register(e){window.customElements.get(e)||window.customElements.define(e,this)}};function pe(t=this){return{hidden:(t==null?void 0:t.getAttribute("hidden"))!=null}}var K=class extends m{attributeChangedCallback(e,n,o){e=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),o?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all"))}connectedCallback(){this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
4
4
  #loader {
5
5
  position: absolute;
6
6
  top: 0;
@@ -64,9 +64,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
64
64
  style="animation: 1.5s linear 0s infinite normal none running loader-circular-track"
65
65
  ></circle>
66
66
  </svg>
67
- </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};K.observedAttributes=["hidden"];K.register("feaas-loader");function Wt(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:t==null?void 0:t.getContextAttribute("cdn")}}var ot=class extends m{getProps(){return Wt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return v(this,null,function*(){V(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};ot.register("feaas-stylesheet");function zt(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var Y=class extends m{setData(e){this.set({data:e})}getProps(){return zt(this)}attributeChangedCallback(e,n,o){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,o)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var o=n;return o}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return v(this,null,function*(){if(!this.getOriginal())try{q(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)B(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;X(this,this.payload,this.props.data)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];Y.register("feaas-component");function Ut(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,o;for(;e!==window.top;){n=e.parent;for(let s=0;s<n.frames.length;s++)if(n.frames[s]===e){for(let i of n.document.getElementsByTagName("iframe"))if(i.contentWindow===e){o=i.getBoundingClientRect();let a=i.contentWindow.getComputedStyle(i);r.push({left:o.left+parseInt(a.borderLeftWidth),top:o.top+parseInt(a.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function Jt(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var st=class extends m{constructor(){super(...arguments);this.framePoint={top:0,left:0};this.wrapperRect={top:0,left:0,width:0,height:0};this.bodyRect={top:0,left:0,width:0,height:0};this.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Ut(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let o=this.wrapper.querySelector(".editor-chrome"),s=this.wrapper.querySelector(".ui.overlays");e?(o.style.width=e.width+16*2+"px",o.style.height=e.height+16*1+64+"px",o.style.left=e.left-16+"px",o.style.top=e.top-64+"px",s&&(s.style.left=n.left+"px",s.style.top=n.top+"px")):(o.style.left="-1000px",o.style.top="-1000px")}}getProps(){return Jt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:o},{Editor:s,VersionStatusList:i,Version:a,EditorUIUndo:u,EditorUIMode:l,React:{useEffect:c,useMemo:p,useState:h},Chakra:{HStack:y,Box:f},Chrome:C,ReactDOM:U,useSDK:Q,useSlots:_,useModelObserver:J}){if(!this.payload)return;let{sdk:I}=Q(),[g,O]=h(),x=I.library;c(()=>O(x.components.getItem(n)),[n,x]),c(()=>{g==null||g.versions.fetch()},[g]);let Z=p(this.getTarget,[this.props.for]),T=J(g==null?void 0:g.versions),b=p(()=>(T==null?void 0:T.filter(R=>R.id==o||!o))||[],[T]);if(!!g)return _(e,({picker:R,children:M})=>React.createElement(f,{ref:E=>this.wrapper=E},React.createElement(f,{className:"editor-wrapper",position:"absolute",left:0,top:0},React.createElement(s,{sdk:I,library:I.library,component:g,versions:b,context:{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}},({editor:E,status:k,isArchivedDisplayed:D})=>({after:M,picker:R,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var w;return D||!((w=S.saved||S.draft)!=null&&w.deletedAt)}).map((S,w)=>React.createElement(f,{key:S.head.id,position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none"},React.createElement(f,{className:"borders",pointerEvents:"none",left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(a,{version:S.head,node:Z},{left:React.createElement(y,{justifyContent:"space-between"},React.createElement(u,{size:"sm",editor:k=="ready"?E:null}),React.createElement(l,{size:"sm"})),middle:React.createElement(i,null)})))})))))}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};st.register("feaas-editor");function qt(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var it=class extends m{getProps(){return qt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:o,React:s,ReactDOM:i}){return s.createElement(o,{mode:e||void 0,onClose:this.props.onClose,context:r},n)}};it.register("feaas-picker");function Vt(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var at=class extends m{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return Vt(this)}render(){let{frontend:e,library:n,getToken:o,src:s,mode:i,context:a}=this.props;this.children.length==0&&(this.innerHTML=`
67
+ </div>`,this.getRoot().appendChild(this.stylesheet),this.getRoot().appendChild(this.loader)}};K.observedAttributes=["hidden"];K.register("feaas-loader");function Wt(t=this){var r;return{library:t==null?void 0:t.getContextAttribute("library"),revision:(r=t==null?void 0:t.getAttribute("revision"))!=null?r:"published",cdn:(t==null?void 0:t.getContextAttribute("cdn"))||(t==null?void 0:t.getContextAttribute("hostname"))}}var ot=class extends m{getProps(){return Wt(this)}isReadyToLoad(){return this.props.library!=null&&this.props.revision!=null&&this.props.cdn!=null}load(){return v(this,null,function*(){V(this.props,this.onLoad)})}render(){this.stylesheet||(this.stylesheet=document.createElement("style"),this.appendChild(this.stylesheet)),this.stylesheet.textContent=this.payload}};ot.register("feaas-stylesheet");function zt(t=this){let r,e=t.getAttribute("data");if(e!=null)try{r=typeof e=="string"?JSON.parse(e):{}}catch(n){}return{data:r!=null?r:{},library:t.getAttribute("library"),component:t.getAttribute("component"),version:t.getAttribute("version"),revision:t.getAttribute("revision"),hostname:t.getAttribute("hostname"),cdn:t.getContextAttribute("cdn"),template:t.getAttribute("template")}}var Y=class extends m{setData(e){this.set({data:e})}getProps(){return zt(this)}attributeChangedCallback(e,n,o){this.payload=void 0,this.needsRefresh=!0,super.attributeChangedCallback(e,n,o)}getOriginal(){let e=this.getAttribute("data-path-scope");if(!!e){for(var n=this;(n=n.previousElementSibling)&&n.getAttribute("data-path-scope")==e;)var o=n;return o}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}load(){return v(this,null,function*(){if(!this.getOriginal())try{q(this.props,this.onLoad)}catch(e){console.error(`FEAAS: Could not fetch component: ${this.props.component}/${this.props.version}/${this.props.revision}`)}})}render(){if(Array.from(this.children).filter(e=>e.tagName!="BR").length>0&&!this.needsRefresh)B(this,this.props.data);else{if(this.needsRefresh=!0,this.getOriginal())return;X(this,this.payload,this.props.data)}}};Y.observedAttributes=["library","component","version","revision","hostname","cdn","template","data"];Y.register("feaas-component");function Ut(t){let r=[];if(t){let e=t.ownerDocument.defaultView,n,o;for(;e!==window.top;){n=e.parent;for(let s=0;s<n.frames.length;s++)if(n.frames[s]===e){for(let i of n.document.getElementsByTagName("iframe"))if(i.contentWindow===e){o=i.getBoundingClientRect();let a=i.contentWindow.getComputedStyle(i);r.push({left:o.left+parseInt(a.borderLeftWidth),top:o.top+parseInt(a.borderTopWidth)})}e=n;break}}}return r.reduce((e,n)=>({left:e.left+n.left,top:e.top+n.top}),{left:0,top:0})}function Jt(t=this){var r;return{context:HTMLElement,frontend:t==null?void 0:t.getContextAttribute("frontend"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/editor.js",library:t==null?void 0:t.getAttribute("library"),component:t==null?void 0:t.getAttribute("component"),version:t==null?void 0:t.getAttribute("version"),revision:(t==null?void 0:t.getAttribute("revision"))||"saved",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,for:t==null?void 0:t.getAttribute("for")}}var st=class extends m{constructor(){super(...arguments);this.framePoint={top:0,left:0};this.wrapperRect={top:0,left:0,width:0,height:0};this.bodyRect={top:0,left:0,width:0,height:0};this.getTarget=()=>document.querySelector("iframe").contentWindow.document.getElementById(this.props.for);this.onChromeMeasureElement=(e,n)=>(n==null&&(n=e.getBoundingClientRect()),e.ownerDocument==document?{left:n.left-this.bodyRect.left,top:n.top-this.bodyRect.top,width:n.width,height:n.height}:{left:n.left+this.framePoint.left-this.bodyRect.left,top:n.top+this.framePoint.top-this.bodyRect.top,width:n.width,height:n.height});this.onBeforeMeasure=e=>{e.memoized.focusable&&(this.framePoint=Ut(e.memoized.focusable)),this.wrapperRect=this.wrapper.getBoundingClientRect(),this.bodyRect=this.wrapper.ownerDocument.body.parentElement.getBoundingClientRect()};this.onMeasure=()=>{};this.onPosition=({focusable:e,root:n})=>{let o=this.wrapper.querySelector(".editor-chrome"),s=this.wrapper.querySelector(".ui.overlays");e?(o.style.width=e.width+16*2+"px",o.style.height=e.height+16*1+64+"px",o.style.left=e.left-16+"px",o.style.top=e.top-64+"px",s&&(s.style.left=n.left+"px",s.style.top=n.top+"px")):(o.style.left="-1000px",o.style.top="-1000px")}}getProps(){return Jt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({children:e,component:n,version:o},{Editor:s,VersionStatusList:i,Version:a,EditorUIUndo:u,EditorUIMode:l,React:{useEffect:c,useMemo:p,useState:h},Chakra:{HStack:y,Box:f},Chrome:C,ReactDOM:U,useSDK:Q,useSlots:_,useModelObserver:J}){if(!this.payload)return;let{sdk:I}=Q(),[g,O]=h(),x=I.library;c(()=>O(x.components.getItem(n)),[n,x]),c(()=>{g==null||g.versions.fetch()},[g]);let Z=p(this.getTarget,[this.props.for]),T=J(g==null?void 0:g.versions),b=p(()=>(T==null?void 0:T.filter(w=>w.id==o||!o))||[],[T]);if(!!g)return _(e,({picker:w,children:M})=>React.createElement(f,{ref:E=>this.wrapper=E},React.createElement(f,{className:"editor-wrapper",position:"absolute",left:0,top:0},React.createElement(s,{sdk:I,library:I.library,component:g,versions:b,context:{onChromeMeasure:this.onMeasure,onChromeBeforeMeasure:this.onBeforeMeasure,onChromeMeasureElement:this.onChromeMeasureElement,onChromePosition:this.onPosition}},({editor:E,status:k,isArchivedDisplayed:D})=>({after:M,picker:w,chrome:E&&React.createElement(C,null),children:g.reduceVersionRevisions(b).filter(S=>{var R;return D||!((R=S.saved||S.draft)!=null&&R.deletedAt)}).map((S,R)=>React.createElement(f,{key:S.head.id,position:"absolute",left:0,top:0,className:"editor-chrome",p:4,boxShadow:"2xl",pointerEvents:"none"},React.createElement(f,{className:"borders",pointerEvents:"none",left:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",right:0,width:"4",top:0,bottom:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",top:0,height:"16",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(f,{className:"borders",pointerEvents:"none",bottom:0,height:"4",left:0,right:0,backdropFilter:"blur(2px)",background:"rgb(244 244 244 / 80%)",position:"absolute"}),React.createElement(a,{version:S.head,node:Z},{left:React.createElement(y,{justifyContent:"space-between"},React.createElement(u,{size:"sm",editor:k=="ready"?E:null}),React.createElement(l,{size:"sm"})),middle:React.createElement(i,null)})))})))))}isReadyToLoad(){return this.props.component!=null&&this.props.version!=null}};st.register("feaas-editor");function qt(t=this){var r,e;return{part:(t==null?void 0:t.getAttribute("part"))||"picker",slot:(t==null?void 0:t.getAttribute("part"))||"slot",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:void 0,onClose:void 0}}var it=class extends m{getProps(){return qt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}renderReact({context:r,mode:e,children:n},{Picker:o,React:s,ReactDOM:i}){return s.createElement(o,{mode:e||void 0,onClose:this.props.onClose,context:r},n)}};it.register("feaas-picker");function Vt(t=this){var r,e;return{library:(t==null?void 0:t.getAttribute("library"))||"library",mode:t==null?void 0:t.getAttribute("mode"),frontend:(r=t==null?void 0:t.getContextAttribute("frontend"))!=null?r:"https://components.sitecorecloud.io",src:(e=t==null?void 0:t.getAttribute("src"))!=null?e:"/assets/picker.js",hidden:(t==null?void 0:t.getAttribute("hidden"))!=null,context:null,getToken:null}}var at=class extends m{constructor(){super(...arguments);this.payload=null;this.onClose=()=>{this.setAttribute("hidden","hidden")}}getProps(){return Vt(this)}render(){let{frontend:e,library:n,getToken:o,src:s,mode:i,context:a}=this.props;this.children.length==0&&(this.innerHTML=`
68
68
  <feaas-context library='${n}'>
69
69
  <feaas-picker mode='${i}'>
70
70
  <feaas-loader />
71
71
  </feaas-context>
72
- `),this.refs.context.set({frontend:e,library:n,getToken:o}),this.refs.picker.set({frontend:e,context:a,src:s,mode:i,onClose:this.onClose})}};at.register("feaas-picker-lazy");function Xt(t=this){var r,e,n,o;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!=null?o:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var G=class extends m{getProps(){return Xt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:o,Chakra:{Button:s,Tooltip:i},React:{useRef:a}}){return i.defaultProps={hasArrow:!0,placement:"top",portalProps:{containerRef:{current:this.getRoot()}}},React.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getTheme:this.getTheme,modalProps:{portalProps:{containerRef:{current:this.getRoot()}}},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:{containerRef:{current:this.getRoot()}}}}},e)}};G.observedAttributes=["library","component","version","revision","hostname","template"];G.register("feaas-context");export{Y as FEAASComponent,zt as FEAASComponentsProps,G as FEAASContext,Xt as FEAASContextProps,st as FEAASEditor,Jt as FEAASEditorProps,K as FEAASLoader,pe as FEAASLoaderProps,it as FEAASPicker,at as FEAASPickerLazy,Vt as FEAASPickerLazyProps,qt as FEAASPickerProps,ot as FEAASStylesheet,Wt as FEAASStylesheetProps,$t as autoloadScripts,Ot as cleanCollectionBit,rt as fetchAndRevalidate,Ut as getFramePosition,nt as loadScript,Ht as normalizeCollectionScope,It as observeDOMElement,dt as queryScopes,ie as renderComponent,oe as renderComponentElement,jt as renderComponentPromise,X as renderDOMContent,B as renderDOMElement,se as renderStylesheet,Nt as renderStylesheetPromise,z as setDOMAttribute};
72
+ `),this.refs.context.set({frontend:e,library:n,getToken:o}),this.refs.picker.set({frontend:e,context:a,src:s,mode:i,onClose:this.onClose})}};at.register("feaas-picker-lazy");function Xt(t=this){var r,e,n,o;return{library:t==null?void 0:t.getAttribute("library"),src:(r=t==null?void 0:t.getAttribute("src"))!=null?r:"/assets/context.js",frontend:(e=t==null?void 0:t.getAttribute("frontend"))!=null?e:"https://components.sitecoreclud.io",backend:(n=t==null?void 0:t.getAttribute("backend"))!=null?n:"https://components-api.sitecoreclud.io",cdn:(o=t==null?void 0:t.getAttribute("cdn"))!=null?o:"https://feaascompontsapiprod.blob.core.windows.net",getToken:null}}var G=class extends m{getProps(){return Xt(this)}load(){return import(this.formatURL(this.props.src,this.props.frontend))}getTheme(e){return e}getRoot(){return this.shadowRoot||this.attachShadow({mode:"open"})}getReactRoot(){return this.reactRoot||(this.reactRoot=document.createElement("div"),this.getRoot().appendChild(this.reactRoot)),this.reactRoot}adoptedCallback(e){super.adoptedCallback(e);let n=e.composedPath()[0];n.parentNode!=this.getRoot()&&this.getRoot().appendChild(n)}renderReact({children:e,library:n},{AppContext:o,Chakra:{Button:s,Tooltip:i},React:a}){let u={containerRef:{current:this.getRoot()}};return i.defaultProps={hasArrow:!0,placement:"top",portalProps:u},a.createElement(o,{libraryId:this.props.library,container:this.getRoot(),getToken:this.props.getToken,getTheme:this.getTheme,modalProps:{portalProps:u},chakraProps:{cssVarsRoot:":host",resetCSS:!0,toastOptions:{portalProps:u}}},e)}};G.observedAttributes=["library","component","version","revision","hostname","template"];G.register("feaas-context");export{Y as FEAASComponent,zt as FEAASComponentsProps,G as FEAASContext,Xt as FEAASContextProps,st as FEAASEditor,Jt as FEAASEditorProps,K as FEAASLoader,pe as FEAASLoaderProps,it as FEAASPicker,at as FEAASPickerLazy,Vt as FEAASPickerLazyProps,qt as FEAASPickerProps,ot as FEAASStylesheet,Wt as FEAASStylesheetProps,$t as autoloadScripts,Ot as cleanCollectionBit,rt as fetchAndRevalidate,Ut as getFramePosition,nt as loadScript,Ht as normalizeCollectionScope,It as observeDOMElement,dt as queryScopes,ie as renderComponent,oe as renderComponentElement,jt as renderComponentPromise,X as renderDOMContent,B as renderDOMElement,se as renderStylesheet,Nt as renderStylesheetPromise,z as setDOMAttribute};
@@ -1432,7 +1432,7 @@ function FEAASStylesheetProps(element = this) {
1432
1432
  return {
1433
1433
  library: element == null ? void 0 : element.getContextAttribute("library"),
1434
1434
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1435
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1435
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1436
1436
  };
1437
1437
  }
1438
1438
  var FEAASStylesheet = class extends FEAASBase {
@@ -1390,7 +1390,7 @@ function FEAASStylesheetProps(element = this) {
1390
1390
  return {
1391
1391
  library: element == null ? void 0 : element.getContextAttribute("library"),
1392
1392
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1393
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1393
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1394
1394
  };
1395
1395
  }
1396
1396
  var FEAASStylesheet = class extends FEAASBase {
@@ -1441,7 +1441,7 @@ function FEAASStylesheetProps(element = this) {
1441
1441
  return {
1442
1442
  library: element == null ? void 0 : element.getContextAttribute("library"),
1443
1443
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1444
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1444
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1445
1445
  };
1446
1446
  }
1447
1447
  var FEAASStylesheet = class extends FEAASBase {
@@ -1901,30 +1901,28 @@ var FEAASContext = class extends FEAASBase {
1901
1901
  this.getRoot().appendChild(target);
1902
1902
  }
1903
1903
  }
1904
- renderReact({ children, library }, { AppContext, Chakra: { Button, Tooltip }, React: { useRef } }) {
1904
+ renderReact({ children, library }, { AppContext, Chakra: { Button, Tooltip }, React: React2 }) {
1905
+ const portalProps = {
1906
+ containerRef: { current: this.getRoot() }
1907
+ };
1905
1908
  Tooltip.defaultProps = {
1906
1909
  hasArrow: true,
1907
1910
  placement: "top",
1908
- portalProps: {
1909
- containerRef: { current: this.getRoot() }
1910
- }
1911
+ portalProps
1911
1912
  };
1912
- return /* @__PURE__ */ React.createElement(AppContext, {
1913
+ return /* @__PURE__ */ React2.createElement(AppContext, {
1913
1914
  libraryId: this.props.library,
1914
1915
  container: this.getRoot(),
1916
+ getToken: this.props.getToken,
1915
1917
  getTheme: this.getTheme,
1916
1918
  modalProps: {
1917
- portalProps: {
1918
- containerRef: { current: this.getRoot() }
1919
- }
1919
+ portalProps
1920
1920
  },
1921
1921
  chakraProps: {
1922
1922
  cssVarsRoot: ":host",
1923
1923
  resetCSS: true,
1924
1924
  toastOptions: {
1925
- portalProps: {
1926
- containerRef: { current: this.getRoot() }
1927
- }
1925
+ portalProps
1928
1926
  }
1929
1927
  }
1930
1928
  }, children);
@@ -1390,7 +1390,7 @@ function FEAASStylesheetProps(element = this) {
1390
1390
  return {
1391
1391
  library: element == null ? void 0 : element.getContextAttribute("library"),
1392
1392
  revision: (_a = element == null ? void 0 : element.getAttribute("revision")) != null ? _a : "published",
1393
- cdn: element == null ? void 0 : element.getContextAttribute("cdn")
1393
+ cdn: (element == null ? void 0 : element.getContextAttribute("cdn")) || (element == null ? void 0 : element.getContextAttribute("hostname"))
1394
1394
  };
1395
1395
  }
1396
1396
  var FEAASStylesheet = class extends FEAASBase {
@@ -1850,30 +1850,28 @@ var FEAASContext = class extends FEAASBase {
1850
1850
  this.getRoot().appendChild(target);
1851
1851
  }
1852
1852
  }
1853
- renderReact({ children, library }, { AppContext, Chakra: { Button, Tooltip }, React: { useRef } }) {
1853
+ renderReact({ children, library }, { AppContext, Chakra: { Button, Tooltip }, React: React2 }) {
1854
+ const portalProps = {
1855
+ containerRef: { current: this.getRoot() }
1856
+ };
1854
1857
  Tooltip.defaultProps = {
1855
1858
  hasArrow: true,
1856
1859
  placement: "top",
1857
- portalProps: {
1858
- containerRef: { current: this.getRoot() }
1859
- }
1860
+ portalProps
1860
1861
  };
1861
- return /* @__PURE__ */ React.createElement(AppContext, {
1862
+ return /* @__PURE__ */ React2.createElement(AppContext, {
1862
1863
  libraryId: this.props.library,
1863
1864
  container: this.getRoot(),
1865
+ getToken: this.props.getToken,
1864
1866
  getTheme: this.getTheme,
1865
1867
  modalProps: {
1866
- portalProps: {
1867
- containerRef: { current: this.getRoot() }
1868
- }
1868
+ portalProps
1869
1869
  },
1870
1870
  chakraProps: {
1871
1871
  cssVarsRoot: ":host",
1872
1872
  resetCSS: true,
1873
1873
  toastOptions: {
1874
- portalProps: {
1875
- containerRef: { current: this.getRoot() }
1876
- }
1874
+ portalProps
1877
1875
  }
1878
1876
  }
1879
1877
  }, children);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sitecore-feaas/clientside",
3
- "version": "0.1.7",
3
+ "version": "0.1.10",
4
4
  "scripts": {
5
5
  "start": "webpack serve --open",
6
6
  "build": "rm -rf dist; npm run build:node; npm run build:browser;",
@@ -59,32 +59,30 @@ export class FEAASContext extends FEAASBase<FEAASContextProps, typeof FEAASConte
59
59
 
60
60
  renderReact(
61
61
  { children, library }: React.PropsWithChildren<FEAASContextProps>,
62
- { AppContext, Chakra: { Button, Tooltip }, React: { useRef } }: typeof this.payload
62
+ { AppContext, Chakra: { Button, Tooltip }, React }: typeof this.payload
63
63
  ) {
64
+ const portalProps = {
65
+ containerRef: { current: this.getRoot() as HTMLElement }
66
+ }
64
67
  Tooltip.defaultProps = {
65
68
  hasArrow: true,
66
69
  placement: 'top',
67
- portalProps: {
68
- containerRef: { current: this.getRoot() as HTMLElement }
69
- }
70
+ portalProps
70
71
  }
71
72
  return (
72
73
  <AppContext
73
74
  libraryId={this.props.library}
74
75
  container={this.getRoot()}
76
+ getToken={this.props.getToken}
75
77
  getTheme={this.getTheme}
76
78
  modalProps={{
77
- portalProps: {
78
- containerRef: { current: this.getRoot() as HTMLElement }
79
- }
79
+ portalProps
80
80
  }}
81
81
  chakraProps={{
82
82
  cssVarsRoot: ':host',
83
83
  resetCSS: true,
84
84
  toastOptions: {
85
- portalProps: {
86
- containerRef: { current: this.getRoot() as HTMLElement }
87
- }
85
+ portalProps
88
86
  }
89
87
  }}
90
88
  >
@@ -5,7 +5,7 @@ export function FEAASStylesheetProps(element: FEAASBase = this) {
5
5
  return {
6
6
  library: element?.getContextAttribute('library'),
7
7
  revision: (element?.getAttribute('revision') ?? 'published') as 'published' | 'staging' | 'saved' | number,
8
- cdn: element?.getContextAttribute('cdn')
8
+ cdn: element?.getContextAttribute('cdn') || element?.getContextAttribute('hostname')
9
9
  }
10
10
  }
11
11
  export type FEAASStylesheetProps = ReturnType<typeof FEAASStylesheetProps>
@@ -31,7 +31,7 @@ export declare class FEAASContext extends FEAASBase<FEAASContextProps, typeof FE
31
31
  getReactRoot(): HTMLDivElement;
32
32
  /** Pull in children FEAAS react elements into the shadow DOM so they receieve the styles */
33
33
  adoptedCallback(event: Event): void;
34
- renderReact({ children, library }: React.PropsWithChildren<FEAASContextProps>, { AppContext, Chakra: { Button, Tooltip }, React: { useRef } }: typeof this.payload): JSX.Element;
34
+ renderReact({ children, library }: React.PropsWithChildren<FEAASContextProps>, { AppContext, Chakra: { Button, Tooltip }, React }: typeof this.payload): JSX.Element;
35
35
  }
36
36
  declare global {
37
37
  namespace JSX {
@@ -1,7 +1,7 @@
1
1
  import { FEAASBase } from './FEAASBase.js';
2
2
  export declare function FEAASStylesheetProps(element?: FEAASBase): {
3
3
  library: string;
4
- revision: number | "staging" | "published" | "saved";
4
+ revision: number | "published" | "staging" | "saved";
5
5
  cdn: string;
6
6
  };
7
7
  export declare type FEAASStylesheetProps = ReturnType<typeof FEAASStylesheetProps>;
@@ -9,7 +9,7 @@ export declare class FEAASStylesheet extends FEAASBase<FEAASStylesheetProps, str
9
9
  stylesheet: HTMLStyleElement;
10
10
  getProps(): {
11
11
  library: string;
12
- revision: number | "staging" | "published" | "saved";
12
+ revision: number | "published" | "staging" | "saved";
13
13
  cdn: string;
14
14
  };
15
15
  isReadyToLoad(): boolean;