var __extends=this&&this.__extends||function(){var e=function(t,n){e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n))e[n]=t[n]};return e(t,n)};return function(t,n){if(typeof n!=="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function o(){this.constructor=t}t.prototype=n===null?Object.create(n):(o.prototype=n.prototype,new o)}}();import{T as TableConfig,S as Space,d as decodeFields}from"./table-config-720f8ea0.js";import{R as ReferenceField}from"./index-ef734a5e.js";var MeetingStructureConfig=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.decode=function(e){var n=Object.assign(Object.create(t.prototype),e);n.space=Space.decode(n.space);return n};return t}(TableConfig);var RuleType;(function(e){e["comparison"]="comparison";e["conditionalComparison"]="conditionalComparison"})(RuleType||(RuleType={}));var FieldType;(function(e){e["number"]="number";e["range"]="range";e["singleChoice"]="single-choice";e["multipleChoice"]="multipleChoice";e["text"]="text"})(FieldType||(FieldType={}));var Comparison;(function(e){e["eq"]="eq";e["ne"]="ne";e["lt"]="lt";e["lte"]="lte";e["gt"]="gt";e["gte"]="gte";e["in"]="in";e["contain"]="contain";e["ncontain"]="ncontain";e["similar"]="similar";e["different"]="different"})(Comparison||(Comparison={}));var Rule=function(){function e(e,t){this.comparisons=e;this.type=t}e.decode=function(t){return Object.assign(Object.create(e.prototype),t)};e.prototype.isValid=function(){if(this.type===RuleType.comparison){return this.comparisons.length===1&&!!this.comparisons[0].firstField&&!!this.comparisons[0].secondField&&!!this.comparisons[0].comparison}return true};return e}();var getPairConfigMemberCollection=function(e,t){return e.fields.find((function(e){return e.type===ReferenceField.type&&e.id===t})).otherCollection};var getPairConfigSelectionConfigForRole=function(e,t){return e.selection?e.selection[t]:undefined};var getPairConfigSelectionConfigTargetingRole=function(e,t){var n;Object.keys(e.selection||{}).forEach((function(o){var i=SelectionConfig.decode(e.selection[o]);if(i.roleNameToSelect===t){n=e.selection[o]}}));return n};var PairConfig=function(e){__extends(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}t.decode=function(e){var n=Object.assign(Object.create(t.prototype),e);n.fields=decodeFields(n.fields);n.space=Space.decode(n.space);Object.keys(n.selection||{}).forEach((function(e){n.selection[e]=SelectionConfig.decode(n.selection[e])}));if(n.structure){n.structure=MeetingStructureConfig.decode(n.structure)}n.actionPermissions=n.actionPermissions||{};return n};return t}(TableConfig);var SelectionConfig=function(){function e(){}e.decode=function(t){var n;var o=Object.assign(Object.create(e.prototype),t);o.rules=(n=o.rules)===null||n===void 0?void 0:n.map((function(e){return Rule.decode(e)}));return o};e.prototype.isActive=function(){return this.status==="active"};return e}();export{Comparison as C,MeetingStructureConfig as M,PairConfig as P,Rule as R,RuleType as a,getPairConfigSelectionConfigForRole as b,getPairConfigSelectionConfigTargetingRole as c,getPairConfigMemberCollection as g};