kenobi-js 0.1.41 → 0.1.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,14 +1,14 @@
1
1
  /*!
2
- * Kenobi SDK v0.1.41
3
- * (c) 2025 Kenobi.ai
2
+ * Kenobi SDK v0.1.42
3
+ * (c) 2026 Kenobi.ai
4
4
  */
5
- "use strict";var KenobiLib=(()=>{var xe=Object.defineProperty;var Jt=Object.getOwnPropertyDescriptor;var Zt=Object.getOwnPropertyNames;var er=Object.prototype.hasOwnProperty;var tr=(e,t,r)=>t in e?xe(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var rr=(e,t)=>{for(var r in t)xe(e,r,{get:t[r],enumerable:!0})},nr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Zt(t))!er.call(e,i)&&i!==r&&xe(e,i,{get:()=>t[i],enumerable:!(n=Jt(t,i))||n.enumerable});return e};var ir=e=>nr(xe({},"__esModule",{value:!0}),e);var h=(e,t,r)=>tr(e,typeof t!="symbol"?t+"":t,r);var qr={};rr(qr,{CueCard:()=>_e,Kenobi:()=>Qe,TRANSFORMATION_ACTIONS:()=>jt});var tt=11;function or(e,t){var r=t.attributes,n,i,o,a,l;if(!(t.nodeType===tt||e.nodeType===tt)){for(var u=r.length-1;u>=0;u--)n=r[u],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=e.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(o,i,a))):(l=e.getAttribute(i),l!==a&&e.setAttribute(i,a));for(var c=e.attributes,d=c.length-1;d>=0;d--)n=c[d],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Ce,ar="http://www.w3.org/1999/xhtml",W=typeof document>"u"?void 0:document,sr=!!W&&"content"in W.createElement("template"),lr=!!W&&W.createRange&&"createContextualFragment"in W.createRange();function cr(e){var t=W.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function ur(e){Ce||(Ce=W.createRange(),Ce.selectNode(W.body));var t=Ce.createContextualFragment(e);return t.childNodes[0]}function dr(e){var t=W.createElement("body");return t.innerHTML=e,t.childNodes[0]}function pr(e){return e=e.trim(),sr?cr(e):lr?ur(e):dr(e)}function Te(e,t){var r=e.nodeName,n=t.nodeName,i,o;return r===n?!0:(i=r.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?r===n.toUpperCase():o<=90&&i>=97?n===r.toUpperCase():!1)}function fr(e,t){return!t||t===ar?W.createElement(e):W.createElementNS(t,e)}function mr(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function He(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var rt={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}He(e,t,"selected")},INPUT:function(e,t){He(e,t,"checked"),He(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}e.selectedIndex=r}}},me=1,nt=11,it=3,ot=8;function ae(){}function hr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function br(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var o=n;n=W.createElement("html"),n.innerHTML=o}else n=pr(n);else n.nodeType===nt&&(n=n.firstElementChild);var a=i.getNodeKey||hr,l=i.onBeforeNodeAdded||ae,u=i.onNodeAdded||ae,c=i.onBeforeElUpdated||ae,d=i.onElUpdated||ae,s=i.onBeforeNodeDiscarded||ae,m=i.onNodeDiscarded||ae,b=i.onBeforeElChildrenUpdated||ae,E=i.skipFromChildren||ae,L=i.addChild||function(y,v){return y.appendChild(v)},C=i.childrenOnly===!0,f=Object.create(null),k=[];function M(y){k.push(y)}function F(y,v){if(y.nodeType===me)for(var R=y.firstChild;R;){var x=void 0;v&&(x=a(R))?M(x):(m(R),R.firstChild&&F(R,v)),R=R.nextSibling}}function I(y,v,R){s(y)!==!1&&(v&&v.removeChild(y),m(y),F(y,R))}function _(y){if(y.nodeType===me||y.nodeType===nt)for(var v=y.firstChild;v;){var R=a(v);R&&(f[R]=v),_(v),v=v.nextSibling}}_(r);function D(y){u(y);for(var v=y.firstChild;v;){var R=v.nextSibling,x=a(v);if(x){var A=f[x];A&&Te(v,A)?(v.parentNode.replaceChild(A,v),U(A,v)):D(v)}else D(v);v=R}}function K(y,v,R){for(;v;){var x=v.nextSibling;(R=a(v))?M(R):I(v,y,!0),v=x}}function U(y,v,R){var x=a(v);if(x&&delete f[x],!R){var A=c(y,v);if(A===!1||(A instanceof HTMLElement&&(y=A,_(y)),e(y,v),d(y),b(y,v)===!1))return}y.nodeName!=="TEXTAREA"?V(y,v):rt.TEXTAREA(y,v)}function V(y,v){var R=E(y,v),x=v.firstChild,A=y.firstChild,ie,N,q,oe,Y;e:for(;x;){for(oe=x.nextSibling,ie=a(x);!R&&A;){if(q=A.nextSibling,x.isSameNode&&x.isSameNode(A)){x=oe,A=q;continue e}N=a(A);var B=A.nodeType,Z=void 0;if(B===x.nodeType&&(B===me?(ie?ie!==N&&((Y=f[ie])?q===Y?Z=!1:(y.insertBefore(Y,A),N?M(N):I(A,y,!0),A=Y,N=a(A)):Z=!1):N&&(Z=!1),Z=Z!==!1&&Te(A,x),Z&&U(A,x)):(B===it||B==ot)&&(Z=!0,A.nodeValue!==x.nodeValue&&(A.nodeValue=x.nodeValue))),Z){x=oe,A=q;continue e}N?M(N):I(A,y,!0),A=q}if(ie&&(Y=f[ie])&&Te(Y,x))R||L(y,Y),U(Y,x);else{var fe=l(x);fe!==!1&&(fe&&(x=fe),x.actualize&&(x=x.actualize(y.ownerDocument||W)),L(y,x),D(x))}x=oe,A=q}K(y,A,N);var ce=rt[y.nodeName];ce&&ce(y,v)}var S=r,j=S.nodeType,ye=n.nodeType;if(!C){if(j===me)ye===me?Te(r,n)||(m(r),S=mr(r,fr(n.nodeName,n.namespaceURI))):S=n;else if(j===it||j===ot){if(ye===j)return S.nodeValue!==n.nodeValue&&(S.nodeValue=n.nodeValue),S;S=n}}if(S===n)m(r);else{if(n.isSameNode&&n.isSameNode(S))return;if(U(S,n,C),k)for(var pe=0,ke=k.length;pe<ke;pe++){var Q=f[k[pe]];Q&&I(Q,Q.parentNode,!1)}}return!C&&S!==r&&r.parentNode&&(S.actualize&&(S=S.actualize(r.ownerDocument||W)),r.parentNode.replaceChild(S,r)),S}}var gr=br(or),Se=gr;var Le,P,ut,_r,se,at,dt,pt,ft,Ke,Fe,Oe,vr,he={},mt=[],yr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function ne(e,t){for(var r in t)e[r]=t[r];return e}function Ve(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function kr(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?Le.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Ae(e,a,n,i,null)}function Ae(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++ut,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(o),o}function te(e){return e.children}function Me(e,t){this.props=e,this.context=t}function ue(e,t){if(t==null)return e.__?ue(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ue(e):null}function ht(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ht(e)}}function st(e){(!e.__d&&(e.__d=!0)&&se.push(e)&&!Pe.__r++||at!=P.debounceRendering)&&((at=P.debounceRendering)||dt)(Pe)}function Pe(){for(var e,t,r,n,i,o,a,l=1;se.length;)se.length>l&&se.sort(pt),e=se.shift(),l=se.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=ne({},n)).__v=n.__v+1,P.vnode&&P.vnode(r),$e(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i??ue(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,_t(o,r,a),n.__e=n.__=null,r.__e!=i&&ht(r)));Pe.__r=0}function bt(e,t,r,n,i,o,a,l,u,c,d){var s,m,b,E,L,C,f,k=n&&n.__k||mt,M=t.length;for(u=wr(r,t,k,u,M),s=0;s<M;s++)(b=r.__k[s])!=null&&(m=b.__i==-1?he:k[b.__i]||he,b.__i=s,C=$e(e,b,m,i,o,a,l,u,c,d),E=b.__e,b.ref&&m.ref!=b.ref&&(m.ref&&je(m.ref,null,b),d.push(b.ref,b.__c||E,b)),L==null&&E!=null&&(L=E),(f=!!(4&b.__u))||m.__k===b.__k?u=gt(b,u,e,f):typeof b.type=="function"&&C!==void 0?u=C:E&&(u=E.nextSibling),b.__u&=-7);return r.__e=L,u}function wr(e,t,r,n,i){var o,a,l,u,c,d=r.length,s=d,m=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+m,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Ae(null,a,null,null,null):Re(a)?Ae(te,{children:a},null,null,null):a.constructor==null&&a.__b>0?Ae(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(c=a.__i=xr(a,r,u,s))!=-1&&(s--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(i>d?m--:i<d&&m++),typeof a.type!="function"&&(a.__u|=4)):c!=u&&(c==u-1?m--:c==u+1?m++:(c>u?m--:m++,a.__u|=4))):e.__k[o]=null;if(s)for(o=0;o<d;o++)(l=r[o])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=ue(l)),yt(l,l));return n}function gt(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=gt(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=ue(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function xr(e,t,r,n){var i,o,a,l=e.key,u=e.type,c=t[r],d=c!=null&&(2&c.__u)==0;if(c===null&&e.key==null||d&&l==c.key&&u==c.type)return r;if(n>(d?1:0)){for(i=r-1,o=r+1;i>=0||o<t.length;)if((c=t[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&l==c.key&&u==c.type)return a}return-1}function lt(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||yr.test(t)?r:r+"px"}function Ee(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||lt(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||lt(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(ft,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=Ke,e.addEventListener(t,o?Oe:Fe,o)):e.removeEventListener(t,o?Oe:Fe,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ct(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ke++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function $e(e,t,r,n,i,o,a,l,u,c){var d,s,m,b,E,L,C,f,k,M,F,I,_,D,K,U,V,S=t.type;if(t.constructor!=null)return null;128&r.__u&&(u=!!(32&r.__u),o=[l=t.__e=r.__e]),(d=P.__b)&&d(t);e:if(typeof S=="function")try{if(f=t.props,k="prototype"in S&&S.prototype.render,M=(d=S.contextType)&&n[d.__c],F=d?M?M.props.value:d.__:n,r.__c?C=(s=t.__c=r.__c).__=s.__E:(k?t.__c=s=new S(f,F):(t.__c=s=new Me(f,F),s.constructor=S,s.render=Tr),M&&M.sub(s),s.props=f,s.state||(s.state={}),s.context=F,s.__n=n,m=s.__d=!0,s.__h=[],s._sb=[]),k&&s.__s==null&&(s.__s=s.state),k&&S.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ne({},s.__s)),ne(s.__s,S.getDerivedStateFromProps(f,s.__s))),b=s.props,E=s.state,s.__v=t,m)k&&S.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),k&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(k&&S.getDerivedStateFromProps==null&&f!==b&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(f,F),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(f,s.__s,F)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(s.props=f,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(j){j&&(j.__=t)}),I=0;I<s._sb.length;I++)s.__h.push(s._sb[I]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(f,s.__s,F),k&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(b,E,L)})}if(s.context=F,s.props=f,s.__P=e,s.__e=!1,_=P.__r,D=0,k){for(s.state=s.__s,s.__d=!1,_&&_(t),d=s.render(s.props,s.state,s.context),K=0;K<s._sb.length;K++)s.__h.push(s._sb[K]);s._sb=[]}else do s.__d=!1,_&&_(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++D<25);s.state=s.__s,s.getChildContext!=null&&(n=ne(ne({},n),s.getChildContext())),k&&!m&&s.getSnapshotBeforeUpdate!=null&&(L=s.getSnapshotBeforeUpdate(b,E)),U=d,d!=null&&d.type===te&&d.key==null&&(U=vt(d.props.children)),l=bt(e,Re(U)?U:[U],t,r,n,i,o,a,l,u,c),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),C&&(s.__E=s.__=null)}catch(j){if(t.__v=null,u||o!=null)if(j.then){for(t.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,t.__e=l}else{for(V=o.length;V--;)Ve(o[V]);Ue(t)}else t.__e=r.__e,t.__k=r.__k,j.then||Ue(t);P.__e(j,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Cr(r.__e,t,r,n,i,o,a,u,c);return(d=P.diffed)&&d(t),128&t.__u?void 0:l}function Ue(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ue)}function _t(e,t,r){for(var n=0;n<r.length;n++)je(r[n],r[++n],r[++n]);P.__c&&P.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){P.__e(o,i.__v)}})}function vt(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:Re(e)?e.map(vt):ne({},e)}function Cr(e,t,r,n,i,o,a,l,u){var c,d,s,m,b,E,L,C=r.props,f=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((b=o[c])&&"setAttribute"in b==!!k&&(k?b.localName==k:b.nodeType==3)){e=b,o[c]=null;break}}if(e==null){if(k==null)return document.createTextNode(f);e=document.createElementNS(i,k,f.is&&f),l&&(P.__m&&P.__m(t,o),l=!1),o=null}if(k==null)C===f||l&&e.data==f||(e.data=f);else{if(o=o&&Le.call(e.childNodes),C=r.props||he,!l&&o!=null)for(C={},c=0;c<e.attributes.length;c++)C[(b=e.attributes[c]).name]=b.value;for(c in C)if(b=C[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=b;else if(!(c in f)){if(c=="value"&&"defaultValue"in f||c=="checked"&&"defaultChecked"in f)continue;Ee(e,c,null,b,i)}}for(c in f)b=f[c],c=="children"?m=b:c=="dangerouslySetInnerHTML"?d=b:c=="value"?E=b:c=="checked"?L=b:l&&typeof b!="function"||C[c]===b||Ee(e,c,b,C[c],i);if(d)l||s&&(d.__html==s.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),bt(t.type=="template"?e.content:e,Re(m)?m:[m],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&ue(r,0),l,u),o!=null)for(c=o.length;c--;)Ve(o[c]);l||(c="value",k=="progress"&&E==null?e.removeAttribute("value"):E!=null&&(E!==e[c]||k=="progress"&&!E||k=="option"&&E!=C[c])&&Ee(e,c,E,C[c],i),c="checked",L!=null&&L!=e[c]&&Ee(e,c,L,C[c],i))}return e}function je(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){P.__e(i,r)}}function yt(e,t,r){var n,i;if(P.unmount&&P.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||je(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){P.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&yt(n[i],t,r||typeof e.type!="function");r||Ve(e.__e),e.__c=e.__=e.__e=void 0}function Tr(e,t,r){return this.constructor(e,r)}function Be(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),P.__&&P.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],$e(t,e=(!n&&r||t).__k=kr(te,null,[e]),i||he,he,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?Le.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),_t(o,e,a)}Le=mt.slice,P={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(l){e=l}throw e}},ut=0,_r=function(e){return e!=null&&e.constructor==null},Me.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},r),this.props)),e&&ne(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),st(this))},Me.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),st(this))},Me.prototype.render=te,se=[],dt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,pt=function(e,t){return e.__v.__b-t.__v.__b},Pe.__r=0,ft=/(PointerCapture)$|Capture$/i,Ke=0,Fe=ct(!1),Oe=ct(!0),vr=0;var be,z,qe,kt,ge=0,Mt=[],H=P,wt=H.__b,xt=H.__r,Ct=H.diffed,Tt=H.__c,St=H.unmount,Et=H.__;function Ge(e,t){H.__h&&H.__h(z,e,ge||t),ge=0;var r=z.__H||(z.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function le(e){return ge=1,Sr(Dt,e)}function Sr(e,t,r){var n=Ge(be++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Dt(void 0,t),function(l){var u=n.__N?n.__N[0]:n.__[0],c=n.t(u,l);u!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=z,!z.__f)){var i=function(l,u,c){if(!n.__c.__H)return!0;var d=n.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!o||o.call(this,l,u,c);var s=n.__c.props!==l;return d.forEach(function(m){if(m.__N){var b=m.__[0];m.__=m.__N,m.__N=void 0,b!==m.__[0]&&(s=!0)}}),o&&o.call(this,l,u,c)||s};z.__f=!0;var o=z.shouldComponentUpdate,a=z.componentWillUpdate;z.componentWillUpdate=function(l,u,c){if(this.__e){var d=o;o=void 0,i(l,u,c),o=d}a&&a.call(this,l,u,c)},z.shouldComponentUpdate=i}return n.__N||n.__}function X(e,t){var r=Ge(be++,3);!H.__s&&Rt(r.__H,t)&&(r.__=e,r.u=t,z.__H.__h.push(r))}function O(e){return ge=5,Pt(function(){return{current:e}},[])}function Pt(e,t){var r=Ge(be++,7);return Rt(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Lt(e,t){return ge=8,Pt(function(){return e},t)}function Er(){for(var e;e=Mt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(De),e.__H.__h.forEach(We),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){z=null,wt&&wt(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Et&&Et(e,t)},H.__r=function(e){xt&&xt(e),be=0;var t=(z=e.__c).__H;t&&(qe===z?(t.__h=[],z.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(De),t.__h.forEach(We),t.__h=[],be=0)),qe=z},H.diffed=function(e){Ct&&Ct(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Mt.push(t)!==1&&kt===H.requestAnimationFrame||((kt=H.requestAnimationFrame)||Ar)(Er)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),qe=z=null},H.__c=function(e,t){t.some(function(r){try{r.__h.forEach(De),r.__h=r.__h.filter(function(n){return!n.__||We(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],H.__e(n,r.__v)}}),Tt&&Tt(e,t)},H.unmount=function(e){St&&St(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{De(n)}catch(i){t=i}}),r.__H=void 0,t&&H.__e(t,r.__v))};var At=typeof requestAnimationFrame=="function";function Ar(e){var t,r=function(){clearTimeout(n),At&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);At&&(t=requestAnimationFrame(r))}function De(e){var t=z,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),z=t}function We(e){var t=z;e.__c=e.__(),z=t}function Rt(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Dt(e,t){return typeof t=="function"?t(e):t}var Mr=0;function p(e,t,r,n,i,o){t||(t={});var a,l,u=t;if("ref"in u)for(l in u={},t)l=="ref"?a=t[l]:u[l]=t[l];var c={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Mr,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)u[l]===void 0&&(u[l]=a[l]);return P.vnode&&P.vnode(c),c}var Nt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M16.72 7.72a.75.75 0 0 1 1.06 0l3.75 3.75a.75.75 0 0 1 0 1.06l-3.75 3.75a.75.75 0 1 1-1.06-1.06l2.47-2.47H3a.75.75 0 0 1 0-1.5h16.19l-2.47-2.47a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Pr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),zt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),Xe=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),It=()=>p("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),p("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]}),Lr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),Rr=`
6
- :host { --kb-font-family: system-ui, -apple-system, sans-serif; --kb-bg-container: rgba(255, 255, 255, 0.05); --kb-border-container: rgba(255, 255, 255, 0.2); --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 16px; --kb-text-title: #ffffff; --kb-text-subtitle: rgba(255, 255, 255, 0.7); --kb-btn-dismiss-bg: rgba(0, 0, 0, 0.7); --kb-btn-dismiss-border: rgba(255, 255, 255, 0.2); --kb-btn-dismiss-text: rgba(255, 255, 255, 0.8); --kb-btn-dismiss-hover-bg: rgba(0, 0, 0, 0.9); --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #000000; --kb-btn-trigger-hover-bg: rgba(255, 255, 255, 0.9); --kb-progress-track: rgba(255, 255, 255, 0.2); --kb-progress-indicator: #ffffff; --kb-popover-bg: rgba(255, 255, 255, 0.05); --kb-popover-border: rgba(255, 255, 255, 0.2); --kb-popover-text: #ffffff; --kb-input-bg: transparent; --kb-input-border: rgba(255, 255, 255, 0.3); --kb-input-text: #ffffff; --kb-input-placeholder: rgba(255, 255, 255, 0.6); --kb-form-label: #ffffff; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-focus-blur: 10px; --kb-kbd-bg: rgba(255, 255, 255, 0.1); --kb-kbd-border: rgba(255, 255, 255, 0.2); --kb-kbd-text: rgba(255, 255, 255, 0.6); --kb-watermark-text: rgba(255, 255, 255, 0.4); font-family: var(--kb-font-family); }
5
+ "use strict";var KenobiLib=(()=>{var Te=Object.defineProperty;var ir=Object.getOwnPropertyDescriptor;var or=Object.getOwnPropertyNames;var ar=Object.prototype.hasOwnProperty;var sr=(e,t,r)=>t in e?Te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var lr=(e,t)=>{for(var r in t)Te(e,r,{get:t[r],enumerable:!0})},cr=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of or(t))!ar.call(e,i)&&i!==r&&Te(e,i,{get:()=>t[i],enumerable:!(n=ir(t,i))||n.enumerable});return e};var ur=e=>cr(Te({},"__esModule",{value:!0}),e);var h=(e,t,r)=>sr(e,typeof t!="symbol"?t+"":t,r);var Zr={};lr(Zr,{CueCard:()=>ke,Kenobi:()=>rt,TRANSFORMATION_ACTIONS:()=>Xt});var at=11;function dr(e,t){var r=t.attributes,n,i,o,a,l;if(!(t.nodeType===at||e.nodeType===at)){for(var d=r.length-1;d>=0;d--)n=r[d],i=n.name,o=n.namespaceURI,a=n.value,o?(i=n.localName||i,l=e.getAttributeNS(o,i),l!==a&&(n.prefix==="xmlns"&&(i=n.name),e.setAttributeNS(o,i,a))):(l=e.getAttribute(i),l!==a&&e.setAttribute(i,a));for(var c=e.attributes,u=c.length-1;u>=0;u--)n=c[u],i=n.name,o=n.namespaceURI,o?(i=n.localName||i,t.hasAttributeNS(o,i)||e.removeAttributeNS(o,i)):t.hasAttribute(i)||e.removeAttribute(i)}}var Se,pr="http://www.w3.org/1999/xhtml",j=typeof document>"u"?void 0:document,fr=!!j&&"content"in j.createElement("template"),hr=!!j&&j.createRange&&"createContextualFragment"in j.createRange();function mr(e){var t=j.createElement("template");return t.innerHTML=e,t.content.childNodes[0]}function br(e){Se||(Se=j.createRange(),Se.selectNode(j.body));var t=Se.createContextualFragment(e);return t.childNodes[0]}function gr(e){var t=j.createElement("body");return t.innerHTML=e,t.childNodes[0]}function _r(e){return e=e.trim(),fr?mr(e):hr?br(e):gr(e)}function Ee(e,t){var r=e.nodeName,n=t.nodeName,i,o;return r===n?!0:(i=r.charCodeAt(0),o=n.charCodeAt(0),i<=90&&o>=97?r===n.toUpperCase():o<=90&&i>=97?n===r.toUpperCase():!1)}function vr(e,t){return!t||t===pr?j.createElement(e):j.createElementNS(t,e)}function yr(e,t){for(var r=e.firstChild;r;){var n=r.nextSibling;t.appendChild(r),r=n}return t}function $e(e,t,r){e[r]!==t[r]&&(e[r]=t[r],e[r]?e.setAttribute(r,""):e.removeAttribute(r))}var st={OPTION:function(e,t){var r=e.parentNode;if(r){var n=r.nodeName.toUpperCase();n==="OPTGROUP"&&(r=r.parentNode,n=r&&r.nodeName.toUpperCase()),n==="SELECT"&&!r.hasAttribute("multiple")&&(e.hasAttribute("selected")&&!t.selected&&(e.setAttribute("selected","selected"),e.removeAttribute("selected")),r.selectedIndex=-1)}$e(e,t,"selected")},INPUT:function(e,t){$e(e,t,"checked"),$e(e,t,"disabled"),e.value!==t.value&&(e.value=t.value),t.hasAttribute("value")||e.removeAttribute("value")},TEXTAREA:function(e,t){var r=t.value;e.value!==r&&(e.value=r);var n=e.firstChild;if(n){var i=n.nodeValue;if(i==r||!r&&i==e.placeholder)return;n.nodeValue=r}},SELECT:function(e,t){if(!t.hasAttribute("multiple")){for(var r=-1,n=0,i=e.firstChild,o,a;i;)if(a=i.nodeName&&i.nodeName.toUpperCase(),a==="OPTGROUP")o=i,i=o.firstChild,i||(i=o.nextSibling,o=null);else{if(a==="OPTION"){if(i.hasAttribute("selected")){r=n;break}n++}i=i.nextSibling,!i&&o&&(i=o.nextSibling,o=null)}e.selectedIndex=r}}},ge=1,lt=11,ct=3,ut=8;function ae(){}function kr(e){if(e)return e.getAttribute&&e.getAttribute("id")||e.id}function wr(e){return function(r,n,i){if(i||(i={}),typeof n=="string")if(r.nodeName==="#document"||r.nodeName==="HTML"||r.nodeName==="BODY"){var o=n;n=j.createElement("html"),n.innerHTML=o}else n=_r(n);else n.nodeType===lt&&(n=n.firstElementChild);var a=i.getNodeKey||kr,l=i.onBeforeNodeAdded||ae,d=i.onNodeAdded||ae,c=i.onBeforeElUpdated||ae,u=i.onElUpdated||ae,s=i.onBeforeNodeDiscarded||ae,f=i.onNodeDiscarded||ae,m=i.onBeforeElChildrenUpdated||ae,S=i.skipFromChildren||ae,L=i.addChild||function(y,k){return y.appendChild(k)},E=i.childrenOnly===!0,b=Object.create(null),v=[];function C(y){v.push(y)}function F(y,k){if(y.nodeType===ge)for(var D=y.firstChild;D;){var w=void 0;k&&(w=a(D))?C(w):(f(D),D.firstChild&&F(D,k)),D=D.nextSibling}}function z(y,k,D){s(y)!==!1&&(k&&k.removeChild(y),f(y),F(y,D))}function _(y){if(y.nodeType===ge||y.nodeType===lt)for(var k=y.firstChild;k;){var D=a(k);D&&(b[D]=k),_(k),k=k.nextSibling}}_(r);function U(y){d(y);for(var k=y.firstChild;k;){var D=k.nextSibling,w=a(k);if(w){var A=b[w];A&&Ee(k,A)?(k.parentNode.replaceChild(A,k),R(A,k)):U(k)}else U(k);k=D}}function O(y,k,D){for(;k;){var w=k.nextSibling;(D=a(k))?C(D):z(k,y,!0),k=w}}function R(y,k,D){var w=a(k);if(w&&delete b[w],!D){var A=c(y,k);if(A===!1||(A instanceof HTMLElement&&(y=A,_(y)),e(y,k),u(y),m(y,k)===!1))return}y.nodeName!=="TEXTAREA"?K(y,k):st.TEXTAREA(y,k)}function K(y,k){var D=S(y,k),w=k.firstChild,A=y.firstChild,W,q,re,pe,J;e:for(;w;){for(pe=w.nextSibling,W=a(w);!D&&A;){if(re=A.nextSibling,w.isSameNode&&w.isSameNode(A)){w=pe,A=re;continue e}q=a(A);var fe=A.nodeType,Y=void 0;if(fe===w.nodeType&&(fe===ge?(W?W!==q&&((J=b[W])?re===J?Y=!1:(y.insertBefore(J,A),q?C(q):z(A,y,!0),A=J,q=a(A)):Y=!1):q&&(Y=!1),Y=Y!==!1&&Ee(A,w),Y&&R(A,w)):(fe===ct||fe==ut)&&(Y=!0,A.nodeValue!==w.nodeValue&&(A.nodeValue=w.nodeValue))),Y){w=pe,A=re;continue e}q?C(q):z(A,y,!0),A=re}if(W&&(J=b[W])&&Ee(J,w))D||L(y,J),R(J,w);else{var be=l(w);be!==!1&&(be&&(w=be),w.actualize&&(w=w.actualize(y.ownerDocument||j)),L(y,w),U(w))}w=pe,A=re}O(y,A,q);var B=st[y.nodeName];B&&B(y,k)}var M=r,V=M.nodeType,xe=n.nodeType;if(!E){if(V===ge)xe===ge?Ee(r,n)||(f(r),M=yr(r,vr(n.nodeName,n.namespaceURI))):M=n;else if(V===ct||V===ut){if(xe===V)return M.nodeValue!==n.nodeValue&&(M.nodeValue=n.nodeValue),M;M=n}}if(M===n)f(r);else{if(n.isSameNode&&n.isSameNode(M))return;if(R(M,n,E),v)for(var de=0,se=v.length;de<se;de++){var le=b[v[de]];le&&z(le,le.parentNode,!1)}}return!E&&M!==r&&r.parentNode&&(M.actualize&&(M=M.actualize(r.ownerDocument||j)),r.parentNode.replaceChild(M,r)),M}}var xr=wr(dr),Ae=xr;var De,P,mt,Cr,ue,dt,bt,gt,_t,We,Ve,Be,Tr,_e={},vt=[],Sr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ze=Array.isArray;function ne(e,t){for(var r in t)e[r]=t[r];return e}function qe(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Er(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?De.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return Pe(e,a,n,i,null)}function Pe(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++mt,__i:-1,__u:0};return i==null&&P.vnode!=null&&P.vnode(o),o}function ie(e){return e.children}function Le(e,t){this.props=e,this.context=t}function he(e,t){if(t==null)return e.__?he(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?he(e):null}function yt(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return yt(e)}}function pt(e){(!e.__d&&(e.__d=!0)&&ue.push(e)&&!Re.__r++||dt!=P.debounceRendering)&&((dt=P.debounceRendering)||bt)(Re)}function Re(){for(var e,t,r,n,i,o,a,l=1;ue.length;)ue.length>l&&ue.sort(gt),e=ue.shift(),l=ue.length,e.__d&&(r=void 0,n=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=ne({},n)).__v=n.__v+1,P.vnode&&P.vnode(r),Xe(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i??he(n),!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,xt(o,r,a),n.__e=n.__=null,r.__e!=i&&yt(r)));Re.__r=0}function kt(e,t,r,n,i,o,a,l,d,c,u){var s,f,m,S,L,E,b,v=n&&n.__k||vt,C=t.length;for(d=Ar(r,t,v,d,C),s=0;s<C;s++)(m=r.__k[s])!=null&&(f=m.__i==-1?_e:v[m.__i]||_e,m.__i=s,E=Xe(e,m,f,i,o,a,l,d,c,u),S=m.__e,m.ref&&f.ref!=m.ref&&(f.ref&&Ge(f.ref,null,m),u.push(m.ref,m.__c||S,m)),L==null&&S!=null&&(L=S),(b=!!(4&m.__u))||f.__k===m.__k?d=wt(m,d,e,b):typeof m.type=="function"&&E!==void 0?d=E:S&&(d=S.nextSibling),m.__u&=-7);return r.__e=L,d}function Ar(e,t,r,n,i){var o,a,l,d,c,u=r.length,s=u,f=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(d=o+f,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Pe(null,a,null,null,null):ze(a)?Pe(ie,{children:a},null,null,null):a.constructor==null&&a.__b>0?Pe(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(c=a.__i=Mr(a,r,d,s))!=-1&&(s--,(l=r[c])&&(l.__u|=2)),l==null||l.__v==null?(c==-1&&(i>u?f--:i<u&&f++),typeof a.type!="function"&&(a.__u|=4)):c!=d&&(c==d-1?f--:c==d+1?f++:(c>d?f--:f++,a.__u|=4))):e.__k[o]=null;if(s)for(o=0;o<u;o++)(l=r[o])!=null&&(2&l.__u)==0&&(l.__e==n&&(n=he(l)),Tt(l,l));return n}function wt(e,t,r,n){var i,o;if(typeof e.type=="function"){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=wt(i[o],t,r,n));return t}e.__e!=t&&(n&&(t&&e.type&&!t.parentNode&&(t=he(e)),r.insertBefore(e.__e,t||null)),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Mr(e,t,r,n){var i,o,a,l=e.key,d=e.type,c=t[r],u=c!=null&&(2&c.__u)==0;if(c===null&&e.key==null||u&&l==c.key&&d==c.type)return r;if(n>(u?1:0)){for(i=r-1,o=r+1;i>=0||o<t.length;)if((c=t[a=i>=0?i--:o++])!=null&&(2&c.__u)==0&&l==c.key&&d==c.type)return a}return-1}function ft(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Sr.test(t)?r:r+"px"}function Me(e,t,r,n,i){var o,a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ft(e.style,t,"");if(r)for(t in r)n&&r[t]==n[t]||ft(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(_t,"$1")),a=t.toLowerCase(),t=a in e||t=="onFocusOut"||t=="onFocusIn"?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.u=n.u:(r.u=We,e.addEventListener(t,o?Be:Ve,o)):e.removeEventListener(t,o?Be:Ve,o);else{if(i=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ht(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=We++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function Xe(e,t,r,n,i,o,a,l,d,c){var u,s,f,m,S,L,E,b,v,C,F,z,_,U,O,R,K,M=t.type;if(t.constructor!=null)return null;128&r.__u&&(d=!!(32&r.__u),o=[l=t.__e=r.__e]),(u=P.__b)&&u(t);e:if(typeof M=="function")try{if(b=t.props,v="prototype"in M&&M.prototype.render,C=(u=M.contextType)&&n[u.__c],F=u?C?C.props.value:u.__:n,r.__c?E=(s=t.__c=r.__c).__=s.__E:(v?t.__c=s=new M(b,F):(t.__c=s=new Le(b,F),s.constructor=M,s.render=Lr),C&&C.sub(s),s.props=b,s.state||(s.state={}),s.context=F,s.__n=n,f=s.__d=!0,s.__h=[],s._sb=[]),v&&s.__s==null&&(s.__s=s.state),v&&M.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=ne({},s.__s)),ne(s.__s,M.getDerivedStateFromProps(b,s.__s))),m=s.props,S=s.state,s.__v=t,f)v&&M.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),v&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(v&&M.getDerivedStateFromProps==null&&b!==m&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,F),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,F)===!1||t.__v==r.__v){for(t.__v!=r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(V){V&&(V.__=t)}),z=0;z<s._sb.length;z++)s.__h.push(s._sb[z]);s._sb=[],s.__h.length&&a.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,F),v&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(m,S,L)})}if(s.context=F,s.props=b,s.__P=e,s.__e=!1,_=P.__r,U=0,v){for(s.state=s.__s,s.__d=!1,_&&_(t),u=s.render(s.props,s.state,s.context),O=0;O<s._sb.length;O++)s.__h.push(s._sb[O]);s._sb=[]}else do s.__d=!1,_&&_(t),u=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++U<25);s.state=s.__s,s.getChildContext!=null&&(n=ne(ne({},n),s.getChildContext())),v&&!f&&s.getSnapshotBeforeUpdate!=null&&(L=s.getSnapshotBeforeUpdate(m,S)),R=u,u!=null&&u.type===ie&&u.key==null&&(R=Ct(u.props.children)),l=kt(e,ze(R)?R:[R],t,r,n,i,o,a,l,d,c),s.base=t.__e,t.__u&=-161,s.__h.length&&a.push(s),E&&(s.__E=s.__=null)}catch(V){if(t.__v=null,d||o!=null)if(V.then){for(t.__u|=d?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,t.__e=l}else{for(K=o.length;K--;)qe(o[K]);je(t)}else t.__e=r.__e,t.__k=r.__k,V.then||je(t);P.__e(V,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Pr(r.__e,t,r,n,i,o,a,d,c);return(u=P.diffed)&&u(t),128&t.__u?void 0:l}function je(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(je)}function xt(e,t,r){for(var n=0;n<r.length;n++)Ge(r[n],r[++n],r[++n]);P.__c&&P.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){P.__e(o,i.__v)}})}function Ct(e){return typeof e!="object"||e==null||e.__b&&e.__b>0?e:ze(e)?e.map(Ct):ne({},e)}function Pr(e,t,r,n,i,o,a,l,d){var c,u,s,f,m,S,L,E=r.props,b=t.props,v=t.type;if(v=="svg"?i="http://www.w3.org/2000/svg":v=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(c=0;c<o.length;c++)if((m=o[c])&&"setAttribute"in m==!!v&&(v?m.localName==v:m.nodeType==3)){e=m,o[c]=null;break}}if(e==null){if(v==null)return document.createTextNode(b);e=document.createElementNS(i,v,b.is&&b),l&&(P.__m&&P.__m(t,o),l=!1),o=null}if(v==null)E===b||l&&e.data==b||(e.data=b);else{if(o=o&&De.call(e.childNodes),E=r.props||_e,!l&&o!=null)for(E={},c=0;c<e.attributes.length;c++)E[(m=e.attributes[c]).name]=m.value;for(c in E)if(m=E[c],c!="children"){if(c=="dangerouslySetInnerHTML")s=m;else if(!(c in b)){if(c=="value"&&"defaultValue"in b||c=="checked"&&"defaultChecked"in b)continue;Me(e,c,null,m,i)}}for(c in b)m=b[c],c=="children"?f=m:c=="dangerouslySetInnerHTML"?u=m:c=="value"?S=m:c=="checked"?L=m:l&&typeof m!="function"||E[c]===m||Me(e,c,m,E[c],i);if(u)l||s&&(u.__html==s.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(s&&(e.innerHTML=""),kt(t.type=="template"?e.content:e,ze(f)?f:[f],t,r,n,v=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&he(r,0),l,d),o!=null)for(c=o.length;c--;)qe(o[c]);l||(c="value",v=="progress"&&S==null?e.removeAttribute("value"):S!=null&&(S!==e[c]||v=="progress"&&!S||v=="option"&&S!=E[c])&&Me(e,c,S,E[c],i),c="checked",L!=null&&L!=e[c]&&Me(e,c,L,E[c],i))}return e}function Ge(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){P.__e(i,r)}}function Tt(e,t,r){var n,i;if(P.unmount&&P.unmount(e),(n=e.ref)&&(n.current&&n.current!=e.__e||Ge(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){P.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Tt(n[i],t,r||typeof e.type!="function");r||qe(e.__e),e.__c=e.__=e.__e=void 0}function Lr(e,t,r){return this.constructor(e,r)}function Ye(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),P.__&&P.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Xe(t,e=(!n&&r||t).__k=Er(ie,null,[e]),i||_e,_e,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?De.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),xt(o,e,a)}De=vt.slice,P={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(l){e=l}throw e}},mt=0,Cr=function(e){return e!=null&&e.constructor==null},Le.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ne({},this.state),typeof e=="function"&&(e=e(ne({},r),this.props)),e&&ne(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),pt(this))},Le.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),pt(this))},Le.prototype.render=ie,ue=[],bt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,gt=function(e,t){return e.__v.__b-t.__v.__b},Re.__r=0,_t=/(PointerCapture)$|Capture$/i,We=0,Ve=ht(!1),Be=ht(!0),Tr=0;var ve,N,Qe,St,ye=0,zt=[],I=P,Et=I.__b,At=I.__r,Mt=I.diffed,Pt=I.__c,Lt=I.unmount,Rt=I.__;function Ze(e,t){I.__h&&I.__h(N,e,ye||t),ye=0;var r=N.__H||(N.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function oe(e){return ye=1,Rr(Ft,e)}function Rr(e,t,r){var n=Ze(ve++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Ft(void 0,t),function(l){var d=n.__N?n.__N[0]:n.__[0],c=n.t(d,l);d!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=N,!N.__f)){var i=function(l,d,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(f){return!!f.__c});if(u.every(function(f){return!f.__N}))return!o||o.call(this,l,d,c);var s=n.__c.props!==l;return u.forEach(function(f){if(f.__N){var m=f.__[0];f.__=f.__N,f.__N=void 0,m!==f.__[0]&&(s=!0)}}),o&&o.call(this,l,d,c)||s};N.__f=!0;var o=N.shouldComponentUpdate,a=N.componentWillUpdate;N.componentWillUpdate=function(l,d,c){if(this.__e){var u=o;o=void 0,i(l,d,c),o=u}a&&a.call(this,l,d,c)},N.shouldComponentUpdate=i}return n.__N||n.__}function G(e,t){var r=Ze(ve++,3);!I.__s&&Ht(r.__H,t)&&(r.__=e,r.u=t,N.__H.__h.push(r))}function H(e){return ye=5,Nt(function(){return{current:e}},[])}function Nt(e,t){var r=Ze(ve++,7);return Ht(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function It(e,t){return ye=8,Nt(function(){return e},t)}function Dr(){for(var e;e=zt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ne),e.__H.__h.forEach(Je),e.__H.__h=[]}catch(t){e.__H.__h=[],I.__e(t,e.__v)}}I.__b=function(e){N=null,Et&&Et(e)},I.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rt&&Rt(e,t)},I.__r=function(e){At&&At(e),ve=0;var t=(N=e.__c).__H;t&&(Qe===N?(t.__h=[],N.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Ne),t.__h.forEach(Je),t.__h=[],ve=0)),Qe=N},I.diffed=function(e){Mt&&Mt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(zt.push(t)!==1&&St===I.requestAnimationFrame||((St=I.requestAnimationFrame)||zr)(Dr)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Qe=N=null},I.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ne),r.__h=r.__h.filter(function(n){return!n.__||Je(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],I.__e(n,r.__v)}}),Pt&&Pt(e,t)},I.unmount=function(e){Lt&&Lt(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ne(n)}catch(i){t=i}}),r.__H=void 0,t&&I.__e(t,r.__v))};var Dt=typeof requestAnimationFrame=="function";function zr(e){var t,r=function(){clearTimeout(n),Dt&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,35);Dt&&(t=requestAnimationFrame(r))}function Ne(e){var t=N,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),N=t}function Je(e){var t=N;e.__c=e.__(),N=t}function Ht(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ft(e,t){return typeof t=="function"?t(e):t}var Nr=0;function p(e,t,r,n,i,o){t||(t={});var a,l,d=t;if("ref"in d)for(l in d={},t)l=="ref"?a=t[l]:d[l]=t[l];var c={type:e,props:d,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Nr,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)d[l]===void 0&&(d[l]=a[l]);return P.vnode&&P.vnode(c),c}var Ot=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"3","stroke-linecap":"round","stroke-linejoin":"round",width:"16",height:"16",children:p("path",{d:"M5 12h14M12 5l7 7-7 7"})}),Ir=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M19.916 4.626a.75.75 0 0 1 .208 1.04l-9 13.5a.75.75 0 0 1-1.154.114l-6-6a.75.75 0 0 1 1.06-1.06l5.353 5.353 8.493-12.739a.75.75 0 0 1 1.04-.208Z",clipRule:"evenodd"})}),Kt=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",width:"16",height:"16",children:p("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),et=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:"animate-spin",children:p("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})}),Hr=()=>p("svg",{width:"32",height:"32",viewBox:"0 0 900 900",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[p("circle",{cx:"446",cy:"450",r:"424",fill:"black"}),p("circle",{cx:"450",cy:"450",r:"357",fill:"#E8E8E8"}),p("ellipse",{cx:"579.85",cy:"294.451",rx:"79.778",ry:"108.483",transform:"rotate(-46.2324 579.85 294.451)",fill:"black"})]}),Fr=()=>p("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",width:"16",height:"16",children:p("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"})}),Or=`
6
+ :host { --kb-font-family: system-ui, -apple-system, sans-serif; --kb-bg-container: rgba(255, 255, 255, 0.05); --kb-border-container: rgba(255, 255, 255, 0.2); --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 16px; --kb-text-title: #ffffff; --kb-text-subtitle: rgba(255, 255, 255, 0.7); --kb-btn-dismiss-bg: rgba(0, 0, 0, 0.7); --kb-btn-dismiss-border: rgba(255, 255, 255, 0.2); --kb-btn-dismiss-text: rgba(255, 255, 255, 0.8); --kb-btn-dismiss-hover-bg: rgba(0, 0, 0, 0.9); --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #000000; --kb-btn-trigger-hover-bg: rgba(255, 255, 255, 0.9); --kb-progress-track: rgba(255, 255, 255, 0.2); --kb-progress-indicator: #ffffff; --kb-popover-bg: rgba(255, 255, 255, 0.05); --kb-popover-border: rgba(255, 255, 255, 0.2); --kb-popover-text: #ffffff; --kb-input-bg: transparent; --kb-input-border: rgba(255, 255, 255, 0.3); --kb-input-text: #ffffff; --kb-input-placeholder: rgba(255, 255, 255, 0.6); --kb-form-label: #ffffff; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-focus-blur: 10px; --kb-kbd-bg: rgba(255, 255, 255, 0.15); --kb-kbd-border: rgba(255, 255, 255, 0.4); --kb-kbd-text: #ffffff; --kb-watermark-text: rgba(255, 255, 255, 0.4); font-family: var(--kb-font-family); }
7
7
  .theme-light { --kb-bg-container: #ffffff; --kb-border-container: #e2e8f0; --kb-shadow-container: 0 20px 25px -5px rgba(0, 0, 0, 0.1); --kb-backdrop-blur: 0px; --kb-text-title: #0f172a; --kb-text-subtitle: #475569; --kb-btn-dismiss-bg: #ffffff; --kb-btn-dismiss-border: #e2e8f0; --kb-btn-dismiss-text: #64748b; --kb-btn-dismiss-hover-bg: #f1f5f9; --kb-btn-dismiss-hover-text: #0f172a; --kb-btn-trigger-bg: #0f172a; --kb-btn-trigger-text: #ffffff; --kb-btn-trigger-hover-bg: #1e293b; --kb-progress-track: #e2e8f0; --kb-progress-indicator: #0f172a; --kb-popover-bg: #ffffff; --kb-popover-border: #e2e8f0; --kb-popover-text: #0f172a; --kb-input-bg: #ffffff; --kb-input-border: #cbd5e1; --kb-input-text: #0f172a; --kb-input-placeholder: #94a3b8; --kb-form-label: #334155; --kb-success-color: #059669; --kb-error-text: #ef4444; --kb-kbd-bg: #f1f5f9; --kb-kbd-border: #e2e8f0; --kb-kbd-text: #64748b; --kb-watermark-text: #94a3b8; }
8
8
  .theme-dark { --kb-bg-container: #0f172a; --kb-border-container: #334155; --kb-shadow-container: 0 25px 50px -12px rgba(0, 0, 0, 0.25); --kb-backdrop-blur: 0px; --kb-text-title: #f1f5f9; --kb-text-subtitle: #94a3b8; --kb-btn-dismiss-bg: #1e293b; --kb-btn-dismiss-border: #334155; --kb-btn-dismiss-text: #cbd5e1; --kb-btn-dismiss-hover-bg: #334155; --kb-btn-dismiss-hover-text: #ffffff; --kb-btn-trigger-bg: #ffffff; --kb-btn-trigger-text: #0f172a; --kb-btn-trigger-hover-bg: #f1f5f9; --kb-progress-track: #1e293b; --kb-progress-indicator: #ffffff; --kb-popover-bg: #0f172a; --kb-popover-border: #334155; --kb-popover-text: #f1f5f9; --kb-input-bg: #0f172a; --kb-input-border: #475569; --kb-input-text: #f1f5f9; --kb-input-placeholder: #94a3b8; --kb-form-label: #e2e8f0; --kb-success-color: #6ee7b7; --kb-error-text: #ef4444; --kb-kbd-bg: #1e293b; --kb-kbd-border: #334155; --kb-kbd-text: #94a3b8; --kb-watermark-text: #64748b; }
9
9
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
10
10
  #cue-card-root { position: fixed; z-index: 2147483647; pointer-events: none; width: 100%; height: 0; top: 0; left: 0; isolation: isolate; }
11
- .container { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 0.25rem; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; padding: 1rem; width: auto; min-width: 320px; max-width: 90vw; opacity: 0; z-index: 1; font-family: var(--kb-font-family); }
11
+ .container { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 0.25rem; border-bottom-left-radius: 0.25rem; border-bottom-right-radius: 0.25rem; padding: 1.25rem 1.5rem; width: auto; min-width: 400px; max-width: 90vw; opacity: 0; z-index: 1; font-family: var(--kb-font-family); }
12
12
  .backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0); backdrop-filter: blur(0); -webkit-backdrop-filter: blur(0); transition: all 0.5s ease; z-index: 0; pointer-events: none; }
13
13
  .backdrop.active { background: rgba(0,0,0,0.1); backdrop-filter: blur(var(--kb-focus-blur)); -webkit-backdrop-filter: blur(var(--kb-focus-blur)); }
14
14
  .launcher { position: absolute; pointer-events: auto; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); border-radius: 9999px; padding: 0.5rem 1rem; display: flex; align-items: center; gap: 0.75rem; cursor: pointer; transition: transform 0.2s, opacity 0.3s; opacity: 0; z-index: 1; color: var(--kb-text-title); font-weight: 500; font-size: 0.875rem; font-family: var(--kb-font-family); }
