{"version":3,"file":"discourse-local-dates.js","names":["define","_exports","_component","_object","_computed","_runloop","_computed2","_localDates","_text","_environment","_decorators","_discourseI18n","_localDateMarkupGenerator","_templateFactory","_dec","_dec2","_dec3","_dec4","_dec5","_dec6","_dec7","_dec8","_dec9","_dec10","_dec11","_dec12","_dec13","_dec14","_dec15","_dec16","_obj","_applyDecoratedDescriptor","target","property","decorators","descriptor","context","desc","Object","keys","forEach","key","enumerable","configurable","initializer","writable","slice","reverse","reduce","decorator","value","call","undefined","defineProperty","default","__COLOCATED_TEMPLATE__","createTemplateFactory","id","block","moduleName","isStrictMode","setComponentTemplate","extend","observes","debounce","INPUT_DELAY","timeFormat","dateFormat","dateTimeFormat","date","toDate","time","toTime","format","formats","recurring","advancedMode","timezone","fromSelected","fromFilled","notEmpty","toSelected","toFilled","init","this","_super","arguments","_picker","setProperties","timezones","siteSettings","discourse_local_dates_default_formats","split","filter","f","currentUserTimezone","moment","didInsertElement","send","configChanged","_renderPreview","markup","result","cook","set","schedule","applyLocalDates","document","querySelectorAll","isRange","isValid","config","fromConfig","from","dateTime","toConfig","to","diff","options","length","timeInferred","tz","includes","create","range","endOf","computedConfig","currentUser","user_option","guess","allTimezones","names","timezoneIsDifferentFromUserTimezone","propertyNotEqual","formattedCurrentUserTimezone","replace","previewedFormats","map","preview","recurringOptions","name","t","_generateDateMarkup","fromDateTime","toDateTime","toggleModeBtnLabel","text","formattedFrom","formattedTo","emptyText","updateFormat","event","preventDefault","selectedDate","selectedTime","changeSelectedDate","changeSelectedTime","eraseToDateTime","focusFrom","minDate","focusTo","get","toggleAdvancedMode","toggleProperty","save","closeModal","model","insertDate","cancel","getOwnPropertyDescriptor","action","_service","_template","_downloadCalendar","_pluginApi","_toMarkdown","_iconLibrary","_localDatesCreate","_localDateBuilder","dates","discourse_local_dates_enabled","currentUserTZ","element","index","arr","opts","buildOptionsFromElement","attributes","fromElement","toElement","_getDateFromElement","isSame","_rangeIsSameLocalDay","sameLocalDayAsFrom","localDateBuilder","build","innerText","insertAdjacentHTML","formatted","setAttribute","textPreview","classes","pastEvent","push","classList","add","dataset","_rangeElements","duration","startDataset","endDataset","dateElement","startDateTime","trim","_calculateDuration","discourse_local_dates_default_timezones","Boolean","calendar","displayedTimezone","countdown","buildOptionsFromMarkdownTag","parentElement","partitions","ranges","Array","children","span","splice","_partitionedRanges","find","pair","initializeDiscourseLocalDates","api","container","lookup","defaultTitle","site_name","title","decorateCookedElement","elem","helper","topicTitle","getModel","topic","onToolbarCreate","toolbar","addButton","group","icon","sendAction","modifyClass","modal","service","pluginId","actions","insertDiscourseLocalDate","toolbarEvent","show","addText","addTextDecorateCallback","nextElement","_previousElement","metadata","discourseLocalDateStartRangeOpts","class","addTagDecorateCallback","startRangeOpts","endRangeOpts","prefix","buildHtmlPreview","htmlPreviews","previews","previewNode","createElement","current","timezoneNode","appendChild","dateTimeNode","innerHTML","previewsNode","htmlPreview","calendarNode","startDate","endDate","calculateStartAndEndDate","node","renderIcon","toISOString","_downloadCalendarNode","outerHTML","showDatePopover","tooltip","contains","downloadCalendar","startsAt","endsAt","close","content","htmlSafe","initialize","window","addEventListener","passive","withPluginApi","teardown","removeEventListener","bind","DateWithZoneHelper","fromDatetime","datetime","localTimezone","year","month","day","hour","minute","second","constructor","params","getProperties","isDST","unitRepetitionsBetweenDates","count","unit","Math","abs","fractional","trunc","parseInt","_fromDatetime","clone","subtract","datetimeWithZone","_bbcodeBlock","setup","allowList","registerOptions","datesEmailFormat","discourse_local_dates_email_format","features","registerPlugin","md","rule","matcher","onMatch","addLocalDate","core","textPostProcess","ruler","addLocalRange","link","timezoneNames","addSingleLocalDate","buffer","state","token","Token","attrs","utils","escapeHtml","match","closeBuffer","invalid","join","utc","formattedDateTime","discourse","defaultFormat","parseTagAttributes","tag","matchString","parseBBCodeTag","matches","parsed","_dateWithZoneHelper","TIME_FORMAT","Set","x","localDate","isAfter","type","repetitionsForType","_generatePreviews","hasTime","_applyFormatting","_generateTextPreviews","_zoneWithoutPrefix","previewedTimezones","_isEqualZones","_createDateTimeRange","any","unshift","uniqBy","timezoneA","timezoneB","utcOffset","startRange","_calculateDatesForRange","formatElements","_optionalTimeIcon","concat","_endDateFormat","_shortFormat","diffTime","humanize","sameTimezone","inCalendarRange","isBetween","_timeOnlyFormat","hours","minutes","_calendarFormats","_formatWithZone","sameDay","_translateCalendarKey","nextDay","lastDay","sameElse","translated","w","_formatTimezone","part1","part2","localTime","_utils","isEmpty","isArray"],"sources":["discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create.js","discourse/plugins/discourse-local-dates/initializers/discourse-local-dates.js","discourse/plugins/discourse-local-dates/lib/date-with-zone-helper.js","discourse/plugins/discourse-local-dates/lib/discourse-markdown/discourse-local-dates.js","discourse/plugins/discourse-local-dates/lib/local-date-builder.js","discourse/plugins/discourse-local-dates/lib/local-date-markup-generator.js"],"sourcesContent":["define(\"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create\", [\"exports\", \"@ember/component\", \"@ember/object\", \"@ember/object/computed\", \"@ember/runloop\", \"discourse/lib/computed\", \"discourse/lib/local-dates\", \"discourse/lib/text\", \"discourse-common/config/environment\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", \"@ember/template-factory\"], function (_exports, _component, _object, _computed, _runloop, _computed2, _localDates, _text, _environment, _decorators, _discourseI18n, _localDateMarkupGenerator, _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, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _obj;\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 __COLOCATED_TEMPLATE__ = (0, _templateFactory.createTemplateFactory)(\n  /*\n    <DModal\n    @title={{i18n \"discourse_local_dates.title\"}}\n    @closeModal={{@closeModal}}\n    class=\"discourse-local-dates-create-modal -large\"\n  >\n    <:body>\n      <div class=\"form\">\n        {{#if this.isValid}}\n          {{#if this.timezoneIsDifferentFromUserTimezone}}\n            <div class=\"preview alert alert-info\">\n              {{i18n \"discourse_local_dates.create.form.current_timezone\"}}\n              <b>{{this.formattedCurrentUserTimezone}}</b>{{this.currentPreview}}\n            </div>\n          {{/if}}\n        {{else}}\n          <div class=\"validation-error alert alert-error\">\n            {{i18n \"discourse_local_dates.create.form.invalid_date\"}}\n          </div>\n        {{/if}}\n  \n        {{this.computeDate}}\n  \n        <div class=\"date-time-configuration\">\n          <div class=\"inputs-panel\">\n            <div\n              class=\"date-time-control from\n                {{if this.fromSelected 'is-selected'}}\n                {{if this.fromFilled 'is-filled'}}\"\n            >\n              {{d-icon \"calendar-alt\"}}\n              <DButton\n                @action={{this.focusFrom}}\n                @translatedLabel={{this.formattedFrom}}\n                id=\"from-date-time\"\n                class=\"date-time\"\n                autofocus\n              />\n            </div>\n  \n            <div\n              class=\"date-time-control to\n                {{if this.toSelected 'is-selected'}}\n                {{if this.toFilled 'is-filled'}}\"\n            >\n              {{d-icon \"calendar-alt\"}}\n              <DButton\n                @action={{this.focusTo}}\n                @translatedLabel={{this.formattedTo}}\n                class=\"date-time\"\n              />\n              {{#if this.toFilled}}\n                <DButton\n                  @action={{this.eraseToDateTime}}\n                  @icon=\"times\"\n                  class=\"delete-to-date\"\n                />\n              {{/if}}\n            </div>\n  \n            {{#if this.site.desktopView}}\n              <TimezoneInput\n                @options={{hash icon=\"globe\"}}\n                @value={{this.timezone}}\n                @onChange={{fn (mut this.timezone)}}\n              />\n            {{/if}}\n          </div>\n  \n          <div class=\"picker-panel\">\n            <CalendarDateTimeInput\n              @datePickerId=\"local-date-create-form\"\n              @date={{this.selectedDate}}\n              @time={{this.selectedTime}}\n              @minDate={{this.minDate}}\n              @timeFormat={{this.timeFormat}}\n              @dateFormat={{this.dateFormat}}\n              @onChangeDate={{action this.changeSelectedDate}}\n              @onChangeTime={{action this.changeSelectedTime}}\n            />\n          </div>\n  \n          {{#if this.site.mobileView}}\n            <TimezoneInput\n              @value={{this.timezone}}\n              @options={{hash icon=\"globe\"}}\n              @onChange={{fn (mut this.timezone)}}\n            />\n          {{/if}}\n        </div>\n  \n        {{#if this.advancedMode}}\n          <div class=\"advanced-options\">\n            {{#unless this.isRange}}\n              <div class=\"control-group recurrence\">\n                <label class=\"control-label\">\n                  {{i18n \"discourse_local_dates.create.form.recurring_title\"}}\n                </label>\n                <p>{{html-safe\n                    (i18n\n                      \"discourse_local_dates.create.form.recurring_description\"\n                    )\n                  }}</p>\n                <div class=\"controls\">\n                  <ComboBox\n                    @content={{this.recurringOptions}}\n                    @value={{this.recurring}}\n                    @onChange={{fn (mut this.recurring)}}\n                    @options={{hash\n                      none=\"discourse_local_dates.create.form.recurring_none\"\n                    }}\n                    class=\"recurrence-input\"\n                  />\n                </div>\n              </div>\n            {{/unless}}\n  \n            <div class=\"control-group timezones\">\n              <label>{{i18n\n                  \"discourse_local_dates.create.form.timezones_title\"\n                }}</label>\n              <p>{{i18n\n                  \"discourse_local_dates.create.form.timezones_description\"\n                }}</p>\n              <div class=\"controls\">\n                <MultiSelect\n                  @valueProperty={{null}}\n                  @nameProperty={{null}}\n                  @content={{this.allTimezones}}\n                  @value={{this.timezones}}\n                  @options={{hash allowAny=false maximum=5}}\n                  class=\"timezones-input\"\n                />\n              </div>\n            </div>\n  \n            <div class=\"control-group format\">\n              <label>{{i18n\n                  \"discourse_local_dates.create.form.format_title\"\n                }}</label>\n              <p>\n                {{i18n \"discourse_local_dates.create.form.format_description\"}}\n                <a\n                  target=\"_blank\"\n                  href=\"https://momentjs.com/docs/#/parsing/string-format/\"\n                  rel=\"noopener noreferrer\"\n                >\n                  {{d-icon \"question-circle\"}}\n                </a>\n              </p>\n              <div class=\"controls\">\n                <TextField @value={{this.format}} class=\"format-input\" />\n              </div>\n            </div>\n            <div class=\"control-group\">\n              <ul class=\"formats\">\n                {{#each this.previewedFormats as |previewedFormat|}}\n                  <li class=\"format\">\n                    <a\n                      class=\"moment-format\"\n                      href\n                      {{on \"click\" (fn this.updateFormat previewedFormat.format)}}\n                    >\n                      {{previewedFormat.format}}\n                    </a>\n                    <span class=\"previewed-format\">\n                      {{previewedFormat.preview}}\n                    </span>\n                  </li>\n                {{/each}}\n              </ul>\n            </div>\n          </div>\n        {{/if}}\n      </div>\n    </:body>\n  \n    <:footer>\n  \n      {{#if this.isValid}}\n        <DButton\n          @action={{this.save}}\n          @label=\"discourse_local_dates.create.form.insert\"\n          class=\"btn-primary\"\n        />\n      {{/if}}\n  \n      <DButton\n        @action={{this.cancel}}\n        @translatedLabel={{i18n \"cancel\"}}\n        class=\"btn-flat\"\n      />\n  \n      <DButton\n        @action={{this.toggleAdvancedMode}}\n        @icon=\"cog\"\n        @label={{this.toggleModeBtnLabel}}\n        class=\"btn-default advanced-mode-btn\"\n      />\n    </:footer>\n  </DModal>\n  */\n  {\n    \"id\": \"V7Ksr4AM\",\n    \"block\": \"[[[8,[39,0],[[24,0,\\\"discourse-local-dates-create-modal -large\\\"]],[[\\\"@title\\\",\\\"@closeModal\\\"],[[28,[37,1],[\\\"discourse_local_dates.title\\\"],null],[30,1]]],[[\\\"body\\\",\\\"footer\\\"],[[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"form\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"isValid\\\"]],[[[41,[30,0,[\\\"timezoneIsDifferentFromUserTimezone\\\"]],[[[1,\\\"          \\\"],[10,0],[14,0,\\\"preview alert alert-info\\\"],[12],[1,\\\"\\\\n            \\\"],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.current_timezone\\\"],null]],[1,\\\"\\\\n            \\\"],[10,\\\"b\\\"],[12],[1,[30,0,[\\\"formattedCurrentUserTimezone\\\"]]],[13],[1,[30,0,[\\\"currentPreview\\\"]]],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[]],[[[1,\\\"        \\\"],[10,0],[14,0,\\\"validation-error alert alert-error\\\"],[12],[1,\\\"\\\\n          \\\"],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.invalid_date\\\"],null]],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\"]],[]]],[1,\\\"\\\\n      \\\"],[1,[30,0,[\\\"computeDate\\\"]]],[1,\\\"\\\\n\\\\n      \\\"],[10,0],[14,0,\\\"date-time-configuration\\\"],[12],[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"inputs-panel\\\"],[12],[1,\\\"\\\\n          \\\"],[10,0],[15,0,[29,[\\\"date-time-control from\\\\n              \\\",[52,[30,0,[\\\"fromSelected\\\"]],\\\"is-selected\\\"],\\\"\\\\n              \\\",[52,[30,0,[\\\"fromFilled\\\"]],\\\"is-filled\\\"]]]],[12],[1,\\\"\\\\n            \\\"],[1,[28,[35,3],[\\\"calendar-alt\\\"],null]],[1,\\\"\\\\n            \\\"],[8,[39,4],[[24,1,\\\"from-date-time\\\"],[24,0,\\\"date-time\\\"],[24,\\\"autofocus\\\",\\\"\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"focusFrom\\\"]],[30,0,[\\\"formattedFrom\\\"]]]],null],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\\n          \\\"],[10,0],[15,0,[29,[\\\"date-time-control to\\\\n              \\\",[52,[30,0,[\\\"toSelected\\\"]],\\\"is-selected\\\"],\\\"\\\\n              \\\",[52,[30,0,[\\\"toFilled\\\"]],\\\"is-filled\\\"]]]],[12],[1,\\\"\\\\n            \\\"],[1,[28,[35,3],[\\\"calendar-alt\\\"],null]],[1,\\\"\\\\n            \\\"],[8,[39,4],[[24,0,\\\"date-time\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"focusTo\\\"]],[30,0,[\\\"formattedTo\\\"]]]],null],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"toFilled\\\"]],[[[1,\\\"              \\\"],[8,[39,4],[[24,0,\\\"delete-to-date\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[30,0,[\\\"eraseToDateTime\\\"]],\\\"times\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"          \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"desktopView\\\"]],[[[1,\\\"            \\\"],[8,[39,5],null,[[\\\"@options\\\",\\\"@value\\\",\\\"@onChange\\\"],[[28,[37,6],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[30,0,[\\\"timezone\\\"]],[28,[37,7],[[28,[37,8],[[30,0,[\\\"timezone\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"        \\\"],[13],[1,\\\"\\\\n\\\\n        \\\"],[10,0],[14,0,\\\"picker-panel\\\"],[12],[1,\\\"\\\\n          \\\"],[8,[39,9],null,[[\\\"@datePickerId\\\",\\\"@date\\\",\\\"@time\\\",\\\"@minDate\\\",\\\"@timeFormat\\\",\\\"@dateFormat\\\",\\\"@onChangeDate\\\",\\\"@onChangeTime\\\"],[\\\"local-date-create-form\\\",[30,0,[\\\"selectedDate\\\"]],[30,0,[\\\"selectedTime\\\"]],[30,0,[\\\"minDate\\\"]],[30,0,[\\\"timeFormat\\\"]],[30,0,[\\\"dateFormat\\\"]],[28,[37,10],[[30,0],[30,0,[\\\"changeSelectedDate\\\"]]],null],[28,[37,10],[[30,0],[30,0,[\\\"changeSelectedTime\\\"]]],null]]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"mobileView\\\"]],[[[1,\\\"          \\\"],[8,[39,5],null,[[\\\"@value\\\",\\\"@options\\\",\\\"@onChange\\\"],[[30,0,[\\\"timezone\\\"]],[28,[37,6],null,[[\\\"icon\\\"],[\\\"globe\\\"]]],[28,[37,7],[[28,[37,8],[[30,0,[\\\"timezone\\\"]]],null]],null]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"      \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"advancedMode\\\"]],[[[1,\\\"        \\\"],[10,0],[14,0,\\\"advanced-options\\\"],[12],[1,\\\"\\\\n\\\"],[41,[51,[30,0,[\\\"isRange\\\"]]],[[[1,\\\"            \\\"],[10,0],[14,0,\\\"control-group recurrence\\\"],[12],[1,\\\"\\\\n              \\\"],[10,\\\"label\\\"],[14,0,\\\"control-label\\\"],[12],[1,\\\"\\\\n                \\\"],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.recurring_title\\\"],null]],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n              \\\"],[10,2],[12],[1,[28,[35,12],[[28,[37,1],[\\\"discourse_local_dates.create.form.recurring_description\\\"],null]],null]],[13],[1,\\\"\\\\n              \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n                \\\"],[8,[39,13],[[24,0,\\\"recurrence-input\\\"]],[[\\\"@content\\\",\\\"@value\\\",\\\"@onChange\\\",\\\"@options\\\"],[[30,0,[\\\"recurringOptions\\\"]],[30,0,[\\\"recurring\\\"]],[28,[37,7],[[28,[37,8],[[30,0,[\\\"recurring\\\"]]],null]],null],[28,[37,6],null,[[\\\"none\\\"],[\\\"discourse_local_dates.create.form.recurring_none\\\"]]]]],null],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n          \\\"],[10,0],[14,0,\\\"control-group timezones\\\"],[12],[1,\\\"\\\\n            \\\"],[10,\\\"label\\\"],[12],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.timezones_title\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,2],[12],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.timezones_description\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n              \\\"],[8,[39,14],[[24,0,\\\"timezones-input\\\"]],[[\\\"@valueProperty\\\",\\\"@nameProperty\\\",\\\"@content\\\",\\\"@value\\\",\\\"@options\\\"],[null,null,[30,0,[\\\"allTimezones\\\"]],[30,0,[\\\"timezones\\\"]],[28,[37,6],null,[[\\\"allowAny\\\",\\\"maximum\\\"],[false,5]]]]],null],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\\n          \\\"],[10,0],[14,0,\\\"control-group format\\\"],[12],[1,\\\"\\\\n            \\\"],[10,\\\"label\\\"],[12],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.format_title\\\"],null]],[13],[1,\\\"\\\\n            \\\"],[10,2],[12],[1,\\\"\\\\n              \\\"],[1,[28,[35,1],[\\\"discourse_local_dates.create.form.format_description\\\"],null]],[1,\\\"\\\\n              \\\"],[10,3],[14,\\\"target\\\",\\\"_blank\\\"],[14,6,\\\"https://momentjs.com/docs/#/parsing/string-format/\\\"],[14,\\\"rel\\\",\\\"noopener noreferrer\\\"],[12],[1,\\\"\\\\n                \\\"],[1,[28,[35,3],[\\\"question-circle\\\"],null]],[1,\\\"\\\\n              \\\"],[13],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n            \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n              \\\"],[8,[39,15],[[24,0,\\\"format-input\\\"]],[[\\\"@value\\\"],[[30,0,[\\\"format\\\"]]]],null],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n          \\\"],[10,0],[14,0,\\\"control-group\\\"],[12],[1,\\\"\\\\n            \\\"],[10,\\\"ul\\\"],[14,0,\\\"formats\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[37,17],[[28,[37,17],[[30,0,[\\\"previewedFormats\\\"]]],null]],null],null,[[[1,\\\"                \\\"],[10,\\\"li\\\"],[14,0,\\\"format\\\"],[12],[1,\\\"\\\\n                  \\\"],[11,3],[24,0,\\\"moment-format\\\"],[24,6,\\\"\\\"],[4,[38,18],[\\\"click\\\",[28,[37,7],[[30,0,[\\\"updateFormat\\\"]],[30,2,[\\\"format\\\"]]],null]],null],[12],[1,\\\"\\\\n                    \\\"],[1,[30,2,[\\\"format\\\"]]],[1,\\\"\\\\n                  \\\"],[13],[1,\\\"\\\\n                  \\\"],[10,1],[14,0,\\\"previewed-format\\\"],[12],[1,\\\"\\\\n                    \\\"],[1,[30,2,[\\\"preview\\\"]]],[1,\\\"\\\\n                  \\\"],[13],[1,\\\"\\\\n                \\\"],[13],[1,\\\"\\\\n\\\"]],[2]],null],[1,\\\"            \\\"],[13],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"    \\\"],[13],[1,\\\"\\\\n  \\\"]],[]],[[[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"isValid\\\"]],[[[1,\\\"      \\\"],[8,[39,4],[[24,0,\\\"btn-primary\\\"]],[[\\\"@action\\\",\\\"@label\\\"],[[30,0,[\\\"save\\\"]],\\\"discourse_local_dates.create.form.insert\\\"]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n    \\\"],[8,[39,4],[[24,0,\\\"btn-flat\\\"]],[[\\\"@action\\\",\\\"@translatedLabel\\\"],[[30,0,[\\\"cancel\\\"]],[28,[37,1],[\\\"cancel\\\"],null]]],null],[1,\\\"\\\\n\\\\n    \\\"],[8,[39,4],[[24,0,\\\"btn-default advanced-mode-btn\\\"]],[[\\\"@action\\\",\\\"@icon\\\",\\\"@label\\\"],[[30,0,[\\\"toggleAdvancedMode\\\"]],\\\"cog\\\",[30,0,[\\\"toggleModeBtnLabel\\\"]]]],null],[1,\\\"\\\\n  \\\"]],[]]]]]],[\\\"@closeModal\\\",\\\"previewedFormat\\\"],false,[\\\"d-modal\\\",\\\"i18n\\\",\\\"if\\\",\\\"d-icon\\\",\\\"d-button\\\",\\\"timezone-input\\\",\\\"hash\\\",\\\"fn\\\",\\\"mut\\\",\\\"calendar-date-time-input\\\",\\\"action\\\",\\\"unless\\\",\\\"html-safe\\\",\\\"combo-box\\\",\\\"multi-select\\\",\\\"text-field\\\",\\\"each\\\",\\\"-track-array\\\",\\\"on\\\"]]\",\n    \"moduleName\": \"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create.hbs\",\n    \"isStrictMode\": false\n  });\n  var _default = _exports.default = (0, _component.setComponentTemplate)(__COLOCATED_TEMPLATE__, _component.default.extend((_dec = (0, _decorators.observes)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\"), _dec2 = (0, _decorators.debounce)(_environment.INPUT_DELAY), _dec3 = (0, _decorators.default)(\"date\", \"toDate\", \"toTime\"), _dec4 = (0, _decorators.default)(\"computedConfig\", \"isRange\"), _dec5 = (0, _decorators.default)(\"date\", \"time\", \"isRange\", \"options.{format,timezone}\"), _dec6 = (0, _decorators.default)(\"toDate\", \"toTime\", \"isRange\", \"options.{timezone,format}\"), _dec7 = (0, _decorators.default)(\"recurring\", \"timezones\", \"timezone\", \"format\"), _dec8 = (0, _decorators.default)(\"fromConfig.{date}\", \"toConfig.{date}\", \"options.{recurring,timezones,timezone,format}\"), _dec9 = (0, _decorators.default)(\"currentUserTimezone\"), _dec10 = (0, _decorators.default)(\"formats\"), _dec11 = (0, _decorators.default)(\"advancedMode\"), _dec12 = (0, _decorators.default)(\"computedConfig.{from,to,options}\", \"options\", \"isValid\", \"isRange\"), _dec13 = (0, _decorators.default)(\"fromConfig.dateTime\"), _dec14 = (0, _decorators.default)(\"toConfig.dateTime\", \"toSelected\"), _dec15 = (0, _decorators.default)(\"fromSelected\", \"toSelected\"), _dec16 = (0, _decorators.default)(\"fromSelected\", \"toSelected\"), (_obj = {\n    timeFormat: \"HH:mm:ss\",\n    dateFormat: \"YYYY-MM-DD\",\n    dateTimeFormat: \"YYYY-MM-DD HH:mm:ss\",\n    date: null,\n    toDate: null,\n    time: null,\n    toTime: null,\n    format: null,\n    formats: null,\n    recurring: null,\n    advancedMode: false,\n    timezone: null,\n    fromSelected: null,\n    fromFilled: (0, _computed.notEmpty)(\"date\"),\n    toSelected: null,\n    toFilled: (0, _computed.notEmpty)(\"toDate\"),\n    init() {\n      this._super(...arguments);\n      this._picker = null;\n      this.setProperties({\n        timezones: [],\n        formats: (this.siteSettings.discourse_local_dates_default_formats || \"\").split(\"|\").filter(f => f),\n        timezone: this.currentUserTimezone,\n        date: moment().format(this.dateFormat)\n      });\n    },\n    didInsertElement() {\n      this._super(...arguments);\n      this.send(\"focusFrom\");\n    },\n    configChanged() {\n      this._renderPreview();\n    },\n    async _renderPreview() {\n      if (this.markup) {\n        const result = await (0, _text.cook)(this.markup);\n        this.set(\"currentPreview\", result);\n        (0, _runloop.schedule)(\"afterRender\", () => {\n          (0, _localDates.applyLocalDates)(document.querySelectorAll(\".preview .discourse-local-date\"), this.siteSettings);\n        });\n      }\n    },\n    isRange(date, toDate, toTime) {\n      return date && (toDate || toTime);\n    },\n    isValid(config, isRange) {\n      const fromConfig = config.from;\n      if (!config.from.dateTime || !config.from.dateTime.isValid()) {\n        return false;\n      }\n      if (isRange) {\n        const toConfig = config.to;\n        if (!toConfig.dateTime || !toConfig.dateTime.isValid() || toConfig.dateTime.diff(fromConfig.dateTime) < 0) {\n          return false;\n        }\n      }\n      return true;\n    },\n    fromConfig(date, time, isRange) {\n      let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n      const timeInferred = time ? false : true;\n      let dateTime;\n      if (!timeInferred) {\n        dateTime = moment.tz(`${date} ${time}`, options.timezone);\n      } else {\n        dateTime = moment.tz(date, options.timezone);\n      }\n      if (!timeInferred) {\n        time = dateTime.format(this.timeFormat);\n      }\n      let format = options.format;\n      if (timeInferred && this.formats.includes(format)) {\n        format = \"LL\";\n      }\n      return _object.default.create({\n        date: dateTime.format(this.dateFormat),\n        time,\n        dateTime,\n        format,\n        range: isRange ? \"start\" : false\n      });\n    },\n    toConfig(date, time, isRange) {\n      let options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n      const timeInferred = time ? false : true;\n      if (time && !date) {\n        date = moment().format(this.dateFormat);\n      }\n      let dateTime;\n      if (!timeInferred) {\n        dateTime = moment.tz(`${date} ${time}`, options.timezone);\n      } else {\n        dateTime = moment.tz(date, options.timezone).endOf(\"day\");\n      }\n      if (!timeInferred) {\n        time = dateTime.format(this.timeFormat);\n      }\n      let format = options.format;\n      if (timeInferred && this.formats.includes(format)) {\n        format = \"LL\";\n      }\n      return _object.default.create({\n        date: dateTime.format(this.dateFormat),\n        time,\n        dateTime,\n        format,\n        range: isRange ? \"end\" : false\n      });\n    },\n    options(recurring, timezones, timezone, format) {\n      return _object.default.create({\n        recurring,\n        timezones,\n        timezone,\n        format\n      });\n    },\n    computedConfig(fromConfig, toConfig, options) {\n      return _object.default.create({\n        from: fromConfig,\n        to: toConfig,\n        options\n      });\n    },\n    currentUserTimezone() {\n      return this.currentUser.user_option.timezone || moment.tz.guess();\n    },\n    allTimezones() {\n      return moment.tz.names();\n    },\n    timezoneIsDifferentFromUserTimezone: (0, _computed2.propertyNotEqual)(\"currentUserTimezone\", \"options.timezone\"),\n    formattedCurrentUserTimezone(timezone) {\n      return timezone.replace(\"_\", \" \").replace(\"Etc/\", \"\").replace(\"/\", \", \");\n    },\n    previewedFormats(formats) {\n      return formats.map(format => {\n        return {\n          format,\n          preview: moment().format(format)\n        };\n      });\n    },\n    recurringOptions() {\n      const key = \"discourse_local_dates.create.form.recurring\";\n      return [{\n        name: _discourseI18n.default.t(`${key}.every_day`),\n        id: \"1.days\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_week`),\n        id: \"1.weeks\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_two_weeks`),\n        id: \"2.weeks\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_month`),\n        id: \"1.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_two_months`),\n        id: \"2.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_three_months`),\n        id: \"3.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_six_months`),\n        id: \"6.months\"\n      }, {\n        name: _discourseI18n.default.t(`${key}.every_year`),\n        id: \"1.years\"\n      }];\n    },\n    _generateDateMarkup(fromDateTime, options, isRange, toDateTime) {\n      return (0, _localDateMarkupGenerator.default)(fromDateTime, options, isRange, toDateTime);\n    },\n    toggleModeBtnLabel(advancedMode) {\n      return advancedMode ? \"discourse_local_dates.create.form.simple_mode\" : \"discourse_local_dates.create.form.advanced_mode\";\n    },\n    markup(config, options, isValid, isRange) {\n      let text;\n      if (isValid && config.from) {\n        if (config.to && config.to.range) {\n          text = this._generateDateMarkup(config.from, options, isRange, config.to);\n        } else {\n          text = this._generateDateMarkup(config.from, options, isRange);\n        }\n      }\n      return text;\n    },\n    formattedFrom(dateTime) {\n      return dateTime.format(\"LLLL\");\n    },\n    formattedTo(dateTime, toSelected) {\n      const emptyText = toSelected ? \"&nbsp;\" : _discourseI18n.default.t(\"discourse_local_dates.create.form.until\");\n      return dateTime.isValid() ? dateTime.format(\"LLLL\") : emptyText;\n    },\n    updateFormat(format, event) {\n      event?.preventDefault();\n      this.set(\"format\", format);\n    },\n    selectedDate(fromSelected) {\n      return fromSelected ? this.date : this.toDate;\n    },\n    selectedTime(fromSelected) {\n      return fromSelected ? this.time : this.toTime;\n    },\n    changeSelectedDate(date) {\n      if (this.fromSelected) {\n        this.set(\"date\", date);\n      } else {\n        this.set(\"toDate\", date);\n      }\n    },\n    changeSelectedTime(time) {\n      if (this.fromSelected) {\n        this.set(\"time\", time);\n      } else {\n        this.set(\"toTime\", time);\n      }\n    },\n    eraseToDateTime() {\n      this.setProperties({\n        toDate: null,\n        toTime: null\n      });\n      this.focusFrom();\n    },\n    focusFrom() {\n      this.setProperties({\n        fromSelected: true,\n        toSelected: false,\n        minDate: null\n      });\n    },\n    focusTo() {\n      this.setProperties({\n        toSelected: true,\n        fromSelected: false,\n        minDate: this.get(\"fromConfig.date\")\n      });\n    },\n    toggleAdvancedMode() {\n      this.toggleProperty(\"advancedMode\");\n    },\n    save() {\n      const markup = this.markup;\n      if (markup) {\n        this.closeModal();\n        this.model.insertDate(markup);\n      }\n    },\n    cancel() {\n      this.closeModal();\n    }\n  }, (_applyDecoratedDescriptor(_obj, \"configChanged\", [_dec], Object.getOwnPropertyDescriptor(_obj, \"configChanged\"), _obj), _applyDecoratedDescriptor(_obj, \"_renderPreview\", [_dec2], Object.getOwnPropertyDescriptor(_obj, \"_renderPreview\"), _obj), _applyDecoratedDescriptor(_obj, \"isRange\", [_dec3], Object.getOwnPropertyDescriptor(_obj, \"isRange\"), _obj), _applyDecoratedDescriptor(_obj, \"isValid\", [_dec4], Object.getOwnPropertyDescriptor(_obj, \"isValid\"), _obj), _applyDecoratedDescriptor(_obj, \"fromConfig\", [_dec5], Object.getOwnPropertyDescriptor(_obj, \"fromConfig\"), _obj), _applyDecoratedDescriptor(_obj, \"toConfig\", [_dec6], Object.getOwnPropertyDescriptor(_obj, \"toConfig\"), _obj), _applyDecoratedDescriptor(_obj, \"options\", [_dec7], Object.getOwnPropertyDescriptor(_obj, \"options\"), _obj), _applyDecoratedDescriptor(_obj, \"computedConfig\", [_dec8], Object.getOwnPropertyDescriptor(_obj, \"computedConfig\"), _obj), _applyDecoratedDescriptor(_obj, \"currentUserTimezone\", [_decorators.default], Object.getOwnPropertyDescriptor(_obj, \"currentUserTimezone\"), _obj), _applyDecoratedDescriptor(_obj, \"allTimezones\", [_decorators.default], Object.getOwnPropertyDescriptor(_obj, \"allTimezones\"), _obj), _applyDecoratedDescriptor(_obj, \"formattedCurrentUserTimezone\", [_dec9], Object.getOwnPropertyDescriptor(_obj, \"formattedCurrentUserTimezone\"), _obj), _applyDecoratedDescriptor(_obj, \"previewedFormats\", [_dec10], Object.getOwnPropertyDescriptor(_obj, \"previewedFormats\"), _obj), _applyDecoratedDescriptor(_obj, \"recurringOptions\", [_decorators.default], Object.getOwnPropertyDescriptor(_obj, \"recurringOptions\"), _obj), _applyDecoratedDescriptor(_obj, \"toggleModeBtnLabel\", [_dec11], Object.getOwnPropertyDescriptor(_obj, \"toggleModeBtnLabel\"), _obj), _applyDecoratedDescriptor(_obj, \"markup\", [_dec12], Object.getOwnPropertyDescriptor(_obj, \"markup\"), _obj), _applyDecoratedDescriptor(_obj, \"formattedFrom\", [_dec13], Object.getOwnPropertyDescriptor(_obj, \"formattedFrom\"), _obj), _applyDecoratedDescriptor(_obj, \"formattedTo\", [_dec14], Object.getOwnPropertyDescriptor(_obj, \"formattedTo\"), _obj), _applyDecoratedDescriptor(_obj, \"updateFormat\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"updateFormat\"), _obj), _applyDecoratedDescriptor(_obj, \"selectedDate\", [_dec15], Object.getOwnPropertyDescriptor(_obj, \"selectedDate\"), _obj), _applyDecoratedDescriptor(_obj, \"selectedTime\", [_dec16], Object.getOwnPropertyDescriptor(_obj, \"selectedTime\"), _obj), _applyDecoratedDescriptor(_obj, \"changeSelectedDate\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"changeSelectedDate\"), _obj), _applyDecoratedDescriptor(_obj, \"changeSelectedTime\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"changeSelectedTime\"), _obj), _applyDecoratedDescriptor(_obj, \"eraseToDateTime\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"eraseToDateTime\"), _obj), _applyDecoratedDescriptor(_obj, \"focusFrom\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"focusFrom\"), _obj), _applyDecoratedDescriptor(_obj, \"focusTo\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"focusTo\"), _obj), _applyDecoratedDescriptor(_obj, \"toggleAdvancedMode\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"toggleAdvancedMode\"), _obj), _applyDecoratedDescriptor(_obj, \"save\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"save\"), _obj), _applyDecoratedDescriptor(_obj, \"cancel\", [_object.action], Object.getOwnPropertyDescriptor(_obj, \"cancel\"), _obj)), _obj))));\n});","define(\"discourse/plugins/discourse-local-dates/initializers/discourse-local-dates\", [\"exports\", \"@ember/service\", \"@ember/template\", \"discourse/lib/download-calendar\", \"discourse/lib/plugin-api\", \"discourse/lib/to-markdown\", \"discourse-common/lib/icon-library\", \"discourse-common/utils/decorators\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", \"discourse/plugins/discourse-local-dates/discourse/components/modal/local-dates-create\", \"discourse/plugins/discourse-local-dates/lib/local-date-builder\"], function (_exports, _service, _template, _downloadCalendar, _pluginApi, _toMarkdown, _iconLibrary, _decorators, _discourseI18n, _localDateMarkupGenerator, _localDatesCreate, _localDateBuilder) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.applyLocalDates = applyLocalDates;\n  _exports.default = void 0;\n  var _obj;\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  // Import applyLocalDates from discourse/lib/local-dates instead\n  function applyLocalDates(dates, siteSettings) {\n    if (!siteSettings.discourse_local_dates_enabled) {\n      return;\n    }\n    const currentUserTZ = moment.tz.guess();\n    dates.forEach((element, index, arr) => {\n      const opts = buildOptionsFromElement(element, siteSettings);\n      if (element.attributes[\"data-range\"]?.value === \"to\" && index !== 0 && arr[index - 1].attributes[\"data-range\"]?.value === \"from\") {\n        const fromElement = arr[index - 1];\n        if (_rangeIsSameLocalDay(fromElement, element)) {\n          opts.sameLocalDayAsFrom = true;\n        }\n      }\n      const localDateBuilder = new _localDateBuilder.default(opts, currentUserTZ).build();\n      element.innerText = \"\";\n      element.insertAdjacentHTML(\"beforeend\", `\n        <svg class=\"fa d-icon d-icon-globe-americas svg-icon\" xmlns=\"http://www.w3.org/2000/svg\">\n          <use href=\"#globe-americas\"></use>\n        </svg>\n        <span class=\"relative-time\">${localDateBuilder.formatted}</span>\n      `);\n      element.setAttribute(\"aria-label\", localDateBuilder.textPreview);\n      const classes = [\"cooked-date\"];\n      if (localDateBuilder.pastEvent) {\n        classes.push(\"past\");\n      }\n      element.classList.add(...classes);\n    });\n  }\n  function _rangeIsSameLocalDay(fromElement, toElement) {\n    if (!fromElement.attributes[\"data-time\"] || !toElement.attributes[\"data-time\"]) {\n      return false;\n    }\n    const timezone = fromElement.attributes[\"data-timezone\"].value;\n    const from = moment(_getDateFromElement(fromElement)).tz(timezone);\n    const to = moment(_getDateFromElement(toElement)).tz(timezone);\n    return from.isSame(to, \"day\");\n  }\n  function _getDateFromElement(element) {\n    return `${element.attributes[\"data-date\"].value}T${element.attributes[\"data-time\"].value}`;\n  }\n  function buildOptionsFromElement(element, siteSettings) {\n    const opts = {};\n    const dataset = element.dataset;\n    if (_rangeElements(element).length === 2) {\n      opts.duration = _calculateDuration(element);\n    }\n    opts.time = dataset.time;\n    opts.date = dataset.date;\n    opts.recurring = dataset.recurring;\n    opts.timezones = (dataset.timezones || siteSettings.discourse_local_dates_default_timezones || \"Etc/UTC\").split(\"|\").filter(Boolean);\n    opts.timezone = dataset.timezone;\n    opts.calendar = (dataset.calendar || \"on\") === \"on\";\n    opts.displayedTimezone = dataset.displayedTimezone;\n    opts.format = dataset.format || (opts.time ? \"LLL\" : \"LL\");\n    opts.countdown = dataset.countdown;\n    return opts;\n  }\n  function buildOptionsFromMarkdownTag(element) {\n    const opts = {};\n\n    // siteSettings defaults as used by buildOptionsFromElement are purposefully\n    // ommitted to reproduce exactly what was on the original element\n    opts.time = element.attributes[\"data-time\"];\n    opts.date = element.attributes[\"data-date\"];\n    opts.recurring = element.attributes[\"data-recurring\"];\n    opts.timezones = element.attributes[\"data-timezones\"];\n    opts.timezone = element.attributes[\"data-timezone\"];\n    opts.calendar = (element.attributes[\"data-calendar\"] || \"on\") === \"on\";\n    opts.displayedTimezone = element.attributes[\"data-displayed-timezone\"];\n    opts.format = element.attributes[\"data-format\"];\n    opts.countdown = element.attributes[\"data-countdown\"];\n    opts.range = element.attributes[\"data-range\"];\n    return opts;\n  }\n  function _rangeElements(element) {\n    if (!element.parentElement) {\n      return [];\n    }\n    if (element.dataset.range) {\n      return _partitionedRanges(element).find(pair => pair.includes(element));\n    }\n    return [element];\n  }\n  function _partitionedRanges(element) {\n    const partitions = [];\n    const ranges = Array.from(element.parentElement.children).filter(span => span.dataset.range);\n    while (ranges.length > 0) {\n      partitions.push(ranges.splice(0, 2));\n    }\n    return partitions;\n  }\n  function initializeDiscourseLocalDates(api) {\n    const siteSettings = api.container.lookup(\"service:site-settings\");\n    const defaultTitle = _discourseI18n.default.t(\"discourse_local_dates.default_title\", {\n      site_name: siteSettings.title\n    });\n    api.decorateCookedElement((elem, helper) => {\n      const dates = elem.querySelectorAll(\".discourse-local-date\");\n      applyLocalDates(dates, siteSettings);\n      const topicTitle = helper?.getModel()?.topic?.title;\n      dates.forEach(date => {\n        date.dataset.title = date.dataset.title || topicTitle || defaultTitle;\n      });\n    });\n    api.onToolbarCreate(toolbar => {\n      toolbar.addButton({\n        title: \"discourse_local_dates.title\",\n        id: \"local-dates\",\n        group: \"extras\",\n        icon: \"calendar-alt\",\n        sendAction: event => toolbar.context.send(\"insertDiscourseLocalDate\", event)\n      });\n    });\n    api.modifyClass(\"component:d-editor\", {\n      modal: (0, _service.service)(),\n      pluginId: \"discourse-local-dates\",\n      actions: {\n        insertDiscourseLocalDate(toolbarEvent) {\n          this.modal.show(_localDatesCreate.default, {\n            model: {\n              insertDate: markup => {\n                toolbarEvent.addText(markup);\n              }\n            }\n          });\n        }\n      }\n    });\n    (0, _toMarkdown.addTextDecorateCallback)(function (text, nextElement, _previousElement, metadata) {\n      if (metadata.discourseLocalDateStartRangeOpts && nextElement?.attributes.class?.includes(\"discourse-local-date\") && text === \"→\") {\n        return \"\";\n      }\n    });\n    (0, _toMarkdown.addTagDecorateCallback)(function () {\n      if (this.element.attributes.class?.includes(\"discourse-local-date\")) {\n        if (this.metadata.discourseLocalDateStartRangeOpts) {\n          const startRangeOpts = this.metadata.discourseLocalDateStartRangeOpts;\n          const endRangeOpts = buildOptionsFromMarkdownTag(this.element);\n          const markup = (0, _localDateMarkupGenerator.default)({\n            date: startRangeOpts.date,\n            time: startRangeOpts.time,\n            format: startRangeOpts.format\n          }, endRangeOpts, true, {\n            date: endRangeOpts.date,\n            time: endRangeOpts.time,\n            format: endRangeOpts.format\n          });\n          this.prefix = markup;\n          this.metadata.discourseLocalDateStartRangeOpts = null;\n          return \"\";\n        }\n        if (this.element.attributes[\"data-range\"] === \"true\" || this.element.attributes[\"data-range\"] === \"from\" || this.element.attributes[\"data-range\"] === \"to\") {\n          this.metadata.discourseLocalDateStartRangeOpts = buildOptionsFromMarkdownTag(this.element);\n          return \"\";\n        }\n        const opts = buildOptionsFromMarkdownTag(this.element, siteSettings);\n        const markup = (0, _localDateMarkupGenerator.default)({\n          date: opts.date,\n          time: opts.time,\n          format: opts.format\n        }, opts, false);\n        this.prefix = markup;\n        return \"\";\n      }\n    });\n  }\n  function buildHtmlPreview(element, siteSettings) {\n    const opts = buildOptionsFromElement(element, siteSettings);\n    const localDateBuilder = new _localDateBuilder.default(opts, moment.tz.guess()).build();\n    const htmlPreviews = localDateBuilder.previews.map(preview => {\n      const previewNode = document.createElement(\"div\");\n      previewNode.classList.add(\"preview\");\n      if (preview.current) {\n        previewNode.classList.add(\"current\");\n      }\n      const timezoneNode = document.createElement(\"span\");\n      timezoneNode.classList.add(\"timezone\");\n      timezoneNode.innerText = preview.timezone;\n      previewNode.appendChild(timezoneNode);\n      const dateTimeNode = document.createElement(\"span\");\n      dateTimeNode.classList.add(\"date-time\");\n      dateTimeNode.innerHTML = preview.formatted;\n      previewNode.appendChild(dateTimeNode);\n      return previewNode;\n    });\n    const previewsNode = document.createElement(\"div\");\n    previewsNode.classList.add(\"locale-dates-previews\");\n    htmlPreviews.forEach(htmlPreview => previewsNode.appendChild(htmlPreview));\n    const calendarNode = _downloadCalendarNode(element);\n    if (calendarNode) {\n      previewsNode.appendChild(calendarNode);\n    }\n    return previewsNode.outerHTML;\n  }\n  function calculateStartAndEndDate(startDataset, endDataset) {\n    let startDate, endDate;\n    startDate = moment.tz(`${startDataset.date} ${startDataset.time || \"\"}`.trim(), startDataset.timezone);\n    if (endDataset) {\n      endDate = moment.tz(`${endDataset.date} ${endDataset.time || \"\"}`.trim(), endDataset.timezone);\n    }\n    return [startDate, endDate];\n  }\n  function _downloadCalendarNode(element) {\n    const [startDataset, endDataset] = _rangeElements(element).map(dateElement => dateElement.dataset);\n    const [startDate, endDate] = calculateStartAndEndDate(startDataset, endDataset);\n    if (startDate < moment().tz(startDataset.timezone)) {\n      return false;\n    }\n    const node = document.createElement(\"div\");\n    node.classList.add(\"download-calendar\");\n    node.innerHTML = `${(0, _iconLibrary.renderIcon)(\"string\", \"file\")} ${_discourseI18n.default.t(\"download_calendar.add_to_calendar\")}`;\n    node.setAttribute(\"data-starts-at\", startDate.toISOString());\n    if (endDataset) {\n      node.setAttribute(\"data-ends-at\", endDate.toISOString());\n    }\n    if (!startDataset.time && !endDataset) {\n      node.setAttribute(\"data-ends-at\", startDate.add(24, \"hours\").toISOString());\n    }\n    node.setAttribute(\"data-title\", startDataset.title);\n    return node;\n  }\n  function _calculateDuration(element) {\n    const [startDataset, endDataset] = _rangeElements(element).map(dateElement => dateElement.dataset);\n    const startDateTime = moment(`${startDataset.date} ${startDataset.time || \"\"}`.trim());\n    const endDateTime = moment(`${endDataset.date} ${endDataset.time || \"\"}`.trim());\n    const duration = endDateTime.diff(startDateTime, \"minutes\");\n\n    // negative duration is used when we calculate difference for end date from range\n    return element.dataset === startDataset ? duration : -duration;\n  }\n  var _default = _exports.default = (_obj = {\n    name: \"discourse-local-dates\",\n    showDatePopover(event) {\n      const tooltip = this.container.lookup(\"service:tooltip\");\n      if (event?.target?.classList?.contains(\"download-calendar\")) {\n        const dataset = event.target.dataset;\n        (0, _downloadCalendar.downloadCalendar)(dataset.title, [{\n          startsAt: dataset.startsAt,\n          endsAt: dataset.endsAt\n        }]);\n        return tooltip.close();\n      }\n      if (!event?.target?.classList?.contains(\"discourse-local-date\")) {\n        return;\n      }\n      const siteSettings = this.container.lookup(\"service:site-settings\");\n      return tooltip.show(event.target, {\n        content: (0, _template.htmlSafe)(buildHtmlPreview(event.target, siteSettings))\n      });\n    },\n    initialize(container) {\n      this.container = container;\n      window.addEventListener(\"click\", this.showDatePopover, {\n        passive: true\n      });\n      const siteSettings = container.lookup(\"service:site-settings\");\n      if (siteSettings.discourse_local_dates_enabled) {\n        (0, _pluginApi.withPluginApi)(\"0.8.8\", initializeDiscourseLocalDates);\n      }\n    },\n    teardown() {\n      window.removeEventListener(\"click\", this.showDatePopover);\n    }\n  }, (_applyDecoratedDescriptor(_obj, \"showDatePopover\", [_decorators.bind], Object.getOwnPropertyDescriptor(_obj, \"showDatePopover\"), _obj)), _obj);\n});","define(\"discourse/plugins/discourse-local-dates/lib/date-with-zone-helper\", [\"exports\", \"@ember/object\"], function (_exports, _object) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  /*\n    DateWithZoneHelper provides a limited list of helpers\n    to manipulate a moment object with timezones\n  \n    - add(count unit) adds a COUNT of UNITS to a date\n    - subtract(count unit) subtracts a COUNT of UNITS to a date\n    - format(format) formats a date with zone in a consistent way, optional moment format\n    - isDST() allows to know if a date in a specified timezone is currently under DST\n    - datetimeWithZone(timezone) returns a new moment object with timezone applied\n    - datetime returns the moment object\n    - unitRepetitionsBetweenDates(duration, date) return the number of repetitions of\n    duration between two dates, eg for duration: \"1.weeks\", \"2.months\"...\n  */\n  class DateWithZoneHelper {\n    static fromDatetime(datetime, timezone, localTimezone) {\n      return new DateWithZoneHelper({\n        year: datetime.year(),\n        month: datetime.month(),\n        day: datetime.date(),\n        hour: datetime.hour(),\n        minute: datetime.minute(),\n        second: datetime.second(),\n        timezone,\n        localTimezone\n      });\n    }\n    constructor() {\n      let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      this.timezone = params.timezone || \"UTC\";\n      this.localTimezone = params.localTimezone || moment.tz.guess();\n      this.datetime = moment.tz((0, _object.getProperties)(params, [\"year\", \"month\", \"day\", \"hour\", \"minute\", \"second\"]), this.timezone);\n    }\n    isDST() {\n      return this.datetime.tz(this.localTimezone).isDST();\n    }\n    unitRepetitionsBetweenDates(duration, date) {\n      const [count, unit] = duration.split(\".\");\n      // get the diff in the specified units with decimals\n      const diff = Math.abs(this.datetime.diff(date, unit, true));\n      // get integer count of duration in diff, eg: 4 hours diff is 2 for 2.hours duration\n      const integer = Math.trunc(diff / count);\n      // get fractional to define if we have to add one \"duration\"\n      const fractional = diff / count % 1;\n      return integer * parseInt(count, 10) + (fractional > 0 ? parseInt(count, 10) : 0);\n    }\n    add(count, unit) {\n      return this._fromDatetime(this.datetime.clone().add(count, unit), this.timezone, this.localTimezone);\n    }\n    subtract(count, unit) {\n      return this._fromDatetime(this.datetime.clone().subtract(count, unit), this.timezone, this.localTimezone);\n    }\n    datetimeWithZone(timezone) {\n      return this.datetime.clone().tz(timezone);\n    }\n    format(format) {\n      if (format) {\n        return this.datetime.tz(this.localTimezone).format(format);\n      }\n      return this.datetime.tz(this.localTimezone).toISOString(true);\n    }\n    _fromDatetime(datetime, timezone, localTimezone) {\n      return DateWithZoneHelper.fromDatetime(datetime, timezone, localTimezone);\n    }\n  }\n  _exports.default = DateWithZoneHelper;\n});","define(\"discourse/plugins/discourse-local-dates/lib/discourse-markdown/discourse-local-dates\", [\"exports\", \"pretty-text/engines/discourse-markdown/bbcode-block\"], function (_exports, _bbcodeBlock) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.setup = setup;\n  moment.tz.link([\"Asia/Kolkata|IST\", \"Asia/Seoul|KST\", \"Asia/Tokyo|JST\"]);\n  const timezoneNames = moment.tz.names();\n  function addSingleLocalDate(buffer, state, config) {\n    let token = new state.Token(\"span_open\", \"span\", 1);\n    token.attrs = [[\"data-date\", state.md.utils.escapeHtml(config.date)]];\n    if (!config.date.match(/\\d{4}-\\d{2}-\\d{2}/)) {\n      closeBuffer(buffer, state, moment.invalid().format());\n      return;\n    }\n    if (config.time && !config.time.match(/\\d{2}:\\d{2}(?::\\d{2})?/)) {\n      closeBuffer(buffer, state, moment.invalid().format());\n      return;\n    }\n    let dateTime = config.date;\n    if (config.time) {\n      token.attrs.push([\"data-time\", state.md.utils.escapeHtml(config.time)]);\n      dateTime = `${dateTime} ${config.time}`;\n    }\n    if (!moment(dateTime).isValid()) {\n      closeBuffer(buffer, state, moment.invalid().format());\n      return;\n    }\n    token.attrs.push([\"class\", \"discourse-local-date\"]);\n    if (config.format) {\n      token.attrs.push([\"data-format\", state.md.utils.escapeHtml(config.format)]);\n    }\n    if (config.countdown) {\n      token.attrs.push([\"data-countdown\", state.md.utils.escapeHtml(config.countdown)]);\n    }\n    if (config.calendar) {\n      token.attrs.push([\"data-calendar\", state.md.utils.escapeHtml(config.calendar)]);\n    }\n    if (config.range) {\n      token.attrs.push([\"data-range\", config.range]);\n    }\n    if (config.displayedTimezone && timezoneNames.includes(config.displayedTimezone)) {\n      token.attrs.push([\"data-displayed-timezone\", state.md.utils.escapeHtml(config.displayedTimezone)]);\n    }\n    if (config.timezones) {\n      const timezones = config.timezones.split(\"|\").filter(timezone => {\n        return timezoneNames.includes(timezone);\n      });\n      token.attrs.push([\"data-timezones\", state.md.utils.escapeHtml(timezones.join(\"|\"))]);\n    }\n    if (config.timezone && timezoneNames.includes(config.timezone)) {\n      token.attrs.push([\"data-timezone\", state.md.utils.escapeHtml(config.timezone)]);\n      dateTime = moment.tz(dateTime, config.timezone);\n    } else {\n      dateTime = moment.utc(dateTime);\n    }\n    if (config.recurring) {\n      token.attrs.push([\"data-recurring\", state.md.utils.escapeHtml(config.recurring)]);\n    }\n    buffer.push(token);\n    const formattedDateTime = dateTime.tz(\"Etc/UTC\").format(state.md.options.discourse.datesEmailFormat || moment.defaultFormat);\n    token.attrs.push([\"data-email-preview\", `${formattedDateTime} UTC`]);\n    closeBuffer(buffer, state, dateTime.utc().format(config.format));\n  }\n  function defaultDateConfig() {\n    return {\n      date: null,\n      time: null,\n      timezone: null,\n      format: null,\n      timezones: null,\n      displayedTimezone: null,\n      countdown: null,\n      range: false\n    };\n  }\n  function parseTagAttributes(tag) {\n    const matchString = tag.replace(/[‘’„“«»”]/g, '\"');\n    return (0, _bbcodeBlock.parseBBCodeTag)(\"[date date\" + matchString + \"]\", 0, matchString.length + 12);\n  }\n  function addLocalDate(buffer, matches, state) {\n    let config = defaultDateConfig();\n    const parsed = parseTagAttributes(matches[1]);\n    config.date = parsed.attrs.date;\n    config.format = parsed.attrs.format;\n    config.calendar = parsed.attrs.calendar;\n    config.time = parsed.attrs.time;\n    config.timezone = (parsed.attrs.timezone || \"\").trim();\n    config.recurring = parsed.attrs.recurring;\n    config.timezones = parsed.attrs.timezones;\n    config.displayedTimezone = parsed.attrs.displayedTimezone;\n    config.countdown = parsed.attrs.countdown;\n    addSingleLocalDate(buffer, state, config);\n  }\n  function addLocalRange(buffer, matches, state) {\n    let config = defaultDateConfig();\n    let date, time;\n    const parsed = parseTagAttributes(matches[1]);\n    config.format = parsed.attrs.format;\n    config.calendar = parsed.attrs.calendar;\n    config.timezone = (parsed.attrs.timezone || \"\").trim();\n    config.recurring = parsed.attrs.recurring;\n    config.timezones = parsed.attrs.timezones;\n    config.displayedTimezone = parsed.attrs.displayedTimezone;\n    config.countdown = parsed.attrs.countdown;\n    if (parsed.attrs.from) {\n      [date, time] = parsed.attrs.from.split(\"T\");\n      config.date = date;\n      config.time = time;\n      config.range = \"from\";\n      addSingleLocalDate(buffer, state, config);\n    }\n    if (config.range) {\n      const token = new state.Token(\"text\", \"\", 0);\n      token.content = \"→\";\n      buffer.push(token);\n    }\n    if (parsed.attrs.to) {\n      [date, time] = parsed.attrs.to.split(\"T\");\n      config.date = date;\n      config.time = time;\n      config.range = \"to\";\n      addSingleLocalDate(buffer, state, config);\n    }\n  }\n  function closeBuffer(buffer, state, text) {\n    let token;\n    token = new state.Token(\"text\", \"\", 0);\n    token.content = text;\n    buffer.push(token);\n    token = new state.Token(\"span_close\", \"span\", -1);\n    buffer.push(token);\n  }\n  function setup(helper) {\n    helper.allowList([\"span.discourse-local-date\", \"span[aria-label]\", \"span[data-date]\", \"span[data-time]\", \"span[data-format]\", \"span[data-countdown]\", \"span[data-calendar]\", \"span[data-displayed-timezone]\", \"span[data-timezone]\", \"span[data-timezones]\", \"span[data-recurring]\", \"span[data-email-preview]\"]);\n    helper.registerOptions((opts, siteSettings) => {\n      opts.datesEmailFormat = siteSettings.discourse_local_dates_email_format;\n      opts.features[\"discourse-local-dates\"] = !!siteSettings.discourse_local_dates_enabled;\n    });\n    helper.registerPlugin(md => {\n      const rule = {\n        matcher: /\\[date(=.+?)\\]/,\n        onMatch: addLocalDate\n      };\n      md.core.textPostProcess.ruler.push(\"discourse-local-dates\", rule);\n    });\n    helper.registerPlugin(md => {\n      const rule = {\n        matcher: /\\[date-range(.+?)\\]/,\n        onMatch: addLocalRange\n      };\n      md.core.textPostProcess.ruler.push(\"discourse-local-dates\", rule);\n    });\n  }\n});","define(\"discourse/plugins/discourse-local-dates/lib/local-date-builder\", [\"exports\", \"discourse-common/lib/icon-library\", \"discourse-i18n\", \"discourse/plugins/discourse-local-dates/lib/date-with-zone-helper\"], function (_exports, _iconLibrary, _discourseI18n, _dateWithZoneHelper) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const DATETIME_FORMAT = \"LLL\";\n  const DATE_FORMAT = \"LL\";\n  const FULL_DATETIME_FORMAT = \"LLLL\";\n  const TIME_FORMAT = \"h:mm A\";\n  const DAY_OF_THE_WEEK_FORMAT = \"dddd\";\n  const RANGE_SEPARATOR = \"→\";\n  const TIME_ICON = \"clock\";\n  const SHORT_FORMAT_DAYS_PERIOD = 1;\n  class LocalDateBuilder {\n    constructor() {\n      let params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n      let localTimezone = arguments.length > 1 ? arguments[1] : undefined;\n      this.time = params.time;\n      this.date = params.date;\n      this.recurring = params.recurring;\n      this.sameLocalDayAsFrom = params.sameLocalDayAsFrom;\n      this.timezones = Array.from(new Set((params.timezones || []).filter(Boolean)));\n      this.timezone = params.timezone || \"UTC\";\n      this.calendar = typeof params.calendar === \"undefined\" ? true : params.calendar;\n      this.displayedTimezone = params.displayedTimezone;\n      this.format = params.format || (this.time ? DATETIME_FORMAT : DATE_FORMAT);\n      this.countdown = params.countdown;\n      this.duration = params.duration;\n      this.localTimezone = localTimezone;\n    }\n    build() {\n      const [year, month, day] = this.date.split(\"-\").map(x => parseInt(x, 10));\n      const [hour, minute, second] = (this.time || \"\").split(\":\").map(x => x ? parseInt(x, 10) : undefined);\n      let displayedTimezone;\n      if (this.time) {\n        displayedTimezone = this.displayedTimezone || this.localTimezone;\n      } else {\n        displayedTimezone = this.displayedTimezone || this.timezone || this.localTimezone;\n      }\n      let localDate = new _dateWithZoneHelper.default({\n        year,\n        month: month ? month - 1 : null,\n        day,\n        hour,\n        minute,\n        second,\n        timezone: this.timezone,\n        localTimezone: this.localTimezone\n      });\n      if (this.recurring && moment().isAfter(localDate.datetime)) {\n        const type = this.recurring.split(\".\")[1];\n        const repetitionsForType = localDate.unitRepetitionsBetweenDates(this.recurring, moment.tz(this.localTimezone));\n        localDate = localDate.add(repetitionsForType, type);\n      }\n      const previews = this._generatePreviews(localDate, displayedTimezone);\n      const hasTime = hour !== undefined;\n      return {\n        pastEvent: !this.recurring && moment.tz(this.localTimezone).isAfter(localDate.datetime),\n        formatted: this._applyFormatting(localDate, displayedTimezone, hasTime),\n        previews,\n        textPreview: this._generateTextPreviews(previews)\n      };\n    }\n    _generateTextPreviews(previews) {\n      return previews.map(preview => {\n        const formattedZone = this._zoneWithoutPrefix(preview.timezone);\n        return `${formattedZone} ${preview.formatted}`;\n      }).join(\", \");\n    }\n    _generatePreviews(localDate, displayedTimezone) {\n      const previewedTimezones = [];\n      const timezones = this.timezones.filter(timezone => !this._isEqualZones(timezone, this.localTimezone));\n      previewedTimezones.push({\n        timezone: this._zoneWithoutPrefix(this.localTimezone),\n        current: true,\n        formatted: this._createDateTimeRange(_dateWithZoneHelper.default.fromDatetime(localDate.datetime, localDate.timezone, this.localTimezone), this.time, this.duration)\n      });\n      if (this.timezone && displayedTimezone === this.localTimezone && this.timezone !== displayedTimezone && !this._isEqualZones(displayedTimezone, this.timezone) && !this.timezones.any(t => this._isEqualZones(t, this.timezone))) {\n        timezones.unshift(this.timezone);\n      }\n      timezones.forEach(timezone => {\n        if (this._isEqualZones(timezone, displayedTimezone)) {\n          return;\n        }\n        if (this._isEqualZones(timezone, this.localTimezone)) {\n          timezone = this.localTimezone;\n        }\n        previewedTimezones.push({\n          timezone: this._zoneWithoutPrefix(timezone),\n          formatted: this._createDateTimeRange(_dateWithZoneHelper.default.fromDatetime(localDate.datetime, localDate.timezone, timezone), this.time, this.duration)\n        });\n      });\n      return previewedTimezones.uniqBy(\"timezone\");\n    }\n    _isEqualZones(timezoneA, timezoneB) {\n      if ((timezoneA || timezoneB) && (!timezoneA || !timezoneB)) {\n        return false;\n      }\n      if (timezoneA.includes(timezoneB) || timezoneB.includes(timezoneA)) {\n        return true;\n      }\n      return moment.tz(timezoneA).utcOffset() === moment.tz(timezoneB).utcOffset();\n    }\n    _createDateTimeRange(startRange, time, duration) {\n      const [startDate, endDate] = this._calculateDatesForRange(startRange, time, duration);\n      let formatElements = [startDate.format(`${DAY_OF_THE_WEEK_FORMAT}, ${DATE_FORMAT}`), this._optionalTimeIcon(startDate, endDate), startDate.format(TIME_FORMAT)];\n      if (endDate) {\n        formatElements = formatElements.concat([RANGE_SEPARATOR, endDate.format(this._endDateFormat(startDate, endDate))]);\n      }\n      return formatElements.filter(Boolean).join(\" \");\n    }\n    _shortFormat(startDate, endDate) {\n      return endDate.datetime.diff(startDate.datetime, \"days\") < SHORT_FORMAT_DAYS_PERIOD;\n    }\n    _optionalTimeIcon(startDate, endDate) {\n      if (!endDate || this._shortFormat(startDate, endDate)) {\n        return `<br />${(0, _iconLibrary.renderIcon)(\"string\", TIME_ICON)}`;\n      }\n    }\n    _endDateFormat(startDate, endDate) {\n      return this._shortFormat(startDate, endDate) ? TIME_FORMAT : FULL_DATETIME_FORMAT;\n    }\n    _calculateDatesForRange(date, time, duration) {\n      // if a time has been given we do not attempt to automatically create a range\n      // instead we show only one date with a format showing the time\n      if (time && !duration) {\n        return [date];\n      }\n      const dates = [date, duration ? date.add(duration, \"minutes\") : date.add(24, \"hours\")];\n      return duration < 0 ? dates.reverse() : dates;\n    }\n    _applyFormatting(localDate, displayedTimezone, hasTime) {\n      if (this.countdown) {\n        const diffTime = moment.tz(this.localTimezone).diff(localDate.datetime);\n        if (diffTime < 0) {\n          return moment.duration(diffTime).humanize();\n        } else {\n          return _discourseI18n.default.t(\"discourse_local_dates.relative_dates.countdown.passed\");\n        }\n      }\n      const sameTimezone = this._isEqualZones(displayedTimezone, this.localTimezone);\n      if (this.calendar) {\n        const inCalendarRange = moment.tz(this.localTimezone).isBetween(localDate.subtract(2, \"day\").datetime, localDate.add(1, \"day\").datetime.endOf(\"day\"));\n        if (this.sameLocalDayAsFrom) {\n          return this._timeOnlyFormat(localDate, displayedTimezone);\n        }\n        if (inCalendarRange && sameTimezone) {\n          const date = localDate.datetimeWithZone(this.localTimezone);\n          if (hasTime && date.hours() === 0 && date.minutes() === 0) {\n            return date.format(\"dddd\");\n          }\n          return date.calendar(moment.tz(localDate.timezone), this._calendarFormats(this.time ? this.time : null));\n        }\n      }\n      if (!sameTimezone) {\n        return this._formatWithZone(localDate, displayedTimezone, this.format);\n      }\n      return localDate.format(this.format);\n    }\n    _calendarFormats(time) {\n      return {\n        sameDay: this._translateCalendarKey(time, \"today\"),\n        nextDay: this._translateCalendarKey(time, \"tomorrow\"),\n        lastDay: this._translateCalendarKey(time, \"yesterday\"),\n        sameElse: \"L\"\n      };\n    }\n    _translateCalendarKey(time, key) {\n      const translated = _discourseI18n.default.t(`discourse_local_dates.relative_dates.${key}`, {\n        time: \"LT\"\n      });\n      if (time) {\n        return translated.split(\"LT\").map(w => `[${w}]`).join(\"LT\");\n      } else {\n        return `[${translated.replace(\" LT\", \"\")}]`;\n      }\n    }\n    _formatTimezone(timezone) {\n      return timezone.replace(\"_\", \" \").replace(\"Etc/\", \"\").split(\"/\");\n    }\n    _zoneWithoutPrefix(timezone) {\n      const [part1, part2] = this._formatTimezone(timezone);\n      return part2 || part1;\n    }\n    _formatWithZone(localDate, displayedTimezone, format) {\n      let formatted = localDate.datetimeWithZone(displayedTimezone).format(format);\n      return `${formatted} (${this._zoneWithoutPrefix(displayedTimezone)})`;\n    }\n    _timeOnlyFormat(localTime, displayedTimezone) {\n      return this._formatWithZone(localTime, displayedTimezone, \"LT\");\n    }\n  }\n  _exports.default = LocalDateBuilder;\n});","define(\"discourse/plugins/discourse-local-dates/lib/local-date-markup-generator\", [\"exports\", \"@ember/utils\"], function (_exports, _utils) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = generateDateMarkup;\n  function generateDateMarkup(fromDateTime, options, isRange, toDateTime) {\n    let text = ``;\n    if (isRange) {\n      let from = [fromDateTime.date, fromDateTime.time].filter(element => !(0, _utils.isEmpty)(element)).join(\"T\");\n      let to = [toDateTime.date, toDateTime.time].filter(element => !(0, _utils.isEmpty)(element)).join(\"T\");\n      text += `[date-range from=${from} to=${to}`;\n    } else {\n      text += `[date=${fromDateTime.date}`;\n    }\n    if (fromDateTime.time && !isRange) {\n      text += ` time=${fromDateTime.time}`;\n    }\n    if (fromDateTime.format && fromDateTime.format.length) {\n      text += ` format=\"${fromDateTime.format}\"`;\n    }\n    if (options.timezone) {\n      text += ` timezone=\"${options.timezone}\"`;\n    }\n    if (options.countdown) {\n      text += ` countdown=\"${options.countdown}\"`;\n    }\n    if (options.displayedTimezone) {\n      text += ` displayedTimezone=\"${options.displayedTimezone}\"`;\n    }\n    if (options.timezones && options.timezones.length) {\n      if (Array.isArray(options.timezones)) {\n        text += ` timezones=\"${options.timezones.join(\"|\")}\"`;\n      } else {\n        text += ` timezones=\"${options.timezones}\"`;\n      }\n    }\n    if (options.recurring && !isRange) {\n      text += ` recurring=\"${options.recurring}\"`;\n    }\n    text += `]`;\n    return text;\n  }\n});"],"mappings":"AAAAA,OAAA,ocAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAMA,IAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC;AACA,SAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GAAA,IAAAC,EAAA;AAAA,OAAAC,OAAAC,KAAAJ,GAAAK,SAAA,SAAAC,GAAAJ,EAAAI,GAAAN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