@imtbl/sdk 1.44.3 → 1.45.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain_data.js +2 -2
- package/dist/browser/checkout/{BridgeWidget-91fb5514.js → BridgeWidget-bbe814fd.js} +1 -1
- package/dist/browser/checkout/{OnRampWidget-3eae12b7.js → OnRampWidget-1cd03821.js} +1 -1
- package/dist/browser/checkout/SaleWidget-6d726c41.js +1 -0
- package/dist/browser/checkout/{SpendingCapHero-12cdf02e.js → SpendingCapHero-6e77f245.js} +1 -1
- package/dist/browser/checkout/{SwapWidget-23b46935.js → SwapWidget-78d29615.js} +1 -1
- package/dist/browser/checkout/{TopUpView-870c837a.js → TopUpView-816276af.js} +1 -1
- package/dist/browser/checkout/{WalletWidget-45368032.js → WalletWidget-c3835446.js} +1 -1
- package/dist/browser/checkout/{auto-track-7620c1cd.js → auto-track-c6ad18e6.js} +1 -1
- package/dist/browser/checkout/{balance-22a95783.js → balance-d958d96d.js} +1 -1
- package/dist/browser/checkout/{index-2648c2cb.js → index-51e74135.js} +1 -1
- package/dist/browser/checkout/{index-01de11d4.js → index-702d1385.js} +13 -13
- package/dist/browser/checkout/{index-9dd96f2e.js → index-9bf3a185.js} +3 -3
- package/dist/browser/checkout/{index-09a1ee8c.js → index-a1e97a3f.js} +1 -1
- package/dist/browser/checkout/index-ab16b9d8.js +1 -0
- package/dist/browser/checkout/{index-3c9d71d0.js → index-c78eb20f.js} +1 -1
- package/dist/browser/checkout/{index-f4affd46.js → index-c7ef03ad.js} +1 -1
- package/dist/browser/checkout/{index-fd6e13ab.js → index-fda04d5e.js} +1 -1
- package/dist/browser/checkout/{index.umd-35c3c2c4.js → index.umd-3937a859.js} +1 -1
- package/dist/browser/checkout/{retry-638d1f33.js → retry-fda49d8c.js} +1 -1
- package/dist/browser/checkout/sdk.js +5 -5
- package/dist/browser/checkout/widgets-esm.js +1 -1
- package/dist/browser/checkout/widgets.js +77 -77
- package/dist/checkout.js +4 -4
- package/dist/config.js +1 -1
- package/dist/index.browser.js +4 -4
- package/dist/index.cjs +7 -7
- package/dist/index.js +7 -7
- package/dist/minting_backend.js +2 -2
- package/dist/orderbook.js +1 -1
- package/dist/passport.js +4 -4
- package/dist/webhook.js +1 -1
- package/dist/x.js +3 -3
- package/package.json +1 -1
- package/dist/browser/checkout/SaleWidget-5fa040af.js +0 -1
- package/dist/browser/checkout/index-247f183f.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c6 as e,j as t,aE as n,_ as r,u as a,r as i,c7 as o,c8 as s,m as l,n as c,c9 as d,B as p,S as h,ca as u,a as b,aK as g,C as m,k as f,cb as L,f as k,cc as x,i as C,aM as w,l as v,b5 as y,z as O,bS as j,y as I,aa as M,bT as E,cd as H,H as S,o as A,d as D,a2 as P,a7 as B,M as T,ce as F,cf as Z,b4 as z,cg as W,ch as N,aD as _,A as $,v as R,bE as V,ci as Q,ab as q,ac as X,ad as K,be as G,X as U,G as Y,R as J}from"./index-9dd96f2e.js";import{T as ee,r as te}from"./retry-638d1f33.js";function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ae=function(e){return{brad:"base.borderRadius.x4",overflow:"hidden",transitionProperty:"background-color",transitionDuration:"base.motion.normal.fast.cssDuration",transitionTimingFunction:"base.motion.normal.fast.cssEase","&.emphasized":{bgc:"base.color.translucent.emphasis.100"},"&.expanded":{bgc:"base.color.translucent.emphasis.100"},"&.emphasized.expanded":{bgc:"base.color.translucent.emphasis.200"},"&:hover":{bgc:"base.color.translucent.emphasis.200"},"&.emphasized:hover":{bgc:"base.color.translucent.emphasis.300"},"&:hover .ButtCon":re({},L("small",e,!1)["&:hover:not([disabled])"])}},ie=re(re({},e),{},{alignItems:"flex-start",justifyContent:"space-between",gap:"base.spacing.x4",position:"relative",px:"base.spacing.x3",py:"base.spacing.x4",minh:"base.spacing.x16"}),oe={position:"absolute",top:"base.spacing.x4"},se={overflow:"visible",bg:"transparent",maxh:"unset",boxShadow:"unset",brad:"unset",p:"0"},le={mb:"base.spacing.x10",px:"base.spacing.x3","& .Divider:first-of-type":{mb:"base.spacing.x4"}},ce=["children","className","sx","chevronSide"];function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function he(e){var n=e.children,a=e.className,o=e.sx,s=void 0===o?{}:o,c=e.chevronSide,d=void 0===c?"left":c,p=r(e,ce),u=i.useMemo((function(){return k(n)}),[n]);return t(g,pe(pe({},p),{},{className:"".concat(null!=a?a:""," AccordionExpandedContent"),sx:l(le,pe({},x("left"===d?"pl":"pr",s,"base.spacing.x15")),s),children:i.Children.map(u,(function(e){return i.isValidElement(e)&&C(e,w)?t(h,{size:"xSmall",children:e}):e}))}))}he.displayName="Accordion.ExpandedContent";var ue=["children","direction","gap","rc"],be=["sx","alignItems","className"],ge=["alignItems","className","sx"];function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e){var n=e.children,a=e.direction,i=void 0===a?"column":a,o=e.gap,s=void 0===o?"0px":o,l=e.rc,c=void 0===l?t("span",{}):l,d=r(e,ue);return t(g,fe(fe({},d),{},{direction:i,gap:s,rc:c,children:n}))}function ke(e){var n=e.sx,a=void 0===n?{}:n,i=e.alignItems,o=void 0===i?"flex-start":i,s=e.className,c=r(e,be);return t(Le,fe(fe({},c),{},{alignItems:o,sx:l({flex:1,textAlign:"left"},a),className:"".concat(null!=s?s:""," AccordionTargetLeftSlot")}))}function xe(e){var n=e.alignItems,a=void 0===n?"flex-end":n,i=e.className,o=e.sx,s=void 0===o?{}:o,c=r(e,ge);return t(Le,fe(fe({},c),{},{alignItems:a,sx:l({textAlign:"right"},s),className:"".concat(null!=i?i:""," AccordionTargetRightSlot")}))}ke.displayName="Accordion.TargetLeftSlot",xe.displayName="Accordion.TargetRightSlot";var Ce=["emphasized","expanded","defaultExpanded","children","gap","alignItems","className","onExpandChange","chevronSide","sx","rc","targetClickOveride","testId"];function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e){var f=ve(ve({},e),{},"expanded"in e?{defaultExpanded:void 0}:{expanded:void 0}),L=f.emphasized,k=f.expanded,x=f.defaultExpanded,C=f.children,w=f.gap,v=void 0===w?"0":w,y=f.alignItems,O=void 0===y?"stretch":y,j=f.className,I=f.onExpandChange,M=f.chevronSide,E=void 0===M?"left":M,H=f.sx,S=void 0===H?{}:H,A=f.rc,D=void 0===A?t(n.div,{}):A,P=f.targetClickOveride,B=f.testId,T=void 0===B?"Accordion":B,F=r(f,Ce),Z=a(),z=Z.base,W=i.useState(x),N=o(W,2),_=N[0],$=N[1],R=null!=k?k:_,V=s(C,ke),Q=s(C,xe),q=s(C,he),X=i.useCallback((function(){void 0===k?$((function(e){return null==I||I(!e),!e})):null==I||I(!k)}),[k,I]),K=i.useMemo((function(){var e,t;return l(ae(Z),null!==(e=null===(t=Z.components)||void 0===t||null===(t=t.Accordion)||void 0===t?void 0:t.sxOverride)&&void 0!==e?e:{},S)}),[S,Z]);return t(m,{children:function(e){var r=e.cx;return c(g,ve(ve({},F),{},{className:"".concat(null!=j?j:""," Accordion ").concat(r({emphasized:L,expanded:R})),gap:v,alignItems:O,rc:D,sx:K,testId:T,children:[c(d,{sx:l(ie,ve({},"left"===E?{pl:"base.spacing.x15"}:{pr:"base.spacing.x15"})),onClick:P||X,testId:"".concat(T,"__clickableArea"),children:[t(p,{rc:t("span",{}),icon:R?"ChevronCollapse":"ChevronExpand",variant:"tertiary",size:"small",testId:"".concat(T,"__clickableArea__chevron"),sx:l(oe,ve({},"left"===E?{left:"base.spacing.x3"}:{right:"base.spacing.x3"})),className:"Accordion__ButtCon"}),t(h,{testId:"".concat(T,"__clickableArea__targetLeft"),children:V}),Q&&t(h,{testId:"".concat(T,"__clickableArea__targetRight"),children:Q})]}),t(u,{children:Boolean(q)&&R?t(b,{sx:se,rc:t(n.div,{initial:{opacity:0,height:0,overflow:"hidden",y:-16},animate:{height:"auto",opacity:1,y:0,transitionEnd:{overflow:"visible"}},exit:{height:0,opacity:0,overflow:"hidden",y:-16},transition:{duration:z.motion.normal.fast.jsDuration,ease:z.motion.normal.fast.jsEase}}),children:t(h,{chevronSide:E,testId:"".concat(T,"__expandedContent"),children:q})}):null})]}))}})}function Oe({visible:e,targetChainId:n,provider:r,checkout:a,onCloseDrawer:o,onNetworkSwitch:s}){const{t:l}=v(),d=y(a.config.environment??O.PRODUCTION,"/switchnetworkethereum.png"),h=y(a.config.environment??O.PRODUCTION,"/switchnetworkzkevm.png"),u=j(n),g=n===I(a.config),m=i.useCallback((async()=>{if(!a)return;const e=await a.switchNetwork({provider:r,chainId:n});s&&s(e.provider)}),[a,r,s,n]),f=M(r),L=i.useMemo((()=>f?r.provider?.session?.peer?.metadata?.name:""),[r,f]),k=i.useMemo((()=>L?.toLowerCase().includes("metamask")),[L]),x=i.useMemo((()=>E(r)?"MetaMask wallet":f&&L?L:"wallet"),[r,f,L]),C=f&&k;return i.useEffect((()=>{(new Image).src=d;(new Image).src=h}),[]),t(B,{size:"threeQuarter",visible:e,onCloseDrawer:o,showHeaderBar:!1,children:c(B.Content,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:[t(H,{aspectRatio:"21:9",use:t("img",{src:g?d:h,alt:l("drawers.networkSwitch.heading",{wallet:x})})}),t(p,{icon:"Close",variant:"tertiary",sx:{pos:"absolute",top:"base.spacing.x5",left:"base.spacing.x5",backdropFilter:"blur(30px)"},onClick:o}),c(b,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"base.spacing.x4",paddingX:"base.spacing.x6"},children:[t(S,{size:"small",weight:"bold",sx:{textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.heading",{wallet:x})}),C&&t(A,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.manualSwitch.body",{chain:u})}),!C&&t(A,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.controlledSwitch.body",{chain:u})})]}),c(b,{sx:{display:"flex",flexDirection:"column",paddingX:"base.spacing.x4",width:"100%"},children:[!C&&t(D,{size:"large",variant:"primary",sx:{width:"100%",marginBottom:"base.spacing.x2"},onClick:m,children:l("drawers.networkSwitch.switchButton",{chain:u})}),t(P,{})]})]})})}function je({onClick:e,icon:n,name:r,symbol:a,balance:i,defaultTokenImage:o,testId:s,id:l}){const{t:d}=v();return c(T,{testId:`${s}-coin-selector__option-${l}`,emphasized:!0,size:"small",onClick:e,children:[t(T.FramedImage,{circularFrame:!0,use:t(ee,{src:n,name:r,defaultImage:o})}),t(T.Label,{children:r}),t(T.Caption,{children:a}),i&&t(T.PriceDisplay,{fiatAmount:`${d("drawers.coinSelector.option.fiatPricePrefix")}${i.formattedFiatAmount}`,price:i.formattedAmount})]})}ye.displayName="Accordion",ye.TargetLeftSlot=ke,ye.TargetRightSlot=xe,ye.ExpandedContent=he;const Ie={display:"flex",flexDirection:"column",gap:"2px",paddingX:"base.spacing.x4",paddingBottom:"base.spacing.x4"},Me={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function Ee({heading:e,options:n,defaultTokenImage:r,optionsLoading:a,children:i,onCloseDrawer:o,visible:s}){const{t:l}=v();return c(B,{headerBarTitle:e,size:"full",onCloseDrawer:o,visible:s,children:[t(B.Target,{children:i}),t(B.Content,{children:c(b,{sx:Ie,children:[a&&0===n.length&&c(b,{sx:Me,children:[t(T,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),t(T,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"}),t(T,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--3"})]}),!a&&0===n.length&&t(A,{sx:{padding:"base.spacing.x4"},children:l("drawers.coinSelector.noCoins")}),!a&&n.map((({onClick:e,icon:n,name:a,symbol:i,balance:o,id:s,testId:l})=>t(je,{id:s,testId:l,onClick:e,icon:n,name:a,symbol:i,balance:o,defaultTokenImage:r},`${i}-${a}`)))]})})]})}function He({testId:e,options:n,optionsLoading:r,subtext:a,onSelectChange:o,textAlign:s,errorMessage:l,disabled:d,selectedOption:p,coinSelectorHeading:h,defaultTokenImage:u,environment:g=O.PRODUCTION,theme:m=z.DARK}){const[f,L]=i.useState(!1),k=i.useMemo((()=>n.map((t=>({...t,testId:e,onClick:()=>{o(t.id),L(!1)}})))),[n,o,L]),x=n?.find((e=>e.id===p))??p;return c(b,{children:[t(Ee,{heading:h,options:k,defaultTokenImage:u,optionsLoading:r??!1,visible:f,onCloseDrawer:()=>L(!1)}),t(Z,{testId:`${e}-select-control`,textAlign:s??"left",subtext:l?void 0:a,isErrored:!!l,errorMessage:l,children:t(F,{testId:`${e}-select`,size:"large",defaultLabel:"Select token",targetClickOveride:()=>L(!0),selectedOption:(()=>{if(p&&0!==n.length&&n.find((e=>e.id===p)))return p})(),sx:{minw:"170px"},children:x&&c(F.Option,{optionKey:x.id,testId:x.testId,disabled:d,children:[!x.icon&&t(F.Option.Icon,{icon:"Coins",variant:"bold"}),x.icon&&t(F.Option.FramedImage,{use:t(ee,{environment:g,theme:m,src:x.icon,name:x.name}),circularFrame:!0,sx:{background:"base.color.translucent.standard.100"}}),t(F.Option.Label,{children:x.symbol})]},x.id)})})]})}function Se({testId:e,value:n,placeholder:r,errorMessage:a,validator:i,onTextInputChange:o,onTextInputBlur:s,onTextInputFocus:l,onTextInputEnter:c,textAlign:d,type:p,subtext:h,maxButtonClick:u,disabled:b,inputMode:g}){return t(Z,{testId:`${e}-text-control`,textAlign:d??"left",subtext:a?void 0:h,isErrored:!!a,errorMessage:a,sx:{width:"100%"},children:t(W,{testId:`${e}-text`,onChange:e=>((e,t)=>{let n=e.target.value;"number"===p&&"."===n&&(n="0."),i(n)?o(n):o(t??"")})(e,n),sizeVariant:"large",value:n,inputMode:g,validationStatus:a?"error":"success",placeholder:r,onBlur:e=>{if(!s)return;const t=e.target.value;i(t)&&s(t)},onFocus:e=>{if(!l)return;const t=e.target.value;i(t)&&l(t)},onKeyDown:e=>{c&&"Enter"===e.key&&c()},disabled:b,hideClearValueButton:!0,sx:{minWidth:"100%"},children:u&&t(W.Button,{testId:`${e}-max-button`,onClick:u,disabled:b,children:"max"})})})}const Ae={display:"flex",flexDirection:"column",height:"100%",padding:"16px 16px 0 16px"},De={display:"flex",flexDirection:"column",gap:"10px",height:"100%"},Pe={display:"flex",width:"100%"},Be=e=>({width:"65%",color:e?"base.color.text.body.primary":"base.color.text.body.secondary"}),Te={width:"35%"},Fe={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function Ze({boldLabel:e,label:n,amount:r,fiatAmount:a,tokenSymbol:i,prefix:o=""}){const s=n.toLowerCase().replace(" ","-");return c(b,{sx:Pe,testId:`fee-item-${s}`,children:[t(A,{sx:Be(e),children:n}),t(N,{testId:s,sx:Te,price:`${o}${i} ${r}`,fiatAmount:a})]})}function ze({fees:e,children:n,visible:r,onCloseDrawer:a,totalFiatAmount:i,totalAmount:o,tokenSymbol:s,loading:l=!1}){const{t:d}=v();return c(B,{headerBarTitle:d("drawers.feesBreakdown.heading"),size:"threeQuarter",onCloseDrawer:a,visible:r,children:[t(B.Target,{children:n}),c(B.Content,{testId:"fees-breakdown-content",sx:Ae,children:[c(b,{sx:De,children:[l&&c(b,{sx:Fe,children:[t(T,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),t(T,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"})]}),!l&&e.map((({label:e,amount:n,fiatAmount:r,prefix:a,token:i})=>t(Ze,{label:e,amount:n,fiatAmount:r,tokenSymbol:i.symbol??s,prefix:a},e))),o&&c(_,{children:[t(w,{size:"xSmall"}),t(Ze,{label:d("drawers.feesBreakdown.total"),amount:$(o),fiatAmount:i?`≈ ${d("drawers.feesBreakdown.fees.fiatPricePrefix")}${i}`:R("0"),tokenSymbol:s,boldLabel:!0},d("drawers.feesBreakdown.total"))]})]}),t(P,{})]})]})}const We={backgroundColor:"base.color.translucent.emphasis.100"},Ne={marginBottom:"base.spacing.x4",color:"base.color.text.body.secondary"};function _e({gasFeeValue:e,gasFeeToken:n,gasFeeFiatValue:r,fees:a,onFeesClick:o,loading:s,sx:l}){const[d,p]=i.useState(!1),{t:h}=v();if(!e&&!s)return null;const u=R($(e)),g=n?.symbol;return c(_,{children:[c(ye,{targetClickOveride:()=>{p(!0),o?.()},sx:{...We,paddingBottom:"base.spacing.x2",...l},children:[t(ye.TargetLeftSlot,{children:t(A,{size:"medium",sx:Ne,children:h("drawers.feesBreakdown.heading")})}),c(ye.TargetRightSlot,{children:[s&&t(b,{sx:{width:"218px",position:"relative"},children:t(b,{sx:{display:"block",position:"absolute",top:"-15px",width:"100%",height:"68px",WebkitMaskPosition:"right center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain",WebkitMaskImage:'url(\'data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="196" height="96"><path d="M182.85 55.2Q181.65 54 180 54h-56q-1.7 0-2.85 1.2Q120 56.35 120 58v4q0 1.7 1.15 2.85Q122.3 66 124 66h56q1.65 0 2.85-1.15Q184 63.7 184 62v-4q0-1.65-1.15-2.8m0-22Q181.65 32 180 32H68q-1.7 0-2.85 1.2Q64 34.35 64 36v8q0 1.7 1.15 2.85Q66.3 48 68 48h112q1.65 0 2.85-1.15Q184 45.7 184 44v-8q0-1.65-1.15-2.8Z" id="a"/></svg>\')'},rc:t("span",{}),children:t(V,{rc:t("span",{})})})}),!s&&t(N,{testId:"fees-gas-fee__priceDisplay",fiatAmount:`≈ ${h("drawers.feesBreakdown.fees.fiatPricePrefix")}${r}`,price:`~ ${g} ${R($(u))}`})]})]}),t(ze,{tokenSymbol:g??"",fees:a,visible:d,loading:s,onCloseDrawer:()=>p(!1)})]})}const $e={display:"flex",flexDirection:"column",alignItems:"center",paddingY:"50px",paddingX:"base.spacing.x4",height:"100%"},Re={color:"base.color.text.body.secondary",fontFamily:"base.font.family.heading.secondary",textAlign:"center",marginTop:"15px"},Ve={display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:"8px",height:"100%",width:"100%"},Qe={width:"100%",height:"64px"};function qe({onCloseDrawer:e,visible:n,showHeaderBar:r,onRetry:a}){const{t:i}=v();return t(B,{headerBarTitle:void 0,size:"full",onCloseDrawer:e,visible:n,showHeaderBar:r,children:t(B.Content,{children:c(b,{sx:$e,children:[t(Q,{icon:"Information",colorVariant:"guidance",iconVariant:"bold"}),c(S,{size:"small",sx:Re,testId:"transaction-rejected-heading",children:[i("drawers.transactionFailed.content.heading1"),t("br",{}),i("drawers.transactionFailed.content.heading2")]}),c(A,{sx:Re,children:[i("drawers.transactionFailed.content.body1"),t("br",{}),i("drawers.transactionFailed.content.body2")]}),c(b,{sx:Ve,children:[t(D,{sx:Qe,variant:"tertiary",onClick:a,children:i("drawers.transactionFailed.buttons.retry")}),t(D,{sx:Qe,variant:"tertiary",onClick:e,testId:"transaction-rejected-cancel-button",children:i("drawers.transactionFailed.buttons.cancel")})]})]})})})}function Xe(){return t(b,{testId:"wallet-approve-hero",sx:{...q,background:"base.color.translucent.emphasis.100"},children:t(b,{sx:{...X,...K},children:c("svg",{width:"430",height:"305",viewBox:"0 0 430 305",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M227.517 171.325L182.178 85.6034C181.033 83.4446 179.583 82.3652 178.156 82.3652C175.711 82.3652 174.322 84.1157 172.863 86.6218L137.285 164.056L183.689 253.776L227.522 171.32L227.517 171.325Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M226.841 137.597C228.497 133.997 228.338 128.188 226.484 124.682L197.866 70.5767C196.012 67.0757 193.14 67.1508 191.484 70.7503L164.936 128.427L168.399 134.936L165.396 141.464L168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992L165.846 154.52L169.3 161.048L166.287 167.562L187.922 208.465C189.776 211.966 192.648 211.891 194.304 208.292L226.845 137.597H226.841Z",fill:"#F191FA"}),t("path",{d:"M168.85 147.992L165.396 141.464L168.399 134.936L164.936 128.427L191.484 70.7503C193.14 67.1508 196.012 67.0757 197.866 70.5767L226.484 124.682C228.338 128.188 228.497 133.997 226.841 137.597H226.845L194.304 208.292C192.648 211.891 189.776 211.966 187.922 208.465L166.287 167.562L169.3 161.048L165.846 154.52L168.85 147.992ZM168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992Z",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M159.384 154.519L155.93 147.991L158.939 141.463L162.388 147.991L159.384 154.519Z",fill:"#F191FA"}),t("path",{d:"M203.136 132.773C202.484 134.19 201.353 134.223 200.621 132.843L196.101 124.297C195.369 122.917 195.308 120.627 195.961 119.21L200.621 109.082C201.273 107.665 202.404 107.632 203.136 109.012L207.656 117.558C208.388 118.938 208.449 121.228 207.796 122.645L203.136 132.773Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M206.22 114.837L204.68 118.183C204.174 119.286 203.291 119.309 202.724 118.234L199.345 111.852",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M197.542 127.015L199.058 123.716C199.565 122.613 200.447 122.589 201.015 123.664L204.394 130.046",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M293.369 250.453L252.263 172.733C249.936 168.331 243.957 164.731 238.982 164.731H173.769C171.516 164.731 169.306 164.14 167.358 163.014L162.876 160.423C160.929 159.297 158.718 158.706 156.466 158.706H147.896L141.237 164.534L189.659 256C190.612 257.493 192.452 258.417 194.939 258.417L287.456 258.445L291.473 260.904L293.904 255.733H293.895C294.556 254.315 294.449 252.471 293.379 250.448L293.369 250.453Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M232.923 169.903L235.354 164.731",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),t("path",{d:"M249.832 177.908C247.505 173.506 241.526 169.907 236.551 169.907L142.025 169.878C139.355 169.878 137.436 168.813 136.549 167.128L186.313 261.185C187.266 262.677 189.105 263.602 191.592 263.602L286.118 263.63C291.098 263.63 293.266 260.03 290.938 255.633L249.832 177.913V177.908Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M255.328 198.77L245.041 179.313C243.581 176.548 240.235 174.042 237.161 174.042L143.555 173.93",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M188.64 259.548L282.448 259.558C285.569 259.558 286.418 257.577 285.198 255.264L276.103 238.064",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M150.238 159.776C150.965 161.151 149.539 163.338 147.051 164.652C144.564 165.966 141.96 165.919 141.227 164.539C140.495 163.159 141.927 160.977 144.414 159.663C145.62 159.025 146.854 158.71 147.891 158.71C148.99 158.71 149.863 159.067 150.238 159.776Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M147.826 161.052C148.164 161.69 147.502 162.704 146.348 163.314C145.193 163.924 143.983 163.9 143.645 163.262C143.307 162.624 143.969 161.61 145.123 161C145.681 160.705 146.254 160.559 146.737 160.559C147.249 160.559 147.652 160.723 147.826 161.057V161.052Z",fill:"black"}),t("path",{d:"M171.652 85.828L136.755 161.652C135.788 163.75 135.784 165.669 136.549 167.124C136.549 167.124 137.717 169.874 142.025 169.874C146.333 169.874 151.754 169.907 151.754 169.907L153.115 167.5L143.419 167.467C139.669 167.467 137.637 165.186 139.205 161.779L174.163 85.8233C175.223 83.5238 176.678 82.3646 178.156 82.3646C178.156 82.3646 173.431 81.961 171.652 85.8233V85.828Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M273.579 230.377L277.263 229.767L287.024 238.458L278.347 222.051L270.373 223.609L273.579 230.377Z",fill:"black"}),t("path",{d:"M274.968 235.918C272.495 231.239 272.777 228.33 278.296 226.565C281.262 225.617 283.951 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.049 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495L255.399 206.127L271.073 235.923H274.973L274.968 235.918Z",fill:"#EBE9E9"}),t("path",{d:"M274.968 235.918C272.495 231.239 272.776 228.33 278.295 226.565C281.261 225.617 283.95 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.048 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),t("path",{d:"M289.926 200.125C287.265 199.276 284.074 201.829 282.793 205.832C281.512 209.835 282.629 213.768 285.29 214.617L286.533 215.016L291.17 200.524L289.926 200.125Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M293.683 209.321C294.963 205.319 293.846 201.386 291.187 200.535C288.528 199.685 285.335 202.239 284.055 206.241C282.775 210.242 283.892 214.176 286.551 215.026C289.21 215.877 292.403 213.322 293.683 209.321Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M213.26 224.182C211.237 224.182 208.816 222.722 207.868 220.934L189.021 185.301C188.077 183.513 188.955 182.053 190.978 182.053L231.3 182.039C233.322 182.039 235.744 183.499 236.692 185.287L255.539 220.92C256.482 222.708 255.604 224.168 253.582 224.168L213.26 224.182Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M214.334 222.319C212.312 222.319 209.89 220.859 208.942 219.071L190.095 183.438C189.884 183.034 189.767 182.649 189.729 182.292C188.64 182.776 188.302 183.944 189.02 185.301L207.867 220.934C208.811 222.722 211.237 224.182 213.26 224.182L253.582 224.168C255.144 224.168 256.022 223.29 255.9 222.065C255.557 222.22 255.14 222.305 254.652 222.305L214.33 222.319H214.334Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M231.586 203.083L233.646 206.978H228.756H223.871H218.981H215.513C214.733 206.978 214.363 207.489 214.691 208.109L215.555 209.737C215.883 210.361 216.794 210.873 217.577 210.873H221.046H225.936L227.395 213.632C227.724 214.256 228.634 214.763 229.418 214.763H231.464C232.243 214.763 232.614 214.252 232.285 213.628L230.826 210.868H235.716H239.184C239.963 210.868 240.334 210.352 240.005 209.732L238.546 206.973L237.086 204.214C236.758 203.589 235.847 203.083 235.063 203.083H231.595H231.586Z",fill:"#F191FA"}),t("path",{d:"M214.855 199.191L216.315 201.951C216.648 202.575 217.554 203.086 218.342 203.086H221.81H226.696H231.586L230.126 200.322C229.793 199.698 228.887 199.187 228.099 199.187H224.631H219.746H214.855V199.191Z",fill:"#F191FA"}),t("path",{d:"M214.986 187.501C214.207 187.501 213.837 188.013 214.165 188.632L215.625 191.392H210.735H207.266C206.487 191.392 206.117 191.903 206.445 192.527L207.905 195.287L209.364 198.046C209.693 198.671 210.603 199.177 211.387 199.177H214.855L212.795 195.282H217.685H222.57H227.46H230.928C231.707 195.282 232.078 194.771 231.75 194.147L230.891 192.523C230.558 191.899 229.652 191.387 228.868 191.387H225.4H220.51L219.051 188.628C218.722 188.003 217.812 187.497 217.028 187.497H214.982L214.986 187.501Z",fill:"#F191FA"}),t("path",{d:"M214.098 243.795L212.428 240.641C211.78 239.412 210.109 238.412 208.725 238.412H202.849L200.428 233.832C199.78 232.602 198.114 231.603 196.725 231.603H191.751C191 231.603 190.483 231.898 190.263 232.363L189.066 234.906L191.464 235.826L192.835 238.417H186.959C186.208 238.417 185.692 238.712 185.471 239.177L184.275 241.721L186.612 242.528L187.288 243.804C187.935 245.034 189.606 246.033 190.99 246.033H196.866L199.287 250.614C199.935 251.843 201.601 252.843 202.99 252.843H205.032L208.256 254.631L209.452 252.087C209.635 251.693 209.607 251.177 209.307 250.614L206.885 246.033H210.194L213.057 247.817L214.253 245.273C214.441 244.879 214.408 244.363 214.108 243.8L214.098 243.795Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.529 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.529 234.146H190.554C189.165 234.146 188.564 235.151 189.212 236.38L191.634 240.961H185.758C184.369 240.961 183.763 241.97 184.416 243.195L186.086 246.348C186.734 247.578 188.405 248.577 189.789 248.577H195.665L198.086 253.158C198.734 254.387 200.4 255.387 201.789 255.387H206.764C208.153 255.387 208.753 254.383 208.106 253.153L205.684 248.573H211.56C212.949 248.573 213.554 247.564 212.902 246.339Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M208.107 253.158L205.685 248.573",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M191.634 240.96H185.758",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.528 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.528 234.146H190.554",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M356.061 232.632L355.632 231L354 231.429L354.429 233.061L356.061 232.632Z",fill:"white"}),t("path",{d:"M57.6531 168.341L57.1006 166.24L54.9996 166.793L55.5521 168.894L57.6531 168.341Z",fill:"white"}),t("path",{d:"M103.489 244.345L101.345 244L101 246.145L103.144 246.49L103.489 244.345Z",fill:"white"}),t("path",{d:"M341.286 111.905L341.905 110.619L340.619 110L340 111.286L341.286 111.905Z",fill:"white"}),t("path",{d:"M323.144 179.08L322.592 176.979L320.491 177.531L321.043 179.632L323.144 179.08Z",fill:"white"}),t("path",{d:"M328.919 177.658L329.538 176.372L328.252 175.753L327.633 177.039L328.919 177.658Z",fill:"white"}),t("path",{d:"M88.1441 141.383L87.2188 140.296L86.1321 141.221L87.0574 142.308L88.1441 141.383Z",fill:"white"}),t("path",{d:"M258.286 89.9052L258.905 88.6191L257.619 88L257 89.2861L258.286 89.9052Z",fill:"white"})]})})})}const Ke=async({checkout:e,provider:t,allowTokenListType:n,chainId:r,allowZero:a=!1,retryPolicy:i=J})=>{const o=r||(await e.getNetworkInfo({provider:t})).chainId,s=await t.getSigner().getAddress(),l=await te((()=>e.getAllBalances({provider:t,walletAddress:s,chainId:o})),{...i});if(void 0===l)return;const c=await e.getTokenAllowList({chainId:o,type:n}),d=new Map;c.tokens.forEach((e=>d.set(e.address?.toLowerCase()||G,!0)));const p=l.balances.filter((e=>!(e.balance.lte(0)&&!a)&&d.get(e.token.address?.toLowerCase()||G))).map((t=>({...t,token:{...t.token,icon:U(e.config.environment,Y(t.token.address)?t.token.symbol:t.token.address??"")}})))??[];return c.tokens=c.tokens.map((t=>({...t,icon:U(e.config.environment,Y(t.address)?t.symbol:t.address??"")}))),{allowList:c,allowedBalances:p}};export{ye as A,_e as F,Oe as N,He as S,Se as T,Xe as W,qe as a,Ke as g};
|
|
1
|
+
import{ca as e,j as t,aI as n,_ as r,u as a,r as i,cb as o,cc as s,m as l,n as c,cd as d,B as p,S as h,ce as u,a as b,aN as g,C as m,k as f,cf as L,f as k,cg as x,i as C,aP as w,l as v,b8 as y,z as O,bW as I,y as j,aa as M,bX as E,ch as H,H as S,o as A,d as D,a2 as P,a7 as B,M as F,ci as T,cj as Z,b7 as z,ck as W,cl as N,aD as _,A as $,v as R,bI as V,cm as Q,ab as X,ac as q,ad as G,bh as K,X as U,G as Y,R as J}from"./index-9bf3a185.js";import{T as ee,r as te}from"./retry-fda49d8c.js";function ne(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function re(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ne(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ne(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var ae=function(e){return{brad:"base.borderRadius.x4",overflow:"hidden",transitionProperty:"background-color",transitionDuration:"base.motion.normal.fast.cssDuration",transitionTimingFunction:"base.motion.normal.fast.cssEase","&.emphasized":{bgc:"base.color.translucent.emphasis.100"},"&.expanded":{bgc:"base.color.translucent.emphasis.100"},"&.emphasized.expanded":{bgc:"base.color.translucent.emphasis.200"},"&:hover":{bgc:"base.color.translucent.emphasis.200"},"&.emphasized:hover":{bgc:"base.color.translucent.emphasis.300"},"&:hover .ButtCon":re({},L("small",e,!1)["&:hover:not([disabled])"])}},ie=re(re({},e),{},{alignItems:"flex-start",justifyContent:"space-between",gap:"base.spacing.x4",position:"relative",px:"base.spacing.x3",py:"base.spacing.x4",minh:"base.spacing.x16"}),oe={position:"absolute",top:"base.spacing.x4"},se={overflow:"visible",bg:"transparent",maxh:"unset",boxShadow:"unset",brad:"unset",p:"0"},le={mb:"base.spacing.x10",px:"base.spacing.x3","& .Divider:first-of-type":{mb:"base.spacing.x4"}},ce=["children","className","sx","chevronSide"];function de(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function pe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?de(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):de(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function he(e){var n=e.children,a=e.className,o=e.sx,s=void 0===o?{}:o,c=e.chevronSide,d=void 0===c?"left":c,p=r(e,ce),u=i.useMemo((function(){return k(n)}),[n]);return t(g,pe(pe({},p),{},{className:"".concat(null!=a?a:""," AccordionExpandedContent"),sx:l(le,pe({},x("left"===d?"pl":"pr",s,"base.spacing.x15")),s),children:i.Children.map(u,(function(e){return i.isValidElement(e)&&C(e,w)?t(h,{size:"xSmall",children:e}):e}))}))}he.displayName="Accordion.ExpandedContent";var ue=["children","direction","gap","rc"],be=["sx","alignItems","className"],ge=["alignItems","className","sx"];function me(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function fe(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?me(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):me(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Le(e){var n=e.children,a=e.direction,i=void 0===a?"column":a,o=e.gap,s=void 0===o?"0px":o,l=e.rc,c=void 0===l?t("span",{}):l,d=r(e,ue);return t(g,fe(fe({},d),{},{direction:i,gap:s,rc:c,children:n}))}function ke(e){var n=e.sx,a=void 0===n?{}:n,i=e.alignItems,o=void 0===i?"flex-start":i,s=e.className,c=r(e,be);return t(Le,fe(fe({},c),{},{alignItems:o,sx:l({flex:1,textAlign:"left"},a),className:"".concat(null!=s?s:""," AccordionTargetLeftSlot")}))}function xe(e){var n=e.alignItems,a=void 0===n?"flex-end":n,i=e.className,o=e.sx,s=void 0===o?{}:o,c=r(e,ge);return t(Le,fe(fe({},c),{},{alignItems:a,sx:l({textAlign:"right"},s),className:"".concat(null!=i?i:""," AccordionTargetRightSlot")}))}ke.displayName="Accordion.TargetLeftSlot",xe.displayName="Accordion.TargetRightSlot";var Ce=["emphasized","expanded","defaultExpanded","children","gap","alignItems","className","onExpandChange","chevronSide","sx","rc","targetClickOveride","testId"];function we(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?we(Object(n),!0).forEach((function(t){f(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):we(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function ye(e){var f=ve(ve({},e),{},"expanded"in e?{defaultExpanded:void 0}:{expanded:void 0}),L=f.emphasized,k=f.expanded,x=f.defaultExpanded,C=f.children,w=f.gap,v=void 0===w?"0":w,y=f.alignItems,O=void 0===y?"stretch":y,I=f.className,j=f.onExpandChange,M=f.chevronSide,E=void 0===M?"left":M,H=f.sx,S=void 0===H?{}:H,A=f.rc,D=void 0===A?t(n.div,{}):A,P=f.targetClickOveride,B=f.testId,F=void 0===B?"Accordion":B,T=r(f,Ce),Z=a(),z=Z.base,W=i.useState(x),N=o(W,2),_=N[0],$=N[1],R=null!=k?k:_,V=s(C,ke),Q=s(C,xe),X=s(C,he),q=i.useCallback((function(){void 0===k?$((function(e){return null==j||j(!e),!e})):null==j||j(!k)}),[k,j]),G=i.useMemo((function(){var e,t;return l(ae(Z),null!==(e=null===(t=Z.components)||void 0===t||null===(t=t.Accordion)||void 0===t?void 0:t.sxOverride)&&void 0!==e?e:{},S)}),[S,Z]);return t(m,{children:function(e){var r=e.cx;return c(g,ve(ve({},T),{},{className:"".concat(null!=I?I:""," Accordion ").concat(r({emphasized:L,expanded:R})),gap:v,alignItems:O,rc:D,sx:G,testId:F,children:[c(d,{sx:l(ie,ve({},"left"===E?{pl:"base.spacing.x15"}:{pr:"base.spacing.x15"})),onClick:P||q,testId:"".concat(F,"__clickableArea"),children:[t(p,{rc:t("span",{}),icon:R?"ChevronCollapse":"ChevronExpand",variant:"tertiary",size:"small",testId:"".concat(F,"__clickableArea__chevron"),sx:l(oe,ve({},"left"===E?{left:"base.spacing.x3"}:{right:"base.spacing.x3"})),className:"Accordion__ButtCon"}),t(h,{testId:"".concat(F,"__clickableArea__targetLeft"),children:V}),Q&&t(h,{testId:"".concat(F,"__clickableArea__targetRight"),children:Q})]}),t(u,{children:Boolean(X)&&R?t(b,{sx:se,rc:t(n.div,{initial:{opacity:0,height:0,overflow:"hidden",y:-16},animate:{height:"auto",opacity:1,y:0,transitionEnd:{overflow:"visible"}},exit:{height:0,opacity:0,overflow:"hidden",y:-16},transition:{duration:z.motion.normal.fast.jsDuration,ease:z.motion.normal.fast.jsEase}}),children:t(h,{chevronSide:E,testId:"".concat(F,"__expandedContent"),children:X})}):null})]}))}})}function Oe({visible:e,targetChainId:n,provider:r,checkout:a,onCloseDrawer:o,onNetworkSwitch:s}){const{t:l}=v(),d=y(a.config.environment??O.PRODUCTION,"/switchnetworkethereum.png"),h=y(a.config.environment??O.PRODUCTION,"/switchnetworkzkevm.png"),u=I(n),g=n===j(a.config),m=i.useCallback((async()=>{if(!a)return;const e=await a.switchNetwork({provider:r,chainId:n});s&&s(e.provider)}),[a,r,s,n]),f=M(r),L=i.useMemo((()=>f?r.provider?.session?.peer?.metadata?.name:""),[r,f]),k=i.useMemo((()=>L?.toLowerCase().includes("metamask")),[L]),x=i.useMemo((()=>E(r)?"MetaMask wallet":f&&L?L:"wallet"),[r,f,L]),C=f&&k;return i.useEffect((()=>{(new Image).src=d;(new Image).src=h}),[]),t(B,{size:"threeQuarter",visible:e,onCloseDrawer:o,showHeaderBar:!1,children:c(B.Content,{sx:{display:"flex",flexDirection:"column",justifyContent:"space-between",alignItems:"center"},children:[t(H,{aspectRatio:"21:9",use:t("img",{src:g?d:h,alt:l("drawers.networkSwitch.heading",{wallet:x})})}),t(p,{icon:"Close",variant:"tertiary",sx:{pos:"absolute",top:"base.spacing.x5",left:"base.spacing.x5",backdropFilter:"blur(30px)"},onClick:o}),c(b,{sx:{display:"flex",flexDirection:"column",alignItems:"center",gap:"base.spacing.x4",paddingX:"base.spacing.x6"},children:[t(S,{size:"small",weight:"bold",sx:{textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.heading",{wallet:x})}),C&&t(A,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.manualSwitch.body",{chain:u})}),!C&&t(A,{size:"medium",weight:"regular",sx:{color:"base.color.text.body.secondary",textAlign:"center",paddingX:"base.spacing.x6"},children:l("drawers.networkSwitch.controlledSwitch.body",{chain:u})})]}),c(b,{sx:{display:"flex",flexDirection:"column",paddingX:"base.spacing.x4",width:"100%"},children:[!C&&t(D,{size:"large",variant:"primary",sx:{width:"100%",marginBottom:"base.spacing.x2"},onClick:m,children:l("drawers.networkSwitch.switchButton",{chain:u})}),t(P,{})]})]})})}function Ie({onClick:e,icon:n,name:r,symbol:a,balance:i,defaultTokenImage:o,testId:s,id:l}){const{t:d}=v();return c(F,{testId:`${s}-coin-selector__option-${l}`,emphasized:!0,size:"small",onClick:e,children:[t(F.FramedImage,{circularFrame:!0,use:t(ee,{src:n,name:r,defaultImage:o})}),t(F.Label,{children:r}),t(F.Caption,{children:a}),i&&t(F.PriceDisplay,{fiatAmount:`${d("drawers.coinSelector.option.fiatPricePrefix")}${i.formattedFiatAmount}`,price:i.formattedAmount})]})}ye.displayName="Accordion",ye.TargetLeftSlot=ke,ye.TargetRightSlot=xe,ye.ExpandedContent=he;const je={display:"flex",flexDirection:"column",gap:"2px",paddingX:"base.spacing.x4",paddingBottom:"base.spacing.x4"},Me={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function Ee({heading:e,options:n,defaultTokenImage:r,optionsLoading:a,children:i,onCloseDrawer:o,visible:s}){const{t:l}=v();return c(B,{headerBarTitle:e,size:"full",onCloseDrawer:o,visible:s,children:[t(B.Target,{children:i}),t(B.Content,{children:c(b,{sx:je,children:[a&&0===n.length&&c(b,{sx:Me,children:[t(F,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),t(F,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"}),t(F,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--3"})]}),!a&&0===n.length&&t(A,{sx:{padding:"base.spacing.x4"},children:l("drawers.coinSelector.noCoins")}),!a&&n.map((({onClick:e,icon:n,name:a,symbol:i,balance:o,id:s,testId:l})=>t(Ie,{id:s,testId:l,onClick:e,icon:n,name:a,symbol:i,balance:o,defaultTokenImage:r},`${i}-${a}`)))]})})]})}function He({testId:e,options:n,optionsLoading:r,subtext:a,onSelectChange:o,textAlign:s,errorMessage:l,disabled:d,selectedOption:p,coinSelectorHeading:h,defaultTokenImage:u,environment:g=O.PRODUCTION,theme:m=z.DARK}){const[f,L]=i.useState(!1),k=i.useMemo((()=>n.map((t=>({...t,testId:e,onClick:()=>{o(t.id),L(!1)}})))),[n,o,L]),x=n?.find((e=>e.id===p))??p;return c(b,{children:[t(Ee,{heading:h,options:k,defaultTokenImage:u,optionsLoading:r??!1,visible:f,onCloseDrawer:()=>L(!1)}),t(Z,{testId:`${e}-select-control`,textAlign:s??"left",subtext:l?void 0:a,isErrored:!!l,errorMessage:l,children:t(T,{testId:`${e}-select`,size:"large",defaultLabel:"Select token",targetClickOveride:()=>L(!0),selectedOption:(()=>{if(p&&0!==n.length&&n.find((e=>e.id===p)))return p})(),sx:{minw:"170px"},children:x&&c(T.Option,{optionKey:x.id,testId:x.testId,disabled:d,children:[!x.icon&&t(T.Option.Icon,{icon:"Coins",variant:"bold"}),x.icon&&t(T.Option.FramedImage,{use:t(ee,{environment:g,theme:m,src:x.icon,name:x.name}),circularFrame:!0,sx:{background:"base.color.translucent.standard.100"}}),t(T.Option.Label,{children:x.symbol})]},x.id)})})]})}function Se({testId:e,value:n,placeholder:r,errorMessage:a,validator:i,onTextInputChange:o,onTextInputBlur:s,onTextInputFocus:l,onTextInputEnter:c,textAlign:d,type:p,subtext:h,maxButtonClick:u,disabled:b,inputMode:g}){return t(Z,{testId:`${e}-text-control`,textAlign:d??"left",subtext:a?void 0:h,isErrored:!!a,errorMessage:a,sx:{width:"100%"},children:t(W,{testId:`${e}-text`,onChange:e=>((e,t)=>{let n=e.target.value;"number"===p&&"."===n&&(n="0."),i(n)?o(n):o(t??"")})(e,n),sizeVariant:"large",value:n,inputMode:g,validationStatus:a?"error":"success",placeholder:r,onBlur:e=>{if(!s)return;const t=e.target.value;i(t)&&s(t)},onFocus:e=>{if(!l)return;const t=e.target.value;i(t)&&l(t)},onKeyDown:e=>{c&&"Enter"===e.key&&c()},disabled:b,hideClearValueButton:!0,sx:{minWidth:"100%"},children:u&&t(W.Button,{testId:`${e}-max-button`,onClick:u,disabled:b,children:"max"})})})}const Ae={display:"flex",flexDirection:"column",height:"100%",padding:"16px 16px 0 16px"},De={display:"flex",flexDirection:"column",gap:"10px",height:"100%"},Pe={display:"flex",width:"100%"},Be=e=>({width:"65%",color:e?"base.color.text.body.primary":"base.color.text.body.secondary"}),Fe={width:"35%"},Te={display:"flex",flexDirection:"column",rowGap:"base.spacing.x2"};function Ze({boldLabel:e,label:n,amount:r,fiatAmount:a,tokenSymbol:i,prefix:o=""}){const s=n.toLowerCase().replace(" ","-");return c(b,{sx:Pe,testId:`fee-item-${s}`,children:[t(A,{sx:Be(e),children:n}),t(N,{testId:s,sx:Fe,price:`${o}${i} ${r}`,fiatAmount:a})]})}function ze({fees:e,children:n,visible:r,onCloseDrawer:a,totalFiatAmount:i,totalAmount:o,tokenSymbol:s,loading:l=!1}){const{t:d}=v();return c(B,{headerBarTitle:d("drawers.feesBreakdown.heading"),size:"threeQuarter",onCloseDrawer:a,visible:r,children:[t(B.Target,{children:n}),c(B.Content,{testId:"fees-breakdown-content",sx:Ae,children:[c(b,{sx:De,children:[l&&c(b,{sx:Te,children:[t(F,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--1"}),t(F,{shimmer:!0,emphasized:!0,testId:"balance-item-shimmer--2"})]}),!l&&e.map((({label:e,amount:n,fiatAmount:r,prefix:a,token:i})=>t(Ze,{label:e,amount:n,fiatAmount:r,tokenSymbol:i.symbol??s,prefix:a},e))),o&&c(_,{children:[t(w,{size:"xSmall"}),t(Ze,{label:d("drawers.feesBreakdown.total"),amount:$(o),fiatAmount:i?`≈ ${d("drawers.feesBreakdown.fees.fiatPricePrefix")}${i}`:R("0"),tokenSymbol:s,boldLabel:!0},d("drawers.feesBreakdown.total"))]})]}),t(P,{})]})]})}const We={backgroundColor:"base.color.translucent.emphasis.100"},Ne={marginBottom:"base.spacing.x4",color:"base.color.text.body.secondary"};function _e({gasFeeValue:e,gasFeeToken:n,gasFeeFiatValue:r,fees:a,onFeesClick:o,loading:s,sx:l}){const[d,p]=i.useState(!1),{t:h}=v();if(!e&&!s)return null;const u=R($(e)),g=n?.symbol;return c(_,{children:[c(ye,{targetClickOveride:()=>{p(!0),o?.()},sx:{...We,paddingBottom:"base.spacing.x2",...l},children:[t(ye.TargetLeftSlot,{children:t(A,{size:"medium",sx:Ne,children:h("drawers.feesBreakdown.heading")})}),c(ye.TargetRightSlot,{children:[s&&t(b,{sx:{width:"218px",position:"relative"},children:t(b,{sx:{display:"block",position:"absolute",top:"-15px",width:"100%",height:"68px",WebkitMaskPosition:"right center",WebkitMaskRepeat:"no-repeat",WebkitMaskSize:"contain",WebkitMaskImage:'url(\'data:image/svg+xml;utf8, <svg xmlns="http://www.w3.org/2000/svg" width="196" height="96"><path d="M182.85 55.2Q181.65 54 180 54h-56q-1.7 0-2.85 1.2Q120 56.35 120 58v4q0 1.7 1.15 2.85Q122.3 66 124 66h56q1.65 0 2.85-1.15Q184 63.7 184 62v-4q0-1.65-1.15-2.8m0-22Q181.65 32 180 32H68q-1.7 0-2.85 1.2Q64 34.35 64 36v8q0 1.7 1.15 2.85Q66.3 48 68 48h112q1.65 0 2.85-1.15Q184 45.7 184 44v-8q0-1.65-1.15-2.8Z" id="a"/></svg>\')'},rc:t("span",{}),children:t(V,{rc:t("span",{})})})}),!s&&t(N,{testId:"fees-gas-fee__priceDisplay",fiatAmount:`≈ ${h("drawers.feesBreakdown.fees.fiatPricePrefix")}${r}`,price:`~ ${g} ${R($(u))}`})]})]}),t(ze,{tokenSymbol:g??"",fees:a,visible:d,loading:s,onCloseDrawer:()=>p(!1)})]})}const $e={display:"flex",flexDirection:"column",alignItems:"center",paddingY:"50px",paddingX:"base.spacing.x4",height:"100%"},Re={color:"base.color.text.body.secondary",fontFamily:"base.font.family.heading.secondary",textAlign:"center",marginTop:"15px"},Ve={display:"flex",flexDirection:"column",justifyContent:"flex-end",gap:"8px",height:"100%",width:"100%"},Qe={width:"100%",height:"64px"};function Xe({onCloseDrawer:e,visible:n,showHeaderBar:r,onRetry:a}){const{t:i}=v();return t(B,{headerBarTitle:void 0,size:"full",onCloseDrawer:e,visible:n,showHeaderBar:r,children:t(B.Content,{children:c(b,{sx:$e,children:[t(Q,{icon:"Information",colorVariant:"guidance",iconVariant:"bold"}),c(S,{size:"small",sx:Re,testId:"transaction-rejected-heading",children:[i("drawers.transactionFailed.content.heading1"),t("br",{}),i("drawers.transactionFailed.content.heading2")]}),c(A,{sx:Re,children:[i("drawers.transactionFailed.content.body1"),t("br",{}),i("drawers.transactionFailed.content.body2")]}),c(b,{sx:Ve,children:[t(D,{sx:Qe,variant:"tertiary",onClick:a,children:i("drawers.transactionFailed.buttons.retry")}),t(D,{sx:Qe,variant:"tertiary",onClick:e,testId:"transaction-rejected-cancel-button",children:i("drawers.transactionFailed.buttons.cancel")})]})]})})})}function qe(){return t(b,{testId:"wallet-approve-hero",sx:{...X,background:"base.color.translucent.emphasis.100"},children:t(b,{sx:{...q,...G},children:c("svg",{width:"430",height:"305",viewBox:"0 0 430 305",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t("path",{d:"M227.517 171.325L182.178 85.6034C181.033 83.4446 179.583 82.3652 178.156 82.3652C175.711 82.3652 174.322 84.1157 172.863 86.6218L137.285 164.056L183.689 253.776L227.522 171.32L227.517 171.325Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M226.841 137.597C228.497 133.997 228.338 128.188 226.484 124.682L197.866 70.5767C196.012 67.0757 193.14 67.1508 191.484 70.7503L164.936 128.427L168.399 134.936L165.396 141.464L168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992L165.846 154.52L169.3 161.048L166.287 167.562L187.922 208.465C189.776 211.966 192.648 211.891 194.304 208.292L226.845 137.597H226.841Z",fill:"#F191FA"}),t("path",{d:"M168.85 147.992L165.396 141.464L168.399 134.936L164.936 128.427L191.484 70.7503C193.14 67.1508 196.012 67.0757 197.866 70.5767L226.484 124.682C228.338 128.188 228.497 133.997 226.841 137.597H226.845L194.304 208.292C192.648 211.891 189.776 211.966 187.922 208.465L166.287 167.562L169.3 161.048L165.846 154.52L168.85 147.992ZM168.85 147.992L171.853 141.464L175.307 147.992L172.304 154.52L168.85 147.992Z",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M159.384 154.519L155.93 147.991L158.939 141.463L162.388 147.991L159.384 154.519Z",fill:"#F191FA"}),t("path",{d:"M203.136 132.773C202.484 134.19 201.353 134.223 200.621 132.843L196.101 124.297C195.369 122.917 195.308 120.627 195.961 119.21L200.621 109.082C201.273 107.665 202.404 107.632 203.136 109.012L207.656 117.558C208.388 118.938 208.449 121.228 207.796 122.645L203.136 132.773Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M206.22 114.837L204.68 118.183C204.174 119.286 203.291 119.309 202.724 118.234L199.345 111.852",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M197.542 127.015L199.058 123.716C199.565 122.613 200.447 122.589 201.015 123.664L204.394 130.046",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M293.369 250.453L252.263 172.733C249.936 168.331 243.957 164.731 238.982 164.731H173.769C171.516 164.731 169.306 164.14 167.358 163.014L162.876 160.423C160.929 159.297 158.718 158.706 156.466 158.706H147.896L141.237 164.534L189.659 256C190.612 257.493 192.452 258.417 194.939 258.417L287.456 258.445L291.473 260.904L293.904 255.733H293.895C294.556 254.315 294.449 252.471 293.379 250.448L293.369 250.453Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M232.923 169.903L235.354 164.731",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),t("path",{d:"M249.832 177.908C247.505 173.506 241.526 169.907 236.551 169.907L142.025 169.878C139.355 169.878 137.436 168.813 136.549 167.128L186.313 261.185C187.266 262.677 189.105 263.602 191.592 263.602L286.118 263.63C291.098 263.63 293.266 260.03 290.938 255.633L249.832 177.913V177.908Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M255.328 198.77L245.041 179.313C243.581 176.548 240.235 174.042 237.161 174.042L143.555 173.93",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M188.64 259.548L282.448 259.558C285.569 259.558 286.418 257.577 285.198 255.264L276.103 238.064",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M150.238 159.776C150.965 161.151 149.539 163.338 147.051 164.652C144.564 165.966 141.96 165.919 141.227 164.539C140.495 163.159 141.927 160.977 144.414 159.663C145.62 159.025 146.854 158.71 147.891 158.71C148.99 158.71 149.863 159.067 150.238 159.776Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M147.826 161.052C148.164 161.69 147.502 162.704 146.348 163.314C145.193 163.924 143.983 163.9 143.645 163.262C143.307 162.624 143.969 161.61 145.123 161C145.681 160.705 146.254 160.559 146.737 160.559C147.249 160.559 147.652 160.723 147.826 161.057V161.052Z",fill:"black"}),t("path",{d:"M171.652 85.828L136.755 161.652C135.788 163.75 135.784 165.669 136.549 167.124C136.549 167.124 137.717 169.874 142.025 169.874C146.333 169.874 151.754 169.907 151.754 169.907L153.115 167.5L143.419 167.467C139.669 167.467 137.637 165.186 139.205 161.779L174.163 85.8233C175.223 83.5238 176.678 82.3646 178.156 82.3646C178.156 82.3646 173.431 81.961 171.652 85.8233V85.828Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M273.579 230.377L277.263 229.767L287.024 238.458L278.347 222.051L270.373 223.609L273.579 230.377Z",fill:"black"}),t("path",{d:"M274.968 235.918C272.495 231.239 272.777 228.33 278.296 226.565C281.262 225.617 283.951 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.049 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495L255.399 206.127L271.073 235.923H274.973L274.968 235.918Z",fill:"#EBE9E9"}),t("path",{d:"M274.968 235.918C272.495 231.239 272.776 228.33 278.295 226.565C281.261 225.617 283.95 224.073 286.255 221.98L291.328 217.371C295.725 213.378 297.048 205.813 294.275 200.561C291.497 195.31 285.626 194.282 281.233 198.276L275.071 203.874C272.983 205.775 270.327 206.939 267.516 207.206C261.79 207.746 259.392 206.456 256.769 201.495",stroke:"black",strokeWidth:"0.469297",strokeMiterlimit:"10"}),t("path",{d:"M289.926 200.125C287.265 199.276 284.074 201.829 282.793 205.832C281.512 209.835 282.629 213.768 285.29 214.617L286.533 215.016L291.17 200.524L289.926 200.125Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M293.683 209.321C294.963 205.319 293.846 201.386 291.187 200.535C288.528 199.685 285.335 202.239 284.055 206.241C282.775 210.242 283.892 214.176 286.551 215.026C289.21 215.877 292.403 213.322 293.683 209.321Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M213.26 224.182C211.237 224.182 208.816 222.722 207.868 220.934L189.021 185.301C188.077 183.513 188.955 182.053 190.978 182.053L231.3 182.039C233.322 182.039 235.744 183.499 236.692 185.287L255.539 220.92C256.482 222.708 255.604 224.168 253.582 224.168L213.26 224.182Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M214.334 222.319C212.312 222.319 209.89 220.859 208.942 219.071L190.095 183.438C189.884 183.034 189.767 182.649 189.729 182.292C188.64 182.776 188.302 183.944 189.02 185.301L207.867 220.934C208.811 222.722 211.237 224.182 213.26 224.182L253.582 224.168C255.144 224.168 256.022 223.29 255.9 222.065C255.557 222.22 255.14 222.305 254.652 222.305L214.33 222.319H214.334Z",fill:"#EBE9E9",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M231.586 203.083L233.646 206.978H228.756H223.871H218.981H215.513C214.733 206.978 214.363 207.489 214.691 208.109L215.555 209.737C215.883 210.361 216.794 210.873 217.577 210.873H221.046H225.936L227.395 213.632C227.724 214.256 228.634 214.763 229.418 214.763H231.464C232.243 214.763 232.614 214.252 232.285 213.628L230.826 210.868H235.716H239.184C239.963 210.868 240.334 210.352 240.005 209.732L238.546 206.973L237.086 204.214C236.758 203.589 235.847 203.083 235.063 203.083H231.595H231.586Z",fill:"#F191FA"}),t("path",{d:"M214.855 199.191L216.315 201.951C216.648 202.575 217.554 203.086 218.342 203.086H221.81H226.696H231.586L230.126 200.322C229.793 199.698 228.887 199.187 228.099 199.187H224.631H219.746H214.855V199.191Z",fill:"#F191FA"}),t("path",{d:"M214.986 187.501C214.207 187.501 213.837 188.013 214.165 188.632L215.625 191.392H210.735H207.266C206.487 191.392 206.117 191.903 206.445 192.527L207.905 195.287L209.364 198.046C209.693 198.671 210.603 199.177 211.387 199.177H214.855L212.795 195.282H217.685H222.57H227.46H230.928C231.707 195.282 232.078 194.771 231.75 194.147L230.891 192.523C230.558 191.899 229.652 191.387 228.868 191.387H225.4H220.51L219.051 188.628C218.722 188.003 217.812 187.497 217.028 187.497H214.982L214.986 187.501Z",fill:"#F191FA"}),t("path",{d:"M214.098 243.795L212.428 240.641C211.78 239.412 210.109 238.412 208.725 238.412H202.849L200.428 233.832C199.78 232.602 198.114 231.603 196.725 231.603H191.751C191 231.603 190.483 231.898 190.263 232.363L189.066 234.906L191.464 235.826L192.835 238.417H186.959C186.208 238.417 185.692 238.712 185.471 239.177L184.275 241.721L186.612 242.528L187.288 243.804C187.935 245.034 189.606 246.033 190.99 246.033H196.866L199.287 250.614C199.935 251.843 201.601 252.843 202.99 252.843H205.032L208.256 254.631L209.452 252.087C209.635 251.693 209.607 251.177 209.307 250.614L206.885 246.033H210.194L213.057 247.817L214.253 245.273C214.441 244.879 214.408 244.363 214.108 243.8L214.098 243.795Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.529 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.529 234.146H190.554C189.165 234.146 188.564 235.151 189.212 236.38L191.634 240.961H185.758C184.369 240.961 183.763 241.97 184.416 243.195L186.086 246.348C186.734 247.578 188.405 248.577 189.789 248.577H195.665L198.086 253.158C198.734 254.387 200.4 255.387 201.789 255.387H206.764C208.153 255.387 208.753 254.383 208.106 253.153L205.684 248.573H211.56C212.949 248.573 213.554 247.564 212.902 246.339Z",fill:"black",stroke:"black",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M208.107 253.158L205.685 248.573",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M191.634 240.96H185.758",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M212.902 246.339L211.231 243.185C210.584 241.956 208.913 240.956 207.528 240.956H201.653L199.231 236.376C198.584 235.151 196.918 234.146 195.528 234.146H190.554",stroke:"#EBE9E9",strokeWidth:"0.469297",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M356.061 232.632L355.632 231L354 231.429L354.429 233.061L356.061 232.632Z",fill:"white"}),t("path",{d:"M57.6531 168.341L57.1006 166.24L54.9996 166.793L55.5521 168.894L57.6531 168.341Z",fill:"white"}),t("path",{d:"M103.489 244.345L101.345 244L101 246.145L103.144 246.49L103.489 244.345Z",fill:"white"}),t("path",{d:"M341.286 111.905L341.905 110.619L340.619 110L340 111.286L341.286 111.905Z",fill:"white"}),t("path",{d:"M323.144 179.08L322.592 176.979L320.491 177.531L321.043 179.632L323.144 179.08Z",fill:"white"}),t("path",{d:"M328.919 177.658L329.538 176.372L328.252 175.753L327.633 177.039L328.919 177.658Z",fill:"white"}),t("path",{d:"M88.1441 141.383L87.2188 140.296L86.1321 141.221L87.0574 142.308L88.1441 141.383Z",fill:"white"}),t("path",{d:"M258.286 89.9052L258.905 88.6191L257.619 88L257 89.2861L258.286 89.9052Z",fill:"white"})]})})})}const Ge=async({checkout:e,provider:t,allowTokenListType:n,chainId:r,allowZero:a=!1,retryPolicy:i=J})=>{const o=r||(await e.getNetworkInfo({provider:t})).chainId,s=await t.getSigner().getAddress(),l=await te((()=>e.getAllBalances({provider:t,walletAddress:s,chainId:o})),{...i});if(void 0===l)return;const c=await e.getTokenAllowList({chainId:o,type:n}),d=new Map;c.tokens.forEach((e=>d.set(e.address?.toLowerCase()||K,!0)));const p=l.balances.filter((e=>!(e.balance.lte(0)&&!a)&&d.get(e.token.address?.toLowerCase()||K))).map((t=>({...t,token:{...t.token,icon:U(e.config.environment,Y(t.token.address)?t.token.symbol:t.token.address??"")}})))??[];return c.tokens=c.tokens.map((t=>({...t,icon:U(e.config.environment,Y(t.address)?t.symbol:t.address??"")}))),{allowList:c,allowedBalances:p}};export{ye as A,_e as F,Oe as N,He as S,Se as T,qe as W,Xe as a,Ge as g};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cF as t,cG as n,cH as i,cI as e,cJ as r,cK as o,cL as s,cM as a,cN as u,cO as c,cP as l,cQ as d,cR as h,cS as v,cT as f,cU as p,cV as g,cW as y,cX as m,cY as w}from"./index-9bf3a185.js";import{i as b}from"./is-plan-event-enabled-80f76ce6.js";function _(t){return t.toLowerCase().replace(".","").replace(/\s+/g,"-")}function S(t,n){return void 0===n&&(n=!1),n?btoa(t).replace(/=/g,""):void 0}function k(r,s,a,u){return t(this,void 0,void 0,(function(){var t,c,l,d,h,v;return n(this,(function(n){switch(n.label){case 0:t=_(s),c=S(t,u),l=e(),d="".concat(l,"/integrations/").concat(null!=c?c:t,"/").concat(a,"/").concat(null!=c?c:t,".dynamic.js.gz"),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,i(d)];case 2:return n.sent(),function(t,n,i){var e,r;try{var s=(null!==(r=null===(e=null===window||void 0===window?void 0:window.performance)||void 0===e?void 0:e.getEntriesByName(t,"resource"))&&void 0!==r?r:[])[0];s&&n.stats.gauge("legacy_destination_time",Math.round(s.duration),o([i],s.duration<100?["cached"]:[],!0))}catch(t){}}(d,r,s),[3,4];case 3:throw h=n.sent(),r.stats.gauge("legacy_destination_time",-1,["plugin:".concat(s),"failed"]),h;case 4:return v=window["".concat(t,"Deps")],[4,Promise.all(v.map((function(t){return i(l+t+".gz")})))];case 5:return n.sent(),window["".concat(t,"Loader")](),[2,window["".concat(t,"Integration")]]}}))}))}function z(i,e){return t(this,void 0,void 0,(function(){var r,o=this;return n(this,(function(a){switch(a.label){case 0:return r=[],s()?[2,e]:[4,f((function(){return e.length>0&&m()}),(function(){return t(o,void 0,void 0,(function(){var t,o;return n(this,(function(n){switch(n.label){case 0:return(t=e.pop())?[4,y(t,i)]:[2];case 1:return o=n.sent(),o instanceof w||r.push(t),[2]}}))}))}))];case 1:return a.sent(),r.map((function(t){return e.pushWithBackoff(t)})),[2,e]}}))}))}var I=function(){function i(t,n,i,e,r,o){void 0===e&&(e={}),this.options={},this.type="destination",this.middleware=[],this._ready=!1,this._initialized=!1,this.flushing=!1,this.name=t,this.version=n,this.settings=a({},e),this.disableAutoISOConversion=r.disableAutoISOConversion||!1,this.integrationSource=o,this.settings.type&&"browser"===this.settings.type&&delete this.settings.type,this.options=r,this.buffer=r.disableClientPersistence?new p(4,[]):new g(4,"".concat(i,":dest-").concat(t)),this.scheduleFlush()}return i.prototype.isLoaded=function(){return this._ready},i.prototype.ready=function(){var t;return null!==(t=this.onReady)&&void 0!==t?t:Promise.resolve()},i.prototype.load=function(i,e){var r;return t(this,void 0,void 0,(function(){var t,o,s=this;return n(this,(function(n){switch(n.label){case 0:return this._ready||void 0!==this.onReady?[2]:null===(r=this.integrationSource)||void 0===r?[3,1]:(o=r,[3,3]);case 1:return[4,k(i,this.name,this.version,this.options.obfuscate)];case 2:o=n.sent(),n.label=3;case 3:t=o,this.integration=function(t,n,i){var e;"Integration"in t?(t({user:function(){return i.user()},addIntegration:function(){}}),e=t.Integration):e=t;var r=new e(n);return r.analytics=i,r}(t,this.settings,e),this.onReady=new Promise((function(t){s.integration.once("ready",(function(){s._ready=!0,t(!0)}))})),this.onInitialize=new Promise((function(t){s.integration.on("initialize",(function(){s._initialized=!0,t(!0)}))}));try{i.stats.increment("analytics_js.integration.invoke",1,["method:initialize","integration_name:".concat(this.name)]),this.integration.initialize()}catch(t){throw i.stats.increment("analytics_js.integration.invoke.error",1,["method:initialize","integration_name:".concat(this.name)]),t}return[2]}}))}))},i.prototype.unload=function(i,o){return function(i,o,s){return t(this,void 0,void 0,(function(){var t,a,u,c;return n(this,(function(n){return t=e(),a=_(i),u=S(i,s),c="".concat(t,"/integrations/").concat(null!=u?u:a,"/").concat(o,"/").concat(null!=u?u:a,".dynamic.js.gz"),[2,r(c)]}))}))}(this.name,this.version,this.options.obfuscate)},i.prototype.addMiddleware=function(){for(var t,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];this.middleware=(t=this.middleware).concat.apply(t,n)},i.prototype.shouldBuffer=function(t){return"page"!==t.event.type&&(s()||!1===this._ready||!1===this._initialized)},i.prototype.send=function(i,e,r){var o,s;return t(this,void 0,void 0,(function(){var t,l,d,h,v,f;return n(this,(function(n){switch(n.label){case 0:if(this.shouldBuffer(i))return this.buffer.push(i),this.scheduleFlush(),[2,i];if(t=null===(s=null===(o=this.options)||void 0===o?void 0:o.plan)||void 0===s?void 0:s.track,l=i.event.event,t&&l&&"Segment.io"!==this.name){if(d=t[l],!b(t,d))return i.updateEvent("integrations",a(a({},i.event.integrations),{All:!1,"Segment.io":!0})),i.cancel(new u({retry:!1,reason:"Event ".concat(l," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,i];if(i.updateEvent("integrations",a(a({},i.event.integrations),null==d?void 0:d.integrations)),(null==d?void 0:d.enabled)&&!1===(null==d?void 0:d.integrations[this.name]))return i.cancel(new u({retry:!1,reason:"Event ".concat(l," disabled for integration ").concat(this.name," in tracking plan"),type:"Dropped by plan"})),[2,i]}return[4,c(this.name,i.event,this.middleware)];case 1:if(null===(h=n.sent()))return[2,i];v=new e(h,{traverse:!this.disableAutoISOConversion}),i.stats.increment("analytics_js.integration.invoke",1,["method:".concat(r),"integration_name:".concat(this.name)]),n.label=2;case 2:return n.trys.push([2,5,,6]),this.integration?[4,this.integration.invoke.call(this.integration,r,v)]:[3,4];case 3:n.sent(),n.label=4;case 4:return[3,6];case 5:throw f=n.sent(),i.stats.increment("analytics_js.integration.invoke.error",1,["method:".concat(r),"integration_name:".concat(this.name)]),f;case 6:return[2,i]}}))}))},i.prototype.track=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Track,"track")]}))}))},i.prototype.page=function(i){var e;return t(this,void 0,void 0,(function(){var t=this;return n(this,(function(n){return(null===(e=this.integration)||void 0===e?void 0:e._assumesPageview)&&!this._initialized&&this.integration.initialize(),[2,this.onInitialize.then((function(){return t.send(i,l.Page,"page")}))]}))}))},i.prototype.identify=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Identify,"identify")]}))}))},i.prototype.alias=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Alias,"alias")]}))}))},i.prototype.group=function(i){return t(this,void 0,void 0,(function(){return n(this,(function(t){return[2,this.send(i,l.Group,"group")]}))}))},i.prototype.scheduleFlush=function(){var i=this;this.flushing||setTimeout((function(){return t(i,void 0,void 0,(function(){var t;return n(this,(function(n){switch(n.label){case 0:return this.flushing=!0,t=this,[4,z(this,this.buffer)];case 1:return t.buffer=n.sent(),this.flushing=!1,this.buffer.todo>0&&this.scheduleFlush(),[2]}}))}))}),5e3*Math.random())},i}();function j(t,n,i,e,r,s){var u,c;if(void 0===i&&(i={}),void 0===e&&(e={}),d())return[];n.plan&&((e=null!=e?e:{}).plan=n.plan);var l=null!==(c=null===(u=n.middlewareSettings)||void 0===u?void 0:u.routingRules)&&void 0!==c?c:[],f=n.integrations,p=e.integrations,g=h(n,null!=e?e:{}),y=null==s?void 0:s.reduce((function(t,n){var i;return a(a({},t),((i={})[function(t){return("Integration"in t?t.Integration:t).prototype.name}(n)]=n,i))}),{}),m=new Set(o(o([],Object.keys(f).filter((function(t){return function(t,n){var i,e=n.type,r=n.bundlingStatus,o=n.versionSettings,s="unbundled"!==r&&("browser"===e||(null===(i=null==o?void 0:o.componentTypes)||void 0===i?void 0:i.includes("browser")));return!t.startsWith("Segment")&&"Iterable"!==t&&s}(t,f[t])})),!0),Object.keys(y||{}).filter((function(t){return v(f[t])||v(null==p?void 0:p[t])})),!0));return Array.from(m).filter((function(t){return!function(t,n){var i=!1===n.All&&void 0===n[t];return!1===n[t]||i}(t,i)})).map((function(n){var i=function(t){var n,i,e,r;return null!==(r=null!==(i=null===(n=null==t?void 0:t.versionSettings)||void 0===n?void 0:n.override)&&void 0!==i?i:null===(e=null==t?void 0:t.versionSettings)||void 0===e?void 0:e.version)&&void 0!==r?r:"latest"}(f[n]),o=new I(n,i,t,g[n],e,null==y?void 0:y[n]);return l.filter((function(t){return t.destinationName===n})).length>0&&r&&o.addMiddleware(r),o}))}export{I as LegacyDestination,j as ajsDestinations};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{cD as r,cE as e}from"./index-9bf3a185.js";for(var t={},n={},o=[],a=0;a<64;)o[a]=0|4294967296*Math.sin(++a%Math.PI);var i=r(Object.freeze({__proto__:null,default:function(r){var e,t,n,i=[e=1732584193,t=4023233417,~e,~t],u=[],f=unescape(encodeURI(r))+"",c=f.length;for(r=--c/4+2|15,u[--r]=8*c;~c;)u[c>>2]|=f.charCodeAt(c)<<8*c--;for(a=f=0;a<r;a+=16){for(c=i;f<64;c=[n=c[3],e+((n=c[0]+[e&t|~e&n,n&e|~n&t,e^t^n,t^(e|~n)][c=f>>4]+o[f]+~~u[a|15&[f,5*f+1,3*f+5,7*f][c]])<<(c=[7,12,17,22,5,9,14,20,4,11,16,23,6,10,15,21][4*c+f++%4])|n>>>-c),e,t])e=0|c[1],t=c[2];for(f=4;f;)i[--f]+=c[f]}for(r="";f<32;)r+=(i[f>>3]>>4*(1^f++)&15).toString(16);return r}})),u={exports:{}};u.exports=function(r,e,t,n,o){for(e=e.split?e.split("."):e,n=0;n<e.length;n++)r=r?r[e[n]]:o;return r===o?t:r};var f=u.exports,c=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;
|
|
2
2
|
/**
|
|
3
3
|
* @license Apache-2.0
|
|
4
4
|
*
|
|
@@ -204,7 +204,7 @@ function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}();
|
|
|
204
204
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
205
205
|
* See the License for the specific language governing permissions and
|
|
206
206
|
* limitations under the License.
|
|
207
|
-
*/var
|
|
207
|
+
*/var D=M,G=function(r){var e,t,n;if(null==r)return J.call(r);t=r[H],e=C(r,H);try{r[H]=void 0}catch(e){return J.call(r)}return n=J.call(r),e?r[H]=t:delete r[H],n},L=U()?G:D,R=L,V="function"==typeof Uint32Array;
|
|
208
208
|
/**
|
|
209
209
|
* @license Apache-2.0
|
|
210
210
|
*
|
|
@@ -221,7 +221,7 @@ function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}();
|
|
|
221
221
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
222
222
|
* See the License for the specific language governing permissions and
|
|
223
223
|
* limitations under the License.
|
|
224
|
-
*/var W="function"==typeof Uint32Array?Uint32Array:null,
|
|
224
|
+
*/var W="function"==typeof Uint32Array?Uint32Array:null,B=function(r){return V&&r instanceof Uint32Array||"[object Uint32Array]"===R(r)},Q=W;
|
|
225
225
|
/**
|
|
226
226
|
* @license Apache-2.0
|
|
227
227
|
*
|
|
@@ -238,7 +238,7 @@ function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}();
|
|
|
238
238
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
239
239
|
* See the License for the specific language governing permissions and
|
|
240
240
|
* limitations under the License.
|
|
241
|
-
*/var
|
|
241
|
+
*/var Y=function(){var r,e;if("function"!=typeof Q)return!1;try{e=new Q(e=[1,3.14,-3.14,4294967296,4294967297]),r=B(e)&&1===e[0]&&3===e[1]&&4294967293===e[2]&&0===e[3]&&1===e[4]}catch(e){r=!1}return r};
|
|
242
242
|
/**
|
|
243
243
|
* @license Apache-2.0
|
|
244
244
|
*
|
|
@@ -255,7 +255,7 @@ function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}();
|
|
|
255
255
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
256
256
|
* See the License for the specific language governing permissions and
|
|
257
257
|
* limitations under the License.
|
|
258
|
-
*/var
|
|
258
|
+
*/var q="function"==typeof Uint32Array?Uint32Array:void 0,z=
|
|
259
259
|
/**
|
|
260
260
|
* @license Apache-2.0
|
|
261
261
|
*
|
|
@@ -273,7 +273,7 @@ function(){return"function"==typeof Symbol&&"symbol"==typeof Symbol("foo")}();
|
|
|
273
273
|
* See the License for the specific language governing permissions and
|
|
274
274
|
* limitations under the License.
|
|
275
275
|
*/
|
|
276
|
-
function(){throw new Error("not implemented")},K=
|
|
276
|
+
function(){throw new Error("not implemented")},K=Y()?q:z,X=L,Z="function"==typeof Float64Array;
|
|
277
277
|
/**
|
|
278
278
|
* @license Apache-2.0
|
|
279
279
|
*
|
|
@@ -342,7 +342,7 @@ function(){throw new Error("not implemented")},K=Q()?Y:q,X=D,Z="function"==typeo
|
|
|
342
342
|
* See the License for the specific language governing permissions and
|
|
343
343
|
* limitations under the License.
|
|
344
344
|
*/
|
|
345
|
-
function(){throw new Error("not implemented")},ar=tr()?nr:or,ir=
|
|
345
|
+
function(){throw new Error("not implemented")},ar=tr()?nr:or,ir=L,ur="function"==typeof Uint8Array;
|
|
346
346
|
/**
|
|
347
347
|
* @license Apache-2.0
|
|
348
348
|
*
|
|
@@ -411,7 +411,7 @@ function(){throw new Error("not implemented")},ar=tr()?nr:or,ir=D,ur="function"=
|
|
|
411
411
|
* See the License for the specific language governing permissions and
|
|
412
412
|
* limitations under the License.
|
|
413
413
|
*/
|
|
414
|
-
function(){throw new Error("not implemented")},vr=sr()?pr:yr,dr=
|
|
414
|
+
function(){throw new Error("not implemented")},vr=sr()?pr:yr,dr=L,hr="function"==typeof Uint16Array;
|
|
415
415
|
/**
|
|
416
416
|
* @license Apache-2.0
|
|
417
417
|
*
|
|
@@ -565,7 +565,7 @@ function(){throw new Error("not implemented")},Or={uint16:_r()?Ar:jr,uint8:vr};
|
|
|
565
565
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
566
566
|
* See the License for the specific language governing permissions and
|
|
567
567
|
* limitations under the License.
|
|
568
|
-
*/S(Cr,"assign",xr);var Hr=Cr,Jr=K,
|
|
568
|
+
*/S(Cr,"assign",xr);var Hr=Cr,Jr=K,Dr=!0===Sr?1:0,Gr=new ar(1),Lr=new Jr(Gr.buffer);
|
|
569
569
|
/**
|
|
570
570
|
* @license Apache-2.0
|
|
571
571
|
*
|
|
@@ -582,7 +582,7 @@ function(){throw new Error("not implemented")},Or={uint16:_r()?Ar:jr,uint8:vr};
|
|
|
582
582
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
583
583
|
* See the License for the specific language governing permissions and
|
|
584
584
|
* limitations under the License.
|
|
585
|
-
*/var Rr,Vr,Wr=function(r){return
|
|
585
|
+
*/var Rr,Vr,Wr=function(r){return Gr[0]=r,Lr[Dr]};
|
|
586
586
|
/**
|
|
587
587
|
* @license Apache-2.0
|
|
588
588
|
*
|
|
@@ -599,7 +599,7 @@ function(){throw new Error("not implemented")},Or={uint16:_r()?Ar:jr,uint8:vr};
|
|
|
599
599
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
600
600
|
* See the License for the specific language governing permissions and
|
|
601
601
|
* limitations under the License.
|
|
602
|
-
*/!0===Sr?(Rr=1,Vr=0):(Rr=0,Vr=1);var
|
|
602
|
+
*/!0===Sr?(Rr=1,Vr=0):(Rr=0,Vr=1);var Br=K,Qr={HIGH:Rr,LOW:Vr},Yr=new ar(1),qr=new Br(Yr.buffer),zr=Qr.HIGH,Kr=Qr.LOW;
|
|
603
603
|
/**
|
|
604
604
|
* @license Apache-2.0
|
|
605
605
|
*
|
|
@@ -616,7 +616,7 @@ function(){throw new Error("not implemented")},Or={uint16:_r()?Ar:jr,uint8:vr};
|
|
|
616
616
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
617
617
|
* See the License for the specific language governing permissions and
|
|
618
618
|
* limitations under the License.
|
|
619
|
-
*/var Xr=function(r,e){return
|
|
619
|
+
*/var Xr=function(r,e){return qr[zr]=r,qr[Kr]=e,Yr[0]},Zr=Xr,$r=Hr,re=Wr,ee=Zr,te=[0,0];
|
|
620
620
|
/**
|
|
621
621
|
* @license Apache-2.0
|
|
622
622
|
*
|
|
@@ -770,4 +770,4 @@ function(r){return Math.abs(r)};
|
|
|
770
770
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
771
771
|
* See the License for the specific language governing permissions and
|
|
772
772
|
* limitations under the License.
|
|
773
|
-
*/ke.dset=function(r,e,t){e.split&&(e=e.split("."));for(var n,o,a=0,i=e.length,u=r;a<i&&"__proto__"!==(o=e[a++])&&"constructor"!==o&&"prototype"!==o;)u=u[o]=a===i?t:typeof(n=u[o])==typeof e?n:0*e[a]!=0||~(""+e[a]).indexOf(".")?{}:[]};var Ne={},Se=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.unset=void 0;var Ee=Se(f);Ne.unset=function(r,e){if((0,Ee.default)(r,e)){for(var t=e.split("."),n=t.pop();t.length&&"\\"===t[t.length-1].slice(-1);)n=t.pop().slice(0,-1)+"."+n;for(;t.length;)r=r[e=t.shift()];return delete r[n]}return!0};var Ue=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(n,"__esModule",{value:!0});var Ie=Ue(i),Pe=Ue(f),Me=Ue(Oe),Fe=ke,xe=Ne;function Te(r,e){He(r,e.drop,(function(r,e){e.forEach((function(e){return delete r[e]}))}))}function Ce(r,e){He(r,e.allow,(function(r,e){Object.keys(r).forEach((function(t){e.includes(t)||delete r[t]}))}))}function He(r,e,t){Object.entries(e).forEach((function(e){var n=e[0],o=e[1],a=function(r){"object"==typeof r&&null!==r&&t(r,o)},i=""===n?r:(0,Pe.default)(r,n);Array.isArray(i)?i.forEach(a):a(i)}))}function Je(r,e){var t=JSON.parse(JSON.stringify(r));for(var n in e.map)if(e.map.hasOwnProperty(n)){var o=e.map[n],a=n.split("."),i=void 0;if(a.length>1?(a.pop(),i=(0,Pe.default)(t,a.join("."))):i=r,"object"==typeof i){if(o.copy){var u=(0,Pe.default)(t,o.copy);void 0!==u&&(0,Fe.dset)(r,n,u)}else if(o.move){var f=(0,Pe.default)(t,o.move);void 0!==f&&(0,Fe.dset)(r,n,f),(0,xe.unset)(r,o.move)}else o.hasOwnProperty("set")&&(0,Fe.dset)(r,n,o.set);if(o.to_string){var c=(0,Pe.default)(r,n);if("string"==typeof c||"object"==typeof c&&null!==c)continue;void 0!==c?(0,Fe.dset)(r,n,JSON.stringify(c)):(0,Fe.dset)(r,n,"undefined")}}}}function
|
|
773
|
+
*/ke.dset=function(r,e,t){e.split&&(e=e.split("."));for(var n,o,a=0,i=e.length,u=r;a<i&&"__proto__"!==(o=e[a++])&&"constructor"!==o&&"prototype"!==o;)u=u[o]=a===i?t:typeof(n=u[o])==typeof e?n:0*e[a]!=0||~(""+e[a]).indexOf(".")?{}:[]};var Ne={},Se=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ne,"__esModule",{value:!0}),Ne.unset=void 0;var Ee=Se(f);Ne.unset=function(r,e){if((0,Ee.default)(r,e)){for(var t=e.split("."),n=t.pop();t.length&&"\\"===t[t.length-1].slice(-1);)n=t.pop().slice(0,-1)+"."+n;for(;t.length;)r=r[e=t.shift()];return delete r[n]}return!0};var Ue=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(n,"__esModule",{value:!0});var Ie=Ue(i),Pe=Ue(f),Me=Ue(Oe),Fe=ke,xe=Ne;function Te(r,e){He(r,e.drop,(function(r,e){e.forEach((function(e){return delete r[e]}))}))}function Ce(r,e){He(r,e.allow,(function(r,e){Object.keys(r).forEach((function(t){e.includes(t)||delete r[t]}))}))}function He(r,e,t){Object.entries(e).forEach((function(e){var n=e[0],o=e[1],a=function(r){"object"==typeof r&&null!==r&&t(r,o)},i=""===n?r:(0,Pe.default)(r,n);Array.isArray(i)?i.forEach(a):a(i)}))}function Je(r,e){var t=JSON.parse(JSON.stringify(r));for(var n in e.map)if(e.map.hasOwnProperty(n)){var o=e.map[n],a=n.split("."),i=void 0;if(a.length>1?(a.pop(),i=(0,Pe.default)(t,a.join("."))):i=r,"object"==typeof i){if(o.copy){var u=(0,Pe.default)(t,o.copy);void 0!==u&&(0,Fe.dset)(r,n,u)}else if(o.move){var f=(0,Pe.default)(t,o.move);void 0!==f&&(0,Fe.dset)(r,n,f),(0,xe.unset)(r,o.move)}else o.hasOwnProperty("set")&&(0,Fe.dset)(r,n,o.set);if(o.to_string){var c=(0,Pe.default)(r,n);if("string"==typeof c||"object"==typeof c&&null!==c)continue;void 0!==c?(0,Fe.dset)(r,n,JSON.stringify(c)):(0,Fe.dset)(r,n,"undefined")}}}}function De(r,e){return!(e.sample.percent<=0)&&(e.sample.percent>=1||(e.sample.path?function(r,e){var t=(0,Pe.default)(r,e.sample.path),n=(0,Ie.default)(JSON.stringify(t)),o=-64,a=[];Ge(n.slice(0,8),a);for(var i=0,u=0;u<64&&1!==a[u];u++)i++;if(0!==i){var f=[];Ge(n.slice(9,16),f),o-=i,a.splice(0,i),f.splice(64-i),a=a.concat(f)}return a[63]=0===a[63]?1:0,(0,Me.default)(parseInt(a.join(""),2),o)<e.sample.percent}(r,e):(t=e.sample.percent,Math.random()<=t)));var t}function Ge(r,e){for(var t=0;t<8;t++)for(var n=r[t],o=128;o>=1;o/=2)n-o>=0?(n-=o,e.push(1)):e.push(0)}n.default=function(r,e){for(var t=r,n=0,o=e;n<o.length;n++){var a=o[n];switch(a.type){case"drop":return null;case"drop_properties":Te(t,a.config);break;case"allow_properties":Ce(t,a.config);break;case"sample_event":if(De(t,a.config))break;return null;case"map_properties":Je(t,a.config);break;case"hash_properties":break;default:throw new Error('Transformer of type "'.concat(a.type,'" is unsupported.'))}}return t};var Le={},Re=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Le,"__esModule",{value:!0});var Ve=Re(f);function We(r,e){if(!Array.isArray(r))return!0===Be(r,e);var t=r[0];switch(t){case"!":return!We(r[1],e);case"or":for(var n=1;n<r.length;n++)if(We(r[n],e))return!0;return!1;case"and":for(n=1;n<r.length;n++)if(!We(r[n],e))return!1;return!0;case"=":case"!=":return function(r,e,t,n){Qe(r)&&(r=We(r,n));Qe(e)&&(e=We(e,n));"object"==typeof r&&"object"==typeof e&&(r=JSON.stringify(r),e=JSON.stringify(e));switch(t){case"=":return r===e;case"!=":return r!==e;default:throw new Error("Invalid operator in compareItems: ".concat(t))}}(Be(r[1],e),Be(r[2],e),t,e);case"<=":case"<":case">":case">=":return function(r,e,t,n){Qe(r)&&(r=We(r,n));Qe(e)&&(e=We(e,n));if("number"!=typeof r||"number"!=typeof e)return!1;switch(t){case"<=":return r<=e;case">=":return r>=e;case"<":return r<e;case">":return r>e;default:throw new Error("Invalid operator in compareNumbers: ".concat(t))}}(Be(r[1],e),Be(r[2],e),t,e);case"in":return function(r,e,t){return void 0!==e.find((function(e){return Be(e,t)===r}))}(Be(r[1],e),Be(r[2],e),e);case"contains":return function(r,e){if("string"!=typeof r||"string"!=typeof e)return!1;return-1!==r.indexOf(e)}(Be(r[1],e),Be(r[2],e));case"match":return function(r,e){if("string"!=typeof r||"string"!=typeof e)return!1;return function(r,e){var t,n;r:for(;r.length>0;){var o=void 0,a=void 0;if(o=(t=Ye(r)).star,a=t.chunk,r=t.pattern,o&&""===a)return!0;var i=qe(a,e),u=i.t,f=i.ok,c=i.err;if(c)return!1;if(!f||!(0===u.length||r.length>0)){if(o)for(var l=0;l<e.length;l++){if(u=(n=qe(a,e.slice(l+1))).t,f=n.ok,c=n.err,f){if(0===r.length&&u.length>0)continue;e=u;continue r}if(c)return!1}return!1}e=u}return 0===e.length}(e,r)}(Be(r[1],e),Be(r[2],e));case"lowercase":var o=Be(r[1],e);return"string"!=typeof o?null:o.toLowerCase();case"typeof":return typeof Be(r[1],e);case"length":return function(r){if(null===r)return 0;if(!Array.isArray(r)&&"string"!=typeof r)return NaN;return r.length}(Be(r[1],e));default:throw new Error("FQL IR could not evaluate for token: ".concat(t))}}function Be(r,e){return Array.isArray(r)?r:"object"==typeof r?r.value:(0,Ve.default)(e,r)}function Qe(r){return!!Array.isArray(r)&&(("lowercase"===r[0]||"length"===r[0]||"typeof"===r[0])&&2===r.length||("contains"===r[0]||"match"===r[0])&&3===r.length)}function Ye(r){for(var e={star:!1,chunk:"",pattern:""};r.length>0&&"*"===r[0];)r=r.slice(1),e.star=!0;var t,n=!1;r:for(t=0;t<r.length;t++)switch(r[t]){case"\\":t+1<r.length&&t++;break;case"[":n=!0;break;case"]":n=!1;break;case"*":if(!n)break r}return e.chunk=r.slice(0,t),e.pattern=r.slice(t),e}function qe(r,e){for(var t,n,o={t:"",ok:!1,err:!1};r.length>0;){if(0===e.length)return o;switch(r[0]){case"[":var a=e[0];e=e.slice(1);var i=!0;(r=r.slice(1)).length>0&&"^"===r[0]&&(i=!1,r=r.slice(1));for(var u=!1,f=0;;){if(r.length>0&&"]"===r[0]&&f>0){r=r.slice(1);break}var c,l="";if(c=(t=ze(r)).char,r=t.newChunk,t.err)return o;if(l=c,"-"===r[0]&&(l=(n=ze(r.slice(1))).char,r=n.newChunk,n.err))return o;c<=a&&a<=l&&(u=!0),f++}if(u!==i)return o;break;case"?":e=e.slice(1),r=r.slice(1);break;case"\\":if(0===(r=r.slice(1)).length)return o.err=!0,o;default:if(r[0]!==e[0])return o;e=e.slice(1),r=r.slice(1)}}return o.t=e,o.ok=!0,o.err=!1,o}function ze(r){var e={char:"",newChunk:"",err:!1};return 0===r.length||"-"===r[0]||"]"===r[0]||"\\"===r[0]&&0===(r=r.slice(1)).length?(e.err=!0,e):(e.char=r[0],e.newChunk=r.slice(1),0===e.newChunk.length&&(e.err=!0),e)}Le.default=function(r,e){if(!e)throw new Error("No matcher supplied!");switch(e.type){case"all":return!0;case"fql":return function(r,e){if(!r)return!1;try{r=JSON.parse(r)}catch(e){throw new Error('Failed to JSON.parse FQL intermediate representation "'.concat(r,'": ').concat(e))}var t=We(r,e);if("boolean"!=typeof t)return!1;return t}(e.ir,r);default:throw new Error("Matcher of type ".concat(e.type," unsupported."))}};var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});var Xe=function(){function r(r){this.rules=[],this.rules=r||[]}return r.prototype.getRulesByDestinationName=function(r){for(var e=[],t=0,n=this.rules;t<n.length;t++){var o=n[t];o.destinationName!==r&&void 0!==o.destinationName||e.push(o)}return e},r}();Ke.default=Xe,function(r){var t=e&&e.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(r,"__esModule",{value:!0}),r.Store=r.matches=r.transform=void 0;var o=n;Object.defineProperty(r,"transform",{enumerable:!0,get:function(){return t(o).default}});var a=Le;Object.defineProperty(r,"matches",{enumerable:!0,get:function(){return t(a).default}});var i=Ke;Object.defineProperty(r,"Store",{enumerable:!0,get:function(){return t(i).default}})}(t);var Ze=function(r){return function(e){var n=e.payload,o=e.integration,a=e.next;new t.Store(r).getRulesByDestinationName(o).forEach((function(r){for(var e=r.matchers,o=r.transformers,i=0;i<e.length;i++)if(t.matches(n.obj,e[i])&&(n.obj=t.transform(n.obj,o[i]),null===n.obj))return a(null)})),a(n)}};export{Ze as tsubMiddleware};
|