@confidencesystemsinc/sdk 1.4.8 → 1.4.9
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/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -689,4 +689,4 @@ svg:not(:root).svg-inline--fa, svg:not(:host).svg-inline--fa {
|
|
|
689
689
|
}`;function Tg(){const e=bg,r=xg,o=Se.cssPrefix,i=Se.replacementClass;let a=Dx;if(o!==e||i!==r){const d=new RegExp("\\.".concat(e,"\\-"),"g"),h=new RegExp("\\--".concat(e,"\\-"),"g"),v=new RegExp("\\.".concat(r),"g");a=a.replace(d,".".concat(o,"-")).replace(h,"--".concat(o,"-")).replace(v,".".concat(i))}return a}let oh=!1;function Nf(){Se.autoAddCss&&!oh&&(Ax(Tg()),oh=!0)}var _x={mixout(){return{dom:{css:Tg,insertCss:Nf}}},hooks(){return{beforeDOMElementCreation(){Nf()},beforeI2svg(){Nf()}}}};const no=ri||{};no[ro]||(no[ro]={});no[ro].styles||(no[ro].styles={});no[ro].hooks||(no[ro].hooks={});no[ro].shims||(no[ro].shims=[]);var wn=no[ro];const Rg=[],Pg=function(){it.removeEventListener("DOMContentLoaded",Pg),ac=1,Rg.map(e=>e())};let ac=!1;ao&&(ac=(it.documentElement.doScroll?/^loaded|^c/:/^loaded|^i|^c/).test(it.readyState),ac||it.addEventListener("DOMContentLoaded",Pg));function Lx(e){ao&&(ac?setTimeout(e,0):Rg.push(e))}function Jl(e){const{tag:r,attributes:o={},children:i=[]}=e;return typeof e=="string"?Cg(e):"<".concat(r," ").concat(Ox(o),">").concat(i.map(Jl).join(""),"</").concat(r,">")}function ih(e,r,o){if(e&&e[r]&&e[r][o])return{prefix:r,iconName:o,icon:e[r][o]}}var $f=function(r,o,i,a){var d=Object.keys(r),h=d.length,v=o,m,x,R;for(i===void 0?(m=1,R=r[d[0]]):(m=0,R=i);m<h;m++)x=d[m],R=v(R,r[x],x,r);return R};function jx(e){const r=[];let o=0;const i=e.length;for(;o<i;){const a=e.charCodeAt(o++);if(a>=55296&&a<=56319&&o<i){const d=e.charCodeAt(o++);(d&64512)==56320?r.push(((a&1023)<<10)+(d&1023)+65536):(r.push(a),o--)}else r.push(a)}return r}function Ed(e){const r=jx(e);return r.length===1?r[0].toString(16):null}function Nx(e,r){const o=e.length;let i=e.charCodeAt(r),a;return i>=55296&&i<=56319&&o>r+1&&(a=e.charCodeAt(r+1),a>=56320&&a<=57343)?(i-55296)*1024+a-56320+65536:i}function ah(e){return Object.keys(e).reduce((r,o)=>{const i=e[o];return!!i.icon?r[i.iconName]=i.icon:r[o]=i,r},{})}function Cd(e,r){let o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const{skipHooks:i=!1}=o,a=ah(r);typeof wn.hooks.addPack=="function"&&!i?wn.hooks.addPack(e,ah(r)):wn.styles[e]=ne(ne({},wn.styles[e]||{}),a),e==="fas"&&Cd("fa",r)}const{styles:zl,shims:$x}=wn,Ag=Object.keys(np),zx=Ag.reduce((e,r)=>(e[r]=Object.keys(np[r]),e),{});let ap=null,Ig={},Og={},Fg={},Mg={},Dg={};function Bx(e){return~Cx.indexOf(e)}function Ux(e,r){const o=r.split("-"),i=o[0],a=o.slice(1).join("-");return i===e&&a!==""&&!Bx(a)?a:null}const _g=()=>{const e=i=>$f(zl,(a,d,h)=>(a[h]=$f(d,i,{}),a),{});Ig=e((i,a,d)=>(a[3]&&(i[a[3]]=d),a[2]&&a[2].filter(v=>typeof v=="number").forEach(v=>{i[v.toString(16)]=d}),i)),Og=e((i,a,d)=>(i[d]=d,a[2]&&a[2].filter(v=>typeof v=="string").forEach(v=>{i[v]=d}),i)),Dg=e((i,a,d)=>{const h=a[2];return i[d]=d,h.forEach(v=>{i[v]=d}),i});const r="far"in zl||Se.autoFetchSvg,o=$f($x,(i,a)=>{const d=a[0];let h=a[1];const v=a[2];return h==="far"&&!r&&(h="fas"),typeof d=="string"&&(i.names[d]={prefix:h,iconName:v}),typeof d=="number"&&(i.unicodes[d.toString(16)]={prefix:h,iconName:v}),i},{names:{},unicodes:{}});Fg=o.names,Mg=o.unicodes,ap=wc(Se.styleDefault,{family:Se.familyDefault})};Px(e=>{ap=wc(e.styleDefault,{family:Se.familyDefault})});_g();function sp(e,r){return(Ig[e]||{})[r]}function Hx(e,r){return(Og[e]||{})[r]}function Yi(e,r){return(Dg[e]||{})[r]}function Lg(e){return Fg[e]||{prefix:null,iconName:null}}function Wx(e){const r=Mg[e],o=sp("fas",e);return r||(o?{prefix:"fas",iconName:o}:null)||{prefix:null,iconName:null}}function ni(){return ap}const jg=()=>({prefix:null,iconName:null,rest:[]});function Vx(e){let r=_t;const o=Ag.reduce((i,a)=>(i[a]="".concat(Se.cssPrefix,"-").concat(a),i),{});return vg.forEach(i=>{(e.includes(o[i])||e.some(a=>zx[i].includes(a)))&&(r=i)}),r}function wc(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{family:o=_t}=r,i=xx[o][e];if(o===bc&&!e)return"fad";const a=nh[o][e]||nh[o][i],d=e in wn.styles?e:null;return a||d||null}function Yx(e){let r=[],o=null;return e.forEach(i=>{const a=Ux(Se.cssPrefix,i);a?o=a:i&&r.push(i)}),{iconName:o,rest:r}}function sh(e){return e.sort().filter((r,o,i)=>i.indexOf(r)===o)}function Sc(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{skipLookups:o=!1}=r;let i=null;const a=yd.concat(lx),d=sh(e.filter(E=>a.includes(E))),h=sh(e.filter(E=>!yd.includes(E))),v=d.filter(E=>(i=E,!gg.includes(E))),[m=null]=v,x=Vx(d),R=ne(ne({},Yx(h)),{},{prefix:wc(m,{family:x})});return ne(ne(ne({},R),qx({values:e,family:x,styles:zl,config:Se,canonical:R,givenPrefix:i})),Gx(o,i,R))}function Gx(e,r,o){let{prefix:i,iconName:a}=o;if(e||!i||!a)return{prefix:i,iconName:a};const d=r==="fa"?Lg(a):{},h=Yi(i,a);return a=d.iconName||h||a,i=d.prefix||i,i==="far"&&!zl.far&&zl.fas&&!Se.autoFetchSvg&&(i="fas"),{prefix:i,iconName:a}}const Qx=vg.filter(e=>e!==_t||e!==bc),Xx=Object.keys(vd).filter(e=>e!==_t).map(e=>Object.keys(vd[e])).flat();function qx(e){const{values:r,family:o,canonical:i,givenPrefix:a="",styles:d={},config:h={}}=e,v=o===bc,m=r.includes("fa-duotone")||r.includes("fad"),x=h.familyDefault==="duotone",R=i.prefix==="fad"||i.prefix==="fa-duotone";if(!v&&(m||x||R)&&(i.prefix="fad"),(r.includes("fa-brands")||r.includes("fab"))&&(i.prefix="fab"),!i.prefix&&Qx.includes(o)&&(Object.keys(d).find(F=>Xx.includes(F))||h.autoFetchSvg)){const F=ex.get(o).defaultShortPrefixId;i.prefix=F,i.iconName=Yi(i.prefix,i.iconName)||i.iconName}return(i.prefix==="fa"||a==="fa")&&(i.prefix=ni()||"fas"),i}class Jx{constructor(){this.definitions={}}add(){for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const a=o.reduce(this._pullDefinitions,{});Object.keys(a).forEach(d=>{this.definitions[d]=ne(ne({},this.definitions[d]||{}),a[d]),Cd(d,a[d]);const h=np[_t][d];h&&Cd(h,a[d]),_g()})}reset(){this.definitions={}}_pullDefinitions(r,o){const i=o.prefix&&o.iconName&&o.icon?{0:o}:o;return Object.keys(i).map(a=>{const{prefix:d,iconName:h,icon:v}=i[a],m=v[2];r[d]||(r[d]={}),m.length>0&&m.forEach(x=>{typeof x=="string"&&(r[d][x]=v)}),r[d][h]=v}),r}}let lh=[],ls={};const hs={},Kx=Object.keys(hs);function Zx(e,r){let{mixoutsTo:o}=r;return lh=e,ls={},Object.keys(hs).forEach(i=>{Kx.indexOf(i)===-1&&delete hs[i]}),lh.forEach(i=>{const a=i.mixout?i.mixout():{};if(Object.keys(a).forEach(d=>{typeof a[d]=="function"&&(o[d]=a[d]),typeof a[d]=="object"&&Object.keys(a[d]).forEach(h=>{o[d]||(o[d]={}),o[d][h]=a[d][h]})}),i.hooks){const d=i.hooks();Object.keys(d).forEach(h=>{ls[h]||(ls[h]=[]),ls[h].push(d[h])})}i.provides&&i.provides(hs)}),o}function Td(e,r){for(var o=arguments.length,i=new Array(o>2?o-2:0),a=2;a<o;a++)i[a-2]=arguments[a];return(ls[e]||[]).forEach(h=>{r=h.apply(null,[r,...i])}),r}function ia(e){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];(ls[e]||[]).forEach(d=>{d.apply(null,o)})}function oi(){const e=arguments[0],r=Array.prototype.slice.call(arguments,1);return hs[e]?hs[e].apply(null,r):void 0}function Rd(e){e.prefix==="fa"&&(e.prefix="fas");let{iconName:r}=e;const o=e.prefix||ni();if(r)return r=Yi(o,r)||r,ih(Ng.definitions,o,r)||ih(wn.styles,o,r)}const Ng=new Jx,ew=()=>{Se.autoReplaceSvg=!1,Se.observeMutations=!1,ia("noAuto")},tw={i2svg:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return ao?(ia("beforeI2svg",e),oi("pseudoElements2svg",e),oi("i2svg",e)):Promise.reject(new Error("Operation requires a DOM of some kind."))},watch:function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:r}=e;Se.autoReplaceSvg===!1&&(Se.autoReplaceSvg=!0),Se.observeMutations=!0,Lx(()=>{nw({autoReplaceSvgRoot:r}),ia("watch",e)})}},rw={icon:e=>{if(e===null)return null;if(typeof e=="object"&&e.prefix&&e.iconName)return{prefix:e.prefix,iconName:Yi(e.prefix,e.iconName)||e.iconName};if(Array.isArray(e)&&e.length===2){const r=e[1].indexOf("fa-")===0?e[1].slice(3):e[1],o=wc(e[0]);return{prefix:o,iconName:Yi(o,r)||r}}if(typeof e=="string"&&(e.indexOf("".concat(Se.cssPrefix,"-"))>-1||e.match(wx))){const r=Sc(e.split(" "),{skipLookups:!0});return{prefix:r.prefix||ni(),iconName:Yi(r.prefix,r.iconName)||r.iconName}}if(typeof e=="string"){const r=ni();return{prefix:r,iconName:Yi(r,e)||e}}}},vr={noAuto:ew,config:Se,dom:tw,parse:rw,library:Ng,findIconDefinition:Rd,toHtml:Jl},nw=function(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const{autoReplaceSvgRoot:r=it}=e;(Object.keys(wn.styles).length>0||Se.autoFetchSvg)&&ao&&Se.autoReplaceSvg&&vr.dom.i2svg({node:r})};function kc(e,r){return Object.defineProperty(e,"abstract",{get:r}),Object.defineProperty(e,"html",{get:function(){return e.abstract.map(o=>Jl(o))}}),Object.defineProperty(e,"node",{get:function(){if(!ao)return;const o=it.createElement("div");return o.innerHTML=e.html,o.children}}),e}function ow(e){let{children:r,main:o,mask:i,attributes:a,styles:d,transform:h}=e;if(ip(h)&&o.found&&!i.found){const{width:v,height:m}=o,x={x:v/m/2,y:.5};a.style=xc(ne(ne({},d),{},{"transform-origin":"".concat(x.x+h.x/16,"em ").concat(x.y+h.y/16,"em")}))}return[{tag:"svg",attributes:a,children:r}]}function iw(e){let{prefix:r,iconName:o,children:i,attributes:a,symbol:d}=e;const h=d===!0?"".concat(r,"-").concat(Se.cssPrefix,"-").concat(o):d;return[{tag:"svg",attributes:{style:"display: none;"},children:[{tag:"symbol",attributes:ne(ne({},a),{},{id:h}),children:i}]}]}function lp(e){const{icons:{main:r,mask:o},prefix:i,iconName:a,transform:d,symbol:h,title:v,maskId:m,titleId:x,extra:R,watchable:E=!1}=e,{width:F,height:M}=o.found?o:r,B=ix.includes(i),D=[Se.replacementClass,a?"".concat(Se.cssPrefix,"-").concat(a):""].filter(_=>R.classes.indexOf(_)===-1).filter(_=>_!==""||!!_).concat(R.classes).join(" ");let P={children:[],attributes:ne(ne({},R.attributes),{},{"data-prefix":i,"data-icon":a,class:D,role:R.attributes.role||"img",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(F," ").concat(M)})};const I=B&&!~R.classes.indexOf("fa-fw")?{width:"".concat(F/M*16*.0625,"em")}:{};E&&(P.attributes[oa]=""),v&&(P.children.push({tag:"title",attributes:{id:P.attributes["aria-labelledby"]||"title-".concat(x||$l())},children:[v]}),delete P.attributes.title);const W=ne(ne({},P),{},{prefix:i,iconName:a,main:r,mask:o,maskId:m,transform:d,symbol:h,styles:ne(ne({},I),R.styles)}),{children:U,attributes:q}=o.found&&r.found?oi("generateAbstractMask",W)||{children:[],attributes:{}}:oi("generateAbstractIcon",W)||{children:[],attributes:{}};return W.children=U,W.attributes=q,h?iw(W):ow(W)}function uh(e){const{content:r,width:o,height:i,transform:a,title:d,extra:h,watchable:v=!1}=e,m=ne(ne(ne({},h.attributes),d?{title:d}:{}),{},{class:h.classes.join(" ")});v&&(m[oa]="");const x=ne({},h.styles);ip(a)&&(x.transform=Mx({transform:a,startCentered:!0,width:o,height:i}),x["-webkit-transform"]=x.transform);const R=xc(x);R.length>0&&(m.style=R);const E=[];return E.push({tag:"span",attributes:m,children:[r]}),d&&E.push({tag:"span",attributes:{class:"sr-only"},children:[d]}),E}function aw(e){const{content:r,title:o,extra:i}=e,a=ne(ne(ne({},i.attributes),o?{title:o}:{}),{},{class:i.classes.join(" ")}),d=xc(i.styles);d.length>0&&(a.style=d);const h=[];return h.push({tag:"span",attributes:a,children:[r]}),o&&h.push({tag:"span",attributes:{class:"sr-only"},children:[o]}),h}const{styles:zf}=wn;function Pd(e){const r=e[0],o=e[1],[i]=e.slice(4);let a=null;return Array.isArray(i)?a={tag:"g",attributes:{class:"".concat(Se.cssPrefix,"-").concat(jf.GROUP)},children:[{tag:"path",attributes:{class:"".concat(Se.cssPrefix,"-").concat(jf.SECONDARY),fill:"currentColor",d:i[0]}},{tag:"path",attributes:{class:"".concat(Se.cssPrefix,"-").concat(jf.PRIMARY),fill:"currentColor",d:i[1]}}]}:a={tag:"path",attributes:{fill:"currentColor",d:i}},{found:!0,width:r,height:o,icon:a}}const sw={found:!1,width:512,height:512};function lw(e,r){!wg&&!Se.showMissingIcons&&e&&console.error('Icon with name "'.concat(e,'" and prefix "').concat(r,'" is missing.'))}function Ad(e,r){let o=r;return r==="fa"&&Se.styleDefault!==null&&(r=ni()),new Promise((i,a)=>{if(o==="fa"){const d=Lg(e)||{};e=d.iconName||e,r=d.prefix||r}if(e&&r&&zf[r]&&zf[r][e]){const d=zf[r][e];return i(Pd(d))}lw(e,r),i(ne(ne({},sw),{},{icon:Se.showMissingIcons&&e?oi("missingIconAbstract")||{}:{}}))})}const ch=()=>{},Id=Se.measurePerformance&&Gu&&Gu.mark&&Gu.measure?Gu:{mark:ch,measure:ch},Al='FA "6.7.2"',uw=e=>(Id.mark("".concat(Al," ").concat(e," begins")),()=>$g(e)),$g=e=>{Id.mark("".concat(Al," ").concat(e," ends")),Id.measure("".concat(Al," ").concat(e),"".concat(Al," ").concat(e," begins"),"".concat(Al," ").concat(e," ends"))};var up={begin:uw,end:$g};const Ju=()=>{};function fh(e){return typeof(e.getAttribute?e.getAttribute(oa):null)=="string"}function cw(e){const r=e.getAttribute?e.getAttribute(tp):null,o=e.getAttribute?e.getAttribute(rp):null;return r&&o}function fw(e){return e&&e.classList&&e.classList.contains&&e.classList.contains(Se.replacementClass)}function dw(){return Se.autoReplaceSvg===!0?Ku.replace:Ku[Se.autoReplaceSvg]||Ku.replace}function pw(e){return it.createElementNS("http://www.w3.org/2000/svg",e)}function hw(e){return it.createElement(e)}function zg(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{ceFn:o=e.tag==="svg"?pw:hw}=r;if(typeof e=="string")return it.createTextNode(e);const i=o(e.tag);return Object.keys(e.attributes||[]).forEach(function(d){i.setAttribute(d,e.attributes[d])}),(e.children||[]).forEach(function(d){i.appendChild(zg(d,{ceFn:o}))}),i}function mw(e){let r=" ".concat(e.outerHTML," ");return r="".concat(r,"Font Awesome fontawesome.com "),r}const Ku={replace:function(e){const r=e[0];if(r.parentNode)if(e[1].forEach(o=>{r.parentNode.insertBefore(zg(o),r)}),r.getAttribute(oa)===null&&Se.keepOriginalSource){let o=it.createComment(mw(r));r.parentNode.replaceChild(o,r)}else r.remove()},nest:function(e){const r=e[0],o=e[1];if(~op(r).indexOf(Se.replacementClass))return Ku.replace(e);const i=new RegExp("".concat(Se.cssPrefix,"-.*"));if(delete o[0].attributes.id,o[0].attributes.class){const d=o[0].attributes.class.split(" ").reduce((h,v)=>(v===Se.replacementClass||v.match(i)?h.toSvg.push(v):h.toNode.push(v),h),{toNode:[],toSvg:[]});o[0].attributes.class=d.toSvg.join(" "),d.toNode.length===0?r.removeAttribute("class"):r.setAttribute("class",d.toNode.join(" "))}const a=o.map(d=>Jl(d)).join(`
|
|
690
690
|
`);r.setAttribute(oa,""),r.innerHTML=a}};function dh(e){e()}function Bg(e,r){const o=typeof r=="function"?r:Ju;if(e.length===0)o();else{let i=dh;Se.mutateApproach===yx&&(i=ri.requestAnimationFrame||dh),i(()=>{const a=dw(),d=up.begin("mutate");e.map(a),d(),o()})}}let cp=!1;function Ug(){cp=!0}function Od(){cp=!1}let sc=null;function ph(e){if(!Zp||!Se.observeMutations)return;const{treeCallback:r=Ju,nodeCallback:o=Ju,pseudoElementsCallback:i=Ju,observeMutationsRoot:a=it}=e;sc=new Zp(d=>{if(cp)return;const h=ni();Ds(d).forEach(v=>{if(v.type==="childList"&&v.addedNodes.length>0&&!fh(v.addedNodes[0])&&(Se.searchPseudoElements&&i(v.target),r(v.target)),v.type==="attributes"&&v.target.parentNode&&Se.searchPseudoElements&&i(v.target.parentNode),v.type==="attributes"&&fh(v.target)&&~Ex.indexOf(v.attributeName))if(v.attributeName==="class"&&cw(v.target)){const{prefix:m,iconName:x}=Sc(op(v.target));v.target.setAttribute(tp,m||h),x&&v.target.setAttribute(rp,x)}else fw(v.target)&&o(v.target)})}),ao&&sc.observe(a,{childList:!0,attributes:!0,characterData:!0,subtree:!0})}function gw(){sc&&sc.disconnect()}function vw(e){const r=e.getAttribute("style");let o=[];return r&&(o=r.split(";").reduce((i,a)=>{const d=a.split(":"),h=d[0],v=d.slice(1);return h&&v.length>0&&(i[h]=v.join(":").trim()),i},{})),o}function yw(e){const r=e.getAttribute("data-prefix"),o=e.getAttribute("data-icon"),i=e.innerText!==void 0?e.innerText.trim():"";let a=Sc(op(e));return a.prefix||(a.prefix=ni()),r&&o&&(a.prefix=r,a.iconName=o),a.iconName&&a.prefix||(a.prefix&&i.length>0&&(a.iconName=Hx(a.prefix,e.innerText)||sp(a.prefix,Ed(e.innerText))),!a.iconName&&Se.autoFetchSvg&&e.firstChild&&e.firstChild.nodeType===Node.TEXT_NODE&&(a.iconName=e.firstChild.data)),a}function bw(e){const r=Ds(e.attributes).reduce((a,d)=>(a.name!=="class"&&a.name!=="style"&&(a[d.name]=d.value),a),{}),o=e.getAttribute("title"),i=e.getAttribute("data-fa-title-id");return Se.autoA11y&&(o?r["aria-labelledby"]="".concat(Se.replacementClass,"-title-").concat(i||$l()):(r["aria-hidden"]="true",r.focusable="false")),r}function xw(){return{iconName:null,title:null,titleId:null,prefix:null,transform:xn,symbol:!1,mask:{iconName:null,prefix:null,rest:[]},maskId:null,extra:{classes:[],styles:{},attributes:{}}}}function hh(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{styleParser:!0};const{iconName:o,prefix:i,rest:a}=yw(e),d=bw(e),h=Td("parseNodeAttributes",{},e);let v=r.styleParser?vw(e):[];return ne({iconName:o,title:e.getAttribute("title"),titleId:e.getAttribute("data-fa-title-id"),prefix:i,transform:xn,mask:{iconName:null,prefix:null,rest:[]},maskId:null,symbol:!1,extra:{classes:a,styles:v,attributes:d}},h)}const{styles:ww}=wn;function Hg(e){const r=Se.autoReplaceSvg==="nest"?hh(e,{styleParser:!1}):hh(e);return~r.extra.classes.indexOf(kg)?oi("generateLayersText",e,r):oi("generateSvgReplacementMutation",e,r)}function Sw(){return[...rx,...yd]}function mh(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!ao)return Promise.resolve();const o=it.documentElement.classList,i=R=>o.add("".concat(rh,"-").concat(R)),a=R=>o.remove("".concat(rh,"-").concat(R)),d=Se.autoFetchSvg?Sw():gg.concat(Object.keys(ww));d.includes("fa")||d.push("fa");const h=[".".concat(kg,":not([").concat(oa,"])")].concat(d.map(R=>".".concat(R,":not([").concat(oa,"])"))).join(", ");if(h.length===0)return Promise.resolve();let v=[];try{v=Ds(e.querySelectorAll(h))}catch{}if(v.length>0)i("pending"),a("complete");else return Promise.resolve();const m=up.begin("onTree"),x=v.reduce((R,E)=>{try{const F=Hg(E);F&&R.push(F)}catch(F){wg||F.name==="MissingIcon"&&console.error(F)}return R},[]);return new Promise((R,E)=>{Promise.all(x).then(F=>{Bg(F,()=>{i("active"),i("complete"),a("pending"),typeof r=="function"&&r(),m(),R()})}).catch(F=>{m(),E(F)})})}function kw(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;Hg(e).then(o=>{o&&Bg([o],r)})}function Ew(e){return function(r){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const i=(r||{}).icon?r:Rd(r||{});let{mask:a}=o;return a&&(a=(a||{}).icon?a:Rd(a||{})),e(i,ne(ne({},o),{},{mask:a}))}}const Cw=function(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:o=xn,symbol:i=!1,mask:a=null,maskId:d=null,title:h=null,titleId:v=null,classes:m=[],attributes:x={},styles:R={}}=r;if(!e)return;const{prefix:E,iconName:F,icon:M}=e;return kc(ne({type:"icon"},e),()=>(ia("beforeDOMElementCreation",{iconDefinition:e,params:r}),Se.autoA11y&&(h?x["aria-labelledby"]="".concat(Se.replacementClass,"-title-").concat(v||$l()):(x["aria-hidden"]="true",x.focusable="false")),lp({icons:{main:Pd(M),mask:a?Pd(a.icon):{found:!1,width:null,height:null,icon:{}}},prefix:E,iconName:F,transform:ne(ne({},xn),o),symbol:i,title:h,maskId:d,titleId:v,extra:{attributes:x,styles:R,classes:m}})))};var Tw={mixout(){return{icon:Ew(Cw)}},hooks(){return{mutationObserverCallbacks(e){return e.treeCallback=mh,e.nodeCallback=kw,e}}},provides(e){e.i2svg=function(r){const{node:o=it,callback:i=()=>{}}=r;return mh(o,i)},e.generateSvgReplacementMutation=function(r,o){const{iconName:i,title:a,titleId:d,prefix:h,transform:v,symbol:m,mask:x,maskId:R,extra:E}=o;return new Promise((F,M)=>{Promise.all([Ad(i,h),x.iconName?Ad(x.iconName,x.prefix):Promise.resolve({found:!1,width:512,height:512,icon:{}})]).then(B=>{let[D,P]=B;F([r,lp({icons:{main:D,mask:P},prefix:h,iconName:i,transform:v,symbol:m,maskId:R,title:a,titleId:d,extra:E,watchable:!0})])}).catch(M)})},e.generateAbstractIcon=function(r){let{children:o,attributes:i,main:a,transform:d,styles:h}=r;const v=xc(h);v.length>0&&(i.style=v);let m;return ip(d)&&(m=oi("generateAbstractTransformGrouping",{main:a,transform:d,containerWidth:a.width,iconWidth:a.width})),o.push(m||a.icon),{children:o,attributes:i}}}},Rw={mixout(){return{layer(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{classes:o=[]}=r;return kc({type:"layer"},()=>{ia("beforeDOMElementCreation",{assembler:e,params:r});let i=[];return e(a=>{Array.isArray(a)?a.map(d=>{i=i.concat(d.abstract)}):i=i.concat(a.abstract)}),[{tag:"span",attributes:{class:["".concat(Se.cssPrefix,"-layers"),...o].join(" ")},children:i}]})}}}},Pw={mixout(){return{counter(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{title:o=null,classes:i=[],attributes:a={},styles:d={}}=r;return kc({type:"counter",content:e},()=>(ia("beforeDOMElementCreation",{content:e,params:r}),aw({content:e.toString(),title:o,extra:{attributes:a,styles:d,classes:["".concat(Se.cssPrefix,"-layers-counter"),...i]}})))}}}},Aw={mixout(){return{text(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const{transform:o=xn,title:i=null,classes:a=[],attributes:d={},styles:h={}}=r;return kc({type:"text",content:e},()=>(ia("beforeDOMElementCreation",{content:e,params:r}),uh({content:e,transform:ne(ne({},xn),o),title:i,extra:{attributes:d,styles:h,classes:["".concat(Se.cssPrefix,"-layers-text"),...a]}})))}}},provides(e){e.generateLayersText=function(r,o){const{title:i,transform:a,extra:d}=o;let h=null,v=null;if(hg){const m=parseInt(getComputedStyle(r).fontSize,10),x=r.getBoundingClientRect();h=x.width/m,v=x.height/m}return Se.autoA11y&&!i&&(d.attributes["aria-hidden"]="true"),Promise.resolve([r,uh({content:r.innerHTML,width:h,height:v,transform:a,title:i,extra:d,watchable:!0})])}}};const Iw=new RegExp('"',"ug"),gh=[1105920,1112319],vh=ne(ne(ne(ne({},{FontAwesome:{normal:"fas",400:"fas"}}),Z0),gx),ux),Fd=Object.keys(vh).reduce((e,r)=>(e[r.toLowerCase()]=vh[r],e),{}),Ow=Object.keys(Fd).reduce((e,r)=>{const o=Fd[r];return e[r]=o[900]||[...Object.entries(o)][0][1],e},{});function Fw(e){const r=e.replace(Iw,""),o=Nx(r,0),i=o>=gh[0]&&o<=gh[1],a=r.length===2?r[0]===r[1]:!1;return{value:Ed(a?r[0]:r),isSecondary:i||a}}function Mw(e,r){const o=e.replace(/^['"]|['"]$/g,"").toLowerCase(),i=parseInt(r),a=isNaN(i)?"normal":i;return(Fd[o]||{})[a]||Ow[o]}function yh(e,r){const o="".concat(vx).concat(r.replace(":","-"));return new Promise((i,a)=>{if(e.getAttribute(o)!==null)return i();const h=Ds(e.children).filter(F=>F.getAttribute(xd)===r)[0],v=ri.getComputedStyle(e,r),m=v.getPropertyValue("font-family"),x=m.match(Sx),R=v.getPropertyValue("font-weight"),E=v.getPropertyValue("content");if(h&&!x)return e.removeChild(h),i();if(x&&E!=="none"&&E!==""){const F=v.getPropertyValue("content");let M=Mw(m,R);const{value:B,isSecondary:D}=Fw(F),P=x[0].startsWith("FontAwesome");let I=sp(M,B),W=I;if(P){const U=Wx(B);U.iconName&&U.prefix&&(I=U.iconName,M=U.prefix)}if(I&&!D&&(!h||h.getAttribute(tp)!==M||h.getAttribute(rp)!==W)){e.setAttribute(o,W),h&&e.removeChild(h);const U=xw(),{extra:q}=U;q.attributes[xd]=r,Ad(I,M).then(_=>{const ie=lp(ne(ne({},U),{},{icons:{main:_,mask:jg()},prefix:M,iconName:W,extra:q,watchable:!0})),ce=it.createElementNS("http://www.w3.org/2000/svg","svg");r==="::before"?e.insertBefore(ce,e.firstChild):e.appendChild(ce),ce.outerHTML=ie.map(ee=>Jl(ee)).join(`
|
|
691
691
|
`),e.removeAttribute(o),i()}).catch(a)}else i()}else i()})}function Dw(e){return Promise.all([yh(e,"::before"),yh(e,"::after")])}function _w(e){return e.parentNode!==document.head&&!~bx.indexOf(e.tagName.toUpperCase())&&!e.getAttribute(xd)&&(!e.parentNode||e.parentNode.tagName!=="svg")}function bh(e){if(ao)return new Promise((r,o)=>{const i=Ds(e.querySelectorAll("*")).filter(_w).map(Dw),a=up.begin("searchPseudoElements");Ug(),Promise.all(i).then(()=>{a(),Od(),r()}).catch(()=>{a(),Od(),o()})})}var Lw={hooks(){return{mutationObserverCallbacks(e){return e.pseudoElementsCallback=bh,e}}},provides(e){e.pseudoElements2svg=function(r){const{node:o=it}=r;Se.searchPseudoElements&&bh(o)}}};let xh=!1;var jw={mixout(){return{dom:{unwatch(){Ug(),xh=!0}}}},hooks(){return{bootstrap(){ph(Td("mutationObserverCallbacks",{}))},noAuto(){gw()},watch(e){const{observeMutationsRoot:r}=e;xh?Od():ph(Td("mutationObserverCallbacks",{observeMutationsRoot:r}))}}}};const wh=e=>{let r={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return e.toLowerCase().split(" ").reduce((o,i)=>{const a=i.toLowerCase().split("-"),d=a[0];let h=a.slice(1).join("-");if(d&&h==="h")return o.flipX=!0,o;if(d&&h==="v")return o.flipY=!0,o;if(h=parseFloat(h),isNaN(h))return o;switch(d){case"grow":o.size=o.size+h;break;case"shrink":o.size=o.size-h;break;case"left":o.x=o.x-h;break;case"right":o.x=o.x+h;break;case"up":o.y=o.y-h;break;case"down":o.y=o.y+h;break;case"rotate":o.rotate=o.rotate+h;break}return o},r)};var Nw={mixout(){return{parse:{transform:e=>wh(e)}}},hooks(){return{parseNodeAttributes(e,r){const o=r.getAttribute("data-fa-transform");return o&&(e.transform=wh(o)),e}}},provides(e){e.generateAbstractTransformGrouping=function(r){let{main:o,transform:i,containerWidth:a,iconWidth:d}=r;const h={transform:"translate(".concat(a/2," 256)")},v="translate(".concat(i.x*32,", ").concat(i.y*32,") "),m="scale(".concat(i.size/16*(i.flipX?-1:1),", ").concat(i.size/16*(i.flipY?-1:1),") "),x="rotate(".concat(i.rotate," 0 0)"),R={transform:"".concat(v," ").concat(m," ").concat(x)},E={transform:"translate(".concat(d/2*-1," -256)")},F={outer:h,inner:R,path:E};return{tag:"g",attributes:ne({},F.outer),children:[{tag:"g",attributes:ne({},F.inner),children:[{tag:o.icon.tag,children:o.icon.children,attributes:ne(ne({},o.icon.attributes),F.path)}]}]}}}};const Bf={x:0,y:0,width:"100%",height:"100%"};function Sh(e){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e.attributes&&(e.attributes.fill||r)&&(e.attributes.fill="black"),e}function $w(e){return e.tag==="g"?e.children:[e]}var zw={hooks(){return{parseNodeAttributes(e,r){const o=r.getAttribute("data-fa-mask"),i=o?Sc(o.split(" ").map(a=>a.trim())):jg();return i.prefix||(i.prefix=ni()),e.mask=i,e.maskId=r.getAttribute("data-fa-mask-id"),e}}},provides(e){e.generateAbstractMask=function(r){let{children:o,attributes:i,main:a,mask:d,maskId:h,transform:v}=r;const{width:m,icon:x}=a,{width:R,icon:E}=d,F=Fx({transform:v,containerWidth:R,iconWidth:m}),M={tag:"rect",attributes:ne(ne({},Bf),{},{fill:"white"})},B=x.children?{children:x.children.map(Sh)}:{},D={tag:"g",attributes:ne({},F.inner),children:[Sh(ne({tag:x.tag,attributes:ne(ne({},x.attributes),F.path)},B))]},P={tag:"g",attributes:ne({},F.outer),children:[D]},I="mask-".concat(h||$l()),W="clip-".concat(h||$l()),U={tag:"mask",attributes:ne(ne({},Bf),{},{id:I,maskUnits:"userSpaceOnUse",maskContentUnits:"userSpaceOnUse"}),children:[M,P]},q={tag:"defs",children:[{tag:"clipPath",attributes:{id:W},children:$w(E)},U]};return o.push(q,{tag:"rect",attributes:ne({fill:"currentColor","clip-path":"url(#".concat(W,")"),mask:"url(#".concat(I,")")},Bf)}),{children:o,attributes:i}}}},Bw={provides(e){let r=!1;ri.matchMedia&&(r=ri.matchMedia("(prefers-reduced-motion: reduce)").matches),e.missingIconAbstract=function(){const o=[],i={fill:"currentColor"},a={attributeType:"XML",repeatCount:"indefinite",dur:"2s"};o.push({tag:"path",attributes:ne(ne({},i),{},{d:"M156.5,447.7l-12.6,29.5c-18.7-9.5-35.9-21.2-51.5-34.9l22.7-22.7C127.6,430.5,141.5,440,156.5,447.7z M40.6,272H8.5 c1.4,21.2,5.4,41.7,11.7,61.1L50,321.2C45.1,305.5,41.8,289,40.6,272z M40.6,240c1.4-18.8,5.2-37,11.1-54.1l-29.5-12.6 C14.7,194.3,10,216.7,8.5,240H40.6z M64.3,156.5c7.8-14.9,17.2-28.8,28.1-41.5L69.7,92.3c-13.7,15.6-25.5,32.8-34.9,51.5 L64.3,156.5z M397,419.6c-13.9,12-29.4,22.3-46.1,30.4l11.9,29.8c20.7-9.9,39.8-22.6,56.9-37.6L397,419.6z M115,92.4 c13.9-12,29.4-22.3,46.1-30.4l-11.9-29.8c-20.7,9.9-39.8,22.6-56.8,37.6L115,92.4z M447.7,355.5c-7.8,14.9-17.2,28.8-28.1,41.5 l22.7,22.7c13.7-15.6,25.5-32.9,34.9-51.5L447.7,355.5z M471.4,272c-1.4,18.8-5.2,37-11.1,54.1l29.5,12.6 c7.5-21.1,12.2-43.5,13.6-66.8H471.4z M321.2,462c-15.7,5-32.2,8.2-49.2,9.4v32.1c21.2-1.4,41.7-5.4,61.1-11.7L321.2,462z M240,471.4c-18.8-1.4-37-5.2-54.1-11.1l-12.6,29.5c21.1,7.5,43.5,12.2,66.8,13.6V471.4z M462,190.8c5,15.7,8.2,32.2,9.4,49.2h32.1 c-1.4-21.2-5.4-41.7-11.7-61.1L462,190.8z M92.4,397c-12-13.9-22.3-29.4-30.4-46.1l-29.8,11.9c9.9,20.7,22.6,39.8,37.6,56.9 L92.4,397z M272,40.6c18.8,1.4,36.9,5.2,54.1,11.1l12.6-29.5C317.7,14.7,295.3,10,272,8.5V40.6z M190.8,50 c15.7-5,32.2-8.2,49.2-9.4V8.5c-21.2,1.4-41.7,5.4-61.1,11.7L190.8,50z M442.3,92.3L419.6,115c12,13.9,22.3,29.4,30.5,46.1 l29.8-11.9C470,128.5,457.3,109.4,442.3,92.3z M397,92.4l22.7-22.7c-15.6-13.7-32.8-25.5-51.5-34.9l-12.6,29.5 C370.4,72.1,384.4,81.5,397,92.4z"})});const d=ne(ne({},a),{},{attributeName:"opacity"}),h={tag:"circle",attributes:ne(ne({},i),{},{cx:"256",cy:"364",r:"28"}),children:[]};return r||h.children.push({tag:"animate",attributes:ne(ne({},a),{},{attributeName:"r",values:"28;14;28;28;14;28;"})},{tag:"animate",attributes:ne(ne({},d),{},{values:"1;0;1;1;0;1;"})}),o.push(h),o.push({tag:"path",attributes:ne(ne({},i),{},{opacity:"1",d:"M263.7,312h-16c-6.6,0-12-5.4-12-12c0-71,77.4-63.9,77.4-107.8c0-20-17.8-40.2-57.4-40.2c-29.1,0-44.3,9.6-59.2,28.7 c-3.9,5-11.1,6-16.2,2.4l-13.1-9.2c-5.6-3.9-6.9-11.8-2.6-17.2c21.2-27.2,46.4-44.7,91.2-44.7c52.3,0,97.4,29.8,97.4,80.2 c0,67.6-77.4,63.5-77.4,107.8C275.7,306.6,270.3,312,263.7,312z"}),children:r?[]:[{tag:"animate",attributes:ne(ne({},d),{},{values:"1;0;0;0;0;1;"})}]}),r||o.push({tag:"path",attributes:ne(ne({},i),{},{opacity:"0",d:"M232.5,134.5l7,168c0.3,6.4,5.6,11.5,12,11.5h9c6.4,0,11.7-5.1,12-11.5l7-168c0.3-6.8-5.2-12.5-12-12.5h-23 C237.7,122,232.2,127.7,232.5,134.5z"}),children:[{tag:"animate",attributes:ne(ne({},d),{},{values:"0;0;1;1;0;0;"})}]}),{tag:"g",attributes:{class:"missing"},children:o}}}},Uw={hooks(){return{parseNodeAttributes(e,r){const o=r.getAttribute("data-fa-symbol"),i=o===null?!1:o===""?!0:o;return e.symbol=i,e}}}},Hw=[_x,Tw,Rw,Pw,Aw,Lw,jw,Nw,zw,Bw,Uw];Zx(Hw,{mixoutsTo:vr});vr.noAuto;vr.config;vr.library;vr.dom;const Md=vr.parse;vr.findIconDefinition;vr.toHtml;const Ww=vr.icon;vr.layer;vr.text;vr.counter;function kh(e,r){var o=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);r&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),o.push.apply(o,i)}return o}function ti(e){for(var r=1;r<arguments.length;r++){var o=arguments[r]!=null?arguments[r]:{};r%2?kh(Object(o),!0).forEach(function(i){us(e,i,o[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):kh(Object(o)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(o,i))})}return e}function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},lc(e)}function us(e,r,o){return r in e?Object.defineProperty(e,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[r]=o,e}function Vw(e,r){if(e==null)return{};var o={},i=Object.keys(e),a,d;for(d=0;d<i.length;d++)a=i[d],!(r.indexOf(a)>=0)&&(o[a]=e[a]);return o}function Wg(e,r){if(e==null)return{};var o=Vw(e,r),i,a;if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(e);for(a=0;a<d.length;a++)i=d[a],!(r.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(o[i]=e[i])}return o}function Dd(e){return Yw(e)||Gw(e)||Qw(e)||Xw()}function Yw(e){if(Array.isArray(e))return _d(e)}function Gw(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Qw(e,r){if(e){if(typeof e=="string")return _d(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);if(o==="Object"&&e.constructor&&(o=e.constructor.name),o==="Map"||o==="Set")return Array.from(e);if(o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o))return _d(e,r)}}function _d(e,r){(r==null||r>e.length)&&(r=e.length);for(var o=0,i=new Array(r);o<r;o++)i[o]=e[o];return i}function Xw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
692
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qw(e){var r,o=e.beat,i=e.fade,a=e.beatFade,d=e.bounce,h=e.shake,v=e.flash,m=e.spin,x=e.spinPulse,R=e.spinReverse,E=e.pulse,F=e.fixedWidth,M=e.inverse,B=e.border,D=e.listItem,P=e.flip,I=e.size,W=e.rotation,U=e.pull,q=(r={"fa-beat":o,"fa-fade":i,"fa-beat-fade":a,"fa-bounce":d,"fa-shake":h,"fa-flash":v,"fa-spin":m,"fa-spin-reverse":R,"fa-spin-pulse":x,"fa-pulse":E,"fa-fw":F,"fa-inverse":M,"fa-border":B,"fa-li":D,"fa-flip":P===!0,"fa-flip-horizontal":P==="horizontal"||P==="both","fa-flip-vertical":P==="vertical"||P==="both"},us(r,"fa-".concat(I),typeof I<"u"&&I!==null),us(r,"fa-rotate-".concat(W),typeof W<"u"&&W!==null&&W!==0),us(r,"fa-pull-".concat(U),typeof U<"u"&&U!==null),us(r,"fa-swap-opacity",e.swapOpacity),r);return Object.keys(q).map(function(_){return q[_]?_:null}).filter(function(_){return _})}function Jw(e){return e=e-0,e===e}function Vg(e){return Jw(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(r,o){return o?o.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var Kw=["style"];function Zw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function eS(e){return e.split(";").map(function(r){return r.trim()}).filter(function(r){return r}).reduce(function(r,o){var i=o.indexOf(":"),a=Vg(o.slice(0,i)),d=o.slice(i+1).trim();return a.startsWith("webkit")?r[Zw(a)]=d:r[a]=d,r},{})}function Yg(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof r=="string")return r;var i=(r.children||[]).map(function(m){return Yg(e,m)}),a=Object.keys(r.attributes||{}).reduce(function(m,x){var R=r.attributes[x];switch(x){case"class":m.attrs.className=R,delete r.attributes.class;break;case"style":m.attrs.style=eS(R);break;default:x.indexOf("aria-")===0||x.indexOf("data-")===0?m.attrs[x.toLowerCase()]=R:m.attrs[Vg(x)]=R}return m},{attrs:{}}),d=o.style,h=d===void 0?{}:d,v=Wg(o,Kw);return a.attrs.style=ti(ti({},a.attrs.style),h),e.apply(void 0,[r.tag,ti(ti({},a.attrs),v)].concat(Dd(i)))}var Gg=!1;try{Gg=process.env.NODE_ENV==="production"}catch{}function tS(){if(!Gg&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Eh(e){if(e&&lc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Md.icon)return Md.icon(e);if(e===null)return null;if(e&&lc(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function Uf(e,r){return Array.isArray(r)&&r.length>0||!Array.isArray(r)&&r?us({},e,r):{}}var rS=["forwardedRef"];function ii(e){var r=e.forwardedRef,o=Wg(e,rS),i=o.icon,a=o.mask,d=o.symbol,h=o.className,v=o.title,m=o.titleId,x=o.maskId,R=Eh(i),E=Uf("classes",[].concat(Dd(qw(o)),Dd(h.split(" ")))),F=Uf("transform",typeof o.transform=="string"?Md.transform(o.transform):o.transform),M=Uf("mask",Eh(a)),B=Ww(R,ti(ti(ti(ti({},E),F),M),{},{symbol:d,title:v,titleId:m,maskId:x}));if(!B)return tS("Could not find icon",R),null;var D=B.abstract,P={ref:r};return Object.keys(o).forEach(function(I){ii.defaultProps.hasOwnProperty(I)||(P[I]=o[I])}),nS(D[0],P)}ii.displayName="FontAwesomeIcon";ii.propTypes={beat:Me.bool,border:Me.bool,beatFade:Me.bool,bounce:Me.bool,className:Me.string,fade:Me.bool,flash:Me.bool,mask:Me.oneOfType([Me.object,Me.array,Me.string]),maskId:Me.string,fixedWidth:Me.bool,inverse:Me.bool,flip:Me.oneOf([!0,!1,"horizontal","vertical","both"]),icon:Me.oneOfType([Me.object,Me.array,Me.string]),listItem:Me.bool,pull:Me.oneOf(["right","left"]),pulse:Me.bool,rotation:Me.oneOf([0,90,180,270]),shake:Me.bool,size:Me.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Me.bool,spinPulse:Me.bool,spinReverse:Me.bool,symbol:Me.oneOfType([Me.bool,Me.string]),title:Me.string,titleId:Me.string,transform:Me.oneOfType([Me.string,Me.object]),swapOpacity:Me.bool};ii.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var nS=Yg.bind(null,V.createElement);const oS=async e=>await(await fetch(`${Vl}/playbook-task-details`,{method:"POST",body:JSON.stringify(e)})).json(),iS=({taskId:e,playbookId:r,enabled:o})=>{const{queryClient:i}=Is(),a=async()=>oS({taskId:+e,templateId:r.toString()}),d=["taskDetails",+e,r],h=Hd({queryKey:d,queryFn:a,enabled:o,staleTime:1/0},i),v=()=>{i.prefetchQuery({queryFn:a,queryKey:d,staleTime:1/0})};return{taskDetails:h.data,prefetchQuery:v,...h}},aS=({buttons:e,onButtonClick:r,disabled:o})=>Q.jsx("div",{className:"flex items-center justify-end",children:e.map(i=>Q.jsx(jl,{size:"smallCollapse",className:"ml-2",disabled:o,onClick:()=>{r(i)},children:cy[i]},i))});function Ch(e,r){if(!e||!r)return!1;const o=r.getRootNode==null?void 0:r.getRootNode();if(e.contains(r))return!0;if(o&&md(o)){let i=r;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Rl(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Hf(e,r){if(r==null)return!1;if("composedPath"in e)return e.composedPath().includes(r);const o=e;return o.target!=null&&r.contains(o.target)}function sS(e){return e.matches("html,body")}function Th(e){return(e==null?void 0:e.ownerDocument)||document}function Wf(e,r){let o=e.filter(a=>{var d;return a.parentId===r&&((d=a.context)==null?void 0:d.open)}),i=o;for(;i.length;)i=e.filter(a=>{var d;return(d=i)==null?void 0:d.some(h=>{var v;return a.parentId===h.id&&((v=a.context)==null?void 0:v.open)})}),o=o.concat(i);return o}function lS(e){return"nativeEvent"in e}var uS=typeof document<"u",cS=function(){},Ld=uS?V.useLayoutEffect:cS;const fS={...de},dS=fS.useInsertionEffect,pS=dS||(e=>e());function ss(e){const r=de.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return pS(()=>{r.current=e}),de.useCallback(function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r.current==null?void 0:r.current(...i)},[])}const hS="data-floating-ui-focusable",Rh="active",Ph="selected",mS={...de};let Ah=!1,gS=0;const Ih=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+gS++;function vS(){const[e,r]=de.useState(()=>Ah?Ih():void 0);return Ld(()=>{e==null&&r(Ih())},[]),de.useEffect(()=>{Ah=!0},[]),e}const yS=mS.useId,bS=yS||vS;let jd;process.env.NODE_ENV!=="production"&&(jd=new Set);function xS(){for(var e,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const a="Floating UI: "+o.join(" ");if(!((e=jd)!=null&&e.has(a))){var d;(d=jd)==null||d.add(a),console.error(a)}}function wS(){const e=new Map;return{emit(r,o){var i;(i=e.get(r))==null||i.forEach(a=>a(o))},on(r,o){e.has(r)||e.set(r,new Set),e.get(r).add(o)},off(r,o){var i;(i=e.get(r))==null||i.delete(o)}}}const SS=de.createContext(null),kS=de.createContext(null),ES=()=>{var e;return((e=de.useContext(SS))==null?void 0:e.id)||null},Qg=()=>de.useContext(kS);function CS(e){return"data-floating-ui-"+e}function TS(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const RS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},PS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Oh=e=>{var r,o;return{escapeKey:typeof e=="boolean"?e:(r=e==null?void 0:e.escapeKey)!=null?r:!1,outsidePress:typeof e=="boolean"?e:(o=e==null?void 0:e.outsidePress)!=null?o:!0}};function AS(e,r){r===void 0&&(r={});const{open:o,onOpenChange:i,elements:a,dataRef:d}=e,{enabled:h=!0,escapeKey:v=!0,outsidePress:m=!0,outsidePressEvent:x="pointerdown",referencePress:R=!1,referencePressEvent:E="pointerdown",ancestorScroll:F=!1,bubbles:M,capture:B}=r,D=Qg(),P=ss(typeof m=="function"?m:()=>!1),I=typeof m=="function"?P:m,W=de.useRef(!1),{escapeKey:U,outsidePress:q}=Oh(M),{escapeKey:_,outsidePress:ie}=Oh(B),ce=de.useRef(!1),ee=de.useRef(-1),ae=ss(ke=>{var Ce;if(!o||!h||!v||ke.key!=="Escape"||ce.current)return;const je=(Ce=d.current.floatingContext)==null?void 0:Ce.nodeId,Z=D?Wf(D.nodesRef.current,je):[];if(!U&&(ke.stopPropagation(),Z.length>0)){let be=!0;if(Z.forEach(G=>{var J;if((J=G.context)!=null&&J.open&&!G.context.dataRef.current.__escapeKeyBubbles){be=!1;return}}),!be)return}i(!1,lS(ke)?ke.nativeEvent:ke,"escape-key")}),Fe=ss(ke=>{var Ce;const je=()=>{var Z;ae(ke),(Z=Rl(ke))==null||Z.removeEventListener("keydown",je)};(Ce=Rl(ke))==null||Ce.addEventListener("keydown",je)}),Ne=ss(ke=>{var Ce;const je=d.current.insideReactTree;d.current.insideReactTree=!1;const Z=W.current;if(W.current=!1,x==="click"&&Z||je||typeof I=="function"&&!I(ke))return;const be=Rl(ke),G="["+CS("inert")+"]",J=Th(a.floating).querySelectorAll(G);let fe=pt(be)?be:null;for(;fe&&!Zn(fe);){const se=to(fe);if(Zn(se)||!pt(se))break;fe=se}if(J.length&&pt(be)&&!sS(be)&&!Ch(be,a.floating)&&Array.from(J).every(se=>!Ch(fe,se)))return;if(Zr(be)&&Qe){const se=Zn(be),ue=_r(be),Te=/auto|scroll/,Ee=se||Te.test(ue.overflowX),Re=se||Te.test(ue.overflowY),$e=Ee&&be.clientWidth>0&&be.scrollWidth>be.clientWidth,oe=Re&&be.clientHeight>0&&be.scrollHeight>be.clientHeight,Ue=ue.direction==="rtl",nt=oe&&(Ue?ke.offsetX<=be.offsetWidth-be.clientWidth:ke.offsetX>be.clientWidth),Lt=$e&&ke.offsetY>be.clientHeight;if(nt||Lt)return}const me=(Ce=d.current.floatingContext)==null?void 0:Ce.nodeId,pe=D&&Wf(D.nodesRef.current,me).some(se=>{var ue;return Hf(ke,(ue=se.context)==null?void 0:ue.elements.floating)});if(Hf(ke,a.floating)||Hf(ke,a.domReference)||pe)return;const ge=D?Wf(D.nodesRef.current,me):[];if(ge.length>0){let se=!0;if(ge.forEach(ue=>{var Te;if((Te=ue.context)!=null&&Te.open&&!ue.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}i(!1,ke,"outside-press")}),_e=ss(ke=>{var Ce;const je=()=>{var Z;Ne(ke),(Z=Rl(ke))==null||Z.removeEventListener(x,je)};(Ce=Rl(ke))==null||Ce.addEventListener(x,je)});de.useEffect(()=>{if(!o||!h)return;d.current.__escapeKeyBubbles=U,d.current.__outsidePressBubbles=q;let ke=-1;function Ce(J){i(!1,J,"ancestor-scroll")}function je(){window.clearTimeout(ke),ce.current=!0}function Z(){ke=window.setTimeout(()=>{ce.current=!1},vc()?5:0)}const be=Th(a.floating);v&&(be.addEventListener("keydown",_?Fe:ae,_),be.addEventListener("compositionstart",je),be.addEventListener("compositionend",Z)),I&&be.addEventListener(x,ie?_e:Ne,ie);let G=[];return F&&(pt(a.domReference)&&(G=ds(a.domReference)),pt(a.floating)&&(G=G.concat(ds(a.floating))),!pt(a.reference)&&a.reference&&a.reference.contextElement&&(G=G.concat(ds(a.reference.contextElement)))),G=G.filter(J=>{var fe;return J!==((fe=be.defaultView)==null?void 0:fe.visualViewport)}),G.forEach(J=>{J.addEventListener("scroll",Ce,{passive:!0})}),()=>{v&&(be.removeEventListener("keydown",_?Fe:ae,_),be.removeEventListener("compositionstart",je),be.removeEventListener("compositionend",Z)),I&&be.removeEventListener(x,ie?_e:Ne,ie),G.forEach(J=>{J.removeEventListener("scroll",Ce)}),window.clearTimeout(ke)}},[d,a,v,I,x,o,i,F,h,U,q,ae,_,Fe,Ne,ie,_e]),de.useEffect(()=>{d.current.insideReactTree=!1},[d,I,x]);const Ge=de.useMemo(()=>({onKeyDown:ae,...R&&{[RS[E]]:ke=>{i(!1,ke.nativeEvent,"reference-press")},...E!=="click"&&{onClick(ke){i(!1,ke.nativeEvent,"reference-press")}}}}),[ae,i,R,E]),Qe=de.useMemo(()=>({onKeyDown:ae,onMouseDown(){W.current=!0},onMouseUp(){W.current=!0},[PS[x]]:()=>{d.current.insideReactTree=!0},onBlurCapture(){D||(TS(ee),d.current.insideReactTree=!0,ee.current=window.setTimeout(()=>{d.current.insideReactTree=!1}))}}),[ae,x,d,D]);return de.useMemo(()=>h?{reference:Ge,floating:Qe}:{},[h,Ge,Qe])}function IS(e){const{open:r=!1,onOpenChange:o,elements:i}=e,a=bS(),d=de.useRef({}),[h]=de.useState(()=>wS()),v=ES()!=null;if(process.env.NODE_ENV!=="production"){const M=i.reference;M&&!pt(M)&&xS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[m,x]=de.useState(i.reference),R=ss((M,B,D)=>{d.current.openEvent=M?B:void 0,h.emit("openchange",{open:M,event:B,reason:D,nested:v}),o==null||o(M,B,D)}),E=de.useMemo(()=>({setPositionReference:x}),[]),F=de.useMemo(()=>({reference:m||i.reference||null,floating:i.floating||null,domReference:i.reference}),[m,i.reference,i.floating]);return de.useMemo(()=>({dataRef:d,open:r,onOpenChange:R,elements:F,events:h,floatingId:a,refs:E}),[r,R,F,h,a,E])}function OS(e){e===void 0&&(e={});const{nodeId:r}=e,o=IS({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||o,a=i.elements,[d,h]=de.useState(null),[v,m]=de.useState(null),R=(a==null?void 0:a.domReference)||d,E=de.useRef(null),F=Qg();Ld(()=>{R&&(E.current=R)},[R]);const M=O0({...e,elements:{...a,...v&&{reference:v}}}),B=de.useCallback(U=>{const q=pt(U)?{getBoundingClientRect:()=>U.getBoundingClientRect(),getClientRects:()=>U.getClientRects(),contextElement:U}:U;m(q),M.refs.setReference(q)},[M.refs]),D=de.useCallback(U=>{(pt(U)||U===null)&&(E.current=U,h(U)),(pt(M.refs.reference.current)||M.refs.reference.current===null||U!==null&&!pt(U))&&M.refs.setReference(U)},[M.refs]),P=de.useMemo(()=>({...M.refs,setReference:D,setPositionReference:B,domReference:E}),[M.refs,D,B]),I=de.useMemo(()=>({...M.elements,domReference:R}),[M.elements,R]),W=de.useMemo(()=>({...M,...i,refs:P,elements:I,nodeId:r}),[M,P,I,r,i]);return Ld(()=>{i.dataRef.current.floatingContext=W;const U=F==null?void 0:F.nodesRef.current.find(q=>q.id===r);U&&(U.context=W)}),de.useMemo(()=>({...M,context:W,refs:P,elements:I}),[M,P,I,W])}function Vf(e,r,o){const i=new Map,a=o==="item";let d=e;if(a&&e){const{[Rh]:h,[Ph]:v,...m}=e;d=m}return{...o==="floating"&&{tabIndex:-1,[hS]:""},...d,...r.map(h=>{const v=h?h[o]:null;return typeof v=="function"?e?v(e):null:v}).concat(e).reduce((h,v)=>(v&&Object.entries(v).forEach(m=>{let[x,R]=m;if(!(a&&[Rh,Ph].includes(x)))if(x.indexOf("on")===0){if(i.has(x)||i.set(x,[]),typeof R=="function"){var E;(E=i.get(x))==null||E.push(R),h[x]=function(){for(var F,M=arguments.length,B=new Array(M),D=0;D<M;D++)B[D]=arguments[D];return(F=i.get(x))==null?void 0:F.map(P=>P(...B)).find(P=>P!==void 0)}}}else h[x]=R}),h),{})}}function FS(e){e===void 0&&(e=[]);const r=e.map(v=>v==null?void 0:v.reference),o=e.map(v=>v==null?void 0:v.floating),i=e.map(v=>v==null?void 0:v.item),a=de.useCallback(v=>Vf(v,e,"reference"),r),d=de.useCallback(v=>Vf(v,e,"floating"),o),h=de.useCallback(v=>Vf(v,e,"item"),i);return de.useMemo(()=>({getReferenceProps:a,getFloatingProps:d,getItemProps:h}),[a,d,h])}const MS={white:"bg-white text-dark-300 border border-gray-300",primary:"bg-primary-600",secondary:"bg-secondary-500",success:"bg-success-600",info:"bg-info-500",warning:"bg-warning-500 text-gray-800",danger:"bg-danger-500",steel:"bg-steel-500",orange:"bg-orange-500",purple:"bg-purple-500",grayDark:"bg-gray-900",grayLight:"bg-gray-100 text-gray-800"},DS={white:"text-white border border-white",primary:"text-primary-600 border border-primary-600",secondary:"text-secondary-500 border border-secondary-500",success:"text-success-600 border border-success-600",info:"text-info-500 border border-info-500",warning:"text-warning-500 border border-warning-500",danger:"text-danger-500 border border-danger-500",steel:"text-steel-500 border border-steel-500",orange:"text-orange-500 border border-orange-500",purple:"text-purple-500 border border-purple-500",grayDark:"text-gray-700 border border-gray-700",grayLight:"text-gray-500 border border-gray-100"},_S={white:"text-dark-300",primary:"text-white",secondary:"text-white",success:"text-white",info:"text-black",warning:"text-gray-800",danger:"text-white",steel:"text-white",orange:"text-black",purple:"text-white",grayDark:"text-white",grayLight:"text-gray-800"},LS={normal:"rounded",pill:"rounded-pill"},jS={big:"h-[24px] leading-[24px] text-md px-1",medium:"h-[22px] leading-[22px] text-sm px-[2px]",small:"h-[18px] leading-[18px] text-xs px-[2px]"},Xg=({category:e="solid",color:r="primary",roundness:o="normal",size:i="medium",textClassName:a="uppercase",children:d,className:h,...v})=>{const m=V.useMemo(()=>_S[r]??"text-white",[r]),x=V.useMemo(()=>fs(m,e==="outline"?DS[r]:MS[r],LS[o],jS[i]),[m,e,r,i,o]);return Q.jsx("div",{className:fs("ui-badge flex items-center font-bold",x,h),style:v==null?void 0:v.style,"data-testid":"badge","data-category":e,"data-color":r,...v,children:Q.jsx("p",{className:fs("mx-1",a),children:d})})},NS={default:"text-secondary-600 border-secondary-600",primary:"text-primary-600 border-primary-600",success:"text-success-600 border-success-600"},$S=({transition:e,onClick:r})=>Q.jsxs("div",{className:"py-1 px-3 space-x-2 flex items-center hover:bg-gray-100 cursor-pointer",onClick:o=>{o.stopPropagation(),r()},children:[Q.jsx("span",{className:"text-base text-dark flex-1",children:e.action}),Q.jsx(ii,{icon:H0,className:"text-gray-400 size-4"}),Q.jsx(Xg,{category:"outline",color:e.color,children:e.to})]}),zS=({title:e,variant:r="default",transitions:o,onClick:i})=>{const[a,d]=V.useState(!1),{refs:h,floatingStyles:v,context:m}=OS({strategy:"fixed",placement:"bottom-end",open:a,onOpenChange:d}),x=AS(m,{outsidePress:!0}),{getReferenceProps:R,getFloatingProps:E}=FS([x]);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{onClick:o!=null&&o.length?()=>d(F=>!F):void 0,ref:h.setReference,className:gt("px-1 uppercase border rounded-sm flex items-center space-x-1",o.length?"cursor-pointer":"pointer-events-none",NS[r]),...R(),children:[Q.jsx("span",{className:"text-sm font-bold",children:e}),o.length>0?Q.jsx(ii,{icon:cg,className:"size-4"}):Q.jsx(Q.Fragment,{})]}),a&&o.length&&Q.jsx("div",{ref:h.setFloating,style:v,className:gt("border border-gray-200 py-1.5 rounded-sm min-w-[172px] bg-white shadow-dark/50"),...E(),children:o.map((F,M)=>Q.jsx($S,{transition:F,onClick:()=>{i==null||i(F.id),d(!1)}},M))})]})},Fh=({description:e})=>{const r=V.useMemo(()=>{const o=/https:\/\/[^/]+\/api\/files/g,i=e==null?void 0:e.replaceAll(o,`${jp}`),a=i==null?void 0:i.replaceAll('src="/api/files',`src="${jp}`),v=new DOMParser().parseFromString(a,"text/html").querySelectorAll("img");return v==null||v.forEach(m=>{const x=m.getAttribute("src");x&&(new Image().src=x)}),a},[e]);return V.useEffect(()=>{},[r]),Q.jsx("div",{className:"flex flex-col gap-4",children:Q.jsx("div",{style:{display:"unset"},className:"lexical-view-mode",dangerouslySetInnerHTML:{__html:r}})})},BS={SEQUENTIAL:"Sequential"},US={[ut.IN_REVIEW]:"In Review"},HS={[ut.OPEN]:"bg-secondary-500",[ut.IN_PROGRESS]:"bg-primary-600",[ut.IN_REVIEW]:"bg-success-600",[ut.COMPLETED]:"bg-success-600"},WS=({playbookType:e,status:r,step:o,isSelected:i,onSelect:a})=>Q.jsx("div",{className:Ll("flex flex-col items-center justify-center",i?"bg-[#FFE600]":HS[r],a&&"cursor-pointer"),onClick:d=>{d.stopPropagation(),a==null||a(d.shiftKey)},children:Q.jsx("span",{className:Ll("text-orientation-mixed w-[27px] flex items-center whitespace-nowrap px-2 text-sm font-bold [writing-mode:vertical-lr]",i?"text-black":"text-white"),children:e===BS.SEQUENTIAL?`STEP ${o}`:(US[r]||r).toUpperCase()})}),VS={[ut.OPEN]:"secondary",[ut.IN_PROGRESS]:"primary",[ut.IN_REVIEW]:"success",[ut.COMPLETED]:"success"},YS=({status:e})=>Q.jsx(Xg,{category:"outline",color:VS[e],children:e}),GS={[ut.OPEN]:"border-[#C1C5C8] bg-[#F0F1F2]",[ut.IN_PROGRESS]:"bg-[#E6F2FF] border-[#94C8FF]",[ut.IN_REVIEW]:"bg-[#EAF6EC] border-[#A5DAB1]",[ut.COMPLETED]:"bg-[#EAF6EC] border-[#A5DAB1]"},Yf={PHOTO:"photo",SCREENSHOT:"screenshot"},QS=({task:e,step:r,playbookType:o,onButtonClick:i,viewMode:a="card",canStart:d=!1,isExpanded:h=!1,toggleExpanded:v,playbookId:m,taskStyle:x,listStickyTopBase:R})=>{const[E,F]=V.useState(!1),{taskDetails:M,prefetchQuery:B}=iS({taskId:e.taskId,playbookId:m,enabled:h}),{buttons:D}=fy({taskStatus:e.workflowStatus,canStart:d}),P=V.useMemo(()=>e.imageRequired===0?null:e.imageRequired===1?Yf.SCREENSHOT:e.imageRequired===2?Yf.PHOTO:null,[e.imageRequired]),I=async W=>{try{F(!0),await i(W)}finally{F(!1)}};if(a==="list"){const W=V.useMemo(()=>e.workflowStatus===ut.COMPLETED?"success":e.workflowStatus===ut.IN_PROGRESS?"primary":"default",[e.workflowStatus]),U=V.useMemo(()=>{const q=[];return D.forEach(_=>{_==="START"&&q.push({id:"START",color:"primary",action:"Start",to:ut.IN_PROGRESS}),_==="COMPLETE"&&q.push({id:"COMPLETE",color:"success",action:"Complete",to:ut.COMPLETED})}),q},[D]);return Q.jsxs("div",{className:gt("flex flex-col"),children:[Q.jsxs("div",{className:gt("flex gap-3 p-2 border-gray-200",e.sequenceOrder>0&&"border-t",h&&"bg-white rounded-md border border-t-none shadow-sm sticky"),style:{top:h?R:0},children:[Q.jsx("div",{className:"text-gray-200 text-base",children:e.sequenceOrder+1}),Q.jsx("div",{onClick:()=>{v==null||v(!h)},onMouseOver:B,className:gt("flex-1 truncate cursor-pointer",h&&"font-medium",e.workflowStatus===ut.COMPLETED&&"text-secondary-400 line-through"),style:{color:e.workflowStatus===ut.IN_PROGRESS&&(x==null?void 0:x.titleColor)||"#1C232D"},children:e.taskInstanceName}),Q.jsx(zS,{title:e.workflowStatus,variant:W,transitions:U,onClick:q=>{i(q)}})]}),(M==null?void 0:M.description)&&Q.jsx("div",{className:gt(!h&&"hidden","border-gray-200 border p-2 mx-4 mb-4 border-t-none -mt-[1px] bg-gray-100 rounded-b-md"),children:Q.jsx(Fh,{description:(M==null?void 0:M.description)||""})})]})}return Q.jsxs("div",{className:Ll("flex items-stretch rounded-sm overflow-hidden border",GS[e.workflowStatus]),children:[Q.jsx(WS,{playbookType:o,status:e.workflowStatus,step:r}),Q.jsxs("div",{className:"flex w-full flex-col overflow-x-hidden flex-1 p-2",children:[o==="Sequential"&&Q.jsx("div",{className:"-mb-3 self-end pr-2 pt-2",children:Q.jsx(YS,{status:e.workflowStatus})}),Q.jsxs("div",{className:"space-y-2 divide-y divide-black/10 flex flex-col flex-1",children:[Q.jsx("div",{className:gt("text-lg font-medium flex-1 pb-1"),style:{color:e.workflowStatus==="Completed"?"#1C232D":(x==null?void 0:x.titleColor)||"#1C232D"},children:e.taskInstanceName}),P?Q.jsxs("div",{className:"flex items-center gap-2 text-sm pb-2",children:[Q.jsx(ii,{icon:U0,className:"size-4"}),Q.jsxs("div",{children:[Q.jsx("span",{className:"font-medium",children:P===Yf.PHOTO?"Photo":"Screenshot"})," ","required"]})]}):Q.jsx(Q.Fragment,{})]}),(M==null?void 0:M.description)&&Q.jsx("div",{className:gt(!h&&"hidden"),children:Q.jsx(Fh,{description:(M==null?void 0:M.description)||""})}),(D.length>0||e.hasDescription)&&Q.jsxs("div",{className:"flex items-center justify-end gap-4 border-t border-black/10 pt-2",children:[Q.jsx("div",{className:"flex-1",children:Q.jsx(aS,{buttons:D,onButtonClick:I,disabled:E})}),v&&Q.jsx(jl,{size:"smallCollapse",onMouseOver:B,category:"link",onClick:()=>{v()},title:h?"Hide task description":"Show task description",children:Q.jsx(ii,{icon:cg,className:Ll("cursor-pointer text-[#0069D9]",h?"rotate-180":"")})})]})]})]})},qg=V.forwardRef(({title:e,className:r,playbookStyle:o,...i},a)=>{var d,h,v;return Q.jsx("div",{ref:a,className:gt("border-b border-gray-200 flex items-center",r),style:{backgroundColor:((d=o==null?void 0:o.whiteLabel)==null?void 0:d.titleBackgroundColor)||"#f8f9fa"},...i,children:Q.jsx("div",{className:gt("text-xl min-h-16 p-4 font-medium flex-1",{"text-dark":((h=o==null?void 0:o.whiteLabel)==null?void 0:h.titleTextColor)==="#ffffff"}),style:{color:(v=o==null?void 0:o.whiteLabel)==null?void 0:v.titleTextColor},children:e})})});qg.displayName="PlaybookHeader";const XS=({playbookInstanceId:e,playbookMode:r,playbookStyle:o})=>{const{playbook:i,actions:a}=uy(e);if(!i)return Q.jsx("div",{});console.log({playbookStyle:o});const d=async(h,v)=>{var m;if(h===Il.COMPLETE){const x=(m=i.tasks.find(R=>R.taskInstanceId===v))==null?void 0:m.sequenceOrder;if(x===void 0){console.error("Task not found in playbook");return}return a.completeTask(v,x)}if(h===Il.START)return a.startTask(v)};return Q.jsx("div",{className:"confidence-playbook",children:Q.jsx(Jg,{playbook:i,playbookMode:r,onTaskButtonClick:d,playbookStyle:o})})},qS=({className:e,children:r,numberOfTasks:o,playbookMode:i})=>Q.jsxs("div",{className:gt("w-full p-4",e),children:[o&&Q.jsxs("div",{className:gt(i==="card"&&"mb-4"),children:[Q.jsx("span",{className:"font-medium",children:"Tasks"})," (",o,")"]}),Q.jsx("div",{className:gt(i==="card"&&"space-y-4"),children:r})]}),Jg=({playbook:e,playbookMode:r,onTaskButtonClick:o,playbookStyle:i})=>{var P,I,W,U,q;const{playbookInstanceName:a,tasks:d}=e,h=V.useRef(null),[v,m]=V.useState(0),[x,R]=V.useState(!0),E=()=>{R(!x)},{isTaskExpanded:F,toggleTaskExpanded:M,isAtLeastOneTaskExpanded:B}=hm(e.playbookInstanceId,{onTaskExpanded:()=>{var _;m(((_=h.current)==null?void 0:_.offsetHeight)||0)}});V.useEffect(()=>{if(B){if(!h.current)throw new Error("Playbook header ref is not set");new ResizeObserver(ie=>{var ce;for(const ee of ie)ee.contentRect&&m(((ce=h.current)==null?void 0:ce.offsetHeight)||0)}).observe(h.current)}return()=>{h.current&&new ResizeObserver(()=>{}).unobserve(h.current)}},[B]);const D=V.useMemo(()=>{const _=d.filter(ie=>ie.workflowStatus===ut.COMPLETED).sort((ie,ce)=>ce.sequenceOrder-ie.sequenceOrder)[0];return _?_.sequenceOrder+1:0},[d]);return Q.jsxs("div",{className:gt(!(i!=null&&i.overlay)&&"min-h-screen",(i==null?void 0:i.overlay)&&"fixed bottom-0 z-[99999999999999] flex","transition-all duration-300 ease-in-out "),...(i==null?void 0:i.overlay)&&{style:{width:"100%",maxWidth:x?((P=i.overlay.size)==null?void 0:P.width)||450:"2.25rem",height:((I=i.overlay.size)==null?void 0:I.height)||"calc(100vh - 4rem)",maxHeight:"calc(100vh - 4rem)",right:((W=i.overlay.offset)==null?void 0:W.right)!==void 0?i.overlay.offset.right:i.overlay.position==="right"?32:void 0,left:((U=i.overlay.offset)==null?void 0:U.left)!==void 0?i.overlay.offset.left:i.overlay.position==="left"?32:void 0}},children:[(i==null?void 0:i.overlay)&&Q.jsx("div",{onClick:E,className:gt("size-9 relative p-1 top-3 z-[99999999999999] border-none rounded-l-sm cursor-pointer"),style:{backgroundColor:((q=i==null?void 0:i.whiteLabel)==null?void 0:q.primaryColor)||"#007BFF",boxShadow:"0px 3px 3px 0px #00000040"},children:Q.jsx("img",{src:Jh,alt:"Confidence Logo",className:"w-full h-full object-contain"})}),Q.jsxs("div",{className:gt("flex flex-col flex-1 bg-gray-50",(i==null?void 0:i.overlay)&&"border border-gray-200 shadow-2xl rounded-t-sm overflow-y-auto"),children:[Q.jsx(qg,{title:a,className:gt("top-0 sticky z-2"),playbookStyle:i,ref:h}),Q.jsx(qS,{playbookMode:r,numberOfTasks:e.numberofTasks,children:d.map((_,ie)=>{var ce;return Q.jsx(QS,{task:_,step:ie+1,viewMode:r,playbookId:e.playbookId,canStart:_.sequenceOrder===D,onButtonClick:ee=>o(ee,_.taskInstanceId),playbookType:"Non-Sequential",taskStyle:{titleColor:(ce=i==null?void 0:i.whiteLabel)==null?void 0:ce.primaryColor},isExpanded:F(_.taskInstanceId),toggleExpanded:()=>M(_.taskInstanceId),listStickyTopBase:v||104},ie)})})]})]})},JS=({email:e,playbookId:r,playbookMode:o,playbookStyle:i})=>{const[a,d]=V.useState(null);return V.useEffect(()=>{(async()=>{const{playbookInstanceId:h,errorCode:v,details:m,message:x}=await mm({bank:"public-sdk",email:e,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"America/Los_Angeles",playbookUid:r})||{};if(v)throw new Error(`Error initiating playbook: ${x} (Code: ${v}) - Details: ${m}`);d(h)})()},[]),a?Q.jsx(aa,{playbookInstanceId:a,playbookMode:o,playbookStyle:i}):Q.jsx("div",{children:"Loading..."})},KS=({playbookId:e,playbookMode:r="list",playbookStyle:o,btnLabel:i="Start Playbook",btnColor:a="primary"})=>{const[d,h]=V.useState(null);return Q.jsxs(Q.Fragment,{children:[Q.jsxs($d.div,{children:[Q.jsx(z0,{playbookId:e,disabled:!!d,onInitiated:h,btnLabel:i,btnColor:a}),Q.jsx("style",{type:"text/css",children:Vd})]}),d&&Q.jsx(aa,{playbookInstanceId:d,playbookMode:r,playbookStyle:o})]})},aa=({playbookInstanceId:e,playbookMode:r,playbookStyle:o})=>Q.jsx(dm,{children:Q.jsx(XS,{playbookInstanceId:e,playbookMode:r,playbookStyle:o})});aa.Context=dm;aa.View=Jg;aa.AutoInstantiated=JS;aa.WithInstantiateButton=KS;const ZS=e=>uc.createPortal(Q.jsxs($d.div,{children:[Q.jsx("style",{children:Vd}),Q.jsx(aa,{...e})]}),document.body);exports.ConfidencePlaybook=ZS;
|
|
692
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qw(e){var r,o=e.beat,i=e.fade,a=e.beatFade,d=e.bounce,h=e.shake,v=e.flash,m=e.spin,x=e.spinPulse,R=e.spinReverse,E=e.pulse,F=e.fixedWidth,M=e.inverse,B=e.border,D=e.listItem,P=e.flip,I=e.size,W=e.rotation,U=e.pull,q=(r={"fa-beat":o,"fa-fade":i,"fa-beat-fade":a,"fa-bounce":d,"fa-shake":h,"fa-flash":v,"fa-spin":m,"fa-spin-reverse":R,"fa-spin-pulse":x,"fa-pulse":E,"fa-fw":F,"fa-inverse":M,"fa-border":B,"fa-li":D,"fa-flip":P===!0,"fa-flip-horizontal":P==="horizontal"||P==="both","fa-flip-vertical":P==="vertical"||P==="both"},us(r,"fa-".concat(I),typeof I<"u"&&I!==null),us(r,"fa-rotate-".concat(W),typeof W<"u"&&W!==null&&W!==0),us(r,"fa-pull-".concat(U),typeof U<"u"&&U!==null),us(r,"fa-swap-opacity",e.swapOpacity),r);return Object.keys(q).map(function(_){return q[_]?_:null}).filter(function(_){return _})}function Jw(e){return e=e-0,e===e}function Vg(e){return Jw(e)?e:(e=e.replace(/[\-_\s]+(.)?/g,function(r,o){return o?o.toUpperCase():""}),e.substr(0,1).toLowerCase()+e.substr(1))}var Kw=["style"];function Zw(e){return e.charAt(0).toUpperCase()+e.slice(1)}function eS(e){return e.split(";").map(function(r){return r.trim()}).filter(function(r){return r}).reduce(function(r,o){var i=o.indexOf(":"),a=Vg(o.slice(0,i)),d=o.slice(i+1).trim();return a.startsWith("webkit")?r[Zw(a)]=d:r[a]=d,r},{})}function Yg(e,r){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(typeof r=="string")return r;var i=(r.children||[]).map(function(m){return Yg(e,m)}),a=Object.keys(r.attributes||{}).reduce(function(m,x){var R=r.attributes[x];switch(x){case"class":m.attrs.className=R,delete r.attributes.class;break;case"style":m.attrs.style=eS(R);break;default:x.indexOf("aria-")===0||x.indexOf("data-")===0?m.attrs[x.toLowerCase()]=R:m.attrs[Vg(x)]=R}return m},{attrs:{}}),d=o.style,h=d===void 0?{}:d,v=Wg(o,Kw);return a.attrs.style=ti(ti({},a.attrs.style),h),e.apply(void 0,[r.tag,ti(ti({},a.attrs),v)].concat(Dd(i)))}var Gg=!1;try{Gg=process.env.NODE_ENV==="production"}catch{}function tS(){if(!Gg&&console&&typeof console.error=="function"){var e;(e=console).error.apply(e,arguments)}}function Eh(e){if(e&&lc(e)==="object"&&e.prefix&&e.iconName&&e.icon)return e;if(Md.icon)return Md.icon(e);if(e===null)return null;if(e&&lc(e)==="object"&&e.prefix&&e.iconName)return e;if(Array.isArray(e)&&e.length===2)return{prefix:e[0],iconName:e[1]};if(typeof e=="string")return{prefix:"fas",iconName:e}}function Uf(e,r){return Array.isArray(r)&&r.length>0||!Array.isArray(r)&&r?us({},e,r):{}}var rS=["forwardedRef"];function ii(e){var r=e.forwardedRef,o=Wg(e,rS),i=o.icon,a=o.mask,d=o.symbol,h=o.className,v=o.title,m=o.titleId,x=o.maskId,R=Eh(i),E=Uf("classes",[].concat(Dd(qw(o)),Dd(h.split(" ")))),F=Uf("transform",typeof o.transform=="string"?Md.transform(o.transform):o.transform),M=Uf("mask",Eh(a)),B=Ww(R,ti(ti(ti(ti({},E),F),M),{},{symbol:d,title:v,titleId:m,maskId:x}));if(!B)return tS("Could not find icon",R),null;var D=B.abstract,P={ref:r};return Object.keys(o).forEach(function(I){ii.defaultProps.hasOwnProperty(I)||(P[I]=o[I])}),nS(D[0],P)}ii.displayName="FontAwesomeIcon";ii.propTypes={beat:Me.bool,border:Me.bool,beatFade:Me.bool,bounce:Me.bool,className:Me.string,fade:Me.bool,flash:Me.bool,mask:Me.oneOfType([Me.object,Me.array,Me.string]),maskId:Me.string,fixedWidth:Me.bool,inverse:Me.bool,flip:Me.oneOf([!0,!1,"horizontal","vertical","both"]),icon:Me.oneOfType([Me.object,Me.array,Me.string]),listItem:Me.bool,pull:Me.oneOf(["right","left"]),pulse:Me.bool,rotation:Me.oneOf([0,90,180,270]),shake:Me.bool,size:Me.oneOf(["2xs","xs","sm","lg","xl","2xl","1x","2x","3x","4x","5x","6x","7x","8x","9x","10x"]),spin:Me.bool,spinPulse:Me.bool,spinReverse:Me.bool,symbol:Me.oneOfType([Me.bool,Me.string]),title:Me.string,titleId:Me.string,transform:Me.oneOfType([Me.string,Me.object]),swapOpacity:Me.bool};ii.defaultProps={border:!1,className:"",mask:null,maskId:null,fixedWidth:!1,inverse:!1,flip:!1,icon:null,listItem:!1,pull:null,pulse:!1,rotation:null,size:null,spin:!1,spinPulse:!1,spinReverse:!1,beat:!1,fade:!1,beatFade:!1,bounce:!1,shake:!1,symbol:!1,title:"",titleId:null,transform:null,swapOpacity:!1};var nS=Yg.bind(null,V.createElement);const oS=async e=>await(await fetch(`${Vl}/playbook-task-details`,{method:"POST",body:JSON.stringify(e)})).json(),iS=({taskId:e,playbookId:r,enabled:o})=>{const{queryClient:i}=Is(),a=async()=>oS({taskId:+e,templateId:r.toString()}),d=["taskDetails",+e,r],h=Hd({queryKey:d,queryFn:a,enabled:o,staleTime:1/0},i),v=()=>{i.prefetchQuery({queryFn:a,queryKey:d,staleTime:1/0})};return{taskDetails:h.data,prefetchQuery:v,...h}},aS=({buttons:e,onButtonClick:r,disabled:o})=>Q.jsx("div",{className:"flex items-center justify-end",children:e.map(i=>Q.jsx(jl,{size:"smallCollapse",className:"ml-2",disabled:o,onClick:()=>{r(i)},children:cy[i]},i))});function Ch(e,r){if(!e||!r)return!1;const o=r.getRootNode==null?void 0:r.getRootNode();if(e.contains(r))return!0;if(o&&md(o)){let i=r;for(;i;){if(e===i)return!0;i=i.parentNode||i.host}}return!1}function Rl(e){return"composedPath"in e?e.composedPath()[0]:e.target}function Hf(e,r){if(r==null)return!1;if("composedPath"in e)return e.composedPath().includes(r);const o=e;return o.target!=null&&r.contains(o.target)}function sS(e){return e.matches("html,body")}function Th(e){return(e==null?void 0:e.ownerDocument)||document}function Wf(e,r){let o=e.filter(a=>{var d;return a.parentId===r&&((d=a.context)==null?void 0:d.open)}),i=o;for(;i.length;)i=e.filter(a=>{var d;return(d=i)==null?void 0:d.some(h=>{var v;return a.parentId===h.id&&((v=a.context)==null?void 0:v.open)})}),o=o.concat(i);return o}function lS(e){return"nativeEvent"in e}var uS=typeof document<"u",cS=function(){},Ld=uS?V.useLayoutEffect:cS;const fS={...de},dS=fS.useInsertionEffect,pS=dS||(e=>e());function ss(e){const r=de.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return pS(()=>{r.current=e}),de.useCallback(function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r.current==null?void 0:r.current(...i)},[])}const hS="data-floating-ui-focusable",Rh="active",Ph="selected",mS={...de};let Ah=!1,gS=0;const Ih=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+gS++;function vS(){const[e,r]=de.useState(()=>Ah?Ih():void 0);return Ld(()=>{e==null&&r(Ih())},[]),de.useEffect(()=>{Ah=!0},[]),e}const yS=mS.useId,bS=yS||vS;let jd;process.env.NODE_ENV!=="production"&&(jd=new Set);function xS(){for(var e,r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];const a="Floating UI: "+o.join(" ");if(!((e=jd)!=null&&e.has(a))){var d;(d=jd)==null||d.add(a),console.error(a)}}function wS(){const e=new Map;return{emit(r,o){var i;(i=e.get(r))==null||i.forEach(a=>a(o))},on(r,o){e.has(r)||e.set(r,new Set),e.get(r).add(o)},off(r,o){var i;(i=e.get(r))==null||i.delete(o)}}}const SS=de.createContext(null),kS=de.createContext(null),ES=()=>{var e;return((e=de.useContext(SS))==null?void 0:e.id)||null},Qg=()=>de.useContext(kS);function CS(e){return"data-floating-ui-"+e}function TS(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const RS={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},PS={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},Oh=e=>{var r,o;return{escapeKey:typeof e=="boolean"?e:(r=e==null?void 0:e.escapeKey)!=null?r:!1,outsidePress:typeof e=="boolean"?e:(o=e==null?void 0:e.outsidePress)!=null?o:!0}};function AS(e,r){r===void 0&&(r={});const{open:o,onOpenChange:i,elements:a,dataRef:d}=e,{enabled:h=!0,escapeKey:v=!0,outsidePress:m=!0,outsidePressEvent:x="pointerdown",referencePress:R=!1,referencePressEvent:E="pointerdown",ancestorScroll:F=!1,bubbles:M,capture:B}=r,D=Qg(),P=ss(typeof m=="function"?m:()=>!1),I=typeof m=="function"?P:m,W=de.useRef(!1),{escapeKey:U,outsidePress:q}=Oh(M),{escapeKey:_,outsidePress:ie}=Oh(B),ce=de.useRef(!1),ee=de.useRef(-1),ae=ss(ke=>{var Ce;if(!o||!h||!v||ke.key!=="Escape"||ce.current)return;const je=(Ce=d.current.floatingContext)==null?void 0:Ce.nodeId,Z=D?Wf(D.nodesRef.current,je):[];if(!U&&(ke.stopPropagation(),Z.length>0)){let be=!0;if(Z.forEach(G=>{var J;if((J=G.context)!=null&&J.open&&!G.context.dataRef.current.__escapeKeyBubbles){be=!1;return}}),!be)return}i(!1,lS(ke)?ke.nativeEvent:ke,"escape-key")}),Fe=ss(ke=>{var Ce;const je=()=>{var Z;ae(ke),(Z=Rl(ke))==null||Z.removeEventListener("keydown",je)};(Ce=Rl(ke))==null||Ce.addEventListener("keydown",je)}),Ne=ss(ke=>{var Ce;const je=d.current.insideReactTree;d.current.insideReactTree=!1;const Z=W.current;if(W.current=!1,x==="click"&&Z||je||typeof I=="function"&&!I(ke))return;const be=Rl(ke),G="["+CS("inert")+"]",J=Th(a.floating).querySelectorAll(G);let fe=pt(be)?be:null;for(;fe&&!Zn(fe);){const se=to(fe);if(Zn(se)||!pt(se))break;fe=se}if(J.length&&pt(be)&&!sS(be)&&!Ch(be,a.floating)&&Array.from(J).every(se=>!Ch(fe,se)))return;if(Zr(be)&&Qe){const se=Zn(be),ue=_r(be),Te=/auto|scroll/,Ee=se||Te.test(ue.overflowX),Re=se||Te.test(ue.overflowY),$e=Ee&&be.clientWidth>0&&be.scrollWidth>be.clientWidth,oe=Re&&be.clientHeight>0&&be.scrollHeight>be.clientHeight,Ue=ue.direction==="rtl",nt=oe&&(Ue?ke.offsetX<=be.offsetWidth-be.clientWidth:ke.offsetX>be.clientWidth),Lt=$e&&ke.offsetY>be.clientHeight;if(nt||Lt)return}const me=(Ce=d.current.floatingContext)==null?void 0:Ce.nodeId,pe=D&&Wf(D.nodesRef.current,me).some(se=>{var ue;return Hf(ke,(ue=se.context)==null?void 0:ue.elements.floating)});if(Hf(ke,a.floating)||Hf(ke,a.domReference)||pe)return;const ge=D?Wf(D.nodesRef.current,me):[];if(ge.length>0){let se=!0;if(ge.forEach(ue=>{var Te;if((Te=ue.context)!=null&&Te.open&&!ue.context.dataRef.current.__outsidePressBubbles){se=!1;return}}),!se)return}i(!1,ke,"outside-press")}),_e=ss(ke=>{var Ce;const je=()=>{var Z;Ne(ke),(Z=Rl(ke))==null||Z.removeEventListener(x,je)};(Ce=Rl(ke))==null||Ce.addEventListener(x,je)});de.useEffect(()=>{if(!o||!h)return;d.current.__escapeKeyBubbles=U,d.current.__outsidePressBubbles=q;let ke=-1;function Ce(J){i(!1,J,"ancestor-scroll")}function je(){window.clearTimeout(ke),ce.current=!0}function Z(){ke=window.setTimeout(()=>{ce.current=!1},vc()?5:0)}const be=Th(a.floating);v&&(be.addEventListener("keydown",_?Fe:ae,_),be.addEventListener("compositionstart",je),be.addEventListener("compositionend",Z)),I&&be.addEventListener(x,ie?_e:Ne,ie);let G=[];return F&&(pt(a.domReference)&&(G=ds(a.domReference)),pt(a.floating)&&(G=G.concat(ds(a.floating))),!pt(a.reference)&&a.reference&&a.reference.contextElement&&(G=G.concat(ds(a.reference.contextElement)))),G=G.filter(J=>{var fe;return J!==((fe=be.defaultView)==null?void 0:fe.visualViewport)}),G.forEach(J=>{J.addEventListener("scroll",Ce,{passive:!0})}),()=>{v&&(be.removeEventListener("keydown",_?Fe:ae,_),be.removeEventListener("compositionstart",je),be.removeEventListener("compositionend",Z)),I&&be.removeEventListener(x,ie?_e:Ne,ie),G.forEach(J=>{J.removeEventListener("scroll",Ce)}),window.clearTimeout(ke)}},[d,a,v,I,x,o,i,F,h,U,q,ae,_,Fe,Ne,ie,_e]),de.useEffect(()=>{d.current.insideReactTree=!1},[d,I,x]);const Ge=de.useMemo(()=>({onKeyDown:ae,...R&&{[RS[E]]:ke=>{i(!1,ke.nativeEvent,"reference-press")},...E!=="click"&&{onClick(ke){i(!1,ke.nativeEvent,"reference-press")}}}}),[ae,i,R,E]),Qe=de.useMemo(()=>({onKeyDown:ae,onMouseDown(){W.current=!0},onMouseUp(){W.current=!0},[PS[x]]:()=>{d.current.insideReactTree=!0},onBlurCapture(){D||(TS(ee),d.current.insideReactTree=!0,ee.current=window.setTimeout(()=>{d.current.insideReactTree=!1}))}}),[ae,x,d,D]);return de.useMemo(()=>h?{reference:Ge,floating:Qe}:{},[h,Ge,Qe])}function IS(e){const{open:r=!1,onOpenChange:o,elements:i}=e,a=bS(),d=de.useRef({}),[h]=de.useState(()=>wS()),v=ES()!=null;if(process.env.NODE_ENV!=="production"){const M=i.reference;M&&!pt(M)&&xS("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[m,x]=de.useState(i.reference),R=ss((M,B,D)=>{d.current.openEvent=M?B:void 0,h.emit("openchange",{open:M,event:B,reason:D,nested:v}),o==null||o(M,B,D)}),E=de.useMemo(()=>({setPositionReference:x}),[]),F=de.useMemo(()=>({reference:m||i.reference||null,floating:i.floating||null,domReference:i.reference}),[m,i.reference,i.floating]);return de.useMemo(()=>({dataRef:d,open:r,onOpenChange:R,elements:F,events:h,floatingId:a,refs:E}),[r,R,F,h,a,E])}function OS(e){e===void 0&&(e={});const{nodeId:r}=e,o=IS({...e,elements:{reference:null,floating:null,...e.elements}}),i=e.rootContext||o,a=i.elements,[d,h]=de.useState(null),[v,m]=de.useState(null),R=(a==null?void 0:a.domReference)||d,E=de.useRef(null),F=Qg();Ld(()=>{R&&(E.current=R)},[R]);const M=O0({...e,elements:{...a,...v&&{reference:v}}}),B=de.useCallback(U=>{const q=pt(U)?{getBoundingClientRect:()=>U.getBoundingClientRect(),getClientRects:()=>U.getClientRects(),contextElement:U}:U;m(q),M.refs.setReference(q)},[M.refs]),D=de.useCallback(U=>{(pt(U)||U===null)&&(E.current=U,h(U)),(pt(M.refs.reference.current)||M.refs.reference.current===null||U!==null&&!pt(U))&&M.refs.setReference(U)},[M.refs]),P=de.useMemo(()=>({...M.refs,setReference:D,setPositionReference:B,domReference:E}),[M.refs,D,B]),I=de.useMemo(()=>({...M.elements,domReference:R}),[M.elements,R]),W=de.useMemo(()=>({...M,...i,refs:P,elements:I,nodeId:r}),[M,P,I,r,i]);return Ld(()=>{i.dataRef.current.floatingContext=W;const U=F==null?void 0:F.nodesRef.current.find(q=>q.id===r);U&&(U.context=W)}),de.useMemo(()=>({...M,context:W,refs:P,elements:I}),[M,P,I,W])}function Vf(e,r,o){const i=new Map,a=o==="item";let d=e;if(a&&e){const{[Rh]:h,[Ph]:v,...m}=e;d=m}return{...o==="floating"&&{tabIndex:-1,[hS]:""},...d,...r.map(h=>{const v=h?h[o]:null;return typeof v=="function"?e?v(e):null:v}).concat(e).reduce((h,v)=>(v&&Object.entries(v).forEach(m=>{let[x,R]=m;if(!(a&&[Rh,Ph].includes(x)))if(x.indexOf("on")===0){if(i.has(x)||i.set(x,[]),typeof R=="function"){var E;(E=i.get(x))==null||E.push(R),h[x]=function(){for(var F,M=arguments.length,B=new Array(M),D=0;D<M;D++)B[D]=arguments[D];return(F=i.get(x))==null?void 0:F.map(P=>P(...B)).find(P=>P!==void 0)}}}else h[x]=R}),h),{})}}function FS(e){e===void 0&&(e=[]);const r=e.map(v=>v==null?void 0:v.reference),o=e.map(v=>v==null?void 0:v.floating),i=e.map(v=>v==null?void 0:v.item),a=de.useCallback(v=>Vf(v,e,"reference"),r),d=de.useCallback(v=>Vf(v,e,"floating"),o),h=de.useCallback(v=>Vf(v,e,"item"),i);return de.useMemo(()=>({getReferenceProps:a,getFloatingProps:d,getItemProps:h}),[a,d,h])}const MS={white:"bg-white text-dark-300 border border-gray-300",primary:"bg-primary-600",secondary:"bg-secondary-500",success:"bg-success-600",info:"bg-info-500",warning:"bg-warning-500 text-gray-800",danger:"bg-danger-500",steel:"bg-steel-500",orange:"bg-orange-500",purple:"bg-purple-500",grayDark:"bg-gray-900",grayLight:"bg-gray-100 text-gray-800"},DS={white:"text-white border border-white",primary:"text-primary-600 border border-primary-600",secondary:"text-secondary-500 border border-secondary-500",success:"text-success-600 border border-success-600",info:"text-info-500 border border-info-500",warning:"text-warning-500 border border-warning-500",danger:"text-danger-500 border border-danger-500",steel:"text-steel-500 border border-steel-500",orange:"text-orange-500 border border-orange-500",purple:"text-purple-500 border border-purple-500",grayDark:"text-gray-700 border border-gray-700",grayLight:"text-gray-500 border border-gray-100"},_S={white:"text-dark-300",primary:"text-white",secondary:"text-white",success:"text-white",info:"text-black",warning:"text-gray-800",danger:"text-white",steel:"text-white",orange:"text-black",purple:"text-white",grayDark:"text-white",grayLight:"text-gray-800"},LS={normal:"rounded",pill:"rounded-pill"},jS={big:"h-[24px] leading-[24px] text-md px-1",medium:"h-[22px] leading-[22px] text-sm px-[2px]",small:"h-[18px] leading-[18px] text-xs px-[2px]"},Xg=({category:e="solid",color:r="primary",roundness:o="normal",size:i="medium",textClassName:a="uppercase",children:d,className:h,...v})=>{const m=V.useMemo(()=>_S[r]??"text-white",[r]),x=V.useMemo(()=>fs(m,e==="outline"?DS[r]:MS[r],LS[o],jS[i]),[m,e,r,i,o]);return Q.jsx("div",{className:fs("ui-badge flex items-center font-bold",x,h),style:v==null?void 0:v.style,"data-testid":"badge","data-category":e,"data-color":r,...v,children:Q.jsx("p",{className:fs("mx-1",a),children:d})})},NS={default:"text-secondary-600 border-secondary-600",primary:"text-primary-600 border-primary-600",success:"text-success-600 border-success-600"},$S=({transition:e,onClick:r})=>Q.jsxs("div",{className:"py-1 px-3 space-x-2 flex items-center hover:bg-gray-100 cursor-pointer",onClick:o=>{o.stopPropagation(),r()},children:[Q.jsx("span",{className:"text-base text-dark flex-1",children:e.action}),Q.jsx(ii,{icon:H0,className:"text-gray-400 size-4"}),Q.jsx(Xg,{category:"outline",color:e.color,children:e.to})]}),zS=({title:e,variant:r="default",transitions:o,onClick:i})=>{const[a,d]=V.useState(!1),{refs:h,floatingStyles:v,context:m}=OS({strategy:"fixed",placement:"bottom-end",open:a,onOpenChange:d}),x=AS(m,{outsidePress:!0}),{getReferenceProps:R,getFloatingProps:E}=FS([x]);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{onClick:o!=null&&o.length?()=>d(F=>!F):void 0,ref:h.setReference,className:gt("px-1 uppercase border rounded-sm flex items-center space-x-1",o.length?"cursor-pointer":"pointer-events-none",NS[r]),...R(),children:[Q.jsx("span",{className:"text-sm font-bold",children:e}),o.length>0?Q.jsx(ii,{icon:cg,className:"size-4"}):Q.jsx(Q.Fragment,{})]}),a&&o.length&&Q.jsx("div",{ref:h.setFloating,style:v,className:gt("border border-gray-200 py-1.5 rounded-sm min-w-[172px] bg-white shadow-dark/50"),...E(),children:o.map((F,M)=>Q.jsx($S,{transition:F,onClick:()=>{i==null||i(F.id),d(!1)}},M))})]})},Fh=({description:e})=>{const r=V.useMemo(()=>{const o=/https:\/\/[^/]+\/api\/files/g,i=e==null?void 0:e.replaceAll(o,`${jp}`),a=i==null?void 0:i.replaceAll('src="/api/files',`src="${jp}`),v=new DOMParser().parseFromString(a,"text/html").querySelectorAll("img");return v==null||v.forEach(m=>{const x=m.getAttribute("src");x&&(new Image().src=x)}),a},[e]);return V.useEffect(()=>{},[r]),Q.jsx("div",{className:"flex flex-col gap-4",children:Q.jsx("div",{style:{display:"unset"},className:"lexical-view-mode",dangerouslySetInnerHTML:{__html:r}})})},BS={SEQUENTIAL:"Sequential"},US={[ut.IN_REVIEW]:"In Review"},HS={[ut.OPEN]:"bg-secondary-500",[ut.IN_PROGRESS]:"bg-primary-600",[ut.IN_REVIEW]:"bg-success-600",[ut.COMPLETED]:"bg-success-600"},WS=({playbookType:e,status:r,step:o,isSelected:i,onSelect:a})=>Q.jsx("div",{className:Ll("flex flex-col items-center justify-center",i?"bg-[#FFE600]":HS[r],a&&"cursor-pointer"),onClick:d=>{d.stopPropagation(),a==null||a(d.shiftKey)},children:Q.jsx("span",{className:Ll("text-orientation-mixed w-[27px] flex items-center whitespace-nowrap px-2 text-sm font-bold [writing-mode:vertical-lr]",i?"text-black":"text-white"),children:e===BS.SEQUENTIAL?`STEP ${o}`:(US[r]||r).toUpperCase()})}),VS={[ut.OPEN]:"secondary",[ut.IN_PROGRESS]:"primary",[ut.IN_REVIEW]:"success",[ut.COMPLETED]:"success"},YS=({status:e})=>Q.jsx(Xg,{category:"outline",color:VS[e],children:e}),GS={[ut.OPEN]:"border-[#C1C5C8] bg-[#F0F1F2]",[ut.IN_PROGRESS]:"bg-[#E6F2FF] border-[#94C8FF]",[ut.IN_REVIEW]:"bg-[#EAF6EC] border-[#A5DAB1]",[ut.COMPLETED]:"bg-[#EAF6EC] border-[#A5DAB1]"},Yf={PHOTO:"photo",SCREENSHOT:"screenshot"},QS=({task:e,step:r,playbookType:o,onButtonClick:i,viewMode:a="card",canStart:d=!1,isExpanded:h=!1,toggleExpanded:v,playbookId:m,taskStyle:x,listStickyTopBase:R})=>{const[E,F]=V.useState(!1),{taskDetails:M,prefetchQuery:B}=iS({taskId:e.taskId,playbookId:m,enabled:h}),{buttons:D}=fy({taskStatus:e.workflowStatus,canStart:d}),P=V.useMemo(()=>e.imageRequired===0?null:e.imageRequired===1?Yf.SCREENSHOT:e.imageRequired===2?Yf.PHOTO:null,[e.imageRequired]),I=async W=>{try{F(!0),await i(W)}finally{F(!1)}};if(a==="list"){const W=V.useMemo(()=>e.workflowStatus===ut.COMPLETED?"success":e.workflowStatus===ut.IN_PROGRESS?"primary":"default",[e.workflowStatus]),U=V.useMemo(()=>{const q=[];return D.forEach(_=>{_==="START"&&q.push({id:"START",color:"primary",action:"Start",to:ut.IN_PROGRESS}),_==="COMPLETE"&&q.push({id:"COMPLETE",color:"success",action:"Complete",to:ut.COMPLETED})}),q},[D]);return Q.jsxs("div",{className:gt("flex flex-col"),children:[Q.jsxs("div",{className:gt("flex gap-3 p-2 border-gray-200",e.sequenceOrder>0&&"border-t",h&&"bg-white rounded-md border border-t-none shadow-sm sticky"),style:{top:h?R:0},children:[Q.jsx("div",{className:"text-gray-200 text-base",children:e.sequenceOrder+1}),Q.jsx("div",{onClick:()=>{v==null||v(!h)},onMouseOver:B,className:gt("flex-1 truncate cursor-pointer",h&&"font-medium",e.workflowStatus===ut.COMPLETED&&"text-secondary-400 line-through"),style:{color:e.workflowStatus===ut.IN_PROGRESS&&(x==null?void 0:x.titleColor)||"#1C232D"},children:e.taskInstanceName}),Q.jsx(zS,{title:e.workflowStatus,variant:W,transitions:U,onClick:q=>{i(q)}})]}),(M==null?void 0:M.description)&&Q.jsx("div",{className:gt(!h&&"hidden","border-gray-200 border p-2 mx-4 mb-4 border-t-none -mt-[1px] bg-gray-100 rounded-b-md"),children:Q.jsx(Fh,{description:(M==null?void 0:M.description)||""})})]})}return Q.jsxs("div",{className:Ll("flex items-stretch rounded-sm overflow-hidden border",GS[e.workflowStatus]),children:[Q.jsx(WS,{playbookType:o,status:e.workflowStatus,step:r}),Q.jsxs("div",{className:"flex w-full flex-col overflow-x-hidden flex-1 p-2",children:[o==="Sequential"&&Q.jsx("div",{className:"-mb-3 self-end pr-2 pt-2",children:Q.jsx(YS,{status:e.workflowStatus})}),Q.jsxs("div",{className:"space-y-2 divide-y divide-black/10 flex flex-col flex-1",children:[Q.jsx("div",{className:gt("text-lg font-medium flex-1 pb-1"),style:{color:e.workflowStatus==="Completed"?"#1C232D":(x==null?void 0:x.titleColor)||"#1C232D"},children:e.taskInstanceName}),P?Q.jsxs("div",{className:"flex items-center gap-2 text-sm pb-2",children:[Q.jsx(ii,{icon:U0,className:"size-4"}),Q.jsxs("div",{children:[Q.jsx("span",{className:"font-medium",children:P===Yf.PHOTO?"Photo":"Screenshot"})," ","required"]})]}):Q.jsx(Q.Fragment,{})]}),(M==null?void 0:M.description)&&Q.jsx("div",{className:gt(!h&&"hidden"),children:Q.jsx(Fh,{description:(M==null?void 0:M.description)||""})}),(D.length>0||e.hasDescription)&&Q.jsxs("div",{className:"flex items-center justify-end gap-4 border-t border-black/10 pt-2",children:[Q.jsx("div",{className:"flex-1",children:Q.jsx(aS,{buttons:D,onButtonClick:I,disabled:E})}),v&&Q.jsx(jl,{size:"smallCollapse",onMouseOver:B,category:"link",onClick:()=>{v()},title:h?"Hide task description":"Show task description",children:Q.jsx(ii,{icon:cg,className:Ll("cursor-pointer text-[#0069D9]",h?"rotate-180":"")})})]})]})]})},qg=V.forwardRef(({title:e,className:r,playbookStyle:o,...i},a)=>{var d,h,v;return Q.jsx("div",{ref:a,className:gt("border-b border-gray-200 flex items-center",r),style:{backgroundColor:((d=o==null?void 0:o.whiteLabel)==null?void 0:d.titleBackgroundColor)||"#f8f9fa"},...i,children:Q.jsx("div",{className:gt("text-xl min-h-16 p-4 font-medium flex-1",{"text-dark":!((h=o==null?void 0:o.whiteLabel)!=null&&h.titleTextColor)}),style:{color:(v=o==null?void 0:o.whiteLabel)==null?void 0:v.titleTextColor},children:e})})});qg.displayName="PlaybookHeader";const XS=({playbookInstanceId:e,playbookMode:r,playbookStyle:o})=>{const{playbook:i,actions:a}=uy(e);if(!i)return Q.jsx("div",{});console.log({playbookStyle:o});const d=async(h,v)=>{var m;if(h===Il.COMPLETE){const x=(m=i.tasks.find(R=>R.taskInstanceId===v))==null?void 0:m.sequenceOrder;if(x===void 0){console.error("Task not found in playbook");return}return a.completeTask(v,x)}if(h===Il.START)return a.startTask(v)};return Q.jsx("div",{className:"confidence-playbook",children:Q.jsx(Jg,{playbook:i,playbookMode:r,onTaskButtonClick:d,playbookStyle:o})})},qS=({className:e,children:r,numberOfTasks:o,playbookMode:i})=>Q.jsxs("div",{className:gt("w-full p-4",e),children:[o&&Q.jsxs("div",{className:gt(i==="card"&&"mb-4"),children:[Q.jsx("span",{className:"font-medium",children:"Tasks"})," (",o,")"]}),Q.jsx("div",{className:gt(i==="card"&&"space-y-4"),children:r})]}),Jg=({playbook:e,playbookMode:r,onTaskButtonClick:o,playbookStyle:i})=>{var P,I,W,U,q;const{playbookInstanceName:a,tasks:d}=e,h=V.useRef(null),[v,m]=V.useState(0),[x,R]=V.useState(!0),E=()=>{R(!x)},{isTaskExpanded:F,toggleTaskExpanded:M,isAtLeastOneTaskExpanded:B}=hm(e.playbookInstanceId,{onTaskExpanded:()=>{var _;m(((_=h.current)==null?void 0:_.offsetHeight)||0)}});V.useEffect(()=>{if(B){if(!h.current)throw new Error("Playbook header ref is not set");new ResizeObserver(ie=>{var ce;for(const ee of ie)ee.contentRect&&m(((ce=h.current)==null?void 0:ce.offsetHeight)||0)}).observe(h.current)}return()=>{h.current&&new ResizeObserver(()=>{}).unobserve(h.current)}},[B]);const D=V.useMemo(()=>{const _=d.filter(ie=>ie.workflowStatus===ut.COMPLETED).sort((ie,ce)=>ce.sequenceOrder-ie.sequenceOrder)[0];return _?_.sequenceOrder+1:0},[d]);return Q.jsxs("div",{className:gt(!(i!=null&&i.overlay)&&"min-h-screen",(i==null?void 0:i.overlay)&&"fixed bottom-0 z-[99999999999999] flex","transition-all duration-300 ease-in-out "),...(i==null?void 0:i.overlay)&&{style:{width:"100%",maxWidth:x?((P=i.overlay.size)==null?void 0:P.width)||450:"2.25rem",height:((I=i.overlay.size)==null?void 0:I.height)||"calc(100vh - 4rem)",maxHeight:"calc(100vh - 4rem)",right:((W=i.overlay.offset)==null?void 0:W.right)!==void 0?i.overlay.offset.right:i.overlay.position==="right"?32:void 0,left:((U=i.overlay.offset)==null?void 0:U.left)!==void 0?i.overlay.offset.left:i.overlay.position==="left"?32:void 0}},children:[(i==null?void 0:i.overlay)&&Q.jsx("div",{onClick:E,className:gt("size-9 relative p-1 top-3 z-[99999999999999] border-none rounded-l-sm cursor-pointer"),style:{backgroundColor:((q=i==null?void 0:i.whiteLabel)==null?void 0:q.primaryColor)||"#007BFF",boxShadow:"0px 3px 3px 0px #00000040"},children:Q.jsx("img",{src:Jh,alt:"Confidence Logo",className:"w-full h-full object-contain"})}),Q.jsxs("div",{className:gt("flex flex-col flex-1 bg-gray-50",(i==null?void 0:i.overlay)&&"border border-gray-200 shadow-2xl rounded-t-sm overflow-y-auto"),children:[Q.jsx(qg,{title:a,className:gt("top-0 sticky z-2"),playbookStyle:i,ref:h}),Q.jsx(qS,{playbookMode:r,numberOfTasks:e.numberofTasks,children:d.map((_,ie)=>{var ce;return Q.jsx(QS,{task:_,step:ie+1,viewMode:r,playbookId:e.playbookId,canStart:_.sequenceOrder===D,onButtonClick:ee=>o(ee,_.taskInstanceId),playbookType:"Non-Sequential",taskStyle:{titleColor:(ce=i==null?void 0:i.whiteLabel)==null?void 0:ce.primaryColor},isExpanded:F(_.taskInstanceId),toggleExpanded:()=>M(_.taskInstanceId),listStickyTopBase:v||104},ie)})})]})]})},JS=({email:e,playbookId:r,playbookMode:o,playbookStyle:i})=>{const[a,d]=V.useState(null);return V.useEffect(()=>{(async()=>{const{playbookInstanceId:h,errorCode:v,details:m,message:x}=await mm({bank:"public-sdk",email:e,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone||"America/Los_Angeles",playbookUid:r})||{};if(v)throw new Error(`Error initiating playbook: ${x} (Code: ${v}) - Details: ${m}`);d(h)})()},[]),a?Q.jsx(aa,{playbookInstanceId:a,playbookMode:o,playbookStyle:i}):Q.jsx("div",{children:"Loading..."})},KS=({playbookId:e,playbookMode:r="list",playbookStyle:o,btnLabel:i="Start Playbook",btnColor:a="primary"})=>{const[d,h]=V.useState(null);return Q.jsxs(Q.Fragment,{children:[Q.jsxs($d.div,{children:[Q.jsx(z0,{playbookId:e,disabled:!!d,onInitiated:h,btnLabel:i,btnColor:a}),Q.jsx("style",{type:"text/css",children:Vd})]}),d&&Q.jsx(aa,{playbookInstanceId:d,playbookMode:r,playbookStyle:o})]})},aa=({playbookInstanceId:e,playbookMode:r,playbookStyle:o})=>Q.jsx(dm,{children:Q.jsx(XS,{playbookInstanceId:e,playbookMode:r,playbookStyle:o})});aa.Context=dm;aa.View=Jg;aa.AutoInstantiated=JS;aa.WithInstantiateButton=KS;const ZS=e=>uc.createPortal(Q.jsxs($d.div,{children:[Q.jsx("style",{children:Vd}),Q.jsx(aa,{...e})]}),document.body);exports.ConfidencePlaybook=ZS;
|
package/dist/index.js
CHANGED
|
@@ -20917,7 +20917,7 @@ const QS = {
|
|
|
20917
20917
|
"div",
|
|
20918
20918
|
{
|
|
20919
20919
|
className: vt("text-xl min-h-16 p-4 font-medium flex-1", {
|
|
20920
|
-
"text-dark": ((h = o == null ? void 0 : o.whiteLabel)
|
|
20920
|
+
"text-dark": !((h = o == null ? void 0 : o.whiteLabel) != null && h.titleTextColor)
|
|
20921
20921
|
}),
|
|
20922
20922
|
style: {
|
|
20923
20923
|
color: (v = o == null ? void 0 : o.whiteLabel) == null ? void 0 : v.titleTextColor
|