{"version":3,"file":"poll.js","names":["define","_exports","_component","_object","_service","_string","_template","_ajax","_ajaxError","_loadScript","_decorators","_discourseI18n","_templateFactory","_dec","_dec2","_dec3","_class","_descriptor","_defineProperty","obj","key","value","arg","input","hint","prim","Symbol","toPrimitive","undefined","res","call","TypeError","String","Number","_toPrimitive","_toPropertyKey","Object","defineProperty","enumerable","configurable","writable","_applyDecoratedDescriptor","target","property","decorators","descriptor","context","desc","keys","forEach","initializer","slice","reverse","reduce","decorator","default","__COLOCATED_TEMPLATE__","createTemplateFactory","id","block","moduleName","isStrictMode","PollBreakdownModal","constructor","super","arguments","this","init","set","model","groupableUserFields","then","fetchGroupedPollData","title","pollTitle","topicTitle","htmlSafe","fields","map","field","transformed","split","filter","Boolean","length","classify","label","join","totalVotes","options","sum","option","votes","ajax","data","post_id","post","poll_name","poll","name","user_field_name","groupedBy","catch","error","popupAjaxError","dialog","alert","t","result","isDestroying","isDestroyed","grouped_results","setGrouping","onSelectPanel","panel","prototype","inject","getOwnPropertyDescriptor","action","setComponentTemplate","_computed","_object2","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_dec10","_dec11","_dec12","_dec13","_dec14","_dec15","_descriptor2","_descriptor3","_initializerDefineProperty","REGULAR_POLL_TYPE","PIE_CHART_TYPE","NUMBER_POLL_TYPE","MULTIPLE_POLL_TYPE","BAR_CHART_TYPE","ALWAYS_POLL_RESULT","PollUiBuilderModal","or","gt","observes","create","siteSettings","poll_default_public","pollResults","staff","push","isRegular","pollType","isNumber","isMultiple","pollOptionsCount","pollOptions","siteGroups","groups","g","isPie","chartType","_setPollMinMax","pollMin","pollMax","poll_maximum_options","pollOutput","pollResult","publicPoll","pollStep","pollGroups","pollAutoClose","pollHeader","output","match","toolbarEvent","getText","step","toISOString","trim","minNumOfOptionsValidation","failed","reason","count","ok","showMinNumOfOptionsValidation","minMaxValueValidation","parseInt","optionsCount","disableInsert","_comboboxOptions","startIndex","endIndex","Array","number","onOptionsTextChange","e","insertPoll","addText","closeModal","toggleAdvanced","toggleProperty","showAdvanced","x","updateValue","event","onInputKeydown","index","preventDefault","stopPropagation","addOption","atIndex","insertAt","removeOption","removeObject","updatePollType","togglePublic","_runloop","_component2","_chartColors","_pollUiBuilder","_class2","PollBreakdownChart","classNames","mapBy","_optionToSlice","didInsertElement","canvas","element","querySelector","_chart","window","Chart","getContext","chartConfig","didReceiveAttrs","_updateDisplayMode","_updateHighlight","willDestroy","destroy","colorStyle","optionColors","displayMode","transformedData","counter","colors","getColors","color","type","plugins","ChartDataLabels","datasets","backgroundColor","hoverBorderColor","tooltip","datalabels","borderRadius","font","family","getComputedStyle","document","body","fontFamily","size","padding","top","right","bottom","left","formatter","toNumber","precision","responsive","aspectRatio","animation","duration","onHover","activeElements","next","setHighlightedOption","sliceIndex","optionIndex","find","_previousDisplayMode","config","update","highlightedOption","datasetIndex","setActiveElements","_computed2","PollBreakdownOption","tagName","propertyEqual","equal","percent","total","colorBackgroundStyle","highlighted","colorPreviewStyle","helpers","getHoverColor","_pluginApi","initializePollUIBuilder","api","addComposerToolbarPopupMenuOption","container","lookup","show","icon","condition","composer","currentUser","getCurrentUser","poll_enabled","topic","pm_with_non_human_user","trust_level","poll_minimum_trust_level_to_create","initialize","withPluginApi","_glue","_getOwner","PLUGIN_ID","_glued","_interval","rerender","queueRerender","cleanUpPolls","clearInterval","cleanUp","initializePolls","_obj","_obj2","register","getRegister","pollGroupableUserFields","poll_groupable_user_fields","modifyClass","pluginId","subscribe","_super","messageBus","_onPollMessage","unsubscribe","msg","get","findLoadedPost","polls","bind","_polls","pollsObject","pollsChanged","p","setProperties","includePostAttributes","decorateCookedElement","elem","helper","pollNodes","querySelectorAll","node","parentNode","getModel","preventCloak","polls_votes","setInterval","pollNode","pollName","dataset","pollPost","vote","quotedId","closest","postId","quoted","findBy","titleElement","attrs","hasSavedVote","titleHTML","outerHTML","glue","appendTo","onlyStream","cleanupStream","addSearchSuggestion","_application","_virtualDom","_formatter","_localDates","_round","_post","_rawHtml","_widget","_iconLibrary","_evenRound","_pollBreakdown","buttonOptionsMap","exportResults","className","showBreakdown","openPoll","closePoll","optionHtml","el","createElement","innerHTML","html","applyLocalDates","checkUserGroups","user","toLowerCase","userGroups","some","includes","createWidget","buildAttributes","tabindex","contents","chosen","iconNode","click","sendWidgetAction","keyDown","buildKey","optionId","defaultState","loading","state","h","finally","voters","avatarFor","username","template","avatar_template","attach","isPublic","public","ordered","sort","a","b","percentages","fill","o","rounded","Math","floor","idx","per","toString","attributes","style","totalScore","average","averageRating","services","showResults","preloaded_voters","resultsWidget","chart_type","fetchVoters","votersCount","option_id","page","limit","newVoters","votersSet","Set","voter","has","add","otherOptionId","scheduleRerender","multipleHelpText","min","max","closed","isClosed","isStaff","isMe","user_id","instructions","help","iconHTML","close","closeDate","moment","utc","isValid","format","isAutomaticallyClosed","age","relativeAge","toDate","addAgo","timeLeft","to","infoText","results","hasVoted","labels","opts","strippedLabels","l","stripHtml","DOMParser","parseFromString","textContent","htmlLegendPlugin","legend","generateLabels","text","fillStyle","display","htmlLegend","containerID","legendContainerId","pieChartConfig","getElementById","willRerenderWidget","removeChild","clearPieChart","chart","afterUpdate","args","ul","item","li","classList","onclick","toggleDataVisibility","boxSpan","background","textContainer","fontColor","getDataVisibility","opacity","appendChild","buildId","transform","content","_buildContent","onChange","param","_r","isAdmin","admin","dataExplorerEnabled","data_explorer_enabled","exportQueryID","poll_export_data_explorer_query_id","topicArchived","staffOnly","hideResultsDisabled","dropdown","dropdownOptionsCount","castVotesDisabled","canCastVotes","disabled","showResultsButton","singleOptionId","singleOption","cssClasses","class","newAttrs","isNaN","numOptions","status","selectedOptionCount","toggleStatus","yesNoConfirm","message","didConfirm","toggleResults","removeVote","_ref2","appEvents","trigger","queryID","params","JSON","stringify","explain","download","csvContent","downloadLink","blob","Blob","href","URL","createObjectURL","setAttribute","remove","showLogin","send","_toggleOption","chosenIdx","indexOf","splice","toggleOption","castVotes","_ref3","getOwner","palette","gradient","currentGradientValue","previousGradientIndex","gradientKeys","colorIndex","baseGradientKeyIndex","y","differenceMultiplier","k","round","setup","allowList","registerOptions","features","pollMaximumOptions","registerPlugin","md","bbcode","ruler","rule","newApiInit","DATA_PREFIX","ALLOWED_ATTRIBUTES","invalidPoll","tag","before","tagInfo","raw","token","bbcode_attrs","bbcode_type","after","openToken","titleTokens","tokens","startToken","pollTokens","open","findIndex","getTitle","items","i","listItems","buffer","level","nesting","getListItems","header","Token","discourse","md5Hash","rhex","hex","s","unescape","encodeURI","n","md5cycle","md5blk","substring","tail","charCodeAt","md51","list","pos","replaceToken","c","d","ff","gg","hh","ii","add32","cmn","q","md5blks","hex_chr","j","sumsUpTo100","decimals","sumOfDecimals","ceil","greatest"],"sources":["discourse/plugins/poll/discourse/components/modal/poll-breakdown.js","discourse/plugins/poll/discourse/components/modal/poll-ui-builder.js","discourse/plugins/poll/discourse/components/poll-breakdown-chart.js","discourse/plugins/poll/discourse/components/poll-breakdown-option.js","discourse/plugins/poll/discourse/initializers/add-poll-ui-builder.js","discourse/plugins/poll/discourse/initializers/extend-for-poll.js","discourse/plugins/poll/discourse/widgets/discourse-poll.js","discourse/plugins/poll/lib/chart-colors.js","discourse/plugins/poll/lib/discourse-markdown/poll.js","discourse/plugins/poll/lib/even-round.js"],"sourcesContent":["define(\"discourse/plugins/poll/discourse/components/modal/poll-breakdown\", [\"exports\", \"@ember/component\", \"@ember/object\", \"@ember/service\", \"@ember/string\", \"@ember/template\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"discourse/lib/load-script\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"@ember/template-factory\"], function (_exports, _component, _object, _service, _string, _template, _ajax, _ajaxError, _loadScript, _decorators, _discourseI18n, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _dec, _dec2, _dec3, _class, _descriptor;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n  function _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    {{! template-lint-disable no-invalid-interactive }}\n  <DModal\n    @title={{i18n \"poll.breakdown.title\"}}\n    @closeModal={{@closeModal}}\n    class=\"poll-breakdown has-tabs\"\n  >\n    <:headerBelowTitle>\n      <ul class=\"modal-tabs\">\n        <li\n          class={{concat-class\n            \"modal-tab percentage\"\n            (if (eq this.displayMode \"percentage\") \"is-active\")\n          }}\n          {{on \"click\" (fn (mut this.displayMode) \"percentage\")}}\n        >{{i18n \"poll.breakdown.percentage\"}}</li>\n        <li\n          class={{concat-class\n            \"modal-tab count\"\n            (if (eq this.displayMode \"count\") \"is-active\")\n          }}\n          {{on \"click\" (fn (mut this.displayMode) \"count\")}}\n        >{{i18n \"poll.breakdown.count\"}}</li>\n      </ul>\n    </:headerBelowTitle>\n    <:body>\n      <div class=\"poll-breakdown-sidebar\">\n        <p class=\"poll-breakdown-title\">\n          {{this.title}}\n        </p>\n  \n        <div class=\"poll-breakdown-total-votes\">{{i18n\n            \"poll.breakdown.votes\"\n            count=this.model.poll.voters\n          }}</div>\n  \n        <ul class=\"poll-breakdown-options\">\n          {{#each this.model.poll.options as |option index|}}\n            <PollBreakdownOption\n              @option={{option}}\n              @index={{index}}\n              @totalVotes={{this.totalVotes}}\n              @optionsCount={{this.model.poll.options.length}}\n              @displayMode={{this.displayMode}}\n              @highlightedOption={{this.highlightedOption}}\n              @onMouseOver={{fn (mut this.highlightedOption) index}}\n              @onMouseOut={{fn (mut this.highlightedOption) null}}\n            />\n          {{/each}}\n        </ul>\n      </div>\n  \n      <div class=\"poll-breakdown-body\">\n        <div class=\"poll-breakdown-body-header\">\n          <label class=\"poll-breakdown-body-header-label\">{{i18n\n              \"poll.breakdown.breakdown\"\n            }}</label>\n  \n          <ComboBox\n            @content={{this.groupableUserFields}}\n            @value={{this.groupedBy}}\n            @nameProperty=\"label\"\n            @class=\"poll-breakdown-dropdown\"\n            @onChange={{action this.setGrouping}}\n          />\n        </div>\n  \n        <div class=\"poll-breakdown-charts\">\n          {{#each this.charts as |chart|}}\n            <PollBreakdownChart\n              @group={{get chart \"group\"}}\n              @options={{get chart \"options\"}}\n              @displayMode={{this.displayMode}}\n              @highlightedOption={{this.highlightedOption}}\n              @setHighlightedOption={{fn (mut this.highlightedOption)}}\n            />\n          {{/each}}\n        </div>\n      </div>\n    </:body>\n  </DModal>\n  */\n  {\n    \"id\": \"bN4YG6Se\",\n    \"block\": \"[[[8,[39,0],[[24,0,\\\"poll-breakdown has-tabs\\\"]],[[\\\"@title\\\",\\\"@closeModal\\\"],[[28,[37,1],[\\\"poll.breakdown.title\\\"],null],[30,1]]],[[\\\"headerBelowTitle\\\",\\\"body\\\"],[[[[1,\\\"\\\\n    \\\"],[10,\\\"ul\\\"],[14,0,\\\"modal-tabs\\\"],[12],[1,\\\"\\\\n      \\\"],[11,\\\"li\\\"],[16,0,[28,[37,2],[\\\"modal-tab percentage\\\",[52,[28,[37,4],[[30,0,[\\\"displayMode\\\"]],\\\"percentage\\\"],null],\\\"is-active\\\"]],null]],[4,[38,5],[\\\"click\\\",[28,[37,6],[[28,[37,7],[[30,0,[\\\"displayMode\\\"]]],null],\\\"percentage\\\"],null]],null],[12],[1,[28,[35,1],[\\\"poll.breakdown.percentage\\\"],null]],[13],[1,\\\"\\\\n      \\\"],[11,\\\"li\\\"],[16,0,[28,[37,2],[\\\"modal-tab count\\\",[52,[28,[37,4],[[30,0,[\\\"displayMode\\\"]],\\\"count\\\"],null],\\\"is-active\\\"]],null]],[4,[38,5],[\\\"click\\\",[28,[37,6],[[28,[37,7],[[30,0,[\\\"displayMode\\\"]]],null],\\\"count\\\"],null]],null],[12],[1,[28,[35,1],[\\\"poll.breakdown.count\\\"],null]],[13],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[]],[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"poll-breakdown-sidebar\\\"],[12],[1,\\\"\\\\n      \\\"],[10,2],[14,0,\\\"poll-breakdown-title\\\"],[12],[1,\\\"\\\\n        \\\"],[1,[30,0,[\\\"title\\\"]]],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[10,0],[14,0,\\\"poll-breakdown-total-votes\\\"],[12],[1,[28,[35,1],[\\\"poll.breakdown.votes\\\"],[[\\\"count\\\"],[[30,0,[\\\"model\\\",\\\"poll\\\",\\\"voters\\\"]]]]]],[13],[1,\\\"\\\\n\\\\n      \\\"],[10,\\\"ul\\\"],[14,0,\\\"poll-breakdown-options\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[37,9],[[28,[37,9],[[30,0,[\\\"model\\\",\\\"poll\\\",\\\"options\\\"]]],null]],null],null,[[[1,\\\"          \\\"],[8,[39,10],null,[[\\\"@option\\\",\\\"@index\\\",\\\"@totalVotes\\\",\\\"@optionsCount\\\",\\\"@displayMode\\\",\\\"@highlightedOption\\\",\\\"@onMouseOver\\\",\\\"@onMouseOut\\\"],[[30,2],[30,3],[30,0,[\\\"totalVotes\\\"]],[30,0,[\\\"model\\\",\\\"poll\\\",\\\"options\\\",\\\"length\\\"]],[30,0,[\\\"displayMode\\\"]],[30,0,[\\\"highlightedOption\\\"]],[28,[37,6],[[28,[37,7],[[30,0,[\\\"highlightedOption\\\"]]],null],[30,3]],null],[28,[37,6],[[28,[37,7],[[30,0,[\\\"highlightedOption\\\"]]],null],null],null]]],null],[1,\\\"\\\\n\\\"]],[2,3]],null],[1,\\\"      \\\"],[13],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n\\\\n    \\\"],[10,0],[14,0,\\\"poll-breakdown-body\\\"],[12],[1,\\\"\\\\n      \\\"],[10,0],[14,0,\\\"poll-breakdown-body-header\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"label\\\"],[14,0,\\\"poll-breakdown-body-header-label\\\"],[12],[1,[28,[35,1],[\\\"poll.breakdown.breakdown\\\"],null]],[13],[1,\\\"\\\\n\\\\n        \\\"],[8,[39,11],null,[[\\\"@content\\\",\\\"@value\\\",\\\"@nameProperty\\\",\\\"@class\\\",\\\"@onChange\\\"],[[30,0,[\\\"groupableUserFields\\\"]],[30,0,[\\\"groupedBy\\\"]],\\\"label\\\",\\\"poll-breakdown-dropdown\\\",[28,[37,12],[[30,0],[30,0,[\\\"setGrouping\\\"]]],null]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[10,0],[14,0,\\\"poll-breakdown-charts\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[37,9],[[28,[37,9],[[30,0,[\\\"charts\\\"]]],null]],null],null,[[[1,\\\"          \\\"],[8,[39,13],null,[[\\\"@group\\\",\\\"@options\\\",\\\"@displayMode\\\",\\\"@highlightedOption\\\",\\\"@setHighlightedOption\\\"],[[28,[37,14],[[30,4],\\\"group\\\"],null],[28,[37,14],[[30,4],\\\"options\\\"],null],[30,0,[\\\"displayMode\\\"]],[30,0,[\\\"highlightedOption\\\"]],[28,[37,6],[[28,[37,7],[[30,0,[\\\"highlightedOption\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[4]],null],[1,\\\"      \\\"],[13],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[]]]]]],[\\\"@closeModal\\\",\\\"option\\\",\\\"index\\\",\\\"chart\\\"],false,[\\\"d-modal\\\",\\\"i18n\\\",\\\"concat-class\\\",\\\"if\\\",\\\"eq\\\",\\\"on\\\",\\\"fn\\\",\\\"mut\\\",\\\"each\\\",\\\"-track-array\\\",\\\"poll-breakdown-option\\\",\\\"combo-box\\\",\\\"action\\\",\\\"poll-breakdown-chart\\\",\\\"get\\\"]]\",\n    \"moduleName\": \"discourse/plugins/poll/discourse/components/modal/poll-breakdown.hbs\",\n    \"isStrictMode\": false\n  });\n  let PollBreakdownModal = _exports.default = (_dec = (0, _decorators.default)(\"model.poll.title\", \"model.post.topic.title\"), _dec2 = (0, _decorators.default)(\"model.groupableUserFields\"), _dec3 = (0, _decorators.default)(\"model.poll.options\"), (_class = class PollBreakdownModal extends _component.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"dialog\", _descriptor, this);\n      _defineProperty(this, \"model\", null);\n      _defineProperty(this, \"charts\", null);\n      _defineProperty(this, \"groupedBy\", null);\n      _defineProperty(this, \"highlightedOption\", null);\n      _defineProperty(this, \"displayMode\", \"percentage\");\n    }\n    init() {\n      this.set(\"groupedBy\", this.model.groupableUserFields[0]);\n      (0, _loadScript.default)(\"/javascripts/Chart.min.js\").then(() => (0, _loadScript.default)(\"/javascripts/chartjs-plugin-datalabels.min.js\")).then(() => {\n        this.fetchGroupedPollData();\n      });\n      super.init(...arguments);\n    }\n    title(pollTitle, topicTitle) {\n      return pollTitle ? (0, _template.htmlSafe)(pollTitle) : topicTitle;\n    }\n    groupableUserFields(fields) {\n      return fields.map(field => {\n        const transformed = field.split(\"_\").filter(Boolean);\n        if (transformed.length > 1) {\n          transformed[0] = (0, _string.classify)(transformed[0]);\n        }\n        return {\n          id: field,\n          label: transformed.join(\" \")\n        };\n      });\n    }\n    totalVotes(options) {\n      return options.reduce((sum, option) => sum + option.votes, 0);\n    }\n    fetchGroupedPollData() {\n      return (0, _ajax.ajax)(\"/polls/grouped_poll_results.json\", {\n        data: {\n          post_id: this.model.post.id,\n          poll_name: this.model.poll.name,\n          user_field_name: this.groupedBy\n        }\n      }).catch(error => {\n        if (error) {\n          (0, _ajaxError.popupAjaxError)(error);\n        } else {\n          this.dialog.alert(_discourseI18n.default.t(\"poll.error_while_fetching_voters\"));\n        }\n      }).then(result => {\n        if (this.isDestroying || this.isDestroyed) {\n          return;\n        }\n        this.set(\"charts\", result.grouped_results);\n      });\n    }\n    setGrouping(value) {\n      this.set(\"groupedBy\", value);\n      this.fetchGroupedPollData();\n    }\n    onSelectPanel(panel) {\n      this.set(\"displayMode\", panel.id);\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"dialog\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class.prototype, \"title\", [_dec], Object.getOwnPropertyDescriptor(_class.prototype, \"title\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"groupableUserFields\", [_dec2], Object.getOwnPropertyDescriptor(_class.prototype, \"groupableUserFields\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"totalVotes\", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, \"totalVotes\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"setGrouping\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"setGrouping\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"onSelectPanel\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"onSelectPanel\"), _class.prototype)), _class));\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, PollBreakdownModal);\n});","define(\"discourse/plugins/poll/discourse/components/modal/poll-ui-builder\", [\"exports\", \"@ember/component\", \"@ember/object\", \"@ember/object/computed\", \"@ember/service\", \"@ember-decorators/object\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"@ember/template-factory\"], function (_exports, _component, _object, _computed, _service, _object2, _decorators, _discourseI18n, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = _exports.REGULAR_POLL_TYPE = _exports.PIE_CHART_TYPE = _exports.NUMBER_POLL_TYPE = _exports.MULTIPLE_POLL_TYPE = _exports.BAR_CHART_TYPE = void 0;\n  var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _class, _descriptor, _descriptor2, _descriptor3;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n  function _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <DModal\n    @title={{i18n \"poll.ui_builder.title\"}}\n    @closeModal={{@closeModal}}\n    @inline={{@inline}}\n    class=\"poll-ui-builder\"\n  >\n    <:body>\n      <div class=\"input-group poll-type\">\n        <a\n          href\n          {{on \"click\" (fn this.updatePollType \"regular\")}}\n          class=\"poll-type-value poll-type-value-regular\n            {{if this.isRegular 'active'}}\"\n        >\n          {{i18n \"poll.ui_builder.poll_type.regular\"}}\n        </a>\n  \n        <a\n          href\n          {{on \"click\" (fn this.updatePollType \"multiple\")}}\n          class=\"poll-type-value poll-type-value-multiple\n            {{if this.isMultiple 'active'}}\"\n        >\n          {{i18n \"poll.ui_builder.poll_type.multiple\"}}\n        </a>\n  \n        {{#if this.showNumber}}\n          <a\n            href\n            {{on \"click\" (fn this.updatePollType \"number\")}}\n            class=\"poll-type-value poll-type-value-number\n              {{if this.isNumber 'active'}}\"\n          >\n            {{i18n \"poll.ui_builder.poll_type.number\"}}\n          </a>\n        {{/if}}\n      </div>\n  \n      {{#if this.showAdvanced}}\n        <div class=\"input-group poll-title\">\n          <label class=\"input-group-label\">{{i18n\n              \"poll.ui_builder.poll_title.label\"\n            }}</label>\n          <Input @value={{this.pollTitle}} />\n        </div>\n      {{/if}}\n  \n      {{#unless this.isNumber}}\n        <div class=\"poll-options\">\n          {{#if this.showAdvanced}}\n            <label class=\"input-group-label\">{{i18n\n                \"poll.ui_builder.poll_options.label\"\n              }}</label>\n            <Textarea\n              @value={{this.pollOptionsText}}\n              {{on \"input\" this.onOptionsTextChange}}\n            />\n            {{#if this.showMinNumOfOptionsValidation}}\n              {{#unless this.minNumOfOptionsValidation.ok}}\n                <InputTip @validation={{this.minNumOfOptionsValidation}} />\n              {{/unless}}\n            {{/if}}\n          {{else}}\n            {{#each this.pollOptions as |option index|}}\n              <div class=\"input-group poll-option-value\">\n                <input\n                  type=\"text\"\n                  value={{option.value}}\n                  {{auto-focus}}\n                  {{on \"input\" (fn this.updateValue option)}}\n                  {{on \"keydown\" (fn this.onInputKeydown index)}}\n                />\n                {{#if this.canRemoveOption}}\n                  <DButton\n                    @icon=\"trash-alt\"\n                    @action={{fn this.removeOption option}}\n                  />\n                {{/if}}\n              </div>\n            {{/each}}\n  \n            <div class=\"poll-option-controls\">\n              <DButton\n                @icon=\"plus\"\n                @label=\"poll.ui_builder.poll_options.add\"\n                @action={{fn this.addOption -1}}\n                class=\"btn-default poll-option-add\"\n              />\n              {{#if\n                (and\n                  this.showMinNumOfOptionsValidation\n                  (not this.minNumOfOptionsValidation.ok)\n                )\n              }}\n                <InputTip @validation={{this.minNumOfOptionsValidation}} />\n              {{/if}}\n            </div>\n          {{/if}}\n        </div>\n      {{/unless}}\n  \n      {{#unless this.isRegular}}\n        <div class=\"options\">\n          <div class=\"input-group poll-number\">\n            <label class=\"input-group-label\">{{i18n\n                \"poll.ui_builder.poll_config.min\"\n              }}</label>\n            <Input\n              @type=\"number\"\n              @value={{this.pollMin}}\n              class=\"poll-options-min\"\n              min=\"1\"\n            />\n          </div>\n  \n          <div class=\"input-group poll-number\">\n            <label class=\"input-group-label\">{{i18n\n                \"poll.ui_builder.poll_config.max\"\n              }}</label>\n            <Input\n              @type=\"number\"\n              @value={{this.pollMax}}\n              class=\"poll-options-max\"\n              min=\"1\"\n            />\n          </div>\n  \n          {{#if this.isNumber}}\n            <div class=\"input-group poll-number\">\n              <label class=\"input-group-label\">{{i18n\n                  \"poll.ui_builder.poll_config.step\"\n                }}</label>\n              <Input\n                @type=\"number\"\n                @value={{this.pollStep}}\n                min=\"1\"\n                class=\"poll-options-step\"\n              />\n            </div>\n          {{/if}}\n        </div>\n  \n        {{#unless this.minMaxValueValidation.ok}}\n          <InputTip @validation={{this.minMaxValueValidation}} />\n        {{/unless}}\n      {{/unless}}\n  \n      <div class=\"input-group poll-public\">\n        <DToggleSwitch\n          @state={{this.publicPoll}}\n          @label=\"poll.ui_builder.poll_public.label\"\n          class=\"poll-toggle-public\"\n          {{on \"click\" this.togglePublic}}\n        />\n      </div>\n  \n      {{#if this.showAdvanced}}\n        <div class=\"input-group poll-allowed-groups\">\n          <label class=\"input-group-label\">{{i18n\n              \"poll.ui_builder.poll_groups.label\"\n            }}</label>\n          <GroupChooser\n            @content={{this.siteGroups}}\n            @value={{this.pollGroups}}\n            @onChange={{action (mut this.pollGroups)}}\n            @labelProperty=\"name\"\n            @valueProperty=\"name\"\n          />\n        </div>\n  \n        <div class=\"input-group poll-date\">\n          <label class=\"input-group-label\">{{i18n\n              \"poll.ui_builder.automatic_close.label\"\n            }}</label>\n          <DateTimeInput\n            @date={{this.pollAutoClose}}\n            @onChange={{action (mut this.pollAutoClose)}}\n            @clearable={{true}}\n            @useGlobalPickerContainer={{true}}\n          />\n        </div>\n  \n        <div class=\"input-group poll-select\">\n          <label class=\"input-group-label\">{{i18n\n              \"poll.ui_builder.poll_result.label\"\n            }}</label>\n          <ComboBox\n            @content={{this.pollResults}}\n            @value={{this.pollResult}}\n            @class=\"poll-result\"\n            @valueProperty=\"value\"\n            @onChange={{action (mut this.pollResult)}}\n          />\n        </div>\n  \n        {{#unless this.isNumber}}\n          <div class=\"input-group poll-select column\">\n            <label class=\"input-group-label\">{{i18n\n                \"poll.ui_builder.poll_chart_type.label\"\n              }}</label>\n  \n            <div class=\"radio-group\">\n              <RadioButton\n                @id=\"poll-chart-type-bar\"\n                @name=\"poll-chart-type\"\n                @value=\"bar\"\n                @selection={{this.chartType}}\n              />\n              <label for=\"poll-chart-type-bar\">{{d-icon \"chart-bar\"}}\n                {{i18n \"poll.ui_builder.poll_chart_type.bar\"}}</label>\n            </div>\n  \n            <div class=\"radio-group\">\n              <RadioButton\n                @id=\"poll-chart-type-pie\"\n                @name=\"poll-chart-type\"\n                @value=\"pie\"\n                @selection={{this.chartType}}\n              />\n              <label for=\"poll-chart-type-pie\">{{d-icon \"chart-pie\"}}\n                {{i18n \"poll.ui_builder.poll_chart_type.pie\"}}</label>\n            </div>\n          </div>\n        {{/unless}}\n      {{/if}}\n    </:body>\n    <:footer>\n      <DButton\n        @action={{this.insertPoll}}\n        @icon=\"chart-bar\"\n        @label=\"poll.ui_builder.insert\"\n        @disabled={{this.disableInsert}}\n        class=\"btn-primary insert-poll\"\n      />\n  \n      <DButton @label=\"cancel\" @action={{@closeModal}} class=\"btn-flat\" />\n  \n      <DButton\n        @action={{this.toggleAdvanced}}\n        @icon=\"cog\"\n        @title={{if\n          this.showAdvanced\n          \"poll.ui_builder.hide_advanced\"\n          \"poll.ui_builder.show_advanced\"\n        }}\n        class=\"btn-default show-advanced\"\n      />\n  \n    </:footer>\n  </DModal>\n  */\n  {\n    \"id\": \"bIW1BI0h\",\n    \"block\": \"[[[8,[39,0],[[24,0,\\\"poll-ui-builder\\\"]],[[\\\"@title\\\",\\\"@closeModal\\\",\\\"@inline\\\"],[[28,[37,1],[\\\"poll.ui_builder.title\\\"],null],[30,1],[30,2]]],[[\\\"body\\\",\\\"footer\\\"],[[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"input-group poll-type\\\"],[12],[1,\\\"\\\\n      \\\"],[11,3],[24,6,\\\"\\\"],[16,0,[29,[\\\"poll-type-value poll-type-value-regular\\\\n          \\\",[52,[30,0,[\\\"isRegular\\\"]],\\\"active\\\"]]]],[4,[38,3],[\\\"click\\\",[28,[37,4],[[30,0,[\\\"updatePollType\\\"]],\\\"regular\\\"],null]],null],[12],[1,\\\"\\\\n        \\\"],[1,[28,[35,1],[\\\"poll.ui_builder.poll_type.regular\\\"],null]],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[11,3],[24,6,\\\"\\\"],[16,0,[29,[\\\"poll-type-value poll-type-value-multiple\\\\n          \\\",[52,[30,0,[\\\"isMultiple\\\"]],\\\"active\\\"]]]],[4,[38,3],[\\\"click\\\",[28,[37,4],[[30,0,[\\\"updatePollType\\\"]],\\\"multiple\\\"],null]],null],[12],[1,\\\"\\\\n        \\\"],[1,[28,[35,1],[\\\"poll.ui_builder.poll_type.multiple\\\"],null]],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"showNumber\\\"]],[[[1,\\\"        \\\"],[11,3],[24,6,\\\"\\\"],[16,0,[29,[\\\"poll-type-value poll-type-value-number\\\\n            \\\",[52,[30,0,[\\\"isNumber\\\"]],\\\"active\\\"]]]],[4,[38,3],[\\\"click\\\",[28,[37,4],[[30,0,[\\\"updatePollType\\\"]],\\\"number\\\"],null]],null],[12],[1,\\\"\\\\n          \\\"],[1,[28,[35,1],[\\\"poll.ui_builder.poll_type.number\\\"],null]],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"    \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"showAdvanced\\\"]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"input-group poll-title\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_title.label\\\"],null]],[13],[1,\\\"\\\\n        \\\"],[8,[39,5],null,[[\\\"@value\\\"],[[30,0,[\\\"pollTitle\\\"]]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n\\\"],[41,[51,[30,0,[\\\"isNumber\\\"]]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"poll-options\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"showAdvanced\\\"]],[[[1,\\\"          \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_options.label\\\"],null]],[13],[1,\\\"\\\\n          \\\"],[8,[39,7],[[4,[38,3],[\\\"input\\\",[30,0,[\\\"onOptionsTextChange\\\"]]],null]],[[\\\"@value\\\"],[[30,0,[\\\"pollOptionsText\\\"]]]],null],[1,\\\"\\\"],[41,[30,0,[\\\"showMinNumOfOptionsValidation\\\"]],[[[41,[51,[30,0,[\\\"minNumOfOptionsValidation\\\",\\\"ok\\\"]]],[[[1,\\\"              \\\"],[8,[39,8],null,[[\\\"@validation\\\"],[[30,0,[\\\"minNumOfOptionsValidation\\\"]]]],null],[1,\\\"\\\\n\\\"]],[]],null]],[]],null]],[]],[[[42,[28,[37,10],[[28,[37,10],[[30,0,[\\\"pollOptions\\\"]]],null]],null],null,[[[1,\\\"            \\\"],[10,0],[14,0,\\\"input-group poll-option-value\\\"],[12],[1,\\\"\\\\n              \\\"],[11,\\\"input\\\"],[16,2,[30,3,[\\\"value\\\"]]],[24,4,\\\"text\\\"],[4,[38,11],null,null],[4,[38,3],[\\\"input\\\",[28,[37,4],[[30,0,[\\\"updateValue\\\"]],[30,3]],null]],null],[4,[38,3],[\\\"keydown\\\",[28,[37,4],[[30,0,[\\\"onInputKeydown\\\"]],[30,4]],null]],null],[12],[13],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"canRemoveOption\\\"]],[[[1,\\\"                \\\"],[8,[39,12],null,[[\\\"@icon\\\",\\\"@action\\\"],[\\\"trash-alt\\\",[28,[37,4],[[30,0,[\\\"removeOption\\\"]],[30,3]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"            \\\"],[13],[1,\\\"\\\\n\\\"]],[3,4]],null],[1,\\\"\\\\n          \\\"],[10,0],[14,0,\\\"poll-option-controls\\\"],[12],[1,\\\"\\\\n            \\\"],[8,[39,12],[[24,0,\\\"btn-default poll-option-add\\\"]],[[\\\"@icon\\\",\\\"@label\\\",\\\"@action\\\"],[\\\"plus\\\",\\\"poll.ui_builder.poll_options.add\\\",[28,[37,4],[[30,0,[\\\"addOption\\\"]],-1],null]]],null],[1,\\\"\\\\n\\\"],[41,[28,[37,13],[[30,0,[\\\"showMinNumOfOptionsValidation\\\"]],[28,[37,14],[[30,0,[\\\"minNumOfOptionsValidation\\\",\\\"ok\\\"]]],null]],null],[[[1,\\\"              \\\"],[8,[39,8],null,[[\\\"@validation\\\"],[[30,0,[\\\"minNumOfOptionsValidation\\\"]]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"          \\\"],[13],[1,\\\"\\\\n\\\"]],[]]],[1,\\\"      \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n\\\"],[41,[51,[30,0,[\\\"isRegular\\\"]]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"options\\\"],[12],[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"input-group poll-number\\\"],[12],[1,\\\"\\\\n          \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_config.min\\\"],null]],[13],[1,\\\"\\\\n          \\\"],[8,[39,5],[[24,0,\\\"poll-options-min\\\"],[24,\\\"min\\\",\\\"1\\\"]],[[\\\"@type\\\",\\\"@value\\\"],[\\\"number\\\",[30,0,[\\\"pollMin\\\"]]]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\\n        \\\"],[10,0],[14,0,\\\"input-group poll-number\\\"],[12],[1,\\\"\\\\n          \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_config.max\\\"],null]],[13],[1,\\\"\\\\n          \\\"],[8,[39,5],[[24,0,\\\"poll-options-max\\\"],[24,\\\"min\\\",\\\"1\\\"]],[[\\\"@type\\\",\\\"@value\\\"],[\\\"number\\\",[30,0,[\\\"pollMax\\\"]]]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"isNumber\\\"]],[[[1,\\\"          \\\"],[10,0],[14,0,\\\"input-group poll-number\\\"],[12],[1,\\\"\\\\n            \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_config.step\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[8,[39,5],[[24,\\\"min\\\",\\\"1\\\"],[24,0,\\\"poll-options-step\\\"]],[[\\\"@type\\\",\\\"@value\\\"],[\\\"number\\\",[30,0,[\\\"pollStep\\\"]]]],null],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"      \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[51,[30,0,[\\\"minMaxValueValidation\\\",\\\"ok\\\"]]],[[[1,\\\"        \\\"],[8,[39,8],null,[[\\\"@validation\\\"],[[30,0,[\\\"minMaxValueValidation\\\"]]]],null],[1,\\\"\\\\n\\\"]],[]],null]],[]],null],[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"input-group poll-public\\\"],[12],[1,\\\"\\\\n      \\\"],[8,[39,15],[[24,0,\\\"poll-toggle-public\\\"],[4,[38,3],[\\\"click\\\",[30,0,[\\\"togglePublic\\\"]]],null]],[[\\\"@state\\\",\\\"@label\\\"],[[30,0,[\\\"publicPoll\\\"]],\\\"poll.ui_builder.poll_public.label\\\"]],null],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"showAdvanced\\\"]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"input-group poll-allowed-groups\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_groups.label\\\"],null]],[13],[1,\\\"\\\\n        \\\"],[8,[39,16],null,[[\\\"@content\\\",\\\"@value\\\",\\\"@onChange\\\",\\\"@labelProperty\\\",\\\"@valueProperty\\\"],[[30,0,[\\\"siteGroups\\\"]],[30,0,[\\\"pollGroups\\\"]],[28,[37,17],[[30,0],[28,[37,18],[[30,0,[\\\"pollGroups\\\"]]],null]],null],\\\"name\\\",\\\"name\\\"]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[10,0],[14,0,\\\"input-group poll-date\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.automatic_close.label\\\"],null]],[13],[1,\\\"\\\\n        \\\"],[8,[39,19],null,[[\\\"@date\\\",\\\"@onChange\\\",\\\"@clearable\\\",\\\"@useGlobalPickerContainer\\\"],[[30,0,[\\\"pollAutoClose\\\"]],[28,[37,17],[[30,0],[28,[37,18],[[30,0,[\\\"pollAutoClose\\\"]]],null]],null],true,true]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[10,0],[14,0,\\\"input-group poll-select\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_result.label\\\"],null]],[13],[1,\\\"\\\\n        \\\"],[8,[39,20],null,[[\\\"@content\\\",\\\"@value\\\",\\\"@class\\\",\\\"@valueProperty\\\",\\\"@onChange\\\"],[[30,0,[\\\"pollResults\\\"]],[30,0,[\\\"pollResult\\\"]],\\\"poll-result\\\",\\\"value\\\",[28,[37,17],[[30,0],[28,[37,18],[[30,0,[\\\"pollResult\\\"]]],null]],null]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[51,[30,0,[\\\"isNumber\\\"]]],[[[1,\\\"        \\\"],[10,0],[14,0,\\\"input-group poll-select column\\\"],[12],[1,\\\"\\\\n          \\\"],[10,\\\"label\\\"],[14,0,\\\"input-group-label\\\"],[12],[1,[28,[35,1],[\\\"poll.ui_builder.poll_chart_type.label\\\"],null]],[13],[1,\\\"\\\\n\\\\n          \\\"],[10,0],[14,0,\\\"radio-group\\\"],[12],[1,\\\"\\\\n            \\\"],[8,[39,21],null,[[\\\"@id\\\",\\\"@name\\\",\\\"@value\\\",\\\"@selection\\\"],[\\\"poll-chart-type-bar\\\",\\\"poll-chart-type\\\",\\\"bar\\\",[30,0,[\\\"chartType\\\"]]]],null],[1,\\\"\\\\n            \\\"],[10,\\\"label\\\"],[14,\\\"for\\\",\\\"poll-chart-type-bar\\\"],[12],[1,[28,[35,22],[\\\"chart-bar\\\"],null]],[1,\\\"\\\\n              \\\"],[1,[28,[35,1],[\\\"poll.ui_builder.poll_chart_type.bar\\\"],null]],[13],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\\n          \\\"],[10,0],[14,0,\\\"radio-group\\\"],[12],[1,\\\"\\\\n            \\\"],[8,[39,21],null,[[\\\"@id\\\",\\\"@name\\\",\\\"@value\\\",\\\"@selection\\\"],[\\\"poll-chart-type-pie\\\",\\\"poll-chart-type\\\",\\\"pie\\\",[30,0,[\\\"chartType\\\"]]]],null],[1,\\\"\\\\n            \\\"],[10,\\\"label\\\"],[14,\\\"for\\\",\\\"poll-chart-type-pie\\\"],[12],[1,[28,[35,22],[\\\"chart-pie\\\"],null]],[1,\\\"\\\\n              \\\"],[1,[28,[35,1],[\\\"poll.ui_builder.poll_chart_type.pie\\\"],null]],[13],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[]],null],[1,\\\"  \\\"]],[]],[[[1,\\\"\\\\n    \\\"],[8,[39,12],[[24,0,\\\"btn-primary insert-poll\\\"]],[[\\\"@action\\\",\\\"@icon\\\",\\\"@label\\\",\\\"@disabled\\\"],[[30,0,[\\\"insertPoll\\\"]],\\\"chart-bar\\\",\\\"poll.ui_builder.insert\\\",[30,0,[\\\"disableInsert\\\"]]]],null],[1,\\\"\\\\n\\\\n    \\\"],[8,[39,12],[[24,0,\\\"btn-flat\\\"]],[[\\\"@label\\\",\\\"@action\\\"],[\\\"cancel\\\",[30,1]]],null],[1,\\\"\\\\n\\\\n    \\\"],[8,[39,12],[[24,0,\\\"btn-default show-advanced\\\"]],[[\\\"@action\\\",\\\"@icon\\\",\\\"@title\\\"],[[30,0,[\\\"toggleAdvanced\\\"]],\\\"cog\\\",[52,[30,0,[\\\"showAdvanced\\\"]],\\\"poll.ui_builder.hide_advanced\\\",\\\"poll.ui_builder.show_advanced\\\"]]],null],[1,\\\"\\\\n\\\\n  \\\"]],[]]]]]],[\\\"@closeModal\\\",\\\"@inline\\\",\\\"option\\\",\\\"index\\\"],false,[\\\"d-modal\\\",\\\"i18n\\\",\\\"if\\\",\\\"on\\\",\\\"fn\\\",\\\"input\\\",\\\"unless\\\",\\\"textarea\\\",\\\"input-tip\\\",\\\"each\\\",\\\"-track-array\\\",\\\"auto-focus\\\",\\\"d-button\\\",\\\"and\\\",\\\"not\\\",\\\"d-toggle-switch\\\",\\\"group-chooser\\\",\\\"action\\\",\\\"mut\\\",\\\"date-time-input\\\",\\\"combo-box\\\",\\\"radio-button\\\",\\\"d-icon\\\"]]\",\n    \"moduleName\": \"discourse/plugins/poll/discourse/components/modal/poll-ui-builder.hbs\",\n    \"isStrictMode\": false\n  });\n  const BAR_CHART_TYPE = _exports.BAR_CHART_TYPE = \"bar\";\n  const PIE_CHART_TYPE = _exports.PIE_CHART_TYPE = \"pie\";\n  const REGULAR_POLL_TYPE = _exports.REGULAR_POLL_TYPE = \"regular\";\n  const NUMBER_POLL_TYPE = _exports.NUMBER_POLL_TYPE = \"number\";\n  const MULTIPLE_POLL_TYPE = _exports.MULTIPLE_POLL_TYPE = \"multiple\";\n  const ALWAYS_POLL_RESULT = \"always\";\n  const VOTE_POLL_RESULT = \"on_vote\";\n  const CLOSED_POLL_RESULT = \"on_close\";\n  const STAFF_POLL_RESULT = \"staff_only\";\n  let PollUiBuilderModal = _exports.default = (_dec = (0, _computed.or)(\"showAdvanced\", \"isNumber\"), _dec2 = (0, _computed.gt)(\"pollOptions.length\", 1), _dec3 = (0, _decorators.default)(\"currentUser.staff\"), _dec4 = (0, _decorators.default)(\"pollType\"), _dec5 = (0, _decorators.default)(\"pollType\"), _dec6 = (0, _decorators.default)(\"pollType\"), _dec7 = (0, _decorators.default)(\"pollOptions.@each.value\"), _dec8 = (0, _decorators.default)(\"site.groups\"), _dec9 = (0, _decorators.default)(\"chartType\", \"pollType\"), _dec10 = (0, _object2.observes)(\"pollType\", \"pollOptionsCount\"), _dec11 = (0, _decorators.default)(\"pollType\", \"pollResult\", \"publicPoll\", \"pollTitle\", \"pollOptions.@each.value\", \"pollMin\", \"pollMax\", \"pollStep\", \"pollGroups\", \"pollAutoClose\", \"chartType\"), _dec12 = (0, _decorators.default)(\"isNumber\", \"pollOptionsCount\"), _dec13 = (0, _decorators.default)(\"pollOptions.@each.value\"), _dec14 = (0, _decorators.default)(\"isMultiple\", \"pollOptionsCount\", \"isNumber\", \"pollMin\", \"pollMax\", \"pollStep\"), _dec15 = (0, _decorators.default)(\"minMaxValueValidation\", \"minNumOfOptionsValidation\"), (_class = class PollUiBuilderModal extends _component.default {\n    constructor() {\n      super(...arguments);\n      _initializerDefineProperty(this, \"siteSettings\", _descriptor, this);\n      _defineProperty(this, \"showAdvanced\", false);\n      _defineProperty(this, \"pollType\", REGULAR_POLL_TYPE);\n      _defineProperty(this, \"pollTitle\", void 0);\n      _defineProperty(this, \"pollOptions\", [_object.default.create({\n        value: \"\"\n      })]);\n      _defineProperty(this, \"pollOptionsText\", \"\");\n      _defineProperty(this, \"pollMin\", 1);\n      _defineProperty(this, \"pollMax\", 2);\n      _defineProperty(this, \"pollStep\", 1);\n      _defineProperty(this, \"pollGroups\", void 0);\n      _defineProperty(this, \"pollAutoClose\", void 0);\n      _defineProperty(this, \"pollResult\", ALWAYS_POLL_RESULT);\n      _defineProperty(this, \"chartType\", BAR_CHART_TYPE);\n      _defineProperty(this, \"publicPoll\", this.siteSettings.poll_default_public);\n      _initializerDefineProperty(this, \"showNumber\", _descriptor2, this);\n      _initializerDefineProperty(this, \"canRemoveOption\", _descriptor3, this);\n    }\n    pollResults(staff) {\n      const options = [{\n        name: _discourseI18n.default.t(\"poll.ui_builder.poll_result.always\"),\n        value: ALWAYS_POLL_RESULT\n      }, {\n        name: _discourseI18n.default.t(\"poll.ui_builder.poll_result.vote\"),\n        value: VOTE_POLL_RESULT\n      }, {\n        name: _discourseI18n.default.t(\"poll.ui_builder.poll_result.closed\"),\n        value: CLOSED_POLL_RESULT\n      }];\n      if (staff) {\n        options.push({\n          name: _discourseI18n.default.t(\"poll.ui_builder.poll_result.staff\"),\n          value: STAFF_POLL_RESULT\n        });\n      }\n      return options;\n    }\n    isRegular(pollType) {\n      return pollType === REGULAR_POLL_TYPE;\n    }\n    isNumber(pollType) {\n      return pollType === NUMBER_POLL_TYPE;\n    }\n    isMultiple(pollType) {\n      return pollType === MULTIPLE_POLL_TYPE;\n    }\n    pollOptionsCount(pollOptions) {\n      return (pollOptions || []).filter(option => option.value.length > 0).length;\n    }\n    siteGroups(groups) {\n      // prevents group \"everyone\" to be listed\n      return groups.filter(g => g.id !== 0);\n    }\n    isPie(chartType, pollType) {\n      return pollType !== NUMBER_POLL_TYPE && chartType === PIE_CHART_TYPE;\n    }\n    _setPollMinMax() {\n      if (this.isMultiple) {\n        if (this.pollMin <= 0 || this.pollMin >= this.pollMax || this.pollMin >= this.pollOptionsCount) {\n          this.set(\"pollMin\", this.pollOptionsCount > 0 ? 1 : 0);\n        }\n        if (this.pollMax <= 0 || this.pollMin >= this.pollMax || this.pollMax > this.pollOptionsCount) {\n          this.set(\"pollMax\", this.pollOptionsCount);\n        }\n      } else if (this.isNumber) {\n        this.set(\"pollMax\", this.siteSettings.poll_maximum_options);\n      }\n    }\n    pollOutput(pollType, pollResult, publicPoll, pollTitle, pollOptions, pollMin, pollMax, pollStep, pollGroups, pollAutoClose, chartType) {\n      let pollHeader = \"[poll\";\n      let output = \"\";\n      const match = this.model.toolbarEvent.getText().match(/\\[poll(\\s+name=[^\\s\\]]+)*.*\\]/gim);\n      if (match) {\n        pollHeader += ` name=poll${match.length + 1}`;\n      }\n      let step = pollStep;\n      if (step < 1) {\n        step = 1;\n      }\n      if (pollType) {\n        pollHeader += ` type=${pollType}`;\n      }\n      if (pollResult) {\n        pollHeader += ` results=${pollResult}`;\n      }\n      if (pollMin && pollType !== REGULAR_POLL_TYPE) {\n        pollHeader += ` min=${pollMin}`;\n      }\n      if (pollMax && pollType !== REGULAR_POLL_TYPE) {\n        pollHeader += ` max=${pollMax}`;\n      }\n      if (pollType === NUMBER_POLL_TYPE) {\n        pollHeader += ` step=${step}`;\n      }\n      pollHeader += ` public=${publicPoll ? \"true\" : \"false\"}`;\n      if (chartType && pollType !== NUMBER_POLL_TYPE) {\n        pollHeader += ` chartType=${chartType}`;\n      }\n      if (pollGroups && pollGroups.length > 0) {\n        pollHeader += ` groups=${pollGroups}`;\n      }\n      if (pollAutoClose) {\n        pollHeader += ` close=${pollAutoClose.toISOString()}`;\n      }\n      pollHeader += \"]\";\n      output += `${pollHeader}\\n`;\n      if (pollTitle) {\n        output += `# ${pollTitle.trim()}\\n`;\n      }\n      if (pollOptions.length > 0 && pollType !== NUMBER_POLL_TYPE) {\n        pollOptions.forEach(option => {\n          if (option.value.length > 0) {\n            output += `* ${option.value.trim()}\\n`;\n          }\n        });\n      }\n      output += \"[/poll]\\n\";\n      return output;\n    }\n    minNumOfOptionsValidation(isNumber, pollOptionsCount) {\n      let options = {\n        ok: true\n      };\n      if (!isNumber) {\n        if (pollOptionsCount < 1) {\n          return _object.default.create({\n            failed: true,\n            reason: _discourseI18n.default.t(\"poll.ui_builder.help.options_min_count\")\n          });\n        }\n        if (pollOptionsCount > this.siteSettings.poll_maximum_options) {\n          return _object.default.create({\n            failed: true,\n            reason: _discourseI18n.default.t(\"poll.ui_builder.help.options_max_count\", {\n              count: this.siteSettings.poll_maximum_options\n            })\n          });\n        }\n      }\n      return _object.default.create(options);\n    }\n    showMinNumOfOptionsValidation(pollOptions) {\n      return pollOptions.length !== 1 || pollOptions[0].value !== \"\";\n    }\n    minMaxValueValidation(isMultiple, pollOptionsCount, isNumber, pollMin, pollMax, pollStep) {\n      pollMin = parseInt(pollMin, 10) || 0;\n      pollMax = parseInt(pollMax, 10) || 0;\n      pollStep = parseInt(pollStep, 10) || 0;\n      if (pollMin < 0) {\n        return _object.default.create({\n          failed: true,\n          reason: _discourseI18n.default.t(\"poll.ui_builder.help.invalid_min_value\")\n        });\n      }\n      if (pollMax < 0 || isMultiple && pollMax > pollOptionsCount) {\n        return _object.default.create({\n          failed: true,\n          reason: _discourseI18n.default.t(\"poll.ui_builder.help.invalid_max_value\")\n        });\n      }\n      if (pollMin > pollMax) {\n        return _object.default.create({\n          failed: true,\n          reason: _discourseI18n.default.t(\"poll.ui_builder.help.invalid_values\")\n        });\n      }\n      if (isNumber) {\n        if (pollStep < 1) {\n          return _object.default.create({\n            failed: true,\n            reason: _discourseI18n.default.t(\"poll.ui_builder.help.min_step_value\")\n          });\n        }\n        const optionsCount = (pollMax - pollMin + 1) / pollStep;\n        if (optionsCount < 1) {\n          return _object.default.create({\n            failed: true,\n            reason: _discourseI18n.default.t(\"poll.ui_builder.help.options_min_count\")\n          });\n        }\n        if (optionsCount > this.siteSettings.poll_maximum_options) {\n          return _object.default.create({\n            failed: true,\n            reason: _discourseI18n.default.t(\"poll.ui_builder.help.options_max_count\", {\n              count: this.siteSettings.poll_maximum_options\n            })\n          });\n        }\n      }\n      return _object.default.create({\n        ok: true\n      });\n    }\n    disableInsert(minMaxValueValidation, minNumOfOptionsValidation) {\n      return !minMaxValueValidation.ok || !minNumOfOptionsValidation.ok;\n    }\n    _comboboxOptions(startIndex, endIndex) {\n      return [...Array(endIndex - startIndex).keys()].map(number => ({\n        value: number + startIndex,\n        name: number + startIndex\n      }));\n    }\n    onOptionsTextChange(e) {\n      this.set(\"pollOptions\", e.target.value.split(\"\\n\").map(value => _object.default.create({\n        value\n      })));\n    }\n    insertPoll() {\n      this.model.toolbarEvent.addText(this.pollOutput);\n      this.closeModal();\n    }\n    toggleAdvanced() {\n      this.toggleProperty(\"showAdvanced\");\n      if (this.showAdvanced) {\n        this.set(\"pollOptionsText\", this.pollOptions.map(x => x.value).join(\"\\n\"));\n      }\n    }\n    updateValue(option, event) {\n      option.set(\"value\", event.target.value);\n    }\n    onInputKeydown(index, event) {\n      if (event.key === \"Enter\") {\n        event.preventDefault();\n        event.stopPropagation();\n        if (event.target.value !== \"\") {\n          this.addOption(index + 1);\n        }\n      }\n    }\n    addOption(atIndex) {\n      if (atIndex === -1) {\n        atIndex = this.pollOptions.length;\n      }\n      const option = _object.default.create({\n        value: \"\"\n      });\n      this.pollOptions.insertAt(atIndex, option);\n    }\n    removeOption(option) {\n      this.pollOptions.removeObject(option);\n    }\n    updatePollType(pollType, event) {\n      event?.preventDefault();\n      this.set(\"pollType\", pollType);\n    }\n    togglePublic() {\n      this.set(\"publicPoll\", !this.publicPoll);\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class.prototype, \"siteSettings\", [_service.inject], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor2 = _applyDecoratedDescriptor(_class.prototype, \"showNumber\", [_dec], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor3 = _applyDecoratedDescriptor(_class.prototype, \"canRemoveOption\", [_dec2], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class.prototype, \"pollResults\", [_dec3], Object.getOwnPropertyDescriptor(_class.prototype, \"pollResults\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isRegular\", [_dec4], Object.getOwnPropertyDescriptor(_class.prototype, \"isRegular\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isNumber\", [_dec5], Object.getOwnPropertyDescriptor(_class.prototype, \"isNumber\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isMultiple\", [_dec6], Object.getOwnPropertyDescriptor(_class.prototype, \"isMultiple\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"pollOptionsCount\", [_dec7], Object.getOwnPropertyDescriptor(_class.prototype, \"pollOptionsCount\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"siteGroups\", [_dec8], Object.getOwnPropertyDescriptor(_class.prototype, \"siteGroups\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"isPie\", [_dec9], Object.getOwnPropertyDescriptor(_class.prototype, \"isPie\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"_setPollMinMax\", [_dec10], Object.getOwnPropertyDescriptor(_class.prototype, \"_setPollMinMax\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"pollOutput\", [_dec11], Object.getOwnPropertyDescriptor(_class.prototype, \"pollOutput\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"minNumOfOptionsValidation\", [_dec12], Object.getOwnPropertyDescriptor(_class.prototype, \"minNumOfOptionsValidation\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"showMinNumOfOptionsValidation\", [_dec13], Object.getOwnPropertyDescriptor(_class.prototype, \"showMinNumOfOptionsValidation\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"minMaxValueValidation\", [_dec14], Object.getOwnPropertyDescriptor(_class.prototype, \"minMaxValueValidation\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"disableInsert\", [_dec15], Object.getOwnPropertyDescriptor(_class.prototype, \"disableInsert\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"onOptionsTextChange\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"onOptionsTextChange\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"insertPoll\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"insertPoll\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"toggleAdvanced\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"toggleAdvanced\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"updateValue\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"updateValue\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"onInputKeydown\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"onInputKeydown\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"addOption\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"addOption\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"removeOption\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"removeOption\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"updatePollType\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"updatePollType\"), _class.prototype), _applyDecoratedDescriptor(_class.prototype, \"togglePublic\", [_object.action], Object.getOwnPropertyDescriptor(_class.prototype, \"togglePublic\"), _class.prototype)), _class));\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, PollUiBuilderModal);\n});","define(\"discourse/plugins/poll/discourse/components/poll-breakdown-chart\", [\"exports\", \"@ember/component\", \"@ember/object/computed\", \"@ember/runloop\", \"@ember/template\", \"@ember-decorators/component\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"discourse/plugins/poll/lib/chart-colors\", \"discourse/plugins/poll/discourse/components/modal/poll-ui-builder\", \"@ember/template-factory\"], function (_exports, _component, _computed, _runloop, _template, _component2, _decorators, _discourseI18n, _chartColors, _pollUiBuilder, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n  function _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <label class=\"poll-breakdown-chart-label\">{{@group}}</label>\n  <canvas class=\"poll-breakdown-chart-chart\"></canvas>\n  */\n  {\n    \"id\": \"oqA5wA7R\",\n    \"block\": \"[[[10,\\\"label\\\"],[14,0,\\\"poll-breakdown-chart-label\\\"],[12],[1,[30,1]],[13],[1,\\\"\\\\n\\\"],[10,\\\"canvas\\\"],[14,0,\\\"poll-breakdown-chart-chart\\\"],[12],[13]],[\\\"@group\\\"],false,[]]\",\n    \"moduleName\": \"discourse/plugins/poll/discourse/components/poll-breakdown-chart.hbs\",\n    \"isStrictMode\": false\n  });\n  let PollBreakdownChart = _exports.default = (_dec = (0, _component2.classNames)(\"poll-breakdown-chart-container\"), _dec2 = (0, _computed.mapBy)(\"options\", \"votes\"), _dec3 = (0, _decorators.default)(\"optionColors\", \"index\"), _dec4 = (0, _decorators.default)(\"data\", \"displayMode\"), _dec(_class = (_class2 = class PollBreakdownChart extends _component.default {\n    constructor() {\n      super(...arguments);\n      // Arguments:\n      _defineProperty(this, \"group\", null);\n      _defineProperty(this, \"options\", null);\n      _defineProperty(this, \"displayMode\", null);\n      _defineProperty(this, \"highlightedOption\", null);\n      _defineProperty(this, \"setHighlightedOption\", null);\n      _initializerDefineProperty(this, \"data\", _descriptor, this);\n      _defineProperty(this, \"_optionToSlice\", null);\n      _defineProperty(this, \"_previousHighlightedSliceIndex\", null);\n      _defineProperty(this, \"_previousDisplayMode\", null);\n    }\n    init() {\n      super.init(...arguments);\n      this._optionToSlice = {};\n    }\n    didInsertElement() {\n      super.didInsertElement(...arguments);\n      const canvas = this.element.querySelector(\"canvas\");\n      this._chart = new window.Chart(canvas.getContext(\"2d\"), this.chartConfig);\n    }\n    didReceiveAttrs() {\n      super.didReceiveAttrs(...arguments);\n      if (this._chart) {\n        this._updateDisplayMode();\n        this._updateHighlight();\n      }\n    }\n    willDestroy() {\n      super.willDestroy(...arguments);\n      if (this._chart) {\n        this._chart.destroy();\n      }\n    }\n    colorStyle(optionColors, index) {\n      return (0, _template.htmlSafe)(`background: ${optionColors[index]};`);\n    }\n    chartConfig(data, displayMode) {\n      const transformedData = [];\n      let counter = 0;\n      this._optionToSlice = {};\n      data.forEach((votes, index) => {\n        if (votes > 0) {\n          transformedData.push(votes);\n          this._optionToSlice[index] = counter++;\n        }\n      });\n      const totalVotes = transformedData.reduce((sum, votes) => sum + votes, 0);\n      const colors = (0, _chartColors.getColors)(data.length).filter((color, index) => data[index] > 0);\n      return {\n        type: _pollUiBuilder.PIE_CHART_TYPE,\n        plugins: [window.ChartDataLabels],\n        data: {\n          datasets: [{\n            data: transformedData,\n            backgroundColor: colors,\n            // TODO: It's a workaround for Chart.js' terrible hover styling.\n            // It will break on non-white backgrounds.\n            // Should be updated after #10341 lands\n            hoverBorderColor: \"#fff\"\n          }]\n        },\n        options: {\n          plugins: {\n            tooltip: false,\n            datalabels: {\n              color: \"#333\",\n              backgroundColor: \"rgba(255, 255, 255, 0.5)\",\n              borderRadius: 2,\n              font: {\n                family: getComputedStyle(document.body).fontFamily,\n                size: 16\n              },\n              padding: {\n                top: 2,\n                right: 6,\n                bottom: 2,\n                left: 6\n              },\n              formatter(votes) {\n                if (displayMode !== \"percentage\") {\n                  return votes;\n                }\n                const percent = _discourseI18n.default.toNumber(votes / totalVotes * 100.0, {\n                  precision: 1\n                });\n                return `${percent}%`;\n              }\n            }\n          },\n          responsive: true,\n          aspectRatio: 1.1,\n          animation: {\n            duration: 0\n          },\n          // wrapping setHighlightedOption in next block as hover can create many events\n          // prevents two sets to happen in the same computation\n          onHover: (event, activeElements) => {\n            if (!activeElements.length) {\n              (0, _runloop.next)(() => {\n                this.setHighlightedOption(null);\n              });\n              return;\n            }\n            const sliceIndex = activeElements[0].index;\n            const optionIndex = Object.keys(this._optionToSlice).find(option => this._optionToSlice[option] === sliceIndex);\n            (0, _runloop.next)(() => {\n              this.setHighlightedOption(Number(optionIndex));\n            });\n          }\n        }\n      };\n    }\n    _updateDisplayMode() {\n      if (this.displayMode !== this._previousDisplayMode) {\n        const config = this.chartConfig;\n        this._chart.data.datasets = config.data.datasets;\n        this._chart.options = config.options;\n        this._chart.update();\n        this._previousDisplayMode = this.displayMode;\n      }\n    }\n    _updateHighlight() {\n      const activeElements = [];\n      if (this.highlightedOption) {\n        const index = this._optionToSlice[this.highlightedOption];\n        if (index !== undefined) {\n          activeElements.push({\n            datasetIndex: 0,\n            index\n          });\n        }\n      }\n      this._chart.setActiveElements(activeElements);\n      this._chart.update();\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"data\", [_dec2], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class2.prototype, \"colorStyle\", [_dec3], Object.getOwnPropertyDescriptor(_class2.prototype, \"colorStyle\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"chartConfig\", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, \"chartConfig\"), _class2.prototype)), _class2)) || _class);\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, PollBreakdownChart);\n});","define(\"discourse/plugins/poll/discourse/components/poll-breakdown-option\", [\"exports\", \"@ember/component\", \"@ember/object/computed\", \"@ember/template\", \"@ember-decorators/component\", \"discourse/lib/computed\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"discourse/plugins/poll/lib/chart-colors\", \"@ember/template-factory\"], function (_exports, _component, _computed, _template, _component2, _computed2, _decorators, _discourseI18n, _chartColors, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2;\n  function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }\n  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n  function _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return typeof key === \"symbol\" ? key : String(key); }\n  function _toPrimitive(input, hint) { if (typeof input !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (typeof res !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }\n  const __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <li\n    class=\"poll-breakdown-option\"\n    style={{this.colorBackgroundStyle}}\n    {{on \"mouseover\" @onMouseOver}}\n    {{on \"mouseout\" @onMouseOut}}\n    role=\"button\"\n  >\n    <span\n      class=\"poll-breakdown-option-color\"\n      style={{this.colorPreviewStyle}}\n    ></span>\n  \n    <span class=\"poll-breakdown-option-count\">\n      {{#if this.showPercentage}}\n        {{this.percent}}%\n      {{else}}\n        {{@option.votes}}\n      {{/if}}\n    </span>\n    <span class=\"poll-breakdown-option-text\">{{html-safe @option.html}}</span>\n  </li>\n  */\n  {\n    \"id\": \"NTR1m1S2\",\n    \"block\": \"[[[11,\\\"li\\\"],[24,0,\\\"poll-breakdown-option\\\"],[16,5,[30,0,[\\\"colorBackgroundStyle\\\"]]],[24,\\\"role\\\",\\\"button\\\"],[4,[38,0],[\\\"mouseover\\\",[30,1]],null],[4,[38,0],[\\\"mouseout\\\",[30,2]],null],[12],[1,\\\"\\\\n  \\\"],[10,1],[14,0,\\\"poll-breakdown-option-color\\\"],[15,5,[30,0,[\\\"colorPreviewStyle\\\"]]],[12],[13],[1,\\\"\\\\n\\\\n  \\\"],[10,1],[14,0,\\\"poll-breakdown-option-count\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"showPercentage\\\"]],[[[1,\\\"      \\\"],[1,[30,0,[\\\"percent\\\"]]],[1,\\\"%\\\\n\\\"]],[]],[[[1,\\\"      \\\"],[1,[30,3,[\\\"votes\\\"]]],[1,\\\"\\\\n\\\"]],[]]],[1,\\\"  \\\"],[13],[1,\\\"\\\\n  \\\"],[10,1],[14,0,\\\"poll-breakdown-option-text\\\"],[12],[1,[28,[35,2],[[30,3,[\\\"html\\\"]]],null]],[13],[1,\\\"\\\\n\\\"],[13]],[\\\"@onMouseOver\\\",\\\"@onMouseOut\\\",\\\"@option\\\"],false,[\\\"on\\\",\\\"if\\\",\\\"html-safe\\\"]]\",\n    \"moduleName\": \"discourse/plugins/poll/discourse/components/poll-breakdown-option.hbs\",\n    \"isStrictMode\": false\n  });\n  let PollBreakdownOption = _exports.default = (_dec = (0, _component2.tagName)(\"\"), _dec2 = (0, _computed2.propertyEqual)(\"highlightedOption\", \"index\"), _dec3 = (0, _computed.equal)(\"displayMode\", \"percentage\"), _dec4 = (0, _decorators.default)(\"option.votes\", \"totalVotes\"), _dec5 = (0, _decorators.default)(\"optionsCount\"), _dec6 = (0, _decorators.default)(\"highlighted\"), _dec7 = (0, _decorators.default)(\"highlighted\", \"optionColors\", \"index\"), _dec(_class = (_class2 = class PollBreakdownOption extends _component.default {\n    constructor() {\n      super(...arguments);\n      // Arguments:\n      _defineProperty(this, \"option\", null);\n      _defineProperty(this, \"index\", null);\n      _defineProperty(this, \"totalVotes\", null);\n      _defineProperty(this, \"optionsCount\", null);\n      _defineProperty(this, \"displayMode\", null);\n      _defineProperty(this, \"highlightedOption\", null);\n      _defineProperty(this, \"onMouseOver\", null);\n      _defineProperty(this, \"onMouseOut\", null);\n      _initializerDefineProperty(this, \"highlighted\", _descriptor, this);\n      _initializerDefineProperty(this, \"showPercentage\", _descriptor2, this);\n    }\n    percent(votes, total) {\n      return _discourseI18n.default.toNumber(votes / total * 100.0, {\n        precision: 1\n      });\n    }\n    optionColors(optionsCount) {\n      return (0, _chartColors.getColors)(optionsCount);\n    }\n    colorBackgroundStyle(highlighted) {\n      if (highlighted) {\n        // TODO: Use CSS variables (#10341)\n        return (0, _template.htmlSafe)(\"background: rgba(0, 0, 0, 0.1);\");\n      }\n    }\n    colorPreviewStyle(highlighted, optionColors, index) {\n      const color = highlighted ? window.Chart.helpers.getHoverColor(optionColors[index]) : optionColors[index];\n      return (0, _template.htmlSafe)(`background: ${color};`);\n    }\n  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, \"highlighted\", [_dec2], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, \"showPercentage\", [_dec3], {\n    configurable: true,\n    enumerable: true,\n    writable: true,\n    initializer: null\n  }), _applyDecoratedDescriptor(_class2.prototype, \"percent\", [_dec4], Object.getOwnPropertyDescriptor(_class2.prototype, \"percent\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"optionColors\", [_dec5], Object.getOwnPropertyDescriptor(_class2.prototype, \"optionColors\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"colorBackgroundStyle\", [_dec6], Object.getOwnPropertyDescriptor(_class2.prototype, \"colorBackgroundStyle\"), _class2.prototype), _applyDecoratedDescriptor(_class2.prototype, \"colorPreviewStyle\", [_dec7], Object.getOwnPropertyDescriptor(_class2.prototype, \"colorPreviewStyle\"), _class2.prototype)), _class2)) || _class);\n  (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, PollBreakdownOption);\n});","define(\"discourse/plugins/poll/discourse/initializers/add-poll-ui-builder\", [\"exports\", \"discourse/lib/plugin-api\", \"discourse/plugins/poll/discourse/components/modal/poll-ui-builder\"], function (_exports, _pluginApi, _pollUiBuilder) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  function initializePollUIBuilder(api) {\n    api.addComposerToolbarPopupMenuOption({\n      action: toolbarEvent => {\n        api.container.lookup(\"service:modal\").show(_pollUiBuilder.default, {\n          model: {\n            toolbarEvent\n          }\n        });\n      },\n      icon: \"chart-bar\",\n      label: \"poll.ui_builder.title\",\n      condition: composer => {\n        const siteSettings = api.container.lookup(\"service:site-settings\");\n        const currentUser = api.getCurrentUser();\n        return siteSettings.poll_enabled && (composer.model.topic?.pm_with_non_human_user || currentUser && (currentUser.staff || currentUser.trust_level >= siteSettings.poll_minimum_trust_level_to_create));\n      }\n    });\n  }\n  var _default = _exports.default = {\n    name: \"add-poll-ui-builder\",\n    initialize() {\n      (0, _pluginApi.withPluginApi)(\"1.14.0\", initializePollUIBuilder);\n    }\n  };\n});","define(\"discourse/plugins/poll/discourse/initializers/extend-for-poll\", [\"exports\", \"@ember/object\", \"discourse/lib/plugin-api\", \"discourse/widgets/glue\", \"discourse-common/lib/get-owner\", \"discourse-common/utils/decorators\"], function (_exports, _object, _pluginApi, _glue, _getOwner, _decorators) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }\n  const PLUGIN_ID = \"discourse-poll\";\n  let _glued = [];\n  let _interval = null;\n  function rerender() {\n    _glued.forEach(g => g.queueRerender());\n  }\n  function cleanUpPolls() {\n    if (_interval) {\n      clearInterval(_interval);\n      _interval = null;\n    }\n    _glued.forEach(g => g.cleanUp());\n    _glued = [];\n  }\n  function initializePolls(api) {\n    var _obj, _dec, _obj2;\n    const register = (0, _getOwner.getRegister)(api),\n      pollGroupableUserFields = api.container.lookup(\"service:site-settings\").poll_groupable_user_fields;\n    cleanUpPolls();\n    api.modifyClass(\"controller:topic\", (_obj = {\n      pluginId: PLUGIN_ID,\n      subscribe() {\n        this._super(...arguments);\n        this.messageBus.subscribe(`/polls/${this.model.id}`, this._onPollMessage);\n      },\n      unsubscribe() {\n        this.messageBus.unsubscribe(\"/polls/*\", this._onPollMessage);\n        this._super(...arguments);\n      },\n      _onPollMessage(msg) {\n        const post = this.get(\"model.postStream\").findLoadedPost(msg.post_id);\n        post?.set(\"polls\", msg.polls);\n      }\n    }, (_applyDecoratedDescriptor(_obj, \"_onPollMessage\", [_decorators.bind], Object.getOwnPropertyDescriptor(_obj, \"_onPollMessage\"), _obj)), _obj));\n    api.modifyClass(\"model:post\", (_dec = (0, _decorators.observes)(\"polls\"), (_obj2 = {\n      pluginId: PLUGIN_ID,\n      _polls: null,\n      pollsObject: null,\n      pollsChanged() {\n        const polls = this.polls;\n        if (polls) {\n          this._polls = this._polls || {};\n          polls.forEach(p => {\n            const existing = this._polls[p.name];\n            if (existing) {\n              this._polls[p.name].setProperties(p);\n            } else {\n              this._polls[p.name] = _object.default.create(p);\n            }\n          });\n          this.set(\"pollsObject\", this._polls);\n          rerender();\n        }\n      }\n    }, (_applyDecoratedDescriptor(_obj2, \"pollsChanged\", [_dec], Object.getOwnPropertyDescriptor(_obj2, \"pollsChanged\"), _obj2)), _obj2)));\n    function attachPolls(elem, helper) {\n      let pollNodes = [...elem.querySelectorAll(\".poll\")];\n      pollNodes = pollNodes.filter(node => node.parentNode.tagName !== \"BLOCKQUOTE\");\n      if (!pollNodes.length || !helper) {\n        return;\n      }\n      const post = helper.getModel();\n      api.preventCloak(post.id);\n      post.pollsChanged();\n      const polls = post.pollsObject || {};\n      const votes = post.polls_votes || {};\n      _interval = _interval || setInterval(rerender, 30000);\n      pollNodes.forEach(pollNode => {\n        const pollName = pollNode.dataset.pollName;\n        let poll = polls[pollName];\n        let pollPost = post;\n        let vote = votes[pollName] || [];\n        const quotedId = pollNode.closest(\".expanded-quote\")?.dataset.postId;\n        if (quotedId && post.quoted[quotedId]) {\n          pollPost = post.quoted[quotedId];\n          pollPost = _object.default.create(pollPost);\n          poll = _object.default.create(pollPost.polls.findBy(\"name\", pollName));\n          vote = pollPost.polls_votes || {};\n          vote = vote[pollName] || [];\n        }\n        if (poll) {\n          const titleElement = pollNode.querySelector(\".poll-title\");\n          const attrs = {\n            id: `${pollName}-${pollPost.id}`,\n            post: pollPost,\n            poll,\n            vote,\n            hasSavedVote: vote.length > 0,\n            titleHTML: titleElement?.outerHTML,\n            groupableUserFields: (pollGroupableUserFields || \"\").split(\"|\").filter(Boolean)\n          };\n          const glue = new _glue.default(\"discourse-poll\", register, attrs);\n          glue.appendTo(pollNode);\n          _glued.push(glue);\n        }\n      });\n    }\n    api.includePostAttributes(\"polls\", \"polls_votes\");\n    api.decorateCookedElement(attachPolls, {\n      onlyStream: true\n    });\n    api.cleanupStream(cleanUpPolls);\n    const siteSettings = api.container.lookup(\"site-settings:main\");\n    if (siteSettings.poll_enabled) {\n      api.addSearchSuggestion(\"in:polls\");\n    }\n  }\n  var _default = _exports.default = {\n    name: \"extend-for-poll\",\n    initialize() {\n      (0, _pluginApi.withPluginApi)(\"0.8.7\", initializePolls);\n    }\n  };\n});","define(\"discourse/plugins/poll/discourse/widgets/discourse-poll\", [\"exports\", \"@ember/application\", \"virtual-dom\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"discourse/lib/formatter\", \"discourse/lib/load-script\", \"discourse/lib/local-dates\", \"discourse/lib/round\", \"discourse/widgets/post\", \"discourse/widgets/raw-html\", \"discourse/widgets/widget\", \"discourse-common/lib/icon-library\", \"discourse-i18n\", \"discourse/plugins/poll/lib/chart-colors\", \"discourse/plugins/poll/lib/even-round\", \"discourse/plugins/poll/discourse/components/modal/poll-breakdown\", \"discourse/plugins/poll/discourse/components/modal/poll-ui-builder\"], function (_exports, _application, _virtualDom, _ajax, _ajaxError, _formatter, _loadScript, _localDates, _round, _post, _rawHtml, _widget, _iconLibrary, _discourseI18n, _chartColors, _evenRound, _pollBreakdown, _pollUiBuilder) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const FETCH_VOTERS_COUNT = 25;\n  const buttonOptionsMap = {\n    exportResults: {\n      className: \"btn-default export-results\",\n      label: \"poll.export-results.label\",\n      title: \"poll.export-results.title\",\n      icon: \"download\",\n      action: \"exportResults\"\n    },\n    showBreakdown: {\n      className: \"btn-default show-breakdown\",\n      label: \"poll.breakdown.breakdown\",\n      icon: \"chart-pie\",\n      action: \"showBreakdown\"\n    },\n    openPoll: {\n      className: \"btn-default toggle-status\",\n      label: \"poll.open.label\",\n      title: \"poll.open.title\",\n      icon: \"unlock-alt\",\n      action: \"toggleStatus\"\n    },\n    closePoll: {\n      className: \"btn-default toggle-status\",\n      label: \"poll.close.label\",\n      title: \"poll.close.title\",\n      icon: \"lock\",\n      action: \"toggleStatus\"\n    }\n  };\n  function optionHtml(option) {\n    let siteSettings = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    const el = document.createElement(\"span\");\n    el.innerHTML = option.html;\n    (0, _localDates.applyLocalDates)(el.querySelectorAll(\".discourse-local-date\"), siteSettings);\n    return new _rawHtml.default({\n      html: `<span>${el.innerHTML}</span>`\n    });\n  }\n  function checkUserGroups(user, poll) {\n    const pollGroups = poll && poll.groups && poll.groups.split(\",\").map(g => g.toLowerCase());\n    if (!pollGroups) {\n      return true;\n    }\n    const userGroups = user && user.groups && user.groups.map(g => g.name.toLowerCase());\n    return userGroups && pollGroups.some(g => userGroups.includes(g));\n  }\n  (0, _widget.createWidget)(\"discourse-poll-option\", {\n    tagName: \"li\",\n    buildAttributes(attrs) {\n      return {\n        tabindex: 0,\n        \"data-poll-option-id\": attrs.option.id\n      };\n    },\n    html(attrs) {\n      const contents = [];\n      const {\n        option,\n        vote\n      } = attrs;\n      const chosen = vote.includes(option.id);\n      if (attrs.isMultiple) {\n        contents.push((0, _iconLibrary.iconNode)(chosen ? \"far-check-square\" : \"far-square\"));\n      } else {\n        contents.push((0, _iconLibrary.iconNode)(chosen ? \"circle\" : \"far-circle\"));\n      }\n      contents.push(\" \");\n      contents.push(optionHtml(option, this.siteSettings));\n      return contents;\n    },\n    click(e) {\n      if (!e.target.closest(\"a\")) {\n        this.sendWidgetAction(\"toggleOption\", this.attrs.option);\n      }\n    },\n    keyDown(e) {\n      if (e.key === \"Enter\") {\n        this.click(e);\n      }\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-load-more\", {\n    tagName: \"div.poll-voters-toggle-expand\",\n    buildKey: attrs => `load-more-${attrs.optionId}`,\n    defaultState() {\n      return {\n        loading: false\n      };\n    },\n    html(attrs, state) {\n      return state.loading ? (0, _virtualDom.h)(\"div.spinner.small\") : (0, _virtualDom.h)(\"a\", (0, _iconLibrary.iconNode)(\"chevron-down\"));\n    },\n    click() {\n      const {\n        state,\n        attrs\n      } = this;\n      if (state.loading) {\n        return;\n      }\n      state.loading = true;\n      return this.sendWidgetAction(\"fetchVoters\", attrs.optionId).finally(() => state.loading = false);\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-voters\", {\n    tagName: \"ul.poll-voters-list\",\n    buildKey: attrs => `poll-voters-${attrs.optionId}`,\n    html(attrs) {\n      const contents = attrs.voters.map(user => (0, _virtualDom.h)(\"li\", [(0, _post.avatarFor)(\"tiny\", {\n        username: user.username,\n        template: user.avatar_template\n      }), \" \"]));\n      if (attrs.voters.length < attrs.totalVotes) {\n        contents.push(this.attach(\"discourse-poll-load-more\", attrs));\n      }\n      return (0, _virtualDom.h)(\"div.poll-voters\", contents);\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-standard-results\", {\n    tagName: \"ul.results\",\n    buildKey: attrs => `poll-standard-results-${attrs.id}`,\n    html(attrs) {\n      const {\n        poll\n      } = attrs;\n      const options = poll.options;\n      if (options) {\n        const voters = poll.voters;\n        const isPublic = poll.public;\n        const ordered = [...options].sort((a, b) => {\n          if (a.votes < b.votes) {\n            return 1;\n          } else if (a.votes === b.votes) {\n            if (a.html < b.html) {\n              return -1;\n            } else {\n              return 1;\n            }\n          } else {\n            return -1;\n          }\n        });\n        const percentages = voters === 0 ? Array(ordered.length).fill(0) : ordered.map(o => 100 * o.votes / voters);\n        const rounded = attrs.isMultiple ? percentages.map(Math.floor) : (0, _evenRound.default)(percentages);\n        return ordered.map((option, idx) => {\n          const contents = [];\n          const per = rounded[idx].toString();\n          const chosen = (attrs.vote || []).includes(option.id);\n          contents.push((0, _virtualDom.h)(\"div.option\", (0, _virtualDom.h)(\"p\", [(0, _virtualDom.h)(\"span.percentage\", `${per}%`), optionHtml(option, this.siteSettings)])));\n          contents.push((0, _virtualDom.h)(\"div.bar-back\", (0, _virtualDom.h)(\"div.bar\", {\n            attributes: {\n              style: `width:${per}%`\n            }\n          })));\n          if (isPublic) {\n            contents.push(this.attach(\"discourse-poll-voters\", {\n              postId: attrs.post.id,\n              optionId: option.id,\n              pollName: poll.name,\n              totalVotes: option.votes,\n              voters: attrs.voters && attrs.voters[option.id] || []\n            }));\n          }\n          return (0, _virtualDom.h)(\"li\", {\n            className: `${chosen ? \"chosen\" : \"\"}`\n          }, contents);\n        });\n      }\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-number-results\", {\n    buildKey: attrs => `poll-number-results-${attrs.id}`,\n    html(attrs) {\n      const {\n        poll\n      } = attrs;\n      const totalScore = poll.options.reduce((total, o) => {\n        return total + parseInt(o.html, 10) * parseInt(o.votes, 10);\n      }, 0);\n      const voters = poll.voters;\n      const average = voters === 0 ? 0 : (0, _round.default)(totalScore / voters, -2);\n      const averageRating = _discourseI18n.default.t(\"poll.average_rating\", {\n        average\n      });\n      const contents = [(0, _virtualDom.h)(\"div.poll-results-number-rating\", new _rawHtml.default({\n        html: `<span>${averageRating}</span>`\n      }))];\n      if (poll.public) {\n        contents.push(this.attach(\"discourse-poll-voters\", {\n          totalVotes: poll.voters,\n          voters: attrs.voters || [],\n          postId: attrs.post.id,\n          pollName: poll.name,\n          pollType: poll.type\n        }));\n      }\n      return contents;\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-container\", {\n    tagName: \"div.poll-container\",\n    buildKey: attrs => `poll-container-${attrs.id}`,\n    services: [\"dialog\"],\n    defaultState() {\n      return {\n        voters: []\n      };\n    },\n    html(attrs, state) {\n      const {\n        poll\n      } = attrs;\n      const options = poll.options;\n      if (attrs.showResults) {\n        const contents = [];\n        if (attrs.titleHTML) {\n          contents.push(new _rawHtml.default({\n            html: attrs.titleHTML\n          }));\n        }\n        if (poll.public) {\n          state.voters = poll.preloaded_voters;\n        }\n        const type = poll.type === \"number\" ? \"number\" : \"standard\";\n        const resultsWidget = type === \"number\" || attrs.poll.chart_type !== _pollUiBuilder.PIE_CHART_TYPE ? `discourse-poll-${type}-results` : \"discourse-poll-pie-chart\";\n        contents.push(this.attach(resultsWidget, {\n          ...attrs,\n          voters: state.voters\n        }));\n        return contents;\n      } else if (options) {\n        const contents = [];\n        if (attrs.titleHTML) {\n          contents.push(new _rawHtml.default({\n            html: attrs.titleHTML\n          }));\n        }\n        if (!checkUserGroups(this.currentUser, poll)) {\n          contents.push((0, _virtualDom.h)(\"div.alert.alert-danger\", _discourseI18n.default.t(\"poll.results.groups.title\", {\n            groups: poll.groups\n          })));\n        }\n        contents.push((0, _virtualDom.h)(\"ul\", options.map(option => {\n          return this.attach(\"discourse-poll-option\", {\n            option,\n            isMultiple: attrs.isMultiple,\n            vote: attrs.vote\n          });\n        })));\n        return contents;\n      }\n    },\n    fetchVoters(optionId) {\n      const {\n        attrs,\n        state\n      } = this;\n      let votersCount;\n      if (optionId) {\n        if (!state.voters) {\n          state.voters = {};\n        }\n        if (!state.voters[optionId]) {\n          state.voters[optionId] = [];\n        }\n        votersCount = state.voters[optionId].length;\n      } else {\n        if (!state.voters) {\n          state.voters = [];\n        }\n        votersCount = state.voters.length;\n      }\n      return (0, _ajax.ajax)(\"/polls/voters.json\", {\n        data: {\n          post_id: attrs.post.id,\n          poll_name: attrs.poll.name,\n          option_id: optionId,\n          page: Math.floor(votersCount / FETCH_VOTERS_COUNT) + 1,\n          limit: FETCH_VOTERS_COUNT\n        }\n      }).then(result => {\n        const voters = optionId ? state.voters[optionId] : state.voters;\n        const newVoters = optionId ? result.voters[optionId] : result.voters;\n        const votersSet = new Set(voters.map(voter => voter.username));\n        newVoters.forEach(voter => {\n          if (!votersSet.has(voter.username)) {\n            votersSet.add(voter.username);\n            voters.push(voter);\n          }\n        });\n\n        // remove users who changed their vote\n        if (attrs.poll.type === \"regular\") {\n          Object.keys(state.voters).forEach(otherOptionId => {\n            if (optionId !== otherOptionId) {\n              state.voters[otherOptionId] = state.voters[otherOptionId].filter(voter => !votersSet.has(voter.username));\n            }\n          });\n        }\n        this.scheduleRerender();\n      }).catch(error => {\n        if (error) {\n          (0, _ajaxError.popupAjaxError)(error);\n        } else {\n          this.dialog.alert(_discourseI18n.default.t(\"poll.error_while_fetching_voters\"));\n        }\n      });\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-info\", {\n    tagName: \"div.poll-info\",\n    multipleHelpText(min, max, options) {\n      if (max > 0) {\n        if (min === max) {\n          if (min > 1) {\n            return _discourseI18n.default.t(\"poll.multiple.help.x_options\", {\n              count: min\n            });\n          }\n        } else if (min > 1) {\n          if (max < options) {\n            return _discourseI18n.default.t(\"poll.multiple.help.between_min_and_max_options\", {\n              min,\n              max\n            });\n          } else {\n            return _discourseI18n.default.t(\"poll.multiple.help.at_least_min_options\", {\n              count: min\n            });\n          }\n        } else if (max <= options) {\n          return _discourseI18n.default.t(\"poll.multiple.help.up_to_max_options\", {\n            count: max\n          });\n        }\n      }\n    },\n    html(attrs) {\n      const {\n        poll,\n        post\n      } = attrs;\n      const closed = attrs.isClosed;\n      const isStaff = this.currentUser && this.currentUser.staff;\n      const isMe = this.currentUser && post.user_id === this.currentUser.id;\n      const count = poll.voters;\n      const contents = [(0, _virtualDom.h)(\"div.poll-info_counts-count\", [(0, _virtualDom.h)(\"span.info-number\", count.toString()), (0, _virtualDom.h)(\"span.info-label\", _discourseI18n.default.t(\"poll.voters\", {\n        count\n      }))])];\n      const instructions = [];\n      if (attrs.isMultiple) {\n        if (attrs.showResults || attrs.isClosed) {\n          const totalVotes = poll.options.reduce((total, o) => {\n            return total + parseInt(o.votes, 10);\n          }, 0);\n          contents.push((0, _virtualDom.h)(\"div.poll-info_counts-count\", [(0, _virtualDom.h)(\"span.info-number\", totalVotes.toString()), (0, _virtualDom.h)(\"span.info-label\", _discourseI18n.default.t(\"poll.total_votes\", {\n            count: totalVotes\n          }))]));\n        } else {\n          const help = this.multipleHelpText(attrs.min, attrs.max, poll.options.length);\n          if (help) {\n            instructions.push(new _rawHtml.default({\n              html: `<li>\n                      ${(0, _iconLibrary.iconHTML)(\"list-ul\")}\n                      <span>${help}</span>\n                     </li>`\n            }));\n          }\n        }\n      }\n      if (poll.close) {\n        const closeDate = moment.utc(poll.close, \"YYYY-MM-DD HH:mm:ss Z\");\n        if (closeDate.isValid()) {\n          const title = closeDate.format(\"LLL\");\n          let label;\n          let icon;\n          if (attrs.isAutomaticallyClosed) {\n            const age = (0, _formatter.relativeAge)(closeDate.toDate(), {\n              addAgo: true\n            });\n            label = _discourseI18n.default.t(\"poll.automatic_close.age\", {\n              age\n            });\n            icon = \"lock\";\n          } else {\n            const timeLeft = moment().to(closeDate, true);\n            label = _discourseI18n.default.t(\"poll.automatic_close.closes_in\", {\n              timeLeft\n            });\n            icon = \"far-clock\";\n          }\n          instructions.push(new _rawHtml.default({\n            html: `<li title=\"${title}\">\n                    ${(0, _iconLibrary.iconHTML)(icon)}\n                    <span>${label}</span>\n                   </li>`\n          }));\n        }\n      }\n      let infoText;\n      if (poll.results === \"on_vote\" && !attrs.hasVoted && !isMe) {\n        infoText = new _rawHtml.default({\n          html: `<li>\n                ${(0, _iconLibrary.iconHTML)(\"check\")}\n                <span>${_discourseI18n.default.t(\"poll.results.vote.title\")}</span>\n               </li>`\n        });\n      } else if (poll.results === \"on_close\" && !closed) {\n        infoText = new _rawHtml.default({\n          html: `<li>\n                ${(0, _iconLibrary.iconHTML)(\"lock\")}\n                <span>${_discourseI18n.default.t(\"poll.results.closed.title\")}</span>\n               </li>`\n        });\n      } else if (poll.results === \"staff_only\" && !isStaff) {\n        infoText = new _rawHtml.default({\n          html: `<li>\n                ${(0, _iconLibrary.iconHTML)(\"shield-alt\")}\n                <span>${_discourseI18n.default.t(\"poll.results.staff.title\")}</span>\n               </li>`\n        });\n      }\n      if (infoText) {\n        instructions.push(infoText);\n      }\n      if (!attrs.isClosed && !attrs.showResults && poll.public && poll.results !== \"staff_only\") {\n        instructions.push(new _rawHtml.default({\n          html: `<li>\n                  ${(0, _iconLibrary.iconHTML)(\"far-eye\")}\n                  <span>${_discourseI18n.default.t(\"poll.public.title\")}</span>\n                 </li>`\n        }));\n      }\n      return [(0, _virtualDom.h)(\"div.poll-info_counts\", contents), (0, _virtualDom.h)(\"ul.poll-info_instructions\", instructions)];\n    }\n  });\n  function clearPieChart(id) {\n    let el = document.querySelector(`#poll-results-chart-${id}`);\n    el && el.parentNode.removeChild(el);\n  }\n  (0, _widget.createWidget)(\"discourse-poll-pie-canvas\", {\n    tagName: \"canvas.poll-results-canvas\",\n    init(attrs) {\n      (0, _loadScript.default)(\"/javascripts/Chart.min.js\").then(() => {\n        const data = attrs.poll.options.mapBy(\"votes\");\n        const labels = attrs.poll.options.mapBy(\"html\");\n        const config = pieChartConfig(data, labels, {\n          legendContainerId: `poll-results-legend-${attrs.id}`\n        });\n        const el = document.getElementById(`poll-results-chart-${attrs.id}`);\n        // eslint-disable-next-line no-undef\n        this._chart = new Chart(el.getContext(\"2d\"), config);\n      });\n    },\n    willRerenderWidget() {\n      this._chart?.destroy();\n    },\n    buildAttributes(attrs) {\n      return {\n        id: `poll-results-chart-${attrs.id}`\n      };\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-pie-chart\", {\n    tagName: \"div.poll-results-chart\",\n    html(attrs) {\n      const contents = [];\n      if (!attrs.showResults) {\n        clearPieChart(attrs.id);\n        return contents;\n      }\n      const chart = this.attach(\"discourse-poll-pie-canvas\", attrs);\n      contents.push(chart);\n      contents.push((0, _virtualDom.h)(`ul#poll-results-legend-${attrs.id}.pie-chart-legends`));\n      return contents;\n    }\n  });\n  const htmlLegendPlugin = {\n    id: \"htmlLegend\",\n    afterUpdate(chart, args, options) {\n      const ul = document.getElementById(options.containerID);\n      ul.innerHTML = \"\";\n      const items = chart.options.plugins.legend.labels.generateLabels(chart);\n      items.forEach(item => {\n        const li = document.createElement(\"li\");\n        li.classList.add(\"legend\");\n        li.onclick = () => {\n          chart.toggleDataVisibility(item.index);\n          chart.update();\n        };\n        const boxSpan = document.createElement(\"span\");\n        boxSpan.classList.add(\"swatch\");\n        boxSpan.style.background = item.fillStyle;\n        const textContainer = document.createElement(\"span\");\n        textContainer.style.color = item.fontColor;\n        textContainer.innerHTML = item.text;\n        if (!chart.getDataVisibility(item.index)) {\n          li.style.opacity = 0.2;\n        } else {\n          li.style.opacity = 1.0;\n        }\n        li.appendChild(boxSpan);\n        li.appendChild(textContainer);\n        ul.appendChild(li);\n      });\n    }\n  };\n  function pieChartConfig(data, labels) {\n    let opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n    const aspectRatio = \"aspectRatio\" in opts ? opts.aspectRatio : 2.2;\n    const strippedLabels = labels.map(l => stripHtml(l));\n    return {\n      type: _pollUiBuilder.PIE_CHART_TYPE,\n      data: {\n        datasets: [{\n          data,\n          backgroundColor: (0, _chartColors.getColors)(data.length)\n        }],\n        labels: strippedLabels\n      },\n      plugins: [htmlLegendPlugin],\n      options: {\n        responsive: true,\n        aspectRatio,\n        animation: {\n          duration: 0\n        },\n        plugins: {\n          legend: {\n            labels: {\n              generateLabels() {\n                return labels.map((text, index) => {\n                  return {\n                    fillStyle: (0, _chartColors.getColors)(data.length)[index],\n                    text,\n                    index\n                  };\n                });\n              }\n            },\n            display: false\n          },\n          htmlLegend: {\n            containerID: opts?.legendContainerId\n          }\n        }\n      }\n    };\n  }\n  function stripHtml(html) {\n    let doc = new DOMParser().parseFromString(html, \"text/html\");\n    return doc.body.textContent || \"\";\n  }\n  (0, _widget.createWidget)(\"discourse-poll-buttons-dropdown\", {\n    tagName: \"div.poll-buttons-dropdown\",\n    buildId(attrs) {\n      return `poll-buttons-dropdown-${attrs.id}`;\n    },\n    transform(attrs) {\n      return {\n        content: this._buildContent(attrs),\n        onChange: item => this.sendWidgetAction(item.id, item.param)\n      };\n    },\n    template: function (attrs, state) {\n      var _r = [];\n      _r.push(\"\\n  \");\n      _r.push(this.attach(\"widget-dropdown\", {\n        \"id\": this.attrs.id,\n        \"icon\": \"cog\",\n        \"label\": \"poll.options.label\",\n        \"content\": this.transformed.content,\n        \"onChange\": this.transformed.onChange,\n        \"options\": this.transformed.options\n      }, undefined, undefined));\n      _r.push(\"\\n\");\n      return _r;\n    },\n    optionsCount(attrs) {\n      return this._buildContent(attrs).length;\n    },\n    _buildContent(attrs) {\n      const contents = [];\n      const isAdmin = this.currentUser && this.currentUser.admin;\n      const dataExplorerEnabled = this.siteSettings.data_explorer_enabled;\n      const exportQueryID = this.siteSettings.poll_export_data_explorer_query_id;\n      const {\n        poll,\n        post\n      } = attrs;\n      const closed = attrs.isClosed;\n      const isStaff = this.currentUser && this.currentUser.staff;\n      const topicArchived = post.get(\"topic.archived\");\n      if (attrs.groupableUserFields.length && poll.voters > 0) {\n        const option = {\n          ...buttonOptionsMap.showBreakdown\n        };\n        option.id = option.action;\n        contents.push(option);\n      }\n      if (isAdmin && dataExplorerEnabled && poll.voters > 0 && exportQueryID) {\n        const option = {\n          ...buttonOptionsMap.exportResults\n        };\n        option.id = option.action;\n        contents.push(option);\n      }\n      if (this.currentUser && (this.currentUser.id === post.user_id || isStaff) && !topicArchived) {\n        if (closed) {\n          if (!attrs.isAutomaticallyClosed) {\n            const option = {\n              ...buttonOptionsMap.openPoll\n            };\n            option.id = option.action;\n            contents.push(option);\n          }\n        } else {\n          const option = {\n            ...buttonOptionsMap.closePoll\n          };\n          option.id = option.action;\n          contents.push(option);\n        }\n      }\n      return contents;\n    }\n  });\n  (0, _widget.createWidget)(\"discourse-poll-buttons\", {\n    tagName: \"div.poll-buttons\",\n    html(attrs) {\n      const contents = [];\n      const {\n        poll,\n        post\n      } = attrs;\n      const topicArchived = post.get(\"topic.archived\");\n      const closed = attrs.isClosed;\n      const staffOnly = poll.results === \"staff_only\";\n      const isStaff = this.currentUser && this.currentUser.staff;\n      const isMe = this.currentUser && post.user_id === this.currentUser.id;\n      const hideResultsDisabled = !staffOnly && (closed || topicArchived);\n      const dropdown = this.attach(\"discourse-poll-buttons-dropdown\", attrs);\n      const dropdownOptionsCount = dropdown.optionsCount(attrs);\n      if (attrs.isMultiple && !hideResultsDisabled && !attrs.showResults) {\n        const castVotesDisabled = !attrs.canCastVotes;\n        contents.push(this.attach(\"button\", {\n          className: `cast-votes ${castVotesDisabled ? \"btn-default\" : \"btn-primary\"}`,\n          label: \"poll.cast-votes.label\",\n          title: \"poll.cast-votes.title\",\n          icon: castVotesDisabled ? \"far-square\" : \"check\",\n          disabled: castVotesDisabled,\n          action: \"castVotes\"\n        }));\n      }\n      if (attrs.showResults && !hideResultsDisabled) {\n        contents.push(this.attach(\"button\", {\n          className: \"btn-default toggle-results\",\n          label: \"poll.hide-results.label\",\n          title: \"poll.hide-results.title\",\n          icon: \"chevron-left\",\n          action: \"toggleResults\"\n        }));\n      }\n      if (!attrs.showResults && !hideResultsDisabled) {\n        let showResultsButton;\n        if (!(poll.results === \"on_vote\" && !attrs.hasVoted && !isMe) && !(poll.results === \"on_close\" && !closed) && !(poll.results === \"staff_only\" && !isStaff) && poll.voters > 0) {\n          showResultsButton = this.attach(\"button\", {\n            className: \"btn-default toggle-results\",\n            label: \"poll.show-results.label\",\n            title: \"poll.show-results.title\",\n            icon: \"chart-bar\",\n            action: \"toggleResults\"\n          });\n        }\n        if (attrs.hasSavedVote) {\n          contents.push(this.attach(\"button\", {\n            className: \"btn-default remove-vote\",\n            label: \"poll.remove-vote.label\",\n            title: \"poll.remove-vote.title\",\n            icon: \"undo\",\n            action: \"removeVote\"\n          }));\n        }\n        if (showResultsButton) {\n          contents.push(showResultsButton);\n        }\n      }\n\n      // only show the dropdown if there's more than 1 button\n      // otherwise just show the button\n      if (dropdownOptionsCount > 1) {\n        contents.push(dropdown);\n      } else if (dropdownOptionsCount === 1) {\n        const singleOptionId = dropdown._buildContent(attrs)[0].id;\n        let singleOption = buttonOptionsMap[singleOptionId];\n        if (singleOptionId === \"toggleStatus\") {\n          singleOption = closed ? buttonOptionsMap.openPoll : buttonOptionsMap.closePoll;\n        }\n        contents.push(this.attach(\"button\", singleOption));\n      }\n      return [contents];\n    }\n  });\n  var _default = _exports.default = (0, _widget.createWidget)(\"discourse-poll\", {\n    tagName: \"div\",\n    buildKey: attrs => `poll-${attrs.id}`,\n    services: [\"dialog\"],\n    buildAttributes(attrs) {\n      let cssClasses = \"poll\";\n      if (attrs.poll.chart_type === _pollUiBuilder.PIE_CHART_TYPE) {\n        cssClasses += \" pie\";\n      }\n      return {\n        class: cssClasses,\n        \"data-poll-name\": attrs.poll.name,\n        \"data-poll-type\": attrs.poll.type\n      };\n    },\n    defaultState(attrs) {\n      const {\n        poll\n      } = attrs;\n      const staffOnly = attrs.poll.results === \"staff_only\";\n      const showResults = poll.results !== \"on_close\" && this.hasVoted() && !staffOnly;\n      return {\n        loading: false,\n        showResults\n      };\n    },\n    html(attrs, state) {\n      const staffOnly = attrs.poll.results === \"staff_only\";\n      const showResults = state.showResults || attrs.post.get(\"topic.archived\") && !staffOnly || this.isClosed() && !staffOnly;\n      const newAttrs = {\n        ...attrs,\n        canCastVotes: this.canCastVotes(),\n        hasVoted: this.hasVoted(),\n        isAutomaticallyClosed: this.isAutomaticallyClosed(),\n        isClosed: this.isClosed(),\n        isMultiple: this.isMultiple(),\n        max: this.max(),\n        min: this.min(),\n        showResults\n      };\n      return [this.attach(\"discourse-poll-container\", newAttrs), this.attach(\"discourse-poll-info\", newAttrs), this.attach(\"discourse-poll-buttons\", newAttrs)];\n    },\n    min() {\n      let min = parseInt(this.attrs.poll.min, 10);\n      if (isNaN(min) || min < 0) {\n        min = 1;\n      }\n      return min;\n    },\n    max() {\n      let max = parseInt(this.attrs.poll.max, 10);\n      const numOptions = this.attrs.poll.options.length;\n      if (isNaN(max) || max > numOptions) {\n        max = numOptions;\n      }\n      return max;\n    },\n    isAutomaticallyClosed() {\n      const {\n        poll\n      } = this.attrs;\n      return poll.close && moment.utc(poll.close, \"YYYY-MM-DD HH:mm:ss Z\") <= moment();\n    },\n    isClosed() {\n      const {\n        poll\n      } = this.attrs;\n      return poll.status === \"closed\" || this.isAutomaticallyClosed();\n    },\n    isMultiple() {\n      const {\n        poll\n      } = this.attrs;\n      return poll.type === \"multiple\";\n    },\n    hasVoted() {\n      const {\n        vote\n      } = this.attrs;\n      return vote && vote.length > 0;\n    },\n    canCastVotes() {\n      const {\n        state,\n        attrs\n      } = this;\n      if (this.isClosed() || state.showResults || state.loading) {\n        return false;\n      }\n      const selectedOptionCount = attrs.vote.length;\n      if (this.isMultiple()) {\n        return selectedOptionCount >= this.min() && selectedOptionCount <= this.max();\n      }\n      return selectedOptionCount > 0;\n    },\n    toggleStatus() {\n      const {\n        state,\n        attrs\n      } = this;\n      const {\n        post,\n        poll\n      } = attrs;\n      if (this.isAutomaticallyClosed()) {\n        return;\n      }\n      this.dialog.yesNoConfirm({\n        message: _discourseI18n.default.t(this.isClosed() ? \"poll.open.confirm\" : \"poll.close.confirm\"),\n        didConfirm: () => {\n          state.loading = true;\n          const status = this.isClosed() ? \"open\" : \"closed\";\n          (0, _ajax.ajax)(\"/polls/toggle_status\", {\n            type: \"PUT\",\n            data: {\n              post_id: post.id,\n              poll_name: poll.name,\n              status\n            }\n          }).then(() => {\n            poll.set(\"status\", status);\n            if (poll.results === \"on_close\") {\n              state.showResults = status === \"closed\";\n            }\n            this.scheduleRerender();\n          }).catch(error => {\n            if (error) {\n              (0, _ajaxError.popupAjaxError)(error);\n            } else {\n              this.dialog.alert(_discourseI18n.default.t(\"poll.error_while_toggling_status\"));\n            }\n          }).finally(() => {\n            state.loading = false;\n          });\n        }\n      });\n    },\n    toggleResults() {\n      this.state.showResults = !this.state.showResults;\n    },\n    removeVote() {\n      const {\n        attrs,\n        state\n      } = this;\n      state.loading = true;\n      return (0, _ajax.ajax)(\"/polls/vote\", {\n        type: \"DELETE\",\n        data: {\n          post_id: attrs.post.id,\n          poll_name: attrs.poll.name\n        }\n      }).then(_ref2 => {\n        let {\n          poll\n        } = _ref2;\n        attrs.poll.setProperties(poll);\n        attrs.vote.length = 0;\n        attrs.hasSavedVote = false;\n        this.appEvents.trigger(\"poll:voted\", poll, attrs.post, attrs.vote);\n      }).catch(error => (0, _ajaxError.popupAjaxError)(error)).finally(() => {\n        state.loading = false;\n      });\n    },\n    exportResults() {\n      const {\n        attrs\n      } = this;\n      const queryID = this.siteSettings.poll_export_data_explorer_query_id;\n\n      // This uses the Data Explorer plugin export as CSV route\n      // There is detection to check if the plugin is enabled before showing the button\n      (0, _ajax.ajax)(`/admin/plugins/explorer/queries/${queryID}/run.csv`, {\n        type: \"POST\",\n        data: {\n          // needed for data-explorer route compatibility\n          params: JSON.stringify({\n            poll_name: attrs.poll.name,\n            post_id: attrs.post.id.toString() // needed for data-explorer route compatibility\n          }),\n\n          explain: false,\n          limit: 1000000,\n          download: 1\n        }\n      }).then(csvContent => {\n        const downloadLink = document.createElement(\"a\");\n        const blob = new Blob([csvContent], {\n          type: \"text/csv;charset=utf-8;\"\n        });\n        downloadLink.href = URL.createObjectURL(blob);\n        downloadLink.setAttribute(\"download\", `poll-export-${attrs.poll.name}-${attrs.post.id}.csv`);\n        downloadLink.click();\n        downloadLink.remove();\n      }).catch(error => {\n        if (error) {\n          (0, _ajaxError.popupAjaxError)(error);\n        } else {\n          this.dialog.alert(_discourseI18n.default.t(\"poll.error_while_exporting_results\"));\n        }\n      });\n    },\n    showLogin() {\n      this.register.lookup(\"route:application\").send(\"showLogin\");\n    },\n    _toggleOption(option) {\n      const {\n        vote\n      } = this.attrs;\n      const chosenIdx = vote.indexOf(option.id);\n      if (chosenIdx !== -1) {\n        vote.splice(chosenIdx, 1);\n      } else {\n        vote.push(option.id);\n      }\n    },\n    toggleOption(option) {\n      const {\n        attrs\n      } = this;\n      if (this.isClosed()) {\n        return;\n      }\n      if (!this.currentUser) {\n        return this.showLogin();\n      }\n      if (!checkUserGroups(this.currentUser, this.attrs.poll)) {\n        return;\n      }\n      const {\n        vote\n      } = attrs;\n      if (!this.isMultiple() && vote.length === 1 && vote[0] === option.id) {\n        return this.removeVote();\n      }\n      if (!this.isMultiple()) {\n        vote.length = 0;\n      }\n      this._toggleOption(option);\n      if (!this.isMultiple()) {\n        return this.castVotes().catch(() => this._toggleOption(option));\n      }\n    },\n    castVotes() {\n      if (!this.canCastVotes()) {\n        return;\n      }\n      if (!this.currentUser) {\n        return this.showLogin();\n      }\n      const {\n        attrs,\n        state\n      } = this;\n      state.loading = true;\n      return (0, _ajax.ajax)(\"/polls/vote\", {\n        type: \"PUT\",\n        data: {\n          post_id: attrs.post.id,\n          poll_name: attrs.poll.name,\n          options: attrs.vote\n        }\n      }).then(_ref3 => {\n        let {\n          poll\n        } = _ref3;\n        attrs.hasSavedVote = true;\n        attrs.poll.setProperties(poll);\n        this.appEvents.trigger(\"poll:voted\", poll, attrs.post, attrs.vote);\n        if (attrs.poll.results !== \"on_close\") {\n          state.showResults = true;\n        }\n        if (attrs.poll.results === \"staff_only\") {\n          if (this.currentUser && this.currentUser.staff) {\n            state.showResults = true;\n          } else {\n            state.showResults = false;\n          }\n        }\n      }).catch(error => {\n        if (error) {\n          (0, _ajaxError.popupAjaxError)(error);\n        } else {\n          this.dialog.alert(_discourseI18n.default.t(\"poll.error_while_casting_votes\"));\n        }\n      }).finally(() => {\n        state.loading = false;\n      });\n    },\n    showBreakdown() {\n      (0, _application.getOwner)(this).lookup(\"service:modal\").show(_pollBreakdown.default, {\n        model: this.attrs\n      });\n    }\n  });\n});","define(\"discourse/plugins/poll/lib/chart-colors\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.getColors = getColors;\n  function getColors(count, palette) {\n    palette = palette || \"cool\";\n    let gradient;\n    switch (palette) {\n      case \"cool\":\n        gradient = {\n          0: [255, 255, 255],\n          25: [220, 237, 200],\n          50: [66, 179, 213],\n          75: [26, 39, 62],\n          100: [0, 0, 0]\n        };\n        break;\n      case \"warm\":\n        gradient = {\n          0: [255, 255, 255],\n          25: [254, 235, 101],\n          50: [228, 82, 27],\n          75: [77, 52, 47],\n          100: [0, 0, 0]\n        };\n        break;\n    }\n    let gradientKeys = Object.keys(gradient);\n    let colors = [];\n    let currentGradientValue;\n    let previousGradientIndex;\n    for (let colorIndex = 0; colorIndex < count; colorIndex++) {\n      currentGradientValue = (colorIndex + 1) * (100 / (count + 1));\n      previousGradientIndex = previousGradientIndex || 0;\n      let baseGradientKeyIndex;\n      for (let y = previousGradientIndex; y < gradientKeys.length; y++) {\n        if (!gradientKeys[y + 1]) {\n          baseGradientKeyIndex = y - 1;\n          break;\n        } else if (currentGradientValue >= gradientKeys[y] && currentGradientValue < gradientKeys[y + 1]) {\n          baseGradientKeyIndex = y;\n          break;\n        }\n      }\n      let differenceMultiplier = (currentGradientValue - gradientKeys[baseGradientKeyIndex]) / (gradientKeys[baseGradientKeyIndex + 1] - gradientKeys[baseGradientKeyIndex]);\n      let color = [];\n      for (let k = 0; k < 3; k++) {\n        color.push(Math.round(gradient[gradientKeys[baseGradientKeyIndex]][k] - (gradient[gradientKeys[baseGradientKeyIndex]][k] - gradient[gradientKeys[baseGradientKeyIndex + 1]][k]) * differenceMultiplier));\n      }\n      colors.push(`rgb(${color.toString()})`);\n      previousGradientIndex = baseGradientKeyIndex;\n    }\n    return colors;\n  }\n});","define(\"discourse/plugins/poll/lib/discourse-markdown/poll\", [\"exports\", \"discourse-i18n\"], function (_exports, _discourseI18n) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setup = setup;\n  /*eslint no-bitwise:0 */\n\n  const DATA_PREFIX = \"data-poll-\";\n  const DEFAULT_POLL_NAME = \"poll\";\n  const ALLOWED_ATTRIBUTES = [\"close\", \"max\", \"min\", \"name\", \"order\", \"public\", \"results\", \"chartType\", \"groups\", \"status\", \"step\", \"type\"];\n  function replaceToken(tokens, target, list) {\n    let pos = tokens.indexOf(target);\n    let level = tokens[pos].level;\n    tokens.splice(pos, 1, ...list);\n    list[0].map = target.map;\n\n    // resequence levels\n    for (; pos < tokens.length; pos++) {\n      let nesting = tokens[pos].nesting;\n      if (nesting < 0) {\n        level--;\n      }\n      tokens[pos].level = level;\n      if (nesting > 0) {\n        level++;\n      }\n    }\n  }\n\n  // analyzes the block to that we have poll options\n  function getListItems(tokens, startToken) {\n    let i = tokens.length - 1;\n    let listItems = [];\n    let buffer = [];\n    for (; tokens[i] !== startToken; i--) {\n      if (i === 0) {\n        return;\n      }\n      let token = tokens[i];\n      if (token.level === 0) {\n        if (token.tag !== \"ol\" && token.tag !== \"ul\") {\n          return;\n        }\n      }\n      if (token.level === 1 && token.nesting === 1) {\n        if (token.tag === \"li\") {\n          listItems.push([token, buffer.reverse().join(\" \")]);\n        } else {\n          return;\n        }\n      }\n      if (token.level === 1 && token.nesting === 1 && token.tag === \"li\") {\n        buffer = [];\n      } else {\n        if (token.type === \"text\" || token.type === \"inline\") {\n          buffer.push(token.content);\n        }\n      }\n    }\n    return listItems.reverse();\n  }\n  function invalidPoll(state, tag) {\n    let token = state.push(\"text\", \"\", 0);\n    token.content = \"[/\" + tag + \"]\";\n  }\n  function getTitle(tokens, startToken) {\n    const startIndex = tokens.indexOf(startToken);\n    if (startIndex === -1) {\n      return;\n    }\n    const pollTokens = tokens.slice(startIndex);\n    const open = pollTokens.findIndex(token => token.type === \"heading_open\");\n    const close = pollTokens.findIndex(token => token.type === \"heading_close\");\n    if (open === -1 || close === -1) {\n      return;\n    }\n    const titleTokens = pollTokens.slice(open + 1, close);\n\n    // Remove the heading element\n    tokens.splice(startIndex + open, close - open + 1);\n    return titleTokens;\n  }\n  const rule = {\n    tag: \"poll\",\n    before(state, tagInfo, raw) {\n      let token = state.push(\"text\", \"\", 0);\n      token.content = raw;\n      token.bbcode_attrs = tagInfo.attrs;\n      token.bbcode_type = \"poll_open\";\n    },\n    after(state, openToken, raw) {\n      const titleTokens = getTitle(state.tokens, openToken);\n      let items = getListItems(state.tokens, openToken);\n      if (!items) {\n        return invalidPoll(state, raw);\n      }\n      const attrs = openToken.bbcode_attrs;\n\n      // default poll attributes\n      const attributes = [[\"class\", \"poll\"]];\n      if (!attrs[\"status\"]) {\n        attributes.push([DATA_PREFIX + \"status\", \"open\"]);\n      }\n      ALLOWED_ATTRIBUTES.forEach(name => {\n        if (attrs[name]) {\n          attributes.push([DATA_PREFIX + name, attrs[name]]);\n        }\n      });\n      if (!attrs.name) {\n        attributes.push([DATA_PREFIX + \"name\", DEFAULT_POLL_NAME]);\n      }\n\n      // we might need these values later...\n      let min = parseInt(attrs[\"min\"], 10);\n      let max = parseInt(attrs[\"max\"], 10);\n      let step = parseInt(attrs[\"step\"], 10);\n\n      // infinite loop if step < 1\n      if (step < 1) {\n        step = 1;\n      }\n      let header = [];\n      let token = new state.Token(\"poll_open\", \"div\", 1);\n      token.block = true;\n      token.attrs = attributes;\n      header.push(token);\n      token = new state.Token(\"poll_open\", \"div\", 1);\n      token.attrs = [[\"class\", \"poll-container\"]];\n      header.push(token);\n      if (titleTokens) {\n        token = new state.Token(\"title_open\", \"div\", 1);\n        token.attrs = [[\"class\", \"poll-title\"]];\n        header.push(token);\n        header.push(...titleTokens);\n        token = new state.Token(\"title_close\", \"div\", -1);\n        header.push(token);\n      }\n\n      // generate the options when the type is \"number\"\n      if (attrs[\"type\"] === \"number\") {\n        // default values\n        if (isNaN(min)) {\n          min = 1;\n        }\n        if (isNaN(max)) {\n          max = state.md.options.discourse.pollMaximumOptions;\n        }\n        if (isNaN(step)) {\n          step = 1;\n        }\n        if (items.length > 0) {\n          return invalidPoll(state, raw);\n        }\n\n        // dynamically generate options\n        token = new state.Token(\"bullet_list_open\", \"ul\", 1);\n        header.push(token);\n        for (let o = min; o <= max; o += step) {\n          token = new state.Token(\"list_item_open\", \"li\", 1);\n          items.push([token, String(o)]);\n          header.push(token);\n          token = new state.Token(\"text\", \"\", 0);\n          token.content = String(o);\n          header.push(token);\n          token = new state.Token(\"list_item_close\", \"li\", -1);\n          header.push(token);\n        }\n        token = new state.Token(\"bullet_item_close\", \"\", -1);\n        header.push(token);\n      }\n\n      // flag items so we add hashes\n      for (let o = 0; o < items.length; o++) {\n        token = items[o][0];\n        let text = items[o][1];\n        token.attrs = token.attrs || [];\n        let md5Hash = md5(JSON.stringify([text]));\n        token.attrs.push([DATA_PREFIX + \"option-id\", md5Hash]);\n      }\n      replaceToken(state.tokens, openToken, header);\n\n      // we got to correct the level on the state\n      // we just resequenced\n      state.level = state.tokens[state.tokens.length - 1].level;\n      state.push(\"poll_close\", \"div\", -1);\n      token = state.push(\"poll_open\", \"div\", 1);\n      token.attrs = [[\"class\", \"poll-info\"]];\n      token = state.push(\"poll_open\", \"div\", 1);\n      token.attrs = [[\"class\", \"poll-info_counts\"]];\n      token = state.push(\"poll_open\", \"div\", 1);\n      token.attrs = [[\"class\", \"poll-info_counts-count\"]];\n      token = state.push(\"span_open\", \"span\", 1);\n      token.block = false;\n      token.attrs = [[\"class\", \"info-number\"]];\n      token = state.push(\"text\", \"\", 0);\n      token.content = \"0\";\n      state.push(\"span_close\", \"span\", -1);\n      token = state.push(\"span_open\", \"span\", 1);\n      token.block = false;\n      token.attrs = [[\"class\", \"info-label\"]];\n      token = state.push(\"text\", \"\", 0);\n      token.content = _discourseI18n.default.t(\"poll.voters\", {\n        count: 0\n      });\n      state.push(\"span_close\", \"span\", -1);\n      state.push(\"poll_close\", \"div\", -1);\n      state.push(\"poll_close\", \"div\", -1);\n      state.push(\"poll_close\", \"div\", -1);\n      state.push(\"poll_close\", \"div\", -1);\n    }\n  };\n  function newApiInit(helper) {\n    helper.registerOptions((opts, siteSettings) => {\n      if (!siteSettings.poll_enabled) {\n        opts.features.poll = false;\n      }\n      opts.pollMaximumOptions = siteSettings.poll_maximum_options;\n    });\n    helper.registerPlugin(md => {\n      md.block.bbcode.ruler.push(\"poll\", rule);\n    });\n  }\n  function setup(helper) {\n    helper.allowList([\"div.poll\", \"div.poll-info\", \"div.poll-info_counts\", \"div.poll-info_counts-count\", \"div.poll-container\", \"div.poll-title\", \"div.poll-buttons\", \"div[data-*]\", \"span.info-number\", \"span.info-text\", \"span.info-label\", \"a.button.cast-votes\", \"a.button.toggle-results\", \"li[data-*]\"]);\n    newApiInit(helper);\n  }\n\n  /*!\n   * Joseph Myer's md5() algorithm wrapped in a self-invoked function to prevent\n   * global namespace pollution, modified to hash unicode characters as UTF-8.\n   *\n   * Copyright 1999-2010, Joseph Myers, Paul Johnston, Greg Holt, Will Bond <will@wbond.net>\n   * http://www.myersdaily.org/joseph/javascript/md5-text.html\n   * http://pajhome.org.uk/crypt/md5\n   *\n   * Released under the BSD license\n   * http://www.opensource.org/licenses/bsd-license\n   */\n  function md5cycle(x, k) {\n    let a = x[0],\n      b = x[1],\n      c = x[2],\n      d = x[3];\n    a = ff(a, b, c, d, k[0], 7, -680876936);\n    d = ff(d, a, b, c, k[1], 12, -389564586);\n    c = ff(c, d, a, b, k[2], 17, 606105819);\n    b = ff(b, c, d, a, k[3], 22, -1044525330);\n    a = ff(a, b, c, d, k[4], 7, -176418897);\n    d = ff(d, a, b, c, k[5], 12, 1200080426);\n    c = ff(c, d, a, b, k[6], 17, -1473231341);\n    b = ff(b, c, d, a, k[7], 22, -45705983);\n    a = ff(a, b, c, d, k[8], 7, 1770035416);\n    d = ff(d, a, b, c, k[9], 12, -1958414417);\n    c = ff(c, d, a, b, k[10], 17, -42063);\n    b = ff(b, c, d, a, k[11], 22, -1990404162);\n    a = ff(a, b, c, d, k[12], 7, 1804603682);\n    d = ff(d, a, b, c, k[13], 12, -40341101);\n    c = ff(c, d, a, b, k[14], 17, -1502002290);\n    b = ff(b, c, d, a, k[15], 22, 1236535329);\n    a = gg(a, b, c, d, k[1], 5, -165796510);\n    d = gg(d, a, b, c, k[6], 9, -1069501632);\n    c = gg(c, d, a, b, k[11], 14, 643717713);\n    b = gg(b, c, d, a, k[0], 20, -373897302);\n    a = gg(a, b, c, d, k[5], 5, -701558691);\n    d = gg(d, a, b, c, k[10], 9, 38016083);\n    c = gg(c, d, a, b, k[15], 14, -660478335);\n    b = gg(b, c, d, a, k[4], 20, -405537848);\n    a = gg(a, b, c, d, k[9], 5, 568446438);\n    d = gg(d, a, b, c, k[14], 9, -1019803690);\n    c = gg(c, d, a, b, k[3], 14, -187363961);\n    b = gg(b, c, d, a, k[8], 20, 1163531501);\n    a = gg(a, b, c, d, k[13], 5, -1444681467);\n    d = gg(d, a, b, c, k[2], 9, -51403784);\n    c = gg(c, d, a, b, k[7], 14, 1735328473);\n    b = gg(b, c, d, a, k[12], 20, -1926607734);\n    a = hh(a, b, c, d, k[5], 4, -378558);\n    d = hh(d, a, b, c, k[8], 11, -2022574463);\n    c = hh(c, d, a, b, k[11], 16, 1839030562);\n    b = hh(b, c, d, a, k[14], 23, -35309556);\n    a = hh(a, b, c, d, k[1], 4, -1530992060);\n    d = hh(d, a, b, c, k[4], 11, 1272893353);\n    c = hh(c, d, a, b, k[7], 16, -155497632);\n    b = hh(b, c, d, a, k[10], 23, -1094730640);\n    a = hh(a, b, c, d, k[13], 4, 681279174);\n    d = hh(d, a, b, c, k[0], 11, -358537222);\n    c = hh(c, d, a, b, k[3], 16, -722521979);\n    b = hh(b, c, d, a, k[6], 23, 76029189);\n    a = hh(a, b, c, d, k[9], 4, -640364487);\n    d = hh(d, a, b, c, k[12], 11, -421815835);\n    c = hh(c, d, a, b, k[15], 16, 530742520);\n    b = hh(b, c, d, a, k[2], 23, -995338651);\n    a = ii(a, b, c, d, k[0], 6, -198630844);\n    d = ii(d, a, b, c, k[7], 10, 1126891415);\n    c = ii(c, d, a, b, k[14], 15, -1416354905);\n    b = ii(b, c, d, a, k[5], 21, -57434055);\n    a = ii(a, b, c, d, k[12], 6, 1700485571);\n    d = ii(d, a, b, c, k[3], 10, -1894986606);\n    c = ii(c, d, a, b, k[10], 15, -1051523);\n    b = ii(b, c, d, a, k[1], 21, -2054922799);\n    a = ii(a, b, c, d, k[8], 6, 1873313359);\n    d = ii(d, a, b, c, k[15], 10, -30611744);\n    c = ii(c, d, a, b, k[6], 15, -1560198380);\n    b = ii(b, c, d, a, k[13], 21, 1309151649);\n    a = ii(a, b, c, d, k[4], 6, -145523070);\n    d = ii(d, a, b, c, k[11], 10, -1120210379);\n    c = ii(c, d, a, b, k[2], 15, 718787259);\n    b = ii(b, c, d, a, k[9], 21, -343485551);\n    x[0] = add32(a, x[0]);\n    x[1] = add32(b, x[1]);\n    x[2] = add32(c, x[2]);\n    x[3] = add32(d, x[3]);\n  }\n  function cmn(q, a, b, x, s, t) {\n    a = add32(add32(a, q), add32(x, t));\n    return add32(a << s | a >>> 32 - s, b);\n  }\n  function ff(a, b, c, d, x, s, t) {\n    return cmn(b & c | ~b & d, a, b, x, s, t);\n  }\n  function gg(a, b, c, d, x, s, t) {\n    return cmn(b & d | c & ~d, a, b, x, s, t);\n  }\n  function hh(a, b, c, d, x, s, t) {\n    return cmn(b ^ c ^ d, a, b, x, s, t);\n  }\n  function ii(a, b, c, d, x, s, t) {\n    return cmn(c ^ (b | ~d), a, b, x, s, t);\n  }\n  function md51(s) {\n    // Converts the string to UTF-8 \"bytes\"\n    s = unescape(encodeURI(s));\n    let n = s.length,\n      state = [1732584193, -271733879, -1732584194, 271733878],\n      i;\n    for (i = 64; i <= s.length; i += 64) {\n      md5cycle(state, md5blk(s.substring(i - 64, i)));\n    }\n    s = s.substring(i - 64);\n    let tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n    for (i = 0; i < s.length; i++) {\n      tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);\n    }\n    tail[i >> 2] |= 0x80 << (i % 4 << 3);\n    if (i > 55) {\n      md5cycle(state, tail);\n      for (i = 0; i < 16; i++) {\n        tail[i] = 0;\n      }\n    }\n    tail[14] = n * 8;\n    md5cycle(state, tail);\n    return state;\n  }\n  function md5blk(s) {\n    /* I figured global was faster.   */\n    let md5blks = [],\n      i; /* Andy King said do it this way. */\n    for (i = 0; i < 64; i += 4) {\n      md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);\n    }\n    return md5blks;\n  }\n  let hex_chr = \"0123456789abcdef\".split(\"\");\n  function rhex(n) {\n    let s = \"\",\n      j = 0;\n    for (; j < 4; j++) {\n      s += hex_chr[n >> j * 8 + 4 & 0x0f] + hex_chr[n >> j * 8 & 0x0f];\n    }\n    return s;\n  }\n  function hex(x) {\n    for (let i = 0; i < x.length; i++) {\n      x[i] = rhex(x[i]);\n    }\n    return x.join(\"\");\n  }\n  function add32(a, b) {\n    return a + b & 0xffffffff;\n  }\n  function md5(s) {\n    return hex(md51(s));\n  }\n});","define(\"discourse/plugins/poll/lib/even-round\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = _default;\n  // works as described on http://stackoverflow.com/a/13483710\n  function sumsUpTo100(percentages) {\n    return percentages.map(p => Math.floor(p)).reduce((a, b) => a + b) === 100;\n  }\n  function _default(percentages) {\n    let decimals = percentages.map(a => a % 1);\n    const sumOfDecimals = Math.ceil(decimals.reduce((a, b) => a + b));\n    // compensate error by adding 1 to n items with the greatest decimal part\n    for (let i = 0, max = decimals.length; i < sumOfDecimals && i < max; i++) {\n      // find the greatest item in the decimals array, set it to 0,\n      // and increase the corresponding item in the percentages array by 1\n      let greatest = 0;\n      let index = 0;\n      for (let j = 0; j < decimals.length; j++) {\n        if (decimals[j] > greatest) {\n          index = j;\n          greatest = decimals[j];\n        }\n      }\n      ++percentages[index];\n      decimals[index] = 0;\n      // quit early when there is a rounding issue\n      if (sumsUpTo100(percentages)) {\n        break;\n      }\n    }\n    return percentages.map(p => Math.floor(p));\n  }\n});"],"mappings":"AAAAA,OAAA,0UAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAMA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC;AAEA,SAAAC,EAAAC,EAAAC,EAAAC,GAAA,OAAAD,EACA,SAAAE,GAAA,IAAAF,EACA,SAAAG,EAAAC,GAAA,oBAAAD,GAAA,OAAAA,EAAA,OAAAA;AAAA,IAAAE,EAAAF,EAAAG,OAAAC;AAAA,QAAAC,IAAAH,EAAA,KAAAI,EAAAJ,EAAAK,KAAAP,EAAAC,GAAA;AAAA,oBAAAK,EAAA,OAAAA;AAAA,UAAAE,UAAA,kEAAAP,EAAAQ,OAAAC,QAAAV,EAAA,CADAW,CAAAZ,EAAA;AAAA,uBAAAF,IAAAY,OAAAZ,EAAA,CADAe,CAAAf,MAAAD,EAAAiB,OAAAC,eAAAlB,EAAAC,EAAA,CAAAC,QAAAiB,YAAA,EAAAC,cAAA,EAAAC,UAAA,IAAArB,EAAAC,GAAAC,EAAAF,CA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