@stndrds/schema 1.0.0-alpha.298 → 1.0.0-alpha.300
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/{all-BekDmUP1.d.mts → all-CNJlNEG2.d.mts} +3 -3
- package/dist/{all-Bl3DlCEn.d.ts → all-CarWsKlE.d.ts} +3 -3
- package/dist/{attributes-SIbTof03.d.ts → attributes-DfhBu4HT.d.ts} +7 -1
- package/dist/{attributes-CtS5Gf_i.d.mts → attributes-Zw-DDGE7.d.mts} +7 -1
- package/dist/chunk-55SG6IBQ.mjs +12 -0
- package/dist/{chunk-JCPAOH76.mjs → chunk-64F3CCLD.mjs} +1 -1
- package/dist/{chunk-5QAE5NPN.js → chunk-C4LR6U4E.js} +4 -4
- package/dist/{chunk-RFKNNT2Q.mjs → chunk-GKMHYCAM.mjs} +1 -1
- package/dist/chunk-GZUTZAPU.js +12 -0
- package/dist/{chunk-47EGJRW7.js → chunk-PKJYAV5U.js} +2 -2
- package/dist/{chunk-V43RXKN2.mjs → chunk-TEHAV6HL.mjs} +1 -1
- package/dist/chunk-VY5UBDTO.js +2 -0
- package/dist/chunk-WBFUAEWU.mjs +2 -0
- package/dist/{chunk-LQYUPOWB.js → chunk-ZMDMQAV5.js} +2 -2
- package/dist/exceptions.d.mts +23 -3
- package/dist/exceptions.d.ts +23 -3
- package/dist/exceptions.js +1 -1
- package/dist/exceptions.mjs +1 -1
- package/dist/{helpers-DZFOorZt.d.ts → helpers-BQ524PQe.d.ts} +3 -3
- package/dist/{helpers-BUsoR80N.d.mts → helpers-MEZ69ERH.d.mts} +3 -3
- package/dist/{index-DaY37pqb.d.ts → index-DL0rfjzZ.d.ts} +4 -2
- package/dist/{index-EHhbbH-p.d.mts → index-Kd4QZ13G.d.mts} +4 -2
- package/dist/index.d.mts +62 -21
- package/dist/index.d.ts +62 -21
- package/dist/index.js +19 -19
- package/dist/index.mjs +19 -19
- package/dist/{migrations-DhQ05TqN.d.ts → migrations-B1Wl_3RY.d.ts} +1 -1
- package/dist/{migrations-DRBic-QO.d.mts → migrations-BG2mNaJn.d.mts} +1 -1
- package/dist/{objects-DMOfJNYg.d.ts → objects-D8tojUPV.d.ts} +6 -5
- package/dist/{objects-KU7alqZq.d.mts → objects-DvZ79fW2.d.mts} +6 -5
- package/dist/{types-ldo4nJxP.d.mts → types-M5L07ItN.d.mts} +1 -1
- package/dist/{types-BNaHEz_n.d.ts → types-R2f1GdCB.d.ts} +1 -1
- package/dist/utils.js +1 -1
- package/dist/utils.mjs +1 -1
- package/dist/validation/all.d.mts +7 -7
- package/dist/validation/all.d.ts +7 -7
- package/dist/validation/all.js +1 -1
- package/dist/validation/all.mjs +1 -1
- package/dist/validation/complex/currency.d.mts +2 -2
- package/dist/validation/complex/currency.d.ts +2 -2
- package/dist/validation/complex/location.d.mts +2 -2
- package/dist/validation/complex/location.d.ts +2 -2
- package/dist/validation/complex/phone.d.mts +2 -2
- package/dist/validation/complex/phone.d.ts +2 -2
- package/dist/validation/complex/relation.d.mts +2 -2
- package/dist/validation/complex/relation.d.ts +2 -2
- package/dist/validation/complex/richtext.d.mts +2 -2
- package/dist/validation/complex/richtext.d.ts +2 -2
- package/dist/validation/complex/select.d.mts +2 -2
- package/dist/validation/complex/select.d.ts +2 -2
- package/dist/validation/complex/user.d.mts +2 -2
- package/dist/validation/complex/user.d.ts +2 -2
- package/dist/validation/computed/formula.d.mts +2 -2
- package/dist/validation/computed/formula.d.ts +2 -2
- package/dist/validation/computed/rollup.d.mts +2 -2
- package/dist/validation/computed/rollup.d.ts +2 -2
- package/dist/validation/config/index.d.mts +4 -4
- package/dist/validation/config/index.d.ts +4 -4
- package/dist/validation/config/index.js +1 -1
- package/dist/validation/config/index.mjs +1 -1
- package/dist/validation/core/index.d.mts +3 -3
- package/dist/validation/core/index.d.ts +3 -3
- package/dist/validation/object/index.d.mts +5 -5
- package/dist/validation/object/index.d.ts +5 -5
- package/dist/validation/object/index.js +1 -1
- package/dist/validation/object/index.mjs +1 -1
- package/dist/validation/primitives/checkbox.d.mts +2 -2
- package/dist/validation/primitives/checkbox.d.ts +2 -2
- package/dist/validation/primitives/date.d.mts +2 -2
- package/dist/validation/primitives/date.d.ts +2 -2
- package/dist/validation/primitives/number.d.mts +2 -2
- package/dist/validation/primitives/number.d.ts +2 -2
- package/dist/validation/primitives/text.d.mts +2 -2
- package/dist/validation/primitives/text.d.ts +2 -2
- package/package.json +2 -2
- package/dist/chunk-72TQRSNX.js +0 -12
- package/dist/chunk-GWAHL4A2.mjs +0 -2
- package/dist/chunk-PT25FZ62.mjs +0 -12
- package/dist/chunk-SDOYGWU4.js +0 -2
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
'use strict';var
|
|
2
|
-
var ki=["fyi","task","question","handoff","system"],Oi=["low","normal","high","urgent"],_i=["public","internal","sensitive"],Pi=["unread","read","archived","snoozed"],Fi=["none","pending","processing","completed","dismissed","expired","failed"],hs="agent.session.waiting_human",As="agent.task.assigned",Ts="agent.question.requested",Hf=[hs,As,Ts];var Jf=["name","type"],Xf=["required","hidden","archived","deprecated","defaultValue","config","order","unique"],Zf=["label","description","placeholder","icon"];var Vi=["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"],$t="*";function ji(e){return e.targets.length===1&&e.targets[0].object===$t}chunkDPD6ZWL2_js.a(ji,"isUniversalRelation");function rb(e){return e.bilateral!==void 0}chunkDPD6ZWL2_js.a(rb,"isBilateralRelation");function nb(e){return "many"}chunkDPD6ZWL2_js.a(nb,"inferInverseCardinality");function ib(e){return chunkSDOYGWU4_js.n(e)}chunkDPD6ZWL2_js.a(ib,"isAttributeSortable");var sb=["record","object","attribute","view","user","role","settings","file","agent","schema_source"],ub=["record.created","record.updated","record.deleted","record.restored","record.purged","object.created","object.updated","object.deleted","attribute.created","attribute.updated","attribute.deleted","view.created","view.updated","view.deleted","schema_source.applied","schema_source.removed","user.created","user.invited","user.updated","user.deleted","user.login","user.logout","role.created","role.updated","role.deleted","role.assigned","role.revoked","settings.updated","file.uploaded","file.updated","file.deleted"];function cb(e){return e.phase==="terminal"}chunkDPD6ZWL2_js.a(cb,"isTerminalState");function pb(e){switch(e.phase){case "running":return "active";case "queued":return "idle";case "parked":if(e.parkedOn===void 0)throw new chunk72TQRSNX_js.b("parked state without parkedOn",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.parkedOn==="agents"?"waiting_agents":"waiting_human";case "terminal":if(e.outcome===void 0)throw new chunk72TQRSNX_js.b("terminal state without outcome",chunk72TQRSNX_js.a.INVARIANT_VIOLATION);return e.outcome}}chunkDPD6ZWL2_js.a(pb,"sessionStateToLegacyStatus");function mb(e){switch(e){case "active":return {phase:"running"};case "idle":return {phase:"queued"};case "waiting_human":return {phase:"parked",parkedOn:"human",humanRequestIds:[]};case "waiting_agents":return {phase:"parked",parkedOn:"agents"};default:return {phase:"terminal",outcome:e}}}chunkDPD6ZWL2_js.a(mb,"legacyStatusToSessionState");var ws=["completed","failed","cancelled","timeout","expired"];function fb(e){return ws.includes(e)}chunkDPD6ZWL2_js.a(fb,"isTerminalSessionStatus");var xs=["idle","completed","waiting_human","waiting_agents","cancelled","failed","timeout"];function bb(e){return xs.includes(e)}chunkDPD6ZWL2_js.a(bb,"isClaimableSessionStatus");var Mi=Object.freeze({mutation:"ask",destructive:"ask",outward:"ask"}),gb=["active","completed","abandoned"],Li=["openai","anthropic","google","spacexai","deepseek","moonshotai","alibaba","mistral","minimax","meta","zai"],Bi=["standard","fast"],Ui=["none","minimal","low","medium","high","xhigh"];function yb(e){return e.label?.trim()||e.name}chunkDPD6ZWL2_js.a(yb,"agentDisplayName");var $i=["approval-requested","approval-responded","approval-dispatched"],Is=["streaming","running",...$i];function hb(e){return Is.includes(e)}chunkDPD6ZWL2_js.a(hb,"isOpenToolPartState");function Ab(e){return $i.includes(e)}chunkDPD6ZWL2_js.a(Ab,"isToolApprovalState");var qt=["CREDITS_EXHAUSTED"];function Tb(e){return typeof e=="string"&&qt.includes(e)}chunkDPD6ZWL2_js.a(Tb,"isSystemPartCode");function Ss(e,t){let r=e.createdAt.getTime()-t.createdAt.getTime();return r===0?e.id.localeCompare(t.id):r}chunkDPD6ZWL2_js.a(Ss,"compareAgentSessionMessages");function wb(e){return [...e].sort(Ss)}chunkDPD6ZWL2_js.a(wb,"orderAgentSessionMessages");var xb=["pending","in_progress","completed","blocked"],Ib=50,Sb=80,vb=500,Rb=2e3;var Nb="session-state",vs="__stndrdsNativeUiPartIds",Rs=1,Es="Native agent UI part IDs metadata is invalid";function se(){throw new chunk72TQRSNX_js.h(Es,[])}chunkDPD6ZWL2_js.a(se,"invalidNativePartIds");function qi(e){if(e===null||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}chunkDPD6ZWL2_js.a(qi,"isPlainRecord");function Ds(e,t){if(e.type==="text"||e.type==="reasoning")return `${e.type}:${t}`;if(e.type==="tool")return `tool:${e.toolCallId}`}chunkDPD6ZWL2_js.a(Ds,"nativeAgentUIPartIdMetadataKey");function kb(e){let t=e.metadata?.[vs];qi(t)||se(),(Object.keys(t).length!==2||t.schemaVersion!==Rs||!qi(t.partIds))&&se();let r=new Map;for(let[s,l]of e.parts.entries()){let p=Ds(l,s);if(!p||r.has(p)){p&&se();continue}r.set(p,l);}let n=Object.entries(t.partIds);n.length!==r.size&&se();let o=new Map,a={};for(let[s,l]of n){let p=r.get(s);p&&typeof l=="string"&&l.length>0||se();let I=o.get(l);I&&(p.type==="tool"||I!==p.type)&&se(),p.type==="tool"&&l!==p.toolCallId&&se(),o.set(l,p.type),a[s]=l;}return a}chunkDPD6ZWL2_js.a(kb,"parseNativeAgentUIPartIdsMetadata");var Pb=16e3,Fb=3200,Vb=6400,jb=16e3,Mb=65536,Lb=15e3,Bb=1e4,Ub=5e3,$b="google/gemini-3.5-transcribe-live",qb={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2};var Gb=["web","presentation","document","spreadsheet","image","code","other"],Wb=["ephemeral","conversation","persistent"],Kb=["source","preview","entrypoint","asset"];var zi=5;function Qb(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"?"message"in e&&typeof e.message=="string"?e.message:JSON.stringify(e):String(e)}chunkDPD6ZWL2_js.a(Qb,"getErrorMessage");function eg(e){return typeof e=="object"&&e!==null&&"slots"in e&&"steps"in e&&"name"in e&&typeof e.name=="string"&&Array.isArray(e.slots)&&Array.isArray(e.steps)}chunkDPD6ZWL2_js.a(eg,"isFormDefinition");var zt=["relation","multiRelation","formula","rollup","document","richtext","user"];function Gi(e){return e.type==="slot"}chunkDPD6ZWL2_js.a(Gi,"isFormSlotFieldRef");function Gt(e){return e.type==="free"}chunkDPD6ZWL2_js.a(Gt,"isFormFreeFieldRef");function ng(e){return e.fieldRequired!==void 0?e.fieldRequired:e.slotMode==="create"&&e.attributeRequired===true}chunkDPD6ZWL2_js.a(ng,"resolveFieldRequired");function Wi(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}chunkDPD6ZWL2_js.a(Wi,"getSlotFieldTargets");function Cs(e){return Gi(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}chunkDPD6ZWL2_js.a(Cs,"formFieldKey");function Ns(e){return Gi(e)?e.attribute:e.attribute.name}chunkDPD6ZWL2_js.a(Ns,"formFieldFlatKey");function ig(e,t){return e[Cs(t)]??e[Ns(t)]}chunkDPD6ZWL2_js.a(ig,"readFormFieldValue");function We(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(We,"isFormFieldsRow");function sg(e){return e.type==="heading"}chunkDPD6ZWL2_js.a(sg,"isFormHeadingRow");function ug(e){return e.type==="separator"}chunkDPD6ZWL2_js.a(ug,"isFormSeparatorRow");function lg(e){return e.type==="text"}chunkDPD6ZWL2_js.a(lg,"isFormTextRow");var Wt=class Wt{async autocomplete(){return await Promise.resolve([])}async reverse(){return await Promise.resolve(null)}async geocode(){return await Promise.resolve(null)}};chunkDPD6ZWL2_js.a(Wt,"NoopGeocodingAdapter");var Ki=Wt;var Kt=["read","create","update","delete","manage"];function gg(e){return e.length===0?"none":e.length===1&&e[0]==="read"?"read-only":e.length===Kt.length&&Kt.every(t=>e.includes(t))?"full":"custom"}chunkDPD6ZWL2_js.a(gg,"actionsToAccessLevel");function yg(e){switch(e){case "full":return [...Kt];case "read-only":return ["read"];case "none":return []}}chunkDPD6ZWL2_js.a(yg,"accessLevelToActions");function Yi(e){let t=e.properties;if(!t)return [];if(Array.isArray(t))return t;let r=t;return Array.isArray(r.definitions)?r.definitions:[]}chunkDPD6ZWL2_js.a(Yi,"resolvePropertyDefinitions");function Tg(e){return e.type==="select"||e.type==="status"||e.type==="multiselect"}chunkDPD6ZWL2_js.a(Tg,"hasOptions");var ks="Notetaker",Ig={systemPrompt:null,meetingRecordingPolicy:"none",meetingBotDisplayName:ks};var vg=["active","suspended"],Rg=["plan","manual","auto"];function Dg(e){return `${e.object}:${e.name}:${e.type}`}chunkDPD6ZWL2_js.a(Dg,"viewStateKey");function Ke(e){return e.type==="detail"}chunkDPD6ZWL2_js.a(Ke,"isDetailView");function Hi(e){return e.type==="list"}chunkDPD6ZWL2_js.a(Hi,"isListView");function Os(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(Os,"isFieldGroup");var _g=["square","landscape","portrait"];var Qi=["none","estimated","exact"];function _s(e){if(typeof e=="string"&&Qi.includes(e))return e;throw new chunk72TQRSNX_js.h(`countMode must be one of: ${Qi.join(", ")} (received: ${String(e)})`,[])}chunkDPD6ZWL2_js.a(_s,"parseCountMode");function Vg(e){return e===void 0?void 0:_s(e)}chunkDPD6ZWL2_js.a(Vg,"parseOptionalCountMode");var jg=1e4;var Bg=["storage.bytes","members.seats"];function Ps(e){return e==null?true:typeof e!="object"?false:Object.keys(e).length===0}chunkDPD6ZWL2_js.a(Ps,"isEmptyObject");function Ji(e){return e!=null&&typeof e=="object"&&Object.keys(e).length>0}chunkDPD6ZWL2_js.a(Ji,"isNotEmpty");function Fs(e){return Ji(e)?e:void 0}chunkDPD6ZWL2_js.a(Fs,"toUndefinedIfEmpty");function Vs(e){if(e<=0)return {value:0,unitIndex:0};let t=1e3,r=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return {value:Number.parseFloat((e/t**r).toFixed(1)),unitIndex:r}}chunkDPD6ZWL2_js.a(Vs,"computeByteMagnitude");var js=["B","KB","MB","GB","TB"];function _y(e){let{value:t,unitIndex:r}=Vs(e);return `${t} ${js[r]}`}chunkDPD6ZWL2_js.a(_y,"formatByteSize");function Ms(e){return e.displayAttributes!==void 0?[...e.displayAttributes]:[...new Set([e.cardUserAttribute,e.cardDateAttribute].filter(t=>t!==void 0))]}chunkDPD6ZWL2_js.a(Ms,"getListViewDisplayAttributeNames");var My={ATTACHMENTS:"attachments"};function Ly(e){return e.type==="document"}chunkDPD6ZWL2_js.a(Ly,"isDocumentAttribute");function By(e,t){if(!t||t.length===0)return true;let r=e.name.toLowerCase();return t.some(n=>n.endsWith("/*")?e.mimeType.startsWith(n.slice(0,-1)):n.startsWith(".")?r.endsWith(n.toLowerCase()):e.mimeType===n)}chunkDPD6ZWL2_js.a(By,"matchesAccepts");var Xi=Object.freeze(["text","number","checkbox","date","phone","currency","status","select","multiselect","location"]);function Ye(e){let t=[];for(let r of e){let n=r.build();if(!Xi.includes(n.type))throw new Error(`Property type "${n.type}" is not supported in .qualifyWith()`);t.push(n);}return {definitions:t}}chunkDPD6ZWL2_js.a(Ye,"buildPropertySchema");var Gy="__";function Wy(e){let t=e.indexOf("__");return t<=0||t+2>=e.length?{kind:"scalar",attribute:e}:{kind:"qualified",root:e.slice(0,t),property:e.slice(t+2)}}chunkDPD6ZWL2_js.a(Wy,"parseQualifiedAttribute");function Ky(e,t){return `${e}__${t}`}chunkDPD6ZWL2_js.a(Ky,"buildQualifiedAttribute");function Z(e){return typeof e=="object"&&e!==null&&typeof e.start=="string"}chunkDPD6ZWL2_js.a(Z,"isDateRangeValue");function Ls(e,t){return chunk5QAE5NPN_js.a(e)?null:Z(e)?t.endDate?{start:e.start,end:e.end??null}:e.start:typeof e=="string"?t.endDate?{start:e,end:null}:e:null}chunkDPD6ZWL2_js.a(Ls,"normalizeDateValue");function fe(e){return typeof e=="string"&&e!==""?e:Z(e)&&e.start!==""?e.start:null}chunkDPD6ZWL2_js.a(fe,"dateValueStart");var He="\u2014";function Bs(e){return String(e)}chunkDPD6ZWL2_js.a(Bs,"formatText");function Us(e){return e?"Yes":"No"}chunkDPD6ZWL2_js.a(Us,"formatCheckbox");function $s(e,t){if(typeof e!="number")return String(e);if(t.renderAs==="rating")return `${e}/${t.max??5}`;let r=t.decimals;return t.unit==="integer"?e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}):t.unit==="percentage"?(e/100).toLocaleString(void 0,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}):e.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}chunkDPD6ZWL2_js.a($s,"formatNumber");function qs(e,t){if(typeof e!="object"||e===null)return String(e);let r=e;return "value"in r&&"code"in r?`${r.value.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} ${r.code}`:String(e)}chunkDPD6ZWL2_js.a(qs,"formatCurrency");function Yt(e){if(Z(e)){let t=Yt(e.start);return e.end?`${t} \u2192 ${Yt(e.end)}`:t}if(e instanceof Date)return e.toISOString().split("T")[0];if(typeof e=="string"){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toISOString().split("T")[0]}return String(e)}chunkDPD6ZWL2_js.a(Yt,"formatDate");function zs(e){if(typeof e!="object"||e===null)return String(e);let t=e;return "phoneNumber"in t?t.phoneNumber?t.countryCode?chunkGXSNLYRR_js.c(t):t.phoneNumber:"":String(e)}chunkDPD6ZWL2_js.a(zs,"formatPhone");function Gs(e,t="full"){if(typeof e!="object"||e===null)return "";let r=e,n=[];switch(t){case "country":r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "state":r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "city":r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "coordinates":r.latitude!==void 0&&r.longitude!==void 0&&n.push(`${r.latitude}, ${r.longitude}`);break;case "address":r.address&&n.push(r.address),r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;default:r.address&&n.push(r.address),r.address2&&n.push(r.address2),r.city&&n.push(r.city),r.state&&n.push(r.state),r.postalCode&&n.push(r.postalCode),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break}return n.join(", ")}chunkDPD6ZWL2_js.a(Gs,"formatLocationValue");function Ws(e,t){return typeof e!="object"||e===null?String(e):Gs(e,t.granularity??"full")||He}chunkDPD6ZWL2_js.a(Ws,"formatLocation");function Ks(e,t){return typeof e!="string"?String(e):t.options?.find(n=>n.value===e)?.label??String(e)}chunkDPD6ZWL2_js.a(Ks,"formatSelect");function Ys(e,t){return Array.isArray(e)?t.options?e.map(n=>t.options.find(o=>o.value===n)?.label).filter(Boolean).join(", "):e.join(", "):String(e)}chunkDPD6ZWL2_js.a(Ys,"formatMultiselect");function Zi(e,t){if(chunk5QAE5NPN_js.a(e))return He;switch(t.type){case "text":return Bs(e);case "checkbox":return Us(e);case "number":return $s(e,t);case "currency":return qs(e);case "date":return Yt(e);case "phone":return zs(e);case "location":return Ws(e,t);case "select":case "status":return Ks(e,t);case "multiselect":return Ys(e,t);case "user":case "relation":return Array.isArray(e)?e.join(", "):String(e);default:return Array.isArray(e)?e.join(", "):String(e)}}chunkDPD6ZWL2_js.a(Zi,"formatAttributeValue");var Qs=["UPPER","LOWER","capitalize","trim"],Js=["prefix","suffix","wrap","default"],Qe=[...Qs,...Js],be=Jt.z.string().min(1,"labelExpression cannot be empty").refine(e=>Je(e),{message:"labelExpression must contain at least one {{ attribute }} interpolation"}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:"labelExpression contains empty {{ }} interpolation"}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,r;for(;(r=t.exec(e))!==null;){let n=r[1];if(!Qe.includes(n))return false}return true},{message:`Invalid pipe name. Valid pipes: ${Qe.join(", ")}`});function Xs(e){let t=be.safeParse(e);return t.success?{success:true,attributes:oo(e)}:{success:false,error:t.error.issues[0]?.message??"Invalid labelExpression"}}chunkDPD6ZWL2_js.a(Xs,"validateLabelExpression");var eo={UPPER:chunkDPD6ZWL2_js.a(e=>String(e).toUpperCase(),"UPPER"),LOWER:chunkDPD6ZWL2_js.a(e=>String(e).toLowerCase(),"LOWER"),capitalize:chunkDPD6ZWL2_js.a(e=>String(e).replace(/(^|\s)\S/g,t=>t.toUpperCase()),"capitalize"),trim:chunkDPD6ZWL2_js.a(e=>String(e).trim(),"trim")},to={prefix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${t}${e}`:"","prefix"),suffix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${e}${t}`:"","suffix"),wrap:chunkDPD6ZWL2_js.a((e,t="",r="")=>e?`${t}${e}${r}`:"","wrap"),default:chunkDPD6ZWL2_js.a((e,t="")=>e||t,"default")};function Zs(e,t){let r=e;for(let n of t){let{name:o,args:a}=no(n),s=eo[o];if(s)r!==""&&(r=s(r));else {let l=to[o];l&&(r=l(r,...a));}}return r}chunkDPD6ZWL2_js.a(Zs,"applyPipes");function eu(e,t){return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}chunkDPD6ZWL2_js.a(eu,"getValue");var ro="(Untitled)";function no(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return {name:e,args:[]};let r=t[1],n=t[2];if(!n)return {name:r,args:[]};let o=[],a=/["']([^"']*?)["']/g,s;for(;(s=a.exec(n))!==null;)o.push(s[1]);return {name:r,args:o}}chunkDPD6ZWL2_js.a(no,"parsePipeExpression");function Ht(e,t,r=ro){return e.replace(/\{\{\s*([^}]+)\s*\}\}/g,(o,a)=>{let s=a.split("||").map(j=>j.trim()),p=s[s.length-1].split("|").map(j=>j.trim());s[s.length-1]=p[0];let I=p.slice(1).filter(Boolean),X=s.filter(Boolean),B="";for(let j of X){let Y=io(eu(t,j));if(Y!==""){B=Y;break}}if(chunk5QAE5NPN_js.a(B)&&I.length===0)return "";for(let j of I){let{name:Y,args:es}=no(j),si=eo[Y];if(si)B!==""&&(B=si(B));else {let ui=to[Y];ui&&(B=ui(B,...es));}}return B}).trim()||r}chunkDPD6ZWL2_js.a(Ht,"renderLabelExpression");function io(e){if(e==null||typeof e=="function")return "";if(typeof e!="object")return String(e);if(Array.isArray(e))return e.map(io).filter(Boolean).join(",");let t=e.toString;return typeof t=="function"&&t!==Object.prototype.toString?String(e):""}chunkDPD6ZWL2_js.a(io,"toText");function Je(e){return /\{\{\s*\S+.*\}\}/.test(e)}chunkDPD6ZWL2_js.a(Je,"isLabelExpression");function oo(e){let t=[],r=/\{\{\s*([^}]+)\s*\}\}/g,n;for(;(n=r.exec(e))!==null;){let a=n[1].trim().split("||").map(l=>l.trim()),s=a[a.length-1];a[a.length-1]=s.split("|")[0].trim();for(let l of a){if(!l)continue;let p=l.split(".")[0];p&&!t.includes(p)&&t.push(p);}}return t}chunkDPD6ZWL2_js.a(oo,"extractAttributeNames");var tu=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function ao(e){let t=e.trim().match(tu);return t?t[1]:null}chunkDPD6ZWL2_js.a(ao,"getSingleAttributeFromExpression");function ru(e,t){let r=ao(e);if(r===null)return null;let n=t.find(o=>o.name===r);return !n||n.type!=="text"||chunkSDOYGWU4_js.j(n).authoring.readOnly?null:n}chunkDPD6ZWL2_js.a(ru,"getEditableLabelAttribute");var nu=/\{\{\s*props\./;function iu(e,t,r){if(!nu.test(e))return e;let n={},o=new Map(r?.map(s=>[s.name,s]));if(t)for(let[s,l]of Object.entries(t)){if(l==null)continue;let p=o.get(s);if(p){let I=Zi(l,p);n[s]=I===He?"":I;}else n[s]=l;}return Ht(e,{props:n},"").replace(/\(\s*\)/g,"").replace(/\[\s*\]/g,"").replace(/\s*[-—|:]\s*$/g,"").replace(/\s{2,}/g," ").trim()}chunkDPD6ZWL2_js.a(iu,"applyRelationProps");function ou(e){if(e?.type==="relation")return e.properties?.definitions}chunkDPD6ZWL2_js.a(ou,"relationPropertyDefs");function au(e){if(e?.type==="relation"||e?.type==="document")return e.properties?.definitions}chunkDPD6ZWL2_js.a(au,"qualifiedPropertyDefs");function so(e){if(chunk5QAE5NPN_js.a(e))return [];if(typeof e=="string")return [{id:e}];if(Array.isArray(e))return e.flatMap(t=>so(t));if(typeof e=="object"&&"id"in e){let t=e;if(typeof t.id=="string")return [{id:t.id,props:t.props}]}return []}chunkDPD6ZWL2_js.a(so,"extractValueRefs");function su(e){let t=[e.firstName,e.lastName].map(r=>r?.trim()).filter(Boolean).join(" ");return t!==""?t:e.email?.split("@")[0]??""}chunkDPD6ZWL2_js.a(su,"getUserDisplayName");var uu=/\p{L}|\p{N}/u;function lu(e,t){let r=e?.trim()??"";if(r==="")return t;let n=r.split(/\s+/),a=(n.length===1?r.split("@")[0].split(/[._-]/):n).map(s=>{let l=s.match(uu)?.[0];return l===void 0?"":[...l.toUpperCase()][0]??""}).filter(Boolean).slice(0,2).join("");return a===""?t:a}chunkDPD6ZWL2_js.a(lu,"deriveInitials");var uo="__creatorRootActorId";function du(e){let t=e.metadata?.[uo];return typeof t=="string"&&t.length>0?t:e.createdBy}chunkDPD6ZWL2_js.a(du,"getRecordCreatorPrincipalId");function ge(e,t){return e?.includes("*")===true||e?.includes(t)===true}chunkDPD6ZWL2_js.a(ge,"includesAction");function cu(e){return {canRead:ge(e,"read"),canCreate:ge(e,"create"),canUpdate:ge(e,"update"),canDelete:ge(e,"delete"),canManage:ge(e,"manage")}}chunkDPD6ZWL2_js.a(cu,"buildPermissionFlags");var wh=new Set(["id","name","label","type","required","system","unique","order"]);var M={PEOPLE:"people",WORKSPACE:"workspace",ARCHITECT:"architect",FEATURE_FLAGS:"feature-flags",FILES:"files",VIEWS:"views",FORMS:"forms",DOCUMENTS:"documents",AUDIT:"audit",API_KEYS:"api-keys",CONNECTORS:"connectors",ENV_VARS:"env-vars",SESSION:"session"},Ih=[M.PEOPLE,M.WORKSPACE,M.ARCHITECT,M.FEATURE_FLAGS,M.FILES,M.VIEWS,M.FORMS,M.DOCUMENTS,M.AUDIT,M.API_KEYS,M.CONNECTORS,M.ENV_VARS,M.SESSION],Sh={people:"People",workspace:"Workspace",architect:"Architect","feature-flags":"Feature flags",files:"Files",views:"Views",forms:"Forms",documents:"Documents",audit:"Audit","api-keys":"API keys",connectors:"Connected accounts","env-vars":"Environment variables",session:"Agent sessions"},pu={OWNER:"owner",MEMBER:"member",AGENT_DEFAULT:"agent_default",REFLEX_DEFAULT:"reflex_default"},vh={owner:"Owner",member:"Member",agent_default:"Agent Default",reflex_default:"Reflex Default"},Rh={owner:"Full access to all platform features and data",member:"Can view, create, edit and delete business data",agent_default:"Default role for AI agents \u2014 CRUD on records plus documents and files",reflex_default:"Default role for reflexes \u2014 no data access; each reflex is granted exactly what its rehearsal showed it uses"},Qt=["read","create","update","delete","manage"],mu=["read","create","delete"],Eh={owner:{system:[{target:"*",actions:Qt}],object:[{target:"*",actions:Qt}]},member:{system:[{target:"people",actions:["read"]},{target:"workspace",actions:["read"]},{target:"connectors",actions:mu},{target:"files",actions:["read","create","update"]}],object:[{target:"*",actions:Qt}]},agent_default:{system:[{target:"documents",actions:["read","create","update"]},{target:"files",actions:["read","create","update"]},{target:"env-vars",actions:["read"]},{target:"session",actions:["observe"]}],object:[{target:"*",actions:["read","create","update","delete"]}]},reflex_default:{system:[],object:[]}};function Dh(e){return Object.values(pu).includes(e)}chunkDPD6ZWL2_js.a(Dh,"isDefaultRole");var bu=new Set(constants.ICONS),co=/^[a-zA-Z_][a-zA-Z0-9_]*$/,gu=/^[a-z][a-z0-9-]*$/,ye=63,lo=128,Xe=Jt__default.default.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
|
|
1
|
+
'use strict';var chunkZMDMQAV5_js=require('./chunk-ZMDMQAV5.js'),chunkVY5UBDTO_js=require('./chunk-VY5UBDTO.js'),chunkPKJYAV5U_js=require('./chunk-PKJYAV5U.js'),chunkC4LR6U4E_js=require('./chunk-C4LR6U4E.js');require('./chunk-LWSOKXPF.js'),require('./chunk-XXTKNIBK.js'),require('./chunk-JOS2XMXY.js');var chunk47KVYDKG_js=require('./chunk-47KVYDKG.js'),chunkKLR22JMC_js=require('./chunk-KLR22JMC.js'),chunkGXSNLYRR_js=require('./chunk-GXSNLYRR.js');require('./chunk-UXISKZ5Y.js'),require('./chunk-XUAP7KWK.js'),require('./chunk-JVLH3DVZ.js'),require('./chunk-LSCBR4VS.js'),require('./chunk-23KPS33D.js');var chunkGZUTZAPU_js=require('./chunk-GZUTZAPU.js'),chunkXHEBV2HE_js=require('./chunk-XHEBV2HE.js'),chunkSLYRQ72J_js=require('./chunk-SLYRQ72J.js'),chunkJFSQ24XR_js=require('./chunk-JFSQ24XR.js'),chunkDPD6ZWL2_js=require('./chunk-DPD6ZWL2.js'),constants=require('@stndrds/constants'),er=require('zod');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var er__default=/*#__PURE__*/_interopDefault(er);/*! © 2025-2026 AND YOU CREATE SAS (RCS Paris 940 190 614). Proprietary — see LICENSE (Standards SDK License 1.0). */
|
|
2
|
+
var ji=["fyi","task","question","handoff","system"],Mi=["low","normal","high","urgent"],Li=["public","internal","sensitive"],Bi=["unread","read","archived","snoozed"],Ui=["none","pending","processing","completed","dismissed","expired","failed"],vs="agent.session.waiting_human",Rs="agent.task.assigned",Es="agent.question.requested",ob=[vs,Rs,Es];var sb=["name","type"],ub=["required","hidden","archived","deprecated","defaultValue","config","order","unique"],lb=["label","description","placeholder","icon"];var $i=["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"],He="*";function pb(e){return e.type!=="relation"||!Array.isArray(e.targets)?[]:e.targets.map(t=>t.object).filter(t=>t!==He)}chunkDPD6ZWL2_js.a(pb,"relationTargetsOf");function qi(e){return e.targets.length===1&&e.targets[0].object===He}chunkDPD6ZWL2_js.a(qi,"isUniversalRelation");function mb(e){return e.bilateral!==void 0}chunkDPD6ZWL2_js.a(mb,"isBilateralRelation");function fb(e){return "many"}chunkDPD6ZWL2_js.a(fb,"inferInverseCardinality");function bb(e){return chunkVY5UBDTO_js.n(e)}chunkDPD6ZWL2_js.a(bb,"isAttributeSortable");var hb=["record","object","attribute","view","user","role","settings","file","agent","schema_source"],Ab=["record.created","record.updated","record.deleted","record.restored","record.purged","object.created","object.updated","object.deleted","attribute.created","attribute.updated","attribute.deleted","view.created","view.updated","view.deleted","schema_source.applied","schema_source.removed","user.created","user.invited","user.updated","user.deleted","user.login","user.logout","role.created","role.updated","role.deleted","role.assigned","role.revoked","settings.updated","file.uploaded","file.updated","file.deleted"];function xb(e){return e.phase==="terminal"}chunkDPD6ZWL2_js.a(xb,"isTerminalState");function Ib(e){switch(e.phase){case "running":return "active";case "queued":return "idle";case "parked":if(e.parkedOn===void 0)throw new chunkGZUTZAPU_js.b("parked state without parkedOn",chunkGZUTZAPU_js.a.INVARIANT_VIOLATION);return e.parkedOn==="agents"?"waiting_agents":"waiting_human";case "terminal":if(e.outcome===void 0)throw new chunkGZUTZAPU_js.b("terminal state without outcome",chunkGZUTZAPU_js.a.INVARIANT_VIOLATION);return e.outcome}}chunkDPD6ZWL2_js.a(Ib,"sessionStateToLegacyStatus");function Sb(e){switch(e){case "active":return {phase:"running"};case "idle":return {phase:"queued"};case "waiting_human":return {phase:"parked",parkedOn:"human",humanRequestIds:[]};case "waiting_agents":return {phase:"parked",parkedOn:"agents"};default:return {phase:"terminal",outcome:e}}}chunkDPD6ZWL2_js.a(Sb,"legacyStatusToSessionState");var Ds=["completed","failed","cancelled","timeout","expired"];function vb(e){return Ds.includes(e)}chunkDPD6ZWL2_js.a(vb,"isTerminalSessionStatus");var Cs=["idle","completed","waiting_human","waiting_agents","cancelled","failed","timeout"];function Rb(e){return Cs.includes(e)}chunkDPD6ZWL2_js.a(Rb,"isClaimableSessionStatus");var zi=Object.freeze({mutation:"ask",destructive:"ask",outward:"ask"}),Eb=["active","completed","abandoned"],Gi=["openai","anthropic","google","spacexai","deepseek","moonshotai","alibaba","mistral","minimax","meta","zai"],Wi=["standard","fast"],Ki=["none","minimal","low","medium","high","xhigh"];function Db(e){return e.label?.trim()||e.name}chunkDPD6ZWL2_js.a(Db,"agentDisplayName");var Yi=["approval-requested","approval-responded","approval-dispatched"],Ns=["streaming","running",...Yi];function Cb(e){return Ns.includes(e)}chunkDPD6ZWL2_js.a(Cb,"isOpenToolPartState");function Nb(e){return Yi.includes(e)}chunkDPD6ZWL2_js.a(Nb,"isToolApprovalState");var Wt=["CREDITS_EXHAUSTED"];function Ob(e){return typeof e=="string"&&Wt.includes(e)}chunkDPD6ZWL2_js.a(Ob,"isSystemPartCode");function Os(e,t){let r=e.createdAt.getTime()-t.createdAt.getTime();return r===0?e.id.localeCompare(t.id):r}chunkDPD6ZWL2_js.a(Os,"compareAgentSessionMessages");function kb(e){return [...e].sort(Os)}chunkDPD6ZWL2_js.a(kb,"orderAgentSessionMessages");var _b=["pending","in_progress","completed","blocked"],Pb=50,Fb=80,Vb=500,jb=2e3;var Ub="session-state",ks="__stndrdsNativeUiPartIds",_s=1,Ps="Native agent UI part IDs metadata is invalid";function se(){throw new chunkGZUTZAPU_js.h(Ps,[])}chunkDPD6ZWL2_js.a(se,"invalidNativePartIds");function Hi(e){if(e===null||typeof e!="object"||Array.isArray(e))return false;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}chunkDPD6ZWL2_js.a(Hi,"isPlainRecord");function Fs(e,t){if(e.type==="text"||e.type==="reasoning")return `${e.type}:${t}`;if(e.type==="tool")return `tool:${e.toolCallId}`}chunkDPD6ZWL2_js.a(Fs,"nativeAgentUIPartIdMetadataKey");function $b(e){let t=e.metadata?.[ks];Hi(t)||se(),(Object.keys(t).length!==2||t.schemaVersion!==_s||!Hi(t.partIds))&&se();let r=new Map;for(let[s,l]of e.parts.entries()){let p=Fs(l,s);if(!p||r.has(p)){p&&se();continue}r.set(p,l);}let n=Object.entries(t.partIds);n.length!==r.size&&se();let o=new Map,a={};for(let[s,l]of n){let p=r.get(s);p&&typeof l=="string"&&l.length>0||se();let I=o.get(l);I&&(p.type==="tool"||I!==p.type)&&se(),p.type==="tool"&&l!==p.toolCallId&&se(),o.set(l,p.type),a[s]=l;}return a}chunkDPD6ZWL2_js.a($b,"parseNativeAgentUIPartIdsMetadata");var Gb=16e3,Wb=3200,Kb=6400,Yb=16e3,Hb=65536,Qb=15e3,Jb=1e4,Xb=5e3,Zb="google/gemini-3.5-transcribe-live",eg={maxDurationMs:3e5,dailyDurationMs:36e5,monthlyDurationMs:72e6,tenantMonthlyBudgetMicrousd:5e7,globalMonthlyBudgetMicrousd:5e7,estimatedMicrousdPerSecond:150,reservationMultiplier:2};var rg=["web","presentation","document","spreadsheet","image","code","other"],ng=["ephemeral","conversation","persistent"],ig=["source","preview","entrypoint","asset"];var Qi=5;function sg(e){return e instanceof Error?e.message:typeof e=="string"?e:e&&typeof e=="object"?"message"in e&&typeof e.message=="string"?e.message:JSON.stringify(e):String(e)}chunkDPD6ZWL2_js.a(sg,"getErrorMessage");function cg(e){return typeof e=="object"&&e!==null&&"slots"in e&&"steps"in e&&"name"in e&&typeof e.name=="string"&&Array.isArray(e.slots)&&Array.isArray(e.steps)}chunkDPD6ZWL2_js.a(cg,"isFormDefinition");var Kt=["relation","multiRelation","formula","rollup","document","richtext","user"];function Ji(e){return e.type==="slot"}chunkDPD6ZWL2_js.a(Ji,"isFormSlotFieldRef");function Yt(e){return e.type==="free"}chunkDPD6ZWL2_js.a(Yt,"isFormFreeFieldRef");function fg(e){return e.fieldRequired!==void 0?e.fieldRequired:e.slotMode==="create"&&e.attributeRequired===true}chunkDPD6ZWL2_js.a(fg,"resolveFieldRequired");function Xi(e){return e.additionalSlotIds?.length?[e.slotId,...e.additionalSlotIds]:[e.slotId]}chunkDPD6ZWL2_js.a(Xi,"getSlotFieldTargets");function Vs(e){return Ji(e)?`${e.slotId}.${e.attribute}`:`free.${e.attribute.name}`}chunkDPD6ZWL2_js.a(Vs,"formFieldKey");function js(e){return Ji(e)?e.attribute:e.attribute.name}chunkDPD6ZWL2_js.a(js,"formFieldFlatKey");function bg(e,t){return e[Vs(t)]??e[js(t)]}chunkDPD6ZWL2_js.a(bg,"readFormFieldValue");function Qe(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(Qe,"isFormFieldsRow");function hg(e){return e.type==="heading"}chunkDPD6ZWL2_js.a(hg,"isFormHeadingRow");function Ag(e){return e.type==="separator"}chunkDPD6ZWL2_js.a(Ag,"isFormSeparatorRow");function Tg(e){return e.type==="text"}chunkDPD6ZWL2_js.a(Tg,"isFormTextRow");var Ht=class Ht{async autocomplete(){return await Promise.resolve([])}async reverse(){return await Promise.resolve(null)}async geocode(){return await Promise.resolve(null)}};chunkDPD6ZWL2_js.a(Ht,"NoopGeocodingAdapter");var Zi=Ht;var Qt=["read","create","update","delete","manage"];function Eg(e){return e.length===0?"none":e.length===1&&e[0]==="read"?"read-only":e.length===Qt.length&&Qt.every(t=>e.includes(t))?"full":"custom"}chunkDPD6ZWL2_js.a(Eg,"actionsToAccessLevel");function Dg(e){switch(e){case "full":return [...Qt];case "read-only":return ["read"];case "none":return []}}chunkDPD6ZWL2_js.a(Dg,"accessLevelToActions");function eo(e){let t=e.properties;if(!t)return [];if(Array.isArray(t))return t;let r=t;return Array.isArray(r.definitions)?r.definitions:[]}chunkDPD6ZWL2_js.a(eo,"resolvePropertyDefinitions");function Og(e){return e.type==="select"||e.type==="status"||e.type==="multiselect"}chunkDPD6ZWL2_js.a(Og,"hasOptions");var Ms="Notetaker",Pg={systemPrompt:null,meetingRecordingPolicy:"none",meetingBotDisplayName:Ms};var Vg=["active","suspended"],jg=["plan","manual","auto"];function Lg(e){return `${e.object}:${e.name}:${e.type}`}chunkDPD6ZWL2_js.a(Lg,"viewStateKey");function Je(e){return e.type==="detail"}chunkDPD6ZWL2_js.a(Je,"isDetailView");function to(e){return e.type==="list"}chunkDPD6ZWL2_js.a(to,"isListView");function Ls(e){return e.type==="fields"}chunkDPD6ZWL2_js.a(Ls,"isFieldGroup");var zg=["square","landscape","portrait"];var ro=["none","estimated","exact"];function Bs(e){if(typeof e=="string"&&ro.includes(e))return e;throw new chunkGZUTZAPU_js.h(`countMode must be one of: ${ro.join(", ")} (received: ${String(e)})`,[])}chunkDPD6ZWL2_js.a(Bs,"parseCountMode");function Kg(e){return e===void 0?void 0:Bs(e)}chunkDPD6ZWL2_js.a(Kg,"parseOptionalCountMode");var Yg=1e4;var Jg=["storage.bytes","members.seats","data.live_records"];function Us(e){return e==null?true:typeof e!="object"?false:Object.keys(e).length===0}chunkDPD6ZWL2_js.a(Us,"isEmptyObject");function no(e){return e!=null&&typeof e=="object"&&Object.keys(e).length>0}chunkDPD6ZWL2_js.a(no,"isNotEmpty");function $s(e){return no(e)?e:void 0}chunkDPD6ZWL2_js.a($s,"toUndefinedIfEmpty");function qs(e){if(e<=0)return {value:0,unitIndex:0};let t=1e3,r=Math.min(4,Math.floor(Math.log(e)/Math.log(t)));return {value:Number.parseFloat((e/t**r).toFixed(1)),unitIndex:r}}chunkDPD6ZWL2_js.a(qs,"computeByteMagnitude");var zs=["B","KB","MB","GB","TB"];function zy(e){let{value:t,unitIndex:r}=qs(e);return `${t} ${zs[r]}`}chunkDPD6ZWL2_js.a(zy,"formatByteSize");function Gs(e){return e.displayAttributes!==void 0?[...e.displayAttributes]:[...new Set([e.cardUserAttribute,e.cardDateAttribute].filter(t=>t!==void 0))]}chunkDPD6ZWL2_js.a(Gs,"getListViewDisplayAttributeNames");var Hy={ATTACHMENTS:"attachments"};function Qy(e){return e.type==="document"}chunkDPD6ZWL2_js.a(Qy,"isDocumentAttribute");function Jy(e,t){if(!t||t.length===0)return true;let r=e.name.toLowerCase();return t.some(n=>n.endsWith("/*")?e.mimeType.startsWith(n.slice(0,-1)):n.startsWith(".")?r.endsWith(n.toLowerCase()):e.mimeType===n)}chunkDPD6ZWL2_js.a(Jy,"matchesAccepts");var io=Object.freeze(["text","number","checkbox","date","phone","currency","status","select","multiselect","location"]);function Xe(e){let t=[];for(let r of e){let n=r.build();if(!io.includes(n.type))throw new Error(`Property type "${n.type}" is not supported in .qualifyWith()`);t.push(n);}return {definitions:t}}chunkDPD6ZWL2_js.a(Xe,"buildPropertySchema");var rh="__";function nh(e){let t=e.indexOf("__");return t<=0||t+2>=e.length?{kind:"scalar",attribute:e}:{kind:"qualified",root:e.slice(0,t),property:e.slice(t+2)}}chunkDPD6ZWL2_js.a(nh,"parseQualifiedAttribute");function ih(e,t){return `${e}__${t}`}chunkDPD6ZWL2_js.a(ih,"buildQualifiedAttribute");function ee(e){return typeof e=="object"&&e!==null&&typeof e.start=="string"}chunkDPD6ZWL2_js.a(ee,"isDateRangeValue");function Ws(e,t){return chunkC4LR6U4E_js.a(e)?null:ee(e)?t.endDate?{start:e.start,end:e.end??null}:e.start:typeof e=="string"?t.endDate?{start:e,end:null}:e:null}chunkDPD6ZWL2_js.a(Ws,"normalizeDateValue");function be(e){return typeof e=="string"&&e!==""?e:ee(e)&&e.start!==""?e.start:null}chunkDPD6ZWL2_js.a(be,"dateValueStart");var Ze="\u2014";function Ks(e){return String(e)}chunkDPD6ZWL2_js.a(Ks,"formatText");function Ys(e){return e?"Yes":"No"}chunkDPD6ZWL2_js.a(Ys,"formatCheckbox");function Hs(e,t){if(typeof e!="number")return String(e);if(t.renderAs==="rating")return `${e}/${t.max??5}`;let r=t.decimals;return t.unit==="integer"?e.toLocaleString(void 0,{minimumFractionDigits:0,maximumFractionDigits:0}):t.unit==="percentage"?(e/100).toLocaleString(void 0,{style:"percent",minimumFractionDigits:r,maximumFractionDigits:r}):e.toLocaleString(void 0,{minimumFractionDigits:r,maximumFractionDigits:r})}chunkDPD6ZWL2_js.a(Hs,"formatNumber");function Qs(e,t){if(typeof e!="object"||e===null)return String(e);let r=e;return "value"in r&&"code"in r?`${r.value.toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})} ${r.code}`:String(e)}chunkDPD6ZWL2_js.a(Qs,"formatCurrency");function Jt(e){if(ee(e)){let t=Jt(e.start);return e.end?`${t} \u2192 ${Jt(e.end)}`:t}if(e instanceof Date)return e.toISOString().split("T")[0];if(typeof e=="string"){let t=new Date(e);if(!Number.isNaN(t.getTime()))return t.toISOString().split("T")[0]}return String(e)}chunkDPD6ZWL2_js.a(Jt,"formatDate");function Js(e){if(typeof e!="object"||e===null)return String(e);let t=e;return "phoneNumber"in t?t.phoneNumber?t.countryCode?chunkGXSNLYRR_js.c(t):t.phoneNumber:"":String(e)}chunkDPD6ZWL2_js.a(Js,"formatPhone");function Xs(e,t="full"){if(typeof e!="object"||e===null)return "";let r=e,n=[];switch(t){case "country":r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "state":r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "city":r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;case "coordinates":r.latitude!==void 0&&r.longitude!==void 0&&n.push(`${r.latitude}, ${r.longitude}`);break;case "address":r.address&&n.push(r.address),r.city&&n.push(r.city),r.state&&n.push(r.state),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break;default:r.address&&n.push(r.address),r.address2&&n.push(r.address2),r.city&&n.push(r.city),r.state&&n.push(r.state),r.postalCode&&n.push(r.postalCode),r.country&&n.push(constants.getCountryDisplayNameByIso3(r.country));break}return n.join(", ")}chunkDPD6ZWL2_js.a(Xs,"formatLocationValue");function Zs(e,t){return typeof e!="object"||e===null?String(e):Xs(e,t.granularity??"full")||Ze}chunkDPD6ZWL2_js.a(Zs,"formatLocation");function eu(e,t){return typeof e!="string"?String(e):t.options?.find(n=>n.value===e)?.label??String(e)}chunkDPD6ZWL2_js.a(eu,"formatSelect");function tu(e,t){return Array.isArray(e)?t.options?e.map(n=>t.options.find(o=>o.value===n)?.label).filter(Boolean).join(", "):e.join(", "):String(e)}chunkDPD6ZWL2_js.a(tu,"formatMultiselect");function oo(e,t){if(chunkC4LR6U4E_js.a(e))return Ze;switch(t.type){case "text":return Ks(e);case "checkbox":return Ys(e);case "number":return Hs(e,t);case "currency":return Qs(e);case "date":return Jt(e);case "phone":return Js(e);case "location":return Zs(e,t);case "select":case "status":return eu(e,t);case "multiselect":return tu(e,t);case "user":case "relation":return Array.isArray(e)?e.join(", "):String(e);default:return Array.isArray(e)?e.join(", "):String(e)}}chunkDPD6ZWL2_js.a(oo,"formatAttributeValue");var nu=["UPPER","LOWER","capitalize","trim"],iu=["prefix","suffix","wrap","default"],et=[...nu,...iu],ge=er.z.string().min(1,"labelExpression cannot be empty").refine(e=>tt(e),{message:"labelExpression must contain at least one {{ attribute }} interpolation"}).refine(e=>!/\{\{\s*\}\}/.test(e),{message:"labelExpression contains empty {{ }} interpolation"}).refine(e=>{let t=/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g,r;for(;(r=t.exec(e))!==null;){let n=r[1];if(!et.includes(n))return false}return true},{message:`Invalid pipe name. Valid pipes: ${et.join(", ")}`});function ou(e){let t=ge.safeParse(e);return t.success?{success:true,attributes:po(e)}:{success:false,error:t.error.issues[0]?.message??"Invalid labelExpression"}}chunkDPD6ZWL2_js.a(ou,"validateLabelExpression");var ao={UPPER:chunkDPD6ZWL2_js.a(e=>String(e).toUpperCase(),"UPPER"),LOWER:chunkDPD6ZWL2_js.a(e=>String(e).toLowerCase(),"LOWER"),capitalize:chunkDPD6ZWL2_js.a(e=>String(e).replace(/(^|\s)\S/g,t=>t.toUpperCase()),"capitalize"),trim:chunkDPD6ZWL2_js.a(e=>String(e).trim(),"trim")},so={prefix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${t}${e}`:"","prefix"),suffix:chunkDPD6ZWL2_js.a((e,t="")=>e?`${e}${t}`:"","suffix"),wrap:chunkDPD6ZWL2_js.a((e,t="",r="")=>e?`${t}${e}${r}`:"","wrap"),default:chunkDPD6ZWL2_js.a((e,t="")=>e||t,"default")};function au(e,t){let r=e;for(let n of t){let{name:o,args:a}=lo(n),s=ao[o];if(s)r!==""&&(r=s(r));else {let l=so[o];l&&(r=l(r,...a));}}return r}chunkDPD6ZWL2_js.a(au,"applyPipes");function su(e,t){return t.split(".").reduce((r,n)=>{if(!(r==null||typeof r!="object"))return r[n]},e)}chunkDPD6ZWL2_js.a(su,"getValue");var uo="(Untitled)";function lo(e){let t=e.match(/^(\w+)(?::(.*))?$/);if(!t)return {name:e,args:[]};let r=t[1],n=t[2];if(!n)return {name:r,args:[]};let o=[],a=/["']([^"']*?)["']/g,s;for(;(s=a.exec(n))!==null;)o.push(s[1]);return {name:r,args:o}}chunkDPD6ZWL2_js.a(lo,"parsePipeExpression");function Xt(e,t,r=uo){return e.replace(/\{\{\s*([^}]+)\s*\}\}/g,(o,a)=>{let s=a.split("||").map(j=>j.trim()),p=s[s.length-1].split("|").map(j=>j.trim());s[s.length-1]=p[0];let I=p.slice(1).filter(Boolean),Z=s.filter(Boolean),B="";for(let j of Z){let H=co(su(t,j));if(H!==""){B=H;break}}if(chunkC4LR6U4E_js.a(B)&&I.length===0)return "";for(let j of I){let{name:H,args:ss}=lo(j),pi=ao[H];if(pi)B!==""&&(B=pi(B));else {let mi=so[H];mi&&(B=mi(B,...ss));}}return B}).trim()||r}chunkDPD6ZWL2_js.a(Xt,"renderLabelExpression");function co(e){if(e==null||typeof e=="function")return "";if(typeof e!="object")return String(e);if(Array.isArray(e))return e.map(co).filter(Boolean).join(",");let t=e.toString;return typeof t=="function"&&t!==Object.prototype.toString?String(e):""}chunkDPD6ZWL2_js.a(co,"toText");function tt(e){return /\{\{\s*\S+.*\}\}/.test(e)}chunkDPD6ZWL2_js.a(tt,"isLabelExpression");function po(e){let t=[],r=/\{\{\s*([^}]+)\s*\}\}/g,n;for(;(n=r.exec(e))!==null;){let a=n[1].trim().split("||").map(l=>l.trim()),s=a[a.length-1];a[a.length-1]=s.split("|")[0].trim();for(let l of a){if(!l)continue;let p=l.split(".")[0];p&&!t.includes(p)&&t.push(p);}}return t}chunkDPD6ZWL2_js.a(po,"extractAttributeNames");var uu=/^\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}$/;function mo(e){let t=e.trim().match(uu);return t?t[1]:null}chunkDPD6ZWL2_js.a(mo,"getSingleAttributeFromExpression");function lu(e,t){let r=mo(e);if(r===null)return null;let n=t.find(o=>o.name===r);return !n||n.type!=="text"||chunkVY5UBDTO_js.j(n).authoring.readOnly?null:n}chunkDPD6ZWL2_js.a(lu,"getEditableLabelAttribute");var du=/\{\{\s*props\./;function cu(e,t,r){if(!du.test(e))return e;let n={},o=new Map(r?.map(s=>[s.name,s]));if(t)for(let[s,l]of Object.entries(t)){if(l==null)continue;let p=o.get(s);if(p){let I=oo(l,p);n[s]=I===Ze?"":I;}else n[s]=l;}return Xt(e,{props:n},"").replace(/\(\s*\)/g,"").replace(/\[\s*\]/g,"").replace(/\s*[-—|:]\s*$/g,"").replace(/\s{2,}/g," ").trim()}chunkDPD6ZWL2_js.a(cu,"applyRelationProps");function pu(e){if(e?.type==="relation")return e.properties?.definitions}chunkDPD6ZWL2_js.a(pu,"relationPropertyDefs");function mu(e){if(e?.type==="relation"||e?.type==="document")return e.properties?.definitions}chunkDPD6ZWL2_js.a(mu,"qualifiedPropertyDefs");function fo(e){if(chunkC4LR6U4E_js.a(e))return [];if(typeof e=="string")return [{id:e}];if(Array.isArray(e))return e.flatMap(t=>fo(t));if(typeof e=="object"&&"id"in e){let t=e;if(typeof t.id=="string")return [{id:t.id,props:t.props}]}return []}chunkDPD6ZWL2_js.a(fo,"extractValueRefs");function fu(e){let t=[e.firstName,e.lastName].map(r=>r?.trim()).filter(Boolean).join(" ");return t!==""?t:e.email?.split("@")[0]??""}chunkDPD6ZWL2_js.a(fu,"getUserDisplayName");var bu=/\p{L}|\p{N}/u;function gu(e,t){let r=e?.trim()??"";if(r==="")return t;let n=r.split(/\s+/),a=(n.length===1?r.split("@")[0].split(/[._-]/):n).map(s=>{let l=s.match(bu)?.[0];return l===void 0?"":[...l.toUpperCase()][0]??""}).filter(Boolean).slice(0,2).join("");return a===""?t:a}chunkDPD6ZWL2_js.a(gu,"deriveInitials");var bo="__creatorRootActorId";function yu(e){let t=e.metadata?.[bo];return typeof t=="string"&&t.length>0?t:e.createdBy}chunkDPD6ZWL2_js.a(yu,"getRecordCreatorPrincipalId");function ye(e,t){return e?.includes("*")===true||e?.includes(t)===true}chunkDPD6ZWL2_js.a(ye,"includesAction");function hu(e){return {canRead:ye(e,"read"),canCreate:ye(e,"create"),canUpdate:ye(e,"update"),canDelete:ye(e,"delete"),canManage:ye(e,"manage")}}chunkDPD6ZWL2_js.a(hu,"buildPermissionFlags");var kh=new Set(["id","name","label","type","required","system","unique","order"]);var L={PEOPLE:"people",WORKSPACE:"workspace",ARCHITECT:"architect",FEATURE_FLAGS:"feature-flags",FILES:"files",VIEWS:"views",FORMS:"forms",DOCUMENTS:"documents",AUDIT:"audit",API_KEYS:"api-keys",CONNECTORS:"connectors",ENV_VARS:"env-vars",SESSION:"session"},Ph=[L.PEOPLE,L.WORKSPACE,L.ARCHITECT,L.FEATURE_FLAGS,L.FILES,L.VIEWS,L.FORMS,L.DOCUMENTS,L.AUDIT,L.API_KEYS,L.CONNECTORS,L.ENV_VARS,L.SESSION],Fh={people:"People",workspace:"Workspace",architect:"Architect","feature-flags":"Feature flags",files:"Files",views:"Views",forms:"Forms",documents:"Documents",audit:"Audit","api-keys":"API keys",connectors:"Connected accounts","env-vars":"Environment variables",session:"Agent sessions"},Au={OWNER:"owner",MEMBER:"member",AGENT_DEFAULT:"agent_default",REFLEX_DEFAULT:"reflex_default"},Vh={owner:"Owner",member:"Member",agent_default:"Agent Default",reflex_default:"Reflex Default"},jh={owner:"Full access to all platform features and data",member:"Can view, create, edit and delete business data",agent_default:"Default role for AI agents \u2014 CRUD on records plus documents and files",reflex_default:"Default role for reflexes \u2014 no data access; each reflex is granted exactly what its rehearsal showed it uses"},Zt=["read","create","update","delete","manage"],Tu=["read","create","delete"],Mh={owner:{system:[{target:"*",actions:Zt}],object:[{target:"*",actions:Zt}]},member:{system:[{target:"people",actions:["read"]},{target:"workspace",actions:["read"]},{target:"connectors",actions:Tu},{target:"files",actions:["read","create","update"]}],object:[{target:"*",actions:Zt}]},agent_default:{system:[{target:"documents",actions:["read","create","update"]},{target:"files",actions:["read","create","update"]},{target:"env-vars",actions:["read"]},{target:"session",actions:["observe"]}],object:[{target:"*",actions:["read","create","update","delete"]}]},reflex_default:{system:[],object:[]}};function Lh(e){return Object.values(Au).includes(e)}chunkDPD6ZWL2_js.a(Lh,"isDefaultRole");var xu=new Set(constants.ICONS),yo=/^[a-zA-Z_][a-zA-Z0-9_]*$/,Iu=/^[a-z][a-z0-9-]*$/,he=63,go=128,rt=er__default.default.string().min(1,"Object name cannot be empty").max(63,"Object name is too long (max 63 characters)").regex(/^[a-z][a-z0-9-]*$/,{message:`Invalid object name format.
|
|
3
3
|
Name must be in kebab-case (slug format):
|
|
4
4
|
\u2705 Valid: 'products', 'user-profiles', 'order-items'
|
|
5
|
-
\u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function
|
|
5
|
+
\u274C Invalid: 'Products', 'userProfiles', 'user_profiles'`});function Ce(e){try{rt.parse(e);}catch(t){throw t instanceof er__default.default.ZodError?new chunkGZUTZAPU_js.b(t.issues[0].message,chunkGZUTZAPU_js.a.INVALID_OBJECT_NAME):t}}chunkDPD6ZWL2_js.a(Ce,"validateObjectName");function nt(e){if(!e||e.length===0)throw new chunkGZUTZAPU_js.h("View name cannot be empty",[{path:["name"],message:"View name cannot be empty"}]);if(e.length>he)throw new chunkGZUTZAPU_js.h("View name is too long",[{path:["name"],message:`View name is too long (max ${he} characters)`}]);if(!Iu.test(e))throw new chunkGZUTZAPU_js.h("Invalid view name format",[{path:["name"],message:"View name must be in kebab-case (e.g., 'detail', 'list-view')"}])}chunkDPD6ZWL2_js.a(nt,"validateViewName");function ue(e,t,r){let n=new Set;for(let o of e){let a=t(o);if(n.has(a))throw r(a);n.add(a);}}chunkDPD6ZWL2_js.a(ue,"assertUniqueBy");var ho=er__default.default.string().min(1,"Attribute name cannot be empty").max(he,`Attribute name is too long (max ${he} characters)`).regex(yo,{message:`Invalid attribute name format.
|
|
6
6
|
Name must be a valid variable identifier:
|
|
7
7
|
\u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
8
|
-
\u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!
|
|
8
|
+
\u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`}).refine(e=>!chunkVY5UBDTO_js.B.includes(e),{message:"This is a reserved attribute name"});function Ne(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute name cannot be empty");if(e.length>he)throw new Error(`[AttributeBuilder] Attribute name is too long (max ${he} characters)`);if(!yo.test(e))throw new Error(`[AttributeBuilder] Invalid attribute name format.
|
|
9
9
|
Name must be a valid variable identifier:
|
|
10
10
|
\u2705 Valid: 'firstName', 'first_name', 'FirstName', 'FIRST_NAME'
|
|
11
|
-
\u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(
|
|
12
|
-
Reserved names: ${
|
|
13
|
-
Icon must be one of the predefined icons from @stndrds/constants.`)}chunkDPD6ZWL2_js.a(fo,"validateIconName");function le(e,t){let r=new Set;for(let n of t){if(!n.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!n.label?.trim())throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has an empty or missing label.`);if(r.has(n.value))throw new Error(`[AttributeBuilder] Duplicate option value "${n.value}" in "${e}".`);r.add(n.value);}for(let n of t){if(n.inverse===void 0)continue;let o=t.find(a=>a.value===n.inverse);if(!o)throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(o.inverse!==n.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${o.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}chunkDPD6ZWL2_js.a(le,"validateOptions");var bo={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2},timeoutMs:3e5},Zt=class Zt{constructor(t){if(!t.name||t.name.trim().length===0)throw new chunk72TQRSNX_js.h("Agent name is required",[]);this.bp={name:t.name,system:true,visibility:"workspace",triggers:[]};}description(t){return this.bp.description=t,this}label(t){return this.bp.label=t,this}icon(t){return this.bp.icon=t,this}systemPrompt(t){return this.bp.systemPrompt=t,this}model(t,r,n){return this.bp.model={provider:t,model:r,...n},this}tools(t){return this.bp.tools=[...t],this}schedule(t){return this.bp.schedule={...t,enabled:t.enabled??true},this}config(t){let r=this.bp.config??bo,n=t.inference===void 0?r.inference:{...r.inference,...t.inference};return this.bp.config={...r,...t,...n===void 0?{}:{inference:n}},this}delegation(t){return Object.assign(this.bp,t),this}mcpServers(t){return this.bp.mcpServers=Array.isArray(t)?[...t]:t,this}approval(t){return this.bp.approval={...Mi,...this.bp.approval,...t},this}visibility(t){return this.bp.visibility=t,this}requiresPermission(t,r){return this.bp.requiredPermission={resource:t,action:r},this}trigger(t,r,n){return this.bp.triggers.push({name:t,eventType:r,...n,enabled:n?.enabled??true}),this}runtime(){return this.bp.system=false,this}build(){if(!this.bp.systemPrompt)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility==="private")throw new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return ue(this.bp.triggers,t=>t.name,t=>new chunk72TQRSNX_js.h(`Agent "${this.bp.name}": duplicate trigger name "${t}"`,[])),{...this.bp,visibility:this.bp.visibility??"workspace",config:this.bp.config??bo,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};chunkDPD6ZWL2_js.a(Zt,"AgentBuilder");var Xt=Zt;function Bh(e){return new Xt(e)}chunkDPD6ZWL2_js.a(Bh,"agent");var yu="@stndrds/schema";function et(e){return {version:1,vendor:yu,validate:chunkDPD6ZWL2_js.a(t=>{let r=e.safeParse(t);return r.success?{value:r.data}:{issues:r.error.issues.map(n=>({message:n.message,path:n.path}))}},"validate")}}chunkDPD6ZWL2_js.a(et,"createStandardSchemaProps");function qh(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"].version===1}chunkDPD6ZWL2_js.a(qh,"isStandardSchema");var yr=class yr{get"~standard"(){let t=chunk5QAE5NPN_js.c(this.build());return et(t)}constructor(t,r,n){Ce(r),mo(n),this.attr={name:r,label:n,type:t,required:false,system:true};}setRequired(t){this.attr.required=t;}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=false,this}hidden(){return this.attr.hidden=true,this}placeholder(t){return this.attr.placeholder=t,this}description(t){return this.attr.description=t,this}icon(t){return fo(t,`attribute "${this.attr.name}"`),this.attr.icon=t,this}order(t){return this.attr.order=t,this}defaultValue(t){return ("defaultValue"in this.attr||!["formula","rollup"].includes(this.attr.type))&&(this.attr.defaultValue=t),this}metadata(t){return this.attr.metadata=t,this}build(){return this.attr}};chunkDPD6ZWL2_js.a(yr,"BaseAttributeBuilder");var R=yr,hr=class hr extends R{constructor(t,r){super("text",t,r);}minLength(t){return this.attr.minLength=t,this}maxLength(t){return this.attr.maxLength=t,this}pattern(t){return this.attr.pattern=t,this.attr.format=void 0,this}multiline(t=true){return this.attr.multiline=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}email(){return this.attr.format="email",this.attr.pattern=void 0,this}url(){return this.attr.format="url",this.attr.pattern=void 0,this}slug(){return this.attr.format="slug",this.attr.pattern=void 0,this}};chunkDPD6ZWL2_js.a(hr,"TextAttributeBuilder");var er=hr;function f(e){return new er(e.name,e.label)}chunkDPD6ZWL2_js.a(f,"text");var Ar=class Ar extends R{constructor(t,r){super("richtext",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ar,"RichtextAttributeBuilder");var tr=Ar;function he(e){return new tr(e.name,e.label)}chunkDPD6ZWL2_js.a(he,"richtext");var Tr=class Tr extends R{constructor(t,r){super("number",t,r);}min(t){return this.attr.min=t,this}max(t){return this.attr.max=t,this}integer(){return this.attr.unit="integer",this.attr.decimals=0,this}decimal(t=2){return this.attr.unit="decimal",this.attr.decimals=t,this}percentage(){return this.attr.unit="percentage",this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Tr,"NumberAttributeBuilder");var rr=Tr;function rt(e){return new rr(e.name,e.label)}chunkDPD6ZWL2_js.a(rt,"number");var wr=class wr extends R{constructor(t,r){super("checkbox",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(wr,"CheckboxAttributeBuilder");var nr=wr;function go(e){return new nr(e.name,e.label)}chunkDPD6ZWL2_js.a(go,"checkbox");var xr=class xr extends R{constructor(t,r){super("date",t,r);}format(t){return this.attr.dateFormat=t,this}minDate(t){return this.attr.minDate=t,this}maxDate(t){return this.attr.maxDate=t,this}endDate(){return this.attr.endDate=true,this.asPhantomState()}includeTime(){return this.attr.includeTime=true,this}timeFormat(t){return this.attr.timeFormat=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(xr,"DateAttributeBuilder");var ir=xr;function U(e){return new ir(e.name,e.label)}chunkDPD6ZWL2_js.a(U,"date");var Ir=class Ir extends R{constructor(t,r){super("phone",t,r);}defaultCountry(t){return this.attr.defaultCountryCode=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ir,"PhoneAttributeBuilder");var or=Ir;function Xh(e){return new or(e.name,e.label)}chunkDPD6ZWL2_js.a(Xh,"phone");var Sr=class Sr extends R{constructor(t,r){super("currency",t,r);}defaultCurrency(t){return this.attr.defaultCurrency=t,this}allowedCurrencies(t){return this.attr.allowedCurrencies=t,this}allowNegative(t=true){return this.attr.allowNegative=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Sr,"CurrencyAttributeBuilder");var ar=Sr;function Zh(e){return new ar(e.name,e.label)}chunkDPD6ZWL2_js.a(Zh,"currency");var vr=class vr extends R{constructor(t,r){super("status",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(vr,"StatusAttributeBuilder");var sr=vr;function eA(e){return new sr(e.name,e.label)}chunkDPD6ZWL2_js.a(eA,"status");var Rr=class Rr extends R{constructor(t,r){super("select",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Rr,"SelectAttributeBuilder");var ur=Rr;function q(e){return new ur(e.name,e.label)}chunkDPD6ZWL2_js.a(q,"select");var Er=class Er extends R{constructor(t,r){super("multiselect",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Er,"MultiselectAttributeBuilder");var lr=Er;function tA(e){return new lr(e.name,e.label)}chunkDPD6ZWL2_js.a(tA,"multiselect");var Dr=class Dr extends R{constructor(t,r){super("location",t,r);}granularity(t){return this.attr.granularity=t,this}defaultCountry(t){return this.attr.defaultCountry=t,this}allowedCountries(t){return this.attr.allowedCountries=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Dr,"LocationAttributeBuilder");var dr=Dr;function rA(e){return new dr(e.name,e.label)}chunkDPD6ZWL2_js.a(rA,"location");var Cr=class Cr extends R{constructor(t,r){super("user",t,r),this.attr.types=["user","agent"];}types(t){let r=[...new Set(t)];if(r.length===0)throw new Error("[AttributeBuilder] user.types must contain at least one type.");return this.attr.types=r,this}multiple(){return this.attr.multiple=true,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Cr,"UserAttributeBuilder");var cr=Cr;function nA(e){return new cr(e.name,e.label)}chunkDPD6ZWL2_js.a(nA,"user");var Nr=class Nr extends R{to(t,r){let n={object:t,...r};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:$t}],this}qualifyWith(...t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.qualifyWith() must be called AFTER .to(). Example: relation({ name: "companies" }).to("companies").qualifyWith(...)');return this.attr.properties=Ye(t),this}bilateral(t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.bilateral() must be called AFTER .to(). Example: relation({ name: "company" }).to("companies").bilateral({ ... })');if(r.length>1)throw new Error("Bilateral relations are not supported for polymorphic relations (multiple .to() targets).");if(ji(this.attr))throw new Error("Bilateral relations are not supported for universal relations (.toAny()).");return this.attr.bilateral=t,this}};chunkDPD6ZWL2_js.a(Nr,"BaseRelationAttributeBuilder");var tt=Nr,kr=class kr extends tt{constructor(t,r){super("relation",t,r),this.attr.cardinality="one",this.attr.targets=[];}many(){let t=new mr(this.attr.name,this.attr.label??"",{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===false&&t.runtime(),this.attr.hidden&&t.hidden(),this.attr.placeholder&&t.placeholder(this.attr.placeholder),this.attr.description&&t.description(this.attr.description),this.attr.icon&&t.icon(this.attr.icon),this.attr.order!==void 0&&t.order(this.attr.order),this.attr.metadata&&t.metadata(this.attr.metadata),t}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(kr,"SingleRelationAttributeBuilder");var pr=kr,Or=class Or extends tt{constructor(t,r,n){super("relation",t,r),this.attr.cardinality="many",this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(true);}maxItems(t){return this.attr.maxItems=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Or,"MultiRelationAttributeBuilder");var mr=Or;function Ae(e){return new pr(e.name,e.label)}chunkDPD6ZWL2_js.a(Ae,"relation");var _r=class _r extends R{constructor(t,r){super("formula",t,r),this.attr.required=false;}expression(t){return this.attr.expression=t,this}returns(t){return this.attr.returnType=t,this}decimals(t){return this.attr.decimals=t,this}required(){throw new Error("Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(_r,"FormulaAttributeBuilder");var fr=_r;function iA(e){return new fr(e.name,e.label)}chunkDPD6ZWL2_js.a(iA,"formula");var Pr=class Pr extends R{constructor(t,r){super("rollup",t,r),this.attr.required=false;}from(t){return this.attr.relationAttribute=t,this}aggregate(t){return this.attr.targetAttribute=t,this}using(t){return this.attr.function=t,this}decimals(t){return this.attr.decimals=t,this}path(t){return this.attr.relationPath=t,this}targetType(t){return this.attr.targetAttributeType=t,this}targetOptions(t){return this.attr.targetAttributeOptions=t,this}targetCurrency(t){return this.attr.targetCurrencyCode=t,this}build(){let t=this.attr.function,r=this.attr.targetAttributeType;if(t==="original"&&r!==void 0&&r!=="select"&&r!=="status"&&r!=="multiselect"){let n=this.attr.relationAttribute??"relation",o=this.attr.targetAttribute??"field";throw new chunk72TQRSNX_js.b(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${r}") was given. To surface a plain ${r} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${n}.${o}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}return super.build()}required(){throw new Error("Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(Pr,"RollupAttributeBuilder");var br=Pr;function oA(e){return new br(e.name,e.label)}chunkDPD6ZWL2_js.a(oA,"rollup");var Fr=class Fr extends R{constructor(t,r){super("document",t,r);}accepts(t){return this.attr.accepts=t,this}maxFileSize(t){return this.attr.maxFileSize=t,this}qualifyWith(...t){return this.attr.properties=Ye(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Fr,"DocumentAttributeBuilder");var gr=Fr;function yo(e){return new gr(e.name,e.label)}chunkDPD6ZWL2_js.a(yo,"document");function Ao(e,t,r){let n=Array.isArray(e)?e:[e],[o,...a]=n;return {type:"slot",slotId:o,additionalSlotIds:a.length>0?a:void 0,attribute:t,label:r?.label,required:r?.required,tooltip:r?.tooltip}}chunkDPD6ZWL2_js.a(Ao,"buildSlotFieldRef");var Lr=class Lr{constructor(t,r,n){this._finalized=false;this.stepBuilder=t,this.rowData={id:r,order:n,type:"fields",fields:[]};}field(t,r,n){return this.rowData.fields.push(Ao(t,r,n)),this}freeField(t,r){let o={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression};return this.rowData.fields.push(o),this}row(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).row(t)}heading(t,r){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).heading(t,r)}separator(){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).separator()}text(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).text(t)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=true,this.stepBuilder._finalizeRow(this.rowData))}};chunkDPD6ZWL2_js.a(Lr,"FormRowBuilder");var Vr=Lr,Br=class Br{constructor(t,r,n){this.rowOrder=0;this.formBuilder=t,this.stepData={id:r,label:n,rows:[]};}description(t){return this.stepData.description=t,this}field(t,r,n){this.rowOrder++;let o=`row-${this.stepData.id}-${this.rowOrder}`,a=Ao(t,r,n),s={id:o,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}freeField(t,r){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,a={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression},s={id:n,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}row(t){return this.rowOrder++,new Vr(this,t,this.rowOrder)}heading(t,r){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"heading",content:t,level:r};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let t={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"separator"};return this.stepData.rows.push(t),this}text(t){this.rowOrder++;let r={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"text",content:t};return this.stepData.rows.push(r),this}step(t,r){return this.formBuilder._finalizeStep(this.stepData).step(t,r)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(t){return t.fields.length>0&&this.stepData.rows.push(t),this}_getData(){return this.stepData}};chunkDPD6ZWL2_js.a(Br,"FormStepBuilder");var jr=Br,Ur=class Ur{constructor(t,r){this.data={slots:[],steps:[],status:"draft",version:1};this.validateName(t),this.data.name=t,this.data.label=r;}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}status(t){return this.data.status=t,this}metadata(t){return this.data.metadata=t,this}slot(t,r,n){if(this.data.slots.some(a=>a.id===t))throw new Error(`[FormBuilder] Duplicate slot id: "${t}"`);let o={id:t,objectName:r,label:n.label,mode:n.mode??"create",color:n.color,icon:n.icon};return this.data.slots.push(o),this}step(t,r){if(this.data.steps.some(n=>n.id===t))throw new Error(`[FormBuilder] Duplicate step id: "${t}"`);return new jr(this,t,r)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.data}_finalizeStep(t){return this.data.steps.push(t),this}validateName(t){let r=Jt.z.string().min(1,"Form name cannot be empty").max(63,"Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'"});try{r.parse(t);}catch(n){throw n instanceof Jt.z.ZodError?new Error(`[FormBuilder] ${n.issues[0].message}`):n}}validateRequiredData(){if(this.data.slots.length===0)throw new Error("[FormBuilder] At least one slot is required. Use .slot() to add slots.");if(this.data.steps.length===0)throw new Error("[FormBuilder] At least one step is required. Use .step() to add steps.")}validateSlotReferences(){let t=new Map(this.data.slots.map(r=>[r.id,r.objectName]));for(let r of this.data.steps)for(let n of r.rows)if(We(n))for(let o of n.fields){if(o.type!=="slot")continue;let a=Wi(o);for(let l of a)if(!t.has(l))throw new Error(`[FormBuilder] Step "${r.id}" references unknown slot "${l}". Declare it with .slot("${l}", ...) first.`);let s=new Set(a.map(l=>t.get(l)));if(s.size>1)throw new Error(`[FormBuilder] Step "${r.id}" field on attribute "${o.attribute}" targets slots of different objects (${[...s].join(", ")}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let t=[...Qe,"join"];for(let r of this.data.steps)for(let n of r.rows)if(We(n))for(let o of n.fields){if(!Gt(o)||!o.prefillExpression)continue;let a=o.prefillExpression,s=`prefillExpression on free field "${o.attribute.name}" in step "${r.id}"`;if(!Je(a))throw new Error(`[FormBuilder] ${s} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(a))throw new Error(`[FormBuilder] ${s} contains empty {{ }} interpolation.`);for(let l of a.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)){let p=l[1];if(!t.includes(p))throw new Error(`[FormBuilder] ${s} uses invalid pipe "${p}". Valid pipes: ${t.join(", ")}`)}}}validateFreeFields(){let t=new Set(zt);for(let r of this.data.steps)for(let n of r.rows)if(We(n)){for(let o of n.fields)if(Gt(o)){let a=o.attribute.type;if(t.has(a))throw new Error(`[FormBuilder] Free field in step "${r.id}" uses forbidden attribute type "${a}". Forbidden types: ${zt.join(", ")}`)}}}};chunkDPD6ZWL2_js.a(Ur,"FormBuilder");var Mr=Ur;function pA(e,t){return new Mr(e,t)}chunkDPD6ZWL2_js.a(pA,"form");function hu(e){return {text:"toString",richtext:"toString",number:"toNumber",currency:"toNumber",date:"toDate",checkbox:"toBoolean"}[e]}chunkDPD6ZWL2_js.a(hu,"resolveBuiltInTransform");var $r=class $r{constructor(t){this.operations=[];this.touchedAttributes=new Set;this.version=t;}assertNotTouched(t,r){if(this.touchedAttributes.has(t))throw new Error(`[MigrationBuilder] Conflicting operations on attribute "${t}": it was already modified earlier in this migration (attempted: ${r}).`)}renameAttribute(t,r){return this.assertNotTouched(t,"rename_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"rename_attribute",from:t,to:r}),this}changeType(t,r,n,o){this.assertNotTouched(t,"change_type"),this.touchedAttributes.add(t);let a=o?.transform?hu(n):void 0;return this.operations.push({type:"change_type",name:t,from:r,to:n,transform:a}),this}removeAttribute(t){return this.assertNotTouched(t,"remove_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"remove_attribute",name:t,backup_config:{}}),this}addAttribute(t){return this.assertNotTouched(t.name,"add_attribute"),this.touchedAttributes.add(t.name),this.operations.push({type:"add_attribute",attribute:t}),this}updateConfig(t,r){return this.assertNotTouched(t,"update_config"),this.touchedAttributes.add(t),this.operations.push({type:"update_config",name:t,from:{},to:r}),this}build(){return {version:this.version,operations:[...this.operations]}}};chunkDPD6ZWL2_js.a($r,"MigrationBuilder");var nt=$r;function Au(e){let{name:t,labelExpression:r,embeddingExpression:n}=e;if(!r)throw new chunk72TQRSNX_js.b(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,chunk72TQRSNX_js.a.VALIDATION_FAILED);let o=be.safeParse(r);if(!o.success){let a=o.error.issues[0]?.message??"Invalid labelExpression";throw new chunk72TQRSNX_js.b(`Invalid labelExpression for "${t}": ${a}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}if(n!==void 0){let a=be.safeParse(n);if(!a.success){let s=a.error.issues[0]?.message??"Invalid embeddingExpression";throw new chunk72TQRSNX_js.b(`Invalid embeddingExpression for "${t}": ${s}`,chunk72TQRSNX_js.a.VALIDATION_FAILED)}}}chunkDPD6ZWL2_js.a(Au,"validateObjectExpressions");var zr=class zr{constructor(t){this._migrations=[];this._sealed=false;this._toleratedAttributes=[];this.validateName(t.name),this.obj={name:t.name,label:t.label,attributes:[],system:true},t.id&&(this.obj.id=t.id);}get"~standard"(){let t=chunk5QAE5NPN_js.e(this.build());return et(t)}description(t){return this.obj.description=t,this}pluralLabel(t){return this._pluralLabel=t,this}icon(t){return this.obj.icon=t,this}runtime(){return this.obj.system=false,this}sealed(){return this._sealed=true,this}tolerate(t){return this._toleratedAttributes=[...this._toleratedAttributes,...t],this}attribute(t){return this.pushAttributes([t]),this}attributes(t){return this.pushAttributes(t),this}pushAttributes(t){let r=t.map(n=>"build"in n&&typeof n.build=="function"?n.build():n);ue([...this.obj.attributes,...r],n=>n.name,n=>new chunk72TQRSNX_js.r("attribute",n,`Object "${this.obj.name}": duplicate attribute name "${n}"`)),this.obj.attributes.push(...r);}metadata(t){return this.obj.metadata={...this.obj.metadata,...t},this}order(t){return this.obj.metadata={...this.obj.metadata,order:t},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:true},this}labelExpression(t){return this._labelExpression=t,this}embeddingExpression(t){return this._embeddingExpression=t,this}documentLayout(t){if(t.presets)for(let r of t.presets)To(r.id,r.structure,1);return this.obj.documentLayout=t,this}migration(t,r){if(t<2)throw new Error(`[ObjectBuilder] Migration version must be >= 2 (version 1 is implicit). Got: ${t}`);if(this._migrations.some(a=>a.version===t))throw new Error(`[ObjectBuilder] Duplicate migration version: ${t}`);let o=new nt(t);return r(o),this._migrations.push(o.build()),this}build(){if(!this.obj.name)throw new Error("[ObjectBuilder] Missing required field: name");if(!this.obj.label)throw new Error("[ObjectBuilder] Missing required field: label");Au({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression});let t=[...this._migrations].sort((n,o)=>n.version-o.version);for(let n=0;n<t.length;n++){let o=n+2;if(t[n].version!==o)throw new Error(`[ObjectBuilder] Migration versions must be sequential starting at 2. Expected version ${o}, got ${t[n].version}.`)}let r=t.length>0?t[t.length-1].version:1;return {...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,schema_version:r,migrations:t,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(t){t!==void 0&&De(t);}};chunkDPD6ZWL2_js.a(zr,"ObjectBuilder");var qr=zr;function z(e){return new qr(e)}chunkDPD6ZWL2_js.a(z,"object");function To(e,t,r){let n=chunkDPD6ZWL2_js.a((a,s)=>{throw new chunk72TQRSNX_js.h(a,[{path:["documentLayout","presets",e],message:s}])},"fail");r>5&&n(`Preset structure exceeds max depth of ${5}`,"Preset structure too deep");let o=new Set;for(let a of t){let s=a.title.trim();s.length===0&&n("Folder preset node title is required","Empty folder title"),s.includes("/")&&n("Folder preset node title cannot contain /",`Folder title contains /: "${s}"`),o.has(s)&&n("Folder preset sibling titles must be unique",`Duplicate folder title: "${s}"`),o.add(s),a.children&&a.children.length>0&&To(e,a.children,r+1);}}chunkDPD6ZWL2_js.a(To,"validatePresetStructure");var en=class en{constructor(t,r){this.data={type:"fields",fields:[]};this.data.id=t,this.data.label=r;}description(t){return this.data.description=t,this}collapsible(t=false){return this.data.collapsible=true,this.data.collapsed=t,this}order(t){return this.data.order=t,this}fields(...t){for(let r of t)this.data.fields?.push({attribute:r});return this}field(t,r){return this.data.fields?.push({attribute:t,...r}),this}attributeGroup(t,r){return this.data.fields?.push({attributeGroup:t,...r}),this}build(){if(!this.data.id)throw new Error("[GroupBuilder] id is required");if(!this.data.label)throw new Error("[GroupBuilder] label is required");if(!this.data.fields||this.data.fields.length===0)throw new Error("[GroupBuilder] At least one field is required");return this.data}};chunkDPD6ZWL2_js.a(en,"GroupBuilder");var ot=en,tn=class tn{constructor(t,r){this.view=t,this.tabData=r;}columns(...t){return this.tabData.columns=t,this}create(t){return this.tabData.allowCreate=true,t?.mode&&(this.tabData.createMode=t.mode),this}createMode(t){return this.tabData.createMode=t,this}edit(){return this.tabData.allowEdit=true,this}delete(){return this.tabData.allowDelete=true,this}crud(){return this.tabData.allowCreate=true,this.tabData.allowEdit=true,this.tabData.allowDelete=true,this}filters(t){return this.tabData.filters=t,this}sorts(t){return this.tabData.sorts=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}tab(t,r){return this.finalize(),new Q(this.view,t,r)}done(){return this.finalize(),this.view}build(){return this.finalize(),this.view.build()}finalize(){if(!this.tabData.columns||this.tabData.columns.length===0)throw new Error(`[TableTabConfig] columns() is required for tab "${this.tabData.name}"`);this.view._addTab(this.tabData);}};chunkDPD6ZWL2_js.a(tn,"TableTabConfig");var at=tn,rn=class rn{constructor(t,r,n){this.view=t,this.tabData={...r,type:"custom",component:n};}props(t){return this.tabData.props=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(rn,"CustomTabConfig");var Gr=rn,nn=class nn{constructor(t,r,n){this.view=t,this.tabData={...r,type:"richtext",attribute:n};}titleAttribute(t){return this.tabData.titleAttribute=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(nn,"RichtextTabConfig");var Wr=nn,on=class on{constructor(t,r){this.view=t,this.tabData={...r,type:"activity"};}limit(t){return this.tabData.limit=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(on,"ActivityTabConfig");var Kr=on,an=class an{constructor(t,r,n){this.view=t,this.tabData={...r,type:n,emailAttributeIds:[]};}emailAttributes(...t){return this.tabData.emailAttributeIds=t,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(an,"AddressMatchedTabConfig");var st=an,sn=class sn extends st{constructor(t,r){super(t,r,"emails");}};chunkDPD6ZWL2_js.a(sn,"EmailsTabConfig");var Yr=sn,un=class un extends st{constructor(t,r){super(t,r,"meetings");}};chunkDPD6ZWL2_js.a(un,"MeetingsTabConfig");var Hr=un,ln=class ln{constructor(t,r){this.view=t,this.tabData={...r,type:"documents",allowUpload:true,allowRemove:true,hideAttachments:false};}disableUpload(){return this.tabData.allowUpload=false,this}disableRemove(){return this.tabData.allowRemove=false,this}hideAttachments(){return this.tabData.hideAttachments=true,this}tab(t,r){return this.view._addTab(this.tabData),new Q(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(ln,"DocumentsTabConfig");var Qr=ln,dn=class dn{constructor(t,r,n){this.view=t,this.base={id:r,name:r,label:n};}icon(t){return this.base.icon=t,this}order(t){return this.base.order=t,this}form(...t){if(t.length===0)throw new Error(`[TabBuilder] form() requires at least one group for tab "${this.base.name}"`);let r={...this.base,type:"form",groups:t.map(n=>n instanceof ot?n.build():n)};return this.view._addTab(r)}table(t){return new at(this.view,{...this.base,type:"table",source:{type:"relation",attribute:t},columns:[]})}tableFrom(t,r){return new at(this.view,{...this.base,type:"table",source:{type:"inverse",object:t,attribute:r},columns:[]})}custom(t){return new Gr(this.view,this.base,t)}richtext(t){return new Wr(this.view,this.base,t)}activity(){return new Kr(this.view,this.base)}documents(){return new Qr(this.view,this.base)}emails(){return new Yr(this.view,this.base)}meetings(){return new Hr(this.view,this.base)}forms(t){let r={...this.base,type:"forms",...t};return this.view._addTab(r)}};chunkDPD6ZWL2_js.a(dn,"TabBuilder");var Q=dn,cn=class cn{constructor(t,r){Ze(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}sidePanel(t){return this.data.sidePanel=t,this}tab(t,r){return new Q(this,t,r)}addTab(t){return this.data.tabs.push(t),this}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[DetailViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[DetailViewBuilder] At least one tab is required");ue(this.data.tabs,r=>r.name,r=>new Error(`[DetailViewBuilder] Duplicate tab name "${r}"`));let t={tabs:this.data.tabs,sidePanel:this.data.sidePanel};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"detail",config:t,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(cn,"DetailViewBuilder");var Jr=cn;function ee(e,t){return new Jr(e,t)}chunkDPD6ZWL2_js.a(ee,"detailView");function it(e){if(Array.isArray(e))return e.map(it).find(r=>r!==void 0);if(e===null||typeof e!="object")return;let t=e;return t.attribute==="visibility"||t.attribute==="ownedBy"?t.attribute:it(t.rules)??it(t.groups)}chunkDPD6ZWL2_js.a(it,"findProtectedTabFilterAttribute");var pn=class pn{constructor(t,r){Ze(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}baseFilter(t){return this.data.defaultFilters=t,this}allowPresentationCustomization(){return this.data.allowPresentationCustomization=true,this}tab(t,r){return new Zr(this,t,r)}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[ListViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[ListViewBuilder] At least one tab is required");if(ue(this.data.tabs,n=>n.id,n=>new Error(`[ListViewBuilder] Duplicate tab id "${n}"`)),this.data.tabs.filter(n=>n.default).length>1)throw new Error("[ListViewBuilder] Only one tab can be marked as default");for(let n of this.data.tabs){if(n.layout==="table"&&n.columns.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" must have at least one column`,[]);if(n.layout==="kanban"&&!n.groupByAttribute)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Kanban tab "${n.id}" requires a groupByAttribute`,[]);if(n.descriptionAttribute!==void 0&&n.descriptionAttribute.length===0)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" requires a nonempty description attribute name`,[]);if(n.displayAttributes!==void 0){let o=chunkSDOYGWU4_js.Y.safeParse(n.displayAttributes);if(!o.success)throw new chunk72TQRSNX_js.h(`[ListViewBuilder] Tab "${n.id}" has invalid display attributes`,o.error.issues.map(a=>({path:["tabs",n.id,"displayAttributes",...a.path.map(String)],message:a.message})))}}let r={allowPresentationCustomization:this.data.allowPresentationCustomization,defaultFilters:this.data.defaultFilters?{id:chunkLQYUPOWB_js.d(),combinator:this.data.defaultFilters.combinator,rules:this.data.defaultFilters.rules}:void 0,tabs:this.data.tabs.map(n=>{let o={id:n.id,label:n.label,icon:n.icon,default:n.default,visibility:n.visibility,columns:n.columns,descriptionAttribute:n.descriptionAttribute,displayAttributes:n.displayAttributes,filters:n.filters?{id:chunkLQYUPOWB_js.d(),combinator:n.filters.combinator,rules:n.filters.rules}:void 0,sorts:n.sorts,createMode:n.createMode};return n.layout==="kanban"?{...o,layout:"kanban",groupByAttribute:n.groupByAttribute,cardUserAttribute:n.cardUserAttribute,cardDateAttribute:n.cardDateAttribute,kanbanColumnOrder:n.kanbanColumnOrder,kanbanColumnVisibility:n.kanbanColumnVisibility,kanbanPinnedColumns:n.kanbanPinnedColumns}:{...o,layout:n.layout,columnSizing:n.columnSizing}})};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"list",config:r,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(pn,"ListViewBuilder");var Xr=pn,ut=class ut{constructor(t,r,n){this.view=t,this.tabData={id:r,label:n,visibility:"all",layout:"table",columns:[]};}icon(t){return this.tabData.icon=t,this}default(){return this.tabData.default=true,this}visibility(t){return this.tabData.visibility=t,this}table(){return this.tabData.layout="table",this}list(){return this.tabData.layout="list",this}descriptionAttribute(t){return this.tabData.descriptionAttribute=t,this}displayAttributes(...t){return this.tabData.displayAttributes=t,this}kanban(t){return this.tabData.layout="kanban",this.tabData.groupByAttribute=t,this}cardUserAttribute(t){return this.tabData.cardUserAttribute=t,this}cardDateAttribute(t){return this.tabData.cardDateAttribute=t,this}kanbanColumnOrder(t){return this.tabData.kanbanColumnOrder=t,this}kanbanColumnVisibility(t){return this.tabData.kanbanColumnVisibility=t,this}kanbanPinnedColumns(t){return this.tabData.kanbanPinnedColumns=t,this}createMode(t){return this.tabData.createMode=t,this}columns(...t){return this.tabData.columns=t,this}columnWidth(t,r){return this.tabData.columnSizing||(this.tabData.columnSizing={}),this.tabData.columnSizing[t]=r,this}filter(t){let r=it(t);if(r){let n=`Tab filters cannot target "${r}". Use .visibility("private")`;throw new chunk72TQRSNX_js.h(n,[{path:["filters"],message:n}])}return this.tabData.filters=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}sorts(t){return this.tabData.sorts=t,this}tab(t,r){return this.view._addTab(this.tabData),new ut(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(ut,"ListViewTabConfigBuilder");var Zr=ut;function G(e,t){return new Xr(e,t)}chunkDPD6ZWL2_js.a(G,"listView");function CA(e,t){return new ot(e,t)}chunkDPD6ZWL2_js.a(CA,"group");function Tu(e){if(!/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z]$/.test(e))throw new Error(`Invalid flag name "${e}". Flag names must be kebab-case (e.g., "architect-mode", "ai-features").`)}chunkDPD6ZWL2_js.a(Tu,"validateFlagName");var yn=class yn{constructor(t,r,n){Tu(t),this.flag={name:t,valueType:r,defaultValue:n,allowedLevels:["global","tenant","user"]};}label(t){return this.flag.label=t,this}description(t){return this.flag.description=t,this}category(t){return this.flag.category=t,this}system(){return this.flag.system=true,this}tenantScoped(){return this.flag.allowedLevels=["global","tenant"],this}globalOnly(){return this.flag.allowedLevels=["global"],this}allowedLevels(t){return this.flag.allowedLevels=[...t],this}build(){if(!this.flag.label?.trim())throw new Error(`Flag "${this.flag.name}" must have a label. Use .label("Human-readable label").`);return {...this.flag,allowedLevels:[...this.flag.allowedLevels||[]]}}};chunkDPD6ZWL2_js.a(yn,"BaseFlagBuilder");var Te=yn,hn=class hn extends Te{constructor(t){super(t,"boolean",false);}defaultValue(t){return this.flag.defaultValue=t,this}enabledByDefault(){return this.flag.defaultValue=true,this}};chunkDPD6ZWL2_js.a(hn,"BooleanFlagBuilder");var mn=hn,An=class An extends Te{constructor(t){super(t,"string","");}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(An,"StringFlagBuilder");var fn=An,Tn=class Tn extends Te{constructor(t){super(t,"number",0);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(Tn,"NumberFlagBuilder");var bn=Tn,wn=class wn extends Te{constructor(t,r){super(t,"json",r);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(wn,"JsonFlagBuilder");var gn=wn;function wu(e){return new mn(e)}chunkDPD6ZWL2_js.a(wu,"booleanFlag");function xu(e){return new fn(e)}chunkDPD6ZWL2_js.a(xu,"stringFlag");function Iu(e){return new bn(e)}chunkDPD6ZWL2_js.a(Iu,"numberFlag");function Su(e,t){return new gn(e,t)}chunkDPD6ZWL2_js.a(Su,"jsonFlag");function xn(e){return new chunk72TQRSNX_js.r("feature flag",e,`Flag "${e}" is already registered. Each flag name must be unique.`)}chunkDPD6ZWL2_js.a(xn,"duplicateFlagError");function In(e){return {...e,allowedLevels:[...e.allowedLevels]}}chunkDPD6ZWL2_js.a(In,"cloneFlagDefinition");var Sn=class Sn{constructor(){this.flags=new Map;}register(t){if(this.flags.has(t.name))throw xn(t.name);this.flags.set(t.name,In(t));}registerAll(t){let r=new Set;for(let n of t){if(this.flags.has(n.name)||r.has(n.name))throw xn(n.name);r.add(n.name);}for(let n of t)this.register(n);}get(t){let r=this.flags.get(t);return r?In(r):void 0}getOrThrow(t){let r=this.get(t);if(!r)throw new chunk72TQRSNX_js.c("Feature flag",t,void 0,`Flag "${t}" is not registered. Available flags: ${this.listNames().join(", ")}`);return r}has(t){return this.flags.has(t)}list(){return Array.from(this.flags.values(),In)}listNames(){return Array.from(this.flags.keys())}unregister(t){return this.flags.delete(t)}clear(){this.flags.clear();}get size(){return this.flags.size}};chunkDPD6ZWL2_js.a(Sn,"FlagRegistry");var Ne=Sn,vu=new Ne;function Ru(){return new Ne}chunkDPD6ZWL2_js.a(Ru,"createFlagRegistry");function lt(){return {global:new Map,tenant:new Map,user:new Map}}chunkDPD6ZWL2_js.a(lt,"emptyOverrides");function Eu(e,t){return e.expiresAt===void 0||e.expiresAt.getTime()>t}chunkDPD6ZWL2_js.a(Eu,"isActiveOverride");function vn(e,t){let r=new Map;for(let n of e){if(!Eu(n,t))continue;let o=n.flagName;r.has(o)||r.set(o,n);}return r}chunkDPD6ZWL2_js.a(vn,"indexOverrides");var Rn=class Rn{constructor(t){this.repository=t.repository,this.registry=t.registry,this.staticDefaults=new Map(t.staticDefaults?.map(r=>[r.name,r.value])??[]);}async resolveAll(t={}){let r=this.collectFlagNames(),n=this.repository&&r.size>0?await this.getAllOverrides(t,[...r]):lt();return this.resolveNames(r,n,t)}resolveAllStatic(){return this.resolveNames(this.collectFlagNames(),lt(),{})}collectFlagNames(){let t=new Set;for(let r of this.registry.listNames())t.add(r);for(let r of this.staticDefaults.keys())t.add(r);return t}resolveNames(t,r,n){let o=new Map;for(let a of t)o.set(a,this.resolveValue(a,r,n));return o}async resolve(t,r={}){let n=this.repository?await this.getAllOverrides(r,[t]):lt();return this.resolveWithSource(t,n,r)}async isEnabled(t,r={}){return (await this.resolve(t,r)).value===true}async getValue(t,r={}){return (await this.resolve(t,r)).value}async setOverride(t,r,n,o={}){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);let a=this.registry.get(t);if(a&&!a.allowedLevels.includes(r)){let s=`Flag "${t}" does not allow ${r}-level overrides. Allowed levels: ${a.allowedLevels.join(", ")}`;throw new chunk72TQRSNX_js.h(s,[{path:["level"],message:s}])}if(a?.system){let s=`Flag "${t}" is a system flag and cannot be overridden via API.`;throw new chunk72TQRSNX_js.h(s,[{path:["flagName"],message:s}])}await this.repository.setOverride({flagName:t,level:r,value:n,targetId:o.targetId,expiresAt:o.expiresAt,createdBy:o.createdBy});}async deleteOverride(t,r,n){if(!this.repository)throw new chunk72TQRSNX_js.b("Cannot delete override: no FeatureFlagsRepository configured.",chunk72TQRSNX_js.a.CONFIGURATION_REQUIRED);await this.repository.deleteOverride(t,r,n);}async getAllOverrides(t,r){if(!this.repository)return lt();let[n,o,a]=await Promise.all([this.repository.getOverrides({level:"global",flagNames:r}),t.tenantId?this.repository.getOverrides({level:"tenant",targetId:t.tenantId,flagNames:r}):Promise.resolve([]),t.userId?this.repository.getOverrides({level:"user",targetId:t.userId,flagNames:r}):Promise.resolve([])]),s=Date.now();return {global:vn(n,s),tenant:vn(o,s),user:vn(a,s)}}resolveValue(t,r,n){return this.resolveWithSource(t,r,n).value}resolveWithSource(t,r,n){let o=this.registry.get(t),a=o?.allowedLevels??["global","tenant","user"];if(n.userId&&a.includes("user")){let s=r.user.get(t);if(s)return {name:t,value:s.value,source:"user",sourceId:n.userId}}if(n.tenantId&&a.includes("tenant")){let s=r.tenant.get(t);if(s)return {name:t,value:s.value,source:"tenant",sourceId:n.tenantId}}if(a.includes("global")){let s=r.global.get(t);if(s)return {name:t,value:s.value,source:"global"}}return this.staticDefaults.has(t)?{name:t,value:this.staticDefaults.get(t),source:"default"}:{name:t,value:o?.defaultValue??void 0,source:"default"}}};chunkDPD6ZWL2_js.a(Rn,"FlagService");var dt=Rn;function Du(e){return new dt(e)}chunkDPD6ZWL2_js.a(Du,"createFlagService");function En(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(En,"cloneObjectDefinition");var Cn=class Cn{constructor(){this.objects=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){let o="build"in n&&typeof n.build=="function"?n.build():n;this.validateAndRegister(o);}return this}validateAndRegister(t){if(!t.system){let r=`[NativeObjectRegistry] Cannot register object "${t.name}" (id: ${t.id}): missing system flag.
|
|
14
|
-
Native objects must have system=true. Did you call .runtime() on the builder? Remove that call \u2014 objects are system:true by default.`;throw new
|
|
11
|
+
\u274C Invalid: 'first-name', 'first name', '123name', 'first.name'`);if(chunkVY5UBDTO_js.B.includes(e))throw new Error(`[AttributeBuilder] "${e}" is a reserved name and cannot be used as an attribute name.
|
|
12
|
+
Reserved names: ${chunkVY5UBDTO_js.B.join(", ")}`)}chunkDPD6ZWL2_js.a(Ne,"validateAttributeName");function Ao(e){if(!e||e.length===0)throw new Error("[AttributeBuilder] Attribute label cannot be empty");if(e.length>go)throw new Error(`[AttributeBuilder] Attribute label is too long (max ${go} characters)`)}chunkDPD6ZWL2_js.a(Ao,"validateLabel");function To(e,t){if(!xu.has(e))throw new Error(`[AttributeBuilder] Invalid icon "${e}" in ${t}.
|
|
13
|
+
Icon must be one of the predefined icons from @stndrds/constants.`)}chunkDPD6ZWL2_js.a(To,"validateIconName");function le(e,t){let r=new Set;for(let n of t){if(!n.value?.trim())throw new Error(`[AttributeBuilder] Option in "${e}" has an empty or missing value.`);if(!n.label?.trim())throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has an empty or missing label.`);if(r.has(n.value))throw new Error(`[AttributeBuilder] Duplicate option value "${n.value}" in "${e}".`);r.add(n.value);}for(let n of t){if(n.inverse===void 0)continue;let o=t.find(a=>a.value===n.inverse);if(!o)throw new Error(`[AttributeBuilder] Option "${n.value}" in "${e}" has inverse "${n.inverse}" which does not match any option value.`);if(o.inverse!==n.value)throw new Error(`[AttributeBuilder] Inverse mismatch in "${e}": "${n.value}" points to "${n.inverse}", but "${n.inverse}" points to "${o.inverse??"(none)"}". Inverse pairs must be symmetric.`)}}chunkDPD6ZWL2_js.a(le,"validateOptions");var wo={maxConcurrentRuns:3,retryPolicy:{maxRetries:3,backoffMs:1e3,backoffMultiplier:2},timeoutMs:3e5},rr=class rr{constructor(t){if(!t.name||t.name.trim().length===0)throw new chunkGZUTZAPU_js.h("Agent name is required",[]);this.bp={name:t.name,system:true,visibility:"workspace",triggers:[]};}description(t){return this.bp.description=t,this}label(t){return this.bp.label=t,this}icon(t){return this.bp.icon=t,this}systemPrompt(t){return this.bp.systemPrompt=t,this}model(t,r,n){return this.bp.model={provider:t,model:r,...n},this}tools(t){return this.bp.tools=[...t],this}schedule(t){return this.bp.schedule={...t,enabled:t.enabled??true},this}config(t){let r=this.bp.config??wo,n=t.inference===void 0?r.inference:{...r.inference,...t.inference};return this.bp.config={...r,...t,...n===void 0?{}:{inference:n}},this}delegation(t){return Object.assign(this.bp,t),this}mcpServers(t){return this.bp.mcpServers=Array.isArray(t)?[...t]:t,this}approval(t){return this.bp.approval={...zi,...this.bp.approval,...t},this}visibility(t){return this.bp.visibility=t,this}requiresPermission(t,r){return this.bp.requiredPermission={resource:t,action:r},this}trigger(t,r,n){return this.bp.triggers.push({name:t,eventType:r,...n,enabled:n?.enabled??true}),this}runtime(){return this.bp.system=false,this}build(){if(!this.bp.systemPrompt)throw new chunkGZUTZAPU_js.h(`Agent "${this.bp.name}": systemPrompt is required`,[]);if(!this.bp.model)throw new chunkGZUTZAPU_js.h(`Agent "${this.bp.name}": model is required`,[]);if(this.bp.system&&this.bp.visibility==="private")throw new chunkGZUTZAPU_js.h(`Agent "${this.bp.name}": system agents must use workspace visibility`,[]);return ue(this.bp.triggers,t=>t.name,t=>new chunkGZUTZAPU_js.h(`Agent "${this.bp.name}": duplicate trigger name "${t}"`,[])),{...this.bp,visibility:this.bp.visibility??"workspace",config:this.bp.config??wo,systemPrompt:this.bp.systemPrompt,model:this.bp.model}}};chunkDPD6ZWL2_js.a(rr,"AgentBuilder");var tr=rr;function Jh(e){return new tr(e)}chunkDPD6ZWL2_js.a(Jh,"agent");var Su="@stndrds/schema";function it(e){return {version:1,vendor:Su,validate:chunkDPD6ZWL2_js.a(t=>{let r=e.safeParse(t);return r.success?{value:r.data}:{issues:r.error.issues.map(n=>({message:n.message,path:n.path}))}},"validate")}}chunkDPD6ZWL2_js.a(it,"createStandardSchemaProps");function eA(e){return typeof e=="object"&&e!==null&&"~standard"in e&&typeof e["~standard"]=="object"&&e["~standard"].version===1}chunkDPD6ZWL2_js.a(eA,"isStandardSchema");var Tr=class Tr{get"~standard"(){let t=chunkC4LR6U4E_js.c(this.build());return it(t)}constructor(t,r,n){Ne(r),Ao(n),this.attr={name:r,label:n,type:t,required:false,system:true};}setRequired(t){this.attr.required=t;}asRequiredState(){return this}asPhantomState(){return this}runtime(){return this.attr.system=false,this}hidden(){return this.attr.hidden=true,this}placeholder(t){return this.attr.placeholder=t,this}description(t){return this.attr.description=t,this}icon(t){return To(t,`attribute "${this.attr.name}"`),this.attr.icon=t,this}order(t){return this.attr.order=t,this}defaultValue(t){return ("defaultValue"in this.attr||!["formula","rollup"].includes(this.attr.type))&&(this.attr.defaultValue=t),this}metadata(t){return this.attr.metadata=t,this}build(){return this.attr}};chunkDPD6ZWL2_js.a(Tr,"BaseAttributeBuilder");var R=Tr,wr=class wr extends R{constructor(t,r){super("text",t,r);}minLength(t){return this.attr.minLength=t,this}maxLength(t){return this.attr.maxLength=t,this}pattern(t){return this.attr.pattern=t,this.attr.format=void 0,this}multiline(t=true){return this.attr.multiline=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}email(){return this.attr.format="email",this.attr.pattern=void 0,this}url(){return this.attr.format="url",this.attr.pattern=void 0,this}slug(){return this.attr.format="slug",this.attr.pattern=void 0,this}};chunkDPD6ZWL2_js.a(wr,"TextAttributeBuilder");var nr=wr;function f(e){return new nr(e.name,e.label)}chunkDPD6ZWL2_js.a(f,"text");var xr=class xr extends R{constructor(t,r){super("richtext",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(xr,"RichtextAttributeBuilder");var ir=xr;function Ae(e){return new ir(e.name,e.label)}chunkDPD6ZWL2_js.a(Ae,"richtext");var Ir=class Ir extends R{constructor(t,r){super("number",t,r);}min(t){return this.attr.min=t,this}max(t){return this.attr.max=t,this}integer(){return this.attr.unit="integer",this.attr.decimals=0,this}decimal(t=2){return this.attr.unit="decimal",this.attr.decimals=t,this}percentage(){return this.attr.unit="percentage",this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Ir,"NumberAttributeBuilder");var or=Ir;function at(e){return new or(e.name,e.label)}chunkDPD6ZWL2_js.a(at,"number");var Sr=class Sr extends R{constructor(t,r){super("checkbox",t,r);}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Sr,"CheckboxAttributeBuilder");var ar=Sr;function xo(e){return new ar(e.name,e.label)}chunkDPD6ZWL2_js.a(xo,"checkbox");var vr=class vr extends R{constructor(t,r){super("date",t,r);}format(t){return this.attr.dateFormat=t,this}minDate(t){return this.attr.minDate=t,this}maxDate(t){return this.attr.maxDate=t,this}endDate(){return this.attr.endDate=true,this.asPhantomState()}includeTime(){return this.attr.includeTime=true,this}timeFormat(t){return this.attr.timeFormat=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(vr,"DateAttributeBuilder");var sr=vr;function U(e){return new sr(e.name,e.label)}chunkDPD6ZWL2_js.a(U,"date");var Rr=class Rr extends R{constructor(t,r){super("phone",t,r);}defaultCountry(t){return this.attr.defaultCountryCode=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Rr,"PhoneAttributeBuilder");var ur=Rr;function lA(e){return new ur(e.name,e.label)}chunkDPD6ZWL2_js.a(lA,"phone");var Er=class Er extends R{constructor(t,r){super("currency",t,r);}defaultCurrency(t){return this.attr.defaultCurrency=t,this}allowedCurrencies(t){return this.attr.allowedCurrencies=t,this}allowNegative(t=true){return this.attr.allowNegative=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Er,"CurrencyAttributeBuilder");var lr=Er;function dA(e){return new lr(e.name,e.label)}chunkDPD6ZWL2_js.a(dA,"currency");var Dr=class Dr extends R{constructor(t,r){super("status",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Dr,"StatusAttributeBuilder");var dr=Dr;function cA(e){return new dr(e.name,e.label)}chunkDPD6ZWL2_js.a(cA,"status");var Cr=class Cr extends R{constructor(t,r){super("select",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Cr,"SelectAttributeBuilder");var cr=Cr;function q(e){return new cr(e.name,e.label)}chunkDPD6ZWL2_js.a(q,"select");var Nr=class Nr extends R{constructor(t,r){super("multiselect",t,r);}options(t){let r=t;return le(this.attr.name??"unknown",r),this.attr.options=r,this.asPhantomState()}option(t){this.attr.options||(this.attr.options=[]);let r=[...this.attr.options,t];return le(this.attr.name??"unknown",r),this.attr.options.push(t),this}renderAs(t){return this.attr.renderAs=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Nr,"MultiselectAttributeBuilder");var pr=Nr;function pA(e){return new pr(e.name,e.label)}chunkDPD6ZWL2_js.a(pA,"multiselect");var Or=class Or extends R{constructor(t,r){super("location",t,r);}granularity(t){return this.attr.granularity=t,this}defaultCountry(t){return this.attr.defaultCountry=t,this}allowedCountries(t){return this.attr.allowedCountries=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Or,"LocationAttributeBuilder");var mr=Or;function mA(e){return new mr(e.name,e.label)}chunkDPD6ZWL2_js.a(mA,"location");var kr=class kr extends R{constructor(t,r){super("user",t,r),this.attr.types=["user","agent"];}types(t){let r=[...new Set(t)];if(r.length===0)throw new Error("[AttributeBuilder] user.types must contain at least one type.");return this.attr.types=r,this}multiple(){return this.attr.multiple=true,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(kr,"UserAttributeBuilder");var fr=kr;function fA(e){return new fr(e.name,e.label)}chunkDPD6ZWL2_js.a(fA,"user");var _r=class _r extends R{to(t,r){let n={object:t,...r};return this.attr.targets?.push(n),this}toAny(){return this.attr.targets=[{object:He}],this}qualifyWith(...t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.qualifyWith() must be called AFTER .to(). Example: relation({ name: "companies" }).to("companies").qualifyWith(...)');return this.attr.properties=Xe(t),this}bilateral(t){let r=this.attr.targets;if(!r||r.length===0)throw new Error('.bilateral() must be called AFTER .to(). Example: relation({ name: "company" }).to("companies").bilateral({ ... })');if(r.length>1)throw new Error("Bilateral relations are not supported for polymorphic relations (multiple .to() targets).");if(qi(this.attr))throw new Error("Bilateral relations are not supported for universal relations (.toAny()).");return this.attr.bilateral=t,this}};chunkDPD6ZWL2_js.a(_r,"BaseRelationAttributeBuilder");var ot=_r,Pr=class Pr extends ot{constructor(t,r){super("relation",t,r),this.attr.cardinality="one",this.attr.targets=[];}many(){let t=new gr(this.attr.name,this.attr.label??"",{targets:this.attr.targets,isRequired:this.attr.required});return this.attr.system===false&&t.runtime(),this.attr.hidden&&t.hidden(),this.attr.placeholder&&t.placeholder(this.attr.placeholder),this.attr.description&&t.description(this.attr.description),this.attr.icon&&t.icon(this.attr.icon),this.attr.order!==void 0&&t.order(this.attr.order),this.attr.metadata&&t.metadata(this.attr.metadata),t}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Pr,"SingleRelationAttributeBuilder");var br=Pr,Fr=class Fr extends ot{constructor(t,r,n){super("relation",t,r),this.attr.cardinality="many",this.attr.targets=n?.targets??[],this.attr.defaultValue=[],n?.isRequired&&this.setRequired(true);}maxItems(t){return this.attr.maxItems=t,this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Fr,"MultiRelationAttributeBuilder");var gr=Fr;function Te(e){return new br(e.name,e.label)}chunkDPD6ZWL2_js.a(Te,"relation");var Vr=class Vr extends R{constructor(t,r){super("formula",t,r),this.attr.required=false;}expression(t){return this.attr.expression=t,this}returns(t){return this.attr.returnType=t,this}decimals(t){return this.attr.decimals=t,this}required(){throw new Error("Formula attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(Vr,"FormulaAttributeBuilder");var yr=Vr;function bA(e){return new yr(e.name,e.label)}chunkDPD6ZWL2_js.a(bA,"formula");var jr=class jr extends R{constructor(t,r){super("rollup",t,r),this.attr.required=false;}from(t){return this.attr.relationAttribute=t,this}aggregate(t){return this.attr.targetAttribute=t,this}using(t){return this.attr.function=t,this}decimals(t){return this.attr.decimals=t,this}path(t){return this.attr.relationPath=t,this}targetType(t){return this.attr.targetAttributeType=t,this}targetOptions(t){return this.attr.targetAttributeOptions=t,this}targetCurrency(t){return this.attr.targetCurrencyCode=t,this}build(){let t=this.attr.function,r=this.attr.targetAttributeType;if(t==="original"&&r!==void 0&&r!=="select"&&r!=="status"&&r!=="multiselect"){let n=this.attr.relationAttribute??"relation",o=this.attr.targetAttribute??"field";throw new chunkGZUTZAPU_js.b(`Rollup "${this.attr.name}": .using("original") only supports a "select", "status", or "multiselect" target, but .targetType("${r}") was given. To surface a plain ${r} value from a related record, use a formula instead \u2014 e.g. formula({ name: "${this.attr.name}", label: "\u2026" }).expression("${n}.${o}").`,chunkGZUTZAPU_js.a.VALIDATION_FAILED)}return super.build()}required(){throw new Error("Rollup attributes cannot be required: they are computed read-only values. Remove .required() from this attribute definition.")}optional(){return this}};chunkDPD6ZWL2_js.a(jr,"RollupAttributeBuilder");var hr=jr;function gA(e){return new hr(e.name,e.label)}chunkDPD6ZWL2_js.a(gA,"rollup");var Mr=class Mr extends R{constructor(t,r){super("document",t,r);}accepts(t){return this.attr.accepts=t,this}maxFileSize(t){return this.attr.maxFileSize=t,this}qualifyWith(...t){return this.attr.properties=Xe(t),this}required(){return this.setRequired(true),this.asRequiredState()}optional(){return this.setRequired(false),this.asRequiredState()}};chunkDPD6ZWL2_js.a(Mr,"DocumentAttributeBuilder");var Ar=Mr;function Io(e){return new Ar(e.name,e.label)}chunkDPD6ZWL2_js.a(Io,"document");function vo(e,t,r){let n=Array.isArray(e)?e:[e],[o,...a]=n;return {type:"slot",slotId:o,additionalSlotIds:a.length>0?a:void 0,attribute:t,label:r?.label,required:r?.required,tooltip:r?.tooltip}}chunkDPD6ZWL2_js.a(vo,"buildSlotFieldRef");var $r=class $r{constructor(t,r,n){this._finalized=false;this.stepBuilder=t,this.rowData={id:r,order:n,type:"fields",fields:[]};}field(t,r,n){return this.rowData.fields.push(vo(t,r,n)),this}freeField(t,r){let o={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression};return this.rowData.fields.push(o),this}row(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).row(t)}heading(t,r){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).heading(t,r)}separator(){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).separator()}text(t){return this._finalized=true,this.stepBuilder._finalizeRow(this.rowData).text(t)}endRow(){return this._finalized?this.stepBuilder:(this._finalized=true,this.stepBuilder._finalizeRow(this.rowData))}};chunkDPD6ZWL2_js.a($r,"FormRowBuilder");var Lr=$r,qr=class qr{constructor(t,r,n){this.rowOrder=0;this.formBuilder=t,this.stepData={id:r,label:n,rows:[]};}description(t){return this.stepData.description=t,this}field(t,r,n){this.rowOrder++;let o=`row-${this.stepData.id}-${this.rowOrder}`,a=vo(t,r,n),s={id:o,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}freeField(t,r){this.rowOrder++;let n=`row-${this.stepData.id}-${this.rowOrder}`,a={type:"free",attribute:t.build(),label:r?.label,required:r?.required,prefillExpression:r?.prefillExpression},s={id:n,order:this.rowOrder,type:"fields",fields:[a]};return this.stepData.rows.push(s),this}row(t){return this.rowOrder++,new Lr(this,t,this.rowOrder)}heading(t,r){this.rowOrder++;let n={id:`heading-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"heading",content:t,level:r};return this.stepData.rows.push(n),this}separator(){this.rowOrder++;let t={id:`sep-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"separator"};return this.stepData.rows.push(t),this}text(t){this.rowOrder++;let r={id:`text-${this.stepData.id}-${this.rowOrder}`,order:this.rowOrder,type:"text",content:t};return this.stepData.rows.push(r),this}step(t,r){return this.formBuilder._finalizeStep(this.stepData).step(t,r)}build(){return this.formBuilder._finalizeStep(this.stepData).build()}_finalizeRow(t){return t.fields.length>0&&this.stepData.rows.push(t),this}_getData(){return this.stepData}};chunkDPD6ZWL2_js.a(qr,"FormStepBuilder");var Br=qr,zr=class zr{constructor(t,r){this.data={slots:[],steps:[],status:"draft",version:1};this.validateName(t),this.data.name=t,this.data.label=r;}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}status(t){return this.data.status=t,this}metadata(t){return this.data.metadata=t,this}slot(t,r,n){if(this.data.slots.some(a=>a.id===t))throw new Error(`[FormBuilder] Duplicate slot id: "${t}"`);let o={id:t,objectName:r,label:n.label,mode:n.mode??"create",color:n.color,icon:n.icon};return this.data.slots.push(o),this}step(t,r){if(this.data.steps.some(n=>n.id===t))throw new Error(`[FormBuilder] Duplicate step id: "${t}"`);return new Br(this,t,r)}build(){return this.validateRequiredData(),this.validateSlotReferences(),this.validateFreeFields(),this.validatePrefillExpressions(),this.data}_finalizeStep(t){return this.data.steps.push(t),this}validateName(t){let r=er.z.string().min(1,"Form name cannot be empty").max(63,"Form name is too long (max 63 characters)").regex(/^[a-z0-9]+(-[a-z0-9]+)*$/,{message:"Invalid form name format. Name must be in kebab-case: 'client-onboarding', 'contact-creation'"});try{r.parse(t);}catch(n){throw n instanceof er.z.ZodError?new Error(`[FormBuilder] ${n.issues[0].message}`):n}}validateRequiredData(){if(this.data.slots.length===0)throw new Error("[FormBuilder] At least one slot is required. Use .slot() to add slots.");if(this.data.steps.length===0)throw new Error("[FormBuilder] At least one step is required. Use .step() to add steps.")}validateSlotReferences(){let t=new Map(this.data.slots.map(r=>[r.id,r.objectName]));for(let r of this.data.steps)for(let n of r.rows)if(Qe(n))for(let o of n.fields){if(o.type!=="slot")continue;let a=Xi(o);for(let l of a)if(!t.has(l))throw new Error(`[FormBuilder] Step "${r.id}" references unknown slot "${l}". Declare it with .slot("${l}", ...) first.`);let s=new Set(a.map(l=>t.get(l)));if(s.size>1)throw new Error(`[FormBuilder] Step "${r.id}" field on attribute "${o.attribute}" targets slots of different objects (${[...s].join(", ")}). A multi-slot field must target slots of the same object.`)}}validatePrefillExpressions(){let t=[...et,"join"];for(let r of this.data.steps)for(let n of r.rows)if(Qe(n))for(let o of n.fields){if(!Yt(o)||!o.prefillExpression)continue;let a=o.prefillExpression,s=`prefillExpression on free field "${o.attribute.name}" in step "${r.id}"`;if(!tt(a))throw new Error(`[FormBuilder] ${s} must contain at least one {{ attribute }} interpolation.`);if(/\{\{\s*\}\}/.test(a))throw new Error(`[FormBuilder] ${s} contains empty {{ }} interpolation.`);for(let l of a.matchAll(/(?<!\|)\|(?!\|)\s*(\w+)(?::[^|}]*)?/g)){let p=l[1];if(!t.includes(p))throw new Error(`[FormBuilder] ${s} uses invalid pipe "${p}". Valid pipes: ${t.join(", ")}`)}}}validateFreeFields(){let t=new Set(Kt);for(let r of this.data.steps)for(let n of r.rows)if(Qe(n)){for(let o of n.fields)if(Yt(o)){let a=o.attribute.type;if(t.has(a))throw new Error(`[FormBuilder] Free field in step "${r.id}" uses forbidden attribute type "${a}". Forbidden types: ${Kt.join(", ")}`)}}}};chunkDPD6ZWL2_js.a(zr,"FormBuilder");var Ur=zr;function IA(e,t){return new Ur(e,t)}chunkDPD6ZWL2_js.a(IA,"form");function vu(e){return {text:"toString",richtext:"toString",number:"toNumber",currency:"toNumber",date:"toDate",checkbox:"toBoolean"}[e]}chunkDPD6ZWL2_js.a(vu,"resolveBuiltInTransform");var Gr=class Gr{constructor(t){this.operations=[];this.touchedAttributes=new Set;this.version=t;}assertNotTouched(t,r){if(this.touchedAttributes.has(t))throw new Error(`[MigrationBuilder] Conflicting operations on attribute "${t}": it was already modified earlier in this migration (attempted: ${r}).`)}renameAttribute(t,r){return this.assertNotTouched(t,"rename_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"rename_attribute",from:t,to:r}),this}changeType(t,r,n,o){this.assertNotTouched(t,"change_type"),this.touchedAttributes.add(t);let a=o?.transform?vu(n):void 0;return this.operations.push({type:"change_type",name:t,from:r,to:n,transform:a}),this}removeAttribute(t){return this.assertNotTouched(t,"remove_attribute"),this.touchedAttributes.add(t),this.operations.push({type:"remove_attribute",name:t,backup_config:{}}),this}addAttribute(t){return this.assertNotTouched(t.name,"add_attribute"),this.touchedAttributes.add(t.name),this.operations.push({type:"add_attribute",attribute:t}),this}updateConfig(t,r){return this.assertNotTouched(t,"update_config"),this.touchedAttributes.add(t),this.operations.push({type:"update_config",name:t,from:{},to:r}),this}build(){return {version:this.version,operations:[...this.operations]}}};chunkDPD6ZWL2_js.a(Gr,"MigrationBuilder");var st=Gr;function Ru(e){let{name:t,labelExpression:r,embeddingExpression:n}=e;if(!r)throw new chunkGZUTZAPU_js.b(`Object "${t}" must have a labelExpression. The labelExpression defines how records are displayed in lists and relations (e.g. "{{ name }}").`,chunkGZUTZAPU_js.a.VALIDATION_FAILED);let o=ge.safeParse(r);if(!o.success){let a=o.error.issues[0]?.message??"Invalid labelExpression";throw new chunkGZUTZAPU_js.b(`Invalid labelExpression for "${t}": ${a}`,chunkGZUTZAPU_js.a.VALIDATION_FAILED)}if(n!==void 0){let a=ge.safeParse(n);if(!a.success){let s=a.error.issues[0]?.message??"Invalid embeddingExpression";throw new chunkGZUTZAPU_js.b(`Invalid embeddingExpression for "${t}": ${s}`,chunkGZUTZAPU_js.a.VALIDATION_FAILED)}}}chunkDPD6ZWL2_js.a(Ru,"validateObjectExpressions");var Wr=class Wr{constructor(t){this._migrations=[];this._sealed=false;this._toleratedAttributes=[];this.validateName(t.name),this.obj={name:t.name,label:t.label,attributes:[],system:true},t.id&&(this.obj.id=t.id);}get"~standard"(){let t=chunkC4LR6U4E_js.e(this.build());return it(t)}description(t){return this.obj.description=t,this}pluralLabel(t){return this._pluralLabel=t,this}icon(t){return this.obj.icon=t,this}runtime(){return this.obj.system=false,this}sealed(){return this._sealed=true,this}tolerate(t){return this._toleratedAttributes=[...this._toleratedAttributes,...t],this}attribute(t){return this.pushAttributes([t]),this}attributes(t){return this.pushAttributes(t),this}pushAttributes(t){let r=t.map(n=>"build"in n&&typeof n.build=="function"?n.build():n);ue([...this.obj.attributes,...r],n=>n.name,n=>new chunkGZUTZAPU_js.r("attribute",n,`Object "${this.obj.name}": duplicate attribute name "${n}"`)),this.obj.attributes.push(...r);}metadata(t){return this.obj.metadata={...this.obj.metadata,...t},this}order(t){return this.obj.metadata={...this.obj.metadata,order:t},this}hidden(){return this.obj.metadata={...this.obj.metadata,hidden:true},this}labelExpression(t){return this._labelExpression=t,this}embeddingExpression(t){return this._embeddingExpression=t,this}documentLayout(t){if(t.presets)for(let r of t.presets)Ro(r.id,r.structure,1);return this.obj.documentLayout=t,this}migration(t,r){if(t<2)throw new Error(`[ObjectBuilder] Migration version must be >= 2 (version 1 is implicit). Got: ${t}`);if(this._migrations.some(a=>a.version===t))throw new Error(`[ObjectBuilder] Duplicate migration version: ${t}`);let o=new st(t);return r(o),this._migrations.push(o.build()),this}build(){if(!this.obj.name)throw new chunkGZUTZAPU_js.h("[ObjectBuilder] Missing required field: name",[{path:["name"],message:"name is required"}]);if(!this.obj.label)throw new chunkGZUTZAPU_js.h("[ObjectBuilder] Missing required field: label",[{path:["label"],message:"label is required"}]);Ru({name:this.obj.name,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression});let t=[...this._migrations].sort((n,o)=>n.version-o.version);for(let n=0;n<t.length;n++){let o=n+2;if(t[n].version!==o)throw new Error(`[ObjectBuilder] Migration versions must be sequential starting at 2. Expected version ${o}, got ${t[n].version}.`)}let r=t.length>0?t[t.length-1].version:1;return {...this.obj,pluralLabel:this._pluralLabel,labelExpression:this._labelExpression,embeddingExpression:this._embeddingExpression,schema_version:r,migrations:t,sealed:this._sealed,toleratedAttributes:this._toleratedAttributes}}validateName(t){t!==void 0&&Ce(t);}};chunkDPD6ZWL2_js.a(Wr,"ObjectBuilder");var Oe=Wr;function FA(e){if(chunkVY5UBDTO_js.w(e.name))throw new chunkGZUTZAPU_js.s(e.name,"builder");return new Oe(e)}chunkDPD6ZWL2_js.a(FA,"object");function Ro(e,t,r){let n=chunkDPD6ZWL2_js.a((a,s)=>{throw new chunkGZUTZAPU_js.h(a,[{path:["documentLayout","presets",e],message:s}])},"fail");r>5&&n(`Preset structure exceeds max depth of ${5}`,"Preset structure too deep");let o=new Set;for(let a of t){let s=a.title.trim();s.length===0&&n("Folder preset node title is required","Empty folder title"),s.includes("/")&&n("Folder preset node title cannot contain /",`Folder title contains /: "${s}"`),o.has(s)&&n("Folder preset sibling titles must be unique",`Duplicate folder title: "${s}"`),o.add(s),a.children&&a.children.length>0&&Ro(e,a.children,r+1);}}chunkDPD6ZWL2_js.a(Ro,"validatePresetStructure");var rn=class rn{constructor(t,r){this.data={type:"fields",fields:[]};this.data.id=t,this.data.label=r;}description(t){return this.data.description=t,this}collapsible(t=false){return this.data.collapsible=true,this.data.collapsed=t,this}order(t){return this.data.order=t,this}fields(...t){for(let r of t)this.data.fields?.push({attribute:r});return this}field(t,r){return this.data.fields?.push({attribute:t,...r}),this}attributeGroup(t,r){return this.data.fields?.push({attributeGroup:t,...r}),this}build(){if(!this.data.id)throw new Error("[GroupBuilder] id is required");if(!this.data.label)throw new Error("[GroupBuilder] label is required");if(!this.data.fields||this.data.fields.length===0)throw new Error("[GroupBuilder] At least one field is required");return this.data}};chunkDPD6ZWL2_js.a(rn,"GroupBuilder");var lt=rn,nn=class nn{constructor(t,r){this.view=t,this.tabData=r;}columns(...t){return this.tabData.columns=t,this}create(t){return this.tabData.allowCreate=true,t?.mode&&(this.tabData.createMode=t.mode),this}createMode(t){return this.tabData.createMode=t,this}edit(){return this.tabData.allowEdit=true,this}delete(){return this.tabData.allowDelete=true,this}crud(){return this.tabData.allowCreate=true,this.tabData.allowEdit=true,this.tabData.allowDelete=true,this}filters(t){return this.tabData.filters=t,this}sorts(t){return this.tabData.sorts=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}tab(t,r){return this.finalize(),new J(this.view,t,r)}done(){return this.finalize(),this.view}build(){return this.finalize(),this.view.build()}finalize(){if(!this.tabData.columns||this.tabData.columns.length===0)throw new Error(`[TableTabConfig] columns() is required for tab "${this.tabData.name}"`);this.view._addTab(this.tabData);}};chunkDPD6ZWL2_js.a(nn,"TableTabConfig");var dt=nn,on=class on{constructor(t,r,n){this.view=t,this.tabData={...r,type:"custom",component:n};}props(t){return this.tabData.props=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(on,"CustomTabConfig");var Kr=on,an=class an{constructor(t,r,n){this.view=t,this.tabData={...r,type:"richtext",attribute:n};}titleAttribute(t){return this.tabData.titleAttribute=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(an,"RichtextTabConfig");var Yr=an,sn=class sn{constructor(t,r){this.view=t,this.tabData={...r,type:"activity"};}limit(t){return this.tabData.limit=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(sn,"ActivityTabConfig");var Hr=sn,un=class un{constructor(t,r,n){this.view=t,this.tabData={...r,type:n,emailAttributeIds:[]};}emailAttributes(...t){return this.tabData.emailAttributeIds=t,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(un,"AddressMatchedTabConfig");var ct=un,ln=class ln extends ct{constructor(t,r){super(t,r,"emails");}};chunkDPD6ZWL2_js.a(ln,"EmailsTabConfig");var Qr=ln,dn=class dn extends ct{constructor(t,r){super(t,r,"meetings");}};chunkDPD6ZWL2_js.a(dn,"MeetingsTabConfig");var Jr=dn,cn=class cn{constructor(t,r){this.view=t,this.tabData={...r,type:"documents",allowUpload:true,allowRemove:true,hideAttachments:false};}disableUpload(){return this.tabData.allowUpload=false,this}disableRemove(){return this.tabData.allowRemove=false,this}hideAttachments(){return this.tabData.hideAttachments=true,this}tab(t,r){return this.view._addTab(this.tabData),new J(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(cn,"DocumentsTabConfig");var Xr=cn,pn=class pn{constructor(t,r,n){this.view=t,this.base={id:r,name:r,label:n};}icon(t){return this.base.icon=t,this}order(t){return this.base.order=t,this}form(...t){if(t.length===0)throw new Error(`[TabBuilder] form() requires at least one group for tab "${this.base.name}"`);let r={...this.base,type:"form",groups:t.map(n=>n instanceof lt?n.build():n)};return this.view._addTab(r)}table(t){return new dt(this.view,{...this.base,type:"table",source:{type:"relation",attribute:t},columns:[]})}tableFrom(t,r){return new dt(this.view,{...this.base,type:"table",source:{type:"inverse",object:t,attribute:r},columns:[]})}custom(t){return new Kr(this.view,this.base,t)}richtext(t){return new Yr(this.view,this.base,t)}activity(){return new Hr(this.view,this.base)}documents(){return new Xr(this.view,this.base)}emails(){return new Qr(this.view,this.base)}meetings(){return new Jr(this.view,this.base)}forms(t){let r={...this.base,type:"forms",...t};return this.view._addTab(r)}};chunkDPD6ZWL2_js.a(pn,"TabBuilder");var J=pn,mn=class mn{constructor(t,r){nt(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}sidePanel(t){return this.data.sidePanel=t,this}readOnly(){return this.data.readOnly=true,this}tab(t,r){return new J(this,t,r)}addTab(t){return this.data.tabs.push(t),this}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[DetailViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[DetailViewBuilder] At least one tab is required");ue(this.data.tabs,r=>r.name,r=>new Error(`[DetailViewBuilder] Duplicate tab name "${r}"`));let t={tabs:this.data.tabs,sidePanel:this.data.sidePanel,...this.data.readOnly?{readOnly:true}:{}};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"detail",config:t,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(mn,"DetailViewBuilder");var Zr=mn;function z(e,t){return new Zr(e,t)}chunkDPD6ZWL2_js.a(z,"detailView");function ut(e){if(Array.isArray(e))return e.map(ut).find(r=>r!==void 0);if(e===null||typeof e!="object")return;let t=e;return t.attribute==="visibility"||t.attribute==="ownedBy"?t.attribute:ut(t.rules)??ut(t.groups)}chunkDPD6ZWL2_js.a(ut,"findProtectedTabFilterAttribute");var fn=class fn{constructor(t,r){nt(t),this.data={name:t,label:r,tabs:[]};}description(t){return this.data.description=t,this}icon(t){return this.data.icon=t,this}for(t){return this.data.object=t,this}default(){return this.data.default=true,this}metadata(t){return this.data.metadata=t,this}baseFilter(t){return this.data.defaultFilters=t,this}allowPresentationCustomization(){return this.data.allowPresentationCustomization=true,this}tab(t,r){return new tn(this,t,r)}_addTab(t){return this.data.tabs.push(t),this}build(){if(!this.data.object)throw new Error("[ListViewBuilder] for() is required - specify the target object");if(this.data.tabs.length===0)throw new Error("[ListViewBuilder] At least one tab is required");if(ue(this.data.tabs,n=>n.id,n=>new Error(`[ListViewBuilder] Duplicate tab id "${n}"`)),this.data.tabs.filter(n=>n.default).length>1)throw new Error("[ListViewBuilder] Only one tab can be marked as default");for(let n of this.data.tabs){if(n.layout==="table"&&n.columns.length===0)throw new chunkGZUTZAPU_js.h(`[ListViewBuilder] Tab "${n.id}" must have at least one column`,[]);if(n.layout==="kanban"&&!n.groupByAttribute)throw new chunkGZUTZAPU_js.h(`[ListViewBuilder] Kanban tab "${n.id}" requires a groupByAttribute`,[]);if(n.descriptionAttribute!==void 0&&n.descriptionAttribute.length===0)throw new chunkGZUTZAPU_js.h(`[ListViewBuilder] Tab "${n.id}" requires a nonempty description attribute name`,[]);if(n.displayAttributes!==void 0){let o=chunkVY5UBDTO_js._.safeParse(n.displayAttributes);if(!o.success)throw new chunkGZUTZAPU_js.h(`[ListViewBuilder] Tab "${n.id}" has invalid display attributes`,o.error.issues.map(a=>({path:["tabs",n.id,"displayAttributes",...a.path.map(String)],message:a.message})))}}let r={allowPresentationCustomization:this.data.allowPresentationCustomization,defaultFilters:this.data.defaultFilters?{id:chunkZMDMQAV5_js.d(),combinator:this.data.defaultFilters.combinator,rules:this.data.defaultFilters.rules}:void 0,tabs:this.data.tabs.map(n=>{let o={id:n.id,label:n.label,icon:n.icon,default:n.default,visibility:n.visibility,columns:n.columns,descriptionAttribute:n.descriptionAttribute,displayAttributes:n.displayAttributes,filters:n.filters?{id:chunkZMDMQAV5_js.d(),combinator:n.filters.combinator,rules:n.filters.rules}:void 0,sorts:n.sorts,readOnly:n.readOnly,createMode:n.createMode};return n.layout==="kanban"?{...o,layout:"kanban",groupByAttribute:n.groupByAttribute,cardUserAttribute:n.cardUserAttribute,cardDateAttribute:n.cardDateAttribute,kanbanColumnOrder:n.kanbanColumnOrder,kanbanColumnVisibility:n.kanbanColumnVisibility,kanbanPinnedColumns:n.kanbanPinnedColumns}:{...o,layout:n.layout,columnSizing:n.columnSizing}})};return {name:this.data.name,label:this.data.label,description:this.data.description,icon:this.data.icon,object:this.data.object,type:"list",config:r,default:this.data.default,metadata:this.data.metadata}}};chunkDPD6ZWL2_js.a(fn,"ListViewBuilder");var en=fn,pt=class pt{constructor(t,r,n){this.view=t,this.tabData={id:r,label:n,visibility:"all",layout:"table",columns:[]};}icon(t){return this.tabData.icon=t,this}default(){return this.tabData.default=true,this}readOnly(){return this.tabData.readOnly=true,this}visibility(t){return this.tabData.visibility=t,this}table(){return this.tabData.layout="table",this}list(){return this.tabData.layout="list",this}descriptionAttribute(t){return this.tabData.descriptionAttribute=t,this}displayAttributes(...t){return this.tabData.displayAttributes=t,this}kanban(t){return this.tabData.layout="kanban",this.tabData.groupByAttribute=t,this}cardUserAttribute(t){return this.tabData.cardUserAttribute=t,this}cardDateAttribute(t){return this.tabData.cardDateAttribute=t,this}kanbanColumnOrder(t){return this.tabData.kanbanColumnOrder=t,this}kanbanColumnVisibility(t){return this.tabData.kanbanColumnVisibility=t,this}kanbanPinnedColumns(t){return this.tabData.kanbanPinnedColumns=t,this}createMode(t){return this.tabData.createMode=t,this}columns(...t){return this.tabData.columns=t,this}columnWidth(t,r){return this.tabData.columnSizing||(this.tabData.columnSizing={}),this.tabData.columnSizing[t]=r,this}filter(t){let r=ut(t);if(r){let n=`Tab filters cannot target "${r}". Use .visibility("private")`;throw new chunkGZUTZAPU_js.h(n,[{path:["filters"],message:n}])}return this.tabData.filters=t,this}sort(t,r="asc"){return this.tabData.sorts||(this.tabData.sorts=[]),this.tabData.sorts.push({attribute:t,direction:r}),this}sorts(t){return this.tabData.sorts=t,this}tab(t,r){return this.view._addTab(this.tabData),new pt(this.view,t,r)}done(){return this.view._addTab(this.tabData),this.view}build(){return this.view._addTab(this.tabData),this.view.build()}};chunkDPD6ZWL2_js.a(pt,"ListViewTabConfigBuilder");var tn=pt;function G(e,t){return new en(e,t)}chunkDPD6ZWL2_js.a(G,"listView");function $A(e,t){return new lt(e,t)}chunkDPD6ZWL2_js.a($A,"group");function Eu(e){if(!/^[a-z][a-z0-9-]*[a-z0-9]$|^[a-z]$/.test(e))throw new Error(`Invalid flag name "${e}". Flag names must be kebab-case (e.g., "architect-mode", "ai-features").`)}chunkDPD6ZWL2_js.a(Eu,"validateFlagName");var An=class An{constructor(t,r,n){Eu(t),this.flag={name:t,valueType:r,defaultValue:n,allowedLevels:["global","tenant","user"]};}label(t){return this.flag.label=t,this}description(t){return this.flag.description=t,this}category(t){return this.flag.category=t,this}system(){return this.flag.system=true,this}tenantScoped(){return this.flag.allowedLevels=["global","tenant"],this}globalOnly(){return this.flag.allowedLevels=["global"],this}allowedLevels(t){return this.flag.allowedLevels=[...t],this}build(){if(!this.flag.label?.trim())throw new Error(`Flag "${this.flag.name}" must have a label. Use .label("Human-readable label").`);return {...this.flag,allowedLevels:[...this.flag.allowedLevels||[]]}}};chunkDPD6ZWL2_js.a(An,"BaseFlagBuilder");var we=An,Tn=class Tn extends we{constructor(t){super(t,"boolean",false);}defaultValue(t){return this.flag.defaultValue=t,this}enabledByDefault(){return this.flag.defaultValue=true,this}};chunkDPD6ZWL2_js.a(Tn,"BooleanFlagBuilder");var bn=Tn,wn=class wn extends we{constructor(t){super(t,"string","");}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(wn,"StringFlagBuilder");var gn=wn,xn=class xn extends we{constructor(t){super(t,"number",0);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(xn,"NumberFlagBuilder");var yn=xn,In=class In extends we{constructor(t,r){super(t,"json",r);}defaultValue(t){return this.flag.defaultValue=t,this}};chunkDPD6ZWL2_js.a(In,"JsonFlagBuilder");var hn=In;function Du(e){return new bn(e)}chunkDPD6ZWL2_js.a(Du,"booleanFlag");function Cu(e){return new gn(e)}chunkDPD6ZWL2_js.a(Cu,"stringFlag");function Nu(e){return new yn(e)}chunkDPD6ZWL2_js.a(Nu,"numberFlag");function Ou(e,t){return new hn(e,t)}chunkDPD6ZWL2_js.a(Ou,"jsonFlag");function Sn(e){return new chunkGZUTZAPU_js.r("feature flag",e,`Flag "${e}" is already registered. Each flag name must be unique.`)}chunkDPD6ZWL2_js.a(Sn,"duplicateFlagError");function vn(e){return {...e,allowedLevels:[...e.allowedLevels]}}chunkDPD6ZWL2_js.a(vn,"cloneFlagDefinition");var Rn=class Rn{constructor(){this.flags=new Map;}register(t){if(this.flags.has(t.name))throw Sn(t.name);this.flags.set(t.name,vn(t));}registerAll(t){let r=new Set;for(let n of t){if(this.flags.has(n.name)||r.has(n.name))throw Sn(n.name);r.add(n.name);}for(let n of t)this.register(n);}get(t){let r=this.flags.get(t);return r?vn(r):void 0}getOrThrow(t){let r=this.get(t);if(!r)throw new chunkGZUTZAPU_js.c("Feature flag",t,void 0,`Flag "${t}" is not registered. Available flags: ${this.listNames().join(", ")}`);return r}has(t){return this.flags.has(t)}list(){return Array.from(this.flags.values(),vn)}listNames(){return Array.from(this.flags.keys())}unregister(t){return this.flags.delete(t)}clear(){this.flags.clear();}get size(){return this.flags.size}};chunkDPD6ZWL2_js.a(Rn,"FlagRegistry");var ke=Rn,ku=new ke;function _u(){return new ke}chunkDPD6ZWL2_js.a(_u,"createFlagRegistry");function mt(){return {global:new Map,tenant:new Map,user:new Map}}chunkDPD6ZWL2_js.a(mt,"emptyOverrides");function Pu(e,t){return e.expiresAt===void 0||e.expiresAt.getTime()>t}chunkDPD6ZWL2_js.a(Pu,"isActiveOverride");function En(e,t){let r=new Map;for(let n of e){if(!Pu(n,t))continue;let o=n.flagName;r.has(o)||r.set(o,n);}return r}chunkDPD6ZWL2_js.a(En,"indexOverrides");var Dn=class Dn{constructor(t){this.repository=t.repository,this.registry=t.registry,this.staticDefaults=new Map(t.staticDefaults?.map(r=>[r.name,r.value])??[]);}async resolveAll(t={}){let r=this.collectFlagNames(),n=this.repository&&r.size>0?await this.getAllOverrides(t,[...r]):mt();return this.resolveNames(r,n,t)}resolveAllStatic(){return this.resolveNames(this.collectFlagNames(),mt(),{})}collectFlagNames(){let t=new Set;for(let r of this.registry.listNames())t.add(r);for(let r of this.staticDefaults.keys())t.add(r);return t}resolveNames(t,r,n){let o=new Map;for(let a of t)o.set(a,this.resolveValue(a,r,n));return o}async resolve(t,r={}){let n=this.repository?await this.getAllOverrides(r,[t]):mt();return this.resolveWithSource(t,n,r)}async isEnabled(t,r={}){return (await this.resolve(t,r)).value===true}async getValue(t,r={}){return (await this.resolve(t,r)).value}async setOverride(t,r,n,o={}){if(!this.repository)throw new chunkGZUTZAPU_js.b("Cannot set override: no FeatureFlagsRepository configured. Add featureFlags to your DatabaseAdapter to enable runtime overrides.",chunkGZUTZAPU_js.a.CONFIGURATION_REQUIRED);let a=this.registry.get(t);if(a&&!a.allowedLevels.includes(r)){let s=`Flag "${t}" does not allow ${r}-level overrides. Allowed levels: ${a.allowedLevels.join(", ")}`;throw new chunkGZUTZAPU_js.h(s,[{path:["level"],message:s}])}if(a?.system){let s=`Flag "${t}" is a system flag and cannot be overridden via API.`;throw new chunkGZUTZAPU_js.h(s,[{path:["flagName"],message:s}])}await this.repository.setOverride({flagName:t,level:r,value:n,targetId:o.targetId,expiresAt:o.expiresAt,createdBy:o.createdBy});}async deleteOverride(t,r,n){if(!this.repository)throw new chunkGZUTZAPU_js.b("Cannot delete override: no FeatureFlagsRepository configured.",chunkGZUTZAPU_js.a.CONFIGURATION_REQUIRED);await this.repository.deleteOverride(t,r,n);}async getAllOverrides(t,r){if(!this.repository)return mt();let[n,o,a]=await Promise.all([this.repository.getOverrides({level:"global",flagNames:r}),t.tenantId?this.repository.getOverrides({level:"tenant",targetId:t.tenantId,flagNames:r}):Promise.resolve([]),t.userId?this.repository.getOverrides({level:"user",targetId:t.userId,flagNames:r}):Promise.resolve([])]),s=Date.now();return {global:En(n,s),tenant:En(o,s),user:En(a,s)}}resolveValue(t,r,n){return this.resolveWithSource(t,r,n).value}resolveWithSource(t,r,n){let o=this.registry.get(t),a=o?.allowedLevels??["global","tenant","user"];if(n.userId&&a.includes("user")){let s=r.user.get(t);if(s)return {name:t,value:s.value,source:"user",sourceId:n.userId}}if(n.tenantId&&a.includes("tenant")){let s=r.tenant.get(t);if(s)return {name:t,value:s.value,source:"tenant",sourceId:n.tenantId}}if(a.includes("global")){let s=r.global.get(t);if(s)return {name:t,value:s.value,source:"global"}}return this.staticDefaults.has(t)?{name:t,value:this.staticDefaults.get(t),source:"default"}:{name:t,value:o?.defaultValue??void 0,source:"default"}}};chunkDPD6ZWL2_js.a(Dn,"FlagService");var ft=Dn;function Fu(e){return new ft(e)}chunkDPD6ZWL2_js.a(Fu,"createFlagService");var Eo=Symbol("stndrds.native-object");function Nn(e){return Object.defineProperty(e,Eo,{value:true,enumerable:false}),e}chunkDPD6ZWL2_js.a(Nn,"markNativeDefinition");var kn=class kn extends Oe{build(){return Nn(super.build())}};chunkDPD6ZWL2_js.a(kn,"NativeObjectBuilder");var Cn=kn;function W(e){return new Cn(e)}chunkDPD6ZWL2_js.a(W,"nativeObject");function On(e){return e[Eo]===true}chunkDPD6ZWL2_js.a(On,"isNativeDefinition");function _n(e){let t=structuredClone(e);return On(e)?Nn(t):t}chunkDPD6ZWL2_js.a(_n,"cloneObjectDefinition");var Fn=class Fn{constructor(){this.objects=new Map;}register(t){let n=(Array.isArray(t)?t:[t]).map(a=>"build"in a&&typeof a.build=="function"?a.build():a),o=new Set;for(let a of n){if(this.validate(a),o.has(a.name))throw new chunkGZUTZAPU_js.r("object",a.name,`[NativeObjectRegistry] Duplicate object name "${a.name}" within a single register() batch.`);o.add(a.name);}for(let a of n)this.objects.set(a.name,_n(a));return this}validate(t){if(!t.system){let r=`[NativeObjectRegistry] Cannot register object "${t.name}" (id: ${t.id}): missing system flag.
|
|
14
|
+
Native objects must have system=true. Did you call .runtime() on the builder? Remove that call \u2014 objects are system:true by default.`;throw new chunkGZUTZAPU_js.h(r,[])}if(chunkVY5UBDTO_js.w(t.name)&&!On(t))throw new chunkGZUTZAPU_js.s(t.name,"registry");if(this.objects.has(t.name)){let r=this.objects.get(t.name),n=`[NativeObjectRegistry] Duplicate object name "${t.name}":
|
|
15
15
|
- Existing: "${r?.label}" (id: ${r?.id})
|
|
16
16
|
- New: "${t.label}" (id: ${t.id})
|
|
17
|
-
Please use unique names for each native object.`;throw new
|
|
18
|
-
Available objects: ${this.listNames().join(", ")}`;throw new
|
|
19
|
-
`)}debug(t){let r=this.summary();return t?.(r),r}};chunkDPD6ZWL2_js.a(
|
|
17
|
+
Please use unique names for each native object.`;throw new chunkGZUTZAPU_js.r("object",t.name,n)}}getByName(t){let r=this.objects.get(t);return r?_n(r):void 0}getByNameOrThrow(t){let r=this.getByName(t);if(!r){let n=`[NativeObjectRegistry] Native object "${t}" not found.
|
|
18
|
+
Available objects: ${this.listNames().join(", ")}`;throw new chunkGZUTZAPU_js.c("Native object",t,chunkGZUTZAPU_js.a.OBJECT_NOT_FOUND,n)}return r}getAll(){return Array.from(this.objects.values(),_n)}listNames(){return Array.from(this.objects.keys())}has(t){return this.objects.has(t)}get size(){return this.objects.size}clear(){this.objects.clear();}summary(){let t=this.getAll();return [`[NativeObjectRegistry] ${this.size} native object(s) registered:`,...t.map(r=>` - ${r.name}: "${r.label}" (${r.attributes.length} attributes)`)].join(`
|
|
19
|
+
`)}debug(t){let r=this.summary();return t?.(r),r}};chunkDPD6ZWL2_js.a(Fn,"NativeObjectRegistryClass");var Pn=Fn,gT=new Pn;function O(e){return {...e,system:true}}chunkDPD6ZWL2_js.a(O,"markSystemView");var Do=`## Overview
|
|
20
20
|
|
|
21
21
|
Describe in one or two sentences what this skill does and the outcome it produces. The agent reads this page when it uses the skill \u2014 write instructions for the agent, not documentation for people.
|
|
22
22
|
|
|
@@ -47,14 +47,14 @@ Show at least one concrete example of the skill applied well.
|
|
|
47
47
|
|
|
48
48
|
- Never \u2026
|
|
49
49
|
- Do not \u2026
|
|
50
|
-
`,
|
|
50
|
+
`,Mu=W({name:"skill",label:"Skill"}).sealed().icon("book-open").order(Number.MAX_SAFE_INTEGER).pluralLabel("Skills").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
|
|
51
51
|
{{ description }}
|
|
52
|
-
{{ content }}`).attribute(f({name:"name",label:"Name"}).maxLength(constants.SKILL_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.SKILL_DESCRIPTION_MAX_LENGTH).required().placeholder('What this skill does and when to use it \u2014 e.g. "Drafts replies to customer complaints. Use when asked to answer an unhappy customer."')).attribute(
|
|
52
|
+
{{ content }}`).attribute(f({name:"name",label:"Name"}).maxLength(constants.SKILL_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.SKILL_DESCRIPTION_MAX_LENGTH).required().placeholder('What this skill does and when to use it \u2014 e.g. "Drafts replies to customer complaints. Use when asked to answer an unhappy customer."')).attribute(Ae({name:"content",label:"Content"}).defaultValue(Do)).build(),Lu=O(z("skill-detail","Skill").for("skill").default().sidePanel({attributes:["name","description"]}).tab("content","Content").richtext("content").titleAttribute("name").done().tab("files","Files").documents().done().tab("activity","Activity").activity().done().build()),Bu=O(G("skill-list","Skills").for("skill").default().allowPresentationCustomization().tab("workspace","Skills").default().icon("list").visibility("workspace").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").tab("mine","My skills").icon("lock").visibility("private").list().columns("name","description").descriptionAttribute("description").displayAttributes("createdBy","updatedAt").sort("name","asc").build());var qu=W({name:"memory",label:"Memory"}).sealed().icon("database").order(Number.MAX_SAFE_INTEGER).pluralLabel("Memories").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
|
|
53
53
|
{{ description }}
|
|
54
|
-
{{ content }}`).migration(2,e=>e.changeType("content","text","richtext")).attribute(f({name:"name",label:"Name"}).maxLength(constants.MEMORY_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.MEMORY_DESCRIPTION_MAX_LENGTH).required()).attribute(
|
|
55
|
-
{{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).build(),
|
|
56
|
-
{{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).attribute(q({name:"kind",label:"Kind"}).options([{value:"web",label:"Web",color:"blue"},{value:"presentation",label:"Presentation",color:"purple"},{value:"document",label:"Document",color:"sky"},{value:"spreadsheet",label:"Spreadsheet",color:"green"},{value:"image",label:"Image",color:"pink"},{value:"code",label:"Code",color:"slate"},{value:"other",label:"Other",color:"gray"}]).required()).attribute(q({name:"retention",label:"Retention"}).options([{value:"ephemeral",label:"Ephemeral",color:"gray"},{value:"conversation",label:"Conversation",color:"blue"},{value:"persistent",label:"Persistent",color:"green"}]).defaultValue("conversation").required()).attribute(
|
|
54
|
+
{{ content }}`).migration(2,e=>e.changeType("content","text","richtext")).attribute(f({name:"name",label:"Name"}).maxLength(constants.MEMORY_NAME_MAX_LENGTH).required()).attribute(f({name:"description",label:"Description"}).multiline().maxLength(constants.MEMORY_DESCRIPTION_MAX_LENGTH).required()).attribute(Ae({name:"content",label:"Content"})).attribute(q({name:"kind",label:"Kind"}).options([{value:"fact",label:"Fact"},{value:"preference",label:"Preference"},{value:"feedback",label:"Feedback"},{value:"reference",label:"Reference"}])).attribute(Te({name:"subjects",label:"Subjects"}).toAny().many()).attribute(Te({name:"links",label:"Links"}).to("memory").many()).attribute(q({name:"source",label:"Source"}).options([{value:"explicit",label:"Saved by an agent"},{value:"extracted",label:"Extracted from a session"},{value:"corroborated",label:"Corroborated across users"},{value:"curated",label:"Curated by Dreamer"}])).attribute(U({name:"validFrom",label:"Valid from"}).includeTime()).attribute(U({name:"invalidAt",label:"Invalid at"}).includeTime()).attribute(Te({name:"supersededBy",label:"Superseded by"}).to("memory")).attribute(f({name:"provenance",label:"Provenance"}).multiline()).attribute(q({name:"reviewState",label:"Review state"}).options([{value:"needs_review",label:"Needs review"},{value:"skill_candidate",label:"Skill candidate"}])).attribute(f({name:"reviewReason",label:"Review reason"}).multiline()).attribute(U({name:"curatedAt",label:"Curated at"}).includeTime()).attribute(U({name:"reviewAfter",label:"Review after"}).includeTime()).attribute(f({name:"curationFingerprint",label:"Curation fingerprint"})).build(),Co={combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_empty",value:null}]},zu=O(z("memory-detail","Memory").for("memory").default().sidePanel({attributes:["description","kind","source","provenance","reviewState","reviewReason","validFrom","invalidAt","supersededBy","curatedAt","reviewAfter","subjects","links"]}).tab("content","Content").richtext("content").titleAttribute("name").build()),Gu=O(G("memory-list","Memories").for("memory").default().allowPresentationCustomization().tab("workspace","Memories").default().icon("list").visibility("workspace").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(Co).sort("name","asc").tab("mine","My memories").icon("lock").visibility("private").list().columns("name","kind","description","createdAt").descriptionAttribute("description").displayAttributes("kind","subjects","createdAt").filter(Co).sort("name","asc").tab("review","To review").icon("question-circle").table().columns("name","reviewState","reviewReason","updatedAt").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_empty",value:null},{attribute:"reviewState",operator:"is_not_empty",value:null}]}).sort("updatedAt","desc").tab("history","History").icon("archive").table().columns("name","kind","invalidAt","supersededBy").filter({combinator:"and",rules:[{attribute:"invalidAt",operator:"is_not_empty",value:null}]}).sort("invalidAt","desc").build());var bt="drives",Wu=W({name:bt,label:"Drive"}).sealed().icon("folder").hidden().pluralLabel("Drives").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
|
|
55
|
+
{{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).build(),Ku=O(z("drive-detail","Drive").for(bt).default().sidePanel({attributes:["description"]}).tab("documents","Documents").documents().build()),Yu=O(G("drive-list","Drives").for(bt).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns("name","description","updatedAt").sort("name","asc").tab("mine","My drives").icon("lock").visibility("private").table().columns("name","description","updatedAt").sort("name","asc").build());var gt="artifact",Hu=W({name:gt,label:"Artifact"}).sealed().icon("package").pluralLabel("Artifacts").labelExpression("{{ name }}").embeddingExpression(`{{ name }}
|
|
56
|
+
{{ description }}`).attribute(f({name:"name",label:"Name"}).required()).attribute(f({name:"description",label:"Description"}).multiline()).attribute(q({name:"kind",label:"Kind"}).options([{value:"web",label:"Web",color:"blue"},{value:"presentation",label:"Presentation",color:"purple"},{value:"document",label:"Document",color:"sky"},{value:"spreadsheet",label:"Spreadsheet",color:"green"},{value:"image",label:"Image",color:"pink"},{value:"code",label:"Code",color:"slate"},{value:"other",label:"Other",color:"gray"}]).required()).attribute(q({name:"retention",label:"Retention"}).options([{value:"ephemeral",label:"Ephemeral",color:"gray"},{value:"conversation",label:"Conversation",color:"blue"},{value:"persistent",label:"Persistent",color:"green"}]).defaultValue("conversation").required()).attribute(at({name:"currentRevision",label:"Current revision"}).integer().min(1)).attribute(U({name:"expiresAt",label:"Expires at"}).includeTime().hidden()).attribute(f({name:"sourceSessionId",label:"Source session"}).hidden()).attribute(f({name:"sourceMessageId",label:"Source message"}).hidden()).attribute(f({name:"initialToolCallId",label:"Initial tool call"}).hidden()).attribute(Io({name:"versions",label:"Versions"}).qualifyWith(at({name:"revision",label:"Revision"}).integer().min(1).required(),f({name:"toolCallId",label:"Tool call"}).hidden(),f({name:"sourceFileId",label:"Source file"}).hidden(),f({name:"previewFileId",label:"Preview file"}).hidden(),f({name:"fileIds",label:"File manifest"}).hidden(),f({name:"entrypoint",label:"Entrypoint"}).hidden(),f({name:"sourceMessageId",label:"Source message"}).hidden(),f({name:"artifactName",label:"Artifact name"}).hidden(),f({name:"artifactDescription",label:"Artifact description"}).hidden(),f({name:"artifactKind",label:"Artifact kind"}).hidden(),f({name:"displayMode",label:"Display mode"}).hidden(),f({name:"displayInteraction",label:"Display interaction"}).hidden(),f({name:"displaySize",label:"Display size"}).hidden(),at({name:"displayAspectRatio",label:"Display aspect ratio"}).hidden())).build(),Qu=O(z("artifact-detail","Artifact").for(gt).default().readOnly().sidePanel({attributes:["description","kind","retention","currentRevision","createdBy","updatedAt"]}).tab("preview","Preview").custom("ArtifactPreview").done().tab("versions","Versions").documents().disableUpload().disableRemove().hideAttachments().done().tab("activity","Activity").activity().done().build());function Ju(){let e=G("artifact-list","Artifacts").for(gt).default().allowPresentationCustomization().tab("mine","My artifacts").default().icon("lock").visibility("private").readOnly().list().columns("name","kind","currentRevision","updatedAt").descriptionAttribute("description").displayAttributes("kind","currentRevision","updatedAt").sort("updatedAt","desc").tab("workspace","Workspace").icon("list").visibility("workspace").readOnly().list().columns("name","kind","currentRevision","updatedAt").descriptionAttribute("description").displayAttributes("kind","currentRevision","updatedAt").sort("updatedAt","desc").build();return {...e,config:{...e.config,tabs:e.config.tabs.map(t=>({...t,default:t.default??false}))}}}chunkDPD6ZWL2_js.a(Ju,"buildArtifactListView");var Xu=O(Ju());var yt="meeting",T={title:"title",description:"description",location:"location",startsAt:"startsAt",endsAt:"endsAt",isAllDay:"isAllDay",status:"status",organizerAddress:"organizerAddress",organizerName:"organizerName",conferenceProvider:"conferenceProvider",conferenceJoinUrl:"conferenceJoinUrl",htmlLink:"htmlLink",participants:"participants",providerEventId:"providerEventId",icalUid:"icalUid",recurringEventId:"recurringEventId",connectionId:"connectionId",recordingOverride:"recordingOverride",endedAnnouncedAt:"endedAnnouncedAt",linkedRecords:"linkedRecords"},Oo="meeting-list",ko="calendar-sync",_o="meeting-detail",No=[T.title,T.startsAt,T.endsAt,T.status],Zu=W({name:yt,label:"Meeting"}).sealed().hidden().metadata({platformOwned:{editable:[T.linkedRecords],source:ko}}).icon("calendar").pluralLabel("Meetings").labelExpression("{{ title }}").embeddingExpression(`{{ title }}
|
|
57
57
|
{{ description }}
|
|
58
|
-
{{ participants }}`).attribute(f({name:T.title,label:"Title"}).required()).attribute(
|
|
59
|
-
Available views: ${s}`;throw new
|
|
60
|
-
`)}debug(t){let r=this.summary();return t?.(r),r}makeKey(t,r,n){return `${t}:${r}:${n}`}};chunkDPD6ZWL2_js.a(On,"ViewRegistry");var kn=On,Ku=new kn;function Eo(e,t=[]){return e.filter(r=>!(!chunkSDOYGWU4_js.j(r).lifecycle.visibleInRuntime||r.system||t.includes(r.name)))}chunkDPD6ZWL2_js.a(Eo,"getRuntimeAttributes");function Do(e){return [...e].sort((t,r)=>{let n=t.order??999,o=r.order??999;return n!==o?n-o:t.name.localeCompare(r.name)})}chunkDPD6ZWL2_js.a(Do,"sortAttributes");function Yu(e){if(e.type==="text"&&e.multiline)return 12;switch(e.type){case "richtext":case "location":return 12;case "checkbox":return 4;default:return 6}}chunkDPD6ZWL2_js.a(Yu,"getDefaultFieldSpan");function Hu(e){return {attribute:e.name,span:Yu(e)}}chunkDPD6ZWL2_js.a(Hu,"attributeToField");function _n(e,t={}){let{includeActivityTab:r=true,includeDocumentsTab:n=true,excludeAttributes:o=[]}=t,a=Eo(e.attributes,o),p=[{id:"form",name:"form",label:"Details",type:"form",groups:[{id:"general",label:"General",type:"fields",fields:Do(a.filter(ae=>chunkSDOYGWU4_js.j(ae).presentation.formField)).map(Hu),order:0}],order:0}],I=1,X=e.attributes.some(ae=>ae.type==="document");n&&X&&p.push({id:"documents",name:"documents",label:"Documents",type:"documents",order:I++,allowUpload:true,allowRemove:true}),r&&p.push({id:"activity",name:"activity",label:"Activity",type:"activity",order:I++});let B={tabs:p};return {name:"default",label:"Default View",object:e.name,type:"detail",config:B,default:true}}chunkDPD6ZWL2_js.a(_n,"generateDefaultDetailView");function Pn(e,t={}){let{excludeAttributes:r=[],maxListColumns:n=5}=t,o=Eo(e.attributes,r),l={tabs:[{id:"all",label:"All",default:true,visibility:"workspace",layout:"table",columns:Do(o.filter(p=>chunkSDOYGWU4_js.j(p).presentation.defaultColumn)).slice(0,n).map(p=>p.name)}]};return {name:"default",label:"All Records",object:e.name,type:"list",config:l,default:true}}chunkDPD6ZWL2_js.a(Pn,"generateDefaultListView");function Qu(e,t){let{preserveCustomTabs:r=true,preserveTableTabs:n=true}=t,o=[];for(let a of e.config.tabs)r&&a.type==="custom"&&o.push(a),n&&a.type==="table"&&o.push(a);return o}chunkDPD6ZWL2_js.a(Qu,"getPreservedDetailTabs");function Ju(e,t){if(t.length===0)return e;let r=e.find(s=>s.type==="form"),n=e.filter(s=>s.type!=="form"),o=[];r&&o.push(r);let a=1;for(let s of t)o.push({...s,order:a++});for(let s of n)o.push({...s,order:a++});return o}chunkDPD6ZWL2_js.a(Ju,"mergeDetailTabs");function Xu(e,t,r){let{preserveMetadata:n=true,...o}=r,a=_n(t,o),s=Qu(e,r),l=Ju(a.config.tabs,s),p={...a.config,tabs:l},I={...a,config:p};return n&&(I.id=e.id,I.name=e.name,I.label=e.label,I.description=e.description,I.icon=e.icon),I}chunkDPD6ZWL2_js.a(Xu,"resetDetailViewToDefault");function Zu(e,t,r){let{preserveMetadata:n=true,...o}=r,s={...Pn(t,o)};return n&&(s.id=e.id,s.name=e.name,s.label=e.label,s.description=e.description,s.icon=e.icon),s}chunkDPD6ZWL2_js.a(Zu,"resetListViewToDefault");function el(e,t,r={}){if(Ke(e))return Xu(e,t,r);if(Hi(e))return Zu(e,t,r);throw new Error(`Reset not supported for view type: ${e.type}`)}chunkDPD6ZWL2_js.a(el,"resetViewToDefault");function NT(e,t){if(t){let r=e.tabs.find(n=>n.id===t);if(r)return r}return e.tabs.find(r=>r.default)??e.tabs[0]}chunkDPD6ZWL2_js.a(NT,"getActiveTab");function Fn(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Fn,"cloneFormDefinition");var Vn=class Vn{constructor(){this.forms=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){if(this.forms.has(n.name))throw new chunk72TQRSNX_js.r("form",n.name,`[FormRegistry] Duplicate form: "${n.name}"`);this.forms.set(n.name,Fn(n));}return this}get(t){let r=this.forms.get(t);return r?Fn(r):void 0}getAll(){return Array.from(this.forms.values(),Fn)}listNames(){return Array.from(this.forms.keys())}};chunkDPD6ZWL2_js.a(Vn,"FormRegistry");var Oe=Vn;var Co=new Oe;function UT(e,t){return `${e}:${t}`}chunkDPD6ZWL2_js.a(UT,"formatAgentStreamFrameId");function $T(e){let t=e.lastIndexOf(":");if(t<=0)return null;let r=e.slice(0,t),n=Number(e.slice(t+1));return !Number.isInteger(n)||n<=0?null:{streamId:r,sequence:n}}chunkDPD6ZWL2_js.a($T,"parseAgentStreamFrameId");var GT=204800,WT=256;function Mn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Mn,"isRecord");function Ln(e,t){let r=Object.keys(e);return r.length===t.length&&r.every(n=>t.includes(n))}chunkDPD6ZWL2_js.a(Ln,"hasExactKeys");function jn(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}chunkDPD6ZWL2_js.a(jn,"isPositiveInteger");function No(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(No,"isNonNegativeInteger");function tl(e){return Mn(e)&&Ln(e,["kind","startOffset","endOffset"])?(e.kind==="text"||e.kind==="reasoning")&&No(e.startOffset)&&No(e.endOffset)&&e.endOffset>=e.startOffset:false}chunkDPD6ZWL2_js.a(tl,"isContentRange");function rl(e){if(!Mn(e))return false;let t=e.content===void 0?["sequence","chunk"]:["sequence","content","chunk"];return Ln(e,t)&&jn(e.sequence)&&e.chunk!==void 0&&(e.content===void 0||tl(e.content))}chunkDPD6ZWL2_js.a(rl,"isBatchItem");function nl(e){try{return new TextEncoder().encode(JSON.stringify(e)).byteLength}catch{return}}chunkDPD6ZWL2_js.a(nl,"encodedSize");function KT(e){if(!(Mn(e)&&Ln(e,["schemaVersion","batchId","tenantId","sessionId","streamId","sequenceStart","sequenceEnd","items"]))||e.schemaVersion!==1||typeof e.batchId!="string"||e.batchId.trim()===""||typeof e.tenantId!="string"||e.tenantId.trim()===""||typeof e.sessionId!="string"||e.sessionId.trim()===""||typeof e.streamId!="string"||e.streamId.trim()===""||!jn(e.sequenceStart)||!jn(e.sequenceEnd)||!Array.isArray(e.items)||e.items.length===0||e.items.length>256||!e.items.every(rl))return false;let t=0;for(let n of e.items){if(n.sequence<=t)return false;t=n.sequence;}if(e.items[0]?.sequence!==e.sequenceStart||e.items.at(-1)?.sequence!==e.sequenceEnd)return false;let r=nl(e);return r!==void 0&&r<=204800}chunkDPD6ZWL2_js.a(KT,"isAgentUIMessageBatch");function QT(e){switch(e.kind){case "workspace":return `workspace:${encodeURIComponent(e.tenantId)}`;case "object":return `object:${encodeURIComponent(e.objectId)}`;case "record":return `record:${encodeURIComponent(e.objectId)}:${encodeURIComponent(e.recordId)}`;case "view":return `view:${encodeURIComponent(e.viewId)}`;case "user":return `user:${encodeURIComponent(e.actorId)}`;case "conversation":return `conversation:${encodeURIComponent(e.sessionId)}`;case "architect-draft":return `architect-draft:${encodeURIComponent(e.actorId)}`}}chunkDPD6ZWL2_js.a(QT,"liveChannelKey");function te(e){try{return decodeURIComponent(e)}catch{return null}}chunkDPD6ZWL2_js.a(te,"decodeLiveChannelPart");function ko(e){let t=e.split(":");if(t[0]==="workspace"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"workspace",tenantId:r}:null}if(t[0]==="object"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"object",objectId:r}:null}if(t[0]==="record"&&t.length===3&&t[1]&&t[2]){let r=te(t[1]),n=te(t[2]);return r&&n?{kind:"record",objectId:r,recordId:n}:null}if(t[0]==="view"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"view",viewId:r}:null}if(t[0]==="user"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"user",actorId:r}:null}if(t[0]==="architect-draft"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"architect-draft",actorId:r}:null}if(t[0]==="conversation"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"conversation",sessionId:r}:null}return null}chunkDPD6ZWL2_js.a(ko,"parseLiveChannelKey");var il={"record.patch":true,"record.deleted":true,"record.removed":true,"record.created":true,"view.projection.stale":true,"agent.session.patch":true,"notification.created":true,"notification.recipient.patch":true,"notification.count.patch":true,"notification.inbox.archived":true,"reflex.state.changed":true,"reflex.run.completed":true,"reflex.authoring.progress":true,"architect.draft.updated":true,"meeting.recording.patch":true,"wallet.state":true,"channel.revoked":true},ol=Object.keys(il),al=["membership-unknown","sort-unknown","permissions-changed"],sl=["permission-revoked","workspace-left","object-deleted"],ul=["inboxState","workState","lockedAt","lockedByActorId","readAt","archivedAt","snoozedUntil","completedAt","dismissedAt","updatedAt"],ll=["type","objectId","recordId","recordVersion"],dl=["type","objectId","recordId","recordVersion","record"],cl=["id","objectId","visibility","ownedBy","label","values","metadata","createdAt","updatedAt","createdBy","lastUpdatedBy","schemaVersion"],pl=["type","targetActorId","archivedCount","version","updatedAt"];function ml(e){return typeof e=="string"&&ol.includes(e)}chunkDPD6ZWL2_js.a(ml,"isLiveEventType");function ew(e){return C(e)&&ml(e.type)?fl(e.type,e):false}chunkDPD6ZWL2_js.a(ew,"isLiveEventPayload");function fl(e,t){if(!C(t))return false;switch(e){case "record.patch":return wl(t);case "record.deleted":return xl(t);case "record.removed":return Il(t);case "record.created":return vl(t);case "view.projection.stale":return Rl(t);case "agent.session.patch":return El(t);case "notification.created":return kl(t);case "notification.recipient.patch":return Ol(t);case "notification.count.patch":return _l(t);case "notification.inbox.archived":return Pl(t);case "reflex.state.changed":return Bl(t);case "reflex.run.completed":return Ul(t);case "reflex.authoring.progress":return $l(t);case "architect.draft.updated":return Ll(t);case "meeting.recording.patch":return zl(t);case "wallet.state":return Kl(t);case "channel.revoked":return Yl(t);default:return false}}chunkDPD6ZWL2_js.a(fl,"isLiveEventPayloadForType");function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(C,"isRecord");function F(e){return typeof e=="string"}chunkDPD6ZWL2_js.a(F,"isString");function Oo(e){return F(e)&&e.length>0}chunkDPD6ZWL2_js.a(Oo,"isNonEmptyString");function mt(e){return e===null||F(e)}chunkDPD6ZWL2_js.a(mt,"isNullableString");function bl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(bl,"isVersion");function W(e){if(!F(e))return false;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString()===e}chunkDPD6ZWL2_js.a(W,"isIsoDateString");function we(e){return e===null||W(e)}chunkDPD6ZWL2_js.a(we,"isNullableIsoDateString");function x(e,t){return F(e[t])}chunkDPD6ZWL2_js.a(x,"hasString");function re(e,t){return Oo(e[t])}chunkDPD6ZWL2_js.a(re,"hasNonEmptyString");function N(e,t){return bl(e[t])}chunkDPD6ZWL2_js.a(N,"hasVersion");function k(e,t){return W(e[t])}chunkDPD6ZWL2_js.a(k,"hasIsoDateString");function w(e,t,r){return !Object.hasOwn(e,t)||r(e[t])}chunkDPD6ZWL2_js.a(w,"hasOptional");function ft(e,t){return Object.keys(e).every(r=>t.includes(r))}chunkDPD6ZWL2_js.a(ft,"hasOnlyKeys");function O(e,t){return typeof e=="string"&&t.includes(e)}chunkDPD6ZWL2_js.a(O,"isOneOf");function gl(e){return O(e,ki)}chunkDPD6ZWL2_js.a(gl,"isNotificationKind");function yl(e){return O(e,Oi)}chunkDPD6ZWL2_js.a(yl,"isNotificationPriority");function hl(e){return O(e,_i)}chunkDPD6ZWL2_js.a(hl,"isNotificationSensitivity");function _o(e){return O(e,Pi)}chunkDPD6ZWL2_js.a(_o,"isNotificationInboxState");function Po(e){return O(e,Fi)}chunkDPD6ZWL2_js.a(Po,"isNotificationWorkState");function Al(e){return C(e)&&x(e,"type")&&x(e,"id")}chunkDPD6ZWL2_js.a(Al,"isNotificationSubject");function Tl(e){return C(e)&&x(e,"fieldKey")&&Object.hasOwn(e,"value")&&N(e,"version")}chunkDPD6ZWL2_js.a(Tl,"isRecordFieldPatch");function wl(e){return e.type==="record.patch"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&w(e,"label",F)&&w(e,"metadata",C)&&w(e,"fieldsWithheld",t=>t===true)&&Array.isArray(e.fieldPatches)&&e.fieldPatches.every(Tl)&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(wl,"isRecordPatchPayload");function xl(e){return e.type==="record.deleted"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&x(e,"deletedAt")}chunkDPD6ZWL2_js.a(xl,"isRecordDeletedPayload");function Il(e){return e.type==="record.removed"&&ft(e,ll)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")}chunkDPD6ZWL2_js.a(Il,"isRecordRemovedPayload");function Sl(e){return C(e)&&ft(e,cl)&&x(e,"id")&&x(e,"objectId")&&O(e.visibility,["workspace","private"])&&mt(e.ownedBy)&&(e.visibility==="workspace"&&e.ownedBy===null||e.visibility==="private"&&Oo(e.ownedBy))&&x(e,"label")&&C(e.values)&&w(e,"metadata",C)&&k(e,"createdAt")&&k(e,"updatedAt")&&w(e,"createdBy",F)&&w(e,"lastUpdatedBy",F)&&N(e,"schemaVersion")}chunkDPD6ZWL2_js.a(Sl,"isRecordLiveSnapshot");function vl(e){return e.type==="record.created"&&ft(e,dl)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&Sl(e.record)&&e.record.id===e.recordId&&e.record.objectId===e.objectId}chunkDPD6ZWL2_js.a(vl,"isRecordCreatedPayload");function Rl(e){return e.type==="view.projection.stale"&&x(e,"viewId")&&O(e.reason,al)}chunkDPD6ZWL2_js.a(Rl,"isViewProjectionStalePayload");function El(e){return e.type==="agent.session.patch"&&x(e,"sessionId")&&C(e.patch)&&N(e,"version")&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(El,"isAgentSessionPatchPayload");function Dl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&w(e,"senderActorId",F)&&w(e,"rootActorId",F)&&w(e,"triggeredByActorId",F)&&gl(e.kind)&&x(e,"type")&&w(e,"subject",Al)&&x(e,"title")&&w(e,"summary",F)&&C(e.payload)&&yl(e.priority)&&hl(e.sensitivity)&&w(e,"threadKey",F)&&w(e,"idempotencyKey",F)&&w(e,"expiresAt",W)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Dl,"isLiveNotification");function Cl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&x(e,"notificationId")&&x(e,"recipientActorId")&&_o(e.inboxState)&&Po(e.workState)&&w(e,"lockedAt",W)&&w(e,"lockedByActorId",F)&&w(e,"readAt",W)&&w(e,"archivedAt",W)&&w(e,"snoozedUntil",W)&&w(e,"completedAt",W)&&w(e,"dismissedAt",W)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Cl,"isLiveNotificationRecipient");function Nl(e){return C(e)?Object.keys(e).every(t=>ul.includes(t))&&w(e,"inboxState",_o)&&w(e,"workState",Po)&&w(e,"lockedAt",we)&&w(e,"lockedByActorId",mt)&&w(e,"readAt",we)&&w(e,"archivedAt",we)&&w(e,"snoozedUntil",we)&&w(e,"completedAt",we)&&w(e,"dismissedAt",we)&&w(e,"updatedAt",W):false}chunkDPD6ZWL2_js.a(Nl,"isNotificationRecipientPatch");function kl(e){let t=Dl(e.notification)?e.notification:null;return e.type==="notification.created"&&t!==null&&Array.isArray(e.recipients)&&e.recipients.length>0&&e.recipients.every(r=>Cl(r)&&r.notificationId===t.id)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(kl,"isNotificationCreatedPayload");function Ol(e){return e.type==="notification.recipient.patch"&&x(e,"recipientId")&&x(e,"recipientActorId")&&Nl(e.patch)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Ol,"isNotificationRecipientPatchPayload");function _l(e){return e.type==="notification.count.patch"&&x(e,"targetActorId")&&N(e,"unread")&&N(e,"pendingWork")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(_l,"isNotificationCountPatchPayload");function Pl(e){return e.type==="notification.inbox.archived"&&ft(e,pl)&&re(e,"targetActorId")&&N(e,"archivedCount")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Pl,"isNotificationInboxArchivedPayload");var Fl=["armed","disarmed"],Vl=["authoring","compiling","replaying","promoted","failed"],jl=["promoted","lkg"],Ml=["composing","published","discarded"];function Ll(e){if(e.type!=="architect.draft.updated"||!C(e.draft))return false;let t=e.draft;return re(t,"id")&&re(t,"actorId")&&mt(t.agentSessionId)&&Array.isArray(t.operations)&&t.operations.every(C)&&C(t.baselines)&&O(t.status,Ml)}chunkDPD6ZWL2_js.a(Ll,"isArchitectDraftUpdatedPayload");function Bl(e){return e.type==="reflex.state.changed"&&re(e,"reflexId")&&O(e.state,Fl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Bl,"isReflexStateChangedPayload");function Ul(e){return e.type==="reflex.run.completed"&&re(e,"reflexId")&&re(e,"runId")&&O(e.served,jl)&&N(e,"version")&&N(e,"wallMs")&&k(e,"completedAt")}chunkDPD6ZWL2_js.a(Ul,"isReflexRunCompletedPayload");function $l(e){return e.type==="reflex.authoring.progress"&&re(e,"reflexId")&&O(e.status,Vl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a($l,"isReflexAuthoringProgressPayload");var ql=["none","scheduled","recording","completed","failed"];function zl(e){return e.type==="meeting.recording.patch"&&re(e,"meetingId")&&O(e.status,ql)&&mt(e.failureReason)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(zl,"isMeetingRecordingPatchPayload");var Gl=["ok","low","exhausted","paused"],Wl=["metering-only","contract","wallet"];function Kl(e){return e.type==="wallet.state"&&O(e.status,Gl)&&O(e.mode,Wl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Kl,"isWalletStatePayload");function Yl(e){return e.type==="channel.revoked"&&x(e,"channel")&&O(e.reason,sl)}chunkDPD6ZWL2_js.a(Yl,"isChannelRevokedPayload");function Bn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Bn,"isRecord");function Hl(e){let{channel:t}=e;return typeof t=="string"&&ko(t)?t:null}chunkDPD6ZWL2_js.a(Hl,"payloadChannel");function iw(e){return Bn(e)?Hl(e):null}chunkDPD6ZWL2_js.a(iw,"getLiveProtocolPayloadChannel");function ow(e){return Bn(e)?typeof e.id=="string"&&e.id.length>0&&typeof e.channel=="string"&&typeof e.type=="string"&&typeof e.tenantId=="string"&&e.tenantId.length>0&&typeof e.occurredAt=="string"&&Bn(e.payload):false}chunkDPD6ZWL2_js.a(ow,"isLiveEventEnvelope");var uw=["if","concat","sum","avg","count","min","max","earliest","latest","unique","first","percent_empty","percent_not_empty","count_empty","count_not_empty","count_unique"],_e={if:{name:"if",returnType:"branch",minArgs:3,maxArgs:3},concat:{name:"concat",returnType:{kind:"scalar",type:"text"},minArgs:1},sum:{name:"sum",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},avg:{name:"avg",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count:{name:"count",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},min:{name:"min",returnType:"source_item",minArgs:1,maxArgs:1},max:{name:"max",returnType:"source_item",minArgs:1,maxArgs:1},earliest:{name:"earliest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},latest:{name:"latest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},unique:{name:"unique",returnType:"argument",minArgs:1,maxArgs:1},first:{name:"first",returnType:"source_item",minArgs:1,maxArgs:1},percent_empty:{name:"percent_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},percent_not_empty:{name:"percent_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_empty:{name:"count_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_not_empty:{name:"count_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_unique:{name:"count_unique",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1}};function bt(e){return Object.hasOwn(_e,e)}chunkDPD6ZWL2_js.a(bt,"isComputedFunctionName");var zn=class zn extends Error{constructor(t){super(t),this.name="ComputedFormulaCompileError";}};chunkDPD6ZWL2_js.a(zn,"ComputedFormulaCompileError");var b=zn;function Bo(e){let t=Ql(e.expression),r=gt(t,e.schema),n=hd(r.valueType);if(n!==e.returnType)throw new b(`Computed formula "${e.attributeName}" returns "${n}", expected "${e.returnType}"`);if(Uo(e.returnType)&&r.optionsSource===void 0)throw new b(`Computed formula "${e.attributeName}" returns "${e.returnType}" without optionsSource`);let o=r.optionsSource===void 0?[]:[{kind:"options",source:r.optionsSource}],a=qn([...r.dependencies,...o]);return {kind:"formula",attributeName:e.attributeName,expression:e.expression,returnType:e.returnType,valueType:r.valueType,dependencies:a,ast:t,...r.optionsSource?{optionsSource:r.optionsSource}:{},...r.targetAttributeType?{targetAttributeType:r.targetAttributeType}:{},dependenciesHash:Ad({expression:e.expression,returnType:e.returnType,dependencies:a})}}chunkDPD6ZWL2_js.a(Bo,"compileComputedFormula");function mw(e){let t=new Map(e.map(o=>[o.attributeName,o])),r=new Set,n=chunkDPD6ZWL2_js.a((o,a)=>{let s=a.indexOf(o);if(s!==-1){let I=[...a.slice(s),o];throw new b(`Computed field cycle detected: ${I.join(" -> ")}`)}if(r.has(o))return;let l=t.get(o);if(l===void 0)return;let p=[...a,o];for(let I of l.dependencies)I.kind==="computed"&&n(I.attributeName,p);r.add(o);},"visit");for(let o of e)n(o.attributeName,[]);}chunkDPD6ZWL2_js.a(mw,"assertAcyclicComputedDependencies");function Ql(e){try{return chunk47EGJRW7_js.e(e)}catch(t){throw t instanceof Error?new b(t.message):t}}chunkDPD6ZWL2_js.a(Ql,"parseCompileFormula");function gt(e,t){switch(e.kind){case "literal":return {valueType:Jl(e.value),dependencies:[],...typeof e.value=="string"?{literalString:e.value}:{}};case "path":return Xl(e.parts,t);case "call":return id(e.functionName,e.args,t);case "binary":return ld(e.operator,gt(e.left,t),gt(e.right,t));default:return e}}chunkDPD6ZWL2_js.a(gt,"inferNode");function Jl(e){switch(typeof e){case "string":return {kind:"scalar",type:"text"};case "number":return {kind:"scalar",type:"number"};case "boolean":return {kind:"scalar",type:"boolean"};case "object":return {kind:"scalar",type:"text"};default:return e}}chunkDPD6ZWL2_js.a(Jl,"literalToValueType");function Xl(e,t){if(e.length===1){let r=e[0],n=Un(t,r);if(n===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);return n.type==="relation"?{valueType:td(),dependencies:[{kind:"relation",relationName:n.name,cardinality:Fo(n)}],targetAttributeType:n.type}:{valueType:Vo(n),dependencies:[ed(n)],optionsSource:jo(t.objectName,n),targetAttributeType:n.type}}if(e.length===2){let[r,n]=e,o=Un(t,r);if(o===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);if(o.type!=="relation")throw new b(`Attribute "${r}" on object "${t.objectName}" is not a relation`);let a=Zl(o);if(a===void 0)throw new b(`Relation "${r}" on object "${t.objectName}" is missing targetObjectName`);let s=t.relatedObjects?.[a];if(s===void 0)throw new b(`Unknown related object "${a}"`);let l=Un(s,n);if(l===void 0)throw new b(`Unknown attribute "${n}" on object "${s.objectName}"`);let p=Vo(l);return {valueType:o.cardinality==="many"?nd(p):p,dependencies:[{kind:"relation",relationName:r,targetAttributeName:n,cardinality:Fo(o)}],optionsSource:jo(s.objectName,l),targetAttributeType:l.type}}throw new b("Computed paths support at most one relation hop")}chunkDPD6ZWL2_js.a(Xl,"inferPath");function Un(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(Un,"findAttribute");function Zl(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(Zl,"getRelationTargetObjectName");function Fo(e){return e.cardinality??"one"}chunkDPD6ZWL2_js.a(Fo,"relationCardinality");function ed(e){return e.type==="formula"||e.type==="rollup"?{kind:"computed",attributeName:e.name}:{kind:"local",attributeName:e.name}}chunkDPD6ZWL2_js.a(ed,"localDependencyFor");function Vo(e){if(e.type==="formula"||e.type==="rollup"){if(e.returnType===void 0)throw new b(`Computed attribute "${e.name}" is missing returnType`);return rd(e.returnType)}switch(e.type){case "number":case "currency":return {kind:"scalar",type:"number"};case "checkbox":return {kind:"scalar",type:"boolean"};case "date":return {kind:"scalar",type:"date"};case "select":case "status":return {kind:"scalar",type:"select"};case "multiselect":return {kind:"collection",itemType:"select"};case "text":case "richtext":case "phone":case "user":case "location":case "relation":case "document":return {kind:"scalar",type:"text"};default:return e.type}}chunkDPD6ZWL2_js.a(Vo,"attributeToValueType");function td(){return {kind:"collection",itemType:"text"}}chunkDPD6ZWL2_js.a(td,"relationToValueType");function rd(e){return e==="multiselect"?{kind:"collection",itemType:"select"}:{kind:"scalar",type:e}}chunkDPD6ZWL2_js.a(rd,"returnTypeToValueType");function nd(e){return e.kind==="collection"?e:{kind:"collection",itemType:e.type}}chunkDPD6ZWL2_js.a(nd,"asCollectionValueType");function jo(e,t){if(t.type==="formula"||t.type==="rollup")return Uo(t.returnType)?t.optionsSource:void 0;if(!(t.type!=="select"&&t.type!=="status"&&t.type!=="multiselect"))return t.optionsSource??{objectName:e,attributeName:t.name,...t.id?{attributeId:t.id}:{}}}chunkDPD6ZWL2_js.a(jo,"optionsSourceForAttribute");function id(e,t,r){if(!bt(e))throw new b(`Unknown computed function "${e}"`);let n=_e[e];if(t.length<n.minArgs||n.maxArgs!==void 0&&t.length>n.maxArgs){let a=n.maxArgs===void 0||n.maxArgs===n.minArgs?String(n.minArgs):`${n.minArgs}-${n.maxArgs}`;throw new b(`Function "${e}" expects ${a} arguments, received ${t.length}`)}let o=t.map(a=>gt(a,r));return od(e,o)}chunkDPD6ZWL2_js.a(id,"inferCall");function od(e,t){let r=qn(t.flatMap(n=>n.dependencies));switch(e){case "if":return ad(t,r);case "concat":return dd(t,`Function "${e}" does not accept collection values`),{valueType:{kind:"scalar",type:"text"},dependencies:r};case "sum":case "avg":return Mo(e,t[0],"number"),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "count":case "count_empty":case "count_not_empty":case "count_unique":case "percent_empty":case "percent_not_empty":return pd(e,t[0]),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "min":case "max":return cd(e,t[0]),{valueType:md(t[0]),dependencies:r,optionsSource:t[0].optionsSource,targetAttributeType:t[0].targetAttributeType};case "earliest":case "latest":return Mo(e,t[0],"date"),{valueType:{kind:"scalar",type:"date"},dependencies:r,targetAttributeType:t[0].targetAttributeType};case "unique":return sd(t[0],r);case "first":return ud(t[0],r);default:return e}}chunkDPD6ZWL2_js.a(od,"inferFunctionReturn");function ad(e,t){$n(e[0].valueType,"boolean",'Function "if" condition must be boolean');let r=e[1],n=e[2],o=bd(r,n),a=gd(r,n);if(o===void 0)throw new b('Function "if" branches must return the same type');return {valueType:o,dependencies:t,...a?{optionsSource:a}:{},targetAttributeType:r.targetAttributeType??n.targetAttributeType}}chunkDPD6ZWL2_js.a(ad,"inferIfFunction");function sd(e,t){if(e.valueType.kind!=="collection"||e.valueType.itemType!=="select")throw new b('Function "unique" expects a select collection');return {valueType:{kind:"collection",itemType:"select"},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(sd,"inferUniqueFunction");function ud(e,t){if(e.valueType.kind!=="collection")throw new b('Function "first" expects a collection');return {valueType:{kind:"scalar",type:e.valueType.itemType},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(ud,"inferFirstFunction");function ld(e,t,r){let n=qn([...t.dependencies,...r.dependencies]),o=e==="+"||e==="-"||e==="*"||e==="/";if(t.valueType.kind==="collection"||r.valueType.kind==="collection")throw new b(`Cannot use collection values with ${o?"arithmetic":"comparison"} operator "${e}"`);if(o)return e==="+"&&(t.valueType.type==="text"||r.valueType.type==="text")?{valueType:{kind:"scalar",type:"text"},dependencies:n}:($n(t.valueType,"number",`Operator "${e}" expects number operands`),$n(r.valueType,"number",`Operator "${e}" expects number operands`),{valueType:{kind:"scalar",type:"number"},dependencies:n});if(e==="=="||e==="!="){if(t.valueType.type!==r.valueType.type)throw new b(`Operator "${e}" expects operands with the same scalar type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}if((t.valueType.type!=="number"||r.valueType.type!=="number")&&(t.valueType.type!=="date"||r.valueType.type!=="date"))throw new b(`Operator "${e}" expects number or date operands of the same type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}chunkDPD6ZWL2_js.a(ld,"inferBinary");function dd(e,t){for(let r of e)if(r.valueType.kind==="collection")throw new b(t)}chunkDPD6ZWL2_js.a(dd,"ensureNoCollections");function Mo(e,t,r){if((t.valueType.kind==="collection"?t.valueType.itemType:t.valueType.type)!==r)throw new b(`Function "${e}" expects ${r} values`)}chunkDPD6ZWL2_js.a(Mo,"ensureCollectionOrScalarType");function cd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`);let r=t.valueType.itemType;if(r!=="number"&&r!=="date")throw new b(`Function "${e}" expects number or date values`)}chunkDPD6ZWL2_js.a(cd,"ensureMinMaxSource");function pd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`)}chunkDPD6ZWL2_js.a(pd,"ensureCollectionSource");function $n(e,t,r){if(e.kind!=="scalar"||e.type!==t)throw new b(r)}chunkDPD6ZWL2_js.a($n,"ensureScalarType");function md(e){return e.valueType.kind==="scalar"?e.valueType:{kind:"scalar",type:e.valueType.itemType}}chunkDPD6ZWL2_js.a(md,"sourceItemValueType");function fd(e,t){return e.kind==="scalar"?t.kind==="scalar"&&e.type===t.type:t.kind==="collection"&&e.itemType===t.itemType}chunkDPD6ZWL2_js.a(fd,"sameValueType");function bd(e,t){if(fd(e.valueType,t.valueType)||Lo(e,t))return e.valueType;if(Lo(t,e))return t.valueType}chunkDPD6ZWL2_js.a(bd,"resolveIfBranchValueType");function Lo(e,t){return e.valueType.kind==="scalar"&&e.valueType.type==="select"&&t.valueType.kind==="scalar"&&t.valueType.type==="text"&&t.literalString!==void 0}chunkDPD6ZWL2_js.a(Lo,"isSelectScalarWithStringLiteral");function gd(e,t){let r=e.optionsSource,n=t.optionsSource;if(r!==void 0&&n!==void 0&&!yd(r,n))throw new b('Function "if" branches use incompatible options sources');return r??n}chunkDPD6ZWL2_js.a(gd,"resolveIfOptionsSource");function yd(e,t){return e.objectName===t.objectName&&e.attributeName===t.attributeName&&e.attributeId===t.attributeId}chunkDPD6ZWL2_js.a(yd,"sameOptionsSource");function Uo(e){return e==="select"||e==="multiselect"}chunkDPD6ZWL2_js.a(Uo,"isSelectLikeReturnType");function hd(e){if(e.kind==="scalar")return e.type;if(e.itemType==="select")return "multiselect";throw new b(`Collection item type "${e.itemType}" cannot be used as a computed return type`)}chunkDPD6ZWL2_js.a(hd,"valueTypeToReturnType");function qn(e){let t=new Set,r=[];for(let n of e){let o=JSON.stringify(Pe(n));t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(qn,"uniqueDependencies");function Ad(e){let t=e.dependencies.map(r=>Pe(r)).sort((r,n)=>$o(JSON.stringify(r),JSON.stringify(n)));return JSON.stringify(Pe({expression:e.expression,returnType:e.returnType,dependencies:t}))}chunkDPD6ZWL2_js.a(Ad,"createDependenciesHash");function Pe(e){return Array.isArray(e)?e.map(t=>Pe(t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>$o(t,r)).map(([t,r])=>[t,Pe(r)])):e}chunkDPD6ZWL2_js.a(Pe,"stableNormalize");function $o(e,t){return e<t?-1:e>t?1:0}chunkDPD6ZWL2_js.a($o,"compareStrings");function Td(e){return e.function==="count"?`count(${e.relationAttribute})`:`${Id(e.function)}(${e.relationAttribute}.${e.targetAttribute})`}chunkDPD6ZWL2_js.a(Td,"rollupToFormulaExpression");function wd(e,t){if(e.function==="count")return "number";let r=Sd(e,t);switch(e.function){case "countValues":case "countEmpty":case "percentEmpty":case "percentNotEmpty":case "countUniqueValues":return "number";case "sum":case "avg":return "number";case "earliest":case "latest":return "date";case "original":if(!Rd(r.type))throw new b('Rollup "original" requires a select, status, or multiselect target');return "multiselect";default:return e.function}}chunkDPD6ZWL2_js.a(wd,"inferRollupReturnType");function yw(e,t){let r=Td(e),n=wd(e,t);return {...Bo({attributeName:e.name,expression:r,returnType:n,schema:xd(e,t)}),kind:"rollup"}}chunkDPD6ZWL2_js.a(yw,"compileRollupAttribute");function xd(e,t){return {...t,attributes:t.attributes.map(r=>r.name===e.relationAttribute&&r.type==="relation"?{...r,cardinality:"many"}:r)}}chunkDPD6ZWL2_js.a(xd,"schemaWithRollupRelationAsMany");function Id(e){switch(e){case "sum":case "avg":case "earliest":case "latest":return e;case "original":return "unique";case "countValues":return "count_not_empty";case "countEmpty":return "count_empty";case "percentEmpty":return "percent_empty";case "percentNotEmpty":return "percent_not_empty";case "countUniqueValues":return "count_unique";default:return e}}chunkDPD6ZWL2_js.a(Id,"rollupFunctionToFormulaFunction");function Sd(e,t){let r=qo(t,e.relationAttribute);if(r===void 0)throw new b(`Unknown relation attribute "${e.relationAttribute}" on object "${t.objectName}"`);if(r.type!=="relation")throw new b(`Attribute "${e.relationAttribute}" on object "${t.objectName}" is not a relation`);let n=vd(r);if(n===void 0)throw new b(`Relation "${e.relationAttribute}" on object "${t.objectName}" is missing targetObjectName`);let o=t.relatedObjects?.[n];if(o===void 0)throw new b(`Unknown related object "${n}"`);let a=qo(o,e.targetAttribute);if(a===void 0)throw new b(`Unknown attribute "${e.targetAttribute}" on object "${o.objectName}"`);return a}chunkDPD6ZWL2_js.a(Sd,"findRollupTargetAttribute");function qo(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(qo,"findAttribute");function vd(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(vd,"getRelationTargetObjectName");function Rd(e){return e==="select"||e==="status"||e==="multiselect"}chunkDPD6ZWL2_js.a(Rd,"isSelectLikeAttributeType");function J(e,t){switch(e.kind){case "literal":return e.value;case "path":return Dd(t,e.parts);case "binary":return Cd(e.operator,J(e.left,t),J(e.right,t));case "call":return Ed(e.functionName,e.args,t);default:return e}}chunkDPD6ZWL2_js.a(J,"evaluateAst");function Ed(e,t,r){if(kd(e),Od(e,t.length),e==="if"){let n=J(t[0],r);return n===null?null:J(n?t[1]:t[2],r)}return _d(e,t.map(n=>J(n,r)))}chunkDPD6ZWL2_js.a(Ed,"evaluateCallNode");function Dd(e,t){return t.reduce((r,n)=>Ho(r,n),e)}chunkDPD6ZWL2_js.a(Dd,"resolvePath");function Ho(e,t){if(Array.isArray(e))return e.map(n=>Ho(n,t));if(!Yo(e))return null;if(Object.hasOwn(e,t))return e[t]??null;let r=e.values;return Yo(r)&&Object.hasOwn(r,t)?r[t]??null:null}chunkDPD6ZWL2_js.a(Ho,"resolvePathPart");function Cd(e,t,r){switch(e){case "+":return Nd(t,r);case "-":return ht(t,r,(n,o)=>n-o);case "*":return ht(t,r,(n,o)=>n*o);case "/":return ht(t,r,(n,o)=>n/o);case ">":return yt(t,r,n=>n>0);case "<":return yt(t,r,n=>n<0);case ">=":return yt(t,r,n=>n>=0);case "<=":return yt(t,r,n=>n<=0);case "==":return zo(t,r);case "!=":{let n=zo(t,r);return n===null?null:!n}default:return e}}chunkDPD6ZWL2_js.a(Cd,"evaluateBinary");function Nd(e,t){return typeof e=="string"||typeof t=="string"?`${e??""}${t??""}`:ht(e,t,(r,n)=>r+n)}chunkDPD6ZWL2_js.a(Nd,"add");function yt(e,t,r){let n=Qo(e,t);return n===null?null:r(n)}chunkDPD6ZWL2_js.a(yt,"compareWith");function Qo(e,t){if(!xe([e,t]))return null;let r=Ie(e),n=Ie(t);if(r!==null&&n!==null)return r-n;let o=Kn(e),a=Kn(t);return o&&a?o.getTime()-a.getTime():null}chunkDPD6ZWL2_js.a(Qo,"compare");function zo(e,t){return e===t?true:e==null||t===null||t===void 0?false:xe([e,t])?Qo(e,t)===0:null}chunkDPD6ZWL2_js.a(zo,"equalScalar");function kd(e){if(!bt(e))throw new Error(`Unknown computed function "${e}"`)}chunkDPD6ZWL2_js.a(kd,"assertComputedFunctionName");function Od(e,t){let{minArgs:r,maxArgs:n}=_e[e];if(t>=r&&t<=(n??Number.POSITIVE_INFINITY))return;let o=n===void 0?`at least ${r}`:`between ${r} and ${n}`;throw new Error(`Function "${e}" expects ${o} arguments, received ${t}`)}chunkDPD6ZWL2_js.a(Od,"validateArity");function _d(e,t){switch(e){case "concat":return t.filter(r=>r!=null).map(String).join("");case "sum":return xe(t)?Gn(t).reduce((r,n)=>r+n,0):null;case "avg":{if(!xe(t))return null;let r=Gn(t);return r.length>0?r.reduce((n,o)=>n+o,0)/r.length:null}case "count":return de(t[0]).length;case "min":return Go(t,"min");case "max":return Go(t,"max");case "earliest":return Wn(t,"min");case "latest":return Wn(t,"max");case "unique":return Ko(de(t[0]));case "first":return de(t[0]).find(r=>r!=null)??null;case "percent_empty":return Wo(t[0],true);case "percent_not_empty":return Wo(t[0],false);case "count_empty":return de(t[0]).filter(chunk5QAE5NPN_js.a).length;case "count_not_empty":return de(t[0]).filter(r=>!chunk5QAE5NPN_js.a(r)).length;case "count_unique":return Ko(de(t[0])).length;default:return e}}chunkDPD6ZWL2_js.a(_d,"evaluateCall");function Gn(e){return At(e).map(Ie).filter(t=>t!==null)}chunkDPD6ZWL2_js.a(Gn,"numericValues");function xe(e){let t=new Set;for(let r of At(e))Yn(r)&&t.add(Jo(r));return t.size<=1}chunkDPD6ZWL2_js.a(xe,"areCommensurable");function Jo(e){return e.code.toUpperCase()}chunkDPD6ZWL2_js.a(Jo,"currencyCode");function ht(e,t,r){if(!xe([e,t]))return null;let n=Ie(e),o=Ie(t);if(n===null||o===null)return null;let a=r(n,o);return Number.isFinite(a)?a:null}chunkDPD6ZWL2_js.a(ht,"numericBinary");function Go(e,t){if(!xe(e))return null;let r=Gn(e);return r.length>0?t==="min"?Math.min(...r):Math.max(...r):Wn(e,t)}chunkDPD6ZWL2_js.a(Go,"minMax");function Wn(e,t){let r=At(e).map(Kn).filter(a=>a!==null);if(r.length===0)return null;let n=r.map(a=>a.getTime()),o=t==="min"?Math.min(...n):Math.max(...n);return new Date(o).toISOString()}chunkDPD6ZWL2_js.a(Wn,"dateMinMax");function Wo(e,t){let r=de(e);return r.length===0?0:r.filter(o=>chunk5QAE5NPN_js.a(o)===t).length/r.length}chunkDPD6ZWL2_js.a(Wo,"percentByEmptyState");function Ko(e){let t=new Set,r=[];for(let n of e){if(chunk5QAE5NPN_js.a(n))continue;let o=Pd(n);t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(Ko,"uniqueNonEmpty");function de(e){return e==null?[]:Array.isArray(e)?At(e):[e]}chunkDPD6ZWL2_js.a(de,"collectionItems");function At(e){return e.flat(Number.POSITIVE_INFINITY)}chunkDPD6ZWL2_js.a(At,"flatten");function Ie(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return Yn(e)&&Number.isFinite(e.value)?e.value:null}chunkDPD6ZWL2_js.a(Ie,"toFiniteNumber");function Yn(e){return typeof e=="object"&&e!==null&&typeof e.value=="number"&&typeof e.code=="string"}chunkDPD6ZWL2_js.a(Yn,"isCurrencyValue");function Kn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e!="string"){let r=fe(e);if(r===null)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}chunkDPD6ZWL2_js.a(Kn,"toDate");function Pd(e){if(Yn(e))return `currency:${Jo(e)}:${e.value}`;let t=Ie(e);return t!==null?`number:${t}`:e instanceof Date?`date:${e.toISOString()}`:`${typeof e}:${JSON.stringify(e)}`}chunkDPD6ZWL2_js.a(Pd,"uniqueKey");function Yo(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Yo,"isPlainRecord");function Fd(e,t,r){if(e==null)return null;let n=chunkDPD6ZWL2_js.a(o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o instanceof Date?String(o):null,"stringifyScalar");switch(t){case "number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:r!==void 0?Number(o.toFixed(r)):o}case "boolean":return !!e;case "date":return e instanceof Date?e.toISOString():typeof e=="string"?e:null;case "text":return String(e);case "select":if(Array.isArray(e)){for(let o of e){if(o==null)continue;let a=n(o);if(a!==null)return a}return null}return n(e);case "multiselect":return Array.isArray(e)?e.flatMap(o=>{if(o==null)return [];let a=n(o);return a===null?[]:[a]}):n(e)===null?[]:[String(e)];default:{let o=t;throw new Error(`Unsupported computed return type: ${o}`)}}}chunkDPD6ZWL2_js.a(Fd,"formatComputedResult");function Sw(e,t){return J(e,t)}chunkDPD6ZWL2_js.a(Sw,"evaluateComputedAst");function vw(e,t){return J(chunk47EGJRW7_js.e(e),t)}chunkDPD6ZWL2_js.a(vw,"evaluateComputedFormula");function Rw(e,t,r,n){try{let o=J(chunk47EGJRW7_js.e(e),t);return {value:r?Fd(o,r,n):o}}catch(o){return {value:null,error:o instanceof Error?o.message:String(o)}}}chunkDPD6ZWL2_js.a(Rw,"evaluateComputedFormulaWithResult");var Cw=[{name:"if",signature:"if(condition, then, else)",description:"Conditional value",category:"logic",example:"if(amount > 100, 'big', 'small')"},{name:"concat",signature:"concat(a, b, ...)",description:"Join values into text",category:"text",example:"concat(firstName, ' ', lastName)"},{name:"sum",signature:"sum(collection)",description:"Total of values",category:"number",example:"sum(orders.amount)"},{name:"avg",signature:"avg(collection)",description:"Average of values",category:"number",example:"avg(orders.amount)"},{name:"min",signature:"min(collection)",description:"Smallest value",category:"number",example:"min(orders.amount)"},{name:"max",signature:"max(collection)",description:"Largest value",category:"number",example:"max(orders.amount)"},{name:"count",signature:"count(collection)",description:"Number of items",category:"collection",example:"count(orders)"},{name:"count_empty",signature:"count_empty(collection)",description:"Items with no value",category:"collection",example:"count_empty(orders.note)"},{name:"count_not_empty",signature:"count_not_empty(collection)",description:"Items with a value",category:"collection",example:"count_not_empty(orders.note)"},{name:"count_unique",signature:"count_unique(collection)",description:"Distinct values",category:"collection",example:"count_unique(orders.status)"},{name:"percent_empty",signature:"percent_empty(collection)",description:"Fraction with no value",category:"collection",example:"percent_empty(orders.note)"},{name:"percent_not_empty",signature:"percent_not_empty(collection)",description:"Fraction with a value",category:"collection",example:"percent_not_empty(orders.note)"},{name:"unique",signature:"unique(collection)",description:"Distinct values as a list",category:"collection",example:"unique(orders.status)"},{name:"first",signature:"first(collection)",description:"First non-empty value",category:"collection",example:"first(orders.status)"},{name:"earliest",signature:"earliest(collection)",description:"Earliest date",category:"date",example:"earliest(orders.closeDate)"},{name:"latest",signature:"latest(collection)",description:"Latest date",category:"date",example:"latest(orders.closeDate)"}];var Xo=chunkDPD6ZWL2_js.a(e=>chunk5QAE5NPN_js.a(e)||Array.isArray(e)&&e.length===0,"isEmpty"),V=chunkDPD6ZWL2_js.a(e=>e==null?"":String(e),"toStr"),xt=chunkDPD6ZWL2_js.a(e=>{if(chunk5QAE5NPN_js.a(e))return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},"toNum"),It=chunkDPD6ZWL2_js.a(e=>{if(e==null)return null;let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t},"toDate"),Tt=chunkDPD6ZWL2_js.a(e=>Array.isArray(e)?e:e==null?[]:[e],"toArr"),Vd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=xt(e),o=xt(t);return n!==null&&o!==null&&r(n,o)},"compareNumbers"),jd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=It(e),o=It(t);return n!==null&&o!==null&&r(n.getTime(),o.getTime())},"compareDates"),Zo=chunkDPD6ZWL2_js.a((e,t,r)=>{if(r.type==="number"||r.type==="currency"){let n=xt(e),o=xt(t);if(n!==null&&o!==null)return n===o}return V(e)===V(t)},"equalsForAttr");function _w(e,t){return e?e==="checkbox":typeof t=="boolean"}chunkDPD6ZWL2_js.a(_w,"isCheckboxEquality");var wt=chunkDPD6ZWL2_js.a(e=>({appliesTo:["number","currency","date","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((t,r,n)=>n.type==="date"?jd(t,r,e):Vd(t,r,e),"evaluateInMemory")}),"orderingSpec"),St={is:{appliesTo:["text","phone","number","currency","checkbox","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>r.type==="checkbox"?e===true==(t===true):Zo(e,t,r),"evaluateInMemory")},is_not:{appliesTo:["text","phone","number","currency","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>!Zo(e,t,r),"evaluateInMemory")},contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},not_contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>!V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},starts_with:{appliesTo:["text","phone"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().startsWith(V(t).toLowerCase()),"evaluateInMemory")},ends_with:{appliesTo:["text"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().endsWith(V(t).toLowerCase()),"evaluateInMemory")},is_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>Xo(e),"evaluateInMemory")},is_not_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>!Xo(e),"evaluateInMemory")},less_than:wt((e,t)=>e<t),greater_than:wt((e,t)=>e>t),less_or_equal:wt((e,t)=>e<=t),greater_or_equal:wt((e,t)=>e>=t),is_within:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=It(e),n=chunkSDOYGWU4_js.Q(t);return r&&n?r.getTime()>=n.startMs&&r.getTime()<n.endMs:false},"evaluateInMemory")},on_day_month:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=It(e);if(!r)return false;let n=t;return r.getMonth()+1===n.month&&r.getDate()===n.day},"evaluateInMemory")},any_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Tt(t).map(V);return Tt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")},none_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Tt(t).map(V);return !Tt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")}};var Md=chunkDPD6ZWL2_js.a((e,t)=>({id:`system:${e}`,name:e,label:e,type:t,system:true}),"systemAttribute"),Ld=[...Object.entries(chunkSDOYGWU4_js.T).map(([e,t])=>Md(e,t))];function zw(e,t,r){let n=t;return Bd(e,{...t.values,id:t.id,objectId:t.objectId,objectName:n.objectName,tenantId:n.tenantId,label:t.label,createdAt:t.createdAt,updatedAt:t.updatedAt,createdBy:t.createdBy,lastUpdatedBy:t.lastUpdatedBy,deletedAt:t.deletedAt,deletedBy:t.deletedBy,visibility:t.visibility,ownedBy:t.ownedBy},[...r,...Ld])}chunkDPD6ZWL2_js.a(zw,"evaluateRecordFilterState");function Bd(e,t,r){if(e.rules.length===0)return true;let n=new Map(r.map(a=>[a.name,a])),o=e.combinator==="or"?"some":"every";return e.rules[o](a=>Ud(a,t,n))}chunkDPD6ZWL2_js.a(Bd,"evaluateFilterState");function Ud(e,t,r){let n=r.get(e.attribute);if(!n)return false;if(e.property&&n.type==="location"){if(!(chunkSDOYGWU4_js.g(e.property)&&chunkSDOYGWU4_js.h(e.operator)))return false;let l=St[e.operator];if(!l)return false;let p=t[e.attribute],I=typeof p=="object"&&p!==null?p[e.property]:void 0;return Hn(l,"text",e.operator,I,e.value,n)}if(e.property){let l=Yi(n).find(j=>j.name===e.property);if(!l)return false;let p=chunkSDOYGWU4_js.I(e.operator),I=St[p];if(!I?.appliesTo.includes(l.type))return false;let X=t[e.attribute],ae=(Array.isArray(X)?X:X==null?[]:[X]).some(j=>{if(typeof j!="object"||j===null)return false;let Y=j.props;return typeof Y!="object"||Y===null?false:Hn(I,l.type,p,Y[e.property],e.value,l)});return (e.quantifier??chunkSDOYGWU4_js.H(e.operator))==="none"?!ae:ae}let o=St[e.operator];if(!o||!o.appliesTo.includes(n.type))return false;let a=t[e.attribute],s=n.type==="relation"||n.type==="document"||n.type==="user"?zd(a):a;return Hn(o,n.type,e.operator,s,e.value,n)}chunkDPD6ZWL2_js.a(Ud,"evaluateRule");function Hn(e,t,r,n,o,a){let[s,l]=$d(t,r,n,o);return t==="phone"&&l===""&&r==="contains"?false:t==="phone"&&l===""&&r==="not_contains"?true:e.evaluateInMemory(s,l,a)}chunkDPD6ZWL2_js.a(Hn,"evaluateNormalizedComparands");function $d(e,t,r,n){return e==="date"&&(t==="is"||t==="is_not")?[ea(r),ea(n)]:e==="phone"?qd(r,n):[ta(e,r),ta(e,n)]}chunkDPD6ZWL2_js.a($d,"normalizeOperatorComparands");function ea(e){let t=Z(e)?fe(e):e;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10);if(typeof t!="string"||t==="")return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;let r=new Date(t);return Number.isNaN(r.getTime())?null:r.toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(ea,"normalizeUtcCalendarDay");function qd(e,t){let r=typeof t=="object"&&t!==null?t:{},n=typeof r.countryCode=="string"?r.countryCode:void 0,o=chunkDPD6ZWL2_js.a(a=>{let s=typeof a=="object"&&a!==null?a:{phoneNumber:a};if(typeof s.phoneNumber!="string")return null;if(!n)return chunkGXSNLYRR_js.a(s.phoneNumber);let l=typeof s.countryCode=="string"?s.countryCode:n;return `${l}:${chunkGXSNLYRR_js.b(s.phoneNumber,l)}`},"normalizeOne");return [o(e),o(t)]}chunkDPD6ZWL2_js.a(qd,"normalizePhoneComparands");function ta(e,t){return e==="currency"?chunkSDOYGWU4_js.F(t):e==="date"?Z(t)?fe(t):t instanceof Date?Number.isNaN(t.getTime())?null:t.toISOString():t:t}chunkDPD6ZWL2_js.a(ta,"normalizeComparableValue");function zd(e){let t=chunkDPD6ZWL2_js.a(r=>typeof r!="object"||r===null?r:r.id,"normalizeOne");return Array.isArray(e)?e.map(t):t(e)}chunkDPD6ZWL2_js.a(zd,"normalizeReferenceIds");var ra="today";function vt(e,t){return new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}chunkDPD6ZWL2_js.a(vt,"dateInTimezone");function Gd(e,t){if(!("defaultValue"in e))return;let{defaultValue:r}=e;return e.type!=="date"||r!==ra?r:e.includeTime?t.now.toISOString():vt(t.now,t.timezone)}chunkDPD6ZWL2_js.a(Gd,"resolveAttributeDefaultValue");function Xw(e,t,r){if(e.combinator==="or"&&e.rules.length>1)return {};let n=new Map(t.map(a=>[a.name,a])),o={};for(let a of e.rules){if(a.property!==void 0||Object.hasOwn(o,a.attribute))continue;let s=n.get(a.attribute);if(!s)continue;let l=Wd(a,r);l!==void 0&&(o[a.attribute]=chunkSDOYGWU4_js.j(s).storage.cardinality==="many"?[l]:l);}return o}chunkDPD6ZWL2_js.a(Xw,"deriveCreateDefaultsFromFilters");function Wd(e,t){if(e.operator==="is")return chunkSDOYGWU4_js.B(e.value)?na(e.value,t):e.value===null||Array.isArray(e.value)?void 0:e.value;if(e.operator==="any_of"){if(!Array.isArray(e.value)||e.value.length!==1)return;let r=e.value[0];return chunkSDOYGWU4_js.B(r)?na(r,t):r}}chunkDPD6ZWL2_js.a(Wd,"extractDeterministicValue");function na(e,t){if(t){if(e.dynamic==="actor")return t.userId;if(e.anchor==="today")return vt(t.now,t.timezone);if(e.anchor==="now")return t.now.toISOString()}}chunkDPD6ZWL2_js.a(na,"resolveDynamicValue");var tx={status:"connector_status",error:"connector_error",provider:"connector_provider"};var Kd=(t=>(t.Desktop="desktop",t))(Kd||{});var ix=["force","skip"],ox=["none","all","external_only"],ax="x-fake-signature",sx={override:null,status:"none",failureReason:null,botId:null};var Yd=/^Session \d+$/;function ia(e){let t=e.replace(/\s+/g," ").trim().replace(/[.!?]+$/,"");return t?t.length>60?`${t.slice(0,59).trimEnd()}...`:t:"New conversation"}chunkDPD6ZWL2_js.a(ia,"buildAgentFallbackTitle");function Hd(e){let t=e.generated?.trim();return t&&!Yd.test(t)?t:e.firstUserText?ia(e.firstUserText):e.emptyLabel}chunkDPD6ZWL2_js.a(Hd,"conversationDisplayTitle");var Qn=/^[a-z0-9][a-z0-9-]{0,62}$/;function Qd(e){if(!Qn.test(e))throw new chunk72TQRSNX_js.h(`Invalid schema source id "${e}": expected a lowercase slug matching ${Qn}`,[])}chunkDPD6ZWL2_js.a(Qd,"assertSchemaSourceId");function Jd(e){return {label:e.label,description:e.description??null,icon:e.icon??null,config:e.config,default:e.default??false,metadata:e.metadata??null}}chunkDPD6ZWL2_js.a(Jd,"viewSyncPayload");function gx(e){let{attributeRemovals:t,objectRemovals:r,renames:n}=e.destructive;return t.length>0||r.length>0||n.length>0}chunkDPD6ZWL2_js.a(gx,"hasDestructiveEntries");var $={objectAdditions:20,totalMutations:500,serializedBytes:512*1024};function Xn(e){return e instanceof Error?e.message:String(e)}chunkDPD6ZWL2_js.a(Xn,"errorMessage");var Xd=Jt.z.enum(["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"]).describe('The attribute\'s data type. Determines which keys `config` accepts and requires: `status`/`select`/`multiselect` need a non-empty `options` array (each `status` option carrying its own `group`); `relation` needs `targets` (non-empty) and `cardinality` ("one" or "many"); `formula` needs `expression` and `returnType`; `rollup` needs `targetAttribute` and `function`. Every other type accepts only the shared presentation keys (`placeholder`, `defaultValue`, `icon`, ...) plus a few type-specific optionals (e.g. `number.decimals`, `date.dateFormat`). An attribute\'s type can never be changed later through this tool \u2014 only through a code migration \u2014 so pick it correctly now.');var ca=Jt.z.string().min(1).superRefine((e,t)=>{try{Ce(e);}catch(r){t.addIssue({code:Jt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe('The attribute\'s machine name \u2014 the record\'s field key, and what `{{ name }}` refers to in a labelExpression. Must be a valid identifier: starts with a letter or underscore, then only letters/digits/underscores ("montantHt", "first_name", "FIRST_NAME" are valid; "first-name", "first name", "123name" are not). Max 63 characters. Cannot be a name reserved by the record shape itself (id, createdAt, updatedAt, createdBy, lastUpdatedBy, objectId, label, embeddingText, values, metadata, deletedAt, deletedBy, schemaVersion).'),Zd=Jt.z.string().min(1).superRefine((e,t)=>{chunkSDOYGWU4_js.A.includes(e)&&t.addIssue({code:Jt.z.ZodIssueCode.custom,message:`"${e}" is a reserved object name (${chunkSDOYGWU4_js.A.join(", ")}) and cannot be used for a new object.`});try{De(e);}catch(r){t.addIssue({code:Jt.z.ZodIssueCode.custom,message:Xn(r)});}}).describe(`The new object's machine name: kebab-case slug, lowercase letters/digits/hyphens only, starting with a letter ("products", "user-profiles", "order-items" are valid; "Products", "userProfiles", "user_profiles" are not). Max 63 characters. Cannot be a name the platform reserves for its own system objects, and cannot already exist.`);function pa(e){return e.superRefine((t,r)=>{try{let n=chunk47EGJRW7_js.n(t.type,{...t.config??{},description:t.description}),o=Object.keys(t.config??{}).filter(a=>!Object.hasOwn(n,a));o.length>0&&r.addIssue({code:"unrecognized_keys",keys:o,path:["config"],message:`Unrecognized attribute config key${o.length===1?"":"s"}: ${o.join(", ")}`});}catch(n){if(n instanceof chunk72TQRSNX_js.h){for(let o of n.errors)r.addIssue({code:Jt.z.ZodIssueCode.custom,path:["config",...o.path.map(a=>/^\d+$/.test(a)?Number(a):a)],message:`Config for type "${t.type}" is invalid or incomplete: ${o.message}`});return}r.addIssue({code:Jt.z.ZodIssueCode.custom,path:["config"],message:`Config for type "${t.type}" is invalid or incomplete: ${Xn(n)}`});}})}chunkDPD6ZWL2_js.a(pa,"withConfigCheck");var ma=Jt.z.object({objectName:Jt.z.string().min(1).describe("Name of the existing (or, elsewhere in the same plan, newly created) object this attribute is added to. Ignored for an attribute declared inline in `additive.objects[].attributes` \u2014 there the parent object's own `name` is used instead."),name:ca,label:Jt.z.string().min(1).max(128).describe("Human-readable display label shown in the UI. 1-128 characters, cannot be empty."),type:Xd,config:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional().describe('Type-specific configuration; required keys depend on `type` (see `type`\'s description). Shared optional keys on every type: `placeholder`, `defaultValue`, `icon`, `order`, `hidden`, `archived`, `deprecated`, `metadata`. Per-type keys: `text` \u2014 `multiline`, `minLength`, `maxLength`, `pattern`, `format` ("email"|"url"|"slug"); `number` \u2014 `renderAs` ("number"|"rating"), `min`, `max`, `unit`, `decimals`; `date` \u2014 `dateFormat`, `minDate`, `maxDate`, `includeTime`, `endDate`, `timeFormat` ("12h"|"24h"); `phone` \u2014 `defaultCountryCode` (3-letter); `currency` \u2014 `defaultCurrency`, `allowedCurrencies`, `allowNegative`; `status`/`select`/`multiselect` \u2014 `options` (REQUIRED, non-empty array of `{ value, label, color }`, unique `value`s; for `status` every OPTION also carries `group` as idle|in_progress|finished \u2014 `group` belongs on each option, never on `config` itself; select/multiselect accept `renderAs: "badges"`); `location` \u2014 `granularity`, `defaultCountry`, `allowedCountries`; `user` \u2014 `types` ("user"|"agent"), `multiple`; `relation` \u2014 `targets` (REQUIRED, non-empty array of `{ object }`) and `cardinality` (REQUIRED, "one"|"many"); `formula` \u2014 `expression` (REQUIRED formula string) and `returnType` (REQUIRED); `rollup` \u2014 `targetAttribute` (REQUIRED) and `function` (REQUIRED, e.g. "sum"|"avg"|"count"); `document` \u2014 `properties`, `accepts`, `maxFileSize`. Omit entirely for `richtext`/`checkbox`, which take no type-specific keys.'),required:Jt.z.boolean().optional().describe("Whether the attribute must have a value on every record. Defaults to false (optional)."),description:Jt.z.string().optional().describe("Help text shown under the field in the UI. Not the same as the plan's `summary`.")}).strict(),ec=pa(ma),tc=pa(ma.omit({objectName:true})),rc=Jt.z.object({name:Zd,label:Jt.z.string().min(1).describe('Human-readable singular display label (e.g. "Devis").'),pluralLabel:Jt.z.string().optional().describe('Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'),description:Jt.z.string().optional().describe("Help text describing what this object represents."),icon:chunk47EGJRW7_js.c.describe("Required icon name for the object. Must be a catalogue value \u2014 call `search_icons` and use a name it returns verbatim. A name that is not in the catalogue is rejected without any hint as to what would have worked, so never guess one."),labelExpression:be.describe('Template used to render a human-readable label for every record of this object \u2014 e.g. shown in relations, search results, and breadcrumbs. MUST contain at least one `{{ attributeName }}` interpolation referencing an attribute this object will actually have (either declared in this same `attributes` array, or an existing attribute if this is an update) \u2014 a plain string with no `{{ }}` at all (e.g. "Devis") is rejected. Interpolations cannot be empty (`{{ }}` is rejected) and only these pipes are allowed: UPPER, LOWER, capitalize, trim, prefix:"...", suffix:"...", wrap:"..." "...", default:"...". `{{ a || b }}` falls back to `b` when `a` is empty. Examples: "{{ firstName }} {{ lastName }}", "{{ numero | UPPER }}", "{{ name || reference }}".'),attributes:Jt.z.array(tc).default([]).describe("Attributes to create on this new object, inline. Same rules as a standalone entry in `additive.attributes`, minus `objectName` (implied by this object). At least one attribute referenced by `labelExpression` should be included here.")}).strict(),fa=Jt.z.object({attributeRemovals:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object the attribute is removed from."),attributeName:Jt.z.string().min(1).describe("Attribute to delete, together with every record's stored value for it. Must not be a system (code-declared) attribute, and must not be referenced by the object's own `labelExpression` or `embeddingExpression` \u2014 update those first.")}).strict()).default([]).describe("Attributes to permanently delete. Irreversible: record values for the attribute are purged."),objectRemovals:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object to delete entirely, together with all its records. Must not be a system (code-declared) object, and must not still be targeted by a `relation` attribute on another object \u2014 retarget or remove that relation first.")}).strict()).default([]).describe("Objects to permanently delete, records included. Irreversible."),renames:Jt.z.array(Jt.z.object({objectName:Jt.z.string().min(1).describe("Object the renamed attribute belongs to."),from:Jt.z.string().min(1).describe("Current attribute name. Must already exist and not be a system attribute."),to:ca.describe("New attribute name \u2014 same identifier rules as any attribute `name` (see `name` on a planned attribute), and must not collide with another name already on the object, including one added elsewhere in this same plan.")}).strict()).default([]).describe("Attribute renames. Every reference to the old name (labelExpression, views, formulas) must be updated separately \u2014 a rename does not follow references automatically.")}).strict().default({attributeRemovals:[],objectRemovals:[],renames:[]}),ba=Jt.z.string().min(1).describe("ONE sentence naming the intent of the change \u2014 what it is for, not what it contains. The human approving it has already watched every entry land in the preview window and can read every row of the plan itself, so a recap tells them nothing they do not have. A second sentence is warranted only when `destructive` is non-empty: say plainly what will be lost (e.g. 'deletes the \"ancienMontant\" column and its data on every devis'). Never restate the plan \u2014 explain intent."),oa="The COMPLETE config this view should end up with \u2014 not a patch. Copy the baseline returned by get_default_view and edit it, preserving every tab and setting you are not changing: anything you omit is dropped. To change the columns shown, set `tabs[].columns` (an array of attribute names) \u2014 there is no top-level `columns` on either view type. For a detail view's side panel, set `sidePanel.attributes`. Every attribute name listed must already exist on the object, or be created earlier in this same plan. ONE EXCEPTION to omit-is-dropped: a tab with `type: \"custom\"` renders a component belonging to the application, which you cannot describe or recreate. Copy every such tab through from the baseline exactly as it came, `name`, `component` and `props` untouched \u2014 dropping one, inventing one, or altering any of those three is rejected rather than applied (`name` is the tab's address in links, not its wording). Its `label` and `icon` you may change.",aa="Opaque token returned by get_default_view alongside the baseline you edited. REQUIRED when the object already exists \u2014 it proves you authored against the baseline that is still current. Must be OMITTED when this plan creates the object, which has no baseline yet.",sa=Jt.z.string().min(1).describe("Name of the object whose default view of this type is replaced. Not a view name \u2014 a plan can only replace an object's deterministic default view, never create a view or target a non-default one."),nc=Jt.z.discriminatedUnion("viewType",[Jt.z.object({objectName:sa,viewType:Jt.z.literal("list").describe("Targets the object's default list view (the grid)."),canonicalConfig:chunkSDOYGWU4_js.ka.describe(oa),baselineToken:Jt.z.string().min(1).optional().describe(aa)}).strict(),Jt.z.object({objectName:sa,viewType:Jt.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),canonicalConfig:chunkSDOYGWU4_js.la.describe(oa),baselineToken:Jt.z.string().min(1).optional().describe(aa)}).strict()]);var ua=Jt.z.string().regex(/^[0-9a-f]{64}$/,"Expected a lowercase SHA-256 hash"),la={baseConfigHash:ua.nullable(),targetConfigHash:ua,baselineOrigin:Jt.z.enum(["persisted","generated","absent"])},ic=Jt.z.discriminatedUnion("viewType",[Jt.z.object({objectName:Jt.z.string().min(1),viewType:Jt.z.literal("list"),canonicalConfig:chunkSDOYGWU4_js.ka,...la}).strict(),Jt.z.object({objectName:Jt.z.string().min(1),viewType:Jt.z.literal("detail"),canonicalConfig:chunkSDOYGWU4_js.la,...la}).strict()]).superRefine((e,t)=>{let r=e.baselineOrigin!=="absent";r!==(e.baseConfigHash!==null)&&t.addIssue({code:"custom",path:["baseConfigHash"],message:r?`A ${e.baselineOrigin} baseline requires baseConfigHash`:"An absent baseline requires baseConfigHash to be null"});});function ga(e){return Jt.z.object({objects:Jt.z.array(rc).default([]).describe("New objects to create, with their attributes inline."),attributes:Jt.z.array(ec).default([]).describe("Attributes to add to existing or same-plan objects."),viewUpdates:Jt.z.array(e).default([]).describe("Complete target configs for deterministic default views; never view names.")}).strict().default({objects:[],attributes:[],viewUpdates:[]})}chunkDPD6ZWL2_js.a(ga,"buildAdditiveSchema");function Jn(e,t=[],r=new WeakSet){if(e===null||typeof e=="string"||typeof e=="boolean")return null;if(typeof e=="number")return Number.isFinite(e)?null:{path:t,message:"Plan input contains a non-finite number"};if(typeof e!="object")return {path:t,message:"Plan input must contain only JSON-safe values"};if(r.has(e))return {path:t,message:"Plan input cannot contain circular references"};if(Array.isArray(e)){r.add(e);for(let s of Reflect.ownKeys(e))if(s!=="length"&&(typeof s=="symbol"||!/^(0|[1-9]\d*)$/.test(s)))return r.delete(e),{path:[...t,s],message:"Plan input arrays cannot contain non-index JSON properties"};for(let s=0;s<e.length;s++){if(!Object.hasOwn(e,s))return r.delete(e),{path:[...t,s],message:"Plan input cannot contain sparse arrays"};let l=Jn(e[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return {path:t,message:"Plan input must contain only plain JSON objects"};r.add(e);let o=e,a=Reflect.ownKeys(o);for(let s of a){let l=Object.getOwnPropertyDescriptor(o,s);if(typeof s=="symbol"||!(l?.enumerable&&"value"in l))return r.delete(e),{path:[...t,s],message:"Plan input objects must contain enumerable JSON data properties only"}}for(let s of a.sort()){let l=Jn(o[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}chunkDPD6ZWL2_js.a(Jn,"findJsonSafetyIssue");function oc(e){let t=[];return e.additive.objects.forEach((r,n)=>{t.push(["additive","objects",n]),r.attributes.forEach((o,a)=>{t.push(["additive","objects",n,"attributes",a]);});}),e.additive.attributes.forEach((r,n)=>{t.push(["additive","attributes",n]);}),e.additive.viewUpdates.forEach((r,n)=>{t.push(["additive","viewUpdates",n]);}),e.destructive.attributeRemovals.forEach((r,n)=>{t.push(["destructive","attributeRemovals",n]);}),e.destructive.objectRemovals.forEach((r,n)=>{t.push(["destructive","objectRemovals",n]);}),e.destructive.renames.forEach((r,n)=>{t.push(["destructive","renames",n]);}),t}chunkDPD6ZWL2_js.a(oc,"mutationPaths");function ya(e,t){e.additive.objects.length>$.objectAdditions&&t.addIssue({code:"too_big",origin:"array",maximum:$.objectAdditions,inclusive:true,path:["additive","objects",$.objectAdditions],message:`A schema plan can add at most ${$.objectAdditions} objects`});let r=oc(e);r.length>$.totalMutations&&t.addIssue({code:"too_big",origin:"array",maximum:$.totalMutations,inclusive:true,path:r[$.totalMutations],message:`A schema plan can contain at most ${$.totalMutations} mutations; received ${r.length}`});}chunkDPD6ZWL2_js.a(ya,"addPlanLimitIssues");function ha(e,t){let r=Jn(e);if(r)return t.addIssue({code:"custom",path:r.path,message:r.message}),Jt.z.NEVER;let n=new TextEncoder().encode(chunkLQYUPOWB_js.a(e)).byteLength;return n>$.serializedBytes?(t.addIssue({code:"too_big",origin:"string",maximum:$.serializedBytes,inclusive:true,path:[],message:`A schema plan can serialize to at most ${$.serializedBytes} UTF-8 bytes; received ${n}`}),Jt.z.NEVER):e}chunkDPD6ZWL2_js.a(ha,"boundSerializedPlanInput");var ac=ga(nc),sc=ga(ic),da=Jt.z.object({schemaPlanVersion:Jt.z.literal(2).describe("Required proposal contract version."),summary:ba,additive:ac,destructive:fa}).strict().superRefine((e,t)=>{let r=new Set(e.additive.objects.map(n=>n.name));e.additive.viewUpdates.forEach((n,o)=>{let a=["additive","viewUpdates",o,"baselineToken"];if(r.has(n.objectName)){n.baselineToken!==void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an object added by this plan must not include baselineToken"});return}n.baselineToken===void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an existing object requires baselineToken"});}),ya(e,t);}),Dx=Object.assign(Jt.z.preprocess(ha,da),{shape:da.shape}),uc=Jt.z.object({schemaPlanVersion:Jt.z.literal(2),summary:ba,additive:sc,destructive:fa}).strict().superRefine(ya),Cx=Jt.z.preprocess(ha,uc);var A=Jt.z.number().finite().nonnegative(),Ta=Jt.z.enum(Li),Zn=Jt.z.enum(Bi),ei=Jt.z.enum(Ui),wa=Jt.z.object({provider:Ta,model:Jt.z.string().min(1)}).strict(),Fx=Jt.z.object({speed:Zn.optional(),reasoning:ei.optional()}).strict(),xa=Jt.z.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),lc=Jt.z.object({model:wa.optional(),speed:Zn.optional(),reasoning:ei.optional(),imageModel:xa.optional()}).strict(),Vx=lc.refine(e=>e.model!==void 0||e.speed!==void 0||e.reasoning!==void 0||e.imageModel!==void 0,{message:"At least one inference override is required"}),jx=Jt.z.object({model:wa.nullable().optional(),speed:Zn.nullable().optional(),reasoning:ei.nullable().optional(),imageModel:xa.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0&&Object.values(e).every(t=>t!==void 0),{message:"At least one inference override is required"}),Ia=Jt.z.object({label:Jt.z.string(),denied:Jt.z.boolean().optional(),deletion:Jt.z.object({target:Jt.z.string().optional(),count:A.optional(),restorableDays:A.optional()}).strict().optional(),counts:Jt.z.record(Jt.z.string(),A).optional(),warnings:Jt.z.array(Jt.z.string()).optional()}).strict(),dc=Jt.z.union([Jt.z.object({type:Jt.z.literal("text"),text:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("reasoning"),text:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("system"),code:Jt.z.enum(qt)}).strict(),Jt.z.object({type:Jt.z.literal("error"),error:Jt.z.string(),errorClass:Jt.z.string().optional()}).strict(),Jt.z.object({type:Jt.z.literal("tool"),toolCallId:Jt.z.string(),name:Jt.z.string(),args:Jt.z.record(Jt.z.string(),Jt.z.unknown()),result:Jt.z.unknown().optional(),error:Jt.z.string().optional(),errorCode:Jt.z.enum(["output_limit_reached","interrupted"]).optional(),state:Jt.z.enum(["streaming","running","completed","error","approval-requested","approval-responded","approval-dispatched"]),durationMs:A.optional(),approvalId:Jt.z.string().optional(),approvalImpact:Ia.optional(),approved:Jt.z.boolean().optional(),approvalReason:Jt.z.string().optional(),approvalRelaxableByAuto:Jt.z.boolean().optional()}).strict(),Jt.z.object({type:Jt.z.literal("file"),fileId:Jt.z.string(),name:Jt.z.string(),mimeType:Jt.z.string()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("in-progress"),reason:Jt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("completed"),tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Jt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Jt.z.string().optional()}).strict(),Jt.z.object({type:Jt.z.literal("compaction"),state:Jt.z.literal("failed"),reason:Jt.z.string(),durationMs:A.optional()}).strict()]),cc=Jt.z.object({id:Jt.z.string(),name:Jt.z.string(),mimeType:Jt.z.string(),size:A}).strict(),pc=Jt.z.object({id:Jt.z.string(),type:Jt.z.string().transform(e=>e),entityId:Jt.z.string(),label:Jt.z.string(),objectName:Jt.z.string().optional(),startIndex:A,endIndex:A}).strict(),mc=Jt.z.object({provider:Ta,model:Jt.z.string(),maxTokens:A.optional(),contextWindow:A.optional()}).strict(),fc=Jt.z.union([Jt.z.date(),Jt.z.string().datetime({offset:true}).transform(e=>new Date(e))]),Aa=Jt.z.object({id:Jt.z.string(),sessionId:Jt.z.string(),tenantId:Jt.z.string().optional(),runId:Jt.z.string().optional(),role:Jt.z.enum(["user","assistant","system","tool"]),parts:Jt.z.array(dc),attachments:Jt.z.array(cc).optional(),mentions:Jt.z.array(pc).optional(),model:mc.optional(),tokenUsage:Jt.z.object({input:A,output:A}).strict().optional(),metadata:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional(),createdAt:fc}).strict(),bc=Jt.z.object({id:Jt.z.string(),description:Jt.z.string(),status:Jt.z.enum(["pending","in_progress","completed","blocked"]),result:Jt.z.string().optional(),updatedAt:A.optional()}).strict(),gc=Jt.z.object({id:Jt.z.string(),sessionId:Jt.z.string(),status:Jt.z.enum(["active","completed","abandoned"]),todos:Jt.z.array(bc),version:A,createdAt:Jt.z.string(),updatedAt:Jt.z.string(),completedAt:Jt.z.string().optional()}).strict(),Sa={"session-named":Jt.z.object({name:Jt.z.string()}).strict(),"compaction-start":Jt.z.object({reason:Jt.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),"compaction-end":Jt.z.object({tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:Jt.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:Jt.z.string().optional()}).strict(),"compaction-failed":Jt.z.object({reason:Jt.z.string()}).strict(),usage:Jt.z.object({messageId:Jt.z.string().min(1).optional(),inputTokens:A,outputTokens:A,totalTokens:A,cacheReadTokens:A.optional(),cacheCreationTokens:A.optional(),contextWindow:A,residentTokens:A,utilization:Jt.z.number().finite().min(0).max(1),costUsd:A.optional()}).strict(),"message-persisted":Jt.z.object({message:Aa}).strict(),"message-updated":Jt.z.object({message:Aa}).strict(),"todo-plan-update":Jt.z.object({plan:gc}).strict(),"approval-context":Jt.z.object({approvalId:Jt.z.string(),toolCallId:Jt.z.string(),impact:Ia.optional(),relaxableByAuto:Jt.z.boolean().optional()}).strict(),"session-state":Jt.z.object({state:Jt.z.object({phase:Jt.z.enum(["queued","running","parked","terminal"]),parkedOn:Jt.z.enum(["human","agents"]).optional(),humanRequestIds:Jt.z.array(Jt.z.string()).optional(),outcome:Jt.z.enum(["completed","failed","cancelled","timeout","expired"]).optional()}).strict(),version:Jt.z.number().int().positive(),updatedAt:Jt.z.string().datetime({offset:true})}).strict()};function yc(e){return e in Sa}chunkDPD6ZWL2_js.a(yc,"isAgentUIDataName");function hc(e){return new chunk72TQRSNX_js.h("Invalid agent UI message chunk",e.map(t=>({path:t.path.map(String),message:t.message,code:t.code})))}chunkDPD6ZWL2_js.a(hc,"agentUIValidationError");function Ac(e){if(typeof e!="object"||e===null||typeof e.type!="string")throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected UI message chunk type",code:"invalid_type"}]);let t=e.type;if(!t.startsWith("data-"))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected agent data chunk type",code:"invalid_value"}]);let r=t.slice(5);if(!yc(r))throw new chunk72TQRSNX_js.h("Invalid agent UI message chunk",[{path:["type"],message:`Unknown agent UI data type: ${r}`,code:"invalid_value"}]);let n=Jt.z.object({type:Jt.z.literal(`data-${r}`),id:Jt.z.string().optional(),data:Sa[r],transient:Jt.z.boolean().optional()}).strict().safeParse(e);if(!n.success)throw hc(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(Ac,"assertCustomAgentUIMessageChunk");function Mx(e,t,r){return Ac({type:`data-${e}`,...r?.id!==void 0?{id:r.id}:{},data:t,...r?.transient!==void 0?{transient:r.transient}:{}})}chunkDPD6ZWL2_js.a(Mx,"agentDataChunk");function Rt(e){return e}chunkDPD6ZWL2_js.a(Rt,"defineOperation");function y(e,t,r){let n=t==="atomic"?"none":t==="local"?"if-not-visible":"follow";return o=>{let a=r?.(o);return {impact:t,navigation:n,focus:{...e(o),...a===void 0?{}:{propertyPath:a}}}}}chunkDPD6ZWL2_js.a(y,"definePresentation");var ti={id:Jt.z.string().min(1)},v={...ti,viewId:Jt.z.string().min(1)};function S(e,t,r){if(!e.views.some(n=>n.id===t))throw new chunk72TQRSNX_js.h(`View "${t}" is not in the draftable state`,[]);return {...e,views:e.views.map(n=>n.id===t?r(n):n)}}chunkDPD6ZWL2_js.a(S,"mapView");function Ra(e,t,r){let n=[...e],[o]=n.splice(t,1);return n.splice(r,0,o),n}chunkDPD6ZWL2_js.a(Ra,"moveWithin");function Fe(e,t,r){if(t.length!==e.length)throw new chunk72TQRSNX_js.h(`${r} order lists ${t.length} ids for ${e.length} items`,[]);return t.map(n=>{let o=e.find(a=>a.id===n);if(!o)throw new chunk72TQRSNX_js.h(`${r} "${n}" is not in this collection`,[]);return o})}chunkDPD6ZWL2_js.a(Fe,"reorderById");function ne(e,t,r){let n=e.tabs.find(o=>o.id===t);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t}" is not in view "${e.id}"`,[]);if(n.type!=="form")throw new chunk72TQRSNX_js.h(`Tab "${t}" is not a form tab`,[]);return {...e,tabs:e.tabs.map(o=>o.id===t?r(n):o)}}chunkDPD6ZWL2_js.a(ne,"mapFormTab");function Ct(e,t){let r=e.groups.find(n=>n.id===t);if(!r)throw new chunk72TQRSNX_js.h(`Group "${t}" is not in tab "${e.id}"`,[]);return r}chunkDPD6ZWL2_js.a(Ct,"requireGroup");function ri(e,t){for(let r of e.groups){let n=r.fields.find(o=>o.id===t);if(n)return {group:r,field:n}}throw new chunk72TQRSNX_js.h(`Field slot "${t}" is not in tab "${e.id}"`,[])}chunkDPD6ZWL2_js.a(ri,"locateField");function Et(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Et,"viewFocus");function Dt(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(Dt,"tabFocus");function Ea(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}}chunkDPD6ZWL2_js.a(Ea,"groupFocus");function Da(e){return {viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Da,"fieldFocus");function Ca(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a(Ca,"addTabFocus");function Na(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.group.id}}chunkDPD6ZWL2_js.a(Na,"addGroupFocus");function ka(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId,fieldId:e.field.id}}chunkDPD6ZWL2_js.a(ka,"addFieldFocus");function Oa(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.toGroupId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Oa,"moveFieldFocus");function Ve(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Ve,"firstChangedProperty");var Tc=chunkSDOYGWU4_js.ia,wc=chunkSDOYGWU4_js.da,xc=chunkSDOYGWU4_js.ca,Ic=Jt.z.object({...v,type:Jt.z.literal("add_tab"),tab:Tc}),Sc={type:"add_tab",schema:Ic,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(r.tabs.some(n=>n.id===t.tab.id))throw new chunk72TQRSNX_js.h(`Tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,tabs:[...r.tabs,t.tab]}}),"apply"),focus:Ca,presentation:y(Ca,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},vc=Jt.z.object({...v,type:Jt.z.literal("remove_tab"),tabId:Jt.z.string().min(1)}),Rc={type:"remove_tab",schema:vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.filter(n=>n.id!==t.tabId)}}),"apply"),focus:Dt,presentation:y(Dt,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},Ma=Jt.z.object({label:Jt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),order:Jt.z.number().int().optional()}),Ec=Object.keys(Ma.shape),Dc=Jt.z.object({...v,type:Jt.z.literal("update_tab"),tabId:Jt.z.string().min(1),changes:Ma.refine(e=>Object.keys(e).length>0,"update_tab needs at least one change")}),_a=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabFocus"),Cc={type:"update_tab",schema:Dc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.map(n=>n.id===t.tabId?{...n,...t.changes}:n)}}),"apply"),focus:_a,presentation:y(_a,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},Nc=Jt.z.object({...v,type:Jt.z.literal("reorder_tabs"),tabOrder:Jt.z.array(Jt.z.string().min(1))}),kc={type:"reorder_tabs",schema:Nc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,tabs:Fe(r.tabs,t.tabOrder,"Tab")})),"apply"),focus:Et,presentation:y(Et,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},Oc=Jt.z.object({...v,type:Jt.z.literal("add_group"),tabId:Jt.z.string().min(1),group:wc}),_c={type:"add_group",schema:Oc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(n.groups.some(o=>o.id===t.group.id))throw new chunk72TQRSNX_js.h(`Group "${t.group.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:[...n.groups,t.group]}})),"apply"),focus:Na,presentation:y(Na,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le groupe \xAB ${e.group.label} \xBB`,"describe")},Pc=Jt.z.object({...v,type:Jt.z.literal("remove_group"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1)}),Fc={type:"remove_group",schema:Pc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ct(n,t.groupId),{...n,groups:n.groups.filter(o=>o.id!==t.groupId)}))),"apply"),focus:Ea,presentation:y(Ea,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime le groupe ${e.groupId}`,"describe")},Vc=Jt.z.object({...v,type:Jt.z.literal("update_group"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),description:Jt.z.string().optional(),collapsible:Jt.z.boolean().optional(),collapsed:Jt.z.boolean().optional(),order:Jt.z.number().int().optional()}).refine(e=>Object.keys(e).length>0,"update_group needs at least one change")}),Pa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}),"updateGroupFocus"),jc={type:"update_group",schema:Vc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Ct(n,t.groupId),{...n,groups:n.groups.map(o=>o.id===t.groupId?{...o,...t.changes}:o)}))),"apply"),focus:Pa,presentation:y(Pa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme le groupe en \xAB ${e.changes.label} \xBB`:"Modifie le groupe","describe")},Mc=Jt.z.object({...v,type:Jt.z.literal("reorder_groups"),tabId:Jt.z.string().min(1),groupOrder:Jt.z.array(Jt.z.string().min(1))}),Lc={type:"reorder_groups",schema:Mc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>({...n,groups:Fe(n.groups,t.groupOrder,"Group")}))),"apply"),focus:Dt,presentation:y(Dt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les groupes","describe")},Bc=Jt.z.object({...v,type:Jt.z.literal("add_field"),tabId:Jt.z.string().min(1),groupId:Jt.z.string().min(1),field:xc,index:Jt.z.number().int().min(0).optional()}),Uc={type:"add_field",schema:Bc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(Ct(n,t.groupId),n.groups.some(o=>o.fields.some(a=>a.id===t.field.id)))throw new chunk72TQRSNX_js.h(`Field slot "${t.field.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:n.groups.map(o=>{if(o.id!==t.groupId)return o;let a=t.index??o.fields.length;return {...o,fields:[...o.fields.slice(0,a),t.field,...o.fields.slice(a)]}})}})),"apply"),focus:ka,presentation:y(ka,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le champ ${e.field.attribute??e.field.id}`,"describe")},$c=Jt.z.object({...v,type:Jt.z.literal("remove_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1)}),qc={type:"remove_field",schema:$c,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o}=ri(n,t.fieldId);return {...n,groups:n.groups.map(a=>a.id===o.id?{...a,fields:a.fields.filter(s=>s.id!==t.fieldId)}:a)}})),"apply"),focus:Da,presentation:y(Da,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Retire le champ ${e.fieldId}`,"describe")},zc=Jt.z.object({...v,type:Jt.z.literal("move_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1),toGroupId:Jt.z.string().min(1),toIndex:Jt.z.number().int().min(0)}),Gc={type:"move_field",schema:zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o,field:a}=ri(n,t.fieldId),s=Ct(n,t.toGroupId);if(o.id===s.id){let l=o.fields.findIndex(p=>p.id===t.fieldId);return {...n,groups:n.groups.map(p=>p.id===o.id?{...p,fields:Ra(p.fields,l,t.toIndex)}:p)}}return {...n,groups:n.groups.map(l=>l.id===o.id?{...l,fields:l.fields.filter(p=>p.id!==t.fieldId)}:l.id===s.id?{...l,fields:[...l.fields.slice(0,t.toIndex),a,...l.fields.slice(t.toIndex)]}:l)}})),"apply"),focus:Oa,presentation:y(Oa,"local"),describe:chunkDPD6ZWL2_js.a(e=>`D\xE9place le champ ${e.fieldId} vers le groupe ${e.toGroupId}`,"describe")},Wc=Jt.z.object({...v,type:Jt.z.literal("update_field"),tabId:Jt.z.string().min(1),fieldId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().optional(),readOnly:Jt.z.boolean().optional(),span:Jt.z.number().int().min(1).max(12).optional()}).refine(e=>Object.keys(e).length>0,"update_field needs at least one change")}),Fa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}),"updateFieldFocus"),Kc={type:"update_field",schema:Wc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(ri(n,t.fieldId),{...n,groups:n.groups.map(o=>({...o,fields:o.fields.map(a=>a.id===t.fieldId?{...a,...t.changes}:a)}))}))),"apply"),focus:Fa,presentation:y(Fa,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Modifie le champ ${e.fieldId}`,"describe")},La=Jt.z.object({source:chunkSDOYGWU4_js.ga.optional(),columns:chunkSDOYGWU4_js.X.optional(),filters:chunkSDOYGWU4_js._.nullable().optional(),sorts:chunkSDOYGWU4_js.Z.nullable().optional(),allowCreate:Jt.z.boolean().optional(),allowEdit:Jt.z.boolean().optional(),allowDelete:Jt.z.boolean().optional(),createMode:Jt.z.enum(["redirect","inline","peek"]).optional()}),Yc=Object.keys(La.shape),Ba=Jt.z.object({emailAttributeIds:Jt.z.array(Jt.z.string().min(1)).optional(),attribute:Jt.z.string().min(1).optional(),titleAttribute:Jt.z.string().min(1).nullable().optional(),component:Jt.z.string().nullable().optional(),props:Jt.z.record(Jt.z.string(),Jt.z.unknown()).nullable().optional()}),Hc=Object.keys(Ba.shape),Qc={emailAttributeIds:["emails","meetings"],attribute:["richtext"],titleAttribute:["richtext"],component:["custom"],props:["custom"]},Jc=Jt.z.object({...v,type:Jt.z.literal("update_tab_config"),tabId:Jt.z.string().min(1),changes:Ba.refine(e=>Object.keys(e).length>0,"update_tab_config needs at least one change")}),Va=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabConfigFocus"),Xc={type:"update_tab_config",schema:Jc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(o=>o.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);for(let o of Object.keys(t.changes)){let a=Qc[o];if(a&&!a.includes(n.type))throw new chunk72TQRSNX_js.h(`"${o}" is not a setting of a "${n.type}" tab`,[])}return {...r,tabs:r.tabs.map(o=>o.id===t.tabId?{...o,...t.changes}:o)}}),"apply"),focus:Va,presentation:y(Va,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>`Configure ${Object.keys(e.changes).join(", ")} sur l'onglet ${e.tabId}`,"describe")},Zc=Jt.z.object({...v,type:Jt.z.literal("update_table_tab"),tabId:Jt.z.string().min(1),changes:La.refine(e=>Object.keys(e).length>0,"update_table_tab needs at least one change")}),ja=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTableTabFocus"),ep={type:"update_table_tab",schema:Zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(l=>l.id===t.tabId);if(!n)throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);if(n.type!=="table")throw new chunk72TQRSNX_js.h(`Tab "${t.tabId}" is not a table tab`,[]);let o=Object.entries(t.changes),a=Object.fromEntries(o.filter(([,l])=>l!==null)),s=new Set(o.filter(([,l])=>l===null).map(([l])=>l));return {...r,tabs:r.tabs.map(l=>l.id===t.tabId?Object.fromEntries(Object.entries({...l,...a}).filter(([p])=>!s.has(p))):l)}}),"apply"),focus:ja,presentation:y(ja,"atomic",Ve),describe:chunkDPD6ZWL2_js.a(e=>e.changes.columns?`Affiche ${e.changes.columns.length} colonne(s) dans l'onglet ${e.tabId}`:`Modifie l'onglet ${e.tabId}`,"describe")},tp=Jt.z.object({...v,type:Jt.z.literal("set_side_panel"),sidePanel:Jt.z.object({attributes:Jt.z.array(Jt.z.string().min(1)),width:Jt.z.number().int().min(1).optional()}).nullable()}),rp={type:"set_side_panel",schema:tp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,sidePanel:t.sidePanel??void 0}})),"apply"),focus:Et,presentation:y(Et,"atomic",()=>["config","sidePanel"]),describe:chunkDPD6ZWL2_js.a(e=>e.sidePanel?"Active le panneau lat\xE9ral":"Retire le panneau lat\xE9ral","describe")},Ua=[Sc,Rc,Cc,kc,_c,Fc,jc,Lc,Uc,qc,Gc,Kc,ep,Xc,rp];var je={...v,tabId:Jt.z.string().min(1)};function Nt(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Nt,"viewFocus");function ie(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(ie,"tabFocus");function $a(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a($a,"addTabFocus");function np(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(np,"firstChangedProperty");function za(e){let t={...e};for(let r of chunkSDOYGWU4_js.qa)delete t[r];return t}chunkDPD6ZWL2_js.a(za,"withoutKanbanKeys");function Ga(e){let t={...e};for(let r of chunkSDOYGWU4_js.pa)delete t[r];return t}chunkDPD6ZWL2_js.a(Ga,"withoutTableKeys");function ip(e,t,r,n){let o=chunkSDOYGWU4_js.ja.safeParse(t);if(!o.success){if(!chunkSDOYGWU4_js.ja.safeParse(e).success)return t;let a=o.error.issues.map(s=>s.path.length?`${s.path.join(".")}: ${s.message}`:s.message).join(", ");throw new chunk72TQRSNX_js.h(`List tab "${n}" in view "${r}" would no longer be publishable: ${a}`,[])}return t}chunkDPD6ZWL2_js.a(ip,"assertStillPublishableTab");function kt(e,t,r,n){return S(e,t,o=>{let a=o.config.tabs??[];if(!a.some(s=>s.id===r))throw new chunk72TQRSNX_js.h(`List tab "${r}" is not in view "${t}"`,[]);return {...o,config:{...o.config,tabs:a.map(s=>s.id===r?ip(s,n(s),t,r):s)}}})}chunkDPD6ZWL2_js.a(kt,"mapListTab");var op=chunkSDOYGWU4_js.ja,Wa=chunkSDOYGWU4_js.$,ap=chunkSDOYGWU4_js.Z;function K(e,t,r,n){let o=Jt.z.object({...je,type:Jt.z.literal(e),value:r});return {type:e,schema:o,apply:chunkDPD6ZWL2_js.a((a,s)=>kt(a,s.viewId,s.tabId,l=>{if(s.value===null){let{[t]:p,...I}=l;return I}return {...l,[t]:s.value}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>[String(t)]),describe:chunkDPD6ZWL2_js.a(a=>n(a.value),"describe")}}chunkDPD6ZWL2_js.a(K,"setOnTab");var sp=Jt.z.object({...v,type:Jt.z.literal("add_list_tab"),tab:op}),up={type:"add_list_tab",schema:sp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(n.some(o=>o.id===t.tab.id))throw new chunk72TQRSNX_js.h(`List tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:[...n,t.tab]}}}),"apply"),focus:$a,presentation:y($a,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},lp=Jt.z.object({...je,type:Jt.z.literal("remove_list_tab")}),dp={type:"remove_list_tab",schema:lp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(!n.some(o=>o.id===t.tabId))throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:n.filter(o=>o.id!==t.tabId)}}}),"apply"),focus:ie,presentation:y(ie,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},cp=Jt.z.object({...je,type:Jt.z.literal("update_list_tab"),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),icon:chunk47EGJRW7_js.c.optional(),default:Jt.z.boolean().optional(),visibility:Jt.z.enum(chunkSDOYGWU4_js.w).optional()}).refine(e=>Object.keys(e).length>0,"update_list_tab needs at least one change")}),qa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateListTabFocus"),pp={type:"update_list_tab",schema:cp,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>({...r,...t.changes})),"apply"),focus:qa,presentation:y(qa,"atomic",np),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},mp=Jt.z.object({...v,type:Jt.z.literal("reorder_list_tabs"),tabOrder:Jt.z.array(Jt.z.string().min(1))}),fp={type:"reorder_list_tabs",schema:mp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,tabs:Fe(r.config.tabs??[],t.tabOrder,"List tab")}})),"apply"),focus:Nt,presentation:y(Nt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},bp=K("set_columns","columns",Jt.z.array(Jt.z.string().min(1)),e=>`Affiche ${Array.isArray(e)?e.length:0} colonne(s)`),gp=K("set_column_sizing","columnSizing",Jt.z.record(Jt.z.string(),Jt.z.number().int().positive()),()=>"Ajuste la largeur des colonnes"),yp=Jt.z.object({...je,type:Jt.z.literal("set_layout"),value:Jt.z.enum(["table","list","kanban"])}),hp={type:"set_layout",schema:yp,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>{if(t.value!=="kanban")return {...za(r),layout:t.value};if(r.groupByAttribute===void 0)throw new chunk72TQRSNX_js.h(`List tab "${t.tabId}" cannot switch to kanban without a group attribute \u2014 use set_group_by, which switches the layout itself`,[]);return {...Ga(r),layout:"kanban"}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["layout"]),describe:chunkDPD6ZWL2_js.a(e=>`Passe en affichage ${e.value}`,"describe")},Ap=Jt.z.object({...je,type:Jt.z.literal("set_group_by"),value:Jt.z.string().min(1).nullable()}),Tp={type:"set_group_by",schema:Ap,apply:chunkDPD6ZWL2_js.a((e,t)=>kt(e,t.viewId,t.tabId,r=>t.value===null?{...za(r),layout:"table"}:{...Ga(r),layout:"kanban",groupByAttribute:t.value}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["groupByAttribute"]),describe:chunkDPD6ZWL2_js.a(e=>e.value?`Regroupe par ${e.value} en kanban`:"Retire le regroupement, retour en table","describe")},wp=K("set_filters","filters",Wa.nullable(),e=>e?"Modifie les filtres":"Retire les filtres"),xp=K("set_sorts","sorts",ap.nullable(),e=>e?"Modifie le tri":"Retire le tri"),Ip=K("set_create_mode","createMode",Jt.z.enum(["redirect","inline","peek"]),e=>`Cr\xE9ation en mode ${e}`),Sp=K("set_read_only","readOnly",Jt.z.boolean(),e=>e?"Passe l'onglet en lecture seule":"Rend l'onglet modifiable"),vp=K("set_card_user_attribute","cardUserAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire l'utilisateur des cartes"),Rp=K("set_card_date_attribute","cardDateAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire la date des cartes"),Ep=K("set_description_attribute","descriptionAttribute",Jt.z.string().min(1).nullable(),e=>e?`Affiche ${e} en description`:"Retire la description"),Dp=K("set_display_attributes","displayAttributes",chunkSDOYGWU4_js.Y.nullable(),e=>`Affiche ${Array.isArray(e)?e.length:0} attribut(s)`),Cp=Jt.z.object({...v,type:Jt.z.literal("set_default_filters"),filters:Wa.nullable()}),Np={type:"set_default_filters",schema:Cp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(t.filters===null){let{defaultFilters:n,...o}=r.config;return {...r,config:o}}return {...r,config:{...r.config,defaultFilters:t.filters}}}),"apply"),focus:Nt,presentation:y(Nt,"atomic",()=>["config","defaultFilters"]),describe:chunkDPD6ZWL2_js.a(e=>e.filters?"Modifie les filtres de la vue":"Retire les filtres de la vue","describe")},Ka=[Np,up,dp,pp,fp,bp,gp,hp,Tp,wp,xp,Ip,Sp,vp,Rp,Ep,Dp];function kp(e){return {id:e.id??e.name,name:e.name,label:e.label,...e.icon===void 0?{}:{icon:e.icon}}}chunkDPD6ZWL2_js.a(kp,"toDraftableObject");function Op(e){let t=e.id??e.name;return (e.attributes??[]).map(r=>_p(r,t))}chunkDPD6ZWL2_js.a(Op,"toDraftableAttributes");function ni(e){return {id:e.id,name:e.name,label:e.label,type:e.attributeType,...e.config}}chunkDPD6ZWL2_js.a(ni,"toAttribute");function _p(e,t){let{id:r,name:n,label:o,type:a,...s}=e;return {id:e.id??e.name,objectId:t,name:e.name,label:e.label??e.name,attributeType:e.type,config:s}}chunkDPD6ZWL2_js.a(_p,"toDraftableAttribute");function Pt(e,t){if(!e.objects.some(r=>r.id===t))throw new chunk72TQRSNX_js.h(`Object "${t}" is not in the draftable state`,[])}chunkDPD6ZWL2_js.a(Pt,"requireObject");function Ot(e){return {objectId:e.objectId}}chunkDPD6ZWL2_js.a(Ot,"objectFocus");function _t(e){return {objectId:e.objectId,recordId:e.recordId}}chunkDPD6ZWL2_js.a(_t,"recordFocus");function Se(e){return {objectId:e.objectId,attributeId:e.attributeId}}chunkDPD6ZWL2_js.a(Se,"attributeFocus");function Pp(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Pp,"firstChangedProperty");var oe={...ti,objectId:Jt.z.string().uuid()},Fp=Jt.z.object({...oe,type:Jt.z.literal("add_object"),name:Xe,label:Jt.z.string().min(1),icon:Jt.z.string().min(1).optional()}),Vp={type:"add_object",schema:Fp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(e.objects.some(n=>n.name===t.name))throw new chunk72TQRSNX_js.h(`Object "${t.name}" already exists`,[]);if(e.objects.some(n=>n.id===t.objectId))throw new chunk72TQRSNX_js.h(`Object id "${t.objectId}" is already taken`,[]);let r={id:t.objectId,name:t.name,label:t.label,...t.icon===void 0?{}:{icon:t.icon}};return {...e,objects:[...e.objects,r]}},"apply"),focus:Ot,presentation:y(Ot,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Cr\xE9e l'objet \xAB ${e.label} \xBB`,"describe")},jp=Jt.z.object({...oe,type:Jt.z.literal("update_object"),changes:Jt.z.object({label:Jt.z.string().min(1).optional(),icon:Jt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_object needs at least one change")}),Ya=chunkDPD6ZWL2_js.a(e=>({objectId:e.objectId}),"updateObjectFocus"),Mp={type:"update_object",schema:jp,apply:chunkDPD6ZWL2_js.a((e,t)=>(Pt(e,t.objectId),{...e,objects:e.objects.map(r=>r.id===t.objectId?{...r,...t.changes}:r)}),"apply"),focus:Ya,presentation:y(Ya,"atomic",Pp),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'objet en \xAB ${e.changes.label} \xBB`:"Modifie l'objet","describe")},Lp=Jt.z.object({...oe,type:Jt.z.literal("remove_object")}),Bp={type:"remove_object",schema:Lp,apply:chunkDPD6ZWL2_js.a((e,t)=>{Pt(e,t.objectId);let r=e.objects.find(n=>n.id===t.objectId)?.name;return {...e,objects:e.objects.filter(n=>n.id!==t.objectId),attributes:e.attributes.filter(n=>n.objectId!==t.objectId),sampleRecords:e.sampleRecords.filter(n=>n.objectId!==t.objectId),views:e.views.filter(n=>n.objectName!==r)}},"apply"),focus:Ot,presentation:y(Ot,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'objet ${e.objectId}`,"describe")},Me=Vi.filter(e=>e!=="formula"&&e!=="rollup"),Up=Jt.z.object({...oe,type:Jt.z.literal("add_attribute"),attributeId:Jt.z.string().min(1),name:po,label:Jt.z.string().min(1),attributeType:Jt.z.enum(Me),config:Jt.z.record(Jt.z.string(),Jt.z.unknown()).optional()}).superRefine((e,t)=>{try{chunk47EGJRW7_js.n(e.attributeType,e.config??{});}catch(r){if(r instanceof chunk72TQRSNX_js.h){for(let n of r.errors)t.addIssue({code:"custom",message:n.message,path:["config",...n.path??[]]});return}throw r}}),$p={type:"add_attribute",schema:Up,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Pt(e,t.objectId),e.attributes.some(n=>n.objectId===t.objectId&&n.name===t.name))throw new chunk72TQRSNX_js.h(`Attribute "${t.name}" already exists on object "${t.objectId}"`,[]);let r={id:t.attributeId,objectId:t.objectId,name:t.name,label:t.label,attributeType:t.attributeType,...t.config===void 0?{}:{config:t.config}};for(let n of e.sampleRecords)n.objectId===t.objectId&&Ha(n.id,r,n.values);return {...e,attributes:[...e.attributes,r]}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'attribut \xAB ${e.label} \xBB`,"describe")},qp=Jt.z.object({...oe,type:Jt.z.literal("update_attribute"),attributeId:Jt.z.string().min(1),changes:Jt.z.object({label:Jt.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_attribute needs at least one change")}),zp={type:"update_attribute",schema:qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.attributes.some(r=>r.id===t.attributeId))throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);return {...e,attributes:e.attributes.map(r=>r.id===t.attributeId?{...r,...t.changes}:r)}},"apply"),focus:Se,presentation:y(Se,"atomic"),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'attribut en \xAB ${e.changes.label} \xBB`:"Modifie l'attribut","describe")},Gp=Jt.z.object({...oe,type:Jt.z.literal("remove_attribute"),attributeId:Jt.z.string().min(1)}),Wp={type:"remove_attribute",schema:Gp,apply:chunkDPD6ZWL2_js.a((e,t)=>{let r=e.attributes.find(o=>o.id===t.attributeId);if(!r)throw new chunk72TQRSNX_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);let n=e.sampleRecords.find(o=>o.objectId===r.objectId&&r.name in o.values);if(n)throw new chunk72TQRSNX_js.h(`Attribute "${r.name}" is still used by sample record "${n.id}"`,[]);return {...e,attributes:e.attributes.filter(o=>o.id!==t.attributeId)}},"apply"),focus:Se,presentation:y(Se,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'attribut ${e.attributeId}`,"describe")};function Kp(e,t,r,n){let o=ni(r);try{chunk5QAE5NPN_js.c(o);}catch{return}let a=chunk5QAE5NPN_js.g(o,n);if(a.success)return;let s=a.errors??[],l=s.map(p=>p.message).join(", ");throw new chunk72TQRSNX_js.h(`Sample record "${e}" has an invalid value for "${t}": ${l}`,s.map(p=>({path:p.path,message:p.message})))}chunkDPD6ZWL2_js.a(Kp,"assertSampleValue");function Ha(e,t,r){if(t.config?.required===true&&t.config?.defaultValue===void 0&&!(t.name in r&&r[t.name]!==void 0))throw new chunk72TQRSNX_js.h(`Sample record "${e}" is missing a value for required attribute "${t.name}"`,[])}chunkDPD6ZWL2_js.a(Ha,"assertRequiredCovered");var Yp=Jt.z.object({...oe,type:Jt.z.literal("add_sample_record"),recordId:Jt.z.string().uuid(),values:Jt.z.record(Jt.z.string(),Jt.z.unknown())}),Hp={type:"add_sample_record",schema:Yp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Pt(e,t.objectId),e.sampleRecords.some(n=>n.id===t.recordId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" already exists`,[]);let r=new Map(e.attributes.filter(n=>n.objectId===t.objectId).map(n=>[n.name,n]));for(let[n,o]of Object.entries(t.values)){let a=r.get(n);if(!a)throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" uses unknown attribute "${n}"`,[]);Kp(t.recordId,n,a,o);}for(let n of r.values())Ha(t.recordId,n,t.values);return {...e,sampleRecords:[...e.sampleRecords,{id:t.recordId,objectId:t.objectId,values:t.values}]}},"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Ajoute un exemple","describe")},Qp=Jt.z.object({...oe,type:Jt.z.literal("remove_sample_record"),recordId:Jt.z.string().min(1)}),Jp={type:"remove_sample_record",schema:Qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.sampleRecords.some(r=>r.id===t.recordId&&r.objectId===t.objectId))throw new chunk72TQRSNX_js.h(`Sample record "${t.recordId}" is not in object "${t.objectId}"`,[]);return {...e,sampleRecords:e.sampleRecords.filter(r=>r.id!==t.recordId)}},"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Retire un exemple","describe")},Qa=[Vp,Mp,Bp,$p,zp,Wp,Hp,Jp];function Xp(){let e=new Map;for(let t of [...Qa,...Ua,...Ka]){if(e.has(t.type))throw new chunk72TQRSNX_js.r("architect operation",t.type);e.set(t.type,t);}return e}chunkDPD6ZWL2_js.a(Xp,"build");var ce=Xp(),ii=[...ce.keys()];function Le(e){let t=ce.get(e.type);if(!t)throw new chunk72TQRSNX_js.h(`Operation "${e.id}" has unknown type "${e.type}"`,[]);return t}chunkDPD6ZWL2_js.a(Le,"defOf");function oi(e,t){return t.reduce((r,n)=>Le(n).apply(r,n),e)}chunkDPD6ZWL2_js.a(oi,"applyOperations");function Zp(e){return Le(e).focus(e)}chunkDPD6ZWL2_js.a(Zp,"focusOf");function em(e,t){return e.map(r=>Le(r).describe(r,t))}chunkDPD6ZWL2_js.a(em,"describeOperations");function tm(e){if(typeof e!="object"||e===null||!("type"in e))throw new chunk72TQRSNX_js.h("An operation must be an object carrying a type",[]);let t=e.type;if(typeof t!="string")throw new chunk72TQRSNX_js.h("An operation's type must be a string",[]);let r=ce.get(t);if(!r)throw new chunk72TQRSNX_js.h(`Unknown operation type "${t}"`,[]);let n=r.schema.safeParse(e);if(!n.success)throw new chunk72TQRSNX_js.h(`Operation "${t}" is invalid: ${n.error.issues.map(o=>`${o.path.join(".")} ${o.message}`).join("; ")}`,[]);return n.data}chunkDPD6ZWL2_js.a(tm,"parseOperation");function Ja(e){return Jt.z.toJSONSchema(e,{io:"input"})}chunkDPD6ZWL2_js.a(Ja,"toJsonSchema");function nm(e){let t=ce.get(e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown operation type "${e}"`,[]);return Ja(t.schema)}chunkDPD6ZWL2_js.a(nm,"describeOperationInput");function im(e){let t=Me.find(r=>r===e);if(!t)throw new chunk72TQRSNX_js.h(`Unknown attribute type "${e}"`,[]);return Ja(chunk47EGJRW7_js.m(t))}chunkDPD6ZWL2_js.a(im,"describeAttributeConfig");function om(){return {operations:[...ii],attributeTypes:[...Me]}}chunkDPD6ZWL2_js.a(om,"listDescribableNames");function Xa(e,t,r){let n=`fld_${e}_${t}`;return r===0?n:`${n}_${r}`}chunkDPD6ZWL2_js.a(Xa,"makeFieldId");function am(e,t){return e.attributeGroup?e.attributeGroup.id:e.attribute?e.attribute:`slot${t}`}chunkDPD6ZWL2_js.a(am,"seedOf");function sm(e){let t=new Map,r=e.fields.map((n,o)=>{if(n.id)return n;let a=am(n,o),s=t.get(a)??0;return t.set(a,s+1),{...n,id:Xa(e.id,a,s)}});return {...e,fields:r}}chunkDPD6ZWL2_js.a(sm,"withIds");function um(e){return e.map(t=>t.type==="form"?{...t,groups:t.groups.map(sm)}:t)}chunkDPD6ZWL2_js.a(um,"ensureFieldIds");function ai(e){return Le(e).presentation(e)}chunkDPD6ZWL2_js.a(ai,"presentationOf");function lm(e){let t=e.map(ai);return new Set(t.map(({focus:n})=>n.viewId??n.objectId).filter(n=>n!==void 0)).size>1||t.some(({impact:n})=>n==="structural")?"structural":t.some(({impact:n})=>n==="local")?"local":"atomic"}chunkDPD6ZWL2_js.a(lm,"episodeImpactOf");function dm(e,t){return e.config.tabs?.find(r=>r.id===t)}chunkDPD6ZWL2_js.a(dm,"listTabOf");function Za(e,t){let r=t.viewId?e.views.find(o=>o.id===t.viewId):void 0,n=t.tabId?r?.tabs.find(o=>o.id===t.tabId):void 0;if(t.attributeId)return e.attributes.find(o=>o.id===t.attributeId);if(t.fieldId){if(n?.type!=="form")return;for(let o of n.groups){let a=o.fields.find(s=>s.id===t.fieldId);if(a)return a}return}if(t.groupId)return n?.type!=="form"?void 0:n.groups.find(o=>o.id===t.groupId);if(t.tabId)return r?n??dm(r,t.tabId):void 0;if(t.recordId)return e.sampleRecords.find(o=>o.id===t.recordId);if(r)return r;if(t.objectId)return e.objects.find(o=>o.id===t.objectId)}chunkDPD6ZWL2_js.a(Za,"snapshotArchitectTarget");function cm(e,t){let r=e;return t.map(n=>{let o=ai(n),a=Za(r,o.focus);r=oi(r,[n]);let s=Za(r,o.focus);return {operationId:n.id,operationType:n.type,presentation:o,before:a,after:s}})}chunkDPD6ZWL2_js.a(cm,"deriveArchitectChanges");function pm(e){return {id:e.id??"",objectName:e.object,type:e.type,label:e.label,tabs:Ke(e)?e.config.tabs??[]:[],config:e.config}}chunkDPD6ZWL2_js.a(pm,"toDraftableView");function mm(e,t){return e.type==="detail"?{...e,label:t.label,config:{...t.config,tabs:t.tabs}}:{...e,label:t.label,config:t.config}}chunkDPD6ZWL2_js.a(mm,"fromDraftableView");Object.defineProperty(exports,"asTenantId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.b}});Object.defineProperty(exports,"asUserId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.c}});Object.defineProperty(exports,"canonicalStringify",{enumerable:true,get:function(){return chunkLQYUPOWB_js.a}});Object.defineProperty(exports,"deepEqual",{enumerable:true,get:function(){return chunkLQYUPOWB_js.f}});Object.defineProperty(exports,"generateId",{enumerable:true,get:function(){return chunkLQYUPOWB_js.d}});Object.defineProperty(exports,"indexBy",{enumerable:true,get:function(){return chunkLQYUPOWB_js.e}});Object.defineProperty(exports,"ATTRIBUTE_FILTER_OPERATORS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.i}});Object.defineProperty(exports,"LIST_TAB_KANBAN_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.qa}});Object.defineProperty(exports,"LIST_TAB_TABLE_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.pa}});Object.defineProperty(exports,"LIST_VIEW_TAB_VISIBILITIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.w}});Object.defineProperty(exports,"LOCATION_FILTER_PROPERTIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.f}});Object.defineProperty(exports,"NO_VALUE_OPERATORS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.s}});Object.defineProperty(exports,"OPERATORS_BY_TYPE",{enumerable:true,get:function(){return chunkSDOYGWU4_js.r}});Object.defineProperty(exports,"REMOVED_OPERATOR_REPLACEMENTS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.U}});Object.defineProperty(exports,"RESERVED_ATTRIBUTE_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.z}});Object.defineProperty(exports,"RESERVED_OBJECT_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.A}});Object.defineProperty(exports,"RESOURCE_VISIBILITIES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.v}});Object.defineProperty(exports,"SYNONYM_ALIASES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.M}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.c}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTE_I18N_KEYS",{enumerable:true,get:function(){return chunkSDOYGWU4_js.a}});Object.defineProperty(exports,"SYSTEM_FIELD_NAMES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.y}});Object.defineProperty(exports,"SYSTEM_FILTER_ATTRIBUTE_TYPES",{enumerable:true,get:function(){return chunkSDOYGWU4_js.T}});Object.defineProperty(exports,"canonicalizeFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.L}});Object.defineProperty(exports,"collectQualifiedRuleIssues",{enumerable:true,get:function(){return chunkSDOYGWU4_js.V}});Object.defineProperty(exports,"columnsSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.X}});Object.defineProperty(exports,"currentActor",{enumerable:true,get:function(){return chunkSDOYGWU4_js.C}});Object.defineProperty(exports,"detailTabDraftSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ia}});Object.defineProperty(exports,"detailTabSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ha}});Object.defineProperty(exports,"detailViewConfigSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.la}});Object.defineProperty(exports,"displayAttributesSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Y}});Object.defineProperty(exports,"extractCurrencyFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.F}});Object.defineProperty(exports,"extractFilterValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.G}});Object.defineProperty(exports,"fieldSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ba}});Object.defineProperty(exports,"fieldShape",{enumerable:true,get:function(){return chunkSDOYGWU4_js.aa}});Object.defineProperty(exports,"fieldSlotSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ca}});Object.defineProperty(exports,"filterGroupSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.$}});Object.defineProperty(exports,"filterStateSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js._}});Object.defineProperty(exports,"getAttributeCapabilities",{enumerable:true,get:function(){return chunkSDOYGWU4_js.j}});Object.defineProperty(exports,"getAttributeFilterOperators",{enumerable:true,get:function(){return chunkSDOYGWU4_js.k}});Object.defineProperty(exports,"getOperatorPolarity",{enumerable:true,get:function(){return chunkSDOYGWU4_js.H}});Object.defineProperty(exports,"getRollupFilterOperators",{enumerable:true,get:function(){return chunkSDOYGWU4_js.u}});Object.defineProperty(exports,"getSystemAttributeI18nKey",{enumerable:true,get:function(){return chunkSDOYGWU4_js.b}});Object.defineProperty(exports,"getSystemAttributeList",{enumerable:true,get:function(){return chunkSDOYGWU4_js.d}});Object.defineProperty(exports,"groupWriteSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.da}});Object.defineProperty(exports,"inverseSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.fa}});Object.defineProperty(exports,"isAttributeFilterable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.l}});Object.defineProperty(exports,"isAttributeGroupable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.o}});Object.defineProperty(exports,"isAttributeKanbanGroupable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.p}});Object.defineProperty(exports,"isAttributeSearchable",{enumerable:true,get:function(){return chunkSDOYGWU4_js.m}});Object.defineProperty(exports,"isDynamicValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.B}});Object.defineProperty(exports,"isLocationFilterProperty",{enumerable:true,get:function(){return chunkSDOYGWU4_js.g}});Object.defineProperty(exports,"isLocationPartOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.h}});Object.defineProperty(exports,"isManagedSystemAttribute",{enumerable:true,get:function(){return chunkSDOYGWU4_js.e}});Object.defineProperty(exports,"isNoValueOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.t}});Object.defineProperty(exports,"isRelativeDateValue",{enumerable:true,get:function(){return chunkSDOYGWU4_js.P}});Object.defineProperty(exports,"isSetMembershipOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.K}});Object.defineProperty(exports,"listViewConfigSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ka}});Object.defineProperty(exports,"listViewTabSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ja}});Object.defineProperty(exports,"normalizeFilterRule",{enumerable:true,get:function(){return chunkSDOYGWU4_js.O}});Object.defineProperty(exports,"normalizeForEdgeRpc",{enumerable:true,get:function(){return chunkSDOYGWU4_js.I}});Object.defineProperty(exports,"normalizeOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.N}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkSDOYGWU4_js.E}});Object.defineProperty(exports,"parseResourceVisibility",{enumerable:true,get:function(){return chunkSDOYGWU4_js.x}});Object.defineProperty(exports,"parseViewConfig",{enumerable:true,get:function(){return chunkSDOYGWU4_js.oa}});Object.defineProperty(exports,"relationSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ea}});Object.defineProperty(exports,"resolveEffectiveFilterType",{enumerable:true,get:function(){return chunkSDOYGWU4_js.q}});Object.defineProperty(exports,"resolveIsWithinBounds",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Q}});Object.defineProperty(exports,"resolveUtcDayBounds",{enumerable:true,get:function(){return chunkSDOYGWU4_js.R}});Object.defineProperty(exports,"sortsSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.Z}});Object.defineProperty(exports,"tableSourceSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ga}});Object.defineProperty(exports,"toMultiValueOperator",{enumerable:true,get:function(){return chunkSDOYGWU4_js.J}});Object.defineProperty(exports,"toUtcDayString",{enumerable:true,get:function(){return chunkSDOYGWU4_js.S}});Object.defineProperty(exports,"today",{enumerable:true,get:function(){return chunkSDOYGWU4_js.D}});Object.defineProperty(exports,"validateQualifiedRule",{enumerable:true,get:function(){return chunkSDOYGWU4_js.W}});Object.defineProperty(exports,"viewConfigByTypeSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.na}});Object.defineProperty(exports,"viewTypeSchema",{enumerable:true,get:function(){return chunkSDOYGWU4_js.ma}});Object.defineProperty(exports,"ComputedFormulaParseError",{enumerable:true,get:function(){return chunk47EGJRW7_js.d}});Object.defineProperty(exports,"SCHEMA_LIMITS",{enumerable:true,get:function(){return chunk47EGJRW7_js.a}});Object.defineProperty(exports,"colorIdSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.b}});Object.defineProperty(exports,"iconNameSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.c}});Object.defineProperty(exports,"multiselectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.h}});Object.defineProperty(exports,"parseAttributeConfig",{enumerable:true,get:function(){return chunk47EGJRW7_js.l}});Object.defineProperty(exports,"parseAttributeConfigForCreate",{enumerable:true,get:function(){return chunk47EGJRW7_js.n}});Object.defineProperty(exports,"parseAttributeConfigForUpdate",{enumerable:true,get:function(){return chunk47EGJRW7_js.o}});Object.defineProperty(exports,"parseComputedFormula",{enumerable:true,get:function(){return chunk47EGJRW7_js.e}});Object.defineProperty(exports,"selectOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.g}});Object.defineProperty(exports,"statusGroupSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.f}});Object.defineProperty(exports,"statusOptionWriteSchema",{enumerable:true,get:function(){return chunk47EGJRW7_js.i}});Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:true,get:function(){return chunk5QAE5NPN_js.d}});Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:true,get:function(){return chunk5QAE5NPN_js.a}});Object.defineProperty(exports,"isValuePresent",{enumerable:true,get:function(){return chunk5QAE5NPN_js.b}});Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.l}});Object.defineProperty(exports,"validateDraft",{enumerable:true,get:function(){return chunk5QAE5NPN_js.j}});Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.k}});Object.defineProperty(exports,"validateObject",{enumerable:true,get:function(){return chunk5QAE5NPN_js.h}});Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:true,get:function(){return chunk5QAE5NPN_js.i}});Object.defineProperty(exports,"createCheckboxValidator",{enumerable:true,get:function(){return chunk47KVYDKG_js.a}});Object.defineProperty(exports,"createDateValidator",{enumerable:true,get:function(){return chunkKLR22JMC_js.a}});Object.defineProperty(exports,"AccessDeniedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.B}});Object.defineProperty(exports,"AttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.H}});Object.defineProperty(exports,"AttributeNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.e}});Object.defineProperty(exports,"ChangeTypeNotSupportedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.q}});Object.defineProperty(exports,"ConcurrentModificationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.z}});Object.defineProperty(exports,"DestructiveSyncNotAllowedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.o}});Object.defineProperty(exports,"DuplicateError",{enumerable:true,get:function(){return chunk72TQRSNX_js.r}});Object.defineProperty(exports,"ForbiddenError",{enumerable:true,get:function(){return chunk72TQRSNX_js.w}});Object.defineProperty(exports,"MemoryNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.F}});Object.defineProperty(exports,"MigrationTimeoutError",{enumerable:true,get:function(){return chunk72TQRSNX_js.p}});Object.defineProperty(exports,"NotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.c}});Object.defineProperty(exports,"NotImplementedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.E}});Object.defineProperty(exports,"ObjectNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.d}});Object.defineProperty(exports,"ObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.I}});Object.defineProperty(exports,"OrphanSystemAttributeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.n}});Object.defineProperty(exports,"ProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.i}});Object.defineProperty(exports,"ProtectedRoleError",{enumerable:true,get:function(){return chunk72TQRSNX_js.x}});Object.defineProperty(exports,"RecordNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.f}});Object.defineProperty(exports,"RecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.G}});Object.defineProperty(exports,"RepositoryError",{enumerable:true,get:function(){return chunk72TQRSNX_js.C}});Object.defineProperty(exports,"RoleNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.y}});Object.defineProperty(exports,"SchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.b}});Object.defineProperty(exports,"SchemaErrorCode",{enumerable:true,get:function(){return chunk72TQRSNX_js.a}});Object.defineProperty(exports,"SchemaPlanNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.g}});Object.defineProperty(exports,"SearchBackendError",{enumerable:true,get:function(){return chunk72TQRSNX_js.D}});Object.defineProperty(exports,"StorageError",{enumerable:true,get:function(){return chunk72TQRSNX_js.A}});Object.defineProperty(exports,"SyncCascadeError",{enumerable:true,get:function(){return chunk72TQRSNX_js.m}});Object.defineProperty(exports,"SyncConflictError",{enumerable:true,get:function(){return chunk72TQRSNX_js.l}});Object.defineProperty(exports,"SyncError",{enumerable:true,get:function(){return chunk72TQRSNX_js.j}});Object.defineProperty(exports,"SystemEntityImmutableError",{enumerable:true,get:function(){return chunk72TQRSNX_js.k}});Object.defineProperty(exports,"ValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.h}});Object.defineProperty(exports,"isAttributeInUseError",{enumerable:true,get:function(){return chunk72TQRSNX_js.K}});Object.defineProperty(exports,"isNotFoundError",{enumerable:true,get:function(){return chunk72TQRSNX_js.t}});Object.defineProperty(exports,"isObjectReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.L}});Object.defineProperty(exports,"isProtectedResourceError",{enumerable:true,get:function(){return chunk72TQRSNX_js.v}});Object.defineProperty(exports,"isRecordReferencedError",{enumerable:true,get:function(){return chunk72TQRSNX_js.J}});Object.defineProperty(exports,"isSchemaError",{enumerable:true,get:function(){return chunk72TQRSNX_js.s}});Object.defineProperty(exports,"isValidationError",{enumerable:true,get:function(){return chunk72TQRSNX_js.u}});Object.defineProperty(exports,"TEXT_FORMAT_PATTERNS",{enumerable:true,get:function(){return chunkXHEBV2HE_js.a}});Object.defineProperty(exports,"createTextValidator",{enumerable:true,get:function(){return chunkXHEBV2HE_js.c}});Object.defineProperty(exports,"resolveTextPattern",{enumerable:true,get:function(){return chunkXHEBV2HE_js.b}});Object.defineProperty(exports,"createNumberValidator",{enumerable:true,get:function(){return chunkSLYRQ72J_js.a}});Object.defineProperty(exports,"DEFAULT_VALIDATION_MESSAGES",{enumerable:true,get:function(){return chunkJFSQ24XR_js.a}});Object.defineProperty(exports,"formatZodErrors",{enumerable:true,get:function(){return chunkJFSQ24XR_js.b}});exports.AGENT_UI_BATCH_MAX_BYTES=GT;exports.AGENT_UI_BATCH_MAX_ITEMS=WT;exports.ALLOWED_PROPERTY_TYPES=Xi;exports.ALL_ACTIONS=Kt;exports.ALL_OPERATION_TYPES=ii;exports.ALL_SYSTEM_RESOURCES=Ih;exports.ARTIFACT_FILE_ROLES=Kb;exports.ARTIFACT_KINDS=Gb;exports.ARTIFACT_LIST_VIEW=qu;exports.ARTIFACT_OBJECT=$u;exports.ARTIFACT_OBJECT_NAME=Nn;exports.ARTIFACT_RETENTIONS=Wb;exports.ATTRIBUTE_TYPES=Vi;exports.AUDIT_ACTIONS=ub;exports.AUDIT_RESOURCE_TYPES=sb;exports.ActivityTabConfig=Kr;exports.AgentBuilder=Xt;exports.BEHAVIOR_PROPERTIES=Xf;exports.BYTE_UNIT_LABELS=js;exports.CLAIMABLE_SESSION_STATUSES=xs;exports.COMPUTED_FUNCTIONS=_e;exports.COMPUTED_FUNCTION_METADATA=Cw;exports.COMPUTED_FUNCTION_NAMES=uw;exports.CONNECTOR_CALLBACK_PARAM=tx;exports.COUNT_MODES=Qi;exports.ComputedFormulaCompileError=b;exports.CustomTabConfig=Gr;exports.DB_COLUMN_FIELDS=wh;exports.DEFAULT_AGENT_EXECUTION_CONFIG=bo;exports.DEFAULT_APPROVAL_POLICY=Mi;exports.DEFAULT_DICTATION_LIMITS=qb;exports.DEFAULT_LABEL_FALLBACK=ro;exports.DEFAULT_MEETING_BOT_DISPLAY_NAME=ks;exports.DEFAULT_ROLES=pu;exports.DEFAULT_ROLE_DESCRIPTIONS=Rh;exports.DEFAULT_ROLE_LABELS=vh;exports.DEFAULT_ROLE_PERMISSIONS=Eh;exports.DEFAULT_TENANT_SETTINGS=Ig;exports.DICTATION_FINALIZATION_TIMEOUT_MS=Ub;exports.DICTATION_FRAME_BYTES=Fb;exports.DICTATION_MAX_BUFFER_BYTES=jb;exports.DICTATION_MAX_FRAME_BYTES=Vb;exports.DICTATION_MAX_TRANSCRIPT_BYTES=Mb;exports.DICTATION_MODEL_ID=$b;exports.DICTATION_PREPARATION_TIMEOUT_MS=Bb;exports.DICTATION_SAMPLE_RATE=Pb;exports.DICTATION_TICKET_TTL_MS=Lb;exports.DOCUMENT_SYSTEM_ATTRIBUTES=My;exports.DRAFTABLE_ATTRIBUTE_TYPES=Me;exports.DRIVE_LIST_VIEW=Uu;exports.DRIVE_OBJECT=Lu;exports.DRIVE_OBJECT_NAME=ct;exports.DRIVE_VIEW=Bu;exports.DetailViewBuilder=Jr;exports.DocumentsTabConfig=Qr;exports.EMPTY_VALUE_PLACEHOLDER=He;exports.ESTIMATED_COUNT_CAP=jg;exports.EmailsTabConfig=Yr;exports.FAKE_MEETING_BOT_SIGNATURE_HEADER=ax;exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES=zt;exports.FlagRegistry=Ne;exports.FlagService=dt;exports.FormBuilder=Mr;exports.FormRegistry=Oe;exports.FormRowBuilder=Vr;exports.FormStepBuilder=jr;exports.GroupBuilder=ot;exports.IDENTITY_PROPERTIES=Jf;exports.IMAGE_FORMATS=_g;exports.INFERENCE_REASONING_OPTIONS=Ui;exports.INFERENCE_SPEEDS=Bi;exports.LIVE_EVENT_TYPES=ol;exports.ListViewBuilder=Xr;exports.ListViewTabConfigBuilder=Zr;exports.MAX_PRESET_DEPTH=zi;exports.MAX_TODOS=Ib;exports.MAX_TODO_DESCRIPTION_CHARS=vb;exports.MAX_TODO_ID_CHARS=Sb;exports.MAX_TODO_RESULT_CHARS=Rb;exports.MEETING_ATTRIBUTES=T;exports.MEETING_DETAIL_VIEW_ID=Ro;exports.MEETING_LIST_VIEW=Wu;exports.MEETING_LIST_VIEW_ID=So;exports.MEETING_OBJECT=zu;exports.MEETING_OBJECT_NAME=pt;exports.MEETING_VIEW=Gu;exports.MEETING_WRITE_SOURCE=vo;exports.MEMORY_LIST_VIEW=Mu;exports.MEMORY_OBJECT=Vu;exports.MEMORY_VIEW=ju;exports.McpOAuthCompletionMode=Kd;exports.MeetingsTabConfig=Hr;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_KEY=vs;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION=Rs;exports.NOTIFICATION_INBOX_STATES=Pi;exports.NOTIFICATION_KINDS=ki;exports.NOTIFICATION_PRIORITIES=Oi;exports.NOTIFICATION_SENSITIVITIES=_i;exports.NOTIFICATION_TYPES_V1=Hf;exports.NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED=Ts;exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN=hs;exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED=As;exports.NOTIFICATION_WORK_STATES=Fi;exports.NO_RECORDING=sx;exports.NoopGeocodingAdapter=Ki;exports.OBJECT_NAME_SCHEMA=Xe;exports.OPEN_TOOL_PART_STATES=Is;exports.OPERATION_REGISTRY=ce;exports.OPERATOR_SPECS=St;exports.ObjectBuilder=qr;exports.PRESENTATION_PROPERTIES=Zf;exports.PROVIDER_NAMES=Li;exports.QUALIFIED_SEPARATOR=Gy;exports.QUOTA_KEYS=Bg;exports.RECORDING_OVERRIDES=ix;exports.RECORDING_POLICIES=ox;exports.RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY=uo;exports.RELATION_TARGET_ANY=$t;exports.RichtextTabConfig=Wr;exports.SCHEMA_PLAN_LIMITS=$;exports.SCHEMA_SOURCE_ID_PATTERN=Qn;exports.SESSION_STATE_STREAM_ID=Nb;exports.SESSION_TERMINAL_STATUSES=ws;exports.SKILL_CONTENT_TEMPLATE=wo;exports.SKILL_LIST_VIEW=_u;exports.SKILL_OBJECT=ku;exports.SKILL_VIEW=Ou;exports.STANDARD_SCHEMA_VENDOR=yu;exports.SYSTEM_PART_CODES=qt;exports.SYSTEM_RESOURCES=M;exports.SYSTEM_RESOURCE_LABELS=Sh;exports.TODAY_DEFAULT=ra;exports.TODO_PLAN_STATUSES=gb;exports.TODO_STATUSES=xb;exports.TOOL_APPROVAL_STATES=$i;exports.TabBuilder=Q;exports.TableTabConfig=at;exports.UPDATE_TABLE_TAB_CHANGE_KEYS=Yc;exports.UPDATE_TAB_CHANGE_KEYS=Ec;exports.UPDATE_TAB_CONFIG_CHANGE_KEYS=Hc;exports.USER_STATUSES=vg;exports.USER_WORK_POSTURES=Rg;exports.accessLevelToActions=yg;exports.actionsToAccessLevel=gg;exports.agent=Bh;exports.agentDataChunk=Mx;exports.agentDisplayName=yb;exports.agentInferencePreferencesSchema=Fx;exports.agentMessageAttachmentSchema=cc;exports.agentMessagePartSchema=dc;exports.agentSessionInferenceOverridesInputSchema=lc;exports.agentSessionInferenceOverridesSchema=Vx;exports.agentSessionMessageSchema=Aa;exports.agentUIValidationError=hc;exports.applyOperations=oi;exports.applyPipes=Zs;exports.applyRelationProps=iu;exports.assertAcyclicComputedDependencies=mw;exports.assertCustomAgentUIMessageChunk=Ac;exports.assertSchemaSourceId=Qd;exports.booleanFlag=wu;exports.buildAgentFallbackTitle=ia;exports.buildPermissionFlags=cu;exports.buildPropertySchema=Ye;exports.buildQualifiedAttribute=Ky;exports.checkbox=go;exports.compareAgentSessionMessages=Ss;exports.compileComputedFormula=Bo;exports.compileRollupAttribute=yw;exports.computeByteMagnitude=Vs;exports.conversationDisplayTitle=Hd;exports.createFlagRegistry=Ru;exports.createFlagService=Du;exports.createStandardSchemaProps=et;exports.currency=Zh;exports.customDataChunkSchemas=Sa;exports.date=U;exports.dateInTimezone=vt;exports.dateValueStart=fe;exports.defineOperation=Rt;exports.definePresentation=y;exports.deriveArchitectChanges=cm;exports.deriveCreateDefaultsFromFilters=Xw;exports.deriveInitials=lu;exports.describeAttributeConfig=im;exports.describeOperationInput=nm;exports.describeOperations=em;exports.destructiveSchema=fa;exports.detailView=ee;exports.document=yo;exports.durableDateSchema=fc;exports.ensureFieldIds=um;exports.episodeImpactOf=lm;exports.evaluateComputedAst=Sw;exports.evaluateComputedFormula=vw;exports.evaluateComputedFormulaWithResult=Rw;exports.evaluateFilterState=Bd;exports.evaluateRecordFilterState=zw;exports.extractAttributeNames=oo;exports.extractValueRefs=so;exports.flagRegistry=vu;exports.focusOf=Zp;exports.form=pA;exports.formFieldFlatKey=Ns;exports.formFieldKey=Cs;exports.formRegistry=Co;exports.formatAgentStreamFrameId=UT;exports.formatAttributeValue=Zi;exports.formatByteSize=_y;exports.formatComputedResult=Fd;exports.formatLocationValue=Gs;exports.formula=iA;exports.fromDraftableView=mm;exports.generateDefaultDetailView=_n;exports.generateDefaultListView=Pn;exports.getActiveTab=NT;exports.getEditableLabelAttribute=ru;exports.getErrorMessage=Qb;exports.getListViewDisplayAttributeNames=Ms;exports.getLiveProtocolPayloadChannel=iw;exports.getRecordCreatorPrincipalId=du;exports.getSingleAttributeFromExpression=ao;exports.getSlotFieldTargets=Wi;exports.getUserDisplayName=su;exports.group=CA;exports.hasDestructiveEntries=gx;exports.hasOptions=Tg;exports.imageModelIdSchema=xa;exports.includesAction=ge;exports.inferInverseCardinality=nb;exports.inferRollupReturnType=wd;exports.inferenceReasoningSchema=ei;exports.inferenceSpeedSchema=Zn;exports.isAgentUIDataName=yc;exports.isAgentUIMessageBatch=KT;exports.isAttributeSortable=ib;exports.isBilateralRelation=rb;exports.isCheckboxEquality=_w;exports.isClaimableSessionStatus=bb;exports.isComputedFunctionName=bt;exports.isDateRangeValue=Z;exports.isDefaultRole=Dh;exports.isDetailView=Ke;exports.isDocumentAttribute=Ly;exports.isEmptyObject=Ps;exports.isFieldGroup=Os;exports.isFormDefinition=eg;exports.isFormFieldsRow=We;exports.isFormFreeFieldRef=Gt;exports.isFormHeadingRow=sg;exports.isFormSeparatorRow=ug;exports.isFormSlotFieldRef=Gi;exports.isFormTextRow=lg;exports.isLabelExpression=Je;exports.isListView=Hi;exports.isLiveEventEnvelope=ow;exports.isLiveEventPayload=ew;exports.isLiveEventPayloadForType=fl;exports.isLiveEventType=ml;exports.isNotEmpty=Ji;exports.isOpenToolPartState=hb;exports.isPlainRecord=Yo;exports.isStandardSchema=qh;exports.isSystemPartCode=Tb;exports.isTerminalSessionStatus=fb;exports.isTerminalState=cb;exports.isToolApprovalState=Ab;exports.isUniversalRelation=ji;exports.jsonFlag=Su;exports.legacyStatusToSessionState=mb;exports.listDescribableNames=om;exports.listView=G;exports.liveChannelKey=QT;exports.location=rA;exports.makeFieldId=Xa;exports.matchesAccepts=By;exports.mentionReferenceSchema=pc;exports.modelDefinitionSchema=mc;exports.modelReferenceSchema=wa;exports.multiselect=tA;exports.nativeAgentUIPartIdMetadataKey=Ds;exports.normalizeDateValue=Ls;exports.number=rt;exports.numberFlag=Iu;exports.object=z;exports.orderAgentSessionMessages=wb;exports.parseAgentStreamFrameId=$T;exports.parseCountMode=_s;exports.parseLiveChannelKey=ko;exports.parseNativeAgentUIPartIdsMetadata=kb;exports.parseOperation=tm;exports.parseOptionalCountMode=Vg;exports.parseQualifiedAttribute=Wy;exports.persistedDefaultViewTargetSchema=ic;exports.persistedSchemaPlanSchema=Cx;exports.phone=Xh;exports.plannedAttributeSchema=ec;exports.plannedInlineAttributeSchema=tc;exports.plannedObjectSchema=rc;exports.presentationOf=ai;exports.proposedDefaultViewTargetSchema=nc;exports.providerNameSchema=Ta;exports.qualifiedPropertyDefs=au;exports.readFormFieldValue=ig;exports.registry=XA;exports.relation=Ae;exports.relationPropertyDefs=ou;exports.renderLabelExpression=Ht;exports.resetViewToDefault=el;exports.resolveAttributeDefaultValue=Gd;exports.resolveFieldRequired=ng;exports.resolvePropertyDefinitions=Yi;exports.richtext=he;exports.rollup=oA;exports.rollupToFormulaExpression=Td;exports.schemaPlanSchema=Dx;exports.select=q;exports.sessionInferencePatchSchema=jx;exports.sessionStateToLegacyStatus=pb;exports.status=eA;exports.stringFlag=xu;exports.text=f;exports.toAttribute=ni;exports.toDraftableAttributes=Op;exports.toDraftableObject=kp;exports.toDraftableView=pm;exports.toUndefinedIfEmpty=Fs;exports.todoItemSchema=bc;exports.todoPlanSchema=gc;exports.toolImpactSchema=Ia;exports.user=nA;exports.validateAttributeName=Ce;exports.validateLabelExpression=Xs;exports.validateObjectExpressions=Au;exports.validateObjectName=De;exports.validateViewName=Ze;exports.viewRegistry=Ku;exports.viewStateKey=Dg;exports.viewSyncPayload=Jd;
|
|
58
|
+
{{ participants }}`).attribute(f({name:T.title,label:"Title"}).required()).attribute(Ae({name:T.description,label:"Description"})).attribute(f({name:T.location,label:"Location"})).attribute(U({name:T.startsAt,label:"Starts at"}).includeTime()).attribute(U({name:T.endsAt,label:"Ends at"}).includeTime()).attribute(xo({name:T.isAllDay,label:"All day"})).attribute(q({name:T.status,label:"Status"}).options([{value:"confirmed",label:"Confirmed"},{value:"tentative",label:"Tentative"},{value:"cancelled",label:"Cancelled"}])).attribute(f({name:T.organizerAddress,label:"Organizer address"}).email()).attribute(f({name:T.organizerName,label:"Organizer"})).attribute(f({name:T.conferenceProvider,label:"Conference provider"})).attribute(f({name:T.conferenceJoinUrl,label:"Join link"}).url()).attribute(f({name:T.htmlLink,label:"Open in calendar"}).url()).attribute(f({name:T.participants,label:"Participants"}).multiline()).attribute(f({name:T.providerEventId,label:"Provider event id"}).hidden()).attribute(f({name:T.icalUid,label:"iCal UID"}).hidden()).attribute(f({name:T.recurringEventId,label:"Recurring event id"}).hidden()).attribute(f({name:T.connectionId,label:"Connection id"}).hidden()).attribute(q({name:T.recordingOverride,label:"Recording"}).options([{value:"force",label:"Force"},{value:"skip",label:"Skip"}]).hidden()).attribute(U({name:T.endedAnnouncedAt,label:"Ended announced at"}).includeTime().hidden()).attribute(Te({name:T.linkedRecords,label:"Linked records"}).toAny().many().qualifyWith(f({name:"source",label:"Source"}).hidden())).build(),el=O(z(_o,"Meeting").for(yt).default().sidePanel({attributes:[T.startsAt,T.endsAt,T.linkedRecords]}).tab("description","Description").richtext(T.description).titleAttribute(T.title).build()),tl=O(G(Oo,"Meetings").for(yt).default().tab("workspace","Shared").default().icon("users").visibility("workspace").table().columns(...No).sort(T.startsAt,"desc").tab("mine","My meetings").icon("lock").visibility("private").table().columns(...No).sort(T.startsAt,"desc").build());function _e(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(_e,"cloneViewDefinition");var jn=class jn{constructor(){this.views=new Map;this.byObject=new Map;this.byObjectAndType=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r)this.registerSingle(n);return this}registerSingle(t){let r=this.makeKey(t.object,t.name,t.type);if(this.views.has(r)){let l=`[ViewRegistry] Duplicate view: "${t.name}" (${t.type}) for object "${t.object}"`;throw new chunkGZUTZAPU_js.r("view",r,l)}let n=_e(t);this.views.set(r,n);let o=this.byObject.get(n.object)??[];o.push(n),this.byObject.set(n.object,o);let a=`${n.object}:${n.type}`,s=this.byObjectAndType.get(a)??[];s.push(n),this.byObjectAndType.set(a,s);}getByObjectName(t){return Array.from(this.byObject.get(t)??[],_e)}getByObjectNameAndType(t,r){return Array.from(this.byObjectAndType.get(`${t}:${r}`)??[],_e)}get(t,r,n){if(n){let a=this.views.get(this.makeKey(t,r,n));return a?_e(a):void 0}return this.getByObjectName(t).find(a=>a.name===r)}getOrThrow(t,r,n){let o=this.get(t,r,n);if(!o){let s=this.getByObjectName(t).map(p=>`${p.name} (${p.type})`).join(", ")||"(none)",l=`[ViewRegistry] View "${r}" not found for object "${t}".
|
|
59
|
+
Available views: ${s}`;throw new chunkGZUTZAPU_js.c("View",`${t}:${r}`,void 0,l)}return o}getAll(){return Array.from(this.views.values(),_e)}has(t,r,n){return n?this.views.has(this.makeKey(t,r,n)):this.getByObjectName(t).some(a=>a.name===r)}hasObject(t){return this.byObject.has(t)}get size(){return this.views.size}listObjectNames(){return Array.from(this.byObject.keys())}getDefault(t,r){let n=this.getByObjectNameAndType(t,r);return n.find(o=>o.default)??n[0]}clear(){this.views.clear(),this.byObject.clear(),this.byObjectAndType.clear();}summary(){let t=[];t.push(`[ViewRegistry] ${this.size} view(s) registered:`);for(let r of this.listObjectNames()){let o=this.getByObjectName(r).map(a=>{let s=[];a.default&&s.push("default");let l=s.length>0?` (${s.join(", ")})`:"";return `${a.name}:${a.type}${l}`});t.push(` ${r}: ${o.join(", ")}`);}return t.join(`
|
|
60
|
+
`)}debug(t){let r=this.summary();return t?.(r),r}makeKey(t,r,n){return `${t}:${r}:${n}`}};chunkDPD6ZWL2_js.a(jn,"ViewRegistry");var Vn=jn,rl=new Vn;function Po(e,t=[]){return e.filter(r=>!(!chunkVY5UBDTO_js.j(r).lifecycle.visibleInRuntime||r.system||t.includes(r.name)))}chunkDPD6ZWL2_js.a(Po,"getRuntimeAttributes");function Fo(e){return [...e].sort((t,r)=>{let n=t.order??999,o=r.order??999;return n!==o?n-o:t.name.localeCompare(r.name)})}chunkDPD6ZWL2_js.a(Fo,"sortAttributes");function nl(e){if(e.type==="text"&&e.multiline)return 12;switch(e.type){case "richtext":case "location":return 12;case "checkbox":return 4;default:return 6}}chunkDPD6ZWL2_js.a(nl,"getDefaultFieldSpan");function il(e){return {attribute:e.name,span:nl(e)}}chunkDPD6ZWL2_js.a(il,"attributeToField");function Mn(e,t={}){let{includeActivityTab:r=true,includeDocumentsTab:n=true,excludeAttributes:o=[]}=t,a=Po(e.attributes,o),p=[{id:"form",name:"form",label:"Details",type:"form",groups:[{id:"general",label:"General",type:"fields",fields:Fo(a.filter(ae=>chunkVY5UBDTO_js.j(ae).presentation.formField)).map(il),order:0}],order:0}],I=1,Z=e.attributes.some(ae=>ae.type==="document");n&&Z&&p.push({id:"documents",name:"documents",label:"Documents",type:"documents",order:I++,allowUpload:true,allowRemove:true}),r&&p.push({id:"activity",name:"activity",label:"Activity",type:"activity",order:I++});let B={tabs:p};return {name:"default",label:"Default View",object:e.name,type:"detail",config:B,default:true}}chunkDPD6ZWL2_js.a(Mn,"generateDefaultDetailView");function Ln(e,t={}){let{excludeAttributes:r=[],maxListColumns:n=5}=t,o=Po(e.attributes,r),l={tabs:[{id:"all",label:"All",default:true,visibility:"workspace",layout:"table",columns:Fo(o.filter(p=>chunkVY5UBDTO_js.j(p).presentation.defaultColumn)).slice(0,n).map(p=>p.name)}]};return {name:"default",label:"All Records",object:e.name,type:"list",config:l,default:true}}chunkDPD6ZWL2_js.a(Ln,"generateDefaultListView");function ol(e,t){let{preserveCustomTabs:r=true,preserveTableTabs:n=true}=t,o=[];for(let a of e.config.tabs)r&&a.type==="custom"&&o.push(a),n&&a.type==="table"&&o.push(a);return o}chunkDPD6ZWL2_js.a(ol,"getPreservedDetailTabs");function al(e,t){if(t.length===0)return e;let r=e.find(s=>s.type==="form"),n=e.filter(s=>s.type!=="form"),o=[];r&&o.push(r);let a=1;for(let s of t)o.push({...s,order:a++});for(let s of n)o.push({...s,order:a++});return o}chunkDPD6ZWL2_js.a(al,"mergeDetailTabs");function sl(e,t,r){let{preserveMetadata:n=true,...o}=r,a=Mn(t,o),s=ol(e,r),l=al(a.config.tabs,s),p={...a.config,tabs:l},I={...a,config:p};return n&&(I.id=e.id,I.name=e.name,I.label=e.label,I.description=e.description,I.icon=e.icon),I}chunkDPD6ZWL2_js.a(sl,"resetDetailViewToDefault");function ul(e,t,r){let{preserveMetadata:n=true,...o}=r,s={...Ln(t,o)};return n&&(s.id=e.id,s.name=e.name,s.label=e.label,s.description=e.description,s.icon=e.icon),s}chunkDPD6ZWL2_js.a(ul,"resetListViewToDefault");function ll(e,t,r={}){if(Je(e))return sl(e,t,r);if(to(e))return ul(e,t,r);throw new Error(`Reset not supported for view type: ${e.type}`)}chunkDPD6ZWL2_js.a(ll,"resetViewToDefault");function ew(e,t){if(t){let r=e.tabs.find(n=>n.id===t);if(r)return r}return e.tabs.find(r=>r.default)??e.tabs[0]}chunkDPD6ZWL2_js.a(ew,"getActiveTab");function Bn(e){return structuredClone(e)}chunkDPD6ZWL2_js.a(Bn,"cloneFormDefinition");var Un=class Un{constructor(){this.forms=new Map;}register(t){let r=Array.isArray(t)?t:[t];for(let n of r){if(this.forms.has(n.name))throw new chunkGZUTZAPU_js.r("form",n.name,`[FormRegistry] Duplicate form: "${n.name}"`);this.forms.set(n.name,Bn(n));}return this}get(t){let r=this.forms.get(t);return r?Bn(r):void 0}getAll(){return Array.from(this.forms.values(),Bn)}listNames(){return Array.from(this.forms.keys())}};chunkDPD6ZWL2_js.a(Un,"FormRegistry");var Pe=Un;var Vo=new Pe;function cw(e,t){return `${e}:${t}`}chunkDPD6ZWL2_js.a(cw,"formatAgentStreamFrameId");function pw(e){let t=e.lastIndexOf(":");if(t<=0)return null;let r=e.slice(0,t),n=Number(e.slice(t+1));return !Number.isInteger(n)||n<=0?null:{streamId:r,sequence:n}}chunkDPD6ZWL2_js.a(pw,"parseAgentStreamFrameId");var bw=204800,gw=256;function qn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(qn,"isRecord");function zn(e,t){let r=Object.keys(e);return r.length===t.length&&r.every(n=>t.includes(n))}chunkDPD6ZWL2_js.a(zn,"hasExactKeys");function $n(e){return typeof e=="number"&&Number.isInteger(e)&&e>0}chunkDPD6ZWL2_js.a($n,"isPositiveInteger");function jo(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(jo,"isNonNegativeInteger");function dl(e){return qn(e)&&zn(e,["kind","startOffset","endOffset"])?(e.kind==="text"||e.kind==="reasoning")&&jo(e.startOffset)&&jo(e.endOffset)&&e.endOffset>=e.startOffset:false}chunkDPD6ZWL2_js.a(dl,"isContentRange");function cl(e){if(!qn(e))return false;let t=e.content===void 0?["sequence","chunk"]:["sequence","content","chunk"];return zn(e,t)&&$n(e.sequence)&&e.chunk!==void 0&&(e.content===void 0||dl(e.content))}chunkDPD6ZWL2_js.a(cl,"isBatchItem");function pl(e){try{return new TextEncoder().encode(JSON.stringify(e)).byteLength}catch{return}}chunkDPD6ZWL2_js.a(pl,"encodedSize");function yw(e){if(!(qn(e)&&zn(e,["schemaVersion","batchId","tenantId","sessionId","streamId","sequenceStart","sequenceEnd","items"]))||e.schemaVersion!==1||typeof e.batchId!="string"||e.batchId.trim()===""||typeof e.tenantId!="string"||e.tenantId.trim()===""||typeof e.sessionId!="string"||e.sessionId.trim()===""||typeof e.streamId!="string"||e.streamId.trim()===""||!$n(e.sequenceStart)||!$n(e.sequenceEnd)||!Array.isArray(e.items)||e.items.length===0||e.items.length>256||!e.items.every(cl))return false;let t=0;for(let n of e.items){if(n.sequence<=t)return false;t=n.sequence;}if(e.items[0]?.sequence!==e.sequenceStart||e.items.at(-1)?.sequence!==e.sequenceEnd)return false;let r=pl(e);return r!==void 0&&r<=204800}chunkDPD6ZWL2_js.a(yw,"isAgentUIMessageBatch");function Tw(e){switch(e.kind){case "workspace":return `workspace:${encodeURIComponent(e.tenantId)}`;case "object":return `object:${encodeURIComponent(e.objectId)}`;case "record":return `record:${encodeURIComponent(e.objectId)}:${encodeURIComponent(e.recordId)}`;case "view":return `view:${encodeURIComponent(e.viewId)}`;case "user":return `user:${encodeURIComponent(e.actorId)}`;case "conversation":return `conversation:${encodeURIComponent(e.sessionId)}`;case "architect-draft":return `architect-draft:${encodeURIComponent(e.actorId)}`}}chunkDPD6ZWL2_js.a(Tw,"liveChannelKey");function te(e){try{return decodeURIComponent(e)}catch{return null}}chunkDPD6ZWL2_js.a(te,"decodeLiveChannelPart");function Mo(e){let t=e.split(":");if(t[0]==="workspace"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"workspace",tenantId:r}:null}if(t[0]==="object"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"object",objectId:r}:null}if(t[0]==="record"&&t.length===3&&t[1]&&t[2]){let r=te(t[1]),n=te(t[2]);return r&&n?{kind:"record",objectId:r,recordId:n}:null}if(t[0]==="view"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"view",viewId:r}:null}if(t[0]==="user"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"user",actorId:r}:null}if(t[0]==="architect-draft"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"architect-draft",actorId:r}:null}if(t[0]==="conversation"&&t.length===2&&t[1]){let r=te(t[1]);return r?{kind:"conversation",sessionId:r}:null}return null}chunkDPD6ZWL2_js.a(Mo,"parseLiveChannelKey");var ml={"record.patch":true,"record.deleted":true,"record.removed":true,"record.created":true,"view.projection.stale":true,"agent.session.patch":true,"notification.created":true,"notification.recipient.patch":true,"notification.count.patch":true,"notification.inbox.archived":true,"reflex.state.changed":true,"reflex.run.completed":true,"reflex.authoring.progress":true,"architect.draft.updated":true,"meeting.recording.patch":true,"wallet.state":true,"channel.revoked":true},fl=Object.keys(ml),bl=["membership-unknown","sort-unknown","permissions-changed"],gl=["permission-revoked","workspace-left","object-deleted"],yl=["inboxState","workState","lockedAt","lockedByActorId","readAt","archivedAt","snoozedUntil","completedAt","dismissedAt","updatedAt"],hl=["type","objectId","recordId","recordVersion"],Al=["type","objectId","recordId","recordVersion","record"],Tl=["id","objectId","visibility","ownedBy","label","values","metadata","createdAt","updatedAt","createdBy","lastUpdatedBy","schemaVersion"],wl=["type","targetActorId","archivedCount","version","updatedAt"];function xl(e){return typeof e=="string"&&fl.includes(e)}chunkDPD6ZWL2_js.a(xl,"isLiveEventType");function Sw(e){return C(e)&&xl(e.type)?Il(e.type,e):false}chunkDPD6ZWL2_js.a(Sw,"isLiveEventPayload");function Il(e,t){if(!C(t))return false;switch(e){case "record.patch":return Nl(t);case "record.deleted":return Ol(t);case "record.removed":return kl(t);case "record.created":return Pl(t);case "view.projection.stale":return Fl(t);case "agent.session.patch":return Vl(t);case "notification.created":return Bl(t);case "notification.recipient.patch":return Ul(t);case "notification.count.patch":return $l(t);case "notification.inbox.archived":return ql(t);case "reflex.state.changed":return Hl(t);case "reflex.run.completed":return Ql(t);case "reflex.authoring.progress":return Jl(t);case "architect.draft.updated":return Yl(t);case "meeting.recording.patch":return Zl(t);case "wallet.state":return rd(t);case "channel.revoked":return nd(t);default:return false}}chunkDPD6ZWL2_js.a(Il,"isLiveEventPayloadForType");function C(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(C,"isRecord");function F(e){return typeof e=="string"}chunkDPD6ZWL2_js.a(F,"isString");function Lo(e){return F(e)&&e.length>0}chunkDPD6ZWL2_js.a(Lo,"isNonEmptyString");function ht(e){return e===null||F(e)}chunkDPD6ZWL2_js.a(ht,"isNullableString");function Sl(e){return typeof e=="number"&&Number.isSafeInteger(e)&&e>=0}chunkDPD6ZWL2_js.a(Sl,"isVersion");function K(e){if(!F(e))return false;let t=Date.parse(e);return Number.isFinite(t)&&new Date(t).toISOString()===e}chunkDPD6ZWL2_js.a(K,"isIsoDateString");function xe(e){return e===null||K(e)}chunkDPD6ZWL2_js.a(xe,"isNullableIsoDateString");function x(e,t){return F(e[t])}chunkDPD6ZWL2_js.a(x,"hasString");function re(e,t){return Lo(e[t])}chunkDPD6ZWL2_js.a(re,"hasNonEmptyString");function N(e,t){return Sl(e[t])}chunkDPD6ZWL2_js.a(N,"hasVersion");function k(e,t){return K(e[t])}chunkDPD6ZWL2_js.a(k,"hasIsoDateString");function w(e,t,r){return !Object.hasOwn(e,t)||r(e[t])}chunkDPD6ZWL2_js.a(w,"hasOptional");function At(e,t){return Object.keys(e).every(r=>t.includes(r))}chunkDPD6ZWL2_js.a(At,"hasOnlyKeys");function _(e,t){return typeof e=="string"&&t.includes(e)}chunkDPD6ZWL2_js.a(_,"isOneOf");function vl(e){return _(e,ji)}chunkDPD6ZWL2_js.a(vl,"isNotificationKind");function Rl(e){return _(e,Mi)}chunkDPD6ZWL2_js.a(Rl,"isNotificationPriority");function El(e){return _(e,Li)}chunkDPD6ZWL2_js.a(El,"isNotificationSensitivity");function Bo(e){return _(e,Bi)}chunkDPD6ZWL2_js.a(Bo,"isNotificationInboxState");function Uo(e){return _(e,Ui)}chunkDPD6ZWL2_js.a(Uo,"isNotificationWorkState");function Dl(e){return C(e)&&x(e,"type")&&x(e,"id")}chunkDPD6ZWL2_js.a(Dl,"isNotificationSubject");function Cl(e){return C(e)&&x(e,"fieldKey")&&Object.hasOwn(e,"value")&&N(e,"version")}chunkDPD6ZWL2_js.a(Cl,"isRecordFieldPatch");function Nl(e){return e.type==="record.patch"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&w(e,"label",F)&&w(e,"metadata",C)&&w(e,"fieldsWithheld",t=>t===true)&&Array.isArray(e.fieldPatches)&&e.fieldPatches.every(Cl)&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(Nl,"isRecordPatchPayload");function Ol(e){return e.type==="record.deleted"&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&x(e,"deletedAt")}chunkDPD6ZWL2_js.a(Ol,"isRecordDeletedPayload");function kl(e){return e.type==="record.removed"&&At(e,hl)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")}chunkDPD6ZWL2_js.a(kl,"isRecordRemovedPayload");function _l(e){return C(e)&&At(e,Tl)&&x(e,"id")&&x(e,"objectId")&&_(e.visibility,["workspace","private"])&&ht(e.ownedBy)&&(e.visibility==="workspace"&&e.ownedBy===null||e.visibility==="private"&&Lo(e.ownedBy))&&x(e,"label")&&C(e.values)&&w(e,"metadata",C)&&k(e,"createdAt")&&k(e,"updatedAt")&&w(e,"createdBy",F)&&w(e,"lastUpdatedBy",F)&&N(e,"schemaVersion")}chunkDPD6ZWL2_js.a(_l,"isRecordLiveSnapshot");function Pl(e){return e.type==="record.created"&&At(e,Al)&&x(e,"objectId")&&x(e,"recordId")&&N(e,"recordVersion")&&_l(e.record)&&e.record.id===e.recordId&&e.record.objectId===e.objectId}chunkDPD6ZWL2_js.a(Pl,"isRecordCreatedPayload");function Fl(e){return e.type==="view.projection.stale"&&x(e,"viewId")&&_(e.reason,bl)}chunkDPD6ZWL2_js.a(Fl,"isViewProjectionStalePayload");function Vl(e){return e.type==="agent.session.patch"&&x(e,"sessionId")&&C(e.patch)&&N(e,"version")&&x(e,"updatedAt")}chunkDPD6ZWL2_js.a(Vl,"isAgentSessionPatchPayload");function jl(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&w(e,"senderActorId",F)&&w(e,"rootActorId",F)&&w(e,"triggeredByActorId",F)&&vl(e.kind)&&x(e,"type")&&w(e,"subject",Dl)&&x(e,"title")&&w(e,"summary",F)&&C(e.payload)&&Rl(e.priority)&&El(e.sensitivity)&&w(e,"threadKey",F)&&w(e,"idempotencyKey",F)&&w(e,"expiresAt",K)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(jl,"isLiveNotification");function Ml(e){return C(e)&&x(e,"id")&&x(e,"tenantId")&&x(e,"notificationId")&&x(e,"recipientActorId")&&Bo(e.inboxState)&&Uo(e.workState)&&w(e,"lockedAt",K)&&w(e,"lockedByActorId",F)&&w(e,"readAt",K)&&w(e,"archivedAt",K)&&w(e,"snoozedUntil",K)&&w(e,"completedAt",K)&&w(e,"dismissedAt",K)&&k(e,"createdAt")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Ml,"isLiveNotificationRecipient");function Ll(e){return C(e)?Object.keys(e).every(t=>yl.includes(t))&&w(e,"inboxState",Bo)&&w(e,"workState",Uo)&&w(e,"lockedAt",xe)&&w(e,"lockedByActorId",ht)&&w(e,"readAt",xe)&&w(e,"archivedAt",xe)&&w(e,"snoozedUntil",xe)&&w(e,"completedAt",xe)&&w(e,"dismissedAt",xe)&&w(e,"updatedAt",K):false}chunkDPD6ZWL2_js.a(Ll,"isNotificationRecipientPatch");function Bl(e){let t=jl(e.notification)?e.notification:null;return e.type==="notification.created"&&t!==null&&Array.isArray(e.recipients)&&e.recipients.length>0&&e.recipients.every(r=>Ml(r)&&r.notificationId===t.id)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Bl,"isNotificationCreatedPayload");function Ul(e){return e.type==="notification.recipient.patch"&&x(e,"recipientId")&&x(e,"recipientActorId")&&Ll(e.patch)&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Ul,"isNotificationRecipientPatchPayload");function $l(e){return e.type==="notification.count.patch"&&x(e,"targetActorId")&&N(e,"unread")&&N(e,"pendingWork")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a($l,"isNotificationCountPatchPayload");function ql(e){return e.type==="notification.inbox.archived"&&At(e,wl)&&re(e,"targetActorId")&&N(e,"archivedCount")&&N(e,"version")&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(ql,"isNotificationInboxArchivedPayload");var zl=["armed","disarmed"],Gl=["authoring","compiling","replaying","promoted","failed"],Wl=["promoted","lkg"],Kl=["composing","published","discarded"];function Yl(e){if(e.type!=="architect.draft.updated"||!C(e.draft))return false;let t=e.draft;return re(t,"id")&&re(t,"actorId")&&ht(t.agentSessionId)&&Array.isArray(t.operations)&&t.operations.every(C)&&C(t.baselines)&&_(t.status,Kl)}chunkDPD6ZWL2_js.a(Yl,"isArchitectDraftUpdatedPayload");function Hl(e){return e.type==="reflex.state.changed"&&re(e,"reflexId")&&_(e.state,zl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Hl,"isReflexStateChangedPayload");function Ql(e){return e.type==="reflex.run.completed"&&re(e,"reflexId")&&re(e,"runId")&&_(e.served,Wl)&&N(e,"version")&&N(e,"wallMs")&&k(e,"completedAt")}chunkDPD6ZWL2_js.a(Ql,"isReflexRunCompletedPayload");function Jl(e){return e.type==="reflex.authoring.progress"&&re(e,"reflexId")&&_(e.status,Gl)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Jl,"isReflexAuthoringProgressPayload");var Xl=["none","scheduled","recording","completed","failed"];function Zl(e){return e.type==="meeting.recording.patch"&&re(e,"meetingId")&&_(e.status,Xl)&&ht(e.failureReason)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(Zl,"isMeetingRecordingPatchPayload");var ed=["ok","low","exhausted","paused"],td=["metering-only","contract","wallet"];function rd(e){return e.type==="wallet.state"&&_(e.status,ed)&&_(e.mode,td)&&k(e,"updatedAt")}chunkDPD6ZWL2_js.a(rd,"isWalletStatePayload");function nd(e){return e.type==="channel.revoked"&&x(e,"channel")&&_(e.reason,gl)}chunkDPD6ZWL2_js.a(nd,"isChannelRevokedPayload");function Gn(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(Gn,"isRecord");function id(e){let{channel:t}=e;return typeof t=="string"&&Mo(t)?t:null}chunkDPD6ZWL2_js.a(id,"payloadChannel");function Dw(e){return Gn(e)?id(e):null}chunkDPD6ZWL2_js.a(Dw,"getLiveProtocolPayloadChannel");function Cw(e){return Gn(e)?typeof e.id=="string"&&e.id.length>0&&typeof e.channel=="string"&&typeof e.type=="string"&&typeof e.tenantId=="string"&&e.tenantId.length>0&&typeof e.occurredAt=="string"&&Gn(e.payload):false}chunkDPD6ZWL2_js.a(Cw,"isLiveEventEnvelope");var kw=["if","concat","sum","avg","count","min","max","earliest","latest","unique","first","percent_empty","percent_not_empty","count_empty","count_not_empty","count_unique"],Fe={if:{name:"if",returnType:"branch",minArgs:3,maxArgs:3},concat:{name:"concat",returnType:{kind:"scalar",type:"text"},minArgs:1},sum:{name:"sum",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},avg:{name:"avg",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count:{name:"count",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},min:{name:"min",returnType:"source_item",minArgs:1,maxArgs:1},max:{name:"max",returnType:"source_item",minArgs:1,maxArgs:1},earliest:{name:"earliest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},latest:{name:"latest",returnType:{kind:"scalar",type:"date"},minArgs:1,maxArgs:1},unique:{name:"unique",returnType:"argument",minArgs:1,maxArgs:1},first:{name:"first",returnType:"source_item",minArgs:1,maxArgs:1},percent_empty:{name:"percent_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},percent_not_empty:{name:"percent_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_empty:{name:"count_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_not_empty:{name:"count_not_empty",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1},count_unique:{name:"count_unique",returnType:{kind:"scalar",type:"number"},minArgs:1,maxArgs:1}};function Tt(e){return Object.hasOwn(Fe,e)}chunkDPD6ZWL2_js.a(Tt,"isComputedFunctionName");var Hn=class Hn extends Error{constructor(t){super(t),this.name="ComputedFormulaCompileError";}};chunkDPD6ZWL2_js.a(Hn,"ComputedFormulaCompileError");var b=Hn;function Ko(e){let t=od(e.expression),r=wt(t,e.schema),n=Ed(r.valueType);if(n!==e.returnType)throw new b(`Computed formula "${e.attributeName}" returns "${n}", expected "${e.returnType}"`);if(Yo(e.returnType)&&r.optionsSource===void 0)throw new b(`Computed formula "${e.attributeName}" returns "${e.returnType}" without optionsSource`);let o=r.optionsSource===void 0?[]:[{kind:"options",source:r.optionsSource}],a=Yn([...r.dependencies,...o]);return {kind:"formula",attributeName:e.attributeName,expression:e.expression,returnType:e.returnType,valueType:r.valueType,dependencies:a,ast:t,...r.optionsSource?{optionsSource:r.optionsSource}:{},...r.targetAttributeType?{targetAttributeType:r.targetAttributeType}:{},dependenciesHash:Dd({expression:e.expression,returnType:e.returnType,dependencies:a})}}chunkDPD6ZWL2_js.a(Ko,"compileComputedFormula");function jw(e){let t=new Map(e.map(o=>[o.attributeName,o])),r=new Set,n=chunkDPD6ZWL2_js.a((o,a)=>{let s=a.indexOf(o);if(s!==-1){let I=[...a.slice(s),o];throw new b(`Computed field cycle detected: ${I.join(" -> ")}`)}if(r.has(o))return;let l=t.get(o);if(l===void 0)return;let p=[...a,o];for(let I of l.dependencies)I.kind==="computed"&&n(I.attributeName,p);r.add(o);},"visit");for(let o of e)n(o.attributeName,[]);}chunkDPD6ZWL2_js.a(jw,"assertAcyclicComputedDependencies");function od(e){try{return chunkPKJYAV5U_js.e(e)}catch(t){throw t instanceof Error?new b(t.message):t}}chunkDPD6ZWL2_js.a(od,"parseCompileFormula");function wt(e,t){switch(e.kind){case "literal":return {valueType:ad(e.value),dependencies:[],...typeof e.value=="string"?{literalString:e.value}:{}};case "path":return sd(e.parts,t);case "call":return md(e.functionName,e.args,t);case "binary":return hd(e.operator,wt(e.left,t),wt(e.right,t));default:return e}}chunkDPD6ZWL2_js.a(wt,"inferNode");function ad(e){switch(typeof e){case "string":return {kind:"scalar",type:"text"};case "number":return {kind:"scalar",type:"number"};case "boolean":return {kind:"scalar",type:"boolean"};case "object":return {kind:"scalar",type:"text"};default:return e}}chunkDPD6ZWL2_js.a(ad,"literalToValueType");function sd(e,t){if(e.length===1){let r=e[0],n=Wn(t,r);if(n===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);return n.type==="relation"?{valueType:dd(),dependencies:[{kind:"relation",relationName:n.name,cardinality:$o(n)}],targetAttributeType:n.type}:{valueType:qo(n),dependencies:[ld(n)],optionsSource:zo(t.objectName,n),targetAttributeType:n.type}}if(e.length===2){let[r,n]=e,o=Wn(t,r);if(o===void 0)throw new b(`Unknown attribute "${r}" on object "${t.objectName}"`);if(o.type!=="relation")throw new b(`Attribute "${r}" on object "${t.objectName}" is not a relation`);let a=ud(o);if(a===void 0)throw new b(`Relation "${r}" on object "${t.objectName}" is missing targetObjectName`);let s=t.relatedObjects?.[a];if(s===void 0)throw new b(`Unknown related object "${a}"`);let l=Wn(s,n);if(l===void 0)throw new b(`Unknown attribute "${n}" on object "${s.objectName}"`);let p=qo(l);return {valueType:o.cardinality==="many"?pd(p):p,dependencies:[{kind:"relation",relationName:r,targetAttributeName:n,cardinality:$o(o)}],optionsSource:zo(s.objectName,l),targetAttributeType:l.type}}throw new b("Computed paths support at most one relation hop")}chunkDPD6ZWL2_js.a(sd,"inferPath");function Wn(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(Wn,"findAttribute");function ud(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(ud,"getRelationTargetObjectName");function $o(e){return e.cardinality??"one"}chunkDPD6ZWL2_js.a($o,"relationCardinality");function ld(e){return e.type==="formula"||e.type==="rollup"?{kind:"computed",attributeName:e.name}:{kind:"local",attributeName:e.name}}chunkDPD6ZWL2_js.a(ld,"localDependencyFor");function qo(e){if(e.type==="formula"||e.type==="rollup"){if(e.returnType===void 0)throw new b(`Computed attribute "${e.name}" is missing returnType`);return cd(e.returnType)}switch(e.type){case "number":case "currency":return {kind:"scalar",type:"number"};case "checkbox":return {kind:"scalar",type:"boolean"};case "date":return {kind:"scalar",type:"date"};case "select":case "status":return {kind:"scalar",type:"select"};case "multiselect":return {kind:"collection",itemType:"select"};case "text":case "richtext":case "phone":case "user":case "location":case "relation":case "document":return {kind:"scalar",type:"text"};default:return e.type}}chunkDPD6ZWL2_js.a(qo,"attributeToValueType");function dd(){return {kind:"collection",itemType:"text"}}chunkDPD6ZWL2_js.a(dd,"relationToValueType");function cd(e){return e==="multiselect"?{kind:"collection",itemType:"select"}:{kind:"scalar",type:e}}chunkDPD6ZWL2_js.a(cd,"returnTypeToValueType");function pd(e){return e.kind==="collection"?e:{kind:"collection",itemType:e.type}}chunkDPD6ZWL2_js.a(pd,"asCollectionValueType");function zo(e,t){if(t.type==="formula"||t.type==="rollup")return Yo(t.returnType)?t.optionsSource:void 0;if(!(t.type!=="select"&&t.type!=="status"&&t.type!=="multiselect"))return t.optionsSource??{objectName:e,attributeName:t.name,...t.id?{attributeId:t.id}:{}}}chunkDPD6ZWL2_js.a(zo,"optionsSourceForAttribute");function md(e,t,r){if(!Tt(e))throw new b(`Unknown computed function "${e}"`);let n=Fe[e];if(t.length<n.minArgs||n.maxArgs!==void 0&&t.length>n.maxArgs){let a=n.maxArgs===void 0||n.maxArgs===n.minArgs?String(n.minArgs):`${n.minArgs}-${n.maxArgs}`;throw new b(`Function "${e}" expects ${a} arguments, received ${t.length}`)}let o=t.map(a=>wt(a,r));return fd(e,o)}chunkDPD6ZWL2_js.a(md,"inferCall");function fd(e,t){let r=Yn(t.flatMap(n=>n.dependencies));switch(e){case "if":return bd(t,r);case "concat":return Ad(t,`Function "${e}" does not accept collection values`),{valueType:{kind:"scalar",type:"text"},dependencies:r};case "sum":case "avg":return Go(e,t[0],"number"),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "count":case "count_empty":case "count_not_empty":case "count_unique":case "percent_empty":case "percent_not_empty":return wd(e,t[0]),{valueType:{kind:"scalar",type:"number"},dependencies:r};case "min":case "max":return Td(e,t[0]),{valueType:xd(t[0]),dependencies:r,optionsSource:t[0].optionsSource,targetAttributeType:t[0].targetAttributeType};case "earliest":case "latest":return Go(e,t[0],"date"),{valueType:{kind:"scalar",type:"date"},dependencies:r,targetAttributeType:t[0].targetAttributeType};case "unique":return gd(t[0],r);case "first":return yd(t[0],r);default:return e}}chunkDPD6ZWL2_js.a(fd,"inferFunctionReturn");function bd(e,t){Kn(e[0].valueType,"boolean",'Function "if" condition must be boolean');let r=e[1],n=e[2],o=Sd(r,n),a=vd(r,n);if(o===void 0)throw new b('Function "if" branches must return the same type');return {valueType:o,dependencies:t,...a?{optionsSource:a}:{},targetAttributeType:r.targetAttributeType??n.targetAttributeType}}chunkDPD6ZWL2_js.a(bd,"inferIfFunction");function gd(e,t){if(e.valueType.kind!=="collection"||e.valueType.itemType!=="select")throw new b('Function "unique" expects a select collection');return {valueType:{kind:"collection",itemType:"select"},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(gd,"inferUniqueFunction");function yd(e,t){if(e.valueType.kind!=="collection")throw new b('Function "first" expects a collection');return {valueType:{kind:"scalar",type:e.valueType.itemType},dependencies:t,optionsSource:e.optionsSource,targetAttributeType:e.targetAttributeType}}chunkDPD6ZWL2_js.a(yd,"inferFirstFunction");function hd(e,t,r){let n=Yn([...t.dependencies,...r.dependencies]),o=e==="+"||e==="-"||e==="*"||e==="/";if(t.valueType.kind==="collection"||r.valueType.kind==="collection")throw new b(`Cannot use collection values with ${o?"arithmetic":"comparison"} operator "${e}"`);if(o)return e==="+"&&(t.valueType.type==="text"||r.valueType.type==="text")?{valueType:{kind:"scalar",type:"text"},dependencies:n}:(Kn(t.valueType,"number",`Operator "${e}" expects number operands`),Kn(r.valueType,"number",`Operator "${e}" expects number operands`),{valueType:{kind:"scalar",type:"number"},dependencies:n});if(e==="=="||e==="!="){if(t.valueType.type!==r.valueType.type)throw new b(`Operator "${e}" expects operands with the same scalar type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}if((t.valueType.type!=="number"||r.valueType.type!=="number")&&(t.valueType.type!=="date"||r.valueType.type!=="date"))throw new b(`Operator "${e}" expects number or date operands of the same type`);return {valueType:{kind:"scalar",type:"boolean"},dependencies:n}}chunkDPD6ZWL2_js.a(hd,"inferBinary");function Ad(e,t){for(let r of e)if(r.valueType.kind==="collection")throw new b(t)}chunkDPD6ZWL2_js.a(Ad,"ensureNoCollections");function Go(e,t,r){if((t.valueType.kind==="collection"?t.valueType.itemType:t.valueType.type)!==r)throw new b(`Function "${e}" expects ${r} values`)}chunkDPD6ZWL2_js.a(Go,"ensureCollectionOrScalarType");function Td(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`);let r=t.valueType.itemType;if(r!=="number"&&r!=="date")throw new b(`Function "${e}" expects number or date values`)}chunkDPD6ZWL2_js.a(Td,"ensureMinMaxSource");function wd(e,t){if(t.valueType.kind!=="collection")throw new b(`Function "${e}" expects a collection`)}chunkDPD6ZWL2_js.a(wd,"ensureCollectionSource");function Kn(e,t,r){if(e.kind!=="scalar"||e.type!==t)throw new b(r)}chunkDPD6ZWL2_js.a(Kn,"ensureScalarType");function xd(e){return e.valueType.kind==="scalar"?e.valueType:{kind:"scalar",type:e.valueType.itemType}}chunkDPD6ZWL2_js.a(xd,"sourceItemValueType");function Id(e,t){return e.kind==="scalar"?t.kind==="scalar"&&e.type===t.type:t.kind==="collection"&&e.itemType===t.itemType}chunkDPD6ZWL2_js.a(Id,"sameValueType");function Sd(e,t){if(Id(e.valueType,t.valueType)||Wo(e,t))return e.valueType;if(Wo(t,e))return t.valueType}chunkDPD6ZWL2_js.a(Sd,"resolveIfBranchValueType");function Wo(e,t){return e.valueType.kind==="scalar"&&e.valueType.type==="select"&&t.valueType.kind==="scalar"&&t.valueType.type==="text"&&t.literalString!==void 0}chunkDPD6ZWL2_js.a(Wo,"isSelectScalarWithStringLiteral");function vd(e,t){let r=e.optionsSource,n=t.optionsSource;if(r!==void 0&&n!==void 0&&!Rd(r,n))throw new b('Function "if" branches use incompatible options sources');return r??n}chunkDPD6ZWL2_js.a(vd,"resolveIfOptionsSource");function Rd(e,t){return e.objectName===t.objectName&&e.attributeName===t.attributeName&&e.attributeId===t.attributeId}chunkDPD6ZWL2_js.a(Rd,"sameOptionsSource");function Yo(e){return e==="select"||e==="multiselect"}chunkDPD6ZWL2_js.a(Yo,"isSelectLikeReturnType");function Ed(e){if(e.kind==="scalar")return e.type;if(e.itemType==="select")return "multiselect";throw new b(`Collection item type "${e.itemType}" cannot be used as a computed return type`)}chunkDPD6ZWL2_js.a(Ed,"valueTypeToReturnType");function Yn(e){let t=new Set,r=[];for(let n of e){let o=JSON.stringify(Ve(n));t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(Yn,"uniqueDependencies");function Dd(e){let t=e.dependencies.map(r=>Ve(r)).sort((r,n)=>Ho(JSON.stringify(r),JSON.stringify(n)));return JSON.stringify(Ve({expression:e.expression,returnType:e.returnType,dependencies:t}))}chunkDPD6ZWL2_js.a(Dd,"createDependenciesHash");function Ve(e){return Array.isArray(e)?e.map(t=>Ve(t)):e!==null&&typeof e=="object"?Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>Ho(t,r)).map(([t,r])=>[t,Ve(r)])):e}chunkDPD6ZWL2_js.a(Ve,"stableNormalize");function Ho(e,t){return e<t?-1:e>t?1:0}chunkDPD6ZWL2_js.a(Ho,"compareStrings");function Cd(e){return e.function==="count"?`count(${e.relationAttribute})`:`${kd(e.function)}(${e.relationAttribute}.${e.targetAttribute})`}chunkDPD6ZWL2_js.a(Cd,"rollupToFormulaExpression");function Nd(e,t){if(e.function==="count")return "number";let r=_d(e,t);switch(e.function){case "countValues":case "countEmpty":case "percentEmpty":case "percentNotEmpty":case "countUniqueValues":return "number";case "sum":case "avg":return "number";case "earliest":case "latest":return "date";case "original":if(!Fd(r.type))throw new b('Rollup "original" requires a select, status, or multiselect target');return "multiselect";default:return e.function}}chunkDPD6ZWL2_js.a(Nd,"inferRollupReturnType");function Uw(e,t){let r=Cd(e),n=Nd(e,t);return {...Ko({attributeName:e.name,expression:r,returnType:n,schema:Od(e,t)}),kind:"rollup"}}chunkDPD6ZWL2_js.a(Uw,"compileRollupAttribute");function Od(e,t){return {...t,attributes:t.attributes.map(r=>r.name===e.relationAttribute&&r.type==="relation"?{...r,cardinality:"many"}:r)}}chunkDPD6ZWL2_js.a(Od,"schemaWithRollupRelationAsMany");function kd(e){switch(e){case "sum":case "avg":case "earliest":case "latest":return e;case "original":return "unique";case "countValues":return "count_not_empty";case "countEmpty":return "count_empty";case "percentEmpty":return "percent_empty";case "percentNotEmpty":return "percent_not_empty";case "countUniqueValues":return "count_unique";default:return e}}chunkDPD6ZWL2_js.a(kd,"rollupFunctionToFormulaFunction");function _d(e,t){let r=Qo(t,e.relationAttribute);if(r===void 0)throw new b(`Unknown relation attribute "${e.relationAttribute}" on object "${t.objectName}"`);if(r.type!=="relation")throw new b(`Attribute "${e.relationAttribute}" on object "${t.objectName}" is not a relation`);let n=Pd(r);if(n===void 0)throw new b(`Relation "${e.relationAttribute}" on object "${t.objectName}" is missing targetObjectName`);let o=t.relatedObjects?.[n];if(o===void 0)throw new b(`Unknown related object "${n}"`);let a=Qo(o,e.targetAttribute);if(a===void 0)throw new b(`Unknown attribute "${e.targetAttribute}" on object "${o.objectName}"`);return a}chunkDPD6ZWL2_js.a(_d,"findRollupTargetAttribute");function Qo(e,t){return e.attributes.find(r=>r.name===t)}chunkDPD6ZWL2_js.a(Qo,"findAttribute");function Pd(e){if(e.targetObjectName!==void 0)return e.targetObjectName;if(e.targets?.length===1){let[t]=e.targets;return t?.object==="*"?void 0:t?.object}}chunkDPD6ZWL2_js.a(Pd,"getRelationTargetObjectName");function Fd(e){return e==="select"||e==="status"||e==="multiselect"}chunkDPD6ZWL2_js.a(Fd,"isSelectLikeAttributeType");function X(e,t){switch(e.kind){case "literal":return e.value;case "path":return jd(t,e.parts);case "binary":return Md(e.operator,X(e.left,t),X(e.right,t));case "call":return Vd(e.functionName,e.args,t);default:return e}}chunkDPD6ZWL2_js.a(X,"evaluateAst");function Vd(e,t,r){if(Bd(e),Ud(e,t.length),e==="if"){let n=X(t[0],r);return n===null?null:X(n?t[1]:t[2],r)}return $d(e,t.map(n=>X(n,r)))}chunkDPD6ZWL2_js.a(Vd,"evaluateCallNode");function jd(e,t){return t.reduce((r,n)=>ra(r,n),e)}chunkDPD6ZWL2_js.a(jd,"resolvePath");function ra(e,t){if(Array.isArray(e))return e.map(n=>ra(n,t));if(!ta(e))return null;if(Object.hasOwn(e,t))return e[t]??null;let r=e.values;return ta(r)&&Object.hasOwn(r,t)?r[t]??null:null}chunkDPD6ZWL2_js.a(ra,"resolvePathPart");function Md(e,t,r){switch(e){case "+":return Ld(t,r);case "-":return It(t,r,(n,o)=>n-o);case "*":return It(t,r,(n,o)=>n*o);case "/":return It(t,r,(n,o)=>n/o);case ">":return xt(t,r,n=>n>0);case "<":return xt(t,r,n=>n<0);case ">=":return xt(t,r,n=>n>=0);case "<=":return xt(t,r,n=>n<=0);case "==":return Jo(t,r);case "!=":{let n=Jo(t,r);return n===null?null:!n}default:return e}}chunkDPD6ZWL2_js.a(Md,"evaluateBinary");function Ld(e,t){return typeof e=="string"||typeof t=="string"?`${e??""}${t??""}`:It(e,t,(r,n)=>r+n)}chunkDPD6ZWL2_js.a(Ld,"add");function xt(e,t,r){let n=na(e,t);return n===null?null:r(n)}chunkDPD6ZWL2_js.a(xt,"compareWith");function na(e,t){if(!Ie([e,t]))return null;let r=Se(e),n=Se(t);if(r!==null&&n!==null)return r-n;let o=Xn(e),a=Xn(t);return o&&a?o.getTime()-a.getTime():null}chunkDPD6ZWL2_js.a(na,"compare");function Jo(e,t){return e===t?true:e==null||t===null||t===void 0?false:Ie([e,t])?na(e,t)===0:null}chunkDPD6ZWL2_js.a(Jo,"equalScalar");function Bd(e){if(!Tt(e))throw new Error(`Unknown computed function "${e}"`)}chunkDPD6ZWL2_js.a(Bd,"assertComputedFunctionName");function Ud(e,t){let{minArgs:r,maxArgs:n}=Fe[e];if(t>=r&&t<=(n??Number.POSITIVE_INFINITY))return;let o=n===void 0?`at least ${r}`:`between ${r} and ${n}`;throw new Error(`Function "${e}" expects ${o} arguments, received ${t}`)}chunkDPD6ZWL2_js.a(Ud,"validateArity");function $d(e,t){switch(e){case "concat":return t.filter(r=>r!=null).map(String).join("");case "sum":return Ie(t)?Qn(t).reduce((r,n)=>r+n,0):null;case "avg":{if(!Ie(t))return null;let r=Qn(t);return r.length>0?r.reduce((n,o)=>n+o,0)/r.length:null}case "count":return de(t[0]).length;case "min":return Xo(t,"min");case "max":return Xo(t,"max");case "earliest":return Jn(t,"min");case "latest":return Jn(t,"max");case "unique":return ea(de(t[0]));case "first":return de(t[0]).find(r=>r!=null)??null;case "percent_empty":return Zo(t[0],true);case "percent_not_empty":return Zo(t[0],false);case "count_empty":return de(t[0]).filter(chunkC4LR6U4E_js.a).length;case "count_not_empty":return de(t[0]).filter(r=>!chunkC4LR6U4E_js.a(r)).length;case "count_unique":return ea(de(t[0])).length;default:return e}}chunkDPD6ZWL2_js.a($d,"evaluateCall");function Qn(e){return St(e).map(Se).filter(t=>t!==null)}chunkDPD6ZWL2_js.a(Qn,"numericValues");function Ie(e){let t=new Set;for(let r of St(e))Zn(r)&&t.add(ia(r));return t.size<=1}chunkDPD6ZWL2_js.a(Ie,"areCommensurable");function ia(e){return e.code.toUpperCase()}chunkDPD6ZWL2_js.a(ia,"currencyCode");function It(e,t,r){if(!Ie([e,t]))return null;let n=Se(e),o=Se(t);if(n===null||o===null)return null;let a=r(n,o);return Number.isFinite(a)?a:null}chunkDPD6ZWL2_js.a(It,"numericBinary");function Xo(e,t){if(!Ie(e))return null;let r=Qn(e);return r.length>0?t==="min"?Math.min(...r):Math.max(...r):Jn(e,t)}chunkDPD6ZWL2_js.a(Xo,"minMax");function Jn(e,t){let r=St(e).map(Xn).filter(a=>a!==null);if(r.length===0)return null;let n=r.map(a=>a.getTime()),o=t==="min"?Math.min(...n):Math.max(...n);return new Date(o).toISOString()}chunkDPD6ZWL2_js.a(Jn,"dateMinMax");function Zo(e,t){let r=de(e);return r.length===0?0:r.filter(o=>chunkC4LR6U4E_js.a(o)===t).length/r.length}chunkDPD6ZWL2_js.a(Zo,"percentByEmptyState");function ea(e){let t=new Set,r=[];for(let n of e){if(chunkC4LR6U4E_js.a(n))continue;let o=qd(n);t.has(o)||(t.add(o),r.push(n));}return r}chunkDPD6ZWL2_js.a(ea,"uniqueNonEmpty");function de(e){return e==null?[]:Array.isArray(e)?St(e):[e]}chunkDPD6ZWL2_js.a(de,"collectionItems");function St(e){return e.flat(Number.POSITIVE_INFINITY)}chunkDPD6ZWL2_js.a(St,"flatten");function Se(e){if(typeof e=="number")return Number.isFinite(e)?e:null;if(typeof e=="string"&&e.trim()!==""){let t=Number(e);return Number.isFinite(t)?t:null}return Zn(e)&&Number.isFinite(e.value)?e.value:null}chunkDPD6ZWL2_js.a(Se,"toFiniteNumber");function Zn(e){return typeof e=="object"&&e!==null&&typeof e.value=="number"&&typeof e.code=="string"}chunkDPD6ZWL2_js.a(Zn,"isCurrencyValue");function Xn(e){if(e instanceof Date)return Number.isNaN(e.getTime())?null:e;if(typeof e!="string"){let r=be(e);if(r===null)return null;let n=new Date(r);return Number.isNaN(n.getTime())?null:n}let t=new Date(e);return Number.isNaN(t.getTime())?null:t}chunkDPD6ZWL2_js.a(Xn,"toDate");function qd(e){if(Zn(e))return `currency:${ia(e)}:${e.value}`;let t=Se(e);return t!==null?`number:${t}`:e instanceof Date?`date:${e.toISOString()}`:`${typeof e}:${JSON.stringify(e)}`}chunkDPD6ZWL2_js.a(qd,"uniqueKey");function ta(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}chunkDPD6ZWL2_js.a(ta,"isPlainRecord");function zd(e,t,r){if(e==null)return null;let n=chunkDPD6ZWL2_js.a(o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"||o instanceof Date?String(o):null,"stringifyScalar");switch(t){case "number":{let o=typeof e=="number"?e:Number(e);return Number.isNaN(o)?null:r!==void 0?Number(o.toFixed(r)):o}case "boolean":return !!e;case "date":return e instanceof Date?e.toISOString():typeof e=="string"?e:null;case "text":return String(e);case "select":if(Array.isArray(e)){for(let o of e){if(o==null)continue;let a=n(o);if(a!==null)return a}return null}return n(e);case "multiselect":return Array.isArray(e)?e.flatMap(o=>{if(o==null)return [];let a=n(o);return a===null?[]:[a]}):n(e)===null?[]:[String(e)];default:{let o=t;throw new Error(`Unsupported computed return type: ${o}`)}}}chunkDPD6ZWL2_js.a(zd,"formatComputedResult");function Yw(e,t){return X(e,t)}chunkDPD6ZWL2_js.a(Yw,"evaluateComputedAst");function Hw(e,t){return X(chunkPKJYAV5U_js.e(e),t)}chunkDPD6ZWL2_js.a(Hw,"evaluateComputedFormula");function Qw(e,t,r,n){try{let o=X(chunkPKJYAV5U_js.e(e),t);return {value:r?zd(o,r,n):o}}catch(o){return {value:null,error:o instanceof Error?o.message:String(o)}}}chunkDPD6ZWL2_js.a(Qw,"evaluateComputedFormulaWithResult");var Zw=[{name:"if",signature:"if(condition, then, else)",description:"Conditional value",category:"logic",example:"if(amount > 100, 'big', 'small')"},{name:"concat",signature:"concat(a, b, ...)",description:"Join values into text",category:"text",example:"concat(firstName, ' ', lastName)"},{name:"sum",signature:"sum(collection)",description:"Total of values",category:"number",example:"sum(orders.amount)"},{name:"avg",signature:"avg(collection)",description:"Average of values",category:"number",example:"avg(orders.amount)"},{name:"min",signature:"min(collection)",description:"Smallest value",category:"number",example:"min(orders.amount)"},{name:"max",signature:"max(collection)",description:"Largest value",category:"number",example:"max(orders.amount)"},{name:"count",signature:"count(collection)",description:"Number of items",category:"collection",example:"count(orders)"},{name:"count_empty",signature:"count_empty(collection)",description:"Items with no value",category:"collection",example:"count_empty(orders.note)"},{name:"count_not_empty",signature:"count_not_empty(collection)",description:"Items with a value",category:"collection",example:"count_not_empty(orders.note)"},{name:"count_unique",signature:"count_unique(collection)",description:"Distinct values",category:"collection",example:"count_unique(orders.status)"},{name:"percent_empty",signature:"percent_empty(collection)",description:"Fraction with no value",category:"collection",example:"percent_empty(orders.note)"},{name:"percent_not_empty",signature:"percent_not_empty(collection)",description:"Fraction with a value",category:"collection",example:"percent_not_empty(orders.note)"},{name:"unique",signature:"unique(collection)",description:"Distinct values as a list",category:"collection",example:"unique(orders.status)"},{name:"first",signature:"first(collection)",description:"First non-empty value",category:"collection",example:"first(orders.status)"},{name:"earliest",signature:"earliest(collection)",description:"Earliest date",category:"date",example:"earliest(orders.closeDate)"},{name:"latest",signature:"latest(collection)",description:"Latest date",category:"date",example:"latest(orders.closeDate)"}];var oa=chunkDPD6ZWL2_js.a(e=>chunkC4LR6U4E_js.a(e)||Array.isArray(e)&&e.length===0,"isEmpty"),V=chunkDPD6ZWL2_js.a(e=>e==null?"":String(e),"toStr"),Et=chunkDPD6ZWL2_js.a(e=>{if(chunkC4LR6U4E_js.a(e))return null;let t=typeof e=="number"?e:Number(e);return Number.isFinite(t)?t:null},"toNum"),Dt=chunkDPD6ZWL2_js.a(e=>{if(e==null)return null;let t=e instanceof Date?e:new Date(String(e));return Number.isNaN(t.getTime())?null:t},"toDate"),vt=chunkDPD6ZWL2_js.a(e=>Array.isArray(e)?e:e==null?[]:[e],"toArr"),Gd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=Et(e),o=Et(t);return n!==null&&o!==null&&r(n,o)},"compareNumbers"),Wd=chunkDPD6ZWL2_js.a((e,t,r)=>{let n=Dt(e),o=Dt(t);return n!==null&&o!==null&&r(n.getTime(),o.getTime())},"compareDates"),aa=chunkDPD6ZWL2_js.a((e,t,r)=>{if(r.type==="number"||r.type==="currency"){let n=Et(e),o=Et(t);if(n!==null&&o!==null)return n===o}return V(e)===V(t)},"equalsForAttr");function nx(e,t){return e?e==="checkbox":typeof t=="boolean"}chunkDPD6ZWL2_js.a(nx,"isCheckboxEquality");var Rt=chunkDPD6ZWL2_js.a(e=>({appliesTo:["number","currency","date","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((t,r,n)=>n.type==="date"?Wd(t,r,e):Gd(t,r,e),"evaluateInMemory")}),"orderingSpec"),Ct={is:{appliesTo:["text","phone","number","currency","checkbox","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>r.type==="checkbox"?e===true==(t===true):aa(e,t,r),"evaluateInMemory")},is_not:{appliesTo:["text","phone","number","currency","status","select","date","user","relation","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t,r)=>!aa(e,t,r),"evaluateInMemory")},contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},not_contains:{appliesTo:["text","phone","formula"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>!V(e).toLowerCase().includes(V(t).toLowerCase()),"evaluateInMemory")},starts_with:{appliesTo:["text","phone"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().startsWith(V(t).toLowerCase()),"evaluateInMemory")},ends_with:{appliesTo:["text"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>V(e).toLowerCase().endsWith(V(t).toLowerCase()),"evaluateInMemory")},is_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>oa(e),"evaluateInMemory")},is_not_empty:{appliesTo:["text","richtext","number","phone","currency","status","select","date","multiselect","location","user","relation","formula","document"],evaluateInMemory:chunkDPD6ZWL2_js.a(e=>!oa(e),"evaluateInMemory")},less_than:Rt((e,t)=>e<t),greater_than:Rt((e,t)=>e>t),less_or_equal:Rt((e,t)=>e<=t),greater_or_equal:Rt((e,t)=>e>=t),is_within:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Dt(e),n=chunkVY5UBDTO_js.S(t);return r&&n?r.getTime()>=n.startMs&&r.getTime()<n.endMs:false},"evaluateInMemory")},on_day_month:{appliesTo:["date"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=Dt(e);if(!r)return false;let n=t;return r.getMonth()+1===n.month&&r.getDate()===n.day},"evaluateInMemory")},any_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=vt(t).map(V);return vt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")},none_of:{appliesTo:["status","select","multiselect","user","relation"],evaluateInMemory:chunkDPD6ZWL2_js.a((e,t)=>{let r=vt(t).map(V);return !vt(e).map(V).some(o=>r.includes(o))},"evaluateInMemory")}};var Kd=chunkDPD6ZWL2_js.a((e,t)=>({id:`system:${e}`,name:e,label:e,type:t,system:true}),"systemAttribute"),Yd=[...Object.entries(chunkVY5UBDTO_js.V).map(([e,t])=>Kd(e,t))];function fx(e,t,r){let n=t;return Hd(e,{...t.values,id:t.id,objectId:t.objectId,objectName:n.objectName,tenantId:n.tenantId,label:t.label,createdAt:t.createdAt,updatedAt:t.updatedAt,createdBy:t.createdBy,lastUpdatedBy:t.lastUpdatedBy,deletedAt:t.deletedAt,deletedBy:t.deletedBy,visibility:t.visibility,ownedBy:t.ownedBy},[...r,...Yd])}chunkDPD6ZWL2_js.a(fx,"evaluateRecordFilterState");function Hd(e,t,r){if(e.rules.length===0)return true;let n=new Map(r.map(a=>[a.name,a])),o=e.combinator==="or"?"some":"every";return e.rules[o](a=>Qd(a,t,n))}chunkDPD6ZWL2_js.a(Hd,"evaluateFilterState");function Qd(e,t,r){let n=r.get(e.attribute);if(!n)return false;if(e.property&&n.type==="location"){if(!(chunkVY5UBDTO_js.g(e.property)&&chunkVY5UBDTO_js.h(e.operator)))return false;let l=Ct[e.operator];if(!l)return false;let p=t[e.attribute],I=typeof p=="object"&&p!==null?p[e.property]:void 0;return ei(l,"text",e.operator,I,e.value,n)}if(e.property){let l=eo(n).find(j=>j.name===e.property);if(!l)return false;let p=chunkVY5UBDTO_js.K(e.operator),I=Ct[p];if(!I?.appliesTo.includes(l.type))return false;let Z=t[e.attribute],ae=(Array.isArray(Z)?Z:Z==null?[]:[Z]).some(j=>{if(typeof j!="object"||j===null)return false;let H=j.props;return typeof H!="object"||H===null?false:ei(I,l.type,p,H[e.property],e.value,l)});return (e.quantifier??chunkVY5UBDTO_js.J(e.operator))==="none"?!ae:ae}let o=Ct[e.operator];if(!o||!o.appliesTo.includes(n.type))return false;let a=t[e.attribute],s=n.type==="relation"||n.type==="document"||n.type==="user"?Zd(a):a;return ei(o,n.type,e.operator,s,e.value,n)}chunkDPD6ZWL2_js.a(Qd,"evaluateRule");function ei(e,t,r,n,o,a){let[s,l]=Jd(t,r,n,o);return t==="phone"&&l===""&&r==="contains"?false:t==="phone"&&l===""&&r==="not_contains"?true:e.evaluateInMemory(s,l,a)}chunkDPD6ZWL2_js.a(ei,"evaluateNormalizedComparands");function Jd(e,t,r,n){return e==="date"&&(t==="is"||t==="is_not")?[sa(r),sa(n)]:e==="phone"?Xd(r,n):[ua(e,r),ua(e,n)]}chunkDPD6ZWL2_js.a(Jd,"normalizeOperatorComparands");function sa(e){let t=ee(e)?be(e):e;if(t instanceof Date)return Number.isNaN(t.getTime())?null:t.toISOString().slice(0,10);if(typeof t!="string"||t==="")return null;if(/^\d{4}-\d{2}-\d{2}$/.test(t))return t;let r=new Date(t);return Number.isNaN(r.getTime())?null:r.toISOString().slice(0,10)}chunkDPD6ZWL2_js.a(sa,"normalizeUtcCalendarDay");function Xd(e,t){let r=typeof t=="object"&&t!==null?t:{},n=typeof r.countryCode=="string"?r.countryCode:void 0,o=chunkDPD6ZWL2_js.a(a=>{let s=typeof a=="object"&&a!==null?a:{phoneNumber:a};if(typeof s.phoneNumber!="string")return null;if(!n)return chunkGXSNLYRR_js.a(s.phoneNumber);let l=typeof s.countryCode=="string"?s.countryCode:n;return `${l}:${chunkGXSNLYRR_js.b(s.phoneNumber,l)}`},"normalizeOne");return [o(e),o(t)]}chunkDPD6ZWL2_js.a(Xd,"normalizePhoneComparands");function ua(e,t){return e==="currency"?chunkVY5UBDTO_js.H(t):e==="date"?ee(t)?be(t):t instanceof Date?Number.isNaN(t.getTime())?null:t.toISOString():t:t}chunkDPD6ZWL2_js.a(ua,"normalizeComparableValue");function Zd(e){let t=chunkDPD6ZWL2_js.a(r=>typeof r!="object"||r===null?r:r.id,"normalizeOne");return Array.isArray(e)?e.map(t):t(e)}chunkDPD6ZWL2_js.a(Zd,"normalizeReferenceIds");var la="today";function Nt(e,t){return new Intl.DateTimeFormat("en-CA",{timeZone:t,year:"numeric",month:"2-digit",day:"2-digit"}).format(e)}chunkDPD6ZWL2_js.a(Nt,"dateInTimezone");function ec(e,t){if(!("defaultValue"in e))return;let{defaultValue:r}=e;return e.type!=="date"||r!==la?r:e.includeTime?t.now.toISOString():Nt(t.now,t.timezone)}chunkDPD6ZWL2_js.a(ec,"resolveAttributeDefaultValue");function xx(e,t,r){if(e.combinator==="or"&&e.rules.length>1)return {};let n=new Map(t.map(a=>[a.name,a])),o={};for(let a of e.rules){if(a.property!==void 0||Object.hasOwn(o,a.attribute))continue;let s=n.get(a.attribute);if(!s)continue;let l=tc(a,r);l!==void 0&&(o[a.attribute]=chunkVY5UBDTO_js.j(s).storage.cardinality==="many"?[l]:l);}return o}chunkDPD6ZWL2_js.a(xx,"deriveCreateDefaultsFromFilters");function tc(e,t){if(e.operator==="is")return chunkVY5UBDTO_js.D(e.value)?da(e.value,t):e.value===null||Array.isArray(e.value)?void 0:e.value;if(e.operator==="any_of"){if(!Array.isArray(e.value)||e.value.length!==1)return;let r=e.value[0];return chunkVY5UBDTO_js.D(r)?da(r,t):r}}chunkDPD6ZWL2_js.a(tc,"extractDeterministicValue");function da(e,t){if(t){if(e.dynamic==="actor")return t.userId;if(e.anchor==="today")return Nt(t.now,t.timezone);if(e.anchor==="now")return t.now.toISOString()}}chunkDPD6ZWL2_js.a(da,"resolveDynamicValue");var vx={status:"connector_status",error:"connector_error",provider:"connector_provider"};var rc=(t=>(t.Desktop="desktop",t))(rc||{});var Dx=["force","skip"],Cx=["none","all","external_only"],Nx="x-fake-signature",Ox={override:null,status:"none",failureReason:null,botId:null};var nc=/^Session \d+$/;function ca(e){let t=e.replace(/\s+/g," ").trim().replace(/[.!?]+$/,"");return t?t.length>60?`${t.slice(0,59).trimEnd()}...`:t:"New conversation"}chunkDPD6ZWL2_js.a(ca,"buildAgentFallbackTitle");function ic(e){let t=e.generated?.trim();return t&&!nc.test(t)?t:e.firstUserText?ca(e.firstUserText):e.emptyLabel}chunkDPD6ZWL2_js.a(ic,"conversationDisplayTitle");var ti=/^[a-z0-9][a-z0-9-]{0,62}$/;function oc(e){if(!ti.test(e))throw new chunkGZUTZAPU_js.h(`Invalid schema source id "${e}": expected a lowercase slug matching ${ti}`,[])}chunkDPD6ZWL2_js.a(oc,"assertSchemaSourceId");function ac(e){return {label:e.label,description:e.description??null,icon:e.icon??null,config:e.config,default:e.default??false,metadata:e.metadata??null}}chunkDPD6ZWL2_js.a(ac,"viewSyncPayload");function Bx(e){let{attributeRemovals:t,objectRemovals:r,renames:n}=e.destructive;return t.length>0||r.length>0||n.length>0}chunkDPD6ZWL2_js.a(Bx,"hasDestructiveEntries");var $={objectAdditions:20,totalMutations:500,serializedBytes:512*1024};function ni(e){return e instanceof Error?e.message:String(e)}chunkDPD6ZWL2_js.a(ni,"errorMessage");var sc=er.z.enum(["text","richtext","number","checkbox","date","phone","currency","status","location","select","multiselect","user","relation","formula","rollup","document"]).describe('The attribute\'s data type. Determines which keys `config` accepts and requires: `status`/`select`/`multiselect` need a non-empty `options` array (each `status` option carrying its own `group`); `relation` needs `targets` (non-empty) and `cardinality` ("one" or "many"); `formula` needs `expression` and `returnType`; `rollup` needs `targetAttribute` and `function`. Every other type accepts only the shared presentation keys (`placeholder`, `defaultValue`, `icon`, ...) plus a few type-specific optionals (e.g. `number.decimals`, `date.dateFormat`). An attribute\'s type can never be changed later through this tool \u2014 only through a code migration \u2014 so pick it correctly now.');var ha=er.z.string().min(1).superRefine((e,t)=>{try{Ne(e);}catch(r){t.addIssue({code:er.z.ZodIssueCode.custom,message:ni(r)});}}).describe('The attribute\'s machine name \u2014 the record\'s field key, and what `{{ name }}` refers to in a labelExpression. Must be a valid identifier: starts with a letter or underscore, then only letters/digits/underscores ("montantHt", "first_name", "FIRST_NAME" are valid; "first-name", "first name", "123name" are not). Max 63 characters. Cannot be a name reserved by the record shape itself (id, createdAt, updatedAt, createdBy, lastUpdatedBy, objectId, label, embeddingText, values, metadata, deletedAt, deletedBy, schemaVersion).'),uc=er.z.string().min(1).superRefine((e,t)=>{chunkVY5UBDTO_js.w(e)&&t.addIssue({code:er.z.ZodIssueCode.custom,message:`"${e}" is a reserved object name (${chunkVY5UBDTO_js.C.join(", ")}) and cannot be used for a new object.`});try{Ce(e);}catch(r){t.addIssue({code:er.z.ZodIssueCode.custom,message:ni(r)});}}).describe(`The new object's machine name: kebab-case slug, lowercase letters/digits/hyphens only, starting with a letter ("products", "user-profiles", "order-items" are valid; "Products", "userProfiles", "user_profiles" are not). Max 63 characters. Cannot be a name the platform reserves for its own system objects, and cannot already exist.`);function Aa(e){return e.superRefine((t,r)=>{try{let n=chunkPKJYAV5U_js.n(t.type,{...t.config??{},description:t.description}),o=Object.keys(t.config??{}).filter(a=>!Object.hasOwn(n,a));o.length>0&&r.addIssue({code:"unrecognized_keys",keys:o,path:["config"],message:`Unrecognized attribute config key${o.length===1?"":"s"}: ${o.join(", ")}`});}catch(n){if(n instanceof chunkGZUTZAPU_js.h){for(let o of n.errors)r.addIssue({code:er.z.ZodIssueCode.custom,path:["config",...o.path.map(a=>/^\d+$/.test(a)?Number(a):a)],message:`Config for type "${t.type}" is invalid or incomplete: ${o.message}`});return}r.addIssue({code:er.z.ZodIssueCode.custom,path:["config"],message:`Config for type "${t.type}" is invalid or incomplete: ${ni(n)}`});}})}chunkDPD6ZWL2_js.a(Aa,"withConfigCheck");var Ta=er.z.object({objectName:er.z.string().min(1).describe("Name of the existing (or, elsewhere in the same plan, newly created) object this attribute is added to. Ignored for an attribute declared inline in `additive.objects[].attributes` \u2014 there the parent object's own `name` is used instead."),name:ha,label:er.z.string().min(1).max(128).describe("Human-readable display label shown in the UI. 1-128 characters, cannot be empty."),type:sc,config:er.z.record(er.z.string(),er.z.unknown()).optional().describe('Type-specific configuration; required keys depend on `type` (see `type`\'s description). Shared optional keys on every type: `placeholder`, `defaultValue`, `icon`, `order`, `hidden`, `archived`, `deprecated`, `metadata`. Per-type keys: `text` \u2014 `multiline`, `minLength`, `maxLength`, `pattern`, `format` ("email"|"url"|"slug"); `number` \u2014 `renderAs` ("number"|"rating"), `min`, `max`, `unit`, `decimals`; `date` \u2014 `dateFormat`, `minDate`, `maxDate`, `includeTime`, `endDate`, `timeFormat` ("12h"|"24h"); `phone` \u2014 `defaultCountryCode` (3-letter); `currency` \u2014 `defaultCurrency`, `allowedCurrencies`, `allowNegative`; `status`/`select`/`multiselect` \u2014 `options` (REQUIRED, non-empty array of `{ value, label, color }`, unique `value`s; for `status` every OPTION also carries `group` as idle|in_progress|finished \u2014 `group` belongs on each option, never on `config` itself; select/multiselect accept `renderAs: "badges"`); `location` \u2014 `granularity`, `defaultCountry`, `allowedCountries`; `user` \u2014 `types` ("user"|"agent"), `multiple`; `relation` \u2014 `targets` (REQUIRED, non-empty array of `{ object }`) and `cardinality` (REQUIRED, "one"|"many"); `formula` \u2014 `expression` (REQUIRED formula string) and `returnType` (REQUIRED); `rollup` \u2014 `targetAttribute` (REQUIRED) and `function` (REQUIRED, e.g. "sum"|"avg"|"count"); `document` \u2014 `properties`, `accepts`, `maxFileSize`. Omit entirely for `richtext`/`checkbox`, which take no type-specific keys.'),required:er.z.boolean().optional().describe("Whether the attribute must have a value on every record. Defaults to false (optional)."),description:er.z.string().optional().describe("Help text shown under the field in the UI. Not the same as the plan's `summary`.")}).strict(),lc=Aa(Ta),dc=Aa(Ta.omit({objectName:true})),cc=er.z.object({name:uc,label:er.z.string().min(1).describe('Human-readable singular display label (e.g. "Devis").'),pluralLabel:er.z.string().optional().describe('Human-readable plural display label (e.g. "Devis"/"Invoices"). Defaults from `label` if omitted.'),description:er.z.string().optional().describe("Help text describing what this object represents."),icon:chunkPKJYAV5U_js.c.describe("Required icon name for the object. Must be a catalogue value \u2014 call `search_icons` and use a name it returns verbatim. A name that is not in the catalogue is rejected without any hint as to what would have worked, so never guess one."),labelExpression:ge.describe('Template used to render a human-readable label for every record of this object \u2014 e.g. shown in relations, search results, and breadcrumbs. MUST contain at least one `{{ attributeName }}` interpolation referencing an attribute this object will actually have (either declared in this same `attributes` array, or an existing attribute if this is an update) \u2014 a plain string with no `{{ }}` at all (e.g. "Devis") is rejected. Interpolations cannot be empty (`{{ }}` is rejected) and only these pipes are allowed: UPPER, LOWER, capitalize, trim, prefix:"...", suffix:"...", wrap:"..." "...", default:"...". `{{ a || b }}` falls back to `b` when `a` is empty. Examples: "{{ firstName }} {{ lastName }}", "{{ numero | UPPER }}", "{{ name || reference }}".'),attributes:er.z.array(dc).default([]).describe("Attributes to create on this new object, inline. Same rules as a standalone entry in `additive.attributes`, minus `objectName` (implied by this object). At least one attribute referenced by `labelExpression` should be included here.")}).strict(),wa=er.z.object({attributeRemovals:er.z.array(er.z.object({objectName:er.z.string().min(1).describe("Object the attribute is removed from."),attributeName:er.z.string().min(1).describe("Attribute to delete, together with every record's stored value for it. Must not be a system (code-declared) attribute, and must not be referenced by the object's own `labelExpression` or `embeddingExpression` \u2014 update those first.")}).strict()).default([]).describe("Attributes to permanently delete. Irreversible: record values for the attribute are purged."),objectRemovals:er.z.array(er.z.object({objectName:er.z.string().min(1).describe("Object to delete entirely, together with all its records. Must not be a system (code-declared) object, and must not still be targeted by a `relation` attribute on another object \u2014 retarget or remove that relation first.")}).strict()).default([]).describe("Objects to permanently delete, records included. Irreversible."),renames:er.z.array(er.z.object({objectName:er.z.string().min(1).describe("Object the renamed attribute belongs to."),from:er.z.string().min(1).describe("Current attribute name. Must already exist and not be a system attribute."),to:ha.describe("New attribute name \u2014 same identifier rules as any attribute `name` (see `name` on a planned attribute), and must not collide with another name already on the object, including one added elsewhere in this same plan.")}).strict()).default([]).describe("Attribute renames. Every reference to the old name (labelExpression, views, formulas) must be updated separately \u2014 a rename does not follow references automatically.")}).strict().default({attributeRemovals:[],objectRemovals:[],renames:[]}),xa=er.z.string().min(1).describe("ONE sentence naming the intent of the change \u2014 what it is for, not what it contains. The human approving it has already watched every entry land in the preview window and can read every row of the plan itself, so a recap tells them nothing they do not have. A second sentence is warranted only when `destructive` is non-empty: say plainly what will be lost (e.g. 'deletes the \"ancienMontant\" column and its data on every devis'). Never restate the plan \u2014 explain intent."),pa="The COMPLETE config this view should end up with \u2014 not a patch. Copy the baseline returned by get_default_view and edit it, preserving every tab and setting you are not changing: anything you omit is dropped. To change the columns shown, set `tabs[].columns` (an array of attribute names) \u2014 there is no top-level `columns` on either view type. For a detail view's side panel, set `sidePanel.attributes`. Every attribute name listed must already exist on the object, or be created earlier in this same plan. ONE EXCEPTION to omit-is-dropped: a tab with `type: \"custom\"` renders a component belonging to the application, which you cannot describe or recreate. Copy every such tab through from the baseline exactly as it came, `name`, `component` and `props` untouched \u2014 dropping one, inventing one, or altering any of those three is rejected rather than applied (`name` is the tab's address in links, not its wording). Its `label` and `icon` you may change.",ma="Opaque token returned by get_default_view alongside the baseline you edited. REQUIRED when the object already exists \u2014 it proves you authored against the baseline that is still current. Must be OMITTED when this plan creates the object, which has no baseline yet.",fa=er.z.string().min(1).describe("Name of the object whose default view of this type is replaced. Not a view name \u2014 a plan can only replace an object's deterministic default view, never create a view or target a non-default one."),pc=er.z.discriminatedUnion("viewType",[er.z.object({objectName:fa,viewType:er.z.literal("list").describe("Targets the object's default list view (the grid)."),canonicalConfig:chunkVY5UBDTO_js.ma.describe(pa),baselineToken:er.z.string().min(1).optional().describe(ma)}).strict(),er.z.object({objectName:fa,viewType:er.z.literal("detail").describe("Targets the object's default detail view (the single-record view)."),canonicalConfig:chunkVY5UBDTO_js.na.describe(pa),baselineToken:er.z.string().min(1).optional().describe(ma)}).strict()]);var ba=er.z.string().regex(/^[0-9a-f]{64}$/,"Expected a lowercase SHA-256 hash"),ga={baseConfigHash:ba.nullable(),targetConfigHash:ba,baselineOrigin:er.z.enum(["persisted","generated","absent"])},mc=er.z.discriminatedUnion("viewType",[er.z.object({objectName:er.z.string().min(1),viewType:er.z.literal("list"),canonicalConfig:chunkVY5UBDTO_js.ma,...ga}).strict(),er.z.object({objectName:er.z.string().min(1),viewType:er.z.literal("detail"),canonicalConfig:chunkVY5UBDTO_js.na,...ga}).strict()]).superRefine((e,t)=>{let r=e.baselineOrigin!=="absent";r!==(e.baseConfigHash!==null)&&t.addIssue({code:"custom",path:["baseConfigHash"],message:r?`A ${e.baselineOrigin} baseline requires baseConfigHash`:"An absent baseline requires baseConfigHash to be null"});});function Ia(e){return er.z.object({objects:er.z.array(cc).default([]).describe("New objects to create, with their attributes inline."),attributes:er.z.array(lc).default([]).describe("Attributes to add to existing or same-plan objects."),viewUpdates:er.z.array(e).default([]).describe("Complete target configs for deterministic default views; never view names.")}).strict().default({objects:[],attributes:[],viewUpdates:[]})}chunkDPD6ZWL2_js.a(Ia,"buildAdditiveSchema");function ri(e,t=[],r=new WeakSet){if(e===null||typeof e=="string"||typeof e=="boolean")return null;if(typeof e=="number")return Number.isFinite(e)?null:{path:t,message:"Plan input contains a non-finite number"};if(typeof e!="object")return {path:t,message:"Plan input must contain only JSON-safe values"};if(r.has(e))return {path:t,message:"Plan input cannot contain circular references"};if(Array.isArray(e)){r.add(e);for(let s of Reflect.ownKeys(e))if(s!=="length"&&(typeof s=="symbol"||!/^(0|[1-9]\d*)$/.test(s)))return r.delete(e),{path:[...t,s],message:"Plan input arrays cannot contain non-index JSON properties"};for(let s=0;s<e.length;s++){if(!Object.hasOwn(e,s))return r.delete(e),{path:[...t,s],message:"Plan input cannot contain sparse arrays"};let l=ri(e[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return {path:t,message:"Plan input must contain only plain JSON objects"};r.add(e);let o=e,a=Reflect.ownKeys(o);for(let s of a){let l=Object.getOwnPropertyDescriptor(o,s);if(typeof s=="symbol"||!(l?.enumerable&&"value"in l))return r.delete(e),{path:[...t,s],message:"Plan input objects must contain enumerable JSON data properties only"}}for(let s of a.sort()){let l=ri(o[s],[...t,s],r);if(l)return r.delete(e),l}return r.delete(e),null}chunkDPD6ZWL2_js.a(ri,"findJsonSafetyIssue");function fc(e){let t=[];return e.additive.objects.forEach((r,n)=>{t.push(["additive","objects",n]),r.attributes.forEach((o,a)=>{t.push(["additive","objects",n,"attributes",a]);});}),e.additive.attributes.forEach((r,n)=>{t.push(["additive","attributes",n]);}),e.additive.viewUpdates.forEach((r,n)=>{t.push(["additive","viewUpdates",n]);}),e.destructive.attributeRemovals.forEach((r,n)=>{t.push(["destructive","attributeRemovals",n]);}),e.destructive.objectRemovals.forEach((r,n)=>{t.push(["destructive","objectRemovals",n]);}),e.destructive.renames.forEach((r,n)=>{t.push(["destructive","renames",n]);}),t}chunkDPD6ZWL2_js.a(fc,"mutationPaths");function Sa(e,t){e.additive.objects.length>$.objectAdditions&&t.addIssue({code:"too_big",origin:"array",maximum:$.objectAdditions,inclusive:true,path:["additive","objects",$.objectAdditions],message:`A schema plan can add at most ${$.objectAdditions} objects`});let r=fc(e);r.length>$.totalMutations&&t.addIssue({code:"too_big",origin:"array",maximum:$.totalMutations,inclusive:true,path:r[$.totalMutations],message:`A schema plan can contain at most ${$.totalMutations} mutations; received ${r.length}`});}chunkDPD6ZWL2_js.a(Sa,"addPlanLimitIssues");function va(e,t){let r=ri(e);if(r)return t.addIssue({code:"custom",path:r.path,message:r.message}),er.z.NEVER;let n=new TextEncoder().encode(chunkZMDMQAV5_js.a(e)).byteLength;return n>$.serializedBytes?(t.addIssue({code:"too_big",origin:"string",maximum:$.serializedBytes,inclusive:true,path:[],message:`A schema plan can serialize to at most ${$.serializedBytes} UTF-8 bytes; received ${n}`}),er.z.NEVER):e}chunkDPD6ZWL2_js.a(va,"boundSerializedPlanInput");var bc=Ia(pc),gc=Ia(mc),ya=er.z.object({schemaPlanVersion:er.z.literal(2).describe("Required proposal contract version."),summary:xa,additive:bc,destructive:wa}).strict().superRefine((e,t)=>{let r=new Set(e.additive.objects.map(n=>n.name));e.additive.viewUpdates.forEach((n,o)=>{let a=["additive","viewUpdates",o,"baselineToken"];if(r.has(n.objectName)){n.baselineToken!==void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an object added by this plan must not include baselineToken"});return}n.baselineToken===void 0&&t.addIssue({code:"custom",path:a,message:"A view target for an existing object requires baselineToken"});}),Sa(e,t);}),Zx=Object.assign(er.z.preprocess(va,ya),{shape:ya.shape}),yc=er.z.object({schemaPlanVersion:er.z.literal(2),summary:xa,additive:gc,destructive:wa}).strict().superRefine(Sa),eI=er.z.preprocess(va,yc);var A=er.z.number().finite().nonnegative(),Ea=er.z.enum(Gi),ii=er.z.enum(Wi),oi=er.z.enum(Ki),Da=er.z.object({provider:Ea,model:er.z.string().min(1)}).strict(),aI=er.z.object({speed:ii.optional(),reasoning:oi.optional()}).strict(),Ca=er.z.string().regex(/^[a-z0-9][a-z0-9-]*\/[a-z0-9][a-z0-9._-]*$/),hc=er.z.object({model:Da.optional(),speed:ii.optional(),reasoning:oi.optional(),imageModel:Ca.optional()}).strict(),sI=hc.refine(e=>e.model!==void 0||e.speed!==void 0||e.reasoning!==void 0||e.imageModel!==void 0,{message:"At least one inference override is required"}),uI=er.z.object({model:Da.nullable().optional(),speed:ii.nullable().optional(),reasoning:oi.nullable().optional(),imageModel:Ca.nullable().optional()}).strict().refine(e=>Object.keys(e).length>0&&Object.values(e).every(t=>t!==void 0),{message:"At least one inference override is required"}),Na=er.z.object({label:er.z.string(),denied:er.z.boolean().optional(),deletion:er.z.object({target:er.z.string().optional(),count:A.optional(),restorableDays:A.optional()}).strict().optional(),counts:er.z.record(er.z.string(),A).optional(),warnings:er.z.array(er.z.string()).optional()}).strict(),Ac=er.z.union([er.z.object({type:er.z.literal("text"),text:er.z.string()}).strict(),er.z.object({type:er.z.literal("reasoning"),text:er.z.string()}).strict(),er.z.object({type:er.z.literal("system"),code:er.z.enum(Wt)}).strict(),er.z.object({type:er.z.literal("error"),error:er.z.string(),errorClass:er.z.string().optional()}).strict(),er.z.object({type:er.z.literal("tool"),toolCallId:er.z.string(),name:er.z.string(),args:er.z.record(er.z.string(),er.z.unknown()),result:er.z.unknown().optional(),error:er.z.string().optional(),errorCode:er.z.enum(["output_limit_reached","interrupted"]).optional(),state:er.z.enum(["streaming","running","completed","error","approval-requested","approval-responded","approval-dispatched"]),durationMs:A.optional(),approvalId:er.z.string().optional(),approvalImpact:Na.optional(),approved:er.z.boolean().optional(),approvalReason:er.z.string().optional(),approvalRelaxableByAuto:er.z.boolean().optional()}).strict(),er.z.object({type:er.z.literal("file"),fileId:er.z.string(),name:er.z.string(),mimeType:er.z.string()}).strict(),er.z.object({type:er.z.literal("compaction"),state:er.z.literal("in-progress"),reason:er.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),er.z.object({type:er.z.literal("compaction"),state:er.z.literal("completed"),tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:er.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:er.z.string().optional()}).strict(),er.z.object({type:er.z.literal("compaction"),state:er.z.literal("failed"),reason:er.z.string(),durationMs:A.optional()}).strict()]),Tc=er.z.object({id:er.z.string(),name:er.z.string(),mimeType:er.z.string(),size:A}).strict(),wc=er.z.object({id:er.z.string(),type:er.z.string().transform(e=>e),entityId:er.z.string(),label:er.z.string(),objectName:er.z.string().optional(),startIndex:A,endIndex:A}).strict(),xc=er.z.object({provider:Ea,model:er.z.string(),maxTokens:A.optional(),contextWindow:A.optional()}).strict(),Ic=er.z.union([er.z.date(),er.z.string().datetime({offset:true}).transform(e=>new Date(e))]),Ra=er.z.object({id:er.z.string(),sessionId:er.z.string(),tenantId:er.z.string().optional(),runId:er.z.string().optional(),role:er.z.enum(["user","assistant","system","tool"]),parts:er.z.array(Ac),attachments:er.z.array(Tc).optional(),mentions:er.z.array(wc).optional(),model:xc.optional(),tokenUsage:er.z.object({input:A,output:A}).strict().optional(),metadata:er.z.record(er.z.string(),er.z.unknown()).optional(),createdAt:Ic}).strict(),Sc=er.z.object({id:er.z.string(),description:er.z.string(),status:er.z.enum(["pending","in_progress","completed","blocked"]),result:er.z.string().optional(),updatedAt:A.optional()}).strict(),vc=er.z.object({id:er.z.string(),sessionId:er.z.string(),status:er.z.enum(["active","completed","abandoned"]),todos:er.z.array(Sc),version:A,createdAt:er.z.string(),updatedAt:er.z.string(),completedAt:er.z.string().optional()}).strict(),Oa={"session-named":er.z.object({name:er.z.string()}).strict(),"compaction-start":er.z.object({reason:er.z.enum(["preflight_threshold","overflow_recovery"]),estimatedTokens:A.optional(),reportedTokens:A.optional()}).strict(),"compaction-end":er.z.object({tokensBefore:A,tokensAfter:A,tokensSaved:A,strategy:er.z.enum(["no-op","summary","truncation"]),durationMs:A,summary:er.z.string().optional()}).strict(),"compaction-failed":er.z.object({reason:er.z.string()}).strict(),usage:er.z.object({messageId:er.z.string().min(1).optional(),inputTokens:A,outputTokens:A,totalTokens:A,cacheReadTokens:A.optional(),cacheCreationTokens:A.optional(),contextWindow:A,residentTokens:A,utilization:er.z.number().finite().min(0).max(1),costUsd:A.optional()}).strict(),"message-persisted":er.z.object({message:Ra}).strict(),"message-updated":er.z.object({message:Ra}).strict(),"todo-plan-update":er.z.object({plan:vc}).strict(),"approval-context":er.z.object({approvalId:er.z.string(),toolCallId:er.z.string(),impact:Na.optional(),relaxableByAuto:er.z.boolean().optional()}).strict(),"session-state":er.z.object({state:er.z.object({phase:er.z.enum(["queued","running","parked","terminal"]),parkedOn:er.z.enum(["human","agents"]).optional(),humanRequestIds:er.z.array(er.z.string()).optional(),outcome:er.z.enum(["completed","failed","cancelled","timeout","expired"]).optional()}).strict(),version:er.z.number().int().positive(),updatedAt:er.z.string().datetime({offset:true})}).strict()};function Rc(e){return e in Oa}chunkDPD6ZWL2_js.a(Rc,"isAgentUIDataName");function Ec(e){return new chunkGZUTZAPU_js.h("Invalid agent UI message chunk",e.map(t=>({path:t.path.map(String),message:t.message,code:t.code})))}chunkDPD6ZWL2_js.a(Ec,"agentUIValidationError");function Dc(e){if(typeof e!="object"||e===null||typeof e.type!="string")throw new chunkGZUTZAPU_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected UI message chunk type",code:"invalid_type"}]);let t=e.type;if(!t.startsWith("data-"))throw new chunkGZUTZAPU_js.h("Invalid agent UI message chunk",[{path:["type"],message:"Expected agent data chunk type",code:"invalid_value"}]);let r=t.slice(5);if(!Rc(r))throw new chunkGZUTZAPU_js.h("Invalid agent UI message chunk",[{path:["type"],message:`Unknown agent UI data type: ${r}`,code:"invalid_value"}]);let n=er.z.object({type:er.z.literal(`data-${r}`),id:er.z.string().optional(),data:Oa[r],transient:er.z.boolean().optional()}).strict().safeParse(e);if(!n.success)throw Ec(n.error.issues);return n.data}chunkDPD6ZWL2_js.a(Dc,"assertCustomAgentUIMessageChunk");function lI(e,t,r){return Dc({type:`data-${e}`,...r?.id!==void 0?{id:r.id}:{},data:t,...r?.transient!==void 0?{transient:r.transient}:{}})}chunkDPD6ZWL2_js.a(lI,"agentDataChunk");function Ot(e){return e}chunkDPD6ZWL2_js.a(Ot,"defineOperation");function y(e,t,r){let n=t==="atomic"?"none":t==="local"?"if-not-visible":"follow";return o=>{let a=r?.(o);return {impact:t,navigation:n,focus:{...e(o),...a===void 0?{}:{propertyPath:a}}}}}chunkDPD6ZWL2_js.a(y,"definePresentation");var ai={id:er.z.string().min(1)},v={...ai,viewId:er.z.string().min(1)};function S(e,t,r){if(!e.views.some(n=>n.id===t))throw new chunkGZUTZAPU_js.h(`View "${t}" is not in the draftable state`,[]);return {...e,views:e.views.map(n=>n.id===t?r(n):n)}}chunkDPD6ZWL2_js.a(S,"mapView");function _a(e,t,r){let n=[...e],[o]=n.splice(t,1);return n.splice(r,0,o),n}chunkDPD6ZWL2_js.a(_a,"moveWithin");function je(e,t,r){if(t.length!==e.length)throw new chunkGZUTZAPU_js.h(`${r} order lists ${t.length} ids for ${e.length} items`,[]);return t.map(n=>{let o=e.find(a=>a.id===n);if(!o)throw new chunkGZUTZAPU_js.h(`${r} "${n}" is not in this collection`,[]);return o})}chunkDPD6ZWL2_js.a(je,"reorderById");function ne(e,t,r){let n=e.tabs.find(o=>o.id===t);if(!n)throw new chunkGZUTZAPU_js.h(`Tab "${t}" is not in view "${e.id}"`,[]);if(n.type!=="form")throw new chunkGZUTZAPU_js.h(`Tab "${t}" is not a form tab`,[]);return {...e,tabs:e.tabs.map(o=>o.id===t?r(n):o)}}chunkDPD6ZWL2_js.a(ne,"mapFormTab");function Pt(e,t){let r=e.groups.find(n=>n.id===t);if(!r)throw new chunkGZUTZAPU_js.h(`Group "${t}" is not in tab "${e.id}"`,[]);return r}chunkDPD6ZWL2_js.a(Pt,"requireGroup");function si(e,t){for(let r of e.groups){let n=r.fields.find(o=>o.id===t);if(n)return {group:r,field:n}}throw new chunkGZUTZAPU_js.h(`Field slot "${t}" is not in tab "${e.id}"`,[])}chunkDPD6ZWL2_js.a(si,"locateField");function kt(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(kt,"viewFocus");function _t(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(_t,"tabFocus");function Pa(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}}chunkDPD6ZWL2_js.a(Pa,"groupFocus");function Fa(e){return {viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(Fa,"fieldFocus");function Va(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a(Va,"addTabFocus");function ja(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.group.id}}chunkDPD6ZWL2_js.a(ja,"addGroupFocus");function Ma(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.groupId,fieldId:e.field.id}}chunkDPD6ZWL2_js.a(Ma,"addFieldFocus");function La(e){return {viewId:e.viewId,tabId:e.tabId,groupId:e.toGroupId,fieldId:e.fieldId}}chunkDPD6ZWL2_js.a(La,"moveFieldFocus");function Me(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(Me,"firstChangedProperty");var Cc=chunkVY5UBDTO_js.ka,Nc=chunkVY5UBDTO_js.fa,Oc=chunkVY5UBDTO_js.ea,kc=er.z.object({...v,type:er.z.literal("add_tab"),tab:Cc}),_c={type:"add_tab",schema:kc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(r.tabs.some(n=>n.id===t.tab.id))throw new chunkGZUTZAPU_js.h(`Tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,tabs:[...r.tabs,t.tab]}}),"apply"),focus:Va,presentation:y(Va,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},Pc=er.z.object({...v,type:er.z.literal("remove_tab"),tabId:er.z.string().min(1)}),Fc={type:"remove_tab",schema:Pc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunkGZUTZAPU_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.filter(n=>n.id!==t.tabId)}}),"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},Ga=er.z.object({label:er.z.string().min(1).optional(),icon:chunkPKJYAV5U_js.c.optional(),order:er.z.number().int().optional()}),Vc=Object.keys(Ga.shape),jc=er.z.object({...v,type:er.z.literal("update_tab"),tabId:er.z.string().min(1),changes:Ga.refine(e=>Object.keys(e).length>0,"update_tab needs at least one change")}),Ba=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabFocus"),Mc={type:"update_tab",schema:jc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(!r.tabs.some(n=>n.id===t.tabId))throw new chunkGZUTZAPU_js.h(`Tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,tabs:r.tabs.map(n=>n.id===t.tabId?{...n,...t.changes}:n)}}),"apply"),focus:Ba,presentation:y(Ba,"atomic",Me),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},Lc=er.z.object({...v,type:er.z.literal("reorder_tabs"),tabOrder:er.z.array(er.z.string().min(1))}),Bc={type:"reorder_tabs",schema:Lc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,tabs:je(r.tabs,t.tabOrder,"Tab")})),"apply"),focus:kt,presentation:y(kt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},Uc=er.z.object({...v,type:er.z.literal("add_group"),tabId:er.z.string().min(1),group:Nc}),$c={type:"add_group",schema:Uc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(n.groups.some(o=>o.id===t.group.id))throw new chunkGZUTZAPU_js.h(`Group "${t.group.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:[...n.groups,t.group]}})),"apply"),focus:ja,presentation:y(ja,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le groupe \xAB ${e.group.label} \xBB`,"describe")},qc=er.z.object({...v,type:er.z.literal("remove_group"),tabId:er.z.string().min(1),groupId:er.z.string().min(1)}),zc={type:"remove_group",schema:qc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Pt(n,t.groupId),{...n,groups:n.groups.filter(o=>o.id!==t.groupId)}))),"apply"),focus:Pa,presentation:y(Pa,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime le groupe ${e.groupId}`,"describe")},Gc=er.z.object({...v,type:er.z.literal("update_group"),tabId:er.z.string().min(1),groupId:er.z.string().min(1),changes:er.z.object({label:er.z.string().min(1).optional(),description:er.z.string().optional(),collapsible:er.z.boolean().optional(),collapsed:er.z.boolean().optional(),order:er.z.number().int().optional()}).refine(e=>Object.keys(e).length>0,"update_group needs at least one change")}),Ua=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,groupId:e.groupId}),"updateGroupFocus"),Wc={type:"update_group",schema:Gc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(Pt(n,t.groupId),{...n,groups:n.groups.map(o=>o.id===t.groupId?{...o,...t.changes}:o)}))),"apply"),focus:Ua,presentation:y(Ua,"atomic",Me),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme le groupe en \xAB ${e.changes.label} \xBB`:"Modifie le groupe","describe")},Kc=er.z.object({...v,type:er.z.literal("reorder_groups"),tabId:er.z.string().min(1),groupOrder:er.z.array(er.z.string().min(1))}),Yc={type:"reorder_groups",schema:Kc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>({...n,groups:je(n.groups,t.groupOrder,"Group")}))),"apply"),focus:_t,presentation:y(_t,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les groupes","describe")},Hc=er.z.object({...v,type:er.z.literal("add_field"),tabId:er.z.string().min(1),groupId:er.z.string().min(1),field:Oc,index:er.z.number().int().min(0).optional()}),Qc={type:"add_field",schema:Hc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{if(Pt(n,t.groupId),n.groups.some(o=>o.fields.some(a=>a.id===t.field.id)))throw new chunkGZUTZAPU_js.h(`Field slot "${t.field.id}" already exists in tab "${t.tabId}"`,[]);return {...n,groups:n.groups.map(o=>{if(o.id!==t.groupId)return o;let a=t.index??o.fields.length;return {...o,fields:[...o.fields.slice(0,a),t.field,...o.fields.slice(a)]}})}})),"apply"),focus:Ma,presentation:y(Ma,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute le champ ${e.field.attribute??e.field.id}`,"describe")},Jc=er.z.object({...v,type:er.z.literal("remove_field"),tabId:er.z.string().min(1),fieldId:er.z.string().min(1)}),Xc={type:"remove_field",schema:Jc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o}=si(n,t.fieldId);return {...n,groups:n.groups.map(a=>a.id===o.id?{...a,fields:a.fields.filter(s=>s.id!==t.fieldId)}:a)}})),"apply"),focus:Fa,presentation:y(Fa,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Retire le champ ${e.fieldId}`,"describe")},Zc=er.z.object({...v,type:er.z.literal("move_field"),tabId:er.z.string().min(1),fieldId:er.z.string().min(1),toGroupId:er.z.string().min(1),toIndex:er.z.number().int().min(0)}),ep={type:"move_field",schema:Zc,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>{let{group:o,field:a}=si(n,t.fieldId),s=Pt(n,t.toGroupId);if(o.id===s.id){let l=o.fields.findIndex(p=>p.id===t.fieldId);return {...n,groups:n.groups.map(p=>p.id===o.id?{...p,fields:_a(p.fields,l,t.toIndex)}:p)}}return {...n,groups:n.groups.map(l=>l.id===o.id?{...l,fields:l.fields.filter(p=>p.id!==t.fieldId)}:l.id===s.id?{...l,fields:[...l.fields.slice(0,t.toIndex),a,...l.fields.slice(t.toIndex)]}:l)}})),"apply"),focus:La,presentation:y(La,"local"),describe:chunkDPD6ZWL2_js.a(e=>`D\xE9place le champ ${e.fieldId} vers le groupe ${e.toGroupId}`,"describe")},tp=er.z.object({...v,type:er.z.literal("update_field"),tabId:er.z.string().min(1),fieldId:er.z.string().min(1),changes:er.z.object({label:er.z.string().optional(),readOnly:er.z.boolean().optional(),span:er.z.number().int().min(1).max(12).optional()}).refine(e=>Object.keys(e).length>0,"update_field needs at least one change")}),$a=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId,fieldId:e.fieldId}),"updateFieldFocus"),rp={type:"update_field",schema:tp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>ne(r,t.tabId,n=>(si(n,t.fieldId),{...n,groups:n.groups.map(o=>({...o,fields:o.fields.map(a=>a.id===t.fieldId?{...a,...t.changes}:a)}))}))),"apply"),focus:$a,presentation:y($a,"atomic",Me),describe:chunkDPD6ZWL2_js.a(e=>`Modifie le champ ${e.fieldId}`,"describe")},Wa=er.z.object({source:chunkVY5UBDTO_js.ia.optional(),columns:chunkVY5UBDTO_js.Z.optional(),filters:chunkVY5UBDTO_js.aa.nullable().optional(),sorts:chunkVY5UBDTO_js.$.nullable().optional(),allowCreate:er.z.boolean().optional(),allowEdit:er.z.boolean().optional(),allowDelete:er.z.boolean().optional(),createMode:er.z.enum(["redirect","inline","peek"]).optional()}),np=Object.keys(Wa.shape),Ka=er.z.object({emailAttributeIds:er.z.array(er.z.string().min(1)).optional(),attribute:er.z.string().min(1).optional(),titleAttribute:er.z.string().min(1).nullable().optional(),component:er.z.string().nullable().optional(),props:er.z.record(er.z.string(),er.z.unknown()).nullable().optional()}),ip=Object.keys(Ka.shape),op={emailAttributeIds:["emails","meetings"],attribute:["richtext"],titleAttribute:["richtext"],component:["custom"],props:["custom"]},ap=er.z.object({...v,type:er.z.literal("update_tab_config"),tabId:er.z.string().min(1),changes:Ka.refine(e=>Object.keys(e).length>0,"update_tab_config needs at least one change")}),qa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTabConfigFocus"),sp={type:"update_tab_config",schema:ap,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(o=>o.id===t.tabId);if(!n)throw new chunkGZUTZAPU_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);for(let o of Object.keys(t.changes)){let a=op[o];if(a&&!a.includes(n.type))throw new chunkGZUTZAPU_js.h(`"${o}" is not a setting of a "${n.type}" tab`,[])}return {...r,tabs:r.tabs.map(o=>o.id===t.tabId?{...o,...t.changes}:o)}}),"apply"),focus:qa,presentation:y(qa,"atomic",Me),describe:chunkDPD6ZWL2_js.a(e=>`Configure ${Object.keys(e.changes).join(", ")} sur l'onglet ${e.tabId}`,"describe")},up=er.z.object({...v,type:er.z.literal("update_table_tab"),tabId:er.z.string().min(1),changes:Wa.refine(e=>Object.keys(e).length>0,"update_table_tab needs at least one change")}),za=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateTableTabFocus"),lp={type:"update_table_tab",schema:up,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.tabs.find(l=>l.id===t.tabId);if(!n)throw new chunkGZUTZAPU_js.h(`Tab "${t.tabId}" is not in view "${r.id}"`,[]);if(n.type!=="table")throw new chunkGZUTZAPU_js.h(`Tab "${t.tabId}" is not a table tab`,[]);let o=Object.entries(t.changes),a=Object.fromEntries(o.filter(([,l])=>l!==null)),s=new Set(o.filter(([,l])=>l===null).map(([l])=>l));return {...r,tabs:r.tabs.map(l=>l.id===t.tabId?Object.fromEntries(Object.entries({...l,...a}).filter(([p])=>!s.has(p))):l)}}),"apply"),focus:za,presentation:y(za,"atomic",Me),describe:chunkDPD6ZWL2_js.a(e=>e.changes.columns?`Affiche ${e.changes.columns.length} colonne(s) dans l'onglet ${e.tabId}`:`Modifie l'onglet ${e.tabId}`,"describe")},dp=er.z.object({...v,type:er.z.literal("set_side_panel"),sidePanel:er.z.object({attributes:er.z.array(er.z.string().min(1)),width:er.z.number().int().min(1).optional()}).nullable()}),cp={type:"set_side_panel",schema:dp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,sidePanel:t.sidePanel??void 0}})),"apply"),focus:kt,presentation:y(kt,"atomic",()=>["config","sidePanel"]),describe:chunkDPD6ZWL2_js.a(e=>e.sidePanel?"Active le panneau lat\xE9ral":"Retire le panneau lat\xE9ral","describe")},Ya=[_c,Fc,Mc,Bc,$c,zc,Wc,Yc,Qc,Xc,ep,rp,lp,sp,cp];var Le={...v,tabId:er.z.string().min(1)};function Ft(e){return {viewId:e.viewId}}chunkDPD6ZWL2_js.a(Ft,"viewFocus");function ie(e){return {viewId:e.viewId,tabId:e.tabId}}chunkDPD6ZWL2_js.a(ie,"tabFocus");function Ha(e){return {viewId:e.viewId,tabId:e.tab.id}}chunkDPD6ZWL2_js.a(Ha,"addTabFocus");function pp(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(pp,"firstChangedProperty");function Ja(e){let t={...e};for(let r of chunkVY5UBDTO_js.sa)delete t[r];return t}chunkDPD6ZWL2_js.a(Ja,"withoutKanbanKeys");function Xa(e){let t={...e};for(let r of chunkVY5UBDTO_js.ra)delete t[r];return t}chunkDPD6ZWL2_js.a(Xa,"withoutTableKeys");function mp(e,t,r,n){let o=chunkVY5UBDTO_js.la.safeParse(t);if(!o.success){if(!chunkVY5UBDTO_js.la.safeParse(e).success)return t;let a=o.error.issues.map(s=>s.path.length?`${s.path.join(".")}: ${s.message}`:s.message).join(", ");throw new chunkGZUTZAPU_js.h(`List tab "${n}" in view "${r}" would no longer be publishable: ${a}`,[])}return t}chunkDPD6ZWL2_js.a(mp,"assertStillPublishableTab");function Vt(e,t,r,n){return S(e,t,o=>{let a=o.config.tabs??[];if(!a.some(s=>s.id===r))throw new chunkGZUTZAPU_js.h(`List tab "${r}" is not in view "${t}"`,[]);return {...o,config:{...o.config,tabs:a.map(s=>s.id===r?mp(s,n(s),t,r):s)}}})}chunkDPD6ZWL2_js.a(Vt,"mapListTab");var fp=chunkVY5UBDTO_js.la,Za=chunkVY5UBDTO_js.ba,bp=chunkVY5UBDTO_js.$;function Y(e,t,r,n){let o=er.z.object({...Le,type:er.z.literal(e),value:r});return {type:e,schema:o,apply:chunkDPD6ZWL2_js.a((a,s)=>Vt(a,s.viewId,s.tabId,l=>{if(s.value===null){let{[t]:p,...I}=l;return I}return {...l,[t]:s.value}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>[String(t)]),describe:chunkDPD6ZWL2_js.a(a=>n(a.value),"describe")}}chunkDPD6ZWL2_js.a(Y,"setOnTab");var gp=er.z.object({...v,type:er.z.literal("add_list_tab"),tab:fp}),yp={type:"add_list_tab",schema:gp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(n.some(o=>o.id===t.tab.id))throw new chunkGZUTZAPU_js.h(`List tab "${t.tab.id}" already exists in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:[...n,t.tab]}}}),"apply"),focus:Ha,presentation:y(Ha,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'onglet \xAB ${e.tab.label} \xBB`,"describe")},hp=er.z.object({...Le,type:er.z.literal("remove_list_tab")}),Ap={type:"remove_list_tab",schema:hp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{let n=r.config.tabs??[];if(!n.some(o=>o.id===t.tabId))throw new chunkGZUTZAPU_js.h(`List tab "${t.tabId}" is not in view "${t.viewId}"`,[]);return {...r,config:{...r.config,tabs:n.filter(o=>o.id!==t.tabId)}}}),"apply"),focus:ie,presentation:y(ie,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'onglet ${e.tabId}`,"describe")},Tp=er.z.object({...Le,type:er.z.literal("update_list_tab"),changes:er.z.object({label:er.z.string().min(1).optional(),icon:chunkPKJYAV5U_js.c.optional(),default:er.z.boolean().optional(),visibility:er.z.enum(chunkVY5UBDTO_js.y).optional()}).refine(e=>Object.keys(e).length>0,"update_list_tab needs at least one change")}),Qa=chunkDPD6ZWL2_js.a(e=>({viewId:e.viewId,tabId:e.tabId}),"updateListTabFocus"),wp={type:"update_list_tab",schema:Tp,apply:chunkDPD6ZWL2_js.a((e,t)=>Vt(e,t.viewId,t.tabId,r=>({...r,...t.changes})),"apply"),focus:Qa,presentation:y(Qa,"atomic",pp),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'onglet en \xAB ${e.changes.label} \xBB`:`Modifie l'onglet ${e.tabId}`,"describe")},xp=er.z.object({...v,type:er.z.literal("reorder_list_tabs"),tabOrder:er.z.array(er.z.string().min(1))}),Ip={type:"reorder_list_tabs",schema:xp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>({...r,config:{...r.config,tabs:je(r.config.tabs??[],t.tabOrder,"List tab")}})),"apply"),focus:Ft,presentation:y(Ft,"local"),describe:chunkDPD6ZWL2_js.a(()=>"R\xE9ordonne les onglets","describe")},Sp=Y("set_columns","columns",er.z.array(er.z.string().min(1)),e=>`Affiche ${Array.isArray(e)?e.length:0} colonne(s)`),vp=Y("set_column_sizing","columnSizing",er.z.record(er.z.string(),er.z.number().int().positive()),()=>"Ajuste la largeur des colonnes"),Rp=er.z.object({...Le,type:er.z.literal("set_layout"),value:er.z.enum(["table","list","kanban"])}),Ep={type:"set_layout",schema:Rp,apply:chunkDPD6ZWL2_js.a((e,t)=>Vt(e,t.viewId,t.tabId,r=>{if(t.value!=="kanban")return {...Ja(r),layout:t.value};if(r.groupByAttribute===void 0)throw new chunkGZUTZAPU_js.h(`List tab "${t.tabId}" cannot switch to kanban without a group attribute \u2014 use set_group_by, which switches the layout itself`,[]);return {...Xa(r),layout:"kanban"}}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["layout"]),describe:chunkDPD6ZWL2_js.a(e=>`Passe en affichage ${e.value}`,"describe")},Dp=er.z.object({...Le,type:er.z.literal("set_group_by"),value:er.z.string().min(1).nullable()}),Cp={type:"set_group_by",schema:Dp,apply:chunkDPD6ZWL2_js.a((e,t)=>Vt(e,t.viewId,t.tabId,r=>t.value===null?{...Ja(r),layout:"table"}:{...Xa(r),layout:"kanban",groupByAttribute:t.value}),"apply"),focus:ie,presentation:y(ie,"atomic",()=>["groupByAttribute"]),describe:chunkDPD6ZWL2_js.a(e=>e.value?`Regroupe par ${e.value} en kanban`:"Retire le regroupement, retour en table","describe")},Np=Y("set_filters","filters",Za.nullable(),e=>e?"Modifie les filtres":"Retire les filtres"),Op=Y("set_sorts","sorts",bp.nullable(),e=>e?"Modifie le tri":"Retire le tri"),kp=Y("set_create_mode","createMode",er.z.enum(["redirect","inline","peek"]),e=>`Cr\xE9ation en mode ${e}`),_p=Y("set_read_only","readOnly",er.z.boolean(),e=>e?"Passe l'onglet en lecture seule":"Rend l'onglet modifiable"),Pp=Y("set_card_user_attribute","cardUserAttribute",er.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire l'utilisateur des cartes"),Fp=Y("set_card_date_attribute","cardDateAttribute",er.z.string().min(1).nullable(),e=>e?`Affiche ${e} sur les cartes`:"Retire la date des cartes"),Vp=Y("set_description_attribute","descriptionAttribute",er.z.string().min(1).nullable(),e=>e?`Affiche ${e} en description`:"Retire la description"),jp=Y("set_display_attributes","displayAttributes",chunkVY5UBDTO_js._.nullable(),e=>`Affiche ${Array.isArray(e)?e.length:0} attribut(s)`),Mp=er.z.object({...v,type:er.z.literal("set_default_filters"),filters:Za.nullable()}),Lp={type:"set_default_filters",schema:Mp,apply:chunkDPD6ZWL2_js.a((e,t)=>S(e,t.viewId,r=>{if(t.filters===null){let{defaultFilters:n,...o}=r.config;return {...r,config:o}}return {...r,config:{...r.config,defaultFilters:t.filters}}}),"apply"),focus:Ft,presentation:y(Ft,"atomic",()=>["config","defaultFilters"]),describe:chunkDPD6ZWL2_js.a(e=>e.filters?"Modifie les filtres de la vue":"Retire les filtres de la vue","describe")},es=[Lp,yp,Ap,wp,Ip,Sp,vp,Ep,Cp,Np,Op,kp,_p,Pp,Fp,Vp,jp];function Bp(e){return {id:e.id??e.name,name:e.name,label:e.label,...e.icon===void 0?{}:{icon:e.icon}}}chunkDPD6ZWL2_js.a(Bp,"toDraftableObject");function Up(e){let t=e.id??e.name;return (e.attributes??[]).map(r=>$p(r,t))}chunkDPD6ZWL2_js.a(Up,"toDraftableAttributes");function ui(e){return {id:e.id,name:e.name,label:e.label,type:e.attributeType,...e.config}}chunkDPD6ZWL2_js.a(ui,"toAttribute");function $p(e,t){let{id:r,name:n,label:o,type:a,...s}=e;return {id:e.id??e.name,objectId:t,name:e.name,label:e.label??e.name,attributeType:e.type,config:s}}chunkDPD6ZWL2_js.a($p,"toDraftableAttribute");function Lt(e,t){if(!e.objects.some(r=>r.id===t))throw new chunkGZUTZAPU_js.h(`Object "${t}" is not in the draftable state`,[])}chunkDPD6ZWL2_js.a(Lt,"requireObject");function jt(e){return {objectId:e.objectId}}chunkDPD6ZWL2_js.a(jt,"objectFocus");function Mt(e){return {objectId:e.objectId,recordId:e.recordId}}chunkDPD6ZWL2_js.a(Mt,"recordFocus");function ve(e){return {objectId:e.objectId,attributeId:e.attributeId}}chunkDPD6ZWL2_js.a(ve,"attributeFocus");function qp(e){let t=Object.keys(e.changes).sort();return t.length===1?[t[0]]:void 0}chunkDPD6ZWL2_js.a(qp,"firstChangedProperty");var oe={...ai,objectId:er.z.string().uuid()},zp=er.z.object({...oe,type:er.z.literal("add_object"),name:rt,label:er.z.string().min(1),icon:er.z.string().min(1).optional()}),Gp={type:"add_object",schema:zp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(e.objects.some(n=>n.name===t.name))throw new chunkGZUTZAPU_js.h(`Object "${t.name}" already exists`,[]);if(e.objects.some(n=>n.id===t.objectId))throw new chunkGZUTZAPU_js.h(`Object id "${t.objectId}" is already taken`,[]);let r={id:t.objectId,name:t.name,label:t.label,...t.icon===void 0?{}:{icon:t.icon}};return {...e,objects:[...e.objects,r]}},"apply"),focus:jt,presentation:y(jt,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Cr\xE9e l'objet \xAB ${e.label} \xBB`,"describe")},Wp=er.z.object({...oe,type:er.z.literal("update_object"),changes:er.z.object({label:er.z.string().min(1).optional(),icon:er.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_object needs at least one change")}),ts=chunkDPD6ZWL2_js.a(e=>({objectId:e.objectId}),"updateObjectFocus"),Kp={type:"update_object",schema:Wp,apply:chunkDPD6ZWL2_js.a((e,t)=>(Lt(e,t.objectId),{...e,objects:e.objects.map(r=>r.id===t.objectId?{...r,...t.changes}:r)}),"apply"),focus:ts,presentation:y(ts,"atomic",qp),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'objet en \xAB ${e.changes.label} \xBB`:"Modifie l'objet","describe")},Yp=er.z.object({...oe,type:er.z.literal("remove_object")}),Hp={type:"remove_object",schema:Yp,apply:chunkDPD6ZWL2_js.a((e,t)=>{Lt(e,t.objectId);let r=e.objects.find(n=>n.id===t.objectId)?.name;return {...e,objects:e.objects.filter(n=>n.id!==t.objectId),attributes:e.attributes.filter(n=>n.objectId!==t.objectId),sampleRecords:e.sampleRecords.filter(n=>n.objectId!==t.objectId),views:e.views.filter(n=>n.objectName!==r)}},"apply"),focus:jt,presentation:y(jt,"structural"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'objet ${e.objectId}`,"describe")},Be=$i.filter(e=>e!=="formula"&&e!=="rollup"),Qp=er.z.object({...oe,type:er.z.literal("add_attribute"),attributeId:er.z.string().min(1),name:ho,label:er.z.string().min(1),attributeType:er.z.enum(Be),config:er.z.record(er.z.string(),er.z.unknown()).optional()}).superRefine((e,t)=>{try{chunkPKJYAV5U_js.n(e.attributeType,e.config??{});}catch(r){if(r instanceof chunkGZUTZAPU_js.h){for(let n of r.errors)t.addIssue({code:"custom",message:n.message,path:["config",...n.path??[]]});return}throw r}}),Jp={type:"add_attribute",schema:Qp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Lt(e,t.objectId),e.attributes.some(n=>n.objectId===t.objectId&&n.name===t.name))throw new chunkGZUTZAPU_js.h(`Attribute "${t.name}" already exists on object "${t.objectId}"`,[]);let r={id:t.attributeId,objectId:t.objectId,name:t.name,label:t.label,attributeType:t.attributeType,...t.config===void 0?{}:{config:t.config}};for(let n of e.sampleRecords)n.objectId===t.objectId&&rs(n.id,r,n.values);return {...e,attributes:[...e.attributes,r]}},"apply"),focus:ve,presentation:y(ve,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Ajoute l'attribut \xAB ${e.label} \xBB`,"describe")},Xp=er.z.object({...oe,type:er.z.literal("update_attribute"),attributeId:er.z.string().min(1),changes:er.z.object({label:er.z.string().min(1).optional()}).refine(e=>Object.keys(e).length>0,"update_attribute needs at least one change")}),Zp={type:"update_attribute",schema:Xp,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.attributes.some(r=>r.id===t.attributeId))throw new chunkGZUTZAPU_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);return {...e,attributes:e.attributes.map(r=>r.id===t.attributeId?{...r,...t.changes}:r)}},"apply"),focus:ve,presentation:y(ve,"atomic"),describe:chunkDPD6ZWL2_js.a(e=>e.changes.label?`Renomme l'attribut en \xAB ${e.changes.label} \xBB`:"Modifie l'attribut","describe")},em=er.z.object({...oe,type:er.z.literal("remove_attribute"),attributeId:er.z.string().min(1)}),tm={type:"remove_attribute",schema:em,apply:chunkDPD6ZWL2_js.a((e,t)=>{let r=e.attributes.find(o=>o.id===t.attributeId);if(!r)throw new chunkGZUTZAPU_js.h(`Attribute "${t.attributeId}" is not in the draftable state`,[]);let n=e.sampleRecords.find(o=>o.objectId===r.objectId&&r.name in o.values);if(n)throw new chunkGZUTZAPU_js.h(`Attribute "${r.name}" is still used by sample record "${n.id}"`,[]);return {...e,attributes:e.attributes.filter(o=>o.id!==t.attributeId)}},"apply"),focus:ve,presentation:y(ve,"local"),describe:chunkDPD6ZWL2_js.a(e=>`Supprime l'attribut ${e.attributeId}`,"describe")};function rm(e,t,r,n){let o=ui(r);try{chunkC4LR6U4E_js.c(o);}catch{return}let a=chunkC4LR6U4E_js.g(o,n);if(a.success)return;let s=a.errors??[],l=s.map(p=>p.message).join(", ");throw new chunkGZUTZAPU_js.h(`Sample record "${e}" has an invalid value for "${t}": ${l}`,s.map(p=>({path:p.path,message:p.message})))}chunkDPD6ZWL2_js.a(rm,"assertSampleValue");function rs(e,t,r){if(t.config?.required===true&&t.config?.defaultValue===void 0&&!(t.name in r&&r[t.name]!==void 0))throw new chunkGZUTZAPU_js.h(`Sample record "${e}" is missing a value for required attribute "${t.name}"`,[])}chunkDPD6ZWL2_js.a(rs,"assertRequiredCovered");var nm=er.z.object({...oe,type:er.z.literal("add_sample_record"),recordId:er.z.string().uuid(),values:er.z.record(er.z.string(),er.z.unknown())}),im={type:"add_sample_record",schema:nm,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(Lt(e,t.objectId),e.sampleRecords.some(n=>n.id===t.recordId))throw new chunkGZUTZAPU_js.h(`Sample record "${t.recordId}" already exists`,[]);let r=new Map(e.attributes.filter(n=>n.objectId===t.objectId).map(n=>[n.name,n]));for(let[n,o]of Object.entries(t.values)){let a=r.get(n);if(!a)throw new chunkGZUTZAPU_js.h(`Sample record "${t.recordId}" uses unknown attribute "${n}"`,[]);rm(t.recordId,n,a,o);}for(let n of r.values())rs(t.recordId,n,t.values);return {...e,sampleRecords:[...e.sampleRecords,{id:t.recordId,objectId:t.objectId,values:t.values}]}},"apply"),focus:Mt,presentation:y(Mt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Ajoute un exemple","describe")},om=er.z.object({...oe,type:er.z.literal("remove_sample_record"),recordId:er.z.string().min(1)}),am={type:"remove_sample_record",schema:om,apply:chunkDPD6ZWL2_js.a((e,t)=>{if(!e.sampleRecords.some(r=>r.id===t.recordId&&r.objectId===t.objectId))throw new chunkGZUTZAPU_js.h(`Sample record "${t.recordId}" is not in object "${t.objectId}"`,[]);return {...e,sampleRecords:e.sampleRecords.filter(r=>r.id!==t.recordId)}},"apply"),focus:Mt,presentation:y(Mt,"local"),describe:chunkDPD6ZWL2_js.a(()=>"Retire un exemple","describe")},ns=[Gp,Kp,Hp,Jp,Zp,tm,im,am];function sm(){let e=new Map;for(let t of [...ns,...Ya,...es]){if(e.has(t.type))throw new chunkGZUTZAPU_js.r("architect operation",t.type);e.set(t.type,t);}return e}chunkDPD6ZWL2_js.a(sm,"build");var ce=sm(),li=[...ce.keys()];function Ue(e){let t=ce.get(e.type);if(!t)throw new chunkGZUTZAPU_js.h(`Operation "${e.id}" has unknown type "${e.type}"`,[]);return t}chunkDPD6ZWL2_js.a(Ue,"defOf");function di(e,t){return t.reduce((r,n)=>Ue(n).apply(r,n),e)}chunkDPD6ZWL2_js.a(di,"applyOperations");function um(e){return Ue(e).focus(e)}chunkDPD6ZWL2_js.a(um,"focusOf");function lm(e,t){return e.map(r=>Ue(r).describe(r,t))}chunkDPD6ZWL2_js.a(lm,"describeOperations");function dm(e){if(typeof e!="object"||e===null||!("type"in e))throw new chunkGZUTZAPU_js.h("An operation must be an object carrying a type",[]);let t=e.type;if(typeof t!="string")throw new chunkGZUTZAPU_js.h("An operation's type must be a string",[]);let r=ce.get(t);if(!r)throw new chunkGZUTZAPU_js.h(`Unknown operation type "${t}"`,[]);let n=r.schema.safeParse(e);if(!n.success)throw new chunkGZUTZAPU_js.h(`Operation "${t}" is invalid: ${n.error.issues.map(o=>`${o.path.join(".")} ${o.message}`).join("; ")}`,[]);return n.data}chunkDPD6ZWL2_js.a(dm,"parseOperation");function is(e){return er.z.toJSONSchema(e,{io:"input"})}chunkDPD6ZWL2_js.a(is,"toJsonSchema");function pm(e){let t=ce.get(e);if(!t)throw new chunkGZUTZAPU_js.h(`Unknown operation type "${e}"`,[]);return is(t.schema)}chunkDPD6ZWL2_js.a(pm,"describeOperationInput");function mm(e){let t=Be.find(r=>r===e);if(!t)throw new chunkGZUTZAPU_js.h(`Unknown attribute type "${e}"`,[]);return is(chunkPKJYAV5U_js.m(t))}chunkDPD6ZWL2_js.a(mm,"describeAttributeConfig");function fm(){return {operations:[...li],attributeTypes:[...Be]}}chunkDPD6ZWL2_js.a(fm,"listDescribableNames");function os(e,t,r){let n=`fld_${e}_${t}`;return r===0?n:`${n}_${r}`}chunkDPD6ZWL2_js.a(os,"makeFieldId");function bm(e,t){return e.attributeGroup?e.attributeGroup.id:e.attribute?e.attribute:`slot${t}`}chunkDPD6ZWL2_js.a(bm,"seedOf");function gm(e){let t=new Map,r=e.fields.map((n,o)=>{if(n.id)return n;let a=bm(n,o),s=t.get(a)??0;return t.set(a,s+1),{...n,id:os(e.id,a,s)}});return {...e,fields:r}}chunkDPD6ZWL2_js.a(gm,"withIds");function ym(e){return e.map(t=>t.type==="form"?{...t,groups:t.groups.map(gm)}:t)}chunkDPD6ZWL2_js.a(ym,"ensureFieldIds");function ci(e){return Ue(e).presentation(e)}chunkDPD6ZWL2_js.a(ci,"presentationOf");function hm(e){let t=e.map(ci);return new Set(t.map(({focus:n})=>n.viewId??n.objectId).filter(n=>n!==void 0)).size>1||t.some(({impact:n})=>n==="structural")?"structural":t.some(({impact:n})=>n==="local")?"local":"atomic"}chunkDPD6ZWL2_js.a(hm,"episodeImpactOf");function Am(e,t){return e.config.tabs?.find(r=>r.id===t)}chunkDPD6ZWL2_js.a(Am,"listTabOf");function as(e,t){let r=t.viewId?e.views.find(o=>o.id===t.viewId):void 0,n=t.tabId?r?.tabs.find(o=>o.id===t.tabId):void 0;if(t.attributeId)return e.attributes.find(o=>o.id===t.attributeId);if(t.fieldId){if(n?.type!=="form")return;for(let o of n.groups){let a=o.fields.find(s=>s.id===t.fieldId);if(a)return a}return}if(t.groupId)return n?.type!=="form"?void 0:n.groups.find(o=>o.id===t.groupId);if(t.tabId)return r?n??Am(r,t.tabId):void 0;if(t.recordId)return e.sampleRecords.find(o=>o.id===t.recordId);if(r)return r;if(t.objectId)return e.objects.find(o=>o.id===t.objectId)}chunkDPD6ZWL2_js.a(as,"snapshotArchitectTarget");function Tm(e,t){let r=e;return t.map(n=>{let o=ci(n),a=as(r,o.focus);r=di(r,[n]);let s=as(r,o.focus);return {operationId:n.id,operationType:n.type,presentation:o,before:a,after:s}})}chunkDPD6ZWL2_js.a(Tm,"deriveArchitectChanges");function wm(e){return {id:e.id??"",objectName:e.object,type:e.type,label:e.label,tabs:Je(e)?e.config.tabs??[]:[],config:e.config}}chunkDPD6ZWL2_js.a(wm,"toDraftableView");function xm(e,t){return e.type==="detail"?{...e,label:t.label,config:{...t.config,tabs:t.tabs}}:{...e,label:t.label,config:t.config}}chunkDPD6ZWL2_js.a(xm,"fromDraftableView");Object.defineProperty(exports,"asTenantId",{enumerable:true,get:function(){return chunkZMDMQAV5_js.b}});Object.defineProperty(exports,"asUserId",{enumerable:true,get:function(){return chunkZMDMQAV5_js.c}});Object.defineProperty(exports,"canonicalStringify",{enumerable:true,get:function(){return chunkZMDMQAV5_js.a}});Object.defineProperty(exports,"deepEqual",{enumerable:true,get:function(){return chunkZMDMQAV5_js.f}});Object.defineProperty(exports,"generateId",{enumerable:true,get:function(){return chunkZMDMQAV5_js.d}});Object.defineProperty(exports,"indexBy",{enumerable:true,get:function(){return chunkZMDMQAV5_js.e}});Object.defineProperty(exports,"ATTRIBUTE_FILTER_OPERATORS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.i}});Object.defineProperty(exports,"LIST_TAB_KANBAN_KEYS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.sa}});Object.defineProperty(exports,"LIST_TAB_TABLE_KEYS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ra}});Object.defineProperty(exports,"LIST_VIEW_TAB_VISIBILITIES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.y}});Object.defineProperty(exports,"LOCATION_FILTER_PROPERTIES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.f}});Object.defineProperty(exports,"NATIVE_OBJECT_NAMES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.v}});Object.defineProperty(exports,"NO_VALUE_OPERATORS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.s}});Object.defineProperty(exports,"OPERATORS_BY_TYPE",{enumerable:true,get:function(){return chunkVY5UBDTO_js.r}});Object.defineProperty(exports,"REMOVED_OPERATOR_REPLACEMENTS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.W}});Object.defineProperty(exports,"RESERVED_ATTRIBUTE_NAMES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.B}});Object.defineProperty(exports,"RESERVED_OBJECT_NAMES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.C}});Object.defineProperty(exports,"RESOURCE_VISIBILITIES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.x}});Object.defineProperty(exports,"SYNONYM_ALIASES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.O}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.c}});Object.defineProperty(exports,"SYSTEM_ATTRIBUTE_I18N_KEYS",{enumerable:true,get:function(){return chunkVY5UBDTO_js.a}});Object.defineProperty(exports,"SYSTEM_FIELD_NAMES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.A}});Object.defineProperty(exports,"SYSTEM_FILTER_ATTRIBUTE_TYPES",{enumerable:true,get:function(){return chunkVY5UBDTO_js.V}});Object.defineProperty(exports,"canonicalizeFilterValue",{enumerable:true,get:function(){return chunkVY5UBDTO_js.N}});Object.defineProperty(exports,"collectQualifiedRuleIssues",{enumerable:true,get:function(){return chunkVY5UBDTO_js.X}});Object.defineProperty(exports,"columnsSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.Z}});Object.defineProperty(exports,"currentActor",{enumerable:true,get:function(){return chunkVY5UBDTO_js.E}});Object.defineProperty(exports,"detailTabDraftSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ka}});Object.defineProperty(exports,"detailTabSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ja}});Object.defineProperty(exports,"detailViewConfigSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.na}});Object.defineProperty(exports,"displayAttributesSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js._}});Object.defineProperty(exports,"extractCurrencyFilterValue",{enumerable:true,get:function(){return chunkVY5UBDTO_js.H}});Object.defineProperty(exports,"extractFilterValue",{enumerable:true,get:function(){return chunkVY5UBDTO_js.I}});Object.defineProperty(exports,"fieldSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.da}});Object.defineProperty(exports,"fieldShape",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ca}});Object.defineProperty(exports,"fieldSlotSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ea}});Object.defineProperty(exports,"filterGroupSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ba}});Object.defineProperty(exports,"filterStateSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.aa}});Object.defineProperty(exports,"getAttributeCapabilities",{enumerable:true,get:function(){return chunkVY5UBDTO_js.j}});Object.defineProperty(exports,"getAttributeFilterOperators",{enumerable:true,get:function(){return chunkVY5UBDTO_js.k}});Object.defineProperty(exports,"getOperatorPolarity",{enumerable:true,get:function(){return chunkVY5UBDTO_js.J}});Object.defineProperty(exports,"getRollupFilterOperators",{enumerable:true,get:function(){return chunkVY5UBDTO_js.u}});Object.defineProperty(exports,"getSystemAttributeI18nKey",{enumerable:true,get:function(){return chunkVY5UBDTO_js.b}});Object.defineProperty(exports,"getSystemAttributeList",{enumerable:true,get:function(){return chunkVY5UBDTO_js.d}});Object.defineProperty(exports,"groupWriteSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.fa}});Object.defineProperty(exports,"inverseSourceSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ha}});Object.defineProperty(exports,"isAttributeFilterable",{enumerable:true,get:function(){return chunkVY5UBDTO_js.l}});Object.defineProperty(exports,"isAttributeGroupable",{enumerable:true,get:function(){return chunkVY5UBDTO_js.o}});Object.defineProperty(exports,"isAttributeKanbanGroupable",{enumerable:true,get:function(){return chunkVY5UBDTO_js.p}});Object.defineProperty(exports,"isAttributeSearchable",{enumerable:true,get:function(){return chunkVY5UBDTO_js.m}});Object.defineProperty(exports,"isDynamicValue",{enumerable:true,get:function(){return chunkVY5UBDTO_js.D}});Object.defineProperty(exports,"isLocationFilterProperty",{enumerable:true,get:function(){return chunkVY5UBDTO_js.g}});Object.defineProperty(exports,"isLocationPartOperator",{enumerable:true,get:function(){return chunkVY5UBDTO_js.h}});Object.defineProperty(exports,"isManagedSystemAttribute",{enumerable:true,get:function(){return chunkVY5UBDTO_js.e}});Object.defineProperty(exports,"isNativeObjectName",{enumerable:true,get:function(){return chunkVY5UBDTO_js.w}});Object.defineProperty(exports,"isNoValueOperator",{enumerable:true,get:function(){return chunkVY5UBDTO_js.t}});Object.defineProperty(exports,"isRelativeDateValue",{enumerable:true,get:function(){return chunkVY5UBDTO_js.R}});Object.defineProperty(exports,"isSetMembershipOperator",{enumerable:true,get:function(){return chunkVY5UBDTO_js.M}});Object.defineProperty(exports,"listViewConfigSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ma}});Object.defineProperty(exports,"listViewTabSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.la}});Object.defineProperty(exports,"normalizeFilterRule",{enumerable:true,get:function(){return chunkVY5UBDTO_js.Q}});Object.defineProperty(exports,"normalizeForEdgeRpc",{enumerable:true,get:function(){return chunkVY5UBDTO_js.K}});Object.defineProperty(exports,"normalizeOperator",{enumerable:true,get:function(){return chunkVY5UBDTO_js.P}});Object.defineProperty(exports,"now",{enumerable:true,get:function(){return chunkVY5UBDTO_js.G}});Object.defineProperty(exports,"parseResourceVisibility",{enumerable:true,get:function(){return chunkVY5UBDTO_js.z}});Object.defineProperty(exports,"parseViewConfig",{enumerable:true,get:function(){return chunkVY5UBDTO_js.qa}});Object.defineProperty(exports,"relationSourceSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ga}});Object.defineProperty(exports,"resolveEffectiveFilterType",{enumerable:true,get:function(){return chunkVY5UBDTO_js.q}});Object.defineProperty(exports,"resolveIsWithinBounds",{enumerable:true,get:function(){return chunkVY5UBDTO_js.S}});Object.defineProperty(exports,"resolveUtcDayBounds",{enumerable:true,get:function(){return chunkVY5UBDTO_js.T}});Object.defineProperty(exports,"sortsSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.$}});Object.defineProperty(exports,"tableSourceSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.ia}});Object.defineProperty(exports,"toMultiValueOperator",{enumerable:true,get:function(){return chunkVY5UBDTO_js.L}});Object.defineProperty(exports,"toUtcDayString",{enumerable:true,get:function(){return chunkVY5UBDTO_js.U}});Object.defineProperty(exports,"today",{enumerable:true,get:function(){return chunkVY5UBDTO_js.F}});Object.defineProperty(exports,"validateQualifiedRule",{enumerable:true,get:function(){return chunkVY5UBDTO_js.Y}});Object.defineProperty(exports,"viewConfigByTypeSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.pa}});Object.defineProperty(exports,"viewTypeSchema",{enumerable:true,get:function(){return chunkVY5UBDTO_js.oa}});Object.defineProperty(exports,"ComputedFormulaParseError",{enumerable:true,get:function(){return chunkPKJYAV5U_js.d}});Object.defineProperty(exports,"SCHEMA_LIMITS",{enumerable:true,get:function(){return chunkPKJYAV5U_js.a}});Object.defineProperty(exports,"colorIdSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.b}});Object.defineProperty(exports,"iconNameSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.c}});Object.defineProperty(exports,"multiselectOptionWriteSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.h}});Object.defineProperty(exports,"parseAttributeConfig",{enumerable:true,get:function(){return chunkPKJYAV5U_js.l}});Object.defineProperty(exports,"parseAttributeConfigForCreate",{enumerable:true,get:function(){return chunkPKJYAV5U_js.n}});Object.defineProperty(exports,"parseAttributeConfigForUpdate",{enumerable:true,get:function(){return chunkPKJYAV5U_js.o}});Object.defineProperty(exports,"parseComputedFormula",{enumerable:true,get:function(){return chunkPKJYAV5U_js.e}});Object.defineProperty(exports,"selectOptionWriteSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.g}});Object.defineProperty(exports,"statusGroupSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.f}});Object.defineProperty(exports,"statusOptionWriteSchema",{enumerable:true,get:function(){return chunkPKJYAV5U_js.i}});Object.defineProperty(exports,"createFormAttributeValidator",{enumerable:true,get:function(){return chunkC4LR6U4E_js.d}});Object.defineProperty(exports,"isNullishOrEmptyString",{enumerable:true,get:function(){return chunkC4LR6U4E_js.a}});Object.defineProperty(exports,"isValuePresent",{enumerable:true,get:function(){return chunkC4LR6U4E_js.b}});Object.defineProperty(exports,"rejectUnknownAttributesOrThrow",{enumerable:true,get:function(){return chunkC4LR6U4E_js.l}});Object.defineProperty(exports,"validateDraft",{enumerable:true,get:function(){return chunkC4LR6U4E_js.j}});Object.defineProperty(exports,"validateDraftOrThrow",{enumerable:true,get:function(){return chunkC4LR6U4E_js.k}});Object.defineProperty(exports,"validateObject",{enumerable:true,get:function(){return chunkC4LR6U4E_js.h}});Object.defineProperty(exports,"validateObjectOrThrow",{enumerable:true,get:function(){return chunkC4LR6U4E_js.i}});Object.defineProperty(exports,"createCheckboxValidator",{enumerable:true,get:function(){return chunk47KVYDKG_js.a}});Object.defineProperty(exports,"createDateValidator",{enumerable:true,get:function(){return chunkKLR22JMC_js.a}});Object.defineProperty(exports,"AccessDeniedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.C}});Object.defineProperty(exports,"AttributeInUseError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.I}});Object.defineProperty(exports,"AttributeNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.e}});Object.defineProperty(exports,"ChangeTypeNotSupportedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.q}});Object.defineProperty(exports,"ConcurrentModificationError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.A}});Object.defineProperty(exports,"DestructiveSyncNotAllowedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.o}});Object.defineProperty(exports,"DuplicateError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.r}});Object.defineProperty(exports,"ForbiddenError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.x}});Object.defineProperty(exports,"MemoryNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.G}});Object.defineProperty(exports,"MigrationTimeoutError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.p}});Object.defineProperty(exports,"NotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.c}});Object.defineProperty(exports,"NotImplementedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.F}});Object.defineProperty(exports,"ObjectNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.d}});Object.defineProperty(exports,"ObjectReferencedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.J}});Object.defineProperty(exports,"OrphanSystemAttributeError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.n}});Object.defineProperty(exports,"ProtectedResourceError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.i}});Object.defineProperty(exports,"ProtectedRoleError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.y}});Object.defineProperty(exports,"RecordNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.f}});Object.defineProperty(exports,"RecordReferencedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.H}});Object.defineProperty(exports,"RepositoryError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.D}});Object.defineProperty(exports,"ReservedObjectNameError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.s}});Object.defineProperty(exports,"RoleNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.z}});Object.defineProperty(exports,"SchemaError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.b}});Object.defineProperty(exports,"SchemaErrorCode",{enumerable:true,get:function(){return chunkGZUTZAPU_js.a}});Object.defineProperty(exports,"SchemaPlanNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.g}});Object.defineProperty(exports,"SearchBackendError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.E}});Object.defineProperty(exports,"StorageError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.B}});Object.defineProperty(exports,"SyncCascadeError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.m}});Object.defineProperty(exports,"SyncConflictError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.l}});Object.defineProperty(exports,"SyncError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.j}});Object.defineProperty(exports,"SystemEntityImmutableError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.k}});Object.defineProperty(exports,"ValidationError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.h}});Object.defineProperty(exports,"isAttributeInUseError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.L}});Object.defineProperty(exports,"isNotFoundError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.u}});Object.defineProperty(exports,"isObjectReferencedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.M}});Object.defineProperty(exports,"isProtectedResourceError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.w}});Object.defineProperty(exports,"isRecordReferencedError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.K}});Object.defineProperty(exports,"isSchemaError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.t}});Object.defineProperty(exports,"isValidationError",{enumerable:true,get:function(){return chunkGZUTZAPU_js.v}});Object.defineProperty(exports,"TEXT_FORMAT_PATTERNS",{enumerable:true,get:function(){return chunkXHEBV2HE_js.a}});Object.defineProperty(exports,"createTextValidator",{enumerable:true,get:function(){return chunkXHEBV2HE_js.c}});Object.defineProperty(exports,"resolveTextPattern",{enumerable:true,get:function(){return chunkXHEBV2HE_js.b}});Object.defineProperty(exports,"createNumberValidator",{enumerable:true,get:function(){return chunkSLYRQ72J_js.a}});Object.defineProperty(exports,"DEFAULT_VALIDATION_MESSAGES",{enumerable:true,get:function(){return chunkJFSQ24XR_js.a}});Object.defineProperty(exports,"formatZodErrors",{enumerable:true,get:function(){return chunkJFSQ24XR_js.b}});exports.AGENT_UI_BATCH_MAX_BYTES=bw;exports.AGENT_UI_BATCH_MAX_ITEMS=gw;exports.ALLOWED_PROPERTY_TYPES=io;exports.ALL_ACTIONS=Qt;exports.ALL_OPERATION_TYPES=li;exports.ALL_SYSTEM_RESOURCES=Ph;exports.ARTIFACT_FILE_ROLES=ig;exports.ARTIFACT_KINDS=rg;exports.ARTIFACT_LIST_VIEW=Xu;exports.ARTIFACT_OBJECT=Hu;exports.ARTIFACT_OBJECT_NAME=gt;exports.ARTIFACT_RETENTIONS=ng;exports.ARTIFACT_VIEW=Qu;exports.ATTRIBUTE_TYPES=$i;exports.AUDIT_ACTIONS=Ab;exports.AUDIT_RESOURCE_TYPES=hb;exports.ActivityTabConfig=Hr;exports.AgentBuilder=tr;exports.BEHAVIOR_PROPERTIES=ub;exports.BYTE_UNIT_LABELS=zs;exports.CLAIMABLE_SESSION_STATUSES=Cs;exports.COMPUTED_FUNCTIONS=Fe;exports.COMPUTED_FUNCTION_METADATA=Zw;exports.COMPUTED_FUNCTION_NAMES=kw;exports.CONNECTOR_CALLBACK_PARAM=vx;exports.COUNT_MODES=ro;exports.ComputedFormulaCompileError=b;exports.CustomTabConfig=Kr;exports.DB_COLUMN_FIELDS=kh;exports.DEFAULT_AGENT_EXECUTION_CONFIG=wo;exports.DEFAULT_APPROVAL_POLICY=zi;exports.DEFAULT_DICTATION_LIMITS=eg;exports.DEFAULT_LABEL_FALLBACK=uo;exports.DEFAULT_MEETING_BOT_DISPLAY_NAME=Ms;exports.DEFAULT_ROLES=Au;exports.DEFAULT_ROLE_DESCRIPTIONS=jh;exports.DEFAULT_ROLE_LABELS=Vh;exports.DEFAULT_ROLE_PERMISSIONS=Mh;exports.DEFAULT_TENANT_SETTINGS=Pg;exports.DICTATION_FINALIZATION_TIMEOUT_MS=Xb;exports.DICTATION_FRAME_BYTES=Wb;exports.DICTATION_MAX_BUFFER_BYTES=Yb;exports.DICTATION_MAX_FRAME_BYTES=Kb;exports.DICTATION_MAX_TRANSCRIPT_BYTES=Hb;exports.DICTATION_MODEL_ID=Zb;exports.DICTATION_PREPARATION_TIMEOUT_MS=Jb;exports.DICTATION_SAMPLE_RATE=Gb;exports.DICTATION_TICKET_TTL_MS=Qb;exports.DOCUMENT_SYSTEM_ATTRIBUTES=Hy;exports.DRAFTABLE_ATTRIBUTE_TYPES=Be;exports.DRIVE_LIST_VIEW=Yu;exports.DRIVE_OBJECT=Wu;exports.DRIVE_OBJECT_NAME=bt;exports.DRIVE_VIEW=Ku;exports.DetailViewBuilder=Zr;exports.DocumentsTabConfig=Xr;exports.EMPTY_VALUE_PLACEHOLDER=Ze;exports.ESTIMATED_COUNT_CAP=Yg;exports.EmailsTabConfig=Qr;exports.FAKE_MEETING_BOT_SIGNATURE_HEADER=Nx;exports.FORM_FORBIDDEN_ATTRIBUTE_TYPES=Kt;exports.FlagRegistry=ke;exports.FlagService=ft;exports.FormBuilder=Ur;exports.FormRegistry=Pe;exports.FormRowBuilder=Lr;exports.FormStepBuilder=Br;exports.GroupBuilder=lt;exports.IDENTITY_PROPERTIES=sb;exports.IMAGE_FORMATS=zg;exports.INFERENCE_REASONING_OPTIONS=Ki;exports.INFERENCE_SPEEDS=Wi;exports.LIVE_EVENT_TYPES=fl;exports.ListViewBuilder=en;exports.ListViewTabConfigBuilder=tn;exports.MAX_PRESET_DEPTH=Qi;exports.MAX_TODOS=Pb;exports.MAX_TODO_DESCRIPTION_CHARS=Vb;exports.MAX_TODO_ID_CHARS=Fb;exports.MAX_TODO_RESULT_CHARS=jb;exports.MEETING_ATTRIBUTES=T;exports.MEETING_DETAIL_VIEW_ID=_o;exports.MEETING_LIST_VIEW=tl;exports.MEETING_LIST_VIEW_ID=Oo;exports.MEETING_OBJECT=Zu;exports.MEETING_OBJECT_NAME=yt;exports.MEETING_VIEW=el;exports.MEETING_WRITE_SOURCE=ko;exports.MEMORY_LIST_VIEW=Gu;exports.MEMORY_OBJECT=qu;exports.MEMORY_VIEW=zu;exports.McpOAuthCompletionMode=rc;exports.MeetingsTabConfig=Jr;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_KEY=ks;exports.NATIVE_AGENT_UI_PART_IDS_METADATA_SCHEMA_VERSION=_s;exports.NOTIFICATION_INBOX_STATES=Bi;exports.NOTIFICATION_KINDS=ji;exports.NOTIFICATION_PRIORITIES=Mi;exports.NOTIFICATION_SENSITIVITIES=Li;exports.NOTIFICATION_TYPES_V1=ob;exports.NOTIFICATION_TYPE_AGENT_QUESTION_REQUESTED=Es;exports.NOTIFICATION_TYPE_AGENT_SESSION_WAITING_HUMAN=vs;exports.NOTIFICATION_TYPE_AGENT_TASK_ASSIGNED=Rs;exports.NOTIFICATION_WORK_STATES=Ui;exports.NO_RECORDING=Ox;exports.NoopGeocodingAdapter=Zi;exports.OBJECT_NAME_SCHEMA=rt;exports.OPEN_TOOL_PART_STATES=Ns;exports.OPERATION_REGISTRY=ce;exports.OPERATOR_SPECS=Ct;exports.ObjectBuilder=Oe;exports.PRESENTATION_PROPERTIES=lb;exports.PROVIDER_NAMES=Gi;exports.QUALIFIED_SEPARATOR=rh;exports.QUOTA_KEYS=Jg;exports.RECORDING_OVERRIDES=Dx;exports.RECORDING_POLICIES=Cx;exports.RECORD_CREATOR_ROOT_ACTOR_METADATA_KEY=bo;exports.RELATION_TARGET_ANY=He;exports.RichtextTabConfig=Yr;exports.SCHEMA_PLAN_LIMITS=$;exports.SCHEMA_SOURCE_ID_PATTERN=ti;exports.SESSION_STATE_STREAM_ID=Ub;exports.SESSION_TERMINAL_STATUSES=Ds;exports.SKILL_CONTENT_TEMPLATE=Do;exports.SKILL_LIST_VIEW=Bu;exports.SKILL_OBJECT=Mu;exports.SKILL_VIEW=Lu;exports.STANDARD_SCHEMA_VENDOR=Su;exports.SYSTEM_PART_CODES=Wt;exports.SYSTEM_RESOURCES=L;exports.SYSTEM_RESOURCE_LABELS=Fh;exports.TODAY_DEFAULT=la;exports.TODO_PLAN_STATUSES=Eb;exports.TODO_STATUSES=_b;exports.TOOL_APPROVAL_STATES=Yi;exports.TabBuilder=J;exports.TableTabConfig=dt;exports.UPDATE_TABLE_TAB_CHANGE_KEYS=np;exports.UPDATE_TAB_CHANGE_KEYS=Vc;exports.UPDATE_TAB_CONFIG_CHANGE_KEYS=ip;exports.USER_STATUSES=Vg;exports.USER_WORK_POSTURES=jg;exports.accessLevelToActions=Dg;exports.actionsToAccessLevel=Eg;exports.agent=Jh;exports.agentDataChunk=lI;exports.agentDisplayName=Db;exports.agentInferencePreferencesSchema=aI;exports.agentMessageAttachmentSchema=Tc;exports.agentMessagePartSchema=Ac;exports.agentSessionInferenceOverridesInputSchema=hc;exports.agentSessionInferenceOverridesSchema=sI;exports.agentSessionMessageSchema=Ra;exports.agentUIValidationError=Ec;exports.applyOperations=di;exports.applyPipes=au;exports.applyRelationProps=cu;exports.assertAcyclicComputedDependencies=jw;exports.assertCustomAgentUIMessageChunk=Dc;exports.assertSchemaSourceId=oc;exports.booleanFlag=Du;exports.buildAgentFallbackTitle=ca;exports.buildPermissionFlags=hu;exports.buildPropertySchema=Xe;exports.buildQualifiedAttribute=ih;exports.checkbox=xo;exports.compareAgentSessionMessages=Os;exports.compileComputedFormula=Ko;exports.compileRollupAttribute=Uw;exports.computeByteMagnitude=qs;exports.conversationDisplayTitle=ic;exports.createFlagRegistry=_u;exports.createFlagService=Fu;exports.createStandardSchemaProps=it;exports.currency=dA;exports.customDataChunkSchemas=Oa;exports.date=U;exports.dateInTimezone=Nt;exports.dateValueStart=be;exports.defineOperation=Ot;exports.definePresentation=y;exports.deriveArchitectChanges=Tm;exports.deriveCreateDefaultsFromFilters=xx;exports.deriveInitials=gu;exports.describeAttributeConfig=mm;exports.describeOperationInput=pm;exports.describeOperations=lm;exports.destructiveSchema=wa;exports.detailView=z;exports.document=Io;exports.durableDateSchema=Ic;exports.ensureFieldIds=ym;exports.episodeImpactOf=hm;exports.evaluateComputedAst=Yw;exports.evaluateComputedFormula=Hw;exports.evaluateComputedFormulaWithResult=Qw;exports.evaluateFilterState=Hd;exports.evaluateRecordFilterState=fx;exports.extractAttributeNames=po;exports.extractValueRefs=fo;exports.flagRegistry=ku;exports.focusOf=um;exports.form=IA;exports.formFieldFlatKey=js;exports.formFieldKey=Vs;exports.formRegistry=Vo;exports.formatAgentStreamFrameId=cw;exports.formatAttributeValue=oo;exports.formatByteSize=zy;exports.formatComputedResult=zd;exports.formatLocationValue=Xs;exports.formula=bA;exports.fromDraftableView=xm;exports.generateDefaultDetailView=Mn;exports.generateDefaultListView=Ln;exports.getActiveTab=ew;exports.getEditableLabelAttribute=lu;exports.getErrorMessage=sg;exports.getListViewDisplayAttributeNames=Gs;exports.getLiveProtocolPayloadChannel=Dw;exports.getRecordCreatorPrincipalId=yu;exports.getSingleAttributeFromExpression=mo;exports.getSlotFieldTargets=Xi;exports.getUserDisplayName=fu;exports.group=$A;exports.hasDestructiveEntries=Bx;exports.hasOptions=Og;exports.imageModelIdSchema=Ca;exports.includesAction=ye;exports.inferInverseCardinality=fb;exports.inferRollupReturnType=Nd;exports.inferenceReasoningSchema=oi;exports.inferenceSpeedSchema=ii;exports.isAgentUIDataName=Rc;exports.isAgentUIMessageBatch=yw;exports.isAttributeSortable=bb;exports.isBilateralRelation=mb;exports.isCheckboxEquality=nx;exports.isClaimableSessionStatus=Rb;exports.isComputedFunctionName=Tt;exports.isDateRangeValue=ee;exports.isDefaultRole=Lh;exports.isDetailView=Je;exports.isDocumentAttribute=Qy;exports.isEmptyObject=Us;exports.isFieldGroup=Ls;exports.isFormDefinition=cg;exports.isFormFieldsRow=Qe;exports.isFormFreeFieldRef=Yt;exports.isFormHeadingRow=hg;exports.isFormSeparatorRow=Ag;exports.isFormSlotFieldRef=Ji;exports.isFormTextRow=Tg;exports.isLabelExpression=tt;exports.isListView=to;exports.isLiveEventEnvelope=Cw;exports.isLiveEventPayload=Sw;exports.isLiveEventPayloadForType=Il;exports.isLiveEventType=xl;exports.isNotEmpty=no;exports.isOpenToolPartState=Cb;exports.isPlainRecord=ta;exports.isStandardSchema=eA;exports.isSystemPartCode=Ob;exports.isTerminalSessionStatus=vb;exports.isTerminalState=xb;exports.isToolApprovalState=Nb;exports.isUniversalRelation=qi;exports.jsonFlag=Ou;exports.legacyStatusToSessionState=Sb;exports.listDescribableNames=fm;exports.listView=G;exports.liveChannelKey=Tw;exports.location=mA;exports.makeFieldId=os;exports.matchesAccepts=Jy;exports.mentionReferenceSchema=wc;exports.modelDefinitionSchema=xc;exports.modelReferenceSchema=Da;exports.multiselect=pA;exports.nativeAgentUIPartIdMetadataKey=Fs;exports.normalizeDateValue=Ws;exports.number=at;exports.numberFlag=Nu;exports.object=FA;exports.orderAgentSessionMessages=kb;exports.parseAgentStreamFrameId=pw;exports.parseCountMode=Bs;exports.parseLiveChannelKey=Mo;exports.parseNativeAgentUIPartIdsMetadata=$b;exports.parseOperation=dm;exports.parseOptionalCountMode=Kg;exports.parseQualifiedAttribute=nh;exports.persistedDefaultViewTargetSchema=mc;exports.persistedSchemaPlanSchema=eI;exports.phone=lA;exports.plannedAttributeSchema=lc;exports.plannedInlineAttributeSchema=dc;exports.plannedObjectSchema=cc;exports.presentationOf=ci;exports.proposedDefaultViewTargetSchema=pc;exports.providerNameSchema=Ea;exports.qualifiedPropertyDefs=mu;exports.readFormFieldValue=bg;exports.registry=gT;exports.relation=Te;exports.relationPropertyDefs=pu;exports.relationTargetsOf=pb;exports.renderLabelExpression=Xt;exports.resetViewToDefault=ll;exports.resolveAttributeDefaultValue=ec;exports.resolveFieldRequired=fg;exports.resolvePropertyDefinitions=eo;exports.richtext=Ae;exports.rollup=gA;exports.rollupToFormulaExpression=Cd;exports.schemaPlanSchema=Zx;exports.select=q;exports.sessionInferencePatchSchema=uI;exports.sessionStateToLegacyStatus=Ib;exports.status=cA;exports.stringFlag=Cu;exports.text=f;exports.toAttribute=ui;exports.toDraftableAttributes=Up;exports.toDraftableObject=Bp;exports.toDraftableView=wm;exports.toUndefinedIfEmpty=$s;exports.todoItemSchema=Sc;exports.todoPlanSchema=vc;exports.toolImpactSchema=Na;exports.user=fA;exports.validateAttributeName=Ne;exports.validateLabelExpression=ou;exports.validateObjectExpressions=Ru;exports.validateObjectName=Ce;exports.validateViewName=nt;exports.viewRegistry=rl;exports.viewStateKey=Lg;exports.viewSyncPayload=ac;
|