// @bun
var{defineProperty:b,getOwnPropertyNames:J,getOwnPropertyDescriptor:N}=Object,O=Object.prototype.hasOwnProperty;function T(n){return this[n]}var E=(n)=>{var r=(w??=new WeakMap).get(n),C;if(r)return r;if(r=b({},"__esModule",{value:!0}),n&&typeof n==="object"||typeof n==="function"){for(var x of J(n))if(!O.call(r,x))b(r,x,{get:T.bind(n,x),enumerable:!(C=N(n,x))||C.enumerable})}return w.set(n,r),r},w;var k=(n)=>n;function q(n,r){this[n]=k.bind(null,r)}var F=(n,r)=>{for(var C in r)b(n,C,{get:r[C],enumerable:!0,configurable:!0,set:q.bind(r,C)})};var G=(n,r)=>()=>(n&&(r=n(n=0)),r);function A(n){return typeof n==="object"&&n!==null&&"kind"in n&&n.kind==="resource_ref"}function B(n){if(!n)return"unknown";if(typeof n==="string")return n;if(typeof n==="object"){if("config"in n&&n.config?.name)return n.config.name;if("name"in n&&typeof n.name==="string")return n.name}return"unknown"}function j(n){if(!n)return null;if(A(n))return{name:`ResourceRef<${n.graphQLType}>`,description:`Reference to ${n.graphQLType} resource (${n.uriTemplate})`,fields:{}};if("config"in n&&n.config){let r=n.config;return{name:r.name,description:r.description,fields:Object.fromEntries(Object.entries(r.fields).map(([C,x])=>[C,{typeName:B(x.type),isOptional:x.isOptional,isArray:x.isArray}]))}}return{name:"unknown",fields:{}}}function I(n){if(!n)return null;return{meta:{key:n.meta.key,version:n.meta.version,stability:n.meta.stability,owners:n.meta.owners,tags:n.meta.tags,description:n.meta.description,goal:n.meta.goal,context:n.meta.context},io:{input:j(n.io.input),output:j(n.io.output)},policy:n.policy?{auth:n.policy.auth}:void 0}}function K(n){if(!n)return null;return{meta:{key:n.meta.key,version:n.meta.version,stability:n.meta.stability,owners:n.meta.owners,tags:n.meta.tags,description:n.meta.description},payload:j(n.payload)}}function L(n){if(!n)return null;return{meta:{key:n.meta.key,version:n.meta.version,stability:n.meta.stability,owners:n.meta.owners,tags:n.meta.tags,description:n.meta.description,goal:n.meta.goal,context:n.meta.context},source:{type:n.source.type,framework:n.source.type==="component"?n.source.framework:void 0,componentKey:n.source.type==="component"?n.source.componentKey:void 0},targets:n.targets}}function P(n){if(!n)return null;return{meta:{key:n.meta.key,version:n.meta.version,stability:n.meta.stability,owners:n.meta.owners,tags:n.meta.tags,description:n.meta.description,title:n.meta.title},source:n.source,view:n.view}}function Q(n){if(!n)return null;return{meta:{key:n.meta.key,version:n.meta.version,stability:n.meta.stability,owners:n.meta.owners,tags:n.meta.tags,description:n.meta.description,title:n.meta.title},fields:n.fields,actions:n.actions}}export{j as serializeSchemaModel,L as serializePresentationSpec,I as serializeOperationSpec,Q as serializeFormSpec,K as serializeEventSpec,P as serializeDataViewSpec};