@@ -31,21 +31,31 @@
31
31
  .title { color: var(--kb-text-title); font-size: 1rem; font-weight: 600; line-height: 1.5; }
32
32
  .subtitle { color: var(--kb-text-title); font-size: 0.875rem; line-height: 1.25; opacity: 0.8; }
33
33
  .btn { display: inline-flex; align-items: center; justify-content: center; border-radius: 0.375rem; font-weight: 500; font-size: 0.875rem; line-height: 1.25rem; padding: 0.5rem 1rem; transition: all 0.2s; cursor: pointer; border: none; outline: none; }
34
- .btn-trigger { background-color: var(--kb-btn-trigger-bg); color: var(--kb-btn-trigger-text); min-width: 8rem; gap: 0.5rem; }
34
+ .btn-trigger { background-color: var(--kb-btn-trigger-bg); color: var(--kb-btn-trigger-text); min-width: 8rem; gap: 0.5rem; transition: opacity 0.2s ease-out, background-color 0.2s ease-out; }
35
+ .btn-trigger.hidden { opacity: 0; pointer-events: none; }
35
36
  .btn-trigger:not(:disabled):hover { background-color: var(--kb-btn-trigger-hover-bg); }
36
37
  .btn-trigger:disabled { opacity: 0.8; cursor: not-allowed; }
