@ai-development-environment/server 0.0.45 → 0.0.46

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.
Files changed (81) hide show
  1. package/package.json +1 -1
  2. package/standalone/.next/BUILD_ID +1 -1
  3. package/standalone/.next/build-manifest.json +3 -3
  4. package/standalone/.next/prerender-manifest.json +3 -3
  5. package/standalone/.next/server/app/[locale]/actions/page_client-reference-manifest.js +1 -1
  6. package/standalone/.next/server/app/[locale]/actions-cache/page_client-reference-manifest.js +1 -1
  7. package/standalone/.next/server/app/[locale]/agents/[id]/page_client-reference-manifest.js +1 -1
  8. package/standalone/.next/server/app/[locale]/agents/page_client-reference-manifest.js +1 -1
  9. package/standalone/.next/server/app/[locale]/analytics-events/page_client-reference-manifest.js +1 -1
  10. package/standalone/.next/server/app/[locale]/build-data/page_client-reference-manifest.js +1 -1
  11. package/standalone/.next/server/app/[locale]/builds/[buildId]/coverage/page_client-reference-manifest.js +1 -1
  12. package/standalone/.next/server/app/[locale]/builds/[buildId]/page_client-reference-manifest.js +1 -1
  13. package/standalone/.next/server/app/[locale]/builds/page_client-reference-manifest.js +1 -1
  14. package/standalone/.next/server/app/[locale]/codebases/[codebaseId]/page_client-reference-manifest.js +1 -1
  15. package/standalone/.next/server/app/[locale]/codebases/page_client-reference-manifest.js +1 -1
  16. package/standalone/.next/server/app/[locale]/codebases/repositories/[repositoryId]/page_client-reference-manifest.js +1 -1
  17. package/standalone/.next/server/app/[locale]/comments/page_client-reference-manifest.js +1 -1
  18. package/standalone/.next/server/app/[locale]/console-logs/page_client-reference-manifest.js +1 -1
  19. package/standalone/.next/server/app/[locale]/credentials/page_client-reference-manifest.js +1 -1
  20. package/standalone/.next/server/app/[locale]/devices/[id]/page_client-reference-manifest.js +1 -1
  21. package/standalone/.next/server/app/[locale]/devices/enroll/page_client-reference-manifest.js +1 -1
  22. package/standalone/.next/server/app/[locale]/devices/page_client-reference-manifest.js +1 -1
  23. package/standalone/.next/server/app/[locale]/jira/cache/page_client-reference-manifest.js +1 -1
  24. package/standalone/.next/server/app/[locale]/jira/cache/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  25. package/standalone/.next/server/app/[locale]/jira/tickets/[issueKey]/page_client-reference-manifest.js +1 -1
  26. package/standalone/.next/server/app/[locale]/jira/tickets/page_client-reference-manifest.js +1 -1
  27. package/standalone/.next/server/app/[locale]/jobs/[jobId]/page_client-reference-manifest.js +1 -1
  28. package/standalone/.next/server/app/[locale]/notifications/page_client-reference-manifest.js +1 -1
  29. package/standalone/.next/server/app/[locale]/page_client-reference-manifest.js +1 -1
  30. package/standalone/.next/server/app/[locale]/provisioning-profiles/[profileId]/page_client-reference-manifest.js +1 -1
  31. package/standalone/.next/server/app/[locale]/provisioning-profiles/page_client-reference-manifest.js +1 -1
  32. package/standalone/.next/server/app/[locale]/pull-requests/[owner]/[repository]/[number]/page_client-reference-manifest.js +1 -1
  33. package/standalone/.next/server/app/[locale]/pull-requests/page_client-reference-manifest.js +1 -1
  34. package/standalone/.next/server/app/[locale]/push-notifications/page_client-reference-manifest.js +1 -1
  35. package/standalone/.next/server/app/[locale]/settings/page_client-reference-manifest.js +1 -1
  36. package/standalone/.next/server/app/[locale]/skills/[skillId]/page_client-reference-manifest.js +1 -1
  37. package/standalone/.next/server/app/[locale]/skills/groups/[groupId]/page_client-reference-manifest.js +1 -1
  38. package/standalone/.next/server/app/[locale]/skills/groups/page_client-reference-manifest.js +1 -1
  39. package/standalone/.next/server/app/[locale]/skills/page_client-reference-manifest.js +1 -1
  40. package/standalone/.next/server/app/[locale]/skills/sync/[runId]/page_client-reference-manifest.js +1 -1
  41. package/standalone/.next/server/app/[locale]/tools/page_client-reference-manifest.js +1 -1
  42. package/standalone/.next/server/app/[locale]/unified-events/page_client-reference-manifest.js +1 -1
  43. package/standalone/.next/server/app/[locale]/usage/page_client-reference-manifest.js +1 -1
  44. package/standalone/.next/server/app/[locale]/worktrees/[worktreeId]/page_client-reference-manifest.js +1 -1
  45. package/standalone/.next/server/app/[locale]/worktrees/page_client-reference-manifest.js +1 -1
  46. package/standalone/.next/server/app/_global-error.html +1 -1
  47. package/standalone/.next/server/app/_global-error.rsc +1 -1
  48. package/standalone/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  49. package/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  50. package/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  51. package/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  52. package/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  53. package/standalone/.next/server/app/_not-found.html +1 -1
  54. package/standalone/.next/server/app/_not-found.rsc +1 -1
  55. package/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  56. package/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  57. package/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  58. package/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  59. package/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  60. package/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  61. package/standalone/.next/server/chunks/ssr/_0dvnys0._.js +4 -4
  62. package/standalone/.next/server/chunks/ssr/_0k5jx04._.js +4 -4
  63. package/standalone/.next/server/chunks/ssr/messages_de_json_[json]_cjs_1uig1ud._.js +1 -1
  64. package/standalone/.next/server/chunks/ssr/messages_en_json_[json]_cjs_206072-._.js +1 -1
  65. package/standalone/.next/server/chunks/ssr/messages_es_json_[json]_cjs_082yukd._.js +1 -1
  66. package/standalone/.next/server/chunks/ssr/messages_fr_json_[json]_cjs_0j6-w0i._.js +1 -1
  67. package/standalone/.next/server/chunks/ssr/src_components_settings-page_tsx_06dxqc7._.js +31 -31
  68. package/standalone/.next/server/middleware-build-manifest.js +3 -3
  69. package/standalone/.next/server/pages/404.html +1 -1
  70. package/standalone/.next/server/pages/500.html +1 -1
  71. package/standalone/.next/server/server-reference-manifest.js +1 -1
  72. package/standalone/.next/server/server-reference-manifest.json +1 -1
  73. package/standalone/.next/static/chunks/{0zha00anzjjeh.js → 0eibx0a-j2s56.js} +4 -4
  74. package/standalone/.next/static/chunks/{2xeugqh9w5yfk.js → 0ftq0sdx2ck_7.js} +4 -4
  75. package/standalone/.next/static/chunks/1x-rxqwi4o4t2.css +1 -0
  76. package/standalone/.next/static/chunks/2t9stoad5r1nz.js +35 -0
  77. package/standalone/.next/static/chunks/1gz-q30e1qzuf.js +0 -35
  78. package/standalone/.next/static/chunks/2-6q03hqlurh2.css +0 -1
  79. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_buildManifest.js +0 -0
  80. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_clientMiddlewareManifest.js +0 -0
  81. /package/standalone/.next/static/{xU6QTRGzeBpwH4_PLChiN → HhiEyDs5GGmRv4pwGKg-m}/_ssgManifest.js +0 -0
