var __extends=this&&this.__extends||function(){var t=function(e,n){t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n))t[n]=e[n]};return t(e,n)};return function(e,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();var getWrappedValue=function(t,e){var n=t;e.split(".").forEach((function(t){if(!n){return}n=n[t]}));return n};var getDataModelFieldDisplayValue=function(t,e,n){var r;if((n==="name"||(e===null||e===void 0?void 0:e.id)==="name")&&!t.name){return"".concat(t.user.firstName," ").concat(t.user.lastName)}if(n===null||n===void 0?void 0:n.includes(".")){return getWrappedValue(t,n)}else if((r=e===null||e===void 0?void 0:e.id)===null||r===void 0?void 0:r.includes(".")){return getWrappedValue(t,e.id)}if(!e){return t[n]}return t[e.id]};function getDataModelField(t,e){return t[e]}var StrictDataModel=function(){function t(){}t.decode=function(e){return Object.assign(Object.create(t.prototype),e)};return t}();var DataModel=function(t){__extends(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}e.decode=function(t){return Object.assign(Object.create(e.prototype),t)};e.prototype.toObject=function(){return JSON.parse(JSON.stringify(this))};e.prototype.toDBRef=function(t){return{_ref:t,_id:this._id}};return e}(StrictDataModel);DataModel.decodeList=function(t){if(t===void 0){t=[]}return t.map((function(t){return DataModel.decode(t)}))};export{DataModel as D,getDataModelFieldDisplayValue as a,getDataModelField as g};