PageSourceSearch

https://www.mintly.uk/_next/static/chunks/3874-58709547232cc775.js

js mintly.uk collected 2026-10-04 21:16:27 UTC 9,169 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3874],{3874:(e,s,r)=>{r.d(s,{A:()=>x});var t=r(37876),a=r(14232),l=r(25922),n=r(49105),i=r(48230),c=r(57665),o=r(39108),d=r(95062),m=r(52296),u=r(96523),h=r(11041);let p=e=>{let{onSelectCustomer:s,selectedCustomerId:r}=e,[c,o]=(0,a.useState)([]),[d,p]=(0,a.useState)(!0),[x,j]=(0,a.useState)(null);return((0,a.useEffect)(()=>{(async()=>{try{let e=await (0,l.Jt)({apiName:"admin",path:"/admin/customers"}).response,s=await e.body.json();o(s)}catch(e){console.error("Failed to fetch customers:",e),j("Failed to load customers.")}finally{p(!1)}})()},[]),d)?(0,t.jsx)(m.aH,{size:"large",className:"my-4"}):x?(0,t.jsx)("p",{className:"text-danger",children:x}):0===c.length?(0,t.jsx)("p",{children:"No customers found."}):(0,t.jsxs)(n.XI,{hover:!0,responsive:!0,size:"sm",className:"mt-3",children:[(0,t.jsx)("thead",{children:(0,t.jsxs)("tr",{children:[(0,t.jsx)("th",{children:"Customer ID"}),(0,t.jsx)("th",{children:"Email"}),(0,t.jsx)("th",{children:"Plan"}),(0,t.jsx)("th",{children:"Status"}),(0,t.jsx)("th",{children:"Stripe"})]})}),(0,t.jsx)("tbody",{children:c.map(e=>(0,t.jsxs)("tr",{onClick:()=>s(e),style:{cursor:"pointer"},className:r===e.customerId?"table-primary":"",children:[(0,t.jsx)("td",{children:(0,t.jsx)("code",{style:{fontSize:"0.8em"},children:e.customerId?`${e.customerId.slice(0,14)}…`:"—"})}),(0,t.jsx)("td",{children:e.email??(0,t.jsx)("span",{className:"text-muted",children:"—"})}),(0,t.jsx)("td",{children:e.productCode??"—"}),(0,t.jsx)("td",{children:(0,t.jsx)(n.Ex,{color:e.subscriptionExpired?"danger":"success",children:e.subscriptionExpired?"Expired":"Active"})}),(0,t.jsx)("td",{onClick:e=>e.stopPropagation(),children:e.customerId&&(0,t.jsx)(i,{href:`https://dashboard.stripe.com/customers/${e.customerId}`,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(u.g,{icon:h.AaJ,size:"sm"})})})]},e.customerId))})]})};p.propTypes={onSelectCustomer:d.func.isRequired,selectedCustomerId:d.string},p.defaultProps={selectedCustomerId:""};let x=()=>{let[e,s]=(0,a.useState)(null),[r,d]=(0,a.useState)([]),[m,u]=(0,a.useState)(30);(0,a.useEffect)(()=>{(async()=>{if(!e?.apiKeyId)return d([]);try{let s=(0,l.Jt)({apiName:"usage",path:`/${e.apiKeyId}`,options:{response:!0,queryParams:{days:Math.max(m,30)}}}),r=await s.response;d(await r.body.json())}catch(e){console.error("Failed to fetch usage:",e),d([])}})()},[e,m]);let h=(0,a.useCallback)(e=>{s(e),d([])},[]),x=(0,a.useCallback)(e=>{u(e)},[]);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(p,{onSelectCustomer:h,selectedCustomerId:e?.customerId}),e&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"d-flex align-items-center justify-content-between mt-4 mb-2",children:[(0,t.jsxs)("h6",{className:"mb-0",children:[(0,t.jsx)("code",{style:{fontSize:"0.85em"},children:e.customerId}),e.email&&(0,t.jsxs)("span",{className:"text-muted ml-2",children:["— ",e.email]})]}),(0,t.jsx)(i,{href:`https://dashboard.stripe.com/customers/${e.customerId}`,target:"_blank",rel:"noopener noreferrer",children:(0,t.jsx)(n.$n,{color:"default",size:"sm",outline:!0,children:"View in Stripe"})})]}),(0,t.jsx)(o.A,{product:e.productCode,apiKeyValue:void 0,status:e.subscriptionExpired?"inactive":"active",userAttributes:{"custom:customerId":e.customerId}}),(0,t.jsx)("div",{className:"d-flex justify-content-end mt-3",children:(0,t.jsx)(n.e2,{size:"sm","aria-label":"Date range",children:[{label:"2Y",days:730},{label:"1Y",days:365},{label:"6M",days:183},{label:"3M",days:91},{label:"1M",days:30},{label:"7D",days:7}].map(e=>{let{label:s,days:r}=e;return(0,t.jsx)(n.$n,{outline:!0,color:"default",onClick:()=>x(r),active:m===r,"aria-label":s,children:s},r)})})}),(0,t.jsx)(c.A,{usageData:r,dateRange:m})]})]})}},36776:(e,s,r)=>{r.r(s),r.d(s,{default:()=>m});var t=r(37876),a=r(14232),l=r(70008),n=r(95062),i=r(49105);r(74726),r(65791),r(32271),r(83886),r(73974),r(44647),r(28628),r(81778),r(61087),r(29178);var c=r(96523),o=r(11041);r(17634);let d=e=>{let{code:s="",language:r="",showCopy:n=!0}=e;return(0,a.useEffect)(()=>{setTimeout(()=>l.highlightAll(),300)},[s,r]),(0,t.jsxs)(t.Fragment,{children:[n&&(0,t.jsxs)(i.$n,{size:"sm",className:"copy",onClick:()=>{navigator.clipboard.writeText(s||"")},children:[(0,t.jsx)(c.g,{icon:o.$3n,className:"mr-2"}),"Copy"]}),(0,t.jsx)("pre",{children:(0,t.jsx)("code",{className:`language-${r}`,children:s})})]})},m=d;
1d.propTypes={code:n.string,language:n.string,showCopy:n.bool},d.defaultProps={code:"",language:"",showCopy:!0}},39108:(e,s,r)=>{r.d(s,{A:()=>j});var t=r(37876),a=r(14232),l=r(95062),n=r(49105),i=r(58736),c=r(52296),o=r(96523),d=r(11041),m=r(48230),u=r(25922),h=r(11426),p=r(36776);let x=e=>{let{product:s,apiKeyValue:r="",status:l,userAttributes:x}=e,[j,b]=(0,a.useState)(!1),[g,y]=(0,a.useState)(!1),f="true"===x["custom:isTeamAdmin"],N=async()=>{y(!0);try{let e=(0,u.bE)({apiName:"subscription",path:"/portal",options:{body:{customer:x["custom:customerId"],sub:x.sub}}}),{url:s}=await (await e.response).body.json();s?window.location.href=s:(console.log("Problem loading Stripe portal"),y(!1))}catch(e){y(!1),console.log(e)}},w=j?d.e68:d.$3n;return(0,a.useEffect)(()=>{j&&setTimeout(()=>b(!1),2e3)},[j]),(0,h.A)(()=>y(!1)),(0,t.jsx)(n.Zp,{className:"shadow border mt-3 mb-2",children:(0,t.jsxs)(n.bw,{children:[(0,t.jsx)("div",{children:(0,t.jsx)(n.Zp,{children:(0,t.jsxs)(n.bw,{children:[(0,t.jsxs)(i.s,{children:[(0,t.jsx)("h4",{children:"Your Plan:"}),(0,t.jsx)("h5",{className:"pt-1",children:s}),(0,t.jsx)("h5",{children:(0,t.jsx)(n.Ex,{color:"active"===l?"success":"warning",className:"text-white",children:l})})]}),r&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)(n.JU,{className:"h6",children:"API\xa0Key"}),(0,t.jsxs)(n.MG,{className:"",children:[(0,t.jsx)(p.default,{language:"javascript",code:r,className:"m-0",showCopy:!1}),(0,t.jsx)("div",{className:"py-2",children:(0,t.jsxs)(n.$n,{className:"ml-1 p-3 border-0",color:j?"slack":"primary",id:"apiKey",onClick:()=>{navigator.clipboard.writeText(r||""),b(!0)},children:[(0,t.jsx)("span",{className:"btn-inner--icon",children:(0,t.jsx)(o.g,{icon:w,className:"mr-2"})}),(0,t.jsxs)("span",{className:"nav-link-inner--text ml-1 mr-1",children:[!j&&"Copy",j&&"Copied"]})]})})]}),(0,t.jsxs)("p",{className:"mt-2",children:["This API Key gives your organisation access to our APIs. It"," ",(0,t.jsx)("b",{children:"must be kept secret"}),". We recommend storing it in a secure secrets manager. It must never be committed to source control repositories. If you need to change your key please"," ",(0,t.jsx)(m,{href:"mailto:[email protected]",children:"contact support"}),"."]})]})]})})}),(0,t.jsxs)("div",{className:"my-2",children:[f&&r&&(0,t.jsx)(n.Zp,{children:(0,t.jsxs)(n.bw,{children:[(0,t.jsx)("h4",{children:"Manage Your Subscription"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{children:"Use the button below to manage your subscription, including:"}),(0,t.jsxs)("ul",{children:[(0,t.jsx)("li",{children:"Updating billing details (add or change card details, billing address)"}),(0,t.jsx)("li",{children:"Viewing invoices"}),(0,t.jsx)("li",{children:"Cancelling your subscription"})]})]}),(0,t.jsxs)(n.$n,{color:"primary",onClick:N,disabled:g,className:"",children:[g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(c.aH,{decelerate:"true"}),(0,t.jsx)("span",{className:"nav-link-inner--text ml-1",children:"please wait"})]}),!g&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"btn-inner--icon",children:(0,t.jsx)(o.g,{icon:d.dB,className:"mr-2"})}),(0,t.jsx)("span",{className:"nav-link-inner--text ml-1",children:"Manage Subscription"})]})]}),(0,t.jsx)("p",{className:"mt-3 small",children:"Plans are billed monthly in arrears, at the end of each billing period. If you cancel, this stops future renewals, but it doesn't refund or cancel the charge for the billing period you're currently in."}),(0,t.jsxs)("p",{className:"mt-3",children:["If you need to change plans or end a free trial early to start a paid plan, please"," ",(0,t.jsx)(m,{href:"mailto:[email protected]",children:"contact support"}),"."]})]})}),r&&(0,t.jsx)(n.Zp,{className:"mt-2",children:(0,t.jsxs)(n.bw,{children:[(0,t.jsx)("h4",{children:"Useful Developer Resources"}),(0,t.jsxs)("p",{children:["We've prepared a"," ",(0,t.jsx)(m,{href:"https://www.postman.com/",target:"_blank",rel:"noreferrer",children:"Postman"})," ","Collection to help you get started with our APIs. Simply download, add your API key to the variables and start sending requests."]}),(0,t.jsx)(m,{href:"/assets/docs/Mintly-API.postman_collection.json",target:"_blank",download:!0,children:(0,t.jsxs)(n.$n,{color:"primary",children:[(0,t.jsx)(o.g,{icon:d.cbP,className:"mr-2"}),"Download postman collection"]})}),(0,t.jsxs)("p",{className:"mt-3",children:["Our ",(0,t.jsx)(m,{href:"/docs",children:"API Documentation"})," covers all Bank Account Checker endpoints and OpenAPI Specifications (YAML and JSON) can be downloaded there."]})]})})]})]})})};x.propTypes={product:l.string.isRequired,apiKeyValue:l.string,status:l.string.isRequired,userAttributes:l.object.isRequired},x.defaultProps={apiKeyValue:""};let j=x}}]);

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.