37
38
  .btn-trigger.success { background-color: transparent; color: var(--kb-success-color); padding-right: 0.75rem; cursor: default; }
39
+ .status-text { display: inline-flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; color: var(--kb-text-subtitle); opacity: 0.8; }
38
40
  .btn-trigger.success:hover { background-color: transparent; }
39
41
  .animate-spin { animation: spin 1s linear infinite; }
40
42
  @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
43
+ @keyframes shine { 0% { background-position: 0% 0%; } 50% { background-position: 100% 100%; } 100% { background-position: 0% 0%; } }
44
+ @keyframes sheen-flash { 0% { opacity: 0; transform: translateX(-100%) skewX(-15deg); } 50% { opacity: 0.6; } 100% { opacity: 0; transform: translateX(200%) skewX(-15deg); } }
45
+ .container-sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none; border-radius: inherit; }
46
+ .container-sheen::after { content: ''; position: absolute; top: 0; left: 0; width: 50%; height: 100%; background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent); transform: translateX(-100%) skewX(-15deg); }
47
+ .container-sheen.active::after { animation: sheen-flash 0.6s ease-out forwards; }
48
+ .launcher-shine-border { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; background-size: 300% 300%; animation: shine var(--shine-duration, 14s) linear infinite; mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0); mask-composite: exclude; -webkit-mask-composite: xor; padding: var(--shine-border-width, 1px); }
41
49
  .btn-dismiss { position: absolute; top: -0.5rem; left: -0.5rem; width: 1.5rem; height: 1.5rem; padding: 0; border-radius: 9999px; display: flex; align-items: center; justify-content: center; background-color: var(--kb-btn-dismiss-bg); border: 1px solid var(--kb-btn-dismiss-border); color: var(--kb-btn-dismiss-text); cursor: pointer; transition: all 0.3s ease-out; z-index: 10; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }
