1function _array_like_to_array(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function _array_with_holes(e){if(Array.isArray(e))return e}function asyncGeneratorStep(e,t,n,r,o,a,i){try{var l=e[a](i),s=l.value}catch(e){return void n(e)}l.done?t(s):Promise.resolve(s).then(r,o)}function _async_to_generator(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var a=e.apply(t,n);function i(e){asyncGeneratorStep(a,r,o,i,l,"next",e)}function l(e){asyncGeneratorStep(a,r,o,i,l,"throw",e)}i(void 0)})}}function _define_property(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _iterable_to_array_limit(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a=[],i=!0,l=!1;try{for(n=n.call(e);!(i=(r=n.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){l=!0,o=e}finally{try{i||null==n.return||n.return()}finally{if(l)throw o}}return a}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _object_spread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){_define_property(e,t,n[t])})}return e}function ownKeys(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 _object_spread_props(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):ownKeys(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function _object_without_properties(e,t){if(null==e)return{};var n,r,o,a={};if("undefined"!=typeof Reflect&&Reflect.ownKeys){for(n=Reflect.ownKeys(Object(e)),o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}if(a=_object_without_properties_loose(e,t),Object.getOwnPropertySymbols)for(n=Object.getOwnPropertySymbols(e),o=0;o<n.length;o++)r=n[o],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r]);return a}function _object_without_properties_loose(e,t){if(null==e)return{};var n,r,o={},a=Object.getOwnPropertyNames(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n]);return o}function _sliced_to_array(e,t){return _array_with_holes(e)||_iterable_to_array_limit(e,t)||_unsupported_iterable_to_array(e,t)||_non_iterable_rest()}function _type_of(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function _unsupported_iterable_to_array(e,t){if(e){if("string"==typeof e)return _array_like_to_array(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_array_like_to_array(e,t):void 0}}function _ts_generator(e,t){var n,r,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(i,"next",{value:s(0)}),l(i,"throw",{value:s(1)}),l(i,"return",{value:s(2)}),"function"==typeof Symbol&&l(i,Symbol.iterator,{value:function(){return this}}),i;function s(l){return function(s){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,r=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==l[0]&&2!==l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,s])}}}!function(){try{var e="u">("undefined"==typeof window?"undefined":_type_of(window))?window:"u">("undefined"==typeof global?"undefined":_type_of(global))?global:"u">("undefined"==typeof globalThis?"undefined":_type_of(globalThis))?globalThis:"u">("undefined"==typeof self?"undefined":_type_of(self))?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="e9dba65d-1a79-44c9-8b8c-2b4aa02ca743",e._sentryDebugIdIdentifier="sentry-dbid-e9dba65d-1a79-44c9-8b8c-2b4aa02ca743")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7535],{6110:function(e,t,n){e=n.nmd(e);var r=n(80815),o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o&&r.process,l=function(){try{var e=a&&a.require&&a.require("util").t
1ypes;return e||i&&i.binding&&i.binding("util")}catch(e){}}();e.exports=l},13227:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},14701:function(e,t,n){var r=n(74687),o=n(36886),a=n(84745),i=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,s=/^0o[0-7]+$/i,u=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(a(e))return NaN;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||s.test(e)?u(e.slice(2),n?2:8):i.test(e)?NaN:+e}},36886:function(e){e.exports=function(e){var t=void 0===e?"undefined":_type_of(e);return null!=e&&("object"==t||"function"==t)}},47260:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(66107),o=function(e,t){return t?(0,r.x4)(e/t):0}},53504:function(e,t,n){"use strict";var r=n(31827),o=n(63477),a=n(47072),i=n(96131),l=n(13545),s=n(96600),u=n(99195);n(71126);var c=function(e){return _async_to_generator(function(){return _ts_generator(this,function(t){switch(t.label){case 0:return[4,i.sleep(10)];case 1:return t.sent(),e(),[2]}})})()},d=function(e){var t=e.show,n=e.coords,d=e.onClose,f=e.children,p=e.anchorEl,_=e.className,b=void 0===_?"":_,v=e.transition,m=void 0===v?"fade":v,y=e.getAwayThreshold,g=void 0===y?100:y,h=e.animationDuration,w=void 0===h?250:h,x=e.position,j=void 0===x?"bottom-right":x,N=e["data-testid"],C=u.useId(),O=u.useRef({uid:C}),M=u.useRef(null),I=u.useRef(null),E=_sliced_to_array(u.useState(!1),2),A=E[0],S=E[1],T=u.useCallback(function(e){var t,r;if("number"==typeof(null==n?void 0:n.top)&&"number"==typeof(null==n?void 0:n.left)&&d){var o=g+((null===(t=I.current)||void 0===t?void 0:t.clientHeight)||0),a=g+((null===(r=I.current)||void 0===r?void 0:r.clientWidth)||0),i=e.pageY-n.top,l=e.pageX-n.left;(i>o||i<-1*o)&&d(),(l>a||l<-1*a)&&d()}},[null==n?void 0:n.top,null==n?void 0:n.left,g,d]);return a.useIsomorphicEffect(function(){return t?(i.popupManager.setIsOpen(O.current),c(function(){"number"==typeof(null==n?void 0:n.top)&&"number"==typeof(null==n?void 0:n.left)&&document.addEventListener("mousemove",T),M.current&&(M.current.style.zIndex="".concat(i.popupManager.getNewZIndex()))})):i.popupManager.setIsClosed(O.current,w),function(){document.removeEventListener("mousemove",T),i.popupManager.setIsClosed(O.current,w)}},[t]),u.useEffect(function(){t?c(function(){return S(!0)}):S(!1)},[t]),u.useEffect(function(){var e=function(e){var t;"Escape"===e.key&&(null===(t=i.popupManager.topElements[0])||void 0===t?void 0:t.uid)===C&&(null==d||d())};document.addEventListener("keydown",e);var t=O.current;return function(){document.removeEventListener("keydown",e),i.popupManager.setIsClosed(t,w)}},[]),r.jsx(l,{children:r.jsx(s,{keepMounted:!0,mounted:A,transition:m,duration:w,onEnter:function(){var e=I.current;if(n){if("number"==typeof(null==n?void 0:n.top)&&"number"==typeof(null==n?void 0:n.left)&&e){var t=e.offsetWidth,r=e.offsetHeight;n.left-t<0?e.style.right=window.innerWidth-n.left-t+"px":e.style.left=n.left-t+"px",n.top+r>window.innerHeight?e.style.bottom=window.innerHeight-n.top+"px":e.style.top="".concat(n.top,"px")}}else{var o=null==p?void 0:p.getBoundingClientRect(),a=_sliced_to_array(j.split("-"),2),i=a[0],l=a[1],s=(null==o?void 0:o.bottom)||0,u=window.innerWidth-((null==o?void 0:o.right)||0),c=(null==o?void 0:o.x)||0,d=(null==o?void 0:o.y)||0;if(!(null==e?void 0:e.style))return;var f=e.clientWidth,_=e.clientHeight;"right"===l&&u+f<window.innerWidth||((null==o?void 0:o.right)||0)+f>window.innerWidth?e.style.right="".concat(u,"px"):e.style.left="".concat(c,"px"),"bottom"===i&&s+_<window.innerHeight||d<_?e.style.top="".concat(s,"px"):e.style.bottom=window.innerHeight-d+"px"}},children:function(e){return r.jsxs("div",{className:o.clsx("bs-popover",{"bs-popover--visible":A}),ref:M,"data-testid":N,children:[r.jsx("div",{onClick:d,className:"bs-popover__wrapper"}),r.jsx("div",{style:e,ref:I,className:o.clsx(["bs-popover__content",_define_property({},b,!!b)]),children:f})]})}})})},f=function(e){var t=e.show,n=e.onClose,o=e.keepMounted,a=void 0!==o&&o,i=e["data-testid"],l=_object_without_properties(e,["show","onClose","keepMounted","data-testid"]),s=_sliced_to_array(u.useState(!1),2),c=s[0],f=s[1],p=_sliced_to_array(u.useState(!1),2),_=p[0],b=p[1],v=u.useCallback(function(){a||f(!1),b(!1),null==n||n()},[a,n]);return u.useEffect(function(){t!==_&&(t?(f(!0),b(!0)):(b(!1),v()))},[t]),c?r.jsx(d,_object_spread_props(_object_spread({},l),{show:_,keepMounted:a,"data-testid":i,onClose:v})):null};f.displayName="BsPopover",e.exports=f},53790:function(e,t,n){"use strict";var r=n(31827),o=n(63477),a=n(99195),i=n(2796),l=n(53504),s=n(47072);n(46312),n(43206),n(13545),n(71126),n(96131),n(96600);var u=function(e){var t=e.onClick,n=e.children,a=e.className,i=void 0===a?"":a,l=e["data-testid"],s=function(e){null==t||t(e)};return r.jsx("li",{tabIndex:0,role:"menuitem",onClick:s,onKeyDown:s,"data-testid":l,className:o.clsx(["bs-dropdown--item",_define_property({},i,i)]),children:n})};u.displayName="BsDropdownItem";
1var c=function(e){var t=e.show,n=e.onChange,u=e.children,c=e.className,d=e.label,f=void 0===d?"":d,p=e.modalProps,_=void 0===p?{}:p,b=e.buttonComponent,v=e.buttonProps,m=void 0===v?{}:v,y=e.disabled,g=void 0!==y&&y,h=e.optionsProps,w=void 0===h?{}:h,x=e.icon,j=void 0===x?"bi-more-v":x,N=e.popoverClassName,C=void 0===N?"":N,O=e.labelPosition,M=void 0===O?"end":O,I=e.position,E=void 0===I?"bottom-right":I,A=e["data-testid"],S=a.useId(),T=s.useWindowSize().isPhone,k=_sliced_to_array(s.useUncontrolled({onChange:n,value:t,defaultValue:!1}),2),B=k[0],P=k[1],L=a.useRef(null),G=function(){P(!1)},K=function(){G()},R=a.useMemo(function(){return _object_spread({showClose:!1,hasPopstate:!1},_)},[_]);return r.jsxs("div",{id:S,"data-testid":A,className:o.clsx(["bs-dropdown",{"bs-dropdown--open":B},c]),children:[r.jsx("button",_object_spread_props(_object_spread({type:"button",className:"bs-dropdown__btn",disabled:g,onClick:function(){B?G():P(!0)}},m),{ref:L,children:b||r.jsxs(r.Fragment,{children:[!!f&&"start"===M&&r.jsx("span",{className:"bs-dropdown__label",children:f}),r.jsx("i",{className:o.clsx(["bs-dropdown__icon",_define_property({},j,!!j)])}),!!f&&"end"===M&&r.jsx("span",{className:"bs-dropdown__label",children:f})]})})),T?r.jsx(i,_object_spread_props(_object_spread({show:B,onClose:G},R),{children:r.jsx("ul",_object_spread_props(_object_spread({className:"bs-dropdown__options bs-dropdown__options--modal",role:"menu"},w),{onClick:K,onKeyDown:K,children:u}))})):r.jsx(l,{anchorEl:L.current,position:E,show:B,onClose:G,transition:"fade",className:o.clsx(["bs-dropdown__options bs-dropdown__options--popover",C]),children:r.jsx("ul",_object_spread_props(_object_spread({},w),{role:"menu",onClick:K,onKeyDown:K,children:u}))})]})};c.displayName="BsDropdown",c.Item=u,e.exports=c},61630:function(e){e.exports=function(e){return function(t){return e(t)}}},66107:function(e,t,n){"use strict";n.d(t,{VW:function(){return o},x4:function(){return r}});var r=function(e){return Math.floor(1e3*e)/1e3},o=function(e){return 10*e}},66347:function(e,t,n){"use strict";var r=n(31827),o=n(63477),a=n(47072),i=function(e){var t=e.tabs,n=e.value,i=e.onChange,l=e.className,s=e.defaultValue,u=e.fullWidth,c=void 0===u||u,d=e.color,f=void 0===d?"primary":d,p=e["data-testid"],_=_sliced_to_array(a.useUncontrolled({value:n,onChange:i,defaultValue:s,finalValue:t[0].value}),2),b=_[0],v=_[1];return r.jsx("div",{className:o.clsx(l,"bs-tabs","bs-tabs--".concat(f),{"bs-tabs--full-width":c}),"data-testid":p,children:r.jsx("div",{className:"bs-tabs__container",children:t.map(function(e){return r.jsxs("div",{role:"button",tabIndex:0,className:o.clsx("bs-tabs__tab",{"bs-tabs__tab--has-dot":e.hasDot,"bs-tabs__tab--active":b===e.value}),onClick:function(){return v(e.value)},onKeyDown:function(){return v(e.value)},children:[!!e.icon&&r.jsx("i",{className:o.clsx("bs-tabs__tab-icon",e.icon)}),r.jsx("span",{className:"bs-tabs__tab-title",children:e.title}),!!e.count&&r.jsx("span",{className:"bs-tabs__tab-count",children:e.count}),e.hasDot&&r.jsx("span",{className:"bs-tabs__tab-dot"})]},e.value)})})})};i.displayName="BsTabs",e.exports=i},74687:function(e,t,n){var r=n(13227),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},88027:function(e,t,n){"use strict";n.d(t,{W:function(){return o}});var r=n(92109),o=function(e){var t,n,o=e.goldGrams,a=e.amountToman,i=e.tradeConfig,l=null!==(t=null==i?void 0:i.minTradeGoldMilligrams)&&void 0!==t?t:0,s=null!==(n=null==i?void 0:i.maxTradeBuyAmountToman)&&void 0!==n?n:1/0;return 1e3*o<l?{isValid:!1,error:r.X6.BELOW_MIN,minGoldMilligrams:l,maxTomanAmount:s}:a>s?{isValid:!1,error:r.X6.ABOVE_MAX,minGoldMilligrams:l,maxTomanAmount:s}:{isValid:!0,error:null,minGoldMilligrams:l,maxTomanAmount:s}}},92109:function(e,t,n){"use strict";n.d(t,{$K:function(){return r},Dt:function(){return c},P_:function(){return l},R3:function(){return a},X6:function(){return i},ef:function(){return u},j1:function(){return s},wK:function(){return o}});var r={BUY:"buy",SELL:"sell"},o={GRAM:"gram",TOMAN:"toman"},a={WALLET:"wallet",VENDOR_BALANCE:"vendor_balance",GATEWAY:"gateway"},i={BELOW_MIN:"BELOW_MIN",ABOVE_MAX:"ABOVE_MAX"},l={INSUFFICIENT_GOLD_BALANCE:"E_INSUFFICIENT_GOLD_BALANCE"},s={BUY_BUTTON_CLICK:"salamGoldBuyButtonClick",SELL_BUTTON_CLICK:"salamGoldSellButtonClick",PAYMENT_BUTTON_CLICK:"salamGoldPaymentButtonClick",FINAL_SELL_BUTTON_CLICK:"salamGoldFinalSellButtonClick"},u="Idempotency-Key",c={walletBalance:["gold-wallet-balance"],goldBalance:["gold-balance"],price:["gold-price"],tradeConfig:["gold-trade-config"],tradeFee:function(e,t){return["gold-trade-fee",e,t]}}},92139:function(e,t,n){"use strict";var r=function(e){var t=e.amountToman,n=e.sellPriceToman,r=e.feeRate,c=void 0===r?0:r,d=e.feePercent,f=e.tradeConfig,p=e.side,_=void 0===p?a.$K.BUY:p,b=e.unit,v=void 0===b?a.wK.TOMAN:b,m=e.goldGrams,y=void 0===m?0:m,g=e.goldBalance,h=e.paymentSource,w=void 0===h?a.R3.WALLET:h,x=e.buy,j=e.onSuccess,N=e.onPaymentRedirect,C=e.onError,O=_sliced_to_array((0,o.useState)(u),2),M=O[0],I=O[1],E=_sliced_to_array((0,o.useState)(!1),2),A=E[0],S=E[1],T=10*n,k=10*t,B=_===a.$K.BUY?1/0:null!=g?g:1/0,P=(0,o.useMemo)(function(){return function(e){var t=e.rialAmount,n=e.goldPriceRial,r=e.feeRate,o=void 0===r?0:r,i=e.side,s=void 0===i?a.$K.BUY:i,u=e.unit,c=void 0===u?a.wK.TOMAN:u,d=e.goldGrams,f=void 0===d?0:d,p=e.maxGold,_=void 0===p?1/0:p,b=s===a.$K.BUY?1+o:1-o,v=n&&b?(0,l.x4)(t/n/b):0,m=Math.min(c===a.wK.GRAM?f:v,_),y=Math.round(1e3*m),g=m*n*b,h=Math.round(g/10);return{goldGrams:c===a.wK.GRAM?f:n?(0,l.x4)(t/n):0,finalGoldAmount:m,goldMilligrams:y,commission:m*n*o,finalAmount:g,amountToman:h}}({rialAmount:k,goldPriceRial:T,feeRate:c,side:_,unit:v,goldGrams:y,maxGold:B})},[k,T,c,_,v,y,B]),L=(0,o.useMemo)(function(){return v===a.wK.GRAM?y:(0,s.W)(t,n)},[v,y,t,n]),G=Math.round(1e3*L),K=(0,o.useMemo)(function(){return(0,i.W)({goldGrams:L,amountToman:t,tradeConfig:f})},[L,t,f]),R=(0,o.useCallback)(function(){return I(u())},[]),D=(0,o.useCallback)(function(){return _async_to_generator(function(){var e,t,n,r,o,i,l,s;return _ts_generator(this,function(c){switch(c.label){case 0:if(!K.isValid||A)return[3,5];S(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),e=_===a.$K.BUY?{amountToman:P.amountToman,goldMilligrams:P.goldMilligrams,paymentSource:w}:{goldMilligrams:P.goldMilligrams},[4,x(e,{idempotencyKey:M})];case 2:return(null==(t=c.sent())?void 0:t.paymentUrl)?[2,void(null==N||N(t.paymentUrl,t))]:(null==j||j(P.goldMilligrams,t),[3,5]);case 3:return n=c.sent(),409===(null==(s=null==n||null===(r=n.response)||void 0===r?void 0:r.data)?void 0:s.http_status)&&(null==s||null===(l=s.errors)||void 0===l||null===(i=l[0])||void 0===i||null===(o=i.data)||void 0===o?void 0:o.internal_code)===a.P_.INSUFFICIENT_GOLD_BALANCE&&I(u()),null==C||C(n),[3,5];case 4:return S(!1),[7];case 5:return[2]}})})()}
1,[K.isValid,A,_,P.amountToman,P.goldMilligrams,w,x,M,N,j,C]);return _object_spread_props(_object_spread({},P),{equivalentSoot:G,feeRate:c,feePercent:d,goldPriceRial:T,validation:K,isValid:K.isValid,isSubmitting:A,idempotencyKey:M,submit:D,reset:R})};n.d(t,{R:function(){return r}});var o=n(99195),a=n(92109),i=n(88027),l=n(66107),s=n(47260),u=function(){var e,t;return(null===(t=globalThis.crypto)||void 0===t||null===(e=t.randomUUID)||void 0===e?void 0:e.call(t))||"".concat(Date.now().toString(16),"-").concat(Math.floor(1e9*Math.random()).toString(16))}},95542:function(e,t,n){"use strict";var r=n(31827),o=n(63477),a=n(47072),i=n(99195),l=function(e){var t=e.value,n=e.min,l=void 0===n?0:n,s=e.mid,u=void 0===s?3:s,c=e.max,d=void 0===c?5:c,f=e.readOnly,p=e.isButton,_=e.onChange,b=e.showIndex,v=e.className,m=e.indexColor,y=e.size,g=void 0===y?"lg":y,h=e.defaultValue,w=e.onHoverChange,x=e.color,j=void 0===x?"warning":x,N=e["data-testid"],C=i.useId(),O=i.useRef(null),M=_sliced_to_array(a.useUncontrolled({value:t,onChange:_,defaultValue:h,finalValue:0}),2),I=M[0],E=M[1],A=_sliced_to_array(i.useState(-1),2),S=A[0],T=A[1],k=_sliced_to_array(i.useState(!0),2),B=k[0],P=k[1],L=function(e){var t=e+1;f||t<l||E(t)},G=function(e){var t=e+1;return B||f?t<=Math.round(I):t<=Math.max(l,S)},K=i.useMemo(function(){return f?{index:Math.ceil(I)-1,fillPercent:I%1==0?100:10*Number(I.toFixed(1).toString().split(".")[1])}:null},[f,I]),R=i.useMemo(function(){return o.clsx("bs-rating","bs-rating--".concat(g),{"bs-rating--is-button":p},v)},[g,p,v]),D=o.clsx("bs-rating__wrapper",{"bs-rating__wrapper--button":p}),U=function(e){return o.clsx("bs-rating__star",{"bs-rating__star--active":G(e)},{"bs-rating__star--readonly":f})},W={bg:"var(--gray-100)",danger:"var(--danger)",black:"var(--gray-600)",warning:"var(--warning)",primary:"var(--primary)",auto:(S>-1?u<=S:u<=I)?"var(--warning)":"var(--danger)"};return r.jsx("div",{className:R,"data-testid":N,children:r.jsx("div",{ref:O,className:D,onMouseEnter:function(){f||P(!1)},onMouseMove:function(e){if(!f&&O.current){var t=O.current.getBoundingClientRect(),n=t.left,r=t.width/d,o=Math.round((e.clientX-n)/r+.5);T(o),null==w||w(o)}},onMouseLeave:function(){f||(T(-1),P(!0),null==w||w(-1))},children:Array.from({length:d}).map(function(e,t){return p?r.jsxs("div",{className:U(t),children:[r.jsx("div",{className:o.clsx("bs-rating__button",{"bs-rating__button--active":G(t),"bs-rating__button--disabled":f&&!h}),onClick:function(){return L(t)},children:r.jsx("i",{className:o.clsx("bs-rating__button-icon","bi-star"+(G(t)?"-fill":""))})},t),b&&r.jsx("span",{className:"bs-rating__star-index",children:t+1})]},t):r.jsxs("div",{className:U(t),role:"button",tabIndex:0,onClick:function(){return L(t)},onKeyDown:function(){return L(t)},children:[r.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(null==K?void 0:K.index)===t&&r.jsxs("linearGradient",{id:C,children:[r.jsx("stop",{offset:"".concat(K.fillPercent,"%"),stopColor:W[j]}),r.jsx("stop",{offset:"".concat(K.fillPercent,"%"),stopColor:W.bg})]}),r.jsx("path",{fill:G(t)?W[j]:W.bg,d:"M12.9279 4.79202L14.2024 8.96053H18.3093C19.7255 8.96053 20.292 10.747 19.159 11.6403L15.7602 14.1712L17.0348 18.3397C17.4596 19.6796 15.9018 20.8706 14.9105 19.9774L11.5117 17.4465L8.11291 19.9774C6.97998 20.8706 5.56381 19.6796 5.98866 18.3397L7.26321 14.1712L3.86441 11.6403C2.73147 10.747 3.29794 8.96053 4.71411 8.96053H8.821L10.0956 4.79202C10.5204 3.45214 12.503 3.45214 12.9279 4.79202Z",style:(null==K?void 0:K.index)===t?{fill:"url('#".concat(C,"')")}:{}})]}),b&&r.jsx("span",{className:"bs-rating__star-index",style:{color:m||W[j]},children:t+1})]},t)})})})};l.displayName="BsRating",e.exports=l}}]);
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.