import{t as e}from"./jsx-runtime-CutOxEx1.js";import{r as t}from"./norm-f7iXVy-b.js";import{t as n}from"./sideCompareText-BRL4oo8p.js";var r=e();function i(e){let i=e.uiText||n(e.uiLanguage);return(0,r.jsxs)(r.Fragment,{children:[e.cloudConsentOpen?(0,r.jsx)(`div`,{className:`ui-sheet-backdrop`,style:{zIndex:50},children:(0,r.jsxs)(`div`,{className:`ui-sheet p-4 pb-6`,children:[(0,r.jsxs)(`div`,{className:`ui-sheet-header px-0 pt-0`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`div`,{className:`text-sm font-bold text-gray-900`,children:i.cloud.uploadTitle}),(0,r.jsx)(`div`,{className:`text-xs text-gray-400 mt-0.5 whitespace-pre-wrap`,children:e.cloudConsentMsg||i.cloud.consentFallback})]}),(0,r.jsx)(`button`,{type:`button`,onClick:e.onCloseCloudConsent,disabled:e.syncBusy,className:`ui-btn ui-btn-sm ui-btn-ghost`,children:i.common.close})]}),(0,r.jsxs)(`div`,{className:`mt-3 flex items-center justify-end gap-2`,children:[(0,r.jsx)(`button`,{type:`button`,onClick:e.onCancelCloudConsent,disabled:e.syncBusy,className:`ui-btn ui-btn-md ui-btn-outline ui-btn-pill`,children:i.common.cancel}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>void e.onConfirmCloudConsent(),disabled:e.syncBusy,className:`ui-btn ui-btn-md ui-btn-primary ui-btn-pill`,children:i.cloud.agreeUpload})]})]})}):null,e.syncOpen?(0,r.jsx)(`div`,{className:`ui-sheet-backdrop`,style:{zIndex:40},onClick:t=>{t.target===t.currentTarget&&!e.syncBusy&&e.onCloseSync()},children:(0,r.jsxs)(`div`,{className:`ui-sheet p-4 pb-6`,children:[(0,r.jsxs)(`div`,{className:`ui-sheet-header px-0 pt-0`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`div`,{className:`text-sm font-bold text-gray-900`,children:i.cloud.syncTitle}),(0,r.jsx)(`div`,{className:`text-xs text-gray-400 mt-0.5`,children:i.cloud.syncDesc})]}),(0,r.jsx)(`button`,{type:`button`,onClick:e.onCloseSync,disabled:e.syncBusy,className:`ui-btn ui-btn-sm ui-btn-ghost`,children:i.common.close})]}),e.syncView===`menu`?(0,r.jsx)(`div`,{className:`mt-3 space-y-2`,children:(0,r.jsxs)(`button`,{type:`button`,onClick:e.onOpenUploadMenu,disabled:e.syncBusy,className:[`w-full p-3 rounded-xl border text-left transition-colors`,e.syncBusy?`bg-gray-50 border-gray-100 cursor-not-allowed`:`border-gray-100 bg-white hover:bg-gray-50`].join(` `),children:[(0,r.jsx)(`div`,{className:`text-sm font-semibold text-gray-900`,children:i.cloud.localUpload}),(0,r.jsx)(`div`,{className:`mt-1 text-xs text-gray-500`,children:i.cloud.localUploadDesc})]})}):null,e.syncView===`upload`?(0,r.jsxs)(`div`,{className:`mt-3`,children:[(0,r.jsx)(`div`,{className:`text-xs text-gray-500`,children:i.cloud.pickUpload}),(0,r.jsx)(`div`,{className:`mt-2 rounded-2xl border border-gray-200 bg-white max-h-[320px] overflow-auto`,children:e.recentJobs.length?(0,r.jsx)(`div`,{className:`p-2 space-y-2`,children:e.recentJobs.slice(0,60).map(n=>{let a=t(n?.id);if(!a)return null;let o=e.uploadPickIds.includes(a),s=e.favoriteSet.has(a),c=t(n?.title)||a,l=t(n?.company)||``;return(0,r.jsxs)(`label`,{className:`flex items-start gap-2 p-2 rounded-xl hover:bg-gray-50 cursor-pointer select-none`,children:[(0,r.jsx)(`input`,{type:`checkbox`,checked:o,onChange:()=>e.onToggleUploadPick(a),className:`mt-0.5 h-4 w-4 border-gray-300 text-gray-900 focus:ring-gray-400`}),(0,r.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,r.jsx)(`div`,{className:`text-sm font-semibold text-gray-900 truncate`,children:c}),(0,r.jsx)(`div`,{className:`text-sm text-gray-600 truncate`,children:l})]}),s?(0,r.jsx)(`div`,{className:`text-xs text-amber-700 bg-amber-50 border border-amber-200 px-2 py-1 rounded-full`,children:i.cloud.uploaded}):null]},a)})}):(0,r.jsx)(`div`,{className:`p-3 text-sm text-gray-600`,children:i.cloud.noJobs})}),(0,r.jsxs)(`div`,{className:`mt-3 flex items-center justify-between gap-2`,children:[(0,r.jsx)(`button`,{type:`button`,onClick:e.onBackToSyncMenu,disabled:e.syncBusy,className:`ui-btn ui-btn-md ui-btn-outline ui-btn-pill`,children:i.cloud.back}),(0,r.jsx)(`button`,{type:`button`,onClick:()=>void e.onUploadToCloud(),disabled:e.syncBusy,className:`ui-btn ui-btn-md ui-btn-primary ui-btn-pill`,children:e.syncBusy?i.cloud.uploading:i.cloud.upload})]})]}):null,e.syncMsg?(0,r.jsx)(`div`,{className:`mt-3 ui-alert ui-alert-info whitespace-pre-wrap`,children:e.syncMsg}):null]})}):null]})}export{i as default};