PageSourceSearch

https://spexbot.com/_next/static/chunks/pages/credits-ef3087e990fde8a4.js

js spexbot.com collected 2026-10-09 22:02:25 UTC 14,634 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1873],{12215:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/credits",function(){return n(86482)}])},21959:function(e,t,n){"use strict";n.d(t,{m:function(){return PageHeader}});var s=n(85893),r=n(38910);n(51721);var a=n(9008),i=n.n(a);let PageHeader=e=>{let{children:t,title:n=r.dP.FALLBACK_TITLE,description:a=r.e5.spexbot.description}=e;return(0,s.jsxs)(i(),{children:[(0,s.jsx)("title",{children:n||r.dP.FALLBACK_TITLE}),(0,s.jsx)("meta",{property:"og:title",content:n}),(0,s.jsx)("meta",{property:"og:description",content:a}),(0,s.jsx)("meta",{property:"og:image",content:r.hw.url}),(0,s.jsx)("meta",{property:"og:image:width",content:"436"}),(0,s.jsx)("meta",{property:"og:image:height",content:"228"}),(0,s.jsx)("meta",{property:"og:image:alt",content:n}),(0,s.jsx)("meta",{property:"og:image:type",content:"image/png"}),(0,s.jsx)("meta",{name:"twitter:card",content:"summary"}),(0,s.jsx)("meta",{name:"twitter:title",content:n}),(0,s.jsx)("meta",{name:"twitter:description",content:a}),(0,s.jsx)("meta",{name:"twitter:image",content:r.hw.url}),(0,s.jsx)("meta",{name:"twitter:image:width",content:"436"}),(0,s.jsx)("meta",{name:"twitter:image:height",content:"228"}),(0,s.jsx)("meta",{name:"twitter:image:alt",content:n}),(0,s.jsx)("meta",{name:"twitter:image:type",content:"image/png"}),t]})}},6487:function(e,t,n){"use strict";n.d(t,{R:function(){return TableBody}});var s=n(85893),r=n(67294),a=n(50629),i=n.n(a);let TableBody=e=>{let{children:t}=e,n=(0,r.useRef)(null),[a,l]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let checkForScrollbar=()=>{let e=n.current;if(e){let t=e.scrollHeight>e.clientHeight;t?l(!0):l(!1)}};return checkForScrollbar(),window.addEventListener("resize",checkForScrollbar),()=>window.removeEventListener("resize",checkForScrollbar)},[t]),(0,s.jsx)("div",{className:"table-body ".concat(i().table_body," ").concat(a?"":"padding-for-scrollbar"),ref:n,children:t})}},16818:function(e,t,n){"use strict";var s=n(85893);n(67294);var r=n(53428),a=n.n(r);t.Z=function(e){let{isLocalToComponent:t=!1}=e;return(0,s.jsx)("div",{className:"".concat(t?a().localMargins:a().sbLoader," spinner-border text-primary"),role:"status",children:(0,s.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}},87278:function(e,t,n){"use strict";n(85893),n(67294);var s=n(30286);n(49130),n(76695),[...s.Z1,...(0,s.$z)([{label:"This Year",range:()=>({startDate:new Date(new Date().getFullYear(),0,1),endDate:new Date(new Date().getFullYear(),11,31)})},{label:"Last Year",range:()=>({startDate:new Date(new Date().getFullYear()-1,0,1),endDate:new Date(new Date().getFullYear()-1,11,31)})},{label:"All Time",range:()=>({startDate:new Date(0),endDate:new Date})}])]},41757:function(e,t,n){"use strict";n.d(t,{L:function(){return TruncatedText}});var s=n(85893),r=n(67294),a=n(14632),i=n(43489),l=n(18734),c=n.n(l);let o=["hover","focus"],d=[],assignRef=(e,t)=>{"function"==typeof e?e(t):e&&"object"==typeof e&&(e.current=t)},TruncatedText=e=>{let{children:t,lines:n=1,placement:l="top",className:u="",as:m="span",fallback:_="N/A",...v}=e,h=(0,r.useRef)(null),[f,x]=(0,r.useState)(!1),p=(0,r.useCallback)(()=>{let e=h.current;e&&x(e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight+1)},[]);return((0,r.useEffect)(()=>{p()},[p,t,n]),(0,r.useEffect)(()=>{let e=h.current;if(!e||"undefined"==typeof ResizeObserver)return;let t=new ResizeObserver(p);return t.observe(e),()=>t.disconnect()},[p]),null==t||""===t)?_:(0,s.jsx)(a.Z,{placement:l,trigger:f?o:d,overlay:(0,s.jsx)(i.Z,{children:(0,s.jsx)("strong",{children:t})}),children:e=>{let{ref:r,...a}=e;return(0,s.jsx)(m,{...a,...v,ref:e=>{assignRef(r,e),h.current=e,p()},className:"".concat(n>1?c().clamp:c().truncate," ").concat(u).trim(),style:n>1?{WebkitLineClamp:n,...v.style||{}}:v.style,children:t})}})}},86482:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return D},default:function(){return credits}});var s=n(85893),r=n(67294),a=n(59820),i=n(46083),l=n.n(i),c=n(30381),o=n.n(c),d=n(25675),u=n.n(d);let m=["#B50038","#3A60FF","#000000","#FF6B00","#00A550","#D10093","#0094FF","#FFD700","#C2105A"],GeneralUsageBar=e=>{let{consumedPercent:t,remainingPercent:n}=e;return(0,s.jsxs)("div",{className:l().generalUsageBar,children:[t>0?(0,s.jsxs)("div",{style:{width:"".concat(t,"%")},children:[t,"%"]}):null,n>0?(0,s.jsxs)("div",{style:{width:"".concat(n,"%"),backgroundColor:"#f6f8fa",color:"black"},children:[n,"%"]}):null]})},ServicesUsageBar=e=>{let{servicesUsage:t}=e,getLastServiceStyle=(e,t)=>
1{let n={width:"".concat(null==e?void 0:e.credits_consumed_percent,"%"),backgroundColor:null==e?void 0:e.color};return n};return(0,s.jsx)("div",{className:l().servicesUsageBar,children:(0,s.jsx)(s.Fragment,{children:null==t?void 0:t.map((e,t)=>(0,s.jsx)(s.Fragment,{children:(null==e?void 0:e.credits_consumed_percent)>0?(0,s.jsx)("div",{style:getLastServiceStyle(e),children:(0,s.jsxs)(s.Fragment,{children:[null==e?void 0:e.credits_consumed_percent,"%"]})}):null}))})})},UsageField=e=>{let{label:t,value:n,color:r="#7c5bff",additionalClass:a=""}=e;return(0,s.jsxs)("div",{className:l().consumptionField,children:[(0,s.jsxs)("div",{className:l().label,children:[(0,s.jsx)("span",{className:"".concat(null===l()||void 0===l()?void 0:l().colorBoxField," ").concat(l()[a]),style:{backgroundColor:r}}),(0,s.jsx)("b",{children:t})]}),(0,s.jsx)("div",{children:n})]})},ServicesUsage=e=>{let{consumption:t}=e;return null==t||t.forEach((e,t)=>{e.color=m[t]}),(0,s.jsxs)("div",{className:l().consumptionSection,children:[(0,s.jsx)("b",{children:"Services Usage"}),(0,s.jsx)(ServicesUsageBar,{servicesUsage:t}),null==t?void 0:t.map(e=>(0,s.jsx)(UsageField,{label:e.name,value:e.credits_consumed,color:e.color},e.id))]})},GenaralUsage=e=>{let{consumption:t}=e;return(0,s.jsxs)("div",{className:l().consumptionSection,children:[(0,s.jsx)("b",{children:"General Usage"}),(0,s.jsx)(GeneralUsageBar,{consumedPercent:null==t?void 0:t.consumed_percent,remainingPercent:null==t?void 0:t.remaining_percent}),(0,s.jsx)(UsageField,{label:"Consumed",value:null==t?void 0:t.consumed}),(0,s.jsx)(UsageField,{label:"Remaining",value:null==t?void 0:t.remaining,color:"#f6f8fa",additionalClass:"borderedCheckbox"})]})};n(87278);var _=n(38910),v=n(41609),h=n.n(v),f=n(41772),x=n(60390),p=n.n(x),b=n(92166),g=n(41757),j=n(16818),y=n(89094),N=n(6487);let CreditTransactions=e=>{let{data:t,setHistoryUrl:n,loadingHistory:r}=e;return(0,s.jsx)(s.Fragment,{children:(0,s.jsx)("div",{className:"upload-table",children:(0,s.jsxs)("div",{className:"table",children:[(0,s.jsx)("div",{className:"table-head",children:(0,s.jsxs)("div",{className:"table-row",children:[(0,s.jsx)("div",{className:"table-cell w-6",children:"ID"}),(0,s.jsxs)("div",{className:"table-cell w-20",children:[(0,s.jsx)(f.n5,{})," Name"]}),(0,s.jsxs)("div",{className:"table-cell w-20",children:[(0,s.jsx)(f.f,{})," Date"]}),(0,s.jsxs)("div",{className:"table-cell w-15",children:[(0,s.jsx)(y.Z,{})," Service"]}),(0,s.jsxs)("div",{className:"table-cell w-9",children:[(0,s.jsx)(f.WW,{})," Type"]}),(0,s.jsxs)("div",{className:"table-cell w-15",children:[(0,s.jsx)(f.WW,{})," Reason"]}),(0,s.jsxs)("div",{className:"table-cell w-15",children:[(0,s.jsx)(f.CJ,{})," Credits"]})]})}),(0,s.jsx)(N.R,{children:r?(0,s.jsx)(j.Z,{isLocalToComponent:!0}):!h()(null==t?void 0:t.results)&&(null==t?void 0:t.results.map((e,t)=>{var n;return(0,s.jsxs)("div",{className:"table-row submissionTableBody",children:[(0,s.jsx)("div",{className:"table-cell w-6",children:(0,s.jsx)("div",{className:"id",children:(0,s.jsx)("p",{children:null==e?void 0:e.id})},e.id)}),(0,s.jsxs)("div",{className:"table-cell initials w-20",children:[(0,s.jsx)("span",{className:"initials-container",children:null===(n=e.user)||void 0===n?void 0:n.concatenated_initials})," ",(0,s.jsx)(g.L,{as:"div",className:"".concat(p().fileName),children:e.user.full_name})]}),(0,s.jsx)("div",{className:"table-cell  w-20",children:(0,b.Of)(e.created)}),(0,s.jsx)("div",{className:"table-cell w-15",children:e.service_type||"N/A"}),(0,s.jsx)("div",{className:"table-cell w-9 ",children:e.type?(0,s.jsx)("span",{className:"".concat("Withdrawal"===e.type?"Withdrawal":"Deposit"),children:e.type}):"N/A"}),(0,s.jsx)("div",{className:"table-cell w-15",children:e.reason}),(0,s.jsx)("div",{className:"table-cell w-15",children:e.credits})]},t)}))}),(0,s.jsx)("div",{className:"table-footer",children:(0,s.jsx)("div",{className:"table-row",children:(0,s.jsxs)("div",{className:"table-cell",children:[(0,s.jsxs)("p",{children:[null==t?void 0:t.count," results"]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("button",{className:"button btn btn-default",onClick:()=>{n(null==t?void 0:t.previous)},disabled:!(null==t?void 0:t.previous)||r,children:"Previous"}),(0,s.jsx)("button",{className:"button btn btn-default",onClick:()=>{n(null==t?void 0:t.next)},disabled:!(null==t?void 0:t.next)||r,children:"Next"})]})]})})})]})})})};var w=n(49514),T=n(44707),S=n(11163);n(51721);var F=n(21959);
1let C="".concat(T.A.GET_TRANSACTIONS_HISTORY,"?start_date=","1970-01-01","&end_date=").concat(o()().format("yyyy-MM-DD"),"&ordering=-created");var D=!0,credits=()=>{var e;let[t,n]=(0,r.useState)(!1),[i,c]=(0,r.useState)(!1),[d,m]=(0,r.useState)([_.cQ]),[v,h]=(0,r.useState)(!1),[f,x]=(0,r.useState)(C),[p,g]=(0,r.useState)("1970-01-01"),[y,N]=(0,r.useState)(o()().format("yyyy-MM-DD")),[D,P]=(0,r.useState)(["get-transactions-summary",p,y]),[L,O]=(0,r.useState)(!1);(0,S.useRouter)();let{data:U,isLoading:B}=(0,a.ZP)(D,()=>(0,w.fl)(D[1],D[2]),{revalidateOnFocus:!1}),{data:E,isLoading:R}=(0,a.ZP)(f,w.FP,{revalidateOnFocus:!1});return(0,r.useEffect)(()=>{if(v){let e=(0,b.Zs)(d[0].startDate,"yyyy-MM-DD"),t=(0,b.Zs)(d[0].endDate,"yyyy-MM-DD"),n="".concat(T.A.GET_TRANSACTIONS_HISTORY,"?start_date=").concat(e,"&end_date=").concat(t,"&ordering=-created");g(e),N(t),P(["get-transactions-summary",e,t]),x(n),h(!1)}else L&&(x(C),P(["get-transactions-summary","1970-01-01","".concat(o()().format("yyyy-MM-DD"))]),O(!1))},[d,v,L]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(F.m,{title:_.dP.CREDITS_PAGE_TITLE}),(0,s.jsx)("div",{className:l().mainPage,children:(0,s.jsxs)("div",{className:l().content,children:[(0,s.jsx)("div",{className:l().topBar,children:(0,s.jsx)("h1",{children:"Credits"})}),(0,s.jsx)("div",{className:l().usageSection,children:B?(0,s.jsx)(j.Z,{isLocalToComponent:!0}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(GenaralUsage,{consumption:null==U?void 0:U.general_usage}),(0,s.jsx)(ServicesUsage,{consumption:null==U?void 0:U.services_usage})]})}),(0,s.jsxs)("div",{className:l().creditTransactions,children:[(0,s.jsx)("div",{className:l().transactionsHistoryHeader,children:(0,s.jsx)("h1",{children:"Credit transactions"})}),R?(0,s.jsx)(j.Z,{isLocalToComponent:!0}):(null==E?void 0:null===(e=E.results)||void 0===e?void 0:e.length)?(0,s.jsx)(CreditTransactions,{data:E,setHistoryUrl:x,loadingHistory:R}):(0,s.jsx)("div",{className:"no-history-found",children:(0,s.jsx)(u(),{src:"/svgs/pages/credits/no-history-found.svg",alt:"",width:_.ex,height:_.M6})})]})]})})]})}},60390:function(e){e.exports={fileName:"SubmissionsTable_fileName__X4I_e",itemName:"SubmissionsTable_itemName__sIjvY",invoiceLink:"SubmissionsTable_invoiceLink__RcV5C",actionCol:"SubmissionsTable_actionCol__J6JTW",submissionTable:"SubmissionsTable_submissionTable__YWcxx",baseImageSelectField:"SubmissionsTable_baseImageSelectField__lYjBv"}},18734:function(e){e.exports={truncate:"TruncatedText_truncate__Ye2hp",clamp:"TruncatedText_clamp__FOqpF"}},53428:function(e){e.exports={sbLoader:"baseLoader_sbLoader__vU60L",localMargins:"baseLoader_localMargins__9d9y0"}},50629:function(){},46083:function(e){e.exports={mainPage:"credits_mainPage__4jIeE",header:"credits_header__9wadd",purchaseUnits:"credits_purchaseUnits__CAf_N",content:"credits_content__Jwq3N",topBar:"credits_topBar__L40cw",calendarField:"credits_calendarField__xAPws",usageSection:"credits_usageSection__poaYF",consumptionSection:"credits_consumptionSection__fU_2q",generalUsageBar:"credits_generalUsageBar__Pbh0X",servicesUsageBar:"credits_servicesUsageBar__X1SDf",consumptionField:"credits_consumptionField__ErRpV",label:"credits_label__RmijN",colorBoxField:"credits_colorBoxField__Z88U7",borderedCheckbox:"credits_borderedCheckbox__4ohxQ",creditTransactions:"credits_creditTransactions__Poll9",transactionsHistoryHeader:"credits_transactionsHistoryHeader__srfTP"}},97326:function(e,t,n){"use strict";function _assertThisInitialized(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}n.d(t,{Z:function(){return _assertThisInitialized}})},15671:function(e,t,n){"use strict";function _classCallCheck(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}n.d(t,{Z:function(){return _classCallCheck}})},43144:function(e,t,n){"use strict";n.d(t,{Z:function(){return _createClass}});var s=n(83997);function _defineProperties(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(0,s.Z)(r.key),r)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}},73568:function(e,t,n){"use strict";function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _isNativeReflectConstruct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(_isNativeReflectConstruct=function(){return!!e})()}n.d(t,{Z:function(){return _createSuper}});var s=n(71002),r=n(97326);function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,a=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return function(e,t){if(t&&("object"===(0,s.Z)(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return(0,r.Z)(e)}(this,n)}}},60136:function(e,t,n){"use strict";n.d(t,{Z:function(){return _inherits}});var s=n(89611);function _inherits(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&(0,s.Z)(e,t)}}},function(e){e.O(0,[6373,264,9774,2888,179],function(){return e(e.s=12215)}),_N_E=e.O()}]);

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.