42
50
  .btn-dismiss:hover { background-color: var(--kb-btn-dismiss-hover-bg); color: var(--kb-btn-dismiss-hover-text); }
43
- .progress-clip { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
44
- .progress-container { position: absolute; bottom: 0; left: 0; right: 0; height: 0.25rem; background-color: var(--kb-progress-track); overflow: hidden; pointer-events: none; }
51
+ .progress-clip { position: absolute; inset: 0; border-radius: inherit; border-bottom-left-radius: 0; border-bottom-right-radius: 0; overflow: hidden; pointer-events: none; }
52
+ .progress-container { position: absolute; bottom: 0; left: 0; right: 0; height: 0.25rem; background-color: var(--kb-progress-track); overflow: hidden; pointer-events: none; border-radius: 0; }
45
53
  .progress-bar { height: 100%; background-color: var(--kb-progress-indicator); width: 0%; transition: width 0.3s ease; }
46
- .popover { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.375rem; background-color: var(--kb-popover-bg); border: 1px solid var(--kb-popover-border); border-radius: 0.25rem; border-top-left-radius: 0; border-top-right-radius: 0; padding: 1rem; color: var(--kb-popover-text); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden; transition: all 0.2s ease-out; }
54
+ .popover { position: absolute; top: 100%; left: 0; right: 0; margin-top: 0.375rem; background-color: var(--kb-popover-bg); border: 1px solid var(--kb-popover-border); border-radius: 0.25rem; border-top-left-radius: 0; border-top-right-radius: 0; padding: 1rem 1.5rem; color: var(--kb-popover-text); box-shadow: var(--kb-shadow-container); backdrop-filter: blur(var(--kb-backdrop-blur)); -webkit-backdrop-filter: blur(var(--kb-backdrop-blur)); opacity: 0; transform: translateY(-10px); pointer-events: none; visibility: hidden; transition: all 0.2s ease-out; }
47
55
  .popover.open { opacity: 1; transform: translateY(0); pointer-events: auto; visibility: visible; }
48
- .form-group { margin-bottom: 1rem; }
56
+ .container.popover-open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
57
+ .container.popover-open .progress-clip { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
58
+ .form-group { margin-bottom: 0; }
49
59
  .form-label { display: block; margin-bottom: 0.5rem; font-size: 0.875rem; color: var(--kb-form-label); font-weight: 500; }
50
60
  .input-row { display: flex; gap: 0.5rem; }
51
61
  .form-input { flex: 1; background-color: var(--kb-input-bg); border: 1px solid var(--kb-input-border); color: var(--kb-input-text); border-radius: 0.375rem; padding: 0.5rem 0.75rem; font-size: 0.875rem; outline: none; transition: border-color 0.2s; min-height: 44px; }
@@ -64,6 +74,9 @@
64
74
  .watermark { text-align: center; font-size: 0.625rem; color: var(--kb-watermark-text); opacity: 0.8; font-weight: 500; letter-spacing: 0.025em; }
65
75
  .watermark a { color: inherit; text-decoration: none; cursor: pointer; }
66
76
  .watermark a:hover { text-decoration: underline; text-decoration-color: var(--kb-watermark-text); }
77
+ .popover-watermark { position: absolute; top: 100%; left: 0; right: 0; text-align: center; font-size: 0.625rem; color: var(--kb-watermark-text); opacity: 0.6; font-weight: 500; letter-spacing: 0.025em; padding-top: 0.5rem; }
78
+ .popover-watermark a { color: inherit; text-decoration: none; cursor: pointer; }
79
+ .popover-watermark a:hover { text-decoration: underline; opacity: 1; }
67
80
  /* Launcher hint positioning */
68
81
  .launcher .kbd-hint { position: static; transform: none; opacity: 0.6; transition: opacity 0.2s; }
69
82
  .launcher:hover .kbd-hint { opacity: 1; }
@@ -86,7 +99,7 @@
86
99
  /* Custom tooltip for toggle button */
87
100
  .btn-toggle-personalization .toggle-tooltip { position: absolute; top: calc(100% + 6px); left: 50%; transform: translateX(-50%); white-space: nowrap; background-color: var(--kb-bg-container); border: 1px solid var(--kb-border-container); color: var(--kb-text-title); font-size: 0.7rem; font-weight: 500; padding: 0.25rem 0.5rem; border-radius: 4px; opacity: 0; visibility: hidden; transition: opacity 0.15s ease-out, visibility 0.15s ease-out; pointer-events: none; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
88
101
  .btn-toggle-personalization:hover .toggle-tooltip { opacity: 1; visibility: visible; }
89
- `,Ht=(e,t,r)=>{let n=O(!1);X(()=>{let i=e.current;if(!i)return;let o=r.direction==="top-to-bottom",a=o?"translateY(-60px)":"translateX(60px)",l=o?"translateY(-20px)":"translateX(20px)",u="translate(0, 0)";if(t){n.current=!0;let c=i.animate([{opacity:0,transform:a},{opacity:1,transform:u}],{duration:500,delay:r.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});c.onfinish=()=>r.onEntranceComplete?.()}else if(n.current){let c=i.animate([{opacity:1,transform:u},{opacity:0,transform:l}],{duration:350,delay:r.exitDelayMs,easing:"ease-in-out",fill:"forwards"});c.onfinish=()=>r.onExitComplete?.()}else i.style.opacity="0",i.style.transform=l},[t,r.direction])},Ft=e=>{if(!e)return{};let t={};return e.fontFamily&&(t["--kb-font-family"]=e.fontFamily),e.backgroundColor&&(t["--kb-bg-container"]=e.backgroundColor,t["--kb-popover-bg"]=e.backgroundColor),e.borderColor&&(t["--kb-border-container"]=e.borderColor,t["--kb-popover-border"]=e.borderColor),e.textColor&&(t["--kb-text-title"]=e.textColor,t["--kb-popover-text"]=e.textColor),e.subtitleColor&&(t["--kb-text-subtitle"]=e.subtitleColor),e.borderRadius&&(t["border-radius"]=e.borderRadius,t["border-bottom-left-radius"]=e.borderRadius,t["border-bottom-right-radius"]=e.borderRadius),e.primaryColor&&(t["--kb-btn-trigger-bg"]=e.primaryColor,t["--kb-progress-indicator"]=e.primaryColor,t["--kb-success-color"]=e.primaryColor),e.primaryTextColor&&(t["--kb-btn-trigger-text"]=e.primaryTextColor),t},Dr=({config:e,isOpen:t,skipFocus:r,setIsOpen:n})=>{let i=e.mountMode==="inline",o=O(null),a=O(null),l=O(null),u=O(null),c=O(null),[d,s]=le("card"),[m,b]=le(!1),[E,L]=le(!1),C=O(!1),f=O(!1),k=O(!1),M=O("card"),F=O(e.status),I=O(!!e.isVisible),_=O(null),D=O(null),K=O(!1),[U,V]=le(!1),[S,j]=le({}),[ye,pe]=le(0),ke=O(0),Q=e.enableTimer!==!1,y=Math.max(500,e.timerDurationMs??2e4),v=Lt(g=>{ke.current=g,pe(g)},[]);X(()=>{e.isVisible&&(s("card"),C.current=!1,b(!1))},[e.isVisible]),d==="card"&&M.current==="launcher"&&(f.current=!1),e.status==="success"&&F.current!=="success"?d==="card"&&(f.current=!0):e.status!=="success"&&(f.current=!1),F.current=e.status,X(()=>{let g=M.current==="launcher",w=d==="card";g&&w&&E&&(k.current=!0,setTimeout(()=>{k.current=!1},100)),d==="launcher"&&V(!1),g&&w&&Q&&(v(0),_.current=null,K.current=!1)},[d,v,Q]),X(()=>{if(e.status==="success"&&(L(!0),e.enableLauncher&&d==="card"&&f.current)){let g=setTimeout(()=>{s("launcher")},2e3);return()=>clearTimeout(g)}},[e.status,e.enableLauncher,d]),X(()=>{e.isVisible&&!I.current&&Q&&(v(0),_.current=null,K.current=!1),I.current=!!e.isVisible},[e.isVisible,v,Q]),X(()=>{M.current=d},[d]);let R=O(!1);r&&(R.current=!0),X(()=>{if(t){E&&c.current&&c.current.reset();let g=R.current;if(R.current=!1,!g){let w=setTimeout(()=>{u.current&&u.current.focus()},100);return()=>clearTimeout(w)}}},[t]);let x=O(t);X(()=>{let g=x.current;x.current=t,!g&&t&&d==="launcher"&&s("card")},[t,d]),i||(Ht(o,!!e.isVisible&&d==="card"&&!m,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:C.current?0:e.entranceDelayMs||0,exitDelayMs:75,onEntranceComplete:()=>{e.onEntranceComplete?.(),C.current=!0},onExitComplete:()=>{(!e.isVisible||m)&&e.onExitComplete?.()}}),Ht(a,!!e.isVisible&&d==="launcher"&&!m,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:0,exitDelayMs:75})),X(()=>{let g=l.current;if(!g)return;let w=e.status==="success";if(e.enableFocusMode&&d==="card"&&e.isVisible&&!w){let T=setTimeout(()=>{g.classList.add("active")},e.focusDelayMs||500);return()=>clearTimeout(T)}else g.classList.remove("active")},[e.enableFocusMode,d,e.isVisible,e.focusDelayMs,e.status]),X(()=>{if(!e.isVisible)return;let g=w=>{if(w.key==="Escape"){if(t){n(!1);return}d==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.());return}(($,J)=>{let ee=J||{key:"p",modifiers:["meta","ctrl"]};if($.key.toLowerCase()!==ee.key.toLowerCase())return!1;let G=ee.modifiers||[];if(J){let ze=G.includes("meta")===$.metaKey,we=G.includes("ctrl")===$.ctrlKey,Ie=G.includes("alt")===$.altKey,Qt=G.includes("shift")===$.shiftKey;return ze&&we&&Ie&&Qt}return $.metaKey||$.ctrlKey})(w,e.keyboardShortcut)&&(w.preventDefault(),d==="launcher"?(s("card"),n(!0)):d==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.()))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e.isVisible,t,d,e.enableLauncher,n,e.onDismiss]);let A=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),ie=(()=>{if(e.keyboardShortcut){let g=e.keyboardShortcut.modifiers||[],w=[];return g.includes("meta")&&w.push(A?"\u2318":"Win"),g.includes("ctrl")&&w.push("Ctrl"),g.includes("alt")&&w.push(A?"Opt":"Alt"),g.includes("shift")&&w.push("Shift"),w.push(e.keyboardShortcut.key.toUpperCase()),w}return[A?"\u2318":"Ctrl","P"]})(),N=e.status==="starting",q=e.status==="success",oe=e.status==="error",Y=q&&f.current,B=e.textOverrides||{},Z=q?B.titleSuccess||"Personalization complete":N?"Starting personalization":oe?B.titleError||"Let's try that again":e.hasPersonalization?"Personalization ready":B.titleResting||"Personalization available",fe=q?B.subtitleSuccess||"Take a look":N?"Hang tight...":oe?B.subtitleError||"Something went wrong. Tap to retry.":B.subtitleResting||"This page can adapt to you",ce=N?B.btnLoading||"Starting...":oe?B.btnError||"Try again":q&&f.current?B.btnSuccess||"Personalised":E?"Show me again":B.btnResting||"Show me",Je=(g,w,T)=>{if(!T)return null;if(T.required&&!w.trim())return T.errorMessage||`${T.label} is required`;if(!w)return null;if(T.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(w))return T.errorMessage||"Please enter a valid email address";if(T.type==="url")try{new URL(w)}catch{return T.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return T.minLength&&w.length<T.minLength?T.errorMessage||`Must be at least ${T.minLength} characters`:T.maxLength&&w.length>T.maxLength?T.errorMessage||`Must be at most ${T.maxLength} characters`:T.pattern&&!new RegExp(T.pattern).test(w)?T.errorMessage||"Invalid format":null},qt=g=>{if(g.preventDefault(),N)return;let w=new FormData(g.target),T={},$={},J=!1;if(w.forEach((ee,G)=>{let Ne=ee.toString();T[G]=Ne;let ze=e.fields.find(Ie=>Ie.name===G),we=Je(G,Ne,ze);we&&($[G]=we,J=!0)}),J){j($);return}j({}),n(!1),e.onSubmitPersonalization?.(T)},Wt=g=>{let w=g.target,T=w.name;if(S[T]){let $=e.fields.find(ee=>ee.name===T),J=Je(T,w.value,$);j(ee=>{let G={...ee};return J?G[T]=J:delete G[T],G})}},Gt=g=>{g.stopPropagation(),!(N||q)&&n(!t)};X(()=>{if(!Q||K.current)return;if(!(e.isVisible&&d==="card"&&e.status==="resting"&&!t&&!U)){D.current!==null&&(cancelAnimationFrame(D.current),D.current=null),_.current=null;return}let w=T=>{_.current===null&&(_.current=T-ke.current/100*y);let $=T-_.current,J=Math.min(1,$/y),ee=J*100;if(v(ee),J>=1){K.current=!0,_.current=null,D.current=null,e.enableLauncher?(s("launcher"),n(!1)):e.onDismiss?.();return}D.current=requestAnimationFrame(w)};return D.current=requestAnimationFrame(w),()=>{D.current!==null&&(cancelAnimationFrame(D.current),D.current=null)}},[e.enableLauncher,e.isVisible,e.onDismiss,e.status,U,t,d,n,y,Q,v]),X(()=>()=>{D.current!==null&&cancelAnimationFrame(D.current)},[]);let Xt=Math.max(0,Math.min(100,e.progressPct??0)),Yt=Q?ye:Xt,Ze=!!e.isVisible&&d==="card"&&!m,et=!!e.isVisible&&d==="launcher"&&!m;return p(te,{children:[p("div",{ref:l,class:"backdrop",style:{display:Ze||et?"block":"none"}}),p("div",{ref:o,class:`container theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...Ft(e.customTheme),pointerEvents:Ze?"auto":"none"},onClick:()=>!t&&!N&&!q&&n(!0),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),children:[p("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),K.current=!0,e.enableLauncher?s("launcher"):e.onDismiss?.()},children:p(zt,{})}),p("div",{class:"content-wrapper",children:[p("div",{class:"logo",children:p(It,{})}),p("div",{class:"text-content",children:p("div",{class:"text-row",children:[p("div",{children:[p("div",{class:"title",children:Z}),p("div",{class:"subtitle",children:fe})]}),p("button",{class:`btn btn-trigger ${Y?"success":""}`,disabled:N||Y,onClick:Gt,children:N?p(te,{children:[p(Xe,{})," ",ce]}):Y?p(te,{children:[p(Pr,{})," ",ce]}):ce})]})})]}),p("div",{class:"progress-clip",children:p("div",{class:"progress-container",children:p("div",{class:"progress-bar",style:{width:`${Yt}%`}})})}),p("div",{class:`popover ${t?"open":""}`,onClick:g=>g.stopPropagation(),children:[p("form",{onSubmit:qt,ref:c,children:[e.fields.map((g,w)=>p("div",{class:"form-group",children:[p("label",{class:`form-label ${S[g.name]?"error":""}`,children:g.label}),p("div",{class:"input-row",children:[p("input",{ref:w===0?u:void 0,class:`form-input ${S[g.name]?"error":""}`,name:g.name,type:g.type||"text",placeholder:g.placeholder,required:g.required,onInput:Wt}),e.fields.length===1&&p("button",{type:"submit",class:"btn btn-submit",disabled:N,children:N?p(Xe,{}):p(Nt,{})})]}),S[g.name]&&p("div",{class:"form-message",children:S[g.name]})]},g.name)),e.fields.length>1&&p("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:N,children:N?p(Xe,{}):p(Nt,{})})]}),e.showWatermark&&p("div",{class:"watermark",children:["Powered by"," ",p("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),e.showKeyboardHints&&e.enableFocusMode&&p("div",{class:`kbd-hint ${!t&&!N&&!q?"visible":""}`,children:[p("div",{class:"kbd-group",children:p("div",{class:"kbd",children:"Esc"})}),p("span",{class:"kbd-text",children:"to dismiss"})]})]}),p("div",{ref:a,class:`launcher theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...Ft(e.customTheme),pointerEvents:et?"auto":"none"},onClick:g=>{g.stopPropagation(),b(!1),s("card"),n(!0)},role:"button",tabIndex:0,children:[p("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),b(!0),e.onDismiss?.()},children:p(zt,{})}),p("div",{class:"launcher-logo",children:p(It,{})}),e.textOverrides?.launcherLabel||(E?"Personalize again":"Personalize"),e.enableUndoToggle&&E&&p("button",{class:"btn-toggle-personalization","aria-label":e.isPersonalized?"Show original":"Show personalized",onClick:g=>{g.stopPropagation(),e.onTogglePersonalization?.()},children:[p(Lr,{}),p("span",{class:"toggle-tooltip",children:e.isPersonalized?"Show original":"Show personalized"})]}),e.showKeyboardHints&&p("div",{class:"kbd-hint visible",children:p("div",{class:"kbd-group",children:ie.map((g,w)=>p("div",{class:"kbd",children:g},w))})})]})]})},_e=class{constructor(t){h(this,"host");h(this,"shadow");h(this,"config");h(this,"isOpen",!1);h(this,"skipFocus",!1);h(this,"mountTarget",null);this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...t},this.mountTarget=t.mountNode??null,this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let r=document.createElement("style");r.textContent=Rr,this.shadow.appendChild(r);let n=document.createElement("div");this.shadow.appendChild(n)}applyHostStyles(){let t=this.config.mountMode==="inline";if(this.host.classList.toggle("kb-inline",t),t){this.host.style.cssText=`
102
+ `,Ut=(e,t,r)=>{let n=H(!1),i=H(null);G(()=>{let o=e.current;if(!o)return;i.current&&(i.current.cancel(),i.current=null);let a=r.direction==="top-to-bottom",l=a?"translateY(-60px)":"translateX(60px)",d=a?"translateY(-20px)":"translateX(20px)",c="translate(0, 0)";if(t){o.style.visibility="visible",n.current=!0;let u=o.animate([{opacity:0,transform:l},{opacity:1,transform:c}],{duration:500,delay:r.entranceDelayMs,easing:"cubic-bezier(0.175, 0.885, 0.32, 1.275)",fill:"forwards"});i.current=u,u.onfinish=()=>{i.current=null,r.onEntranceComplete?.()}}else if(n.current){let u=o.animate([{opacity:1,transform:c},{opacity:0,transform:d}],{duration:350,delay:r.exitDelayMs,easing:"ease-in-out",fill:"forwards"});i.current=u,u.onfinish=()=>{o.style.visibility="hidden",i.current=null,r.onExitComplete?.()}}else o.style.opacity="0",o.style.transform=d,o.style.visibility="hidden"},[t,r.direction])},$t=e=>{if(!e)return{};let t={};return e.fontFamily&&(t["--kb-font-family"]=e.fontFamily),e.backgroundColor&&(t["--kb-bg-container"]=e.backgroundColor,t["--kb-popover-bg"]=e.backgroundColor),e.borderColor&&(t["--kb-border-container"]=e.borderColor,t["--kb-popover-border"]=e.borderColor),e.textColor&&(t["--kb-text-title"]=e.textColor,t["--kb-popover-text"]=e.textColor),e.subtitleColor&&(t["--kb-text-subtitle"]=e.subtitleColor),e.borderRadius&&(t["border-radius"]=e.borderRadius,t["border-bottom-left-radius"]=e.borderRadius,t["border-bottom-right-radius"]=e.borderRadius),e.primaryColor&&(t["--kb-btn-trigger-bg"]=e.primaryColor,t["--kb-progress-indicator"]=e.primaryColor,t["--kb-success-color"]=e.primaryColor),e.primaryTextColor&&(t["--kb-btn-trigger-text"]=e.primaryTextColor),t},Kr=({config:e,isOpen:t,skipFocus:r,setIsOpen:n})=>{let i=e.mountMode==="inline",o=H(null),a=H(null),l=H(null),d=H(null),c=H(null),[u,s]=oe("card"),[f,m]=oe(!1),[S,L]=oe(!1),[E,b]=oe(!1),v=H(!1),C=H(!1),F=H(!1),z=H("card"),_=H(e.status),U=H(!!e.isVisible),O=H(null),R=H(null),K=H(!1),[M,V]=oe(!1),[xe,de]=oe(!1),[se,le]=oe({}),[y,k]=oe(0),D=H(0),w=e.enableTimer!==!1,A=Math.max(500,e.timerDurationMs??2e4),W=It(g=>{D.current=g,k(g)},[]);G(()=>{e.isVisible&&(s("card"),v.current=!1,m(!1))},[e.isVisible]),u==="card"&&z.current==="launcher"&&(C.current=!1),e.status==="success"&&_.current!=="success"?u==="card"&&(C.current=!0):e.status!=="success"&&(C.current=!1),_.current=e.status,G(()=>{let g=z.current==="launcher",x=u==="card";g&&x&&S&&(F.current=!0,setTimeout(()=>{F.current=!1},100)),u==="launcher"&&V(!1),g&&x&&w&&(W(0),O.current=null,K.current=!1)},[u,W,w]),G(()=>{if(e.status==="success"&&(L(!0),e.enableLauncher&&u==="card"&&C.current)){let g=setTimeout(()=>{s("launcher")},2e3);return()=>clearTimeout(g)}},[e.status,e.enableLauncher,u]),G(()=>{e.isVisible&&!U.current&&w&&(W(0),O.current=null,K.current=!1),U.current=!!e.isVisible},[e.isVisible,W,w]),G(()=>{z.current=u},[u]);let q=H(!1);r&&(q.current=!0),G(()=>{if(t){S&&c.current&&c.current.reset();let g=q.current;if(q.current=!1,!g){let x=setTimeout(()=>{d.current&&d.current.focus()},100);return()=>clearTimeout(x)}}},[t]);let re=H(t);G(()=>{let g=re.current;re.current=t,!g&&t&&u==="launcher"&&s("card")},[t,u]);let pe=!v.current,J=z.current==="launcher",fe=pe?e.entranceDelayMs||0:J&&u==="card"?400:0;i||(Ut(o,!!e.isVisible&&u==="card"&&!f,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:fe,exitDelayMs:75,onEntranceComplete:()=>{e.onEntranceComplete?.(),v.current=!0},onExitComplete:()=>{(!e.isVisible||f)&&e.onExitComplete?.()}}),Ut(a,!!e.isVisible&&u==="launcher"&&!f,{direction:e.direction||"top-to-bottom",position:e.position||"top-center",entranceDelayMs:400,exitDelayMs:75})),G(()=>{let g=l.current;if(!g)return;let x=e.status==="success"&&C.current;if(e.enableFocusMode&&u==="card"&&e.isVisible&&!x){let T=setTimeout(()=>{g.classList.add("active")},e.focusDelayMs||500);return()=>clearTimeout(T)}else g.classList.remove("active")},[e.enableFocusMode,u,e.isVisible,e.focusDelayMs,e.status]),G(()=>{if(!e.isVisible)return;let g=x=>{if(x.key==="Escape"){u==="card"&&(e.enableLauncher?(b(!0),s("launcher"),setTimeout(()=>{n(!1),b(!1)},500)):(n(!1),e.onDismiss?.()));return}(($,Q)=>{let ee=Q||{key:"p",modifiers:["meta","ctrl"]};if($.key.toLowerCase()!==ee.key.toLowerCase())return!1;let X=ee.modifiers||[];if(Q){let Ke=X.includes("meta")===$.metaKey,Ce=X.includes("ctrl")===$.ctrlKey,Ue=X.includes("alt")===$.altKey,nr=X.includes("shift")===$.shiftKey;return Ke&&Ce&&Ue&&nr}return $.metaKey||$.ctrlKey})(x,e.keyboardShortcut)&&(x.preventDefault(),u==="launcher"?(s("card"),n(!0)):u==="card"&&(e.enableLauncher?s("launcher"):e.onDismiss?.()))};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[e.isVisible,t,u,e.enableLauncher,n,e.onDismiss]);let Y=typeof navigator<"u"&&/Mac/.test(navigator.userAgent),be=(()=>{if(e.keyboardShortcut){let g=e.keyboardShortcut.modifiers||[],x=[];return g.includes("meta")&&x.push(Y?"\u2318":"Win"),g.includes("ctrl")&&x.push("Ctrl"),g.includes("alt")&&x.push(Y?"Opt":"Alt"),g.includes("shift")&&x.push("Shift"),x.push(e.keyboardShortcut.key.toUpperCase()),x}return[Y?"\u2318":"Ctrl","P"]})(),B=e.status==="starting",ce=e.status==="success",Ie=e.status==="error",He=ce&&C.current,Z=e.textOverrides||{},Yt=ce?Z.titleSuccess||"Personalization complete":B?"Starting personalization":Ie?Z.titleError||"Let's try that again":e.hasPersonalization?"Personalization ready":Z.titleResting||"Personalization available",Qt=ce?Z.subtitleSuccess||"Take a look":B?"Hang tight...":Ie?Z.subtitleError||"Something went wrong. Tap to retry.":Z.subtitleResting||"This page can adapt to you",Fe=B?Z.btnLoading||"Starting...":Ie?Z.btnError||"Try again":ce&&C.current?Z.btnSuccess||"Personalised":S?"Show me again":Z.btnResting||"Show me",nt=(g,x,T)=>{if(!T)return null;if(T.required&&!x.trim())return T.errorMessage||`${T.label} is required`;if(!x)return null;if(T.type==="email"&&!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(x))return T.errorMessage||"Please enter a valid email address";if(T.type==="url")try{new URL(x)}catch{return T.errorMessage||"Please enter a valid URL (e.g., https://example.com)"}return T.minLength&&x.length<T.minLength?T.errorMessage||`Must be at least ${T.minLength} characters`:T.maxLength&&x.length>T.maxLength?T.errorMessage||`Must be at most ${T.maxLength} characters`:T.pattern&&!new RegExp(T.pattern).test(x)?T.errorMessage||"Invalid format":null},Jt=g=>{if(g.preventDefault(),B)return;let x=new FormData(g.target),T={},$={},Q=!1;if(x.forEach((ee,X)=>{let Oe=ee.toString();T[X]=Oe;let Ke=e.fields.find(Ue=>Ue.name===X),Ce=nt(X,Oe,Ke);Ce&&($[X]=Ce,Q=!0)}),Q){le($);return}le({}),n(!1),e.onSubmitPersonalization?.(T)},Zt=g=>{let x=g.target,T=x.name;if(se[T]){let $=e.fields.find(ee=>ee.name===T),Q=nt(T,x.value,$);le(ee=>{let X={...ee};return Q?X[T]=Q:delete X[T],X})}},er=g=>{if(g.stopPropagation(),B||ce)return;let x=!t;n(x),x&&e.enableClickSheen&&(de(!0),setTimeout(()=>de(!1),600))};G(()=>{if(!w||K.current)return;if(!(e.isVisible&&u==="card"&&e.status==="resting"&&!t&&!M)){R.current!==null&&(cancelAnimationFrame(R.current),R.current=null),O.current=null;return}let x=T=>{O.current===null&&(O.current=T-D.current/100*A);let $=T-O.current,Q=Math.min(1,$/A),ee=Q*100;if(W(ee),Q>=1){K.current=!0,O.current=null,R.current=null,e.enableLauncher?(s("launcher"),n(!1)):e.onDismiss?.();return}R.current=requestAnimationFrame(x)};return R.current=requestAnimationFrame(x),()=>{R.current!==null&&(cancelAnimationFrame(R.current),R.current=null)}},[e.enableLauncher,e.isVisible,e.onDismiss,e.status,M,t,u,n,A,w,W]),G(()=>()=>{R.current!==null&&cancelAnimationFrame(R.current)},[]);let tr=Math.max(0,Math.min(100,e.progressPct??0)),rr=w?y:tr,it=!!e.isVisible&&u==="card"&&!f,ot=!!e.isVisible&&u==="launcher"&&!f;return p(ie,{children:[p("div",{ref:l,class:"backdrop",style:{display:it||ot?"block":"none"}}),p("div",{ref:o,class:`container theme-${e.theme||"glass"} pos-${e.position||"top-center"}${t?" popover-open":""}`,style:{...$t(e.customTheme),pointerEvents:it?"auto":"none"},onClick:()=>!t&&!B&&!ce&&n(!0),onMouseEnter:()=>V(!0),onMouseLeave:()=>V(!1),children:[e.enableClickSheen&&p("div",{class:`container-sheen${xe?" active":""}`}),p("button",{class:"btn-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),K.current=!0,e.enableLauncher?s("launcher"):e.onDismiss?.()},children:p(Kt,{})}),p("div",{class:"content-wrapper",children:p("div",{class:"text-content",children:p("div",{class:"text-row",children:[p("div",{children:[p("div",{class:"title",children:Yt}),p("div",{class:"subtitle",children:Qt})]}),B?p("span",{class:"status-text",children:[p(et,{})," ",Fe]}):p("button",{class:`btn btn-trigger ${He?"success":""}${t||E?" hidden":""}`,disabled:He,onClick:er,children:He?p(ie,{children:[p(Ir,{})," ",Fe]}):Fe})]})})}),p("div",{class:"progress-clip",children:p("div",{class:"progress-container",children:p("div",{class:"progress-bar",style:{width:`${rr}%`}})})}),p("div",{class:`popover ${t?"open":""}`,onClick:g=>g.stopPropagation(),children:[p("form",{onSubmit:Jt,ref:c,children:[e.fields.map((g,x)=>p("div",{class:"form-group",children:[p("label",{class:`form-label ${se[g.name]?"error":""}`,children:g.label}),p("div",{class:"input-row",children:[p("input",{ref:x===0?d:void 0,class:`form-input ${se[g.name]?"error":""}`,name:g.name,type:g.type||"text",placeholder:g.placeholder,required:g.required,onInput:Zt}),e.fields.length===1&&p("button",{type:"submit",class:"btn btn-submit",disabled:B,children:B?p(et,{}):p(Ot,{})})]}),se[g.name]&&p("div",{class:"form-message",children:se[g.name]})]},g.name)),e.fields.length>1&&p("button",{type:"submit",class:"btn btn-submit",style:{width:"100%"},disabled:B,children:B?p(et,{}):p(Ot,{})})]}),e.showWatermark&&p("div",{class:"popover-watermark",children:["Powered by"," ",p("a",{href:"https://kenobi.ai",target:"_blank",rel:"noopener noreferrer",children:"Kenobi"})]})]}),e.showKeyboardHints&&e.enableFocusMode&&p("div",{class:`kbd-hint ${!t&&!B&&!ce?"visible":""}`,children:[p("div",{class:"kbd-group",children:p("div",{class:"kbd",children:"Esc"})}),p("span",{class:"kbd-text",children:"to dismiss"})]})]}),p("div",{ref:a,class:`launcher theme-${e.theme||"glass"} pos-${e.position||"top-center"}`,style:{...$t(e.customTheme),...e.launcherStyles,pointerEvents:ot?"auto":"none"},onClick:g=>{g.stopPropagation(),m(!1),s("card"),n(!0)},role:"button",tabIndex:0,children:[e.launcherShineBorder?.enabled&&p("div",{class:"launcher-shine-border",style:{"--shine-duration":`${e.launcherShineBorder.duration||14}s`,"--shine-border-width":`${e.launcherShineBorder.borderWidth||1}px`,backgroundImage:`radial-gradient(transparent, transparent, ${Array.isArray(e.launcherShineBorder.color)?e.launcherShineBorder.color.join(","):e.launcherShineBorder.color||"rgba(255,255,255,0.5)"}, transparent, transparent)`}}),p("button",{class:"btn-dismiss launcher-dismiss","aria-label":"Dismiss",onClick:g=>{g.stopPropagation(),m(!0),e.onDismiss?.()},children:p(Kt,{})}),e.showLauncherLogo!==!1&&p("div",{class:"launcher-logo",children:p(Hr,{})}),S?e.textOverrides?.launcherLabelSuccess||e.textOverrides?.launcherLabel||"Personalize again":e.textOverrides?.launcherLabel||"Personalize",e.enableUndoToggle&&S&&p("button",{class:"btn-toggle-personalization","aria-label":e.isPersonalized?"Show original":"Show personalized",onClick:g=>{g.stopPropagation(),e.onTogglePersonalization?.()},children:[p(Fr,{}),p("span",{class:"toggle-tooltip",children:e.isPersonalized?"Show original":"Show personalized"})]}),e.showKeyboardHints&&p("div",{class:"kbd-hint visible",children:p("div",{class:"kbd-group",children:be.map((g,x)=>p("div",{class:"kbd",children:g},x))})})]})]})},ke=class{constructor(t){h(this,"host");h(this,"shadow");h(this,"config");h(this,"isOpen",!1);h(this,"skipFocus",!1);h(this,"mountTarget",null);this.config={position:"top-center",direction:"top-to-bottom",theme:"glass",entranceDelayMs:0,exitDelayMs:75,hasPersonalization:!1,isVisible:!1,progressPct:0,status:"resting",enableTimer:!0,timerDurationMs:2e4,enableLauncher:!0,enableFocusMode:!1,focusBlurIntensity:"10px",focusDelayMs:500,showKeyboardHints:!1,showWatermark:!0,mountMode:"overlay",...t},this.mountTarget=t.mountNode??null,this.host=document.createElement("div"),this.host.id="kenobi-cue-card-root",this.applyHostStyles(),this.shadow=this.host.attachShadow({mode:"open"});let r=document.createElement("style");r.textContent=Or,this.shadow.appendChild(r);let n=document.createElement("div");this.shadow.appendChild(n)}applyHostStyles(){let t=this.config.mountMode==="inline";this.host.classList.toggle("kb-inline",t);let r=this.config.focusBlurIntensity??"10px";if(t){this.host.style.cssText=`
90
103
  position: relative !important;
91
104
  z-index: auto !important;
92
105
  top: auto !important;
@@ -96,6 +109,7 @@
96
109
  pointer-events: auto !important;
97
110
  isolation: auto !important;
98
111
  display: block !important;
112
+ --kb-focus-blur: ${r};
99
113
  `;return}this.host.style.cssText=`
100
114
  position: fixed !important;
101
115
  z-index: 2147483647 !important;
@@ -105,5 +119,6 @@
105
119
  height: 0 !important;
106
120
  pointer-events: none !important;
107
121
  isolation: isolate !important;
108
- `}mount(t){let r=t||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){Be(null,this.shadow.lastElementChild),this.host.remove()}update(t){t.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1),this.config={...this.config,...t},this.applyHostStyles(),this.render()}setTheme(t){this.update({theme:t})}openForm(t){this.isOpen=!0,this.skipFocus=t??!1,this.render()}render(){let t=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,Be(p(Dr,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),t)}};var Ot="kfor",Ut="kenobi_visitor_key",re="data-kenobi-transformation-identifier",de={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Nr=e=>({enabled:e?.enabled??de.enabled,durationMs:e?.durationMs??de.durationMs,delayMs:e?.delayMs??de.delayMs,easing:e?.easing??de.easing,animateSize:e?.animateSize??de.animateSize,overflow:e?.overflow??de.overflow,textAnimation:e?.textAnimation,enter:e?.enter,exit:e?.exit}),zr=(e,t)=>({enabled:t?.enabled??e.enabled,durationMs:t?.durationMs??e.durationMs,delayMs:t?.delayMs??e.delayMs,easing:t?.easing??e.easing,animateSize:t?.animateSize??e.animateSize,overflow:t?.overflow??e.overflow,textAnimation:t?.textAnimation??e.textAnimation,enter:t?.enter??e.enter,exit:t?.exit??e.exit}),Vt=e=>typeof e=="string",ve=e=>e instanceof HTMLElement||typeof SVGElement<"u"&&e instanceof SVGElement,Ir=e=>typeof e=="string",Hr=e=>e==="hidden"||e==="visible"||e==="clip",Fr=e=>e==="line"||e==="word"||e==="character",$t=e=>typeof e!="object"||e===null?!1:Array.isArray(e)?e.every(t=>typeof t=="object"&&t!==null):!0,Kt=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=t;return(r===void 0||Vt(r))&&(n===void 0||$t(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Or=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=t;return Fr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Vt(i)||o!==void 0)&&(o===void 0||$t(o))},Ur=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:u,enter:c,exit:d}=t;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Ir(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Hr(l))&&(u===void 0||Or(u))&&(c===void 0||Kt(c))&&(d===void 0||Kt(d))},Ye=class{constructor(){h(this,"replaceWithTransition",async(t,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.overflow;let o=t.getBoundingClientRect(),a=window.getComputedStyle(t);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let l=t.cloneNode(!0);if(!(l instanceof Element)||!ve(l))throw new Error("oldElClone is not an AnimatableElement");l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%",l.style.margin="0",l.style.pointerEvents="none",i.appendChild(l);let u=document.createElement("div");u.innerHTML=r;let c=u.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(t,n).finished,t;let d=c.style.cssText,s=t.parentNode,m;if(s instanceof HTMLElement){let _=s.cloneNode(!1),D=window.getComputedStyle(s),K=D.cssText?D.cssText:Array.from(D).reduce((U,V)=>`${U}${V}:${D.getPropertyValue(V)};`,"");_.style.cssText=K,_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.style.pointerEvents="none",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(_)}else{let _=document.createElement("div");_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),m=c.getBoundingClientRect(),document.body.removeChild(_)}c.style.cssText=d,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${m.width}px`,c.style.height=`${m.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),t.replaceWith(i);let b=n.exit?.delayMs??n.delayMs,E=n.exit?.durationMs??n.durationMs,L=n.enter?.delayMs??n.delayMs,C=n.enter?.durationMs??n.durationMs,f=[],k=this.resolveKeyframes(n.exit?.keyframes),M=l.animate(k,{duration:E,delay:b,easing:n.easing,fill:"forwards"});f.push(M);let F=this.resolveKeyframes(n.enter?.keyframes),I=c.animate(F,{duration:C,delay:L,easing:n.easing,fill:"forwards"});if(f.push(I),n.animateSize){let _=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${m.width}px`,height:`${m.height}px`}],{duration:C,delay:L,easing:n.easing,fill:"forwards"});f.push(_)}return await Promise.all(f.map(_=>_.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=d,l.remove(),c});h(this,"enter",(t,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"exit",(t,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"resolveKeyframes",t=>t?Array.isArray(t)?t:[t]:[]);h(this,"applyTextAnimationToNode",(t,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(t),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",l=(u,c,d)=>{if(u.nodeType===Node.TEXT_NODE){let s=u.textContent??"";if(s.trim().length===0)return c;if(r.by==="character"){let L=s.split(/(\s+)/),C=document.createDocumentFragment(),f=c;return L.forEach(k=>{if(k.length===0)return;if(k.trim().length===0){C.appendChild(document.createTextNode(k));return}let M=document.createElement("span");M.style.display="inline-block",M.style.whiteSpace="nowrap",d&&(M.style.setProperty("background","inherit"),M.style.setProperty("-webkit-background-clip","text"),M.style.setProperty("background-clip","text"),M.style.setProperty("color","transparent")),k.split("").forEach(I=>{let _=document.createElement("span");_.textContent=I,_.style.display="inline-block",_.style.opacity="0",d&&(_.style.setProperty("background","inherit"),_.style.setProperty("-webkit-background-clip","text"),_.style.setProperty("background-clip","text"),_.style.setProperty("color","transparent"),_.style.paddingBottom="0.1em",_.style.marginBottom="-0.1em");let D=this.resolveKeyframes(r.keyframes),K=r.durationMs??n.durationMs??300,U=n.easing??"ease",V=_.animate(D,{duration:K,easing:U,delay:f,fill:"forwards"});V.addEventListener("finish",()=>{V.commitStyles(),V.cancel()}),M.appendChild(_),f+=r.staggerMs??50}),C.appendChild(M)}),u.parentNode?.replaceChild(C,u),f}let m;switch(r.by){case"word":m=s.split(/(\s+)/);break;case"line":m=s.split(`
109
- `);break;default:m=s.split("")}let b=document.createDocumentFragment(),E=c;return m.forEach(L=>{if(L.length===0)return;if(L.trim().length===0){b.appendChild(document.createTextNode(L));return}let f=document.createElement("span");f.textContent=L,f.style.display="inline-block",f.style.opacity="0",d&&(f.style.setProperty("background","inherit"),f.style.setProperty("-webkit-background-clip","text"),f.style.setProperty("background-clip","text"),f.style.setProperty("color","transparent"),f.style.setProperty("will-change","opacity, transform"));let k=this.resolveKeyframes(r.keyframes),M=r.durationMs??n.durationMs??300,F=n.easing??"ease",I=f.animate(k,{duration:M,easing:F,delay:E,fill:"forwards"});I.addEventListener("finish",()=>{I.commitStyles(),I.cancel()}),b.appendChild(f),E+=r.staggerMs??50}),u.parentNode?.replaceChild(b,u),E}if(u.nodeType===Node.ELEMENT_NODE){let s=c,m=Array.from(u.childNodes);for(let b of m)s=l(b,s,d);return s}return c};l(t,i,a)})}},Kr=e=>typeof e!="object"||e===null?!1:typeof e.enabled=="boolean",jt=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),Bt=e=>typeof e=="string",Vr=e=>Array.isArray(e)&&e.every(t=>Bt(t)),$r=e=>typeof e=="string"&&jt.has(e),jr=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return Bt(t.identifier)&&typeof t.markup=="string"&&Vr(t.selectorGuesses)&&$r(t.action)&&(t.transition===void 0||Ur(t.transition))},Br=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid response: expected object with data array");let t=e.data;if(!Array.isArray(t))throw new Error("Invalid response: data must be an array");return t.forEach((r,n)=>{if(!jr(r))throw new Error(`Invalid transformation at index ${n}`)}),t},Qe=class{constructor(t){h(this,"config");h(this,"changeStack",new Map);h(this,"visitorKey",null);h(this,"orchestrator");h(this,"cueCardInstance",null);h(this,"currentPath");h(this,"currentUrl");h(this,"navTicking",!1);h(this,"transitionDefaults");h(this,"lastAppliedTransformations",[]);h(this,"isPersonalized",!1);h(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(t){this.log("error","Auto-transformation flow failed with error:",t)}});h(this,"transform",async()=>{try{let t=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${Ot}"`,"Exiting...");return}let r=[];try{r=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(r)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let n=new Date,i=this.getDurationInMilliseconds(t,n);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(t){this.log("error","An unexpected, top-level error occurred during transformation",t)}});h(this,"log",(t,r,...n)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${t.toLocaleUpperCase()}] :: ${r}`;switch(t){case"debug":this.config.debug&&console.log(a,...n);break;case"info":console.log(a,...n);break;case"warn":console.warn(a,...n);break;case"error_detailed":console.trace(...n);case"error":console.error(a,...n);break}});h(this,"resolveTransitionConfig",t=>zr(this.transitionDefaults,t));h(this,"retrieveElement",t=>{if(!Array.isArray(t)||t.some(r=>typeof r!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(t)}`);for(let r of t){let n=document.querySelectorAll(r);if(n.length===0)continue;if(n.length===1)return n[0];let i=Array.from(n).filter(a=>{let l=a.getBoundingClientRect(),u=getComputedStyle(a);return u.display!=="none"&&u.visibility!=="hidden"&&l.width>0&&l.height>0});if(i.length===0)continue;let o=i.sort((a,l)=>a.getBoundingClientRect().top-l.getBoundingClientRect().top);return this.log("debug",`Selector "${r}" matched ${n.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${t.join(", ")}`)});h(this,"getQueryParam",t=>new URLSearchParams(window.location.search).get(t));h(this,"getCurrentPath",()=>window.location.pathname);h(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);h(this,"getDurationInMilliseconds",(t,r)=>+r-+t);h(this,"formatThousands",t=>new Intl.NumberFormat("en-US").format(t));h(this,"setDebug",t=>this.config.debug=t);h(this,"isInputElement",t=>!(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLSelectElement)));h(this,"waitForFrames",()=>new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))));h(this,"waitForIdle",(t=1e3)=>new Promise(r=>"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:t}):setTimeout(r,50)));h(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(t=>window.addEventListener("load",()=>t(),{once:!0})));h(this,"waitForQuietDom",(t,r)=>new Promise(n=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+t;(function l(){let u=performance.now();if(u-i>=r){o.disconnect(),n();return}if(u>=a){o.disconnect(),n();return}requestAnimationFrame(l)})()}));h(this,"isFramer",()=>{let t=Array.from(document.scripts).map(n=>n.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),t.some(n=>/framerusercontent\.com\/sites/i.test(n))].some(n=>!!n)});h(this,"syncVisitorKey",()=>{try{let t=this.getQueryParam(Ot);t?(this.log("debug",`Query param value found (${t}), pushing into session storage`),sessionStorage.setItem(Ut,t),this.visitorKey=t):this.visitorKey=sessionStorage.getItem(Ut)}catch(t){this.log("error","Failed to sync visitor key with error:",t)}});h(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let t=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>t("navigation:navigate")),i.addEventListener("currententrychange",()=>t("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>t("navigation:success")))}let r=history.pushState.bind(history),n=history.replaceState.bind(history);history.pushState=((...i)=>{let o=r(...i);return t("pushState"),o}),history.replaceState=((...i)=>{let o=n(...i);return t("replaceState"),o}),window.addEventListener("popstate",()=>t("popstate")),window.addEventListener("hashchange",()=>t("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>t("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&t("poll")},1e3)});h(this,"getTransformations",async(t,r)=>{let n=new URLSearchParams({path:t}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${r}?${n.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return Br(o)});h(this,"validateTransitionPreconditions",(t,r,n)=>{if(n.enabled){let i=document.createElement("div");i.innerHTML=r;let o=i.firstElementChild;if(!o||!ve(o))return this.log("warn",`Transformation "${t}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});h(this,"applyTransformations",async(t,r)=>{this.log("debug",`Starting ${t.length} transformations`),r?.shouldConsolidate&&this.changeStack.forEach((n,i)=>{t.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:n,...i}of t)try{if(this.changeStack.get(n))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,l=this.resolveTransitionConfig(i.transition);if(l.enabled&&ve(o)&&"animate"in o){let u=await this.orchestrator.replaceWithTransition(o,i.markup,l);this.setOrUpdateReplaceChangeRef(n,a,u)}else Se(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(n,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let l=o.previousElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(re,n),a.enabled&&ve(l)){let u=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=u},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let l=o.nextElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(re,n),a.enabled&&ve(l)){let u=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=u},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"Delete":{let a=o.outerHTML;Se(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(re,n),this.changeStack.set(n,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(re,n),this.changeStack.set(n,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${n}"`,o)}this.lastAppliedTransformations=t,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});h(this,"setOrUpdateReplaceChangeRef",(t,r,n)=>{let i=this.changeStack.get(t);if(!i){n.setAttribute(re,t),this.changeStack.set(t,{undoOpts:{type:"Replace",ref:n,content:r}});return}let o=i.undoOpts.ref;o&&o!==n&&o.isConnected&&o.removeAttribute(re),n.setAttribute(re,t),i.undoOpts.ref=n});h(this,"syncChangeStack",()=>{let t=0;for(let[r,n]of this.changeStack){let i=n.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(r),t++;continue}i.getAttribute(re)!==r&&(this.changeStack.delete(r),t++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(t)} stale entries`)});h(this,"undo",t=>{let r=this.changeStack.get(t);if(r===void 0)throw new Error(`Cannot undo stack item with identifier ${t} as it does not exist.`);let{undoOpts:n}=r;switch(n.type){case"Remove":{n.ref.remove();break}case"Replace":{Se(n.ref,n.content),n.ref.removeAttribute(re);break}case"SetInput":{if(!this.isInputElement(n.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(n.ref,n.content),n.ref.removeAttribute(re);break}}this.changeStack.delete(t)});h(this,"undoAll",()=>{this.changeStack.forEach((t,r)=>this.undo(r))});h(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});h(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});h(this,"setInputValue",(t,r)=>{let n=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:t instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(t,r),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))});h(this,"fetchCueCardConfig",async t=>{if(!this.config.publicKey)return null;try{let r=new URLSearchParams({publicKey:this.config.publicKey,pagePath:t}),n=await fetch(`${this.config.apiHost}/v1/cue-card-config?${r.toString()}`);if(!n.ok)return this.log("warn",`CueCard config request failed with status ${n.status}`),null;let i=await n.json();return Kr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(r){return this.log("error","Failed to fetch CueCard config:",r),null}});h(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let t=await this.fetchCueCardConfig(this.currentPath);if(!t||!t.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let r=t.config;this.cueCardInstance=new _e({theme:r?.theme??"light",position:r?.position??"top-center",direction:r?.direction??"top-to-bottom",fields:r?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!0,enableFocusMode:r?.enableFocusMode??!1,showWatermark:r?.showWatermark??!1,showKeyboardHints:r?.showKeyboardHints??!0,enableLauncher:r?.enableLauncher??!0,customTheme:r?.customTheme,textOverrides:r?.textOverrides,enableUndoToggle:r?.enableUndoToggle??!1,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user")},onSubmitPersonalization:n=>{this.log("debug","CueCard submitted:",n),this.personalize(n)},onOpenChange:n=>{this.log("debug","CueCard open state changed:",n)},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations()}}),this.cueCardInstance.mount(),this.log("debug","CueCard mounted successfully")});h(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});h(this,"personalize",async t=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let r=new Date;this.log("debug","Starting personalization with input:",t),this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:10});try{let n=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:this.config.publicKey,input:t,pagePath:this.currentPath})});if(this.cueCardInstance&&this.cueCardInstance.update({progressPct:50}),!n.ok){let l=await n.json().catch(()=>({}));throw new Error(l.error||`API error: ${n.status}`)}let i=await n.json();this.log("debug","Personalization API response:",i),this.cueCardInstance&&this.cueCardInstance.update({progressPct:80}),i.transformations&&Array.isArray(i.transformations)&&await this.applyTransformations(i.transformations,{shouldConsolidate:!0}),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let o=new Date,a=this.getDurationInMilliseconds(r,o);this.log("debug",`Personalization complete, took ${this.formatThousands(a)} ms`)}catch(n){this.log("error","Personalization failed:",n),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0})}});h(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...t},this.transitionDefaults=Nr(this.config.transitionDefaults),this.orchestrator=new Ye,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(r){this.log("error","Failed to initialize navigation listener with error:",r)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return ir(qr);})();
122
+ --kb-focus-blur: ${r};
123
+ `}mount(t){let r=t||this.config.mountNode||this.mountTarget||document.body;this.mountTarget=r,r.contains(this.host)||r.appendChild(this.host),this.applyHostStyles(),this.render()}unmount(){Ye(null,this.shadow.lastElementChild),this.host.remove()}update(t){t.status==="starting"&&this.config.status!=="starting"&&(this.isOpen=!1),this.config={...this.config,...t},this.applyHostStyles(),this.render()}setTheme(t){this.update({theme:t})}openForm(t){this.isOpen=!0,this.skipFocus=t??!1,this.render()}render(){let t=this.shadow.lastElementChild,r=this.skipFocus;this.skipFocus=!1,Ye(p(Kr,{config:this.config,isOpen:this.isOpen,skipFocus:r,setIsOpen:n=>{this.isOpen=n,this.config.onOpenChange?.(n),this.render()}}),t)}};var Vt="kfor",Bt="kenobi_visitor_key",te="data-kenobi-transformation-identifier",me={enabled:!1,durationMs:300,delayMs:0,easing:"ease",animateSize:!0,overflow:"hidden"},Ur=e=>({enabled:e?.enabled??me.enabled,durationMs:e?.durationMs??me.durationMs,delayMs:e?.delayMs??me.delayMs,easing:e?.easing??me.easing,animateSize:e?.animateSize??me.animateSize,overflow:e?.overflow??me.overflow,textAnimation:e?.textAnimation,enter:e?.enter,exit:e?.exit}),$r=(e,t)=>({enabled:t?.enabled??e.enabled,durationMs:t?.durationMs??e.durationMs,delayMs:t?.delayMs??e.delayMs,easing:t?.easing??e.easing,animateSize:t?.animateSize??e.animateSize,overflow:t?.overflow??e.overflow,textAnimation:t?.textAnimation??e.textAnimation,enter:t?.enter??e.enter,exit:t?.exit??e.exit}),Wt=e=>typeof e=="string",we=e=>e instanceof HTMLElement||typeof SVGElement<"u"&&e instanceof SVGElement,Vr=e=>typeof e=="string",Br=e=>e==="hidden"||e==="visible"||e==="clip",jr=e=>e==="line"||e==="word"||e==="character",qt=e=>typeof e!="object"||e===null?!1:Array.isArray(e)?e.every(t=>typeof t=="object"&&t!==null):!0,jt=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{animationName:r,keyframes:n,durationMs:i,delayMs:o}=t;return(r===void 0||Wt(r))&&(n===void 0||qt(n))&&(i===void 0||typeof i=="number")&&(o===void 0||typeof o=="number")},Wr=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{by:r,staggerMs:n,animationName:i,keyframes:o,delayMs:a,durationMs:l}=t;return jr(r)&&(a===void 0||typeof a=="number")&&(n===void 0||typeof n=="number")&&(l===void 0||typeof l=="number")&&(Wt(i)||o!==void 0)&&(o===void 0||qt(o))},qr=e=>{if(typeof e!="object"||e===null)return!1;let t=e,{enabled:r,durationMs:n,delayMs:i,easing:o,animateSize:a,overflow:l,textAnimation:d,enter:c,exit:u}=t;return(r===void 0||typeof r=="boolean")&&(n===void 0||typeof n=="number")&&(i===void 0||typeof i=="number")&&(o===void 0||Vr(o))&&(a===void 0||typeof a=="boolean")&&(l===void 0||Br(l))&&(d===void 0||Wr(d))&&(c===void 0||jt(c))&&(u===void 0||jt(u))},tt=class{constructor(){h(this,"replaceWithTransition",async(t,r,n)=>{let i=document.createElement("div");i.style.position="relative",i.style.overflow=n.overflow;let o=t.getBoundingClientRect(),a=window.getComputedStyle(t);i.style.display=a.display,i.style.verticalAlign=a.verticalAlign,i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.style.margin=a.margin;let l=t.cloneNode(!0);if(!(l instanceof Element)||!we(l))throw new Error("oldElClone is not an AnimatableElement");l.style.position="absolute",l.style.top="0",l.style.left="0",l.style.width="100%",l.style.height="100%",l.style.margin="0",l.style.pointerEvents="none",i.appendChild(l);let d=document.createElement("div");d.innerHTML=r;let c=d.firstElementChild;if(!c||!(c instanceof HTMLElement||c instanceof SVGElement))return await this.exit(t,n).finished,t;let u=c.style.cssText,s=t.parentNode,f;if(s instanceof HTMLElement){let _=s.cloneNode(!1),U=window.getComputedStyle(s),O=U.cssText?U.cssText:Array.from(U).reduce((R,K)=>`${R}${K}:${U.getPropertyValue(K)};`,"");_.style.cssText=O,_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.style.pointerEvents="none",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),f=c.getBoundingClientRect(),document.body.removeChild(_)}else{let _=document.createElement("div");_.style.position="absolute",_.style.top="-9999px",_.style.left="-9999px",_.style.visibility="hidden",_.appendChild(c),document.body.appendChild(_),n.textAnimation&&this.applyTextAnimationToNode(c,n.textAnimation,n),f=c.getBoundingClientRect(),document.body.removeChild(_)}c.style.cssText=u,c.style.visibility="",c.style.position="absolute",c.style.top="0",c.style.left="0",c.style.width=`${f.width}px`,c.style.height=`${f.height}px`,c.style.margin="0",c.style.opacity="0",i.appendChild(c),t.replaceWith(i);let m=n.exit?.delayMs??n.delayMs,S=n.exit?.durationMs??n.durationMs,L=n.enter?.delayMs??n.delayMs,E=n.enter?.durationMs??n.durationMs,b=[],v=this.resolveKeyframes(n.exit?.keyframes),C=l.animate(v,{duration:S,delay:m,easing:n.easing,fill:"forwards"});b.push(C);let F=this.resolveKeyframes(n.enter?.keyframes),z=c.animate(F,{duration:E,delay:L,easing:n.easing,fill:"forwards"});if(b.push(z),n.animateSize){let _=i.animate([{width:`${o.width}px`,height:`${o.height}px`},{width:`${f.width}px`,height:`${f.height}px`}],{duration:E,delay:L,easing:n.easing,fill:"forwards"});b.push(_)}return await Promise.all(b.map(_=>_.finished)),i.parentNode&&i.replaceWith(c),c.style.cssText=u,l.remove(),c});h(this,"enter",(t,r)=>{let n=r.enter?.delayMs??r.delayMs,i=r.enter?.durationMs??r.durationMs,o=this.resolveKeyframes(r.enter?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"exit",(t,r)=>{let n=r.exit?.delayMs??r.delayMs,i=r.exit?.durationMs??r.durationMs,o=this.resolveKeyframes(r.exit?.keyframes);return t.animate(o,{duration:i,delay:n,easing:r.easing,fill:"forwards"})});h(this,"resolveKeyframes",t=>t?Array.isArray(t)?t:[t]:[]);h(this,"applyTextAnimationToNode",(t,r,n)=>{let i=r.delayMs??0,o=window.getComputedStyle(t),a=o.getPropertyValue("background-clip")==="text"||o.getPropertyValue("-webkit-background-clip")==="text",l=(d,c,u)=>{if(d.nodeType===Node.TEXT_NODE){let s=d.textContent??"";if(s.trim().length===0)return c;if(r.by==="character"){let L=s.split(/(\s+)/),E=document.createDocumentFragment(),b=c;return L.forEach(v=>{if(v.length===0)return;if(v.trim().length===0){E.appendChild(document.createTextNode(v));return}let C=document.createElement("span");C.style.display="inline-block",C.style.whiteSpace="nowrap",u&&(C.style.setProperty("background","inherit"),C.style.setProperty("-webkit-background-clip","text"),C.style.setProperty("background-clip","text"),C.style.setProperty("color","transparent")),v.split("").forEach(z=>{let _=document.createElement("span");_.textContent=z,_.style.display="inline-block",_.style.opacity="0",u&&(_.style.setProperty("background","inherit"),_.style.setProperty("-webkit-background-clip","text"),_.style.setProperty("background-clip","text"),_.style.setProperty("color","transparent"),_.style.paddingBottom="0.1em",_.style.marginBottom="-0.1em");let U=this.resolveKeyframes(r.keyframes),O=r.durationMs??n.durationMs??300,R=n.easing??"ease",K=_.animate(U,{duration:O,easing:R,delay:b,fill:"forwards"});K.addEventListener("finish",()=>{K.commitStyles(),K.cancel()}),C.appendChild(_),b+=r.staggerMs??50}),E.appendChild(C)}),d.parentNode?.replaceChild(E,d),b}let f;switch(r.by){case"word":f=s.split(/(\s+)/);break;case"line":f=s.split(`
124
+ `);break;default:f=s.split("")}let m=document.createDocumentFragment(),S=c;return f.forEach(L=>{if(L.length===0)return;if(L.trim().length===0){m.appendChild(document.createTextNode(L));return}let b=document.createElement("span");b.textContent=L,b.style.display="inline-block",b.style.opacity="0",u&&(b.style.setProperty("background","inherit"),b.style.setProperty("-webkit-background-clip","text"),b.style.setProperty("background-clip","text"),b.style.setProperty("color","transparent"),b.style.setProperty("will-change","opacity, transform"));let v=this.resolveKeyframes(r.keyframes),C=r.durationMs??n.durationMs??300,F=n.easing??"ease",z=b.animate(v,{duration:C,easing:F,delay:S,fill:"forwards"});z.addEventListener("finish",()=>{z.commitStyles(),z.cancel()}),m.appendChild(b),S+=r.staggerMs??50}),d.parentNode?.replaceChild(m,d),S}if(d.nodeType===Node.ELEMENT_NODE){let s=c,f=Array.from(d.childNodes);for(let m of f)s=l(m,s,u);return s}return c};l(t,i,a)})}},Xr=e=>typeof e!="object"||e===null?!1:typeof e.enabled=="boolean",Xt=new Set(["Replace","InsertBefore","InsertAfter","Delete","SetFormField"]),Gt=e=>typeof e=="string",Gr=e=>Array.isArray(e)&&e.every(t=>Gt(t)),Yr=e=>typeof e=="string"&&Xt.has(e),Qr=e=>{if(typeof e!="object"||e===null)return!1;let t=e;return Gt(t.identifier)&&typeof t.markup=="string"&&Gr(t.selectorGuesses)&&Yr(t.action)&&(t.transition===void 0||qr(t.transition))},Jr=e=>{if(typeof e!="object"||e===null)throw new Error("Invalid response: expected object with data array");let t=e.data;if(!Array.isArray(t))throw new Error("Invalid response: data must be an array");return t.forEach((r,n)=>{if(!Qr(r))throw new Error(`Invalid transformation at index ${n}`)}),t},rt=class{constructor(t){h(this,"config");h(this,"changeStack",new Map);h(this,"visitorKey",null);h(this,"orchestrator");h(this,"cueCardInstance",null);h(this,"currentPath");h(this,"currentUrl");h(this,"navTicking",!1);h(this,"transitionDefaults");h(this,"lastAppliedTransformations",[]);h(this,"isPersonalized",!1);h(this,"startAutoTransform",async()=>{try{this.syncChangeStack(),await this.waitForLoaded(),this.isFramer()&&(await this.waitForFrames(),await this.waitForIdle(),await this.waitForQuietDom(100,1e3)),await this.transform()}catch(t){this.log("error","Auto-transformation flow failed with error:",t)}});h(this,"transform",async()=>{try{let t=new Date;if(this.log("debug","Starting transform"),this.visitorKey===null){this.log("debug",`Couldn't find a visitor copy external ID with query param key "${Vt}"`,"Exiting...");return}let r=[];try{r=await this.getTransformations(this.currentPath,this.visitorKey)}catch(o){this.log("error_detailed","An error occurred _getting_ transformations",o)}try{await this.applyTransformations(r)}catch(o){this.log("error_detailed","An error occurred _applying_ transformations",o)}let n=new Date,i=this.getDurationInMilliseconds(t,n);this.log("debug",`Transformation complete, took ${this.formatThousands(i)} ms`)}catch(t){this.log("error","An unexpected, top-level error occurred during transformation",t)}});h(this,"log",(t,r,...n)=>{let a=`${`[Kenobi \u25D4] (v${typeof window.__KENOBI_VERSION__<"u"?window.__KENOBI_VERSION__:"dev"})`} [${t.toLocaleUpperCase()}] :: ${r}`;switch(t){case"debug":this.config.debug&&console.log(a,...n);break;case"info":console.log(a,...n);break;case"warn":console.warn(a,...n);break;case"error_detailed":console.trace(...n);case"error":console.error(a,...n);break}});h(this,"resolveTransitionConfig",t=>$r(this.transitionDefaults,t));h(this,"retrieveElement",t=>{if(!Array.isArray(t)||t.some(r=>typeof r!="string"))throw new Error(`Invalid selectorGuesses payload received: expected array of strings but got ${JSON.stringify(t)}`);for(let r of t){let n=document.querySelectorAll(r);if(n.length===0)continue;if(n.length===1)return n[0];let i=Array.from(n).filter(a=>{let l=a.getBoundingClientRect(),d=getComputedStyle(a);return d.display!=="none"&&d.visibility!=="hidden"&&l.width>0&&l.height>0});if(i.length===0)continue;let o=i.sort((a,l)=>a.getBoundingClientRect().top-l.getBoundingClientRect().top);return this.log("debug",`Selector "${r}" matched ${n.length} elements, selected topmost visible one at y=${o[0].getBoundingClientRect().top}`),o[0]}throw new Error(`Could not find an element in the document with any of these selector patterns: ${t.join(", ")}`)});h(this,"getQueryParam",t=>new URLSearchParams(window.location.search).get(t));h(this,"getCurrentPath",()=>window.location.pathname);h(this,"getCurrentUrl",()=>window.location.pathname+window.location.search+window.location.hash);h(this,"getDurationInMilliseconds",(t,r)=>+r-+t);h(this,"formatThousands",t=>new Intl.NumberFormat("en-US").format(t));h(this,"setDebug",t=>this.config.debug=t);h(this,"isInputElement",t=>!(!(t instanceof HTMLInputElement)&&!(t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLSelectElement)));h(this,"waitForFrames",()=>new Promise(t=>requestAnimationFrame(()=>requestAnimationFrame(t))));h(this,"waitForIdle",(t=1e3)=>new Promise(r=>"requestIdleCallback"in window?window.requestIdleCallback(()=>r(),{timeout:t}):setTimeout(r,50)));h(this,"waitForLoaded",()=>document.readyState==="complete"?Promise.resolve():new Promise(t=>window.addEventListener("load",()=>t(),{once:!0})));h(this,"waitForQuietDom",(t,r)=>new Promise(n=>{let i=performance.now(),o=new MutationObserver(()=>{i=performance.now()});o.observe(document.documentElement,{subtree:!0,childList:!0,attributes:!0,characterData:!0});let a=performance.now()+t;(function l(){let d=performance.now();if(d-i>=r){o.disconnect(),n();return}if(d>=a){o.disconnect(),n();return}requestAnimationFrame(l)})()}));h(this,"isFramer",()=>{let t=Array.from(document.scripts).map(n=>n.src||"");return["__framer_events"in window,document.querySelector("[data-framer-root],[data-framer-component],[data-framer-page]"),t.some(n=>/framerusercontent\.com\/sites/i.test(n))].some(n=>!!n)});h(this,"syncVisitorKey",()=>{try{let t=this.getQueryParam(Vt);t?(this.log("debug",`Query param value found (${t}), pushing into session storage`),sessionStorage.setItem(Bt,t),this.visitorKey=t):this.visitorKey=sessionStorage.getItem(Bt)}catch(t){this.log("error","Failed to sync visitor key with error:",t)}});h(this,"initNavigationListener",()=>{if("__KENOBI_NAV_HOOKED__"in window)return;window.__KENOBI_NAV_HOOKED__=!0;let t=i=>{this.navTicking||(this.navTicking=!0,queueMicrotask(()=>{this.navTicking=!1;let o=this.getCurrentUrl();o!==this.currentUrl&&(this.currentUrl=o,this.currentPath=this.getCurrentPath(),this.log("debug",`URL changed (${i}) \u2192 ${location.href}`),this.config.autoTransform&&(this.undoAll(),this.startAutoTransform()),this.syncCueCardVisibility())}))};if("navigation"in window){let i=window.navigation;i&&"addEventListener"in i&&typeof i.addEventListener=="function"&&(i.addEventListener("navigate",()=>t("navigation:navigate")),i.addEventListener("currententrychange",()=>t("navigation:entrychange")),i.addEventListener?.("navigatesuccess",()=>t("navigation:success")))}let r=history.pushState.bind(history),n=history.replaceState.bind(history);history.pushState=((...i)=>{let o=r(...i);return t("pushState"),o}),history.replaceState=((...i)=>{let o=n(...i);return t("replaceState"),o}),window.addEventListener("popstate",()=>t("popstate")),window.addEventListener("hashchange",()=>t("hashchange")),document.addEventListener("click",i=>{let o=i.target,a=o&&o.closest?.("a[href]");!a||a.target&&a.target!=="_self"||new URL(a.href,location.href).origin!==location.origin||setTimeout(()=>t("click"),0)},!0),setInterval(()=>{this.getCurrentUrl()!==this.currentUrl&&t("poll")},1e3)});h(this,"getTransformations",async(t,r)=>{let n=new URLSearchParams({path:t}),i=await fetch(`${this.config.apiHost}/v1/visitor-copy-transformations/${r}?${n.toString()}`),o=await i.json();if(!i.ok)throw new Error(`Network error (status ${i.status}) with json body: ${JSON.stringify(o,null,2)}`);return Jr(o)});h(this,"validateTransitionPreconditions",(t,r,n)=>{if(n.enabled){let i=document.createElement("div");i.innerHTML=r;let o=i.firstElementChild;if(!o||!we(o))return this.log("warn",`Transformation "${t}" was skipped: A transition was requested, but the element is not animatable.`),!1}return!0});h(this,"applyTransformations",async(t,r)=>{this.log("debug",`Starting ${t.length} transformations`),r?.shouldConsolidate&&this.changeStack.forEach((n,i)=>{t.find(a=>a.identifier===i)&&this.undo(i)});for(let{identifier:n,...i}of t)try{if(this.changeStack.get(n))throw new Error("Transformation already exists in stack");let o=this.retrieveElement(i.selectorGuesses);switch(i.action){case"Replace":{let a=o.outerHTML,l=this.resolveTransitionConfig(i.transition);if(l.enabled&&we(o)&&"animate"in o){let d=await this.orchestrator.replaceWithTransition(o,i.markup,l);this.setOrUpdateReplaceChangeRef(n,a,d)}else Ae(o,i.markup,{}),this.setOrUpdateReplaceChangeRef(n,a,o);o.nodeName==="VIDEO"&&o.play();break}case"InsertBefore":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("beforebegin",i.markup);let l=o.previousElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(te,n),a.enabled&&we(l)){let d=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=d},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"InsertAfter":{let a=this.resolveTransitionConfig(i.transition);if(!this.validateTransitionPreconditions(n,i.markup,a))break;o.insertAdjacentHTML("afterend",i.markup);let l=o.nextElementSibling;if(l===null)throw new Error("Element wasn't created");if(l.setAttribute(te,n),a.enabled&&we(l)){let d=l.style.cssText;l.style.opacity="0",this.orchestrator.enter(l,{...a,delayMs:a.enter?.delayMs??a.delayMs}).addEventListener("finish",()=>{l.style.cssText=d},{once:!0})}this.changeStack.set(n,{undoOpts:{type:"Remove",ref:l}});break}case"Delete":{let a=o.outerHTML;Ae(o,'<div style="display: none;" data-kenobi-delete-marker="true"></div>',{}),o.setAttribute(te,n),this.changeStack.set(n,{undoOpts:{type:"Replace",ref:o,content:a}});break}case"SetFormField":{if(!this.isInputElement(o))throw new Error("Element targeted is not of a supported type");let a=o.value;this.setInputValue(o,i.markup),o.setAttribute(te,n),this.changeStack.set(n,{undoOpts:{type:"SetInput",ref:o,content:a}})}}}catch(o){this.log("warn",`Unable to apply transformation with identifier "${n}"`,o)}this.lastAppliedTransformations=t,this.isPersonalized=!0,this.updateCueCardPersonalizationState()});h(this,"setOrUpdateReplaceChangeRef",(t,r,n)=>{let i=this.changeStack.get(t);if(!i){n.setAttribute(te,t),this.changeStack.set(t,{undoOpts:{type:"Replace",ref:n,content:r}});return}let o=i.undoOpts.ref;o&&o!==n&&o.isConnected&&o.removeAttribute(te),n.setAttribute(te,t),i.undoOpts.ref=n});h(this,"syncChangeStack",()=>{let t=0;for(let[r,n]of this.changeStack){let i=n.undoOpts.ref;if(!(!!i&&(i.isConnected||document.contains(i)))){this.changeStack.delete(r),t++;continue}i.getAttribute(te)!==r&&(this.changeStack.delete(r),t++)}this.log("debug",`syncChangeStack pruned ${this.formatThousands(t)} stale entries`)});h(this,"undo",t=>{let r=this.changeStack.get(t);if(r===void 0)throw new Error(`Cannot undo stack item with identifier ${t} as it does not exist.`);let{undoOpts:n}=r;switch(n.type){case"Remove":{n.ref.remove();break}case"Replace":{Ae(n.ref,n.content),n.ref.removeAttribute(te);break}case"SetInput":{if(!this.isInputElement(n.ref))throw new Error("Element targeted is not of a supported type");this.setInputValue(n.ref,n.content),n.ref.removeAttribute(te);break}}this.changeStack.delete(t)});h(this,"undoAll",()=>{this.changeStack.forEach((t,r)=>this.undo(r))});h(this,"toggleTransformations",async()=>{this.isPersonalized?(this.undoAll(),this.isPersonalized=!1,this.log("debug","Toggled to original content")):(this.lastAppliedTransformations.length>0&&await this.applyTransformations(this.lastAppliedTransformations,{shouldConsolidate:!0}),this.isPersonalized=!0,this.log("debug","Toggled to personalized content")),this.updateCueCardPersonalizationState()});h(this,"updateCueCardPersonalizationState",()=>{this.cueCardInstance&&this.cueCardInstance.update({isPersonalized:this.isPersonalized})});h(this,"setInputValue",(t,r)=>{let n=t instanceof HTMLTextAreaElement?HTMLTextAreaElement.prototype:t instanceof HTMLInputElement?HTMLInputElement.prototype:HTMLSelectElement.prototype,i=Object.getOwnPropertyDescriptor(n,"value");if(!i?.set)throw new Error("No value setter found");i.set.call(t,r),t.dispatchEvent(new Event("input",{bubbles:!0})),t.dispatchEvent(new Event("change",{bubbles:!0}))});h(this,"fetchCueCardConfig",async t=>{if(!this.config.publicKey)return null;try{let r=new URLSearchParams({publicKey:this.config.publicKey,pagePath:t}),n=await fetch(`${this.config.apiHost}/v1/cue-card-config?${r.toString()}`);if(!n.ok)return this.log("warn",`CueCard config request failed with status ${n.status}`),null;let i=await n.json();return Xr(i)?i:(this.log("warn","Invalid CueCard config response format"),null)}catch(r){return this.log("error","Failed to fetch CueCard config:",r),null}});h(this,"initCueCard",async()=>{if(this.cueCardInstance){this.log("warn","CueCard already initialized, skipping...");return}let t=await this.fetchCueCardConfig(this.currentPath);if(!t||!t.enabled){this.log("debug",`CueCard not mounted: no active template for path "${this.currentPath}"`);return}this.log("debug","Active template found, mounting CueCard...");let r=t.config;this.cueCardInstance=new ke({theme:r?.theme??"light",position:r?.position??"top-center",direction:r?.direction??"top-to-bottom",fields:r?.fields??[{name:"companyDomain",label:"Company Name or Domain",placeholder:"example.com",required:!0,minLength:3,errorMessage:"Company name or domain is required"}],isVisible:!0,enableFocusMode:r?.enableFocusMode??!1,showWatermark:r?.showWatermark??!1,showKeyboardHints:r?.showKeyboardHints??!0,enableLauncher:r?.enableLauncher??!0,customTheme:r?.customTheme,textOverrides:r?.textOverrides,enableUndoToggle:r?.enableUndoToggle??!1,isPersonalized:this.isPersonalized,onDismiss:()=>{this.log("debug","CueCard dismissed by user"),this.dispatchKenobiEvent("cuecard:dismiss",{pagePath:this.currentPath})},onSubmitPersonalization:n=>{this.log("debug","CueCard submitted:",n),this.personalize(n)},onOpenChange:n=>{this.log("debug","CueCard open state changed:",n),this.dispatchKenobiEvent("cuecard:openchange",{isOpen:n,pagePath:this.currentPath})},onTogglePersonalization:()=>{this.log("debug","CueCard toggle personalization"),this.toggleTransformations(),this.dispatchKenobiEvent("cuecard:toggle",{isPersonalized:this.isPersonalized,pagePath:this.currentPath})}}),this.cueCardInstance.mount(),this.log("debug","CueCard mounted successfully")});h(this,"syncCueCardVisibility",async()=>{this.config.publicKey&&(this.cueCardInstance&&(this.log("debug","Navigation detected, unmounting CueCard"),this.cueCardInstance.unmount(),this.cueCardInstance=null),this.initCueCard())});h(this,"dispatchKenobiEvent",(t,r)=>{let n=new CustomEvent(`kenobi:${t}`,{detail:r,bubbles:!0});window.dispatchEvent(n),this.log("debug",`Dispatched event: kenobi:${t}`,r)});h(this,"personalize",async t=>{if(!this.config.publicKey){this.log("error","Cannot personalize: publicKey not configured");return}let r=new Date;this.log("debug","Starting personalization with input:",t),this.dispatchKenobiEvent("personalization:start",{input:t,pagePath:this.currentPath}),this.cueCardInstance&&this.cueCardInstance.update({status:"starting",progressPct:10});try{let n=await fetch(`${this.config.apiHost}/v1/personalize`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({publicKey:this.config.publicKey,input:t,pagePath:this.currentPath})});if(this.cueCardInstance&&this.cueCardInstance.update({progressPct:50}),!n.ok){let l=await n.json().catch(()=>({}));throw new Error(l.error||`API error: ${n.status}`)}let i=await n.json();this.log("debug","Personalization API response:",i),this.cueCardInstance&&this.cueCardInstance.update({progressPct:80}),i.transformations&&Array.isArray(i.transformations)&&await this.applyTransformations(i.transformations,{shouldConsolidate:!0}),this.cueCardInstance&&this.cueCardInstance.update({status:"success",progressPct:100});let o=new Date,a=this.getDurationInMilliseconds(r,o);this.log("debug",`Personalization complete, took ${this.formatThousands(a)} ms`),this.dispatchKenobiEvent("personalization:complete",{input:t,pagePath:this.currentPath,durationMs:a,transformationsCount:i.transformations?.length??0,metadata:i.metadata})}catch(n){this.log("error","Personalization failed:",n),this.cueCardInstance&&this.cueCardInstance.update({status:"error",progressPct:0}),this.dispatchKenobiEvent("personalization:error",{input:t,pagePath:this.currentPath,error:n instanceof Error?n.message:String(n)})}});h(this,"getCueCard",()=>this.cueCardInstance);this.config={apiHost:"https://kenobi.ai/api",debug:!1,autoTransform:!0,...t},this.transitionDefaults=Ur(this.config.transitionDefaults),this.orchestrator=new tt,this.syncVisitorKey(),this.currentPath=this.getCurrentPath(),this.currentUrl=this.getCurrentUrl();try{this.initNavigationListener()}catch(r){this.log("error","Failed to initialize navigation listener with error:",r)}this.log("debug","Kenobi initialized"),this.config.autoTransform&&(this.log("debug","Auto-transform is requested... Starting..."),this.startAutoTransform()),this.config.publicKey&&!this.config.skipCueCardAutoMount&&(this.log("debug","Public key provided, checking for active template..."),this.initCueCard())}};return ur(Zr);})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kenobi-js",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Kenobi JavaScript SDK",
5
5
  "main": "browser/dist.min.js",
6
6
  "exports": {
@@ -10,12 +10,6 @@
10
10
  "files": [
11
11
  "browser"
12
12
  ],
13
- "scripts": {
14
- "bump": "pnpm version patch",
15
- "build": "tsx src/build.ts --prod",
16
- "dev": "tsx src/build.ts --watch",
17
- "tsc": "tsc --noEmit"
18
- },
19
13
  "publishConfig": {
20
14
  "access": "public"
21
15
  },
@@ -25,6 +19,12 @@
25
19
  },
26
20
  "devDependencies": {
27
21
  "esbuild": "^0.25.9",
28
- "typescript": "catalog:"
22
+ "typescript": "^5.8.3"
23
+ },
24
+ "scripts": {
25
+ "bump": "pnpm version patch",
26
+ "build": "tsx src/build.ts --prod",
27
+ "dev": "tsx src/build.ts --watch",
28
+ "tsc": "tsc --noEmit"
29
29
  }
30
- }
30
+ }