@@ -1,37 +1,37 @@
1
- module.exports=[753934,a=>{"use strict";var b=a.i(187924),c=a.i(613412),d=a.i(617770),e=a.i(168370),f=a.i(993492),g=a.i(126766),h=a.i(748819),i=a.i(879675),j=a.i(336273),k=a.i(980180);let l=(0,a.i(164831).default)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);var m=a.i(201661),n=a.i(32886),o=a.i(415925),p=a.i(572131),q=a.i(844873),r=a.i(940879),s=a.i(403512),t=a.i(124348),u=a.i(786304),v=a.i(699570),w=a.i(591119),x=a.i(866718),y=a.i(870430),z=a.i(668684),A=a.i(460280),B=a.i(508357);function C(){let a=(0,o.useTranslations)("cacheServerSettings"),d=(0,o.useTranslations)("common"),[e,f]=(0,p.useState)(null),[g,h]=(0,p.useState)(""),[j,m]=(0,p.useState)(""),[n,C]=(0,p.useState)([]),[D,E]=(0,p.useState)(!0),[F,G]=(0,p.useState)(!1),[H,I]=(0,p.useState)(null),[J,K]=(0,p.useState)(null),L=(0,p.useCallback)(a=>{f(a),h(a.baseUrl??""),m(""),C(a.headers.map(a=>({...a,value:""})))},[]),M=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${B.CACHE_SERVER_SETTINGS_FIELDS} } }`);L(a.cacheServerSettings)}catch(a){I(a instanceof Error?a.message:String(a))}finally{E(!1)}},[L]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>void M(),0);return()=>window.clearTimeout(a)},[M]);let N=(a,b,c)=>C(d=>d.map((d,e)=>e===a?{...d,[b]:c,..."name"===b&&c!==d.name?{valueConfigured:!1}:{}}:d)),O=async b=>{b.preventDefault(),G(!0);try{let b=n.map(a=>({name:a.name.trim(),value:a.value||null})).filter(a=>a.name),c=await (0,A.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
2
- saveCacheServerSettings(input: $input) { ${B.CACHE_SERVER_SETTINGS_FIELDS} }
3
- }`,{input:{baseUrl:g.trim(),apiKey:j||null,headers:b}});L(c.saveCacheServerSettings),I(null),K(a("saved"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}},P=async()=>{G(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation TestCacheServerConnection {
4
- testCacheServerConnection { ${B.CACHE_SERVER_SETTINGS_FIELDS} }
5
- }`);L(b.testCacheServerConnection),I(null),K(a("connectionSucceeded"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}},Q=async()=>{G(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation ClearCacheServerSettings {
6
- clearCacheServerSettings { ${B.CACHE_SERVER_SETTINGS_FIELDS} }
7
- }`);L(b.clearCacheServerSettings),I(null),K(a("removed"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}};return(0,b.jsx)("form",{onSubmit:O,children:(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.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.DatabaseZap,{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")})]})]}),(0,b.jsx)(u.Badge,{className:e?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:e?.configured?a("configured"):a("notConfigured")})]}),D?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[H&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:H})}),J&&(0,b.jsxs)(t.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)(t.AlertDescription,{className:"text-current",children:J})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:a("baseUrl")}),(0,b.jsx)(x.Input,{autoComplete:"url",id:"cache-server-base-url",onChange:a=>h(a.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:g}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("baseUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:a("apiKey")}),(0,b.jsx)(x.Input,{autoComplete:"new-password",id:"cache-server-api-key",onChange:a=>m(a.target.value),placeholder:e?.apiKeyConfigured?a("apiKeyPlaceholderConfigured"):a("apiKeyPlaceholder"),required:!e?.apiKeyConfigured,type:"password",value:j}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e?.apiKeyConfigured?a("apiKeyKeepHelp"):a("apiKeyHelp")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(y.Label,{className:"text-sm font-medium",children:a("headers")}),(0,b.jsxs)(v.Button,{onClick:()=>C(a=>[...a,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,b.jsx)(s.Plus,{}),a("addHeader")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("headersHelp")}),0===n.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("noHeaders")}):(0,b.jsx)("div",{className:"space-y-2",children:n.map((c,d)=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(x.Input,{"aria-label":a("headerName"),className:"flex-1",onChange:a=>N(d,"name",a.target.value),placeholder:a("headerName"),value:c.name}),(0,b.jsx)(x.Input,{"aria-label":a("headerValue"),autoComplete:"new-password",className:"flex-1",onChange:a=>N(d,"value",a.target.value),placeholder:c.valueConfigured?a("headerValuePlaceholderConfigured"):a("headerValue"),required:!c.valueConfigured,type:"password",value:c.value}),(0,b.jsx)(v.Button,{"aria-label":a("removeHeader"),onClick:()=>C(a=>a.filter((a,b)=>b!==d)),size:"icon",type:"button",variant:"ghost",children:(0,b.jsx)(k.Trash2,{})})]},d))})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:Q,title:a("confirmRemove"),trigger:(0,b.jsxs)(v.Button,{disabled:F||!e?.configured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{}),a("remove")]})}),(0,b.jsxs)(v.Button,{disabled:F||!e?.configured,onClick:()=>void P(),type:"button",variant:"outline",children:[(0,b.jsx)(l,{}),a("test")]}),(0,b.jsxs)(v.Button,{disabled:F,type:"submit",children:[F?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{}),a("save")]})]})]})]})})})}var D=a.i(235709),E=a.i(519783),F=a.i(429246),G=a.i(320615),H=a.i(444358);function I(){let a=(0,o.useTranslations)("iosDeviceSettings"),d=(0,o.useTranslations)("common"),e=(0,n.useLocale)(),[f,h]=(0,p.useState)(null),[l,r]=(0,p.useState)(""),[s,B]=(0,p.useState)(""),[C,I]=(0,p.useState)(""),[J,K]=(0,p.useState)(""),[L,M]=(0,p.useState)(""),[N,O]=(0,p.useState)(!1),[P,Q]=(0,p.useState)(!0),[R,S]=(0,p.useState)(!1),[T,U]=(0,p.useState)(!1),[V,W]=(0,p.useState)(null),[X,Y]=(0,p.useState)(null),Z=(0,p.useCallback)(a=>{h(a),r(a.organizationName),B(a.profileIdentifier),I(a.appStoreConnectIssuerId??""),K(a.appStoreConnectKeyId??""),M("")},[]),$=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query IosDeviceSettings {
8
- iosDeviceSettings { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
9
- }`);Z(a.iosDeviceSettings)}catch(a){W(a instanceof Error?a.message:String(a))}finally{Q(!1)}},[Z]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>void $(),0);return()=>window.clearTimeout(a)},[$]);let _=b=>(0,G.formatDateValue)(b,"short",{locale:e,fallback:a("unavailable")}),aa=async b=>{b.preventDefault(),S(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
10
- saveIosProfileSettings(input: $input) { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
11
- }`,{input:{organizationName:l,profileIdentifier:s}});Z(b.saveIosProfileSettings),W(null),Y(a("profileSaved"))}catch(a){W(a instanceof Error?a.message:String(a)),Y(null)}finally{S(!1)}},ab=async()=>{S(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
12
- regenerateIosProfileSigner { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
13
- }`);Z(b.regenerateIosProfileSigner),W(null),Y(a("signerRegenerated"))}catch(a){W(a instanceof Error?a.message:String(a)),Y(null)}finally{S(!1)}},ac=async b=>{b.preventDefault(),U(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
14
- saveAppStoreConnectSettings(input: $input) { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
15
- }`,{input:{issuerId:C.trim(),keyId:J.trim(),privateKey:L||null}});Z(b.saveAppStoreConnectSettings),W(null),Y(a("appleSaved"))}catch(a){W(a instanceof Error?a.message:String(a)),Y(null)}finally{U(!1)}},ad=async()=>{U(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
16
- testAppStoreConnectSettings { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
17
- }`);Z(b.testAppStoreConnectSettings),W(null),Y(a("appleTestSucceeded"))}catch(a){W(a instanceof Error?a.message:String(a)),Y(null),$()}finally{U(!1)}},ae=async()=>{U(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
18
- clearAppStoreConnectSettings { ${H.IOS_DEVICE_SETTINGS_FIELDS} }
19
- }`);Z(b.clearAppStoreConnectSettings),W(null),Y(a("appleCleared"))}catch(a){W(a instanceof Error?a.message:String(a)),Y(null)}finally{U(!1)}},af=async b=>{if(!b.name.toLowerCase().endsWith(".p8")){W(a("p8Invalid")),Y(null);return}try{let c=await b.text();if(!c.includes("-----BEGIN PRIVATE KEY-----")||!c.includes("-----END PRIVATE KEY-----")){W(a("p8Invalid")),Y(null);return}M(c),W(null),Y(a("p8Loaded",{filename:b.name}))}catch{W(a("p8ReadError")),Y(null)}};return(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.CardContent,{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(D.Apple,{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")})]})]}),V&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:V})}),X&&(0,b.jsxs)(t.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)(t.AlertDescription,{className:"text-current",children:X})]}),P?(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.Spinner,{})," ",a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("form",{className:"space-y-4",onSubmit:aa,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(j.ShieldCheck,{className:"size-4"})," ",a("profileTitle")]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("profileDescription")})]}),(0,b.jsx)(u.Badge,{variant:"outline",children:f?.signerConfigured?a("signerReady"):a("signerNotGenerated")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(y.Label,{htmlFor:"ios-organization-name",children:a("organizationName")}),(0,b.jsx)(x.Input,{id:"ios-organization-name",maxLength:100,onChange:a=>r(a.target.value),required:!0,value:l})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(y.Label,{htmlFor:"ios-profile-identifier",children:a("profileIdentifier")}),(0,b.jsx)(x.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:a=>B(a.target.value),required:!0,spellCheck:!1,value:s})]})]}),f?.signerConfigured&&(0,b.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,b.jsx)("p",{children:a("signerCreated",{date:_(f.signerCreatedAt)})}),(0,b.jsx)("p",{children:a("signerExpires",{date:_(f.signerExpiresAt)})}),(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:f.signerFingerprint}),(0,b.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:a("unverifiedWarning")})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("regenerateSigner"),cancelLabel:d("cancel"),description:a("regenerateDescription"),onConfirm:ab,title:a("regenerateTitle"),trigger:(0,b.jsxs)(v.Button,{disabled:R,type:"button",variant:"outline",children:[(0,b.jsx)(E.RefreshCw,{})," ",a("regenerateSigner")]})}),(0,b.jsxs)(v.Button,{disabled:R,type:"submit",children:[R?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{})," ",a("saveProfile")]})]})]}),(0,b.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:ac,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(g.KeyRound,{className:"size-4"})," ",a("appleTitle")]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("appleDescription")})]}),(0,b.jsx)(u.Badge,{className:f?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.appStoreConnectConfigured?a("verified"):a("notVerified")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(y.Label,{htmlFor:"app-store-issuer-id",children:a("issuerId")}),(0,b.jsx)(x.Input,{autoCapitalize:"none",id:"app-store-issuer-id",maxLength:100,onChange:a=>I(a.target.value),required:!0,spellCheck:!1,value:C})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(y.Label,{htmlFor:"app-store-key-id",children:a("keyId")}),(0,b.jsx)(x.Input,{autoCapitalize:"characters",id:"app-store-key-id",maxLength:100,onChange:a=>K(a.target.value),required:!0,spellCheck:!1,value:J})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(y.Label,{htmlFor:"app-store-private-key",children:a("privateKey")}),(0,b.jsxs)("div",{"aria-label":a("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${N?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),O(!0)},onDragLeave:()=>O(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",O(!0)},onDrop:a=>{a.preventDefault(),O(!1);let b=a.dataTransfer.files.item(0);b&&af(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)(m.Upload,{className:"size-3.5"})," ",a("p8DropHint")]}),(0,b.jsx)(F.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",onChange:a=>M(a.target.value),placeholder:f?.appStoreConnectPrivateKeyConfigured?a("privateKeyConfiguredPlaceholder"):a("privateKeyPlaceholder"),required:!f?.appStoreConnectPrivateKeyConfigured,value:L}),(0,b.jsx)(x.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":a("chooseP8"),className:"mt-2 h-auto text-xs",onChange:a=>{let b=a.target.files?.item(0);b&&af(b),a.target.value=""},type:"file"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:f?.appStoreConnectPrivateKeyConfigured?a("privateKeyKeepHelp"):a("privateKeyHelp")})]}),(f?.appStoreConnectLastTestedAt||f?.appStoreConnectPrivateKeyFingerprint)&&(0,b.jsx)(t.Alert,{variant:f.appStoreConnectVerificationError?"destructive":"default",children:(0,b.jsxs)(t.AlertDescription,{children:[(0,b.jsx)("p",{className:"font-medium",children:f.appStoreConnectVerificationError?a("lastTestFailed",{date:_(f.appStoreConnectLastTestedAt)}):a("lastVerified",{date:_(f.appStoreConnectVerifiedAt)})}),f.appStoreConnectVerificationError&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:f.appStoreConnectVerificationError}),f.appStoreConnectPrivateKeyFingerprint&&(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:f.appStoreConnectPrivateKeyFingerprint})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("clear"),cancelLabel:d("cancel"),description:a("clearDescription"),onConfirm:ae,title:a("clearTitle"),trigger:(0,b.jsxs)(v.Button,{disabled:T||!f?.appStoreConnectPrivateKeyConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{})," ",a("clear")]})}),(0,b.jsxs)(v.Button,{disabled:T||!f?.appStoreConnectPrivateKeyConfigured,onClick:()=>void ad(),type:"button",variant:"outline",children:[(0,b.jsx)(E.RefreshCw,{})," ",a("retest")]}),(0,b.jsxs)(v.Button,{disabled:T,type:"submit",children:[T?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{})," ",a("saveAndVerify")]})]})]})]})]})})}var J=a.i(580701);let K=`
1
+ module.exports=[753934,a=>{"use strict";var b=a.i(187924),c=a.i(613412),d=a.i(617770),e=a.i(993492),f=a.i(126766),g=a.i(748819),h=a.i(879675),i=a.i(336273),j=a.i(980180);let k=(0,a.i(164831).default)("unplug",[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]]);var l=a.i(201661),m=a.i(32886),n=a.i(415925),o=a.i(572131),p=a.i(844873),q=a.i(940879),r=a.i(403512),s=a.i(124348),t=a.i(786304),u=a.i(699570),v=a.i(591119),w=a.i(866718),x=a.i(870430),y=a.i(668684),z=a.i(460280),A=a.i(508357);function B(){let a=(0,n.useTranslations)("cacheServerSettings"),d=(0,n.useTranslations)("common"),[e,f]=(0,o.useState)(null),[g,i]=(0,o.useState)(""),[l,m]=(0,o.useState)(""),[B,C]=(0,o.useState)([]),[D,E]=(0,o.useState)(!0),[F,G]=(0,o.useState)(!1),[H,I]=(0,o.useState)(null),[J,K]=(0,o.useState)(null),L=(0,o.useCallback)(a=>{f(a),i(a.baseUrl??""),m(""),C(a.headers.map(a=>({...a,value:""})))},[]),M=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query CacheServerSettings { cacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} } }`);L(a.cacheServerSettings)}catch(a){I(a instanceof Error?a.message:String(a))}finally{E(!1)}},[L]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void M(),0);return()=>window.clearTimeout(a)},[M]);let N=(a,b,c)=>C(d=>d.map((d,e)=>e===a?{...d,[b]:c,..."name"===b&&c!==d.name?{valueConfigured:!1}:{}}:d)),O=async b=>{b.preventDefault(),G(!0);try{let b=B.map(a=>({name:a.name.trim(),value:a.value||null})).filter(a=>a.name),c=await (0,z.controlPlaneRequest)(`mutation SaveCacheServerSettings($input: SaveCacheServerSettingsInput!) {
2
+ saveCacheServerSettings(input: $input) { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
3
+ }`,{input:{baseUrl:g.trim(),apiKey:l||null,headers:b}});L(c.saveCacheServerSettings),I(null),K(a("saved"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}},P=async()=>{G(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation TestCacheServerConnection {
4
+ testCacheServerConnection { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
5
+ }`);L(b.testCacheServerConnection),I(null),K(a("connectionSucceeded"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}},Q=async()=>{G(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation ClearCacheServerSettings {
6
+ clearCacheServerSettings { ${A.CACHE_SERVER_SETTINGS_FIELDS} }
7
+ }`);L(b.clearCacheServerSettings),I(null),K(a("removed"))}catch(a){I(a instanceof Error?a.message:String(a)),K(null)}finally{G(!1)}};return(0,b.jsx)("form",{onSubmit:O,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)(q.DatabaseZap,{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")})]})]}),(0,b.jsx)(t.Badge,{className:e?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:e?.configured?a("configured"):a("notConfigured")})]}),D?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[H&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:H})}),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.jsx)("p",{className:"rounded-md border bg-muted/30 p-3 text-xs text-muted-foreground",children:a("setupHelp")}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-base-url",children:a("baseUrl")}),(0,b.jsx)(w.Input,{autoComplete:"url",id:"cache-server-base-url",onChange:a=>i(a.target.value),placeholder:"http://cache-server.internal:3006/management-api",required:!0,type:"url",value:g}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("baseUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"cache-server-api-key",children:a("apiKey")}),(0,b.jsx)(w.Input,{autoComplete:"new-password",id:"cache-server-api-key",onChange:a=>m(a.target.value),placeholder:e?.apiKeyConfigured?a("apiKeyPlaceholderConfigured"):a("apiKeyPlaceholder"),required:!e?.apiKeyConfigured,type:"password",value:l}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e?.apiKeyConfigured?a("apiKeyKeepHelp"):a("apiKeyHelp")})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsxs)("div",{className:"flex items-center justify-between",children:[(0,b.jsx)(x.Label,{className:"text-sm font-medium",children:a("headers")}),(0,b.jsxs)(u.Button,{onClick:()=>C(a=>[...a,{name:"",value:"",valueConfigured:!1}]),size:"sm",type:"button",variant:"outline",children:[(0,b.jsx)(r.Plus,{}),a("addHeader")]})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("headersHelp")}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("headersSetupHelp")}),0===B.length?(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("noHeaders")}):(0,b.jsx)("div",{className:"space-y-2",children:B.map((c,d)=>(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(w.Input,{"aria-label":a("headerName"),className:"flex-1",onChange:a=>N(d,"name",a.target.value),placeholder:a("headerName"),value:c.name}),(0,b.jsx)(w.Input,{"aria-label":a("headerValue"),autoComplete:"new-password",className:"flex-1",onChange:a=>N(d,"value",a.target.value),placeholder:c.valueConfigured?a("headerValuePlaceholderConfigured"):a("headerValue"),required:!c.valueConfigured,type:"password",value:c.value}),(0,b.jsx)(u.Button,{"aria-label":a("removeHeader"),onClick:()=>C(a=>a.filter((a,b)=>b!==d)),size:"icon",type:"button",variant:"ghost",children:(0,b.jsx)(j.Trash2,{})})]},d))})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:Q,title:a("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:F||!e?.configured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:F||!e?.configured,onClick:()=>void P(),type:"button",variant:"outline",children:[(0,b.jsx)(k,{}),a("test")]}),(0,b.jsxs)(u.Button,{disabled:F,type:"submit",children:[F?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{}),a("save")]})]})]})]})})})}var C=a.i(235709),D=a.i(519783),E=a.i(168370);function F({children:a,href:c}){return(0,b.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:c,rel:"noreferrer",target:"_blank",children:[a,(0,b.jsx)(E.ExternalLink,{"aria-hidden":"true",className:"size-3 shrink-0"})]})}var G=a.i(429246),H=a.i(320615),I=a.i(444358);function J(){let a=(0,n.useTranslations)("iosDeviceSettings"),d=(0,n.useTranslations)("common"),e=(0,m.useLocale)(),[g,k]=(0,o.useState)(null),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[E,J]=(0,o.useState)(""),[K,L]=(0,o.useState)(""),[M,N]=(0,o.useState)(""),[O,P]=(0,o.useState)(!1),[Q,R]=(0,o.useState)(!0),[S,T]=(0,o.useState)(!1),[U,V]=(0,o.useState)(!1),[W,X]=(0,o.useState)(null),[Y,Z]=(0,o.useState)(null),$=(0,o.useCallback)(a=>{k(a),r(a.organizationName),B(a.profileIdentifier),J(a.appStoreConnectIssuerId??""),L(a.appStoreConnectKeyId??""),N("")},[]),_=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query IosDeviceSettings {
8
+ iosDeviceSettings { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
9
+ }`);$(a.iosDeviceSettings)}catch(a){X(a instanceof Error?a.message:String(a))}finally{R(!1)}},[$]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void _(),0);return()=>window.clearTimeout(a)},[_]);let aa=b=>(0,H.formatDateValue)(b,"short",{locale:e,fallback:a("unavailable")}),ab=async b=>{b.preventDefault(),T(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveIosProfileSettings($input: SaveIosProfileSettingsInput!) {
10
+ saveIosProfileSettings(input: $input) { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
11
+ }`,{input:{organizationName:q,profileIdentifier:A}});$(b.saveIosProfileSettings),X(null),Z(a("profileSaved"))}catch(a){X(a instanceof Error?a.message:String(a)),Z(null)}finally{T(!1)}},ac=async()=>{T(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation RegenerateIosProfileSigner {
12
+ regenerateIosProfileSigner { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
13
+ }`);$(b.regenerateIosProfileSigner),X(null),Z(a("signerRegenerated"))}catch(a){X(a instanceof Error?a.message:String(a)),Z(null)}finally{T(!1)}},ad=async b=>{b.preventDefault(),V(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveAppStoreConnectSettings($input: SaveAppStoreConnectSettingsInput!) {
14
+ saveAppStoreConnectSettings(input: $input) { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
15
+ }`,{input:{issuerId:E.trim(),keyId:K.trim(),privateKey:M||null}});$(b.saveAppStoreConnectSettings),X(null),Z(a("appleSaved"))}catch(a){X(a instanceof Error?a.message:String(a)),Z(null)}finally{V(!1)}},ae=async()=>{V(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation TestAppStoreConnectSettings {
16
+ testAppStoreConnectSettings { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
17
+ }`);$(b.testAppStoreConnectSettings),X(null),Z(a("appleTestSucceeded"))}catch(a){X(a instanceof Error?a.message:String(a)),Z(null),_()}finally{V(!1)}},af=async()=>{V(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation ClearAppStoreConnectSettings {
18
+ clearAppStoreConnectSettings { ${I.IOS_DEVICE_SETTINGS_FIELDS} }
19
+ }`);$(b.clearAppStoreConnectSettings),X(null),Z(a("appleCleared"))}catch(a){X(a instanceof Error?a.message:String(a)),Z(null)}finally{V(!1)}},ag=async b=>{if(!b.name.toLowerCase().endsWith(".p8")){X(a("p8Invalid")),Z(null);return}try{let c=await b.text();if(!c.includes("-----BEGIN PRIVATE KEY-----")||!c.includes("-----END PRIVATE KEY-----")){X(a("p8Invalid")),Z(null);return}N(c),X(null),Z(a("p8Loaded",{filename:b.name}))}catch{X(a("p8ReadError")),Z(null)}};return(0,b.jsx)(v.Card,{children:(0,b.jsxs)(v.CardContent,{className:"space-y-6",children:[(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)(C.Apple,{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")})]})]}),W&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:W})}),Y&&(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:Y})]}),Q?(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)(b.Fragment,{children:[(0,b.jsxs)("form",{className:"space-y-4",onSubmit:ab,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(i.ShieldCheck,{className:"size-4"})," ",a("profileTitle")]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("profileDescription")})]}),(0,b.jsx)(t.Badge,{variant:"outline",children:g?.signerConfigured?a("signerReady"):a("signerNotGenerated")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"ios-organization-name",children:a("organizationName")}),(0,b.jsx)(w.Input,{id:"ios-organization-name",maxLength:100,onChange:a=>r(a.target.value),required:!0,value:q}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("profileOrganizationHelp")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"ios-profile-identifier",children:a("profileIdentifier")}),(0,b.jsx)(w.Input,{autoCapitalize:"none",className:"font-mono text-sm",id:"ios-profile-identifier",maxLength:200,onChange:a=>B(a.target.value),required:!0,spellCheck:!1,value:A}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("profileIdentifierHelp")})]})]}),g?.signerConfigured&&(0,b.jsxs)("div",{className:"rounded-md border bg-muted/30 p-3 text-xs",children:[(0,b.jsx)("p",{children:a("signerCreated",{date:aa(g.signerCreatedAt)})}),(0,b.jsx)("p",{children:a("signerExpires",{date:aa(g.signerExpiresAt)})}),(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-muted-foreground",children:g.signerFingerprint}),(0,b.jsx)("p",{className:"mt-2 text-amber-700 dark:text-amber-300",children:a("unverifiedWarning")})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("regenerateSigner"),cancelLabel:d("cancel"),description:a("regenerateDescription"),onConfirm:ac,title:a("regenerateTitle"),trigger:(0,b.jsxs)(u.Button,{disabled:S,type:"button",variant:"outline",children:[(0,b.jsx)(D.RefreshCw,{})," ",a("regenerateSigner")]})}),(0,b.jsxs)(u.Button,{disabled:S,type:"submit",children:[S?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("saveProfile")]})]})]}),(0,b.jsxs)("form",{className:"space-y-4 border-t pt-6",onSubmit:ad,children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsxs)("h3",{className:"flex items-center gap-2 font-medium",children:[(0,b.jsx)(f.KeyRound,{className:"size-4"})," ",a("appleTitle")]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:a("appleDescription")})]}),(0,b.jsx)(t.Badge,{className:g?.appStoreConnectConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:g?.appStoreConnectConfigured?a("verified"):a("notVerified")})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("p",{className:"sm:col-span-2 text-xs text-muted-foreground",children:[a("appleSetupHelp")," ",(0,b.jsx)(F,{href:"https://appstoreconnect.apple.com/access/integrations/api",children:a("openApiKeys")})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"app-store-issuer-id",children:a("issuerId")}),(0,b.jsx)(w.Input,{autoCapitalize:"none",id:"app-store-issuer-id",maxLength:100,onChange:a=>J(a.target.value),required:!0,spellCheck:!1,value:E})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"app-store-key-id",children:a("keyId")}),(0,b.jsx)(w.Input,{autoCapitalize:"characters",id:"app-store-key-id",maxLength:100,onChange:a=>L(a.target.value),required:!0,spellCheck:!1,value:K})]})]}),(0,b.jsxs)("div",{className:"space-y-1.5",children:[(0,b.jsx)(x.Label,{htmlFor:"app-store-private-key",children:a("privateKey")}),(0,b.jsxs)("div",{"aria-label":a("p8DropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${O?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),P(!0)},onDragLeave:()=>P(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",P(!0)},onDrop:a=>{a.preventDefault(),P(!1);let b=a.dataTransfer.files.item(0);b&&ag(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"})," ",a("p8DropHint")]}),(0,b.jsx)(G.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",onChange:a=>N(a.target.value),placeholder:g?.appStoreConnectPrivateKeyConfigured?a("privateKeyConfiguredPlaceholder"):a("privateKeyPlaceholder"),required:!g?.appStoreConnectPrivateKeyConfigured,value:M}),(0,b.jsx)(w.Input,{accept:".p8,application/pkcs8,text/plain","aria-label":a("chooseP8"),className:"mt-2 h-auto text-xs",onChange:a=>{let b=a.target.files?.item(0);b&&ag(b),a.target.value=""},type:"file"})]}),(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:g?.appStoreConnectPrivateKeyConfigured?a("privateKeyKeepHelp"):a("privateKeyHelp")})]}),(g?.appStoreConnectLastTestedAt||g?.appStoreConnectPrivateKeyFingerprint)&&(0,b.jsx)(s.Alert,{variant:g.appStoreConnectVerificationError?"destructive":"default",children:(0,b.jsxs)(s.AlertDescription,{children:[(0,b.jsx)("p",{className:"font-medium",children:g.appStoreConnectVerificationError?a("lastTestFailed",{date:aa(g.appStoreConnectLastTestedAt)}):a("lastVerified",{date:aa(g.appStoreConnectVerifiedAt)})}),g.appStoreConnectVerificationError&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:g.appStoreConnectVerificationError}),g.appStoreConnectPrivateKeyFingerprint&&(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:g.appStoreConnectPrivateKeyFingerprint})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("clear"),cancelLabel:d("cancel"),description:a("clearDescription"),onConfirm:af,title:a("clearTitle"),trigger:(0,b.jsxs)(u.Button,{disabled:U||!g?.appStoreConnectPrivateKeyConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{})," ",a("clear")]})}),(0,b.jsxs)(u.Button,{disabled:U||!g?.appStoreConnectPrivateKeyConfigured,onClick:()=>void ae(),type:"button",variant:"outline",children:[(0,b.jsx)(D.RefreshCw,{})," ",a("retest")]}),(0,b.jsxs)(u.Button,{disabled:U,type:"submit",children:[U?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{})," ",a("saveAndVerify")]})]})]})]})]})})}var K=a.i(580701);let L=`
20
20
  tokenConfigured tokenTeamId tokenKeyId tokenPrivateKeyFingerprint
21
21
  tokenConfiguredAt tokenLastUsedAt tokenLastError
22
22
  certificates { id name topic environment fingerprint expiresAt lastTestedAt lastError }
23
- `;function L(){let a=(0,o.useTranslations)("pushSettings"),c=(0,o.useTranslations)("common"),d=(0,n.useLocale)(),[e,f]=(0,p.useState)(null),[h,j]=(0,p.useState)(""),[l,r]=(0,p.useState)(""),[s,B]=(0,p.useState)(""),[C,D]=(0,p.useState)(""),[F,H]=(0,p.useState)(""),[I,L]=(0,p.useState)("SANDBOX"),[M,N]=(0,p.useState)(""),[O,P]=(0,p.useState)(""),[Q,R]=(0,p.useState)(!1),[S,T]=(0,p.useState)(null),U=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${K} } }`);f(a.pushNotificationSettings),j(a.pushNotificationSettings.tokenTeamId??""),r(a.pushNotificationSettings.tokenKeyId??"")}catch(a){T(a instanceof Error?a.message:String(a))}},[]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>void U(),0);return()=>window.clearTimeout(a)},[U]);let V=async a=>{a.preventDefault(),R(!0);try{let a=await (0,A.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${K} } }`,{input:{teamId:h,keyId:l,privateKey:s||null}});f(a.saveApnsTokenSettings),B(""),T(null)}catch(a){T(a instanceof Error?a.message:String(a))}finally{R(!1)}},W=async a=>{a.preventDefault(),R(!0);try{let a=await (0,A.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${K} } }`,{input:{name:C,topic:F,environment:I,p12Base64:M,passphrase:O}});f(a.addApnsCertificateCredential),D(""),H(""),N(""),P(""),T(null)}catch(a){T(a instanceof Error?a.message:String(a))}finally{R(!1)}};return(0,b.jsxs)(w.Card,{children:[(0,b.jsx)(w.CardHeader,{children:(0,b.jsx)(w.CardTitle,{children:a("title")})}),(0,b.jsxs)(w.CardContent,{className:"space-y-6",children:[S&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:S})}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:V,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)(u.Badge,{variant:e?.tokenConfigured?"default":"secondary",children:e?.tokenConfigured?a("configured"):a("notConfigured")})]}),(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)(y.Label,{htmlFor:"apns-team",children:a("teamId")}),(0,b.jsx)(x.Input,{id:"apns-team",onChange:a=>j(a.target.value),value:h})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(y.Label,{htmlFor:"apns-key",children:a("keyId")}),(0,b.jsx)(x.Input,{id:"apns-key",onChange:a=>r(a.target.value),value:l})]})]}),(0,b.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-6",children:[(0,b.jsx)(m.Upload,{})," ",s?a("p8Ready"):e?.tokenConfigured?a("replaceP8"):a("chooseP8"),(0,b.jsx)(x.Input,{accept:".p8",className:"sr-only",onChange:a=>{let b=a.target.files?.[0];b&&b.text().then(B)},type:"file"})]}),e?.tokenPrivateKeyFingerprint&&(0,b.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",e.tokenPrivateKeyFingerprint]}),e?.tokenLastError&&(0,b.jsx)("p",{className:"text-sm text-destructive",children:e.tokenLastError}),(0,b.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:c("cancel"),description:a("removeTokenDescription"),onConfirm:async()=>{f((await (0,A.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${K} } }`)).clearApnsTokenSettings),j(""),r("")},title:a("removeToken"),trigger:(0,b.jsxs)(v.Button,{disabled:Q||!e?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{})," ",a("remove")]})}),(0,b.jsxs)(v.Button,{disabled:Q||!h||!l||!s&&!e?.tokenConfigured,type:"submit",children:[Q?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{})," ",a("save")]})]})]}),(0,b.jsx)("div",{className:"border-t"}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:W,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)("div",{className:"grid gap-4 sm:grid-cols-3",children:[(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(y.Label,{children:a("name")}),(0,b.jsx)(x.Input,{onChange:a=>D(a.target.value),value:C})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(y.Label,{children:a("topic")}),(0,b.jsx)(x.Input,{onChange:a=>H(a.target.value),value:F})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(y.Label,{children:a("environment")}),(0,b.jsxs)(J.Select,{onValueChange:L,value:I,children:[(0,b.jsx)(J.SelectTrigger,{children:(0,b.jsx)(J.SelectValue,{})}),(0,b.jsxs)(J.SelectContent,{children:[(0,b.jsx)(J.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,b.jsx)(J.SelectItem,{value:"PRODUCTION",children:"Production"})]})]})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)(y.Label,{className:"flex cursor-pointer items-center justify-center gap-2 rounded-xl border border-dashed p-5",children:[(0,b.jsx)(g.KeyRound,{})," ",M?a("p12Ready"):a("chooseP12"),(0,b.jsx)(x.Input,{accept:".p12,.pfx",className:"sr-only",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(N)},type:"file"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(y.Label,{children:a("passphrase")}),(0,b.jsx)(x.Input,{onChange:a=>P(a.target.value),type:"password",value:O})]})]}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(v.Button,{disabled:Q||!C||!F||!M,type:"submit",children:[(0,b.jsx)(i.Save,{})," ",a("addCertificate")]})})]}),e?.certificates.map(e=>(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:e.name}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[e.topic," · ",e.environment]}),(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",e.fingerprint]}),e.expiresAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("expires",{date:(0,G.formatDateValue)(e.expiresAt,"short",{locale:d,showTime:!1})})}),e.lastTestedAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("lastTested",{date:(0,G.formatDateValue)(e.lastTestedAt,"short",{locale:d})})}),e.lastError&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:e.lastError})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(v.Button,{disabled:Q,onClick:()=>void(async()=>{R(!0);try{let a=await (0,A.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${K} } }`,{id:e.id});f(a.retestApnsCertificateCredential),T(null)}catch(a){T(a instanceof Error?a.message:String(a)),await U()}finally{R(!1)}})(),size:"sm",variant:"outline",children:[(0,b.jsx)(E.RefreshCw,{})," ",a("retest")]}),(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:c("cancel"),description:a("removeCertificateDescription"),onConfirm:async()=>{await (0,A.controlPlaneRequest)("mutation Delete($id: ID!) { deleteApnsCertificateCredential(id: $id) }",{id:e.id}),await U()},title:a("removeCertificate"),trigger:(0,b.jsx)(v.Button,{size:"icon-sm",variant:"ghost",children:(0,b.jsx)(k.Trash2,{})})})]})]},e.id))]})]})}let M="siteUrl email tokenConfigured cacheTtlSeconds updatedAt";function N({embedded:a=!1}={}){let d=(0,o.useTranslations)("jiraSettings"),e=(0,o.useTranslations)("common"),[f,h]=(0,p.useState)(null),[j,m]=(0,p.useState)(""),[n,r]=(0,p.useState)(""),[s,B]=(0,p.useState)(""),[C,D]=(0,p.useState)(null),[E,F]=(0,p.useState)(!0),[G,H]=(0,p.useState)(!1),[I,J]=(0,p.useState)(null),[K,L]=(0,p.useState)(null),[O,P]=(0,p.useState)(!1),Q=a=>{h(a),m(a.siteUrl??""),r(a.email??""),B("")},R=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query { jiraSettings { ${M} } }`);Q(a.jiraSettings)}catch(a){J(a instanceof Error?a.message:String(a))}finally{F(!1)}},[]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>void R(),0);return()=>window.clearTimeout(a)},[R]);let S=async a=>{H(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${M} } }`,{input:{siteUrl:j,email:n,apiToken:s||null,resetSite:a}});Q(b.saveJiraSettings),D(null),J(null),L(d("saved"))}catch(a){J(a instanceof Error?a.message:String(a)),L(null)}finally{H(!1)}},T=async()=>{H(!0);try{let a=await (0,A.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");D(a.testJiraConnection),J(null),L(d("connectionSucceeded"))}catch(a){D(null),J(a instanceof Error?a.message:String(a)),L(null)}finally{H(!1)}},U=async()=>{H(!0);try{let a=await (0,A.controlPlaneRequest)(`mutation { clearJiraCredentials { ${M} } }`);Q(a.clearJiraCredentials),D(null),J(null),L(d("removed"))}catch(a){J(a instanceof Error?a.message:String(a))}finally{H(!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")})]}),E?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.Spinner,{}),d("loading")]}):(0,b.jsx)("form",{onSubmit:a=>{(a.preventDefault(),f?.siteUrl&&f.siteUrl!==j.trim().replace(/\/$/,""))?P(!0):S(!1)},children:(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.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)(g.KeyRound,{className:"size-5"}),(0,b.jsx)("h2",{className:"font-semibold",children:d("credentials")})]}),(0,b.jsx)(u.Badge,{className:f?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.tokenConfigured?d("configured"):d("notConfigured")})]}),I&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:I})}),K&&(0,b.jsxs)(t.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)(t.AlertDescription,{className:"text-current",children:K})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-site-url",children:d("siteUrl")}),(0,b.jsx)(x.Input,{autoComplete:"url",id:"jira-site-url",onChange:a=>m(a.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:j}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:d("siteUrlHelp")})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-email",children:d("email")}),(0,b.jsx)(x.Input,{autoComplete:"username",id:"jira-email",onChange:a=>r(a.target.value),required:!0,type:"email",value:n})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"jira-token",children:d("apiToken")}),(0,b.jsx)(x.Input,{autoComplete:"new-password",id:"jira-token",onChange:a=>B(a.target.value),placeholder:f?.tokenConfigured?d("tokenPlaceholderConfigured"):d("tokenPlaceholder"),required:!f?.tokenConfigured,type:"password",value:s}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:f?.tokenConfigured?d("tokenKeepHelp"):d("tokenHelp")})]}),C&&(0,b.jsx)(t.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:C.displayName}),(0,b.jsx)("p",{className:"text-muted-foreground",children:C.emailAddress??C.accountId})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:d("remove"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:U,title:d("confirmRemove"),trigger:(0,b.jsxs)(v.Button,{disabled:G||!f?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{}),d("remove")]})}),(0,b.jsxs)(v.Button,{disabled:G||!f?.tokenConfigured,onClick:()=>void T(),type:"button",variant:"outline",children:[(0,b.jsx)(l,{}),d("test")]}),(0,b.jsxs)(v.Button,{disabled:G,type:"submit",children:[G?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{}),d("save")]})]})]})})}),(0,b.jsx)(q.ConfirmationDialog,{actionLabel:e("continue"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:()=>S(!0),onOpenChange:P,open:O,title:d("confirmSiteChange")})]})}var O=a.i(648104);let P="tokenConfigured defaultJiraKeyRegex updatedAt",Q="configured appId installationId privateKeyConfigured keyFingerprint appSlug accountLogin repositorySelection actionsPermission verifiedAt updatedAt";function R({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 S(){let a=(0,o.useTranslations)("editorSettings"),[c,e]=(0,p.useState)("CODE"),[f,g]=(0,p.useState)(!0),[h,j]=(0,p.useState)(!1),[k,l]=(0,p.useState)(null),[m,n]=(0,p.useState)(null);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>{(0,A.controlPlaneRequest)("query EditorSettings { worktreeSettings { editorVariant } }").then(a=>e(a.worktreeSettings.editorVariant)).catch(a=>n(a instanceof Error?a.message:String(a))).finally(()=>g(!1))},0);return()=>window.clearTimeout(a)},[]);let q=async()=>{j(!0);try{await (0,A.controlPlaneRequest)(`mutation SaveEditorSettings($editorVariant: WorktreeEditorVariant!) {
23
+ `;function M(){let a=(0,n.useTranslations)("pushSettings"),c=(0,n.useTranslations)("common"),d=(0,m.useLocale)(),[e,g]=(0,o.useState)(null),[i,k]=(0,o.useState)(""),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[C,E]=(0,o.useState)(""),[G,I]=(0,o.useState)(""),[J,M]=(0,o.useState)("SANDBOX"),[N,O]=(0,o.useState)(""),[P,Q]=(0,o.useState)(""),[R,S]=(0,o.useState)(!1),[T,U]=(0,o.useState)(null),V=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query PushSettings { pushNotificationSettings { ${L} } }`);g(a.pushNotificationSettings),k(a.pushNotificationSettings.tokenTeamId??""),r(a.pushNotificationSettings.tokenKeyId??"")}catch(a){U(a instanceof Error?a.message:String(a))}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void V(),0);return()=>window.clearTimeout(a)},[V]);let W=async a=>{a.preventDefault(),S(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation SaveApnsToken($input: SaveApnsTokenSettingsInput!) { saveApnsTokenSettings(input: $input) { ${L} } }`,{input:{teamId:i,keyId:q,privateKey:A||null}});g(a.saveApnsTokenSettings),B(""),U(null)}catch(a){U(a instanceof Error?a.message:String(a))}finally{S(!1)}},X=async a=>{a.preventDefault(),S(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation AddApnsCertificate($input: AddApnsCertificateCredentialInput!) { addApnsCertificateCredential(input: $input) { ${L} } }`,{input:{name:C,topic:G,environment:J,p12Base64:N,passphrase:P}});g(a.addApnsCertificateCredential),E(""),I(""),O(""),Q(""),U(null)}catch(a){U(a instanceof Error?a.message:String(a))}finally{S(!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:[T&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:T})}),(0,b.jsxs)("form",{className:"space-y-4",onSubmit:W,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:e?.tokenConfigured?"default":"secondary",children:e?.tokenConfigured?a("configured"):a("notConfigured")})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("tokenSetupHelp")," ",(0,b.jsx)(F,{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,{id:"apns-team",onChange:a=>k(a.target.value),value:i})]}),(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,{id:"apns-key",onChange:a=>r(a.target.value),value:q})]})]}),(0,b.jsxs)("p",{className:"text-xs text-muted-foreground",children:[a("teamIdHelp")," ",(0,b.jsx)(F,{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,{})," ",A?a("p8Ready"):e?.tokenConfigured?a("replaceP8"):a("chooseP8"),(0,b.jsx)(w.Input,{accept:".p8",className:"sr-only",onChange:a=>{let b=a.target.files?.[0];b&&b.text().then(B)},type:"file"})]}),e?.tokenPrivateKeyFingerprint&&(0,b.jsxs)("p",{className:"break-all font-mono text-xs text-muted-foreground",children:["SHA-256 ",e.tokenPrivateKeyFingerprint]}),e?.tokenLastError&&(0,b.jsx)("p",{className:"text-sm text-destructive",children:e.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()=>{g((await (0,z.controlPlaneRequest)(`mutation { clearApnsTokenSettings { ${L} } }`)).clearApnsTokenSettings),k(""),r("")},title:a("removeToken"),trigger:(0,b.jsxs)(u.Button,{disabled:R||!e?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{})," ",a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:R||!i||!q||!A&&!e?.tokenConfigured,type:"submit",children:[R?(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:X,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)(F,{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,{onChange:a=>E(a.target.value),value:C})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("topic")}),(0,b.jsx)(w.Input,{onChange:a=>I(a.target.value),value:G})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("environment")}),(0,b.jsxs)(K.Select,{onValueChange:M,value:J,children:[(0,b.jsx)(K.SelectTrigger,{children:(0,b.jsx)(K.SelectValue,{})}),(0,b.jsxs)(K.SelectContent,{children:[(0,b.jsx)(K.SelectItem,{value:"SANDBOX",children:"Sandbox"}),(0,b.jsx)(K.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,{})," ",N?a("p12Ready"):a("chooseP12"),(0,b.jsx)(w.Input,{accept:".p12,.pfx",className:"sr-only",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(O)},type:"file"})]}),(0,b.jsxs)("div",{className:"space-y-2",children:[(0,b.jsx)(x.Label,{children:a("passphrase")}),(0,b.jsx)(w.Input,{onChange:a=>Q(a.target.value),type:"password",value:P})]})]}),(0,b.jsx)("div",{className:"flex justify-end",children:(0,b.jsxs)(u.Button,{disabled:R||!C||!G||!N,type:"submit",children:[(0,b.jsx)(h.Save,{})," ",a("addCertificate")]})})]}),e?.certificates.map(e=>(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:e.name}),(0,b.jsxs)("p",{className:"font-mono text-xs",children:[e.topic," · ",e.environment]}),(0,b.jsxs)("p",{className:"font-mono text-xs text-muted-foreground",children:["SHA-256 ",e.fingerprint]}),e.expiresAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("expires",{date:(0,H.formatDateValue)(e.expiresAt,"short",{locale:d,showTime:!1})})}),e.lastTestedAt&&(0,b.jsx)("p",{className:"text-xs text-muted-foreground",children:a("lastTested",{date:(0,H.formatDateValue)(e.lastTestedAt,"short",{locale:d})})}),e.lastError&&(0,b.jsx)("p",{className:"text-xs text-destructive",children:e.lastError})]}),(0,b.jsxs)("div",{className:"flex items-center gap-1",children:[(0,b.jsxs)(u.Button,{disabled:R,onClick:()=>void(async()=>{S(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation Retest($id: ID!) { retestApnsCertificateCredential(id: $id) { ${L} } }`,{id:e.id});g(a.retestApnsCertificateCredential),U(null)}catch(a){U(a instanceof Error?a.message:String(a)),await V()}finally{S(!1)}})(),size:"sm",variant:"outline",children:[(0,b.jsx)(D.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:e.id}),await V()},title:a("removeCertificate"),trigger:(0,b.jsx)(u.Button,{size:"icon-sm",variant:"ghost",children:(0,b.jsx)(j.Trash2,{})})})]})]},e.id))]})]})}let N="siteUrl email tokenConfigured cacheTtlSeconds updatedAt";function O({embedded:a=!1}={}){let d=(0,n.useTranslations)("jiraSettings"),e=(0,n.useTranslations)("common"),[g,i]=(0,o.useState)(null),[l,m]=(0,o.useState)(""),[q,r]=(0,o.useState)(""),[A,B]=(0,o.useState)(""),[C,D]=(0,o.useState)(null),[E,G]=(0,o.useState)(!0),[H,I]=(0,o.useState)(!1),[J,K]=(0,o.useState)(null),[L,M]=(0,o.useState)(null),[P,Q]=(0,o.useState)(!1),R=a=>{i(a),m(a.siteUrl??""),r(a.email??""),B("")},S=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query { jiraSettings { ${N} } }`);R(a.jiraSettings)}catch(a){K(a instanceof Error?a.message:String(a))}finally{G(!1)}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void S(),0);return()=>window.clearTimeout(a)},[S]);let T=async a=>{I(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveJiraSettings($input: SaveJiraSettingsInput!) { saveJiraSettings(input: $input) { ${N} } }`,{input:{siteUrl:l,email:q,apiToken:A||null,resetSite:a}});R(b.saveJiraSettings),D(null),K(null),M(d("saved"))}catch(a){K(a instanceof Error?a.message:String(a)),M(null)}finally{I(!1)}},U=async()=>{I(!0);try{let a=await (0,z.controlPlaneRequest)("mutation { testJiraConnection { accountId displayName emailAddress } }");D(a.testJiraConnection),K(null),M(d("connectionSucceeded"))}catch(a){D(null),K(a instanceof Error?a.message:String(a)),M(null)}finally{I(!1)}},V=async()=>{I(!0);try{let a=await (0,z.controlPlaneRequest)(`mutation { clearJiraCredentials { ${N} } }`);R(a.clearJiraCredentials),D(null),K(null),M(d("removed"))}catch(a){K(a instanceof Error?a.message:String(a))}finally{I(!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")})]}),E?(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(),g?.siteUrl&&g.siteUrl!==l.trim().replace(/\/$/,""))?Q(!0):T(!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:g?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:g?.tokenConfigured?d("configured"):d("notConfigured")})]}),J&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:J})}),L&&(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:L})]}),(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",onChange:a=>m(a.target.value),placeholder:"https://example.atlassian.net",required:!0,type:"url",value:l}),(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",onChange:a=>r(a.target.value),required:!0,type:"email",value:q}),(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",id:"jira-token",onChange:a=>B(a.target.value),placeholder:g?.tokenConfigured?d("tokenPlaceholderConfigured"):d("tokenPlaceholder"),required:!g?.tokenConfigured,type:"password",value:A}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:g?.tokenConfigured?d("tokenKeepHelp"):d("tokenHelp")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[d("tokenAcquireHelp")," ",(0,b.jsx)(F,{href:"https://id.atlassian.com/manage-profile/security/api-tokens",children:d("createToken")})]})]}),C&&(0,b.jsx)(s.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:C.displayName}),(0,b.jsx)("p",{className:"text-muted-foreground",children:C.emailAddress??C.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:V,title:d("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:H||!g?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),d("remove")]})}),(0,b.jsxs)(u.Button,{disabled:H||!g?.tokenConfigured,onClick:()=>void U(),type:"button",variant:"outline",children:[(0,b.jsx)(k,{}),d("test")]}),(0,b.jsxs)(u.Button,{disabled:H,type:"submit",children:[H?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{}),d("save")]})]})]})})}),(0,b.jsx)(p.ConfirmationDialog,{actionLabel:e("continue"),cancelLabel:e("cancel"),description:e("cannotBeUndone"),onConfirm:()=>T(!0),onOpenChange:Q,open:P,title:d("confirmSiteChange")})]})}var P=a.i(648104);let Q="tokenConfigured defaultJiraKeyRegex updatedAt",R="configured appId installationId privateKeyConfigured keyFingerprint appSlug accountLogin repositorySelection actionsPermission verifiedAt updatedAt";function S({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 T(){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!) {
24
24
  saveWorktreeSettings(editorVariant: $editorVariant) { editorVariant }
25
- }`,{editorVariant:c}),l(a("saved")),n(null)}catch(a){n(a instanceof Error?a.message:String(a)),l(null)}finally{j(!1)}};return(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.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)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:m})}),k&&(0,b.jsx)(t.Alert,{children:(0,b.jsx)(t.AlertDescription,{children:k})}),f?(0,b.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.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)(y.Label,{htmlFor:"editor-variant",children:a("label")}),(0,b.jsxs)(J.Select,{onValueChange:a=>e(a),value:c,children:[(0,b.jsx)(J.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,b.jsx)(J.SelectValue,{})}),(0,b.jsxs)(J.SelectContent,{children:[(0,b.jsx)(J.SelectItem,{value:"CODE",children:a("code")}),(0,b.jsx)(J.SelectItem,{value:"CODE_INSIDERS",children:a("insiders")}),(0,b.jsx)(J.SelectItem,{value:"NONE",children:a("none")})]})]})]}),(0,b.jsxs)(v.Button,{disabled:h,onClick:()=>void q(),children:[h?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{})," ",a("save")]})]})]})})}function T(){let a=(0,o.useTranslations)("githubAppSettings"),d=(0,o.useTranslations)("common"),f=(0,n.useLocale)(),[r,s]=(0,p.useState)(null),[B,C]=(0,p.useState)(""),[D,E]=(0,p.useState)(""),[H,I]=(0,p.useState)(""),[J,K]=(0,p.useState)(""),[L,M]=(0,p.useState)(!1),[N,O]=(0,p.useState)(!0),[P,R]=(0,p.useState)(!1),[S,T]=(0,p.useState)(null),[U,V]=(0,p.useState)(null),W=(0,p.useCallback)(a=>{s(a),C(a.appId??""),E(a.installationId??""),I("")},[]),X=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${Q} } }`);W(a.githubAppSettings)}catch(a){T(a instanceof Error?a.message:String(a))}finally{O(!1)}},[W]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>{K(window.location.origin),X()},0);return()=>window.clearTimeout(a)},[X]);let Y=async b=>{b.preventDefault(),R(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
26
- saveGitHubAppSettings(input: $input) { ${Q} }
27
- }`,{input:{appId:B.trim(),installationId:D.trim(),privateKey:H||null}});W(b.saveGitHubAppSettings),T(null),V(H&&r?.configured?a("rotated"):a("saved"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{R(!1)}},Z=async()=>{R(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation TestGitHubAppConnection {
28
- testGitHubAppConnection { ${Q} }
29
- }`);W(b.testGitHubAppConnection),T(null),V(a("connectionSucceeded"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{R(!1)}},$=async()=>{R(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
30
- clearGitHubAppCredentials { ${Q} }
31
- }`);W(b.clearGitHubAppCredentials),T(null),V(a("removed"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{R(!1)}},_=async b=>{if(!b.name.toLowerCase().endsWith(".pem")){T(a("pemFileInvalid")),V(null);return}try{let c=await b.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(c)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(c)){T(a("pemFileInvalid")),V(null);return}I(c),T(null),V(a("pemFileLoaded",{filename:b.name}))}catch{T(a("pemFileReadError")),V(null)}};return(0,b.jsx)("form",{onSubmit:Y,children:(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.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)(j.ShieldCheck,{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")})]})]}),(0,b.jsx)(u.Badge,{className:r?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:r?.configured?a("verified"):a("notConfigured")})]}),N?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[S&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:S})}),U&&(0,b.jsxs)(t.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)(t.AlertDescription,{className:"text-current",children:U})]}),(0,b.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,b.jsx)("h3",{className:"font-medium",children:a("setupTitle")}),(0,b.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,b.jsxs)("li",{children:[a("stepRegister")," ",(0,b.jsxs)("a",{className:"inline-flex items-center gap-1 text-primary hover:underline",href:"https://github.com/settings/apps/new",rel:"noreferrer",target:"_blank",children:[a("registerLink"),(0,b.jsx)(e.ExternalLink,{className:"size-3"})]})]}),(0,b.jsxs)("li",{children:[a("stepHomepage")," ",(0,b.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:J}),a("stepHomepageSuffix")]}),(0,b.jsx)("li",{children:a("stepPermissions")}),(0,b.jsx)("li",{children:a("stepInstall")}),(0,b.jsxs)("li",{children:[a("stepInstallationId")," ",(0,b.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>"}),a("stepInstallationIdSuffix")]}),(0,b.jsx)("li",{children:a("stepCredentials")})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:a("appId")}),(0,b.jsx)(x.Input,{id:"github-app-id",inputMode:"numeric",onChange:a=>C(a.target.value),placeholder:a("appIdPlaceholder"),required:!0,value:B})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:a("installationId")}),(0,b.jsx)(x.Input,{id:"github-installation-id",inputMode:"numeric",onChange:a=>E(a.target.value),placeholder:a("installationIdPlaceholder"),required:!0,value:D})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:a("privateKey")}),(0,b.jsxs)("div",{"aria-label":a("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${L?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),M(!0)},onDragLeave:()=>M(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",M(!0)},onDrop:a=>{a.preventDefault(),M(!1);let b=a.dataTransfer.files.item(0);b&&_(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)(m.Upload,{className:"size-3.5"}),a("pemDropHint")]}),(0,b.jsx)(F.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",id:"github-app-private-key",onChange:a=>I(a.target.value),placeholder:r?.privateKeyConfigured?a("privateKeyPlaceholderConfigured"):a("privateKeyPlaceholder"),required:!r?.privateKeyConfigured,value:H})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:r?.privateKeyConfigured?a("privateKeyKeepHelp"):a("privateKeyHelp")})]}),r?.configured&&(0,b.jsxs)(t.Alert,{className:"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)(g.KeyRound,{}),(0,b.jsxs)(t.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)("p",{className:"font-medium",children:a("connectedAs",{app:r.appSlug??"—",account:r.accountLogin??"—"})}),(0,b.jsx)("p",{className:"mt-1 text-xs",children:a("connectionDetails",{permission:r.actionsPermission??"—",selection:r.repositorySelection??"—"})}),r.verifiedAt&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:a("lastVerified",{date:(0,G.formatDateValue)(r.verifiedAt,"short",{locale:f})})}),r.keyFingerprint&&(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:r.keyFingerprint})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:$,title:a("confirmRemove"),trigger:(0,b.jsxs)(v.Button,{disabled:P||!r?.configured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{}),a("remove")]})}),(0,b.jsxs)(v.Button,{disabled:P||!r?.configured,onClick:()=>void Z(),type:"button",variant:"outline",children:[(0,b.jsx)(l,{}),a("test")]}),(0,b.jsxs)(v.Button,{disabled:P,type:"submit",children:[P?(0,b.jsx)(z.Spinner,{}):H&&r?.configured?(0,b.jsx)(h.RotateCw,{}):(0,b.jsx)(i.Save,{}),H&&r?.configured?a("rotate"):a("save")]})]})]})]})})})}function U(){let a=(0,o.useTranslations)("githubSettings"),d=(0,o.useTranslations)("common"),[e,g]=(0,p.useState)(null),[h,j]=(0,p.useState)(""),[m,n]=(0,p.useState)(null),[r,s]=(0,p.useState)(!0),[B,C]=(0,p.useState)(!1),[D,E]=(0,p.useState)(null),[F,G]=(0,p.useState)(null),H=a=>{g(a),j("")},I=(0,p.useCallback)(async()=>{try{let a=await (0,A.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${P} } }`);H(a.githubSettings)}catch(a){E(a instanceof Error?a.message:String(a))}finally{s(!1)}},[]);(0,p.useEffect)(()=>{let a=window.setTimeout(()=>void I(),0);return()=>window.clearTimeout(a)},[I]);let J=async b=>{b.preventDefault(),C(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
32
- saveGitHubSettings(input: $input) { ${P} }
33
- }`,{input:{apiToken:h||null}});H(b.saveGitHubSettings),n(null),E(null),G(a("saved"))}catch(a){E(a instanceof Error?a.message:String(a)),G(null)}finally{C(!1)}},K=async()=>{C(!0);try{let b=await (0,A.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");n(b.testGitHubConnection),E(null),G(a("connectionSucceeded"))}catch(a){n(null),E(a instanceof Error?a.message:String(a)),G(null)}finally{C(!1)}},L=async()=>{C(!0);try{let b=await (0,A.controlPlaneRequest)(`mutation ClearGitHubCredentials {
34
- clearGitHubCredentials { ${P} }
35
- }`);H(b.clearGitHubCredentials),n(null),E(null),G(a("removed"))}catch(a){E(a instanceof Error?a.message:String(a)),G(null)}finally{C(!1)}};return(0,b.jsx)("form",{onSubmit:J,children:(0,b.jsx)(w.Card,{children:(0,b.jsxs)(w.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.GitPullRequest,{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")})]})]}),(0,b.jsx)(u.Badge,{className:e?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:e?.tokenConfigured?a("configured"):a("notConfigured")})]}),r?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(z.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[D&&(0,b.jsx)(t.Alert,{variant:"destructive",children:(0,b.jsx)(t.AlertDescription,{children:D})}),F&&(0,b.jsxs)(t.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)(t.AlertDescription,{className:"text-current",children:F})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(y.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:a("apiToken")}),(0,b.jsx)(x.Input,{autoComplete:"new-password",id:"github-token",onChange:a=>j(a.target.value),placeholder:e?.tokenConfigured?a("tokenPlaceholderConfigured"):a("tokenPlaceholder"),required:!e?.tokenConfigured,type:"password",value:h}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:e?.tokenConfigured?a("tokenKeepHelp"):a("tokenHelp")})]}),m&&(0,b.jsx)(t.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:m.name??m.login}),(0,b.jsxs)("a",{className:"text-sm text-primary hover:underline",href:m.url,rel:"noreferrer",target:"_blank",children:["@",m.login]})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(q.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:L,title:a("confirmRemove"),trigger:(0,b.jsxs)(v.Button,{disabled:B||!e?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(k.Trash2,{}),a("remove")]})}),(0,b.jsxs)(v.Button,{disabled:B||!e?.tokenConfigured,onClick:()=>void K(),type:"button",variant:"outline",children:[(0,b.jsx)(l,{}),a("test")]}),(0,b.jsxs)(v.Button,{disabled:B,type:"submit",children:[B?(0,b.jsx)(z.Spinner,{}):(0,b.jsx)(i.Save,{}),a("save")]})]})]})]})})})}a.s(["SettingsPage",0,function(){let a=(0,o.useTranslations)("settings");return(0,b.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:a("title")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a("description")})]}),(0,b.jsx)(O.DatabaseEncryptionAlert,{}),(0,b.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,b.jsx)(R,{description:a("developmentGroupDescription"),id:"settings-development",title:a("developmentGroup"),children:(0,b.jsx)(S,{})}),(0,b.jsxs)(R,{description:a("appleGroupDescription"),id:"settings-apple",title:a("appleGroup"),children:[(0,b.jsx)(I,{}),(0,b.jsx)(L,{})]})]}),(0,b.jsx)("div",{className:"min-w-0",children:(0,b.jsxs)(R,{description:a("integrationsGroupDescription"),id:"settings-integrations",title:a("integrationsGroup"),children:[(0,b.jsx)(N,{embedded:!0}),(0,b.jsx)(U,{}),(0,b.jsx)(T,{}),(0,b.jsx)(C,{})]})})]})]})}],753934)}];
25
+ }`,{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)(K.Select,{onValueChange:a=>e(a),value:c,children:[(0,b.jsx)(K.SelectTrigger,{className:"w-full",id:"editor-variant",children:(0,b.jsx)(K.SelectValue,{})}),(0,b.jsxs)(K.SelectContent,{children:[(0,b.jsx)(K.SelectItem,{value:"CODE",children:a("code")}),(0,b.jsx)(K.SelectItem,{value:"CODE_INSIDERS",children:a("insiders")}),(0,b.jsx)(K.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)(F,{href:"https://code.visualstudio.com/download",children:a("downloadCode")}),(0,b.jsx)(F,{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 U(){let a=(0,n.useTranslations)("githubAppSettings"),d=(0,n.useTranslations)("common"),e=(0,m.useLocale)(),[q,r]=(0,o.useState)(null),[A,B]=(0,o.useState)(""),[C,D]=(0,o.useState)(""),[E,I]=(0,o.useState)(""),[J,K]=(0,o.useState)(""),[L,M]=(0,o.useState)(!1),[N,O]=(0,o.useState)(!0),[P,Q]=(0,o.useState)(!1),[S,T]=(0,o.useState)(null),[U,V]=(0,o.useState)(null),W=(0,o.useCallback)(a=>{r(a),B(a.appId??""),D(a.installationId??""),I("")},[]),X=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query GitHubAppSettings { githubAppSettings { ${R} } }`);W(a.githubAppSettings)}catch(a){T(a instanceof Error?a.message:String(a))}finally{O(!1)}},[W]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>{K(window.location.origin),X()},0);return()=>window.clearTimeout(a)},[X]);let Y=async b=>{b.preventDefault(),Q(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveGitHubAppSettings($input: SaveGitHubAppSettingsInput!) {
26
+ saveGitHubAppSettings(input: $input) { ${R} }
27
+ }`,{input:{appId:A.trim(),installationId:C.trim(),privateKey:E||null}});W(b.saveGitHubAppSettings),T(null),V(E&&q?.configured?a("rotated"):a("saved"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{Q(!1)}},Z=async()=>{Q(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation TestGitHubAppConnection {
28
+ testGitHubAppConnection { ${R} }
29
+ }`);W(b.testGitHubAppConnection),T(null),V(a("connectionSucceeded"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{Q(!1)}},$=async()=>{Q(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation ClearGitHubAppCredentials {
30
+ clearGitHubAppCredentials { ${R} }
31
+ }`);W(b.clearGitHubAppCredentials),T(null),V(a("removed"))}catch(a){T(a instanceof Error?a.message:String(a)),V(null)}finally{Q(!1)}},_=async b=>{if(!b.name.toLowerCase().endsWith(".pem")){T(a("pemFileInvalid")),V(null);return}try{let c=await b.text();if(!/-----BEGIN (?:RSA )?PRIVATE KEY-----/.test(c)||!/-----END (?:RSA )?PRIVATE KEY-----/.test(c)){T(a("pemFileInvalid")),V(null);return}I(c),T(null),V(a("pemFileLoaded",{filename:b.name}))}catch{T(a("pemFileReadError")),V(null)}};return(0,b.jsx)("form",{onSubmit:Y,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)(i.ShieldCheck,{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")})]})]}),(0,b.jsx)(t.Badge,{className:q?.configured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:q?.configured?a("verified"):a("notConfigured")})]}),N?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[S&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:S})}),U&&(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:U})]}),(0,b.jsxs)("div",{className:"rounded-lg border bg-muted/30 p-4",children:[(0,b.jsx)("h3",{className:"font-medium",children:a("setupTitle")}),(0,b.jsxs)("ol",{className:"mt-3 list-decimal space-y-3 pl-5 text-sm text-muted-foreground",children:[(0,b.jsxs)("li",{children:[a("stepRegister")," ",(0,b.jsx)(F,{href:"https://github.com/settings/apps/new",children:a("registerLink")})]}),(0,b.jsxs)("li",{children:[a("stepHomepage")," ",(0,b.jsx)("code",{className:"break-all rounded bg-muted px-1 py-0.5 text-xs text-foreground",children:J}),a("stepHomepageSuffix")]}),(0,b.jsx)("li",{children:a("stepPermissions")}),(0,b.jsx)("li",{children:a("stepInstall")}),(0,b.jsxs)("li",{children:[a("stepInstallationId")," ",(0,b.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>"}),a("stepInstallationIdSuffix")]}),(0,b.jsx)("li",{children:a("stepCredentials")})]})]}),(0,b.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-id",children:a("appId")}),(0,b.jsx)(w.Input,{id:"github-app-id",inputMode:"numeric",onChange:a=>B(a.target.value),placeholder:a("appIdPlaceholder"),required:!0,value:A})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-installation-id",children:a("installationId")}),(0,b.jsx)(w.Input,{id:"github-installation-id",inputMode:"numeric",onChange:a=>D(a.target.value),placeholder:a("installationIdPlaceholder"),required:!0,value:C})]})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-app-private-key",children:a("privateKey")}),(0,b.jsxs)("div",{"aria-label":a("privateKeyDropZone"),className:`rounded-md border border-dashed p-2 transition-colors ${L?"border-primary bg-primary/5":"border-input"}`,onDragEnter:a=>{a.preventDefault(),M(!0)},onDragLeave:()=>M(!1),onDragOver:a=>{a.preventDefault(),a.dataTransfer.dropEffect="copy",M(!0)},onDrop:a=>{a.preventDefault(),M(!1);let b=a.dataTransfer.files.item(0);b&&_(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"}),a("pemDropHint")]}),(0,b.jsx)(G.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",id:"github-app-private-key",onChange:a=>I(a.target.value),placeholder:q?.privateKeyConfigured?a("privateKeyPlaceholderConfigured"):a("privateKeyPlaceholder"),required:!q?.privateKeyConfigured,value:E})]}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:q?.privateKeyConfigured?a("privateKeyKeepHelp"):a("privateKeyHelp")})]}),q?.configured&&(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)(f.KeyRound,{}),(0,b.jsxs)(s.AlertDescription,{className:"text-emerald-700 dark:text-emerald-300",children:[(0,b.jsx)("p",{className:"font-medium",children:a("connectedAs",{app:q.appSlug??"—",account:q.accountLogin??"—"})}),(0,b.jsx)("p",{className:"mt-1 text-xs",children:a("connectionDetails",{permission:q.actionsPermission??"—",selection:q.repositorySelection??"—"})}),q.verifiedAt&&(0,b.jsx)("p",{className:"mt-1 text-xs",children:a("lastVerified",{date:(0,H.formatDateValue)(q.verifiedAt,"short",{locale:e})})}),q.keyFingerprint&&(0,b.jsx)("p",{className:"mt-1 break-all font-mono text-xs",children:q.keyFingerprint})]})]}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:$,title:a("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:P||!q?.configured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:P||!q?.configured,onClick:()=>void Z(),type:"button",variant:"outline",children:[(0,b.jsx)(k,{}),a("test")]}),(0,b.jsxs)(u.Button,{disabled:P,type:"submit",children:[P?(0,b.jsx)(y.Spinner,{}):E&&q?.configured?(0,b.jsx)(g.RotateCw,{}):(0,b.jsx)(h.Save,{}),E&&q?.configured?a("rotate"):a("save")]})]})]})]})})})}function V(){let a=(0,n.useTranslations)("githubSettings"),d=(0,n.useTranslations)("common"),[f,g]=(0,o.useState)(null),[i,l]=(0,o.useState)(""),[m,q]=(0,o.useState)(null),[r,A]=(0,o.useState)(!0),[B,C]=(0,o.useState)(!1),[D,E]=(0,o.useState)(null),[G,H]=(0,o.useState)(null),I=a=>{g(a),l("")},J=(0,o.useCallback)(async()=>{try{let a=await (0,z.controlPlaneRequest)(`query GitHubSettings { githubSettings { ${Q} } }`);I(a.githubSettings)}catch(a){E(a instanceof Error?a.message:String(a))}finally{A(!1)}},[]);(0,o.useEffect)(()=>{let a=window.setTimeout(()=>void J(),0);return()=>window.clearTimeout(a)},[J]);let K=async b=>{b.preventDefault(),C(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation SaveGitHubSettings($input: SaveGitHubSettingsInput!) {
32
+ saveGitHubSettings(input: $input) { ${Q} }
33
+ }`,{input:{apiToken:i||null}});I(b.saveGitHubSettings),q(null),E(null),H(a("saved"))}catch(a){E(a instanceof Error?a.message:String(a)),H(null)}finally{C(!1)}},L=async()=>{C(!0);try{let b=await (0,z.controlPlaneRequest)("mutation TestGitHubConnection { testGitHubConnection { login name avatarUrl url } }");q(b.testGitHubConnection),E(null),H(a("connectionSucceeded"))}catch(a){q(null),E(a instanceof Error?a.message:String(a)),H(null)}finally{C(!1)}},M=async()=>{C(!0);try{let b=await (0,z.controlPlaneRequest)(`mutation ClearGitHubCredentials {
34
+ clearGitHubCredentials { ${Q} }
35
+ }`);I(b.clearGitHubCredentials),q(null),E(null),H(a("removed"))}catch(a){E(a instanceof Error?a.message:String(a)),H(null)}finally{C(!1)}};return(0,b.jsx)("form",{onSubmit:K,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)(e.GitPullRequest,{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")})]})]}),(0,b.jsx)(t.Badge,{className:f?.tokenConfigured?"border-emerald-500/30 bg-emerald-500/10 text-emerald-700 dark:text-emerald-300":void 0,children:f?.tokenConfigured?a("configured"):a("notConfigured")})]}),r?(0,b.jsxs)("div",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,b.jsx)(y.Spinner,{}),a("loading")]}):(0,b.jsxs)(b.Fragment,{children:[D&&(0,b.jsx)(s.Alert,{variant:"destructive",children:(0,b.jsx)(s.AlertDescription,{children:D})}),G&&(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:G})]}),(0,b.jsxs)("div",{children:[(0,b.jsx)(x.Label,{className:"mb-1.5 block text-sm font-medium",htmlFor:"github-token",children:a("apiToken")}),(0,b.jsx)(w.Input,{autoComplete:"new-password",id:"github-token",onChange:a=>l(a.target.value),placeholder:f?.tokenConfigured?a("tokenPlaceholderConfigured"):a("tokenPlaceholder"),required:!f?.tokenConfigured,type:"password",value:i}),(0,b.jsx)("p",{className:"mt-1 text-xs text-muted-foreground",children:f?.tokenConfigured?a("tokenKeepHelp"):a("tokenHelp")}),(0,b.jsxs)("p",{className:"mt-1 text-xs text-muted-foreground",children:[a("tokenAcquireHelp")," ",(0,b.jsx)(F,{href:"https://github.com/settings/personal-access-tokens/new",children:a("createToken")})]})]}),m&&(0,b.jsx)(s.Alert,{className:"bg-muted",children:(0,b.jsxs)("div",{children:[(0,b.jsx)("p",{className:"font-medium",children:m.name??m.login}),(0,b.jsxs)("a",{className:"text-sm text-primary hover:underline",href:m.url,rel:"noreferrer",target:"_blank",children:["@",m.login]})]})}),(0,b.jsxs)("div",{className:"flex flex-wrap justify-end gap-2 border-t pt-4",children:[(0,b.jsx)(p.ConfirmationDialog,{actionLabel:a("remove"),cancelLabel:d("cancel"),description:a("confirmRemoveDescription"),onConfirm:M,title:a("confirmRemove"),trigger:(0,b.jsxs)(u.Button,{disabled:B||!f?.tokenConfigured,type:"button",variant:"ghost",children:[(0,b.jsx)(j.Trash2,{}),a("remove")]})}),(0,b.jsxs)(u.Button,{disabled:B||!f?.tokenConfigured,onClick:()=>void L(),type:"button",variant:"outline",children:[(0,b.jsx)(k,{}),a("test")]}),(0,b.jsxs)(u.Button,{disabled:B,type:"submit",children:[B?(0,b.jsx)(y.Spinner,{}):(0,b.jsx)(h.Save,{}),a("save")]})]})]})]})})})}a.s(["SettingsPage",0,function(){let a=(0,n.useTranslations)("settings");return(0,b.jsxs)("section",{className:"mx-auto flex w-full max-w-[1500px] flex-col gap-6",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-2xl font-semibold tracking-tight",children:a("title")}),(0,b.jsx)("p",{className:"mt-1 text-sm text-muted-foreground",children:a("description")})]}),(0,b.jsx)(P.DatabaseEncryptionAlert,{}),(0,b.jsxs)("div",{className:"grid items-start gap-6 xl:grid-cols-2",children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-col gap-8",children:[(0,b.jsx)(S,{description:a("developmentGroupDescription"),id:"settings-development",title:a("developmentGroup"),children:(0,b.jsx)(T,{})}),(0,b.jsxs)(S,{description:a("appleGroupDescription"),id:"settings-apple",title:a("appleGroup"),children:[(0,b.jsx)(J,{}),(0,b.jsx)(M,{})]})]}),(0,b.jsx)("div",{className:"min-w-0",children:(0,b.jsxs)(S,{description:a("integrationsGroupDescription"),id:"settings-integrations",title:a("integrationsGroup"),children:[(0,b.jsx)(O,{embedded:!0}),(0,b.jsx)(V,{}),(0,b.jsx)(U,{}),(0,b.jsx)(B,{})]})})]})]})}],753934)}];
36
36
 
37
37
  //# sourceMappingURL=src_components_settings-page_tsx_06dxqc7._.js.map
@@ -7,9 +7,9 @@ globalThis.__BUILD_MANIFEST = {
7
7
  "static/chunks/0cz1d0mv5g_q7.js"
8
8
  ],
9
9
  "lowPriorityFiles": [
10
- "static/xU6QTRGzeBpwH4_PLChiN/_buildManifest.js",
11
- "static/xU6QTRGzeBpwH4_PLChiN/_ssgManifest.js",
12
- "static/xU6QTRGzeBpwH4_PLChiN/_clientMiddlewareManifest.js"
10
+ "static/HhiEyDs5GGmRv4pwGKg-m/_buildManifest.js",
11
+ "static/HhiEyDs5GGmRv4pwGKg-m/_ssgManifest.js",
12
+ "static/HhiEyDs5GGmRv4pwGKg-m/_clientMiddlewareManifest.js"
13
13
  ],
14
14
  "rootMainFiles": [
15
15
  "static/chunks/40ovzayigkz_-.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/40ovzayigkz_-.js"/><script src="/_next/static/chunks/09w24awgoam9b.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-1v9ogj_5hv56l.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="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/40ovzayigkz_-.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\":\"xU6QTRGzeBpwH4_PLChiN\"}\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\":\"/favicon.ico?favicon.2vob68tjqpejf.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"2\",{}]]\n"])</script></body></html>
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/40ovzayigkz_-.js"/><script src="/_next/static/chunks/09w24awgoam9b.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-1v9ogj_5hv56l.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="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><script src="/_next/static/chunks/0cz1d0mv5g_q7.js" noModule=""></script></head><body><div hidden=""><!--$--><!--/$--></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/40ovzayigkz_-.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\":\"HhiEyDs5GGmRv4pwGKg-m\"}\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\":\"/favicon.ico?favicon.2vob68tjqpejf.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$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/40ovzayigkz_-.js"/><script src="/_next/static/chunks/09w24awgoam9b.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-1v9ogj_5hv56l.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"/><link rel="icon" href="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/40ovzayigkz_-.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\":\"xU6QTRGzeBpwH4_PLChiN\"}\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\":\"/favicon.ico?favicon.2vob68tjqpejf.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"2\",{}]]\n"])</script></body></html>
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/40ovzayigkz_-.js"/><script src="/_next/static/chunks/09w24awgoam9b.js" async=""></script><script src="/_next/static/chunks/34oyci46fsc5w.js" async=""></script><script src="/_next/static/chunks/turbopack-1v9ogj_5hv56l.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"/><link rel="icon" href="/favicon.ico?favicon.2vob68tjqpejf.ico" sizes="256x256" type="image/x-icon"/><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,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;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/40ovzayigkz_-.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\":\"HhiEyDs5GGmRv4pwGKg-m\"}\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\":\"/favicon.ico?favicon.2vob68tjqpejf.ico\",\"sizes\":\"256x256\",\"type\":\"image/x-icon\"}],[\"$\",\"$Le\",\"2\",{}]]\n"])</script></body></html>
@@ -1 +1 @@
1
- self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"CKX6AgZRf0oV8/ChnEvEvlstAf2gNPqjGih7X4ZQHYE=\"\n}"
1
+ self.__RSC_SERVER_MANIFEST="{\n \"node\": {},\n \"edge\": {},\n \"encryptionKey\": \"hQyBzDaWqxSy4fsPS+Y1ItI94bujg2K8V1GisGMcX1g=\"\n}"
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "node": {},
3
3
  "edge": {},
4
- "encryptionKey": "CKX6AgZRf0oV8/ChnEvEvlstAf2gNPqjGih7X4ZQHYE="
4
+ "encryptionKey": "hQyBzDaWqxSy4fsPS+Y1ItI94bujg2K8V1GisGMcX1g="
5
5
  }
@@ -51,15 +51,15 @@ ${r}`}).replace(/([*_]+)(\S.*?)\1/g,(e,t,n)=>{switch(t.length){case 1:return`_${
51
51
  addJiraComment(issueKey: $issueKey, content: $content) {
52
52
  ${L}
53
53
  }
54
- }`,{issueKey:n.key,content:t});e(r.addJiraComment)}catch(e){throw a(e instanceof Error?e.message:String(e)),e}finally{l(!1)}};return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"font-semibold",children:r("comments",{count:n.comments.length})}),0===n.comments.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r("noComments")}):(0,t.jsx)(N.ItemGroup,{className:"gap-3",children:n.comments.map(e=>(0,t.jsx)(N.Item,{asChild:!0,variant:"outline",children:(0,t.jsx)("article",{children:(0,t.jsx)(N.ItemContent,{className:"@container/comment basis-full",children:(0,t.jsx)(A,{compactActionsMenu:!0,content:e.content,controlsClassName:"contents @md/comment:flex @md/comment:flex-wrap @md/comment:items-center @md/comment:justify-end @md/comment:gap-1",header:(0,t.jsx)(N.ItemTitle,{children:(0,t.jsx)(B.JiraUser,{avatarUrl:e.author?.avatarUrl??null,name:e.author?.displayName??r("unknownUser")})}),headerActions:(0,t.jsx)(M.DateTime,{className:"col-start-1 row-start-2 -mt-1 mr-auto shrink-0 text-xs text-muted-foreground",value:e.createdAt}),headerClassName:"grid grid-cols-[minmax(0,1fr)_auto] grid-rows-[auto_auto] items-start gap-x-2 gap-y-0.5 border-b pb-2 @md/comment:flex @md/comment:flex-row @md/comment:items-center @md/comment:gap-2",showFormatOverride:!1,value:e.body,viewActionsClassName:"col-start-2 row-start-1 ml-auto @md/comment:ml-0"})})})},e.id))}),(0,t.jsx)("div",{className:"border-t pt-4",children:(0,t.jsx)(E,{busy:i,error:o,onSubmit:u,submitLabel:r("addComment")})})]})}],456743);var O=e.i(776639),$=e.i(110204),U=e.i(983913),W=e.i(987968),q=e.i(677572),H=e.i(487486);let K="worktree-branch-mode",V="worktree-branch-mode-changed";function J(){if("u"<typeof document)return"NEW";let e=document.cookie.split("; ").find(e=>e.startsWith(`${K}=`))?.split("=")[1];return"EXISTING"===e||"TICKET"===e?e:"NEW"}function Z({target:e,busy:n,submitLabel:r,onSubmit:i,onSubmitError:l,recovery:o,fixedTicketKey:a}){let u=(0,c.useTranslations)("worktrees"),s=(0,p.useId)(),[h,f]=function(){let[e,t]=(0,p.useState)(J);return(0,p.useEffect)(()=>{let e=()=>t(J());return window.addEventListener(V,e),()=>window.removeEventListener(V,e)},[]),[e,e=>{document.cookie=`${K}=${e}; Max-Age=31536000; Path=/; SameSite=Lax`,t(e),window.dispatchEvent(new Event(V))}]}(),d=a?"TICKET":h,[x,k]=(0,p.useState)(""),[D,y]=(0,p.useState)(e.currentBranch??""),[v,b]=(0,p.useState)(e.currentBaseBranch??e.defaultBranch??""),[C,w]=(0,p.useState)(a??""),[A,E]=(0,p.useState)(null),[F,S]=(0,p.useState)(!1),[B,j]=(0,p.useState)(null),_=(0,p.useRef)(0);(0,p.useEffect)(()=>{let t=++_.current,n=C.trim().toUpperCase(),r=window.setTimeout(async()=>{if("TICKET"!==d||!/^[A-Z][A-Z0-9_]*-\d+$/.test(n))return void S(!1);S(!0);try{let r=await (0,I.controlPlaneRequest)(`query PreviewWorktreeTicketBranch($input: PreviewWorktreeTicketBranchInput!) {
54
+ }`,{issueKey:n.key,content:t});e(r.addJiraComment)}catch(e){throw a(e instanceof Error?e.message:String(e)),e}finally{l(!1)}};return(0,t.jsxs)("section",{className:"space-y-4",children:[(0,t.jsx)("h3",{className:"font-semibold",children:r("comments",{count:n.comments.length})}),0===n.comments.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:r("noComments")}):(0,t.jsx)(N.ItemGroup,{className:"gap-3",children:n.comments.map(e=>(0,t.jsx)(N.Item,{asChild:!0,variant:"outline",children:(0,t.jsx)("article",{children:(0,t.jsx)(N.ItemContent,{className:"@container/comment basis-full",children:(0,t.jsx)(A,{compactActionsMenu:!0,content:e.content,controlsClassName:"contents @md/comment:flex @md/comment:flex-wrap @md/comment:items-center @md/comment:justify-end @md/comment:gap-1",header:(0,t.jsx)(N.ItemTitle,{children:(0,t.jsx)(B.JiraUser,{avatarUrl:e.author?.avatarUrl??null,name:e.author?.displayName??r("unknownUser")})}),headerActions:(0,t.jsx)(M.DateTime,{className:"col-start-1 row-start-2 -mt-1 mr-auto shrink-0 text-xs text-muted-foreground",value:e.createdAt}),headerClassName:"grid grid-cols-[minmax(0,1fr)_auto] grid-rows-[auto_auto] items-start gap-x-2 gap-y-0.5 border-b pb-2 @md/comment:flex @md/comment:flex-row @md/comment:items-center @md/comment:gap-2",showFormatOverride:!1,value:e.body,viewActionsClassName:"col-start-2 row-start-1 ml-auto @md/comment:ml-0"})})})},e.id))}),(0,t.jsx)("div",{className:"border-t pt-4",children:(0,t.jsx)(E,{busy:i,error:o,onSubmit:u,submitLabel:r("addComment")})})]})}],456743);var O=e.i(776639),$=e.i(110204),U=e.i(983913),W=e.i(987968),q=e.i(677572),H=e.i(487486);let K=/^[A-Z][A-Z0-9_]*-\d+$/;function V(e){let t=e?.trim().toUpperCase()??"";return K.test(t)?t:null}function J(e){let t,n=V(e);if(n)return n;try{t=new URL(e.trim())}catch{return null}if("https:"!==t.protocol&&"http:"!==t.protocol)return null;let r=V(t.searchParams.get("selectedIssue"));if(r)return r;let i=t.pathname.split("/").filter(Boolean);for(let e=0;e<i.length-1;e+=1){if(!/^(browse|issues)$/i.test(i[e]))continue;let t=V(i[e+1]);if(t)return t}return null}let Z="worktree-branch-mode",Q="worktree-branch-mode-changed";function X(){if("u"<typeof document)return"NEW";let e=document.cookie.split("; ").find(e=>e.startsWith(`${Z}=`))?.split("=")[1];return"EXISTING"===e||"TICKET"===e?e:"NEW"}function G({target:e,busy:n,submitLabel:r,onSubmit:i,onSubmitError:l,recovery:o,fixedTicketKey:a}){let u=(0,c.useTranslations)("worktrees"),s=(0,p.useId)(),[h,f]=function(){let[e,t]=(0,p.useState)(X);return(0,p.useEffect)(()=>{let e=()=>t(X());return window.addEventListener(Q,e),()=>window.removeEventListener(Q,e)},[]),[e,e=>{document.cookie=`${Z}=${e}; Max-Age=31536000; Path=/; SameSite=Lax`,t(e),window.dispatchEvent(new Event(Q))}]}(),d=a?"TICKET":h,[x,k]=(0,p.useState)(""),[D,y]=(0,p.useState)(e.currentBranch??""),[v,b]=(0,p.useState)(e.currentBaseBranch??e.defaultBranch??""),[C,w]=(0,p.useState)(a??""),[A,E]=(0,p.useState)(null),[F,S]=(0,p.useState)(!1),[B,j]=(0,p.useState)(null),_=(0,p.useRef)(0);(0,p.useEffect)(()=>{let t=++_.current,n=J(C),r=window.setTimeout(async()=>{if("TICKET"!==d||!n)return void S(!1);S(!0);try{let r=await (0,I.controlPlaneRequest)(`query PreviewWorktreeTicketBranch($input: PreviewWorktreeTicketBranchInput!) {
55
55
  previewWorktreeTicketBranch(input: $input) { ticketKey ticketTitle ticketType projectKey branchName }
56
- }`,{input:{codebaseId:e.codebaseId,worktreeId:e.worktreeId??null,ticketKey:n}});if(t!==_.current)return;E(r.previewWorktreeTicketBranch)}catch(e){if(t!==_.current)return;j(e instanceof Error?e.message:String(e))}finally{t===_.current&&S(!1)}},400);return()=>window.clearTimeout(r)},[d,e.codebaseId,e.worktreeId,C]);let z=(0,p.useMemo)(()=>e.remoteBranches.map(t=>({value:t,label:t,description:t===e.defaultBranch?u("remoteDefault"):void 0})),[u,e.defaultBranch,e.remoteBranches]),R=(0,p.useMemo)(()=>{let t=new Set(e.localBranches),n=new Set(e.remoteBranches),r=new Set(e.unavailableBranches);return[...new Set([...t,...n])].filter(e=>!r.has(e)).sort((e,t)=>e.localeCompare(t)).map(e=>({value:e,label:e,description:t.has(e)&&n.has(e)?u("localAndOrigin"):t.has(e)?u("localBranch"):u("originBranch")}))},[u,e.localBranches,e.remoteBranches,e.unavailableBranches]),P=async e=>{e.preventDefault();let t={mode:d,baseBranch:v,..."NEW"===d?{branchName:x}:"EXISTING"===d?{branchName:D}:{ticketKey:C.trim().toUpperCase()}};try{j(null),await i(t)}catch(n){let e=n instanceof Error?n:Error(String(n));j(e.message),l?.(t,e)}},L=n||!v||"NEW"===d&&!x.trim()||"EXISTING"===d&&!D||"TICKET"===d&&(!A||F);return(0,t.jsxs)("form",{className:"space-y-4",onSubmit:e=>void P(e),children:[!a&&(0,t.jsx)(q.Tabs,{onValueChange:e=>{E(null),S(!1),j(null),f(e)},value:d,children:(0,t.jsxs)(q.TabsList,{className:"grid w-full grid-cols-3",children:[(0,t.jsx)(q.TabsTrigger,{value:"NEW",children:u("newBranch")}),(0,t.jsx)(q.TabsTrigger,{value:"EXISTING",children:u("existingBranch")}),(0,t.jsx)(q.TabsTrigger,{value:"TICKET",children:u("fromTicket")})]})}),"NEW"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",htmlFor:`${s}-branch`,children:u("branchName")}),(0,t.jsx)(T.Input,{autoComplete:"off",id:`${s}-branch`,onChange:e=>k(e.target.value),placeholder:"feature/TICKET-123-ticket-title",value:x})]}),"EXISTING"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:u("existingBranch")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:u("existingBranch"),emptyMessage:u("noMatchingBranches"),onValueChange:y,options:R,placeholder:u("selectExistingBranch"),searchPlaceholder:u("searchBranches"),value:D})]}),"TICKET"===d&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",htmlFor:`${s}-ticket`,children:u("ticketKey")}),(0,t.jsx)(T.Input,{autoComplete:"off",id:`${s}-ticket`,onChange:e=>{w(e.target.value),E(null),S(!1),j(null)},placeholder:"TICKET-123",readOnly:!!a,value:C})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(W.Spinner,{})," ",u("loadingTicketBranch")]}),A&&(0,t.jsx)(N.Item,{variant:"muted",children:(0,t.jsxs)(N.ItemContent,{children:[(0,t.jsxs)(N.ItemTitle,{className:"w-full flex-wrap",children:[(0,t.jsx)("span",{children:A.ticketKey}),A.ticketType&&(0,t.jsx)(H.Badge,{variant:"secondary",children:A.ticketType})]}),(0,t.jsx)(N.ItemDescription,{children:A.ticketTitle}),(0,t.jsx)(N.ItemDescription,{className:"break-all font-mono text-xs text-foreground",children:A.branchName})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:u("baseBranch")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:u("baseBranch"),emptyMessage:u("noMatchingBranches"),onValueChange:b,options:z,placeholder:u("selectBaseBranch"),searchPlaceholder:u("searchBranches"),value:v})]}),B&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:B})}),o,(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(g.Button,{disabled:L,type:"submit",children:[n&&(0,t.jsx)(W.Spinner,{}),r]})})]})}async function Q(e){let t=Date.now()+6e5;for(;Date.now()<t;){await new Promise(e=>window.setTimeout(e,750));let t=(await (0,I.controlPlaneRequest)("query WorktreeJob($id: ID!) { agentJob(id: $id) { status error } }",{id:e})).agentJob;if(!(!t||["QUEUED","RUNNING"].includes(t.status))){if("SUCCEEDED"!==t.status)throw Error(t.error||`Worktree operation ${t.status.toLowerCase()}`);return}}throw Error("Worktree operation is still running; check the agent job history")}async function X(e){let t=Date.now()+12e5;for(;Date.now()<t;){await new Promise(e=>window.setTimeout(e,750));let t=(await (0,I.controlPlaneRequest)(`query WorktreeMove($id: ID!) {
56
+ }`,{input:{codebaseId:e.codebaseId,worktreeId:e.worktreeId??null,ticketKey:n}});if(t!==_.current)return;E(r.previewWorktreeTicketBranch)}catch(e){if(t!==_.current)return;j(e instanceof Error?e.message:String(e))}finally{t===_.current&&S(!1)}},400);return()=>window.clearTimeout(r)},[d,e.codebaseId,e.worktreeId,C]);let z=(0,p.useMemo)(()=>e.remoteBranches.map(t=>({value:t,label:t,description:t===e.defaultBranch?u("remoteDefault"):void 0})),[u,e.defaultBranch,e.remoteBranches]),R=(0,p.useMemo)(()=>{let t=new Set(e.localBranches),n=new Set(e.remoteBranches),r=new Set(e.unavailableBranches);return[...new Set([...t,...n])].filter(e=>!r.has(e)).sort((e,t)=>e.localeCompare(t)).map(e=>({value:e,label:e,description:t.has(e)&&n.has(e)?u("localAndOrigin"):t.has(e)?u("localBranch"):u("originBranch")}))},[u,e.localBranches,e.remoteBranches,e.unavailableBranches]),P=async e=>{e.preventDefault();let t={mode:d,baseBranch:v,..."NEW"===d?{branchName:x}:"EXISTING"===d?{branchName:D}:{ticketKey:J(C)}};try{j(null),await i(t)}catch(n){let e=n instanceof Error?n:Error(String(n));j(e.message),l?.(t,e)}},L=n||!v||"NEW"===d&&!x.trim()||"EXISTING"===d&&!D||"TICKET"===d&&(!A||F);return(0,t.jsxs)("form",{className:"space-y-4",onSubmit:e=>void P(e),children:[!a&&(0,t.jsx)(q.Tabs,{onValueChange:e=>{E(null),S(!1),j(null),f(e)},value:d,children:(0,t.jsxs)(q.TabsList,{className:"grid w-full grid-cols-3",children:[(0,t.jsx)(q.TabsTrigger,{value:"NEW",children:u("newBranch")}),(0,t.jsx)(q.TabsTrigger,{value:"EXISTING",children:u("existingBranch")}),(0,t.jsx)(q.TabsTrigger,{value:"TICKET",children:u("fromTicket")})]})}),"NEW"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",htmlFor:`${s}-branch`,children:u("branchName")}),(0,t.jsx)(T.Input,{autoComplete:"off",id:`${s}-branch`,onChange:e=>k(e.target.value),placeholder:"feature/TICKET-123-ticket-title",value:x})]}),"EXISTING"===d&&(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:u("existingBranch")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:u("existingBranch"),emptyMessage:u("noMatchingBranches"),onValueChange:y,options:R,placeholder:u("selectExistingBranch"),searchPlaceholder:u("searchBranches"),value:D})]}),"TICKET"===d&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",htmlFor:`${s}-ticket`,children:u("ticketKey")}),(0,t.jsx)(T.Input,{autoComplete:"off",id:`${s}-ticket`,onChange:e=>{w(e.target.value),E(null),S(!1),j(null)},placeholder:"TICKET-123",readOnly:!!a,value:C})]}),F&&(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(W.Spinner,{})," ",u("loadingTicketBranch")]}),A&&(0,t.jsx)(N.Item,{variant:"muted",children:(0,t.jsxs)(N.ItemContent,{children:[(0,t.jsxs)(N.ItemTitle,{className:"w-full flex-wrap",children:[(0,t.jsx)("span",{children:A.ticketKey}),A.ticketType&&(0,t.jsx)(H.Badge,{variant:"secondary",children:A.ticketType})]}),(0,t.jsx)(N.ItemDescription,{children:A.ticketTitle}),(0,t.jsx)(N.ItemDescription,{className:"break-all font-mono text-xs text-foreground",children:A.branchName})]})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:u("baseBranch")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:u("baseBranch"),emptyMessage:u("noMatchingBranches"),onValueChange:b,options:z,placeholder:u("selectBaseBranch"),searchPlaceholder:u("searchBranches"),value:v})]}),B&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:B})}),o,(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(g.Button,{disabled:L,type:"submit",children:[n&&(0,t.jsx)(W.Spinner,{}),r]})})]})}async function Y(e){let t=Date.now()+6e5;for(;Date.now()<t;){await new Promise(e=>window.setTimeout(e,750));let t=(await (0,I.controlPlaneRequest)("query WorktreeJob($id: ID!) { agentJob(id: $id) { status error } }",{id:e})).agentJob;if(!(!t||["QUEUED","RUNNING"].includes(t.status))){if("SUCCEEDED"!==t.status)throw Error(t.error||`Worktree operation ${t.status.toLowerCase()}`);return}}throw Error("Worktree operation is still running; check the agent job history")}async function ee(e){let t=Date.now()+12e5;for(;Date.now()<t;){await new Promise(e=>window.setTimeout(e,750));let t=(await (0,I.controlPlaneRequest)(`query WorktreeMove($id: ID!) {
57
57
  worktreeMove(id: $id) {
58
58
  id sourceWorktreeId sourceCodebaseId targetCodebaseId targetWorktreeId destinationMode
59
59
  branch headSha deleteSource status sourceJobId targetJobId cleanupJobId error warning
60
60
  createdAt updatedAt finishedAt
61
61
  }
62
- }`,{id:e})).worktreeMove;if(!t)throw Error("Worktree move disappeared");if(!["PUSHING","CHECKING_OUT","CLEANING_UP"].includes(t.status))return t}throw Error("Worktree move is still running; it will continue in the background")}function G(e,t){return{codebaseId:e.codebase.id,...t?{worktreeId:t.id}:{},defaultBranch:e.codebase.defaultBranch,currentBranch:t?.branch,currentBaseBranch:t?.baseBranch,localBranches:e.codebase.localBranches,remoteBranches:e.codebase.remoteBranches,unavailableBranches:e.worktrees.flatMap(e=>e.branch&&e.id!==t?.id?[e.branch]:[])}}e.s(["WorktreeBranchForm",0,Z],284494),e.s(["waitForWorktreeJob",0,Q,"waitForWorktreeMove",0,X],440289),e.s(["TicketWorktreeDialog",0,function({issueKey:e,open:n,onOpenChange:r}){let i=(0,c.useTranslations)("jiraTickets"),[l,o]=(0,p.useState)(null),[a,u]=(0,p.useState)("NEW_WORKTREE"),[s,h]=(0,p.useState)(""),[f,d]=(0,p.useState)(!1),[x,k]=(0,p.useState)(!1),[D,y]=(0,p.useState)(null),[b,C]=(0,p.useState)(null),[w,A]=(0,p.useState)(null),E=(0,p.useCallback)(async()=>{d(!0);try{let e=await (0,I.controlPlaneRequest)(`query TicketWorktreeDestinations {
62
+ }`,{id:e})).worktreeMove;if(!t)throw Error("Worktree move disappeared");if(!["PUSHING","CHECKING_OUT","CLEANING_UP"].includes(t.status))return t}throw Error("Worktree move is still running; it will continue in the background")}function et(e,t){return{codebaseId:e.codebase.id,...t?{worktreeId:t.id}:{},defaultBranch:e.codebase.defaultBranch,currentBranch:t?.branch,currentBaseBranch:t?.baseBranch,localBranches:e.codebase.localBranches,remoteBranches:e.codebase.remoteBranches,unavailableBranches:e.worktrees.flatMap(e=>e.branch&&e.id!==t?.id?[e.branch]:[])}}e.s(["WorktreeBranchForm",0,G],284494),e.s(["waitForWorktreeJob",0,Y,"waitForWorktreeMove",0,ee],440289),e.s(["TicketWorktreeDialog",0,function({issueKey:e,open:n,onOpenChange:r}){let i=(0,c.useTranslations)("jiraTickets"),[l,o]=(0,p.useState)(null),[a,u]=(0,p.useState)("NEW_WORKTREE"),[s,h]=(0,p.useState)(""),[f,d]=(0,p.useState)(!1),[x,k]=(0,p.useState)(!1),[D,y]=(0,p.useState)(null),[b,C]=(0,p.useState)(null),[w,A]=(0,p.useState)(null),E=(0,p.useCallback)(async()=>{d(!0);try{let e=await (0,I.controlPlaneRequest)(`query TicketWorktreeDestinations {
63
63
  worktreeOverview {
64
64
  agents {
65
65
  agent { id name hostname connectionStatus capabilities }
@@ -73,4 +73,4 @@ ${r}`}).replace(/([*_]+)(\S.*?)\1/g,(e,t,n)=>{switch(t.length){case 1:return`_${
73
73
  }
74
74
  }
75
75
  }
76
- }`);o(e.worktreeOverview),y(null)}catch(e){y(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]);(0,p.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>void E(),0);return()=>window.clearTimeout(e)},[E,n]);let F=(0,p.useMemo)(()=>l?.agents.flatMap(e=>e.codebases.flatMap(t=>"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch")&&"AVAILABLE"===t.codebase.availability?[{agentGroup:e,group:t}]:[]))??[],[l]),S=F.filter(({group:e})=>!e.worktrees.some(e=>e.activeJob)),T=F.flatMap(({agentGroup:e,group:t})=>t.worktrees.flatMap(n=>"AVAILABLE"!==n.availability||n.activeJob?[]:[{agentGroup:e,group:t,worktree:n}])),B="NEW_WORKTREE"===a?S.some(e=>e.group.codebase.id===s)?s:1===S.length?S[0].group.codebase.id:"":T.some(e=>e.worktree.id===s)?s:1===T.length?T[0].worktree.id:"",j=S.find(e=>e.group.codebase.id===B),_=T.find(e=>e.worktree.id===B),z=j?G(j.group):_?G(_.group,_.worktree):null,R=_?.worktree??null,P="NEW_WORKTREE"===a?S.map(({agentGroup:e,group:t})=>({value:t.codebase.id,label:`${t.repository.name} \xb7 ${e.agent.name}`,description:t.codebase.folder,keywords:`${t.repository.displayOrigin} ${e.agent.hostname}`})):T.map(({agentGroup:e,group:t,worktree:n})=>({value:n.id,label:n.branch??i("detachedBranch"),description:`${t.repository.name} \xb7 ${e.agent.name}`,secondaryDescription:n.folder,keywords:`${t.repository.displayOrigin} ${e.agent.hostname}`})),L=async(e,t=!1)=>{if(!z)throw Error(i("selectWorktreeDestination"));k(!0),C(null);try{let n="NEW_WORKTREE"===a,l=await (0,I.controlPlaneRequest)(n?"mutation CreateTicketWorktree($input: CreateWorktreeInput!) { createWorktree(input: $input) { id } }":"mutation ChangeTicketWorktree($input: ChangeWorktreeBranchInput!) { changeWorktreeBranch(input: $input) { id } }",{input:n?{codebaseId:z.codebaseId,selection:e,requestId:(0,v.createClientId)()}:{worktreeId:z.worktreeId,selection:e,requestId:(0,v.createClientId)(),stashOnFailure:t}}),o=n?l.createWorktree:l.changeWorktreeBranch;if(await Q(o.id),A(null),y(null),n)return void r(!1);C(i("ticketBranchChanged")),await E()}finally{k(!1)}},M=async()=>{if(w)try{y(null),await L(w,!0)}catch(e){y(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(O.Dialog,{onOpenChange:r,open:n,children:(0,t.jsxs)(O.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[(0,t.jsxs)(O.DialogHeader,{children:[(0,t.jsx)(O.DialogTitle,{children:i("ticketWorktreeTitle",{issueKey:e})}),(0,t.jsx)(O.DialogDescription,{children:i("ticketWorktreeDescription")})]}),(0,t.jsx)(q.Tabs,{onValueChange:e=>{u(e),h(""),A(null),y(null),C(null)},value:a,children:(0,t.jsxs)(q.TabsList,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(q.TabsTrigger,{value:"NEW_WORKTREE",children:i("newWorktree")}),(0,t.jsx)(q.TabsTrigger,{value:"EXISTING_WORKTREE",children:i("existingWorktree")})]})}),D&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:D})}),b&&(0,t.jsx)(m.Alert,{children:(0,t.jsx)(m.AlertDescription,{children:b})}),f&&!l?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(W.Spinner,{})," ",i("loadingWorktreeDestinations")]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:"NEW_WORKTREE"===a?i("agentAndCodebase"):i("existingWorktree")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:i("selectWorktreeDestination"),disabled:x||0===P.length,emptyMessage:i("noWorktreeDestinations"),onValueChange:h,options:P,placeholder:i("selectWorktreeDestination"),searchPlaceholder:i("searchWorktreeDestinations"),showSelectedDetails:"EXISTING_WORKTREE"===a,value:B})]}),z?(0,t.jsx)(Z,{busy:x,fixedTicketKey:e,onSubmit:e=>L(e),onSubmitError:e=>{A("EXISTING_WORKTREE"===a&&R&&(R.hasStagedChanges||R.hasUnstagedChanges)?e:null)},recovery:w?(0,t.jsx)(m.Alert,{children:(0,t.jsxs)(m.AlertDescription,{className:"space-y-2",children:[(0,t.jsx)("p",{children:i("ticketStashRetryHelp")}),(0,t.jsxs)(g.Button,{disabled:x,onClick:()=>void M(),size:"sm",type:"button",variant:"outline",children:[x&&(0,t.jsx)(W.Spinner,{}),i("stashAndRetry")]})]})}):null,submitLabel:"NEW_WORKTREE"===a?i("createTicketWorktree"):i("createAndSwitchBranch"),target:z},`${a}:${B}:${e}`):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:P.length?i("chooseWorktreeDestination"):i("noWorktreeDestinations")})]})]})})}],741725)}]);
76
+ }`);o(e.worktreeOverview),y(null)}catch(e){y(e instanceof Error?e.message:String(e))}finally{d(!1)}},[]);(0,p.useEffect)(()=>{if(!n)return;let e=window.setTimeout(()=>void E(),0);return()=>window.clearTimeout(e)},[E,n]);let F=(0,p.useMemo)(()=>l?.agents.flatMap(e=>e.codebases.flatMap(t=>"ONLINE"===e.agent.connectionStatus&&e.agent.capabilities.includes("worktree.branch")&&"AVAILABLE"===t.codebase.availability?[{agentGroup:e,group:t}]:[]))??[],[l]),S=F.filter(({group:e})=>!e.worktrees.some(e=>e.activeJob)),T=F.flatMap(({agentGroup:e,group:t})=>t.worktrees.flatMap(n=>"AVAILABLE"!==n.availability||n.activeJob?[]:[{agentGroup:e,group:t,worktree:n}])),B="NEW_WORKTREE"===a?S.some(e=>e.group.codebase.id===s)?s:1===S.length?S[0].group.codebase.id:"":T.some(e=>e.worktree.id===s)?s:1===T.length?T[0].worktree.id:"",j=S.find(e=>e.group.codebase.id===B),_=T.find(e=>e.worktree.id===B),z=j?et(j.group):_?et(_.group,_.worktree):null,R=_?.worktree??null,P="NEW_WORKTREE"===a?S.map(({agentGroup:e,group:t})=>({value:t.codebase.id,label:`${t.repository.name} \xb7 ${e.agent.name}`,description:t.codebase.folder,keywords:`${t.repository.displayOrigin} ${e.agent.hostname}`})):T.map(({agentGroup:e,group:t,worktree:n})=>({value:n.id,label:n.branch??i("detachedBranch"),description:`${t.repository.name} \xb7 ${e.agent.name}`,secondaryDescription:n.folder,keywords:`${t.repository.displayOrigin} ${e.agent.hostname}`})),L=async(e,t=!1)=>{if(!z)throw Error(i("selectWorktreeDestination"));k(!0),C(null);try{let n="NEW_WORKTREE"===a,l=await (0,I.controlPlaneRequest)(n?"mutation CreateTicketWorktree($input: CreateWorktreeInput!) { createWorktree(input: $input) { id } }":"mutation ChangeTicketWorktree($input: ChangeWorktreeBranchInput!) { changeWorktreeBranch(input: $input) { id } }",{input:n?{codebaseId:z.codebaseId,selection:e,requestId:(0,v.createClientId)()}:{worktreeId:z.worktreeId,selection:e,requestId:(0,v.createClientId)(),stashOnFailure:t}}),o=n?l.createWorktree:l.changeWorktreeBranch;if(await Y(o.id),A(null),y(null),n)return void r(!1);C(i("ticketBranchChanged")),await E()}finally{k(!1)}},M=async()=>{if(w)try{y(null),await L(w,!0)}catch(e){y(e instanceof Error?e.message:String(e))}};return(0,t.jsx)(O.Dialog,{onOpenChange:r,open:n,children:(0,t.jsxs)(O.DialogContent,{className:"max-h-[90vh] overflow-y-auto sm:max-w-2xl",children:[(0,t.jsxs)(O.DialogHeader,{children:[(0,t.jsx)(O.DialogTitle,{children:i("ticketWorktreeTitle",{issueKey:e})}),(0,t.jsx)(O.DialogDescription,{children:i("ticketWorktreeDescription")})]}),(0,t.jsx)(q.Tabs,{onValueChange:e=>{u(e),h(""),A(null),y(null),C(null)},value:a,children:(0,t.jsxs)(q.TabsList,{className:"grid w-full grid-cols-2",children:[(0,t.jsx)(q.TabsTrigger,{value:"NEW_WORKTREE",children:i("newWorktree")}),(0,t.jsx)(q.TabsTrigger,{value:"EXISTING_WORKTREE",children:i("existingWorktree")})]})}),D&&(0,t.jsx)(m.Alert,{variant:"destructive",children:(0,t.jsx)(m.AlertDescription,{children:D})}),b&&(0,t.jsx)(m.Alert,{children:(0,t.jsx)(m.AlertDescription,{children:b})}),f&&!l?(0,t.jsxs)("p",{className:"flex items-center gap-2 text-sm text-muted-foreground",children:[(0,t.jsx)(W.Spinner,{})," ",i("loadingWorktreeDestinations")]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)($.Label,{className:"mb-1.5 block",children:"NEW_WORKTREE"===a?i("agentAndCodebase"):i("existingWorktree")}),(0,t.jsx)(U.SearchableSelect,{ariaLabel:i("selectWorktreeDestination"),disabled:x||0===P.length,emptyMessage:i("noWorktreeDestinations"),onValueChange:h,options:P,placeholder:i("selectWorktreeDestination"),searchPlaceholder:i("searchWorktreeDestinations"),showSelectedDetails:"EXISTING_WORKTREE"===a,value:B})]}),z?(0,t.jsx)(G,{busy:x,fixedTicketKey:e,onSubmit:e=>L(e),onSubmitError:e=>{A("EXISTING_WORKTREE"===a&&R&&(R.hasStagedChanges||R.hasUnstagedChanges)?e:null)},recovery:w?(0,t.jsx)(m.Alert,{children:(0,t.jsxs)(m.AlertDescription,{className:"space-y-2",children:[(0,t.jsx)("p",{children:i("ticketStashRetryHelp")}),(0,t.jsxs)(g.Button,{disabled:x,onClick:()=>void M(),size:"sm",type:"button",variant:"outline",children:[x&&(0,t.jsx)(W.Spinner,{}),i("stashAndRetry")]})]})}):null,submitLabel:"NEW_WORKTREE"===a?i("createTicketWorktree"):i("createAndSwitchBranch"),target:z},`${a}:${B}:${e}`):(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:P.length?i("chooseWorktreeDestination"):i("noWorktreeDestinations")})]})]})})}],741725)}]);