@tinkerlandai/indiana-sdk 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/server.js CHANGED
@@ -1 +1 @@
1
- import{b as Z,c as N,d as ie,e as oe}from"./chunk-Y7LNDG3O.js";import{a as c,b as I}from"./chunk-2HEB2TPD.js";import{Ag as F,Bg as j,Bj as $,Cg as Q,Di as C,Dj as Y,Ei as K,Fh as o,G as b,Gi as G,Ji as k,Ki as P,Li as z,Lk as H,Mk as W,yg as M,zg as B}from"./chunk-FMAMDKAV.js";function u(n,r){try{return n.parse(r)}catch{throw new c("INVALID_RESPONSE","Invalid gateway response")}}function ce(n){if(typeof window<"u")throw new c("SERVER_ONLY","Secret API keys must stay on the backend");return{start:r=>Z(n,r)}}var _=class extends c{constructor(t,e){super("DECISION_PENDING","Decision is still pending; read this decision ID or retry the original request ID",202,e);this.decisionId=t;this.decisionRequestId=e}decisionId;decisionRequestId};function ue(n){if("remoteEval"in n)throw new c("INVALID_REQUEST","Configure evaluation mode on the Funnel; remoteEval is not supported");if(typeof window<"u")throw new c("SERVER_ONLY","Funnel decisions are requested by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new c("INVALID_TOKEN","A server API key is required");async function r(a,i,s=!1){let p=I({...n,fetch:(l,f)=>{let m=new Headers(f?.headers);return m.set("Accept-Encoding","identity"),s&&m.set("Prefer","respond-async"),(n.fetch??globalThis.fetch)(l,{...f,headers:m})},timeoutMs:Math.min(n.timeoutMs??1e4,i?Math.max(1,i-Date.now()):12e4)});return p.identify(n.apiKey),p.request("funnels",a)}async function t(a,i){let s=P.parse(await r(k.parse({operation:"read_decision",decisionId:a}),i));if(s.decisionId!==a)throw new c("INVALID_RESPONSE","Decision identity changed");return s}async function e(a,i,s=!1){let p=k.parse({...a,operation:"decide",funnelId:n.funnelId}),l;try{l=P.parse(await r(p,i,s))}catch(f){throw f instanceof c&&["TIMEOUT","NETWORK_ERROR","SERVICE_UNAVAILABLE"].includes(f.code)?new c("DECISION_ACCEPTANCE_UNKNOWN","Decision acceptance is unknown; retry the original request ID and input",f.status,a.requestId):f}if(l.requestId!==a.requestId||l.decision&&l.decision.customerId!==a.customerId)throw new c("INVALID_RESPONSE","Decision request or customer changed");return l}return{async configuration(){let a=Y.parse(await r({operation:"configuration",funnelId:n.funnelId}));if(a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment||a.funnelId!==n.funnelId)throw new c("SCOPE_MISMATCH","Configuration scope changed");return a},features(a={}){return N({...a,scope:n.scope,load:async()=>$.parse(await r({operation:"feature_config",funnelId:n.funnelId}))})},read:a=>t(a),async submit(a){return e(a,void 0,!0)},async decide(a){let i=Date.now()+3e4,s=await e(a,i),p=s.decisionId,l=250;for(;;){if(s.requestId!==a.requestId||s.decision&&s.decision.customerId!==a.customerId)throw new c("INVALID_RESPONSE","Decision request or customer changed");if(s.decision)return s.decision;if(s.status==="failed")throw new c("DECISION_FAILED","Decision execution failed",503,a.requestId);if(Date.now()>=i)throw new _(p,a.requestId);if(await new Promise(f=>setTimeout(f,Math.min(l,i-Date.now()))),Date.now()>=i)throw new _(p,a.requestId);try{l=Math.min(1e3,l*2),s=await t(p,i)}catch(f){if(f instanceof c&&["TIMEOUT","NETWORK_ERROR","SERVICE_UNAVAILABLE","RATE_LIMITED"].includes(f.code))continue;throw f}}},async reportUsed(a){let i=z.parse(await r(k.parse({...a,operation:"report_used"})));if(i.decisionId!==a.decisionId||i.eventId!==a.eventId)throw new c("INVALID_RESPONSE","Usage receipt identity changed");return i}}}function pe(n){if(typeof window<"u")throw new c("SERVER_ONLY","Native receipts are verified by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new c("INVALID_TOKEN","Server API key required");let r=I({...n,timeoutMs:n.timeoutMs??35e3});return r.identify(n.apiKey),{async recover(t){let e=H.parse(t),a=W.parse(await r.request("funnels",e));if(a.requestId!==e.requestId||a.orderId!==e.orderId||a.receiptId!==e.receiptId||a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment)throw new c("INVALID_RESPONSE","Current order receipt scope changed");return a}}}import{z as d}from"zod";var S=M,de=d.string().regex(/^(0|[1-9]\d{0,5})(\.\d{1,12})?$/),te=d.strictObject(Object.fromEntries(S.map(n=>[n,d.number().int().nonnegative().max(1e9)]))),re=B,le=F,U=d.strictObject({modelId:re,source:d.enum(["models.dev","custom"]),fetchedAt:d.iso.datetime(),rates:j,contextTier:d.number().int().nonnegative(),markupPercent:le}),O=d.strictObject({pricing:U,tokens:te,quantity:b,digest:d.string().regex(/^[a-f0-9]{64}$/)}),ne=n=>{let[r,t=""]=n.split(".");return BigInt(r)*10n**12n+BigInt(t.padEnd(12,"0"))};function me(n){if(typeof n!="number"||!Number.isFinite(n)||n<0)throw new c("AI_PRICE_UNAVAILABLE","A published token price is missing");let r=String(n),t=r.includes("e")?n.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):r;if(Number(t)!==n||!de.safeParse(t).success)throw new c("AI_PRICE_UNAVAILABLE","Published price exceeds the supported precision");return t}var J=d.strictObject({input:d.number().nonnegative(),output:d.number().nonnegative(),cache_read:d.number().nonnegative().optional(),cache_write:d.number().nonnegative().optional(),reasoning:d.number().nonnegative().optional(),input_audio:d.number().nonnegative().optional(),output_audio:d.number().nonnegative().optional()}),fe=J.extend({context_over_200k:d.unknown().optional(),tiers:d.array(J.extend({tier:d.strictObject({type:d.literal("context"),size:d.number().int().nonnegative()})})).max(20).refine(n=>new Set(n.map(r=>r.tier.size)).size===n.length).optional()});async function X(n,r,t){let e=new TextEncoder().encode(JSON.stringify({pricing:n,tokens:r,quantity:t}));return[...new Uint8Array(await crypto.subtle.digest("SHA-256",e))].map(a=>a.toString(16).padStart(2,"0")).join("")}function ee(n,r){let t=0n;for(let w of S){if(!r[w])continue;let g=n.rates[w];if(g===void 0)throw new c("AI_PRICE_UNAVAILABLE",`No published price for ${w}; report exclusive token pools`);t+=ne(g)*BigInt(r[w])}let[e,a="0"]=String(n.markupPercent).split("e"),i=(e.split(".")[1]?.length??0)-Number(a),s=10n**BigInt(Math.max(i,0)),p=BigInt(e.replace(".",""))*10n**BigInt(Math.max(-i,0)),l=100n*s+p,f=100n*s*1000000n,m=(t*l+f-1n)/f;return b.parse(`${m/1000000n}.${(m%1000000n).toString().padStart(6,"0")}`)}function ae(n={}){if(typeof window<"u")throw new c("SERVER_ONLY","AI token pricing belongs on your backend");let r=Q.parse({defaultMarkup:n.defaultMarkup??0,providerMarkups:n.providerMarkups??{},modelMarkups:n.modelMarkups??{},customModels:n.customModels??{}}),t=null,e=0;async function a(){if(!t||Date.now()>=e){e=Date.now()+15*6e4;let i=(async()=>{let s=await(n.fetch??fetch)("https://models.dev/api.json",{signal:AbortSignal.timeout(3e4)});if(!s.ok)throw new c("AI_PRICE_UNAVAILABLE","Models.dev pricing is unavailable");return{data:d.record(d.string(),d.object({models:d.record(d.string(),d.unknown())})).parse(await s.json()),fetchedAt:new Date().toISOString()}})().catch(s=>{throw t===i&&(t=null),s});t=i}return t}return{refreshPrices(){t=null,e=0},async quoteTokens(i){let s=re.parse(i.modelId),p=te.parse(i.tokens),[l,...f]=s.split("/"),m=r.customModels[s],w,g,y,x=0;if(m?.input!==void 0&&m.output!==void 0&&S.every(q=>p[q]===0||m[q]!==void 0))w={...m,input:m.input,output:m.output},g="custom",y=new Date().toISOString();else{let q=await a(),D=q.data[l]?.models[f.join("/")];if(!D)throw new c("AI_PRICE_UNAVAILABLE","Unknown model; configure a complete custom price");let{cost:E}=d.object({cost:fe}).parse(D),L=p.input+p.cache_read+p.cache_write+p.input_audio;if(E.tiers===void 0&&E.context_over_200k!==void 0&&L>2e5)throw new c("AI_PRICE_UNAVAILABLE","A current context tier is required for this model");let R=E.tiers?.filter(h=>L>h.tier.size).sort((h,se)=>se.tier.size-h.tier.size)[0],V=R??E;R&&(x=R.tier.size),w=Object.fromEntries(S.filter(h=>V[h]!==void 0).map(h=>[h,me(V[h])])),w={...w,...m},g=m?"custom":"models.dev",y=q.fetchedAt}let v=U.parse({modelId:s,source:g,fetchedAt:y,rates:w,contextTier:x,markupPercent:r.modelMarkups[s]??r.providerMarkups[l]??r.defaultMarkup}),T=ee(v,p);return O.parse({pricing:v,tokens:p,quantity:T,digest:await X(v,p,T)})},async trackTokens(i,s){let p=O.parse(s.quote);if(p.quantity!==ee(p.pricing,p.tokens)||p.digest!==await X(p.pricing,p.tokens,p.quantity))throw new c("INVALID_REQUEST","AI quote changed after pricing");let l=s.properties??{},f=s.providerCostUsd===void 0?void 0:d.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/).parse(s.providerCostUsd),m=s.generationId===void 0?void 0:d.string().min(1).max(120).parse(s.generationId),w=8+ +(f!==void 0)+ +(m!==void 0);if(Object.keys(l).some(y=>y.startsWith("ai_")))throw new c("INVALID_REQUEST","AI tracking reserves ai_ event properties");if(Object.keys(l).length>16-w)throw new c("INVALID_REQUEST","AI tracking properties exceed the available event budget");let g={operation:"consume",internal_feature_id:s.internal_feature_id,quantity:p.quantity,idempotencyKey:s.idempotencyKey,properties:{...l,...f!==void 0?{ai_provider_cost_usd:f}:{},...m!==void 0?{ai_generation_id:m}:{},ai_model:p.pricing.modelId,ai_source:p.pricing.source,ai_price_at:p.pricing.fetchedAt,ai_quote_hash:p.digest,ai_markup:String(p.pricing.markupPercent),ai_tier:String(p.pricing.contextTier),ai_tokens:S.map(y=>p.tokens[y]).join(","),ai_rates:"v1:"+S.map(y=>p.pricing.rates[y]===void 0?"-":ne(p.pricing.rates[y]).toString(36)).join(",")},...s.entityId?{entityId:s.entityId}:{}};return i.mutateBalance({customerId:s.customerId,command:g})}}}async function we(n,r,t={}){let{config:e,model_markups:a}=await n.readAiPricing(r);return ae({defaultMarkup:e.default_markup??0,providerMarkups:Object.fromEntries(Object.entries(e.provider_markups??{}).map(([i,s])=>[i,s.markup])),modelMarkups:Object.fromEntries(Object.entries(a??{}).filter(([,i])=>i.markup!==void 0).map(([i,s])=>[i,s.markup])),customModels:Object.fromEntries(Object.entries(a??{}).filter(([,i])=>i.input_cost!==void 0||i.output_cost!==void 0).map(([i,s])=>[i,{...s.input_cost!==void 0?{input:String(s.input_cost)}:{},...s.output_cost!==void 0?{output:String(s.output_cost)}:{}}])),...t})}import{z as ge}from"zod";var A=ge.number().int().min(0).max(Number.MAX_SAFE_INTEGER);function ye(n,r){let t=A.parse(n.inputTokens.total),e=A.parse(n.outputTokens.total),a=A.parse(n.inputTokens.cacheRead??0),i=A.parse(n.inputTokens.cacheWrite??0),s=A.parse(n.outputTokens.reasoning??0);if(a+i>t||s>e||n.inputTokens.noCache!==void 0&&A.parse(n.inputTokens.noCache)!==t-a-i||n.outputTokens.text!==void 0&&A.parse(n.outputTokens.text)!==e-s)throw new c("AI_USAGE_UNAVAILABLE","Provider token counts do not conserve total usage");return{input:t-a-i,cache_read:a,cache_write:i,output:r==="output"?e:e-s,reasoning:r==="separate"?s:0,input_audio:0,output_audio:0}}function Ie(n){if(typeof window<"u")throw new c("SERVER_ONLY","AI usage belongs on the trusted backend");if(!n.modelId||!["output","separate"].includes(n.reasoning))throw new c("INVALID_REQUEST","Model ID and reasoning pricing are required");async function r(e){await n.persist({context:e,modelId:n.modelId,usage:null,tokens:null,quote:null,receipt:null,phase:"incomplete"})}async function t(e,a){let i={context:e,modelId:n.modelId,usage:a,tokens:null,quote:null,receipt:null,phase:"captured"};await n.persist(i);let s=n.mapTokens?n.mapTokens(a):ye(a,n.reasoning),p=await n.pricing.quoteTokens({modelId:n.modelId,tokens:s});await n.persist({...i,tokens:s,quote:p,phase:"quoted"});let l=await n.pricing.trackTokens(n.client,{...e,quote:p});if(!l.receipt.accepted)throw new c("AI_BALANCE_REJECTED","AI usage was captured but the balance operation was rejected");await n.persist({...i,tokens:s,quote:p,receipt:l,phase:"settled"})}return{specificationVersion:"v4",async wrapGenerate({doGenerate:e}){let a=await n.context(),i;try{i=await e()}catch(s){throw await r(a),s}return await t(a,i.usage),i},async wrapStream({doStream:e}){let a=await n.context(),i;try{i=await e()}catch(m){throw await r(a),m}let s=!1,p=!1,l=i.stream.getReader();async function f(){s||p||(p=!0,await r(a))}return{...i,stream:new ReadableStream({async pull(m){try{let{value:w,done:g}=await l.read();if(g){if(!s)throw await f(),new c("AI_USAGE_UNAVAILABLE","Stream ended without final usage; no amount was invented");m.close();return}if(w.type==="finish"){if(s)throw new c("AI_USAGE_UNAVAILABLE","Provider sent more than one final usage record");s=!0,await t(a,w.usage)}m.enqueue(w)}catch(w){try{await f()}finally{m.error(w),await l.cancel(w)}}},async cancel(m){try{await f()}finally{await l.cancel(m)}}})}}}}function he(n){if(typeof window<"u")throw new c("SERVER_ONLY","Funnel receipts are sent by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new c("INVALID_TOKEN","A server API key is required");let r=I(n);return r.identify(n.apiKey),{async signal(t){let e=C.parse({...t,operation:"signal"}),a=K.parse(await r.request("funnels",e));if(a.runId!==t.runId||a.eventId!==t.eventId||a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment)throw new c("INVALID_RESPONSE","Receipt identity changed");return a},async readResults(t){let e=C.parse({operation:"read_results",runId:t}),a=G.parse(await r.request("funnels",e));if(a.runId!==t||a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment)throw new c("INVALID_RESPONSE","Result identity changed");return a}}}function Ge(){if(typeof window<"u")throw new c("SERVER_ONLY","Guest identity is issued by your backend");let n=crypto.getRandomValues(new Uint8Array(32));return"gg_gc_"+btoa(String.fromCharCode(...n)).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function ze(n){if(typeof window<"u")throw new c("SERVER_ONLY","Secret API keys must stay on your backend");let r=I(n);return r.identify(n.apiKey),{async resolvePaywall(t){let e=o.resolvePaywall;return u(e.response,await r.request(e.path,e.request.parse(t)))},async resolveOffering(t){let e=o.resolveOffering;return u(e.response,await r.request(e.path,e.request.parse(t)))},async checkEntitlement(t){let e=o.checkEntitlement;return u(e.response,await r.request(e.path,e.request.parse(t)))},async setupPayment(t){let e=o.setupPayment;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readPaymentSetup(t){let e=o.readPaymentSetup;return u(e.response,await r.request(e.path,e.request.parse(t)))},async previewSubscriptionBatch(t){let e=o.previewSubscriptionBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async confirmSubscriptionBatch(t){let e=o.confirmSubscriptionBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionBatch(t){let e=o.readSubscriptionBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async abandonSubscriptionBatch(t){let e=o.abandonSubscriptionBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async manageSubscriptionTrial(t){let e=o.manageSubscriptionTrial;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionTrial(t){let e=o.readSubscriptionTrial;return u(e.response,await r.request(e.path,e.request.parse(t)))},async listSubscriptions(t){let e=o.listSubscriptions;return u(e.response,await r.request(e.path,e.request.parse(t)))},async listPurchases(t){let e=o.listPurchases;return u(e.response,await r.request(e.path,e.request.parse(t)))},async listSubscriptionConflicts(t){let e=o.listSubscriptionConflicts;return u(e.response,await r.request(e.path,e.request.parse(t)))},async retrySubscriptionConflict(t){let e=o.retrySubscriptionConflict;return u(e.response,await r.request(e.path,e.request.parse(t)))},async previewRefund(t){let e=o.previewRefund;return u(e.response,await r.request(e.path,e.request.parse(t)))},async refund(t){let e=o.refund;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readRefund(t){let e=o.readRefund;return u(e.response,await r.request(e.path,e.request.parse(t)))},async previewUpdate(t){let e=o.previewUpdate;return u(e.response,await r.request(e.path,e.request.parse(t)))},async update(t){let e=o.update;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionUpdate(t){let e=o.readSubscriptionUpdate;return u(e.response,await r.request(e.path,e.request.parse(t)))},async restoreNativePurchase(t){let e=o.restoreNativePurchase;return u(e.response,await r.request(e.path,e.request.parse(t)))},async verifySubscriptions(t){let e=o.verifySubscriptions;return u(e.response,await r.request(e.path,e.request.parse(t)))},async previewAttach(t){let e=o.previewAttach;return u(e.response,await r.request(e.path,e.request.parse(t)))},async attach(t){let e=o.attach;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionOperation(t){let e=o.readSubscriptionOperation;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readAiPricing(t){let e=o.readAiPricing;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readUsage(t){let e=o.readUsage;return u(e.response,await r.request(e.path,e.request.parse(t)))},async setUsage(t){let e=o.setUsage;return u(e.response,await r.request(e.path,e.request.parse(t)))},async manageBalanceGrant(t){let e=o.manageBalanceGrant;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readBalanceSource(t){let e=o.readBalanceSource;return u(e.response,await r.request(e.path,e.request.parse(t)))},async adjustBalance(t){let e=o.adjustBalance;return u(e.response,await r.request(e.path,e.request.parse(t)))},async listBalanceGrants(t){let e=o.listBalanceGrants;return u(e.response,await r.request(e.path,e.request.parse(t)))},async manageBillingLimits(t){let e=o.manageBillingLimits;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readSeats(t){let e=o.readSeats;return u(e.response,await r.request(e.path,e.request.parse(t)))},async manageSeat(t){let e=o.manageSeat;return u(e.response,await r.request(e.path,e.request.parse(t)))},async manageUsageEntity(t){let e=o.manageUsageEntity;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readUsageAnalytics(t){let e=o.readUsageAnalytics;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readCreditAnalytics(t){let e=o.readCreditAnalytics;return u(e.response,await r.request(e.path,e.request.parse(t)))},async submitUsageBatch(t){let e=o.submitUsageBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readUsageBatch(t){let e=o.readUsageBatch;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readHoldings(t){let e=o.readHoldings;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readLedger(t){let e=o.readLedger;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readBillingInvoice(t){let e=o.readBillingInvoice;return u(e.response,await r.request(e.path,e.request.parse(t)))},async readCreditStatement(t){let e=o.readCreditStatement;return u(e.response,await r.request(e.path,e.request.parse(t)))},async quoteBalance(t){let e=o.quoteBalance;return u(e.response,await r.request(e.path,e.request.parse(t)))},async trackUsage(t){let e=o.trackUsage;return u(e.response,await r.request(e.path,e.request.parse(t)))},async mutateBalance(t){let e=o.mutateBalance;return u(e.response,await r.request(e.path,e.request.parse(t)))},async getCustomer(t){let e=o.getCustomer,a=e.request.safeParse(t);if(!a.success)throw new c("INVALID_REQUEST","Invalid customer lookup");let i=e.response.safeParse(await r.request(e.path,a.data));if(!i.success)throw new c("INVALID_RESPONSE","Invalid customer response");return i.data},async listCustomers(t={}){let e=o.listCustomers,a=e.request.safeParse(t);if(!a.success)throw new c("INVALID_REQUEST","Invalid customer filters");let i=e.response.safeParse(await r.request(e.path,a.data));if(!i.success)throw new c("INVALID_RESPONSE","Invalid customer response");return i.data},async updateCustomer(t){let e=o.updateCustomer,a=e.request.safeParse(t);if(!a.success)throw new c("INVALID_REQUEST","Invalid customer patch");let i=e.response.safeParse(await r.request(e.path,a.data));if(!i.success)throw new c("INVALID_RESPONSE","Invalid customer response");return i.data},async createGuestCustomer(t){let e=o.createGuestCustomer;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async resumeGuestSession(t){let e=o.resumeGuestSession;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async claimGuestCustomer(t){let e=o.claimGuestCustomer;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async renewCustomerSession(t){let e=o.renewSession;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async revokeCustomerSessions(t){let e=o.revokeSessions;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async createCustomerSession(t){let e=o.createSession.request.safeParse({customerId:t});if(!e.success)throw new c("INVALID_REQUEST","A customer ID is required");let a=o.createSession.response.safeParse(await r.request("customer-sessions",e.data));if(!a.success)throw new c("INVALID_RESPONSE","Invalid customer session response");return a.data},async getOrCreateCustomer(t){let e=o.createCustomer.request.safeParse(t);if(!e.success)throw new c("INVALID_REQUEST","Invalid customer input");let a=o.createCustomer.response.safeParse(await r.request("customers",e.data));if(!a.success)throw new c("INVALID_RESPONSE","Invalid customer response");return a.data},async grantOffer(t){let e=o.grantOffer.request.safeParse({...t,requestId:t.requestId??crypto.randomUUID()});if(!e.success)throw new c("INVALID_REQUEST","Invalid offer grant");let a=o.grantOffer.response.safeParse(await r.request("offers/grant",e.data));if(!a.success)throw new c("INVALID_RESPONSE","Invalid offer response");return a.data}}}async function $e(n,r){if(typeof window<"u")throw new c("SERVER_ONLY","Renewal requires your backend");let{funnelCredentialCommandSchema:t,funnelCredentialResponseSchema:e}=await import("./src-G7U7DUQR.js"),a=I(n);return a.identify(n.apiKey),e.parse(await a.request("funnels",t.parse({...r,operation:"renew_run"})))}export{_ as FunnelDecisionTimeoutError,c as IndianaError,U as aiPriceSnapshotSchema,O as aiTokenQuoteSchema,ae as createAiPricing,Ie as createAiUsageMiddleware,we as createConfiguredAiPricing,N as createFeatureClient,ue as createFunnelDecisionClient,he as createFunnelOrchestrationClient,oe as createFunnelStartClient,Ge as createGuestToken,ze as createIndianaServer,pe as createNativeReceiptClient,ce as createPaywallStartClient,ie as evaluateFunnelNode,$e as renewFunnelRun};
1
+ import{a as k,c as te,d as T,e as pe,f as de}from"./chunk-ULRVTA45.js";import{a as o,b as I}from"./chunk-EZFAY4ZL.js";import{Ag as j,Bg as Q,Cg as K,Dg as G,Eg as z,G as O,Gj as b,Hj as W,Ji as P,Ki as $,Lh as c,Mi as Y,Mj as Z,Oj as J,Qi as C,Ri as _,Si as H,Uk as X,Vk as ee}from"./chunk-YOH6DIUN.js";function p(n,r){try{return n.parse(r)}catch{throw new o("INVALID_RESPONSE","Invalid gateway response")}}function le(n){if(typeof window<"u")throw new o("SERVER_ONLY","Secret API keys must stay on the backend");return{start:r=>te(n,r)}}var S=class extends o{constructor(t,e){super("DECISION_PENDING","Decision is still pending; read this decision ID or retry the original request ID",202,e);this.decisionId=t;this.decisionRequestId=e}decisionId;decisionRequestId};function U(n){if("remoteEval"in n)throw new o("INVALID_REQUEST","Configure evaluation mode on the Funnel; remoteEval is not supported");if(typeof window<"u")throw new o("SERVER_ONLY","Funnel decisions are requested by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new o("INVALID_TOKEN","A server API key is required");async function r(a,s,i=!1){let u=I({...n,fetch:(m,f)=>{let d=new Headers(f?.headers);return d.set("Accept-Encoding","identity"),i&&d.set("Prefer","respond-async"),(n.fetch??globalThis.fetch)(m,{...f,headers:d})},timeoutMs:Math.min(n.timeoutMs??1e4,s?Math.max(1,s-Date.now()):12e4)});return u.identify(n.apiKey),u.request("funnels",a)}async function t(a,s){let i=_.parse(await r(C.parse({operation:"read_decision",decisionId:a}),s));if(i.decisionId!==a)throw new o("INVALID_RESPONSE","Decision identity changed");return i}async function e(a,s,i=!1){let u=C.options[0].parse({...a,operation:"decide",funnelId:n.funnelId}),m;try{m=_.parse(await r(u,s,i))}catch(f){throw f instanceof o&&["TIMEOUT","NETWORK_ERROR","SERVICE_UNAVAILABLE"].includes(f.code)?new o("DECISION_ACCEPTANCE_UNKNOWN","Decision acceptance is unknown; retry the original request ID and input",f.status,a.requestId):f}if(m.requestId!==a.requestId||m.decision&&!k(m.decision,u.customer))throw new o("INVALID_RESPONSE","Decision request or customer changed");return{response:m,customer:u.customer}}return{async configuration(){let a=J.parse(await r({operation:"configuration",funnelId:n.funnelId}));if(a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment||a.funnelId!==n.funnelId)throw new o("SCOPE_MISMATCH","Configuration scope changed");return a},features(a={}){return T({...a,scope:n.scope,load:async()=>Z.parse(await r({operation:"feature_config",funnelId:n.funnelId}))})},read:a=>t(a),async submit(a){return(await e(a,void 0,!0)).response},async decide(a){let s=Date.now()+3e4,i=await e(a,s),u=i.response,m=u.decisionId,f=250;for(;;){if(u.requestId!==a.requestId||u.decision&&!k(u.decision,i.customer))throw new o("INVALID_RESPONSE","Decision request or customer changed");if(u.decision)return u.decision;if(u.status==="failed")throw new o("DECISION_FAILED","Decision execution failed",503,a.requestId);if(Date.now()>=s)throw new S(m,a.requestId);if(await new Promise(d=>setTimeout(d,Math.min(f,s-Date.now()))),Date.now()>=s)throw new S(m,a.requestId);try{f=Math.min(1e3,f*2),u=await t(m,s)}catch(d){if(d instanceof o&&["TIMEOUT","NETWORK_ERROR","SERVICE_UNAVAILABLE","RATE_LIMITED"].includes(d.code))continue;throw d}}},async reportUsed(a){let s=H.parse(await r(C.parse({...a,operation:"report_used"})));if(s.decisionId!==a.decisionId||s.eventId!==a.eventId)throw new o("INVALID_RESPONSE","Usage receipt identity changed");return s}}}function me(n){if(typeof window<"u")throw new o("SERVER_ONLY","Native receipts are verified by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new o("INVALID_TOKEN","Server API key required");let r=I({...n,timeoutMs:n.timeoutMs??35e3});return r.identify(n.apiKey),{async recover(t){let e=X.parse(t);if(e.orderId!==e.receiptId)throw new o("INVALID_REQUEST","Native recovery requires the accepted commercial intent");let a=e.nativeEvidence,s={requestId:e.requestId,customerToken:e.customerToken,purchaseIntentId:e.orderId,...a===null?{intent:"read"}:a.provider==="apple"?{provider:"apple",signedTransaction:a.signedTransaction}:{provider:"google",purchaseToken:a.purchaseToken}},i=c.restoreNativePurchase.response.parse(await r.request(c.restoreNativePurchase.path,s));if(i.operation.requestId!==e.requestId)throw new o("INVALID_RESPONSE","Native receipt request identity changed");let u=ee.parse({scope:i.scope,requestId:e.requestId,orderId:i.operation.orderId,receiptId:i.operation.orderId,orderStatus:i.operation.status,refunded:i.operation.refunded,...i.operation.completion===null?{}:{nativeCompletion:{orderId:i.operation.orderId,receiptId:i.operation.orderId,...i.operation.completion}}});if(u.requestId!==e.requestId||u.orderId!==e.orderId||u.receiptId!==e.receiptId||u.scope.projectId!==n.scope.projectId||u.scope.environment!==n.scope.environment)throw new o("INVALID_RESPONSE","Current order receipt scope changed");return u}}}import{z as l}from"zod";var q=j,fe=l.string().regex(/^(0|[1-9]\d{0,5})(\.\d{1,12})?$/),se=l.strictObject(Object.fromEntries(q.map(n=>[n,l.number().int().nonnegative().max(1e9)]))),ie=Q,we=K,D=l.strictObject({modelId:ie,source:l.enum(["models.dev","custom"]),fetchedAt:l.iso.datetime(),rates:G,contextTier:l.number().int().nonnegative(),markupPercent:we}),x=l.strictObject({pricing:D,tokens:se,quantity:O,digest:l.string().regex(/^[a-f0-9]{64}$/)}),oe=n=>{let[r,t=""]=n.split(".");return BigInt(r)*10n**12n+BigInt(t.padEnd(12,"0"))};function Ie(n){if(typeof n!="number"||!Number.isFinite(n)||n<0)throw new o("AI_PRICE_UNAVAILABLE","A published token price is missing");let r=String(n),t=r.includes("e")?n.toFixed(12).replace(/0+$/,"").replace(/\.$/,""):r;if(Number(t)!==n||!fe.safeParse(t).success)throw new o("AI_PRICE_UNAVAILABLE","Published price exceeds the supported precision");return t}var ne=l.strictObject({input:l.number().nonnegative(),output:l.number().nonnegative(),cache_read:l.number().nonnegative().optional(),cache_write:l.number().nonnegative().optional(),reasoning:l.number().nonnegative().optional(),input_audio:l.number().nonnegative().optional(),output_audio:l.number().nonnegative().optional()}),ge=ne.extend({context_over_200k:l.unknown().optional(),tiers:l.array(ne.extend({tier:l.strictObject({type:l.literal("context"),size:l.number().int().nonnegative()})})).max(20).refine(n=>new Set(n.map(r=>r.tier.size)).size===n.length).optional()});async function re(n,r,t){let e=new TextEncoder().encode(JSON.stringify({pricing:n,tokens:r,quantity:t}));return[...new Uint8Array(await crypto.subtle.digest("SHA-256",e))].map(a=>a.toString(16).padStart(2,"0")).join("")}function ae(n,r){let t=0n;for(let w of q){if(!r[w])continue;let g=n.rates[w];if(g===void 0)throw new o("AI_PRICE_UNAVAILABLE",`No published price for ${w}; report exclusive token pools`);t+=oe(g)*BigInt(r[w])}let[e,a="0"]=String(n.markupPercent).split("e"),s=(e.split(".")[1]?.length??0)-Number(a),i=10n**BigInt(Math.max(s,0)),u=BigInt(e.replace(".",""))*10n**BigInt(Math.max(-s,0)),m=100n*i+u,f=100n*i*1000000n,d=(t*m+f-1n)/f;return O.parse(`${d/1000000n}.${(d%1000000n).toString().padStart(6,"0")}`)}function ce(n={}){if(typeof window<"u")throw new o("SERVER_ONLY","AI token pricing belongs on your backend");let r=z.parse({defaultMarkup:n.defaultMarkup??0,providerMarkups:n.providerMarkups??{},modelMarkups:n.modelMarkups??{},customModels:n.customModels??{}}),t=null,e=0;async function a(){if(!t||Date.now()>=e){e=Date.now()+15*6e4;let s=(async()=>{let i=await(n.fetch??fetch)("https://models.dev/api.json",{signal:AbortSignal.timeout(3e4)});if(!i.ok)throw new o("AI_PRICE_UNAVAILABLE","Models.dev pricing is unavailable");return{data:l.record(l.string(),l.object({models:l.record(l.string(),l.unknown())})).parse(await i.json()),fetchedAt:new Date().toISOString()}})().catch(i=>{throw t===s&&(t=null),i});t=s}return t}return{refreshPrices(){t=null,e=0},async quoteTokens(s){let i=ie.parse(s.modelId),u=se.parse(s.tokens),[m,...f]=i.split("/"),d=r.customModels[i],w,g,y,L=0;if(d?.input!==void 0&&d.output!==void 0&&q.every(E=>u[E]===0||d[E]!==void 0))w={...d,input:d.input,output:d.output},g="custom",y=new Date().toISOString();else{let E=await a(),F=E.data[m]?.models[f.join("/")];if(!F)throw new o("AI_PRICE_UNAVAILABLE","Unknown model; configure a complete custom price");let{cost:v}=l.object({cost:ge}).parse(F),M=u.input+u.cache_read+u.cache_write+u.input_audio;if(v.tiers===void 0&&v.context_over_200k!==void 0&&M>2e5)throw new o("AI_PRICE_UNAVAILABLE","A current context tier is required for this model");let N=v.tiers?.filter(h=>M>h.tier.size).sort((h,ue)=>ue.tier.size-h.tier.size)[0],B=N??v;N&&(L=N.tier.size),w=Object.fromEntries(q.filter(h=>B[h]!==void 0).map(h=>[h,Ie(B[h])])),w={...w,...d},g=d?"custom":"models.dev",y=E.fetchedAt}let R=D.parse({modelId:i,source:g,fetchedAt:y,rates:w,contextTier:L,markupPercent:r.modelMarkups[i]??r.providerMarkups[m]??r.defaultMarkup}),V=ae(R,u);return x.parse({pricing:R,tokens:u,quantity:V,digest:await re(R,u,V)})},async trackTokens(s,i){let u=x.parse(i.quote);if(u.quantity!==ae(u.pricing,u.tokens)||u.digest!==await re(u.pricing,u.tokens,u.quantity))throw new o("INVALID_REQUEST","AI quote changed after pricing");let m=i.properties??{},f=i.providerCostUsd===void 0?void 0:l.string().regex(/^(0|[1-9]\d{0,11})(\.\d{1,18})?$/).parse(i.providerCostUsd),d=i.generationId===void 0?void 0:l.string().min(1).max(120).parse(i.generationId),w=8+ +(f!==void 0)+ +(d!==void 0);if(Object.keys(m).some(y=>y.startsWith("ai_")))throw new o("INVALID_REQUEST","AI tracking reserves ai_ event properties");if(Object.keys(m).length>16-w)throw new o("INVALID_REQUEST","AI tracking properties exceed the available event budget");let g={operation:"consume",internal_feature_id:i.internal_feature_id,quantity:u.quantity,idempotencyKey:i.idempotencyKey,properties:{...m,...f!==void 0?{ai_provider_cost_usd:f}:{},...d!==void 0?{ai_generation_id:d}:{},ai_model:u.pricing.modelId,ai_source:u.pricing.source,ai_price_at:u.pricing.fetchedAt,ai_quote_hash:u.digest,ai_markup:String(u.pricing.markupPercent),ai_tier:String(u.pricing.contextTier),ai_tokens:q.map(y=>u.tokens[y]).join(","),ai_rates:"v1:"+q.map(y=>u.pricing.rates[y]===void 0?"-":oe(u.pricing.rates[y]).toString(36)).join(",")},...i.entityId?{entityId:i.entityId}:{}};return s.mutateBalance({customerId:i.customerId,command:g})}}}async function ye(n,r,t={}){let{config:e,model_markups:a}=await n.readAiPricing(r);return ce({defaultMarkup:e.default_markup??0,providerMarkups:Object.fromEntries(Object.entries(e.provider_markups??{}).map(([s,i])=>[s,i.markup])),modelMarkups:Object.fromEntries(Object.entries(a??{}).filter(([,s])=>s.markup!==void 0).map(([s,i])=>[s,i.markup])),customModels:Object.fromEntries(Object.entries(a??{}).filter(([,s])=>s.input_cost!==void 0||s.output_cost!==void 0).map(([s,i])=>[s,{...i.input_cost!==void 0?{input:String(i.input_cost)}:{},...i.output_cost!==void 0?{output:String(i.output_cost)}:{}}])),...t})}import{z as he}from"zod";var A=he.number().int().min(0).max(Number.MAX_SAFE_INTEGER);function Se(n,r){let t=A.parse(n.inputTokens.total),e=A.parse(n.outputTokens.total),a=A.parse(n.inputTokens.cacheRead??0),s=A.parse(n.inputTokens.cacheWrite??0),i=A.parse(n.outputTokens.reasoning??0);if(a+s>t||i>e||n.inputTokens.noCache!==void 0&&A.parse(n.inputTokens.noCache)!==t-a-s||n.outputTokens.text!==void 0&&A.parse(n.outputTokens.text)!==e-i)throw new o("AI_USAGE_UNAVAILABLE","Provider token counts do not conserve total usage");return{input:t-a-s,cache_read:a,cache_write:s,output:r==="output"?e:e-i,reasoning:r==="separate"?i:0,input_audio:0,output_audio:0}}function Ae(n){if(typeof window<"u")throw new o("SERVER_ONLY","AI usage belongs on the trusted backend");if(!n.modelId||!["output","separate"].includes(n.reasoning))throw new o("INVALID_REQUEST","Model ID and reasoning pricing are required");async function r(e){await n.persist({context:e,modelId:n.modelId,usage:null,tokens:null,quote:null,receipt:null,phase:"incomplete"})}async function t(e,a){let s={context:e,modelId:n.modelId,usage:a,tokens:null,quote:null,receipt:null,phase:"captured"};await n.persist(s);let i=n.mapTokens?n.mapTokens(a):Se(a,n.reasoning),u=await n.pricing.quoteTokens({modelId:n.modelId,tokens:i});await n.persist({...s,tokens:i,quote:u,phase:"quoted"});let m=await n.pricing.trackTokens(n.client,{...e,quote:u});if(!m.receipt.accepted)throw new o("AI_BALANCE_REJECTED","AI usage was captured but the balance operation was rejected");await n.persist({...s,tokens:i,quote:u,receipt:m,phase:"settled"})}return{specificationVersion:"v4",async wrapGenerate({doGenerate:e}){let a=await n.context(),s;try{s=await e()}catch(i){throw await r(a),i}return await t(a,s.usage),s},async wrapStream({doStream:e}){let a=await n.context(),s;try{s=await e()}catch(d){throw await r(a),d}let i=!1,u=!1,m=s.stream.getReader();async function f(){i||u||(u=!0,await r(a))}return{...s,stream:new ReadableStream({async pull(d){try{let{value:w,done:g}=await m.read();if(g){if(!i)throw await f(),new o("AI_USAGE_UNAVAILABLE","Stream ended without final usage; no amount was invented");d.close();return}if(w.type==="finish"){if(i)throw new o("AI_USAGE_UNAVAILABLE","Provider sent more than one final usage record");i=!0,await t(a,w.usage)}d.enqueue(w)}catch(w){try{await f()}finally{d.error(w),await m.cancel(w)}}},async cancel(d){try{await f()}finally{await m.cancel(d)}}})}}}}function qe(n){if(typeof window<"u")throw new o("SERVER_ONLY","Funnel receipts are sent by your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new o("INVALID_TOKEN","A server API key is required");let r=I(n);return r.identify(n.apiKey),{async signal(t){let e=P.parse({...t,operation:"signal"}),a=$.parse(await r.request("funnels",e));if(a.runId!==t.runId||a.eventId!==t.eventId||a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment)throw new o("INVALID_RESPONSE","Receipt identity changed");return a},async readResults(t){let e=P.parse({operation:"read_results",runId:t}),a=Y.parse(await r.request("funnels",e));if(a.runId!==t||a.scope.projectId!==n.scope.projectId||a.scope.environment!==n.scope.environment)throw new o("INVALID_RESPONSE","Result identity changed");return a}}}function Ee(n){if(typeof window<"u")throw new o("SERVER_ONLY","Campaign entry requires your backend");if(!/^gg_sk_[A-Za-z0-9_-]{32,128}$/.test(n.apiKey))throw new o("INVALID_TOKEN","A server API key is required");let r=I({...n,timeoutMs:n.timeoutMs??35e3});r.identify(n.apiKey);let t=U(n);return{async decide(e){let a=b.parse({...e,funnelId:n.funnelId,operation:"campaign_decide"}),s=_.parse(await r.request("funnels",a));if(s.scope.projectId!==n.scope.projectId||s.scope.environment!==n.scope.environment)throw new o("SCOPE_MISMATCH","Campaign scope changed");let i=s.decisionId,u=s.requestId,m=Date.now()+(n.timeoutMs??3e4);for(;s.status==="pending";){if(Date.now()>=m)throw new S(i,u);if(await new Promise(f=>setTimeout(f,250)),s=await t.read(i),s.requestId!==u)throw new o("INVALID_RESPONSE","Campaign decision identity changed")}if(s.status==="failed")throw new o("DECISION_FAILED","Campaign decision execution failed");if(!s.decision||!k(s.decision,a.customer))throw new o("INVALID_RESPONSE","Campaign Customer changed");return s.decision},async start(e){let a=b.parse({...e,funnelId:n.funnelId,operation:"campaign_start"}),s=W.parse(await r.request("funnels",a));if(s.scope.projectId!==n.scope.projectId||s.scope.environment!==n.scope.environment)throw new o("SCOPE_MISMATCH","Campaign scope changed");if(!("suppressed"in s)&&(s.run.source.id!==n.funnelId||!s.customerId||a.customer.type==="id"&&s.customerId!==a.customer.value))throw new o("INVALID_RESPONSE","Campaign Funnel or Customer changed");return s}}}function tt(){if(typeof window<"u")throw new o("SERVER_ONLY","Guest identity is issued by your backend");let n=crypto.getRandomValues(new Uint8Array(32));return"gg_gc_"+btoa(String.fromCharCode(...n)).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}function nt(n){if(typeof window<"u")throw new o("SERVER_ONLY","Secret API keys must stay on your backend");let r=I(n);return r.identify(n.apiKey),{async resolvePaywall(t){let e=c.resolvePaywall;return p(e.response,await r.request(e.path,e.request.parse(t)))},async resolveOffering(t){let e=c.resolveOffering;return p(e.response,await r.request(e.path,e.request.parse(t)))},async checkEntitlement(t){let e=c.checkEntitlement;return p(e.response,await r.request(e.path,e.request.parse(t)))},async setupPayment(t){let e=c.setupPayment;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readPaymentSetup(t){let e=c.readPaymentSetup;return p(e.response,await r.request(e.path,e.request.parse(t)))},async previewSubscriptionBatch(t){let e=c.previewSubscriptionBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async confirmSubscriptionBatch(t){let e=c.confirmSubscriptionBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionBatch(t){let e=c.readSubscriptionBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async abandonSubscriptionBatch(t){let e=c.abandonSubscriptionBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async manageSubscriptionTrial(t){let e=c.manageSubscriptionTrial;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionTrial(t){let e=c.readSubscriptionTrial;return p(e.response,await r.request(e.path,e.request.parse(t)))},async listSubscriptions(t){let e=c.listSubscriptions;return p(e.response,await r.request(e.path,e.request.parse(t)))},async listPurchases(t){let e=c.listPurchases;return p(e.response,await r.request(e.path,e.request.parse(t)))},async listSubscriptionConflicts(t){let e=c.listSubscriptionConflicts;return p(e.response,await r.request(e.path,e.request.parse(t)))},async retrySubscriptionConflict(t){let e=c.retrySubscriptionConflict;return p(e.response,await r.request(e.path,e.request.parse(t)))},async previewRefund(t){let e=c.previewRefund;return p(e.response,await r.request(e.path,e.request.parse(t)))},async refund(t){let e=c.refund;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readRefund(t){let e=c.readRefund;return p(e.response,await r.request(e.path,e.request.parse(t)))},async previewUpdate(t){let e=c.previewUpdate;return p(e.response,await r.request(e.path,e.request.parse(t)))},async update(t){let e=c.update;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionUpdate(t){let e=c.readSubscriptionUpdate;return p(e.response,await r.request(e.path,e.request.parse(t)))},async restoreNativePurchase(t){let e=c.restoreNativePurchase;return p(e.response,await r.request(e.path,e.request.parse(t)))},async verifySubscriptions(t){let e=c.verifySubscriptions;return p(e.response,await r.request(e.path,e.request.parse(t)))},async previewAttach(t){let e=c.previewAttach;return p(e.response,await r.request(e.path,e.request.parse(t)))},async attach(t){let e=c.attach;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readSubscriptionOperation(t){let e=c.readSubscriptionOperation;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readAiPricing(t){let e=c.readAiPricing;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readUsage(t){let e=c.readUsage;return p(e.response,await r.request(e.path,e.request.parse(t)))},async setUsage(t){let e=c.setUsage;return p(e.response,await r.request(e.path,e.request.parse(t)))},async manageBalanceGrant(t){let e=c.manageBalanceGrant;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readBalanceSource(t){let e=c.readBalanceSource;return p(e.response,await r.request(e.path,e.request.parse(t)))},async adjustBalance(t){let e=c.adjustBalance;return p(e.response,await r.request(e.path,e.request.parse(t)))},async listBalanceGrants(t){let e=c.listBalanceGrants;return p(e.response,await r.request(e.path,e.request.parse(t)))},async manageBillingLimits(t){let e=c.manageBillingLimits;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readSeats(t){let e=c.readSeats;return p(e.response,await r.request(e.path,e.request.parse(t)))},async manageSeat(t){let e=c.manageSeat;return p(e.response,await r.request(e.path,e.request.parse(t)))},async manageUsageEntity(t){let e=c.manageUsageEntity;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readUsageAnalytics(t){let e=c.readUsageAnalytics;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readCreditAnalytics(t){let e=c.readCreditAnalytics;return p(e.response,await r.request(e.path,e.request.parse(t)))},async submitUsageBatch(t){let e=c.submitUsageBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readUsageBatch(t){let e=c.readUsageBatch;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readHoldings(t){let e=c.readHoldings;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readLedger(t){let e=c.readLedger;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readBillingInvoice(t){let e=c.readBillingInvoice;return p(e.response,await r.request(e.path,e.request.parse(t)))},async readCreditStatement(t){let e=c.readCreditStatement;return p(e.response,await r.request(e.path,e.request.parse(t)))},async quoteBalance(t){let e=c.quoteBalance;return p(e.response,await r.request(e.path,e.request.parse(t)))},async trackUsage(t){let e=c.trackUsage;return p(e.response,await r.request(e.path,e.request.parse(t)))},async mutateBalance(t){let e=c.mutateBalance;return p(e.response,await r.request(e.path,e.request.parse(t)))},async getCustomer(t){let e=c.getCustomer,a=e.request.safeParse(t);if(!a.success)throw new o("INVALID_REQUEST","Invalid customer lookup");let s=e.response.safeParse(await r.request(e.path,a.data));if(!s.success)throw new o("INVALID_RESPONSE","Invalid customer response");return s.data},async listCustomers(t={}){let e=c.listCustomers,a=e.request.safeParse(t);if(!a.success)throw new o("INVALID_REQUEST","Invalid customer filters");let s=e.response.safeParse(await r.request(e.path,a.data));if(!s.success)throw new o("INVALID_RESPONSE","Invalid customer response");return s.data},async updateCustomer(t){let e=c.updateCustomer,a=e.request.safeParse(t);if(!a.success)throw new o("INVALID_REQUEST","Invalid customer patch");let s=e.response.safeParse(await r.request(e.path,a.data));if(!s.success)throw new o("INVALID_RESPONSE","Invalid customer response");return s.data},async createGuestCustomer(t){let e=c.createGuestCustomer;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async resumeGuestSession(t){let e=c.resumeGuestSession;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async claimGuestCustomer(t){let e=c.claimGuestCustomer;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async renewCustomerSession(t){let e=c.renewSession;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async revokeCustomerSessions(t){let e=c.revokeSessions;return e.response.parse(await r.request(e.path,e.request.parse(t)))},async createCustomerSession(t){let e=c.createSession.request.safeParse({customerId:t});if(!e.success)throw new o("INVALID_REQUEST","A customer ID is required");let a=c.createSession.response.safeParse(await r.request("customer-sessions",e.data));if(!a.success)throw new o("INVALID_RESPONSE","Invalid customer session response");return a.data},async getOrCreateCustomer(t){let e=c.createCustomer.request.safeParse(t);if(!e.success)throw new o("INVALID_REQUEST","Invalid customer input");let a=c.createCustomer.response.safeParse(await r.request("customers",e.data));if(!a.success)throw new o("INVALID_RESPONSE","Invalid customer response");return a.data},async grantOffer(t){let e=c.grantOffer.request.safeParse({...t,requestId:t.requestId??crypto.randomUUID()});if(!e.success)throw new o("INVALID_REQUEST","Invalid offer grant");let a=c.grantOffer.response.safeParse(await r.request("offers/grant",e.data));if(!a.success)throw new o("INVALID_RESPONSE","Invalid offer response");return a.data}}}async function rt(n,r){if(typeof window<"u")throw new o("SERVER_ONLY","Renewal requires your backend");let{funnelCredentialCommandSchema:t,funnelCredentialResponseSchema:e}=await import("./src-3GT6E6XD.js"),a=I(n);return a.identify(n.apiKey),e.parse(await a.request("funnels",t.parse({...r,operation:"renew_run"})))}export{S as FunnelDecisionTimeoutError,o as IndianaError,D as aiPriceSnapshotSchema,x as aiTokenQuoteSchema,ce as createAiPricing,Ae as createAiUsageMiddleware,ye as createConfiguredAiPricing,T as createFeatureClient,Ee as createFunnelCampaignClient,U as createFunnelDecisionClient,qe as createFunnelOrchestrationClient,de as createFunnelStartClient,tt as createGuestToken,nt as createIndianaServer,me as createNativeReceiptClient,le as createPaywallStartClient,pe as evaluateFunnelNode,rt as renewFunnelRun};
@@ -0,0 +1 @@
1
+ import{$,$a,$b,$c,$d,$e,$f as ag,$g as ah,$h as ai,$i as aj,$j as ak,$k as al,A,Aa,Ab,Ac,Ad,Ae,Af as Bf,Ag as Bg,Ah as Bh,Ai as Bi,Aj as Bj,Ak as Bk,B,Ba,Bb,Bc,Bd,Be,Bf as Cf,Bg as Cg,Bh as Ch,Bi as Ci,Bj as Cj,Bk as Ck,C,Ca,Cb,Cc,Cd,Ce,Cf as Df,Cg as Dg,Ch as Dh,Ci as Di,Cj as Dj,Ck as Dk,D,Da,Db,Dc,Dd,De,Df as Ef,Dg as Eg,Dh as Eh,Di as Ei,Dj as Ej,Dk as Ek,E,Ea,Eb,Ec,Ed,Ee,Ef as Ff,Eg as Fg,Eh as Fh,Ei as Fi,Ej as Fj,Ek as Fk,F,Fa,Fb,Fc,Fd,Fe,Ff as Gf,Fg as Gg,Fh as Gh,Fi as Gi,Fj as Gj,Fk as Gk,G,Ga,Gb,Gc,Gd,Ge,Gf as Hf,Gg as Hg,Gh as Hh,Gi as Hi,Gj as Hj,Gk as Hk,H,Ha,Hb,Hc,Hd,He,Hf as If,Hg as Ig,Hh as Ih,Hi as Ii,Hj as Ij,Hk as Ik,I,Ia,Ib,Ic,Id,Ie,If as Jf,Ig as Jg,Ih as Jh,Ii as Ji,Ij as Jj,Ik as Jk,J,Ja,Jb,Jc,Jd,Je,Jf as Kf,Jg as Kg,Jh as Kh,Ji as Ki,Jj as Kj,Jk as Kk,K,Ka,Kb,Kc,Kd,Ke,Kf as Lf,Kg as Lg,Kh as Lh,Ki as Li,Kj as Lj,Kk as Lk,L,La,Lb,Lc,Ld,Le,Lf as Mf,Lg as Mg,Lh as Mh,Li as Mi,Lj as Mj,Lk as Mk,M,Ma,Mb,Mc,Md,Me,Mf as Nf,Mg as Ng,Mh as Nh,Mi as Ni,Mj as Nj,Mk as Nk,N,Na,Nb,Nc,Nd,Ne,Nf as Of,Ng as Og,Nh as Oh,Ni as Oi,Nj as Oj,Nk as Ok,O,Oa,Ob,Oc,Od,Oe,Of as Pf,Og as Pg,Oh as Ph,Oi as Pi,Oj as Pj,Ok as Pk,P,Pa,Pb,Pc,Pd,Pe,Pf as Qf,Pg as Qg,Ph as Qh,Pi as Qi,Pj as Qj,Pk as Qk,Q,Qa,Qb,Qc,Qd,Qe,Qf as Rf,Qg as Rg,Qh as Rh,Qi as Ri,Qj as Rj,Qk as Rk,R,Ra,Rb,Rc,Rd,Re,Rf as Sf,Rg as Sg,Rh as Sh,Ri as Si,Rj as Sj,Rk as Sk,S,Sa,Sb,Sc,Sd,Se,Sf as Tf,Sg as Tg,Sh as Th,Si as Ti,Sj as Tj,Sk as Tk,T,Ta,Tb,Tc,Td,Te,Tf as Uf,Tg as Ug,Th as Uh,Ti as Ui,Tj as Uj,Tk as Uk,U,Ua,Ub,Uc,Ud,Ue,Uf as Vf,Ug as Vg,Uh as Vh,Ui as Vi,Uj as Vj,Uk as Vk,V,Va,Vb,Vc,Vd,Ve,Vf as Wf,Vg as Wg,Vh as Wh,Vi as Wi,Vj as Wj,Vk as Wk,W,Wa,Wb,Wc,Wd,We,Wf as Xf,Wg as Xg,Wh as Xh,Wi as Xi,Wj as Xj,Wk as Xk,X,Xa,Xb,Xc,Xd,Xe,Xf as Yf,Xg as Yg,Xh as Yh,Xi as Yi,Xj as Yj,Xk as Yk,Y,Ya,Yb,Yc,Yd,Ye,Yf as Zf,Yg as Zg,Yh as Zh,Yi as Zi,Yj as Zj,Yk as Zk,Z,Za,Zb,Zc,Zd,Ze,Zf as _f,Zg as _g,Zh as _h,Zi as _i,Zj as _j,Zk as _k,_,_a,_b,_c,_d,_e,_f as $f,_g as $g,_h as $h,_i as $i,_j as $j,_k as $k,a,aa,ab,ac,ad,ae,af,ag as bg,ah as bh,ai as bi,aj as bj,ak as bk,al as bl,b,ba,bb,bc,bd,be,bf,bg as cg,bh as ch,bi as ci,bj as cj,bk as ck,bl as cl,c,ca,cb,cc,cd,ce,cf,cg as dg,ch as dh,ci as di,cj as dj,ck as dk,cl as dl,d,da,db,dc,dd,de,df,dg as eg,dh as eh,di as ei,dj as ej,dk as ek,dl as el,e,ea,eb,ec,ed,ee,ef,eg as fg,eh as fh,ei as fi,ej as fj,ek as fk,el as fl,f,fa,fb,fc,fd,fe,ff,fg as gg,fh as gh,fi as gi,fj as gj,fk as gk,fl as gl,g,ga,gb,gc,gd,ge,gf,gg as hg,gh as hh,gi as hi,gj as hj,gk as hk,gl as hl,h,ha,hb,hc,hd,he,hf,hg as ig,hh as ih,hi as ii,hj as ij,hk as ik,hl as il,i,ia,ib,ic,id,ie,if as jf,ig as jg,ih as jh,ii as ji,ij as jj,ik as jk,il as jl,j,ja,jb,jc,jd,je,jf as kf,jg as kg,jh as kh,ji as ki,jj as kj,jk as kk,jl as kl,k,ka,kb,kc,kd,ke,kf as lf,kg as lg,kh as lh,ki as li,kj as lj,kk as lk,kl as ll,l,la,lb,lc,ld,le,lf as mf,lg as mg,lh as mh,li as mi,lj as mj,lk as mk,ll as ml,m,ma,mb,mc,md,me,mf as nf,mg as ng,mh as nh,mi as ni,mj as nj,mk as nk,ml as nl,n,na,nb,nc,nd,ne,nf as of,ng as og,nh as oh,ni as oi,nj as oj,nk as ok,nl as ol,o,oa,ob,oc,od,oe,of as pf,og as pg,oh as ph,oi as pi,oj as pj,ok as pk,ol as pl,p,pa,pb,pc,pd,pe,pf as qf,pg as qg,ph as qh,pi as qi,pj as qj,pk as qk,pl as ql,q,qa,qb,qc,qd,qe,qf as rf,qg as rg,qh as rh,qi as ri,qj as rj,qk as rk,ql as rl,r,ra,rb,rc,rd,re,rf as sf,rg as sg,rh as sh,ri as si,rj as sj,rk as sk,rl as sl,s,sa,sb,sc,sd,se,sf as tf,sg as tg,sh as th,si as ti,sj as tj,sk as tk,sl as tl,t,ta,tb,tc,td,te,tf as uf,tg as ug,th as uh,ti as ui,tj as uj,tk as uk,tl as ul,u,ua,ub,uc,ud,ue,uf as vf,ug as vg,uh as vh,ui as vi,uj as vj,uk as vk,ul as vl,v,va,vb,vc,vd,ve,vf as wf,vg as wg,vh as wh,vi as wi,vj as wj,vk as wk,vl as wl,w,wa,wb,wc,wd,we,wf as xf,wg as xg,wh as xh,wi as xi,wj as xj,wk as xk,wl as xl,x,xa,xb,xc,xd,xe,xf as yf,xg as yg,xh as yh,xi as yi,xj as yj,xk as yk,xl as yl,y,ya,yb,yc,yd,ye,yf as zf,yg as zg,yh as zh,yi as zi,yj as zj,yk as zk,yl as zl,z,za,zb,zc,zd,ze,zf as Af,zg as Ag,zh as Ah,zi as Ai,zj as Aj,zk as Ak,zl as Al}from"./chunk-YOH6DIUN.js";export{Ma as COMMON_LOCALES,Oa as COUPON_TERM_LOCALES,_e as CUSTOMER_DATA_SOURCES,xk as DEFAULT_AUDIENCE_GROUP,Gi as DEFAULT_FUNNEL_EXECUTION_POLICY,Ui as FUNNEL_API_CAPABILITIES,Oh as FUNNEL_LIMITS,Sj as FUNNEL_PREVIEW_LIMITS,re as OFFERING_MAX_DEPTH,te as OFFERING_MAX_ITEMS,se as OFFERING_MAX_PRODUCTS,Vf as POPUP_WIDTHS,kf as SCREEN_LIMITS,jf as SCREEN_SCHEMA_VERSION,Rh as SCREEN_TEMPLATES,Tf as SURFACE_PATHS,Se as SURFACE_VARIABLES,Ph as UNBOUND_PRODUCT_VERSION_ID,j as aiCreditSystemConfigSchema,Dg as aiMarkupSchema,Cg as aiModelIdSchema,Eg as aiModelRatesSchema,Fg as aiPricingConfigurationSchema,Bg as aiTokenPools,w as amountToMinor,Lh as apiErrorCodeSchema,Mh as apiOperations,Eh as apiPermissionSchema,Rk as appResultsSchema,Qk as appRevenueSchema,_k as appendScreenTemplate,rl as applyGrowthReleasePlan,qi as archiveSurfaceTemplateSchema,Ak as audienceCustomerSchema,Jk as audienceFunnelUsageSchema,Kk as audienceFunnelUsagesSchema,Bk as audienceMembersSchema,dc as audienceSchema,zk as audienceWriteSchema,sk as auditFieldSchema,vk as auditHistoryCursorSchema,wk as auditHistorySchema,rk as auditResourceSchema,nb as autoTopupPurchaseLimitSchema,zb as autoTopupStateSchema,yl as autumnAmountToMinor,gk as autumnCustomerAutoTopupSchema,lk as autumnCustomerControlsSchema,nk as autumnCustomerMetadataSchema,kk as autumnCustomerOverageAllowedSchema,pk as autumnCustomerProductSummarySchema,ok as autumnCustomerProfileRecordSchema,hk as autumnCustomerSpendLimitSchema,jk as autumnCustomerUsageAlertSchema,ik as autumnCustomerUsageLimitSchema,mk as autumnEntityControlsSchema,zl as autumnMinorToAmount,Al as autumnUsageUnitAmountDecimal,wg as balanceAdjustmentCommandSchema,xg as balanceAdjustmentStateSchema,vc as balanceAllocationSchema,sc as balanceCommandSchema,Ac as balanceGrantCommandSchema,zc as balanceGrantCreateSchema,Dc as balanceGrantPageSchema,Cc as balanceGrantReadSchema,Bc as balanceGrantSchema,yc as balanceOperationSchema,tc as balancePricingSegmentSchema,xc as balanceQuoteSchema,uc as balanceReceiptUnitsSchema,wc as balanceRejectionReasonSchema,el as balanceSourceReasonSchema,yg as balanceSourceStateSchema,fl as balanceSourceStatusSchema,hl as balanceSourcesPageSchema,gl as balanceSourcesQuerySchema,gb as billingAccruedMinorSchema,fb as billingAmountMinorSchema,qb as billingAuthorizationSchema,pb as billingAuthorizationTermsSchema,hb as billingBudgetMinorSchema,Ab as billingControlInputSchema,Bb as billingControlsSchema,Jb as billingCouponsSchema,z as billingCurrencies,Cb as billingInvoiceLineSchema,Db as billingInvoiceSchema,Gb as billingInvoicesSchema,ub as billingLimitSchema,mi as billingPortalInputSchema,ni as billingPortalSchema,D as billingSettingsMutationSchema,B as billingSettingsSchema,C as billingSettingsScopeSchema,yb as billingUsageWindowSchema,yf as borderSchema,Ef as buttonNodeSchema,gc as campaignInputSchema,ec as campaignOfferSchema,hc as campaignSchema,Ka as canonicalLocale,Te as capabilityBindingSchema,lb as cashPriceSchema,jb as cashPricingSchema,ib as cashPricingTiersSchema,eb as cashUnitAmountMinorSchema,eh as claimRewardProductRequestSchema,dd as commerceAccessSchema,ie as commerceContextSchema,Xd as commerceCursorSchema,Yd as commerceListQuerySchema,ed as commerceMoneySchema,al as commerceProductKind,cd as commerceProductKindSchema,bd as commerceProviderSchema,Ba as compileGrowthFeatures,Eb as confirmBillingAdjustmentInputSchema,sb as confirmBillingAuthorizationInputSchema,vl as consoleHasPermission,Hd as consoleRefundRequestSchema,tl as consoleResources,ul as consoleRolePermissions,sl as consoleRoleSchema,Lf as countdownNodeSchema,Va as couponAppliesToSchema,_a as couponChangeErrors,Kf as couponCodeNodeSchema,Ta as couponDiscountSchema,Ck as couponDisplaySchema,Wh as couponDistributionBatchSchema,Yh as couponDistributionDetailSchema,Vh as couponDistributionPreviewSchema,Xh as couponDistributionRecipientSchema,Zh as couponDistributionWriteSchema,Ua as couponDurationSchema,Wa as couponEligibilitySchema,Xa as couponInputSchema,Sa as couponStatusSchema,fk as couponTemplateExample,dk as couponTemplateKey,bb as couponWindow,Fk as createAccountOverviewPage,Ek as createCreditCenterPage,Hk as createCustomerPageTemplates,Hh as createCustomerRequestSchema,Ih as createCustomerResponseSchema,Gk as createMembershipPage,gh as createReferralCodeRequestSchema,F as creditAmountSchema,Ig as creditAnalyticsFilterSchema,Kg as creditAnalyticsPageSchema,Jg as creditAnalyticsQuerySchema,Gg as creditAnalyticsRangeSchema,Hg as creditAnalyticsTimezoneSchema,L as creditDimensionSchema,M as creditMultiplierSchema,H as creditPriceAdjustmentSchema,N as creditPricingSchema,J as creditPropertiesSchema,G as creditQuantitySchema,O as creditRateSchema,Lb as creditResetCountSchema,Kb as creditResetSchema,I as creditResourceKeySchema,Mb as creditRolloverSchema,c as creditSchemaItemSchema,Hc as creditStatementInputSchema,Ic as creditStatementSchema,i as creditSystemConfigSchema,K as creditTiersSchema,t as currencies,A as currencyAmountOptionsSchema,v as currencyDecimals,u as currencySchema,Nh as currentApiOperations,Jc as currentNotificationEventTypeSchema,If as customHtmlNodeSchema,ka as customerActivitySchema,ph as customerAttributesSchema,yk as customerAudienceSchema,af as customerDataConfigSchema,df as customerDataIntentSchema,Gf as customerDataNodeSchema,vh as customerDataReferenceMessage,uh as customerDataReferenced,th as customerDataSchema,$e as customerDataSourceSchema,Kh as customerEntitlementsSchema,Ch as customerFiltersSchema,qh as customerFingerprintSchema,Sk as customerFunnelDecisionsSchema,Ah as customerGetSchema,Rc as customerHoldingsSchema,rh as customerInputSchema,Vc as customerLedgerEntrySchema,Wc as customerLedgerPageSchema,Uc as customerLedgerQuerySchema,yh as customerLookupSchema,xh as customerMutationSchema,cf as customerPageDataSchema,bf as customerPageNodeStateSchema,qk as customerPageSampleData,Dh as customerPageSchema,zh as customerPatchSchema,bc as customerPlanCreateSchema,cc as customerPlanCreatedSchema,ja as customerPlanSchema,wh as customerProfileSchema,sh as customerReferenceSchema,li as customerScheduledChangeCancelSchema,ji as customerScheduledChangeSchema,ki as customerScheduledChangesSchema,ic as customerSchema,oh as customerTagsSchema,Bh as customerUpdateRequestSchema,Qh as defaultScreenTheme,$a as describeCoupon,Xb as diffProductVariant,Ff as dividerNodeSchema,ef as emptyCustomerPageNode,ke as entitlementCheckInputSchema,le as entitlementCheckReasonSchema,ne as entitlementCheckResultSchema,je as entitlementRequirementSchema,ga as entitlementSnapshotSchema,Jh as entitlementStatusSchema,X as environmentSchema,$c as environmentSettingsSchema,jc as errorResponseSchema,gf as escapeHtmlText,na as evalCondition,pa as evalFeature,Cj as executionSourceSchema,Aa as experimentConfigurationSchema,za as experimentPhaseSchema,Ea as experimentSnapshotSchema,n as featureCollectionSchema,g as featureConfigOverrideSchema,k as featureDefinitionSchema,a as featureIdSchema,$ as featureInputSchema,f as featureMarkupsOverrideSchema,o as featureOptionsSchema,Nj as featurePayloadSchema,m as featureRecordSchema,aa as featureSchema,wl as featureTypes,xl as featureUpdateBlockers,l as featureUpdateRulesSchema,Nc as featureUsageReadSchema,Oc as featureUsageSetSchema,Pc as featureUsageStateSchema,b as featureUsageTypeSchema,p as featureWriteSchema,$f as fieldValue,wf as fillSchema,Qc as financialAmountSchema,Tc as financialCursorSchema,Sc as financialEntryTypeSchema,gg as findDocumentNode,fg as findNode,ck as formatCouponConditions,Qa as formatCouponDiscount,Pa as formatCouponMoney,Ra as formatCouponTerms,y as formatCurrencyMinor,dl as formatProductBillingPeriod,ab as formatUsd,Vi as funnelApiBindingSchema,Hj as funnelCampaignCommandSchema,Ij as funnelCampaignStartResponseSchema,Wi as funnelCapabilitySchema,xj as funnelCollectionSchema,tj as funnelCommandSchema,Pj as funnelConfigurationSchema,dj as funnelConsumedVariables,Fj as funnelCredentialCommandSchema,Gj as funnelCredentialResponseSchema,sj as funnelDataQueriesSchema,Qi as funnelDecideShape,Ri as funnelDecisionCommandSchema,Oi as funnelDecisionOutputSchema,Si as funnelDecisionResponseSchema,Pi as funnelDecisionSchema,Ti as funnelDecisionUsedResponseSchema,nj as funnelDocumentDraftSchema,pj as funnelDocumentSchema,si as funnelEvaluationAttributes,vj as funnelEvaluationModeSchema,Fi as funnelExecutionPolicySchema,jj as funnelExecutionStateSchema,Ei as funnelExternalTaskSchema,Zi as funnelGraphDraftSchema,Yi as funnelGraphNodeSchema,_i as funnelGraphSchema,$i as funnelGraphTargets,Ik as funnelGroupReferenceSchema,Bj as funnelInstructionSchema,hj as funnelNodeInputSchema,fj as funnelNodeKindSchema,ij as funnelNodeResultSchema,Ki as funnelOrchestrationCommandSchema,yi as funnelParametersFromUrl,rj as funnelPresentationSubmissionSchema,Tj as funnelPreviewCommandSchema,Wj as funnelPreviewDependencySchema,Xj as funnelPreviewJournalSchema,Uj as funnelPreviewOutcomeSchema,Zj as funnelPreviewRequestSchema,_j as funnelPreviewResponseSchema,Vj as funnelPreviewScenarioSchema,ak as funnelPreviewShareWriteSchema,$j as funnelPreviewSnapshotSchema,Yj as funnelPreviewSourceSchema,oj as funnelPublishableDraftSchema,wj as funnelRecordSchema,gj as funnelResourceReferenceSchema,Lk as funnelResultsCursorSchema,Mk as funnelResultsQuerySchema,Ni as funnelResultsResponseSchema,Nk as funnelResultsSchema,Dj as funnelRunViewSchema,Ej as funnelRuntimeResponseSchema,Aj as funnelRuntimeStatusSchema,Li as funnelSignalResponseSchema,bk as funnelStatisticsSchema,Di as funnelTaskBindingSchema,Bi as funnelTaskDataSchema,Ci as funnelTaskOutputsSchema,Hi as funnelTaskResponseSchema,Mi as funnelTaskResultsSchema,Zk as funnelTemplateDraft,Xk as funnelTemplateSchema,Qj as funnelTopology,Oj as funnelTopologySchema,kj as funnelTraceEventSchema,mj as funnelValueDeclarationSchema,qj as funnelValueMatches,ri as funnelValueSchema,ej as funnelWaitKindSchema,yj as funnelWriteSchema,Jj as gbRuntimeExperimentSchema,Kj as gbRuntimeFeatureRuleSchema,Lj as gbRuntimeFeatureSchema,Mj as gbRuntimeSavedGroupsSchema,ql as getRecommendedRolloutData,il as growthAttributeSchema,ra as growthAttributesSchema,kl as growthCatalogSchema,ua as growthConditionGroupIds,ui as growthConditionPaths,sa as growthConditionSchema,ml as growthDryRunSchema,nl as growthExperimentInspectionSchema,Ca as growthExperimentStop,Da as growthFeatureExpiry,wa as growthFeatureRuleSchema,xa as growthFeatureSchema,ya as growthFeaturesSchema,ol as growthGroupReferenceCursorSchema,pl as growthGroupReferencesSchema,ta as growthGroupSchema,jl as growthNamespaceSchema,ll as growthResourceWriteSchema,Ha as growthRuleContextSchema,va as growthSavedGroupsSchema,Fa as growthSnapshotSchema,Ia as growthSplitResultSchema,ff as htmlVariableErrors,mf as identifierSchema,Df as imageNodeSchema,vf as imagePositionSchema,tf as insetsSchema,Ec as invoiceDetailInputSchema,Gc as invoiceDetailSchema,Fc as invoiceProductItemSchema,Gd as invoiceRefundsSchema,mb as isInvoiceCreditPrice,Pe as isProductGroup,$k as isRecurringMembership,hg as isRtlLocale,kb as itemBillingCycleSchema,qa as jsonValueSchema,E as licenseOfferSchema,Fb as listBillingInvoicesInputSchema,Na as localeLabel,Ja as localeSchema,ag as localeStatuses,eg as localizeScreen,wb as manageBillingLimitsInputSchema,vb as manageOveragePolicyInputSchema,uf as marginSchema,La as matchLocale,ti as matchesGrowthCondition,T as membershipActionSchema,bl as membershipBillingCount,U as membershipChangeSchema,V as membershipHoldingSchema,R as membershipRulesSchema,W as membershipStateSchema,S as membershipTimingSchema,tk as mergeAuditSchema,_ as metadataSchema,h as meteredConfigSchema,x as minorToAmount,e as modelMarkupsSchema,Uk as nativeCompletionSchema,fd as nativeCouponStoreOfferLinkWriteSchema,gd as nativeCouponStoreOfferLinksSchema,oc as nativeProductBindingSchema,qc as nativeProductBindingWriteSchema,pc as nativeProductBindingsPageSchema,Tk as nativeProofSchema,ld as nativePurchaseInstructionSchema,Vk as nativeReceiptCommandSchema,Wk as nativeReceiptResponseSchema,ge as nativeRestoreCommandSchema,he as nativeRestoreResultSchema,jd as nativeStoreOfferForProduct,hd as nativeStoreOfferSelectionSchema,id as nativeStoreOfferSelectionsSchema,kd as nativeStoreSelectionMatches,yd as nativeSubscriptionUpdatePreviewSchema,zd as nativeSubscriptionUpdateResultSchema,Uh as newBlankSurface,Za as newCouponInput,zj as newFunnelDocument,Sh as newScreenFromTemplate,Th as newSurfaceFromTemplate,lf as nodeIdSchema,uk as objectAuditSchema,Ok as offerFlowInputSchema,Pk as offerFlowResultSchema,cb as offerSchema,db as offerUnavailableReasonSchema,ze as offeringAuthorSchema,De as offeringCollectionSchema,ye as offeringDocumentSchema,ue as offeringItemSchema,ve as offeringItemsSchema,qe as offeringMetadataSchema,Ae as offeringProductEvidenceSchema,pe as offeringProductIdSchema,we as offeringProductIds,He as offeringProductOptionSchema,xe as offeringProductPaths,Je as offeringPublicationIssues,Be as offeringRecordSchema,Ge as offeringSelectorSchema,Ke as offeringValueSchema,Ce as offeringVersionSchema,Ie as offeringWorkspaceSchema,Fe as offeringWriteResultSchema,Ee as offeringWriteSchema,rc as overageBehaviorSchema,xb as overagePolicySchema,lj as ownedFunnelScreenSchema,rf as paintColorSchema,Rd as paymentSetupCommandSchema,Sd as paymentSetupReadSchema,Ud as paymentSetupSchema,me as paywallCandidateSchema,lg as paywallClientActionSchema,rg as paywallCollectionSchema,mg as paywallDocumentDraftSchema,ng as paywallDocumentSchema,pg as paywallFlowIssues,tg as paywallLibrarySchema,og as paywallProductIssues,Ne as paywallProductsSchema,qg as paywallRecordSchema,oe as paywallRequestSchema,vg as paywallResolutionSchema,ug as paywallResolveInputSchema,sg as paywallWriteSchema,da as planConfigSchema,ea as planInputSchema,ca as planItemSchema,Mf as planPickerNodeSchema,fa as planSchema,ha as planVersionSchema,fc as popupSchema,ac as prepaidAllowanceAmount,r as prepaidPriceAmount,s as prepaidQuantityAmount,kc as prepaidQuantitySchema,q as prepaidTierPricingSchema,ob as prepareBillingAuthorizationInputSchema,ek as prepareCouponTemplate,ma as prepareSavedGroups,rb as preparedBillingAuthorizationSchema,Uf as presentationSchema,Jf as priceNodeSchema,ba as priceSchema,Pb as productAllowanceSchema,lc as productBindingSchema,nc as productBindingWriteSchema,mc as productBindingsPageSchema,_b as productCollectionSchema,Sb as productConfigurationSchema,Vb as productDefinitionSchema,$b as productEditorOptionsSchema,Me as productGroupingMatches,Le as productGroupingSchema,Rb as productLicenseSchema,_h as productMigrationBlockReasonSchema,fi as productMigrationDetailSchema,$h as productMigrationErrorCodeSchema,ei as productMigrationItemSchema,ci as productMigrationItemStatusSchema,gi as productMigrationListSchema,ai as productMigrationPreviewSchema,ii as productMigrationQuerySchema,bi as productMigrationRunStatusSchema,di as productMigrationSchema,hi as productMigrationWriteSchema,Yb as productOptionsSchema,Ob as productPrepaidPriceSchema,Nb as productPricesSchema,Zb as productRecordSchema,jg as productSelectionSchema,Qb as productTrialSchema,Tb as productVariantOverridesSchema,Ub as productVariantSchema,Rj as projectFunnelConfiguration,_c as projectSettingsSchema,Ya as promotionCodeInputSchema,d as providerMarkupsSchema,bg as publishChecks,_d as purchaseListItemSchema,ee as purchaseListPageSchema,of as radiusSchema,dh as redeemRewardRequestSchema,hh as referralCodeSchema,jh as referralProgramCollectionSchema,Yg as referralProgramInputSchema,_g as referralProgramRecordSchema,bh as referralProgramWriteSchema,Xf as replaceFirstPageRoot,Dk as resolveCouponDisplay,Xi as resolveFunnelCapabilityInputs,Ji as resolveFunnelTaskInputs,Wb as resolveProductVariant,dg as resolveScreenLocale,Gh as responseMetaSchema,tb as revokeBillingAuthorizationInputSchema,lh as rewardActivityRedemptionSchema,mh as rewardActivitySchema,Xg as rewardCodeInputSchema,kh as rewardCodeSchema,nh as rewardCodeWriteSchema,ih as rewardCollectionSchema,Ug as rewardConfigurationSchema,Sg as rewardGrantExpirySchema,Tg as rewardGrantSchema,Wg as rewardInputSchema,Vg as rewardKeySchema,$g as rewardOptionSchema,fh as rewardProductCheckoutSchema,Zg as rewardRecordSchema,ch as rewardRedemptionSchema,Rg as rewardStatusSchema,Qg as rewardTypeSchema,ah as rewardWriteSchema,oa as runExperiment,cl as sameMembershipBillingCycle,pi as saveSurfaceTemplateSchema,Y as scopeSchema,Qf as screenActionSchema,wi as screenAnswersSchema,vi as screenDataCursorSchema,Yf as screenDocumentSchema,pf as screenImageSourceSchema,zi as screenInputBindingsSchema,Pf as screenNodeSchema,xi as screenParametersSchema,kg as screenPresentationSchema,Qe as screenProductScopes,Re as screenProductSelections,Ai as screenRendererInputSchema,ig as screenSelections,Rf as screenStringsSchema,Yc as seatCommandSchema,Xc as seatReadSchema,Zc as seatsStateSchema,bj as selectFunnelCondition,Oe as selectedPaywallProduct,Ze as selectedSurfaceValue,cg as servableLocales,Ib as setBillingCouponsInputSchema,zf as shadowSchema,xf as shapeSchema,sf as sizeSchema,nf as spaceSchema,Hf as spacerNodeSchema,Z as stableKeySchema,Nf as stackInteractionSchema,Of as stackNodeSchema,Ga as stickyAssignmentDocumentSchema,pd as stripeAppendContextSchema,od as stripeCouponTermsSchema,qd as stripePurchaseExecutionSchema,Dd as stripeRefundExecutionSchema,Td as stripeSetupExecutionSchema,vd as stripeSubscriptionUpdateExecutionSchema,wd as stripeSubscriptionUpdatePreviewSchema,xd as stripeSubscriptionUpdateResultSchema,Od as stripeTrialExecutionSchema,Bf as styleSchema,md as subscriptionAttachCommandSchema,rd as subscriptionAttachQuoteSchema,Id as subscriptionBatchCommandSchema,Kd as subscriptionBatchGroupSchema,Jd as subscriptionBatchReadSchema,Ld as subscriptionBatchSchema,td as subscriptionCarryOptionsSchema,fe as subscriptionConflictPageSchema,ae as subscriptionConflictQuerySchema,ce as subscriptionConflictRetryResultSchema,be as subscriptionConflictRetrySchema,$d as subscriptionConflictSchema,Hb as subscriptionCouponExecutionSchema,Zd as subscriptionListItemSchema,de as subscriptionListPageSchema,nd as subscriptionOperationInputSchema,sd as subscriptionOperationSchema,Cd as subscriptionRefundCommandSchema,Ed as subscriptionRefundPreviewSchema,Fd as subscriptionRefundResultSchema,Md as subscriptionTrialCommandSchema,Qd as subscriptionTrialPolicySchema,Nd as subscriptionTrialReadSchema,Pd as subscriptionTrialResultSchema,ud as subscriptionUpdateCommandSchema,Ad as subscriptionUpdatePreviewSchema,Bd as subscriptionUpdateResultSchema,Vd as subscriptionVerificationInputSchema,Wd as subscriptionVerificationSchema,hf as substituteHtmlVariables,Ye as substituteSurfaceVariables,Ve as surfaceDataSchema,Sf as surfaceSchema,oi as surfaceTemplateSchema,Ue as surfaceValueSchema,We as surfaceVariableNames,Yk as templateScreen,Cf as textNodeSchema,Af as textStyleSchema,qf as themeSchema,la as toAttributeString,cj as transitionFunnelGraph,_f as translatableFields,P as trialPolicySchema,Q as trialRecordSchema,Xe as unknownSurfaceVariables,Lc as usageAlertNotificationDataSchema,Mc as usageAllowanceNotificationDataSchema,Mg as usageAnalyticsPageSchema,Lg as usageAnalyticsQuerySchema,Pg as usageBatchPageSchema,Og as usageBatchReadSchema,Ng as usageBatchSubmitSchema,zg as usageEntityCommandSchema,Ag as usageEntitySchema,Kc as usageLimitNotificationDataSchema,aj as validateFunnelGraph,Ii as validateFunnelTaskData,uj as validateScreenAnswers,ia as validitySchema,Fh as verifiedPrincipalSchema,Wf as walkDocument,Zf as walkScreen,ad as workspaceSettingsSchema};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkerlandai/indiana-sdk",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "Framework-independent Indiana SDK for customer identity, entitlements, credits, offers and growth surfaces.",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {