1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b5c20c49-de09-40ea-8e5f-9008ee919aa7",e._sentryDebugIdIdentifier="sentry-dbid-b5c20c49-de09-40ea-8e5f-9008ee919aa7")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4816],{25890:(e,t,r)=>{r.d(t,{C:()=>o,r:()=>a});let n="/api/files/serve/",i="/dashboard/files/serve/";function s(e){if(!e)return null;try{return new URL(e,"http://localhost")}catch(e){return null}}function a(e){let t=s(e);if(!t)return e;if(t.pathname.startsWith(i))return"".concat(t.pathname).concat(t.search).concat(t.hash);if(!t.pathname.startsWith(n))return e;let r=t.pathname.slice(n.length);return"".concat(i).concat(r).concat(t.search).concat(t.hash)}function o(e){let t=a(e),r=s(t);if(!r||!r.pathname.startsWith(i))return t;let n=new URLSearchParams(r.search);n.set("inline","true");let o=n.toString();return"".concat(r.pathname).concat(o?"?".concat(o):"").concat(r.hash)}},34816:(e,t,r)=>{r.d(t,{hD:()=>n.hD,FH:()=>S,SU:()=>w,hS:()=>v});var n=r(74773);let i=new Map,s=new Map;function a(e){var t,r;return{page:null!=(r=null==e?void 0:e.page)?r:1,limit:null==e?void 0:e.limit,search:(null==e||null==(t=e.search)?void 0:t.trim())||void 0}}function o(e){let t=new URLSearchParams;return(null==e?void 0:e.page)&&t.set("page",e.page.toString()),(null==e?void 0:e.limit)&&t.set("limit",e.limit.toString()),(null==e?void 0:e.search)&&t.set("search",e.search),t.toString()}function c(e,t){let r=a(t);return"".concat(e,":").concat(JSON.stringify(r))}function l(e){return{data:[...e.data],pagination:{...e.pagination}}}function u(){i.clear(),s.clear()}function d(e){let{result:t,...r}=e;return{...r,...t?{result:{piiFindings:t.piiFindings,draft:p(t.draft)}}:{}}}function m(e){if(!e)return;let{githubUrl:t,...r}=e;return!r.github&&t?{...r,github:t}:r}function p(e){let{displayName:t,...r}=e;return{...r,...null==t?{}:{displayName:t},contactInfo:m(e.contactInfo)}}function h(e){return{...e,...e.contactInfo?{contactInfo:m(e.contactInfo)}:{}}}var g=r(25890);function f(e){var t;return e&&"object"==typeof e?{...e,thumbnailUrl:e.thumbnailUrl?(0,g.r)(e.thumbnailUrl):e.thumbnailUrl,pdfUrl:e.pdfUrl?(0,g.r)(e.pdfUrl):e.pdfUrl,htmlUrl:e.htmlUrl?(0,g.r)(e.htmlUrl):e.htmlUrl,artifacts:null==(t=e.artifacts)?void 0:t.map(e=>({...e,url:(0,g.r)(e.url)}))}:{thumbnailUrl:void 0,pdfUrl:void 0,htmlUrl:void 0,artifacts:[]}}var y=r(35133);class b extends n.dg{constructor(e){var t;super(e),this.users=function(e){return{listDeviceCredentials:()=>e.request("/web/ext-credentials"),revokeDeviceCredential:t=>e.request("/web/ext-credentials/".concat(encodeURIComponent(t)),{method:"PATCH",body:JSON.stringify({action:"revoke"})}),getProfile:()=>e.request("/users/profile"),updateProfile:t=>e.request("/users/profile",{method:"PATCH",body:JSON.stringify(t)}),deleteAccount:()=>e.request("/users/profile",{method:"DELETE"}),exportData:()=>e.request("/users/export"),updateNotificationPreferences:t=>e.request("/users/notification-preferences",{method:"PATCH",body:JSON.stringify(t)}),updateMeasurementConsent:t=>e.request("/users/measurement-consent",{method:"PATCH",body:JSON.stringify(t)}),getDefaultTemplate:()=>e.request("/users/default-template"),setDefaultTemplate:t=>e.request("/users/default-template",{method:"PATCH",body:JSON.stringify({templateId:t})})}}(this),this.resumeGenerationRuns=function(e){return{createRun:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.request("/resumes/".concat(t,"/generation-runs"),{method:"POST",body:JSON.stringify(r)})},getRun:(t,r)=>e.request("/resumes/".concat(t,"/generation-runs/").concat(r)),retryRun:(t,r,n)=>{var i;return e.request("/resumes/".concat(t,"/generation-runs/").concat(r,"/retry"),{method:"POST",...(null==n||null==(i=n.formats)?void 0:i.length)?{body:JSON.stringify({formats:n.formats})}:{}})}}}(this);let r=function(e){return{resumes:{list:async t=>{var r;let n=new URLSearchParams;(null==t?void 0:t.page)&&n.set("page",String(t.page)),(null==t?void 0:t.limit)&&n.set("limit",String(t.limit)),(null==t?void 0:t.favorite)!==void 0&&n.set("favorite",String(t.favorite)),(null==t||null==(r=t.search)?void 0:r.trim())&&n.set("search",t.search.trim());let i=n.toString();return e.request("/resumes".concat(i?"?".concat(i):""))},get:t=>e.request("/resumes/".concat(t)),create:t=>e.request("/resumes",{method:"POST",body:JSON.stringify(t)}),update:(t,r)=>e.request("/resumes/".concat(t),{method:"PUT",body:JSON.stringify(r)}),delete:t=>e.request("/resumes/".concat(t),{method:"DELETE"}),duplicate:t=>e.request("/resumes/".concat(t,"/duplicate"),{method:"POST"}),toggleFavorite:t=>e.request("/resumes/".concat(t,"/favorite"),{method:"PATCH"}),analyze:t=>e.request("/resumes/".concat(t,"/analyze"),{method:"POST"}),generateContent:(t,r)=>e.request("/resumes/".concat(t,"/generate"),{method:"POST",body:JSON.stringify(r)}),startCreation:t=>{let{idempotencyKey:r,...n}=t;return e.request("/resumes/creation-jobs",{method:"POST",headers:{"Idempotency-Key":r},body:JSON.stringify(n)})},getCreation:t=>e.request("/resumes/creation-jobs/"+encodeURIComponent(t),{cache:"no-store"}),retryCreation:t=>e.request("/resumes/creation-jobs/"+encodeURIComponent(t)+"/retry",{method:"POST"}),createFromProfile:t=>{let{idempotencyKey:r,...n}=t;return e.request("/resumes/from-profile",{method:"POST",headers:r?{"Idempotency-Key":r}:void 0,body:JSON.stringify(n)})}},experiences:{list:t=>e.request("/resumes/".concat(t,"/experiences")),create:(t,r)=>e.request("/resumes/".concat(t,"/experiences"),{method:"POST",body:JSON.stringify(r)}),update:(t,r,n)=>e.request("/resumes/".concat(t,"/experiences/").concat(r),{method:"PATCH",body:JSON.stringify(n)}),delete:(t,r)=>e.request("/resumes/".concat(t,"/experiences/").concat(r),{method:"DELETE"})},education:{list:t=>e.request("/resumes/".concat(t,"/education")),create:(t,r)=>e.request("/resumes/".concat(t,"/education"),{method:"POST",body:JSON.stringify(r)}),update:(t,r,n)=>e.request("/resumes/".concat(t,"/education/").concat(r),{method:"PATCH",body:JSON.stringify(n)}),delete:(t,r)=>e.request("/resumes/".concat(t,"/education/").concat(r),{method:"DELETE"})},skills:{list:t=>e.request("/resumes/".concat(t,"/skills")),create:(t,r)=>e.request("/resumes/".concat(t,"/skills"),{method:"POST",body:JSON.stringify(r)}),update:(t,r,n)=>e.request("/resumes/".concat(t,"/skills/").concat(r),{method:"PATCH",body:JSON.stringify(n)}),delete:(t,r)=>e.request("/resumes/".concat(t,"/skills/").concat(r),{method:"DELETE"})},exports:{listExports:t=>e.request("/exports/history/".concat(t)),deleteExport:t=>e.request("/exports/".concat(t),{method:"DELETE"}),createJob:(t,r,i)=>{if(!(null==i?void 0:i.paperSize))throw new n.hD("paperSize is required when creating export jobs",400);return e.request("/exports/jobs",{method:"POST",body:JSON.stringify({resumeId:t,format:r,options:i})})},getJob:t=>e.request("/exports/jobs/".concat(t)),listJobs:async t=>{let r=new URLSearchParams;(null==t?void 0:t.resumeId)&&r.set("resumeId",t.resumeId),(null==t?void 0:t.cursor)&&r.set("cursor",t.curs
1or),(null==t?void 0:t.limit)&&r.set("limit",String(t.limit));let n=r.toString();return e.request("/exports/jobs".concat(n?"?".concat(n):""))},downloadJob:t=>e.fetchWithAuth(e.buildUrl("/exports/jobs/".concat(t,"/download")),{})},resumeArtifacts:{getResumeArtifacts:async t=>f(await e.request("/resume-artifacts/".concat(t))),renderPreviewHtml:(t,r)=>e.request("/resume-artifacts/".concat(t,"/preview-html"),{method:"POST",body:JSON.stringify(r)}),generateResumeArtifacts:function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!r.paperSize)throw new n.hD("paperSize is required when generating resume artifacts",400);let i=new URLSearchParams;if(r.quality&&i.append("quality",r.quality),r.formats){if(r.formats.filter(e=>"pdf"===e).length>0)throw new n.hD("PDF exports must use /exports/jobs",400);i.append("formats",r.formats.join(","))}i.append("paperSize",r.paperSize);let s=i.toString();return e.request("/resume-artifacts/".concat(t,"/generate").concat(s?"?".concat(s):""),{method:"POST"}).then(e=>f(e))},getArtifactStatus:t=>e.request("/resume-artifacts/".concat(t,"/status")),cleanupResumeArtifacts:t=>e.request("/resume-artifacts/".concat(t),{method:"DELETE"}),downloadArtifact:async(t,r)=>{let i=await e.fetchWithAuth((0,g.r)(t),{});if(!i.ok)throw new n.hD("Failed to download artifact",i.status);let s=await i.blob();if(r&&1){let e=null,t=null;try{e=window.URL.createObjectURL(s),(t=document.createElement("a")).href=e,t.download=r,document.body.appendChild(t),t.click()}finally{(null==t?void 0:t.parentNode)&&document.body.removeChild(t),e&&window.URL.revokeObjectURL(e)}}return s}}}}(this);this.resumes=r.resumes,this.experiences=r.experiences,this.education=r.education,this.skills=r.skills,this.exports=r.exports,this.getResumeArtifacts=r.resumeArtifacts.getResumeArtifacts,this.renderResumePreviewHtml=r.resumeArtifacts.renderPreviewHtml,this.generateResumeArtifacts=r.resumeArtifacts.generateResumeArtifacts,this.getArtifactStatus=r.resumeArtifacts.getArtifactStatus,this.cleanupResumeArtifacts=r.resumeArtifacts.cleanupResumeArtifacts,this.downloadArtifact=r.resumeArtifacts.downloadArtifact;let m=function(e){return{jobs:{list:t=>{let r=o(t);return e.request("/jobs".concat(r?"?".concat(r):""))},listMine:async t=>{let r=e.getAuthScopeKey(),n=function(e,t){let r=Date.now(),n=a(t),s=c(e,n),o=i.get(s);if(o&&o.expiresAt>r)return l(o.response);if(o&&i.delete(s),!n.limit)return null;for(let[t,s]of i.entries()){if(s.expiresAt<=r){i.delete(t);continue}if(s.authKey!==e||s.params.page!==n.page||s.params.search!==n.search)continue;let a=s.params.limit;if(("number"!=typeof a||!(a<n.limit))&&(void 0===a||a>=n.limit)){var u;let e=s.response.pagination.total,t=n.limit;return{data:s.response.data.slice(0,t),pagination:{page:null!=(u=n.page)?u:1,limit:t,total:e,totalPages:Math.max(1,Math.ceil(e/t))}}}}return null}(r,t);if(n)return n;let u=function(e,t){let r=a(t),n=c(e,r),i=s.get(n);if(i)return i.request;if(!r.limit)return null;for(let[,t]of s.entries()){if(t.authKey!==e)continue;let n=t.params;if(n.page===r.page&&n.search===r.search&&(void 0===n.limit||n.limit>=r.limit)){let e=r.limit;return t.request.then(t=>{var n;return{data:t.data.slice(0,e),pagination:{page:null!=(n=r.page)?n:1,limit:e,total:t.pagination.total,totalPages:Math.max(1,Math.ceil(t.pagination.total/e))}}})}}return null}(r,t);if(u)return u;let d=o(t),m=a(t),p=c(r,m),h=e.request("/jobs/mine".concat(d?"?".concat(d):"")).then(e=>(i.set(c(r,t),{authKey:r,params:a(t),response:l(e),expiresAt:Date.now()+15e3}),l(e))).finally(()=>{s.delete(p)});return s.set(p,{authKey:r,params:m,request:h}),h},get:t=>e.request("/jobs/".concat(t)),create:async t=>{let r=await e.request("/jobs",{method:"POST",body:JSON.stringify(t)});return u(),r},update:async(t,r)=>{let n=await e.request("/jobs/".concat(t),{method:"PUT",body:JSON.stringify(r)});return u(),n},delete:async t=>{await e.request("/jobs/".concat(t),{method:"DELETE"}),u()},analyze:t=>e.request("/jobs/analyze",{method:"POST",body:JSON.stringify(t)}),importFromUrl:t=>e.request("/jobs/import-url",{method:"POST",body:JSON.stringify({url:t})}),reparse:async(t,r)=>{let n=await e.request("/jobs/".concat(t,"/reparse"),{...r,method:"POST"});return u(),n}},jobsMonitor:{list:t=>{let r=new URLSearchParams;(null==t?void 0:t.status)&&r.set("status",t.status),(null==t?void 0:t.type)&&r.set("type",t.type),(null==t?void 0:t.page)&&r.set("page",t.page.toString()),(null==t?void 0:t.limit)&&r.set("limit",t.limit.toString());let n=r.toString();return e.request("/background-jobs/stats".concat(n?"?".concat(n):""))},get:t=>e.request("/background-jobs/".concat(t)),cancel:t=>e.request("/background-jobs/".concat(t),{method:"DELETE"}),retry:t=>e.request("/background-jobs/".concat(t,"/retry"),{method:"POST"})}}}(this);this.jobs=m.jobs,this.jobs_monitor=m.jobsMonitor,this.apiKeys=function(e){return{list:()=>e.request("/api-keys"),create:t=>e.request("/api-keys",{method:"POST",body:JSON.stringify(t)}),update:(t,r)=>e.request("/api-keys/".concat(t),{method:"PATCH",body:JSON.stringify(r)}),delete:t=>e.request("/api-keys/".concat(t),{method:"DELETE"}),getUsage:t=>e.request("/api-keys/".concat(t,"/usage"))}}(this),this.webhooks=function(e){return{list:()=>e.request("/webhooks"),create:t=>e.request("/webhooks",{method:"POST",body:JSON.stringify(t)}),update:(t,r)=>e.request("/webhooks/".concat(t),{method:"PUT",body:JSON.stringify(r)}),delete:t=>e.request("/webhooks/".concat(t),{method:"DELETE"}),test:t=>e.request("/webhooks/".concat(t,"/test"),{method:"POST"}),getDeliveries:t=>e.request("/webhooks/".concat(t,"/deliveries")),retryDelivery:(t,r)=>e.request("/webhooks/".concat(t,"/deliveries/").concat(r,"/retry"),{method:"POST"})}}(this),this.files=function(e){return{upload:(t,r)=>{let n=new FormData;return n.append("file",t),n.append("type",r),e.request("/files/upload",{method:"POST",body:n})},delete:t=>e.request("/files/".concat(t),{method:"DELETE"})}}(this),this.feedback=function(e){return{create:t=>e.request("/feedback",{method:"POST",body:JSON.stringify(t)}),verifyEmail:t=>e.request("/feedback/verify-email",{method:"POST",body:JSON.stringify({token:t})})}}(this),this.health=(t=this,{check:()=>t.request("/health")}),this.billing=function(e){return{getInfo:()=>e.request("/billing/info"),getPlans:()=>e.request("/billing/plans"),createSetupIntent:()=>e.request("/billing/payment-method/setup-intent",{method:"POST"}),setDefaultPaymentMethod:t=>e.request("/billing/payment-method/set-default",{method:"POST",body:JSON.stringify({paymentMethodId:t})}),createCheckoutSession:(t,r)=>e.request("/billing/checkout-session",{method:"POST",body:JSON.stringify({plan:t,...r})}),verifyCheckoutConversion:t=>e.request("/billing/checkout-session/verify-conversion",{method:"POST",body:JSON.stringify({sessionId:t})}),subscribe:(t,r)=>e.request("/billing/subscription",{method:"POST",body:JSON.stringify({plan:t,...r})}),cancelAtPeriodEnd:()=>e.request("/billing/subscription/cancel",{method:"POST"}),createPortalSession:()=>e.request("/billing/portal-session",{method:"POST"}),startTrial:()=>e.request("/billing/trial",{method:"POST"}),getTrialStatus:()=>e.request("/billing/trial/status"),getInvoices:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:20;return e.request("/billing/invoices?limit=".concat(t))},retryPayment:()=>e.request("/billing/retry-payment",{method:"POST"}),getUsage:()=>e.request("/billing/usage"),getCreditBalance:()=>e.request("/billing/credits"),getCreditHistory:()=>e.request("/billing/credits/history"),validateCoupon:(t,r)=>e.request("/billing/coupon/validate",{method:"POST",body:JSON.stringify({code:t,plan:r})}),updateBusinessInfo:t=>e.request("/billing/business-info",{method:"POST",body:JSON.stringify(t)})}}(this),this.templates=(0,y.s)(this),this.profiles=function(e){return{get:async()=>p(await e.request("/profile")),update:t=>e.request("/profile",{method:"PUT",body:JSON.stringify(h(t))}).then(p),importFromResume:t=>{let r=new FormData;return t.file&&r.append("file",t.file),t.text&&r.append("text",t.text),r.append("consentToAiProcessing",t.consentToAiProcessing?"true":"false"),t.acknowledgePii&&r.append("acknowledgePii","true"),t.source&&r.append("source",t.source),e.requestForm("/profile/import",r,{idempotencyKey:t.idempotencyKey}).then(e=>({...e,draft:p(e.draft)}))},getImportOperation:t=>e.request("/profile/import/operations/".concat(encodeURIComponent(t))).then(d),getImportOperationByKey:t=>e.request("/profile/import/operations/by-key?key=".concat(encodeURIComponent(t))).then(d),mergeImport:(t,r,n,i)=>e.request("/profile/import/merge",{method:"POST",body:JSON.stringify({draft:h(t),...r?{tag:r}:{},...n?{overrides:h(n)}:{},...i?{profileUpdatedAt:i.profileUpdatedAt,...i.replacements?{replacements:i.replacements}:{}}:{}})}).then(e=>({...e,profile:p(e.profile)})),clearData:t=>e.request("/profile/data",{method:"DELETE",body:JSON.stringify({confirm:!0,profileUpdatedAt:t})}).then(e=>({...e,profile:p(e.profile)})),mergeDescriptions:t=>e.request("/profile/merge-descriptions",{method:"POST",body:JSON.stringify({descriptions:t})}),getTags:()=>e.request("/profile/tags"),renameTag:(t,r,n)=>e.request("/profile/tags/rename",{method:"POST",body:JSON.stringify({oldTag:t,newTag:r,profileUpdatedAt:n})}),deleteTag:(t,r)=>e.request("/profile/tags/".concat(encodeURIComponent(t)).concat(r?"?profileUpdatedAt=".concat(encodeURIComponent(r)):""),{method:"DELETE"}),listPresets:()=>e.request("/profile/presets"),getPreset:t=>e.request("/profile/presets/".concat(t)),createPreset:t=>e.request("/profile/presets",{method:"POST",body:JSON.stringify(t)}),updatePreset:(t,r)=>e.request("/profile/presets/".concat(t),{method:"PUT",body:JSON.stringify(r)}),deletePreset:t=>e.request("/profile/presets/".concat(t),{method:"DELETE"})}}(this),this.stats=function(e){return{getDashboardStats:()=>e.request("/stats/dashboard"),getCounts:()=>e.request("/stats/counts")}}(this),this.admin=function(e){return{getStats:()=>e.request("/admin/stats"),getUsers:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.page&&r.set("page",String(t.page)),t.limit&&r.set("limit",String(t.limit)),t.search&&r.set("search",t.search),t.role&&r.set("role",t.role);let n=r.toString();return e.request("/admin/users".concat(n?"?".concat(n):""))}
1,getUserDetail:t=>e.request("/admin/users/".concat(t)),setUserMcpBetaAccess:(t,r,n)=>e.request("/admin/users/".concat(t,"/mcp-beta-access"),{method:"PUT",body:JSON.stringify({enabled:r,reason:n})}),updateUserRole:(t,r)=>e.request("/admin/users/".concat(t,"/role"),{method:"PUT",body:JSON.stringify({role:r})}),deleteUser:t=>e.request("/admin/users/".concat(t),{method:"DELETE"}),getUserUsage:t=>e.request("/admin/users/".concat(t,"/usage")),setUsageValue:(t,r,n,i)=>e.request("/admin/users/".concat(t,"/usage/").concat(r,"/value"),{method:"PUT",body:JSON.stringify({value:n,reason:i})}),setUsageLimit:(t,r,n,i)=>e.request("/admin/users/".concat(t,"/usage/").concat(r,"/limit"),{method:"PUT",body:JSON.stringify({limitOverride:n,reason:i})}),getTemplates:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.page&&r.set("page",String(t.page)),t.limit&&r.set("limit",String(t.limit)),t.search&&r.set("search",t.search),void 0!==t.isSystem&&r.set("isSystem",String(t.isSystem)),void 0!==t.isPublic&&r.set("isPublic",String(t.isPublic)),t.ownerType&&r.set("ownerType",t.ownerType);let n=r.toString();return e.request("/admin/templates".concat(n?"?".concat(n):""))},updateTemplateSystemStatus:(t,r)=>e.request("/admin/templates/".concat(t,"/system-status"),{method:"PUT",body:JSON.stringify({isSystem:r})}),updateTemplatePublicStatus:(t,r)=>e.request("/admin/templates/".concat(t,"/public-status"),{method:"PUT",body:JSON.stringify({isPublic:r})}),deleteTemplate:t=>e.request("/admin/templates/".concat(t),{method:"DELETE"}),getTemplatePacks:()=>e.request("/admin/templates/packs"),createTemplatePack:t=>e.request("/admin/templates/packs",{method:"POST",body:JSON.stringify(t)}),updateTemplatePack:(t,r)=>e.request("/admin/templates/packs/".concat(t),{method:"PUT",body:JSON.stringify(r)}),deleteTemplatePack:t=>e.request("/admin/templates/packs/".concat(t),{method:"DELETE"}),addTemplateToPack:(t,r)=>e.request("/admin/templates/packs/".concat(t,"/templates/").concat(r),{method:"POST"}),removeTemplateFromPack:(t,r)=>e.request("/admin/templates/packs/".concat(t,"/templates/").concat(r),{method:"DELETE"}),getGrowthOverview:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=t.days?"?days=".concat(encodeURIComponent(String(t.days))):"";return e.request("/admin/growth/overview".concat(r))},getBillingOverview:()=>e.request("/admin/billing/overview"),getBillingStats:()=>e.request("/admin/billing/stats"),getBillingAnalytics:()=>e.request("/admin/billing/analytics"),searchBillingCustomers:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.query&&r.set("q",t.query),t.limit&&r.set("limit",String(t.limit));let n=r.toString();return e.request("/admin/billing/customers".concat(n?"?".concat(n):""))},getBillingCustomerDetail:t=>e.request("/admin/billing/customers/".concat(t)),retryBillingPayment:t=>e.request("/admin/billing/customers/".concat(t,"/retry-payment"),{method:"POST"}),resyncBillingCustomer:t=>e.request("/admin/billing/customers/".concat(t,"/resync"),{method:"POST"}),overridePlan:(t,r,n)=>e.request("/admin/billing/override-plan",{method:"POST",body:JSON.stringify({targetUserId:t,plan:r,reason:n})}),setGracePeriod:(t,r,n)=>e.request("/admin/billing/grace-period",{method:"POST",body:JSON.stringify({targetUserId:t,days:r,reason:n})}),issueRefund:(t,r,n,i)=>e.request("/admin/billing/refund",{method:"POST",body:JSON.stringify({targetUserId:t,amount:r,reason:n,operationKey:i})}),getAuditLog:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.page&&r.set("page",String(t.page)),t.limit&&r.set("limit",String(t.limit));let n=r.toString();return e.request("/admin/billing/audit-log".concat(n?"?".concat(n):""))},expireTrials:()=>e.request("/admin/billing/expire-trials",{method:"POST"}),getCoupons:()=>e.request("/admin/billing/coupons"),createCoupon:t=>e.request("/admin/billing/coupons",{method:"POST",body:JSON.stringify(t)}),updateCoupon:(t,r)=>e.request("/admin/billing/coupons/".concat(t),{method:"PATCH",body:JSON.stringify(r)}),deleteCoupon:t=>e.request("/admin/billing/coupons/".concat(t),{method:"DELETE"}),approveCoupon:t=>e.request("/admin/billing/coupons/".concat(t,"/approve"),{method:"PATCH"}),revokeCoupon:t=>e.request("/admin/billing/coupons/".concat(t,"/revoke"),{method:"PATCH"}),getAdsPerformance:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.days&&r.set("days",String(t.days));let n=r.toString();return e.request("/admin/ads/performance".concat(n?"?".concat(n):""))},getApiUsage:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.days&&r.set("days",String(t.days)),t.limit&&r.set("limit",String(t.limit)),t.userId&&r.set("userId",t.userId);let n=r.toString();return e.request("/admin/api-usage".concat(n?"?".concat(n):""))},getLlmUsage:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.days&&r.set("days",String(t.days)),t.limit&&r.set("limit",String(t.limit)),t.userId&&r.set("userId",t.userId);let n=r.toString();
1return e.request("/admin/llm-usage".concat(n?"?".concat(n):""))},getModerationQueue:()=>e.request("/admin/moderation/queue"),getModerationStats:()=>e.request("/admin/moderation/stats"),takeAction:(t,r,n)=>e.request("/admin/moderation/".concat(t,"/").concat(r,"/action"),{method:"POST",body:JSON.stringify(n)}),getStripeEvents:t=>{let r=new URLSearchParams;(null==t?void 0:t.status)&&r.set("status",t.status),(null==t?void 0:t.eventType)&&r.set("eventType",t.eventType),(null==t?void 0:t.page)&&r.set("page",String(t.page)),(null==t?void 0:t.limit)&&r.set("limit",String(t.limit));let n=r.toString();return e.request("/admin/webhooks/stripe-events".concat(n?"?".concat(n):""))},getStripeEventStats:()=>e.request("/admin/webhooks/stripe-events/stats"),replayStripeEvent:t=>e.request("/admin/webhooks/stripe-events/".concat(t,"/replay"),{method:"POST"}),getWebhookDeliveries:t=>{let r=new URLSearchParams;(null==t?void 0:t.status)&&r.set("status",t.status),(null==t?void 0:t.page)&&r.set("page",String(t.page)),(null==t?void 0:t.limit)&&r.set("limit",String(t.limit));let n=r.toString();return e.request("/admin/webhooks/deliveries".concat(n?"?".concat(n):""))},getInvitations:t=>{let r=new URLSearchParams;(null==t?void 0:t.status)&&r.set("status",t.status),(null==t?void 0:t.limit)&&r.set("limit",String(t.limit)),(null==t?void 0:t.offset)&&r.set("offset",String(t.offset));let n=r.toString();return e.request("/admin/invitations".concat(n?"?".concat(n):""))},createInvitation:(t,r,n)=>e.request("/admin/invitations",{method:"POST",body:JSON.stringify({emailAddress:t,...r&&{redirectUrl:r},...n&&{couponCode:n}})}),revokeInvitation:t=>e.request("/admin/invitations/".concat(t,"/revoke"),{method:"POST"}),resendInvitation:t=>e.request("/admin/invitations/".concat(t,"/resend"),{method:"POST"}),getFeedback:function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=new URLSearchParams;t.page&&r.set("page",String(t.page)),t.limit&&r.set("limit",String(t.limit)),t.status&&r.set("status",t.status),t.type&&r.set("type",t.type),t.search&&r.set("search",t.search);let n=r.toString();return e.request("/admin/feedback".concat(n?"?".concat(n):""))},getFeedbackStats:()=>e.request("/admin/feedback/stats"),updateFeedback:(t,r)=>e.request("/admin/feedback/".concat(t),{method:"PATCH",body:JSON.stringify(r)})}}(this),this.documentQuality=function(e){return{review:(t,r)=>e.request("/application-assist/resumes/".concat(encodeURIComponent(t),"/review"),r),generateAnswer:(t,r)=>e.request("/application-assist/answer",{method:"POST",body:JSON.stringify({jobId:t,question:r})})}}(this),this.applicationAssist=function(e){return{updateWorkspaceState:(t,r)=>e.request("/application-assist/jobs/".concat(encodeURIComponent(t),"/workspace/state"),{method:"PUT",body:JSON.stringify(r)}),undoCoverLetterReplacement:(t,r)=>e.request("/application-assist/cover-letters/".concat(encodeURIComponent(t),"/undo-replacement"),{method:"POST",body:JSON.stringify({token:r})}),workspace:t=>e.request("/application-assist/jobs/"+encodeURIComponent(t)+"/workspace"),startMaterialGeneration:(t,r)=>{let{idempotencyKey:n,...i}=r;return e.request("/application-assist/jobs/"+encodeURIComponent(t)+"/material-generation",{method:"POST",headers:{"Idempotency-Key":n},body:JSON.stringify(i)})},coverLetterGenerations:{get:t=>e.request("/application-assist/cover-letter-generation-jobs/"+encodeURIComponent(t),{cache:"no-store"}),retry:t=>e.request("/application-assist/cover-letter-generation-jobs/"+encodeURIComponent(t)+"/retry",{method:"POST"})},generateCoverLetter:t=>e.request("/application-assist/cover-letter",{method:"POST",body:JSON.stringify(t)}),coverLetters:{list:async t=>{let r=function(e){var t;let r={jobId:null==e?void 0:e.jobId,search:(null==e||null==(t=e.search)?void 0:t.trim())||void 0,page:null==e?void 0:e.page,limit:null==e?void 0:e.limit},n=new URLSearchParams;return r.jobId&&n.set("jobId",r.jobId),r.search&&n.set("search",r.search),r.page&&n.set("page",String(r.page)),r.limit&&n.set("limit",String(r.limit)),n.toString()}(t);return e.request("/application-assist/cover-letters".concat(r?"?".concat(r):""))},generateAndSave:(t,r)=>e.request("/application-assist/cover-letters",{method:"POST",headers:(null==r?void 0:r.idempotencyKey)?{"Idempotency-Key":r.idempotencyKey}:void 0,body:JSON.stringify(t)}),get:t=>e.request("/application-assist/cover-letters/".concat(t)),update:(t,r)=>e.request("/application-assist/cover-letters/".concat(t),{method:"PATCH",body:JSON.stringify(r)}),downloadPdf:async(t,r)=>{let n=function(e){let t=new URLSearchParams;return(null==e?void 0:e.pageSize)&&t.set("pageSize",e.pageSize),(null==e?void 0:e.font)&&t.set("font",e.font),(null==e?void 0:e.fontSize)&&t.set("fontSize",e.fontSize),(null==e?void 0:e.spacing)&&t.set("spacing",e.spacing),(null==e?void 0:e.margins)&&t.set("margins",e.margins),(null==e?void 0:e.alignment)&&t.set("alignment",e.alignment),t.toString()}(r),i=await e.fetchWithAuth("/api/application-assist/cover-letters/".concat(t,"/export/pdf").concat(n?"?".concat(n):""));if(!i.ok)throw Error("Failed to download PDF (".concat(i.status,")"));return i.blob()},delete:t=>e.request("/application-assist/cover-letters/".concat(t),{method:"DELETE"})}}}(this),this.mcp=function(e){return{listConnections:()=>e.request("/mcp/connections"),revokeConnection:t=>e.request("/mcp/connections/".concat(encodeURIComponent(t)),{method:"DELETE"}),getAutomationPolicy:()=>e.request("/mcp/automation-policy"),updateAutomationPolicy:t=>e.request("/mcp/automation-policy",{method:"PUT",body:JSON.stringify(t)}),confirmIdentity:t=>e.request("/mcp/identity/confirm",{method:"POST",body:JSON.stringify({challenge:t})}),previewIdentity:t=>e.request("/mcp/identity/preview",{method:"POST",body:JSON.stringify({challenge:t})}),previewCliActivation:t=>e.request("/mcp/cli-activations/preview",{method:"POST",body:JSON.stringify({userCode:t})}),authorizeCliActivation:t=>e.request("/mcp/cli-activations/authorize",{method:"POST",body:JSON.stringify({userCode:t,confirmed:!0})})}}(this),this.operations=function(e){return{list:(t,r)=>{let n=new URLSearchParams;t&&n.set("cursor",t);let i=n.toString();return e.request("/operations".concat(i?"?".concat(i):""),{signal:null==r?void 0:r.signal})},retryExport:(t,r)=>e.request("/operations/export/".concat(encodeURIComponent(t),"/retry"),{method:"POST",headers:{"Idempotency-Key":r}}),cancelExport:t=>e.request("/operations/export/".concat(encodeURIComponent(t),"/cancel"),{method:"POST"}),retryCreation:t=>e.request("/operations/creation/".concat(encodeURIComponent(t),"/retry"),{method:"POST"}),cancelCreation:t=>e.request("/operations/creation/".concat(encodeURIComponent(t),"/cancel"),{method:"POST"})}}(this)}}let S=new b;
1function v(e,t){if(e instanceof n.hD){if(401===e.status&&void 0===e.response&&"Authentication required. Please sign in."===e.message)return e;if(t)if(n.hD.isUsageLimit(e)){let r=n.hD.getUsageLimitInfo(e);t(e.message,{type:"warning",title:(null==r?void 0:r.metric)==="RESUME_CREATE"?"Resume limit reached":"Plan limit reached",duration:8e3})}else n.hD.isRateLimit(e)?t(e.message,{type:"warning",title:"Rate Limit Exceeded",duration:7e3}):e.status>=500?t(e.message,{type:"error",title:"Server Error",duration:6e3}):401===e.status?t(e.message,{type:"warning",title:"Authentication Required"}):403===e.status?t(e.message,{type:"error",title:"Permission Denied"}):404===e.status?t(e.message,{type:"error",title:"Not Found"}):t(e.message,{type:"error",title:"Request Failed"});return e}let r=new n.hD("An unexpected error occurred",0,void 0,!0);return t&&t(r.message,{type:"error",title:"Unexpected Error"}),r}function w(e,t){if(e instanceof n.hD){let t=e.response&&"object"==typeof e.response?e.response:void 0;if("string"==typeof(null==t?void 0:t.message)&&t.message.trim())return t.message;if(e.message.trim())return e.message}if(e instanceof Error&&e.message.trim())return e.message;let r=e&&"object"==typeof e?e:void 0;return"string"==typeof(null==r?void 0:r.message)&&r.message.trim()?r.message:t}},35133:(e,t,r)=>{r.d(t,{Y:()=>i,s:()=>a});var n=r(74773);class i extends n.hD{constructor(e,t){var r;super(e,409,t,!1),this.name="TemplateStaleError";let n=t&&"object"==typeof t?t:null,i=null!=(r=null==n?void 0:n.currentUpdatedAt)?r:null==n?void 0:n.updatedAt;this.currentUpdatedAt="string"==typeof i?i:void 0}}function s(e){let t=e.sections;return{...e,isActive:!0,templateSchema:t}}function a(e){return{list:async t=>{let r=new URLSearchParams;(null==t?void 0:t.includePublic)!==void 0&&r.append("includePublic",t.includePublic.toString()),(null==t?void 0:t.includeStructure)&&r.append("includeStructure","true"),(null==t?void 0:t.page)&&r.append("page",t.page.toString()),(null==t?void 0:t.limit)&&r.append("limit",t.limit.toString()),(null==t?void 0:t.search)&&r.append("search",t.search);let n=r.toString(),i=await e.request("/templates".concat(n?"?".concat(n):""));return{data:i.data.map(s),pagination:i.pagination}},listPacks:()=>e.request("/templates/packs"),get:async t=>s(await e.request("/templates/".concat(t))),create:async t=>s(await e.request("/templates",{method:"POST",body:JSON.stringify(t)})),update:async(t,r)=>{let{expectedUpdatedAt:a,...o}=r,c=a instanceof Date?a.toISOString():a;try{let r=await e.request("/templates/".concat(t),{method:"PUT",body:JSON.stringify({...o,updatedAt:c})});return s(r)}catch(e){if(e instanceof n.hD&&409===e.status){let t=e.response&&"object"==typeof e.response?e.response.code:void 0;if(void 0===t||"TEMPLATE_UPDATED_AT_MISMATCH"===t)throw new i(e.message,e.response)}throw e}},delete:t=>e.request("/templates/".concat(t),{method:"DELETE"}),clone:async(t,r)=>s(await e.request("/templates/".concat(t,"/clone"),{method:"POST",body:JSON.stringify(r)})),instantiate:async(t,r)=>{let n=await e.request("/templates/".concat(t,"/instantiate"),{method:"POST",body:JSON.stringify(r)});return{template:s(n.template),created:n.created}},customize:(t,r)=>e.request("/templates/".concat(t,"/customize"),{method:"POST",body:JSON.stringify(r)}),generateContentSuggestions:(t,r)=>e.request("/templates/content-suggestions",{method:"POST",body:JSON.stringify({resumeData:t,sectionType:r})}),optimizeForATS:t=>e.request("/templates/".concat(t,"/ats-optimization")),generatePreview:t=>e.request("/templates/".concat(t,"/preview")),generateContent:(t,r)=>e.request("/templates/".concat(t,"/generate-content"),{method:"POST",body:JSON.stringify(r)})}}},74773:(e,t,r)=>{r.d(t,{dg:()=>v,hD:()=>l});var n=r(16902),i=r(79105);function s(e){if(!Number.isInteger(e)||e<0||e>3)throw RangeError("Invalid retryCount ".concat(e,". Expected an integer between 0 and ").concat(3,"."))}function a(e){if(s(e.retryCount),!Number.isFinite(e.startedAtMs)||e.startedAtMs<=0)throw RangeError("Invalid retry start time ".concat(e.startedAtMs,". Expected a positive timestamp."))}function o(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return"number"==typeof e?(s(e),{retryCount:e,startedAtMs:Date.now()}):(a(e),e)}async function c(e,t){if(null==t?void 0:t.aborted)throw b(t);await new Promise((r,n)=>{let i=setTimeout(function(){a(),r()},e),s=()=>{clearTimeout(i),a(),n(t?b(t):new u)},a=()=>null==t?void 0:t.removeEventListener("abort",s);null==t||t.addEventListener("abort",s,{once:!0})})}r(77011),(0,n.j)("NEXT_PUBLIC_API_URL");
1class l extends Error{static isRateLimit(e){return 429===e.status}static isTemporary(e){let t=e.response&&"object"==typeof e.response?e.response.scope:void 0;return(429!==e.status||"burst"!==t)&&(e.isRetryable||e.status>=500||503===e.status||429===e.status)}static getUsageLimitInfo(e){let t=e.response&&"object"==typeof e.response?e.response:null;if(!t)return null;let r="string"==typeof t.errorCode?t.errorCode:void 0,n="string"==typeof t.error?t.error:void 0;return"USAGE_LIMIT_EXCEEDED"!==r&&"USAGE_LIMIT_EXCEEDED"!==n?null:{metric:"string"==typeof t.metric?t.metric:void 0,currentUsage:"number"==typeof t.currentUsage?t.currentUsage:void 0,limit:"number"==typeof t.limit?t.limit:void 0,currentPlan:"string"==typeof t.currentPlan?t.currentPlan:void 0,upgradeUrl:"string"==typeof t.upgradeUrl?t.upgradeUrl:void 0}}static isUsageLimit(e,t){let r=l.getUsageLimitInfo(e);return!!r&&(!t||r.metric===t)}constructor(e,t,r,n=!1,i,s){super(e),this.status=t,this.response=r,this.isRetryable=n,this.code=s,this.name="ApiError",i&&i.length>0&&(this.details=i)}}class u extends l{constructor(){super("Request cancelled.",0,void 0,!1,void 0,"REQUEST_ABORTED"),this.name="ApiAbortError"}}class d extends l{constructor(e){super("Request timed out. Please try again.",408,{timeoutMs:e},!0,void 0,"REQUEST_TIMEOUT"),this.name="ApiTimeoutError"}}class m extends l{constructor(e){super("Response was too large to process safely.",413,{maxResponseBytes:e},!1,void 0,"RESPONSE_TOO_LARGE"),this.name="ApiResponseTooLargeError"}}class p extends l{constructor(e,t){super("We could not confirm whether this change completed. Check the result before trying again.",0,{endpoint:e,cause:t?{code:t.code,status:t.status,message:t.message}:void 0},!1,void 0,"UNCERTAIN_WRITE"),this.name="ApiUncertainWriteError",this.cause=t}}function h(e,t){var r;let n=new AbortController,i=null!=(r=null==e?void 0:e.aborted)&&r,s=!1,a=()=>{i=!0,n.abort(new u)},o=setTimeout(()=>{s=!0,n.abort(new d(t))},t);return(null==e?void 0:e.aborted)?a():null==e||e.addEventListener("abort",a,{once:!0}),{signal:n.signal,abort:e=>n.abort(e),callerAborted:()=>i,timedOut:()=>s,cleanup:()=>{clearTimeout(o),null==e||e.removeEventListener("abort",a)}}}function g(e,t,r){let n=null!=e?e:t;if(!Number.isFinite(n)||n<=0)throw RangeError("".concat(r," must be a positive finite number."));return n}async function f(e,t,r){if(!e.body)return"";let n=e.body.getReader(),i=new TextDecoder,s=0,a="";try{for(;;){let{done:e,value:o}=await y(n,r);if(e)return a+=i.decode();if((s+=o.byteLength)>t)throw new m(t);a+=i.decode(o,{stream:!0})}}finally{n.cancel().catch(()=>void 0);try{n.releaseLock()}catch(e){}}}async function y(e,t){if(!t)return e.read();if(t.aborted)throw b(t);return new Promise((r,n)=>{let i=()=>{s(),e.cancel().catch(()=>void 0),n(b(t))},s=()=>t.removeEventListener("abort",i);t.addEventListener("abort",i,{once:!0}),e.read().then(e=>{s(),r(e)},e=>{s(),n(e)})})}function b(e){var t;return null!=(t=e.reason)?t:new DOMException("Request aborted","AbortError")}function S(e,t){return t.signal.aborted?Promise.reject(b(t.signal)):new Promise((r,n)=>{let i=()=>{s(),n(b(t.signal))},s=()=>t.signal.removeEventListener("abort",i);t.signal.addEventListener("abort",i,{once:!0}),e.then(e=>{s(),r(e)},e=>{s(),n(e)})})}class v{resolveBaseUrl(e){return e.startsWith("/")?e:"/api"}buildUrl(e){return"".concat(this.baseUrl).concat(e)}setTokenGetter(e){this.tokenGetter=e}setAuthState(e){this.authState=e}getAuthScopeKey(){var e,t;return(null==(e=this.authState)?void 0:e.userId)?this.authState.userId:(null==(t=this.authState)?void 0:t.isSignedIn)?"__signed_in__":"__anonymous__"}async attachAuthHeader(e){let{logDetails:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.tokenGetter)return t&&i.v.warn("[API] No getToken function available"),!1;try{let r=await this.tokenGetter();if(!r)return t&&i.v.warn("[API] No token available from getToken()"),!1;let n=r.split(".");if(3!==n.length)return t&&i.v.error("[API] â Invalid JWT format - token has",n.length,"parts instead of 3"),!1;return e.Authorization="Bearer ".concat(r),t&&i.v.debug("[API] Added valid JWT token to request"),!0}catch(e){return t&&i.v.error("Failed to get auth token",e),!1}}isPublicEndpoint(e){return e.startsWith("/health")||"/billing/plans"===e||"/feedback"===e||"/feedback/verify-email"===e}requiresAuth(e){return!this.isPublicEndpoint(e)}async waitForAuthReady(){if(!this.authState||this.authState.isLoaded)return;let e=Date.now();for(;!this.authState.isLoaded&&Date.now()-e<this.authWaitMs;)await new Promise(e=>setTimeout(e,50))}redactAuthHeader(e){let t={...e};return t.Authorization&&(t.Authorization="<redacted>"),t.authorization&&(t.authorization="<redacted>"),t}
1async parseSuccessfulResponse(e,t,r,n,i){if(204===e.status)return null;let s=e.headers.get("content-type");if(null==s?void 0:s.includes("application/json")){let s=await f(e,n,i);try{return JSON.parse(s)}catch(n){throw new l("Unexpected JSON response from API",e.status,{endpoint:t,url:r,body:s.slice(0,500)})}}if(s&&!s.includes("application/json")){let a=await f(e,n,i);throw new l("Unexpected non-JSON response from API",e.status,{endpoint:t,url:r,contentType:s,body:a.slice(0,500)})}let a=await f(e,n,i);if(!a.trim())return null;try{return JSON.parse(a)}catch(n){throw new l("Unexpected non-JSON response from API",e.status,{endpoint:t,url:r,contentType:null!=s?s:null,body:a.slice(0,500)})}}resolveRequestFormUrl(e){return"".concat(this.baseUrl).concat(e)}async handleNonOkResponse(e,t,r,n,o,u){var d;let m={};try{let t=await f(e,o,u);m=t?JSON.parse(t):{}}catch(e){if(e instanceof l)throw e}let p="object"==typeof m&&null!==m?{...m}:{},h=function(e){let t=e.headers.get("retry-after");if(!t)return;let r=Number.parseInt(t,10);if(Number.isFinite(r)&&r>0)return r;let n=Date.parse(t);if(Number.isNaN(n))return;let i=n-Date.now();return i>0?Math.ceil(i/1e3):0}(e);void 0!==h&&(p.retryAfterSeconds=h);let g=null==p?void 0:p.message,y=Array.isArray(g)?g.filter(e=>"string"==typeof e):void 0,b=("string"==typeof g?g:y&&y.length>0?y.join(", "):"").replace(/^Internal server error:\s*/i,"").trim(),S=b.includes("Circuit breaker")||b.includes("temporarily unavailable")||b.includes("high demand"),v=w((r.method||"GET").toUpperCase()),q=!!p&&"object"==typeof p&&("USAGE_LIMIT_EXCEEDED"===p.errorCode||"USAGE_LIMIT_EXCEEDED"===p.error),T=429===e.status&&"string"==typeof p.scope&&"burst"===p.scope,P=q||T||v?null:function(e){var t;let{status:r,isCircuitBreakerOpen:n,retryState:i,retryAfterSeconds:o,nowMs:c=Date.now()}=e;if(a(i),!(429===r||503===r&&!n)||i.retryCount>=3)return null;let l=void 0!==o&&o>0?Math.min(1e3*Math.ceil(o),31e3):void 0,u=null!=l?l:(s(t=i.retryCount),Math.round(Math.min(1e3*2**t,31e3)*(.5+.5*Math.random())));return c-i.startedAtMs+u>1e4?null:{delayMs:u,nextState:{retryCount:i.retryCount+1,startedAtMs:i.startedAtMs},showToast:0===i.retryCount}}({status:e.status,isCircuitBreakerOpen:S,retryState:n,retryAfterSeconds:h});if(P){let n=503===e.status?"Service unavailable":"Rate limited";if(i.v.warn("[API] ".concat(n,", retrying in ").concat(P.delayMs,"ms (attempt ").concat(P.nextState.retryCount,"/").concat(3,")")),P.showToast){let t=window.__globalAddToast;t&&t(503===e.status?"Service unavailable, retrying automatically...":"Too many requests, retrying automatically...",{type:"info",title:"Retrying Request",duration:3e3})}return await c(P.delayMs,null!=(d=r.signal)?d:void 0),this.request(t,r,P.nextState)}let O=b||"HTTP ".concat(e.status),E=!1;throw q?(O=function(e){var t;let r="string"==typeof e.metric?e.metric:void 0,n=(t="string"==typeof e.currentPlan?e.currentPlan:void 0)?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():"current";return"RESUME_CREATE"===r?"You've reached this month's resume limit for the ".concat(n," plan. Upgrade in Settings to keep generating resumes."):"You've reached this month's ".concat(function(e){switch(e){case"RESUME_CREATE":return"resume";case"RESUME_EXPORT":return"resume export";case"JOB_MATCH":return"job match";case"AI_GENERATION":return"AI generation";default:return"usage"}}(r)," limit for the ").concat(n," plan. Upgrade in Settings to continue.")}(p),E=!1):503===e.status?(O=b.length>0?b:"Service temporarily unavailable. Please try again in a moment.",E=!v):429===e.status?(O=T?h&&h>0?"Too many requests. Retry in about ".concat(h," seconds."):"Too many requests. Please wait a moment before trying again.":b.length>0?b:h&&h>0?"Too many requests. Retry in about ".concat(h," seconds."):"Too many requests. Please wait a moment before trying again.",E=!T&&!v):e.status>=500?(O="Server error. Please try again later.",E=!0):401===e.status?O="Authentication required. Please sign in.":403===e.status?O="You do not have permission to perform this action.":404===e.status&&(O="The requested resource was not found."),new l(O,e.status,p,E,y)}async request(e){let t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,i=o(n),s=this.buildUrl(e),{timeoutMs:a,maxResponseBytes:c,signal:f,...y}=r,b=g(a,3e4,"timeoutMs"),v=g(c,5242880,"maxResponseBytes"),q=h(f,b),T={...y.headers},P="undefined"!=typeof FormData&&y.body instanceof FormData,O="Content-Type"in T||"content-type"in T;P||O||(T["Content-Type"]="application/json");let E=(y.method||"GET").toUpperCase();this.requiresAuth(e)&&await this.waitForAuthReady();try{t=await S(this.attachAuthHeader(T,{logDetails:!0}),q)}catch(e){if(q.cleanup(),e instanceof l)throw e;throw new l("Unable to prepare the authenticated request.",0)}if(q.callerAborted())throw q.cleanup(),new u;if(q.timedOut())throw q.cleanup(),new d(b);if(this.requiresAuth(e)&&!t)throw q.cleanup(),new l("Authentication required. Please sign in.",401,void 0,!1);let A={...y,headers:T,credentials:"include",signal:q.signal},U=!1;try{let t=fetch(s,A);U=!0;let r=await S(t,q);if(!r.ok)return await this.handleNonOkResponse(r,e,A,i,v,q.signal);return await this.parseSuccessfulResponse(r,e,s,v,q.signal)}catch(t){if(q.callerAborted()){let t=new u;if(w(E)&&U)throw new p(e,t);throw t}if(q.timedOut()){let t=new d(b);if(w(E)&&U)throw new p(e,t);throw t}if(t instanceof l){if(w(E)&&U&&(t instanceof u||t instanceof d||t instanceof m))throw new p(e,t);throw t}if(w(E))throw new p(e,new l("Network error. Please check your connection and try again.",0,void 0,!0));throw new l("Network error. Please check your connection and try again.",0,void 0,!0)}finally{q.cleanup()}}async requestForm(e,t){let r,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=this.resolveRequestFormUrl(e),s=n.idempotencyKey?{"Idempotency-Key":n.idempotencyKey}:{},a=g(n.timeoutMs,3e4,"timeoutMs"),c=g(n.maxResponseBytes,5242880,"maxResponseBytes"),f=h(n.signal,a);this.requiresAuth(e)&&await this.waitForAuthReady();try{r=await S(this.attachAuthHeader(s,{logDetails:!1}),f)}catch(e){if(f.cleanup(),e instanceof l)throw e;throw new l("Unable to prepare the authenticated request.",0)}if(f.callerAborted())throw f.cleanup(),new u;if(f.timedOut())throw f.cleanup(),new d(a);if(this.requiresAuth(e)&&!r)throw f.cleanup(),new l("Authentication required. Please sign in.",401,void 0,!1);let y={method:"POST",body:t,headers:s,credentials:"include",signal:f.
1signal},b=!1;try{let t=fetch(i,y);b=!0;let r=await S(t,f);if(!r.ok)return await this.handleNonOkResponse(r,e,y,o(0),c,f.signal);return await this.parseSuccessfulResponse(r,e,i,c,f.signal)}catch(t){if(f.callerAborted())throw new p(e,new u);if(f.timedOut())throw new p(e,new d(a));if(t instanceof l){if(b&&(t instanceof u||t instanceof d||t instanceof m))throw new p(e,t);throw t}throw new p(e,new l("Network error. Please check your connection and try again.",0,void 0,!0))}finally{f.cleanup()}}async fetch(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.request(e,t)}async fetchWithAuth(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},{timeoutMs:r,maxResponseBytes:n,signal:i,...s}=t,a=g(r,3e4,"timeoutMs"),o=g(n,5242880,"maxResponseBytes"),c=h(i,a),m={...s.headers};try{await S(this.attachAuthHeader(m,{logDetails:!1}),c)}catch(e){if(c.cleanup(),e instanceof l)throw e;throw new l("Unable to prepare the authenticated request.",0)}let f=(s.method||"GET").toUpperCase(),y=!1;try{var b;if(c.callerAborted())throw new u;if(c.timedOut())throw new d(a);let t=fetch(e,{...s,headers:m,credentials:null!=(b=s.credentials)?b:"include",signal:c.signal});y=!0;let r=await S(t,c);return this.boundRawResponse(r,c,a,o,w(f)?e:void 0)}catch(t){if(c.cleanup(),c.callerAborted()){let t=new u;if(w(f)&&y)throw new p(e,t);throw t}if(c.timedOut()){let t=new d(a);if(w(f)&&y)throw new p(e,t);throw t}throw t}}boundRawResponse(e,t,r,n,i){if(!e.body)return t.cleanup(),e;let s=e.body.getReader(),a=0,o=e=>{try{s.cancel(e).catch(()=>void 0),t.abort(e)}finally{q(s),t.cleanup()}},c=new ReadableStream({async pull(e){try{let{done:r,value:i}=await y(s,t.signal);if(r){t.cleanup(),q(s),e.close();return}if((a+=i.byteLength)>n)throw new m(n);e.enqueue(i)}catch(n){if(o(n),t.callerAborted()){let t=new u;e.error(i?new p(i,t):t)}else if(t.timedOut()){let t=new d(r);e.error(i?new p(i,t):t)}else i&&n instanceof m?e.error(new p(i,n)):e.error(n)}},cancel(e){o(e)}});return new Response(c,{status:e.status,statusText:e.statusText,headers:e.headers})}async fetchText(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=await this.fetchWithAuth(e,t);if(!r.ok)throw new l("HTTP ".concat(r.status),r.status);return f(r,g(t.maxResponseBytes,5242880,"maxResponseBytes"))}constructor(e="/api"){this.authWaitMs=1200,this.baseUrl=this.resolveBaseUrl(e)}}function w(e){return"POST"===e||"PUT"===e||"PATCH"===e||"DELETE"===e}function q(e){try{e.releaseLock()}catch(e){}}},79105:(e,t,r)=>{r.d(t,{v:()=>o});var n=r(16902);let i={ERROR:"error",WARN:"warn",INFO:"info",DEBUG:"debug"},s=["silent","error","warn","info","debug"];class a{shouldLog(e){return!this.isSilent&&("DEBUG"!==e||!!this.isDevelopment)}redactString(e){return e.replace(this.bearerTokenPattern,"Bearer <redacted>").replace(this.jwtPattern,"<redacted-jwt>")}sanitizeValue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new WeakSet;if("string"==typeof e)return this.redactString(e);if(Array.isArray(e))return e.map(e=>this.sanitizeValue(e,t));if(e instanceof Error)return{name:e.name,message:this.redactString(e.message)};if(e&&"object"==typeof e){if(t.has(e))return"[Circular]";t.add(e);let r={};for(let[n,i]of Object.entries(e)){if(this.sensitiveKeyPattern.test(n)){r[n]="<redacted>";continue}r[n]=this.sanitizeValue(i,t)}return r}return e}log(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),s=2;s<r;s++)n[s-2]=arguments[s];if(!this.shouldLog(e))return;let a=new Date().toISOString(),o=i[e],c=this.redactString(t),l=n.length>0?n.map(e=>this.sanitizeValue(e)):[],u=this.isDevelopment?"[".concat(a,"]"):"[PROD ".concat(a,"]");console[o]("".concat(u," ").concat(c),...l)}error(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log("ERROR",e,...r)}warn(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log("WARN",e,...r)}info(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log("INFO",e,...r)}debug(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];this.log("DEBUG",e,...r)}constructor(){this.isDevelopment=!1,this.sensitiveKeyPattern=/(token|authorization|secret|api[-_]?key|password|cookie)/i,this.bearerTokenPattern=/\bBearer\s+[A-Za-z0-9\-._~+/]+=*/gi,this.jwtPattern=/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\b/g;let e=(0,n.j)("NEXT_PUBLIC_LOG_LEVEL");void 0===e||s.includes(e)||console.warn('[Logger] Invalid NEXT_PUBLIC_LOG_LEVEL "'.concat(e,'". Expected one of: ').concat(s.join(", "),". Defaulting to normal logging.")),this.isSilent="silent"===e,this.isSilent&&console.warn("[Logger] NEXT_PUBLIC_LOG_LEVEL=silent. All logger output is disabled.")}}let o=new a}}]);
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.