@frak-labs/components 0.0.8 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/components.js +1 -1
- package/package.json +3 -3
package/cdn/components.js
CHANGED
|
@@ -18,4 +18,4 @@
|
|
|
18
18
|
Last Response: ${n.lastResponse}
|
|
19
19
|
Client Status: ${n.clientStatus}
|
|
20
20
|
Error: ${n.error}
|
|
21
|
-
`.trim()}};function Nr(){const e=new Map;return{createChannel:t=>{const n=Math.random().toString(36).substring(7);return e.set(n,t),n},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}function Ur({iframe:e}){const t=new $t;return{handleEvent:async r=>{switch(r.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":r.data.backup?localStorage.setItem(ye,r.data.backup):localStorage.removeItem(ye);break;case"remove-backup":localStorage.removeItem(ye);break;case"show":case"hide":Rt({iframe:e,isVisible:r.iframeLifecycle==="show"});break;case"handshake":{e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:r.data.token,currentUrl:window.location.href}},"*");break}}},isConnected:t.promise}}function Lr({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}){if(typeof window>"u")throw new M(N.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new M(N.configError,"The iframe does not have a product window");const a=t.contentWindow;async function s(_){if(!_.origin)return;try{if(new URL(_.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(w){console.log("Unable to check frak msg origin",w);return}if(typeof _.data!="object")return;if(o.setLastResponse(_),"iframeLifecycle"in _.data){await r.handleEvent(_.data);return}if("clientLifecycle"in _.data){console.error("Client lifecycle event received on the client side, dismissing it");return}const v=_.data.id,d=n.getRpcResolver(v);d&&await d(_.data)}window.addEventListener("message",s);function l(_){a.postMessage(_,{targetOrigin:e}),o.setLastRequest(_,e)}function c(){window.removeEventListener("message",s)}return{sendEvent:l,cleanup:c}}function zr({config:e,iframe:t}){const n=Nr(),r=Ur({iframe:t}),o=new Lt(e,t),a=Lr({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}),s=async d=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const f=new $t,b=n.createChannel(async m=>{const i=await Ot(m.data);i.error?f.reject(new M(i.error.code,i.error.message,i.error?.data)):f.resolve(i.result),n.removeChannel(b)}),p=await Tt(d);return a.sendEvent({id:b,topic:d.method,data:p}),f.promise},l=async(d,w)=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const b=n.createChannel(async m=>{const i=await Ot(m.data);if(i.result)w(i.result);else throw new Ir("No valid result in the response")}),p=await Tt(d);a.sendEvent({id:b,topic:d.method,data:p})},c=Dr(a,r),_=async()=>{c(),n.destroy(),a.cleanup(),t.remove()},v=jr({config:e,messageHandler:a,lifecycleManager:r}).then(()=>o.updateSetupStatus(!0));return{config:e,debugInfo:o,waitForConnection:r.isConnected,waitForSetup:v,request:s,listenerRequest:l,destroy:_}}function Dr(e,t){let o,a;const s=()=>e.sendEvent({clientLifecycle:"heartbeat"});async function l(){s(),o=setInterval(s,100),a=setTimeout(()=>{c(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,c()}function c(){o&&clearInterval(o),a&&clearTimeout(a)}return l(),c}async function jr({config:e,messageHandler:t,lifecycleManager:n}){await n.isConnected;const r=async()=>{const a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},o=async()=>{if(typeof window>"u")return;const a=window.localStorage.getItem(ye);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([r(),o()])}async function Vr({config:e}){const t=await Rr({config:e});if(!t){console.error("Failed to create iframe");return}const n=zr({config:e,iframe:t});if(await n.waitForSetup,!await n.waitForConnection){console.error("Failed to connect to client");return}return n}function Wr(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}var ie,I,zt,Z,Dt,jt,ze,Vt,De,je,Ve,ae={},Wt=[],qr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,we=Array.isArray;function j(e,t){for(var n in t)e[n]=t[n];return e}function We(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function z(e,t,n){var r,o,a,s={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?ie.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return se(e,s,r,o,null)}function se(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++zt,__i:-1,__u:0};return o==null&&I.vnode!=null&&I.vnode(a),a}function Q(e){return e.children}function V(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?te(e):null}function qt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return qt(e)}}function Jt(e){(!e.__d&&(e.__d=!0)&&Z.push(e)&&!me.__r++||Dt!==I.debounceRendering)&&((Dt=I.debounceRendering)||jt)(me)}function me(){var e,t,n,r,o,a,s,l;for(Z.sort(ze);e=Z.shift();)e.__d&&(t=Z.length,r=void 0,a=(o=(n=e).__v).__e,s=[],l=[],n.__P&&((r=j({},o)).__v=o.__v+1,I.vnode&&I.vnode(r),qe(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[a]:null,s,a??te(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,Zt(s,r,l),r.__e!=a&&qt(r)),Z.length>t&&Z.sort(ze));me.__r=0}function Kt(e,t,n,r,o,a,s,l,c,_,v){var d,w,f,b,p,m,i=r&&r.__k||Wt,h=t.length;for(c=Jr(n,t,i,c,h),d=0;d<h;d++)(f=n.__k[d])!=null&&(w=f.__i===-1?ae:i[f.__i]||ae,f.__i=d,m=qe(e,f,w,o,a,s,l,c,_,v),b=f.__e,f.ref&&w.ref!=f.ref&&(w.ref&&Je(w.ref,null,f),v.push(f.ref,f.__c||b,f)),p==null&&b!=null&&(p=b),4&f.__u||w.__k===f.__k?c=Gt(f,c,e):typeof f.type=="function"&&m!==void 0?c=m:b&&(c=b.nextSibling),f.__u&=-7);return n.__e=p,c}function Jr(e,t,n,r,o){var a,s,l,c,_,v=n.length,d=v,w=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=t[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=a+w,(s=e.__k[a]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?se(null,s,null,null,null):we(s)?se(Q,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?se(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,l=null,(_=s.__i=Kr(s,n,c,d))!==-1&&(d--,(l=n[_])&&(l.__u|=2)),l==null||l.__v===null?(_==-1&&w--,typeof s.type!="function"&&(s.__u|=4)):_!=c&&(_==c-1?w--:_==c+1?w++:(_>c?w--:w++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<v;a++)(l=n[a])!=null&&!(2&l.__u)&&(l.__e==r&&(r=te(l)),Qt(l,l));return r}function Gt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Gt(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=te(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function be(e,t){return t=t||[],e==null||typeof e=="boolean"||(we(e)?e.some(function(n){be(n,t)}):t.push(e)),t}function Kr(e,t,n,r){var o,a,s=e.key,l=e.type,c=t[n];if(c===null||c&&s==c.key&&l===c.type&&!(2&c.__u))return n;if(r>(c!=null&&!(2&c.__u)?1:0))for(o=n-1,a=n+1;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&s==c.key&&l===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(2&c.__u)&&s==c.key&&l===c.type)return a;a++}}return-1}function Xt(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||qr.test(t)?n:n+"px"}function ge(e,t,n,r,o){var a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Xt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Vt,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=De,e.addEventListener(t,a?Ve:je,a)):e.removeEventListener(t,a?Ve:je,a);else{if(o=="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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Yt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=De++;else if(t.t<n.u)return;return n(I.event?I.event(t):t)}}}function qe(e,t,n,r,o,a,s,l,c,_){var v,d,w,f,b,p,m,i,h,g,C,k,u,S,E,y,A,x=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(v=I.__b)&&v(t);e:if(typeof x=="function")try{if(i=t.props,h="prototype"in x&&x.prototype.render,g=(v=x.contextType)&&r[v.__c],C=v?g?g.props.value:v.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(h?t.__c=d=new x(i,C):(t.__c=d=new V(i,C),d.constructor=x,d.render=Xr),g&&g.sub(d),d.props=i,d.state||(d.state={}),d.context=C,d.__n=r,w=d.__d=!0,d.__h=[],d._sb=[]),h&&d.__s==null&&(d.__s=d.state),h&&x.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=j({},d.__s)),j(d.__s,x.getDerivedStateFromProps(i,d.__s))),f=d.props,b=d.state,d.__v=t,w)h&&x.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),h&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(h&&x.getDerivedStateFromProps==null&&i!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(i,C),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(i,d.__s,C)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=i,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(P){P&&(P.__=t)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(i,d.__s,C),h&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,b,p)})}if(d.context=C,d.props=i,d.__P=e,d.__e=!1,u=I.__r,S=0,h){for(d.state=d.__s,d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=j(j({},r),d.getChildContext())),h&&!w&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(f,b)),l=Kt(e,we(y=v!=null&&v.type===Q&&v.key==null?v.props.children:v)?y:[y],t,n,r,o,a,s,l,c,_),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(P){if(t.__v=null,c||a!=null)if(P.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else for(A=a.length;A--;)We(a[A]);else t.__e=n.__e,t.__k=n.__k;I.__e(P,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Gr(n.__e,t,n,r,o,a,s,c,_);return(v=I.diffed)&&v(t),128&t.__u?void 0:l}function Zt(e,t,n){for(var r=0;r<n.length;r++)Je(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){I.__e(a,o.__v)}})}function Gr(e,t,n,r,o,a,s,l,c){var _,v,d,w,f,b,p,m=n.props,i=t.props,h=t.type;if(h=="svg"?o="http://www.w3.org/2000/svg":h=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((f=a[_])&&"setAttribute"in f==!!h&&(h?f.localName==h:f.nodeType==3)){e=f,a[_]=null;break}}if(e==null){if(h==null)return document.createTextNode(i);e=document.createElementNS(o,h,i.is&&i),l&&(I.__m&&I.__m(t,a),l=!1),a=null}if(h===null)m===i||l&&e.data===i||(e.data=i);else{if(a=a&&ie.call(e.childNodes),m=n.props||ae,!l&&a!=null)for(m={},_=0;_<e.attributes.length;_++)m[(f=e.attributes[_]).name]=f.value;for(_ in m)if(f=m[_],_!="children"){if(_=="dangerouslySetInnerHTML")d=f;else if(!(_ in i)){if(_=="value"&&"defaultValue"in i||_=="checked"&&"defaultChecked"in i)continue;ge(e,_,null,f,o)}}for(_ in i)f=i[_],_=="children"?w=f:_=="dangerouslySetInnerHTML"?v=f:_=="value"?b=f:_=="checked"?p=f:l&&typeof f!="function"||m[_]===f||ge(e,_,f,m[_],o);if(v)l||d&&(v.__html===d.__html||v.__html===e.innerHTML)||(e.innerHTML=v.__html),t.__k=[];else if(d&&(e.innerHTML=""),Kt(e,we(w)?w:[w],t,n,r,h=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:n.__k&&te(n,0),l,c),a!=null)for(_=a.length;_--;)We(a[_]);l||(_="value",h=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[_]||h=="progress"&&!b||h=="option"&&b!==m[_])&&ge(e,_,b,m[_],o),_="checked",p!==void 0&&p!==e[_]&&ge(e,_,p,m[_],o))}return e}function Je(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){I.__e(o,n)}}function Qt(e,t,n){var r,o;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Je(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){I.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Qt(r[o],t,n||typeof e.type!="function");n||We(e.__e),e.__c=e.__=e.__e=void 0}function Xr(e,t,n){return this.constructor(e,n)}function ve(e,t,n){var r,o,a,s;t==document&&(t=document.documentElement),I.__&&I.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],s=[],qe(t,e=(!r&&n||t).__k=z(Q,null,[e]),o||ae,ae,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ie.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,s),Zt(a,e,s)}function en(e,t){ve(e,t,en)}function tn(e,t,n){var r,o,a,s,l=j({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?o=t[a]:l[a]=t[a]===void 0&&s!==void 0?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?ie.call(arguments,2):n),se(e.type,l,r||e.key,o||e.ref,null)}ie=Wt.slice,I={__e:function(e,t,n,r){for(var o,a,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},zt=0,V.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},n),this.props)),e&&j(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Jt(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jt(this))},V.prototype.render=Q,Z=[],jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ze=function(e,t){return e.__v.__b-t.__v.__b},me.__r=0,Vt=/(PointerCapture)$|Capture$/i,De=0,je=Yt(!1),Ve=Yt(!0);function Ke(){return(Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yr=["context","children"];function Zr(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,s,l={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(a=c[s])>=0||(l[a]=r[a]);return l}(e,Yr);return tn(t,n)}function Qr(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=z(Zr,Ke({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},s=0,l=n.attributes,c=n.childNodes;for(s=l.length;s--;)l[s].name!=="slot"&&(a[l[s].name]=l[s].value,a[nn(l[s].name)]=l[s].value);for(s=c.length;s--;){var _=t(c[s],null),v=c[s].slot;v?a[v]=z(rn,{name:v},_):o[s]=_}var d=r?z(rn,null,o):o;return z(r||n.nodeName.toLowerCase(),a,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?en:ve)(this._vdom,this._root)}function nn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function eo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[nn(e)]=n,this._vdom=tn(this._vdom,r),ve(this._vdom,this._root)}}function to(){ve(this._vdom=null,this._root)}function rn(e,t){var n=this;return z("slot",Ke({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function on(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Qr,o.prototype.attributeChangedCallback=eo,o.prototype.disconnectedCallback=to,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(s){this._vdom?this.attributeChangedCallback(a,null,s):(this._props||(this._props={}),this._props[a]=s,this.connectedCallback());var l=typeof s;s!=null&&l!=="string"&&l!=="boolean"&&l!=="number"||this.setAttribute(a,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}var no=0;function O(e,t,n,r,o,a){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var _={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--no,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return I.vnode&&I.vnode(_),_}var ro={createLink(){return{handlerTypeDenominator:he(Ie.referral),interactionData:it.referral.createLink}},referred({referrer:e}){const t=Cr([it.referral.referred,Y(e,{size:32})]);return{handlerTypeDenominator:he(Ie.referral),interactionData:t}}};function oo(e,t){return e.request({method:"frak_listenToWalletStatus"}).then(n=>(io(n.interactionToken),n))}function io(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function ao({domain:e}){const t=e??window.location.host;return Et(he(t))}async function so(e,{productId:t,interaction:n,validation:r}){const o=t??ao(e.config);return await e.request({method:"frak_sendInteraction",params:[o,n,r]})}async function an(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,n]})}async function sn(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata.name]})}async function co(e){return await e.request({method:"frak_getProductInformation"})}function uo(e,{metadata:t,login:n,openSession:r}){return xe(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}function xe(e,t){function n(s){return xe(e,{...t,steps:{...t.steps,sendTransaction:s}})}function r(s){return xe(e,{...t,steps:{...t.steps,final:{...s,action:{key:"reward"}}}})}function o(s,l){return xe(e,{...t,steps:{...t.steps,final:{...l,action:{key:"sharing",options:s}}}})}async function a(s){return s&&(t.metadata=s(t.metadata??{})),await an(e,t)}return{params:t,sendTx:n,reward:r,sharing:o,display:a}}async function lo(e,{walletStatus:t,frakContext:n,modalConfig:r,productId:o,options:a}){let s=!1;async function l(){if(!s)return s=!0,ho(e,{modalConfig:r,walletStatus:t})}async function c(_){const v=ro.referred({referrer:_});await so(e,{productId:o,interaction:v})}try{const{status:_,currentWallet:v}=await fo({initialWalletStatus:t,getFreshWalletStatus:l,pushReferralInteraction:c,frakContext:n});return Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:v}:null}),_}catch(_){return console.log("Error processing referral",{error:_}),Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),_o(_)}}async function fo({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let o=e?.wallet;return r?.r?(o||(o=await t()),o&&Ar(r.r,o)?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await n(r.r),{status:"success",currentWallet:o})):{status:"no-referrer",currentWallet:o}}async function ho(e,{modalConfig:t,walletStatus:n}){return n?.interactionSession?n.wallet??void 0:t?(await an(e,t))?.login?.wallet??void 0:void 0}function _o(e){if(e instanceof M)switch(e.code){case N.walletNotConnected:return"no-wallet";case N.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function po(e,{productId:t,modalConfig:n,options:r}={}){const o=Le.parse({url:window.location.href}),a=await oo(e);try{return await lo(e,{walletStatus:a,frakContext:o,modalConfig:n,productId:t,options:r})}catch(s){console.warn("Error processing referral",{error:s})}}function cn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cn(e))&&(r&&(r+=" "),r+=t);return r}const un=yo;var ce,B,Ge,ln,ue=0,fn=[],H=I,dn=H.__b,hn=H.__r,_n=H.diffed,pn=H.__c,yn=H.unmount,wn=H.__;function Xe(e,t){H.__h&&H.__h(B,e,ue||t),ue=0;var n=B.__H||(B.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function J(e){return ue=1,wo(gn,e)}function wo(e,t,n){var r=Xe(ce++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gn(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],_=r.t(c,l);c!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.u)){var o=function(l,c,_){if(!r.__c.__H)return!0;var v=r.__c.__H.__.filter(function(w){return!!w.__c});if(v.every(function(w){return!w.__N}))return!a||a.call(this,l,c,_);var d=r.__c.props!==l;return v.forEach(function(w){if(w.__N){var f=w.__[0];w.__=w.__N,w.__N=void 0,f!==w.__[0]&&(d=!0)}}),a&&a.call(this,l,c,_)||d};B.u=!0;var a=B.shouldComponentUpdate,s=B.componentWillUpdate;B.componentWillUpdate=function(l,c,_){if(this.__e){var v=a;a=void 0,o(l,c,_),a=v}s&&s.call(this,l,c,_)},B.shouldComponentUpdate=o}return r.__N||r.__}function Ye(e,t){var n=Xe(ce++,3);!H.__s&&bn(n.__H,t)&&(n.__=e,n.i=t,B.__H.__h.push(n))}function mo(e){return ue=5,ne(function(){return{current:e}},[])}function ne(e,t){var n=Xe(ce++,7);return bn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Fe(e,t){return ue=8,ne(function(){return e},t)}function bo(){for(var e;e=fn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ke),e.__H.__h.forEach(Ze),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){B=null,dn&&dn(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),wn&&wn(e,t)},H.__r=function(e){hn&&hn(e),ce=0;var t=(B=e.__c).__H;t&&(Ge===B?(t.__h=[],B.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(ke),t.__h.forEach(Ze),t.__h=[],ce=0)),Ge=B},H.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fn.push(t)!==1&&ln===H.requestAnimationFrame||((ln=H.requestAnimationFrame)||go)(bo)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Ge=B=null},H.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ke),n.__h=n.__h.filter(function(r){return!r.__||Ze(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],H.__e(r,n.__v)}}),pn&&pn(e,t)},H.unmount=function(e){yn&&yn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ke(r)}catch(o){t=o}}),n.__H=void 0,t&&H.__e(t,n.__v))};var mn=typeof requestAnimationFrame=="function";function go(e){var t,n=function(){clearTimeout(r),mn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);mn&&(t=requestAnimationFrame(n))}function ke(e){var t=B,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),B=t}function Ze(e){var t=B;e.__c=e.__(),B=t}function bn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gn(e,t){return typeof t=="function"?t(e):t}const W={spinner:"_spinner_1gez9_1",spinner__leaf:"_spinner__leaf_1gez9_10"},vn=({ref:e,className:t,...n})=>O("span",{...n,ref:e,className:un(W.spinner),children:[O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf})]});vn.displayName="Spinner";function vo(e={}){const{successDuration:t=2e3}=e,[n,r]=J(!1);return{copy:Fe(async a=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a),r(!0);else{const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),r(!0)}catch(l){return console.error("Failed to copy text:",l),!1}finally{s.remove()}}return setTimeout(()=>{r(!1)},t),!0}catch(s){return console.error("Failed to copy text:",s),!1}},[t]),copied:n}}const xn="frakClientReady";let Se;function xo(){const e=new CustomEvent(xn);window.dispatchEvent(e)}function Ee(e,t){if(window.FrakSetup?.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(xn,t,!1)}function Fo(e){Se=uo(e,window.FrakSetup?.modalConfig??{})}async function ko(e){if(!Se){console.error("modalBuilderSteps not found");return}const t=await po(e,{modalConfig:Se.reward().params});console.log("referral",t)}function So(){return Se}function Eo(){"vibrate"in navigator?navigator.vibrate(200):console.log("Vibration not supported")}async function Fn(e){const t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}const n=await co(t);if(!n?.estimatedEurReward)return;let r=n.estimatedEurReward;if(e){const o=n.rewards.filter(a=>a.interactionTypeKey===e).map(a=>a.referrer.eurAmount).reduce((a,s)=>s>a?s:a,0);o>0&&(r=Math.ceil(o).toString())}return r}const Co={buttonShare:"_buttonShare_i4e8j_1"};async function Ao(e){const t=So();if(!t)throw new Error("modalBuilderSteps not found");await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(n=>({...n,targetInteraction:e}))}async function Io(){if(!window.FrakSetup?.client)throw new Error("Frak client not found");await sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Po({text:e="Share and earn!",classname:t="",useReward:n,noRewardText:r,targetInteraction:o,showWallet:a}){const s=ne(()=>n!==void 0,[n]),l=ne(()=>a!==void 0,[a]),[c,_]=J(void 0),[v,d]=J(void 0),[w,f]=J(!1),[b,p]=J(!1),m=Fe(()=>{p(!0),s&&Fn(o).then(g=>{g&&d(`${g}€`)})},[s,o]);Ye(()=>(Ee("add",m),()=>Ee("remove",m)),[m]);const i=ne(()=>s?v?e.includes("{REWARD}")?e.replace("{REWARD}",v):`${e} ${v}`:r??e.replace("{REWARD}",""):e,[s,e,r,v]),h=Fe(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),_(Lt.empty().formatDebugInfo("Frak client not found")),f(!0);return}try{l?await Io():await Ao(o)}catch(g){if(g instanceof M&&g.code===N.clientAborted){console.debug("User aborted the modal");return}const C=window.FrakSetup.client.debugInfo.formatDebugInfo(g);_(C),f(!0),console.error("Error while opening the modal",g);return}},[l,o]);return O(Q,{children:[O("button",{type:"button",className:un(Co.buttonShare,t),onClick:h,children:[!b&&O(vn,{})," ",i]}),w&&O($o,{debugInfo:c})]})}const ee={errorContainer:{marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},header:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},title:{margin:0,fontSize:"16px",fontWeight:500},message:{fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},link:{color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},copyButton:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500}};function $o({debugInfo:e}){const{copied:t,copy:n}=vo();return O("div",{style:ee.errorContainer,children:[O("div",{style:ee.header,children:O("h3",{style:ee.title,children:"Oups ! Nous avons rencontré un petit problème"})}),O("p",{style:ee.message,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le problème persiste, copiez les informations ci-dessous et collez-les dans votre mail à"," ",O("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:ee.link,children:"help@frak-labs.com"})," ",O("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs délais."]}),O("button",{type:"button",onClick:()=>n(e??""),style:ee.copyButton,children:t?"Informations copiées !":"Copier les informations de débogage"}),O(To,{debugInfo:e})]})}function To({debugInfo:e}){const[t,n]=J(!1);return O("div",{children:[O("button",{type:"button",style:ee.copyButton,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&O("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function Oo(){customElements.get("frak-button-share")||on(Po,"frak-button-share",["text"],{shadow:!1})}function Ro(e,t){for(var n in t)e[n]=t[n];return e}function kn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Sn(e,t){this.props=e,this.context=t}(Sn.prototype=new V).isPureReactComponent=!0,Sn.prototype.shouldComponentUpdate=function(e,t){return kn(this.props,e)||kn(this.state,t)};var En=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),En&&En(e)};var Bo=I.__e;I.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Bo(e,t,n,r)};var Cn=I.unmount;function An(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ro({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return An(r,t,n)})),e}function In(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return In(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qe(){this.__u=0,this.o=null,this.__b=null}function Pn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ce(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Cn&&Cn(e)},(Qe.prototype=new V).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Pn(r.__v),a=!1,s=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=s;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=In(c,c.__c.__P,c.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=An(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(Q,null,e.fallback);return o&&(o.__u&=-33),[z(Q,null,t.__a?null:e.children),o]};var $n=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ce.prototype=new V).__a=function(e){var t=this,n=Pn(t.__v),r=t.l.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),$n(t,e,r)):o()};n?n(a):a()}},Ce.prototype.render=function(e){this.i=null,this.l=new Map;var t=be(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ce.prototype.componentDidUpdate=Ce.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){$n(e,n,t)})};var Ho=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Mo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,No=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Uo=/[A-Z0-9]/g,Lo=typeof document<"u",zo=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Tn=I.event;function Do(){}function jo(){return this.cancelBubble}function Vo(){return this.defaultPrevented}I.event=function(e){return Tn&&(e=Tn(e)),e.persist=Do,e.isPropagationStopped=jo,e.isDefaultPrevented=Vo,e.nativeEvent=e};var Wo={enumerable:!1,configurable:!0,get:function(){return this.class}},On=I.vnode;I.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},a=r.indexOf("-")===-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||Lo&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||zo(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":No.test(s)&&(s=c):c=s="oninput":a&&Mo.test(s)?s=s.replace(Uo,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.value.indexOf(_.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.multiple?o.defaultValue.indexOf(_.props.value)!=-1:o.defaultValue==_.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Wo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ho,On&&On(e)};var Rn=I.__r;I.__r=function(e){Rn&&Rn(e),e.__c};var Bn=I.diffed;I.diffed=function(e){Bn&&Bn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};const qo=e=>z("svg",{fill:"none",height:24,viewBox:"0 0 28 28",width:24,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"m23.1427 13.9999v11.4285h-18.2857v-11.4285m9.1429 11.4285v-17.14282m0 0h-5.1429c-.75776 0-1.48448-.30102-2.0203-.83684s-.83684-1.26255-.83684-2.02031.30102-1.48448.83684-2.0203 1.26254-.83684 2.0203-.83684c4 0 5.1429 5.71429 5.1429 5.71429zm0 0h5.1428c.7578 0 1.4845-.30102 2.0203-.83684s.8369-1.26255.8369-2.02031-.3011-1.48448-.8369-2.0203-1.2625-.83684-2.0203-.83684c-4 0-5.1428 5.71429-5.1428 5.71429zm-11.42861 0h22.85711v5.71432h-22.85711z",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round"}));function Jo(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}Eo(),sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Ko({classname:e="",useReward:t,targetInteraction:n}){const r=ne(()=>t!==void 0,[t]),[o,a]=J(!0),[s,l]=J(void 0),c=mo(null),_=Fe(()=>{a(!1),r&&Fn(n).then(v=>{v&&l(`${v}€`)})},[r,n]);return Ye(()=>(Ee("add",_),()=>Ee("remove",_)),[_]),Ye(()=>{const v=window.FrakSetup.modalWalletConfig?.metadata?.position;c.current?.parentElement?.classList.add(v??"right")},[]),O("button",{ref:c,type:"button",class:e,disabled:o,onClick:Jo,children:[O(qo,{}),s&&O("span",{children:s})]})}function Go(){customElements.get("frak-button-wallet")||on(Ko,"frak-button-wallet",[],{shadow:!1})}Oo(),Go(),Wr(async function(){if(!window.FrakSetup?.config){console.error("window.FrakSetup.config not found");return}const t=await Vr({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,xo(),Fo(t),ko(t)})});
|
|
21
|
+
`.trim()}};function Nr(){const e=new Map;return{createChannel:t=>{const n=Math.random().toString(36).substring(7);return e.set(n,t),n},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}function Ur({iframe:e}){const t=new $t;return{handleEvent:async r=>{switch(r.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":r.data.backup?localStorage.setItem(ye,r.data.backup):localStorage.removeItem(ye);break;case"remove-backup":localStorage.removeItem(ye);break;case"show":case"hide":Rt({iframe:e,isVisible:r.iframeLifecycle==="show"});break;case"handshake":{e.contentWindow?.postMessage({clientLifecycle:"handshake-response",data:{token:r.data.token,currentUrl:window.location.href}},"*");break}}},isConnected:t.promise}}function Lr({frakWalletUrl:e,iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}){if(typeof window>"u")throw new M(N.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new M(N.configError,"The iframe does not have a product window");const a=t.contentWindow;async function s(_){if(!_.origin)return;try{if(new URL(_.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return}catch(w){console.log("Unable to check frak msg origin",w);return}if(typeof _.data!="object")return;if(o.setLastResponse(_),"iframeLifecycle"in _.data){await r.handleEvent(_.data);return}if("clientLifecycle"in _.data){console.error("Client lifecycle event received on the client side, dismissing it");return}const v=_.data.id,d=n.getRpcResolver(v);d&&await d(_.data)}window.addEventListener("message",s);function l(_){a.postMessage(_,{targetOrigin:e}),o.setLastRequest(_,e)}function c(){window.removeEventListener("message",s)}return{sendEvent:l,cleanup:c}}function zr({config:e,iframe:t}){const n=Nr(),r=Ur({iframe:t}),o=new Lt(e,t),a=Lr({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:n,iframeLifecycleManager:r,debugInfo:o}),s=async d=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const f=new $t,b=n.createChannel(async m=>{const i=await Ot(m.data);i.error?f.reject(new M(i.error.code,i.error.message,i.error?.data)):f.resolve(i.result),n.removeChannel(b)}),p=await Tt(d);return a.sendEvent({id:b,topic:d.method,data:p}),f.promise},l=async(d,w)=>{if(!await r.isConnected)throw new M(N.clientNotConnected,"The iframe provider isn't connected yet");const b=n.createChannel(async m=>{const i=await Ot(m.data);if(i.result)w(i.result);else throw new Ir("No valid result in the response")}),p=await Tt(d);a.sendEvent({id:b,topic:d.method,data:p})},c=Dr(a,r),_=async()=>{c(),n.destroy(),a.cleanup(),t.remove()},v=jr({config:e,messageHandler:a,lifecycleManager:r}).then(()=>o.updateSetupStatus(!0));return{config:e,debugInfo:o,waitForConnection:r.isConnected,waitForSetup:v,request:s,listenerRequest:l,destroy:_}}function Dr(e,t){let o,a;const s=()=>e.sendEvent({clientLifecycle:"heartbeat"});async function l(){s(),o=setInterval(s,100),a=setTimeout(()=>{c(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,c()}function c(){o&&clearInterval(o),a&&clearTimeout(a)}return l(),c}async function jr({config:e,messageHandler:t,lifecycleManager:n}){await n.isConnected;const r=async()=>{const a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},o=async()=>{if(typeof window>"u")return;const a=window.localStorage.getItem(ye);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([r(),o()])}async function Vr({config:e}){const t=await Rr({config:e});if(!t){console.error("Failed to create iframe");return}const n=zr({config:e,iframe:t});if(await n.waitForSetup,!await n.waitForConnection){console.error("Failed to connect to client");return}return n}function Wr(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}var ie,I,zt,Z,Dt,jt,ze,Vt,De,je,Ve,ae={},Wt=[],qr=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,we=Array.isArray;function j(e,t){for(var n in t)e[n]=t[n];return e}function We(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function z(e,t,n){var r,o,a,s={};for(a in t)a=="key"?r=t[a]:a=="ref"?o=t[a]:s[a]=t[a];if(arguments.length>2&&(s.children=arguments.length>3?ie.call(arguments,2):n),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)s[a]===void 0&&(s[a]=e.defaultProps[a]);return se(e,s,r,o,null)}function se(e,t,n,r,o){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++zt,__i:-1,__u:0};return o==null&&I.vnode!=null&&I.vnode(a),a}function Q(e){return e.children}function V(e,t){this.props=e,this.context=t}function te(e,t){if(t==null)return e.__?te(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type=="function"?te(e):null}function qt(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=e.__c.base=n.__e;break}return qt(e)}}function Jt(e){(!e.__d&&(e.__d=!0)&&Z.push(e)&&!me.__r++||Dt!==I.debounceRendering)&&((Dt=I.debounceRendering)||jt)(me)}function me(){var e,t,n,r,o,a,s,l;for(Z.sort(ze);e=Z.shift();)e.__d&&(t=Z.length,r=void 0,a=(o=(n=e).__v).__e,s=[],l=[],n.__P&&((r=j({},o)).__v=o.__v+1,I.vnode&&I.vnode(r),qe(n.__P,r,o,n.__n,n.__P.namespaceURI,32&o.__u?[a]:null,s,a??te(o),!!(32&o.__u),l),r.__v=o.__v,r.__.__k[r.__i]=r,Zt(s,r,l),r.__e!=a&&qt(r)),Z.length>t&&Z.sort(ze));me.__r=0}function Kt(e,t,n,r,o,a,s,l,c,_,v){var d,w,f,b,p,m,i=r&&r.__k||Wt,h=t.length;for(c=Jr(n,t,i,c,h),d=0;d<h;d++)(f=n.__k[d])!=null&&(w=f.__i===-1?ae:i[f.__i]||ae,f.__i=d,m=qe(e,f,w,o,a,s,l,c,_,v),b=f.__e,f.ref&&w.ref!=f.ref&&(w.ref&&Je(w.ref,null,f),v.push(f.ref,f.__c||b,f)),p==null&&b!=null&&(p=b),4&f.__u||w.__k===f.__k?c=Gt(f,c,e):typeof f.type=="function"&&m!==void 0?c=m:b&&(c=b.nextSibling),f.__u&=-7);return n.__e=p,c}function Jr(e,t,n,r,o){var a,s,l,c,_,v=n.length,d=v,w=0;for(e.__k=new Array(o),a=0;a<o;a++)(s=t[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(c=a+w,(s=e.__k[a]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?se(null,s,null,null,null):we(s)?se(Q,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?se(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,l=null,(_=s.__i=Kr(s,n,c,d))!==-1&&(d--,(l=n[_])&&(l.__u|=2)),l==null||l.__v===null?(_==-1&&w--,typeof s.type!="function"&&(s.__u|=4)):_!=c&&(_==c-1?w--:_==c+1?w++:(_>c?w--:w++,s.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<v;a++)(l=n[a])!=null&&!(2&l.__u)&&(l.__e==r&&(r=te(l)),Qt(l,l));return r}function Gt(e,t,n){var r,o;if(typeof e.type=="function"){for(r=e.__k,o=0;r&&o<r.length;o++)r[o]&&(r[o].__=e,t=Gt(r[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=te(e)),n.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function be(e,t){return t=t||[],e==null||typeof e=="boolean"||(we(e)?e.some(function(n){be(n,t)}):t.push(e)),t}function Kr(e,t,n,r){var o,a,s=e.key,l=e.type,c=t[n];if(c===null||c&&s==c.key&&l===c.type&&!(2&c.__u))return n;if(r>(c!=null&&!(2&c.__u)?1:0))for(o=n-1,a=n+1;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&s==c.key&&l===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(2&c.__u)&&s==c.key&&l===c.type)return a;a++}}return-1}function Xt(e,t,n){t[0]=="-"?e.setProperty(t,n??""):e[t]=n==null?"":typeof n!="number"||qr.test(t)?n:n+"px"}function ge(e,t,n,r,o){var a;e:if(t=="style")if(typeof n=="string")e.style.cssText=n;else{if(typeof r=="string"&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Xt(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Xt(e.style,t,n[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(Vt,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=n,n?r?n.u=r.u:(n.u=De,e.addEventListener(t,a?Ve:je,a)):e.removeEventListener(t,a?Ve:je,a);else{if(o=="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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&n==1?"":n))}}function Yt(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t.t==null)t.t=De++;else if(t.t<n.u)return;return n(I.event?I.event(t):t)}}}function qe(e,t,n,r,o,a,s,l,c,_){var v,d,w,f,b,p,m,i,h,g,C,k,u,S,E,y,A,x=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(c=!!(32&n.__u),a=[l=t.__e=n.__e]),(v=I.__b)&&v(t);e:if(typeof x=="function")try{if(i=t.props,h="prototype"in x&&x.prototype.render,g=(v=x.contextType)&&r[v.__c],C=v?g?g.props.value:v.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(h?t.__c=d=new x(i,C):(t.__c=d=new V(i,C),d.constructor=x,d.render=Xr),g&&g.sub(d),d.props=i,d.state||(d.state={}),d.context=C,d.__n=r,w=d.__d=!0,d.__h=[],d._sb=[]),h&&d.__s==null&&(d.__s=d.state),h&&x.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=j({},d.__s)),j(d.__s,x.getDerivedStateFromProps(i,d.__s))),f=d.props,b=d.state,d.__v=t,w)h&&x.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),h&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(h&&x.getDerivedStateFromProps==null&&i!==f&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(i,C),!d.__e&&(d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(i,d.__s,C)===!1||t.__v==n.__v)){for(t.__v!=n.__v&&(d.props=i,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(P){P&&(P.__=t)}),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(i,d.__s,C),h&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(f,b,p)})}if(d.context=C,d.props=i,d.__P=e,d.__e=!1,u=I.__r,S=0,h){for(d.state=d.__s,d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,u&&u(t),v=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++S<25);d.state=d.__s,d.getChildContext!=null&&(r=j(j({},r),d.getChildContext())),h&&!w&&d.getSnapshotBeforeUpdate!=null&&(p=d.getSnapshotBeforeUpdate(f,b)),l=Kt(e,we(y=v!=null&&v.type===Q&&v.key==null?v.props.children:v)?y:[y],t,n,r,o,a,s,l,c,_),d.base=t.__e,t.__u&=-161,d.__h.length&&s.push(d),m&&(d.__E=d.__=null)}catch(P){if(t.__v=null,c||a!=null)if(P.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;a[a.indexOf(l)]=null,t.__e=l}else for(A=a.length;A--;)We(a[A]);else t.__e=n.__e,t.__k=n.__k;I.__e(P,t,n)}else a==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=Gr(n.__e,t,n,r,o,a,s,c,_);return(v=I.diffed)&&v(t),128&t.__u?void 0:l}function Zt(e,t,n){for(var r=0;r<n.length;r++)Je(n[r],n[++r],n[++r]);I.__c&&I.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(a){a.call(o)})}catch(a){I.__e(a,o.__v)}})}function Gr(e,t,n,r,o,a,s,l,c){var _,v,d,w,f,b,p,m=n.props,i=t.props,h=t.type;if(h=="svg"?o="http://www.w3.org/2000/svg":h=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),a!=null){for(_=0;_<a.length;_++)if((f=a[_])&&"setAttribute"in f==!!h&&(h?f.localName==h:f.nodeType==3)){e=f,a[_]=null;break}}if(e==null){if(h==null)return document.createTextNode(i);e=document.createElementNS(o,h,i.is&&i),l&&(I.__m&&I.__m(t,a),l=!1),a=null}if(h===null)m===i||l&&e.data===i||(e.data=i);else{if(a=a&&ie.call(e.childNodes),m=n.props||ae,!l&&a!=null)for(m={},_=0;_<e.attributes.length;_++)m[(f=e.attributes[_]).name]=f.value;for(_ in m)if(f=m[_],_!="children"){if(_=="dangerouslySetInnerHTML")d=f;else if(!(_ in i)){if(_=="value"&&"defaultValue"in i||_=="checked"&&"defaultChecked"in i)continue;ge(e,_,null,f,o)}}for(_ in i)f=i[_],_=="children"?w=f:_=="dangerouslySetInnerHTML"?v=f:_=="value"?b=f:_=="checked"?p=f:l&&typeof f!="function"||m[_]===f||ge(e,_,f,m[_],o);if(v)l||d&&(v.__html===d.__html||v.__html===e.innerHTML)||(e.innerHTML=v.__html),t.__k=[];else if(d&&(e.innerHTML=""),Kt(e,we(w)?w:[w],t,n,r,h=="foreignObject"?"http://www.w3.org/1999/xhtml":o,a,s,a?a[0]:n.__k&&te(n,0),l,c),a!=null)for(_=a.length;_--;)We(a[_]);l||(_="value",h=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[_]||h=="progress"&&!b||h=="option"&&b!==m[_])&&ge(e,_,b,m[_],o),_="checked",p!==void 0&&p!==e[_]&&ge(e,_,p,m[_],o))}return e}function Je(e,t,n){try{if(typeof e=="function"){var r=typeof e.__u=="function";r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(o){I.__e(o,n)}}function Qt(e,t,n){var r,o;if(I.unmount&&I.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Je(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(a){I.__e(a,t)}r.base=r.__P=null}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&Qt(r[o],t,n||typeof e.type!="function");n||We(e.__e),e.__c=e.__=e.__e=void 0}function Xr(e,t,n){return this.constructor(e,n)}function ve(e,t,n){var r,o,a,s;t==document&&(t=document.documentElement),I.__&&I.__(e,t),o=(r=typeof n=="function")?null:n&&n.__k||t.__k,a=[],s=[],qe(t,e=(!r&&n||t).__k=z(Q,null,[e]),o||ae,ae,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?ie.call(t.childNodes):null,a,!r&&n?n:o?o.__e:t.firstChild,r,s),Zt(a,e,s)}function en(e,t){ve(e,t,en)}function tn(e,t,n){var r,o,a,s,l=j({},e.props);for(a in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)a=="key"?r=t[a]:a=="ref"?o=t[a]:l[a]=t[a]===void 0&&s!==void 0?s[a]:t[a];return arguments.length>2&&(l.children=arguments.length>3?ie.call(arguments,2):n),se(e.type,l,r||e.key,o||e.ref,null)}ie=Wt.slice,I={__e:function(e,t,n,r){for(var o,a,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((a=o.constructor)&&a.getDerivedStateFromError!=null&&(o.setState(a.getDerivedStateFromError(e)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,r||{}),s=o.__d),s)return o.__E=o}catch(l){e=l}throw e}},zt=0,V.prototype.setState=function(e,t){var n;n=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},n),this.props)),e&&j(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),Jt(this))},V.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Jt(this))},V.prototype.render=Q,Z=[],jt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ze=function(e,t){return e.__v.__b-t.__v.__b},me.__r=0,Vt=/(PointerCapture)$|Capture$/i,De=0,je=Yt(!1),Ve=Yt(!0);function Ke(){return(Ke=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}var Yr=["context","children"];function Zr(e){this.getChildContext=function(){return e.context};var t=e.children,n=function(r,o){if(r==null)return{};var a,s,l={},c=Object.keys(r);for(s=0;s<c.length;s++)o.indexOf(a=c[s])>=0||(l[a]=r[a]);return l}(e,Yr);return tn(t,n)}function Qr(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=z(Zr,Ke({},this._props,{context:e.detail.context}),function t(n,r){if(n.nodeType===3)return n.data;if(n.nodeType!==1)return null;var o=[],a={},s=0,l=n.attributes,c=n.childNodes;for(s=l.length;s--;)l[s].name!=="slot"&&(a[l[s].name]=l[s].value,a[nn(l[s].name)]=l[s].value);for(s=c.length;s--;){var _=t(c[s],null),v=c[s].slot;v?a[v]=z(rn,{name:v},_):o[s]=_}var d=r?z(rn,null,o):o;return z(r||n.nodeName.toLowerCase(),a,d)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?en:ve)(this._vdom,this._root)}function nn(e){return e.replace(/-(\w)/g,function(t,n){return n?n.toUpperCase():""})}function eo(e,t,n){if(this._vdom){var r={};r[e]=n=n??void 0,r[nn(e)]=n,this._vdom=tn(this._vdom,r),ve(this._vdom,this._root)}}function to(){ve(this._vdom=null,this._root)}function rn(e,t){var n=this;return z("slot",Ke({},e,{ref:function(r){r?(n.ref=r,n._listener||(n._listener=function(o){o.stopPropagation(),o.detail.context=t},r.addEventListener("_preact",n._listener))):n.ref.removeEventListener("_preact",n._listener)}}))}function on(e,t,n,r){function o(){var a=Reflect.construct(HTMLElement,[],o);return a._vdomComponent=e,a._root=r&&r.shadow?a.attachShadow({mode:r.mode||"open"}):a,a}return(o.prototype=Object.create(HTMLElement.prototype)).constructor=o,o.prototype.connectedCallback=Qr,o.prototype.attributeChangedCallback=eo,o.prototype.disconnectedCallback=to,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),o.observedAttributes=n,n.forEach(function(a){Object.defineProperty(o.prototype,a,{get:function(){return this._vdom.props[a]},set:function(s){this._vdom?this.attributeChangedCallback(a,null,s):(this._props||(this._props={}),this._props[a]=s,this.connectedCallback());var l=typeof s;s!=null&&l!=="string"&&l!=="boolean"&&l!=="number"||this.setAttribute(a,s)}})}),customElements.define(t||e.tagName||e.displayName||e.name,o)}var no=0;function O(e,t,n,r,o,a){t||(t={});var s,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?s=t[l]:c[l]=t[l];var _={type:e,props:c,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--no,__i:-1,__u:0,__source:o,__self:a};if(typeof e=="function"&&(s=e.defaultProps))for(l in s)c[l]===void 0&&(c[l]=s[l]);return I.vnode&&I.vnode(_),_}var ro={createLink(){return{handlerTypeDenominator:he(Ie.referral),interactionData:it.referral.createLink}},referred({referrer:e}){const t=Cr([it.referral.referred,Y(e,{size:32})]);return{handlerTypeDenominator:he(Ie.referral),interactionData:t}}};function oo(e,t){return e.request({method:"frak_listenToWalletStatus"}).then(n=>(io(n.interactionToken),n))}function io(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function ao({domain:e}){const t=e??window.location.host;return Et(he(t))}async function so(e,{productId:t,interaction:n,validation:r}){const o=t??ao(e.config);return await e.request({method:"frak_sendInteraction",params:[o,n,r]})}async function an(e,{steps:t,metadata:n}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,n]})}async function sn(e,t){await e.request({method:"frak_displayEmbededWallet",params:[t,e.config.metadata.name]})}async function co(e){return await e.request({method:"frak_getProductInformation"})}function uo(e,{metadata:t,login:n,openSession:r}){return xe(e,{steps:{login:n??{},openSession:r??{}},metadata:t})}function xe(e,t){function n(s){return xe(e,{...t,steps:{...t.steps,sendTransaction:s}})}function r(s){return xe(e,{...t,steps:{...t.steps,final:{...s,action:{key:"reward"}}}})}function o(s,l){return xe(e,{...t,steps:{...t.steps,final:{...l,action:{key:"sharing",options:s}}}})}async function a(s){return s&&(t.metadata=s(t.metadata??{})),await an(e,t)}return{params:t,sendTx:n,reward:r,sharing:o,display:a}}async function lo(e,{walletStatus:t,frakContext:n,modalConfig:r,productId:o,options:a}){let s=!1;async function l(){if(!s)return s=!0,ho(e,{modalConfig:r,walletStatus:t})}async function c(_){const v=ro.referred({referrer:_});await so(e,{productId:o,interaction:v})}try{const{status:_,currentWallet:v}=await fo({initialWalletStatus:t,getFreshWalletStatus:l,pushReferralInteraction:c,frakContext:n});return Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:v}:null}),_}catch(_){return console.log("Error processing referral",{error:_}),Le.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),_o(_)}}async function fo({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:n,frakContext:r}){let o=e?.wallet;return r?.r?(o||(o=await t()),o&&Ar(r.r,o)?{status:"self-referral",currentWallet:o}:(e?.interactionSession||(o=await t()),await n(r.r),{status:"success",currentWallet:o})):{status:"no-referrer",currentWallet:o}}async function ho(e,{modalConfig:t,walletStatus:n}){return n?.interactionSession?n.wallet??void 0:t?(await an(e,t))?.login?.wallet??void 0:void 0}function _o(e){if(e instanceof M)switch(e.code){case N.walletNotConnected:return"no-wallet";case N.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function po(e,{productId:t,modalConfig:n,options:r}={}){const o=Le.parse({url:window.location.href}),a=await oo(e);try{return await lo(e,{walletStatus:a,frakContext:o,modalConfig:n,productId:t,options:r})}catch(s){console.warn("Error processing referral",{error:s})}}function cn(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=cn(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function yo(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=cn(e))&&(r&&(r+=" "),r+=t);return r}const un=yo;var ce,B,Ge,ln,ue=0,fn=[],H=I,dn=H.__b,hn=H.__r,_n=H.diffed,pn=H.__c,yn=H.unmount,wn=H.__;function Xe(e,t){H.__h&&H.__h(B,e,ue||t),ue=0;var n=B.__H||(B.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function J(e){return ue=1,wo(gn,e)}function wo(e,t,n){var r=Xe(ce++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gn(void 0,t),function(l){var c=r.__N?r.__N[0]:r.__[0],_=r.t(c,l);c!==_&&(r.__N=[_,r.__[1]],r.__c.setState({}))}],r.__c=B,!B.u)){var o=function(l,c,_){if(!r.__c.__H)return!0;var v=r.__c.__H.__.filter(function(w){return!!w.__c});if(v.every(function(w){return!w.__N}))return!a||a.call(this,l,c,_);var d=r.__c.props!==l;return v.forEach(function(w){if(w.__N){var f=w.__[0];w.__=w.__N,w.__N=void 0,f!==w.__[0]&&(d=!0)}}),a&&a.call(this,l,c,_)||d};B.u=!0;var a=B.shouldComponentUpdate,s=B.componentWillUpdate;B.componentWillUpdate=function(l,c,_){if(this.__e){var v=a;a=void 0,o(l,c,_),a=v}s&&s.call(this,l,c,_)},B.shouldComponentUpdate=o}return r.__N||r.__}function Ye(e,t){var n=Xe(ce++,3);!H.__s&&bn(n.__H,t)&&(n.__=e,n.i=t,B.__H.__h.push(n))}function mo(e){return ue=5,ne(function(){return{current:e}},[])}function ne(e,t){var n=Xe(ce++,7);return bn(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Fe(e,t){return ue=8,ne(function(){return e},t)}function bo(){for(var e;e=fn.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ke),e.__H.__h.forEach(Ze),e.__H.__h=[]}catch(t){e.__H.__h=[],H.__e(t,e.__v)}}H.__b=function(e){B=null,dn&&dn(e)},H.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),wn&&wn(e,t)},H.__r=function(e){hn&&hn(e),ce=0;var t=(B=e.__c).__H;t&&(Ge===B?(t.__h=[],B.__h=[],t.__.forEach(function(n){n.__N&&(n.__=n.__N),n.i=n.__N=void 0})):(t.__h.forEach(ke),t.__h.forEach(Ze),t.__h=[],ce=0)),Ge=B},H.diffed=function(e){_n&&_n(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fn.push(t)!==1&&ln===H.requestAnimationFrame||((ln=H.requestAnimationFrame)||go)(bo)),t.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.i=void 0})),Ge=B=null},H.__c=function(e,t){t.some(function(n){try{n.__h.forEach(ke),n.__h=n.__h.filter(function(r){return!r.__||Ze(r)})}catch(r){t.some(function(o){o.__h&&(o.__h=[])}),t=[],H.__e(r,n.__v)}}),pn&&pn(e,t)},H.unmount=function(e){yn&&yn(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{ke(r)}catch(o){t=o}}),n.__H=void 0,t&&H.__e(t,n.__v))};var mn=typeof requestAnimationFrame=="function";function go(e){var t,n=function(){clearTimeout(r),mn&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);mn&&(t=requestAnimationFrame(n))}function ke(e){var t=B,n=e.__c;typeof n=="function"&&(e.__c=void 0,n()),B=t}function Ze(e){var t=B;e.__c=e.__(),B=t}function bn(e,t){return!e||e.length!==t.length||t.some(function(n,r){return n!==e[r]})}function gn(e,t){return typeof t=="function"?t(e):t}const W={spinner:"_spinner_1gez9_1",spinner__leaf:"_spinner__leaf_1gez9_10"},vn=({ref:e,className:t,...n})=>O("span",{...n,ref:e,className:un(W.spinner),children:[O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf}),O("span",{className:W.spinner__leaf})]});vn.displayName="Spinner";function vo(e={}){const{successDuration:t=2e3}=e,[n,r]=J(!1);return{copy:Fe(async a=>{try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(a),r(!0);else{const s=document.createElement("textarea");s.value=a,s.style.position="fixed",s.style.opacity="0",document.body.appendChild(s),s.focus(),s.select();try{document.execCommand("copy"),r(!0)}catch(l){return console.error("Failed to copy text:",l),!1}finally{s.remove()}}return setTimeout(()=>{r(!1)},t),!0}catch(s){return console.error("Failed to copy text:",s),!1}},[t]),copied:n}}const xn="frakClientReady";let Se;function xo(){const e=new CustomEvent(xn);window.dispatchEvent(e)}function Ee(e,t){if(window.FrakSetup?.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(xn,t,!1)}function Fo(e){Se=uo(e,window.FrakSetup?.modalConfig??{})}async function ko(e){if(!Se){console.error("modalBuilderSteps not found");return}const t=await po(e,{modalConfig:Se.reward().params});console.log("referral",t)}function So(){return Se}function Eo(){"vibrate"in navigator?navigator.vibrate(10):console.log("Vibration not supported")}async function Fn(e){const t=window.FrakSetup?.client;if(!t){console.warn("Frak client not ready yet");return}const n=await co(t);if(!n?.estimatedEurReward)return;let r=n.estimatedEurReward;if(e){const o=n.rewards.filter(a=>a.interactionTypeKey===e).map(a=>a.referrer.eurAmount).reduce((a,s)=>s>a?s:a,0);o>0&&(r=Math.ceil(o).toString())}return r}const Co={buttonShare:"_buttonShare_i4e8j_1"};async function Ao(e){const t=So();if(!t)throw new Error("modalBuilderSteps not found");await t.sharing(window.FrakSetup?.modalShareConfig??{}).display(n=>({...n,targetInteraction:e}))}async function Io(){if(!window.FrakSetup?.client)throw new Error("Frak client not found");await sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Po({text:e="Share and earn!",classname:t="",useReward:n,noRewardText:r,targetInteraction:o,showWallet:a}){const s=ne(()=>n!==void 0,[n]),l=ne(()=>a!==void 0,[a]),[c,_]=J(void 0),[v,d]=J(void 0),[w,f]=J(!1),[b,p]=J(!1),m=Fe(()=>{p(!0),s&&Fn(o).then(g=>{g&&d(`${g}€`)})},[s,o]);Ye(()=>(Ee("add",m),()=>Ee("remove",m)),[m]);const i=ne(()=>s?v?e.includes("{REWARD}")?e.replace("{REWARD}",v):`${e} ${v}`:r??e.replace("{REWARD}",""):e,[s,e,r,v]),h=Fe(async()=>{if(!window.FrakSetup?.client){console.error("Frak client not found"),_(Lt.empty().formatDebugInfo("Frak client not found")),f(!0);return}try{l?await Io():await Ao(o)}catch(g){if(g instanceof M&&g.code===N.clientAborted){console.debug("User aborted the modal");return}const C=window.FrakSetup.client.debugInfo.formatDebugInfo(g);_(C),f(!0),console.error("Error while opening the modal",g);return}},[l,o]);return O(Q,{children:[O("button",{type:"button",className:un(Co.buttonShare,t),onClick:h,children:[!b&&O(vn,{})," ",i]}),w&&O($o,{debugInfo:c})]})}const ee={errorContainer:{marginTop:"16px",padding:"16px",backgroundColor:"#FEE2E2",border:"1px solid #FCA5A5",borderRadius:"4px",color:"#991B1B"},header:{display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},title:{margin:0,fontSize:"16px",fontWeight:500},message:{fontSize:"14px",lineHeight:"1.5",margin:"0 0 12px 0"},link:{color:"#991B1B",textDecoration:"underline",textUnderlineOffset:"2px"},copyButton:{display:"inline-flex",alignItems:"center",gap:"8px",marginBottom:"10px",padding:"8px 12px",backgroundColor:"white",border:"1px solid #D1D5DB",borderRadius:"4px",color:"black",fontSize:"14px",fontWeight:500}};function $o({debugInfo:e}){const{copied:t,copy:n}=vo();return O("div",{style:ee.errorContainer,children:[O("div",{style:ee.header,children:O("h3",{style:ee.title,children:"Oups ! Nous avons rencontré un petit problème"})}),O("p",{style:ee.message,children:["Impossible d'ouvrir le menu de partage pour le moment. Si le problème persiste, copiez les informations ci-dessous et collez-les dans votre mail à"," ",O("a",{href:"mailto:help@frak-labs.com?subject=Debug",style:ee.link,children:"help@frak-labs.com"})," ",O("br",{}),"Merci pour votre retour, nous traitons votre demande dans les plus brefs délais."]}),O("button",{type:"button",onClick:()=>n(e??""),style:ee.copyButton,children:t?"Informations copiées !":"Copier les informations de débogage"}),O(To,{debugInfo:e})]})}function To({debugInfo:e}){const[t,n]=J(!1);return O("div",{children:[O("button",{type:"button",style:ee.copyButton,onClick:()=>n(!t),children:"Ouvrir les informations"}),t&&O("textarea",{style:{display:"block",width:"100%",height:"200px",fontSize:"12px"},children:e})]})}function Oo(){customElements.get("frak-button-share")||on(Po,"frak-button-share",["text"],{shadow:!1})}function Ro(e,t){for(var n in t)e[n]=t[n];return e}function kn(e,t){for(var n in e)if(n!=="__source"&&!(n in t))return!0;for(var r in t)if(r!=="__source"&&e[r]!==t[r])return!0;return!1}function Sn(e,t){this.props=e,this.context=t}(Sn.prototype=new V).isPureReactComponent=!0,Sn.prototype.shouldComponentUpdate=function(e,t){return kn(this.props,e)||kn(this.state,t)};var En=I.__b;I.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),En&&En(e)};var Bo=I.__e;I.__e=function(e,t,n,r){if(e.then){for(var o,a=t;a=a.__;)if((o=a.__c)&&o.__c)return t.__e==null&&(t.__e=n.__e,t.__k=n.__k),o.__c(e,t)}Bo(e,t,n,r)};var Cn=I.unmount;function An(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(r){typeof r.__c=="function"&&r.__c()}),e.__c.__H=null),(e=Ro({},e)).__c!=null&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(r){return An(r,t,n)})),e}function In(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(r){return In(r,t,n)}),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function Qe(){this.__u=0,this.o=null,this.__b=null}function Pn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Ce(){this.i=null,this.l=null}I.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Cn&&Cn(e)},(Qe.prototype=new V).__c=function(e,t){var n=t.__c,r=this;r.o==null&&(r.o=[]),r.o.push(n);var o=Pn(r.__v),a=!1,s=function(){a||(a=!0,n.__R=null,o?o(l):l())};n.__R=s;var l=function(){if(!--r.__u){if(r.state.__a){var c=r.state.__a;r.__v.__k[0]=In(c,c.__c.__P,c.__c.__O)}var _;for(r.setState({__a:r.__b=null});_=r.o.pop();)_.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(s,s)},Qe.prototype.componentWillUnmount=function(){this.o=[]},Qe.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=An(this.__b,n,r.__O=r.__P)}this.__b=null}var o=t.__a&&z(Q,null,e.fallback);return o&&(o.__u&=-33),[z(Q,null,t.__a?null:e.children),o]};var $n=function(e,t,n){if(++n[1]===n[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(n=e.i;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.i=n=n[2]}};(Ce.prototype=new V).__a=function(e){var t=this,n=Pn(t.__v),r=t.l.get(e);return r[0]++,function(o){var a=function(){t.props.revealOrder?(r.push(o),$n(t,e,r)):o()};n?n(a):a()}},Ce.prototype.render=function(e){this.i=null,this.l=new Map;var t=be(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var n=t.length;n--;)this.l.set(t[n],this.i=[1,0,this.i]);return e.children},Ce.prototype.componentDidUpdate=Ce.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,n){$n(e,n,t)})};var Ho=typeof Symbol<"u"&&Symbol.for&&Symbol.for("react.element")||60103,Mo=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,No=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Uo=/[A-Z0-9]/g,Lo=typeof document<"u",zo=function(e){return(typeof Symbol<"u"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};V.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(V.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Tn=I.event;function Do(){}function jo(){return this.cancelBubble}function Vo(){return this.defaultPrevented}I.event=function(e){return Tn&&(e=Tn(e)),e.persist=Do,e.isPropagationStopped=jo,e.isDefaultPrevented=Vo,e.nativeEvent=e};var Wo={enumerable:!1,configurable:!0,get:function(){return this.class}},On=I.vnode;I.vnode=function(e){typeof e.type=="string"&&function(t){var n=t.props,r=t.type,o={},a=r.indexOf("-")===-1;for(var s in n){var l=n[s];if(!(s==="value"&&"defaultValue"in n&&l==null||Lo&&s==="children"&&r==="noscript"||s==="class"||s==="className")){var c=s.toLowerCase();s==="defaultValue"&&"value"in n&&n.value==null?s="value":s==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?s="ondblclick":c!=="onchange"||r!=="input"&&r!=="textarea"||zo(n.type)?c==="onfocus"?s="onfocusin":c==="onblur"?s="onfocusout":No.test(s)&&(s=c):c=s="oninput":a&&Mo.test(s)?s=s.replace(Uo,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[s=c]&&(s="oninputCapture"),o[s]=l}}r=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.value.indexOf(_.props.value)!=-1})),r=="select"&&o.defaultValue!=null&&(o.value=be(n.children).forEach(function(_){_.props.selected=o.multiple?o.defaultValue.indexOf(_.props.value)!=-1:o.defaultValue==_.props.value})),n.class&&!n.className?(o.class=n.class,Object.defineProperty(o,"className",Wo)):(n.className&&!n.class||n.class&&n.className)&&(o.class=o.className=n.className),t.props=o}(e),e.$$typeof=Ho,On&&On(e)};var Rn=I.__r;I.__r=function(e){Rn&&Rn(e),e.__c};var Bn=I.diffed;I.diffed=function(e){Bn&&Bn(e);var t=e.props,n=e.__e;n!=null&&e.type==="textarea"&&"value"in t&&t.value!==n.value&&(n.value=t.value==null?"":t.value)};const qo=e=>z("svg",{fill:"none",height:24,viewBox:"0 0 28 28",width:24,xmlns:"http://www.w3.org/2000/svg",...e},z("path",{d:"m23.1427 13.9999v11.4285h-18.2857v-11.4285m9.1429 11.4285v-17.14282m0 0h-5.1429c-.75776 0-1.48448-.30102-2.0203-.83684s-.83684-1.26255-.83684-2.02031.30102-1.48448.83684-2.0203 1.26254-.83684 2.0203-.83684c4 0 5.1429 5.71429 5.1429 5.71429zm0 0h5.1428c.7578 0 1.4845-.30102 2.0203-.83684s.8369-1.26255.8369-2.02031-.3011-1.48448-.8369-2.0203-1.2625-.83684-2.0203-.83684c-4 0-5.1428 5.71429-5.1428 5.71429zm-11.42861 0h22.85711v5.71432h-22.85711z",stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round"}));function Jo(){if(!window.FrakSetup?.client){console.error("Frak client not found");return}Eo(),sn(window.FrakSetup.client,window.FrakSetup?.modalWalletConfig??{})}function Ko({classname:e="",useReward:t,targetInteraction:n}){const r=ne(()=>t!==void 0,[t]),[o,a]=J(!0),[s,l]=J(void 0),c=mo(null),_=Fe(()=>{a(!1),r&&Fn(n).then(v=>{v&&l(`${v}€`)})},[r,n]);return Ye(()=>(Ee("add",_),()=>Ee("remove",_)),[_]),Ye(()=>{const v=window.FrakSetup?.modalWalletConfig?.metadata?.position;c.current?.parentElement?.classList.add(v??"right")},[]),O("button",{ref:c,type:"button",class:e,disabled:o,onClick:Jo,children:[O(qo,{}),s&&O("span",{children:s})]})}function Go(){customElements.get("frak-button-wallet")||on(Ko,"frak-button-wallet",[],{shadow:!1})}Oo(),Go(),Wr(async function(){if(!window.FrakSetup?.config){console.error("window.FrakSetup.config not found");return}const t=await Vr({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,xo(),Fo(t),ko(t)})});
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.10",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
@@ -48,10 +48,10 @@
|
|
|
48
48
|
"build:watch": "vite build --watch",
|
|
49
49
|
"typecheck": "tsc --noEmit",
|
|
50
50
|
"prepublish": "bun run lint && bun run build",
|
|
51
|
-
"publish": "
|
|
51
|
+
"publish": "echo 'Publishing components...'"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@frak-labs/core-sdk": "0.0.
|
|
54
|
+
"@frak-labs/core-sdk": "0.0.7",
|
|
55
55
|
"esbuild-plugin-polyfill-node": "^0.3.0",
|
|
56
56
|
"preact": "^10.25.4",
|
|
57
57
|
"preact-custom-element": "^4.3.0"
|