PageSourceSearch

https://www.clipdesk.io/_next/static/chunks/1mq60n3n5el53.js

js clipdesk.io collected 2026-10-02 01:57:37 UTC 46,955 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,81947,e=>{"use strict";var t=e.i(43476),a=e.i(47163);let n={info:"border-blue-200 bg-blue-50 text-blue-900",success:"border-emerald-200 bg-emerald-50 text-emerald-900",warning:"border-amber-200 bg-amber-50 text-amber-900",danger:"border-rose-200 bg-rose-50 text-rose-900"};e.s(["Alert",0,function({tone:e="info",className:r,...i}){return(0,t.jsx)("div",{className:(0,a.cn)("rounded-3xl border px-4 py-3 text-sm",n[e],r),...i})}])},94179,e=>{"use strict";var t=e.i(43476),a=e.i(47163);let n={neutral:"bg-slate-100 text-slate-700",success:"bg-emerald-100 text-emerald-700",warning:"bg-amber-100 text-amber-800",danger:"bg-rose-100 text-rose-700",primary:"bg-blue-100 text-blue-700"};e.s(["Badge",0,function({tone:e="neutral",className:r,...i}){return(0,t.jsx)("span",{className:(0,a.cn)("inline-flex items-center rounded-full px-3 py-1 text-xs font-semibold uppercase tracking-[0.18em]",n[e],r),...i})}])},70065,e=>{"use strict";var t=e.i(43476),a=e.i(47163);e.s(["Card",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("surface rounded-[28px]",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("p-6 pt-0",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,t.jsx)("p",{className:(0,a.cn)("text-sm text-[var(--muted)]",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{className:(0,a.cn)("flex flex-col gap-2 p-6",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("h2",{className:(0,a.cn)("font-[var(--font-heading)] text-2xl font-semibold tracking-tight",e),...n})}])},47975,e=>{"use strict";var t=e.i(71645);e.i(96303);var a=e.i(21046);e.s(["useClipDeskSessionToken",0,function(){let{getToken:e,isLoaded:n}=(0,a.useAppAuth)(),r=(0,t.useCallback)(async()=>n?e():null,[e,n]);return{isLoaded:n,resolveToken:r}}])},15760,e=>{"use strict";var t=e.i(84976);let a=new Set(["free","pro","max","team","founder_lifetime"]),n=null,r=null,i=0,s=0;async function o(e,{token:a,signal:n,method:r="GET",body:i}={}){let s=void 0!==i;try{var l,c;let o=await fetch(`${(0,t.getApiUrl)()}${e}`,{method:r,headers:{...s?{"content-type":"application/json"}:{},...a?{authorization:`Bearer ${a}`}:{}},signal:n,...s?{body:JSON.stringify(i)}:{}}),d=await o.json().catch(()=>null);if(!o.ok){let e,t,a,n,r,i;return{ok:!1,error:(l=o.status,c=o.headers,e="string"==typeof d?.code?d.code:null,t="string"==typeof d?.message?d.message:"string"==typeof d?.error?d.error:null,a=function(e){if(!e)return null;let t=Number(e);if(Number.isFinite(t)&&t>=0)return Math.max(0,Math.ceil(1e3*t));let a=Date.parse(e);return Number.isNaN(a)?null:Math.max(0,a-Date.now())}(c?.get("retry-after")??null),n="number"==typeof d?.retryAfterSeconds?d.retryAfterSeconds:null!==a?Math.max(1,Math.ceil(a/1e3)):void 0,r="string"==typeof d?.requestId?d.requestId:void 0,i=(e?({BILLING_NOT_CONFIGURED:"Billing is not configured yet.",BILLING_CUSTOMER_MISSING:"You do not have a billing customer yet. Upgrade first to create one.",NO_BILLING_CUSTOMER:"No subscription to manage yet. Upgrade to Pro first.",NO_ACTIVE_SUBSCRIPTION:"No subscription to manage yet. Upgrade to Pro first.",STRIPE_CHECKOUT_UNAVAILABLE:"ClipDesk could not start checkout. Try again shortly.",BILLING_DATABASE_UNAVAILABLE:"ClipDesk billing data is temporarily unavailable. Try again shortly.",RATE_LIMITED:"Request rate limit reached. Wait a minute and try again."})[e]:void 0)??({401:"Please sign in again before managing billing.",403:"You do not have permission to manage this subscription.",409:"No subscription to manage yet. Upgrade to Pro first.",422:"ClipDesk could not start checkout. Refresh the page and try again.",429:"Request rate limit reached. Wait a minute and try again.",502:"ClipDesk could not reach Stripe. Try again shortly.",503:"ClipDesk billing is temporarily unavailable. Try again shortly.",500:"ClipDesk billing returned a server error. Status: 500."})[l]??(l>=500?`ClipDesk billing returned a server error. Status: ${l}.`:"The ClipDesk API is reachable, but the request could not be completed."),401===l?{code:e??"AUTH_REQUIRED",message:t??i,retryable:!1,...r?{requestId:r}:{},status:l}:403===l?{code:e??"FORBIDDEN",message:t??i,retryable:!1,...r?{requestId:r}:{},status:l}:l>=500?{code:e??"INTERNAL_ERROR",message:t??i,retryable:!0,...n?{retryAfterSeconds:n}:{},...r?{requestId:r}:{},status:l}:{code:e??"BACKEND_REQUEST_FAILED",message:t??i,retryable:408===l||429===l,...n?{retryAfterSeconds:n}:{},...r?{requestId:r}:{},status:l})}}return{ok:!0,data:d}}catch{return{ok:!1,error:{code:"BACKEND_UNAVAILABLE",message:"The backend could not be reached. Check api.clipdesk.io and CORS.",retryable:!0}}}}async function l(e){return o("/health",{signal:e})}async function c(e,t){let n=await o("/account/profile",{token:e,signal:t});if(!n.ok)return n;let r=n.data.profile?.displayName??null,i=n.data.profile?.primaryEmail??n.data.profile?.email??n.data.profile?.maskedEmail??n.data.primaryEmail??n.data.maskedEmail??null,s=n.data.profile?.organizationName??n.data.organizationName??null,l=n.data.plan?.id??n.data.planId??"free",c=a.has(l)?l:"free",d=n.data.plan?.label??({free:"Free",pro:"Pro",max:"Max",team:"Team",founder_lifetime:"Founder Lifetime"})[c],u=n.data.extensionConnection,m=void 0===u?null:!!u.connected,p=u?.label??(!0===m?"Connected to ClipDesk extension":!1===m?"Not connected yet":"Check extension connection page");return{ok:!0,data:{displayName:r,email:i,organizationName:s,plan:c,planLabel:d,extensionConnected:m,extensionLabel:p}}}async function d(e,t){let a=await o("/billing/readiness",{token:e,signal:t});if(!a.ok){if(429===a.error.status||"RATE_LIMITED"===a.error.code){let e=void 0!==a.error.retryAfterSeconds?1e3*a.error.retryAfterSeconds:6e4;return i=s=Date.now()+e,r={ok:!0,data:{checkoutReady:!1,portalReady:!1,message:"Billing status is refreshing. Try again shortly.",mode:"production"}}}return i=Date.now()+15e3,r=a,a}return i=Date.now()+3e4,r={ok:!0,data:{checkoutReady:!!a.data.checkoutReady,portalReady:!!a.data.portalReady,message:a.data.message??"Billing is ready.",mode:a.data.mode??"production"}},s=0,r}async function u(e,t,a={}){let o=Date.now();return!a.force&&r&&o<s||!a.force&&r&&o<i?r:n||(n=d(e,t).finally(()=>{n=null}))}async function m(e,a,n,r=1){let i=await o("/billing/checkout",{token:a,signal:n,method:"POST",body:{tier:e,quantity:r,successUrl:`${(0,t.getSiteUrl)()}/billing?checkout=success`,cancelUrl:`${(0,t.getSiteUrl)()}/billing?checkout=cancel`}});return i.ok?{ok:!0,data:{url:i.data.url??i.data.checkoutUrl??null,message:i.data.message??"Continue to secure checkout."}}:i}async function p(e,a){let n=await o("/billing/portal",{token:e,signal:a,method:"POST",body:{returnUrl:`${(0,t.getSiteUrl)()}/billing`}});return n.ok?{ok:!0,data:{url:n.data.url??n.data.portalUrl??null,message:n.data.message??"Continue to your subscription portal."}}:n}async function h(e,a){let n=await o("/extension/connect/code",{token:e,signal:a,method:"POST",body:{extensionId:(0,t.getExtensionId)()}});if(!n.ok)return n;let r=n.data.connectionCode??n.data.code??null,i=n.data.nonce??null;return r&&i?{ok:!0,data:{connectionCode:r,nonce:i,expiresAt:n.data.expiresAt??null}}:{ok:!1,error:{code:"BACKEND_RESPONSE_INCOMPLETE",message:"ClipDesk could not prepare a safe extension connection code.",retryable:!1}}}async function g(e,t){return o("/ocr/usage",{token:e,signal:t})}async function y(e,t,a){let n=await o("/support/tickets",{token:e,signal:a,method:"POST",body:t});return n.ok?{ok:!0,data:n.data}:n}async function f(e,t){let a=await o("/sync/preferences",{token:e,signal:t});return a.ok?{ok:!0,data:"preferences"in a.data?a.data.preferences:a.data}:a}async function b(e,t,a={},n){let r=await o("/sync/preferences",{token:e,signal:n,method:"PUT",body:{...t,...a.confirmClipContent?{confirmClipContent:!0}:{}}});return r.ok?{ok:!0,data:"preferences"in r.data?r.data.preferences:r.data}:r}async function x(e,t){let a=await o("/account/devices",{token:e,signal:t});return a.ok?{ok:!0,data:a.data.items}:a}async function C(e,t,a,n){return o("/account/devices/rename",{token:e,signal:n,method:"POST",body:{deviceId:t,deviceName:a}})}async function v(e,t,a){return o("/account/devices/revoke",{token:e,signal:a,method:"POST",body:{deviceId:t}})}async function k(e,t){let a=await o("/sync/conflicts",{token:e,signal:t});return a.ok?{ok:!0,data:Array.isArray(a.data)?a.data:a.data.conflicts}:a}let w=new Set(["settings","collections","savedFilters","clipsMetadata","clipsContent"]);function j(e){return"string"==typeof e&&!Number.isNaN(Date.parse(e))}function S(e,t){return!!e&&"object"==typeof e&&e.objectId===t.objectId&&e.objectType===t.objectType&&e.scope===t.scope&&"number"==typeof e.ver
1sion&&Number.isInteger(e.version)&&e.version>0&&"string"==typeof e.contentHash&&("none"===e.encryptionMode||"opaque"===e.encryptionMode)&&(void 0===e.deletedAt||null===e.deletedAt||j(e.deletedAt))}async function T(e,t,a){let n=await o(`/sync/conflicts/${encodeURIComponent(t)}`,{token:e,signal:a});return n.ok?!function(e){if(!e||"object"!=typeof e)return!1;let t=e.conflict;if(!t||"object"!=typeof t||"string"!=typeof t.id||"string"!=typeof t.objectId||"string"!=typeof t.objectType||!w.has(t.scope)||"open"!==t.status||!j(t.createdAt)||!j(t.expectedUpdatedAt))return!1;let a={objectId:t.objectId,objectType:t.objectType,scope:t.scope},n=e.remote;return!!n&&S(e.local,a)&&"string"==typeof n.envelopeId&&n.envelopeId.length>0&&S(n,a)}(n.data)?{ok:!1,error:{code:"SYNC_CONFLICT_DETAIL_UNSAFE",message:"The conflict detail did not match the selected object and was not displayed.",retryable:!1}}:{ok:!0,data:n.data}:n}function R(e){if(!e||"object"!=typeof e||"boolean"!=typeof e.inheritsGlobal||["readOnly","available","effectiveEnabled"].some(t=>void 0!==e[t]&&"boolean"!=typeof e[t])||void 0!==e.effectiveScopes&&(!Array.isArray(e.effectiveScopes)||!e.effectiveScopes.every(e=>w.has(e))))return!1;if(null===e.policy)return!0;let t=e.policy;return!!t&&"string"==typeof t.projectId&&0!==t.projectId.length&&!(t.projectId.length>255)&&"number"==typeof t.schemaVersion&&!!Number.isInteger(t.schemaVersion)&&!(t.schemaVersion<1)&&"boolean"==typeof t.enabled&&!!Array.isArray(t.scopes)&&!!j(t.updatedAt)&&(1===t.schemaVersion?t.scopes.every(e=>w.has(e)):t.scopes.every(e=>"string"==typeof e&&e.length>0&&e.length<=128)&&!0===e.readOnly&&!1===e.available)}async function P(e,t,a){let n=new URLSearchParams({limit:"25"});t&&n.set("cursor",t);let r=await o(`/sync/project-policies?${n.toString()}`,{token:e,signal:a});if(!r.ok)return r;if(!r.data||"object"!=typeof r.data)return{ok:!1,error:{code:"SYNC_POLICY_UNSAFE",message:"The saved project policies were malformed and were not displayed.",retryable:!1}};let i=r.data;return Array.isArray(i.items)&&i.items.every(R)&&(null===i.nextCursor||"string"==typeof i.nextCursor)?{ok:!0,data:{items:i.items,nextCursor:i.nextCursor}}:{ok:!1,error:{code:"SYNC_POLICY_UNSAFE",message:"The saved project policies were malformed and were not displayed.",retryable:!1}}}async function I(e,t,a){let n=await o(`/sync/project-policies/${encodeURIComponent(t)}`,{token:e,signal:a});return n.ok?R(n.data)?{ok:!0,data:n.data}:{ok:!1,error:{code:"SYNC_POLICY_UNSAFE",message:"The project policy was malformed and was not displayed.",retryable:!1}}:n}async function N(e,t,a,n){let r=await o(`/sync/project-policies/${encodeURIComponent(t)}`,{token:e,signal:n,method:"PUT",body:a});return r.ok?R(r.data)?{ok:!0,data:r.data}:{ok:!1,error:{code:"SYNC_POLICY_UNSAFE",message:"The saved project policy was malformed and was not applied locally.",retryable:!1}}:r}async function U(e,t,a,n){let r=`/sync/history/${encodeURIComponent(t)}/${encodeURIComponent(a)}`,i=await o(r,{token:e,signal:n});return i.ok?{ok:!0,data:Array.isArray(i.data)?i.data:i.data.history}:i}async function A(e,t,a){return o("/sync/restore",{token:e,signal:a,method:"POST",body:t})}async function $(e,t){return o("/account/cloud-data-deletion",{token:e,signal:t})}async function O(e,t,a){return o("/account/cloud-data-deletion",{token:e,signal:a,method:"POST",body:{idempotencyKey:t}})}async function L(e,t,a){return o("/team/workspaces",{token:e,signal:a,method:"POST",body:t})}async function D(e,t){return o("/team/workspaces",{token:e,signal:t})}async function E(e,t,a){return o(`/team/workspaces/${encodeURIComponent(t)}`,{token:e,signal:a})}async function M(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}`,{token:e,signal:n,method:"PATCH",body:a})}async function _(e,t,a){return o(`/team/workspaces/${encodeURIComponent(t)}/members`,{token:e,signal:a})}async function B(e,t,a){return o(`/team/workspaces/${encodeURIComponent(t)}/invites`,{token:e,signal:a})}async function F(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/invites`,{token:e,signal:n,method:"POST",body:a})}async function H(e,t,a){return o(`/team/invites/${encodeURIComponent(t)}/inspect`,{token:e,signal:a,method:"POST"})}async function q(e,t,a,n){return o(`/team/invites/${encodeURIComponent(t)}/accept`,{token:e,signal:n,method:"POST",body:{idempotencyKey:a}})}
1async function Y(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/invites/${encodeURIComponent(a)}/resend`,{token:e,signal:r,method:"POST",body:{idempotencyKey:n}})}async function G(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/invites/${encodeURIComponent(a)}/revoke`,{token:e,signal:r,method:"POST",body:{idempotencyKey:n}})}async function V(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/members/${encodeURIComponent(a)}`,{token:e,signal:r,method:"PATCH",body:n})}async function W(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/members/${encodeURIComponent(a)}`,{token:e,signal:r,method:"DELETE",body:{idempotencyKey:n}})}async function K(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/ownership/transfer`,{token:e,signal:r,method:"POST",body:{targetMembershipId:a,confirmation:"TRANSFER",idempotencyKey:n}})}function z(e,t,a=25){let n=new URLSearchParams({limit:String(a)});return t&&n.set("cursor",t),`${e}?${n.toString()}`}async function Q(e,t,a,n){return o(z(`/team/workspaces/${encodeURIComponent(t)}/collections`,a),{token:e,signal:n})}async function J(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/collections/${encodeURIComponent(a)}`,{token:e,signal:n})}async function Z(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/collections`,{token:e,signal:n,method:"POST",body:a})}async function X(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/collections/${encodeURIComponent(a)}`,{token:e,signal:r,method:"PATCH",body:n})}async function ee(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/collections/${encodeURIComponent(a)}`,{token:e,signal:r,method:"DELETE",body:{idempotencyKey:n}})}async function et(e,t,a,n,r){return o(z(`/team/workspaces/${encodeURIComponent(t)}/collections/${encodeURIComponent(a)}/clips`,n),{token:e,signal:r})}async function ea(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/clips/${encodeURIComponent(a)}`,{token:e,signal:n})}async function en(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/clips/${encodeURIComponent(a)}`,{token:e,signal:r,method:"PATCH",body:n})}async function er(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/clips/${encodeURIComponent(a)}`,{token:e,signal:r,method:"DELETE",body:{idempotencyKey:n}})}async function ei(e,t,a,n,r,i){return o(z(`/team/workspaces/${encodeURIComponent(t)}/${encodeURIComponent(a)}/${encodeURIComponent(n)}/comments`,r),{token:e,signal:i})}async function es(e,t,a,n,r,i){return o(`/team/workspaces/${encodeURIComponent(t)}/${encodeURIComponent(a)}/${encodeURIComponent(n)}/comments`,{token:e,signal:i,method:"POST",body:r})}async function eo(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/comments/${encodeURIComponent(a)}`,{token:e,signal:r,method:"PATCH",body:n})}async function el(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/comments/${encodeURIComponent(a)}`,{token:e,signal:r,method:"DELETE",body:{idempotencyKey:n}})}async function ec(e,t,a={},n){let r=new URLSearchParams({limit:"25"});return a.status&&r.set("status",a.status),a.assigneeMembershipId&&r.set("assigneeMembershipId",a.assigneeMembershipId),a.cursor&&r.set("cursor",a.cursor),o(`/team/workspaces/${encodeURIComponent(t)}/assignments?${r.toString()}`,{token:e,signal:n})}async function ed(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/exports`,{token:e,signal:n,method:"POST",body:a})}async function eu(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/exports/${encodeURIComponent(a)}`,{token:e,signal:n})}async function em(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/deletion/prepare`,{token:e,signal:n,method:"POST",body:{idempotencyKey:a}})}async function ep(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/deletion/confirm`,{token:e,signal:n,method:"POST",body:a})}async function eh(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/deletion/${encodeURIComponent(a)}`,{token:e,signal:n})}async function eg(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/deletion/${encodeURIComponent(a)}/cancel`,{token:e,signal:r,method:"POST",body:{idempotencyKey:n}})}async function ey(e,t,a,n,r){let i=new URLSearchParams({limit:"25"});return a&&i.set("eventName",a),n&&i.set("cursor",n),o(`/team/workspaces
1/${encodeURIComponent(t)}/audit?${i.toString()}`,{token:e,signal:r})}async function ef(e,t,a,n){return o(`/team/workspaces/${encodeURIComponent(t)}/assignments`,{token:e,signal:n,method:"POST",body:a})}async function eb(e,t,a,n,r){return o(`/team/workspaces/${encodeURIComponent(t)}/assignments/${encodeURIComponent(a)}`,{token:e,signal:r,method:"PATCH",body:n})}e.s(["acceptTeamInvite",0,q,"cancelTeamDeletion",0,eg,"confirmTeamDeletion",0,ep,"createBillingCheckoutForTier",0,m,"createBillingPortal",0,p,"createExtensionConnectionCode",0,h,"createSupportTicket",0,y,"createTeamAssignment",0,ef,"createTeamCollection",0,Z,"createTeamComment",0,es,"createTeamExport",0,ed,"createTeamInvite",0,F,"createTeamWorkspace",0,L,"deleteTeamClip",0,er,"deleteTeamCollection",0,ee,"deleteTeamComment",0,el,"getAccountDevices",0,x,"getAccountProfile",0,c,"getBillingReadiness",0,u,"getCloudDataDeletionStatus",0,$,"getHealth",0,l,"getOcrUsage",0,g,"getSyncConflictDetail",0,T,"getSyncConflicts",0,k,"getSyncHistory",0,U,"getSyncPreferences",0,f,"getSyncProjectPolicies",0,P,"getSyncProjectPolicy",0,I,"getTeamAssignments",0,ec,"getTeamAudit",0,ey,"getTeamClip",0,ea,"getTeamCollection",0,J,"getTeamCollectionClips",0,et,"getTeamCollections",0,Q,"getTeamComments",0,ei,"getTeamDeletion",0,eh,"getTeamExport",0,eu,"getTeamInvites",0,B,"getTeamMembers",0,_,"getTeamWorkspace",0,E,"getTeamWorkspaces",0,D,"inspectTeamInvite",0,H,"prepareTeamDeletion",0,em,"putSyncProjectPolicy",0,N,"removeTeamMember",0,W,"renameAccountDevice",0,C,"renameTeamWorkspace",0,M,"requestCloudDataDeletion",0,O,"resendTeamInvite",0,Y,"restoreSyncHistory",0,A,"revokeAccountDevice",0,v,"revokeTeamInvite",0,G,"transferTeamOwnership",0,K,"updateSyncPreferences",0,b,"updateTeamAssignment",0,eb,"updateTeamClip",0,en,"updateTeamCollection",0,X,"updateTeamComment",0,eo,"updateTeamMember",0,V])},96661,e=>{"use strict";e.s(["mergeClasses",0,(...e)=>e.filter((e,t,a)=>!!e&&""!==e.trim()&&a.indexOf(e)===t).join(" ").trim()])},71987,88973,e=>{"use strict";e.s(["default",0,{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}],71987),e.s(["hasA11yProp",0,e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1}],88973)},5014,e=>{"use strict";var t=e.i(71645),a=e.i(71987),n=e.i(88973),r=e.i(96661);let i=(0,t.createContext)({}),s=(0,t.forwardRef)(({color:e,size:s,strokeWidth:o,absoluteStrokeWidth:l,className:c="",children:d,iconNode:u,...m},p)=>{let{size:h=24,strokeWidth:g=2,absoluteStrokeWidth:y=!1,color:f="currentColor",className:b=""}=(0,t.useContext)(i)??{},x=l??y?24*Number(o??g)/Number(s??h):o??g;return(0,t.createElement)("svg",{ref:p,...a.default,width:s??h??a.default.width,height:s??h??a.default.height,stroke:e??f,strokeWidth:x,className:(0,r.mergeClasses)("lucide",b,c),...!d&&!(0,n.hasA11yProp)(m)&&{"aria-hidden":"true"},...m},[...u.map(([e,a])=>(0,t.createElement)(e,a)),...Array.isArray(d)?d:[d]])});e.s(["default",0,s],5014)},56420,22296,94672,e=>{"use strict";var t=e.i(71645),a=e.i(96661);let n=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,a)=>a?a.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var r=e.i(5014);e.s(["default",0,(e,i)=>{let s=(0,t.forwardRef)(({className:s,...o},l)=>(0,t.createElement)(r.default,{ref:l,iconNode:i,className:(0,a.mergeClasses)(`lucide-${n(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...o}));return s.displayName=n(e),s}],56420);var i=e.i(43476),s=e.i(22016);e.i(96303);var o=e.i(21046),l=e.i(81947),c=e.i(94179),d=e.i(70065),u=e.i(47975),m=e.i(15760);let p={shipped:"Available now",beta:"Beta",preview:"Preview",coming_soon:"Coming in 2.0"},h="preview",g={ocr:{title:"Scanned PDF OCR",message:"OCR is a preview, not a working feature yet. Pro is planned to include a starter quota and Max higher-volume and batch OCR; future OCR limits will never lock local data.",recommendedPlan:"pro"},citations:{title:"Citation toolkit",message:"Citation and source metadata tools are a Pro preview and are not included as a shipped capability yet.",recommendedPlan:"pro"},search:{title:"Power Search",message:"Power Search and Research Lenses are a Pro preview. Standard local search remains available on Free.",recommendedPlan:"pro"},sync:{title:"Selective sync",message:"Selective sync is a preview. Local ClipDesk access does not depend on sync or a paid subscription.",recommendedPlan:"pro"},archive:{title:"Local archive",message:"Permanent Local Archive and Link-Rot Guard are a Max preview, not a currently shipped capability.",recommendedPlan:"max"},ai:{title:"AI Research Assist",message:"Optional selected-content AI Research Assist is a Max preview, not a currently shipped capability.",recommendedPlan:"max"},migration:{title:"Migration Center",message:"Import and Migration Center is a Pro preview, not a currently shipped capability.",recommendedPlan:"pro"},review:{title:"Review Queue",message:"Review Queue and Knowledge Resurfacing are a Max preview, not a currently shipped capability.",recommendedPlan:"max"},team:{title:"Team Research Spaces",message:"Multi-seat billing is available now. Shared spaces, roles, invites, and administration remain previews.",recommendedPlan:"team"}};function y({signedIn:e,eligible:t,loading:a,usage:n,errorMessage:r}){return e?a?(0,i.jsx)(l.Alert,{"aria-live":"polite",children:"Loading OCR usage..."}
1):r?(0,i.jsx)(l.Alert,{role:"alert",tone:"warning",children:r}):t?(0,i.jsxs)(d.Card,{children:[(0,i.jsxs)(d.CardHeader,{children:[(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,i.jsx)(d.CardTitle,{children:"OCR page usage"}),(0,i.jsx)(c.Badge,{tone:"neutral",children:p[h]})]}),(0,i.jsx)(d.CardDescription,{children:"This meter reports quota state only. It does not mean the OCR engine is shipped or available."})]}),(0,i.jsx)(d.CardContent,{className:"space-y-4",children:n?(0,i.jsxs)(i.Fragment,{children:[(0,i.jsxs)("dl",{className:"grid gap-4 sm:grid-cols-3",children:[(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm text-[var(--muted)]",children:"Used + reserved"}),(0,i.jsxs)("dd",{className:"text-2xl font-semibold",children:[n.used+n.reserved," / ",n.limit]}),(0,i.jsxs)("dd",{className:"text-xs text-[var(--muted)]",children:[n.used," used, ",n.reserved," reserved"]})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm text-[var(--muted)]",children:"Remaining"}),(0,i.jsx)("dd",{className:"text-2xl font-semibold",children:n.remaining})]}),(0,i.jsxs)("div",{children:[(0,i.jsx)("dt",{className:"text-sm text-[var(--muted)]",children:"Processing"}),(0,i.jsx)("dd",{className:"text-lg font-semibold",children:"Local only"})]})]}),(0,i.jsxs)("p",{className:"text-sm text-[var(--muted)]",children:["Usage reset period started ",(0,i.jsx)("time",{dateTime:n.periodStart,children:new Intl.DateTimeFormat(void 0,{timeZone:"UTC"}).format(new Date(n.periodStart))}),"."]}),0===n.limit?(0,i.jsx)(l.Alert,{tone:"info",children:"This plan currently has no OCR page allowance."}):null,n.remaining<=0?(0,i.jsx)(l.Alert,{tone:"warning",children:"OCR page limit reached. Your local library, local search, backup, and export remain accessible."}):n.remaining<=Math.max(1,Math.ceil(.1*n.limit))?(0,i.jsxs)(l.Alert,{tone:"warning",children:["OCR page allowance is nearly used. ",n.remaining," page",1===n.remaining?" remains":"s remain","."]}):null]}):null})]}):(0,i.jsxs)(d.Card,{children:[(0,i.jsxs)(d.CardHeader,{children:[(0,i.jsx)(d.CardTitle,{children:"OCR page usage"}),(0,i.jsx)(d.CardDescription,{children:"OCR metering is unavailable on Free. OCR remains a Preview capability."})]}),(0,i.jsxs)(d.CardContent,{className:"space-y-3",children:[(0,i.jsx)("p",{className:"text-sm",children:"Your local library, local search, backup, and export remain accessible."}),(0,i.jsx)(s.default,{className:"text-sm underline",href:"/billing?plan=pro&feature=ocr",children:"Preview OCR plan packaging"})]})]}):(0,i.jsx)(l.Alert,{tone:"info",children:"Sign in to view OCR metering. Your local library remains available without an account."})}e.s(["OCR_CAPABILITY_STATUS",0,h,"billingFeatureContexts",0,g,"capabilityStatusLabels",0,p,"isBillingFeatureContext",0,function(e){return null!==e&&Object.hasOwn(g,e)},"planCapabilityCatalog",0,{free:{family:"free",name:"Free",description:"The signed-out, local-first ClipDesk core.",capabilities:[{id:"local-library",label:"Local capture library",status:"shipped"},{id:"pdf-import",label:"Text-based PDF import",status:"shipped"},{id:"organization",label:"Folders, projects, collections, tags, and notes",status:"shipped"},{id:"local-search",label:"Standard local search",status:"shipped"},{id:"local-export",label:"Basic Markdown export and local backup",status:"shipped"},{id:"living-highlights",label:"Living Highlights on web and PDF, local",status:"coming_soon",detail:"Durable, color-coded highlights that survive page changes and become cited clips. Unlimited locally."},{id:"comments",label:"Personal comments on clips and highlights",status:"coming_soon",detail:"Unlimited local margin comments and threads. Shared team comments are a Team capability."},{id:"focus-reader",label:"Focus reader mode and richer clip formatting",status:"coming_soon"}]},pro:{family:"pro",name:"Pro",description:"Serious individual research workflows.",capabilities:[{id:"free",label:"All currently available Free capabilities",status:"shipped"},{id:"premium-export",label:"Premium fixed export profiles",status:"shipped"},{id:"export-automation",label:"Custom Markdown templates and export automation",status:"preview"},{id:"ocr",label:"Scanned PDF OCR starter quota",status:h,detail:"Planned OCR usage will be metered by pages. Reaching the quota will never block your local library, search, backup, or export."},{id:"citations",label:"Citation and source metadata toolkit",status:"preview"},{id:"power-search",label:"Power Search and Research Lenses",status:"preview"},{id:"sync",label:"Basic selective sync",status:"preview"},{id:"migration",label:"Import and Migration Center",status:"preview"}
1,{id:"export-studio",label:"Universal export and note-app connectors",status:"coming_soon",detail:"One-click send to Obsidian, Notion, Google Docs, Logseq, Roam, Anki, Readwise, and a NotebookLM-ready bundle, plus PDF/DOCX/HTML."},{id:"citation-studio",label:"Citation Studio: all styles and bibliography builder",status:"coming_soon",detail:"APA, MLA, Chicago, Harvard, IEEE, Vancouver and the full CSL library, DOI/ISBN lookup, and one-click bibliographies."},{id:"draft-builder",label:"Smart Outline and one-click Draft Builder",status:"coming_soon"},{id:"capture-anywhere",label:"Capture Anywhere: threads, YouTube, email, and region OCR",status:"coming_soon"},{id:"transcription",label:"Audio and video transcription capture",status:"coming_soon"}]},max:{family:"max",name:"Max",description:"Power-user capacity, continuity, and assistance.",capabilities:[{id:"pro",label:"All currently available Pro capabilities",status:"shipped"},{id:"ocr-high-volume",label:"Higher-volume and batch OCR quota",status:h,detail:"Planned higher limits will apply to OCR processing only. Local data will remain available if the limit is reached."},{id:"archive",label:"Permanent Local Archive and Link-Rot Guard",status:"preview"},{id:"restore",label:"Advanced sync history, restore, and conflict review",status:"preview"},{id:"ai",label:"Optional selected-content AI Research Assist",status:"preview"},{id:"review",label:"Review Queue and Knowledge Resurfacing",status:"preview"},{id:"ask-library",label:"Ask Your Library: private answers from your own clips",status:"coming_soon",detail:"Grounded answers cite the exact clip and quote. Your library is never used to answer anything but your questions."},{id:"analytics",label:"Knowledge Analytics and spaced resurfacing",status:"coming_soon"}]},team:{family:"team",name:"Team",description:"Multi-seat billing now; collaboration capabilities remain previews.",capabilities:[{id:"max",label:"All currently available Max capabilities",status:"shipped"},{id:"seat-billing",label:"Stripe-backed multi-seat billing",status:"shipped"},{id:"volume-discounts",label:"Volume seat discounts",status:"shipped"},{id:"research-spaces",label:"Team Research Spaces and shared libraries",status:"preview"},{id:"roles",label:"Roles, invites, and member administration",status:"preview"},{id:"team-export",label:"Team export and cloud deletion controls",status:"preview"},{id:"shared-comments",label:"Shared threaded comments, @mentions, and assignments",status:"coming_soon",detail:"Team comments build on personal comments and only sync under reviewed Team consent."}]}}],22296),e.s(["OcrUsagePanel",0,function(){let{isLoaded:e,isSignedIn:a}=(0,o.useAppAuth)(),{resolveToken:n}=(0,u.useClipDeskSessionToken)(),[r,s]=(0,t.useState)(!1),[l,c]=(0,t.useState)(null),[d,p]=(0,t.useState)(!0),[h,g]=(0,t.useState)(null);return(0,t.useEffect)(()=>{let t=!1;return async function(){if(!e||!a)return p(!1);let r=await n();if(!r){g("Sign in again to load OCR usage."),p(!1);return}let i=await (0,m.getAccountProfile)(r);if(!i.ok){t||(g(i.error.message),p(!1));return}let o="pro"===i.data.plan||"max"===i.data.plan||"team"===i.data.plan;if(t||s(o),!o){t||p(!1);return}let l=await (0,m.getOcrUsage)(r);t||(l.ok?c(l.data):g(l.error.message),p(!1))}(),()=>{t=!0}},[e,a,n]),(0,i.jsx)(y,{signedIn:!!a,eligible:r,loading:d,usage:l,errorMessage:h})}],94672)},35506,e=>{"use strict";var t=e.i(43476),a=e.i(71645),n=e.i(18566),r=e.i(22016),i=e.i(56420);let s=(0,i.default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),o=(0,i.default)("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]),l=(0,i.default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.i(96303);var c=e.i(21046),d=e.i(81947),u=e.i(94179),m=e.i(67881),p=e.i(70065),h=e.i(47975),g=e.i(15760);let y=[{minSeats:3,maxSeats:9,baseUnitPrice:15,discountedUnitPrice:15,discountPercent:0,tierLabel:"Standard team rate"},{minSeats:10,maxSeats:24,baseUnitPrice:15,discountedUnitPrice:13.5,discountPercent:10,tierLabel:"Large team discount"},{minSeats:25,maxSeats:49,baseUnitPrice:15,discountedUnitPrice:12,discountPercent:20,tierLabel:"Large team discount"},{minSeats:50,maxSeats:null,baseUnitPrice:15,discountedUnitPrice:10.5,discountPercent:30,tierLabel:"Best volume rate applied"}],f=[{minSeats:3,maxSeats:9,baseUnitPrice:150,discountedUnitPrice:150,discountPercent:0,tierLabel:"Standard team rate"},{minSeats:10,maxSeats:24,baseUnitPrice:150,discountedUnitPrice:135,discountPercent:10,tierLabel:"Large team discount"},{minSeats:25,maxSeats:49,baseUnitPrice:150,discountedUnitPrice:120,discountPercent:20,tierLabel:"Large team discount"},{minSeats:50,maxSeats:null,baseUnitPrice:150,discountedUnitPrice:105,discountPercent:30,tierLabel:"Best volume rate applied"}];function b(e){return"monthly"===e?y:f}function x(e){return Number.isInteger(e)?e<3?"Team plans start at 3 seats.":e>500?"Self-serve checkout supports up to 500 seats.":null:"Enter a whole number of seats."}function C(e,t){let a=x(t);if(a)throw Error(a);let n=b(e).find(({minSeats:e,maxSeats:a})=>t>=e&&(null===a||t<=a))??b(e)[0],r=t*n.baseUnitPrice,i=t*n.discountedUnitPrice;return{seats:t,interval:e,baseUnitPrice:n.baseUnitPrice,discountedUnitPrice:n.discountedUnitPrice,discountPercent:n.discountPercent,subtotal:r,savings:r-i,total:i,tierLabel:n.tierLabel}}function v(e){return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2*(e%1!=0),maximumFractionDigits:2}).format(e)}var k=e.i(22296),w=e.i(94672);let j=[{tier:"pro_monthly",title:"Pro Monthly",price:"$9.99",period:"per month",description:"Premium export formats for a stronger personal workflow.",family:"pro"},{tier:"pro_yearly",title:"Pro Annual",price:"$99",period:"per year",description:"The full Pro toolkit at the annual rate.",family:"pro",highlight:!0},{tier:"max_monthly",title:"Max Monthly",price:"$14.99",period:"per month",description:"For heavier workflows that need more export range and faster support.",family:"max"},{tier:"max_yearly",title:"Max Annual",price:"$149",period:"per year",description:"The highest solo tier for daily ClipDesk work.",family:"max"}],S=[{tier:"founder_49",title:"Founder $49",description:"One-time local-first founder access for early supporters.",features:["Local Pro workflow","Obsidian export","JSON backup/export","Custom Markdown templates"]},{tier:"founder_79",title:"Founder $79",description:"Founder access with priority support for local-first power users.",features:["Local Pro workflow","Obsidian export","JSON backup/export","Priority processing/support"]}];function T(e,t){let a="checkout"===e?"Checkout":"Billing portal";if(429===t.status||"RATE_LIMITED"===t.code)return"Too many checkout attempts. Wait a minute and try again.";
1if("checkout"===e&&(422===t.status||"VALIDATION_ERROR"===t.code))return"Checkout could not start because the selected plan was not accepted. Refresh the page and try again.";if("portal"===e&&("NO_BILLING_CUSTOMER"===t.code||"NO_ACTIVE_SUBSCRIPTION"===t.code||404===t.status||409===t.status))return"No subscription to manage yet. Upgrade to Pro first.";if(500===t.status)return`${a} failed because ClipDesk billing returned a server error. Status: 500.${t.message?` ${t.message}`:""}`;let n=[t.status?`Status: ${t.status}`:null,t.code?`Code: ${t.code}`:null].filter(Boolean);return`${a} failed: ${t.message||"ClipDesk could not complete the billing request."}${n.length>0?` ${n.join(". ")}.`:""}`}function R({items:e}){return(0,t.jsx)("ul",{className:"space-y-3",children:e.map(e=>(0,t.jsxs)("li",{className:"flex items-start gap-3 text-sm text-[var(--foreground)]",children:[(0,t.jsx)("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-emerald-100 text-emerald-700",children:(0,t.jsx)(s,{className:"h-3.5 w-3.5"})}),(0,t.jsxs)("span",{className:"space-y-1",children:[(0,t.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)("span",{children:e.label}),(0,t.jsx)(u.Badge,{tone:"shipped"===e.status?"success":"beta"===e.status?"primary":"neutral",children:k.capabilityStatusLabels[e.status]})]}),e.detail?(0,t.jsx)("span",{className:"block text-xs leading-5 text-[var(--muted)]",children:e.detail}):null]})]},e.id))})}function P({title:e,price:a,period:n,description:r,features:i,actionLabel:s,pendingLabel:o,highlight:l=!1,disabled:c=!1,children:d,onAction:h}){return(0,t.jsxs)(p.Card,{className:l?"border-blue-300 shadow-blue-500/10":void 0,children:[(0,t.jsxs)(p.CardHeader,{children:[l?(0,t.jsx)(u.Badge,{tone:"primary",children:"Most popular"}):null,(0,t.jsx)(p.CardTitle,{className:"text-xl",children:e}),(0,t.jsx)(p.CardDescription,{children:r})]}),(0,t.jsxs)(p.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-[var(--font-heading)] text-4xl font-semibold",children:a}),(0,t.jsx)("div",{className:"text-sm text-[var(--muted)]",children:n})]}),d,(0,t.jsx)(R,{items:i}),(0,t.jsx)(m.Button,{className:"w-full",disabled:c,onClick:h,variant:l?"primary":"secondary",children:c&&o?o:s})]})]})}function I({seats:e,inputValue:a,errorMessage:n,onChange:r,onInputChange:i}){return(0,t.jsx)("div",{className:"rounded-[28px] border border-slate-200/80 bg-white/70 p-5",children:(0,t.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-sm uppercase tracking-[0.18em] text-[var(--muted)]",children:"Team seats"}),(0,t.jsx)("div",{className:"mt-2 text-2xl font-semibold",children:e}),(0,t.jsxs)("p",{className:"mt-2 text-sm leading-6 text-[var(--muted)]",children:["Enter the exact number of seats you need. Team plans start at ",3," seats."]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(m.Button,{"aria-label":"Decrease team seats",variant:"secondary",onClick:()=>r(Math.max(3,e-1)),children:(0,t.jsx)(o,{className:"h-4 w-4"})}),(0,t.jsx)("label",{className:"sr-only",htmlFor:"team-seat-count",children:"Team seats"}),(0,t.jsx)("input",{"aria-describedby":n?"team-seat-count-error":void 0,"aria-invalid":!!n,className:"w-28 rounded-xl border border-slate-300 bg-white px-4 py-2 text-center text-base font-medium text-slate-950 outline-none ring-0 transition focus:border-slate-500",id:"team-seat-count",inputMode:"numeric",max:500,min:3,type:"number",value:a,onChange:e=>i(e.target.value)}),(0,t.jsx)(m.Button,{"aria-label":"Increase team seats",variant:"secondary",onClick:()=>r(Math.min(500,e+1)),children:(0,t.jsx)(l,{className:"h-4 w-4"})})]}),(0,t.jsxs)("p",{className:"text-xs text-[var(--muted)]",children:["Minimum ",3,". Self-serve checkout supports up to ",500," seats."]}),n?(0,t.jsx)("p",{className:"text-sm text-rose-700",id:"team-seat-count-error",children:n}):null]})]})})}function N({interval:e,seats:a,pricing:n,estimateMode:r}){return(0,t.jsxs)("div",{className:"space-y-2 text-sm text-[var(--muted)]",children:[(0,t.jsxs)("p",{className:"font-medium text-slate-900",children:[a," seat",1===a?"":"s",": ",v(n.total),"/","monthly"===e?"month":"year",n.discountPercent>0?` after ${n.discountPercent}% volume discount`:""]}),(0,t.jsx)("p",{children:n.discountPercent>0?"Large team discount":"Discounts start at 10 seats."}),(0,t.jsx)("p",{children:n.tierLabel}),(0,t.jsx)("p",{children:"Final total is confirmed in Stripe checkout."})]})}function U({signedIn:e,readiness:n,errorMessage:i,pending:s,pendingTier:o=null,initialPlan:l=null,featureContext:c=null,onUpgrade:h,onManagePortal:g}){let[y,f]=(0,a.useState)(3),[b,T]=(0,a.useState)(String(3)),[A,$]=(0,a.useState)(null),O=(0,a.useRef)(null),L=(0,a.useRef)(null),D=(0,a.useRef)(null),E=(0,a.useMemo)(()=>C("monthly",y),[y]),M=(0,a.useMemo)(()=>C("yearly",y),[y]),_=s||!e||!n?.checkoutReady,B=s||!e||!n?.portalReady;async function F(e){let t=Number(b),a=x(t);a?$(a):(f(t),await h({...e,quantity:t}))}return(0,a.useEffect)(()=>
1{if(!l)return;let e={pro:O,max:L,team:D}[l].current;e&&(e.scrollIntoView?.({behavior:"smooth",block:"start"}),e.focus())},[l]),(0,t.jsxs)("div",{className:"page-shell space-y-8",children:[(0,t.jsxs)("div",{className:"space-y-4 text-center",children:[(0,t.jsx)(u.Badge,{tone:"primary",children:"Pricing"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsx)("h1",{className:"font-[var(--font-heading)] text-4xl font-semibold md:text-5xl",children:"Choose the ClipDesk plan that fits your workflow."}),(0,t.jsx)("p",{className:"mx-auto max-w-3xl text-base leading-7 text-[var(--muted)]",children:"Checkout is handled securely by Stripe."})]})]}),l?(0,t.jsx)(d.Alert,{tone:"info",children:"Choose your ClipDesk plan. Checkout is handled securely by Stripe."}):null,c?(0,t.jsxs)("section",{"aria-labelledby":"billing-feature-context",className:"rounded-2xl border border-blue-200 bg-blue-50 p-5",children:[(0,t.jsx)(u.Badge,{tone:"primary",children:"Feature context"}),(0,t.jsx)("h2",{className:"mt-3 text-xl font-semibold",id:"billing-feature-context",children:k.billingFeatureContexts[c].title}),(0,t.jsx)("p",{className:"mt-2 text-sm leading-6 text-[var(--muted)]",children:k.billingFeatureContexts[c].message})]}):null,(0,t.jsxs)("div",{className:"space-y-3",children:[e?null:(0,t.jsx)(d.Alert,{tone:"info",children:"Sign in to unlock a paid ClipDesk plan."}),i?(0,t.jsx)(d.Alert,{tone:"warning",children:i}):null,!n||n.checkoutReady||n.portalReady?null:(0,t.jsx)(d.Alert,{tone:"warning",children:n.message})]}),(0,t.jsx)(w.OcrUsagePanel,{}),(0,t.jsxs)("div",{className:"grid gap-6 xl:grid-cols-[0.8fr_1.2fr]",children:[(0,t.jsxs)(p.Card,{children:[(0,t.jsxs)(p.CardHeader,{children:[(0,t.jsx)(p.CardTitle,{children:"Free"}),(0,t.jsx)(p.CardDescription,{children:"A strong local-first capture workflow right inside the extension."})]}),(0,t.jsxs)(p.CardContent,{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"font-[var(--font-heading)] text-4xl font-semibold",children:"$0"}),(0,t.jsx)("div",{className:"text-sm text-[var(--muted)]",children:"forever"})]}),(0,t.jsx)(R,{items:k.planCapabilityCatalog.free.capabilities}),(0,t.jsx)(m.Button,{className:"w-full",disabled:!0,children:"Current plan"})]})]}),(0,t.jsx)("div",{className:"grid gap-6 md:grid-cols-2",children:j.map(e=>(0,t.jsx)("div",{ref:e.tier.startsWith("pro_")?O:e.tier.startsWith("max_")?L:void 0,tabIndex:-1,"data-testid":`billing-plan-${e.tier}`,children:(0,t.jsx)(P,{title:e.title,price:e.price,period:e.period,description:e.description,features:k.planCapabilityCatalog[e.family].capabilities,actionLabel:"Get started",pendingLabel:o===e.tier?"Opening checkout...":void 0,highlight:e.highlight,disabled:_,onAction:()=>void h({tier:e.tier,label:e.title})})},e.tier))})]}),(0,t.jsx)("div",{ref:D,tabIndex:-1,"data-testid":"billing-plan-team",children:(0,t.jsxs)(p.Card,{children:[(0,t.jsxs)(p.CardHeader,{children:[(0,t.jsx)(u.Badge,{tone:"success",children:"Team pricing"}),(0,t.jsx)(p.CardTitle,{children:"Choose seats before checkout"}),(0,t.jsx)(p.CardDescription,{children:"Volume discounts start at 10 seats. Final total is confirmed in Stripe checkout."})]}),(0,t.jsxs)(p.CardContent,{className:"space-y-6",children:[(0,t.jsx)(I,{errorMessage:A,inputValue:b,seats:y,onChange:function(e){let t=x(e);T(String(e)),$(t),t||f(e)},onInputChange:function(e){if(T(e),!e.trim())return void $("Team plans start at 3 seats.");let t=Number(e),a=x(t);$(a),a||f(t)}}),(0,t.jsxs)("div",{className:"grid gap-6 md:grid-cols-2",children:[(0,t.jsx)(P,{title:"Team Monthly",price:"From $15/seat/month",period:"Monthly billing",description:`${v(E.discountedUnitPrice)} per seat at the current estimate.`,features:k.planCapabilityCatalog.team.capabilities,actionLabel:"Start team monthly",pendingLabel:"team_monthly"===o?"Opening checkout...":void 0,disabled:_,onAction:()=>void F({tier:"team_monthly",label:"Team Monthly"}),children:(0,t.jsx)(N,{estimateMode:!0,interval:"monthly",pricing:E,seats:y})}),(0,t.jsx)(P,{title:"Team Annual",price:"From $150/seat/year",period:"Annual billing",description:`${v(M.discountedUnitPrice)} per seat at the current estimate.`,features:k.planCapabilityCatalog.team.capabilities,actionLabel:"Start team annual",pendingLabel:"team_yearly"===o?"Opening checkout...":void 0,disabled:_,onAction:()=>void F({tier:"team_yearly",label:"Team Annual"}),children:(0,t.jsx)(N,{estimateMode:!0,interval:"yearly",pricing:M,seats:y})})]}),(0,t.jsxs)("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-4 text-sm text-[var(--muted)]",children:[(0,t.jsx)("p",{className:"font-medium text-slate-900",children:C("monthly",y).tierLabel}),(0,t.jsx)("p",{children:"Large team discount"}),(0,t.jsx)("p",{children:"Discounts start at 10 seats."}),(0,t.jsx)("p",{children:"Final total is confirmed in Stripe checkout."})]})]})]})}),(0,t.jsx)("div",{className:"grid gap-6 md:grid-cols-2",children:S.map(e=>(0,t.jsx)(P,{title:e.title,price:"founder_49"===e.tier?"$49":"$79",period:"one-time",description:e.description,features:e.features.map((t,a)=>
1({id:`${e.tier}-${a}`,label:t,status:"shipped"})),actionLabel:"Get lifetime access",pendingLabel:o===e.tier?"Opening checkout...":void 0,disabled:_,onAction:()=>void h({tier:e.tier,label:e.title})},e.tier))}),(0,t.jsxs)(p.Card,{children:[(0,t.jsxs)(p.CardHeader,{children:[(0,t.jsx)(p.CardTitle,{children:"Already subscribed?"}),(0,t.jsx)(p.CardDescription,{children:"Open the Stripe portal to update payment details, manage invoices, or cancel when needed."})]}),(0,t.jsxs)(p.CardContent,{className:"flex flex-col gap-3 sm:flex-row",children:[(0,t.jsx)(m.Button,{disabled:B,onClick:()=>void g(),children:"Manage subscription"}),(0,t.jsx)(r.default,{href:"/support",children:(0,t.jsx)(m.Button,{variant:"secondary",children:"Billing FAQ"})})]})]})]})}e.s(["BillingContent",0,U,"BillingPage",0,function(){let e=(0,n.useSearchParams)(),{isSignedIn:r}=(0,c.useAppAuth)(),{resolveToken:i}=(0,h.useClipDeskSessionToken)(),[s,o]=(0,a.useState)(null),[l,d]=(0,a.useState)(null),[u,m]=(0,a.useState)(null),[p,y]=(0,a.useState)(!1),f=(0,a.useMemo)(()=>{let t=e.get("plan");return"pro"===t||"max"===t||"team"===t?t:null},[e]),b=(0,a.useMemo)(()=>{let t=e.get("feature");return(0,k.isBillingFeatureContext)(t)?t:null},[e]);async function x(e){m(e.tier),d(null);
1try{let t=await i(),a=await (0,g.createBillingCheckoutForTier)(e.tier,t,void 0,e.quantity??1);if(!a.ok)return void d(T("checkout",a.error));if(!a.data.url)return void d("Backend did not return a checkout URL.");window.location.assign(a.data.url)}finally{m(null)}}async function C(){y(!0),d(null);try{let e=await i(),t=await (0,g.createBillingPortal)(e);if(!t.ok)return void d(T("portal",t.error));if(!t.data.url)return void d("Backend did not return a billing portal URL.");window.location.assign(t.data.url)}finally{y(!1)}}return(0,a.useEffect)(()=>{let t=!1;return async function(){let a=await i(),n=await (0,g.getBillingReadiness)(a);if(!t){if(n.ok){o(n.data),d("success"===e.get("checkout")?"Subscription updated successfully.":"cancel"===e.get("checkout")?"Checkout canceled.":null);return}o(null),d(n.error.message)}}(),()=>{t=!0}},[i,e]),(0,t.jsx)(U,{signedIn:!!r,readiness:s,errorMessage:l,pending:null!==u||p,pendingTier:u,initialPlan:f,featureContext:b,onUpgrade:x,onManagePortal:C})},"readErrorMessage",0,T],35506)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.