{"version":3,"sources":["webpack:////build/source/ee/app/assets/javascripts/merge_requests/queries/approval_summary.query.graphql","webpack:////build/source/node_modules/lodash/_baseAggregator.js","webpack:////build/source/node_modules/lodash/groupBy.js","webpack:////build/source/ee/app/assets/javascripts/vue_merge_request_widget/mappers.js","webpack:///./lib/utils/grammar.js","webpack:////build/source/ee/app/assets/javascripts/merge_requests/queries/approval_summary.subscription.graphql","webpack:////build/source/node_modules/lodash/_arrayAggregator.js","webpack:////build/source/ee/app/assets/javascripts/approvals/constants.js","webpack:////build/source/node_modules/lodash/_createAggregator.js","webpack:////build/source/ee/app/assets/javascripts/merge_requests/components/reviewers/approval_summary.vue","webpack:////build/source/ee/app/assets/javascripts/merge_requests/components/reviewers/approval_summary.vue?3e32","webpack:///../../../ee/app/assets/javascripts/merge_requests/components/reviewers/approval_summary.vue","webpack:////build/source/ee/app/assets/javascripts/merge_requests/components/reviewers/approval_summary.vue?c345"],"names":["doc","loc","source","definitionRefs","findOperation","name","i","definitions","length","element","value","forEach","def","refs","Set","collectFragmentReferences","node","kind","add","type","selectionSet","selections","selection","variableDefinitions","module","exports","operationName","newDoc","hasOwnProperty","opRefs","allRefs","newRefs","refName","size","prevRefs","has","childRef","op","push","oneQuery","baseEach","collection","setter","iteratee","accumulator","key","baseAssignValue","createAggregator","Object","prototype","groupBy","result","call","getApprovalRuleNamesLeft","multipleApprovalRulesAvailable","rules","rulesLeft","_groupBy","x","_x$type","rule_type","toLowerCase","RULE_TYPE_ANY_APPROVER","__","RULE_TYPE_REGULAR","map","filter","RULE_TYPE_REPORT_APPROVER","RULE_TYPE_CODE_OWNER","toNounSeriesText","items","onlyCommas","sprintf","s__","item","reduce","nextItem","idx","lastItem","firstItem","array","index","TYPE_USER","TYPE_GROUP","TYPE_HIDDEN_GROUPS","RULE_TYPE_FALLBACK","RULE_NAME_ANY_APPROVER","COVERAGE_CHECK_NAME","APPROVAL_RULE_CONFIGS","title","popoverText","documentationText","reportType","APPROVAL_SETTINGS_I18N","learnMore","approvalSettingsHeader","approvalSettingsDescription","saveChanges","loadingErrorMessage","savingErrorMessage","savingSuccessMessage","lockedByAdmin","lockedByGroupOwner","PROJECT_APPROVAL_SETTINGS_LABELS_I18N","authorApprovalLabel","preventMrApprovalRuleEditLabel","preventCommittersApprovalLabel","requireUserPasswordLabel","whenCommitAddedLabel","keepApprovalsLabel","removeApprovalsOnPushLabel","selectiveCodeOwnerRemovalsLabel","GROUP_APPROVAL_SETTINGS_LABELS_I18N","APPROVAL_DIALOG_I18N","form","approvalsRequiredLabel","approvalTypeLabel","approversLabel","nameLabel","nameDescription","protectedBranchLabel","protectedBranchDescription","validations","approvalsRequiredNegativeNumber","approvalsRequiredNotNumber","approvalsRequiredMinimum","approversRequired","branchesRequired","ruleNameTaken","ruleNameMissing","ruleNameTooLong","MR_APPROVALS_PROMO_DISMISSED","MR_APPROVALS_PROMO_TRACKING_EVENTS","learnMoreClick","action","label","tryNowClick","collapsePromo","expandPromo","MR_APPROVALS_PROMO_I18N","accordionTitle","promoTitle","summary","tryNow","valueStatements","DROPDOWN_OPTION_PROJECT_GROUPS","TABLE_HEADERS","members","approvalsRequired","branches","actions","arrayAggregator","baseAggregator","baseIteratee","isArray","initializer","func","apollo","mergeRequest","query","approvalSummaryQuery","variables","projectPath","iid","issuableIid","update","data","_data$project","project","subscribeToMore","document","approvalSummarySubscription","issuableId","convertToGraphQLId","TYPENAME_MERGE_REQUEST","updateQuery","_","subscriptionData","mergeRequestApprovalStateUpdated","queryResult","inject","props","hideIfOptional","Boolean","required","default","shortText","computed","isLoading","_this$$apollo","$apollo","queries","loading","approvalsOptional","approvedBy","nodes","approvalsLeft","_this$mergeRequest$ap","approvalState","r","approved","approvalsLeftMessage","n__","names","count","component","_vm","this","_c","_self","staticClass","_v","_s","_t","_e"],"mappings":"4EACI,IAAIA,EAAM,CAAC,KAAO,WAAW,YAAc,CAAC,CAAC,KAAO,sBAAsB,UAAY,QAAQ,KAAO,CAAC,KAAO,OAAO,MAAQ,mBA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QAAA,IAAAW,QAAA,SAAAqI,GAAA,OAAAA,EAAAC,cAGAC,uBACA,YAAAR,kBACAxH,cAAA,iCAGA,KAAAqF,aAAA0C,SACAzI,aAAA,gCAGA,KAAAP,UAAAhD,SAAA,KAAAkL,UACAlH,kBACAkI,cACA,4CACA,6CACA,KAAAN,eAEA,CACAO,MAAAtI,YAAA,KAAAb,WACAoJ,MAAA,KAAAR,gBAEA,GAIA,KAAAV,UACAgB,cAAA,oDAAAN,eAGAM,cACA,4CACA,6CACA,KAAAN,kB,YCtGIS,EAAY,YACd,GHRW,WAAkB,IAAIC,EAAIC,KAAKC,EAAGF,EAAIG,MAAMD,GAAG,OAAOA,EAAG,MAAM,CAACE,YAAY,2BAA2B,CAAEJ,EAAIlB,UAAWoB,EAAG,MAAM,CAACE,YAAY,gEAAiEJ,EAAIhD,cAAgBgD,EAAIxJ,+BAAgC,CAAC0J,EAAG,IAAI,CAACE,YAAY,qDAAqD,CAACJ,EAAIK,GAAG,WAAWL,EAAIM,GAAGN,EAAIL,sBAAsB,YAAYK,EAAIK,GAAG,KAAKL,EAAIO,GAAG,YAAYP,EAAIQ,MAAM,KAEjb,IGSpB,EACA,KACA,KACA,MAIa,UAAAT,E","file":"331.908f9aca.chunk.js","sourcesContent":["\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"query\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalSummary\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"projectPath\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"ID\"}}},\"directives\":[]},{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"String\"}}},\"directives\":[]}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"project\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"fullPath\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"projectPath\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"mergeRequest\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"iid\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approved\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsLeft\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsRequired\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvedBy\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalState\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"rules\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approved\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsRequired\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":423}};\n doc.loc.source = {\"body\":\"query approvalSummary($projectPath: ID!, $iid: String!) {\\n project(fullPath: $projectPath) {\\n id\\n mergeRequest(iid: $iid) {\\n id\\n approved\\n approvalsLeft\\n approvalsRequired\\n approvedBy {\\n nodes {\\n id\\n }\\n }\\n approvalState {\\n rules {\\n id\\n approved\\n approvalsRequired\\n name\\n type\\n }\\n }\\n }\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n // Collect any fragment/type references from a node, adding them to the refs Set\n function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }\n\n var definitionRefs = {};\n (function extractReferences() {\n doc.definitions.forEach(function(def) {\n if (def.name) {\n var refs = new Set();\n collectFragmentReferences(def, refs);\n definitionRefs[def.name.value] = refs;\n }\n });\n })();\n\n function findOperation(doc, name) {\n for (var i = 0; i < doc.definitions.length; i++) {\n var element = doc.definitions[i];\n if (element.name && element.name.value == name) {\n return element;\n }\n }\n }\n\n function oneQuery(doc, operationName) {\n // Copy the DocumentNode, but clear out the definitions\n var newDoc = {\n kind: doc.kind,\n definitions: [findOperation(doc, operationName)]\n };\n if (doc.hasOwnProperty(\"loc\")) {\n newDoc.loc = doc.loc;\n }\n\n // Now, for the operation we're running, find any fragments referenced by\n // it or the fragments it references\n var opRefs = definitionRefs[operationName] || new Set();\n var allRefs = new Set();\n var newRefs = new Set();\n\n // IE 11 doesn't support \"new Set(iterable)\", so we add the members of opRefs to newRefs one by one\n opRefs.forEach(function(refName) {\n newRefs.add(refName);\n });\n\n while (newRefs.size > 0) {\n var prevRefs = newRefs;\n newRefs = new Set();\n\n prevRefs.forEach(function(refName) {\n if (!allRefs.has(refName)) {\n allRefs.add(refName);\n var childRefs = definitionRefs[refName] || new Set();\n childRefs.forEach(function(childRef) {\n newRefs.add(childRef);\n });\n }\n });\n }\n\n allRefs.forEach(function(refName) {\n var op = findOperation(doc, refName);\n if (op) {\n newDoc.definitions.push(op);\n }\n });\n\n return newDoc;\n }\n \n module.exports = doc;\n \n module.exports[\"approvalSummary\"] = oneQuery(doc, \"approvalSummary\");\n \n","var baseEach = require('./_baseEach');\n\n/**\n * Aggregates elements of `collection` on `accumulator` with keys transformed\n * by `iteratee` and values set by `setter`.\n *\n * @private\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction baseAggregator(collection, setter, iteratee, accumulator) {\n baseEach(collection, function(value, key, collection) {\n setter(accumulator, value, iteratee(value), collection);\n });\n return accumulator;\n}\n\nmodule.exports = baseAggregator;\n","var baseAssignValue = require('./_baseAssignValue'),\n createAggregator = require('./_createAggregator');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an object composed of keys generated from the results of running\n * each element of `collection` thru `iteratee`. The order of grouped values\n * is determined by the order they occur in `collection`. The corresponding\n * value of each key is an array of elements responsible for generating the\n * key. The iteratee is invoked with one argument: (value).\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Collection\n * @param {Array|Object} collection The collection to iterate over.\n * @param {Function} [iteratee=_.identity] The iteratee to transform keys.\n * @returns {Object} Returns the composed aggregate object.\n * @example\n *\n * _.groupBy([6.1, 4.2, 6.3], Math.floor);\n * // => { '4': [4.2], '6': [6.1, 6.3] }\n *\n * // The `_.property` iteratee shorthand.\n * _.groupBy(['one', 'two', 'three'], 'length');\n * // => { '3': ['one', 'two'], '5': ['three'] }\n */\nvar groupBy = createAggregator(function(result, value, key) {\n if (hasOwnProperty.call(result, key)) {\n result[key].push(value);\n } else {\n baseAssignValue(result, key, [value]);\n }\n});\n\nmodule.exports = groupBy;\n","import { groupBy } from 'lodash';\nimport {\n RULE_TYPE_REGULAR,\n RULE_TYPE_FALLBACK,\n RULE_TYPE_CODE_OWNER,\n RULE_TYPE_REPORT_APPROVER,\n RULE_TYPE_ANY_APPROVER,\n} from 'ee/approvals/constants';\nimport { __ } from '~/locale';\n\nfunction mapApprovalRule(rule, settings) {\n if (rule.rule_type === RULE_TYPE_FALLBACK) {\n // Show a friendly name for the fallback rule\n return {\n ...rule,\n name: __('All Members'),\n fallback: true,\n };\n }\n if (rule.rule_type === RULE_TYPE_REGULAR && !settings.multiple_approval_rules_available) {\n // Give a friendly name to the single rule\n return {\n ...rule,\n name: __('Merge Request'),\n };\n }\n\n return rule;\n}\n\nexport function getApprovalRuleNamesLeft(multipleApprovalRulesAvailable, rules) {\n if (!multipleApprovalRulesAvailable) {\n return [];\n }\n\n const rulesLeft = groupBy(rules, (x) => x.rule_type || x.type?.toLowerCase());\n\n const anyApprover = rulesLeft[RULE_TYPE_ANY_APPROVER] ? [__('eligible users')] : [];\n\n // Filter out empty names (fallback rule has no name) because the empties would look weird.\n const regularRules = (rulesLeft[RULE_TYPE_REGULAR] || []).map((x) => x.name).filter((x) => x);\n\n // Report Approvals\n const reportApprovalRules = (rulesLeft[RULE_TYPE_REPORT_APPROVER] || []).map((x) => x.name);\n\n // If there are code owners that need to approve, only mention that once.\n // As the names of code owner rules are patterns that don't mean much out of context.\n const codeOwnerRules = rulesLeft[RULE_TYPE_CODE_OWNER] ? [__('Code Owners')] : [];\n\n return [...anyApprover, ...regularRules, ...reportApprovalRules, ...codeOwnerRules];\n}\n\n/**\n * Map the approval rules response for use by the MR widget\n */\nexport function mapApprovalRulesResponse(rules, settings) {\n return rules.map((x) => mapApprovalRule(x, settings));\n}\n\n/**\n * Map the overall approvals response for use by the MR widget\n */\nexport function mapApprovalsResponse(data) {\n return {\n ...data,\n approvalRuleNamesLeft: getApprovalRuleNamesLeft(\n data.multiple_approval_rules_available,\n data.approval_rules_left,\n ),\n };\n}\n","import { sprintf, s__ } from '~/locale';\n\n/**\n * Combines each given item into a noun series sentence fragment. It does this\n * in a way that supports i18n by giving context and punctuation to the locale\n * functions.\n *\n * **Examples:**\n *\n * - `[\"A\", \"B\"] => \"A and B\"`\n * - `[\"A\", \"B\", \"C\"] => \"A, B, and C\"`\n *\n * **Why only nouns?**\n *\n * Some languages need a bit more context to translate other series.\n *\n * @param {String[]} items\n */\nexport const toNounSeriesText = (items, { onlyCommas = false } = {}) => {\n if (items.length === 0) {\n return '';\n }\n if (items.length === 1) {\n return sprintf(s__(`nounSeries|%{item}`), { item: items[0] }, false);\n }\n if (items.length === 2 && !onlyCommas) {\n return sprintf(\n s__('nounSeries|%{firstItem} and %{lastItem}'),\n {\n firstItem: items[0],\n lastItem: items[1],\n },\n false,\n );\n }\n\n return items.reduce((item, nextItem, idx) =>\n idx === items.length - 1 && !onlyCommas\n ? sprintf(s__('nounSeries|%{item}, and %{lastItem}'), { item, lastItem: nextItem }, false)\n : sprintf(s__('nounSeries|%{item}, %{nextItem}'), { item, nextItem }, false),\n );\n};\n\nexport default {\n toNounSeriesText,\n};\n","\n var doc = {\"kind\":\"Document\",\"definitions\":[{\"kind\":\"OperationDefinition\",\"operation\":\"subscription\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalSummarySubscription\"},\"variableDefinitions\":[{\"kind\":\"VariableDefinition\",\"variable\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"issuableId\"}},\"type\":{\"kind\":\"NonNullType\",\"type\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"IssuableID\"}}},\"directives\":[]}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"mergeRequestApprovalStateUpdated\"},\"arguments\":[{\"kind\":\"Argument\",\"name\":{\"kind\":\"Name\",\"value\":\"issuableId\"},\"value\":{\"kind\":\"Variable\",\"name\":{\"kind\":\"Name\",\"value\":\"issuableId\"}}}],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"InlineFragment\",\"typeCondition\":{\"kind\":\"NamedType\",\"name\":{\"kind\":\"Name\",\"value\":\"MergeRequest\"}},\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approved\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsLeft\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsRequired\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvedBy\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"nodes\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]}]}}]}},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalState\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"rules\"},\"arguments\":[],\"directives\":[],\"selectionSet\":{\"kind\":\"SelectionSet\",\"selections\":[{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"id\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approved\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"approvalsRequired\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"name\"},\"arguments\":[],\"directives\":[]},{\"kind\":\"Field\",\"name\":{\"kind\":\"Name\",\"value\":\"type\"},\"arguments\":[],\"directives\":[]}]}}]}}]}}]}}]}}],\"loc\":{\"start\":0,\"end\":449}};\n doc.loc.source = {\"body\":\"subscription approvalSummarySubscription($issuableId: IssuableID!) {\\n mergeRequestApprovalStateUpdated(issuableId: $issuableId) {\\n ... on MergeRequest {\\n id\\n approved\\n approvalsLeft\\n approvalsRequired\\n approvedBy {\\n nodes {\\n id\\n }\\n }\\n approvalState {\\n rules {\\n id\\n approved\\n approvalsRequired\\n name\\n type\\n }\\n }\\n }\\n }\\n}\\n\",\"name\":\"GraphQL request\",\"locationOffset\":{\"line\":1,\"column\":1}};\n \n\n var names = {};\n function unique(defs) {\n return defs.filter(\n function(def) {\n if (def.kind !== 'FragmentDefinition') return true;\n var name = def.name.value\n if (names[name]) {\n return false;\n } else {\n names[name] = true;\n return true;\n }\n }\n )\n }\n \n\n // Collect any fragment/type references from a node, adding them to the refs Set\n function collectFragmentReferences(node, refs) {\n if (node.kind === \"FragmentSpread\") {\n refs.add(node.name.value);\n } else if (node.kind === \"VariableDefinition\") {\n var type = node.type;\n if (type.kind === \"NamedType\") {\n refs.add(type.name.value);\n }\n }\n\n if (node.selectionSet) {\n node.selectionSet.selections.forEach(function(selection) {\n collectFragmentReferences(selection, refs);\n });\n }\n\n if (node.variableDefinitions) {\n node.variableDefinitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n\n if (node.definitions) {\n node.definitions.forEach(function(def) {\n collectFragmentReferences(def, refs);\n });\n }\n }\n\n var definitionRefs = {};\n (function extractReferences() {\n doc.definitions.forEach(function(def) {\n if (def.name) {\n var refs = new Set();\n collectFragmentReferences(def, refs);\n definitionRefs[def.name.value] = refs;\n }\n });\n })();\n\n function findOperation(doc, name) {\n for (var i = 0; i < doc.definitions.length; i++) {\n var element = doc.definitions[i];\n if (element.name && element.name.value == name) {\n return element;\n }\n }\n }\n\n function oneQuery(doc, operationName) {\n // Copy the DocumentNode, but clear out the definitions\n var newDoc = {\n kind: doc.kind,\n definitions: [findOperation(doc, operationName)]\n };\n if (doc.hasOwnProperty(\"loc\")) {\n newDoc.loc = doc.loc;\n }\n\n // Now, for the operation we're running, find any fragments referenced by\n // it or the fragments it references\n var opRefs = definitionRefs[operationName] || new Set();\n var allRefs = new Set();\n var newRefs = new Set();\n\n // IE 11 doesn't support \"new Set(iterable)\", so we add the members of opRefs to newRefs one by one\n opRefs.forEach(function(refName) {\n newRefs.add(refName);\n });\n\n while (newRefs.size > 0) {\n var prevRefs = newRefs;\n newRefs = new Set();\n\n prevRefs.forEach(function(refName) {\n if (!allRefs.has(refName)) {\n allRefs.add(refName);\n var childRefs = definitionRefs[refName] || new Set();\n childRefs.forEach(function(childRef) {\n newRefs.add(childRef);\n });\n }\n });\n }\n\n allRefs.forEach(function(refName) {\n var op = findOperation(doc, refName);\n if (op) {\n newDoc.definitions.push(op);\n }\n });\n\n return newDoc;\n }\n \n module.exports = doc;\n \n module.exports[\"approvalSummarySubscription\"] = oneQuery(doc, \"approvalSummarySubscription\");\n \n","/**\n * A specialized version of `baseAggregator` for arrays.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} setter The function to set `accumulator` values.\n * @param {Function} iteratee The iteratee to transform keys.\n * @param {Object} accumulator The initial aggregated object.\n * @returns {Function} Returns `accumulator`.\n */\nfunction arrayAggregator(array, setter, iteratee, accumulator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n var value = array[index];\n setter(accumulator, value, iteratee(value), array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayAggregator;\n","import { __, s__ } from '~/locale';\n\nexport const TYPE_USER = 'user';\nexport const TYPE_GROUP = 'group';\nexport const TYPE_HIDDEN_GROUPS = 'hidden_groups';\n\nexport const RULE_TYPE_FALLBACK = 'fallback';\nexport const RULE_TYPE_REGULAR = 'regular';\nexport const RULE_TYPE_REPORT_APPROVER = 'report_approver';\nexport const RULE_TYPE_CODE_OWNER = 'code_owner';\nexport const RULE_TYPE_ANY_APPROVER = 'any_approver';\nexport const RULE_NAME_ANY_APPROVER = 'All Members';\n\nexport const LICENSE_CHECK_NAME = 'License-Check';\nexport const COVERAGE_CHECK_NAME = 'Coverage-Check';\n\nexport const REPORT_TYPE_LICENSE_SCANNING = 'license_scanning';\nexport const REPORT_TYPE_CODE_COVERAGE = 'code_coverage';\n\nexport const APPROVAL_RULE_CONFIGS = {\n [COVERAGE_CHECK_NAME]: {\n title: s__('SecurityApprovals|Coverage-Check'),\n popoverText: s__(\n 'SecurityApprovals|A merge request approval is required when test coverage declines.',\n ),\n documentationText: s__('SecurityApprovals|Learn more about Coverage-Check'),\n reportType: REPORT_TYPE_CODE_COVERAGE,\n },\n};\n\nexport const APPROVAL_SETTINGS_I18N = {\n learnMore: __('Learn more.'),\n approvalSettingsHeader: __('Approval settings'),\n approvalSettingsDescription: __('Define how approval rules are applied to merge requests.'),\n saveChanges: __('Save changes'),\n loadingErrorMessage: s__(\n 'ApprovalSettings|There was an error loading merge request approval settings.',\n ),\n savingErrorMessage: s__(\n 'ApprovalSettings|There was an error updating merge request approval settings.',\n ),\n savingSuccessMessage: s__('ApprovalSettings|Merge request approval settings have been updated.'),\n lockedByAdmin: s__(\n 'ApprovalSettings|This setting is configured at the instance level and can only be changed by an administrator.',\n ),\n lockedByGroupOwner: s__(\n 'ApprovalSettings|This setting is configured in %{groupName} and can only be changed in the group settings by an administrator or group owner.',\n ),\n};\n\nexport const PROJECT_APPROVAL_SETTINGS_LABELS_I18N = {\n authorApprovalLabel: s__('ApprovalSettings|Prevent approval by author'),\n preventMrApprovalRuleEditLabel: s__(\n 'ApprovalSettings|Prevent editing approval rules in merge requests',\n ),\n preventCommittersApprovalLabel: s__(\n 'ApprovalSettings|Prevent approvals by users who add commits',\n ),\n requireUserPasswordLabel: s__(\n 'ApprovalSettings|Require user re-authentication (password or SAML) to approve',\n ),\n whenCommitAddedLabel: s__('ApprovalSettings|When a commit is added:'),\n keepApprovalsLabel: s__('ApprovalSettings|Keep approvals'),\n removeApprovalsOnPushLabel: s__('ApprovalSettings|Remove all approvals'),\n selectiveCodeOwnerRemovalsLabel: s__(\n 'ApprovalSettings|Remove approvals by Code Owners if their files changed',\n ),\n};\n\nexport const GROUP_APPROVAL_SETTINGS_LABELS_I18N = {\n ...PROJECT_APPROVAL_SETTINGS_LABELS_I18N,\n preventMrApprovalRuleEditLabel: s__(\n 'ApprovalSettings|Prevent editing approval rules in projects and merge requests.',\n ),\n};\n\nexport const APPROVAL_DIALOG_I18N = {\n form: {\n approvalsRequiredLabel: s__('ApprovalRule|Required number of approvals'),\n approvalTypeLabel: s__('ApprovalRule|Approver Type'),\n approversLabel: s__('ApprovalRule|Add approvers'),\n nameLabel: s__('ApprovalRule|Rule name'),\n nameDescription: s__('ApprovalRule|Examples: QA, Security.'),\n protectedBranchLabel: s__('ApprovalRule|Target branch'),\n protectedBranchDescription: __(\n 'Apply this approval rule to all branches or a specific protected branch.',\n ),\n },\n validations: {\n approvalsRequiredNegativeNumber: __('Please enter a non-negative number'),\n approvalsRequiredNotNumber: __('Please enter a valid number'),\n approvalsRequiredMinimum: __(\n 'Please enter a number greater than %{number} (from the project settings)',\n ),\n approversRequired: __('Please select and add a member'),\n branchesRequired: __('Please select a valid target branch'),\n ruleNameTaken: __('Rule name is already taken.'),\n ruleNameMissing: __('Please provide a name'),\n ruleNameTooLong: __('Please enter a name with less than %{number} characters.'),\n },\n};\n\nexport const MR_APPROVALS_PROMO_DISMISSED = 'mr_approvals_promo.dismissed';\nexport const MR_APPROVALS_PROMO_TRACKING_EVENTS = {\n learnMoreClick: { action: 'click_link', label: 'learn_more_merge_approval' },\n tryNowClick: { action: 'click_button', label: 'start_trial' },\n collapsePromo: { action: 'click_button', label: 'collapse_approval_rules' },\n expandPromo: { action: 'click_button', label: 'expand_approval_rules' },\n};\nexport const MR_APPROVALS_PROMO_I18N = {\n accordionTitle: s__('ApprovalRule|Approval rules'),\n learnMore: __('Learn more'),\n promoTitle: s__(\"ApprovalRule|Improve your organization's code review with required approvals.\"),\n summary: __('Approvals are optional.'),\n tryNow: s__('ApprovalRule|Try for free'),\n valueStatements: [\n s__('ApprovalRule|Select eligible approvers by expertise or files changed.'),\n s__('ApprovalRule|Increase quality and maintain standards.'),\n s__('ApprovalRule|Reduce your time to merge.'),\n ],\n};\n\nexport const SEARCH_PLACEHOLDER = s__('ApprovalRule|Search users or groups');\n\nexport const DROPDOWN_OPTION_PROJECT_GROUPS = s__('ApprovalRule|Search in project groups');\n\nexport const DROPDOWN_OPTION_ALL_GROUPS = s__('ApprovalRule|Search in all groups');\n\nexport const GROUP_OPTIONS = [DROPDOWN_OPTION_ALL_GROUPS, DROPDOWN_OPTION_PROJECT_GROUPS];\n\nexport const TABLE_HEADERS = {\n name: s__('ApprovalRule|Rule'),\n members: s__('ApprovalRule|Approvers'),\n approvalsRequired: s__('ApprovalRule|Approvals required'),\n branches: __('Target branch'),\n actions: __('Actions'),\n};\n","var arrayAggregator = require('./_arrayAggregator'),\n baseAggregator = require('./_baseAggregator'),\n baseIteratee = require('./_baseIteratee'),\n isArray = require('./isArray');\n\n/**\n * Creates a function like `_.groupBy`.\n *\n * @private\n * @param {Function} setter The function to set accumulator values.\n * @param {Function} [initializer] The accumulator object initializer.\n * @returns {Function} Returns the new aggregator function.\n */\nfunction createAggregator(setter, initializer) {\n return function(collection, iteratee) {\n var func = isArray(collection) ? arrayAggregator : baseAggregator,\n accumulator = initializer ? initializer() : {};\n\n return func(collection, setter, baseIteratee(iteratee, 2), accumulator);\n };\n}\n\nmodule.exports = createAggregator;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"gl-flex gl-items-center\"},[(_vm.isLoading)?_c('div',{staticClass:\"gl-animate-skeleton-loader gl-h-4 gl-w-full gl-rounded-base\"}):(_vm.mergeRequest && _vm.multipleApprovalRulesAvailable)?[_c('p',{staticClass:\"gl-mb-0 gl-inline-block gl-text-sm gl-text-subtle\"},[_vm._v(\"\\n \"+_vm._s(_vm.approvalsLeftMessage)+\"\\n \")]),_vm._v(\" \"),_vm._t(\"default\")]:_vm._e()],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./approval_summary.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../../../../../../node_modules/thread-loader/dist/cjs.js??ref--13-0!../../../../../../../node_modules/babel-loader/lib/index.js??ref--13-1!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./approval_summary.vue?vue&type=script&lang=js\"","<script>\nimport { n__, sprintf, s__, __ } from '~/locale';\nimport { getApprovalRuleNamesLeft } from 'ee/vue_merge_request_widget/mappers';\nimport { toNounSeriesText } from '~/lib/utils/grammar';\nimport { TYPENAME_MERGE_REQUEST } from '~/graphql_shared/constants';\nimport { convertToGraphQLId } from '~/graphql_shared/utils';\nimport approvalSummaryQuery from '../../queries/approval_summary.query.graphql';\nimport approvalSummarySubscription from '../../queries/approval_summary.subscription.graphql';\n\nexport default {\n apollo: {\n mergeRequest: {\n query: approvalSummaryQuery,\n variables() {\n return {\n projectPath: this.projectPath,\n iid: this.issuableIid,\n };\n },\n update: (data) => data.project?.mergeRequest,\n subscribeToMore: {\n document: approvalSummarySubscription,\n variables() {\n return {\n issuableId: convertToGraphQLId(TYPENAME_MERGE_REQUEST, this.issuableId),\n };\n },\n updateQuery(\n _,\n {\n subscriptionData: {\n data: { mergeRequestApprovalStateUpdated: queryResult },\n },\n },\n ) {\n if (queryResult) {\n this.mergeRequest = queryResult;\n }\n },\n },\n },\n },\n inject: ['projectPath', 'issuableId', 'issuableIid', 'multipleApprovalRulesAvailable'],\n props: {\n hideIfOptional: {\n type: Boolean,\n required: false,\n default: false,\n },\n shortText: {\n type: Boolean,\n required: false,\n default: false,\n },\n },\n data() {\n return {\n mergeRequest: null,\n };\n },\n computed: {\n isLoading() {\n return this.$apollo?.queries?.mergeRequest?.loading || !this.mergeRequest;\n },\n approvalsOptional() {\n return (\n this.mergeRequest.approvalsRequired === 0 && this.mergeRequest.approvedBy.nodes.length === 0\n );\n },\n approvalsLeft() {\n return this.mergeRequest.approvalsLeft || 0;\n },\n rulesLeft() {\n return getApprovalRuleNamesLeft(\n this.multipleApprovalRulesAvailable,\n (this.mergeRequest.approvalState?.rules || []).filter((r) => !r.approved),\n );\n },\n approvalsLeftMessage() {\n if (this.approvalsOptional) {\n return s__('mrWidget|Approval is optional');\n }\n\n if (this.mergeRequest.approved) {\n return __('All required approvals given');\n }\n\n if (this.rulesLeft.length && !this.shortText) {\n return sprintf(\n n__(\n 'Requires %{count} approval from %{names}.',\n 'Requires %{count} approvals from %{names}.',\n this.approvalsLeft,\n ),\n {\n names: toNounSeriesText(this.rulesLeft),\n count: this.approvalsLeft,\n },\n false,\n );\n }\n\n if (this.shortText) {\n return n__('Requires %d approval', 'Requires %d approvals', this.approvalsLeft);\n }\n\n return n__(\n 'Requires %d approval from eligible users.',\n 'Requires %d approvals from eligible users.',\n this.approvalsLeft,\n );\n },\n },\n};\n</script>\n\n<template>\n <div class=\"gl-flex gl-items-center\">\n <div v-if=\"isLoading\" class=\"gl-animate-skeleton-loader gl-h-4 gl-w-full gl-rounded-base\"></div>\n <template v-else-if=\"mergeRequest && multipleApprovalRulesAvailable\">\n <p class=\"gl-mb-0 gl-inline-block gl-text-sm gl-text-subtle\">\n {{ approvalsLeftMessage }}\n </p>\n <slot></slot>\n </template>\n </div>\n</template>\n","import { render, staticRenderFns } from \"./approval_summary.vue?vue&type=template&id=ea99370a\"\nimport script from \"./approval_summary.vue?vue&type=script&lang=js\"\nexport * from \"./approval_summary.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}