@sitecore-feaas/clientside 0.5.13-alpha.2 → 0.5.15-alpha.1
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 +1 -1
- package/build/components/FEAASComponent.js.map +1 -1
- package/dist/browser/headless.cjs +1 -1
- package/dist/browser/headless.cjs.map +2 -2
- package/dist/browser/headless.esm.js +1 -1
- package/dist/browser/headless.esm.js.map +1 -1
- package/dist/browser/index.cjs +1 -1
- package/dist/browser/index.cjs.map +2 -2
- package/dist/browser/index.esm.js +1 -1
- package/dist/browser/index.esm.js.map +1 -1
- package/dist/browser/react.cjs +1 -1
- package/dist/browser/react.cjs.map +2 -2
- package/dist/browser/react.esm.js +1 -1
- package/dist/browser/react.esm.js.map +1 -1
- package/dist/node/headless.cjs +1 -1
- package/dist/node/headless.cjs.map +2 -2
- package/dist/node/headless.esm.js +1 -1
- package/dist/node/headless.esm.js.map +2 -2
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +2 -2
- package/dist/node/index.esm.js +1 -1
- package/dist/node/index.esm.js.map +2 -2
- package/dist/node/react.cjs +1 -1
- package/dist/node/react.cjs.map +2 -2
- package/dist/node/react.esm.js +1 -1
- package/dist/node/react.esm.js.map +2 -2
- package/headless.cjs +1 -1
- package/headless.cjs.map +2 -2
- package/headless.js +1 -1
- package/headless.js.map +2 -2
- package/package.json +1 -1
- package/react.cjs +1 -1
- package/react.cjs.map +2 -2
- package/react.js +1 -1
- package/react.js.map +2 -2
- package/src/components/FEAASComponent.tsx +1 -1
|
@@ -4,7 +4,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
4
4
|
`).trim();if(typeof e=="string")return e;if(e==null)return"";switch(e.type){case"heading":let{level:r,...n}=e.attrs;return le(e.content,n,"h"+r);case"text":return(e.marks||[]).reduce((i,o)=>le(i,o.attrs,{link:"a",bold:"strong",italic:"em",strike:"s",underline:"u"}[o.type]),(t=e.text)===null||t===void 0?void 0:t.replace(/\s+/," "));default:return le(e.content||e.text,e.attrs,{bulletList:"ul",orderedList:"ol",listItem:"li",horizontalRule:"hr",paragraph:"p",codeBlock:"code",blockquote:"blockquote"}[e.type])}}var D=class{constructor(t,r=1,n){this.ownerDocument={createElement(i){return new D(i)},createDocumentFragment(){return new D(null,11)}},this.nodeName=t,this.nodeType=r,this.textContent=n,this.attributes=[],this.childNodes=[]}setAttribute(t,r){let n=this.attributes.find(i=>i.name===t);n?n.value=r:this.attributes.push({name:t,value:r})}getAttribute(t){let r=this.attributes.find(n=>n.name===t);return r?r.value:void 0}insertBefore(t,r){if(t.parentNode=this,r===null)this.childNodes.push(t);else{let n=this.childNodes.indexOf(r);n!==-1&&this.childNodes.splice(n,0,t)}}removeAttribute(t){let r=this.attributes.findIndex(n=>n.name===t);r!==-1&&this.attributes.splice(r,1)}appendChild(t){t.parentNode=this,this.childNodes.push(t)}get tagName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toUpperCase()}get localName(){var t;return(t=this.nodeName)===null||t===void 0?void 0:t.toLowerCase()}get innerHTML(){return ce(this.childNodes)}set innerHTML(t){this.childNodes=de(String(t!=null?t:""))}get outerHTML(){return ce([this])}get children(){return this.childNodes.filter(t=>t.nodeType==1)}closest(t){let r=this;for(;r;){if(Oe(t,r))return r;r=r.parentNode}return null}querySelectorAll(t){let r=t.split(/\s*,\s*/),n=[],i=o=>{for(let a of r)if(Oe(a,o)){n.push(o);break}for(let a of o.childNodes)i(a)};for(let o of this.childNodes)i(o);return n}querySelector(t){return this.querySelectorAll(t)[0]}findSibling(t,r){if(!this.parentNode)return null;let n=this.parentNode.childNodes,i=n.indexOf(this);if(i===-1)return null;for(let o=i+t;o>=0&&o<n.length;o+=t){let a=n[o];if(!r||a.nodeType===1)return a}return null}removeChild(t){let r=this.childNodes.indexOf(t);if(r!==-1)return this.childNodes.splice(r,1),t.parentNode=void 0,t}get previousSibling(){return this.findSibling(-1)}get nextSibling(){return this.findSibling(1)}get previousElementSibling(){return this.findSibling(-1,!0)}get nextElementSibling(){return this.findSibling(1,!0)}cloneNode(t=!1){let r=new D(this.nodeName,this.nodeType);if(r.attributes=JSON.parse(JSON.stringify(this.attributes)),this.textContent&&(r.textContent=this.textContent),t)for(let n of this.childNodes){let i=n.cloneNode(!0);r.appendChild(i)}return r}get parentElement(){var t;return((t=this.parentNode)===null||t===void 0?void 0:t.nodeType)==1?this.parentNode:null}};function Oe(e,t){let r=e.match(/([.#]?[\w-]+|\[([\w-]+)(="([^"]*)")?\])/g);if(!r)return!1;for(let n of r)if(n.startsWith("#")){if(t.getAttribute("id")!==n.slice(1))return!1}else if(n.startsWith(".")){if(!(t.getAttribute("class")||"").split(" ").includes(n.slice(1)))return!1}else if(n.startsWith("[")){let i=n.match(/^\[([\w-]+)(="([^"]*)")?\]$/);if(i){let o=i[1],a=i[3],s=t.getAttribute(o);if(typeof a=="undefined"){if(s===void 0)return!1}else if(s!==a)return!1}else return!1}else if(t.nodeName!==n)return!1;return!0}function de(e){var t;let r=[],n=[];for(;e;){let i=e.match(/^<([\w-]+)(\s[^>]*)?>/),o=e.match(/^<\/([\w-]+)>/);if(i){let a=i[1].toLowerCase(),l=((t=(i[2]||"").match(/([\w-]+)(="([^"]*)")?/g))===null||t===void 0?void 0:t.map(u=>{let[h,d,,f]=u.match(/([\w-]+)(="([^"]*)")?/);return{name:d,value:ft(f||"")}}))||[],c=new D(a,1);if(c.attributes=l,n.length>0){let u=n[n.length-1];u.childNodes.push(c),c.parentNode=u}else r.push(c);["img","input","br"].includes(a)||n.push(c),e=e.slice(i[0].length)}else if(o)n.pop(),e=e.slice(o[0].length);else{let a=e.indexOf("<"),s=e.slice(0,a!==-1?a:void 0),l=new D("#text",3);if(l.textContent=s,n.length>0){let c=n[n.length-1];c.childNodes.push(l),l.parentNode=c}else r.push(l);e=e.slice(s.length)}}return r}function ht(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/'/g,"'")}function ce(e){return e.map(t=>{if(t.nodeType===3)return t.textContent||"";let{nodeName:r,attributes:n}=t,i=n.map(({name:a,value:s})=>` ${a}="${ht(String(s))}"`).join(""),o=ce(t.childNodes);return["img","input","br"].includes(r)?`<${r}${i} />`:`<${r}${i}>${o}</${r}>`}).join("")}function pt(e){let t=new e.ownerDocument.defaultView.MutationObserver(r=>{r.forEach(n=>{let i=n.target,o=i.getAttribute("data-embed-src");o&&G(i,o),n.addedNodes&&n.addedNodes.forEach(a=>{a.nodeType==1&&mt(a,!1)})})});return t.observe(e,{attributes:!0,subtree:!0,childList:!0}),t}function mt(e,t=!0){let r=e.querySelectorAll("[data-embed-src]");for(var n=0;n<r.length;n++){let i=r[n];G(i,i.getAttribute("data-embed-src"))}if(t)return pt(e)}function G(e,t){for(var r=e;r;r=r.parentElement)if(!r.parentElement){let i=r.querySelectorAll("script");for(var n=0;n<i.length;n++)if(i[n].getAttribute("src")==t)return!0;r.tagName=="HTML"&&(r=r.querySelector("head")||r);let o=r.ownerDocument.createElement("script");o.setAttribute("type","module"),o.setAttribute("src",t),r.appendChild(o);break}}var fe={};V(fe,{adjustNumbers:()=>gt,cleanCollectionBit:()=>K,getHumanizedLabel:()=>wt,getLastPathBit:()=>At,getQualifier:()=>bt,normalizeCollectionScope:()=>he,parseLimit:()=>yt,parseRange:()=>vt});var yt=e=>{var t;let r=parseInt((t=e==null?void 0:e.match(/\[0:(\d+)\]/))===null||t===void 0?void 0:t[1],10);return!isNaN(r)&&r>0?String(r):null},vt=e=>{var t;let r=(t=e==null?void 0:e.match(/\[([^\]]+)\]/))===null||t===void 0?void 0:t[1].split(/\s*,\s*/g).filter(Boolean).map(n=>{if(n.match(/^-?\d+$/))return n;let i=n.match(/^(\d+):(\d+)$/);return i&&parseInt(i[1],10)<parseInt(i[2],10)?i[1]+"-"+i[2]:null});return r!=null&&r.every(Boolean)?r.join(","):null},bt=e=>{var t;return(t=e==null?void 0:e.match(/(\.\*|\[[^\]]*\])$/))===null||t===void 0?void 0:t[0]};function K(e){return e.replace(/(\.?\[[^\]\[]*\]|\.\*)$/g,"")}function he(e){return K(e)+".*"}function gt(e,t){return e==null?void 0:e.replace(/(.|^)(\d+)/g,(r,n,i)=>n+(n==":"?i:String(parseInt(i)+t)))}function wt(e,t=2){var r=K(e).split(/]\.|\.\*\./g).pop().split(/\./g).slice(-3);return r=r.filter(n=>isNaN(parseInt(n))),r.map(n=>n.charAt(0).toUpperCase()+n.slice(1)).slice(-t).join(" ")}function At(e){return K(e).split(".").pop()}var St=["January","February","March","April","May","June","July","August","September","October","November","December"],Te=e=>{if(!e||typeof e.getDay!="function")return;let t=e.getFullYear(),r=St[e.getMonth()],n=e.getDate();return`${r} ${n}, ${t}`},$e=function(e){return String(new Date(e))!=="Invalid Date"&&!isNaN(Number(new Date(e)))};function ke(e){let t=e.getAttribute("data-path-scope");for(var r=0,n=e;n=n.previousElementSibling;)n.getAttribute("data-path-scope")==t&&r++;return r}function xt(e,t,r){let n=e.getAttribute("data-path-scope");if(n==null)return;var i=ke(e);if(i!=0)return;let o=e.parentNode;if(o!=null){t==0?e.setAttribute("hidden","hidden"):e.getAttribute("hidden")!=null&&e.removeAttribute("hidden");for(var a=i+1,s=e,l=e;l=l.nextElementSibling;)l.getAttribute("data-path-scope")==n&&(a++,s=l);for(var c=a;c<t;c++)o.insertBefore(s.cloneNode(!0),s.nextElementSibling);for(var c=Math.max(1,t);c<a;c++)s=s.previousElementSibling,o.removeChild(s.nextElementSibling)}}function N(e,t,r,n){var i,o,a;if(!e)return;var s=e;(r==null?void 0:r.type)=="doc"&&Array.isArray(r.content)&&(r=$(r)),n!=null&&n.processValue&&(r=n==null?void 0:n.processValue(e,t,r));var l=t.replace("data-path-","");if(t=="data-path-src"||t=="data-path-alt"){let y=Array.from(e.children).find(S=>S.localName=="picture")||e;s=e.localName=="img"?e:y.querySelector("img, video")}else if(t=="data-path-href")s=e.querySelector("a")||e.closest("a");else if(t=="data-path-hidden")r=r?null:!0;else if(t=="data-path"||t=="data-embed-html"||t=="html")l="innerHTML";else if(t=="data-embed-src")G(e,r);else if(t=="data-path-attributes"){if(!Array.isArray(r)){let y=((i=e.getAttribute("data-attributes-keys"))===null||i===void 0?void 0:i.split(",").filter(Boolean))||[];if(!Array.isArray(r))for(var c in r){var u=r[c];N(e,c,typeof u=="object"&&u?JSON.stringify(u):u,n)}for(var h=0;h<y.length;h++)(r==null||!(y[h]in r))&&N(e,y[h],null,n);N(e,"data-attributes-keys",Object.keys(r||{}).join(","))}if(e.tagName=="FEAAS-EXTERNAL"){let y=String(e.getAttribute("data-path-attributes")||"").slice(0,-1).split(".")[0]||"_";N(e,"datasources",JSON.stringify({[y]:r}))}return}if(typeof r=="boolean"&&(r=r?"":null),!s)return;if((l=="innerHTML"||l=="src")&&(r==null||r==="")){var f=String((a=(o=e.getAttribute("data-path-placeholder")||s[l])!==null&&o!==void 0?o:s.getAttribute(l))!==null&&a!==void 0?a:"");l=="innerHTML"?s.innerHTML=f:f?s.setAttribute(l,f):s.removeAttribute(l)}else if(r!=null)if(l=="innerHTML"){for(var b=String(r),m=s;m.parentElement&&m.localName.match(/^(a|var|strong|em|i|b)$/);)m=m.parentElement;m.localName.match(/p|h\d|button|time|li/)&&(b=b.replace(/<(p|h\d|li|ul)[^>]*?>|<\/(p|h\d|li|ul)[^>]*?>/g," ").trim().replace(/\s+/g," ")),String(m.getAttribute("class")).includes("-inline--time")&&$e(b)&&(b=Te(new Date(b))),s.innerHTML!=b&&(s.innerHTML=b)}else s.getAttribute(l)!=r&&s.setAttribute(l,r);else s.removeAttribute(l)}var Pe=["data-attributes-keys","data-path-attributes","data-path-scope"];function A(e,t,r,n){var i,o,a;let s=e;if(n||(t=((i=r==null?void 0:r.processData)===null||i===void 0?void 0:i.call(r,s,t))||t),s.nodeType==1){let u=s.getAttribute("data-path-scope");if(u){let d=ke(s),f=q(t,u,!1);d==0&&xt(s,((o=r==null?void 0:r.shouldRepeat)===null||o===void 0?void 0:o.call(r,s,f))===!1?1:f.length,r),t={...t,[he(u)]:f[d]}}let h=Array.prototype.slice.call(s.attributes).sort((d,f)=>Pe.indexOf(d.name)-Pe.indexOf(f.name));for(var l=0;l<h.length;l++){let{name:d,value:f}=h[l];d.startsWith("data-path")&&d!="data-path-scope"&&N(s,d,q(t,f,!0,void 0,s.tagName!="FEAAS-EXTERNAL"),r),d=="data-embed-src"&&N(s,d,s.getAttribute(d),r)}}for(var l=0,c;c=s.childNodes[l++];)Me(c)&&A(c,t,r,!0);return n||(a=r==null?void 0:r.onRender)===null||a===void 0||a.call(r,s,t),s}function Me(e){return e.nodeType==1}function P(e,t,r,n){var i;let o=((i=n==null?void 0:n.processTemplate)===null||i===void 0?void 0:i.call(n,e,t,r))||t;if(e.innerHTML=o,e.classList.add("-feaas"),(e.closest(".component.feaas")||e).className.includes("-theme--"))for(var s=0,l;l=e.childNodes[s++];)Me(l)&&(l.className=l.className.replace(/(\s|^)-theme--[^\s]+\s*/g,"$1"));return A(e,r,n)}function Et(e,t,r,n=!1){var i;let o=((i=r==null?void 0:r.processTemplate)===null||i===void 0?void 0:i.call(r,null,e,t))||e;if(typeof document=="undefined"||n){let a=de(o);return A(a[0],t,r).outerHTML}else{let a=document.createElement("div");return a.innerHTML=o,A(a,t,r),a.innerHTML}}var Le=["initial","check","updated"],Y={};function ir(){Y={}}async function X(e,t,r,n,i=Y){return k({url:e,options:t,validator:r,callback:n,cache:i}).then(Q).then(o=>o.response)}async function k({url:e,options:t,validator:r,callback:n,cache:i},o="initial"){let a=new Date;if(i!=null){var s=Ct(e);if(Le.indexOf(s.phase)>=Le.indexOf(o))var l=s[o];else s.phase=o}let c=await(l||fetch(e,t));if(!l&&s&&(c.ok?s[o].resolve(c):s[o].reject(new Error("Fetch failed"))),!c.ok)throw new Error("Fetch failed");let u=new Date(c.headers.get("date"))<a||l&&o=="initial"&&(s.phase=="updated"||s.phase=="check");if((r==null?void 0:r(c,u))===!1)throw new me("Response is not valid");return await(n==null?void 0:n(c,o,u)),{url:e,options:t,isCached:u,response:c,validator:r,callback:n,cache:i}}function Ct(e,t=!1){let r=String(e).replace("?head","");var n=Y[r];return!n&&!t&&(n=Y[r]={phase:null,initial:x(),check:x(),updated:x(),final:x()}),n}var me=class extends Error{};async function Q(e){let{url:t,isCached:r,options:n,validator:i,response:o,cache:a}=e;if(r){let{response:s}=await k({url:t+"?head",options:{...n,method:"HEAD",cache:"no-cache"},validator:i,cache:a},"check");if(s.headers.get("last-modified")!=o.headers.get("last-modified"))return ye(e)}return e}async function ye(e){return k({...e,options:{...e.options,cache:"reload"}},"updated")}var _="https://feaas.blob.core.windows.net";function Z(e){let t=e.match(/^(?:(.*?)\/components)?\/?([^\/]+)\/([^\/]+)(?:\/([^\/]+)(?:\/(published|staged|saved|\d+)(?:\.html?)?)?)?$/);if(t){var[,r,n,i,o,a]=t;return{cdn:r,library:n,component:i,version:o,revision:a}}}function sr(e){if(!e||!e.library||!e.component)throw new Error("Component requires `library` and `component` properties");return`${e.cdn&&e.cdn!=_?`${e.cdn}/components`:""}/${e.library}/${e.component}/${!e.version||e.version=="responsive"&&(!e.revision||e.revision=="published")?"":e.version}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/(^\/|\/$|\/\/)(?!.+\/components\/)/g,"")}function lr(e){return`${e.cdn&&e.cdn!=_?`${e.cdn}/styles/`:""}${e.library}/${!e.revision||e.revision=="published"?"":e.revision}`.replace(/\/$|\/\/(?!.+\/styles\/)/g,"")}function W(e){let t=e.match(/^(?:(.*?)\/styles\/)?([^\/]+)(?:\/(published|staged|saved|\d+)(?:.css)?)?$/);if(t){var[,r,n,i]=t;return{cdn:r,library:n,revision:i}}else{let o=Z(e);if(o){var{cdn:r,library:n,revision:i}=o;return i!=null&&i.match(/\d/)&&(i=void 0),{cdn:r,library:n,revision:i}}}}function je(e){return typeof e=="string"&&(e={src:e}),"src"in e&&(e={...Z(e.src)}),`${e.cdn||e.hostname||_}/components/${e.library}/${e.component}/${e.version||"responsive"}/${e.revision||"published"}.html`}function ee(e){if(typeof e=="string"&&(e={src:e}),"src"in e){if(String(e.src).includes("v1/files/components/styles"))return e.src;e={...W(e.src)}}return`${e.cdn||e.hostname||_}/styles/${e.library}/${e.revision=="staged"?"staged":e.revision=="saved"?"saved":"published"}.css`}async function H(e,t,r=!1){let n=s=>s.headers.get("x-ms-meta-versionDeletedAt")==null,i=s=>s.clone().text().then(t),o=await Promise.all([e.instance&&k({options:{headers:{Accept:"text/html"},credentials:"omit"},url:je({...e,version:e.instance}),validator:n}).catch(s=>s),k({url:je(e),validator:n}).catch(s=>s)]),a=o.find(s=>s&&"isCached"in s&&s);if(!a||a instanceof Error)throw o.find(l=>l&&l instanceof Error)||new Error("Can not fetch component");return o[0]==a&&console.log("Using fork!",o),await i(a.response),r?a:Q({...a,callback:i}).catch(s=>{if(o[0]==a&&(ye({...a,callback:null,validator:null}),console.log("Fork was deleted"),!(o[1]instanceof Error)))return i(o[1].response),Q({...o[1],callback:i});throw s})}async function ur(e){typeof e=="string"&&(e={src:e});var t;let{response:r}=await H(e,n=>{t=n},!0);return{...e,template:t,lastModified:r.headers.get("last-modified")}}async function ve(e,t){return X(ee(e),{headers:{Accept:"text/css"},credentials:"omit"},r=>r.headers.get("x-ms-meta-deletedAt")==null,(r,n)=>r.clone().text().then(i=>t(i,n)))}function hr(e,t){return _t(e,t||(t=document.createElement("style"))),t}function _t(e,t){return t||(t=document.createElement("style")),ve(e,(r,n)=>{t.textContent=r}).then(()=>t)}var Dt=new WeakSet;function be(e,t){var r,n=Ft(e);if(n){if(Dt.has(n))return Promise.resolve(n);e=n.getAttribute("data-href")||n.getAttribute("href")}return ve(e,(i,o)=>{o=="initial"&&n||(r||(r=!n||n.tagName=="LINK"?Rt(e):n),r.textContent=i),t==null||t(i,o)}).then(()=>r||n)}function Ie(e){return new Promise((t,r)=>{be(e,t).catch(r)})}function Ft(e){let t=ee(e),{library:r}=W(t),n=`/files/components/styles/${r}.css`;return document.querySelector(`style[data-href="${t}"],
|
|
5
5
|
link[rel="stylesheet"][href="${t}"],
|
|
6
6
|
style[data-href*="${n}"],
|
|
7
|
-
link[rel="stylesheet"][href*="${n}"]`)}function Rt(e){let t=ee(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function yr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ue(e,t){return Nt(e,t||(t=document.createElement("div"))),t}async function Nt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?P(t,e.template,e.data,e):H(e,r=>P(t,r,e.data,e)).then(()=>t)}function Ot(e){let{params:t,method:r,headers:n,body:i,url:o}=w(e);var a={url:o},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(a.headers=s),r!=="GET"&&(a.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(a.body=i),Object.keys(t).length>0&&(a={...a,params:t}),a}var M=e=>{if(!e||typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function Be(e){let{url:t,headers:r,params:n,method:i,body:o}=w(e),a,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(a=JSON.stringify(o)),s==="multipart/form-data"&&(a=Object.keys(o).reduce((c,u)=>(c.append(u,o[u]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(a=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:a,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var ge=async e=>{try{let[t,r]=Be(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?B(i,e.jsonpath):i}catch(t){return{}}};async function We(e){if(!e)return e;if(M(e))return ge(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>M(e[n])?ge(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:M(e[i])?r.shift():e[i]}),{})}function Tt(e){return e?M(e)||Object.values(e).some(M):!1}w.clean=Ot;w.toFetchArguments=Be;w.fetchOne=ge;w.fetch=We;w.isDataSettings=M;w.hasDataSettings=Tt;w.fetchImplementation=(...e)=>fetch(...e);function $t(e){var t,r,n,i,o,a,s,l;let c,u=e.getAttribute("src");if(u){let O=Z(u);if(!O)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:h,library:d,component:f,version:b,revision:m}=O}let y=e.getAttribute("data");if(y!=null&&y!="")try{c=typeof y=="string"?JSON.parse(y):{}}catch(O){console.error(O)}let S=e.getAttribute("fetch");return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:f,version:(a=(o=e.getAttribute("version"))!==null&&o!==void 0?o:b)!==null&&a!==void 0?a:"responsive",revision:(l=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),fetch:S=="false"?[]:S==null||S=="true"?["data","template","stylesheet"]:S.split(/(\s+|\-)+/g).filter(Boolean)}}var te=class extends E{setData(t){this.set({data:t})}getProps(){return $t(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0,this.alreadyRendered&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(t,r,n),t=="data"&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!w.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=x(r=>this.readyData=r,r=>this.onError(r)),this.defaultProps={cdn:_,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=r=>{this.payload=r,this.advance()};let t=this.getAttribute("data");this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){var t;if(this.getOriginal())return;let r=()=>{this.payload!=null&&(n||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var n=Ie({...this.props}).then(()=>{n=null,r()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var i=H(this.props,o=>{this.payload=o,this.needsRefresh=!0,r()})}else this.payload=(t=this.props.template)!==null&&t!==void 0?t:this.innerHTML;return Promise.all([n,this.whenDataReady.then(()=>r()),i]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh))if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;P(this,this.payload,this.readyData)}}};te.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];te.register("feaas-component");function Pt(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var re=class extends E{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Pt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
7
|
+
link[rel="stylesheet"][href*="${n}"]`)}function Rt(e){let t=ee(e),r=document.createElement("style");return r.setAttribute("data-href",t),document.head.appendChild(r),r}function yr(e,t){let r=document.createElement("div");r.innerHTML=e;let n=document.createDocumentFragment();for(;r.firstChild;)n.appendChild(r.firstChild);return A(n,t),r}function Ue(e,t){return Nt(e,t||(t=document.createElement("div"))),t}async function Nt(e,t){return t||(t=document.createElement("div")),t.childNodes.length?A(t,e.data,e):"template"in e?P(t,e.template,e.data,e):H(e,r=>P(t,r,e.data,e)).then(()=>t)}function Ot(e){let{params:t,method:r,headers:n,body:i,url:o}=w(e);var a={url:o},s={...n};return n["Content-Type"]==="application/json"&&delete s["Content-Type"],n.Accept==="application/json"&&delete s.Accept,Object.keys(s).length>0&&(a.headers=s),r!=="GET"&&(a.method=r),r==="GET"||r==="HEAD"||Object.keys(i).length===0||(a.body=i),Object.keys(t).length>0&&(a={...a,params:t}),a}var M=e=>{if(!e||typeof e.url!="string")return!1;for(var t in e)if(!(t=="body"||t=="params"||t=="headers"||t=="url"||t==="method"||t=="jsonpath"&&typeof e[t]=="string"))return!1;return!0};function Be(e){let{url:t,headers:r,params:n,method:i,body:o}=w(e),a,s=r["Content-Type"];i!="GET"&&i!="HEAD"&&(s==="application/json"&&(a=JSON.stringify(o)),s==="multipart/form-data"&&(a=Object.keys(o).reduce((c,u)=>(c.append(u,o[u]),c),new FormData)),s==="application/x-www-form-urlencoded"&&(a=new URLSearchParams(o)));let l=Object.keys(n).length?`?${new URLSearchParams(n)}`:"";return[`${t}${l}`,{headers:r,body:a,method:i}]}function w(e){let t={};for(let r in(e==null?void 0:e.headers)||{})if(e.headers.hasOwnProperty(r)){let n=r.replace(/^[a-z]|\-[a-z]/g,i=>i.toUpperCase());t[n]=e.headers[r]}return t.Accept||(t.Accept="application/json"),{params:(e==null?void 0:e.params)||{},headers:t,jsonpath:String((e==null?void 0:e.jsonpath)||"$"),method:((e==null?void 0:e.method)||"GET").toUpperCase(),body:(e==null?void 0:e.body)||{},url:String((e==null?void 0:e.url)||"")}}var ge=async e=>{try{let[t,r]=Be(e),i=await(await w.fetchImplementation(t,{...r,method:r.method.toLowerCase()})).json();return e.jsonpath&&e.jsonpath!="$"?B(i,e.jsonpath):i}catch(t){return{}}};async function We(e){if(!e)return e;if(M(e))return ge(e);let t=Object.keys(e),r=await Promise.all(t.map(n=>M(e[n])?ge(e[n]):null).filter(Boolean));return t.reduce((n,i)=>({...n,[i]:M(e[i])?r.shift():e[i]}),{})}function Tt(e){return e?M(e)||Object.values(e).some(M):!1}w.clean=Ot;w.toFetchArguments=Be;w.fetchOne=ge;w.fetch=We;w.isDataSettings=M;w.hasDataSettings=Tt;w.fetchImplementation=(...e)=>fetch(...e);function $t(e){var t,r,n,i,o,a,s,l;let c,u=e.getAttribute("src");if(u){let O=Z(u);if(!O)throw new Error(`Could not parse FEAAS Component source: ${u}`);var{cdn:h,library:d,component:f,version:b,revision:m}=O}let y=e.getAttribute("data");if(y!=null&&y!="")try{c=typeof y=="string"?JSON.parse(y):{}}catch(O){console.error(O)}let S=e.getAttribute("fetch");return{data:c||{},cdn:(r=(t=e.getContextAttribute("cdn"))!==null&&t!==void 0?t:h)!==null&&r!==void 0?r:_,library:(n=e.getAttribute("library"))!==null&&n!==void 0?n:d,component:(i=e.getAttribute("component"))!==null&&i!==void 0?i:f,version:(a=(o=e.getAttribute("version"))!==null&&o!==void 0?o:b)!==null&&a!==void 0?a:"responsive",revision:(l=(s=e.getAttribute("revision"))!==null&&s!==void 0?s:m)!==null&&l!==void 0?l:"published",hostname:e.getAttribute("hostname"),template:e.getAttribute("template"),instance:e.getAttribute("instance"),editable:e.getAttribute("editable")!=null,suspended:e.getAttribute("suspended")!=null,lastModified:e.getAttribute("last-modified"),fetch:S=="false"?[]:S==null||S=="true"?["data","template","stylesheet"]:S.split(/(\s+|\-)+/g).filter(Boolean)}}var te=class extends E{setData(t){this.set({data:t})}getProps(){return $t(this)}isJSONAttribute(t){return t=="data"}attributeChangedCallback(t,r,n){r!==n&&((t=="library"||t=="component"||t=="revision"||t=="version")&&(this.payload=void 0,this.alreadyRendered&&this.connected&&(this.needsRefresh=!0,this.needsToFetchTemplate=!0)),super.attributeChangedCallback(t,r,n),t=="data"&&(this.needsRefresh=!0,(this.props.fetch.includes("data")||this.alreadyRendered||!w.hasDataSettings(this.props.data))&&this.fetchData()))}async fetchData(){this.readyData=void 0,this.whenDataReady=this.whenDataReady.restart();let t=await w.fetch(this.props.data),r=this.alreadyRendered;await this.whenDataReady.resolve(t),r&&this.advance()}getEditor(){var t;return(t=document.querySelector("feaas-context"))===null||t===void 0?void 0:t.refs.editor}constructor(){super(),this.readyData={},this.whenDataReady=x(r=>this.readyData=r,r=>this.onError(r)),this.defaultProps={cdn:_,revision:"published",version:"responsive",editable:!1,suspended:!1,data:{}},this.onLoad=r=>{this.payload=r,this.advance()};let t=this.getAttribute("data");this.getAttribute("data")||this.whenDataReady.resolve({}),this.addEventListener("click",()=>{this.props.editable&&this.edit()})}edit(){let t=this.getEditor();if(t!=null&&t.setTarget(this))return t.open(),!0}getOriginal(){let t=this.getAttribute("data-path-scope");if(t){for(var r=this;(r=r.previousElementSibling)&&r.getAttribute("data-path-scope")==t;)var n=r;return n}}isReadyToLoad(){return super.isReadyToLoad()&&this.props.library!=null&&this.props.component!=null&&this.props.version!=null}async load(){var t;if(this.getOriginal())return;let r=()=>{this.payload!=null&&(n||this.readyData&&this.onLoad(this.payload))};if(this.props.fetch.includes("stylesheet"))var n=Ie({...this.props}).then(()=>{n=null,r()});if(this.props.fetch.includes("template")||this.needsToFetchTemplate){this.needsToFetchTemplate=!1;var i=H(this.props,o=>{this.payload=o,this.needsRefresh=!0,r()})}else this.payload=(t=this.props.template)!==null&&t!==void 0?t:this.innerHTML;return Promise.all([n,this.whenDataReady.then(()=>r()),i]).then(()=>this.payload)}flush(){this.readyData&&super.flush()}update(){if(this.alreadyRendered=!0,!(!this.props.fetch.includes("data")&&!this.props.fetch.includes("template")&&this.firstElementChild&&!this.needsRefresh))if(Array.from(this.children).filter(t=>t.tagName!="BR").length>0&&!this.needsRefresh)A(this,this.readyData);else{if(this.needsRefresh=!1,this.getOriginal())return;P(this,this.payload,this.readyData)}}};te.observedAttributes=["library","component","version","revision","hostname","cdn","template","data","instance","editable","with-stylesheet"];te.register("feaas-component");function Pt(e){return{opacity:e!=null&&e.getAttribute("opacity")?parseFloat(e==null?void 0:e.getAttribute("opacity")):1,hidden:(e==null?void 0:e.getAttribute("hidden"))!=null}}var re=class extends E{constructor(){super(...arguments),this.defaultProps={hidden:!1}}getProps(){return Pt(this)}attributeChangedCallback(t,r,n){if(r!==n)return t=="hidden"&&(this.style.setProperty("display","block","important"),this.style.setProperty("transition","opacity 0.3s","important"),n?(this.style.setProperty("opacity","0","important"),this.style.pointerEvents="none"):(this.style.setProperty("opacity","1","important"),this.style.pointerEvents="all")),super.attributeChangedCallback(t,r,n)}connectedCallback(){this.payload=null,super.connectedCallback(),this.attributeChangedCallback("hidden",this.getAttribute("hidden"),this.getAttribute("hidden")),this.stylesheet=document.createElement("style"),this.stylesheet.textContent=`
|
|
8
8
|
#loader {
|
|
9
9
|
position: absolute;
|
|
10
10
|
top: 0;
|