@ai-development-environment/server 0.0.74 → 0.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/standalone/.next/BUILD_ID +1 -1
- package/standalone/.next/build-manifest.json +3 -3
- package/standalone/.next/prerender-manifest.json +3 -3
- package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
- package/standalone/.next/server/app/_global-error.html +1 -1
- package/standalone/.next/server/app/_global-error.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.html +1 -1
- package/standalone/.next/server/app/_not-found.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
- package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
- package/standalone/.next/server/chunks/ssr/src_components_settings-page_tsx_06dxqc7._.js +1 -1
- package/standalone/.next/server/middleware-build-manifest.js +3 -3
- package/standalone/.next/server/pages/404.html +1 -1
- package/standalone/.next/server/pages/500.html +1 -1
- package/standalone/.next/server/server-reference-manifest.js +1 -1
- package/standalone/.next/server/server-reference-manifest.json +1 -1
- package/standalone/.next/static/chunks/2jvwh8l-4r8jn.js +37 -0
- package/standalone/.next/static/chunks/3r4fi297tsw1d.js +0 -37
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_buildManifest.js +0 -0
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_clientMiddlewareManifest.js +0 -0
- /package/standalone/.next/static/{YQIuXmWQUbKsutRkPFwhf → Aei0gFCWoltbmK7Sdf4sn}/_ssgManifest.js +0 -0
|
@@ -22,7 +22,7 @@ module.exports=[753934,a=>{"use strict";var b=a.i(187924),c=a.i(613412),d=a.i(61
|
|
|
22
22
|
tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
|
|
23
23
|
tokenConfiguredAt tokenLastUsedAt tokenLastError
|
|
24
24
|
certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
|
|
25
|
-
`;function P(){let a=(0,n.useTranslations)("pushSettings"),c=(0,n.useTranslations)("common"),d=(0,n.useTranslations)("credentials"),e=C(),g=(0,m.useLocale)(),[i,k]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[D,E]=(0,o.useState)(""),[F,H]=(0,o.useState)(""),[J,L]=(0,o.useState)(""),[M,P]=(0,o.useState)("SANDBOX"),[Q,R]=(0,o.useState)(""),[S,T]=(0,o.useState)(""),[U,V]=(0,o.useState)(!1),[W,X]=(0,o.useState)(null),Y=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${O} } }`);k(a.pushNotificationSettings),r(a.pushNotificationSettings.tokenTeamId??""),B(a.pushNotificationSettings.tokenKeyId??"")}catch(a){X(a instanceof Error?a.message:String(a))}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void Y(),0);return()=>window.clearTimeout(a)},[Y]);let Z=async a=>{a.preventDefault(),V(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${O} } }`,{input:{teamId:q,keyId:A,privateKey:D||null}});k(a.saveApnsTokenSettings),E(""),X(null)}catch(a){X(a instanceof Error?a.message:String(a))}finally{V(!1)}},$=async a=>{a.preventDefault(),V(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${O} } }`,{input:{name:F,topic:J,environment:M,p12Base64:Q,passphrase:S}});k(a.addApnsCertificateCredential),H(""),L(""),R(""),T(""),X(null)}catch(a){X(a instanceof Error?a.message:String(a))}finally{V(!1)}};return(0,b.jsxs)(v.Card,{children:[(0,b.jsx)(v.CardHeader,{children:(0,b.jsx)(v.CardTitle,{children:a("title")})}),(0,b.jsxs)(v.CardContent,{className:"space-y-6",children:[W&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:W})}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:Z,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-medium",children:a("tokenAuthentication")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("tokenDescription")})]}),(0,b.jsx)(t.Badge,{variant:i?.tokenConfigured?"default":"secondary",children:i?.tokenConfigured?a("configured"):a("notConfigured")})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("tokenSetupHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account/resources/authkeys/add",children:a("createTokenKey")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-team",children:a("teamId")}),(0,b.jsx)(w.Input,{disabled:e,id:"apns-team",onChange:a=>r(a.target.value),value:q})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-key",children:a("keyId")}),(0,b.jsx)(w.Input,{disabled:e,id:"apns-key",onChange:a=>B(a.target.value),value:A})]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("teamIdHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account#MembershipDetailsCard",children:a("openMembership")})]}),(0,b.jsxs)(x.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-6",children:[(0,b.jsx)(l.Upload,{})," ",e?d("readOnlyNotice"):D?a("p8Ready"):i?.tokenConfigured?a("replaceP8"):a("chooseP8"),(0,b.jsx)(w.Input,{accept:".p8",className:"sr-only",disabled:e,onChange:a=>{let b=a.target.files?.[0];b&&b.text().then(E)},type:"file"})]}),i?.tokenPrivateKeyFingerprint&&(0,b.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",i.tokenPrivateKeyFingerprint]}),i?.tokenLastError&&(0,b.jsx)("p",{className:"text-sm text-destructive",children:i.tokenLastError}),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:c("cancel"),description:a("removeTokenDescription"),onConfirm:async()=>{k((await (0,z.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${O} } }`)).clearApnsTokenSettings),r(""),B("")},title:a("removeToken"),trigger:(0,b.jsxs)(u.Button,{disabled:U||!i?.tokenConfigured||e,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{})," ",a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:U||!q||!A||!D&&!i?.tokenConfigured||e,type:"submit",children:[U?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("save")]})]})]}),(0,b.jsx)("div",{className:"border-t"}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:$,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-medium",children:a("certificateAuthentication")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("certificateDescription")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a("certificateSetupHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account/resources/certificates/add",children:a("createCertificate")})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("name")}),(0,b.jsx)(w.Input,{disabled:e,onChange:a=>H(a.target.value),value:F})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("topic")}),(0,b.jsx)(w.Input,{disabled:e,onChange:a=>L(a.target.value),value:J})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("environment")}),(0,b.jsxs)(N.Select,{disabled:e,onValueChange:P,value:M,children:[(0,b.jsx)(N.SelectTrigger,{children:(0,b.jsx)(N.SelectValue,{})}),(0,b.jsxs)(N.SelectContent,{children:[(0,b.jsx)(N.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,b.jsx)(N.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)(x.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-5",children:[(0,b.jsx)(f.KeyRound,{})," ",Q?a("p12Ready"):a("chooseP12"),(0,b.jsx)(w.Input,{accept:".p12,.pfx",className:"sr-only",disabled:e,onChange:a=>{let b=a.target.files?.[0];b&&new Promise((a,c)=>{let d=new FileReader;d.onerror=()=>c(d.error),d.onload=()=>a(String(d.result).split(",")[1]??""),d.readAsDataURL(b)}).then(R)},type:"file"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("passphrase")}),(0,b.jsx)(w.Input,{disabled:e,onChange:a=>T(a.target.value),type:"password",value:S})]})]}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(u.Button,{disabled:U||!F||!J||!Q||e,type:"submit",children:[(0,b.jsx)(h.Save,{})," ",a("addCertificate")]})})]}),i?.certificates.map(d=>(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:d.name}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[d.topic," · ",d.environment]}),(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",d.fingerprint]}),d.expiresAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("expires",{date:(0,K.formatDateValue)(d.expiresAt,"short",{locale:g,showTime:!1})})}),d.lastTestedAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("lastTested",{date:(0,K.formatDateValue)(d.lastTestedAt,"short",{locale:g})})}),d.lastError&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:d.lastError})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(u.Button,{disabled:U,onClick:()=>void(async()=>{V(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${O} } }`,{id:d.id});k(a.retestApnsCertificateCredential),X(null)}catch(a){X(a instanceof Error?a.message:String(a)),await Y()}finally{V(!1)}})(),size:"sm",variant:"outline",children:[(0,b.jsx)(G.RefreshCw,{})," ",a("retest")]}),(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:c("cancel"),description:a("removeCertificateDescription"),onConfirm:async()=>{await (0,z.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:d.id}),await Y()},title:a("removeCertificate"),trigger:(0,b.jsx)(u.Button,{disabled:e,size:"icon-sm",variant:"ghost",children:(0,b.jsx)(j.Trash2,{})})})]})]},d.id))]})]})}var Q=a.i(585650),R=a.i(27524),S=a.i(555027);let T="siteUrl email tokenConfigured cacheTtlSeconds updatedAt",U="enabled secretConfigured registered registrationId registeredUrl jql configuredAt lastReceivedAt lastOutcome lastError";function V({label:a,value:d,copyLabel:e,copiedLabel:f,help:g,mono:h=!1}){let[i,j]=(0,o.useState)(!1),k=async()=>{try{await navigator.clipboard.writeText(d),j(!0),window.setTimeout(()=>j(!1),2e3)}catch{}};return(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",children:a}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(w.Input,{className:h?"font-mono text-xs":void 0,onFocus:a=>a.target.select(),readOnly:!0,value:d}),(0,b.jsxs)(u.Button,{onClick:()=>void k(),type:"button",variant:"outline",children:[i?(0,b.jsx)(c.CheckCircle2,{}):(0,b.jsx)(Q.Copy,{}),i?f:e]})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:g})]})}function W(){let a=(0,n.useTranslations)("jiraSettings"),d=(0,n.useTranslations)("common"),e=(0,m.useLocale)(),g=C(),[h,i]=(0,o.useState)(null),[k,l]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[D,E]=(0,o.useState)(!1),[F,H]=(0,o.useState)(null),[J,L]=(0,o.useState)(null),M=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query { jiraWebhookSettings { ${U} } }`);i(a.jiraWebhookSettings),a.jiraWebhookSettings.registeredUrl&&r(a.jiraWebhookSettings.registeredUrl),B(a.jiraWebhookSettings.jql??"")}catch(a){H(a instanceof Error?a.message:String(a))}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{r(`${window.location.origin.replace(/\/$/,"")}/api/public/jira/webhook`),M()},0);return()=>window.clearTimeout(a)},[M]),(0,o.useEffect)(()=>{let a=(0,z.controlPlaneSubscriptions)().subscribe({query:"subscription { jiraWebhookDeliveryChanged { deliveryId } }"},{next:()=>void M(),error:()=>void 0,complete:()=>void 0});return()=>a()},[M]);let N=async(a,b,c,d)=>{E(!0);try{let e=(await (0,z.controlPlaneRequest)(a,d))[b];i(e.settings),l(e.secret),H(null),L(c)}catch(a){H(a instanceof Error?a.message:String(a)),L(null)}finally{E(!1)}},O=async()=>{E(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation { disableJiraWebhook { ${U} } }`);i(b.disableJiraWebhook),l(null),H(null),L(a("webhookDisabled"))}catch(a){H(a instanceof Error?a.message:String(a)),L(null)}finally{E(!1)}},P=h?.secretConfigured??!1,Q=h?.registered??!1;return(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-5",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(R.Webhook,{className:"size-5"}),(0,b.jsx)("h2",{className:"font-semibold",children:a("webhookTitle")})]}),(0,b.jsx)(t.Badge,{className:P?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:Q?a("webhookRegistered"):P?a("webhookConfigured"):a("webhookNotConfigured")})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("webhookDescription")}),F&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:F})}),J&&(0,b.jsxs)(s.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(c.CheckCircle2,{}),(0,b.jsx)(s.AlertDescription,{className:"text-current",children:J})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-url",children:a("webhookUrl")}),(0,b.jsx)(w.Input,{disabled:D||g,id:"jira-webhook-url",onChange:a=>r(a.target.value),value:q}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("webhookUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-jql",children:a("webhookJql")}),(0,b.jsx)(w.Input,{disabled:D||g,id:"jira-webhook-jql",onChange:a=>B(a.target.value),placeholder:"project in (ABC, XYZ)",value:A}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("webhookJqlHelp")})]}),k&&!Q?(0,b.jsx)(V,{copiedLabel:a("copied"),copyLabel:a("copy"),help:a("webhookSecretHelp"),label:a("webhookSecret"),mono:!0,value:k}):(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",children:a("webhookSecret")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Q?a("webhookSecretRegistered"):P?a("webhookSecretHelp"):a("webhookSecretPending")})]}),Q?(0,b.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs text-muted-foreground",children:[(0,b.jsx)("p",{children:a("webhookRegisteredAs",{id:h?.registrationId??"—"})}),(0,b.jsx)("p",{className:"mt-2",children:(0,b.jsx)(I,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:a("webhookDocs")})})]}):(0,b.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs",children:[(0,b.jsx)("p",{className:"mb-2 font-medium",children:a("setupTitle")}),(0,b.jsx)("p",{className:"mb-2 text-muted-foreground",children:a("manualIntro")}),(0,b.jsxs)("ol",{className:"list-decimal space-y-1 pl-4 text-muted-foreground",children:[(0,b.jsx)("li",{children:a("setupStep1")}),(0,b.jsx)("li",{children:a("setupStep2")}),(0,b.jsx)("li",{children:a("setupStep3",{events:"jira:issue_created, jira:issue_updated, jira:issue_deleted, comment_created, worklog_created, attachment_created, issuelink_created, sprint_started, sprint_closed"})}),(0,b.jsx)("li",{children:a("setupStep4",{jql:"project in (ABC, XYZ)"})})]}),(0,b.jsx)("p",{className:"mt-2",children:(0,b.jsx)(I,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:a("webhookDocs")})})]}),h?.lastReceivedAt&&(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,b.jsx)("p",{children:a("lastWebhook",{date:(0,K.formatDateValue)(h.lastReceivedAt,"short",{locale:e}),outcome:h.lastOutcome??"—"})}),h.lastError&&(0,b.jsx)("p",{className:"mt-1 text-destructive",children:h.lastError})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[P&&(0,b.jsx)(u.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,b.jsx)(S.Link,{href:"/jira-webhooks",children:a("viewDeliveries")})}),P&&(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("disableWebhook"),cancelLabel:d("cancel"),description:a("confirmDisableDescription"),onConfirm:O,title:a("confirmDisable"),trigger:(0,b.jsxs)(u.Button,{disabled:D||g,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),a("disableWebhook")]})}),P&&(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("rotateWebhook"),cancelLabel:d("cancel"),description:Q?a("confirmRotateRegisteredDescription"):a("confirmRotateDescription"),onConfirm:()=>N(`mutation { rotateJiraWebhookSecret { secret settings { ${U} } } }`,"rotateJiraWebhookSecret",Q?a("webhookRotatedInJira"):a("webhookRotated")),title:a("confirmRotate"),trigger:(0,b.jsxs)(u.Button,{disabled:D||g,type:"button",variant:"ghost",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(G.RefreshCw,{}),a("rotateWebhook")]})}),!P&&(0,b.jsxs)(u.Button,{disabled:D||g,onClick:()=>void N(`mutation { enableJiraWebhook { secret settings { ${U} } } }`,"enableJiraWebhook",a("webhookEnabled")),type:"button",variant:"outline",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(f.KeyRound,{}),a("enableWebhook")]}),(0,b.jsxs)(u.Button,{disabled:D||g||!q.trim(),onClick:()=>void N(`mutation Register($input: RegisterJiraWebhookInput!) { registerJiraWebhook(input: $input) { secret settings { ${U} } } }`,"registerJiraWebhook",Q?a("webhookReregistered"):a("webhookRegisteredNotice"),{input:{url:q,jql:A.trim()||null}}),type:"button",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(R.Webhook,{}),Q?a("updateRegistration"):a("registerWebhook")]})]})]})})}function X({embedded:a=!1}={}){let d=(0,n.useTranslations)("jiraSettings"),e=(0,n.useTranslations)("common"),g=(0,n.useTranslations)("credentials"),i=C(),[l,m]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[D,E]=(0,o.useState)(""),[F,G]=(0,o.useState)(null),[H,J]=(0,o.useState)(!0),[K,L]=(0,o.useState)(!1),[M,N]=(0,o.useState)(null),[O,P]=(0,o.useState)(null),[Q,R]=(0,o.useState)(!1),S=a=>{m(a),r(a.siteUrl??""),B(a.email??""),E("")},U=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query { jiraSettings { ${T} } }`);S(a.jiraSettings)}catch(a){N(a instanceof Error?a.message:String(a))}finally{J(!1)}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void U(),0);return()=>window.clearTimeout(a)},[U]);let V=async a=>{L(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${T} } }`,{input:{siteUrl:q,email:A,apiToken:D||null,resetSite:a}});S(b.saveJiraSettings),G(null),N(null),P(d("saved"))}catch(a){N(a instanceof Error?a.message:String(a)),P(null)}finally{L(!1)}},Y=async()=>{L(!0);try{let a=await (0,z.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");G(a.testJiraConnection),N(null),P(d("connectionSucceeded"))}catch(a){G(null),N(a instanceof Error?a.message:String(a)),P(null)}finally{L(!1)}},Z=async()=>{L(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation { clearJiraCredentials { ${T} } }`);S(a.clearJiraCredentials),G(null),N(null),P(d("removed"))}catch(a){N(a instanceof Error?a.message:String(a))}finally{L(!1)}};return(0,b.jsxs)("section",{className:a?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!a&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:d("title")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:d("description")})]}),H?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{}),d("loading")]}):(0,b.jsx)("form",{onSubmit:a=>{(a.preventDefault(),l?.siteUrl&&l.siteUrl!==q.trim().replace(/\/$/,""))?R(!0):V(!1)},children:(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-5",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(f.KeyRound,{className:"size-5"}),(0,b.jsx)("h2",{className:"font-semibold",children:d("credentials")})]}),(0,b.jsx)(t.Badge,{className:l?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:l?.tokenConfigured?d("configured"):d("notConfigured")})]}),M&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:M})}),O&&(0,b.jsxs)(s.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(c.CheckCircle2,{}),(0,b.jsx)(s.AlertDescription,{className:"text-current",children:O})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:d("siteUrl")}),(0,b.jsx)(w.Input,{autoComplete:"url",id:"jira-site-url",disabled:i,onChange:a=>r(a.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:q}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("siteUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:d("email")}),(0,b.jsx)(w.Input,{autoComplete:"username",id:"jira-email",disabled:i,onChange:a=>B(a.target.value),required:!0,type:"email",value:A}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("accountHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:d("apiToken")}),(0,b.jsx)(w.Input,{autoComplete:"new-password",disabled:i,id:"jira-token",onChange:a=>E(a.target.value),placeholder:l?.tokenConfigured?d("tokenPlaceholderConfigured"):d("tokenPlaceholder"),required:!l?.tokenConfigured&&!i,type:"password",value:D}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?g("readOnlyNotice"):l?.tokenConfigured?d("tokenKeepHelp"):d("tokenHelp")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[d("tokenAcquireHelp")," ",(0,b.jsx)(I,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:d("createToken")})]})]}),F&&(0,b.jsx)(s.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:F.displayName}),(0,b.jsx)("p",{className:"text-muted-foreground",children:F.emailAddress??F.accountId})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:d("remove"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:Z,title:d("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:K||!l?.tokenConfigured||i,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),d("remove")]})}),(0,b.jsxs)(u.Button,{disabled:K||!l?.tokenConfigured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,b.jsx)(k.Unplug,{}),d("test")]}),(0,b.jsxs)(u.Button,{disabled:K||i,type:"submit",children:[K?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{}),d("save")]})]})]})})}),!H&&l?.tokenConfigured&&(0,b.jsx)(W,{}),(0,b.jsx)(p.ConfirmationDialog,{actionLabel:e("continue"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:()=>V(!0),onOpenChange:R,open:Q,title:d("confirmSiteChange")})]})}var Y=a.i(648104),Z=a.i(315055);let $="tokenConfigured defaultJiraKeyRegex actionsNotificationPollIntervalSeconds cacheTtlSeconds updatedAt",_="configured appId installationId privateKeyConfigured keyFingerprint appSlug appOwnerLogin appOwnerType accountLogin repositorySelection actionsPermission checksPermission commitStatusesPermission webhookEvents enhancedPipelineWebhooksEnabled enhancedPipelineWebhooksReady enhancedPipelineWebhooksMissing verifiedAt webhookConfigured webhookUrl webhookConfiguredAt webhookLastReceivedAt webhookLastOutcome webhookLastError updatedAt";function aa(a){if(!a?.appSlug)return null;let b=encodeURIComponent(a.appSlug);if("User"===a.appOwnerType)return`https://github.com/settings/apps/${b}`;if(!a.appOwnerLogin)return null;let c=encodeURIComponent(a.appOwnerLogin);return"Organization"===a.appOwnerType?`https://github.com/organizations/${c}/settings/apps/${b}`:"Enterprise"===a.appOwnerType?`https://github.com/enterprises/${c}/settings/apps/${b}`:null}function ab({children:a,description:c,id:d,title:e}){return(0,b.jsxs)("section",{"aria-labelledby":d,className:"min-w-0 space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:d,children:e}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:c})]}),(0,b.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:a})]})}function ac(){let a=(0,n.useTranslations)("editorSettings"),[c,e]=(0,o.useState)("CODE"),[f,g]=(0,o.useState)(!0),[i,j]=(0,o.useState)(!1),[k,l]=(0,o.useState)(null),[m,p]=(0,o.useState)(null);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{(0,z.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(a=>e(a.worktreeSettings.editorVariant)).catch(a=>p(a instanceof Error?a.message:String(a))).finally(()=>g(!1))},0);return()=>window.clearTimeout(a)},[]);let q=async()=>{j(!0);try{await (0,z.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
|
|
25
|
+
`;function P(){let a=(0,n.useTranslations)("pushSettings"),d=(0,n.useTranslations)("common"),e=(0,n.useTranslations)("credentials"),g=C(),i=(0,m.useLocale)(),[k,q]=(0,o.useState)(null),[r,A]=(0,o.useState)(""),[B,D]=(0,o.useState)(""),[E,F]=(0,o.useState)(""),[H,L]=(0,o.useState)(!1),[M,P]=(0,o.useState)(""),[Q,R]=(0,o.useState)(""),[S,T]=(0,o.useState)("SANDBOX"),[U,V]=(0,o.useState)(""),[W,X]=(0,o.useState)(""),[Y,Z]=(0,o.useState)(!1),[$,_]=(0,o.useState)(""),[aa,ab]=(0,o.useState)(!1),[ac,ad]=(0,o.useState)(null),[ae,af]=(0,o.useState)(null),ag=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${O} } }`);q(a.pushNotificationSettings),A(a.pushNotificationSettings.tokenTeamId??""),D(a.pushNotificationSettings.tokenKeyId??"")}catch(a){ad(a instanceof Error?a.message:String(a))}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void ag(),0);return()=>window.clearTimeout(a)},[ag]);let ah=a=>(0,K.formatDateValue)(a,"short",{locale:i}),ai=async b=>{b.preventDefault(),ab(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${O} } }`,{input:{teamId:r,keyId:B,privateKey:E||null}});q(b.saveApnsTokenSettings),F(""),ad(null),af(a("tokenSaved"))}catch(a){ad(a instanceof Error?a.message:String(a)),af(null)}finally{ab(!1)}},aj=async b=>{if(!b.name.toLowerCase().endsWith(".p8")){ad(a("p8Invalid")),af(null);return}try{let c=await b.text();if(!c.includes("-----BEGIN PRIVATE KEY-----")||!c.includes("-----END PRIVATE KEY-----")){ad(a("p8Invalid")),af(null);return}F(c),ad(null),af(a("p8Loaded",{filename:b.name}))}catch{ad(a("p8ReadError")),af(null)}},ak=async b=>{let c=b.name.toLowerCase();if(!c.endsWith(".p12")&&!c.endsWith(".pfx")){ad(a("p12Invalid")),af(null);return}try{V(await new Promise((a,c)=>{let d=new FileReader;d.onerror=()=>c(d.error),d.onload=()=>a(String(d.result).split(",")[1]??""),d.readAsDataURL(b)})),X(b.name),ad(null),af(a("p12Loaded",{filename:b.name}))}catch{ad(a("p12ReadError")),af(null)}},al=async b=>{b.preventDefault(),ab(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${O} } }`,{input:{name:M,topic:Q,environment:S,p12Base64:U,passphrase:$}});q(b.addApnsCertificateCredential),P(""),R(""),V(""),X(""),_(""),ad(null),af(a("certificateAdded"))}catch(a){ad(a instanceof Error?a.message:String(a)),af(null)}finally{ab(!1)}};return(0,b.jsxs)(v.Card,{children:[(0,b.jsx)(v.CardHeader,{children:(0,b.jsx)(v.CardTitle,{children:a("title")})}),(0,b.jsxs)(v.CardContent,{className:"space-y-6",children:[ac&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:ac})}),ae&&(0,b.jsxs)(s.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(c.CheckCircle2,{}),(0,b.jsx)(s.AlertDescription,{className:"text-current",children:ae})]}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:ai,children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-medium",children:a("tokenAuthentication")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("tokenDescription")})]}),(0,b.jsx)(t.Badge,{variant:k?.tokenConfigured?"default":"secondary",children:k?.tokenConfigured?a("configured"):a("notConfigured")})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("tokenSetupHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account/resources/authkeys/add",children:a("createTokenKey")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-team",children:a("teamId")}),(0,b.jsx)(w.Input,{disabled:g,id:"apns-team",onChange:a=>A(a.target.value),value:r})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-key",children:a("keyId")}),(0,b.jsx)(w.Input,{disabled:g,id:"apns-key",onChange:a=>D(a.target.value),value:B})]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("teamIdHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account#MembershipDetailsCard",children:a("openMembership")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-private-key",children:a("privateKey")}),(0,b.jsxs)("div",{"aria-label":a("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${H?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),L(!0)},onDragLeave:()=>L(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",L(!0)},onDrop:a=>{if(a.preventDefault(),L(!1),g)return;let b=a.dataTransfer.files.item(0);b&&aj(b)},role:"group",children:[(0,b.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(l.Upload,{className:"size-3.5"})," ",g?e("readOnlyNotice"):a("p8DropHint")]}),(0,b.jsx)(J.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:g,id:"apns-private-key",onChange:a=>F(a.target.value),placeholder:k?.tokenConfigured?a("privateKeyConfiguredPlaceholder"):a("privateKeyPlaceholder"),required:!k?.tokenConfigured&&!g,value:E}),(0,b.jsx)(w.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":a("chooseP8"),className:"mt-2 h-auto text-xs",disabled:g,onChange:a=>{let b=a.target.files?.item(0);b&&aj(b),a.target.value=""},type:"file"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:k?.tokenConfigured?a("privateKeyKeepHelp"):a("privateKeyHelp")})]}),(k?.tokenConfiguredAt||k?.tokenPrivateKeyFingerprint||k?.tokenLastError)&&(0,b.jsx)(s.Alert,{variant:k.tokenLastError?"destructive":"default",children:(0,b.jsxs)(s.AlertDescription,{children:[k.tokenConfiguredAt&&(0,b.jsx)("p",{className:"font-medium",children:a("tokenConfiguredOn",{date:ah(k.tokenConfiguredAt)})}),k.tokenLastUsedAt&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:a("tokenLastUsed",{date:ah(k.tokenLastUsedAt)})}),k.tokenLastError&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:k.tokenLastError}),k.tokenPrivateKeyFingerprint&&(0,b.jsxs)("p",{className:"mt-1 break-all font-mono text-xs",children:["SHA-256 ",k.tokenPrivateKeyFingerprint]})]})}),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("removeTokenDescription"),onConfirm:async()=>{q((await (0,z.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${O} } }`)).clearApnsTokenSettings),A(""),D(""),F(""),ad(null),af(a("tokenRemoved"))},title:a("removeToken"),trigger:(0,b.jsxs)(u.Button,{disabled:aa||!k?.tokenConfigured||g,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{})," ",a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:aa||!r||!B||!E&&!k?.tokenConfigured||g,type:"submit",children:[aa?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("save")]})]})]}),(0,b.jsx)("div",{className:"border-t"}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:al,children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"font-medium",children:a("certificateAuthentication")}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("certificateDescription")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a("certificateSetupHelp")," ",(0,b.jsx)(I,{href:"https://developer.apple.com/account/resources/certificates/add",children:a("createCertificate")})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-certificate-name",children:a("name")}),(0,b.jsx)(w.Input,{disabled:g,id:"apns-certificate-name",onChange:a=>P(a.target.value),value:M})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-certificate-topic",children:a("topic")}),(0,b.jsx)(w.Input,{disabled:g,id:"apns-certificate-topic",onChange:a=>R(a.target.value),value:Q})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-certificate-environment",children:a("environment")}),(0,b.jsxs)(N.Select,{disabled:g,onValueChange:T,value:S,children:[(0,b.jsx)(N.SelectTrigger,{id:"apns-certificate-environment",children:(0,b.jsx)(N.SelectValue,{})}),(0,b.jsxs)(N.SelectContent,{children:[(0,b.jsx)(N.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,b.jsx)(N.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-certificate-bundle",children:a("certificate")}),(0,b.jsxs)("div",{"aria-label":a("p12DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${Y?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),Z(!0)},onDragLeave:()=>Z(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",Z(!0)},onDrop:a=>{if(a.preventDefault(),Z(!1),g)return;let b=a.dataTransfer.files.item(0);b&&ak(b)},role:"group",children:[(0,b.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,b.jsx)(f.KeyRound,{className:"size-3.5"})," ",g?e("readOnlyNotice"):W?a("p12Selected",{filename:W}):a("p12DropHint")]}),(0,b.jsx)(J.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:g,id:"apns-certificate-bundle",onChange:a=>{V(a.target.value.trim()),X("")},placeholder:a("p12Placeholder"),required:!g,value:U}),(0,b.jsx)(w.Input,{accept:".p12,.pfx,application/x-pkcs12","aria-label":a("chooseP12"),className:"mt-2 h-auto text-xs",disabled:g,onChange:a=>{let b=a.target.files?.item(0);b&&ak(b),a.target.value=""},type:"file"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("certificateHelp")})]}),(0,b.jsxs)("div",{className:"space-y-2 sm:max-w-sm",children:[(0,b.jsx)(x.Label,{htmlFor:"apns-certificate-passphrase",children:a("passphrase")}),(0,b.jsx)(w.Input,{autoComplete:"new-password",disabled:g,id:"apns-certificate-passphrase",onChange:a=>_(a.target.value),type:"password",value:$})]}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(u.Button,{disabled:aa||!M||!Q||!U||g,type:"submit",children:[aa?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("addCertificate")]})})]}),k?.certificates.map(c=>(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:c.name}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[c.topic," · ",c.environment]}),(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",c.fingerprint]}),c.expiresAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("expires",{date:(0,K.formatDateValue)(c.expiresAt,"short",{locale:i,showTime:!1})})}),c.lastTestedAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("lastTested",{date:(0,K.formatDateValue)(c.lastTestedAt,"short",{locale:i})})}),c.lastError&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:c.lastError})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(u.Button,{disabled:aa,onClick:()=>void(async()=>{ab(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${O} } }`,{id:c.id});q(a.retestApnsCertificateCredential),ad(null)}catch(a){ad(a instanceof Error?a.message:String(a)),await ag()}finally{ab(!1)}})(),size:"sm",variant:"outline",children:[(0,b.jsx)(G.RefreshCw,{})," ",a("retest")]}),(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("removeCertificateDescription"),onConfirm:async()=>{await (0,z.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:c.id}),await ag()},title:a("removeCertificate"),trigger:(0,b.jsx)(u.Button,{disabled:g,size:"icon-sm",variant:"ghost",children:(0,b.jsx)(j.Trash2,{})})})]})]},c.id))]})]})}var Q=a.i(585650),R=a.i(27524),S=a.i(555027);let T="siteUrl email tokenConfigured cacheTtlSeconds updatedAt",U="enabled secretConfigured registered registrationId registeredUrl jql configuredAt lastReceivedAt lastOutcome lastError";function V({label:a,value:d,copyLabel:e,copiedLabel:f,help:g,mono:h=!1}){let[i,j]=(0,o.useState)(!1),k=async()=>{try{await navigator.clipboard.writeText(d),j(!0),window.setTimeout(()=>j(!1),2e3)}catch{}};return(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",children:a}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(w.Input,{className:h?"font-mono text-xs":void 0,onFocus:a=>a.target.select(),readOnly:!0,value:d}),(0,b.jsxs)(u.Button,{onClick:()=>void k(),type:"button",variant:"outline",children:[i?(0,b.jsx)(c.CheckCircle2,{}):(0,b.jsx)(Q.Copy,{}),i?f:e]})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:g})]})}function W(){let a=(0,n.useTranslations)("jiraSettings"),d=(0,n.useTranslations)("common"),e=(0,m.useLocale)(),g=C(),[h,i]=(0,o.useState)(null),[k,l]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[D,E]=(0,o.useState)(!1),[F,H]=(0,o.useState)(null),[J,L]=(0,o.useState)(null),M=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query { jiraWebhookSettings { ${U} } }`);i(a.jiraWebhookSettings),a.jiraWebhookSettings.registeredUrl&&r(a.jiraWebhookSettings.registeredUrl),B(a.jiraWebhookSettings.jql??"")}catch(a){H(a instanceof Error?a.message:String(a))}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{r(`${window.location.origin.replace(/\/$/,"")}/api/public/jira/webhook`),M()},0);return()=>window.clearTimeout(a)},[M]),(0,o.useEffect)(()=>{let a=(0,z.controlPlaneSubscriptions)().subscribe({query:"subscription { jiraWebhookDeliveryChanged { deliveryId } }"},{next:()=>void M(),error:()=>void 0,complete:()=>void 0});return()=>a()},[M]);let N=async(a,b,c,d)=>{E(!0);try{let e=(await (0,z.controlPlaneRequest)(a,d))[b];i(e.settings),l(e.secret),H(null),L(c)}catch(a){H(a instanceof Error?a.message:String(a)),L(null)}finally{E(!1)}},O=async()=>{E(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation { disableJiraWebhook { ${U} } }`);i(b.disableJiraWebhook),l(null),H(null),L(a("webhookDisabled"))}catch(a){H(a instanceof Error?a.message:String(a)),L(null)}finally{E(!1)}},P=h?.secretConfigured??!1,Q=h?.registered??!1;return(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-5",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(R.Webhook,{className:"size-5"}),(0,b.jsx)("h2",{className:"font-semibold",children:a("webhookTitle")})]}),(0,b.jsx)(t.Badge,{className:P?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:Q?a("webhookRegistered"):P?a("webhookConfigured"):a("webhookNotConfigured")})]}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:a("webhookDescription")}),F&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:F})}),J&&(0,b.jsxs)(s.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(c.CheckCircle2,{}),(0,b.jsx)(s.AlertDescription,{className:"text-current",children:J})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-url",children:a("webhookUrl")}),(0,b.jsx)(w.Input,{disabled:D||g,id:"jira-webhook-url",onChange:a=>r(a.target.value),value:q}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("webhookUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-jql",children:a("webhookJql")}),(0,b.jsx)(w.Input,{disabled:D||g,id:"jira-webhook-jql",onChange:a=>B(a.target.value),placeholder:"project in (ABC, XYZ)",value:A}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("webhookJqlHelp")})]}),k&&!Q?(0,b.jsx)(V,{copiedLabel:a("copied"),copyLabel:a("copy"),help:a("webhookSecretHelp"),label:a("webhookSecret"),mono:!0,value:k}):(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",children:a("webhookSecret")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:Q?a("webhookSecretRegistered"):P?a("webhookSecretHelp"):a("webhookSecretPending")})]}),Q?(0,b.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs text-muted-foreground",children:[(0,b.jsx)("p",{children:a("webhookRegisteredAs",{id:h?.registrationId??"—"})}),(0,b.jsx)("p",{className:"mt-2",children:(0,b.jsx)(I,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:a("webhookDocs")})})]}):(0,b.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs",children:[(0,b.jsx)("p",{className:"mb-2 font-medium",children:a("setupTitle")}),(0,b.jsx)("p",{className:"mb-2 text-muted-foreground",children:a("manualIntro")}),(0,b.jsxs)("ol",{className:"list-decimal space-y-1 pl-4 text-muted-foreground",children:[(0,b.jsx)("li",{children:a("setupStep1")}),(0,b.jsx)("li",{children:a("setupStep2")}),(0,b.jsx)("li",{children:a("setupStep3",{events:"jira:issue_created, jira:issue_updated, jira:issue_deleted, comment_created, worklog_created, attachment_created, issuelink_created, sprint_started, sprint_closed"})}),(0,b.jsx)("li",{children:a("setupStep4",{jql:"project in (ABC, XYZ)"})})]}),(0,b.jsx)("p",{className:"mt-2",children:(0,b.jsx)(I,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:a("webhookDocs")})})]}),h?.lastReceivedAt&&(0,b.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,b.jsx)("p",{children:a("lastWebhook",{date:(0,K.formatDateValue)(h.lastReceivedAt,"short",{locale:e}),outcome:h.lastOutcome??"—"})}),h.lastError&&(0,b.jsx)("p",{className:"mt-1 text-destructive",children:h.lastError})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[P&&(0,b.jsx)(u.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,b.jsx)(S.Link,{href:"/jira-webhooks",children:a("viewDeliveries")})}),P&&(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("disableWebhook"),cancelLabel:d("cancel"),description:a("confirmDisableDescription"),onConfirm:O,title:a("confirmDisable"),trigger:(0,b.jsxs)(u.Button,{disabled:D||g,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),a("disableWebhook")]})}),P&&(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("rotateWebhook"),cancelLabel:d("cancel"),description:Q?a("confirmRotateRegisteredDescription"):a("confirmRotateDescription"),onConfirm:()=>N(`mutation { rotateJiraWebhookSecret { secret settings { ${U} } } }`,"rotateJiraWebhookSecret",Q?a("webhookRotatedInJira"):a("webhookRotated")),title:a("confirmRotate"),trigger:(0,b.jsxs)(u.Button,{disabled:D||g,type:"button",variant:"ghost",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(G.RefreshCw,{}),a("rotateWebhook")]})}),!P&&(0,b.jsxs)(u.Button,{disabled:D||g,onClick:()=>void N(`mutation { enableJiraWebhook { secret settings { ${U} } } }`,"enableJiraWebhook",a("webhookEnabled")),type:"button",variant:"outline",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(f.KeyRound,{}),a("enableWebhook")]}),(0,b.jsxs)(u.Button,{disabled:D||g||!q.trim(),onClick:()=>void N(`mutation Register($input: RegisterJiraWebhookInput!) { registerJiraWebhook(input: $input) { secret settings { ${U} } } }`,"registerJiraWebhook",Q?a("webhookReregistered"):a("webhookRegisteredNotice"),{input:{url:q,jql:A.trim()||null}}),type:"button",children:[D?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(R.Webhook,{}),Q?a("updateRegistration"):a("registerWebhook")]})]})]})})}function X({embedded:a=!1}={}){let d=(0,n.useTranslations)("jiraSettings"),e=(0,n.useTranslations)("common"),g=(0,n.useTranslations)("credentials"),i=C(),[l,m]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[D,E]=(0,o.useState)(""),[F,G]=(0,o.useState)(null),[H,J]=(0,o.useState)(!0),[K,L]=(0,o.useState)(!1),[M,N]=(0,o.useState)(null),[O,P]=(0,o.useState)(null),[Q,R]=(0,o.useState)(!1),S=a=>{m(a),r(a.siteUrl??""),B(a.email??""),E("")},U=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query { jiraSettings { ${T} } }`);S(a.jiraSettings)}catch(a){N(a instanceof Error?a.message:String(a))}finally{J(!1)}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void U(),0);return()=>window.clearTimeout(a)},[U]);let V=async a=>{L(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${T} } }`,{input:{siteUrl:q,email:A,apiToken:D||null,resetSite:a}});S(b.saveJiraSettings),G(null),N(null),P(d("saved"))}catch(a){N(a instanceof Error?a.message:String(a)),P(null)}finally{L(!1)}},Y=async()=>{L(!0);try{let a=await (0,z.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");G(a.testJiraConnection),N(null),P(d("connectionSucceeded"))}catch(a){G(null),N(a instanceof Error?a.message:String(a)),P(null)}finally{L(!1)}},Z=async()=>{L(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation { clearJiraCredentials { ${T} } }`);S(a.clearJiraCredentials),G(null),N(null),P(d("removed"))}catch(a){N(a instanceof Error?a.message:String(a))}finally{L(!1)}};return(0,b.jsxs)("section",{className:a?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!a&&(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:d("title")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:d("description")})]}),H?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{}),d("loading")]}):(0,b.jsx)("form",{onSubmit:a=>{(a.preventDefault(),l?.siteUrl&&l.siteUrl!==q.trim().replace(/\/$/,""))?R(!0):V(!1)},children:(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-5",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(f.KeyRound,{className:"size-5"}),(0,b.jsx)("h2",{className:"font-semibold",children:d("credentials")})]}),(0,b.jsx)(t.Badge,{className:l?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:l?.tokenConfigured?d("configured"):d("notConfigured")})]}),M&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:M})}),O&&(0,b.jsxs)(s.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(c.CheckCircle2,{}),(0,b.jsx)(s.AlertDescription,{className:"text-current",children:O})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:d("siteUrl")}),(0,b.jsx)(w.Input,{autoComplete:"url",id:"jira-site-url",disabled:i,onChange:a=>r(a.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:q}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("siteUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:d("email")}),(0,b.jsx)(w.Input,{autoComplete:"username",id:"jira-email",disabled:i,onChange:a=>B(a.target.value),required:!0,type:"email",value:A}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("accountHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:d("apiToken")}),(0,b.jsx)(w.Input,{autoComplete:"new-password",disabled:i,id:"jira-token",onChange:a=>E(a.target.value),placeholder:l?.tokenConfigured?d("tokenPlaceholderConfigured"):d("tokenPlaceholder"),required:!l?.tokenConfigured&&!i,type:"password",value:D}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?g("readOnlyNotice"):l?.tokenConfigured?d("tokenKeepHelp"):d("tokenHelp")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[d("tokenAcquireHelp")," ",(0,b.jsx)(I,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:d("createToken")})]})]}),F&&(0,b.jsx)(s.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:F.displayName}),(0,b.jsx)("p",{className:"text-muted-foreground",children:F.emailAddress??F.accountId})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:d("remove"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:Z,title:d("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:K||!l?.tokenConfigured||i,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),d("remove")]})}),(0,b.jsxs)(u.Button,{disabled:K||!l?.tokenConfigured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,b.jsx)(k.Unplug,{}),d("test")]}),(0,b.jsxs)(u.Button,{disabled:K||i,type:"submit",children:[K?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{}),d("save")]})]})]})})}),!H&&l?.tokenConfigured&&(0,b.jsx)(W,{}),(0,b.jsx)(p.ConfirmationDialog,{actionLabel:e("continue"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:()=>V(!0),onOpenChange:R,open:Q,title:d("confirmSiteChange")})]})}var Y=a.i(648104),Z=a.i(315055);let $="tokenConfigured defaultJiraKeyRegex actionsNotificationPollIntervalSeconds cacheTtlSeconds updatedAt",_="configured appId installationId privateKeyConfigured keyFingerprint appSlug appOwnerLogin appOwnerType accountLogin repositorySelection actionsPermission checksPermission commitStatusesPermission webhookEvents enhancedPipelineWebhooksEnabled enhancedPipelineWebhooksReady enhancedPipelineWebhooksMissing verifiedAt webhookConfigured webhookUrl webhookConfiguredAt webhookLastReceivedAt webhookLastOutcome webhookLastError updatedAt";function aa(a){if(!a?.appSlug)return null;let b=encodeURIComponent(a.appSlug);if("User"===a.appOwnerType)return`https://github.com/settings/apps/${b}`;if(!a.appOwnerLogin)return null;let c=encodeURIComponent(a.appOwnerLogin);return"Organization"===a.appOwnerType?`https://github.com/organizations/${c}/settings/apps/${b}`:"Enterprise"===a.appOwnerType?`https://github.com/enterprises/${c}/settings/apps/${b}`:null}function ab({children:a,description:c,id:d,title:e}){return(0,b.jsxs)("section",{"aria-labelledby":d,className:"min-w-0 space-y-4",children:[(0,b.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,b.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:d,children:e}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground",children:c})]}),(0,b.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:a})]})}function ac(){let a=(0,n.useTranslations)("editorSettings"),[c,e]=(0,o.useState)("CODE"),[f,g]=(0,o.useState)(!0),[i,j]=(0,o.useState)(!1),[k,l]=(0,o.useState)(null),[m,p]=(0,o.useState)(null);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{(0,z.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(a=>e(a.worktreeSettings.editorVariant)).catch(a=>p(a instanceof Error?a.message:String(a))).finally(()=>g(!1))},0);return()=>window.clearTimeout(a)},[]);let q=async()=>{j(!0);try{await (0,z.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
|
|
26
26
|
saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
|
|
27
27
|
}`,{editorVariant:c}),l(a("saved")),p(null)}catch(a){p(a instanceof Error?a.message:String(a)),l(null)}finally{j(!1)}};return(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-4",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(d.Code2,{className:"size-5"}),(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"font-semibold",children:a("title")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("description")})]})]}),m&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:m})}),k&&(0,b.jsx)(s.Alert,{children:(0,b.jsx)(s.AlertDescription,{children:k})}),f?(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{})," ",a("loading")]}):(0,b.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,b.jsxs)("div",{className:"min-w-64 flex-1 space-y-2",children:[(0,b.jsx)(x.Label,{htmlFor:"editor-variant",children:a("label")}),(0,b.jsxs)(N.Select,{onValueChange:a=>e(a),value:c,children:[(0,b.jsx)(N.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,b.jsx)(N.SelectValue,{})}),(0,b.jsxs)(N.SelectContent,{children:[(0,b.jsx)(N.SelectItem,{value:"CODE",children:a("code")}),(0,b.jsx)(N.SelectItem,{value:"CODE_INSIDERS",children:a("insiders")}),(0,b.jsx)(N.SelectItem,{value:"NONE",children:a("none")})]})]}),(0,b.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,b.jsx)("p",{children:a("setupHelp")}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[(0,b.jsx)(I,{href:"https://code.visualstudio.com/download",children:a("downloadCode")}),(0,b.jsx)(I,{href:"https://code.visualstudio.com/insiders/",children:a("downloadInsiders")})]})]})]}),(0,b.jsxs)(u.Button,{disabled:i,onClick:()=>void q(),children:[i?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("save")]})]})]})})}function ad(){let a=(0,n.useTranslations)("githubAppSettings"),d=(0,n.useTranslations)("common"),e=(0,m.useLocale)(),q=C(),[r,A]=(0,o.useState)(null),[B,D]=(0,o.useState)(""),[E,F]=(0,o.useState)(""),[G,H]=(0,o.useState)(""),[L,M]=(0,o.useState)(""),[N,O]=(0,o.useState)(""),[P,Q]=(0,o.useState)(!1),[R,T]=(0,o.useState)(!1),[U,V]=(0,o.useState)(!1),[W,X]=(0,o.useState)(!0),[Y,$]=(0,o.useState)(!1),[ab,ac]=(0,o.useState)(null),[ad,ae]=(0,o.useState)(null),af=aa(r),ag=!r||(r.enhancedPipelineWebhooksMissing?.length??0)>0,ah=(0,o.useCallback)(a=>{A(a),D(a.appId??""),F(a.installationId??""),H(""),O(b=>a.webhookUrl??b),Q(!!a.webhookUrl),T(a.enhancedPipelineWebhooksEnabled??!1)},[]),ai=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${_} } }`);ah(a.githubAppSettings)}catch(a){ac(a instanceof Error?a.message:String(a))}finally{X(!1)}},[ah]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{M(window.location.origin),O(`${window.location.origin.replace(/\/$/,"")}/api/public/github/webhook`),ai()},0);return()=>window.clearTimeout(a)},[ai]);let aj=async b=>{b.preventDefault(),$(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
|
|
28
28
|
saveGitHubAppSettings(input: $input) { ${_} }
|
|
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
|
|
|
7
7
|
"static/chunks/0cz1d0mv5g_q7.js"
|
|
8
8
|
],
|
|
9
9
|
"lowPriorityFiles": [
|
|
10
|
-
"static/
|
|
11
|
-
"static/
|
|
12
|
-
"static/
|
|
10
|
+
"static/Aei0gFCWoltbmK7Sdf4sn/_buildManifest.js",
|
|
11
|
+
"static/Aei0gFCWoltbmK7Sdf4sn/_ssgManifest.js",
|
|
12
|
+
"static/Aei0gFCWoltbmK7Sdf4sn/_clientMiddlewareManifest.js"
|
|
13
13
|
],
|
|
14
14
|
"rootMainFiles": [
|
|
15
15
|
"static/chunks/1oto92aw_9yqi.js",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oto92aw_9yqi.js"/><script src="/_next/static/chunks/2vfwa2oqh6yha.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-0q2foqhal-cxp.js" async=""></script><script src="/_next/static/chunks/2yl1jv4w6po1z.js" async=""></script><script src="/_next/static/chunks/1m5ykreap-f2c.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/icon.svg?icon.2eq-kzgm9x62k.svg" sizes="any" type="image/svg+xml"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oto92aw_9yqi.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"ViewportBoundary\"]\na:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"MetadataBoundary\"]\nc:I[168027,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/1m5ykreap-f2c.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oto92aw_9yqi.js"/><script src="/_next/static/chunks/2vfwa2oqh6yha.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-0q2foqhal-cxp.js" async=""></script><script src="/_next/static/chunks/2yl1jv4w6po1z.js" async=""></script><script src="/_next/static/chunks/1m5ykreap-f2c.js" async=""></script><meta name="robots" content="noindex"/><meta name="next-size-adjust" content=""/><title>404: This page could not be found.</title><link rel="manifest" href="/manifest.webmanifest"/><link rel="icon" href="/icon.svg?icon.2eq-kzgm9x62k.svg" sizes="any" type="image/svg+xml"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oto92aw_9yqi.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"ViewportBoundary\"]\na:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"MetadataBoundary\"]\nc:I[168027,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_not-found\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",16],[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"script\",\"script-0\",{\"src\":\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"async\":true,\"nonce\":\"$undefined\"}],[\"$\",\"script\",\"script-1\",{\"src\":\"/_next/static/chunks/1m5ykreap-f2c.js\",\"async\":true,\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"children\":[\"$\",\"body\",null,{\"children\":[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],[]],\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:style\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:1:props:style\",\"children\":404}],[\"$\",\"div\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:style\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$0:f:0:1:0:props:children:1:props:children:props:children:props:notFound:0:1:props:children:props:children:2:props:children:props:style\",\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"]},null,false,null],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"Aei0gFCWoltbmK7Sdf4sn\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"e:I[154500,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"IconMark\"]\n6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}],[\"$\",\"link\",\"1\",{\"rel\":\"icon\",\"href\":\"/icon.svg?icon.2eq-kzgm9x62k.svg\",\"sizes\":\"any\",\"type\":\"image/svg+xml\"}],[\"$\",\"$Le\",\"2\",{}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oto92aw_9yqi.js"/><script src="/_next/static/chunks/2vfwa2oqh6yha.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-0q2foqhal-cxp.js" async=""></script><script src="/_next/static/chunks/2yl1jv4w6po1z.js" async=""></script><script src="/_next/static/chunks/1m5ykreap-f2c.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="manifest" href="/manifest.webmanifest"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oto92aw_9yqi.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"ViewportBoundary\"]\na:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"MetadataBoundary\"]\nc:I[168027,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"
|
|
1
|
+
<!DOCTYPE html><html id="__next_error__"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/1oto92aw_9yqi.js"/><script src="/_next/static/chunks/2vfwa2oqh6yha.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-0q2foqhal-cxp.js" async=""></script><script src="/_next/static/chunks/2yl1jv4w6po1z.js" async=""></script><script src="/_next/static/chunks/1m5ykreap-f2c.js" async=""></script><meta name="next-size-adjust" content=""/><title>500: This page couldn’t load</title><link rel="manifest" href="/manifest.webmanifest"/><style>:root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }</style><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji";height:100vh;display:flex;align-items:center;justify-content:center"><div style="margin-top:-32px;max-width:325px;padding:32px 28px;text-align:left"><svg width="32" height="32" viewBox="-0.2 -1.5 32 32" fill="none" style="margin-bottom:24px"><path d="M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z" fill="var(--next-error-title)"></path></svg><h1 style="font-size:24px;font-weight:500;letter-spacing:-0.02em;line-height:32px;margin:0 0 12px 0;color:var(--next-error-title)">This page couldn’t load</h1><p style="font-size:14px;font-weight:400;line-height:21px;margin:0 0 20px 0;color:var(--next-error-message)">A server error occurred. Reload to try again.</p><form style="margin:0"><button type="submit" style="display:inline-flex;align-items:center;justify-content:center;height:32px;padding:0 12px;font-size:14px;font-weight:500;line-height:20px;border-radius:6px;cursor:pointer;color:var(--next-error-btn-text);background:var(--next-error-btn-bg);border:var(--next-error-btn-border)">Reload</button></form></div></div><!--$--><!--/$--><script src="/_next/static/chunks/1oto92aw_9yqi.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[339756,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n3:I[837457,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\"]\n4:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"OutletBoundary\"]\n5:\"$Sreact.suspense\"\n8:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"ViewportBoundary\"]\na:I[897367,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"MetadataBoundary\"]\nc:I[168027,[\"/_next/static/chunks/2yl1jv4w6po1z.js\",\"/_next/static/chunks/1m5ykreap-f2c.js\"],\"default\",1]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"c\":[\"\",\"_global-error\"],\"q\":\"\",\"i\":false,\"f\":[[[\"\",{\"children\":[\"__PAGE__\",{}]}],[[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L2\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L3\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[[\"$\",\"$1\",\"c\",{\"children\":[[\"$\",\"html\",null,{\"id\":\"__next_error__\",\"children\":[[\"$\",\"head\",null,{\"children\":[[\"$\",\"title\",null,{\"children\":\"500: This page couldn’t load\"}],[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\":root {--next-error-bg: #fff;--next-error-text: #171717;--next-error-title: #171717;--next-error-message: #171717;--next-error-digest: #666666;--next-error-btn-text: #fff;--next-error-btn-bg: #171717;--next-error-btn-border: none;--next-error-btn-secondary-text: #171717;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(0,0,0,0.08);}@media (prefers-color-scheme: dark) {:root {--next-error-bg: #0a0a0a;--next-error-text: #ededed;--next-error-title: #ededed;--next-error-message: #ededed;--next-error-digest: #a0a0a0;--next-error-btn-text: #0a0a0a;--next-error-btn-bg: #ededed;--next-error-btn-border: none;--next-error-btn-secondary-text: #ededed;--next-error-btn-secondary-bg: transparent;--next-error-btn-secondary-border: 1px solid rgba(255,255,255,0.14);}}body { margin: 0; color: var(--next-error-text); background: var(--next-error-bg); }\"}}]]}],[\"$\",\"body\",null,{\"children\":[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"display\":\"flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"style\":{\"marginTop\":\"-32px\",\"maxWidth\":\"325px\",\"padding\":\"32px 28px\",\"textAlign\":\"left\"},\"children\":[[\"$\",\"svg\",null,{\"width\":\"32\",\"height\":\"32\",\"viewBox\":\"-0.2 -1.5 32 32\",\"fill\":\"none\",\"style\":{\"marginBottom\":\"24px\"},\"children\":[\"$\",\"path\",null,{\"d\":\"M16.9328 0C18.0839 0.000116771 19.1334 0.658832 19.634 1.69531L31.4299 26.1309C32.0708 27.4588 31.1036 28.9999 29.6291 29H2.00215C0.527541 29 -0.439628 27.4588 0.201371 26.1309L11.9973 1.69531C12.4979 0.658823 13.5474 7.75066e-05 14.6984 0H16.9328ZM3.59493 26H28.0363L16.9328 3H14.6984L3.59493 26ZM15.8156 19C16.9202 19.0001 17.8156 19.8955 17.8156 21C17.8156 22.1045 16.9202 22.9999 15.8156 23C14.7111 23 13.8156 22.1046 13.8156 21C13.8156 19.8954 14.7111 19 15.8156 19ZM17.3156 16.5H14.3156V8.5H17.3156V16.5Z\",\"fill\":\"var(--next-error-title)\"}]}],[\"$\",\"h1\",null,{\"style\":{\"fontSize\":\"24px\",\"fontWeight\":500,\"letterSpacing\":\"-0.02em\",\"lineHeight\":\"32px\",\"margin\":\"0 0 12px 0\",\"color\":\"var(--next-error-title)\"},\"children\":\"This page couldn’t load\"}],[\"$\",\"p\",null,{\"style\":{\"fontSize\":\"14px\",\"fontWeight\":400,\"lineHeight\":\"21px\",\"margin\":\"0 0 20px 0\",\"color\":\"var(--next-error-message)\"},\"children\":\"A server error occurred. Reload to try again.\"}],[\"$\",\"form\",null,{\"style\":{\"margin\":0},\"children\":[\"$\",\"button\",null,{\"type\":\"submit\",\"style\":{\"display\":\"inline-flex\",\"alignItems\":\"center\",\"justifyContent\":\"center\",\"height\":\"32px\",\"padding\":\"0 12px\",\"fontSize\":\"14px\",\"fontWeight\":500,\"lineHeight\":\"20px\",\"borderRadius\":\"6px\",\"cursor\":\"pointer\",\"color\":\"var(--next-error-btn-text)\",\"background\":\"var(--next-error-btn-bg)\",\"border\":\"var(--next-error-btn-border)\"},\"children\":\"Reload\"}]}]]}]}]}]]}],null,[\"$\",\"$L4\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.MetadataOutlet\",\"children\":\"$@6\"}]}]]}],{},null,false,null]},null,false,\"$@7\"],[\"$\",\"$1\",\"h\",{\"children\":[null,[\"$\",\"$L8\",null,{\"children\":\"$L9\"}],[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$La\",null,{\"children\":[\"$\",\"$5\",null,{\"name\":\"Next.Metadata\",\"children\":\"$Lb\"}]}]}],[\"$\",\"meta\",null,{\"name\":\"next-size-adjust\",\"content\":\"\"}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$c\",[]],\"S\":true,\"h\":null,\"s\":\"$undefined\",\"l\":\"$undefined\",\"p\":\"$undefined\",\"d\":\"$undefined\",\"b\":\"Aei0gFCWoltbmK7Sdf4sn\"}\n"])</script><script>self.__next_f.push([1,"d:[]\n7:\"$Wd\"\n"])</script><script>self.__next_f.push([1,"9:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n"])</script><script>self.__next_f.push([1,"6:null\nb:[[\"$\",\"link\",\"0\",{\"rel\":\"manifest\",\"href\":\"/manifest.webmanifest\",\"crossOrigin\":\"$undefined\"}]]\n"])</script></body></html>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"24D8lqv7JUoA8LsDU3KCSBk7D0+89E0jmp04IeTnbEY=\"\n}"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,534710,e=>{"use strict";var t=e.i(843476),a=e.i(551757),s=e.i(452330),n=e.i(634398),r=e.i(758925),i=e.i(825398),l=e.i(856522),o=e.i(584026),d=e.i(573474),c=e.i(594831),u=e.i(725981),p=e.i(861745),m=e.i(948148),x=e.i(271645),h=e.i(340953),g=e.i(567745),f=e.i(77071),j=e.i(929592),b=e.i(487486),v=e.i(519455),S=e.i(515288),C=e.i(793479),y=e.i(110204),k=e.i(987968),N=e.i(637611);let w=`query CredentialStoreWritability {
|
|
2
|
+
credentialStoreStatus { readOnly }
|
|
3
|
+
}`,E=null;function I(){let[e,t]=(0,x.useState)(E??!1);return(0,x.useEffect)(()=>{if(null!==E)return;let e=!1;return(0,N.controlPlaneRequest)(w).then(a=>{E=a.credentialStoreStatus.readOnly,e||t(E)}).catch(()=>{}),()=>{e=!0}},[]),e}var A=e.i(45407);function D(){let e=(0,m.useTranslations)("cacheServerSettings"),s=(0,m.useTranslations)("common"),n=(0,m.useTranslations)("credentials"),r=I(),[i,o]=(0,x.useState)(null),[u,p]=(0,x.useState)(""),[w,E]=(0,x.useState)(""),[D,T]=(0,x.useState)([]),[L,P]=(0,x.useState)(!0),[R,q]=(0,x.useState)(!1),[H,K]=(0,x.useState)(null),[$,F]=(0,x.useState)(null),B=(0,x.useCallback)(e=>{o(e),p(e.baseUrl??""),E(""),T(e.headers.map(e=>({...e,value:""})))},[]),U=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} } }`);B(e.cacheServerSettings)}catch(e){K(e instanceof Error?e.message:String(e))}finally{P(!1)}},[B]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void U(),0);return()=>window.clearTimeout(e)},[U]);let V=(e,t,a)=>T(s=>s.map((s,n)=>n===e?{...s,[t]:a,..."name"===t&&a!==s.name?{valueConfigured:!1}:{}}:s)),W=async t=>{t.preventDefault(),q(!0);try{let t=D.map(e=>({name:e.name.trim(),value:e.value||null})).filter(e=>e.name),a=await (0,N.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
|
|
4
|
+
saveCacheServerSettings(input: $input) { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
5
|
+
}`,{input:{baseUrl:u.trim(),apiKey:w||null,headers:t}});B(a.saveCacheServerSettings),K(null),F(e("saved"))}catch(e){K(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}},O=async()=>{q(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation TestCacheServerConnection {
|
|
6
|
+
testCacheServerConnection { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
7
|
+
}`);B(t.testCacheServerConnection),K(null),F(e("connectionSucceeded"))}catch(e){K(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}},G=async()=>{q(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation ClearCacheServerSettings {
|
|
8
|
+
clearCacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
|
|
9
|
+
}`);B(t.clearCacheServerSettings),K(null),F(e("removed"))}catch(e){K(e instanceof Error?e.message:String(e)),F(null)}finally{q(!1)}};return(0,t.jsx)("form",{onSubmit:W,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(g.DatabaseZap,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:i?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:i?.configured?e("configured"):e("notConfigured")})]}),L?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[H&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:H})}),$&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:$})]}),(0,t.jsx)("p",{className:"rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground",children:e("setupHelp")}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:e("baseUrl")}),(0,t.jsx)(C.Input,{autoComplete:"url",id:"cache-server-base-url",disabled:r,onChange:e=>p(e.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:u}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("baseUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:e("apiKey")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:r,id:"cache-server-api-key",onChange:e=>E(e.target.value),placeholder:i?.apiKeyConfigured?e("apiKeyPlaceholderConfigured"):e("apiKeyPlaceholder"),required:!i?.apiKeyConfigured&&!r,type:"password",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?n("readOnlyNotice"):i?.apiKeyConfigured?e("apiKeyKeepHelp"):e("apiKeyHelp")})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(y.Label,{className:"text-sm font-medium",children:e("headers")}),(0,t.jsxs)(v.Button,{disabled:r,onClick:()=>T(e=>[...e,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,t.jsx)(f.Plus,{}),e("addHeader")]})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersHelp")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("headersSetupHelp")}),0===D.length?(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("noHeaders")}):(0,t.jsx)("div",{className:"space-y-2",children:D.map((a,s)=>(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Input,{"aria-label":e("headerName"),disabled:r,className:"flex-1",onChange:e=>V(s,"name",e.target.value),placeholder:e("headerName"),value:a.name}),(0,t.jsx)(C.Input,{"aria-label":e("headerValue"),autoComplete:"new-password",className:"flex-1",disabled:r,onChange:e=>V(s,"value",e.target.value),placeholder:a.valueConfigured?e("headerValuePlaceholderConfigured"):e("headerValue"),required:!a.valueConfigured&&!r,type:"password",value:a.value}),(0,t.jsx)(v.Button,{"aria-label":e("removeHeader"),disabled:r,onClick:()=>T(e=>e.filter((e,t)=>t!==s)),size:"icon",type:"button",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})]},s))})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:G,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:R||!i?.configured||r,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:R||!i?.configured,onClick:()=>void O(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:R||r,type:"submit",children:[R?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}var T=e.i(636162),L=e.i(741120),P=e.i(482022);function R({children:e,href:a}){return(0,t.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:a,rel:"noreferrer",target:"_blank",children:[e,(0,t.jsx)(P.ExternalLink,{"aria-hidden":"true",className:"size-3 shrink-0"})]})}var q=e.i(624687),H=e.i(360583),K=e.i(938882);function $(){let e=(0,m.useTranslations)("iosDeviceSettings"),s=(0,m.useTranslations)("common"),n=(0,p.useLocale)(),i=I(),[c,g]=(0,x.useState)(null),[f,w]=(0,x.useState)(""),[E,A]=(0,x.useState)(""),[D,P]=(0,x.useState)(""),[$,F]=(0,x.useState)(""),[B,U]=(0,x.useState)(""),[V,W]=(0,x.useState)(!1),[O,G]=(0,x.useState)(!0),[_,z]=(0,x.useState)(!1),[J,M]=(0,x.useState)(!1),[Y,Z]=(0,x.useState)(null),[X,Q]=(0,x.useState)(null),ee=(0,x.useCallback)(e=>{g(e),w(e.organizationName),A(e.profileIdentifier),P(e.appStoreConnectIssuerId??""),F(e.appStoreConnectKeyId??""),U("")},[]),et=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query IosDeviceSettings {
|
|
10
|
+
iosDeviceSettings { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
11
|
+
}`);ee(e.iosDeviceSettings)}catch(e){Z(e instanceof Error?e.message:String(e))}finally{G(!1)}},[ee]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void et(),0);return()=>window.clearTimeout(e)},[et]);let ea=t=>(0,H.formatDateValue)(t,"short",{locale:n,fallback:e("unavailable")}),es=async t=>{t.preventDefault(),z(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
|
|
12
|
+
saveIosProfileSettings(input: $input) { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
13
|
+
}`,{input:{organizationName:f,profileIdentifier:E}});ee(t.saveIosProfileSettings),Z(null),Q(e("profileSaved"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{z(!1)}},en=async()=>{z(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
|
|
14
|
+
regenerateIosProfileSigner { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
15
|
+
}`);ee(t.regenerateIosProfileSigner),Z(null),Q(e("signerRegenerated"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{z(!1)}},er=async t=>{t.preventDefault(),M(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
|
|
16
|
+
saveAppStoreConnectSettings(input: $input) { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
17
|
+
}`,{input:{issuerId:D.trim(),keyId:$.trim(),privateKey:B||null}});ee(t.saveAppStoreConnectSettings),Z(null),Q(e("appleSaved"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{M(!1)}},ei=async()=>{M(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
|
|
18
|
+
testAppStoreConnectSettings { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
19
|
+
}`);ee(t.testAppStoreConnectSettings),Z(null),Q(e("appleTestSucceeded"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null),et()}finally{M(!1)}},el=async()=>{M(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
|
|
20
|
+
clearAppStoreConnectSettings { ${K.IOS_DEVICE_SETTINGS_FIELDS} }
|
|
21
|
+
}`);ee(t.clearAppStoreConnectSettings),Z(null),Q(e("appleCleared"))}catch(e){Z(e instanceof Error?e.message:String(e)),Q(null)}finally{M(!1)}},eo=async t=>{if(!t.name.toLowerCase().endsWith(".p8")){Z(e("p8Invalid")),Q(null);return}try{let a=await t.text();if(!a.includes("-----BEGIN PRIVATE KEY-----")||!a.includes("-----END PRIVATE KEY-----")){Z(e("p8Invalid")),Q(null);return}U(a),Z(null),Q(e("p8Loaded",{filename:t.name}))}catch{Z(e("p8ReadError")),Q(null)}};return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(T.Apple,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),Y&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:Y})}),X&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:X})]}),O?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("form",{className:"space-y-4",onSubmit:es,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-4"})," ",e("profileTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("profileDescription")})]}),(0,t.jsx)(b.Badge,{variant:"outline",children:c?.signerConfigured?e("signerReady"):e("signerNotGenerated")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-organization-name",children:e("organizationName")}),(0,t.jsx)(C.Input,{id:"ios-organization-name",maxLength:100,onChange:e=>w(e.target.value),required:!0,value:f}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileOrganizationHelp")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"ios-profile-identifier",children:e("profileIdentifier")}),(0,t.jsx)(C.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:e=>A(e.target.value),required:!0,spellCheck:!1,value:E}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("profileIdentifierHelp")})]})]}),c?.signerConfigured&&(0,t.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,t.jsx)("p",{children:e("signerCreated",{date:ea(c.signerCreatedAt)})}),(0,t.jsx)("p",{children:e("signerExpires",{date:ea(c.signerExpiresAt)})}),(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:c.signerFingerprint}),(0,t.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:e("unverifiedWarning")})]}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("regenerateSigner"),cancelLabel:s("cancel"),description:e("regenerateDescription"),onConfirm:en,title:e("regenerateTitle"),trigger:(0,t.jsxs)(v.Button,{disabled:_,type:"button",variant:"outline",children:[(0,t.jsx)(L.RefreshCw,{})," ",e("regenerateSigner")]})}),(0,t.jsxs)(v.Button,{disabled:_,type:"submit",children:[_?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveProfile")]})]})]}),(0,t.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:er,children:[(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,t.jsxs)("div",{children:[(0,t.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,t.jsx)(r.KeyRound,{className:"size-4"})," ",e("appleTitle")]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("appleDescription")})]}),(0,t.jsx)(b.Badge,{className:c?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:c?.appStoreConnectConfigured?e("verified"):e("notVerified")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("p",{className:"sm:col-span-2 text-xs text-muted-foreground",children:[e("appleSetupHelp")," ",(0,t.jsx)(R,{href:"https://appstoreconnect.apple.com/access/integrations/api",children:e("openApiKeys")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-issuer-id",children:e("issuerId")}),(0,t.jsx)(C.Input,{autoCapitalize:"none",id:"app-store-issuer-id",disabled:i,maxLength:100,onChange:e=>P(e.target.value),required:!0,spellCheck:!1,value:D})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-key-id",children:e("keyId")}),(0,t.jsx)(C.Input,{autoCapitalize:"characters",id:"app-store-key-id",disabled:i,maxLength:100,onChange:e=>F(e.target.value),required:!0,spellCheck:!1,value:$})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"app-store-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${V?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),W(!0)},onDragLeave:()=>W(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",W(!0)},onDrop:e=>{if(e.preventDefault(),W(!1),i)return;let t=e.dataTransfer.files.item(0);t&&eo(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"})," ",e("p8DropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",id:"app-store-private-key",disabled:i,onChange:e=>U(e.target.value),placeholder:c?.appStoreConnectPrivateKeyConfigured?e("privateKeyConfiguredPlaceholder"):e("privateKeyPlaceholder"),required:!c?.appStoreConnectPrivateKeyConfigured&&!i,value:B}),(0,t.jsx)(C.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":e("chooseP8"),disabled:i,className:"mt-2 h-auto text-xs",onChange:e=>{let t=e.target.files?.item(0);t&&eo(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c?.appStoreConnectPrivateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),(c?.appStoreConnectLastTestedAt||c?.appStoreConnectPrivateKeyFingerprint)&&(0,t.jsx)(j.Alert,{variant:c.appStoreConnectVerificationError?"destructive":"default",children:(0,t.jsxs)(j.AlertDescription,{children:[(0,t.jsx)("p",{className:"font-medium",children:c.appStoreConnectVerificationError?e("lastTestFailed",{date:ea(c.appStoreConnectLastTestedAt)}):e("lastVerified",{date:ea(c.appStoreConnectVerifiedAt)})}),c.appStoreConnectVerificationError&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:c.appStoreConnectVerificationError}),c.appStoreConnectPrivateKeyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:c.appStoreConnectPrivateKeyFingerprint})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("clear"),cancelLabel:s("cancel"),description:e("clearDescription"),onConfirm:el,title:e("clearTitle"),trigger:(0,t.jsxs)(v.Button,{disabled:J||!c?.appStoreConnectPrivateKeyConfigured||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("clear")]})}),(0,t.jsxs)(v.Button,{disabled:J||!c?.appStoreConnectPrivateKeyConfigured,onClick:()=>void ei(),type:"button",variant:"outline",children:[(0,t.jsx)(L.RefreshCw,{})," ",e("retest")]}),(0,t.jsxs)(v.Button,{disabled:J||i,type:"submit",children:[J?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("saveAndVerify")]})]})]})]})]})})}var F=e.i(967489);let B=`
|
|
22
|
+
tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
|
|
23
|
+
tokenConfiguredAt tokenLastUsedAt tokenLastError
|
|
24
|
+
certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
|
|
25
|
+
`;function U(){let e=(0,m.useTranslations)("pushSettings"),s=(0,m.useTranslations)("common"),n=(0,m.useTranslations)("credentials"),i=I(),o=(0,p.useLocale)(),[c,g]=(0,x.useState)(null),[f,w]=(0,x.useState)(""),[E,A]=(0,x.useState)(""),[D,T]=(0,x.useState)(""),[P,K]=(0,x.useState)(!1),[$,U]=(0,x.useState)(""),[V,W]=(0,x.useState)(""),[O,G]=(0,x.useState)("SANDBOX"),[_,z]=(0,x.useState)(""),[J,M]=(0,x.useState)(""),[Y,Z]=(0,x.useState)(!1),[X,Q]=(0,x.useState)(""),[ee,et]=(0,x.useState)(!1),[ea,es]=(0,x.useState)(null),[en,er]=(0,x.useState)(null),ei=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${B} } }`);g(e.pushNotificationSettings),w(e.pushNotificationSettings.tokenTeamId??""),A(e.pushNotificationSettings.tokenKeyId??"")}catch(e){es(e instanceof Error?e.message:String(e))}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void ei(),0);return()=>window.clearTimeout(e)},[ei]);let el=e=>(0,H.formatDateValue)(e,"short",{locale:o}),eo=async t=>{t.preventDefault(),et(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${B} } }`,{input:{teamId:f,keyId:E,privateKey:D||null}});g(t.saveApnsTokenSettings),T(""),es(null),er(e("tokenSaved"))}catch(e){es(e instanceof Error?e.message:String(e)),er(null)}finally{et(!1)}},ed=async t=>{if(!t.name.toLowerCase().endsWith(".p8")){es(e("p8Invalid")),er(null);return}try{let a=await t.text();if(!a.includes("-----BEGIN PRIVATE KEY-----")||!a.includes("-----END PRIVATE KEY-----")){es(e("p8Invalid")),er(null);return}T(a),es(null),er(e("p8Loaded",{filename:t.name}))}catch{es(e("p8ReadError")),er(null)}},ec=async t=>{let a=t.name.toLowerCase();if(!a.endsWith(".p12")&&!a.endsWith(".pfx")){es(e("p12Invalid")),er(null);return}try{z(await new Promise((e,a)=>{let s=new FileReader;s.onerror=()=>a(s.error),s.onload=()=>e(String(s.result).split(",")[1]??""),s.readAsDataURL(t)})),M(t.name),es(null),er(e("p12Loaded",{filename:t.name}))}catch{es(e("p12ReadError")),er(null)}},eu=async t=>{t.preventDefault(),et(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${B} } }`,{input:{name:$,topic:V,environment:O,p12Base64:_,passphrase:X}});g(t.addApnsCertificateCredential),U(""),W(""),z(""),M(""),Q(""),es(null),er(e("certificateAdded"))}catch(e){es(e instanceof Error?e.message:String(e)),er(null)}finally{et(!1)}};return(0,t.jsxs)(S.Card,{children:[(0,t.jsx)(S.CardHeader,{children:(0,t.jsx)(S.CardTitle,{children:e("title")})}),(0,t.jsxs)(S.CardContent,{className:"space-y-6",children:[ea&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:ea})}),en&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:en})]}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:eo,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("tokenAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("tokenDescription")})]}),(0,t.jsx)(b.Badge,{variant:c?.tokenConfigured?"default":"secondary",children:c?.tokenConfigured?e("configured"):e("notConfigured")})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("tokenSetupHelp")," ",(0,t.jsx)(R,{href:"https://developer.apple.com/account/resources/authkeys/add",children:e("createTokenKey")})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-team",children:e("teamId")}),(0,t.jsx)(C.Input,{disabled:i,id:"apns-team",onChange:e=>w(e.target.value),value:f})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-key",children:e("keyId")}),(0,t.jsx)(C.Input,{disabled:i,id:"apns-key",onChange:e=>A(e.target.value),value:E})]})]}),(0,t.jsxs)("p",{className:"text-xs text-muted-foreground",children:[e("teamIdHelp")," ",(0,t.jsx)(R,{href:"https://developer.apple.com/account#MembershipDetailsCard",children:e("openMembership")})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${P?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),K(!0)},onDragLeave:()=>K(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",K(!0)},onDrop:e=>{if(e.preventDefault(),K(!1),i)return;let t=e.dataTransfer.files.item(0);t&&ed(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"})," ",i?n("readOnlyNotice"):e("p8DropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:i,id:"apns-private-key",onChange:e=>T(e.target.value),placeholder:c?.tokenConfigured?e("privateKeyConfiguredPlaceholder"):e("privateKeyPlaceholder"),required:!c?.tokenConfigured&&!i,value:D}),(0,t.jsx)(C.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":e("chooseP8"),className:"mt-2 h-auto text-xs",disabled:i,onChange:e=>{let t=e.target.files?.item(0);t&&ed(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:c?.tokenConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),(c?.tokenConfiguredAt||c?.tokenPrivateKeyFingerprint||c?.tokenLastError)&&(0,t.jsx)(j.Alert,{variant:c.tokenLastError?"destructive":"default",children:(0,t.jsxs)(j.AlertDescription,{children:[c.tokenConfiguredAt&&(0,t.jsx)("p",{className:"font-medium",children:e("tokenConfiguredOn",{date:el(c.tokenConfiguredAt)})}),c.tokenLastUsedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("tokenLastUsed",{date:el(c.tokenLastUsedAt)})}),c.tokenLastError&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:c.tokenLastError}),c.tokenPrivateKeyFingerprint&&(0,t.jsxs)("p",{className:"mt-1 break-all font-mono text-xs",children:["SHA-256 ",c.tokenPrivateKeyFingerprint]})]})}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("removeTokenDescription"),onConfirm:async()=>{g((await (0,N.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${B} } }`)).clearApnsTokenSettings),w(""),A(""),T(""),es(null),er(e("tokenRemoved"))},title:e("removeToken"),trigger:(0,t.jsxs)(v.Button,{disabled:ee||!c?.tokenConfigured||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{})," ",e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:ee||!f||!E||!D&&!c?.tokenConfigured||i,type:"submit",children:[ee?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]}),(0,t.jsx)("div",{className:"border-t"}),(0,t.jsxs)("form",{className:"space-y-4",onSubmit:eu,children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"font-medium",children:e("certificateAuthentication")}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("certificateDescription")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("certificateSetupHelp")," ",(0,t.jsx)(R,{href:"https://developer.apple.com/account/resources/certificates/add",children:e("createCertificate")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-certificate-name",children:e("name")}),(0,t.jsx)(C.Input,{disabled:i,id:"apns-certificate-name",onChange:e=>U(e.target.value),value:$})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-certificate-topic",children:e("topic")}),(0,t.jsx)(C.Input,{disabled:i,id:"apns-certificate-topic",onChange:e=>W(e.target.value),value:V})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-certificate-environment",children:e("environment")}),(0,t.jsxs)(F.Select,{disabled:i,onValueChange:G,value:O,children:[(0,t.jsx)(F.SelectTrigger,{id:"apns-certificate-environment",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsxs)(F.SelectContent,{children:[(0,t.jsx)(F.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,t.jsx)(F.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,t.jsxs)("div",{className:"space-y-1.5",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-certificate-bundle",children:e("certificate")}),(0,t.jsxs)("div",{"aria-label":e("p12DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${Y?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),Z(!0)},onDragLeave:()=>Z(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",Z(!0)},onDrop:e=>{if(e.preventDefault(),Z(!1),i)return;let t=e.dataTransfer.files.item(0);t&&ec(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(r.KeyRound,{className:"size-3.5"})," ",i?n("readOnlyNotice"):J?e("p12Selected",{filename:J}):e("p12DropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-36 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:i,id:"apns-certificate-bundle",onChange:e=>{z(e.target.value.trim()),M("")},placeholder:e("p12Placeholder"),required:!i,value:_}),(0,t.jsx)(C.Input,{accept:".p12,.pfx,application/x-pkcs12","aria-label":e("chooseP12"),className:"mt-2 h-auto text-xs",disabled:i,onChange:e=>{let t=e.target.files?.item(0);t&&ec(t),e.target.value=""},type:"file"})]}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("certificateHelp")})]}),(0,t.jsxs)("div",{className:"space-y-2 sm:max-w-sm",children:[(0,t.jsx)(y.Label,{htmlFor:"apns-certificate-passphrase",children:e("passphrase")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:i,id:"apns-certificate-passphrase",onChange:e=>Q(e.target.value),type:"password",value:X})]}),(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(v.Button,{disabled:ee||!$||!V||!_||i,type:"submit",children:[ee?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("addCertificate")]})})]}),c?.certificates.map(a=>(0,t.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3 rounded-xl border p-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:a.name}),(0,t.jsxs)("p",{className:"font-mono text-xs",children:[a.topic," · ",a.environment]}),(0,t.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",a.fingerprint]}),a.expiresAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("expires",{date:(0,H.formatDateValue)(a.expiresAt,"short",{locale:o,showTime:!1})})}),a.lastTestedAt&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("lastTested",{date:(0,H.formatDateValue)(a.lastTestedAt,"short",{locale:o})})}),a.lastError&&(0,t.jsx)("p",{className:"text-xs text-destructive",children:a.lastError})]}),(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsxs)(v.Button,{disabled:ee,onClick:()=>void(async()=>{et(!0);try{let e=await (0,N.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${B} } }`,{id:a.id});g(e.retestApnsCertificateCredential),es(null)}catch(e){es(e instanceof Error?e.message:String(e)),await ei()}finally{et(!1)}})(),size:"sm",variant:"outline",children:[(0,t.jsx)(L.RefreshCw,{})," ",e("retest")]}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("removeCertificateDescription"),onConfirm:async()=>{await (0,N.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:a.id}),await ei()},title:e("removeCertificate"),trigger:(0,t.jsx)(v.Button,{disabled:i,size:"icon-sm",variant:"ghost",children:(0,t.jsx)(d.Trash2,{})})})]})]},a.id))]})]})}var V=e.i(508734),W=e.i(799835),O=e.i(520133);let G="siteUrl email tokenConfigured cacheTtlSeconds updatedAt",_="enabled secretConfigured registered registrationId registeredUrl jql configuredAt lastReceivedAt lastOutcome lastError";function z({label:e,value:s,copyLabel:n,copiedLabel:r,help:i,mono:l=!1}){let[o,d]=(0,x.useState)(!1),c=async()=>{try{await navigator.clipboard.writeText(s),d(!0),window.setTimeout(()=>d(!1),2e3)}catch{}};return(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",children:e}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(C.Input,{className:l?"font-mono text-xs":void 0,onFocus:e=>e.target.select(),readOnly:!0,value:s}),(0,t.jsxs)(v.Button,{onClick:()=>void c(),type:"button",variant:"outline",children:[o?(0,t.jsx)(a.CheckCircle2,{}):(0,t.jsx)(V.Copy,{}),o?r:n]})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i})]})}function J(){let e=(0,m.useTranslations)("jiraSettings"),s=(0,m.useTranslations)("common"),n=(0,p.useLocale)(),i=I(),[l,o]=(0,x.useState)(null),[c,u]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,E]=(0,x.useState)(""),[A,D]=(0,x.useState)(!1),[T,P]=(0,x.useState)(null),[q,K]=(0,x.useState)(null),$=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query { jiraWebhookSettings { ${_} } }`);o(e.jiraWebhookSettings),e.jiraWebhookSettings.registeredUrl&&f(e.jiraWebhookSettings.registeredUrl),E(e.jiraWebhookSettings.jql??"")}catch(e){P(e instanceof Error?e.message:String(e))}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{f(`${window.location.origin.replace(/\/$/,"")}/api/public/jira/webhook`),$()},0);return()=>window.clearTimeout(e)},[$]),(0,x.useEffect)(()=>{let e=(0,N.controlPlaneSubscriptions)().subscribe({query:"subscription { jiraWebhookDeliveryChanged { deliveryId } }"},{next:()=>void $(),error:()=>void 0,complete:()=>void 0});return()=>e()},[$]);let F=async(e,t,a,s)=>{D(!0);try{let n=(await (0,N.controlPlaneRequest)(e,s))[t];o(n.settings),u(n.secret),P(null),K(a)}catch(e){P(e instanceof Error?e.message:String(e)),K(null)}finally{D(!1)}},B=async()=>{D(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation { disableJiraWebhook { ${_} } }`);o(t.disableJiraWebhook),u(null),P(null),K(e("webhookDisabled"))}catch(e){P(e instanceof Error?e.message:String(e)),K(null)}finally{D(!1)}},U=l?.secretConfigured??!1,V=l?.registered??!1;return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(W.Webhook,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:e("webhookTitle")})]}),(0,t.jsx)(b.Badge,{className:U?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:V?e("webhookRegistered"):U?e("webhookConfigured"):e("webhookNotConfigured")})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e("webhookDescription")}),T&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:T})}),q&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:q})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-url",children:e("webhookUrl")}),(0,t.jsx)(C.Input,{disabled:A||i,id:"jira-webhook-url",onChange:e=>f(e.target.value),value:g}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-webhook-jql",children:e("webhookJql")}),(0,t.jsx)(C.Input,{disabled:A||i,id:"jira-webhook-jql",onChange:e=>E(e.target.value),placeholder:"project in (ABC, XYZ)",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookJqlHelp")})]}),c&&!V?(0,t.jsx)(z,{copiedLabel:e("copied"),copyLabel:e("copy"),help:e("webhookSecretHelp"),label:e("webhookSecret"),mono:!0,value:c}):(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",children:e("webhookSecret")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:V?e("webhookSecretRegistered"):U?e("webhookSecretHelp"):e("webhookSecretPending")})]}),V?(0,t.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("webhookRegisteredAs",{id:l?.registrationId??"—"})}),(0,t.jsx)("p",{className:"mt-2",children:(0,t.jsx)(R,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:e("webhookDocs")})})]}):(0,t.jsxs)("div",{className:"rounded-md border bg-muted/40 p-3 text-xs",children:[(0,t.jsx)("p",{className:"mb-2 font-medium",children:e("setupTitle")}),(0,t.jsx)("p",{className:"mb-2 text-muted-foreground",children:e("manualIntro")}),(0,t.jsxs)("ol",{className:"list-decimal space-y-1 pl-4 text-muted-foreground",children:[(0,t.jsx)("li",{children:e("setupStep1")}),(0,t.jsx)("li",{children:e("setupStep2")}),(0,t.jsx)("li",{children:e("setupStep3",{events:"jira:issue_created, jira:issue_updated, jira:issue_deleted, comment_created, worklog_created, attachment_created, issuelink_created, sprint_started, sprint_closed"})}),(0,t.jsx)("li",{children:e("setupStep4",{jql:"project in (ABC, XYZ)"})})]}),(0,t.jsx)("p",{className:"mt-2",children:(0,t.jsx)(R,{href:"https://developer.atlassian.com/cloud/jira/platform/webhooks/",children:e("webhookDocs")})})]}),l?.lastReceivedAt&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("lastWebhook",{date:(0,H.formatDateValue)(l.lastReceivedAt,"short",{locale:n}),outcome:l.lastOutcome??"—"})}),l.lastError&&(0,t.jsx)("p",{className:"mt-1 text-destructive",children:l.lastError})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[U&&(0,t.jsx)(v.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,t.jsx)(O.Link,{href:"/jira-webhooks",children:e("viewDeliveries")})}),U&&(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("disableWebhook"),cancelLabel:s("cancel"),description:e("confirmDisableDescription"),onConfirm:B,title:e("confirmDisable"),trigger:(0,t.jsxs)(v.Button,{disabled:A||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("disableWebhook")]})}),U&&(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("rotateWebhook"),cancelLabel:s("cancel"),description:V?e("confirmRotateRegisteredDescription"):e("confirmRotateDescription"),onConfirm:()=>F(`mutation { rotateJiraWebhookSecret { secret settings { ${_} } } }`,"rotateJiraWebhookSecret",V?e("webhookRotatedInJira"):e("webhookRotated")),title:e("confirmRotate"),trigger:(0,t.jsxs)(v.Button,{disabled:A||i,type:"button",variant:"ghost",children:[A?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(L.RefreshCw,{}),e("rotateWebhook")]})}),!U&&(0,t.jsxs)(v.Button,{disabled:A||i,onClick:()=>void F(`mutation { enableJiraWebhook { secret settings { ${_} } } }`,"enableJiraWebhook",e("webhookEnabled")),type:"button",variant:"outline",children:[A?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(r.KeyRound,{}),e("enableWebhook")]}),(0,t.jsxs)(v.Button,{disabled:A||i||!g.trim(),onClick:()=>void F(`mutation Register($input: RegisterJiraWebhookInput!) { registerJiraWebhook(input: $input) { secret settings { ${_} } } }`,"registerJiraWebhook",V?e("webhookReregistered"):e("webhookRegisteredNotice"),{input:{url:g,jql:w.trim()||null}}),type:"button",children:[A?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(W.Webhook,{}),V?e("updateRegistration"):e("registerWebhook")]})]})]})})}function M({embedded:e=!1}={}){let s=(0,m.useTranslations)("jiraSettings"),n=(0,m.useTranslations)("common"),i=(0,m.useTranslations)("credentials"),o=I(),[u,p]=(0,x.useState)(null),[g,f]=(0,x.useState)(""),[w,E]=(0,x.useState)(""),[A,D]=(0,x.useState)(""),[T,L]=(0,x.useState)(null),[P,q]=(0,x.useState)(!0),[H,K]=(0,x.useState)(!1),[$,F]=(0,x.useState)(null),[B,U]=(0,x.useState)(null),[V,W]=(0,x.useState)(!1),O=e=>{p(e),f(e.siteUrl??""),E(e.email??""),D("")},_=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query { jiraSettings { ${G} } }`);O(e.jiraSettings)}catch(e){F(e instanceof Error?e.message:String(e))}finally{q(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void _(),0);return()=>window.clearTimeout(e)},[_]);let z=async e=>{K(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${G} } }`,{input:{siteUrl:g,email:w,apiToken:A||null,resetSite:e}});O(t.saveJiraSettings),L(null),F(null),U(s("saved"))}catch(e){F(e instanceof Error?e.message:String(e)),U(null)}finally{K(!1)}},Y=async()=>{K(!0);try{let e=await (0,N.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");L(e.testJiraConnection),F(null),U(s("connectionSucceeded"))}catch(e){L(null),F(e instanceof Error?e.message:String(e)),U(null)}finally{K(!1)}},Z=async()=>{K(!0);try{let e=await (0,N.controlPlaneRequest)(`mutation { clearJiraCredentials { ${G} } }`);O(e.clearJiraCredentials),L(null),F(null),U(s("removed"))}catch(e){F(e instanceof Error?e.message:String(e))}finally{K(!1)}};return(0,t.jsxs)("section",{className:e?"flex w-full flex-col gap-6":"mx-auto flex w-full max-w-3xl flex-col gap-6",children:[!e&&(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:s("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:s("description")})]}),P?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),s("loading")]}):(0,t.jsx)("form",{onSubmit:e=>{(e.preventDefault(),u?.siteUrl&&u.siteUrl!==g.trim().replace(/\/$/,""))?W(!0):z(!1)},children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(r.KeyRound,{className:"size-5"}),(0,t.jsx)("h2",{className:"font-semibold",children:s("credentials")})]}),(0,t.jsx)(b.Badge,{className:u?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:u?.tokenConfigured?s("configured"):s("notConfigured")})]}),$&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:$})}),B&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:B})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:s("siteUrl")}),(0,t.jsx)(C.Input,{autoComplete:"url",id:"jira-site-url",disabled:o,onChange:e=>f(e.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:g}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("siteUrlHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:s("email")}),(0,t.jsx)(C.Input,{autoComplete:"username",id:"jira-email",disabled:o,onChange:e=>E(e.target.value),required:!0,type:"email",value:w}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:s("accountHelp")})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:s("apiToken")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:o,id:"jira-token",onChange:e=>D(e.target.value),placeholder:u?.tokenConfigured?s("tokenPlaceholderConfigured"):s("tokenPlaceholder"),required:!u?.tokenConfigured&&!o,type:"password",value:A}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:o?i("readOnlyNotice"):u?.tokenConfigured?s("tokenKeepHelp"):s("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[s("tokenAcquireHelp")," ",(0,t.jsx)(R,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:s("createToken")})]})]}),T&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:T.displayName}),(0,t.jsx)("p",{className:"text-muted-foreground",children:T.emailAddress??T.accountId})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:s("remove"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:Z,title:s("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:H||!u?.tokenConfigured||o,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),s("remove")]})}),(0,t.jsxs)(v.Button,{disabled:H||!u?.tokenConfigured,onClick:()=>void Y(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),s("test")]}),(0,t.jsxs)(v.Button,{disabled:H||o,type:"submit",children:[H?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{}),s("save")]})]})]})})}),!P&&u?.tokenConfigured&&(0,t.jsx)(J,{}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:n("continue"),cancelLabel:n("cancel"),description:n("cannotBeUndone"),onConfirm:()=>z(!0),onOpenChange:W,open:V,title:s("confirmSiteChange")})]})}var Y=e.i(468096),Z=e.i(257428);let X="tokenConfigured defaultJiraKeyRegex actionsNotificationPollIntervalSeconds cacheTtlSeconds updatedAt",Q="configured appId installationId privateKeyConfigured keyFingerprint appSlug appOwnerLogin appOwnerType accountLogin repositorySelection actionsPermission checksPermission commitStatusesPermission webhookEvents enhancedPipelineWebhooksEnabled enhancedPipelineWebhooksReady enhancedPipelineWebhooksMissing verifiedAt webhookConfigured webhookUrl webhookConfiguredAt webhookLastReceivedAt webhookLastOutcome webhookLastError updatedAt";function ee(e){if(!e?.appSlug)return null;let t=encodeURIComponent(e.appSlug);if("User"===e.appOwnerType)return`https://github.com/settings/apps/${t}`;if(!e.appOwnerLogin)return null;let a=encodeURIComponent(e.appOwnerLogin);return"Organization"===e.appOwnerType?`https://github.com/organizations/${a}/settings/apps/${t}`:"Enterprise"===e.appOwnerType?`https://github.com/enterprises/${a}/settings/apps/${t}`:null}function et({children:e,description:a,id:s,title:n}){return(0,t.jsxs)("section",{"aria-labelledby":s,className:"min-w-0 space-y-4",children:[(0,t.jsxs)("div",{className:"space-y-1 border-b pb-3",children:[(0,t.jsx)("h2",{className:"text-lg font-semibold tracking-tight",id:s,children:n}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:a})]}),(0,t.jsx)("div",{className:"flex min-w-0 flex-col gap-6",children:e})]})}function ea(){let e=(0,m.useTranslations)("editorSettings"),[a,n]=(0,x.useState)("CODE"),[r,i]=(0,x.useState)(!0),[o,d]=(0,x.useState)(!1),[c,u]=(0,x.useState)(null),[p,h]=(0,x.useState)(null);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{(0,N.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(e=>n(e.worktreeSettings.editorVariant)).catch(e=>h(e instanceof Error?e.message:String(e))).finally(()=>i(!1))},0);return()=>window.clearTimeout(e)},[]);let g=async()=>{d(!0);try{await (0,N.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
|
|
26
|
+
saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
|
|
27
|
+
}`,{editorVariant:a}),u(e("saved")),h(null)}catch(e){h(e instanceof Error?e.message:String(e)),u(null)}finally{d(!1)}};return(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-4",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(s.Code2,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),p&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:p})}),c&&(0,t.jsx)(j.Alert,{children:(0,t.jsx)(j.AlertDescription,{children:c})}),r?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{})," ",e("loading")]}):(0,t.jsxs)("div",{className:"flex flex-wrap items-end gap-3",children:[(0,t.jsxs)("div",{className:"min-w-64 flex-1 space-y-2",children:[(0,t.jsx)(y.Label,{htmlFor:"editor-variant",children:e("label")}),(0,t.jsxs)(F.Select,{onValueChange:e=>n(e),value:a,children:[(0,t.jsx)(F.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,t.jsx)(F.SelectValue,{})}),(0,t.jsxs)(F.SelectContent,{children:[(0,t.jsx)(F.SelectItem,{value:"CODE",children:e("code")}),(0,t.jsx)(F.SelectItem,{value:"CODE_INSIDERS",children:e("insiders")}),(0,t.jsx)(F.SelectItem,{value:"NONE",children:e("none")})]})]}),(0,t.jsxs)("div",{className:"space-y-1 text-xs text-muted-foreground",children:[(0,t.jsx)("p",{children:e("setupHelp")}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-x-3 gap-y-1",children:[(0,t.jsx)(R,{href:"https://code.visualstudio.com/download",children:e("downloadCode")}),(0,t.jsx)(R,{href:"https://code.visualstudio.com/insiders/",children:e("downloadInsiders")})]})]})]}),(0,t.jsxs)(v.Button,{disabled:o,onClick:()=>void g(),children:[o?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{})," ",e("save")]})]})]})})}function es(){let e=(0,m.useTranslations)("githubAppSettings"),s=(0,m.useTranslations)("common"),n=(0,p.useLocale)(),g=I(),[f,w]=(0,x.useState)(null),[E,A]=(0,x.useState)(""),[D,T]=(0,x.useState)(""),[L,P]=(0,x.useState)(""),[K,$]=(0,x.useState)(""),[F,B]=(0,x.useState)(""),[U,V]=(0,x.useState)(!1),[W,G]=(0,x.useState)(!1),[_,z]=(0,x.useState)(!1),[J,M]=(0,x.useState)(!0),[Y,X]=(0,x.useState)(!1),[et,ea]=(0,x.useState)(null),[es,en]=(0,x.useState)(null),er=ee(f),ei=!f||(f.enhancedPipelineWebhooksMissing?.length??0)>0,el=(0,x.useCallback)(e=>{w(e),A(e.appId??""),T(e.installationId??""),P(""),B(t=>e.webhookUrl??t),V(!!e.webhookUrl),G(e.enhancedPipelineWebhooksEnabled??!1)},[]),eo=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${Q} } }`);el(e.githubAppSettings)}catch(e){ea(e instanceof Error?e.message:String(e))}finally{M(!1)}},[el]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>{$(window.location.origin),B(`${window.location.origin.replace(/\/$/,"")}/api/public/github/webhook`),eo()},0);return()=>window.clearTimeout(e)},[eo]);let ed=async t=>{t.preventDefault(),X(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
|
|
28
|
+
saveGitHubAppSettings(input: $input) { ${Q} }
|
|
29
|
+
}`,{input:{appId:E.trim(),installationId:D.trim(),privateKey:L||null,...U?{webhookUrl:F.trim()}:{},enhancedPipelineWebhooksEnabled:W}});el(t.saveGitHubAppSettings),ea(null),en(L&&f?.configured?e("rotated"):e("saved"))}catch(e){ea(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},ec=async()=>{X(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation TestGitHubAppConnection {
|
|
30
|
+
testGitHubAppConnection { ${Q} }
|
|
31
|
+
}`);el(t.testGitHubAppConnection),ea(null),en(e("connectionSucceeded"))}catch(e){ea(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},eu=async()=>{X(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
|
|
32
|
+
clearGitHubAppCredentials { ${Q} }
|
|
33
|
+
}`);el(t.clearGitHubAppCredentials),ea(null),en(e("removed"))}catch(e){ea(e instanceof Error?e.message:String(e)),en(null)}finally{X(!1)}},ep=async t=>{if(!t.name.toLowerCase().endsWith(".pem")){ea(e("pemFileInvalid")),en(null);return}try{let a=await t.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(a)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(a)){ea(e("pemFileInvalid")),en(null);return}P(a),ea(null),en(e("pemFileLoaded",{filename:t.name}))}catch{ea(e("pemFileReadError")),en(null)}};return(0,t.jsx)("form",{onSubmit:ed,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.ShieldCheck,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:f?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.configured?e("verified"):e("notConfigured")})]}),J?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[et&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:et})}),es&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:es})]}),(0,t.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,t.jsx)("h3",{className:"font-medium",children:e("setupTitle")}),(0,t.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,t.jsxs)("li",{children:[e("stepRegister")," ",(0,t.jsx)(R,{href:"https://github.com/settings/apps/new",children:e("registerLink")})]}),(0,t.jsxs)("li",{children:[e("stepHomepage")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:K}),e("stepHomepageSuffix")]}),(0,t.jsx)("li",{children:e("stepPermissions")}),(0,t.jsxs)("li",{children:[e("stepWebhook")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:F}),e("stepWebhookSuffix")]}),(0,t.jsx)("li",{children:e("stepInstall")}),(0,t.jsxs)("li",{children:[e("stepInstallationId")," ",(0,t.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:"https://github.com/organizations/<Organization-name>/settings/installations/<ID>"}),e("stepInstallationIdSuffix")]}),(0,t.jsx)("li",{children:e("stepCredentials")})]})]}),(0,t.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:e("appId")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-app-id",inputMode:"numeric",onChange:e=>A(e.target.value),placeholder:e("appIdPlaceholder"),required:!0,value:E})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:e("installationId")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-installation-id",inputMode:"numeric",onChange:e=>T(e.target.value),placeholder:e("installationIdPlaceholder"),required:!0,value:D})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-webhook-url",children:e("webhookUrl")}),(0,t.jsx)(C.Input,{disabled:g,id:"github-app-webhook-url",onChange:e=>{B(e.target.value),V(!0)},placeholder:"https://example.com/api/public/github/webhook",required:!0,type:"url",value:F}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("webhookUrlHelp")})]}),(0,t.jsx)("div",{className:"rounded-lg border p-4",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)(Z.Checkbox,{checked:W,disabled:ei,id:"github-enhanced-pipeline-webhooks",onCheckedChange:e=>G(!0===e)}),(0,t.jsxs)("div",{className:"min-w-0",children:[(0,t.jsx)(y.Label,{className:"font-medium",htmlFor:"github-enhanced-pipeline-webhooks",children:e("enhancedWebhooks")}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("enhancedWebhooksHelp")}),er&&(0,t.jsx)("p",{className:"mt-2 text-xs",children:(0,t.jsx)(R,{href:er,children:e("openAppSettings")})}),f&&!f.enhancedPipelineWebhooksReady&&(f.enhancedPipelineWebhooksMissing?.length??0)>0&&(0,t.jsx)("ul",{className:"mt-2 list-disc space-y-1 pl-5 text-xs text-amber-700 dark:text-amber-300",children:(f.enhancedPipelineWebhooksMissing??[]).map(e=>(0,t.jsx)("li",{children:e},e))})]})]})}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:e("privateKey")}),(0,t.jsxs)("div",{"aria-label":e("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${_?"border-primary bg-primary/5":"border-input"}`,onDragEnter:e=>{e.preventDefault(),z(!0)},onDragLeave:()=>z(!1),onDragOver:e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",z(!0)},onDrop:e=>{if(e.preventDefault(),z(!1),g)return;let t=e.dataTransfer.files.item(0);t&&ep(t)},role:"group",children:[(0,t.jsxs)("p",{className:"mb-2 flex items-center gap-1.5 text-xs text-muted-foreground",children:[(0,t.jsx)(u.Upload,{className:"size-3.5"}),e("pemDropHint")]}),(0,t.jsx)(q.Textarea,{autoComplete:"new-password",className:"min-h-40 border-0 bg-transparent font-mono text-xs shadow-none focus-visible:ring-0 dark:bg-transparent",disabled:g,id:"github-app-private-key",onChange:e=>P(e.target.value),placeholder:f?.privateKeyConfigured?e("privateKeyPlaceholderConfigured"):e("privateKeyPlaceholder"),required:!f?.privateKeyConfigured&&!g,value:L})]}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:f?.privateKeyConfigured?e("privateKeyKeepHelp"):e("privateKeyHelp")})]}),f?.configured&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(r.KeyRound,{}),(0,t.jsxs)(j.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)("p",{className:"font-medium",children:e("connectedAs",{app:f.appSlug??"—",account:f.accountLogin??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("connectionDetails",{permission:f.actionsPermission??"—",selection:f.repositorySelection??"—"})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("pipelinePermissions",{checks:f.checksPermission??"none",statuses:f.commitStatusesPermission??"none"})}),f.verifiedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastVerified",{date:(0,H.formatDateValue)(f.verifiedAt,"short",{locale:n})})}),(0,t.jsx)("p",{className:"mt-1 text-xs",children:f.webhookConfigured?e("webhookConfigured",{url:f.webhookUrl??"—"}):f.webhookUrl?e("webhookNeedsSetup"):e("webhookUnavailable")}),f.webhookLastReceivedAt&&(0,t.jsx)("p",{className:"mt-1 text-xs",children:e("lastWebhook",{date:(0,H.formatDateValue)(f.webhookLastReceivedAt,"short",{locale:n}),outcome:f.webhookLastOutcome??"—"})}),f.webhookLastError&&(0,t.jsx)("p",{className:"mt-1 text-xs text-destructive",children:f.webhookLastError}),f.keyFingerprint&&(0,t.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:f.keyFingerprint})]})]}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t pt-4",children:[f?.webhookConfigured&&(0,t.jsx)(v.Button,{asChild:!0,className:"mr-auto",variant:"link",children:(0,t.jsx)(O.Link,{href:"/webhooks",children:e("viewDeliveries")})}),(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:eu,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:Y||!f?.configured||g,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:Y||!f?.configured,onClick:()=>void ec(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:Y||g&&!f?.configured,type:"submit",children:[Y?(0,t.jsx)(k.Spinner,{}):L&&f?.configured?(0,t.jsx)(i.RotateCw,{}):(0,t.jsx)(l.Save,{}),L&&f?.configured?e("rotate"):e("save")]})]})]})]})})})}function en(){let e=(0,m.useTranslations)("githubSettings"),s=(0,m.useTranslations)("common"),r=(0,m.useTranslations)("credentials"),i=I(),[o,u]=(0,x.useState)(null),[p,g]=(0,x.useState)(""),[f,w]=(0,x.useState)(60),[E,A]=(0,x.useState)(null),[D,T]=(0,x.useState)(!0),[L,P]=(0,x.useState)(!1),[q,H]=(0,x.useState)(null),[K,$]=(0,x.useState)(null),F=e=>{u(e),g(""),w(e.actionsNotificationPollIntervalSeconds)},B=(0,x.useCallback)(async()=>{try{let e=await (0,N.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${X} } }`);F(e.githubSettings)}catch(e){H(e instanceof Error?e.message:String(e))}finally{T(!1)}},[]);(0,x.useEffect)(()=>{let e=window.setTimeout(()=>void B(),0);return()=>window.clearTimeout(e)},[B]);let U=async t=>{t.preventDefault(),P(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
|
|
34
|
+
saveGitHubSettings(input: $input) { ${X} }
|
|
35
|
+
}`,{input:{apiToken:p||null,actionsNotificationPollIntervalSeconds:f}});F(t.saveGitHubSettings),A(null),H(null),$(e("saved"))}catch(e){H(e instanceof Error?e.message:String(e)),$(null)}finally{P(!1)}},V=async()=>{P(!0);try{let t=await (0,N.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");A(t.testGitHubConnection),H(null),$(e("connectionSucceeded"))}catch(e){A(null),H(e instanceof Error?e.message:String(e)),$(null)}finally{P(!1)}},W=async()=>{P(!0);try{let t=await (0,N.controlPlaneRequest)(`mutation ClearGitHubCredentials {
|
|
36
|
+
clearGitHubCredentials { ${X} }
|
|
37
|
+
}`);F(t.clearGitHubCredentials),A(null),H(null),$(e("removed"))}catch(e){H(e instanceof Error?e.message:String(e)),$(null)}finally{P(!1)}};return(0,t.jsx)("form",{onSubmit:U,children:(0,t.jsx)(S.Card,{children:(0,t.jsxs)(S.CardContent,{className:"space-y-5",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(n.GitPullRequest,{className:"size-5"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("h2",{className:"font-semibold",children:e("title")}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:e("description")})]})]}),(0,t.jsx)(b.Badge,{className:o?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:o?.tokenConfigured?e("configured"):e("notConfigured")})]}),D?(0,t.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(k.Spinner,{}),e("loading")]}):(0,t.jsxs)(t.Fragment,{children:[q&&(0,t.jsx)(j.Alert,{variant:"destructive",children:(0,t.jsx)(j.AlertDescription,{children:q})}),K&&(0,t.jsxs)(j.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,t.jsx)(a.CheckCircle2,{}),(0,t.jsx)(j.AlertDescription,{className:"text-current",children:K})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:e("apiToken")}),(0,t.jsx)(C.Input,{autoComplete:"new-password",disabled:i,id:"github-token",onChange:e=>g(e.target.value),placeholder:o?.tokenConfigured?e("tokenPlaceholderConfigured"):e("tokenPlaceholder"),required:!o?.tokenConfigured&&!i,type:"password",value:p}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:i?r("readOnlyNotice"):o?.tokenConfigured?e("tokenKeepHelp"):e("tokenHelp")}),(0,t.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[e("tokenAcquireHelp")," ",(0,t.jsx)(R,{href:"https://github.com/settings/personal-access-tokens/new",children:e("createToken")})]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-actions-poll-interval",children:e("pollInterval")}),(0,t.jsx)(C.Input,{id:"github-actions-poll-interval",max:3600,min:30,onChange:e=>w(Number(e.target.value)),required:!0,type:"number",value:f}),(0,t.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e("pollIntervalHelp")})]}),E&&(0,t.jsx)(j.Alert,{className:"bg-muted",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium",children:E.name??E.login}),(0,t.jsxs)("a",{className:"text-sm text-primary hover:underline",href:E.url,rel:"noreferrer",target:"_blank",children:["@",E.login]})]})}),(0,t.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,t.jsx)(h.ConfirmationDialog,{actionLabel:e("remove"),cancelLabel:s("cancel"),description:e("confirmRemoveDescription"),onConfirm:W,title:e("confirmRemove"),trigger:(0,t.jsxs)(v.Button,{disabled:L||!o?.tokenConfigured||i,type:"button",variant:"ghost",children:[(0,t.jsx)(d.Trash2,{}),e("remove")]})}),(0,t.jsxs)(v.Button,{disabled:L||!o?.tokenConfigured,onClick:()=>void V(),type:"button",variant:"outline",children:[(0,t.jsx)(c.Unplug,{}),e("test")]}),(0,t.jsxs)(v.Button,{disabled:L,type:"submit",children:[L?(0,t.jsx)(k.Spinner,{}):(0,t.jsx)(l.Save,{}),e("save")]})]})]})]})})})}e.s(["SettingsPage",0,function(){let e=(0,m.useTranslations)("settings");return(0,t.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:e("title")}),(0,t.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:e("description")})]}),(0,t.jsx)(Y.DatabaseEncryptionAlert,{}),(0,t.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,t.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,t.jsx)(et,{description:e("developmentGroupDescription"),id:"settings-development",title:e("developmentGroup"),children:(0,t.jsx)(ea,{})}),(0,t.jsxs)(et,{description:e("appleGroupDescription"),id:"settings-apple",title:e("appleGroup"),children:[(0,t.jsx)($,{}),(0,t.jsx)(U,{})]})]}),(0,t.jsx)("div",{className:"min-w-0",children:(0,t.jsxs)(et,{description:e("integrationsGroupDescription"),id:"settings-integrations",title:e("integrationsGroup"),children:[(0,t.jsx)(M,{embedded:!0}),(0,t.jsx)(en,{}),(0,t.jsx)(es,{}),(0,t.jsx)(D,{})]})})]})]})},"githubAppSettingsUrl",0,ee],534710)}]);
|