PageSourceSearch

https://app.metalbear.com/assets/Edit-BZ-ABXHM.js

js metalbear.com collected 2026-10-01 11:33:52 UTC 15,998 bytes, 10 lines download raw bytes

1import{c as te,r as c,u as q,a as L,j as e,q as H,au as G,av as ne,aw as O,ax as W,w as re,ay as se,a5 as w,a7 as ie,m as ce,ai as V,y as B,R as S,L as U,az as ae,f as le,a6 as D,a3 as Q,aA as oe,d as ue,aB as de,A as me,B as fe,P as xe,D as he,E as z,M as $,Z as Y}from"./index-CoH3pPWC.js";import{H as ye}from"./HowAreSeatsCalculated-BFjoDBXS.js";import{P as ge}from"./PageHeading-DYRnTTdf.js";import{M as je}from"./index-CEOtY8g3.js";import{A as be}from"./arrow-left-1_b87t9K.js";/**
2 * @license lucide-react v0.575.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const ve=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],K=te("tag",ve);function Ee(t,r,s){var f=this,n=c.useRef(null),m=c.useRef(0),l=c.useRef(null),u=c.useRef([]),i=c.useRef(),a=c.useRef(),o=c.useRef(t),x=c.useRef(!0);o.current=t;var j=typeof window<"u",h=!r&&r!==0&&j;if(typeof t!="function")throw new TypeError("Expected a function");r=+r||0;var N=!!(s=s||{}).leading,g=!("trailing"in s)||!!s.trailing,E="maxWait"in s,y="debounceOnServer"in s&&!!s.debounceOnServer,C=E?Math.max(+s.maxWait||0,r):null;c.useEffect(function(){return x.current=!0,function(){x.current=!1}},[]);var _=c.useMemo(function(){var P=function(v){var p=u.current,R=i.current;return u.current=i.current=null,m.current=v,a.current=o.current.apply(R,p)},d=function(v,p){h&&cancelAnimationFrame(l.current),l.current=h?requestAnimationFrame(v):setTimeout(v,p)},b=function(v){if(!x.current)return!1;var p=v-n.current;return!n.current||p>=r||p<0||E&&v-m.current>=C},T=function(v){return l.current=null,g&&u.current?P(v):(u.current=i.current=null,a.current)},F=function v(){var p=Date.now();if(b(p))return T(p);if(x.current){var R=r-(p-n.current),ee=E?Math.min(R,C-(p-m.current)):R;d(v,ee)}},A=function(){if(j||y){var v=Date.now(),p=b(v);if(u.current=[].slice.call(arguments),i.current=f,n.current=v,p){if(!l.current&&x.current)return m.current=n.current,d(F,r),N?P(n.current):a.current;if(E)return d(F,r),P(n.current)}return l.current||d(F,r),a.current}};return A.cancel=function(){l.current&&(h?cancelAnimationFrame(l.current):clearTimeout(l.current)),m.current=0,u.current=n.current=i.current=l.current=null},A.isPending=function(){return!!l.current},A.flush=function(){return l.current?T(Date.now()):a.current},A},[N,E,r,C,g,h,j,y]);return _}function pe(t,r){return t===r}function Ne(t,r,s){var f=pe,n=c.useRef(t),m=c.useState({})[1],l=Ee(c.useCallback(function(i){n.current=i,m({})},[m]),r,s),u=c.useRef(t);return f(u.current,t)||(l(t),u.current=t),[n.current,l]}const Ce=`
7The Enterprise license includes support for airgapped clusters, higher SLA, and professional services, and is priced at $80/seat/month when billed annually (volume discounts are provided).
8
9To enquire about an Enterprise license, please email us directly or schedule a meeting with us.
10`,Te=300,Pe="Contact us",Se="Book time with us",Z="Go Back",Le="Number of Seats",_e="The number of users in your organization who can use mirrord.",Ie="Billing Period",we="Billing will recur automatically at the end of the billing period.",Ae="Discount Code",Re="Per user per",ke="Subtotal + tax",Be="Total per",De="Due now",qe="---",Fe="Edit license",Me="Buy a license",Oe="Choose the plan, the number of seats and how often you are billed.",Ue="Order summary",Qe="Enterprise",ze="License Type",$e="Team",Ye="Enterprise",He=12,Ge=7,We=30,Ve=365,I=5,X=({form:t,summary:r})=>e.jsxs("div",{className:"grid items-start gap-6 lg:grid-cols-[minmax(0,1fr)_22rem]",children:[e.jsx($,{children:e.jsx(Y,{className:"space-y-8 p-6",children:t})}),e.jsx($,{className:"lg:sticky lg:top-20",children:e.jsx(Y,{className:"space-y-4 p-6",children:r})})]}),Ke=({licenseTypeField:t})=>{const r=V();return e.jsx(X,{form:e.jsxs(e.Fragment,{children:[t,e.jsx(B,{}),e.jsx("div",{className:"prose prose-sm markdown",children:e.jsx(je,{children:Ce})})]}),summary:e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:Qe}),e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx(S,{asChild:!0,children:e.jsx(U,{to:"/contact",children:Pe})}),e.jsx(S,{variant:"outline",asChild:!0,children:e.jsx(U,{to:"https://meetings-eu1.hubspot.com/mirrord/mirrord-demo",target:"_blank",rel:"noopener noreferrer",children:Se})}),e.jsx(S,{variant:"ghost",onClick:()=>{r(-1)},children:Z})]})]})})},Ze=t=>{const r=O(),s=V(),{accessToken:f}=q(),[n,m]=c.useState(t.initialSelection),[l,u]=c.useState(""),[i,a]=c.useState(!1),{data:o,error:x,isPending:j}=L(ae(f,l,n.price.priceId,i)),h=n.price.priceId,N=n.quantity,g=c.useMemo(()=>Object.fromEntries(t.basePrices.map(d=>[d.priceId,d])),[t.basePrices]),E=c.useMemo(()=>{var d;return((d=g[h])==null?void 0:d.cycle.interval)==="month"?t.basePrices.find(b=>b.cycle.interval==="year"):void 0},[h,g,t.basePrices]);c.useEffect(()=>{x!==null&&(w.error(`Failed to fetch discount: ${x.message}`),a(!1))},[x,a]);const y=c.useCallback(d=>{d.preventDefault();const b=g[h];if(b!==void 0)try{const T=parseInt(d.target.value,10);T>=b.minQuantity&&T<=b.maxQuantity&&m({price:b,quantity:T})}catch{}},[h,g,m]),C=c.useCallback(d=>{d.preventDefault();const b=d.target.value.trim();u(b)},[u]),P=!((t.license.isTrial||t.license.licenseType==="free")&&t.license.billing===void 0)&&n.price.priceId===t.initialSelection.price.priceId&&n.quantity===t.initialSelection.quantity;return e.jsx("form",{onSubmit:d=>{d.preventDefault(),!(t.frozen||i&&j)&&t.handleSubmit(n,i?o==null?void 0:o.id:void 0)},children:e.jsx(X,{form:e.jsxs(e.Fragment,{children:[t.licenseTypeField,e.jsx(B,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-md bg-primary/10 flex items-center justify-center",children:e.jsx(le,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx(D,{className:"text-sm font-semibold",children:Le})]}),e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(Q,{type:"text",className:"w-20 text-center text-lg font-semibold",value:n.quantity,name:"seats",onChange:y,disabled:t.frozen}),e.jsxs("div",{className:"flex-1",children:[e.jsx("input",{type:"range",className:"w-full accent-primary h-1.5 cursor-pointer",min:n.price.minQuantity,max:n.price.maxQuantity,name:"seats",value:n.quantity,onChange:y,disabled:t.frozen}),e.jsxs("div",{className:"flex justify-between mt-1",children:[e.jsx("span",{className:"text-xs text-muted-foreground
10/60",children:n.price.minQuantity}),e.jsx("span",{className:"text-xs text-muted-foreground/60",children:n.price.maxQuantity})]})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:_e}),e.jsx(ye,{})]}),e.jsx(B,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-md bg-primary/10 flex items-center justify-center",children:e.jsx(oe,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx(D,{className:"text-sm font-semibold",children:Ie})]}),e.jsx("div",{className:"grid grid-cols-3 gap-2",children:t.basePrices.map(d=>{const b=n.price.priceId===d.priceId;return e.jsxs("button",{type:"button",className:`relative py-3 px-4 rounded-lg border text-sm font-medium transition-all ${b?"border-primary bg-primary/5 text-primary ring-1 ring-primary/20":"border-border bg-card text-foreground hover:border-primary/30 hover:bg-primary/[0.02]"}`,onClick:()=>{if(!t.frozen){const T=g[d.priceId];T&&m(M(T,N))}},disabled:t.frozen,children:[b&&e.jsx("div",{className:"absolute -top-1.5 -right-1.5 h-4 w-4 rounded-full bg-primary flex items-center justify-center",children:e.jsx(ue,{className:"h-2.5 w-2.5 text-white"})}),J(d.cycle)]},d.priceId)})})]}),t.discountsAvailable&&e.jsxs(e.Fragment,{children:[e.jsx(B,{}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-md bg-primary/10 flex items-center justify-center",children:e.jsx(K,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx(D,{className:"text-sm font-semibold",children:Ae})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Q,{type:"text",className:"w-48",value:l,name:"discountCode",disabled:i,onChange:C,placeholder:"Enter code"}),e.jsx(S,{size:"sm",variant:i?"outline":"default",disabled:!i&&l===""||i&&o===void 0,onClick:d=>{d.preventDefault(),a(!i)},children:i?"Remove":"Apply"}),i&&o!==void 0&&e.jsx("span",{className:"text-xs font-medium text-emerald-600",children:o.description??"Discount applied"})]})]})]})]}),summary:e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:Ue}),e.jsx(Xe,{selection:n,paddle:r.getPaddle(),customerId:r.getCustomerId(),discountId:i?o==null?void 0:o.id:void 0,alternatePrice:E,countryCode:t.countryCode}),t.editFingerprint!==void 0&&e.jsx(Je,{fingerprint:t.editFingerprint,accessToken:f,selection:n,discountId:i?o==null?void 0:o.id:void 0,enabled:!P}),e.jsx("p",{className:"text-xs text-muted-foreground/70",children:we}),e.jsxs("div",{className:"flex flex-col gap-2 pt-2",children:[e.jsx(S,{type:"submit",disabled:t.frozen||P||i&&j,className:"gap-2",children:t.submitButtonText}),e.jsxs(S,{type:"button",variant:"ghost",className:"gap-2 text-muted-foreground",onClick:()=>{s(-1)},children:[e.jsx(be,{className:"h-3.5 w-3.5"}),Z]})]})]})})})};function J(t){function r(f){return f.charAt(0).toUpperCase()+f.slice(1)}const s=r(t.interval);return t.frequency===1?s:`${t.frequency} ${s}s`}function k(t,r){let s;switch(r){case"USD":s="$";break;case void 0:default:s=""}return`${s}${t.toFixed(2)}`}const Xe=t=>{var j,h,N,g,E;const r=t.selection.price.priceId,[s,f]=Ne(t.selection.quantity,Te),{data:n,error:m}=L(W(t.paddle,t.customerId,[{priceId:r,quantity:s}],t.discountId,t.countryCode)),[l,u]=c.useState((j=n==null?void 0:n[0])==null?void 0:j.formattedUnitPrice),i=J(t.selection.price.cycle),a=(h=n==null?void 0:n[0])==null?void 0:h.currencyCode,o=`${k(((N=n==null?void 0:n[0])==null?void 0:N.subtotalPrice)??0,a)} + ${k(((g=n==null?void 0:n[0])==null?void 0:g.totalTax)??0,a)}`;c.useEffect(()=>{m!==null&&(console.error(m),w.error("Failed to fetch price preview"))},[m]),c.useEffect(()=>{var y;(y=n==null?void 0:n[0])!=null&&y.formattedUnitPrice&&u(n[0].formattedUnitPrice)},[n]);const x=c.useMemo(()=>{var _;if(!t.alternatePrice)return null;const C=(((_=n==null?void 0:n[0])==null?void 0:_.totalPrice)??t.selection.price.totalPrice*s)-t.alternatePrice.totalPrice/t.alternatePrice.quantity/He*s;return` (Save ${k(C,a)} per month with a yearly subscription)`},[a,n,t.alternatePrice,t.selection,s]);return e.jsxs("div",{className:"rounded-xl border border-border bg-gradient-to-br from-muted/20 to-muted/40 p-5 space-y-3",children:[e.jsxs("div",{className:"flex justify-between items-center text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[Re," ",i]}),e.jsx("span",{className:"font-medium",children:l??"..."})]}),n===void 0||f.isPending()?e.jsx("div",{className:"h-6 animate-pulse bg-muted rounded"}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex justify-between items-center text-sm",children:[e.jsx("span",{className:"text-muted-foreground",children:ke}),e.jsx("span",{children:o})]}),e.jsx("div",{className:"h-px bg-border"}),e.jsxs("div",{className:"flex justify-between items-center pt-1",children:[e.jsxs("span",{className:"font-semibold text-sm",children:[Be," ",i]}),e.jsx("span",{className:"text-lg font-semibold tracking-tight",children:k(((E=n[0])==null?void 0:E.totalPrice)??0,a)})]}),x&&e.jsx("p",{className:"text-xs text-primary font-medium",children:x})]})]})},Je=t=>{const{data:r,error:s}=L(de(t.accessToken,t.fingerprint,t.selection.quantity,t.selection.price.priceId,t.discountId,t.enabled));return c.useEffect(()=>{s!==null&&(console.error(s),w.error("Failed to immediate cost"))},[s]),e.jsxs("div",{className:"flex justify-between items-center rounded-xl border border-primary/20 bg-primary/[0.03] p-4",children:[e.jsx("span",{className:"text-sm font-medium",children:De}),e.jsx("span",{className:"text-lg font-semibold",children:t.enabled?r===void 0?e.jsx("span",{className:"inline-block animate-pulse bg-muted rounded w-16 h-5"}):r.immediatePayment??"$0.00":e.jsx("span",{className:"text-muted-foreground",children:qe})})]})};function M(t,r){return r>=t.minQuantity&&r<=t.maxQuantity?{price:t,quantity:r}:I>=t.minQuantity&&I<=t.maxQuantity?{price:t,quantity:I}:{price:t,quantity:t.minQuantity}}const et=t=>{var E;const{accessToken:r}=q(),s=O(),f=(t.license.isTrial||t.license.licenseType==="free")&&t.license.billing===void 0,[n,m]=c.useState(f?"teams":t.license.licenseType),l=f||t.license.licenseType==="teams",u=f?t.license.fingerprint:null,i=((E=t.license.billing)==null?void 0:E.status.state)==="c
10anceled"?t.license.fingerprint:null,a=u===null&&i===null?t.license.fingerprint:void 0,{mutate:o,isPending:x,isSuccess:j,error:h}=re(se(r,t.license.fingerprint)),N=c.useCallback((y,C)=>{x||(u?s.openCheckout(y.price.priceId,y.quantity,{type:"trial",fingerprint:u},C):i?s.openCheckout(y.price.priceId,y.quantity,{type:"canceled",fingerprint:i},C):o({maxSeats:y.quantity,priceId:y.price.priceId,discountId:C}))},[s,o,x,u,i]);if(c.useEffect(()=>{h!==null&&w.error(`Failed to update license subscription: ${h.message}`)},[h]),c.useEffect(()=>{j&&w.info("Your license subscription will be updated shortly")},[j]),j)return e.jsx(G,{to:"/billing"});const g=e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"h-6 w-6 rounded-md bg-primary/10 flex items-center justify-center",children:e.jsx(K,{className:"h-3.5 w-3.5 text-primary"})}),e.jsx(D,{className:"text-sm font-semibold",children:ze})]}),e.jsxs(me,{value:n,name:"licenseType",onValueChange:y=>{if(l)switch(y){case"teams":m("teams");return;case"enterprise":m("enterprise");return;default:return}},children:[e.jsx(fe,{className:"w-48",children:e.jsx(xe,{})}),e.jsxs(he,{children:[e.jsx(z,{value:"teams",disabled:!l,children:$e}),e.jsx(z,{value:"enterprise",disabled:!l,children:Ye})]})]})]});return e.jsxs("div",{className:"space-y-6",children:[u!==null&&e.jsx("img",{alt:"",referrerPolicy:"no-referrer-when-downgrade",src:"https://static.scarf.sh/a.png?x-pxid=c402ddbf-5dcb-4906-9dc3-19044165d4fa",className:"hidden"}),e.jsx(ge,{title:u===null?Fe:Me,description:Oe}),n==="teams"&&e.jsx(Ze,{frozen:x,handleSubmit:N,initialSelection:t.initialSelection,basePrices:t.basePrices,submitButtonText:u===null?"Save Changes":"Buy License",discountsAvailable:u===null,editFingerprint:a,license:t.license,countryCode:t.countryCode,licenseTypeField:g}),n==="enterprise"&&e.jsx(Ke,{licenseTypeField:g})]})},tt=t=>{const r=O(),{accessToken:s}=q(),f=r.getPriceIds(),{data:n}=L(W(r.getPaddle(),r.getCustomerId(),f.map(a=>({priceId:a,quantity:1})),void 0)),{data:m}=L(ie(s)),l=c.useCallback(a=>{switch(a.interval){case"day":return a.frequency;case"month":return a.frequency*We;case"week":return a.frequency*Ge;case"year":return a.frequency*Ve}},[]),u=c.useCallback((a,o)=>{var h;const x=(h=o.billing)==null?void 0:h.cycle;if(x!==void 0){const N=a.find(g=>g.cycle.frequency===x.frequency&&g.cycle.interval===x.interval);if(N!==void 0)return M(N,o.maxSeats??I)}const j=a[0];if(j!==void 0)return M(j,o.maxSeats??I);throw new Error("no available price")},[]);if(n===void 0)return e.jsx(H,{fixed:!1});const i=[...n];return i.sort((a,o)=>l(a.cycle)-l(o.cycle)),e.jsx(et,{license:t.license,basePrices:i,initialSelection:u(i,t.license),countryCode:m==null?void 0:m.countryCode})},at=t=>{const{accessToken:r}=q(),{data:s}=L(ce(r)),f=s==null?void 0:s.find(n=>n.fingerprint===t.fingerprint);return s===void 0?e.jsx(H,{fixed:!1}):f===void 0?e.jsx(G,{to:"/billing"}):e.jsx(ne,{children:e.jsx(tt,{license:f})})};export{at as default};

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.