1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1893],{12041:(e,t,n)=>{n.d(t,{DA:()=>i,Dk:()=>r,pW:()=>a,v4:()=>s});let a="draft-2026-10",r=!0,s=[{id:"draft",heading:"Draft for legal review",paragraphs:["This document is a draft. It has not yet been reviewed by a lawyer, and ETEC+ will replace it with a reviewed version.","When that happens you will be asked to read and accept the new version before it applies to you. Until then, this draft sets out how the partner program works."]},{id:"parties",heading:"Who this agreement is between",paragraphs:['This agreement is between the business that operates ETEC+, whose legal name and ABN are shown at the top of this page ("ETEC+", "we", "us"), and the person or business named in the partner application ("you").',"It starts when ETEC+ approves your application. Accepting this agreement in your application does not guarantee that it will be approved."]},{id:"relationship",heading:"Independent contractor",paragraphs:["You are an independent contractor who runs your own business. Nothing in this agreement makes you an employee of ETEC+, and it does not create an agency, a joint venture or a legal partnership between us.",'The word "partner" is a commercial title for the people and businesses in this program. It has no other legal meaning.',"You decide how, when and where you work. You use your own equipment and you pay your own costs.","You have no authority to sign anything, accept money, offer a discount or make any promise on behalf of ETEC+, and you must not say or suggest that you do."]},{id:"services",heading:"What you do",paragraphs:["You introduce prospective clients to ETEC+ and sell ETEC+ managed plans, using the sales materials that ETEC+ provides or approves.","You only make claims about ETEC+ that are honest, accurate and supported by those materials. You do not promise results, prices, features or timeframes that ETEC+ has not published.","You comply with the Australian Consumer Law. That means no misleading or deceptive conduct, no false statements about what a product does or costs, and no pressure selling.","You comply with the Spam Act 2003. You only send commercial emails or messages to people who have agreed to receive them, you say who you are, and you include a way to unsubscribe that works.","You follow any reasonable direction ETEC+ gives you about its brand, its materials and how its products are described."]},{id:"commission",heading:"Commission and bonuses",paragraphs:["ETEC+ pays you commission and bonuses at the rates published in the partner portal. The published rates form part of this agreement.","Commission is a percentage of the plan amount, excluding GST, that a client attributed to you has actually paid. It is never calculated on GST, on the setup fee or on credit top-ups.","Commission is earned on each plan payment the client makes, for as long as the client keeps paying and this agreement is in force.","A bonus is paid once per client, when that client has paid the full setup fee. If the setup fee was waived or discounted, a bonus is paid only if ETEC+ decides to pay one.","ETEC+ may change the published rates. A change applies to client payments made on or after its effective date. It does not change commission already earned on earlier payments.","A client is attributed to you when they sign up through your partner link or when ETEC+ allocates them to you. ETEC+'s records decide who a client is attributed to. You cannot earn commission on your own business, or on an account that you own or are a member of."]},{id:"split_deals",heading:"Split deals",paragraphs:["Some deals are shared between two partners: one books and qualifies the client (the setter) and the other completes the sale (the closer).","On a split deal the setter and the closer are each paid at the rates published for split deals. ETEC+ decides whether a deal is full cycle or split, and who the setter and the closer are.","Payments on a split deal are reviewed and approved by ETEC+ before they are sent."]},{id:"payment",heading:"How you are paid",paragraphs:["You are paid only from client payments that ETEC+ has received in cleared funds. If a client does not pay, there is nothing to pay commission on.","Payments are made through Stripe to the Stripe account you connect in the partner portal. Stripe then pays your bank account on its payout schedule. ETEC+ does not pay by any other method.","You must complete Stripe's identity and bank account checks before you can be paid. Commission you earn before then is held for you and paid once your Str
1ipe account can receive it.","ETEC+ may hold a payment while the client payment behind it is under review, while your partner account is suspended, or while Stripe needs something from you."]},{id:"clawback",heading:"Refunds, chargebacks and clawback",paragraphs:["If a client payment is refunded, reversed or disputed (a chargeback), in full or in part, the commission and any bonus paid on it are reduced or reversed to match.","If that commission has not been paid yet, it is reduced or cancelled. If it has already been paid, you owe it back to ETEC+ (a clawback).","ETEC+ may recover a clawback by deducting it from your later commission or bonuses, or by reversing the Stripe transfer. If neither covers it, you must repay it when ETEC+ asks."]},{id:"gst",heading:"GST and recipient-created tax invoices",paragraphs:["All rates are stated excluding GST. If you are registered for GST, ETEC+ pays GST on top of your commission and bonuses. If you are not registered, no GST is added and ETEC+ gives you a remittance advice for each payment.","If you are registered for GST, you and ETEC+ agree to the following.","(a) ETEC+ can issue tax invoices for the supplies you make to ETEC+ under this agreement. These are recipient-created tax invoices.","(b) You will not issue tax invoices for those supplies.","(c) You are registered for GST when you enter into this agreement, and you will notify ETEC+ if you stop being registered.","(d) ETEC+ is registered for GST when it enters into this agreement, and it will notify you if it stops being registered.","You must tell ETEC+ straight away if your GST registration or your ABN changes."]},{id:"own_costs",heading:"Your ABN, tax, superannuation and insurance",paragraphs:["You must hold a valid Australian Business Number for as long as this agreement runs, and the ABN you give ETEC+ must be your own.","You are responsible for your own income tax, GST, superannuation and insurance, and for every cost of running your business.","Because you quote an ABN, ETEC+ does not withhold tax from your payments. ETEC+ does not provide leave or any other employment entitlement."]},{id:"clients",heading:"Clients, client data and the pipeline",paragraphs:["Every client and prospective client you introduce is a client or prospect of ETEC+. ETEC+ owns the client relationship, the client's data and the sales pipeline, during this agreement and after it ends.","ETEC+ contracts with clients directly, sets its own prices and terms, and decides whether to accept, keep or stop serving any client.","You only use client and prospect information to sell ETEC+ under this agreement. You do not copy it, keep it after this agreement ends, or use it for yourself or for anyone else."]},{id:"confidentiality",heading:"Confidentiality",paragraphs:["You keep confidential anything ETEC+ shares with you that is not public, including client and prospect details, unpublished pricing and internal materials.","You only use it for this agreement, and you return or delete it when the agreement ends. This duty continues after the agreement ends."]},{id:"non_exclusive",heading:"Not exclusive",paragraphs:["This agreement is not exclusive. You are free to work with other businesses, and ETEC+ is free to appoint other partners and to sell directly."]},{id:"term",heading:"Term and ending this agreement",paragraphs:["This agreement continues until one of us ends it.","Either of us can end it at any time by giving the other written notice. An email is enough.","ETEC+ may suspend or end it immediately if you breach it, mislead a client or prospect, or act in a way that could harm ETEC+ or its clients.","Commission and bonuses on client payments made before this agreement ends are still paid, subject to the refund and clawback rules above.","After this agreement ends, you are paid commission on later client payments only if ETEC+ confirms that in writing when the agreement ends, and only for the period it confirms.","The sections on clawback, clients, confidentiality, privacy and liability continue after this agreement ends."]},{id:"privacy",heading:"Privacy",paragraphs:["ETEC+ collects the details in your application, and records of your activity in the program, to assess your application, run the program and pay you. It handles them in line with its Privacy Policy.","ETEC+ shares with Stripe the details needed to verify your identity and pay you. Your bank details and identity documents are collected by Stripe and are not stored by ETEC+.","When you handle personal information about clients or prospects, you comply with the Privacy Act 1988 as it applies to you, and you tell ETEC+ straight away if that information is lost or seen by someone who should not have it."]},{id:"liability",heading:"Liability",paragraphs:["You are responsible for what you say and do when you sell ETEC+. You will c
1over any loss ETEC+ suffers because you breached this agreement, broke the law or made a claim that ETEC+ did not approve.","To the extent the law allows, ETEC+'s total liability to you under this agreement is limited to the commission and bonuses it owes you, and neither of us is liable to the other for indirect or consequential loss.","Nothing in this agreement excludes or limits a right or remedy that cannot be excluded or limited by law."]},{id:"general",heading:"General",paragraphs:["This agreement is governed by the laws of New South Wales, Australia, and the courts of New South Wales have jurisdiction.","You accept this agreement electronically, by ticking the declarations and typing your full legal name. That has the same effect as signing on paper. ETEC+ keeps a record of the version you accepted, when you accepted it, and the device and network address it came from.","This agreement, together with the rates published in the partner portal, is the entire agreement between us about the partner program. It replaces anything said or written before.","ETEC+ may update this agreement. A new version applies to you once you have accepted it."]}],i=[{id:"independent_contractor",label:"I am an independent contractor running my own business. I am not an employee of ETEC+, and this is not an agency or a legal partnership."},{id:"own_tax_and_insurance",label:"I am responsible for my own tax, superannuation, insurance and business costs."},{id:"commission_terms",label:"I am paid by commission only, from client payments that have cleared. Commission can be reduced or reversed if a client is refunded or disputes a payment."},{id:"client_ownership",label:"ETEC+ owns the client relationships, the client data and the sales pipeline, during this agreement and after it ends."},{id:"right_to_work_au",label:"I have the right to work in Australia, and the ABN I have given is my own."},{id:"privacy_consent",label:"I agree to ETEC+ collecting and using my details to run the partner program, and sharing them with Stripe to verify my identity and pay me."},{id:"rcti_agreement",label:"I am registered for GST. I agree that ETEC+ will issue recipient-created tax invoices for my commission and bonuses, that I will not issue tax invoices for them, and that I will tell ETEC+ if I stop being registered.",gstOnly:!0}]},13364:(e,t,n)=>{function a(e,t){return Number.isFinite(e)&&t>0?Math.round(e*t):0}function r(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function s(e){if(!Number.isFinite(e))return"0";let t=Math.abs(e);return t>=1e9?`${(e/1e9).toLocaleString("en-AU",{maximumFractionDigits:1})}B`:t>=1e6?`${(e/1e6).toLocaleString("en-AU",{maximumFractionDigits:1})}M`:t>=1e3?`${Math.floor(e/1e3).toLocaleString("en-AU")}K`:Math.round(e).toLocaleString("en-AU")}function i(e,t){return Number.isFinite(e)&&Number.isFinite(t)?Math.floor(e*(1e4-t)/1e4):0}function o(e,t){return Number.isFinite(e)&&t>0?1e4*Math.floor(Math.round(e*t)/1e4):0}function d(e,t){return Math.ceil(Math.round(e)/t-1e-6)}function l(e){return`A$${(e/100).toLocaleString("en-AU",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function c(e){switch(e){case"running":return"success";case"provisioning":case"starting":case"restarting":case"updating":return"warning";case"failed":case"error":return"destructive";default:return"muted"}}function u(e){return["provisioning","starting","restarting","updating","deleting"].includes(e||"")}n.d(t,{EH:()=>d,Ql:()=>r,X7:()=>o,Xc:()=>u,Zw:()=>l,di:()=>i,hJ:()=>m,iS:()=>c,o2:()=>a,rh:()=>s});let h={amex:"American Express",mastercard:"Mastercard",visa:"Visa",unionpay:"UnionPay",jcb:"JCB",diners:"Diners Club",discover:"Discover"};function m(e){return`${h[e.brand]??e.brand} \xb7\xb7\xb7\xb7${e.last4}`}},22164:(e,t,n)=>{n.d(t,{A:()=>a});
1let a=(0,n(78340).A)("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])},42763:(e,t,n)=>{n.d(t,{Cf:()=>h,Es:()=>p,L3:()=>g,c7:()=>m,lG:()=>d,rr:()=>f,zM:()=>l});var a=n(95155),r=n(12115),s=n(43146),i=n(33210),o=n(40980);let d=s.bL,l=s.l9,c=s.ZL;s.bm;let u=r.forwardRef(({className:e,...t},n)=>(0,a.jsx)(s.hJ,{ref:n,className:(0,o.cn)("fixed inset-0 z-50 bg-black/50 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));u.displayName=s.hJ.displayName;let h=r.forwardRef(({className:e,children:t,...n},r)=>(0,a.jsxs)(c,{children:[(0,a.jsx)(u,{}),(0,a.jsxs)(s.UC,{ref:r,className:(0,o.cn)("fixed left-1/2 top-1/2 z-50 grid min-w-0 max-h-[90vh] w-[calc(100%-2rem)] max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 overflow-y-auto rounded-lg border bg-background p-6 shadow-lg duration-200",e),...n,children:[t,(0,a.jsxs)(s.bm,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring disabled:pointer-events-none",children:[(0,a.jsx)(i.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Close"})]})]})]}));function m({className:e,...t}){return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}function p({className:e,...t}){return(0,a.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...t})}h.displayName=s.UC.displayName;let g=r.forwardRef(({className:e,...t},n)=>(0,a.jsx)(s.hE,{ref:n,className:(0,o.cn)("text-lg font-semibold leading-none tracking-tight",e),...t}));g.displayName=s.hE.displayName;let f=r.forwardRef(({className:e,...t},n)=>(0,a.jsx)(s.VY,{ref:n,className:(0,o.cn)("text-sm text-muted-foreground",e),...t}));f.displayName=s.VY.displayName},45160:(e,t,n)=>{n.d(t,{E:()=>o});var a=n(95155),r=n(18460),s=n(40980);let i=(0,r.F)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium transition-colors",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"text-foreground",success:"border-transparent bg-emerald-100 text-emerald-800 dark:bg-emerald-500/15 dark:text-emerald-300",warning:"border-transparent bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300",muted:"border-transparent bg-muted text-muted-foreground",brand:"border-transparent bg-brand text-brand-foreground"}},defaultVariants:{variant:"default"}});function o({className:e,variant:t,...n}){return(0,a.jsx)("span",{className:(0,s.cn)(i({variant:t}),e),...n})}},75230:(e,t,n)=>{n.d(t,{T:()=>d});var a=n(95155),r=n(12115),s=n(66609),i=n(42763),o=n(89239);function d({open:e,onOpenChange:t,title:n,description:l,confirmText:c="Confirm",destructive:u=!1,onConfirm:h}){let[m,p]=(0,r.useState)(!1);async function g(){p(!0);try{await h(),t(!1)}catch(e){s.oR.error(e.message)}finally{p(!1)}}return(0,a.jsx)(i.lG,{open:e,onOpenChange:t,children:(0,a.jsxs)(i.Cf,{children:[(0,a.jsxs)(i.c7,{children:[(0,a.jsx)(i.L3,{children:n}),l&&(0,a.jsx)(i.rr,{children:l})]}),(0,a.jsxs)(i.Es,{children:[(0,a.jsx)(o.$,{variant:"outline",onClick:()=>t(!1),disabled:m,children:"Cancel"}),(0,a.jsx)(o.$,{variant:u?"destructive":"default",onClick:g,disabled:m,children:m?"Working...":c})]})]})})}},83765:(e,t,n)=>{n.d(t,{Ev:()=>T,Iw:()=>A,Jg:()=>I,KN:()=>v,LR:()=>z,M:()=>C,X6:()=>N,ZX:()=>$,bJ:()=>D,is:()=>q,jT:()=>_,lZ:()=>L,mW:()=>E,oJ:()=>M,p5:()=>k,pc:()=>S,wq:()=>Y,x$:()=>j});var a=n(95155),r=n(12115),s=n(98500),i=n.n(s),o=n(41585),d=n(22164),l=n(94514),c=n(41641),u=n(21362),h=n(55554),m=n(61732),p=n(45160),g=n(89239),f=n(60529),y=n(77977),b=n(12041),x=n(40980);let w={applying:"outline",submitted:"warning",approved:"success",rejected:"muted",suspended:"destructive",terminated:"muted"};function v({status:e}){return(0,a.jsx)(p.E,{variant:w[e]??"muted",children:y.R8[e]??e})}function E({stage:e}){return(0,a.jsx)(p.E,{variant:"outline",children:y.J4[e]??e})}function N(e){return"approved"===e||"suspended"===e||"terminated"===e}function j(e,t){return"approved"!==e.status?null:t?"Ready":e.stripe_account_id?"Setup incomplete":"Not started"}function C(e){return e.legal_name||e.preferred_name||e.email}function T(e){return[e.suburb,e.state,e.postcode].filter(Boolean).join(" ")}let k="mt-1.5 flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",S="mt-1.5 flex w-full resize-y rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm transition-colors placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50";function A(e){return e?y.W0.includes(e)?"That word is reserved. Choose another.":(0,y.J5)(e)?null:"Use 3 to 32 lowercase letters, digits and hyphens. It can't start or end with a hyphen, or have two in a row.":"Choose a handle. It becomes their partner link."}
1function I({value:e,onChange:t,error:n,disabled:s,autoFocus:i}){let o=(0,r.useId)(),d=(0,r.useRef)(null),l=n??A(e);return(0,r.useEffect)(()=>{n&&!s&&d.current?.focus()},[n,s]),(0,a.jsxs)("label",{className:"block text-sm font-medium",children:["Handle",(0,a.jsxs)("span",{className:"mt-1.5 flex items-center rounded-md border border-input shadow-sm focus-within:ring-1 focus-within:ring-ring",children:[(0,a.jsx)("span",{className:"select-none pl-3 text-sm font-normal text-muted-foreground",children:"/partner/"}),(0,a.jsx)(f.p,{ref:d,className:"border-0 pl-0.5 shadow-none focus-visible:ring-0",value:e,onChange:e=>t(e.target.value.toLowerCase().replace(/\s+/g,"-").replace(/[^a-z0-9-]/g,"")),maxLength:32,spellCheck:!1,autoCapitalize:"none",autoCorrect:"off","aria-label":"Partner handle","aria-invalid":!!l,"aria-describedby":o,disabled:s,autoFocus:i})]}),n?(0,a.jsx)("span",{id:o,role:"alert",className:"mt-1.5 block text-xs font-normal text-destructive",children:n},"server"):(0,a.jsx)("span",{id:o,className:(0,x.cn)("mt-1.5 block text-xs font-normal",l&&e?"text-destructive":"text-muted-foreground"),children:l??`Partner link: /partner/${e}`},"hint")]})}function _({matches:e,className:t}){return e.length?(0,a.jsxs)("div",{className:(0,x.cn)("flex items-start gap-2 rounded-lg border border-warning-border bg-warning-surface px-3 py-2 text-xs",t),children:[(0,a.jsx)(o.A,{className:"mt-0.5 size-3.5 shrink-0 text-warning","aria-hidden":!0}),(0,a.jsxs)("p",{children:[1===e.length?"Another partner quotes this ABN: ":"Other partners quote this ABN: ",e.map((e,t)=>(0,a.jsxs)("span",{children:[t>0&&", ",(0,a.jsx)(i(),{href:`/admin/partners/${e.id}`,className:"font-medium underline underline-offset-2",children:e.legal_name||"Unnamed partner"})," ","(",y.R8[e.status]??e.status,")"]},e.id)),". A company and its director can both apply, so check who this one is before you decide."]})]}):null}function $(){return(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-3 rounded-xl border border-warning-border bg-warning-surface px-4 py-3 text-sm",children:[(0,a.jsx)(o.A,{className:"mt-0.5 size-4 shrink-0 text-warning","aria-hidden":!0}),(0,a.jsxs)("p",{children:["The partner program isn't in this database yet. Apply"," ",(0,a.jsx)("code",{className:"font-mono text-xs",children:"supabase/migrations/0074_partner_program.sql"})," and reload. Until then nobody can apply, and this page stays empty."]})]})}function Y({answers:e}){let t=e?.experience?.trim(),n=e?.linkedin?.trim(),r=e?.heard_from?.trim();return t||n||r?(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"What they wrote"}),(0,a.jsxs)("div",{className:"mt-1.5 space-y-2 rounded-lg border bg-muted/30 p-3 text-sm",children:[t&&(0,a.jsx)("p",{className:"whitespace-pre-wrap",children:t}),n&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Profile:"," ",/^https?:\/\//i.test(n)?(0,a.jsxs)("a",{href:n,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-foreground hover:underline",children:[n,(0,a.jsx)(d.A,{className:"size-3","aria-hidden":!0})]}):n]}),r&&(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Heard about us from: ",r]})]})]}):null}function M({ids:e}){return e.length?(0,a.jsx)("ul",{className:"space-y-1.5",children:e.map(e=>(0,a.jsxs)("li",{className:"flex items-start gap-2 text-xs",children:[(0,a.jsx)(l.A,{className:"mt-0.5 size-3.5 shrink-0 text-emerald-600 dark:text-emerald-400","aria-hidden":!0}),(0,a.jsx)("span",{children:b.DA.find(t=>t.id===e)?.label??e})]},e))}):(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"No declarations were recorded."})}function L({agreement:e}){let t=e.version===b.pW;return(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-sm",children:[(0,a.jsxs)("span",{children:["Signed as ",(0,a.jsxs)("span",{className:"font-medium",children:["â",e.signed_name,"â"]})," on ",(0,m.KQ)(e.accepted_at)]}),(0,a.jsx)(p.E,{variant:"outline",className:"font-mono font-normal",children:e.version}),t&&b.Dk&&(0,a.jsx)(p.E,{variant:"warning",children:"Draft agreement"}),!t&&(0,a.jsx)(p.E,{variant:"muted",children:"Older version"})]})}function D({agreement:e}){return e?(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-xs font-medium text-muted-foreground",children:"Agreement"}),(0,a.jsxs)("div",{className:"mt-1.5 space-y-2",children:[(0,a.jsx)(L,{agreement:e}),(0,a.jsx)(M,{ids:e.declarations??[]})]})]}):(0,a.jsx)("p",{className:"text-sm text-muted-foreground",children:"No signed agreement on file."})}function q({page:e,pageSize:t,total:n,onPage:r}){if(n<=t)return null;let s=Math.max(1,Math.ceil(n/t));return(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-between text-sm text-muted-foreground",children:[(0,a.jsxs)("span",{className:"tabular-nums",children:[(e-1)*t+1,"â",Math.min(n,e*t)," of ",n]}),(0,a.jsxs)("div",{className:"flex gap-1",children:[(0,a.jsx)(g.$,{variant:"outline",size:"icon",className:"size-8",disabled:e<=1,onClick:()=>r(e-1),"aria-label":"Previous page",children:(0,a.jsx)(c.A,{className:"size-4"})}),(0,a.jsx)(g.$,{variant:"outline",size:"icon",className:"size-8",disabled:e>=s,onClick:()=>r(e+1),"aria-label":"Next page",children:(0,a.jsx)(u.A,{className:"size-4"})})]})]})}function z(){return(0,h.T_)().refreshPartnerWork}},87757:(e,t,n)=>{n.d(t,{I:()=>w,Lg:()=>j,P$:()=>f,PE:()=>y,Tq:()=>N,XV:()=>b,_N:()=>v,aV:()=>x,lZ:()=>E,ob:()=>p,s7:()=>g,uw:()=>k}
1);var a=n(95155),r=n(12115),s=n(41585),i=n(6296),o=n(66609),d=n(83765),l=n(89239),c=n(42763),u=n(60529),h=n(27529),m=n(40980);function p(e){let t=e.replace(/[\s,$]/g,"");if(!/^\d+(\.\d{1,2})?$/.test(t))return null;let n=Math.round(100*Number(t));return Number.isSafeInteger(n)?n:null}function g(e){return(Math.max(0,e)/100).toFixed(2)}function f(e){let t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(!t)return null;let n=new Date(Number(t[1]),Number(t[2])-1,Number(t[3]));return Number.isNaN(n.getTime())?null:n.toISOString()}function y(e){let t=e?new Date(e):new Date,n=Number.isNaN(t.getTime())?new Date:t;return`${n.getFullYear()}-${String(n.getMonth()+1).padStart(2,"0")}-${String(n.getDate()).padStart(2,"0")}`}function b(e){return e?new Date(e).toLocaleDateString("en-AU",{day:"numeric",month:"short",year:"numeric"}):"â"}function x(e,t){let[n,a]=(0,r.useState)(null),[s,i]=(0,r.useState)(!0),[d,l]=(0,r.useState)(!1),[c,u]=(0,r.useState)(!1),m=(0,r.useCallback)(async n=>{i(!0),l(!1);try{let t=await (0,h.nr)(e,{signal:n});a(t),u(!!t?.migrationRequired)}catch(e){if("AbortError"===e.name)return;e instanceof h.E6&&"migration_required"===e.code?u(!0):o.oR.error(`Couldn't load ${t}: ${e.message}`),l(!0)}finally{n?.aborted||i(!1)}},[e,t]);return(0,r.useEffect)(()=>{let e=new AbortController;return m(e.signal),()=>e.abort()},[m]),{data:n,loading:s,failed:d,migrationRequired:c,reload:(0,r.useCallback)(()=>m(),[m])}}function w({className:e}){return(0,a.jsxs)("div",{className:(0,m.cn)("mb-4 flex items-start gap-3 rounded-xl border border-warning-border bg-warning-surface px-4 py-3 text-sm",e),children:[(0,a.jsx)(s.A,{className:"mt-0.5 size-4 shrink-0 text-warning","aria-hidden":!0}),(0,a.jsxs)("p",{children:["This part of the partner program isn't in this database yet. Apply"," ",(0,a.jsx)("code",{className:"font-mono text-xs",children:"supabase/migrations/0076_partner_payrun.sql"})," and reload. Until then nothing here can be changed."]})]})}function v({rows:e=4,className:t}){return(0,a.jsx)("div",{className:(0,m.cn)("space-y-2 px-5 py-4",t),"aria-busy":"true",children:Array.from({length:e}).map((e,t)=>(0,a.jsx)("div",{className:"h-9 animate-pulse rounded bg-muted"},t))})}function E({message:e}){return e?(0,a.jsx)("p",{role:"alert",className:"rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:e}):null}function N({label:e,value:t,onChange:n,placeholder:r,hint:s,disabled:i,optional:o,autoFocus:l}){return(0,a.jsxs)("label",{className:"block text-sm font-medium",children:[e," ",(0,a.jsx)("span",{className:"font-normal text-muted-foreground",children:o?"(optional)":"(required, internal)"}),(0,a.jsx)("textarea",{className:d.pc,value:t,onChange:e=>n(e.target.value),rows:3,maxLength:2e3,placeholder:r,disabled:i,autoFocus:l}),(0,a.jsx)("span",{className:"mt-1.5 block text-xs font-normal text-muted-foreground",children:s??"Kept in the audit log. Never shown or sent to the partner."})]})}function j({open:e,onOpenChange:t,title:n,description:s,noteLabel:i="Why",notePlaceholder:o,noteOptional:d,confirmText:l,dismissText:u="Cancel",destructive:h,canSubmit:m=!0,children:p,onSubmit:g}){let[f,y]=(0,r.useState)(!1);return(0,a.jsx)(c.lG,{open:e,onOpenChange:e=>!f&&t(e),children:(0,a.jsx)(c.Cf,{className:"sm:max-w-lg",children:e&&(0,a.jsx)(C,{title:n,description:s,noteLabel:i,notePlaceholder:o,noteOptional:d,confirmText:l,dismissText:u,destructive:h,canSubmit:m,busy:f,setBusy:y,onClose:()=>t(!1),onSubmit:g,children:p})})})}function C({title:e,description:t,noteLabel:n,notePlaceholder:s,noteOptional:o,confirmText:d,dismissText:u,destructive:h,canSubmit:m,busy:p,setBusy:g,onClose:f,onSubmit:y,children:b}){let[x]=(0,r.useState)(()=>crypto.randomUUID()),[w,v]=(0,r.useState)(""),[j,T]=(0,r.useState)(null),k=m&&(o||w.trim().length>0);async function S(){if(k&&!p){g(!0),T(null);try{await y(w.trim(),x),f()}catch(e){T(e.message||"That didn't work. Nothing was changed.")}finally{g(!1)}}}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(c.c7,{children:[(0,a.jsx)(c.L3,{children:e}),t&&(0,a.jsx)(c.rr,{children:t})]}),(0,a.jsxs)("form",{className:"space-y-5",onSubmit:e=>{e.preventDefault(),S()},children:[b,(0,a.jsx)(N,{label:n,value:w,onChange:v,placeholder:s,optional:o,disabled:p}),(0,a.jsx)(E,{message:j}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(l.$,{type:"button",variant:"outline",onClick:f,disabled:p,children:u}),(0,a.jsxs)(l.$,{type:"submit",variant:h?"destructive":"default",disabled:p||!k,children:[p&&(0,a.jsx)(i.A,{className:"animate-spin"}),d]})]})]})]})}let T={suspend:{title:e=>`Suspend ${e}?`,description:"Their partner link stops working and nothing is sent to them while they are suspended. Commission and bonuses on their clients are still recorded, and wait as held until they are reinstated. They aren't emailed about this.",confirm:"Suspend",done:e=>`${e} is suspended. Their payments are held.`,placeholder:"e.g. Complaint from a client, pausing while we look into it"},reinstate:{title:e=>`Reinstate ${e}?`,description:"They become an approved partner again: their link works, and anything held while they were suspended is sent on the next pay run, as long as nothing else is
1in its way.",confirm:"Reinstate",done:e=>`${e} is reinstated.`,placeholder:"e.g. Complaint resolved"},terminate:{title:e=>`End ${e}'s partnership?`,description:"They stop being a partner: their link stops working and they can't take on new clients. This can't be undone from here. Choose below whether commission on their existing clients stops now or carries on until a date.",confirm:"End partnership",done:e=>`${e}'s partnership has ended.`,placeholder:"e.g. Left by agreement, trailing commission for 3 months per clause 9"}};function k({partner:e,action:t,onOpenChange:n,onDone:s}){let i=(0,d.M)(e),[l,c]=(0,r.useState)("now"),[m,p]=(0,r.useState)(""),g=(0,r.useId)(),[b,x]=(0,r.useState)("suspend");(0,r.useEffect)(()=>{t&&(x(t),c("now"),p(""))},[t]);let w=T[t??b],v=y(),E="date"===l?f(m):null,N="now"===l||!!E&&m>v;return(0,a.jsxs)(j,{open:!!t,onOpenChange:n,title:w.title(i),description:w.description,notePlaceholder:w.placeholder,confirmText:w.confirm,destructive:(t??b)!=="reinstate",canSubmit:(t??b)!=="terminate"||N,onSubmit:async(n,a)=>{if(!t)return;let r={note:n,request_id:a};"terminate"===t&&(r.commission_until="date"===l&&E?E:"now"),await (0,h.nr)(`/api/admin/partners/${e.id}/${t}`,{method:"POST",body:JSON.stringify(r)}),o.oR.success(w.done(i)),await s()},children:[(t??b)==="terminate"&&"suspended"===e.status&&(0,a.jsxs)("p",{className:"rounded-lg border border-warning-border bg-warning-surface px-3 py-2 text-sm",children:[i," is suspended, so their payments are being held. Ending the partnership keeps them held: their payouts are put on hold. To send what is held, change their payout setting afterwards; to keep it, cancel the lines."]}),(t??b)==="terminate"&&(0,a.jsxs)("fieldset",{className:"space-y-2",children:[(0,a.jsx)("legend",{className:"text-sm font-medium",children:"Commission on their existing clients"}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 text-sm has-[:checked]:border-foreground",children:[(0,a.jsx)("input",{type:"radio",name:g,className:"mt-1",checked:"now"===l,onChange:()=>c("now")}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block font-medium",children:"Stop now"}),(0,a.jsxs)("span",{className:"block text-xs text-muted-foreground",children:["No commission is recorded on client payments from this moment. Lines already created are still paid","suspended"===e.status?" once their payouts are taken off hold.":"."]})]})]}),(0,a.jsxs)("label",{className:"flex cursor-pointer items-start gap-2.5 rounded-lg border p-3 text-sm has-[:checked]:border-foreground",children:[(0,a.jsx)("input",{type:"radio",name:g,className:"mt-1",checked:"date"===l,onChange:()=>c("date")}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"block font-medium",children:"Keep paying until a date"}),(0,a.jsx)("span",{className:"block text-xs text-muted-foreground",children:"Commission is still recorded on client payments made before this date, and stops from it."}),"date"===l&&(0,a.jsx)(u.p,{type:"date",className:"mt-2 w-44",value:m,min:v,onChange:e=>p(e.target.value),"aria-label":"Commission is paid until","aria-invalid":!!m&&!N}),"date"===l&&m&&!N&&(0,a.jsx)("span",{className:"mt-1 block text-xs text-destructive",children:"Choose a date after today."})]})]})]})]})}},94514:(e,t,n)=>{n.d(t,{A:()=>a});let a=(0,n(78340).A)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])}}]);
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.