403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/accessrights/v2/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/rospirotorg.ru/bitrix/js/ui/accessrights/v2/dist/v2.bundle.min.js
this.BX=this.BX||{};this.BX.UI=this.BX.UI||{};this.BX.UI.AccessRights=this.BX.UI.AccessRights||{};(function(t,e,s,i,o,r,n,a,l,c,u,d,h,p,g,v,b,m){"use strict";class S{getComponentName(){throw new Error("not implemented")}getEmptyValue(t){var e;return(e=t.emptyValue)!=null?e:new Set}getMinValue(t){if(!m.Type.isNil(t.minValue)){return t.minValue}return null}getMaxValue(t){if(!m.Type.isNil(t.maxValue)){return t.maxValue}return null}isRowValueConfigurable(){return true}}class f extends S{getComponentName(){return"DependentVariables"}}class y extends S{getComponentName(){return"Multivariables"}}class I extends S{getComponentName(){return"Toggler"}getEmptyValue(t){const e=!t.emptyValue||!t.emptyValue[0];if(e){return new Set(["0"])}return super.getEmptyValue(t)}getMinValue(t){const e=super.getMinValue(t);if(!m.Type.isNull(e)){return e}return new Set(["0"])}getMaxValue(t){const e=super.getMaxValue(t);if(!m.Type.isNull(e)){return e}return new Set(["1"])}isRowValueConfigurable(){return false}}class R extends S{getComponentName(){return"Variables"}}var C=babelHelpers.classPrivateFieldLooseKey("cache");class L{static getHint(t){return babelHelpers.classPrivateFieldLooseBase(this,C)[C].remember(`hint-${t}`,(()=>BX.UI.Hint.createInstance({id:`ui-access-rights-v2-hint-${t}`,popupParameters:{className:"ui-access-rights-v2-popup-pointer-events ui-hint-popup",autoHide:true,darkMode:true,maxWidth:280,offsetTop:0,offsetLeft:8,angle:true,animation:"fading-slide"}})))}static getValueTypeByRight(t){return this.getValueType(t.type)}static getValueType(t){const e=String(t);return babelHelpers.classPrivateFieldLooseBase(this,C)[C].remember(e,(()=>{if(e==="dependent_variables"){return new f}if(e==="multivariables"){return new y}if(e==="toggler"){return new I}if(e==="variables"){return new R}console.warn("ui.accessrights.v2: Unknown access right type",t);return null}))}}Object.defineProperty(L,C,{writable:true,value:new m.Cache.MemoryCache});const P=Object.freeze({ROLE:"ui.accessrights.v2~role-selector",MEMBER:"ui.accessrights.v2~member-selector",VARIABLE:"ui.accessrights.v2~variable-selector"});const M=Object.freeze({ROLE:"ui.accessrights.v2~role",VARIABLE:"ui.accessrights.v2~variable"});const w={name:"Selector",emits:["close"],props:{userGroup:{type:Object,required:true},bindNode:{type:HTMLElement,required:true}},computed:{selectedItems(){const t=[];for(const e of this.userGroup.members.keys()){t.push(this.getItemIdByAccessCode(e))}return t},...v.mapState({options:t=>t.application.options,addUserGroupsProviderTab:t=>t.application.options.additionalMembersParams.addUserGroupsProviderTab,addProjectsProviderTab:t=>t.application.options.additionalMembersParams.addProjectsProviderTab,addStructureTeamsProviderTab:t=>t.application.options.additionalMembersParams.addStructureTeamsProviderTab})},mounted(){const t=this.getEntities();new r.Dialog({enableSearch:true,context:P.MEMBER,alwaysShowLabels:true,entities:t,targetNode:this.bindNode,preselectedItems:this.selectedItems,cacheable:false,events:{"Item:onSelect":this.onMemberAdd,"Item:onDeselect":this.onMemberRemove,onHide:()=>{this.$emit("close")}}}).show()},methods:{getItemIdByAccessCode(t){if(/^I?U(\d+)$/.test(t)){const e=t.match(/^I?U(\d+)$/)||null;const s=e?e[1]:null;return["user",s]}if(/^DR(\d+)$/.test(t)){const e=t.match(/^DR(\d+)$/)||null;const s=e?e[1]:null;return["department",s]}if(/^D(\d+)$/.test(t)){const e=t.match(/^D(\d+)$/)||null;const s=e?e[1]:null;return["department",`${s}:F`]}if(/^G(\d+)$/.test(t)){const e=t.match(/^G(\d+)$/)||null;const s=e?e[1]:null;return["site-groups",s]}if(t.at(0)==="A"){return["user-groups",t]}if(/^SG(\d+)_([AEK])$/.test(t)){return["project-access-codes",t]}if(/^SNT(\d+)$/.test(t)){const e=t.match(/^SNT(\d+)$/)||null;const s=e?e[1]:null;return["structure-node",`${s}:F`]}if(/^SNTR(\d+)$/.test(t)){const e=t.match(/^SNTR(\d+)$/)||null;const s=e?e[1]:null;return["structure-node",s]}return["unknown",t]},onMemberAdd(t){const e=this.getMemberFromEvent(t);this.$store.dispatch("userGroups/addMember",{userGroupId:this.userGroup.id,accessCode:e.id,member:e})},onMemberRemove(t){const e=this.getMemberFromEvent(t);this.$store.dispatch("userGroups/removeMember",{userGroupId:this.userGroup.id,accessCode:e.id})},getMemberFromEvent(t){const{item:e}=t.getData();return{id:this.getAccessCodeByItem(e),type:this.getMemberTypeByItem(e),name:e.title.text,avatar:m.Type.isStringFilled(e.avatar)?e.avatar:null}},getAccessCodeByItem(t){const e=t.entityId;if(e==="user"){return`U${t.id}`}if(e==="department"){if(m.Type.isString(t.id)&&t.id.endsWith(":F")){const e=t.id.match(/^(\d+):F$/);const s=e?e[1]:null;return`D${s}`}return`DR${t.id}`}if(e==="structure-node"){if(m.Type.isString(t.id)&&t.id.endsWith(":F")){const e=t.id.match(/^(\d+):F$/);const s=e?e[1]:null;return`SNT${s}`}return`SNTR${t.id}`}if(e==="site-groups"){return`G${t.id}`}if(e==="user-groups"){return t.id}if(e==="project-access-codes"){return t.id}return""},getMemberTypeByItem(t){switch(t.entityId){case"user":return"users";case"intranet":case"department":return"departments";case"socnetgroup":case"project-access-codes":return"sonetgroups";case"group":return"groups";case"structure-node":return"structureteams";case"site-groups":case"user-groups":return"usergroups";default:return""}},getEntities(){const t=[{id:"user",options:{intranetUsersOnly:true,emailUsers:false,inviteEmployeeLink:false,inviteGuestLink:false}},{id:"department",options:{selectMode:"usersAndDepartments",allowSelectRootDepartment:true,allowFlatDepartments:true}},{id:"site-groups",dynamicLoad:true,dynamicSearch:true}];if(this.addStructureTeamsProviderTab){t.push({id:"structure-node",options:{selectMode:"usersAndDepartments",allowSelectRootDepartment:true,allowFlatDepartments:true,includedNodeEntityTypes:["team"],useMultipleTabs:true,visual:{avatarMode:"node",tagStyle:"none"}}})}if(this.addProjectsProviderTab){t.push({id:"project-access-codes"})}if(this.addUserGroupsProviderTab){t.push({id:"user-groups",dynamicLoad:true,options:{}})}return t}},template:"<div hidden></div>"};const H={name:"SingleMember",props:{member:{type:Object,required:true}},computed:{avatarBackgroundImage(){return`url(${encodeURI(this.member.avatar)})`},noAvatarClass(){if(this.member.type==="groups"){return"ui-icon-common-user-group"}if(this.member.type==="sonetgroups"||this.member.type==="departments"){return"ui-icon-common-company"}if(this.member.type==="usergroups"){return"ui-icon-common-user-group"}if(this.member.type==="structureteams"){return"ui-icon-common-my-plan"}return"ui-icon-common-user"}},template:`\n\t\t<div class='ui-access-rights-v2-members-item'>\n\t\t\t<a v-if="member.avatar" class='ui-access-rights-v2-members-item-avatar' :title="member.name" :style="{\n\t\t\t\tbackgroundImage: avatarBackgroundImage,\n\t\t\t\tbackgroundSize: 'cover',\n\t\t\t}"></a>\n\t\t\t<a v-else class='ui-icon ui-access-rights-v2-members-item-icon' :class="noAvatarClass" :title="member.name">\n\t\t\t\t<i></i>\n\t\t\t</a>\n\t\t</div>\n\t`};const V=5;const E={name:"Members",components:{SingleMember:H,Selector:w},props:{userGroup:{type:Object,required:true}},data(){return{isSelectorShown:false,isSelectedMembersPopupShown:false}},popup:null,computed:{shownMembers(){if(this.userGroup.members.size<=V){return this.userGroup.members}const t=[...this.userGroup.members].slice(0,V);return new Map(t)},notShownMembersCount(){if(this.userGroup.members.size>V){return this.userGroup.members.size-V}return 0},bindNode(){return this.$refs.container}},template:`\n\t\t<div ref="container" class="ui-access-rights-v2-members-container"  @click="isSelectorShown = true">\n\t\t\t<div v-if="userGroup.members.size > 0" class='ui-access-rights-v2-members'>\n\t\t\t\t<SingleMember v-for="[accessCode, member] in shownMembers" :key="accessCode" :member="member"/>\n\t\t\t\t<span v-if="notShownMembersCount > 0" class="ui-access-rights-v2-members-more">\n\t\t\t\t\t+ {{ notShownMembersCount }}\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tclass='ui-access-rights-v2-members-item ui-access-rights-v2-members-item-add'\n\t\t\t\t:class="{\n\t\t\t\t\t'--show-always': userGroup.members.size <= 0,\n\t\t\t\t\t'--has-siblings': userGroup.members.size > 0,\n\t\t\t\t}"\n\t\t\t>\n\t\t\t\t<div class="ui-icon-set --plus-30"></div>\n\t\t\t</div>\n\t\t\t<Selector\n\t\t\t\tv-if="isSelectorShown"\n\t\t\t\t:user-group="userGroup"\n\t\t\t\t:bind-node="bindNode"\n\t\t\t\t@close="isSelectorShown = false"\n\t\t\t/>\n\t\t</div>\n\t`};const B={name:"RoleHeading",components:{RichMenuPopup:h.RichMenuPopup,RichMenuItem:h.RichMenuItem},props:{userGroup:{type:Object,required:true}},data(){return{isEdit:false,isPopupShown:false}},computed:{RichMenuItemIcon:()=>h.RichMenuItemIcon,...v.mapState({isSaving:t=>t.application.isSaving,guid:t=>t.application.guid,maxVisibleUserGroups:t=>t.application.options.maxVisibleUserGroups}),...v.mapGetters({isMaxVisibleUserGroupsReached:"userGroups/isMaxVisibleUserGroupsReached",isMaxValueSetForAny:"accessRights/isMaxValueSetForAny",isMinValueSetForAny:"accessRights/isMinValueSetForAny"}),title:{get(){return this.userGroup.title},set(t){this.$store.dispatch("userGroups/setRoleTitle",{userGroupId:this.userGroup.id,title:t})}}},watch:{isEdit(t){if(t===true){this.bindClickedOutsideHandler();void this.$nextTick((()=>{this.$refs.input.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"});this.$refs.input.focus();this.$refs.input.select()}))}else{this.unbindClickedOutsideHandler()}}},mounted(){if(this.userGroup.isNew){this.isEdit=true}},beforeUnmount(){this.unbindClickedOutsideHandler()},methods:{bindClickedOutsideHandler(){m.Event.bind(window,"click",this.turnOffEditWhenClickedOutside,{capture:true})},unbindClickedOutsideHandler(){m.Event.unbind(window,"click",this.turnOffEditWhenClickedOutside,{capture:true})},turnOffEditWhenClickedOutside(t){if(t.target!==this.$refs.input){this.isEdit=false}},showDeleteConfirmation(){const t=new c.Popup({bindElement:this.$refs.container,width:250,overlay:true,contentPadding:10,content:this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_POPUP_REMOVE_ROLE"),className:"ui-access-rights-v2-text-center",animation:"fading-slide",cacheable:false,buttons:[new i.Button({text:this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_POPUP_REMOVE_ROLE_YES"),size:i.ButtonSize.SMALL,color:i.ButtonColor.PRIMARY,events:{click:()=>{t.destroy();this.$store.dispatch("userGroups/removeUserGroup",{userGroupId:this.userGroup.id})}}}),new i.CancelButton({size:i.ButtonSize.SMALL,events:{click:()=>{t.destroy()}}})]});t.show()},showActionsMenu(){if(!this.isSaving){this.isPopupShown=true}},onSetMaxValuesClick(){this.isPopupShown=false;this.$store.dispatch("userGroups/setMaxAccessRightValues",{userGroupId:this.userGroup.id})},onSetMinValuesClick(){this.isPopupShown=false;this.$store.dispatch("userGroups/setMinAccessRightValues",{userGroupId:this.userGroup.id})},onEnableEditClick(){this.isPopupShown=false;this.isEdit=true},onCopyRoleClick(){if(this.isMaxVisibleUserGroupsReached){return}this.isPopupShown=false;this.$store.dispatch("userGroups/copyUserGroup",{userGroupId:this.userGroup.id})},onDeleteRoleClick(){this.isPopupShown=false;this.showDeleteConfirmation()}},template:`\n\t\t<div ref="container" class='ui-access-rights-v2-role'>\n\t\t\t<div class="ui-access-rights-v2-role-value-container">\n\t\t\t\t<input\n\t\t\t\t\tv-if="isEdit && !isSaving"\n\t\t\t\t\tref="input"\n\t\t\t\t\ttype='text'\n\t\t\t\t\tclass='ui-access-rights-v2-role-input'\n\t\t\t\t\tv-model="title"\n\t\t\t\t\t:placeholder="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_NAME')"\n\t\t\t\t\t@keydown.enter="isEdit = false"\n\t\t\t\t/>\n\t\t\t\t<div v-else class='ui-access-rights-v2-role-value' :title="title">{{ title }}</div>\n\t\t\t</div>\n\t\t\t<div \n\t\t\t\tref="menu"\n\t\t\t\tclass="ui-icon-set --more ui-access-rights-v2-icon-more" \n\t\t\t\t@click="showActionsMenu"\n\t\t\t>\n\t\t\t\t<RichMenuPopup v-if="isPopupShown" @close="isPopupShown = false" :popup-options="{bindElement: $refs.menu}">\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\tv-if="isMaxValueSetForAny"\n\t\t\t\t\t\t:icon="RichMenuItemIcon.check"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS_SUBTITLE')"\n\t\t\t\t\t\t@click="onSetMaxValuesClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\tv-if="isMinValueSetForAny"\n\t\t\t\t\t\t:icon="RichMenuItemIcon['red-lock']"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS_SUBTITLE')"\n\t\t\t\t\t\t@click="onSetMinValuesClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t:icon="RichMenuItemIcon.pencil"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_RENAME')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_RENAME_SUBTITLE')"\n\t\t\t\t\t\t@click="onEnableEditClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t:icon="RichMenuItemIcon.copy"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_COPY')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_COPY_ROLE_SUBTITLE')"\n\t\t\t\t\t\t:disabled="isMaxVisibleUserGroupsReached"\n\t\t\t\t\t\t:hint="\n\t\t\t\t\t\t\tisMaxVisibleUserGroupsReached\n\t\t\t\t\t\t\t\t? $Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_COPYING_DISABLED', {\n\t\t\t\t\t\t\t\t\t'#COUNT#': maxVisibleUserGroups,\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t"\n\t\t\t\t\t\t@click="onCopyRoleClick"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t:icon="RichMenuItemIcon['trash-bin']"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_REMOVE')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_REMOVE_SUBTITLE')"\n\t\t\t\t\t\t@click="onDeleteRoleClick"\n\t\t\t\t\t/>\n\t\t\t\t</RichMenuPopup>\n\t\t\t</div>\n\t\t</div>\n\t`};class T{static mapUserGroups(t){const e=[];for(const s of t.values()){e.push({id:s.id,entityId:M.ROLE,title:s.title,supertitle:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ROLE"),avatar:"/bitrix/js/ui/accessrights/v2/images/role-avatar.svg",tabs:["recents"]})}return e}static mapVariables(t){const e=[];for(const s of t.values()){const t=m.Runtime.clone(s);t.entityId=t.entityId||M.VARIABLE;t.tabs="recents";e.push(t)}return e}}const _={template:`\n\t\t<div class='ui-access-rights-v2-column-item'>\n\t\t\t<slot/>\n\t\t</div>\n\t`};const G={template:`\n\t\t<div class='ui-access-rights-v2-column'>\n\t\t\t<slot/>\n\t\t</div>\n\t`};const F={name:"RolesControl",components:{CellLayout:_,ColumnLayout:G,RichMenuPopup:h.RichMenuPopup,RichMenuItem:h.RichMenuItem},props:{userGroups:{type:Map,required:true}},viewDialog:null,computed:{RichMenuItemIcon:()=>h.RichMenuItemIcon,...v.mapState({allUserGroups:t=>t.userGroups.collection,maxVisibleUserGroups:t=>t.application.options.maxVisibleUserGroups,guid:t=>t.application.guid}),...v.mapGetters({isMaxVisibleUserGroupsSet:"application/isMaxVisibleUserGroupsSet",isMaxVisibleUserGroupsReached:"userGroups/isMaxVisibleUserGroupsReached"}),shownGroupsCounter(){return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ROLE_COUNTER",{"#VISIBLE_ROLES#":this.userGroups.size,"#ALL_ROLES#":this.allUserGroups.size,"#GREY_START#":'<span style="opacity: var(--ui-opacity-30)">',"#GREY_FINISH#":"</span>"})},copyDialogItems(){return T.mapUserGroups(this.allUserGroups)},viewDialogItems(){const t=[];for(const e of this.copyDialogItems){t.push({...e,selected:this.userGroups.has(e.id)})}return t}},data(){return{isPopupShown:false}},methods:{onCreateNewRoleClick(){if(this.isMaxVisibleUserGroupsReached){return}this.isPopupShown=false;this.$store.dispatch("userGroups/addUserGroup")},onRoleViewClick(){this.isPopupShown=false;this.showViewDialog(this.$refs.configure)},onCopyRoleClick(){if(this.isMaxVisibleUserGroupsReached){return}this.isPopupShown=false;this.showCopyDialog()},showCopyDialog(){const t=new r.Dialog({context:P.ROLE,targetNode:this.$refs.configure,multiple:false,dropdownMode:true,enableSearch:true,cacheable:false,items:this.copyDialogItems,events:{"Item:onSelect":t=>{const{item:e}=t.getData();this.$store.dispatch("userGroups/copyUserGroup",{userGroupId:e.getId()})}}});t.show()},showViewDialog(t){this.viewDialog=new r.Dialog({context:P.ROLE,footer:this.isMaxVisibleUserGroupsSet?this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ROLE_SELECTOR_MAX_VISIBLE_WARNING",{"#COUNT#":this.maxVisibleUserGroups}):null,targetNode:t,multiple:true,dropdownMode:true,enableSearch:true,cacheable:false,items:this.viewDialogItems,events:{"Item:onBeforeSelect":t=>{if(this.isMaxVisibleUserGroupsSet&&this.viewDialog.getSelectedItems().length>=this.maxVisibleUserGroups){t.preventDefault()}},"Item:onSelect":t=>{const{item:e}=t.getData();this.$store.dispatch("userGroups/showUserGroup",{userGroupId:e.getId()})},"Item:onDeselect":t=>{const{item:e}=t.getData();this.$store.dispatch("userGroups/hideUserGroup",{userGroupId:e.getId()})},onHide:()=>{this.viewDialog=null}}});this.viewDialog.show()},toggleViewDialog(t){if(this.viewDialog){this.viewDialog.hide()}else{this.showViewDialog(t)}}},template:`\n\t\t<ColumnLayout>\n\t\t\t<CellLayout class="ui-access-rights-v2-header-roles-control">\n\t\t\t\t<div class='ui-access-rights-v2-column-item-text ui-access-rights-v2-header-roles-control-header'>\n\t\t\t\t\t<div>{{ $Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLES') }}</div>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref="configure"\n\t\t\t\t\t\tclass="ui-icon-set --more ui-access-rights-v2-icon-more"\n\t\t\t\t\t\t@click="isPopupShown = true"\n\t\t\t\t\t>\n\t\t\t\t\t\t<RichMenuPopup v-if="isPopupShown" @close="isPopupShown = false" :popup-options="{bindElement: $refs.configure}">\n\t\t\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t\t\t:icon="RichMenuItemIcon.role"\n\t\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_NEW_ROLE')"\n\t\t\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_NEW_ROLE_SUBTITLE')"\n\t\t\t\t\t\t\t\t:disabled="isMaxVisibleUserGroupsReached"\n\t\t\t\t\t\t\t\t:hint="\n\t\t\t\t\t\t\t\t\tisMaxVisibleUserGroupsReached\n\t\t\t\t\t\t\t\t\t\t? $Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_ADDING_DISABLED', {\n\t\t\t\t\t\t\t\t\t\t\t'#COUNT#': maxVisibleUserGroups,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t"\n\t\t\t\t\t\t\t\t@click="onCreateNewRoleClick"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t\t\t:icon="RichMenuItemIcon.copy"\n\t\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_COPY_ROLE')"\n\t\t\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_COPY_ROLE_SUBTITLE')"\n\t\t\t\t\t\t\t\t:disabled="isMaxVisibleUserGroupsReached"\n\t\t\t\t\t\t\t\t:hint="\n\t\t\t\t\t\t\t\t\tisMaxVisibleUserGroupsReached\n\t\t\t\t\t\t\t\t\t\t? $Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_COPYING_DISABLED', {\n\t\t\t\t\t\t\t\t\t\t\t'#COUNT#': maxVisibleUserGroups,\n\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t\t\t\t: null\n\t\t\t\t\t\t\t\t"\n\t\t\t\t\t\t\t\t@click="onCopyRoleClick"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t\t\t:icon="RichMenuItemIcon['opened-eye']"\n\t\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_VIEW')"\n\t\t\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE_VIEW_SUBTITLE_MSGVER_1')"\n\t\t\t\t\t\t\t\t@click="onRoleViewClick"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</RichMenuPopup>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div class="ui-access-rights-v2-header-roles-control-actions">\n\t\t\t\t\t<div\n\t\t\t\t\t\tref="counter"\n\t\t\t\t\t\tclass="ui-access-rights-v2-header-roles-control-counter"\n\t\t\t\t\t\t@click="toggleViewDialog($refs.counter)"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class="ui-icon-set --opened-eye" style="--ui-icon-set__icon-size: 15px;"></div>\n\t\t\t\t\t\t<span v-html="shownGroupsCounter"></span>\n\t\t\t\t\t\t<div class="ui-icon-set --chevron-down ui-access-rights-v2-header-roles-control-chevron"></div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ui-access-rights-v2-header-roles-control-expander">\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclass="ui-icon-set --collapse"\n\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_COLLAPSE_ALL_SECTIONS')"\n\t\t\t\t\t\t\t@click="$store.dispatch('accessRights/collapseAllSections')"\n\t\t\t\t\t\t></div>\n\t\t\t\t\t\t<div \n\t\t\t\t\t\t\tclass="ui-icon-set --expand-1"\n\t\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_EXPAND_ALL_SECTIONS')"\n\t\t\t\t\t\t\t@click="$store.dispatch('accessRights/expandAllSections')"\n\t\t\t\t\t\t></div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</CellLayout>\n\t\t</ColumnLayout>\n\t`};const A=new Map;const x=new Map;const O={name:"SyncHorizontalScroll",data(){return{componentGuid:m.Text.getRandom(16)}},computed:{...v.mapState({guid:t=>t.application.guid})},throttledEmitScrollEvent:null,created(){this.throttledEmitScrollEvent=U(this.emitScrollEvent)},mounted(){if(!A.has(this.guid)){const t=this.$store.state.accessRights.collection.size+1;this.$Bitrix.eventEmitter.incrementMaxListeners("ui:accessrights:v2:syncScroll",t);A.set(this.guid,true)}this.$Bitrix.eventEmitter.subscribe("ui:accessrights:v2:syncScroll",this.handleScrollEvent);void this.$nextTick((()=>{if(x.has(this.guid)){this.syncScroll(x.get(this.guid))}}))},beforeUnmount(){this.$Bitrix.eventEmitter.unsubscribe("ui:accessrights:v2:syncScroll",this.handleScrollEvent)},methods:{emitScrollEvent(t){const{scrollLeft:e}=t.target;x.set(this.guid,e);this.$Bitrix.eventEmitter.emit("ui:accessrights:v2:syncScroll",{scrollLeft:e,componentGuid:this.componentGuid})},handleScrollEvent(t){const{scrollLeft:e,componentGuid:s}=t.getData();if(this.componentGuid===s){return}this.syncScroll(e)},syncScroll(t){if(this.$el.scrollLeft!==t){this.$el.scrollLeft=t}}},template:`\n\t\t<div @scroll="throttledEmitScrollEvent">\n\t\t\t<slot/>\n\t\t</div>\n\t`};function U(t){let e=false;let s=false;return function i(...o){s=true;if(!e){const i=function i(){if(s){t(...o);s=false;requestAnimationFrame(i);e=true}else{e=false}};i()}}}const $={name:"Header",components:{RoleHeading:B,SyncHorizontalScroll:O,Members:E,RolesControl:F,ColumnLayout:G,CellLayout:_},directives:{hint:a.hint},props:{userGroups:{type:Map,required:true}},computed:{...v.mapState({maxVisibleUserGroups:t=>t.application.options.maxVisibleUserGroups}),...v.mapGetters({isMaxVisibleUserGroupsReached:"userGroups/isMaxVisibleUserGroupsReached"})},methods:{onCreateNewRoleClick(){if(this.isMaxVisibleUserGroupsReached){return}this.$store.dispatch("userGroups/addUserGroup")}},template:`\n\t\t<div class="ui-access-rights-v2-section ui-access-rights-v2--head-section">\n\t\t\t<div class='ui-access-rights-v2-section-container'>\n\t\t\t\t<div class='ui-access-rights-v2-section-head'>\n\t\t\t\t\t<RolesControl :user-groups="userGroups"/>\n\t\t\t\t</div>\n\t\t\t\t<div class='ui-access-rights-v2-section-content'>\n\t\t\t\t\t<SyncHorizontalScroll class='ui-access-rights-v2-section-wrapper'>\n\t\t\t\t\t\t<ColumnLayout\n\t\t\t\t\t\t\tv-for="[groupId, group] in userGroups" \n\t\t\t\t\t\t\t:key="groupId"\n\t\t\t\t\t\t\t:data-accessrights-user-group-id="groupId"\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<CellLayout class="ui-access-rights-v2-header-role-cell">\n\t\t\t\t\t\t\t\t<RoleHeading :user-group="group"/>\n\t\t\t\t\t\t\t\t<Members :user-group="group"/>\n\t\t\t\t\t\t\t</CellLayout>\n\t\t\t\t\t\t</ColumnLayout>\n\t\t\t\t\t\t<ColumnLayout>\n\t\t\t\t\t\t\t<div class="ui-access-rights-v2-header-role-add">\n\t\t\t\t\t\t\t\t<button class="ui-btn ui-btn-light-border ui-btn-round ui-btn-disabled"\n\t\t\t\t\t\t\t\t\t\tv-if="isMaxVisibleUserGroupsReached"\n\t\t\t\t\t\t\t\t\t\tv-hint="$Bitrix.Loc.getMessage(\n\t\t\t\t\t\t\t\t\t 'JS_UI_ACCESSRIGHTS_V2_ROLE_ADDING_DISABLED', \n\t\t\t\t\t\t\t\t\t {'#COUNT#': maxVisibleUserGroups,})"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div class="ui-icon-set --plus-20"/>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button class="ui-btn ui-btn-light-border ui-btn-round"\n\t\t\t\t\t\t\t\t\t\tv-else\n\t\t\t\t\t\t\t\t\t\t@click="onCreateNewRoleClick"\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t<div class="ui-icon-set --plus-20"/>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</ColumnLayout>\n\t\t\t\t\t</SyncHorizontalScroll>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`};const k={name:"SearchBox",debouncedSetSearchQuery:null,created(){const t=t=>{this.$store.dispatch("accessRights/search",{query:t})};this.debouncedSetSearchQuery=m.Runtime.debounce(t,200)},computed:{searchQuery:{get(){return this.$store.state.accessRights.searchQuery},set(t){this.debouncedSetSearchQuery(t)}}},template:`\n\t\t<div class="ui-ctl ui-ctl-after-icon ui-ctl-w100 ui-access-rights-v2-search">\n\t\t\t<input\n\t\t\t\ttype="text"\n\t\t\t\tclass="ui-ctl-element ui-ctl-textbox ui-access-rights-v2-search-input"\n\t\t\t\t:placeholder="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SEARCH_PLACEHOLDER')"\n\t\t\t\tv-model="searchQuery"\n\t\t\t>\n\t\t\t<a class="ui-ctl-after ui-ctl-icon-search ui-access-rights-v2-search-icon"></a>\n\t\t</div>\n\t`};function D(t){if(!t.isShown){return false}return!t.group||t.isGroupExpanded}function j(t,e,s){if(s){return t}const i=new Map;for(const[s,o]of t){if(e.has(s)){i.set(s,o)}}return i}function N(t){const e=[...t.values()].pop();if(t.size===1){return e.title}return m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_HAS_SELECTED_ITEMS",{"#FIRST_ITEM_NAME#":K(e.title),"#COUNT_REST_ITEMS#":t.size-1})}function K(t){const e=15;if(t.length>e){return`${t.slice(0,e)}...`}return t}function z(t,e,s){if(t.size<2){return""}let i="";for(const e of J(t,s)){i+=`<li>${m.Text.encode(e.title)}</li>`}return`\n\t\t<p>${m.Text.encode(e)}</p>\n\t\t<ul>${i}</ul>\n\t`}function J(t,e){const s=new Map;let i=0;for(const[t]of e){s.set(t,i);i++}return[...t.values()].sort(((t,e)=>{const i=s.get(t.id);const o=s.get(e.id);if(m.Type.isNil(i)){return 1}if(m.Type.isNil(o)){return-1}return i-o}))}const X="|";function q(t,e=X){const s=t.split(e);return new Set(s)}function W(t,e=X){const s=[...t].sort();return s.join(e)}function Y(t,e=X){const s=q(t,e);return W(s,e)}var Q=babelHelpers.classPrivateFieldLooseKey("internalizeExternalSection");var Z=babelHelpers.classPrivateFieldLooseKey("internalizeExternalIcon");var tt=babelHelpers.classPrivateFieldLooseKey("internalizeExternalSectionAction");var et=babelHelpers.classPrivateFieldLooseKey("internalizeSelectedVariablesAliases");var st=babelHelpers.classPrivateFieldLooseKey("internalizeValueSet");var it=babelHelpers.classPrivateFieldLooseKey("internalizeSetEmptyOnSetMinMaxValueInColumn");var ot=babelHelpers.classPrivateFieldLooseKey("internalizeExternalVariable");class rt{constructor(){Object.defineProperty(this,ot,{value:ht});Object.defineProperty(this,it,{value:dt});Object.defineProperty(this,st,{value:ut});Object.defineProperty(this,et,{value:ct});Object.defineProperty(this,tt,{value:lt});Object.defineProperty(this,Z,{value:at});Object.defineProperty(this,Q,{value:nt})}transform(t){const e=new Map;for(const s of t){const t=babelHelpers.classPrivateFieldLooseBase(this,Q)[Q](s);e.set(t.sectionCode,t)}return e}internalizeExternalItem(t){const[e,s]=babelHelpers.classPrivateFieldLooseBase(this,et)[et](t.selectedVariablesAliases);const i={id:String(t.id),type:String(t.type),title:String(t.title),subtitle:m.Type.isStringFilled(t.subtitle)?t.subtitle:null,hint:m.Type.isStringFilled(t.hint)?t.hint:null,group:m.Type.isNil(t.group)?null:String(t.group),groupHead:m.Type.isBoolean(t.groupHead)?t.groupHead:false,isShown:true,minValue:babelHelpers.classPrivateFieldLooseBase(this,st)[st](t.minValue),maxValue:babelHelpers.classPrivateFieldLooseBase(this,st)[st](t.maxValue),defaultValue:babelHelpers.classPrivateFieldLooseBase(this,st)[st](t.defaultValue),emptyValue:babelHelpers.classPrivateFieldLooseBase(this,st)[st](t.emptyValue),nothingSelectedValue:babelHelpers.classPrivateFieldLooseBase(this,st)[st](t.nothingSelectedValue),setEmptyOnSetMinMaxValueInColumn:babelHelpers.classPrivateFieldLooseBase(this,it)[it](t),variables:m.Type.isArray(t.variables)||m.Type.isMap(t.variables)?new Map:null,allSelectedCode:m.Type.isStringFilled(t.allSelectedCode)?t.allSelectedCode:null,selectedVariablesAliases:e,selectedVariablesAliasesSeparator:s,enableSearch:m.Type.isBoolean(t.enableSearch)?t.enableSearch:null,showAvatars:m.Type.isBoolean(t.showAvatars)?t.showAvatars:null,compactView:m.Type.isBoolean(t.compactView)?t.compactView:null,hintTitle:m.Type.isStringFilled(t.hintTitle)?t.hintTitle:null,dependentVariablesPopupHint:m.Type.isStringFilled(t.dependentVariablesPopupHint)?t.dependentVariablesPopupHint:null,iconClass:m.Type.isStringFilled(t.iconClass)?t.iconClass:null,isClickable:m.Type.isBoolean(t.isClickable)?t.isClickable:false,isDeletable:m.Type.isBoolean(t.isDeletable)?t.isDeletable:false,isNew:m.Type.isBoolean(t.isNew)?t.isNew:false,isModified:m.Type.isBoolean(t.isModified)?t.isModified:false};if(i.groupHead||i.group){i.isGroupExpanded=false}if(m.Type.isArray(t.variables)){for(const e of t.variables){const t=babelHelpers.classPrivateFieldLooseBase(this,ot)[ot](e);i.variables.set(t.id,t)}}else if(m.Type.isMap(t.variables)){for(const e of t.variables.values()){const t=babelHelpers.classPrivateFieldLooseBase(this,ot)[ot](e);i.variables.set(t.id,t)}}return i}}function nt(t){const e={sectionCode:m.Type.isStringFilled(t.sectionCode)?t.sectionCode:m.Text.getRandom(),sectionTitle:String(t.sectionTitle),sectionSubTitle:m.Type.isStringFilled(t.sectionSubTitle)?t.sectionSubTitle:null,sectionHint:m.Type.isStringFilled(t.sectionHint)?t.sectionHint:null,sectionIcon:babelHelpers.classPrivateFieldLooseBase(this,Z)[Z](t.sectionIcon),rights:new Map,isExpanded:true,isShown:true,action:babelHelpers.classPrivateFieldLooseBase(this,tt)[tt](t.action)};for(const s of t.rights){const t=this.internalizeExternalItem(s);e.rights.set(t.id,t)}return e}function at(t){if(m.Type.isStringFilled(t==null?void 0:t.type)&&m.Type.isStringFilled(t==null?void 0:t.bgColor)){return{type:t.type,bgColor:t.bgColor}}return null}function lt(t){if(m.Type.isStringFilled(t==null?void 0:t.buttonText)){return{buttonText:t.buttonText}}return null}function ct(t){if(!m.Type.isPlainObject(t)){return[new Map,X]}const e=m.Type.isString(t.separator)?t.separator:X;const s=new Map;for(const[i,o]of Object.entries(t)){if(i==="separator"){continue}s.set(Y(i,e),String(o))}return[s,e]}function ut(t){if(m.Type.isNil(t)){return null}if(m.Type.isArray(t)){return new Set(t.map((t=>String(t))))}if(m.Type.isSet(t)){return new Set(Array.from(t,(t=>String(t))))}return new Set([String(t)])}function dt(t){const e=t=>m.Type.isBoolean(t)?t:null;if(!m.Type.isUndefined(t.setEmptyOnSetMinMaxValueInColumn)){return e(t.setEmptyOnSetMinMaxValueInColumn)}return e(t.setEmptyOnGroupActions)}function ht(t){return{id:String(t.id),title:String(t.title),entityId:m.Type.isStringFilled(t.entityId)?t.entityId:null,supertitle:m.Type.isStringFilled(t.supertitle)?t.supertitle:null,avatar:m.Type.isStringFilled(t.avatar)?t.avatar:null,avatarOptions:m.Type.isPlainObject(t.avatarOptions)?t.avatarOptions:null,conflictsWith:m.Type.isArray(t.conflictsWith)?new Set(t.conflictsWith.map((t=>String(t)))):null,requires:m.Type.isArray(t.requires)?new Set(t.requires.map((t=>String(t)))):null,secondary:m.Type.isBoolean(t.secondary)?t.secondary:null,hint:m.Type.isStringFilled(t.hint)?t.hint:null}}var pt=babelHelpers.classPrivateFieldLooseKey("initialRights");var gt=babelHelpers.classPrivateFieldLooseKey("searchAction");class vt extends v.BuilderModel{constructor(...t){super(...t);Object.defineProperty(this,gt,{value:bt});Object.defineProperty(this,pt,{writable:true,value:new Map})}getName(){return"accessRights"}setInitialAccessRights(t){babelHelpers.classPrivateFieldLooseBase(this,pt)[pt]=t;return this}getState(){return{collection:m.Runtime.clone(babelHelpers.classPrivateFieldLooseBase(this,pt)[pt]),searchQuery:"",deleted:new Set}}getElementState(t={}){throw new Error("Cant create AccessRightSection. You are doing something wrong")}getGetters(){return{shown:t=>{const e=new Map;for(const[s,i]of t.collection){if(i.isShown){e.set(s,i)}}return e},isMinValueSetForAny:(t,e)=>{for(const s of t.collection.values()){for(const t of s.rights.values()){const i=e.isMinValueSet(s.sectionCode,t.id);if(i){return true}}}return false},isMinValueSet:t=>(e,s)=>{var i;const o=(i=t.collection.get(e))==null?void 0:i.rights.get(s);if(!o){console.warn("ui.accessrights.v2: attempt to check if min value set for unknown right",{sectionCode:e,rightId:s});return false}return!m.Type.isNil(o.minValue)},isMaxValueSetForAny:(t,e)=>{for(const s of t.collection.values()){for(const t of s.rights.values()){const i=e.isMaxValueSet(s.sectionCode,t.id);if(i){return true}}}return false},isMaxValueSet:t=>(e,s)=>{var i;const o=(i=t.collection.get(e))==null?void 0:i.rights.get(s);if(!o){console.warn("ui.accessrights.v2: attempt to check if max value set for unknown right",{sectionCode:e,rightId:s});return false}return!m.Type.isNil(o.maxValue)},getEmptyValue:t=>(e,s)=>{var i,o,r;const n=(i=t.collection.get(e))==null?void 0:i.rights.get(s);if(!n){return new Set}return(o=(r=L.getValueTypeByRight(n))==null?void 0:r.getEmptyValue(n))!=null?o:new Set},getNothingSelectedValue:(t,e)=>(s,i)=>{var o,r;const n=(o=t.collection.get(s))==null?void 0:o.rights.get(i);return(r=n==null?void 0:n.nothingSelectedValue)!=null?r:e.getEmptyValue(s,i)},getSelectedVariablesAlias:t=>(e,s,i)=>{var o;const r=(o=t.collection.get(e))==null?void 0:o.rights.get(s);if(!r){return null}const n=W(i,r.selectedVariablesAliasesSeparator);return r.selectedVariablesAliases.get(n)},isModified:t=>{if(t.deleted.size>0){return true}for(const e of t.collection.values()){for(const t of e.rights.values()){if(t.isNew||t.isModified){return true}}}return false}}}getActions(){return{toggleSection:(t,{sectionCode:e})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Attempt to toggle section that dont exists",{sectionCode:e});return}t.commit("toggleSection",{sectionCode:e})},expandAllSections:t=>{for(const e of t.state.collection.keys()){t.commit("expandSection",{sectionCode:e})}},collapseAllSections:t=>{for(const e of t.state.collection.keys()){t.commit("collapseSection",{sectionCode:e})}},toggleGroup:(t,{sectionCode:e,groupId:s})=>{var i;const o=(i=t.state.collection.get(e))==null?void 0:i.rights.get(s);if(!o){console.warn("ui.accessrights.v2: Attempt to toggle group that dont exists",{groupId:s});return}if(!o.groupHead){console.warn("ui.accessrights.v2: Attempt to toggle group that is not group head",{groupId:s});return}t.commit("toggleGroup",{sectionCode:e,groupId:s})},search:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,gt)[gt](t,e)},addRight:(t,{sectionCode:e,right:s})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Adding right to section that doesn`t exists",{sectionCode:e});return}const i=t.state.collection.get(e);if(i){const i=(new rt).internalizeExternalItem(s);t.commit("expandSection",{sectionCode:e});t.commit("addRight",{sectionCode:e,right:i})}},updateRightTitle:(t,{sectionCode:e,rightId:s,rightTitle:i})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Updating right in section that doesn`t exists",{sectionCode:e});return}const o=t.state.collection.get(e);if(!o.rights.has(s)){console.warn("ui.accessrights.v2: Updating right that doesn`t exists",{rightId:s});return}t.commit("expandSection",{sectionCode:e});t.commit("setRightTitle",{sectionCode:e,rightId:s,title:i})},updateRightSubtitle:(t,{sectionCode:e,rightId:s,rightSubtitle:i})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Updating right in section that doesn`t exists",{sectionCode:e});return}const o=t.state.collection.get(e);if(!o.rights.has(s)){console.warn("ui.accessrights.v2: Updating right that doesn`t exists",{rightId:s});return}t.commit("expandSection",{sectionCode:e});t.commit("setRightSubtitle",{sectionCode:e,rightId:s,subtitle:i})},deleteRight:(t,{sectionCode:e,rightId:s})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Deleting right in section that doesn`t exists",{sectionCode:e});return}const i=t.state.collection.get(e);if(!i.rights.has(s)){console.warn("ui.accessrights.v2: Deleting right that doesn`t exists",{rightId:s});return}t.commit("expandSection",{sectionCode:e});t.commit("deleteRight",{sectionCode:e,rightId:s})},markRightAsModified:(t,{sectionCode:e,rightId:s,isModified:i})=>{if(!t.state.collection.has(e)){console.warn("ui.accessrights.v2: Updating right in section that doesn`t exists",{sectionCode:e});return}const o=t.state.collection.get(e);if(!o.rights.has(s)){console.warn("ui.accessrights.v2: Updating right that doesn`t exists",{rightId:s});return}t.commit("expandSection",{sectionCode:e});t.commit("markRightAsModified",{sectionCode:e,rightId:s,isModified:i})}}}getMutations(){return{addRight:(t,{sectionCode:e,right:s})=>{const i=t.collection.get(e);i.rights.set(s.id,s)},setRightTitle:(t,{sectionCode:e,rightId:s,title:i})=>{const o=t.collection.get(e);o.rights.get(s).title=i},setRightSubtitle:(t,{sectionCode:e,rightId:s,subtitle:i})=>{const o=t.collection.get(e);o.rights.get(s).subtitle=i},deleteRight:(t,{sectionCode:e,rightId:s})=>{const i=t.collection.get(e);i.rights.delete(s);t.deleted.add(s)},markRightAsModified:(t,{sectionCode:e,rightId:s,isModified:i})=>{const o=t.collection.get(e);o.rights.get(s).isModified=i},toggleSection:(t,{sectionCode:e})=>{const s=t.collection.get(e);s.isExpanded=!s.isExpanded},expandSection:(t,{sectionCode:e})=>{const s=t.collection.get(e);s.isExpanded=true},collapseSection:(t,{sectionCode:e})=>{const s=t.collection.get(e);s.isExpanded=false},toggleGroup:(t,{sectionCode:e,groupId:s})=>{const i=t.collection.get(e);for(const t of i.rights.values()){if(t.id===s&&t.groupHead||t.group===s){t.isGroupExpanded=!t.isGroupExpanded}}},expandGroup:(t,{sectionCode:e,groupId:s})=>{const i=t.collection.get(e);i.isExpanded=true;for(const t of i.rights.values()){if(t.id===s&&t.groupHead||t.group===s){t.isGroupExpanded=true}}},showItem:(t,{sectionCode:e,itemId:s})=>{const i=t.collection.get(e);i.isShown=true;const o=i.rights.get(s);o.isShown=true;if(o.group){i.rights.get(o.group).isShown=true}},showGroup:(t,{sectionCode:e,groupId:s})=>{const i=t.collection.get(e);i.isShown=true;for(const t of i.rights.values()){if(t.id===s&&t.groupHead||t.group===s){t.isShown=true}}},showSection:(t,{sectionCode:e})=>{const s=t.collection.get(e);s.isShown=true;for(const t of s.rights.values()){t.isShown=true}},showAll:t=>{for(const e of t.collection.values()){e.isShown=true;for(const t of e.rights.values()){t.isShown=true}}},hideAll:t=>{for(const e of t.collection.values()){e.isShown=false;for(const t of e.rights.values()){t.isShown=false}}},setSearchQuery:(t,{query:e})=>{t.searchQuery=String(e)}}}}function bt(t,{query:e}){if(!m.Type.isString(e)){console.warn("ui.accessrights.v2: attempt to search with non-string search query");return}t.commit("setSearchQuery",{query:e});if(e===""){t.commit("showAll");return}t.commit("hideAll");const s=e.toLowerCase();for(const e of t.state.collection.values()){var i;if(e.sectionTitle.toLowerCase().includes(s)||(i=e.sectionSubTitle)!=null&&i.toLowerCase().includes(s)){t.commit("showSection",{sectionCode:e.sectionCode});continue}for(const i of e.rights.values()){if(!i.title.toLowerCase().includes(s)){continue}if(i.groupHead){t.commit("showGroup",{sectionCode:e.sectionCode,groupId:i.id})}else{t.commit("showItem",{sectionCode:e.sectionCode,itemId:i.id});if(i.group){t.commit("expandGroup",{sectionCode:e.sectionCode,groupId:i.group})}}}}}const mt={name:"MenuCell",components:{CellLayout:_,RichMenuPopup:h.RichMenuPopup,RichMenuItem:h.RichMenuItem},inject:["section","userGroup"],data(){return{isMenuShown:false}},computed:{RichMenuItemIcon:()=>h.RichMenuItemIcon,...v.mapGetters({isMaxValueSetForAny:"accessRights/isMaxValueSetForAny",isMinValueSetForAny:"accessRights/isMinValueSetForAny"}),menuPopupOptions(){const t=290;return{bindElement:this.$refs.icon,width:t,offsetLeft:-Math.floor(t/2)+9}},shownUserGroupsWithoutCurrent(){const t=this.$store.getters["userGroups/shown"];const e=m.Runtime.clone(t);e.delete(this.userGroup.id);return e},applyDialogItems(){return T.mapUserGroups(this.shownUserGroupsWithoutCurrent)}},methods:{toggleMenu(){this.isMenuShown=!this.isMenuShown},showApplyDialog(){this.isMenuShown=false;const t=new r.Dialog({context:P.ROLE,targetNode:this.$refs.icon,multiple:false,dropdownMode:true,enableSearch:true,cacheable:false,items:this.applyDialogItems,events:{"Item:onSelect":t=>{const{item:e}=t.getData();this.$store.dispatch("userGroups/copySectionValues",{srcUserGroupId:this.userGroup.id,dstUserGroupId:e.getId(),sectionCode:this.section.sectionCode})}}});t.show()},setMaxValuesInSection(){this.isMenuShown=false;this.$store.dispatch("userGroups/setMaxAccessRightValuesInSection",{userGroupId:this.userGroup.id,sectionCode:this.section.sectionCode})},setMinValuesInSection(){this.isMenuShown=false;this.$store.dispatch("userGroups/setMinAccessRightValuesInSection",{userGroupId:this.userGroup.id,sectionCode:this.section.sectionCode})}},template:`\n\t\t<CellLayout class="ui-access-rights-v2-menu-cell" style="cursor: pointer" @click="toggleMenu">\n\t\t\t<div\n\t\t\t\tref="icon"\n\t\t\t\tclass="ui-icon-set --more ui-access-rights-v2-icon-more"\n\t\t\t>\n\t\t\t\t<RichMenuPopup\n\t\t\t\t\tv-if="isMenuShown"\n\t\t\t\t\t@close="isMenuShown = false"\n\t\t\t\t\t:popup-options="menuPopupOptions"\n\t\t\t\t>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\tv-if="isMaxValueSetForAny"\n\t\t\t\t\t\t:icon="RichMenuItemIcon.check"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage(\n\t\t\t\t\t\t\t'JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS_SUBTITLE_SECTION',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'#SECTION#': section.sectionTitle + (section.sectionSubTitle ? (' ' + section.sectionSubTitle) : ''),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)"\n\t\t\t\t\t\t@click="setMaxValuesInSection"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\tv-if="isMinValueSetForAny"\n\t\t\t\t\t\t:icon="RichMenuItemIcon['red-lock']"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage(\n\t\t\t\t\t\t\t'JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS_SUBTITLE_SECTION',\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t'#SECTION#': section.sectionTitle + (section.sectionSubTitle ? (' ' + section.sectionSubTitle) : ''),\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t)"\n\t\t\t\t\t\t@click="setMinValuesInSection"\n\t\t\t\t\t/>\n\t\t\t\t\t<RichMenuItem\n\t\t\t\t\t\t:icon="RichMenuItemIcon.copy"\n\t\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_APPLY_TO_ROLE')"\n\t\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_APPLY_TO_ROLE_SUBTITLE')"\n\t\t\t\t\t\t@click="showApplyDialog"\n\t\t\t\t\t/>\n\t\t\t\t</RichMenuPopup>\n\t\t\t</div>\n\t\t</CellLayout>\n\t`};const St={name:"Icon",inject:["section"],computed:{iconBgColor(){if(this.section.sectionIcon.bgColor.startsWith("--")){return`var(${this.section.sectionIcon.bgColor})`}return this.section.sectionIcon.bgColor}},template:`\n\t\t<div v-if="section.sectionIcon" class="ui-access-rights-v2-section-header-icon" :style="{\n\t\t\tbackgroundColor: iconBgColor,\n\t\t}">\n\t\t\t<div class="ui-icon-set" :class="'--' + section.sectionIcon.type"></div>\n\t\t</div>\n\t`};const ft={name:"Locator",components:{SectionIcon:St},props:{maxWidth:{type:Number,default:430}},inject:["section","right"],computed:{rightOrGroupTitle(){if(!this.right.group){return this.right.title}const t=this.section.rights.get(this.right.group);return t==null?void 0:t.title}},template:`\n\t\t<div class="ui-access-rights-v2-cell-popup-header-locator" :style="{\n\t\t\tmaxWidth: maxWidth + 'px',\n\t\t}">\n\t\t\t<SectionIcon/>\n\t\t\t<span\n\t\t\t\tclass="ui-access-rights-v2-text-ellipsis"\n\t\t\t\t:title="section.sectionTitle"\n\t\t\t>{{ section.sectionTitle }}</span>\n\t\t\t<span\n\t\t\t\tv-if="section.sectionSubTitle" \n\t\t\t\tclass="ui-access-rights-v2-text-ellipsis"\n\t\t\t\t:title="section.sectionSubTitle"\n\t\t\t\tstyle="margin-left: 5px; color: var(--ui-color-palette-gray-70);"\n\t\t\t>{{ section.sectionSubTitle }}</span>\n\t\t\t<div class="ui-icon-set --chevron-right ui-access-rights-v2-cell-popup-header-chevron"></div>\n\t\t\t<template v-if="rightOrGroupTitle !== right.title">\n\t\t\t\t<span class="ui-access-rights-v2-text-ellipsis" :title="right.title">{{ right.title }}</span>\n\t\t\t\t<div class="ui-icon-set --chevron-right ui-access-rights-v2-cell-popup-header-chevron"></div>\n\t\t\t</template>\n\t\t\t<span class="ui-access-rights-v2-text-ellipsis" :title="rightOrGroupTitle">{{ rightOrGroupTitle }}</span>\n\t\t</div>\n\t`};const yt={name:"MasterSwitcher",components:{Switcher:l.Switcher},emits:["check","uncheck"],props:{isChecked:{type:Boolean,required:true}},inject:["section","right"],computed:{switcherOptions(){return{size:"small",color:"green"}}},template:`\n\t\t<div class="ui-access-rights-v2-cell-popup-header-master-switcher" :class="{\n\t\t\t'--checked': isChecked,\n\t\t}">\n\t\t\t<slot/>\n\t\t\t<div class="ui-access-rights-v2-cell-popup-header-toggle-container">\n\t\t\t\t<span class="ui-access-rights-v2-cell-popup-header-toggle-caption">{{\n\t\t\t\t\t$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ACCESS')\n\t\t\t\t}}</span>\n\t\t\t\t<Switcher\n\t\t\t\t\t:is-checked="isChecked"\n\t\t\t\t\t@check="$emit('check')"\n\t\t\t\t\t@uncheck="$emit('uncheck')"\n\t\t\t\t\t:options="switcherOptions"\n\t\t\t\t\tdata-accessrights-min-max\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t`};const It={name:"SingleRoleTitle",props:{userGroupTitle:{type:String,required:true}},template:`\n\t\t<div class="ui-access-rights-v2-cell-popup-header-role-container">\n\t\t\t<div>\n\t\t\t\t<div class="ui-access-rights-v2-cell-popup-header-role-caption">\n\t\t\t\t\t{{ $Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ROLE') }}\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass="ui-access-rights-v2-cell-popup-header-role-title ui-access-rights-v2-text-ellipsis"\n\t\t\t\t\t:title="userGroupTitle"\n\t\t\t\t>\n\t\t\t\t\t{{ userGroupTitle }}\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t`};const Rt={name:"DependentVariablesPopupHeader",components:{Locator:ft,MasterSwitcher:yt,SingleRoleTitle:It},emits:["setMax","setMin"],props:{values:{type:Set,required:true}},inject:["right"],computed:{isChecked(){if(!this.isMinMaxValuesSet){return this.values.size>0}return this.isSelectedAnythingBesidesMin},isMinMaxValuesSet(){return!m.Type.isNil(this.right.minValue)&&!m.Type.isNil(this.right.maxValue)},isSelectedAnythingBesidesMin(){if(this.values.size<=0){return false}for(const t of this.values){if(!this.right.minValue.has(t)){return true}}return false}},methods:{setMin(){if(this.isMinMaxValuesSet){this.$emit("setMin")}},setMax(){if(this.isMinMaxValuesSet){this.$emit("setMax")}}},template:`\n\t\t<div>\n\t\t\t<Locator/>\n\t\t\t<MasterSwitcher\n\t\t\t\t:is-checked="isChecked"\n\t\t\t\t@check="setMax"\n\t\t\t\t@uncheck="setMin"\n\t\t\t>\n\t\t\t\t<slot/>\n\t\t\t</MasterSwitcher>\n\t\t</div>\n\t`};const Ct={name:"DependentVariablesPopupContent",emits:["apply"],components:{Switcher:l.Switcher,PopupHeader:Rt,Icon:s.BIcon},directives:{hint:a.hint},props:{initialValues:{type:Set,default:new Set}},data(){return{notSavedValues:this.getNotSavedValues()}},inject:["section","right","redefineApply"],computed:{isMinMaxValuesSet(){return!m.Type.isNil(this.right.minValue)&&!m.Type.isNil(this.right.maxValue)},variablesShownInList(){if(!this.isMinMaxValuesSet){return this.right.variables}const t=m.Runtime.clone(this.right.variables);for(const e of this.right.minValue){t.delete(e)}for(const[e,s]of t){if(s.secondary){t.delete(e)}}return t},secondaryVariables(){const t=new Map;for(const[e,s]of this.right.variables){if(s.secondary){t.set(e,s)}}return t},nothingSelectedValues(){return this.$store.getters["accessRights/getNothingSelectedValue"](this.section.sectionCode,this.right.id)},switcherOptions(){return{size:"small",color:"primary"}},secondarySwitcherOptions(){return{size:"extra-small",color:"green"}},iconSet(){return s.Set}},mounted(){this.redefineApply((()=>{this.apply()}))},methods:{addValue(t){const e=this.right.variables.get(t);if(!e){return}this.notSavedValues.add(t);if(!m.Type.isNil(e.requires)){for(const t of e.requires){this.notSavedValues.add(t)}}if(!m.Type.isNil(e.conflictsWith)){for(const t of e.conflictsWith){this.notSavedValues.delete(t)}}for(const e of this.right.variables.values()){if(e.id===t){continue}if(this.notSavedValues.has(e.id)&&!m.Type.isNil(e.conflictsWith)){for(const t of e.conflictsWith){if(this.notSavedValues.has(t)){this.notSavedValues.delete(e.id)}}}}},removeValue(t){this.notSavedValues.delete(t);for(const e of this.notSavedValues){if(e===t){continue}const s=this.right.variables.get(e);if(!s){continue}if(!m.Type.isNil(s.requires)&&s.requires.has(t)){this.notSavedValues.delete(e)}}},setMaxValue(){for(const t of this.right.maxValue){this.addValue(t)}},setMinValue(){for(const t of this.right.minValue){this.addValue(t)}},apply(){let t=this.notSavedValues;if(t.size<=0){t=this.nothingSelectedValues}this.$emit("apply",{values:t})},getNotSavedValues(){const t=new Set;this.initialValues.forEach((e=>{if(this.right.variables.has(e)){t.add(e)}}));return t},getVariableHintOptions(t){return{text:t.hint,popupOptions:{bindOptions:{position:"bottom"},width:262,angle:{position:"top",offset:33}}}}},template:`\n\t\t<div>\n\t\t\t<PopupHeader\n\t\t\t\t:values="notSavedValues"\n\t\t\t\t@set-max="setMaxValue"\n\t\t\t\t@set-min="setMinValue"\n\t\t\t>\n\t\t\t\t<slot name="role-title"/>\n\t\t\t</PopupHeader>\n\t\t\t<div class="ui-access-rights-v2-dv-popup--line-container">\n\t\t\t\t<div\n\t\t\t\t\tv-for="[variableId, variable] in variablesShownInList"\n\t\t\t\t\t:key="variableId"\n\t\t\t\t\tclass="ui-access-rights-v2-dv-popup--line"\n\t\t\t\t>\n\t\t\t\t\t<div class="ui-access-rights-v2-dv-popup--line-title">\n\t\t\t\t\t\t<span class="ui-access-rights-v2-text-ellipsis" :title="variable.title">{{ variable.title }}</span>\n\t\t\t\t\t\t<Icon v-if="variable.hint" :name="iconSet.INFO_1" :color="'var(--ui-color-palette-gray-40)'" :size="20" v-hint="getVariableHintOptions(variable)"></Icon>\n\t\t\t\t\t</div>\n\t\t\t\t\t<Switcher\n\t\t\t\t\t\t:is-checked="notSavedValues.has(variable.id)"\n\t\t\t\t\t\t@check="addValue(variable.id)"\n\t\t\t\t\t\t@uncheck="removeValue(variable.id)"\n\t\t\t\t\t\t:options="switcherOptions"\n\t\t\t\t\t\t:data-accessrights-variable-id="variable.id"\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tv-for="[variableId, variable] in secondaryVariables"\n\t\t\t\t\t:key="variableId"\n\t\t\t\t\tclass="ui-access-rights-v2-dv-popup--line --secondary"\n\t\t\t\t>\n\t\t\t\t\t<Switcher\n\t\t\t\t\t\t:is-checked="notSavedValues.has(variable.id)"\n\t\t\t\t\t\t@check="addValue(variable.id)"\n\t\t\t\t\t\t@uncheck="removeValue(variable.id)"\n\t\t\t\t\t\t:options="secondarySwitcherOptions"\n\t\t\t\t\t\tstyle="padding-right: 5px;"\n\t\t\t\t\t\t:data-accessrights-variable-id="variable.id"\n\t\t\t\t\t/>\n\t\t\t\t\t<span class="ui-access-rights-v2-text-ellipsis">{{ variable.title }}</span>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<div\n\t\t\t\tv-if="right.dependentVariablesPopupHint"\n\t\t\t\tclass="ui-access-rights-v2-dv-popup--hint"\n\t\t\t>\n\t\t\t\t<Icon :name="iconSet.INFO_1" :color="'var(--ui-color-palette-gray-40)'" :size="20"></Icon>\n\t\t\t\t<span>{{ right.dependentVariablesPopupHint }}</span>\n\t\t\t</div>\n\t\t</div>\n\t`};const Lt={name:"AllRolesTitle",template:`\n\t\t<div class="ui-access-rights-v2-cell-popup-header-all-role-container">\n\t\t\t<div class="ui-icon-set --persons-3" style="margin-right: 4px;"></div>\n\t\t\t<div class="ui-access-rights-v2-cell-popup-header-all-roles-caption">{{ \n\t\t\t\t$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_ALL_ROLES')\n\t\t\t}}</div>\n\t\t</div>\n\t`};const Pt={name:"ValuePopup",components:{Popup:o.Popup},emits:["close","apply"],provide(){return{redefineApply:t=>{this.onApply=t}}},data(){return{onApply:()=>{this.$emit("apply")}}},computed:{popupOptions(){return{autoHide:true,closeEsc:true,cacheable:false,minWidth:466,padding:18}}},mounted(){void this.$nextTick((()=>{const t=new i.ApplyButton({color:i.ButtonColor.PRIMARY,onclick:()=>{this.apply();this.$emit("close")}});t.renderTo(this.$refs["button-container"]);const e=new i.CancelButton({onclick:()=>{this.$emit("close")}});e.renderTo(this.$refs["button-container"])}))},methods:{apply(){this.onApply()}},template:`\n\t\t<Popup @close="$emit('close')" :options="popupOptions">\n\t\t\t<slot/>\n\t\t\t<div ref="button-container" class="ui-access-rights-v2-value-popup-buttons"></div>\n\t\t</Popup>\n\t`};const Mt={name:"DependentVariables",components:{PopupContent:Ct,AllRolesTitle:Lt,ValuePopup:Pt},emits:["close"],inject:["section","right"],methods:{apply({values:t}){this.$store.dispatch("userGroups/setAccessRightValuesForShown",{sectionCode:this.section.sectionCode,valueId:this.right.id,values:t})}},template:`\n\t\t<ValuePopup @close="$emit('close')">\n\t\t\t<PopupContent @apply="apply">\n\t\t\t\t<template #role-title>\n\t\t\t\t\t<AllRolesTitle/>\n\t\t\t\t</template>\n\t\t\t</PopupContent>\n\t\t</ValuePopup>\n\t`};let wt=t=>t,Ht,Vt;var Et=babelHelpers.classPrivateFieldLooseKey("toggleSelectButtons");var Bt=babelHelpers.classPrivateFieldLooseKey("selectAll");var Tt=babelHelpers.classPrivateFieldLooseKey("deselectAll");var _t=babelHelpers.classPrivateFieldLooseKey("onItemStatusChange");class Gt extends r.DefaultFooter{constructor(t,e){super(t,e);Object.defineProperty(this,_t,{value:Ot});Object.defineProperty(this,Tt,{value:xt});Object.defineProperty(this,Bt,{value:At});Object.defineProperty(this,Et,{value:Ft});this.selectAllButton=m.Tag.render(Ht||(Ht=wt`<div class="ui-selector-footer-link">${0}</div>`),m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ALL_SELECT_LABEL"));m.Dom.hide(this.selectAllButton);m.Event.bind(this.selectAllButton,"click",babelHelpers.classPrivateFieldLooseBase(this,Bt)[Bt].bind(this));this.deselectAllButton=m.Tag.render(Vt||(Vt=wt`<div class="ui-selector-footer-link">${0}</div>`),m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ALL_DESELECT_LABEL"));m.Dom.hide(this.deselectAllButton);m.Event.bind(this.deselectAllButton,"click",babelHelpers.classPrivateFieldLooseBase(this,Tt)[Tt].bind(this));this.getDialog().subscribe("Item:onSelect",babelHelpers.classPrivateFieldLooseBase(this,_t)[_t].bind(this));this.getDialog().subscribe("Item:onDeselect",babelHelpers.classPrivateFieldLooseBase(this,_t)[_t].bind(this))}getContent(){babelHelpers.classPrivateFieldLooseBase(this,Et)[Et]();return[this.selectAllButton,this.deselectAllButton]}}function Ft(){if(this.getDialog().getSelectedItems().length===this.getDialog().getItems().length){m.Dom.hide(this.selectAllButton);m.Dom.show(this.deselectAllButton)}else{m.Dom.show(this.selectAllButton);m.Dom.hide(this.deselectAllButton)}}function At(){this.getDialog().getItems().forEach((t=>{t.select()}))}function xt(){this.getDialog().getSelectedItems().forEach((t=>{t.deselect()}))}function Ot(){babelHelpers.classPrivateFieldLooseBase(this,Et)[Et]()}let Ut=t=>t,$t;var kt=babelHelpers.classPrivateFieldLooseKey("renderVueApp");class Dt extends r.BaseHeader{constructor(...t){super(...t);Object.defineProperty(this,kt,{value:jt})}render(){return babelHelpers.classPrivateFieldLooseBase(this,kt)[kt]()}}function jt(){const t=m.Tag.render($t||($t=Ut`<div style="padding: 20px 20px 0;"></div>`));const e=n.BitrixVue.createApp(ft,{maxWidth:this.getDialog().getWidth()});e.provide("section",this.getOption("section"));e.provide("right",this.getOption("right"));e.mount(t);return t}const Nt={name:"Selector",emits:["apply","close"],props:{initialValues:{type:Set,default:new Set}},inject:["section","right"],data(){return{values:this.initialValues}},dialog:null,computed:{isAllSelected(){return this.values.has(this.right.allSelectedCode)},selectedVariables(){return j(this.right.variables,this.values,this.isAllSelected)},dialogItems(){return T.mapVariables(this.right.variables)},selectedDialogItems(){return this.dialogItems.filter((t=>this.selectedVariables.has(t.id)))}},mounted(){this.showSelector()},beforeUnmount(){var t;(t=this.dialog)==null?void 0:t.hide()},methods:{showSelector(){this.dialog=new r.Dialog({height:400,context:P.VARIABLE,enableSearch:this.right.enableSearch,multiple:true,autoHide:true,hideByEsc:true,dropdownMode:true,compactView:this.right.compactView,showAvatars:this.right.showAvatars,selectedItems:this.selectedDialogItems,searchOptions:{allowCreateItem:false},cacheable:false,events:{"Item:onSelect":this.onItemSelect,"Item:onDeselect":this.onItemDeselect,onHide:this.apply,onDestroy:()=>{this.dialog=null}},entities:[{id:M.VARIABLE}],items:this.dialogItems,header:Dt,headerOptions:{section:this.section,right:this.right},footer:Gt});this.dialog.show()},onItemSelect(t){const e=t.getData().item;this.addValue(String(e.getId()))},onItemDeselect(t){const e=t.getData().item;this.removeValue(String(e.getId()))},addValue(t){const e=m.Runtime.clone(this.values);e.add(t);if(e.size>=this.right.variables.size){this.setValues(new Set([this.right.allSelectedCode]))}else{this.setValues(e)}},removeValue(t){if(this.values.has(this.right.allSelectedCode)){const e=[...this.right.variables.values()].map((t=>t.id));const s=new Set(e);s.delete(t);this.setValues(s)}else{const e=[...this.values].filter((e=>e!==t));this.setValues(new Set(e))}},setValues(t){this.values=t},apply(){this.setNothingSelectedValueIfNeeded();this.$emit("apply",{values:this.values});this.$emit("close")},setNothingSelectedValueIfNeeded(){if(this.values.size<=0){const t=this.$store.getters["accessRights/getNothingSelectedValue"](this.section.sectionCode,this.right.id);for(const e of t){this.addValue(e)}}}},template:`\n\t\t<div></div>\n\t`};const Kt={name:"Multivariables",emits:["close"],components:{Selector:Nt},inject:["section","right"],methods:{apply({values:t}){this.$store.dispatch("userGroups/setAccessRightValuesForShown",{sectionCode:this.section.sectionCode,valueId:this.right.id,values:t})},close(){this.$emit("close")}},template:`\n\t\t<Selector @apply="apply" @close="close"/>\n\t`};const zt="ui-access-rights-v2-row-value-variables";const Jt={name:"Variables",emits:["close"],inject:["section","right"],mounted(){this.showSelector()},beforeUnmount(){this.closeSelector()},methods:{showSelector(){const t=[];for(const e of this.right.variables.values()){t.push({id:e.id,text:e.title,onclick:(t,s)=>{var i;(i=s.getMenuWindow())==null?void 0:i.close();this.setValue(e.id)}})}c.MenuManager.show({id:zt,bindElement:this.$el,items:t,autoHide:true,cacheable:false,events:{onClose:()=>{this.$emit("close")}}})},setValue(t){this.$store.dispatch("userGroups/setAccessRightValuesForShown",{sectionCode:this.section.sectionCode,valueId:this.right.id,values:new Set([t])})},closeSelector(){var t;(t=c.MenuManager.getMenuById(zt))==null?void 0:t.close()}},template:`\n\t\t<div></div>\n\t`};const Xt={name:"SelectedHint",props:{html:{type:String,required:true}},data(){return{isRendered:true}},watch:{html(){this.isRendered=false;void this.$nextTick((()=>{this.isRendered=true}))}},directives:{hint:a.hint},template:`\n\t\t<div v-if="isRendered" v-hint="{\n\t\t\thtml,\n\t\t\tpopupOptions: {\n\t\t\t\toffsetTop: 3,\n\t\t\t},\n\t\t}" data-hint-init="vue">\n\t\t\t<slot/>\n\t\t</div>\n\t`};const qt={name:"DependentVariables",components:{ValuePopup:Pt,PopupContent:Ct,SelectedHint:Xt,SingleRoleTitle:It},props:{value:{type:Object,required:true}},data(){return{isPopupShown:false}},inject:["section","userGroup","right"],computed:{selectedVariables(){return j(this.right.variables,this.value.values,false)},currentAlias(){return this.$store.getters["accessRights/getSelectedVariablesAlias"](this.section.sectionCode,this.value.id,this.value.values)},title(){if(m.Type.isString(this.currentAlias)){return this.currentAlias}if(this.selectedVariables.size<=0){return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ADD")}return N(this.selectedVariables)},hintHtml(){return z(this.selectedVariables,this.hintTitle,this.right.variables)},hintTitle(){if(m.Type.isString(this.right.hintTitle)){return this.right.hintTitle}return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_SELECTED_ITEMS_TITLE")}},methods:{apply({values:t}){this.$store.dispatch("userGroups/setAccessRightValues",{sectionCode:this.section.sectionCode,userGroupId:this.userGroup.id,valueId:this.value.id,values:t})}},template:`\n\t\t<div class='ui-access-rights-v2-column-item-text-link' :class="{\n\t\t\t'ui-access-rights-v2-text-ellipsis': !hintHtml\n\t\t}" @click="isPopupShown = true">\n\t\t\t<SelectedHint v-if="hintHtml" :html="hintHtml">{{title}}</SelectedHint>\n\t\t\t<div v-else :title="title">{{title}}</div>\n\t\t\t<ValuePopup v-if="isPopupShown" @close="isPopupShown = false">\n\t\t\t\t<PopupContent\n\t\t\t\t\t@apply="apply"\n\t\t\t\t\t:initial-values="value.values"\n\t\t\t\t>\n\t\t\t\t\t<template #role-title>\n\t\t\t\t\t\t<SingleRoleTitle :user-group-title="userGroup.title"/>\n\t\t\t\t\t</template>\n\t\t\t\t</PopupContent>\n\t\t\t</ValuePopup>\n\t\t</div>\n\t`};const Wt={name:"Multivariables",components:{SelectedHint:Xt,Selector:Nt},props:{value:{type:Object,required:true}},inject:["section","userGroup","right"],data(){return{isSelectorShown:false}},computed:{isAllSelected(){return this.value.values.has(this.right.allSelectedCode)},selectedVariables(){return j(this.right.variables,this.value.values,this.isAllSelected)},currentAlias(){return this.$store.getters["accessRights/getSelectedVariablesAlias"](this.section.sectionCode,this.value.id,this.value.values)},title(){if(m.Type.isString(this.currentAlias)){return this.currentAlias}if(this.isAllSelected){return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ALL_ACCEPTED")}if(this.selectedVariables.size<=0){return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ADD")}return N(this.selectedVariables)},hintHtml(){return z(this.selectedVariables,this.hintTitle,this.right.variables)},hintTitle(){if(m.Type.isString(this.right.hintTitle)){return this.right.hintTitle}return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_SELECTED_ITEMS_TITLE")}},methods:{showSelector(){this.isSelectorShown=true},setValues({values:t}){this.$store.dispatch("userGroups/setAccessRightValues",{sectionCode:this.section.sectionCode,userGroupId:this.userGroup.id,valueId:this.value.id,values:t})}},template:`\n\t\t<SelectedHint \n\t\t\tv-if="hintHtml"\n\t\t\t:html="hintHtml" \n\t\t\tclass='ui-access-rights-v2-column-item-text-link'\n\t\t\t@click="showSelector"\n\t\t\tv-bind="$attrs"\n\t\t>\n\t\t\t{{ title }}\n\t\t</SelectedHint>\n\t\t<div \n\t\t\tv-else\n\t\t\tclass='ui-access-rights-v2-column-item-text-link ui-access-rights-v2-text-ellipsis'\n\t\t\t@click="showSelector"\n\t\t\t:title="title"\n\t\t\tv-bind="$attrs"\n\t\t>\n\t\t\t{{ title }}\n\t\t</div>\n\t\t<Selector\n\t\t\tv-if="isSelectorShown" \n\t\t\t:initial-values="value.values"\n\t\t\t@close="isSelectorShown = false"\n\t\t\t@apply="setValues"\n\t\t/>\n\t`};const Yt={name:"Toggler",components:{Switcher:l.Switcher},props:{value:{type:Object,required:true}},inject:["section","userGroup"],computed:{isChecked(){return this.value.values.has("1")}},methods:{setValue(t){this.$store.dispatch("userGroups/setAccessRightValues",{userGroupId:this.userGroup.id,sectionCode:this.section.sectionCode,valueId:this.value.id,values:new Set([t])})}},template:`\n\t\t<Switcher\n\t\t\t:is-checked="isChecked"\n\t\t\t@check="setValue('1')"\n\t\t\t@uncheck="setValue('0')"\n\t\t\t:options="{\n\t\t\t\tsize: 'extra-small',\n\t\t\t\tcolor: 'green',\n\t\t\t}"\n\t\t/>\n\t`};const Qt="ui-access-rights-v2-column-item-popup-variables";const Zt={name:"Variables",props:{value:{type:Object,required:true}},inject:["section","userGroup","right"],computed:{emptyVariableId(){const t=this.$store.getters["accessRights/getEmptyValue"](this.section.sectionCode,this.value.id);return t[0]},currentVariableId(){if(this.value.values.size<=0){return this.emptyVariableId}const[t]=this.value.values;return t},currentAlias(){return this.$store.getters["accessRights/getSelectedVariablesAlias"](this.section.sectionCode,this.value.id,this.value.values)},currentVariableTitle(){if(m.Type.isString(this.currentAlias)){return this.currentAlias}const t=this.right.variables.get(this.currentVariableId);if(!t){return this.$Bitrix.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ADD")}return t.title}},methods:{showSelector(t){const e=[];for(const t of this.right.variables.values()){e.push({id:t.id,text:t.title,onclick:(e,s)=>{var i;(i=s.getMenuWindow())==null?void 0:i.close();this.setValue(t.id)}})}c.MenuManager.show({id:Qt,bindElement:t.target,items:e,autoHide:true,cacheable:false})},setValue(t){this.$store.dispatch("userGroups/setAccessRightValues",{sectionCode:this.section.sectionCode,userGroupId:this.userGroup.id,valueId:this.value.id,values:new Set([t])})}},template:`\n\t\t<div\n\t\t\tclass='ui-access-rights-v2-column-item-text-link ui-access-rights-v2-text-ellipsis'\n\t\t\t:title="currentVariableTitle"\n\t\t\t@click="showSelector"\n\t\t>\n\t\t\t{{ currentVariableTitle }}\n\t\t</div>\n\t`};const te=Object.freeze({DependentVariables:qt,Multivariables:Wt,Toggler:Yt,Variables:Zt});const ee=Object.freeze({DependentVariables:Mt,Multivariables:Kt,Variables:Jt});function se(t){const e=L.getValueTypeByRight(t);if(!e){return""}return e.getComponentName()}const ie={name:"ValueCell",components:{CellLayout:_,...te},props:{right:{type:Object,required:true}},inject:["section","userGroup"],provide(){return{right:this.right}},computed:{value(){const t=this.userGroup.accessRights.get(this.right.id);return t||this.$store.getters["userGroups/getEmptyAccessRightValue"](this.userGroup.id,this.section.sectionCode,this.right.id)},cellComponent(){return se(this.right)}},template:`\n\t\t<CellLayout\n\t\t\t:class="{\n\t\t\t\t'ui-access-rights-v2-group-children': right.group,\n\t\t\t\t'--modified': value.isModified\n\t\t\t}"\n\t\t\tv-memo="[userGroup.id, value.values, value.isModified]"\n\t\t>\n\t\t\t<Component\n\t\t\t\t:is="cellComponent"\n\t\t\t\t:value="value"\n\t\t\t\t:data-accessrights-right-id="right.id"\n\t\t\t/>\n\t\t</CellLayout>\n\t`};const oe={name:"Column",components:{ColumnLayout:G,ValueCell:ie,MenuCell:mt},props:{userGroup:{type:Object,required:true},rights:{type:Map,required:true}},provide(){return{userGroup:n.computed((()=>this.userGroup))}},computed:{renderedRights(){const t=new Map;for(const[e,s]of this.rights){if(D(s)){t.set(e,s)}}return t}},template:`\n\t\t<ColumnLayout ref="column">\n\t\t\t<MenuCell/>\n\t\t\t<ValueCell\n\t\t\t\tv-for="[rightId, accessRightItem] in renderedRights"\n\t\t\t\t:key="rightId"\n\t\t\t\t:right="accessRightItem"\n\t\t\t/>\n\t\t</ColumnLayout>\n\t`};const re={name:"ColumnList",components:{Column:oe,SyncHorizontalScroll:O,ColumnLayout:G},props:{userGroups:{type:Map,required:true},rights:{type:Map,required:true}},throttledScrollHandler:null,throttledResizeHandler:null,ears:null,isEarsInited:false,data(){return{isLeftShadowShown:false,isRightShadowShown:false}},created(){this.throttledScrollHandler=m.Runtime.throttle((()=>{this.adjustShadowsVisibility()}),200);this.throttledResizeHandler=m.Runtime.throttle((()=>{this.adjustShadowsVisibility();this.adjustEars()}),200)},mounted(){m.Event.bind(window,"resize",this.throttledResizeHandler);this.adjustShadowsVisibility();this.initEars()},beforeUnmount(){this.destroyEars();m.Event.unbind(window,"resize",this.throttledResizeHandler)},watch:{userGroups(t,e){if(t.size!==e.size){this.adjustShadowsVisibility();this.adjustEars()}}},methods:{calculateShadowsVisibility(){if(!this.$refs["column-container"]){return{isLeftShadowShown:false,isRightShadowShown:false}}const t=this.$refs["column-container"].$el.scrollLeft;const e=t>0;const s=this.$refs["column-container"].$el.offsetWidth;return{isLeftShadowShown:e,isRightShadowShown:this.$refs["column-container"].$el.scrollWidth>Math.round(t+s)}},adjustShadowsVisibility(){requestAnimationFrame((()=>{const{isLeftShadowShown:t,isRightShadowShown:e}=this.calculateShadowsVisibility();this.isLeftShadowShown=t;this.isRightShadowShown=e}))},adjustEars(){if(!this.isEarsInited){return}requestAnimationFrame((()=>{this.ears.toggleEars()}))},initEars(){if(!this.$refs["column-container"]){return}if(this.ears){return}this.ears=new u.Ears({container:this.$refs["column-container"].$el,immediateInit:true,smallSize:true});requestAnimationFrame((()=>{if(!this.ears||!this.$refs["column-container"]){this.ears=null;return}const t=this.$refs["column-container"].$el.scrollLeft;this.ears.init();m.Dom.style(this.ears.getWrapper(),"flex",1);if(t>0){this.$refs["column-container"].$el.scrollLeft=t}this.isEarsInited=true}))},destroyEars(){var t;(t=this.ears)==null?void 0:t.destroy();this.isEarsInited=false;this.ears=null}},template:`\n\t\t<div\n\t\t\tclass='ui-access-rights-v2-section-content'\n\t\t\t:class="{\n\t\t\t\t'ui-access-rights-v2-section-shadow-left-shown': isLeftShadowShown,\n\t\t\t\t'ui-access-rights-v2-section-shadow-right-shown': isRightShadowShown,\n\t\t\t}"\n\t\t>\n\t\t\t<SyncHorizontalScroll\n\t\t\t\tref="column-container"\n\t\t\t\tclass='ui-access-rights-v2-section-wrapper'\n\t\t\t\t@scroll="throttledScrollHandler"\n\t\t\t>\n\t\t\t\t<Column\n\t\t\t\t\tv-for="[groupId, group] in userGroups"\n\t\t\t\t\t:key="groupId"\n\t\t\t\t\t:user-group="group"\n\t\t\t\t\t:rights="rights"\n\t\t\t\t\t:data-accessrights-user-group-id="groupId"\n\t\t\t\t/>\n\t\t\t\t<ColumnLayout/>\n\t\t\t</SyncHorizontalScroll>\n\t\t</div>\n\t`};let ne=t=>t,ae;const le={name:"Hint",props:{html:{type:String,required:true}},computed:{...v.mapState({guid:t=>t.application.guid})},mounted(){this.renderHint()},watch:{html(){m.Dom.clean(this.$refs.container);this.renderHint()}},methods:{renderHint(){const t=m.Tag.render(ae||(ae=ne`<span data-hint-html="true" data-hint-interactivity="true"></span>`));t.setAttribute("data-hint",this.html);m.Dom.append(t,this.$refs.container);this.getHintManager().initNode(t)},getHintManager(){return L.getHint(this.guid)}},template:'<span class="ui-access-rights-v2-hint-container" ref="container"></span>'};const ce={name:"Header",components:{Hint:le,Icon:St},inject:["section"],methods:{toggleSection(){this.$store.dispatch("accessRights/toggleSection",{sectionCode:this.section.sectionCode})},onSectionEventButtonClick(){const t={guid:this.$store.getters["application/guid"],section:this.section};b.EventEmitter.emit("BX.UI.AccessRights.V2:onSectionHeaderClick",t)}},template:`\n\t\t<div\n\t\t\t@click="toggleSection"\n\t\t\tclass='ui-access-rights-v2-section-header'\n\t\t\t:class="{\n\t\t\t\t'--expanded': section.isExpanded,\n\t\t\t}" \n\t\t\tv-memo="[section.isExpanded]"\n\t\t>\n\t\t\t<div class="ui-access-rights-v2-section-header-expander">\n\t\t\t\t<div class='ui-icon-set' :class="{\n\t\t\t\t\t'--chevron-up': section.isExpanded,\n\t\t\t\t\t'--chevron-down': !section.isExpanded,\n\t\t\t\t}"\n\t\t\t\t></div>\n\t\t\t</div>\n\t\t\t<Icon/>\n\t\t\t<span \n\t\t\t\tclass="ui-access-rights-v2-text-ellipsis ui-access-rights-v2-section-title"\n\t\t\t\t:title="section.sectionTitle"\n\t\t\t>{{ section.sectionTitle }}</span>\n\t\t\t<span\n\t\t\t\tv-if="section.sectionSubTitle"\n\t\t\t\tclass="ui-access-rights-v2-text-ellipsis ui-access-rights-v2-section-subtitle"\n\t\t\t\t:title="section.sectionSubTitle"\n\t\t\t>\n\t\t\t\t{{ section.sectionSubTitle }}\n\t\t\t</span>\n\t\t\t<Hint v-if="section.sectionHint" :html="section.sectionHint"/>\n\t\t\t<span \n\t\t\t\tv-if="section.action"\n\t\t\t\tclass="ui-btn ui-btn-light-border ui-btn-xs ui-access-rights-v2-section-action"\n\t\t\t\t@click.stop="onSectionEventButtonClick"\n\t\t\t>{{ section.action.buttonText }}</span>\n\t\t</div>\n\t`};const ue={name:"MenuCell",components:{CellLayout:_},template:`\n\t\t<CellLayout class="ui-access-rights-v2-menu-cell"/>\n\t`};const de={name:"RowValue",components:{...ee},emits:["close"],inject:["right"],computed:{component(){return se(this.right)}},template:`\n\t\t<Component :is="component" @close="$emit('close')" />\n\t`};const he={name:"TitleCell",components:{Hint:le,RowValue:de,RichMenuItem:h.RichMenuItem,RichMenuPopup:h.RichMenuPopup},props:{right:{type:Object,required:true}},inject:["section"],provide(){return{right:this.right}},data(){return{isMenuShown:false,isRowValueShown:false}},computed:{RichMenuItemIcon:()=>h.RichMenuItemIcon,isMinValueSet(){return this.$store.getters["accessRights/isMinValueSet"](this.section.sectionCode,this.right.id)},isMaxValueSet(){return this.$store.getters["accessRights/isMaxValueSet"](this.section.sectionCode,this.right.id)},isRowValueConfigurable(){var t,e;return(t=(e=L.getValueTypeByRight(this.right))==null?void 0:e.isRowValueConfigurable())!=null?t:false},isRightDeletable(){return this.right.isDeletable},rightCellStyle(){return{"margin-left":!this.right.groupHead&&!this.right.group&&!this.right.iconClass?"23px":null,"max-width":this.right.iconClass?"calc(100% - 52px)":"auto"}}},methods:{toggleGroup(){if(!this.right.groupHead){return}this.$store.dispatch("accessRights/toggleGroup",{sectionCode:this.section.sectionCode,groupId:this.right.id})},toggleMenu(){this.isMenuShown=!this.isMenuShown},setMaxValuesForRight(){this.isRowValueShown=false;this.isMenuShown=false;this.$store.dispatch("userGroups/setMaxAccessRightValuesForRight",{sectionCode:this.section.sectionCode,rightId:this.right.id})},setMinValuesForRight(){this.isRowValueShown=false;this.isMenuShown=false;this.$store.dispatch("userGroups/setMinAccessRightValuesForRight",{sectionCode:this.section.sectionCode,rightId:this.right.id})},openRowValue(){this.isMenuShown=false;this.isRowValueShown=true},onRightClick(){const t={guid:this.$store.getters["application/guid"],right:this.right};b.EventEmitter.emit("BX.UI.AccessRights.V2:onRightClick",t)},deleteRight(){this.$store.dispatch("userGroups/deleteRight",{rightId:this.right.id});this.$store.dispatch("accessRights/deleteRight",{sectionCode:this.section.sectionCode,rightId:this.right.id});b.EventEmitter.emit("BX.UI.AccessRights.V2:onRightDelete",{guid:this.$store.getters["application/guid"],right:this.right})}},template:`\n\t\t<div\n\t\t\tclass='ui-access-rights-v2-column-item-text ui-access-rights-v2-column-item-title'\n\t\t\t@click="toggleGroup"\n\t\t\t:style="{\n\t\t\t\tcursor: right.groupHead ? 'pointer' : null,\n\t\t\t}"\n\t\t\tv-memo="[right.isGroupExpanded, right.title, right.subtitle]"\n\t\t\t:data-accessrights-right-id="right.id"\n\t\t>\n\t\t\t<span\n\t\t\t\tv-if="right.groupHead"\n\t\t\t\tclass="ui-icon-set"\n\t\t\t\t:class="{\n\t\t\t\t\t'--minus-in-circle': right.isGroupExpanded,\n\t\t\t\t\t'--plus-in-circle': !right.isGroupExpanded,\n\t\t\t\t}"\n\t\t\t></span>\n\t\t\t<div \n\t\t\t\tv-if="right.iconClass" \n\t\t\t\t:class="right.iconClass"\n\t\t\t\tclass="ui-access-rights-v2-column-item-title-icon"\n\t\t\t><i></i></div>\n\t\t\t<div class="ui-access-rights-v2-column-item-title-block" :style="rightCellStyle">\n\t\t\t\t<span\n\t\t\t\t\tv-if="right.isClickable"\n\t\t\t\t\tclass="ui-access-rights-v2-column-item-title-link ui-access-rights-v2-text-ellipsis"\n\t\t\t\t\t@click="onRightClick"\n\t\t\t\t>\n\t\t\t\t\t{{ right.title }}\n\t\t\t\t\t<Hint v-once v-if="right.hint" :html="right.hint"/>\n\t\t\t\t</span>\n\t\t\t\t<span \n\t\t\t\t\tv-else \n\t\t\t\t\tclass="ui-access-rights-v2-text-wrap"\n\t\t\t\t>\n\t\t\t\t\t{{ right.title }}\n\t\t\t\t\t<Hint v-once v-if="right.hint" :html="right.hint"/>\n\t\t\t\t</span>\n\t\t\t\t<span \n\t\t\t\t\tv-if="right.subtitle" \n\t\t\t\t\tclass="ui-access-rights-v2-column-item-subtitle ui-access-rights-v2-text-ellipsis"\n\t\t\t\t>{{ right.subtitle }}</span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div\n\t\t\tref="icon" \n\t\t\tclass="ui-icon-set --more ui-access-rights-v2-icon-more ui-access-rights-v2-title-column-menu" \n\t\t\t@click="toggleMenu"\n\t\t>\n\t\t\t<RichMenuPopup\n\t\t\t\tv-if="isMenuShown"\n\t\t\t\t@close="isMenuShown = false"\n\t\t\t\t:popup-options="{bindElement: $refs.icon, width: 300}"\n\t\t\t>\n\t\t\t\t<RichMenuItem\n\t\t\t\t\tv-if="isMaxValueSet"\n\t\t\t\t\t:icon="RichMenuItemIcon.check"\n\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS_ROW')"\n\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MAX_ACCESS_RIGHTS_ROW_SUBTITLE')"\n\t\t\t\t\t@click="setMaxValuesForRight"\n\t\t\t\t/>\n\t\t\t\t<RichMenuItem\n\t\t\t\t\tv-if="isMinValueSet"\n\t\t\t\t\t:icon="RichMenuItemIcon['red-lock']"\n\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS_ROW')"\n\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_SET_MIN_ACCESS_RIGHTS_ROW_SUBTITLE')"\n\t\t\t\t\t@click="setMinValuesForRight"\n\t\t\t\t/>\n\t\t\t\t<RichMenuItem\n\t\t\t\t\tv-if="isRowValueConfigurable"\n\t\t\t\t\t:icon="RichMenuItemIcon.settings"\n\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_OPEN_ROW_VALUE')"\n\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_OPEN_ROW_VALUE_SUBTITLE')"\n\t\t\t\t\t@click="openRowValue"\n\t\t\t\t/>\n\t\t\t\t<RichMenuItem\n\t\t\t\t\tv-if="isRightDeletable"\n\t\t\t\t\t:icon="RichMenuItemIcon['trash-bin']"\n\t\t\t\t\t:title="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_DELETE_ROW')"\n\t\t\t\t\t:subtitle="$Bitrix.Loc.getMessage('JS_UI_ACCESSRIGHTS_V2_DELETE_ROW_SUBTITLE')"\n\t\t\t\t\t@click="deleteRight"\n\t\t\t\t/>\n\t\t\t</RichMenuPopup>\n\t\t\t<RowValue v-if="isRowValueShown" @close="isRowValueShown = false"/>\n\t\t</div>\n\t`};const pe={name:"TitleColumn",components:{TitleCell:he,ColumnLayout:G,CellLayout:_,MenuCell:ue},props:{rights:{type:Map,required:true}},computed:{renderedRights(){const t=new Map;for(const[e,s]of this.rights){if(D(s)){t.set(e,s)}}return t}},template:`\n\t\t<ColumnLayout>\n\t\t\t<MenuCell/>\n\t\t\t<CellLayout\n\t\t\t\tv-for="[rightId, accessRightItem] in renderedRights"\n\t\t\t\t:key="rightId"\n\t\t\t\t:class="{\n\t\t\t\t\t'ui-access-rights-v2-group-children': accessRightItem.group,\n\t\t\t\t}"\n\t\t\t>\n\t\t\t\t<TitleCell :right="accessRightItem" />\n\t\t\t</CellLayout>\n\t\t</ColumnLayout>\n\t`};const ge={name:"Section",components:{Column:oe,SyncHorizontalScroll:O,TitleColumn:pe,Header:ce,ColumnList:re},props:{userGroups:{type:Map,required:true},rights:{type:Map,required:true},code:{type:String,required:true},isExpanded:{type:Boolean,required:true},title:{type:String,required:true},subTitle:{type:String},hint:{type:String},icon:{type:Object},action:{type:Object}},provide(){return{section:n.computed((()=>({sectionCode:this.code,sectionTitle:this.title,sectionSubTitle:this.subTitle,sectionIcon:this.icon,sectionHint:this.hint,isExpanded:this.isExpanded,rights:this.rights,action:this.action})))}},template:`\n\t\t<div class="ui-access-rights-v2-section" :data-accessrights-section-code="code">\n\t\t\t<Header/>\n\t\t\t<div v-if="isExpanded" class='ui-access-rights-v2-section-container'>\n\t\t\t\t<div class='ui-access-rights-v2-section-head'>\n\t\t\t\t\t<TitleColumn :rights="rights" />\n\t\t\t\t</div>\n\t\t\t\t<ColumnList :rights="rights" :user-groups="userGroups"/>\n\t\t\t</div>\n\t\t</div>\n\t`};const ve={name:"Grid",components:{Section:ge,Header:$,SearchBox:k},loader:null,computed:{...v.mapState({isSaving:t=>t.application.isSaving,guid:t=>t.application.guid,searchContainerSelector:t=>t.application.options.searchContainerSelector}),...v.mapGetters({shownSections:"accessRights/shown",shownUserGroups:"userGroups/shown"})},mounted(){L.getHint(this.guid).initOwnerDocument(this.$refs.container);b.EventEmitter.subscribe("BX.UI.AccessRights.V2:addRight",this.addRight);b.EventEmitter.subscribe("BX.UI.AccessRights.V2:updateRightTitle",this.updateRightTitle);b.EventEmitter.subscribe("BX.UI.AccessRights.V2:updateRightSubtitle",this.updateRightSubtitle);b.EventEmitter.subscribe("BX.UI.AccessRights.V2:markRightAsModified",this.markRightAsModified)},beforeUnmount(){b.EventEmitter.unsubscribe("BX.UI.AccessRights.V2:addRight",this.addRight);b.EventEmitter.unsubscribe("BX.UI.AccessRights.V2:updateRightTitle",this.updateRightTitle);b.EventEmitter.unsubscribe("BX.UI.AccessRights.V2:updateRightSubtitle",this.updateRightSubtitle);b.EventEmitter.unsubscribe("BX.UI.AccessRights.V2:markRightAsModified",this.markRightAsModified)},methods:{scrollToSection(t){const e=this.$refs.sections.find((e=>e.code===t));if(e){scrollTo({top:m.Dom.getPosition(e.$el).top-155,behavior:"smooth"})}},addRight(t){const{guid:e,sectionCode:s,right:i}=t.data;if(!e){console.warn("ui.accessrights.v2: addRight: application guid should be passed in event data");return}if(e===this.$store.getters["application/guid"]){this.$store.dispatch("accessRights/addRight",{sectionCode:s,right:i})}},updateRightTitle(t){const{guid:e,sectionCode:s,rightId:i,rightTitle:o}=t.data;if(!e){console.warn("ui.accessrights.v2: updateRightTitle: application guid should be passed in event data");return}if(e===this.$store.getters["application/guid"]){this.$store.dispatch("accessRights/updateRightTitle",{sectionCode:s,rightId:i,rightTitle:o})}},updateRightSubtitle(t){const{guid:e,sectionCode:s,rightId:i,rightSubtitle:o}=t.data;if(!e){console.warn("ui.accessrights.v2: updateRightSubtitle: application guid should be passed in event data");return}if(e===this.$store.getters["application/guid"]){this.$store.dispatch("accessRights/updateRightSubtitle",{sectionCode:s,rightId:i,rightSubtitle:o})}},markRightAsModified(t){const{guid:e,sectionCode:s,rightId:i,isModified:o}=t.data;if(!e){console.warn("ui.accessrights.v2: markRightAsModified: application guid should be passed in event data");return}if(e===this.$store.getters["application/guid"]){this.$store.dispatch("accessRights/markRightAsModified",{sectionCode:s,rightId:i,isModified:o})}}},template:`\n\t\t<Teleport v-if="searchContainerSelector" :to="searchContainerSelector">\n\t\t\t<SearchBox/>\n\t\t</Teleport>\n\t\t<div ref="container" class='ui-access-rights-v2' :class="{\n\t\t\t'ui-access-rights-v2-block': isSaving,\n\t\t}">\n\t\t\t<Header :user-groups="shownUserGroups"/>\n\t\t\t<Section\n\t\t\t\tv-for="[sectionCode, accessRightSection] in shownSections"\n\t\t\t\t:key="sectionCode"\n\t\t\t\t:code="accessRightSection.sectionCode"\n\t\t\t\t:is-expanded="accessRightSection.isExpanded"\n\t\t\t\t:title="accessRightSection.sectionTitle"\n\t\t\t\t:sub-title="accessRightSection.sectionSubTitle"\n\t\t\t\t:hint="accessRightSection.sectionHint"\n\t\t\t\t:icon="accessRightSection.sectionIcon"\n\t\t\t\t:rights="accessRightSection.rights"\n\t\t\t\t:action="accessRightSection.action"\n\t\t\t\t:user-groups="shownUserGroups"\n\t\t\t\tref="sections"\n\t\t\t/>\n\t\t</div>\n\t`};var be=babelHelpers.classPrivateFieldLooseKey("store");var me=babelHelpers.classPrivateFieldLooseKey("data");var Se=babelHelpers.classPrivateFieldLooseKey("isEnabled");var fe=babelHelpers.classPrivateFieldLooseKey("isCancelAlreadyRegistered");var ye=babelHelpers.classPrivateFieldLooseKey("analyzeRoles");var Ie=babelHelpers.classPrivateFieldLooseKey("isUserGroupEdited");var Re=babelHelpers.classPrivateFieldLooseKey("getSaveErrorStatus");var Ce=babelHelpers.classPrivateFieldLooseKey("registerRoleCreateEvent");var Le=babelHelpers.classPrivateFieldLooseKey("registerRoleEditEvent");var Pe=babelHelpers.classPrivateFieldLooseKey("registerRoleDeleteEvent");var Me=babelHelpers.classPrivateFieldLooseKey("appendRoleCountView");var we=babelHelpers.classPrivateFieldLooseKey("appendP");class He{constructor(t,e){Object.defineProperty(this,we,{value:Ae});Object.defineProperty(this,Me,{value:Fe});Object.defineProperty(this,Pe,{value:Ge});Object.defineProperty(this,Le,{value:_e});Object.defineProperty(this,Ce,{value:Te});Object.defineProperty(this,Re,{value:Be});Object.defineProperty(this,Ie,{value:Ee});Object.defineProperty(this,ye,{value:Ve});Object.defineProperty(this,be,{writable:true,value:void 0});Object.defineProperty(this,me,{writable:true,value:void 0});Object.defineProperty(this,Se,{writable:true,value:void 0});Object.defineProperty(this,fe,{writable:true,value:false});babelHelpers.classPrivateFieldLooseBase(this,be)[be]=t;babelHelpers.classPrivateFieldLooseBase(this,me)[me]=e;babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]=Object.hasOwn(babelHelpers.classPrivateFieldLooseBase(this,me)[me],"tool")&&Object.hasOwn(babelHelpers.classPrivateFieldLooseBase(this,me)[me],"category")}onSaveAttempt(){if(!babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]){return}const{createdRoles:t,editedRoles:e,deletedRoles:s}=babelHelpers.classPrivateFieldLooseBase(this,ye)[ye]();for(let e=0;e<t;e++){babelHelpers.classPrivateFieldLooseBase(this,Ce)[Ce]("attempt")}for(let t=0;t<e;t++){babelHelpers.classPrivateFieldLooseBase(this,Le)[Le]("attempt")}for(let t=0;t<s;t++){babelHelpers.classPrivateFieldLooseBase(this,Pe)[Pe]("attempt")}}onSaveSuccess(){if(!babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]){return}const{createdRoles:t,editedRoles:e,deletedRoles:s}=babelHelpers.classPrivateFieldLooseBase(this,ye)[ye]();for(let e=0;e<t;e++){babelHelpers.classPrivateFieldLooseBase(this,Ce)[Ce]("success")}for(let t=0;t<e;t++){babelHelpers.classPrivateFieldLooseBase(this,Le)[Le]("success")}for(let t=0;t<s;t++){babelHelpers.classPrivateFieldLooseBase(this,Pe)[Pe]("success")}}onSaveError(t){if(!babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]){return}const e=babelHelpers.classPrivateFieldLooseBase(this,Re)[Re](t);const{createdRoles:s,editedRoles:i,deletedRoles:o}=babelHelpers.classPrivateFieldLooseBase(this,ye)[ye]();for(let t=0;t<s;t++){babelHelpers.classPrivateFieldLooseBase(this,Ce)[Ce](e)}for(let t=0;t<i;t++){babelHelpers.classPrivateFieldLooseBase(this,Le)[Le](e)}for(let t=0;t<o;t++){babelHelpers.classPrivateFieldLooseBase(this,Pe)[Pe](e)}}onCancelChanges(){if(!babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]){return}if(babelHelpers.classPrivateFieldLooseBase(this,fe)[fe]){return}g.sendData({...babelHelpers.classPrivateFieldLooseBase(this,me)[me],event:"settings_cancel"});babelHelpers.classPrivateFieldLooseBase(this,fe)[fe]=true}onCloseWithoutSave(){if(!babelHelpers.classPrivateFieldLooseBase(this,Se)[Se]){return}g.sendData({...babelHelpers.classPrivateFieldLooseBase(this,me)[me],event:"settings_pop_cancel"})}}function Ve(){const t={createdRoles:0,editedRoles:0,deletedRoles:babelHelpers.classPrivateFieldLooseBase(this,be)[be].state.userGroups.deleted.size};for(const e of babelHelpers.classPrivateFieldLooseBase(this,be)[be].state.userGroups.collection.values()){if(e.isNew){t.createdRoles++}else if(babelHelpers.classPrivateFieldLooseBase(this,Ie)[Ie](e)){t.editedRoles++}}return t}function Ee(t){if(t.isModified){return true}for(const e of t.accessRights.values()){if(e.isModified){return true}}return false}function Be(t){if(!m.Type.isArrayFilled(t==null?void 0:t.errors)){return"error"}for(const e of t.errors){if(m.Type.isStringFilled(e==null?void 0:e.code)){return`error_${m.Text.toCamelCase(e.code)}`}}return"error"}function Te(t){const e={...babelHelpers.classPrivateFieldLooseBase(this,me)[me],event:"role_create",status:t};babelHelpers.classPrivateFieldLooseBase(this,Me)[Me](e);g.sendData(e)}function _e(t){const e={...babelHelpers.classPrivateFieldLooseBase(this,me)[me],event:"role_edit",status:t};babelHelpers.classPrivateFieldLooseBase(this,Me)[Me](e);g.sendData(e)}function Ge(t){const e={...babelHelpers.classPrivateFieldLooseBase(this,me)[me],event:"role_delete",status:t};babelHelpers.classPrivateFieldLooseBase(this,Me)[Me](e);g.sendData(e)}function Fe(t){babelHelpers.classPrivateFieldLooseBase(this,we)[we](t,"roleCountView",babelHelpers.classPrivateFieldLooseBase(this,be)[be].getters["userGroups/shown"].size)}function Ae(t,e,s){for(const i of["p1","p2","p3","p4","p5"]){if(!Object.hasOwn(t,i)){t[i]=`${e}_${s}`;return}}}const xe="save";const Oe="ajax";const Ue="data";var $e=babelHelpers.classPrivateFieldLooseKey("guid");var ke=babelHelpers.classPrivateFieldLooseKey("options");class De extends v.BuilderModel{constructor(...t){super(...t);Object.defineProperty(this,$e,{writable:true,value:void 0});Object.defineProperty(this,ke,{writable:true,value:void 0})}getName(){return"application"}setOptions(t){babelHelpers.classPrivateFieldLooseBase(this,ke)[ke]=t;return this}setGuid(t){babelHelpers.classPrivateFieldLooseBase(this,$e)[$e]=t;return this}getState(){return{options:babelHelpers.classPrivateFieldLooseBase(this,ke)[ke],guid:babelHelpers.classPrivateFieldLooseBase(this,$e)[$e],isSaving:false}}getGetters(){return{isMaxVisibleUserGroupsSet:t=>t.options.maxVisibleUserGroups>0,isModified:(t,e,s,i)=>i["userGroups/isModified"]||i["accessRights/isModified"],guid:t=>t.guid}}getMutations(){return{setSaving:(t,e)=>{t.isSaving=Boolean(e)}}}}const je="new~~~";var Ne=babelHelpers.classPrivateFieldLooseKey("initialUserGroups");var Ke=babelHelpers.classPrivateFieldLooseKey("setAccessRightValuesAction");var ze=babelHelpers.classPrivateFieldLooseKey("setAccessRightValuesForShownAction");var Je=babelHelpers.classPrivateFieldLooseKey("setMinAccessRightValuesAction");var Xe=babelHelpers.classPrivateFieldLooseKey("setMinAccessRightValuesInSectionAction");var qe=babelHelpers.classPrivateFieldLooseKey("setMinAccessRightValuesForRight");var We=babelHelpers.classPrivateFieldLooseKey("getMinValueForColumnAction");var Ye=babelHelpers.classPrivateFieldLooseKey("getMinValue");var Qe=babelHelpers.classPrivateFieldLooseKey("setMaxAccessRightValuesAction");var Ze=babelHelpers.classPrivateFieldLooseKey("setMaxAccessRightValuesInSectionAction");var ts=babelHelpers.classPrivateFieldLooseKey("setMaxAccessRightValuesForRight");var es=babelHelpers.classPrivateFieldLooseKey("getMaxValueForColumnAction");var ss=babelHelpers.classPrivateFieldLooseKey("getMaxValue");var is=babelHelpers.classPrivateFieldLooseKey("copySectionValuesAction");var os=babelHelpers.classPrivateFieldLooseKey("setRoleTitleAction");var rs=babelHelpers.classPrivateFieldLooseKey("addMemberAction");var ns=babelHelpers.classPrivateFieldLooseKey("removeMemberAction");var as=babelHelpers.classPrivateFieldLooseKey("copyUserGroupAction");var ls=babelHelpers.classPrivateFieldLooseKey("addUserGroupAction");var cs=babelHelpers.classPrivateFieldLooseKey("removeUserGroupAction");var us=babelHelpers.classPrivateFieldLooseKey("showUserGroupAction");var ds=babelHelpers.classPrivateFieldLooseKey("hideUserGroupAction");var hs=babelHelpers.classPrivateFieldLooseKey("isUserGroupExists");var ps=babelHelpers.classPrivateFieldLooseKey("getUserGroup");var gs=babelHelpers.classPrivateFieldLooseKey("isValueExistsInStructure");var vs=babelHelpers.classPrivateFieldLooseKey("deleteRightAction");var bs=babelHelpers.classPrivateFieldLooseKey("isValueModified");var ms=babelHelpers.classPrivateFieldLooseKey("isSetsEqual");var Ss=babelHelpers.classPrivateFieldLooseKey("isUserGroupModified");class fs extends v.BuilderModel{constructor(...t){super(...t);Object.defineProperty(this,Ss,{value:Js});Object.defineProperty(this,ms,{value:zs});Object.defineProperty(this,bs,{value:Ks});Object.defineProperty(this,vs,{value:Ns});Object.defineProperty(this,gs,{value:js});Object.defineProperty(this,ps,{value:Ds});Object.defineProperty(this,hs,{value:ks});Object.defineProperty(this,ds,{value:$s});Object.defineProperty(this,us,{value:Us});Object.defineProperty(this,cs,{value:Os});Object.defineProperty(this,ls,{value:xs});Object.defineProperty(this,as,{value:As});Object.defineProperty(this,ns,{value:Fs});Object.defineProperty(this,rs,{value:Gs});Object.defineProperty(this,os,{value:_s});Object.defineProperty(this,is,{value:Ts});Object.defineProperty(this,ss,{value:Bs});Object.defineProperty(this,es,{value:Es});Object.defineProperty(this,ts,{value:Vs});Object.defineProperty(this,Ze,{value:Hs});Object.defineProperty(this,Qe,{value:ws});Object.defineProperty(this,Ye,{value:Ms});Object.defineProperty(this,We,{value:Ps});Object.defineProperty(this,qe,{value:Ls});Object.defineProperty(this,Xe,{value:Cs});Object.defineProperty(this,Je,{value:Rs});Object.defineProperty(this,ze,{value:Is});Object.defineProperty(this,Ke,{value:ys});Object.defineProperty(this,Ne,{writable:true,value:new Map})}getName(){return"userGroups"}setInitialUserGroups(t){babelHelpers.classPrivateFieldLooseBase(this,Ne)[Ne]=t;return this}getState(){return{collection:m.Runtime.clone(babelHelpers.classPrivateFieldLooseBase(this,Ne)[Ne]),deleted:new Set}}getElementState(t={}){return{id:`${je}${m.Text.getRandom()}`,isNew:true,isModified:true,isShown:true,title:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_ROLE_NAME"),accessRights:new Map,members:new Map}}getGetters(){return{shown:t=>{const e=new Map;for(const[s,i]of t.collection){if(i.isShown){e.set(s,i)}}return e},getEmptyAccessRightValue:(t,e,s,i)=>(e,s,o)=>{const r=i["accessRights/getEmptyValue"](s,o);return{id:o,values:r,isModified:t.collection.get(e).isNew}},defaultAccessRightValues:(t,e,s)=>{const i=new Map;for(const t of s.accessRights.collection.values()){for(const[e,s]of t.rights){if(m.Type.isNil(s.defaultValue)){continue}i.set(e,{id:e,values:s.defaultValue,isModified:true})}}return i},isModified:t=>{if(t.deleted.size>0){return true}for(const e of t.collection.values()){if(e.isNew||e.isModified){return true}for(const t of e.accessRights.values()){if(t.isModified){return true}}}return false},isMaxVisibleUserGroupsReached:(t,e,s,i)=>{if(!i["application/isMaxVisibleUserGroupsSet"]){return false}return e.shown.size>=s.application.options.maxVisibleUserGroups}}}getActions(){return{setAccessRightValues:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,Ke)[Ke](t,e)},setAccessRightValuesForShown:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,ze)[ze](t,e)},setMinAccessRightValues:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,Je)[Je](t,e)},setMaxAccessRightValues:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,Qe)[Qe](t,e)},setMinAccessRightValuesInSection:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,Xe)[Xe](t,e)},setMaxAccessRightValuesInSection:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,Ze)[Ze](t,e)},setMinAccessRightValuesForRight:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,qe)[qe](t,e)},setMaxAccessRightValuesForRight:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,ts)[ts](t,e)},setRoleTitle:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,os)[os](t,e)},addMember:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,rs)[rs](t,e)},removeMember:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,ns)[ns](t,e)},copyUserGroup:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,as)[as](t,e)},copySectionValues:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,is)[is](t,e)},addUserGroup:t=>{babelHelpers.classPrivateFieldLooseBase(this,ls)[ls](t)},removeUserGroup:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,cs)[cs](t,e)},showUserGroup:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,us)[us](t,e)},hideUserGroup:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,ds)[ds](t,e)},deleteRight:(t,e)=>{babelHelpers.classPrivateFieldLooseBase(this,vs)[vs](t,e)}}}getMutations(){return{setAccessRightValues:(t,{userGroupId:e,valueId:s,values:i,isModified:o})=>{const r=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t,e);const n=r.accessRights.get(s);if(!n){r.accessRights.set(s,{id:s,values:i,isModified:o});return}n.values=i;n.isModified=o},setRoleTitle:(t,{userGroupId:e,title:s})=>{const i=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t,e);i.title=s;i.isModified=babelHelpers.classPrivateFieldLooseBase(this,Ss)[Ss](i)},addMember:(t,{userGroupId:e,accessCode:s,member:i})=>{const o=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t,e);o.members.set(s,i);o.isModified=babelHelpers.classPrivateFieldLooseBase(this,Ss)[Ss](o)},removeMember:(t,{userGroupId:e,accessCode:s})=>{const i=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t,e);i.members.delete(s);i.isModified=babelHelpers.classPrivateFieldLooseBase(this,Ss)[Ss](i)},addUserGroup:(t,{userGroup:e})=>{t.collection.set(e.id,e)},removeUserGroup:(t,{userGroupId:e})=>{t.collection.delete(e)},markUserGroupForDeletion:(t,{userGroupId:e})=>{t.deleted.add(e)},showUserGroup:(t,{userGroupId:e})=>{t.collection.get(e).isShown=true},hideUserGroup:(t,{userGroupId:e})=>{t.collection.get(e).isShown=false},deleteRight:(t,{rightId:e})=>{for(const s of t.collection.values()){if(s.accessRights.get(e)){s.accessRights.delete(e)}}}}}}function ys(t,e){if(!m.Type.isSet(e.values)){console.warn("ui.accessrights.v2: Attempt to set not-Set values",e);return}if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e.userGroupId)){console.warn("ui.accessrights.v2: Attempt to set value to a user group that dont exists",e);return}if(!babelHelpers.classPrivateFieldLooseBase(this,gs)[gs](t,e.sectionCode,e.valueId)){console.warn("ui.accessrights.v2: Attempt to set value to a right that dont exists in structure",e);return}t.commit("setAccessRightValues",{userGroupId:e.userGroupId,valueId:e.valueId,values:e.values,isModified:babelHelpers.classPrivateFieldLooseBase(this,bs)[bs](e.userGroupId,e.valueId,e.values,t.rootGetters["accessRights/getEmptyValue"](e.sectionCode,e.valueId))})}function Is(t,e){for(const s of t.getters.shown.keys()){void t.dispatch("setAccessRightValues",{...e,userGroupId:s})}}function Rs(t,{userGroupId:e}){for(const s of t.rootState.accessRights.collection.keys()){void t.dispatch("setMinAccessRightValuesInSection",{userGroupId:e,sectionCode:s})}void t.dispatch("accessRights/expandAllSections",null,{root:true})}function Cs(t,{userGroupId:e,sectionCode:s}){const i=t.rootState.accessRights.collection.get(s);if(!i){console.warn("ui.accessrights.v2: attempt to set min values in section that dont exists",{sectionCode:s});return}for(const s of i.rights.values()){const o=babelHelpers.classPrivateFieldLooseBase(this,We)[We](s,t.rootGetters["accessRights/getEmptyValue"](i.sectionCode,s.id));if(m.Type.isNil(o)){continue}void t.dispatch("setAccessRightValues",{userGroupId:e,sectionCode:i.sectionCode,valueId:s.id,values:o})}}function Ls(t,{sectionCode:e,rightId:s}){var i;const o=(i=t.rootState.accessRights.collection.get(e))==null?void 0:i.rights.get(s);if(!o){console.warn("ui.accessrights.v2: attempt to set min values for right that dont exists",{sectionCode:e,rightId:s});return}const r=babelHelpers.classPrivateFieldLooseBase(this,Ye)[Ye](o);if(m.Type.isNil(r)){console.warn("ui.accessrights.v2: attempt to set min values for right that dont have min value set",{sectionCode:e,rightId:s});return}void t.dispatch("setAccessRightValuesForShown",{sectionCode:e,valueId:s,values:r})}function Ps(t,e){const s=m.Type.isBoolean(t.setEmptyOnSetMinMaxValueInColumn)&&t.setEmptyOnSetMinMaxValueInColumn;if(s){return e}return babelHelpers.classPrivateFieldLooseBase(this,Ye)[Ye](t)}function Ms(t){var e;return(e=L.getValueTypeByRight(t))==null?void 0:e.getMinValue(t)}function ws(t,{userGroupId:e}){for(const s of t.rootState.accessRights.collection.keys()){void t.dispatch("setMaxAccessRightValuesInSection",{userGroupId:e,sectionCode:s})}void t.dispatch("accessRights/expandAllSections",null,{root:true})}function Hs(t,{userGroupId:e,sectionCode:s}){const i=t.rootState.accessRights.collection.get(s);if(!i){console.warn("ui.accessrights.v2: attempt to set max values in section that dont exists",{sectionCode:s});return}for(const s of i.rights.values()){const o=babelHelpers.classPrivateFieldLooseBase(this,es)[es](s,t.rootGetters["accessRights/getEmptyValue"](i.sectionCode,s.id));if(m.Type.isNil(o)){continue}void t.dispatch("setAccessRightValues",{userGroupId:e,sectionCode:i.sectionCode,valueId:s.id,values:o})}}function Vs(t,{sectionCode:e,rightId:s}){var i;const o=(i=t.rootState.accessRights.collection.get(e))==null?void 0:i.rights.get(s);if(!o){console.warn("ui.accessrights.v2: attempt to set max values for right that dont exists",{sectionCode:e,rightId:s});return}const r=babelHelpers.classPrivateFieldLooseBase(this,ss)[ss](o);if(m.Type.isNil(r)){console.warn("ui.accessrights.v2: attempt to set max values for right that dont have max value set",{sectionCode:e,rightId:s});return}void t.dispatch("setAccessRightValuesForShown",{sectionCode:e,valueId:s,values:r})}function Es(t,e){const s=m.Type.isBoolean(t.setEmptyOnSetMinMaxValueInColumn)&&t.setEmptyOnSetMinMaxValueInColumn;if(s){return e}return babelHelpers.classPrivateFieldLooseBase(this,ss)[ss](t)}function Bs(t){var e;return(e=L.getValueTypeByRight(t))==null?void 0:e.getMaxValue(t)}function Ts(t,e){const s=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t.state,e.srcUserGroupId);if(!s){console.warn("ui.accessrights.v2: Attempt to copy values from user group that dont exists",e);return}const i=t.rootState.accessRights.collection.get(e.sectionCode);if(!i){console.warn("ui.accessrights.v2: Attempt to copy values for section that dont exists",e);return}for(const o of i.rights.keys()){const r=s.accessRights.get(o);if(r){void t.dispatch("setAccessRightValues",{userGroupId:e.dstUserGroupId,sectionCode:i.sectionCode,valueId:r.id,values:r.values})}else{const s=t.rootGetters["accessRights/getEmptyValue"](i.sectionCode,o);void t.dispatch("setAccessRightValues",{userGroupId:e.dstUserGroupId,sectionCode:i.sectionCode,valueId:o,values:s})}}}function _s(t,e){if(!m.Type.isString(e.title)){console.warn("ui.accessrights.v2: Attempt to set role title with something other than string",e);return}if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e.userGroupId)){console.warn("ui.accessrights.v2: Attempt to update user group that dont exists",e);return}t.commit("setRoleTitle",e)}function Gs(t,e){if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e.userGroupId)){console.warn("ui.accessrights.v2: Attempt to add member to a user group that dont exists",e);return}if(!m.Type.isStringFilled(e.accessCode)||!m.Type.isStringFilled(e.member.id)||!m.Type.isStringFilled(e.member.type)||!m.Type.isStringFilled(e.member.name)||!(m.Type.isNil(e.member.avatar)||m.Type.isStringFilled(e.member.avatar))){console.warn("ui.accessrights.v2: Attempt to add member with invalid payload",e);return}t.commit("addMember",e)}function Fs(t,e){if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e.userGroupId)){console.warn("ui.accessrights.v2: Attempt to remove member from a user group that dont exists",e);return}if(!m.Type.isStringFilled(e.accessCode)){console.warn("ui.accessrights.v2: Attempt to remove member with invalid payload",e);return}t.commit("removeMember",e)}function As(t,{userGroupId:e}){const s=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t.state,e);if(!s){console.warn("ui.accessrights.v2: Attempt to copy user group that dont exists",{userGroupId:e});return}const i=this.getElementState();const o={...m.Runtime.clone(s),id:i.id,title:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_COPIED_ROLE_NAME",{"#ORIGINAL#":s.title}),isNew:true,isModified:true,isShown:true};for(const t of o.accessRights.values()){t.isModified=true}t.commit("addUserGroup",{userGroup:o})}function xs(t){const e=this.getElementState();e.accessRights=m.Runtime.clone(t.getters.defaultAccessRightValues);t.commit("addUserGroup",{userGroup:e})}function Os(t,{userGroupId:e}){const s=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t.state,e);if(!s){console.warn("ui.accessrights.v2: Attempt to remove user group that dont exists",{userGroupId:e});return}t.commit("removeUserGroup",{userGroupId:e});if(!s.isNew){t.commit("markUserGroupForDeletion",{userGroupId:e})}}function Us(t,{userGroupId:e}){if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e)){console.warn("ui.accessrights.v2: Attempt to show user group that dont exists",{userGroupId:e});return}t.commit("showUserGroup",{userGroupId:e})}function $s(t,{userGroupId:e}){if(!babelHelpers.classPrivateFieldLooseBase(this,hs)[hs](t,e)){console.warn("ui.accessrights.v2: Attempt to shrink user group that dont exists",{userGroupId:e});return}t.commit("hideUserGroup",{userGroupId:e})}function ks(t,e){const s=babelHelpers.classPrivateFieldLooseBase(this,ps)[ps](t.state,e);return Boolean(s)}function Ds(t,e){return t.collection.get(e)}function js(t,e,s){const i=t.rootState.accessRights.collection.get(e);return i==null?void 0:i.rights.has(s)}function Ns(t,{rightId:e}){t.commit("deleteRight",{rightId:e})}function Ks(t,e,s,i){var o,r;const n=babelHelpers.classPrivateFieldLooseBase(this,Ne)[Ne].get(t);if(!n){return true}const a=(o=(r=n.accessRights.get(e))==null?void 0:r.values)!=null?o:i;return!babelHelpers.classPrivateFieldLooseBase(this,ms)[ms](new Set(a),new Set(s))}function zs(t,e){if(m.Type.isFunction(t.symmetricDifference)){return t.symmetricDifference(e).size===0}if(t.size!==e.size){return false}for(const s of t){if(!e.has(s)){return false}}for(const s of e){if(!t.has(s)){return false}}return true}function Js(t){if(t.isNew){return true}const e=babelHelpers.classPrivateFieldLooseBase(this,Ne)[Ne].get(t.id);if(!e){throw new Error("ui.accessrights.v2: initial user group not found")}if(t.title!==e.title){return true}const s=new Set(e.members.keys());const i=new Set(t.members.keys());return!babelHelpers.classPrivateFieldLooseBase(this,ms)[ms](s,i)}function Xs(t,e,s,i){const o=fs.create().setInitialUserGroups(e);const r=vt.create().setInitialAccessRights(s);const{store:n}=v.Builder.init().addModel(De.create().setOptions(t).setGuid(i)).addModel(r).addModel(o).syncBuild();return{store:n,resetState:()=>{o.clearState();r.clearState();b.EventEmitter.emit("BX.UI.AccessRights.V2:onResetState",{guid:i})},userGroupsModel:o,accessRightsModel:r}}class qs{transform(t,e){const s=[];for(const o of t.values()){for(const t of o.rights.values()){const o={id:t.id,name:t.title,additionalRightData:{}};const r=b.EventEmitter.emit("BX.UI.AccessRights.V2:additionalRightData",{guid:e,right:t});for(const t of r){var i;o.additionalRightData={...o.additionalRightData,...(i=t.getData())==null?void 0:i.additionalRightData}}s.push(o)}}return s}}var Ws=babelHelpers.classPrivateFieldLooseKey("transformAccessCodes");var Ys=babelHelpers.classPrivateFieldLooseKey("transformAccessRightValues");class Qs{constructor(){Object.defineProperty(this,Ys,{value:ti});Object.defineProperty(this,Ws,{value:Zs})}transform(t){const e=[];for(const s of t.values()){e.push({id:s.id.startsWith(je)?"0":s.id,title:s.title,accessCodes:babelHelpers.classPrivateFieldLooseBase(this,Ws)[Ws](s.members),accessRights:babelHelpers.classPrivateFieldLooseBase(this,Ys)[Ys](s)})}return e}shouldBeIncludedInExport(t,e){throw new Error("Not implemented")}}function Zs(t){const e={};for(const[s,i]of t){e[s]=i.type}return e}function ti(t){const e=[];for(const s of t.accessRights.values()){if(!this.shouldBeIncludedInExport(t,s)){continue}for(const t of s.values){e.push({id:s.id,value:t})}}return e}class ei extends Qs{shouldBeIncludedInExport(t,e){return true}}class si extends Qs{shouldBeIncludedInExport(t,e){return t.isNew||e.isModified}}var ii=babelHelpers.classPrivateFieldLooseKey("deepFreeze");class oi{constructor(){Object.defineProperty(this,ii,{value:ri})}transform(t){var e,s,i,o,r,n;return babelHelpers.classPrivateFieldLooseBase(this,ii)[ii]({component:String(t.component),actionSave:m.Type.isStringFilled(t.actionSave)?t.actionSave:xe,mode:m.Type.isStringFilled(t.mode)?t.mode:Oe,bodyType:m.Type.isStringFilled(t.bodyType)?t.bodyType:Ue,additionalSaveParams:m.Type.isPlainObject(t.additionalSaveParams)?t.additionalSaveParams:null,isSaveOnlyChangedRights:m.Type.isBoolean(t.isSaveOnlyChangedRights)?t.isSaveOnlyChangedRights:false,maxVisibleUserGroups:m.Type.isInteger(t.maxVisibleUserGroups)?t.maxVisibleUserGroups:null,searchContainerSelector:m.Type.isStringFilled(t.searchContainerSelector)?t.searchContainerSelector:null,additionalMembersParams:m.Type.isPlainObject(t.additionalMembersParams)?{addUserGroupsProviderTab:Boolean((e=(s=t.additionalMembersParams)==null?void 0:s.addUserGroupsProviderTab)!=null?e:false),addProjectsProviderTab:Boolean((i=(o=t.additionalMembersParams)==null?void 0:o.addProjectsProviderTab)!=null?i:true),addStructureTeamsProviderTab:Boolean((r=(n=t.additionalMembersParams)==null?void 0:n.addStructureTeamsProviderTab)!=null?r:false)}:{addUserGroupsProviderTab:false,addProjectsProviderTab:true,addStructureTeamsProviderTab:false},isSaveAccessRightsList:m.Type.isBoolean(t.isSaveAccessRightsList)?t.isSaveAccessRightsList:false})}}function ri(t){if(m.Type.isObject(t)){Object.values(t).forEach((t=>{babelHelpers.classPrivateFieldLooseBase(this,ii)[ii](t)}));return Object.freeze(t)}return t}var ni=babelHelpers.classPrivateFieldLooseKey("maxVisibleUserGroups");var ai=babelHelpers.classPrivateFieldLooseKey("internalizeExternalGroup");var li=babelHelpers.classPrivateFieldLooseKey("internalizeExternalAccessRightsValue");var ci=babelHelpers.classPrivateFieldLooseKey("internalizeExternalAccessCode");var ui=babelHelpers.classPrivateFieldLooseKey("internalizeExternalMember");class di{constructor(t){Object.defineProperty(this,ui,{value:vi});Object.defineProperty(this,ci,{value:gi});Object.defineProperty(this,li,{value:pi});Object.defineProperty(this,ai,{value:hi});Object.defineProperty(this,ni,{writable:true,value:null});if(m.Type.isInteger(t)){babelHelpers.classPrivateFieldLooseBase(this,ni)[ni]=t}}transform(t){const e=new Map;for(const s of t){const t=babelHelpers.classPrivateFieldLooseBase(this,ai)[ai](s);if(babelHelpers.classPrivateFieldLooseBase(this,ni)[ni]>0&&e.size>=babelHelpers.classPrivateFieldLooseBase(this,ni)[ni]){t.isShown=false}e.set(t.id,t)}return e}}function hi(t){const e={id:String(t.id),isNew:false,isModified:false,isShown:true,title:String(t.title),accessRights:new Map,members:new Map};for(const s of t.accessRights){const t=babelHelpers.classPrivateFieldLooseBase(this,li)[li](s);if(e.accessRights.has(t.id)){for(const s of e.accessRights.get(t.id).values){t.values.add(s)}}e.accessRights.set(t.id,t)}for(const[s,i]of Object.entries(t.members)){const t=babelHelpers.classPrivateFieldLooseBase(this,ci)[ci](s);e.members.set(t,babelHelpers.classPrivateFieldLooseBase(this,ui)[ui](i))}return e}function pi(t){const e=String(t.id);const s={id:e,isModified:false};const i=m.Type.isArray(t.value)?t.value:[t.value];s.values=new Set(i.map((t=>String(t))));return s}function gi(t){let e=String(t);if(/^IU(\d+)$/.test(e)){e=e.replace("IU","U")}return e}function vi(t){return{type:String(t.type),id:String(t.id),name:String(t.name),avatar:m.Type.isStringFilled(t.avatar)?t.avatar:null}}var bi=babelHelpers.classPrivateFieldLooseKey("srcUserGroups");var mi=babelHelpers.classPrivateFieldLooseKey("maxVisibleUserGroups");var Si=babelHelpers.classPrivateFieldLooseKey("ensureThatNoMoreUserGroupsThanMaxIsShown");class fi{constructor(t,e){Object.defineProperty(this,Si,{value:yi});Object.defineProperty(this,bi,{writable:true,value:void 0});Object.defineProperty(this,mi,{writable:true,value:null});babelHelpers.classPrivateFieldLooseBase(this,bi)[bi]=t;if(m.Type.isInteger(e)){babelHelpers.classPrivateFieldLooseBase(this,mi)[mi]=e}}transform(t){for(const[e,s]of t){const t=babelHelpers.classPrivateFieldLooseBase(this,bi)[bi].get(e);if(t){s.isShown=t.isShown}else{s.isShown=true}}if(babelHelpers.classPrivateFieldLooseBase(this,mi)[mi]>0){babelHelpers.classPrivateFieldLooseBase(this,Si)[Si](t)}return t}}function yi(t){let e=0;for(const s of t.values()){if(!s.isShown){continue}e++;if(e>babelHelpers.classPrivateFieldLooseBase(this,mi)[mi]){s.isShown=false}}}var Ii=babelHelpers.classPrivateFieldLooseKey("options");var Ri=babelHelpers.classPrivateFieldLooseKey("renderTo");var Ci=babelHelpers.classPrivateFieldLooseKey("buttonPanel");var Li=babelHelpers.classPrivateFieldLooseKey("guid");var Pi=babelHelpers.classPrivateFieldLooseKey("isUserConfirmedClose");var Mi=babelHelpers.classPrivateFieldLooseKey("handleSliderClose");var wi=babelHelpers.classPrivateFieldLooseKey("app");var Hi=babelHelpers.classPrivateFieldLooseKey("rootComponent");var Vi=babelHelpers.classPrivateFieldLooseKey("store");var Ei=babelHelpers.classPrivateFieldLooseKey("resetState");var Bi=babelHelpers.classPrivateFieldLooseKey("unwatch");var Ti=babelHelpers.classPrivateFieldLooseKey("userGroupsModel");var _i=babelHelpers.classPrivateFieldLooseKey("accessRightsModel");var Gi=babelHelpers.classPrivateFieldLooseKey("analyticsManager");var Fi=babelHelpers.classPrivateFieldLooseKey("bindEvents");var Ai=babelHelpers.classPrivateFieldLooseKey("unbindEvents");var xi=babelHelpers.classPrivateFieldLooseKey("tryShowFeaturePromoter");var Oi=babelHelpers.classPrivateFieldLooseKey("showNotification");var Ui=babelHelpers.classPrivateFieldLooseKey("runSaveAjaxRequest");var $i=babelHelpers.classPrivateFieldLooseKey("confirmBeforeClosingModifiedSlider");class ki{constructor(t){Object.defineProperty(this,$i,{value:Ji});Object.defineProperty(this,Ui,{value:zi});Object.defineProperty(this,Oi,{value:Ki});Object.defineProperty(this,xi,{value:Ni});Object.defineProperty(this,Ai,{value:ji});Object.defineProperty(this,Fi,{value:Di});Object.defineProperty(this,Ii,{writable:true,value:{}});Object.defineProperty(this,Ri,{writable:true,value:void 0});Object.defineProperty(this,Ci,{writable:true,value:void 0});Object.defineProperty(this,Li,{writable:true,value:void 0});Object.defineProperty(this,Pi,{writable:true,value:false});Object.defineProperty(this,Mi,{writable:true,value:void 0});Object.defineProperty(this,wi,{writable:true,value:void 0});Object.defineProperty(this,Hi,{writable:true,value:void 0});Object.defineProperty(this,Vi,{writable:true,value:void 0});Object.defineProperty(this,Ei,{writable:true,value:void 0});Object.defineProperty(this,Bi,{writable:true,value:void 0});Object.defineProperty(this,Ti,{writable:true,value:void 0});Object.defineProperty(this,_i,{writable:true,value:void 0});Object.defineProperty(this,Gi,{writable:true,value:void 0});babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii]=t||{};babelHelpers.classPrivateFieldLooseBase(this,Ri)[Ri]=babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii].renderTo;babelHelpers.classPrivateFieldLooseBase(this,Ci)[Ci]=BX.UI.ButtonPanel||null;babelHelpers.classPrivateFieldLooseBase(this,Li)[Li]=m.Text.getRandom(16);babelHelpers.classPrivateFieldLooseBase(this,Fi)[Fi]()}fireEventReset(){const t=e.MessageBox.create({message:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CANCEL_WARNING"),modal:true,buttons:[new i.Button({color:i.ButtonColor.PRIMARY,size:i.ButtonSize.SMALL,text:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CANCEL_YES_CANCEL"),onclick:()=>{babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi].onCancelChanges();babelHelpers.classPrivateFieldLooseBase(this,Ei)[Ei]();t.close()}}),new i.Button({color:i.ButtonColor.LINK,size:i.ButtonSize.SMALL,text:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CANCEL_NO_CANCEL"),onclick:()=>{t.close()}})]});t.show()}sendActionRequest(){return new Promise(((t,e)=>{if(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.isSaving||!babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].getters["application/isModified"]){t();return}babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].commit("application/setSaving",true);babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi].onSaveAttempt();babelHelpers.classPrivateFieldLooseBase(this,Ui)[Ui]().then((({userGroups:t,accessRights:e})=>{babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi].onSaveSuccess();babelHelpers.classPrivateFieldLooseBase(this,Ti)[Ti].setInitialUserGroups(t);if(e){babelHelpers.classPrivateFieldLooseBase(this,_i)[_i].setInitialAccessRights(e)}const s=babelHelpers.classPrivateFieldLooseBase(this,Li)[Li];b.EventEmitter.emit("BX.UI.AccessRights.V2:afterSave",{userGroups:t,accessRights:e,guid:s});babelHelpers.classPrivateFieldLooseBase(this,Ei)[Ei]();babelHelpers.classPrivateFieldLooseBase(this,Oi)[Oi](m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_SETTINGS_HAVE_BEEN_SAVED"))})).catch((t=>{var s,i;babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi].onSaveError(t);console.warn("ui.accessrights.v2: error during save",t);if(babelHelpers.classPrivateFieldLooseBase(this,xi)[xi](t)){e(t);return}babelHelpers.classPrivateFieldLooseBase(this,Oi)[Oi]((t==null?void 0:(s=t.errors)==null?void 0:(i=s[0])==null?void 0:i.message)||"Something went wrong");b.EventEmitter.emit("ui:accessRights:v2:onSaveError",{response:t});e(t)})).finally((()=>{var e;const s=(e=babelHelpers.classPrivateFieldLooseBase(this,Ci)[Ci])==null?void 0:e.getContainer().querySelector(".ui-btn-wait");m.Dom.removeClass(s,"ui-btn-wait");babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].commit("application/setSaving",false);t()}))}))}draw(){const t=(new oi).transform(babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii]);const{store:e,resetState:s,userGroupsModel:i,accessRightsModel:o}=Xs(t,new di(t.maxVisibleUserGroups).transform(babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii].userGroups),(new rt).transform(babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii].accessRights),babelHelpers.classPrivateFieldLooseBase(this,Li)[Li]);babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi]=e;babelHelpers.classPrivateFieldLooseBase(this,Ei)[Ei]=s;babelHelpers.classPrivateFieldLooseBase(this,Ti)[Ti]=i;babelHelpers.classPrivateFieldLooseBase(this,_i)[_i]=o;babelHelpers.classPrivateFieldLooseBase(this,Bi)[Bi]=babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].watch(((t,e)=>e["application/isModified"]),(t=>{if(t){var e;(e=babelHelpers.classPrivateFieldLooseBase(this,Ci)[Ci])==null?void 0:e.show()}else{var s;(s=babelHelpers.classPrivateFieldLooseBase(this,Ci)[Ci])==null?void 0:s.hide()}}));babelHelpers.classPrivateFieldLooseBase(this,wi)[wi]=n.BitrixVue.createApp(ve);babelHelpers.classPrivateFieldLooseBase(this,wi)[wi].use(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi]);m.Dom.clean(babelHelpers.classPrivateFieldLooseBase(this,Ri)[Ri]);babelHelpers.classPrivateFieldLooseBase(this,Hi)[Hi]=babelHelpers.classPrivateFieldLooseBase(this,wi)[wi].mount(babelHelpers.classPrivateFieldLooseBase(this,Ri)[Ri]);babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi]=new He(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi],babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii].analytics)}destroy(){babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi]=null;babelHelpers.classPrivateFieldLooseBase(this,wi)[wi].unmount();babelHelpers.classPrivateFieldLooseBase(this,wi)[wi]=null;babelHelpers.classPrivateFieldLooseBase(this,Ai)[Ai]();babelHelpers.classPrivateFieldLooseBase(this,Bi)[Bi]();babelHelpers.classPrivateFieldLooseBase(this,Bi)[Bi]=null;babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi]=null;babelHelpers.classPrivateFieldLooseBase(this,Ei)[Ei]=null;babelHelpers.classPrivateFieldLooseBase(this,Ti)[Ti]=null;babelHelpers.classPrivateFieldLooseBase(this,Ii)[Ii]=null;babelHelpers.classPrivateFieldLooseBase(this,Ci)[Ci]=null;m.Dom.clean(babelHelpers.classPrivateFieldLooseBase(this,Ri)[Ri]);babelHelpers.classPrivateFieldLooseBase(this,Ri)[Ri]=null}hasUnsavedChanges(){return!(!babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].getters["application/isModified"]||babelHelpers.classPrivateFieldLooseBase(this,Pi)[Pi])}scrollToSection(t){babelHelpers.classPrivateFieldLooseBase(this,Hi)[Hi].scrollToSection(t)}getGuid(){return babelHelpers.classPrivateFieldLooseBase(this,Li)[Li]}}function Di(){babelHelpers.classPrivateFieldLooseBase(this,Mi)[Mi]=t=>{var e,s;const[i]=t.getData();const o=((e=BX.SidePanel)==null?void 0:(s=e.Instance)==null?void 0:s.getSliderByWindow(window))===(i==null?void 0:i.getSlider());if(!o){return}babelHelpers.classPrivateFieldLooseBase(this,$i)[$i](i)};b.EventEmitter.subscribe("SidePanel.Slider:onClose",babelHelpers.classPrivateFieldLooseBase(this,Mi)[Mi])}function ji(){b.EventEmitter.unsubscribe("SidePanel.Slider:onClose",babelHelpers.classPrivateFieldLooseBase(this,Mi)[Mi]);babelHelpers.classPrivateFieldLooseBase(this,Mi)[Mi]=null}function Ni(t){if(!m.Type.isArrayFilled(t==null?void 0:t.errors)){return false}for(const s of t.errors){var e;if(m.Type.isStringFilled(s==null?void 0:(e=s.customData)==null?void 0:e.sliderCode)){m.Runtime.loadExtension("ui.info-helper").then((({FeaturePromotersRegistry:t})=>{t.getPromoter({code:s.customData.sliderCode}).show()})).catch((t=>{console.error("ui.accessrights.v2: could not load ui.info-helper",t)}));return true}}return false}function Ki(t){BX.UI.Notification.Center.notify({content:t,position:"top-right",autoHideDelay:3e3})}function zi(){const t=babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.userGroups.collection;let e=null;if(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.isSaveOnlyChangedRights){e=(new si).transform(t)}else{e=(new ei).transform(t)}const s=babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.bodyType;let i=null;let o=null;if(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.isSaveAccessRightsList){i=(new qs).transform(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.accessRights.collection,babelHelpers.classPrivateFieldLooseBase(this,Li)[Li]);o=[...babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.accessRights.deleted.values()]}return new Promise(((r,n)=>{m.ajax.runComponentAction(babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.component,babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.actionSave,{mode:babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.mode,[s]:{userGroups:e,deletedUserGroups:[...babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.userGroups.deleted.values()],parameters:babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.additionalSaveParams,accessRights:i,deletedAccessRights:o}}).then((e=>{const s=babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].state.application.options.maxVisibleUserGroups;const i=new di(s).transform(e.data.USER_GROUPS);new fi(t,s).transform(i);let o=null;if(e.data.ACCESS_RIGHTS){o=(new rt).transform(e.data.ACCESS_RIGHTS)}r({userGroups:i,accessRights:o})})).catch(n)}))}function Ji(t){if(!babelHelpers.classPrivateFieldLooseBase(this,Vi)[Vi].getters["application/isModified"]||babelHelpers.classPrivateFieldLooseBase(this,Pi)[Pi]){return}t.denyAction();const s=e.MessageBox.create({mediumButtonSize:false,title:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CLOSE_WARNING_TITLE"),message:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CLOSE_WARNING"),modal:true,buttons:[new i.Button({color:i.ButtonColor.PRIMARY,size:i.ButtonSize.SMALL,text:m.Loc.getMessage("JS_UI_ACCESSRIGHTS_V2_MODIFIED_CLOSE_YES_CLOSE"),onclick:()=>{babelHelpers.classPrivateFieldLooseBase(this,Gi)[Gi].onCloseWithoutSave();babelHelpers.classPrivateFieldLooseBase(this,Pi)[Pi]=true;s.close();setTimeout((()=>{t.getSlider().close()}))}}),new i.CancelButton({size:i.ButtonSize.SMALL,onclick:()=>{s.close()}})]});s.show()}t.App=ki})(this.BX.UI.AccessRights.V2=this.BX.UI.AccessRights.V2||{},BX.UI.Dialogs,BX.UI.IconSet,BX.UI,BX.UI.Vue3.Components,BX.UI.EntitySelector,BX.Vue3,BX.Vue3.Directives,BX.UI.Vue3.Components,BX.Main,BX.UI,BX,BX.UI.Vue3.Components,BX,BX.UI.Analytics,BX.Vue3.Vuex,BX.Event,BX);
//# sourceMappingURL=v2.bundle.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit