@frak-labs/components 1.0.9 → 1.0.10-beta.727c2f3f
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/Banner.De5nN3cX.js +167 -0
- package/cdn/{ButtonShare.D9-F0jJJ.js → ButtonShare.Bu3FfiV5.js} +1 -1
- package/cdn/{ButtonWallet.B0buPR_z.js → ButtonWallet.nvTBXwL2.js} +1 -1
- package/cdn/{GiftIcon.eRNTGQ_r.js → GiftIcon.DnSW4dJQ.js} +1 -1
- package/cdn/{OpenInAppButton.Dgb-qhM8.js → OpenInAppButton.CpO_E-l-.js} +1 -1
- package/cdn/PostPurchase.BhzdyhpA.js +89 -0
- package/cdn/components.js +1 -1
- package/cdn/embeddedWallet.CDUxjdX2.js +1 -0
- package/cdn/formatReward.DNFkBh_E.js +1 -0
- package/cdn/loader.js +1 -1
- package/cdn/replay-V6FXES7X.CNozpSRg.js +1 -0
- package/cdn/{useGlobalComponents.TG9kIYSc.js → useGlobalComponents.pjgSwLk9.js} +1 -1
- package/cdn/{useLightDomStyles.tjNBKcOr.js → useLightDomStyles.2RQE6Iby.js} +1 -1
- package/cdn/usePlacement.CRfzWKVY.js +58 -0
- package/cdn/useReward.DSMOMYCh.js +1 -0
- package/dist/{GiftIcon-BIp9FTJs.js → GiftIcon-WEWSJ8kV.js} +1 -1
- package/dist/banner.d.ts +1 -2
- package/dist/banner.js +63 -69
- package/dist/buttonShare.d.ts +1 -2
- package/dist/buttonShare.js +4 -4
- package/dist/buttonWallet.d.ts +1 -2
- package/dist/buttonWallet.js +2 -2
- package/dist/{formatReward-Cf2KpA3x.js → formatReward-D3CkH7It.js} +8 -2
- package/dist/openInApp.d.ts +1 -3
- package/dist/openInApp.js +2 -2
- package/dist/postPurchase.d.ts +1 -2
- package/dist/postPurchase.js +6 -5
- package/dist/{useLightDomStyles-CgAkUlb_.js → useLightDomStyles-DPKMhggr.js} +1 -1
- package/dist/{usePlacement-rmDVnK7X.js → usePlacement-DTN6H6vW.js} +55 -1
- package/dist/{useReward-ClVShg45.js → useReward-DSrQsn3r.js} +2 -2
- package/package.json +3 -3
- package/cdn/Banner.CcOWT4lZ.js +0 -178
- package/cdn/PostPurchase.BYxnAEyn.js +0 -89
- package/cdn/embeddedWallet.BS-9u4Be.js +0 -1
- package/cdn/formatReward.B1ZyoceC.js +0 -1
- package/cdn/replay-V6FXES7X.BoL9fAjx.js +0 -1
- package/cdn/usePlacement.BgMXY5CX.js +0 -58
- package/cdn/useReward.BtBpuMwt.js +0 -1
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import{C as e,n as t,t as n,y as r}from"./loader.js";var i,a,o,s,c,l,u,d,f,p,m,h,g,_,v={},y=[],b=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,x=Array.isArray;function S(e,t){for(var n in t)e[n]=t[n];return e}function C(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function w(e,t,n){var r,a,o,s={};for(o in t)o==`key`?r=t[o]:o==`ref`?a=t[o]:s[o]=t[o];if(arguments.length>2&&(s.children=arguments.length>3?i.call(arguments,2):n),typeof e==`function`&&e.defaultProps!=null)for(o in e.defaultProps)s[o]===void 0&&(s[o]=e.defaultProps[o]);return T(e,s,r,a,null)}function T(e,t,n,r,i){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++o,__i:-1,__u:0};return i==null&&a.vnode!=null&&a.vnode(s),s}function E(e){return e.children}function D(e,t){this.props=e,this.context=t}function O(e,t){if(t==null)return e.__?O(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`?O(e):null}function k(e){if(e.__P&&e.__d){var t=e.__v,n=t.__e,r=[],i=[],o=S({},t);o.__v=t.__v+1,a.vnode&&a.vnode(o),F(e.__P,o,t,e.__n,e.__P.namespaceURI,32&t.__u?[n]:null,r,n??O(t),!!(32&t.__u),i),o.__v=t.__v,o.__.__k[o.__i]=o,oe(r,o,i),t.__e=t.__=null,o.__e!=n&&A(o)}}function A(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),A(e)}function j(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!M.__r++||c!=a.debounceRendering)&&((c=a.debounceRendering)||l)(M)}function M(){try{for(var e,t=1;s.length;)s.length>t&&s.sort(u),e=s.shift(),t=s.length,k(e)}finally{s.length=M.__r=0}}function ee(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,b=r&&r.__k||y,x=t.length;for(c=te(n,t,b,c,x),d=0;d<x;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&b[p.__i]||v,p.__i=d,g=F(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&L(f.ref,null,p),u.push(p.ref,p.__c||m,p)),h==null&&m!=null&&(h=m),(_=!!(4&p.__u))||f.__k===p.__k?(c=ne(p,c,e,_),_&&f.__e&&(f.__e=null)):typeof p.type==`function`&&g!==void 0?c=g:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=h,c}function te(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=T(null,o,null,null,null):x(o)?o=e.__k[a]=T(E,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=T(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=ie(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=O(s)),le(s,s));return r}function ne(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=ne(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=O(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function re(e,t){return t||=[],e==null||typeof e==`boolean`||(x(e)?e.some(function(e){re(e,t)}):t.push(e)),t}function ie(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function N(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||b.test(t)?n:n+`px`}function P(e,t,n,r,i){var a,o;n: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||N(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||N(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(m,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[p]=r[p]:(n[p]=h,e.addEventListener(t,a?_:g,a)):e.removeEventListener(t,a?_:g,a);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]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ae(e){return function(t){if(this.l){var n=this.l[t.type+e];if(t[f]==null)t[f]=h++;else if(t[f]<n[p])return;return n(a.event?a.event(t):t)}}}function F(e,t,n,r,i,o,s,c,l,u){var d,f,p,m,h,g,_,v,b,w,T,O,k,A,j,M=t.type;if(t.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),o=[c=t.__e=n.__e]),(d=a.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,b=M.prototype&&M.prototype.render,w=(d=M.contextType)&&r[d.__c],T=d?w?w.props.value:d.__:r,n.__c?_=(f=t.__c=n.__c).__=f.__E:(b?t.__c=f=new M(v,T):(t.__c=f=new D(v,T),f.constructor=M,f.render=ue),w&&w.sub(f),f.state||={},f.__n=r,p=f.__d=!0,f.__h=[],f._sb=[]),b&&f.__s==null&&(f.__s=f.state),b&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=S({},f.__s)),S(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)b&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),b&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(b&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,T),t.__v==n.__v||!f.__e&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,T)){t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),y.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&s.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,T),b&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=T,f.props=v,f.__P=e,f.__e=!1,O=a.__r,k=0,b)f.state=f.__s,f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),y.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,O&&O(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++k<25);f.state=f.__s,f.getChildContext!=null&&(r=S(S({},r),f.getChildContext())),b&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),A=d!=null&&d.type===E&&d.key==null?se(d.props.children):d,c=ee(e,x(A)?A:[A],t,n,r,i,o,s,c,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&s.push(f),_&&(f.__E=f.__=null)}catch(e){if(t.__v=null,l||o!=null)if(e.then){for(t.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o[o.indexOf(c)]=null,t.__e=c}else{for(j=o.length;j--;)C(o[j]);I(t)}else t.__e=n.__e,t.__k=n.__k,e.then||I(t);a.__e(e,t,n)}else o==null&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):c=t.__e=ce(n.__e,t,n,r,i,o,s,l,u);return(d=a.diffed)&&d(t),128&t.__u?void 0:c}function I(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(I))}function oe(e,t,n){for(var r=0;r<n.length;r++)L(n[r],n[++r],n[++r]);a.__c&&a.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){a.__e(e,t.__v)}})}function se(e){return typeof e!=`object`||!e||e.__b>0?e:x(e)?e.map(se):e.constructor===void 0?S({},e):null}function ce(e,t,n,r,o,s,c,l,u){var d,f,p,m,h,g,_,y=n.props||v,b=t.props,S=t.type;if(S==`svg`?o=`http://www.w3.org/2000/svg`:S==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((h=s[d])&&`setAttribute`in h==!!S&&(S?h.localName==S:h.nodeType==3)){e=h,s[d]=null;break}}if(e==null){if(S==null)return document.createTextNode(b);e=document.createElementNS(o,S,b.is&&b),l&&=(a.__m&&a.__m(t,s),!1),s=null}if(S==null)y===b||l&&e.data==b||(e.data=b);else{if(s=S==`textarea`&&b.defaultValue!=null?null:s&&i.call(e.childNodes),!l&&s!=null)for(y={},d=0;d<e.attributes.length;d++)y[(h=e.attributes[d]).name]=h.value;for(d in y)h=y[d],d==`dangerouslySetInnerHTML`?p=h:d==`children`||d in b||d==`value`&&`defaultValue`in b||d==`checked`&&`defaultChecked`in b||P(e,d,null,h,o);for(d in b)h=b[d],d==`children`?m=h:d==`dangerouslySetInnerHTML`?f=h:d==`value`?g=h:d==`checked`?_=h:l&&typeof h!=`function`||y[d]===h||P(e,d,h,y[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==e.innerHTML)||(e.innerHTML=f.__html),t.__k=[];else if(p&&(e.innerHTML=``),ee(t.type==`template`?e.content:e,x(m)?m:[m],t,n,r,S==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:n.__k&&O(n,0),l,u),s!=null)for(d=s.length;d--;)C(s[d]);l&&S!=`textarea`||(d=`value`,S==`progress`&&g==null?e.removeAttribute(`value`):g!=null&&(g!==e[d]||S==`progress`&&!g||S==`option`&&g!=y[d])&&P(e,d,g,y[d],o),d=`checked`,_!=null&&_!=e[d]&&P(e,d,_,y[d],o))}return e}function L(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(e){a.__e(e,n)}}function le(e,t,n){var r,i;if(a.unmount&&a.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||L(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){a.__e(e,t)}r.base=r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&le(r[i],t,n||typeof e.type!=`function`);n||C(e.__e),e.__c=e.__=e.__e=void 0}function ue(e,t,n){return this.constructor(e,n)}function R(e,t,n){var r,o,s,c;t==document&&(t=document.documentElement),a.__&&a.__(e,t),o=(r=typeof n==`function`)?null:n&&n.__k||t.__k,s=[],c=[],F(t,e=(!r&&n||t).__k=w(E,null,[e]),o||v,v,t.namespaceURI,!r&&n?[n]:o?null:t.firstChild?i.call(t.childNodes):null,s,!r&&n?n:o?o.__e:t.firstChild,r,c),oe(s,e,c)}function de(e,t){R(e,t,de)}function fe(e,t,n){var r,a,o,s,c=S({},e.props);for(o in e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)o==`key`?r=t[o]:o==`ref`?a=t[o]:c[o]=t[o]===void 0&&s!=null?s[o]:t[o];return arguments.length>2&&(c.children=arguments.length>3?i.call(arguments,2):n),T(e.type,c,r||e.key,a||e.ref,null)}i=y.slice,a={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},o=0,D.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=S({},this.state);typeof e==`function`&&(e=e(S({},n),this.props)),e&&S(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),j(this))},D.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),j(this))},D.prototype.render=E,s=[],l=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,u=function(e,t){return e.__v.__b-t.__v.__b},M.__r=0,d=Math.random().toString(8),f=`__d`+d,p=`__a`+d,m=/(PointerCapture)$|Capture$/i,h=0,g=ae(!1),_=ae(!0);function z(){return z=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},z.apply(this,arguments)}function B(e,t){if(e==null)return{};var n,r,i={},a=Object.keys(e);for(r=0;r<a.length;r++)t.indexOf(n=a[r])>=0||(i[n]=e[n]);return i}var pe=[`context`,`children`],me=[`useFragment`];function he(e,t,n,r){function i(){var t,n=Reflect.construct(HTMLElement,[],i);return n._vdomComponent=e,r&&r.shadow?(n._root=n.attachShadow({mode:r.mode||`open`,serializable:(t=r.serializable)!=null&&t}),r.adoptedStyleSheets&&(n._root.adoptedStyleSheets=r.adoptedStyleSheets)):n._root=n,n}return(i.prototype=Object.create(HTMLElement.prototype)).constructor=i,i.prototype.connectedCallback=function(){_e.call(this,r)},i.prototype.attributeChangedCallback=ve,i.prototype.disconnectedCallback=ye,n=n||e.observedAttributes||Object.keys(e.propTypes||{}),i.observedAttributes=n,e.formAssociated&&(i.formAssociated=!0),n.forEach(function(e){Object.defineProperty(i.prototype,e,{get:function(){return this._vdom?this._vdom.props[e]:this._props[e]},set:function(t){this._vdom?this.attributeChangedCallback(e,null,t):(this._props||={},this._props[e]=t);var n=typeof t;t!=null&&n!==`string`&&n!==`boolean`&&n!==`number`||this.setAttribute(e,t)}})}),customElements.define(t||e.tagName||e.displayName||e.name,i),i}function ge(e){this.getChildContext=function(){return e.context};var t=e.children;return fe(t,B(e,pe))}function _e(e){var t=new CustomEvent(`_preact`,{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(t),this._vdom=w(ge,z({},this._props,{context:t.detail.context}),xe(this,this._vdomComponent,e)),(this.hasAttribute(`hydrate`)?de:R)(this._vdom,this._root)}function V(e){return e.replace(/-(\w)/g,function(e,t){return t?t.toUpperCase():``})}function ve(e,t,n){if(this._vdom){var r={};r[e]=n??=void 0,r[V(e)]=n,this._vdom=fe(this._vdom,r),R(this._vdom,this._root)}}function ye(){R(this._vdom=null,this._root)}function be(e,t){var n=this,r=e.useFragment,i=B(e,me);return w(r?E:`slot`,z({},i,{ref:function(e){e?(n.ref=e,n._listener||(n._listener=function(e){e.stopPropagation(),e.detail.context=t},e.addEventListener(`_preact`,n._listener))):n.ref.removeEventListener(`_preact`,n._listener)}}))}function xe(e,t,n){if(e.nodeType===3)return e.data;if(e.nodeType!==1)return null;var r=[],i={},a=0,o=e.attributes,s=e.childNodes;for(a=o.length;a--;)o[a].name!==`slot`&&(i[o[a].name]=o[a].value,i[V(o[a].name)]=o[a].value);for(a=s.length;a--;){var c=xe(s[a],null,n),l=s[a].slot;l?i[l]=w(be,{name:l},c):r[a]=c}var u=!(!n||!n.shadow),d=t?w(be,{useFragment:!u},r):r;return!u&&t&&(e.innerHTML=``),w(t||e.nodeName.toLowerCase(),i,d)}function Se(t,r,i=[],a={shadow:!0}){typeof window<`u`&&(e(n),customElements.get(r)||he(t,r,i,a))}var Ce=0;Array.isArray;function we(e,t,n,r,i,o){t||={};var s,c,l=t;if(`ref`in l)for(c in l={},t)c==`ref`?s=t[c]:l[c]=t[c];var u={type:e,props:l,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ce,__i:-1,__u:0,__source:i,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return a.vnode&&a.vnode(u),u}var H,U,W,Te,G=0,Ee=[],K=a,De=K.__b,Oe=K.__r,ke=K.diffed,Ae=K.__c,je=K.unmount,Me=K.__;function q(e,t){K.__h&&K.__h(U,e,G||t),G=0;var n=U.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function J(e){return G=1,Ne(ze,e)}function Ne(e,t,n){var r=q(H++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ze(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=U,!U.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a&&a.call(this,e,t,n)||o};U.__f=!0;var a=U.shouldComponentUpdate,o=U.componentWillUpdate;U.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},U.shouldComponentUpdate=i}return r.__N||r.__}function Y(e,t){var n=q(H++,3);!K.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,U.__H.__h.push(n))}function Pe(e){return G=5,X(function(){return{current:e}},[])}function X(e,t){var n=q(H++,7);return Re(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function Fe(e,t){return G=8,X(function(){return e},t)}function Ie(){for(var e;e=Ee.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Q),t.__h.some($),t.__h=[]}catch(n){t.__h=[],K.__e(n,e.__v)}}}K.__b=function(e){U=null,De&&De(e)},K.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Me&&Me(e,t)},K.__r=function(e){Oe&&Oe(e),H=0;var t=(U=e.__c).__H;t&&(W===U?(t.__h=[],U.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Q),t.__h.some($),t.__h=[],H=0)),W=U},K.diffed=function(e){ke&&ke(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ee.push(t)!==1&&Te===K.requestAnimationFrame||((Te=K.requestAnimationFrame)||Le)(Ie)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),W=U=null},K.__c=function(e,t){t.some(function(e){try{e.__h.some(Q),e.__h=e.__h.filter(function(e){return!e.__||$(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],K.__e(n,e.__v)}}),Ae&&Ae(e,t)},K.unmount=function(e){je&&je(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Q(e)}catch(e){t=e}}),n.__H=void 0,t&&K.__e(t,n.__v))};var Z=typeof requestAnimationFrame==`function`;function Le(e){var t,n=function(){clearTimeout(r),Z&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Z&&(t=requestAnimationFrame(n))}function Q(e){var t=U,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),U=t}function $(e){var t=U;e.__c=e.__(),U=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function ze(e,t){return typeof t==`function`?t(e):t}function Be(){let[e,n]=J(()=>window.FrakSetup?.config?.waitForBackendConfig===!1?!0:r.isResolved),[i,a]=J(()=>r.getConfig().hidden??!1),[o,s]=J(()=>!!window.FrakSetup?.client);return Y(()=>{let e=r.getConfig();e.isResolved&&(n(!0),a(e.hidden??!1)),window.FrakSetup?.client&&s(!0);let i=e=>{let t=e.detail;t.isResolved&&n(!0),a(t.hidden??!1)};window.addEventListener(`frak:config`,i);let o=()=>s(!0);return t(`add`,o),()=>{window.removeEventListener(`frak:config`,i),t(`remove`,o)}},[]),{shouldRender:e,isHidden:i,isClientReady:o}}const Ve=`
|
|
2
|
+
:host {
|
|
3
|
+
display: contents;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
:host([hidden]) {
|
|
7
|
+
display: none;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.button:disabled {
|
|
11
|
+
opacity: 0.7;
|
|
12
|
+
cursor: default;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.button__fadeIn {
|
|
16
|
+
animation: frak-fadeIn 300ms ease-in;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
@keyframes frak-fadeIn {
|
|
20
|
+
from {
|
|
21
|
+
opacity: 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
to {
|
|
25
|
+
opacity: 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
`;function He(e,t){return t?`${Ve}\n${e}\n${t}`:`${Ve}\n${e}`}const Ue=`
|
|
29
|
+
:where(frak-button-share, frak-open-in-app) {
|
|
30
|
+
display: contents;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
:where(frak-button-share .button, frak-open-in-app .button) {
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
justify-content: center;
|
|
37
|
+
gap: 10px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
:where(frak-button-share .button:disabled, frak-open-in-app .button:disabled) {
|
|
41
|
+
opacity: 0.7;
|
|
42
|
+
cursor: default;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
:where(frak-button-share .button__fadeIn, frak-open-in-app .button__fadeIn) {
|
|
46
|
+
animation: frak-fadeIn 300ms ease-in;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes frak-fadeIn {
|
|
50
|
+
from {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
to {
|
|
55
|
+
opacity: 1;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
`;function We(e){return r.getConfig().placements?.[e]}function Ge(e){let[t,n]=J(0);return Y(()=>{let e=e=>{n(e=>e+1)};return window.addEventListener(`frak:config`,e),n(e=>e+1),()=>window.removeEventListener(`frak:config`,e)},[]),X(()=>e?We(e):void 0,[e,t])}export{Pe as a,Fe as c,Se as d,D as f,a as g,w as h,Be as i,Y as l,E as m,He as n,X as o,re as p,Ue as r,J as s,Ge as t,we as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as e,g as t,p as n}from"./loader.js";import{l as r,s as i}from"./usePlacement.CRfzWKVY.js";import{n as a}from"./formatReward.DNFkBh_E.js";function o(e,t){switch(e.payoutType){case`fixed`:return e.amount[t];case`tiered`:return e.tiers.reduce((e,n)=>`amount`in n?Math.max(e,n.amount[t]):e,0);case`percentage`:return 0}}function s({rewards:e},r,i){let s=(i?e.filter(e=>e.interactionTypeKey===i):e).map(e=>e.referrer).filter(e=>e!==void 0);if(s.length===0)return;let c=t(n(r)),l=s[0],u=o(l,c);for(let e=1;e<s.length;e++){let t=o(s[e],c);t>u&&(l=s[e],u=t)}if(u<=0){let e=s.find(e=>e.payoutType===`percentage`);if(!e)return;l=e}return a(l,r)}function c(t,n){let[a,o]=i(void 0);return r(()=>{if(!t)return;let r=window.FrakSetup?.client;r&&e(r).then(e=>{let t=r.config.metadata?.currency,i=s(e,t,n);i&&o(i)}).catch(()=>{})},[t,n]),{reward:a}}export{c as t};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "preact/hooks";
|
|
2
2
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
3
3
|
import { Component, Fragment as Fragment$1, createElement, options, toChildArray } from "preact";
|
|
4
|
-
//#region ../../node_modules/.bun/preact@10.29.
|
|
4
|
+
//#region ../../node_modules/.bun/preact@10.29.2/node_modules/preact/compat/dist/compat.module.js
|
|
5
5
|
function g(n, t) {
|
|
6
6
|
for (var e in t) n[e] = t[e];
|
|
7
7
|
return n;
|
package/dist/banner.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
import * as _$preact from "preact";
|
|
3
2
|
|
|
4
3
|
//#region src/components/Banner/types.d.ts
|
|
5
4
|
/**
|
|
@@ -123,7 +122,7 @@ declare function Banner({
|
|
|
123
122
|
preview,
|
|
124
123
|
previewMode,
|
|
125
124
|
allowInappRedirect
|
|
126
|
-
}: BannerProps):
|
|
125
|
+
}: BannerProps): import("preact").JSX.Element | null;
|
|
127
126
|
//#endregion
|
|
128
127
|
//#region src/components/Banner/index.d.ts
|
|
129
128
|
/**
|
package/dist/banner.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
|
|
2
2
|
import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { t as
|
|
5
|
-
import {
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DPKMhggr.js";
|
|
4
|
+
import { t as applyRewardPlaceholder } from "./formatReward-D3CkH7It.js";
|
|
5
|
+
import { t as useReward } from "./useReward-DSrQsn3r.js";
|
|
6
|
+
import { a as ExternalLinkIcon, i as LogoFrakWithName, n as cssSource$5, o as CloseCircleIcon, r as WarningIcon, t as GiftIcon } from "./GiftIcon-WEWSJ8kV.js";
|
|
6
7
|
import { isInAppBrowser, redirectToExternalBrowser, trackEvent } from "@frak-labs/core-sdk";
|
|
7
8
|
import { REFERRAL_SUCCESS_EVENT, getMergeToken } from "@frak-labs/core-sdk/actions";
|
|
8
9
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
9
10
|
import { jsx, jsxs } from "preact/jsx-runtime";
|
|
10
|
-
//#region \0ve-inline:../../packages/design-system/src/
|
|
11
|
-
const cssSource$
|
|
11
|
+
//#region \0ve-inline:../../packages/design-system/src/keyframes.css.ts.vanilla.js
|
|
12
|
+
const cssSource$4 = `@keyframes keyframes_fadeIn__mnqmlt0 {
|
|
12
13
|
from {
|
|
13
14
|
opacity: 0;
|
|
14
15
|
transform: translateY(-4px);
|
|
@@ -17,8 +18,10 @@ const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
|
17
18
|
opacity: 1;
|
|
18
19
|
transform: translateY(0);
|
|
19
20
|
}
|
|
20
|
-
}
|
|
21
|
-
|
|
21
|
+
}`;
|
|
22
|
+
//#endregion
|
|
23
|
+
//#region \0ve-inline:../../packages/design-system/src/styles/inAppBanner.css.ts.vanilla.js
|
|
24
|
+
const cssSource$3 = `.inAppBanner_container__1ibpiy70 {
|
|
22
25
|
position: fixed;
|
|
23
26
|
top: max(8px, env(safe-area-inset-top));
|
|
24
27
|
left: 16px;
|
|
@@ -30,27 +33,27 @@ const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
|
30
33
|
padding: 12px 16px;
|
|
31
34
|
padding-right: 32px;
|
|
32
35
|
border-radius: 12px;
|
|
33
|
-
background-color: #
|
|
36
|
+
background-color: #000000cc;
|
|
34
37
|
backdrop-filter: blur(12px);
|
|
35
38
|
-webkit-backdrop-filter: blur(12px);
|
|
36
|
-
color:
|
|
37
|
-
animation:
|
|
39
|
+
color: var(--text-onAction__pbq4ak6);
|
|
40
|
+
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
38
41
|
}
|
|
39
|
-
.
|
|
42
|
+
.inAppBanner_header__1ibpiy71 {
|
|
40
43
|
display: flex;
|
|
41
44
|
align-items: center;
|
|
42
45
|
gap: 8px;
|
|
43
46
|
}
|
|
44
|
-
.
|
|
47
|
+
.inAppBanner_iconWrapper__1ibpiy72 {
|
|
45
48
|
flex-shrink: 0;
|
|
46
49
|
width: 20px;
|
|
47
50
|
height: 20px;
|
|
48
51
|
display: flex;
|
|
49
52
|
align-items: center;
|
|
50
53
|
justify-content: center;
|
|
51
|
-
color:
|
|
54
|
+
color: var(--text-onAction__pbq4ak6);
|
|
52
55
|
}
|
|
53
|
-
.
|
|
56
|
+
.inAppBanner_title__1ibpiy73 {
|
|
54
57
|
margin: 0;
|
|
55
58
|
padding: 0;
|
|
56
59
|
font-size: 16px;
|
|
@@ -58,13 +61,13 @@ const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
|
58
61
|
line-height: 26px;
|
|
59
62
|
color: var(--text-onAction__pbq4ak6);
|
|
60
63
|
}
|
|
61
|
-
.
|
|
64
|
+
.inAppBanner_body__1ibpiy74 {
|
|
62
65
|
display: flex;
|
|
63
66
|
flex-wrap: wrap;
|
|
64
67
|
align-items: baseline;
|
|
65
68
|
gap: 0 4px;
|
|
66
69
|
}
|
|
67
|
-
.
|
|
70
|
+
.inAppBanner_description__1ibpiy75 {
|
|
68
71
|
margin: 0;
|
|
69
72
|
padding: 0;
|
|
70
73
|
font-size: 14px;
|
|
@@ -72,24 +75,24 @@ const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
|
72
75
|
line-height: 22px;
|
|
73
76
|
opacity: 0.96;
|
|
74
77
|
}
|
|
75
|
-
.
|
|
78
|
+
.inAppBanner_cta__1ibpiy76 {
|
|
76
79
|
all: unset;
|
|
77
80
|
display: inline-flex;
|
|
78
81
|
align-items: center;
|
|
79
82
|
gap: 4px;
|
|
80
|
-
color: #
|
|
83
|
+
color: #2bb2ff;
|
|
81
84
|
font-size: 14px;
|
|
82
85
|
font-weight: 600;
|
|
83
86
|
text-decoration: underline;
|
|
84
87
|
text-underline-offset: 2px;
|
|
85
88
|
cursor: pointer;
|
|
86
89
|
}
|
|
87
|
-
.
|
|
88
|
-
outline: 2px solid #
|
|
90
|
+
.inAppBanner_cta__1ibpiy76:focus-visible {
|
|
91
|
+
outline: 2px solid #2bb2ff;
|
|
89
92
|
outline-offset: 2px;
|
|
90
93
|
border-radius: 4px;
|
|
91
94
|
}
|
|
92
|
-
.
|
|
95
|
+
.inAppBanner_closeButton__1ibpiy77 {
|
|
93
96
|
all: unset;
|
|
94
97
|
position: absolute;
|
|
95
98
|
top: 8px;
|
|
@@ -100,23 +103,24 @@ const cssSource$2 = `@keyframes inAppBanner_fadeIn__1ibpiy70 {
|
|
|
100
103
|
align-items: center;
|
|
101
104
|
justify-content: center;
|
|
102
105
|
border-radius: 9999px;
|
|
103
|
-
color:
|
|
106
|
+
color: #ffffff99;
|
|
104
107
|
cursor: pointer;
|
|
105
108
|
}
|
|
106
|
-
.
|
|
107
|
-
outline: 2px solid
|
|
109
|
+
.inAppBanner_closeButton__1ibpiy77:focus-visible {
|
|
110
|
+
outline: 2px solid var(--text-onAction__pbq4ak6);
|
|
108
111
|
outline-offset: 2px;
|
|
109
112
|
}`;
|
|
110
113
|
//#endregion
|
|
111
114
|
//#region ../../packages/design-system/src/styles/inAppBanner.css.ts
|
|
112
|
-
var body = "
|
|
113
|
-
var closeButton = "
|
|
114
|
-
var container = "
|
|
115
|
-
var cta = "
|
|
116
|
-
var description = "
|
|
117
|
-
var header = "
|
|
118
|
-
var iconWrapper = "
|
|
119
|
-
var title = "
|
|
115
|
+
var body = "inAppBanner_body__1ibpiy74";
|
|
116
|
+
var closeButton = "inAppBanner_closeButton__1ibpiy77";
|
|
117
|
+
var container = "inAppBanner_container__1ibpiy70";
|
|
118
|
+
var cta = "inAppBanner_cta__1ibpiy76";
|
|
119
|
+
var description = "inAppBanner_description__1ibpiy75";
|
|
120
|
+
var header = "inAppBanner_header__1ibpiy71";
|
|
121
|
+
var iconWrapper = "inAppBanner_iconWrapper__1ibpiy72";
|
|
122
|
+
var title = "inAppBanner_title__1ibpiy73";
|
|
123
|
+
cssSource$4 + cssSource$3;
|
|
120
124
|
//#endregion
|
|
121
125
|
//#region ../../packages/design-system/src/components/InAppBanner/index.tsx
|
|
122
126
|
function InAppBanner({ title: title$1, description: description$1, cta: cta$1, dismissLabel, onAction, onDismiss, className, classNames }) {
|
|
@@ -167,26 +171,16 @@ function InAppBanner({ title: title$1, description: description$1, cta: cta$1, d
|
|
|
167
171
|
}
|
|
168
172
|
//#endregion
|
|
169
173
|
//#region \0ve-inline:src/components/Banner/Banner.css.ts.vanilla.js
|
|
170
|
-
const cssSource$1 =
|
|
171
|
-
from {
|
|
172
|
-
opacity: 0;
|
|
173
|
-
transform: translateY(-4px);
|
|
174
|
-
}
|
|
175
|
-
to {
|
|
176
|
-
opacity: 1;
|
|
177
|
-
transform: translateY(0);
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
.Banner_rootBase__1gnumzi1 {
|
|
174
|
+
const cssSource$1 = `.Banner_rootBase__1gnumzi0 {
|
|
181
175
|
position: relative;
|
|
182
176
|
display: flex;
|
|
183
|
-
animation:
|
|
177
|
+
animation: keyframes_fadeIn__mnqmlt0 300ms ease-out;
|
|
184
178
|
}
|
|
185
|
-
.
|
|
179
|
+
.Banner_iconSvg__1gnumzi1 {
|
|
186
180
|
width: 100%;
|
|
187
181
|
height: 100%;
|
|
188
182
|
}
|
|
189
|
-
.
|
|
183
|
+
.Banner_referral__1gnumzi2 {
|
|
190
184
|
flex-direction: row;
|
|
191
185
|
align-items: center;
|
|
192
186
|
gap: 16px;
|
|
@@ -196,7 +190,7 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
196
190
|
border: 1px solid var(--border-default__pbq4akv);
|
|
197
191
|
border-radius: 12px;
|
|
198
192
|
}
|
|
199
|
-
.
|
|
193
|
+
.Banner_referralIconWrapper__1gnumzi3 {
|
|
200
194
|
flex-shrink: 0;
|
|
201
195
|
align-self: flex-start;
|
|
202
196
|
display: flex;
|
|
@@ -206,7 +200,7 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
206
200
|
height: 40px;
|
|
207
201
|
overflow: hidden;
|
|
208
202
|
}
|
|
209
|
-
.
|
|
203
|
+
.Banner_referralImage__1gnumzi4 {
|
|
210
204
|
max-width: 100%;
|
|
211
205
|
max-height: 100%;
|
|
212
206
|
width: auto;
|
|
@@ -214,23 +208,23 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
214
208
|
object-fit: contain;
|
|
215
209
|
display: block;
|
|
216
210
|
}
|
|
217
|
-
.
|
|
211
|
+
.Banner_referralBody__1gnumzi5 {
|
|
218
212
|
flex: 1;
|
|
219
213
|
min-width: 0;
|
|
220
214
|
}
|
|
221
|
-
.
|
|
215
|
+
.Banner_referralTitle__1gnumzi6 {
|
|
222
216
|
font-size: 16px;
|
|
223
217
|
font-weight: 600;
|
|
224
218
|
color: var(--text-primary__pbq4ak0);
|
|
225
219
|
line-height: 22px;
|
|
226
220
|
}
|
|
227
|
-
.
|
|
221
|
+
.Banner_referralDescription__1gnumzi7 {
|
|
228
222
|
margin-bottom: 8px;
|
|
229
223
|
font-size: 14px;
|
|
230
224
|
color: #979797;
|
|
231
225
|
line-height: 22px;
|
|
232
226
|
}
|
|
233
|
-
.
|
|
227
|
+
.Banner_referralCta__1gnumzi8 {
|
|
234
228
|
display: inline-block;
|
|
235
229
|
padding: 8px 16px;
|
|
236
230
|
border: 1px solid #000000;
|
|
@@ -241,7 +235,7 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
241
235
|
line-height: 12px;
|
|
242
236
|
text-transform: uppercase;
|
|
243
237
|
}
|
|
244
|
-
.
|
|
238
|
+
.Banner_frakLogo__1gnumzi9 {
|
|
245
239
|
position: absolute;
|
|
246
240
|
right: 16px;
|
|
247
241
|
bottom: 12px;
|
|
@@ -249,16 +243,16 @@ const cssSource$1 = `@keyframes Banner_fadeIn__1gnumzi0 {
|
|
|
249
243
|
}`;
|
|
250
244
|
//#endregion
|
|
251
245
|
//#region src/components/Banner/Banner.css.ts
|
|
252
|
-
var frakLogo = "
|
|
253
|
-
var iconSvg = "
|
|
254
|
-
var referral = "
|
|
255
|
-
var referralBody = "
|
|
256
|
-
var referralCta = "
|
|
257
|
-
var referralDescription = "
|
|
258
|
-
var referralIconWrapper = "
|
|
259
|
-
var referralImage = "
|
|
260
|
-
var referralTitle = "
|
|
261
|
-
const cssSource = cssSource$
|
|
246
|
+
var frakLogo = "Banner_frakLogo__1gnumzi9";
|
|
247
|
+
var iconSvg = "Banner_iconSvg__1gnumzi1";
|
|
248
|
+
var referral = "Banner_referral__1gnumzi2 reset_base__1831jhd0 Banner_rootBase__1gnumzi0";
|
|
249
|
+
var referralBody = "Banner_referralBody__1gnumzi5";
|
|
250
|
+
var referralCta = "Banner_referralCta__1gnumzi8 sharedBaseCss_buttonReset__7cswil0";
|
|
251
|
+
var referralDescription = "Banner_referralDescription__1gnumzi7 reset_base__1831jhd0";
|
|
252
|
+
var referralIconWrapper = "Banner_referralIconWrapper__1gnumzi3";
|
|
253
|
+
var referralImage = "Banner_referralImage__1gnumzi4";
|
|
254
|
+
var referralTitle = "Banner_referralTitle__1gnumzi6 reset_base__1831jhd0";
|
|
255
|
+
const cssSource = cssSource$4 + cssSource$3 + cssSource$1;
|
|
262
256
|
//#endregion
|
|
263
257
|
//#region src/components/Banner/Banner.tsx
|
|
264
258
|
/**
|
|
@@ -297,7 +291,7 @@ function Banner({ placement: placementId, classname = "", interaction, referralT
|
|
|
297
291
|
const isInappRedirectAllowed = allowInappRedirect === true || allowInappRedirect === "true";
|
|
298
292
|
const placement = usePlacement(placementId);
|
|
299
293
|
const { shouldRender, isHidden, isClientReady } = useClientReady();
|
|
300
|
-
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource, cssSource$
|
|
294
|
+
useLightDomStyles("frak-banner", placementId, placement?.components?.banner?.css, cssSource, cssSource$5);
|
|
301
295
|
const [dismissed, setDismissed] = useState(false);
|
|
302
296
|
const [mode, setMode] = useState(() => {
|
|
303
297
|
if (isPreview) return resolvedPreviewMode;
|
|
@@ -388,14 +382,14 @@ function Banner({ placement: placementId, classname = "", interaction, referralT
|
|
|
388
382
|
if (mode === "referral") {
|
|
389
383
|
const defaultTitle = reward ? `Earn ${reward} on purchases on this site` : "You've been referred!";
|
|
390
384
|
return {
|
|
391
|
-
title: propReferralTitle ?? bannerConfig?.referralTitle ?? defaultTitle,
|
|
392
|
-
description: propReferralDescription ?? bannerConfig?.referralDescription ?? "Earn rewards after your purchase via the Frak partner app.",
|
|
385
|
+
title: applyRewardPlaceholder(propReferralTitle ?? bannerConfig?.referralTitle ?? defaultTitle, reward),
|
|
386
|
+
description: applyRewardPlaceholder(propReferralDescription ?? bannerConfig?.referralDescription ?? "Earn rewards after your purchase via the Frak partner app.", reward),
|
|
393
387
|
cta: propReferralCta ?? bannerConfig?.referralCta ?? "Got it"
|
|
394
388
|
};
|
|
395
389
|
}
|
|
396
390
|
return {
|
|
397
|
-
title: propInappTitle ?? bannerConfig?.inappTitle ?? "Open in your browser",
|
|
398
|
-
description: propInappDescription ?? bannerConfig?.inappDescription ?? "For a better experience and to earn your rewards, open this page in your default browser.",
|
|
391
|
+
title: applyRewardPlaceholder(propInappTitle ?? bannerConfig?.inappTitle ?? "Open in your browser", reward),
|
|
392
|
+
description: applyRewardPlaceholder(propInappDescription ?? bannerConfig?.inappDescription ?? "For a better experience and to earn your rewards, open this page in your default browser.", reward),
|
|
399
393
|
cta: propInappCta ?? bannerConfig?.inappCta ?? "Open browser"
|
|
400
394
|
};
|
|
401
395
|
}, [
|
package/dist/buttonShare.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
import * as _$preact from "preact";
|
|
3
2
|
|
|
4
3
|
//#region src/components/ButtonShare/types.d.ts
|
|
5
4
|
/**
|
|
@@ -104,7 +103,7 @@ declare function ButtonShare({
|
|
|
104
103
|
targetInteraction,
|
|
105
104
|
clickAction: rawClickAction,
|
|
106
105
|
preview
|
|
107
|
-
}: ButtonShareProps):
|
|
106
|
+
}: ButtonShareProps): import("preact").JSX.Element | null;
|
|
108
107
|
//#endregion
|
|
109
108
|
//#region src/components/ButtonShare/index.d.ts
|
|
110
109
|
/**
|
package/dist/buttonShare.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, s as openSharingPage, t as usePlacement } from "./usePlacement-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, s as openSharingPage, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
|
|
2
2
|
import { t as openEmbeddedWallet } from "./embeddedWallet-By3_p5Xc.js";
|
|
3
3
|
import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
|
|
4
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
5
|
-
import { t as applyRewardPlaceholder } from "./formatReward-
|
|
6
|
-
import { t as useReward } from "./useReward-
|
|
4
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DPKMhggr.js";
|
|
5
|
+
import { t as applyRewardPlaceholder } from "./formatReward-D3CkH7It.js";
|
|
6
|
+
import { t as useReward } from "./useReward-DSrQsn3r.js";
|
|
7
7
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
8
8
|
import { useCallback, useMemo } from "preact/hooks";
|
|
9
9
|
import { jsx } from "preact/jsx-runtime";
|
package/dist/buttonWallet.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InteractionTypeKey } from "@frak-labs/core-sdk";
|
|
2
|
-
import * as _$preact from "preact";
|
|
3
2
|
|
|
4
3
|
//#region src/components/ButtonWallet/types.d.ts
|
|
5
4
|
/**
|
|
@@ -70,7 +69,7 @@ declare function ButtonWallet({
|
|
|
70
69
|
classname,
|
|
71
70
|
useReward: rawUseReward,
|
|
72
71
|
targetInteraction
|
|
73
|
-
}: ButtonWalletProps):
|
|
72
|
+
}: ButtonWalletProps): import("preact").JSX.Element | null;
|
|
74
73
|
//#endregion
|
|
75
74
|
//#region src/components/ButtonWallet/index.d.ts
|
|
76
75
|
/**
|
package/dist/buttonWallet.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, n as buildStyleContent, t as usePlacement } from "./usePlacement-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, n as buildStyleContent, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
|
|
2
2
|
import { t as openEmbeddedWallet } from "./embeddedWallet-By3_p5Xc.js";
|
|
3
|
-
import { t as useReward } from "./useReward-
|
|
3
|
+
import { t as useReward } from "./useReward-DSrQsn3r.js";
|
|
4
4
|
import { useEffect, useMemo, useState } from "preact/hooks";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "preact/jsx-runtime";
|
|
6
6
|
//#region src/components/ButtonWallet/assets/GiftIcon.tsx
|
|
@@ -17,8 +17,14 @@ function formatEstimatedReward(reward, currency, basketAmount) {
|
|
|
17
17
|
if (basketAmount !== void 0) return formatAmount(Math.round(reward.percent * basketAmount / 100), supportedCurrency);
|
|
18
18
|
return `${reward.percent} %`;
|
|
19
19
|
case "tiered": {
|
|
20
|
-
const max = reward.tiers.reduce((acc, tier) => Math.max(acc, tier.amount[key]), 0);
|
|
21
|
-
return formatAmount(Math.round(max), supportedCurrency);
|
|
20
|
+
const max = reward.tiers.reduce((acc, tier) => "amount" in tier ? Math.max(acc, tier.amount[key]) : acc, 0);
|
|
21
|
+
if (max > 0) return formatAmount(Math.round(max), supportedCurrency);
|
|
22
|
+
const maxPercent = reward.tiers.reduce((acc, tier) => "percent" in tier ? Math.max(acc, tier.percent) : acc, 0);
|
|
23
|
+
if (maxPercent > 0) {
|
|
24
|
+
if (basketAmount !== void 0) return formatAmount(Math.round(maxPercent * basketAmount / 100), supportedCurrency);
|
|
25
|
+
return `${maxPercent} %`;
|
|
26
|
+
}
|
|
27
|
+
return formatAmount(0, supportedCurrency);
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
}
|
package/dist/openInApp.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as _$preact from "preact";
|
|
2
|
-
|
|
3
1
|
//#region src/components/OpenInAppButton/types.d.ts
|
|
4
2
|
/**
|
|
5
3
|
* The props type for {@link OpenInAppButton}.
|
|
@@ -49,7 +47,7 @@ declare function OpenInAppButton({
|
|
|
49
47
|
placement: placementId,
|
|
50
48
|
text,
|
|
51
49
|
classname
|
|
52
|
-
}: OpenInAppButtonProps):
|
|
50
|
+
}: OpenInAppButtonProps): import("preact").JSX.Element | null;
|
|
53
51
|
//#endregion
|
|
54
52
|
//#region src/components/OpenInAppButton/index.d.ts
|
|
55
53
|
/**
|
package/dist/openInApp.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-
|
|
2
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
|
|
2
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DPKMhggr.js";
|
|
3
3
|
import { DEEP_LINK_SCHEME, isMobile, trackEvent, triggerDeepLinkWithFallback } from "@frak-labs/core-sdk";
|
|
4
4
|
import { useMemo } from "preact/hooks";
|
|
5
5
|
import { jsx } from "preact/jsx-runtime";
|
package/dist/postPurchase.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SharingPageProduct } from "@frak-labs/core-sdk";
|
|
2
|
-
import * as _$preact from "preact";
|
|
3
2
|
|
|
4
3
|
//#region src/components/PostPurchase/types.d.ts
|
|
5
4
|
/**
|
|
@@ -143,7 +142,7 @@ declare function PostPurchase({
|
|
|
143
142
|
previewVariant,
|
|
144
143
|
products,
|
|
145
144
|
imageUrl
|
|
146
|
-
}: PostPurchaseProps):
|
|
145
|
+
}: PostPurchaseProps): import("preact").JSX.Element | null;
|
|
147
146
|
//#endregion
|
|
148
147
|
//#region src/components/PostPurchase/index.d.ts
|
|
149
148
|
/**
|
package/dist/postPurchase.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as registerWebComponent, i as useClientReady, o as sanitizeProductList, s as openSharingPage, t as usePlacement } from "./usePlacement-
|
|
1
|
+
import { a as registerWebComponent, i as useClientReady, o as sanitizeProductList, s as openSharingPage, t as usePlacement } from "./usePlacement-DTN6H6vW.js";
|
|
2
2
|
import { t as useGlobalComponents } from "./useGlobalComponents-mSs9unyN.js";
|
|
3
|
-
import { t as useLightDomStyles } from "./useLightDomStyles-
|
|
4
|
-
import { n as formatEstimatedReward, t as applyRewardPlaceholder } from "./formatReward-
|
|
5
|
-
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-
|
|
3
|
+
import { t as useLightDomStyles } from "./useLightDomStyles-DPKMhggr.js";
|
|
4
|
+
import { n as formatEstimatedReward, t as applyRewardPlaceholder } from "./formatReward-D3CkH7It.js";
|
|
5
|
+
import { i as LogoFrakWithName, n as cssSource$2, t as GiftIcon } from "./GiftIcon-WEWSJ8kV.js";
|
|
6
6
|
import { trackEvent } from "@frak-labs/core-sdk";
|
|
7
7
|
import { getMerchantInformation, getUserReferralStatus, trackPurchaseStatus } from "@frak-labs/core-sdk/actions";
|
|
8
8
|
import { useCallback, useEffect, useMemo, useRef, useState } from "preact/hooks";
|
|
@@ -225,7 +225,8 @@ function PostPurchase({ customerId, orderId, token, sharingUrl, merchantId, plac
|
|
|
225
225
|
useEffect(() => {
|
|
226
226
|
if (!resolvedVariant) return;
|
|
227
227
|
if (trackedImpressionVariantRef.current === resolvedVariant) return;
|
|
228
|
-
if (!
|
|
228
|
+
if (!isClientReady) return;
|
|
229
|
+
if (!isPreview && (!shouldRender || isHidden)) return;
|
|
229
230
|
trackEvent(window.FrakSetup?.client, "post_purchase_impression", {
|
|
230
231
|
placement: placementId,
|
|
231
232
|
variant: resolvedVariant,
|
|
@@ -17,6 +17,43 @@ async function openSharingPage(targetInteraction, placement, options) {
|
|
|
17
17
|
}, placement);
|
|
18
18
|
}
|
|
19
19
|
//#endregion
|
|
20
|
+
//#region src/utils/dom/detectListenerPreloads.ts
|
|
21
|
+
/**
|
|
22
|
+
* Tags that count as "Frak components" for the purpose of preload detection.
|
|
23
|
+
*
|
|
24
|
+
* Kept in sync with the registry in `bootstrap/loader.ts#COMPONENTS_MAP` —
|
|
25
|
+
* any new public custom element should be added here too so the iframe
|
|
26
|
+
* preload hash reflects the user's actual page surface.
|
|
27
|
+
*/
|
|
28
|
+
const FRAK_COMPONENT_SELECTOR = [
|
|
29
|
+
"frak-button-share",
|
|
30
|
+
"frak-button-wallet",
|
|
31
|
+
"frak-open-in-app",
|
|
32
|
+
"frak-post-purchase",
|
|
33
|
+
"frak-banner"
|
|
34
|
+
].join(",");
|
|
35
|
+
/**
|
|
36
|
+
* Dynamically compute the iframe preload list based on which Frak components
|
|
37
|
+
* are present in the current document.
|
|
38
|
+
*
|
|
39
|
+
* Behaviour:
|
|
40
|
+
* - No `frak-*` element on the page → `[]` (caller should skip the
|
|
41
|
+
* `#preload=...` hash entirely so the listener doesn't warm chunks no one
|
|
42
|
+
* will use).
|
|
43
|
+
* - At least one `frak-*` element → `["sharing"]`. Every public component
|
|
44
|
+
* eventually opens the sharing flow (directly via `<frak-button-share>` or
|
|
45
|
+
* indirectly via wallet/post-purchase/banner CTAs), so a single hint
|
|
46
|
+
* covers the whole surface without bloating the iframe URL.
|
|
47
|
+
*
|
|
48
|
+
* Called once during {@link initFrakSdk}, before {@link setupClient} creates
|
|
49
|
+
* the iframe. Dynamically-mounted components (added after init) still work —
|
|
50
|
+
* the listener loads handlers on demand — they just skip the warm-up.
|
|
51
|
+
*/
|
|
52
|
+
function detectListenerPreloads() {
|
|
53
|
+
if (typeof document === "undefined") return [];
|
|
54
|
+
return document.querySelector(FRAK_COMPONENT_SELECTOR) !== null ? ["sharing"] : [];
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
20
57
|
//#region src/utils/sharingPageProducts.ts
|
|
21
58
|
/**
|
|
22
59
|
* Whether `value` is a syntactically valid URL with an `http(s):` scheme.
|
|
@@ -176,7 +213,7 @@ function initFrakSdk() {
|
|
|
176
213
|
async function doInit() {
|
|
177
214
|
if (!window.FrakSetup?.config) throw new Error("[Frak SDK] Configuration not found. Please ensure window.FrakSetup.config is set.");
|
|
178
215
|
console.log("[Frak SDK] Starting initialization");
|
|
179
|
-
const client = await setupClient({ config: window.FrakSetup.config });
|
|
216
|
+
const client = await setupClient({ config: withDynamicPreload(window.FrakSetup.config) });
|
|
180
217
|
if (!client) throw new Error("[Frak SDK] Failed to create client");
|
|
181
218
|
window.FrakSetup.client = client;
|
|
182
219
|
console.log("[Frak SDK] Client initialized successfully");
|
|
@@ -185,6 +222,23 @@ async function doInit() {
|
|
|
185
222
|
handleActionQueryParam();
|
|
186
223
|
}
|
|
187
224
|
/**
|
|
225
|
+
* Inject a dynamically-computed `preload` list when the caller hasn't set
|
|
226
|
+
* one explicitly.
|
|
227
|
+
*
|
|
228
|
+
* Rationale: the listener iframe warms Ring 1/Ring 2 chunks based on the
|
|
229
|
+
* `#preload=...` hash. The components CDN entry can detect which Frak
|
|
230
|
+
* components are actually on the page and avoid the warm-up cost when none
|
|
231
|
+
* are mounted. An explicit `config.preload` (including `[]`) is respected
|
|
232
|
+
* as an escape hatch.
|
|
233
|
+
*/
|
|
234
|
+
function withDynamicPreload(config) {
|
|
235
|
+
if (config.preload !== void 0) return config;
|
|
236
|
+
return {
|
|
237
|
+
...config,
|
|
238
|
+
preload: detectListenerPreloads()
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
188
242
|
* Check the query param for an auto-opening of the Frak sharing page.
|
|
189
243
|
*
|
|
190
244
|
* Supported params (all optional except `frakAction`):
|