1import{w as e}from"./dist-DiEP1Qns.js";import{D as t,Ht as n,On as r,Yt as i,Zn as a,_ as o,b as s,bt as c,ct as l,er as u,g as d,mt as f,o as p,tr as m,un as h,vn as g,y as _}from"./runtime-core.esm-bundler-BKdLzFmX.js";import{t as v}from"./appVariables-if8fQ3xE.js";import{t as y}from"./_plugin-vue_export-helper-BDNMzG2s.js";import{t as b}from"./Input-DIU8PGUv.js";import{t as x}from"./helper-D5ziWoUd.js";var S={},C={width:`16`,height:`16`,viewBox:`0 0 16 16`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`};function w(e,t){return f(),s(`svg`,C,[...t[0]||=[o(`path`,{d:`M8.03145 12.6798C8.25706 12.6798 8.44839 12.6019 8.60545 12.4461C8.76249 12.2903 8.84101 12.0996 8.84101 11.874C8.84101 11.6484 8.76312 11.457 8.60734 11.3C8.45155 11.1429 8.26085 11.0644 8.03524 11.0644C7.80961 11.0644 7.61828 11.1423 7.46124 11.2981C7.30418 11.4539 7.22566 11.6446 7.22566 11.8702C7.22566 12.0958 7.30355 12.2871 7.45934 12.4442C7.61512 12.6012 7.80582 12.6798 8.03145 12.6798ZM8.00843 15.5836C6.9652 15.5836 5.98271 15.3863 5.06093 14.9915C4.13914 14.5968 3.33232 14.0537 2.64047 13.3622C1.94861 12.6706 1.40523 11.8645 1.01032 10.9437C0.61542 10.0229 0.417969 9.03906 0.417969 7.99216C0.417969 6.94524 0.61533 5.96437 1.01005 5.04953C1.40477 4.13469 1.9479 3.33134 2.63943 2.63949C3.33097 1.94763 4.13713 1.40425 5.05791 1.00935C5.97868 0.614445 6.96252 0.416992 8.00943 0.416992C9.05634 0.416992 10.0372 0.614354 10.9521 1.00908C11.8669 1.4038 12.6702 1.94692 13.3621 2.63845C14.054 3.32999 14.5973 4.13453 14.9922 5.05206C15.3871 5.96958 15.5846 6.94995 15.5846 7.99316C15.5846 9.03638 15.3872 10.0189 14.9925 10.9407C14.5978 11.8625 14.0547 12.6693 13.3631 13.3611C12.6716 14.053 11.8671 14.5964 10.9495 14.9913C10.032 15.3862 9.05163 15.5836 8.00843 15.5836ZM8.00128 14.5003C9.80684 14.5003 11.3416 13.8684 12.6054 12.6045C13.8693 11.3406 14.5013 9.80586 14.5013 8.00031C14.5013 6.19475 13.8693 4.66003 12.6054 3.39614C11.3416 2.13225 9.80684 1.50031 8.00128 1.50031C6.19573 1.50031 4.661 2.13225 3.39711 3.39614C2.13323 4.66003 1.50128 6.19475 1.50128 8.00031C1.50128 9.80586 2.13323 11.3406 3.39711 12.6045C4.661 13.8684 6.19573 14.5003 8.00128 14.5003ZM8.05264 4.43299C8.44147 4.43299 8.77798 4.55545 9.06218 4.80037C9.34637 5.04528 9.48847 5.35143 9.48847 5.7188C9.48847 6.02828 9.4022 6.30374 9.22966 6.54518C9.05711 6.78664 8.85546 7.00459 8.6247 7.19903C8.3222 7.46738 8.05239 7.76951 7.81528 8.10543C7.57818 8.44133 7.45857 8.81388 7.45643 9.22308C7.45108 9.37477 7.50158 9.49496 7.60793 9.58364C7.71427 9.67231 7.83834 9.71664 7.98013 9.71664C8.13205 9.71664 8.26009 9.67364 8.36426 9.58764C8.46841 9.50164 8.53598 9.38812 8.56697 9.2471C8.63641 8.94689 8.76168 8.68249 8.94278 8.45389C9.12387 8.22529 9.32004 8.0079 9.5313 7.80172C9.835 7.50569 10.0862 7.17597 10.2849 6.81255C10.4836 6.44912 10.583 6.05926 10.583 5.64295C10.583 4.9827 10.3367 4.43329 9.84422 3.99472C9.35171 3.55615 8.76233 3.33687 8.07609 3.33687C7.58605 3.33687 7.12843 3.45012 6.70322 3.67662C6.27801 3.9031 5.92807 4.22173 5.65341 4.63249C5.56589 4.75805 5.54266 4.89573 5.5837 5.04554C5.62474 5.19533 5.71889 5.30032 5.86614 5.36051C6.01821 5.43128 6.16742 5.44155 6.31378 5.39133C6.46014 5.34112 6.58247 5.26367 6.68076 5.15897C6.84957 4.95383 7.05042 4.78156 7.28332 4.64214C7.51623 4.50271 7.77266 4.43299 8.05264 4.43299Z`,fill:`#1C1B1F`},null,-1)]])}var T=y(S,[[`render`,w]]),E={class:`font-cr-medium text-5xl xs:text-4xl xs-sm:text-4xl`},D={class:`flex ml-6 sm:ml-3 xs:ml-4 items-center`},O={class:`flex`},k={"aria-hidden":`true`,class:`text-lg font-cr-bold xs:font-cr-medium xs:text-sm`},A=[`aria-label`,`value`],j={__name:`ChooseCoffeeCount`,props:[`fromPage`,`tagEmoji`,`amtAccToGoal`,`creatorData`,`monthlySupportEnabled`],emits:[`emitCoffeeCount`,`setPayableAmount`],setup(l,{emit:u}){let d=l,_=u,v=g(1),y=[1,3,5],S=g(),C=x.roundToMultipleOfFive(d.creatorData.coffee_price_converted);n(()=>d.amtAccToGoal,e=>{S.value=e/C>0?e/C:``,v.value=S.value>0?S.value:1,_(`emitCoffeeCount`,S.value)});let w=e=>{x.allowOnlyNumbers(e)||e.preventDefault(),S.value>5e3&&e.preventDefault(),_(`setPayableAmount`)},T=()=>{S.value=v.value,_(`emitCoffeeCount`,v.value)};return(n,u)=>(f(),s(`div`,{class:a([[l.fromPage==`homeWidget`?`items-center`:``,l.monthlySupportEnabled==1?`rounded-t-xl border border-dark/10 bg-white`:`rounded-xl border border-pageTheme25 bg-pageTheme05`],`mt-5 w-full p-4 border-solid flex justify-center`])},[o(`div`,E,m(l.tagEmoji?l.tagEmoji:`â`),1),u[4]||=o(`div`,{"aria-hidden":`true`,class:`text-2xl text-grey71 opacity-60 font-cr-medium ml-4 flex items-center xs:ml-3`},`x`,-1),o(`div`,D,[o(`div`,O,[(f(!0),s(p,null,c(r(y),t=>(f(),s(`div`,{class:a([`tw-coffee-counter relative mr-2.5 rounded-full border border-pageTheme25 border-solid flex items-center justify-center hover:border-pageTheme last:mr-0 xs:mr-2 sm:w-10 sm:h-10 xs:w-10 xs:h-10`,[r(v)==t?`bg-pageTheme text-themeTextColor`:`bg-white text-pageTheme`,l.fromPage==`homeWidget`?`w-12 h-12`:`w-12.5 h-12.5`]])},[o(`span`,k,m(t),1),i(o(`input`,{type:`radio`,"aria-label":t,role:`button`,value:t,class:`absolute opacity-0 w-full h-full left-0 top-0 cursor-pointer`,onChange:T,"onUpdate:modelValue":u[0]||=e=>h(v)?v.value=e:v=e},null,40,A),[[e,r(v)]])],2))),256))]),t(b,{type:`number`,min:`1`,max:`5000`,placeholder:`10`,inputCssType:`white-input`,modelValue:r(S),"onUpdate:modelValue":u[1]||=e=>h(S)?S.value=e:S=e,"aria-label":n.$t(`lang.a11y.input_qty`),onInput:u[2]||=e=>{h(v)?v.value=r(S):v=r(S),n.$emit(`emitCoffeeCount`,r(v))},onKeypress:u[3]||=e=>w(e),class:a([l.fromPage==`homeWidget`?`!w-12 !h-12 !px-1 xs:!w-10 xs:!h-10`:`!w-12.5 h-12.5 xs:!w-12 xs:!h-10`,`w-full bg-white !text-lg p-1 ml-5 hover:border-greyE5 focus:border-greyE5 text-center placeholder:text-dark/30 tw-coffee-custom-input tw-hide-placeholder-focus sm:ml-2`])},null,8,[`modelValue`,`aria-label`,`class`])])],2))}},M={class:`relative mt-4`,tabindex:`0`},N=[`aria-label`],P=[`onClick`],F={__name:`SuggestedAmount`,props:[`suggestedAmounts`,`amtAccToGoal`,`postHogVariant`,`monthlySupportEnabled`],emits:[`emitCoffeeCount`],setup(e,{emit:i}
1){let y=i,S=e,C=g(),w=g(),T=g(),E=g(25),D=g(176);l(()=>{if(v.IsBrowser){let e=x.userCurrency().length>1?20:14;E.value=T.value.offsetWidth+e,D.value=w.value.offsetWidth+18}}),n(()=>S.amtAccToGoal,e=>{C.value=e,y(`emitCoffeeCount`,C.value)});let O=x.getExchangeRate(),k=()=>Math.floor(O*5e3),A=e=>e<=0?0:e<=5?5:e<10?10:e<50?Math.round(e/5)*5:e<100?Math.round(e/10)*10:e<500?Math.round(e/50)*50:e<1e3?Math.round(e/100)*100:e<5e3?Math.round(e/500)*500:e<1e4?Math.round(e/1e3)*1e3:Math.round(e/5e3)*5e3,j=d(()=>S.suggestedAmounts.map(e=>O===1?Math.round(e):A(e))),F=(e,t)=>{if(t===`button`){if(C.value||=0,Number(e)+Number(C.value)>k())return;C.value=Math.round(Number(e)+Number(C.value)),v.IsBrowser&&x.autoFocus(`paymentAmount`)}else C.value=e;y(`emitCoffeeCount`,C.value)},I=d(()=>v.IsBrowser&&window.innerWidth<1200?Math.round(S.suggestedAmounts[1])>99:Math.round(S.suggestedAmounts[1])>9999),L=d(()=>x.userCurrencyConverted().length>1),R=d(()=>I.value||L.value?18:D.value),z=d(()=>{let e=``;return S.monthlySupportEnabled==1&&(e=`!rounded-b-none !bg-white !border !border-dark/10`),I.value||L.value?L.value&&!I.value?(e+=` h-15 xl:h-28 xl:pb-16 !text-lg`,e):(e+=` h-28 !pb-16 !text-lg`,e):(e+=` h-15 !text-lg`,e)}),B=d(()=>{let e=``;return e=I.value||L.value?L.value&&!I.value?`xl:h-10 xl:top-16 xl:right-auto xl:left-3`:`!h-10 !top-16 right-auto left-3`:``,e}),V=e=>{e.keyCode===69&&!e.keyCode!==8?e.preventDefault():e.keyCode!==8&&(x.preventDecimalNumber(e),e.target.value=e.target.value.substring(0,6))};return(n,i)=>(f(),s(`div`,null,[o(`div`,M,[o(`span`,{class:a([`text-dark font-cr-bold absolute left-3`,`text-lg top-[16px]`]),ref_key:`currencyBox`,ref:T,role:`text`,"aria-label":r(x).userCurrencyConvertedName()},m(r(x).userCurrencyConverted()),9,N),t(b,{class:a(r(z)),style:u(`padding-right: ${r(R)}px;padding-left: ${r(E)}px`),placeholder:n.$t(`lang.payment.enter_amount`),min:`1`,id:`paymentAmount`,modelValue:r(C),"onUpdate:modelValue":i[0]||=e=>h(C)?C.value=e:C=e,modelModifiers:{number:!0},onInput:i[1]||=e=>F(r(C),`input`),onKeydown:i[2]||=e=>V(e),type:`number`},null,8,[`class`,`style`,`placeholder`,`modelValue`]),o(`div`,{class:a([`h-[1px] w-full absolute top-14 px-3 hidden`,r(I)||r(L)?r(L)&&!r(I)?`xl:block`:`!block`:``])},[...i[3]||=[o(`div`,{class:`bg-dark/5 w-full h-[1px]`},null,-1)]],2),e.postHogVariant===`suggested-new`?_(``,!0):(f(),s(`div`,{key:0,ref_key:`amountList`,ref:w,class:a([r(B),`bg-transparent z-10 h-full flex items-center gap-x-1 absolute right-3 top-0 font-cr-book text-md`])},[(f(!0),s(p,null,c(j.value,(e,t)=>(f(),s(`div`,{key:t,role:`button`,tabindex:`0`,onClick:t=>F(e,`button`),class:a(r(`flex justify-center items-center h-8 bg-white border border-greyE5 rounded-lg px-3 select-none cursor-pointer hover:bg-greyF5/90 transform active:scale-[.99] active:bg-greyF5 xxs:px-1.5`))},`+`+m(r(x).numberFormat(e)),11,P))),128))],2))])]))}};export{j as n,T as r,F as t};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.