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22B,EACzB,kDAGFhgC,EAAO,kDAAkD0D,MAAM,CAC7D0H,GAAI,QACJpH,WAAW,EACXgH,QAAS,YAKPjL,KAAKoD,OAAO88B,mBACdjgC,EAAO,6CAA6C4/B,UAClD7/B,KAAKoD,OAAO+8B,kBACZngC,KAAKoD,OAAOtD,MAGlB,M,gFAACy+B,CAAA,CA1IqB,GCtBxBt+B,EAAOQ,UAAU2/B,MAAM,YACT,IAAI7B,IACZ8B,KACN,E","sources":["webpack://readthedocsext-theme/external var \"moment\"","webpack://readthedocsext-theme/./src/js/application/views.js","webpack://readthedocsext-theme/./src/js/application/globals.js","webpack://readthedocsext-theme/./src/js/application/plugins.js","webpack://readthedocsext-theme/./src/js/application/registry.js","webpack://readthedocsext-theme/./src/js/account/index.js","webpack://readthedocsext-theme/./src/js/build/detail.js","webpack://readthedocsext-theme/./src/js/core/views.js","webpack://readthedocsext-theme/./src/js/gold/index.js","webpack://readthedocsext-theme/./src/js/application/elements.js","webpack://readthedocsext-theme/./src/js/modules/avatar.js","webpack://readthedocsext-theme/./src/js/modules/header.js","webpack://readthedocsext-theme/./src/js/modules/filter.js","webpack://readthedocsext-theme/./src/js/modules/forms.js","webpack://readthedocsext-theme/./src/js/modules/menus.js","webpack://readthedocsext-theme/./node_modules/dompurify/dist/purify.es.mjs","webpack://readthedocsext-theme/./src/js/modules/notifications.js","webpack://readthedocsext-theme/./src/js/modules/popupcards.js","webpack://readthedocsext-theme/./src/js/organization/index.js","webpack://readthedocsext-theme/./src/js/project/admin.js","webpack://readthedocsext-theme/./src/js/tasks/index.js","webpack://readthedocsext-theme/./src/js/project/create.js","webpack://readthedocsext-theme/./src/js/project/index.js","webpack://readthedocsext-theme/./src/js/profile/index.js","webpack://readthedocsext-theme/./src/js/application/index.js","webpack://readthedocsext-theme/./src/js/site.js"],"sourcesContent":["if(typeof moment === 'undefined') { var e = new Error(\"Cannot find module 'moment'\"); e.code = 'MODULE_NOT_FOUND'; throw e; }\n\nmodule.exports = moment;","import ko from \"knockout\";\n// Note: if debugging is needed, you can try this import instead.\n//import ko from \"knockout/build/output/knockout-latest.debug.js\";\nimport jquery from \"jquery\";\n\n/**\n * ``ApplicationView`` is the top-level view that is bound to ``<body>``, and is\n * what surfaces all registered view to templates. Registered views will be\n * available as attributes on this instance, and can be referenced directly, or\n * if the context is already in one of the views, can be referenced using\n * ``$root``:\n *\n * .. code:: html\n *\n *    <body>\n *      <!-- The context is bound to ApplicationView() -->\n *      <div data-bind=\"using: ProjectCreateView()\">\n *       <!-- The context is now bound to ProjectCreateView() -->\n *       <div data-bind=\"using $root.DocEmbedView()\">\n *         <!-- The context is bound to DocEmbedView() -->\n *       </div>\n *      </div>\n *    </body>\n *\n * This view also has a few utility methods that templates use directly. This is\n * for a few quirks where Knockout or HTML required for SemanticUI need some\n * additional code.\n */\nexport class ApplicationView {\n  /**\n   * Attach application main view\n   *\n   * @param {string} selector - Selector string to use for view attachment\n   */\n  attach(selector = \"body\") {\n    console.debug(\"Attaching application to selector:\", selector);\n    ko.applyBindings(this, jquery(selector)[0]);\n  }\n\n  /**\n   * Show a modal using an event callback. This is set up on\n   * :class:`ApplicationView` so that this method is available as\n   * ``$root.show_modal(123);``. This is required because the modal plugin ends\n   * up altering ``<body>``, and this causes some havoc on the already attached\n   * view on ``<body>``.\n   *\n   * This should be used from an element data-bind, such as:\n   *\n   * .. code:: html\n   *\n   *     <button data-bind=\"click: $root.show_modal('delete')\"></button>\n   *     <div class=\"ui modal\" data-modal-id=\"delete\"></div>\n   *\n   * This method is executed when the view is attached and returns a callback.\n   * The callback is finally executed from the ``click`` binding.\n   *\n   * @param {string} modal_id - Modal id, references `data-modal-id` attribute\n   * @returns {knockout_click}\n   */\n  show_modal(modal_id) {\n    return (data, event) => {\n      const selector = \"[data-modal-id=\" + modal_id + \"]\";\n      console.debug(\"Showing modal:\", selector);\n      const found_modal = jquery(selector).modal(\"show\");\n      if (found_modal.length === 0) {\n        console.debug(\"Modal not found:\", selector);\n      }\n\n      // Remove \"visible\" variation property to remove \"Last used\" tooltip\n      const buttons = document.querySelectorAll(\".button.ui\");\n      for (const button of buttons) {\n        if (button.dataset.variation) {\n          const variation = button.dataset.variation.split(\" \");\n          variation.pop(\"visible\");\n          button.dataset.variation = variation.join(\" \");\n        }\n      }\n    };\n  }\n\n  /**\n   * Submit a child form, useful for triggering a form POST with a link\n   *\n   * This could be used like:\n   *\n   * .. code:: html\n   *\n   *     <button data-bind=\"click: $root.post_child_form\">\n   *       Log out\n   *       <form method=\"post\" action=\"...\">\n   *         ...\n   *       </form>\n   *     </button>\n   *\n   * @param {Object} data - Context data\n   * @param {Event} event - Click event\n   * @returns {knockout_click}\n   */\n  post_child_form(data, event) {\n    const elem = event.currentTarget;\n    const form = elem.querySelector(\":scope > form\");\n    if (form) {\n      form.submit();\n    }\n    return false;\n  }\n}\n","/**\n * Global imports workaround\n *\n * This import is used mostly during testing and for jQuery dependencies.\n * Because jQuery plugins and downstream libraries use jQuery as a\n * global/window object, we need to surface the library in the same way during\n * testing. In normal usage, jQuery is in our vendor library and Webpack knows\n * how to treat reference the external vendor library for instances of a\n * global/window jQuery variable.\n *\n * In testing, this accomplishes the same thing. It's defined in a separate\n * import as the import will be evaluated first, giving a chance to attach\n * `window.jQuery` before the other dependencies, like jQuery plugins and all\n * of FomanticUI's component, are imported.\n */\n\nimport jquery from \"jquery\";\nglobalThis.jQuery = jquery;\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\n// TODO this is only really needed while testing, it could be behind a\n// conditional\nimport \"./globals\";\n\nimport Plausible from \"plausible-tracker\";\n\n// Required for FUI tab module\nimport * as jqueryAddress from \"jquery-address\";\n\n/* CommonJS require instead of import syntax on purpose */\nimport * as fomanticVisibility from \"fomantic-ui-less/definitions/behaviors/visibility.js\";\nimport * as fomaticForm from \"fomantic-ui-less/definitions/behaviors/form.js\";\nimport * as fomaticState from \"fomantic-ui-less/definitions/behaviors/state.js\";\nimport * as fomaticAPI from \"fomantic-ui-less/definitions/behaviors/api.js\";\nimport * as fomaticTransition from \"fomantic-ui-less/definitions/modules/transition.js\";\nimport * as fomaticTab from \"fomantic-ui-less/definitions/modules/tab.js\";\nimport * as fomaticDropdown from \"fomantic-ui-less/definitions/modules/dropdown.js\";\nimport * as fomaticModal from \"fomantic-ui-less/definitions/modules/modal.js\";\nimport * as fomaticSearch from \"fomantic-ui-less/definitions/modules/search.js\";\nimport * as fomaticSticky from \"fomantic-ui-less/definitions/modules/sticky.js\";\nimport * as fomaticShape from \"fomantic-ui-less/definitions/modules/shape.js\";\nimport * as fomaticAccordian from \"fomantic-ui-less/definitions/modules/accordion.js\";\nimport * as fomaticSidebar from \"fomantic-ui-less/definitions/modules/sidebar.js\";\nimport * as fomaticDimmer from \"fomantic-ui-less/definitions/modules/dimmer.js\";\nimport * as fomaticCheckbox from \"fomantic-ui-less/definitions/modules/checkbox.js\";\nimport * as fomaticSlider from \"fomantic-ui-less/definitions/modules/slider.js\";\nimport * as fomaticPopup from \"fomantic-ui-less/definitions/modules/popup.js\";\nimport * as fomaticEmbed from \"fomantic-ui-less/definitions/modules/embed.js\";\nimport * as fomaticProgress from \"fomantic-ui-less/definitions/modules/progress.js\";\nimport * as fomaticToast from \"fomantic-ui-less/definitions/modules/toast.js\";\nimport * as fomaticSite from \"fomantic-ui-less/definitions/globals/site.js\";\n\n/**\n * Set up jQuery plugins. SemanticUI jQuery plugins are brought in piecemeal,\n * through separate dependencies. This allows for a smaller footprint.\n */\nexport function configure_jquery_plugins() {\n  jquery.fn.site(\"normalize\");\n  jquery.fn.tabs = jquery_tabmenu;\n  // ``tabmenu`` was ported from our website, but ``tabs`` is nicer\n  jquery.fn.tabmenu = jquery_tabmenu;\n  jquery.fn.plausible = jqueryPlausible;\n}\n\n/**\n * Set up Knockout plugins for interacting with HTML templates\n */\nexport function configure_knockout_plugins() {\n  ko.bindingHandlers.htmlInit = htmlInit;\n  ko.bindingHandlers.textInit = textInit;\n  ko.bindingHandlers.jsonInit = jsonInit;\n  ko.bindingHandlers.valueInit = valueInit;\n  ko.bindingHandlers.element = element;\n  ko.bindingHandlers.chart = chart;\n  ko.bindingHandlers.popup = popup;\n  ko.bindingHandlers.semanticui = semanticui;\n  ko.bindingHandlers.webcomponent = webcomponent;\n}\n\n/**\n * Binding for initializing an observable using the inner HTML of an element.\n */\nexport const htmlInit = add_init_handler(\n  (element) => {\n    return element.innerHTML;\n  },\n  (property) => {\n    return { html: property };\n  },\n);\n\n/**\n * Binding for initializing an observable using the inner text (the child text\n * nodes) of an element.\n */\nexport const textInit = add_init_handler(\n  (element) => {\n    return element.innerText;\n  },\n  (property) => {\n    return { text: property };\n  },\n);\n\n/**\n * Binding for initializing an observable from the ``value`` attribute of an\n * element -- for example a form ``<input>`` element.\n */\nexport const valueInit = add_init_handler(\n  (element) => {\n    return element.value;\n  },\n  (property) => {\n    return { value: property };\n  },\n);\n\n/**\n * JSON binding for writing JSON configuration objects in HTML and initializing\n * the value in a Knockout observable. This is used to transfer configuration\n * from Django and Django template tags, into our front end code.\n *\n * This binding does not set anything, it is only used to initialize an\n * observable on page load.\n *\n * Usage:\n *\n * .. code:: html\n *\n *     <script type=\"application/json\" data-bind=\"jsonInit: config\">\n *     {\"url\": \"https://example.com/api/v3/projects/1234\"}\n *     </script>\n *\n * In turn, there should be a Knockout observable ``config`` in the view:\n *\n * .. code:: javascript\n *\n *     self.config = ko.observable()\n *     self.url = ko.computed(() => {\n *       return self.config().url;\n *     })\n */\nexport const jsonInit = add_init_handler((element) => {\n  try {\n    return JSON.parse(element.innerHTML);\n  } catch (err) {\n    console.error(err);\n    return {};\n  }\n});\n\nfunction add_init_handler(getter, setter) {\n  return {\n    init: function (element, valueAccessor, allBindingsAccessor, data) {\n      const property = valueAccessor();\n      const value = getter(element);\n\n      // Create the observable, if it doesn't exist\n      if (!ko.isWriteableObservable(property)) {\n        throw new Error(\"Property not found:\", property);\n      }\n\n      property(value);\n\n      if (setter) {\n        ko.applyBindingsToNode(element, setter(property));\n      }\n    },\n  };\n}\n\nexport const element = {\n  init: function (element, value_accessor) {\n    var property = value_accessor();\n    property(element);\n  },\n};\n\n/**\n * Chart binding used in a couple views to instantiate chartjs on a ``<canvas>``.\n * This plugin loads chartjs, which is rather large, via an async import in\n * Webpack. This will load the chartjs and dependencies separately from the rest\n * of our application code.\n *\n * Usage:\n *\n * .. code:: html\n *\n *    <canvas width=\"400\" height=\"150\" data-bind=\"chart: config\"></canvas>\n *    <script type=\"application/json\" data-bind=\"jsonInit: config\">\n *    {...}\n *    </script>\n */\nexport const chart = {\n  init: function (element, value_accessor) {\n    var property = value_accessor();\n\n    // Dynamic webpack import of library. This will trigger a new request.\n    import(\n      /* webpackChunkName: \"chartjs\" */\n      \"chart.js\"\n    ).then(({ default: chartjs }) => {\n      let config = property();\n\n      const datasets = config.data.datasets.map((value) => {\n        value.backgroundColor = \"rgb(65, 131, 196, 0.8)\";\n        value.borderColor = \"rgb(65, 131, 196, 1)\";\n        value.pointBorderColor = \"rgb(65, 131, 196, 1)\";\n        value.borderWidth = 2;\n        return value;\n      });\n\n      config.data.datasets = datasets;\n      const chart = new chartjs(element, config);\n    });\n  },\n};\n\n/**\n * Popup plugin for configuring SUI popups. This can be replaced by\n * :func:`semanticui`.\n */\nexport const popup = {\n  init: (element, value_accessor, bindings, view, context) => {\n    const config = Object.assign(\n      {\n        hoverable: true,\n        delay: {\n          show: 300,\n          hide: 100,\n        },\n        exclusive: true,\n        onHide: () => {\n          context.$rawData.hide();\n        },\n      },\n      value_accessor(),\n    );\n    const jq_element = jquery(element);\n    jq_element.popup(config).hover(() => {\n      context.$rawData.show();\n    });\n  },\n};\n\n/**\n * Web component bridge binding\n *\n * This binding is used to help bridge Knockout views and web components, but\n * allowing observables to set web component attributes when updated.\n *\n * It's important to note that there is likely a bit of extra overhead here as\n * both Knockout and Lit have differing patterns for property/observable\n * lifecycles. That is, Knockout will process the observable change with\n * multiple calls, and then pass the value off to the LitElement, which will do\n * its own round of internal calls to update the property value.\n *\n * Either way, this binding can help with the transition to web components.\n *\n * With an underlying Knockout view, a web component property can be updated\n * with this data binding like so:\n *\n * .. code:: html\n *\n *     <readthedocs-foo data-bind=\"webcomponent: {someProperty: someObservable}\">\n *\n * In the above example here, the web component property ``someProperty`` is\n * updated by the Knockout view observable ``someObservable``. When there is an\n * update to the observable in the Knockout view, this property will then be\n * updated on the web component. This can be a full object, this pattern is not\n * limited to data primitives, like when using web components from HTML.\n */\nexport const webcomponent = {\n  update: (element, value_accessor, all_bindings) => {\n    const binding_value = ko.unwrap(value_accessor());\n    for (const [key, value] of Object.entries(binding_value)) {\n      if (value !== undefined) {\n        if (typeof value === \"function\") {\n          console.error(\"Unsupported function in data binding\");\n        } else {\n          element[key] = value;\n        }\n      }\n    }\n  },\n};\n\n/**\n * Knockout binding for calling SemanticUI jQuery plugins on individual elements\n *\n * This binding provides direct access to all of the SemanticUI jQuery plugins\n * provided by each of the SemanticUI module units.\n *\n * Each key passed into the ``semanticui`` binding represents a module plugin\n * that will be called by the data binding. For example, a data binding that\n * initializes ``popup()`` and ``modal()`` module plugins is:\n *\n * .. code:: html\n *\n *     <div data-bind=\"semanticui: { popup: {'on': 'click'}, modal: {'closable': false}}\">\n *\n * Which would be the following if using the standard jQuery initialization\n * pattern described by SUI guides:\n *\n * .. code:: js\n *\n *     $(element).popup({\"on\": \"click\"});\n *     $(element).modal({\"closable\": false});\n *\n * Passing arguments\n * -----------------\n *\n * There are three available patterns you can use for passing arguments into the\n * plugin methods:\n *\n * A literal value inside the data binding attribute in template code\n *   The simplest option, useful if arguments are fairly basic.\n *\n * An observable in the data binding attribute\n *   This is useful when the arguments passed into the plugin method are\n *   complex or conditional.\n *\n * An anonymous function through an observable\n *   This is for advanced cases and the best pattern for using SUI module\n *   behaviors.\n *\n * Literal value\n * ~~~~~~~~~~~~~\n *\n * If you only need to pass basic arguments into the plugin, you can do so in\n * template code without any further JS:\n *\n * .. code:: html\n *\n *     <a class=\"ui item\" data-bind=\"semanticui: {popup: {on: 'click'}}\">\n *\n * To compare this to the standard initialization pattern described by the SUI\n * documentation, which relies on jQuery for targeting:\n *\n * .. code:: js\n *\n *     $(element).popup({on: \"click\"});\n *\n * Observable value\n * ~~~~~~~~~~~~~~~~\n *\n * For complex and conditional arguments, it's usually better to pass an\n * observable to the binding for the module plugin. Because we will be creating\n * observables, this requires a view class. Inside the view class, an\n * observable can be declared:\n *\n * .. code:: js\n *\n *     this.popup_config = ko.computed(() => {\n *       return {\n *         label: this.example_observable(),\n *         on: \"click\",\n *       }\n *     });\n *\n * Our template code would reference the observable instead of a literal:\n *\n * .. code:: html\n *\n *     <a class=\"ui item\" data-bind=\"semanticui: {popup: popup_config()}\">\n *\n * .. seealso::\n *     :func:`BuildDetailView.progress_config`\n *       An example of an observable passing arguments to the ``progress()``\n *       module jQuery plugin.\n *\n * Anonymous function\n * ~~~~~~~~~~~~~~~~~~\n *\n * For deep usage of the SUI module jQuery plugins, you can also set an\n * observable to an anonymous function value to use the plugin method directly\n * on an individual element. This binding will call into that function with the\n * jQuery plugin method exposed as a function as the only argument.\n *\n * With the template code still using an observable in the data binding on the\n * view layer, an observable using an anonymous function instead would be:\n *\n * .. code:: js\n *\n *     this.popup_config = ko.observable((popup) => {\n *       popup({\n *         label: \"Test\",\n *         on: \"click\",\n *       });\n *     });\n *\n * This is most helpful for utilizing SUI module *behaviors*. Behaviors are\n * listed on most SUI modules, such as:\n * https://fomantic-ui.com/modules/popup.html#behavior\n *\n * To now call module behaviors from this observable:\n *\n * .. code:: js\n *\n *     this.popup_config((popup) => popup(\"show\"));\n *\n * It's also possible to mix these patterns and call behaviors more than once.\n * For example a progress bar that progressively updates can mix both plugin\n * initialization and subsequent behavior calls after initialization:\n *\n * .. code:: js\n *\n *     this.progress_config = ko.computed(() => {\n *       if (ko.computedContext.isInitial()) {\n *         // First call, initialize the module\n *         return {\n *           total: 10,\n *         }\n *       } else {\n *         return (progress) => {\n *           progress(\"set progress\", self.value());\n *         }\n *       }\n *     });\n *\n */\nexport const semanticui = {\n  update: (element, value_accessor, all_bindings) => {\n    const binding_value = ko.unwrap(value_accessor());\n    const jq_element = jquery(element);\n    for (const [key, value] of Object.entries(binding_value)) {\n      if (value !== undefined) {\n        if (typeof value === \"function\") {\n          const callback = (behavior, ...args) => {\n            console.debug(\n              \"Calling SemanticUI component behavior:\",\n              key,\n              element,\n              behavior,\n              ...args,\n            );\n            jq_element[key](behavior, ...args);\n          };\n          value(callback);\n        } else {\n          if (key === \"modal\") {\n            // We do something fun here and move the element into ``body``\n            // before the SUI initialization. The reason for this is that SUI\n            // will move the element automatically already, however when it\n            // does the KO bindings are all re-evaluated. This will cause\n            // exceptions to be thrown around duplicate binding definitions. To\n            // make the ``modal`` module play with KO nicely, we mark the modal\n            // as _not detachable_, meaning SUI won't move the element when\n            // initializing, and move the element manually so that the\n            // positioning is relative to ``body`` instead of being relative to\n            // the modal element's parent element. If detachable is manually\n            // configured, throw an error.\n            if (value.detachable == true) {\n              throw new Error(\n                \"Setting a modal as detachable is not supported by the semanticui binding.\",\n              );\n            }\n            value.detachable = false;\n            document.body.prepend(element);\n          }\n          // The value is probably an object, and is almost certainly a module\n          // configuration for initializing the module\n          console.debug(\n            \"Setting up SemanticUI component:\",\n            key,\n            value,\n            element,\n          );\n          jq_element[key](value);\n        }\n\n        // Set attribute for CSS selector on element. This is used to avoid\n        // initializing SUI jQuery plugins twice on elements.\n        jq_element.attr(\"data-semanticui-\" + key, true);\n      }\n    }\n  },\n};\n\n/**\n * Plausible tracking module\n *\n * This reuses jQuery to provide explicit tracking of events at Plausible. To\n * use events, add the ``data-analytics-events`` attribute to an element. In most\n * cases, this should be a link element, however in the case of other UI\n * components, it may be a ``<div>`` or ``<button>``\n *\n * You may also define custom event properties with\n * ``data-analytics-property-*`` attributes, the attribute value is passed to\n * Plausible.\n *\n *     <button class=\"ui button\"\n *            data-analytics-events=\"some-event-id,another-id\"\n *            data-analytics-property-foo=\"bar\">\n *       Something\n *     </button>\n *\n * In the case of a link with a ``href`` attribute, the link click event will\n * continue after all events have been tracked at Plausible, or after a 1s\n * timeout passes.\n */\nfunction jqueryPlausible(domain, debug = false) {\n  let plausibleSettings = { domain: domain };\n  if (debug === true) {\n    plausibleSettings.trackLocalhost = true;\n  }\n  const { trackEvent } = Plausible(plausibleSettings);\n  const { trackPageview } = Plausible(plausibleSettings);\n\n  // Track pageview for all pages\n  trackPageview();\n\n  return this.each((index, elem) => {\n    // ``data-analytics`` is used on the website, but we added some more\n    // functionality here so ``data-analytics-events`` is preferred.\n    const data = jquery(elem).data();\n    const eventNames =\n      data.analyticsEvents?.split(/,/) || data.analytics?.split(/,/) || [];\n    const eventProperties = {};\n\n    // ``data-analytics-property-*`` attributes are used to populate properties.\n    Object.keys(data).forEach((key) => {\n      const match = key.match(/analyticsProperty(.*)/);\n      if (match) {\n        const [_, property] = match;\n        eventProperties[property.toLowerCase()] = data[key];\n      }\n    });\n\n    function handleAnalyticsEvent(event) {\n      const isLink =\n        elem.tagName != undefined && elem.tagName.toLowerCase() == \"a\";\n      const isMiddleClick = event.type == \"auxclick\" && event.which == 2;\n      const isClick = event.type == \"click\";\n      const isLinkClick =\n        isLink &&\n        isClick &&\n        !elem.target &&\n        !(event.ctrlKey || event.metaKey || event.shiftKey);\n\n      if (isMiddleClick || isClick) {\n        Promise.all(\n          eventNames.map((eventName) => {\n            return new Promise((resolve, reject) => {\n              const options = { callback: resolve, props: eventProperties };\n              trackEvent(eventName, options);\n              // Fallback timeout\n              setTimeout(() => {\n                reject();\n              }, 1000);\n            });\n          }),\n        )\n          .catch((e) => {\n            console.debug(\n              \"Plausible didn't receive a response for one or more event\",\n            );\n          })\n          .finally(() => {\n            console.debug(\n              \"Plausible tracked events:\",\n              eventNames,\n              eventProperties,\n            );\n            if (isLinkClick && elem.href && elem.href != \"#\") {\n              console.debug(\"Plausible replaying click event\", elem.href);\n              window.location = elem.href;\n            }\n          });\n      }\n\n      // If this is a normal click of an anchor element, prevent the default\n      // event from propagating and instead wait until the callback\n      // returns/expires to redirect the current page URL. If the user held\n      // control/shift/meta while clicking, we're assuming the browser is doing\n      // something special instead and will not block the default event.\n      if (isLinkClick) {\n        event.preventDefault();\n        return false;\n      }\n    }\n\n    // TODO support other methods than click\n    elem.addEventListener(\"click\", handleAnalyticsEvent);\n    elem.addEventListener(\"auxclick\", handleAnalyticsEvent);\n  });\n}\n\n/**\n * Tab group SUI module helper\n *\n * The tab module is instantiated in a unique way that conflicts with the normal\n * patterns used for instantiating FUI modules here. Instead of being called on\n * a singular element, the tab module is called on child elements of a menu.\n * That is, the tab module would normally be set up on multiple modules at a\n * time with ``$(\".ui.menu > .item\").tab({...})``.\n *\n * Calling the module on multiple ``.item`` elements in a query is important,\n * or we end up instantiating a tab menu for each menu item and the tab menu\n * does not work correctly.\n *\n * In short, this consolidates the tab module instantiation onto a query\n * instead of a singular element like the ``semanticui`` data binding normal\n * would.\n */\nfunction jquery_tabmenu(settings) {\n  return this.each((index, elem) => {\n    $(elem).find(\".item\").tab(settings);\n  });\n}\n","import ko from \"knockout\";\n\n/**\n * Registry pattern for views, to accumulate public views for templates\n *\n * To avoid using a routing library, or treating this JS as a single page\n * application on top of a Django backend, we simply will make all views\n * available to all templates. This registry ultimately attaches to the\n * main :class:`ApplicationView` instance, and all views will be available in\n * that bound context.\n *\n * See :class:`ApplicationView` here for examples and more information\n */\nexport class Registry {\n  static views = {};\n\n  /**\n   * Add view to registry. View should have ``view_name`` proprety defined.\n   *\n   * A ``view_name`` attribute is required as the class name will change when\n   * the sources are minified.\n   *\n   * @param {class} view - Knockout view to expose to the application\n   */\n  static add_view(view) {\n    if (view.name === undefined) {\n      console.error(\"View view_name is unspecified\", view);\n      return;\n    }\n    this.views[view.view_name] = (...params) => {\n      console.debug(\"Loading view with parameters:\", view.view_name, params);\n      // ignoreDependencies is needed here or the context used by the subview\n      // is incorrect\n      return ko.ignoreDependencies(() => {\n        return new view(...params);\n      }, this);\n    };\n  }\n\n  /**\n   * Attach all of the registered views to a view, almost always, the root\n   * application view.\n   *\n   * @param {ApplicationView} view - View to attach to\n   */\n  attach(view) {\n    for (const [view_name, view_class] of Object.entries(\n      this.constructor.views,\n    )) {\n      view[view_name] = view_class;\n    }\n  }\n}\n","import ko from \"knockout\";\nimport { msg } from \"@lit/localize\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Listing view for social account connections.\n *\n * This view is subclassed by the :js:cls:`LoginView`, as the templates that\n * use this code are shared between the social account connection listing view\n * and the login view. On the social account listing we don't want the same\n * features for last login method etc so this view overloads the functions\n * used.\n */\nexport class SocialAccountView {\n  static view_name = \"SocialAccountView\";\n\n  constructor(options) {\n    this.github_modal_config = ko.observable();\n  }\n\n  show_github_modal() {\n    this.github_modal_config((modal) => modal(\"show\"));\n  }\n\n  // No-op to skip popup setup\n  popup_login_method() {}\n\n  save_login_method() {\n    return true;\n  }\n}\n\n/**\n * LoginView saves a cookie for the last login method.\n *\n * Usage:\n *\n * .. code:: html\n *\n *   <div data-bind=\"using: LoginView()\">\n *     <form method=\"post\" action=\"...\">\n *       <button data-bind=\"click: save_login_method.bind($data, 'email'), semanticui: { popup: popup_login_method('email') }\">\n *         Log in using GitHub\n *       </button>\n *     </form>\n *   </div>\n */\nexport class LoginView extends SocialAccountView {\n  static view_name = \"LoginView\";\n\n  constructor(options) {\n    super(options);\n\n    /** @observable {string} Last tab to be selected. Comes from view */\n    this.last_tab = ko.observable(options?.last_tab || \"vcs\");\n    /** @observable {string} Last method to be used. Comes from view */\n    this.last_method = ko.observable(options?.last_method);\n\n    // This is an named lookup for observables, one for each method. It is\n    // populated by the template code as each popup is configured.\n    this.popups = {};\n  }\n\n  /**\n   * Add popup for login method\n   *\n   * This adds an observable using by the semanticui binding to add and\n   * manipulate a popup module on the element.\n   *\n   * Accepts multiple method ids just because we have a GitHub sub-modal right\n   * now. This can be removed eventually.\n   *\n   * @param {string|Array.<string>} method - Method id or list of method ids\n   * @param {string} position - Position to pass to SUI popup position attribute\n   * @param {string} method - Method id\n   */\n  popup_login_method(method, position = \"top center\") {\n    this.popups[method] = ko.observable((popup) => {\n      // First set up the element as a manual popup, then manually show it.\n      // This is using the anonymous function pattern for passing arguments to\n      // the ``popup()`` jQuery plugin binding, via :func:`application.plugins.semanticui`\n      popup({\n        content: msg(`Last used`),\n        position: position,\n        variation: \"mini teal\",\n        closable: true,\n        preserve: true,\n        on: \"manual\",\n      });\n      if (!Array.isArray(method) && this.last_method() == method) {\n        popup(\"show\");\n      } else if (Array.isArray(method) && method.includes(this.last_method())) {\n        popup(\"show\");\n      }\n    });\n    return this.popups[method]();\n  }\n\n  /**\n   * Save a cookie to track last login method.\n   *\n   * This could be used like:\n   *\n   * .. code:: html\n   *\n   *     <form method=\"post\" action=\"...\">\n   *       <button data-bind=\"click: save_login_method.bind($data, 'email')\">\n   *         Log in using GitHub\n   *       </button>\n   *     </form>\n   *\n   * @param {string} method - Method id\n   * @returns {knockout_click}\n   */\n  save_login_method(method) {\n    console.debug(\"Saving last login method:\", method);\n    let cookie = `last-login-method=${method}`;\n    if (window.isSecureContext) {\n      cookie = cookie + `; Secure`;\n    }\n    document.cookie = cookie;\n    return true;\n  }\n\n  // On top of showing the GitHub modal, show any popups for GitHub providers as\n  // well. This avoids requiring the popups to always be visible and avoids\n  // manual removal of the popups.\n  show_github_modal() {\n    super.show_github_modal();\n    const last_method = this.last_method();\n    if ([\"github\", \"githubapp\"].includes(last_method)) {\n      this.popups[last_method]((popup) => popup(\"show\"));\n    }\n  }\n}\n\nRegistry.add_view(SocialAccountView);\nRegistry.add_view(LoginView);\n","// Build - detail view\n\nimport jquery from \"jquery\";\nimport ko from \"knockout\";\nimport dayjs from \"dayjs\";\nimport RelativeTime from \"dayjs/plugin/relativeTime\";\nimport Duration from \"dayjs/plugin/duration\";\nimport LocalizedFormat from \"dayjs/plugin/localizedFormat\";\n\nimport { Registry } from \"../application/registry\";\n\ndayjs.extend(RelativeTime);\ndayjs.extend(Duration);\ndayjs.extend(LocalizedFormat);\n\n/** Build command output subview, represented in :class:`BuildCommand` as an\n * array of output lines.\n *\n * @param {Object} build_command_output - BuildCommand APIv2 data\n */\nclass BuildCommandOutput {\n  constructor(build_command_output) {\n    /** The command that was executed\n     * @type {string} */\n    this.command = build_command_output.command;\n    /** @observable {string} Build command output line */\n    this.output = ko.observable(build_command_output.output);\n    /** Command output line number provided by :class:`BuildCommand`.\n     * @observable {number} Command output line number */\n    this.line_number = ko.observable(build_command_output.line_number);\n    /** Computed observable for the achor id, the linkable element in the UI.\n     * The anchor matches the syntax ``12--123``, which is the command index in\n     * the array of commands, and the command output line number index in the\n     * array of command output lines.\n     * @computed {string} Anchor id in the syntax ``12--123`` */\n    this.anchor_id = ko.computed(() => {\n      return this.command.id() + \"--\" + this.line_number();\n    });\n\n    /** @observable {Boolean} Is the line selected/highlighted. Selected lines\n     * are lines that are linked to via URL hash */\n    this.is_selected = ko.observable(false);\n  }\n}\n\n/**\n * Build command subview. :class:`BuildDetailView` retains an array of\n * :class:`BuildCommand` objects for display. This class uses an array of\n * :class:`BuildCommandOutput` objects to display individual lines of output.\n *\n * @param {Object} build_command - APIv2 build command data\n */\nclass BuildCommand {\n  constructor(build_command) {\n    // Remove the full path from build command display, and hack debug flag\n    // TODO rely on debug flag from build model when it's added\n    const re_command_trim =\n      /(\\/usr\\/src\\/app|\\/home\\/docs)\\/checkouts\\/readthedocs.org\\/user_builds\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+\\//g;\n    let command = build_command.command.replace(re_command_trim, \"\");\n    let looks_like_debug = false;\n    if (build_command.is_debug === undefined) {\n      const re_commands = /^(pip freeze|cat .*conf.py)$/;\n      looks_like_debug = command.match(re_commands);\n    }\n    const is_debug = build_command.is_debug || looks_like_debug;\n\n    /** @observable {number} Build command id */\n    this.id = ko.observable(build_command.id);\n    /** @observable {string} Build command executed */\n    this.command = ko.observable(command);\n    /** @observable {number} Build command posix exit code */\n    this.exit_code = ko.observable(build_command.exit_code || 0);\n    /** @computed {Boolean} Was :func:`exit_code` successful? */\n    this.is_successful = ko.computed(() => {\n      return this.exit_code() === 0;\n    });\n    /** @computed {Boolean} Did command emit exit code 183? */\n    this.is_cancelled = ko.computed(() => {\n      return this.exit_code() === 183;\n    });\n    /** @observable {number} Command run time in seconds */\n    this.run_time = ko.observable(build_command.run_time);\n    /** @observable {string} Command start time */\n    this.start_time = ko.observable(build_command.start_time);\n    /** @observable {number} Command end time in seconds */\n    this.end_time = ko.observable(build_command.end_time);\n    /** @computed {Boolean} Command is finished running? */\n    this.finished = ko.computed(() => {\n      return this.end_time() !== null;\n    });\n    /** @computed {string} Command metadata line, same format as the text log */\n    this.info_display = ko.computed(() => {\n      return (\n        `start-time: ${this.start_time()}, ` +\n        `end-time: ${this.end_time()}, ` +\n        `duration: ${this.run_time()}, ` +\n        `exit-code: ${this.exit_code()}`\n      );\n    });\n    /** @computed {Boolean} This command is a debug class command */\n    this.is_debug = ko.observable(is_debug);\n    /** @computed {Boolean} Hide debug commands until debug mode is enabled */\n    this.is_visible = ko.computed(\n      () => {\n        if (this.is_debug()) {\n          return false;\n        } else {\n          return true;\n        }\n      },\n      null,\n      { deferEvaluation: true },\n    );\n    /** @computed {string} Command text class */\n    this.command_class = ko.computed(() => {\n      if (this.is_debug()) {\n        return \"grey\";\n      } else if (this.is_cancelled()) {\n        return \"yellow\";\n      } else {\n        return this.is_successful() ? \"olive\" : \"red\";\n      }\n    });\n\n    /** @observable {Boolean} Is this command expanded? Failed commands are\n     * expanded by default. */\n    this.is_expanded = ko.observable((build_command.exit_code || 0) > 0);\n    this.exit_code.subscribe((exit_code) => {\n      if (exit_code !== undefined && exit_code > 0) {\n        this.is_expanded(true);\n      }\n    });\n\n    /** @observable {string} Raw command output */\n    this.output = ko.observable();\n    /** @computed {Array.<BuildCommandOutput>} Split output lines */\n    this.output_lines = ko.computed(\n      () => {\n        const output_lines = this.output().split(/\\n/);\n\n        return output_lines.map((line, index) => {\n          return new BuildCommandOutput({\n            command: this,\n            output: line,\n            line_number: index + 1,\n          });\n        });\n      },\n      null,\n      { deferEvaluation: true },\n    );\n\n    this.output(build_command.output);\n    // TODO color output is disabled for now. This needs to be async due to the\n    // extra libraries loaded, and should block page load, polling, and updating\n    // the selected line. This also requires an application change.\n    // this.color_output(build_command.output);\n  }\n\n  /**\n   * Add ANSI coloring and other fun to output string. Modules used here are\n   * dynamically loaded separate from the normal vendor bundle. This is to\n   * reduce the size of the standard vendor bundle.\n   *\n   * @param {string} output - The output string to colorize\n   * @returns {Promise}\n   */\n  color_output(output) {\n    // Dynamically load expensive chunks. These will be kept out of the normal\n    // vendor bundle.\n    return import(\n      /* webpackChunkName: 'ansi_up' */\n      \"ansi_up\"\n    ).then(({ default: AnsiUp }) => {\n      // Build output lines\n      let ansi_up = new AnsiUp();\n      ansi_up.use_classes = true;\n      output = ansi_up.ansi_to_html(output);\n      // TODO use dompurify here\n      //output = DOMPurify.sanitize_html(output);\n      return output;\n    });\n  }\n\n  /**\n   * Toggle :func:`is_expanded`, used to expand command output\n   *\n   * This is triggered by a click event, so ``false`` is returned to avoid\n   * default behavior and event propagation.\n   */\n  toggle_expanded() {\n    this.is_expanded(!this.is_expanded());\n    return false;\n  }\n}\n\n/**\n * Build detail view shows build metadata, build commands, and build command\n * output. In most cases you are only passing in the build pk, and relying on\n * the API to fill in the rest of the build data.\n *\n * Usage from a Django template:\n *\n * .. code:: html\n *\n *     <div data-bind=\"using: BuildDetailView({id: {{ build.pk }}}, '{% url ... %}', '{% url ... %}')\"></div>\n *\n * @param {Object} build - API data for a build.\n */\nexport class BuildDetailView {\n  static view_name = \"BuildDetailView\";\n\n  constructor(build = {}, url_api_build, url_api_notifications) {\n    /** @type {number} The build pk/id to fetch */\n    this.id = build.id;\n    /** @type {string} APIv2 build detail API URL */\n    this.url_api_build = url_api_build;\n    /** @type {string} APIv3 build notification API URL */\n    this.url_api_notifications = url_api_notifications;\n\n    /** @observable {Boolean} Was for successful build or not */\n    this.success = ko.observable(build.success);\n    /** @observable {string} Build error message */\n    this.error = ko.observable(build.error);\n    /** @observableArray {Object} List of notifications from API */\n    this.notifications = ko.observableArray();\n    /** @computed {Boolean} Has notifications? */\n    this.has_notifications = ko.computed(() => {\n      return this.notifications().length > 0;\n    });\n\n    /** @obsevable {string} Build state */\n    this.state = ko.observable(build.state);\n    /** @observable {string} Build state as a display string */\n    this.state_display = ko.observable(build.state_display);\n\n    // State helpers that are not modeled from the backend API\n    /** @observable {Boolean} Is the build in a finished state? */\n    this.is_finished = ko.observable(false);\n    /** @observable {Boolean} Have we received data from the API yet? */\n    this.is_loading = ko.observable(true);\n    /** @observable {Boolean} Build can be cancelled */\n    this.can_cancel = ko.observable(false);\n    /** @observable {Boolean} Build can be retried */\n    this.can_retry = ko.observable(false);\n    /** @observable {Boolean} There was doc output in the build */\n    this.can_view_docs = ko.observable(false);\n\n    /** @observable {Boolean} Is the command output wrapped? */\n    this.is_wrapped = ko.observable(true);\n\n    // Consolidate all of the observable updates that depend on build state\n    this.state.subscribe((state) => {\n      this.update_state(state);\n    });\n\n    /** SUI progress module config/behavior\n     * @computed {Object or Function} the parameters to pass to the module call\n     *\n     * See the `semanticui` Knockout plugin for more information */\n    this.progress_config = ko\n      .computed(() => {\n        const state = this.state();\n        const states = [\n          \"triggered\",\n          \"queued\",\n          \"cloning\",\n          \"installing\",\n          \"building\",\n          \"uploading\",\n          \"finished\",\n        ];\n        // If this is the first update, configure the module. If this is an\n        // update, then send progress updates using module behaviors instead.\n        if (ko.computedContext.isInitial()) {\n          return {\n            autoSuccess: false,\n            value: states.indexOf(state),\n            total: states.length - 1,\n            label: this.state_display(),\n          };\n        } else {\n          if (this.is_finished()) {\n            const is_cancelled = state === \"cancelled\";\n            const is_failed = this.error() || this.success() === false;\n            if (is_cancelled) {\n              return (progress) => {\n                progress(\"set warning\", \"Build cancelled\");\n              };\n            } else if (is_failed) {\n              return (progress) => {\n                // TODO translate this in the application or templates\n                progress(\"set error\", \"Build failed\");\n              };\n            } else {\n              return (progress) => {\n                // TODO translate this in the application or templates\n                progress(\"set success\", \"Build succeeded\");\n              };\n            }\n          } else {\n            return (progress) => {\n              progress(\"set progress\", states.indexOf(state));\n              progress(\"set label\", this.state_display());\n            };\n          }\n        }\n      })\n      .extend({\n        // Debounce API updates, so we aren't triggering this once for each\n        // observable update -- from the API response for example.\n        deferred: true,\n      });\n\n    // Date and time manipulation\n    /* @observable {number} Build date ... as integer? TBD */\n    this.date = ko.observable(build.date);\n    /* @observable {number} Build length in seconds */\n    this.length = ko.observable(build.length);\n    /* @observable {string} Build date display in a localized format */\n    this.date_display = ko.observable();\n    /* @observable {string} Build date as a relative format */\n    this.date_display_since = ko.observable();\n    /* @observable {string} Build length in a human readable format */\n    this.length_display = ko.observable();\n\n    this.date.subscribe((date) => {\n      const date_readable = dayjs(date);\n      this.date_display(date_readable.format(\"llll\"));\n      this.date_display_since(date_readable.fromNow());\n    });\n    this.length.subscribe((length) => {\n      let duration;\n      if (length) {\n        duration = dayjs.duration(length, \"seconds\");\n      } else {\n        // Infer length from build start time\n        const dateNow = dayjs();\n        const dateStart = dayjs(this.date());\n        duration = dayjs.duration(dateNow.diff(dateStart));\n      }\n      let formatParts = [\"s[s]\"];\n      if (duration.minutes()) {\n        formatParts.unshift(\"m[m]\");\n      }\n      if (duration.hours()) {\n        formatParts.unshift(\"H[h]\");\n      }\n      this.length_display(duration.format(formatParts.join(\" \")));\n    });\n\n    /* Output */\n    /** @observable {Object} Build configuration used for the build */\n    this.config = ko.observable();\n    /** @observable {string} The build instance to process the build */\n    this.builder = ko.observable(build.builder);\n    /** @observable {Array.<Object>} Build command objects as an array */\n    this.commands = ko.observableArray(build.commands);\n\n    /** @observable {string} Repository commit for the build */\n    this.commit = ko.observable(build.commit);\n    /** @computed {string} A truncated version of the build commit */\n    this.commit_short = ko.computed(() => {\n      let commit = this.commit();\n      if (commit) {\n        return commit.substring(0, 8);\n      }\n    });\n    /** @observable {string} URL for build's documentation */\n    this.docs_url = ko.observable(build.docs_url);\n    /** @observable {string} URL for build commit */\n    this.commit_url = ko.observable(build.commit_url);\n\n    /* Others */\n    /** This is old old build output, before we were separating commands by\n     * build command and just lumping evertying by STDOUT/STDERR. Oooof. We\n     * don't want to show these, and probably just want to show a \"Sorry, this\n     * is too old\" error.\n     * @observable {Boolean} Build output doesn't have build commands */\n    this.legacy_output = ko.observable(false);\n\n    // Selected line handling\n    /** The selected command and command line are updated when the window hash\n     * (anchor) changes. The hash is meant to be in the format of ``12--123``,\n     * which is the command id and the command id output line number.\n     * @observable {string} The window hash/anchor */\n    this.selected_hash = ko.observable(jquery(location).attr(\"hash\"));\n    this.selected_hash.subscribe((selected_hash) => {\n      jquery(location).attr(\"hash\", selected_hash);\n    });\n    /** @observable {BuildCommandOutput} The command line found from the selected hash*/\n    this.selected_line = ko.observable();\n    // Remove the selected state on the current/old selected line\n    this.selected_line.subscribe(\n      (selected_line_prev) => {\n        if (selected_line_prev) {\n          selected_line_prev.is_selected(false);\n        }\n      },\n      this,\n      \"beforeChange\",\n    );\n    // Update the new selected line\n    this.selected_line.subscribe((selected_line) => {\n      if (selected_line.command.is_debug()) {\n        this.show_debug(true);\n      }\n      selected_line.command.is_expanded(true);\n      selected_line.is_selected(true);\n      this.selected_hash(selected_line.anchor_id());\n    });\n\n    /* Debug */\n    /** @observable {Boolean} Show debug/info commands */\n    this.show_debug = ko.observable(false);\n\n    /* Raw log */\n    /** The view mode is kept in the ``view`` query parameter, so the raw log\n     * can be linked to directly.\n     * @observable {Boolean} Show the raw log instead of the command table */\n    this.show_raw = ko.observable(\n      new URLSearchParams(location.search).get(\"view\") === \"raw\",\n    );\n    this.show_raw.subscribe((show_raw) => {\n      const url = new URL(location);\n      if (show_raw) {\n        url.searchParams.set(\"view\", \"raw\");\n      } else {\n        url.searchParams.delete(\"view\");\n      }\n      history.replaceState(null, \"\", url);\n    });\n\n    /** @observable {Boolean} Are we still polling the API? */\n    this.is_polling = ko.observable(true);\n    this.is_polling.subscribe((is_polling) => {\n      if (!is_polling) {\n        this.set_selected_line_from_hash(this.selected_hash());\n      }\n    });\n\n    if (this.url_api_build) {\n      this.poll_api_build();\n    }\n    if (this.url_api_notifications) {\n      this.poll_api_notifications();\n    }\n  }\n\n  /**\n   * Continually poll our APIv2 for build object and update Build, BuildCommand,\n   * and BuildCommandOutput states. When the API return indicates the build is\n   * finished, we stop recursive polling.\n   */\n  poll_api_build() {\n    jquery\n      .getJSON(this.url_api_build)\n      .then((data) => {\n        this.date(data.date);\n        this.success(data.success);\n        this.error(data.error);\n        this.length(data.length);\n        this.commit(data.commit);\n        this.docs_url(data.docs_url);\n        this.commit_url(data.commit_url);\n        this.builder(data.builder);\n        this.config(data.config);\n        this.state(data.state);\n        this.state_display(data.state_display);\n\n        // Always update date and length, as these should update as the build progresses\n        this.date.valueHasMutated();\n        this.length.valueHasMutated();\n\n        // This is a mock command used to preview the command output.\n        // TODO probably do this in the application instead\n        this.add_command({\n          id: 0,\n          command: \"readthedocs-build --show-config\",\n          output: JSON.stringify(data.config, null, \"  \"),\n          exit_code: 0,\n          run_time: 0,\n          is_debug: true,\n        });\n        for (const command of data.commands) {\n          this.add_command(command);\n        }\n\n        // We've completed a request to the API. From here, we are not loading\n        // from the API, but we'll be polling until the build is finished.\n        this.is_loading(false);\n      })\n      .then(() => {\n        // Continually poll API while build is not finished. If it is in a finished\n        // state, this method will return without setting another timer. We do not\n        // updated :attr:`is_polling` by computed/subscription as we want to ensure\n        // this update happens at the very end of API updates instead.\n        if (this.is_finished()) {\n          this.is_polling(false);\n        } else {\n          setTimeout(() => {\n            this.poll_api_build();\n            this.poll_api_notifications();\n          }, 2000);\n        }\n      });\n  }\n\n  /** Poll APIv3 build notification API directly\n   *\n   * We have to do this because we rely on the build APIv2 for everything else\n   * and the APIv3 build endpoints don't have the data required yet.\n   *\n   * TODO this should all happen under a single build API v3 poll instead, and\n   * this method should go away.\n   *\n   * @param {str} url - APIv3 build notification endpoint\n   */\n  poll_api_notifications() {\n    const params = {\n      state__in: \"read,unread\",\n    };\n    jquery.getJSON(this.url_api_notifications, params).then((data) => {\n      if (data.results) {\n        this.notifications(data.results);\n      }\n    });\n  }\n\n  /** Add a command to :attr:`commands` if it doesn't already exist\n   *\n   * @param {Object} command - Build command API data structure\n   */\n  add_command(command) {\n    const command_found = ko.utils.arrayFirst(\n      this.commands(),\n      (command_search) => {\n        return command_search.id() === command.id;\n      },\n    );\n    if (command_found) {\n      command_found.output(command.output);\n      command_found.exit_code(command.exit_code || 0);\n      command_found.run_time(command.run_time);\n      command_found.start_time(command.start_time);\n      command_found.end_time(command.end_time);\n    } else {\n      this.commands.push(new BuildCommand(command));\n    }\n  }\n\n  /**\n   * Set the selected line and focus on the new selected element\n   *\n   * This is called from :meth:`set_selected_line_from_hash`, but also from the\n   * line number link click event. We return ``false`` at the end to avoid the\n   * default behavior and event propagation.\n   *\n   * @param {BuildCommandOutput} selected_line - Command output line to target\n   */\n  set_selected_line(selected_line) {\n    this.selected_line(selected_line);\n    // The attribute ``data-selected`` is set in the templates. This isn't\n    // ideal, but easier than a custom KO plugin.\n    const elem = document.querySelector(\"[data-selected=true]\");\n    if (elem) {\n      if (elem.scrollIntoView) {\n        // Try modern centered focus on element, instead of focus at the top of\n        // the viewport.\n        elem.scrollIntoView({\n          behavior: \"auto\",\n          block: \"center\",\n          inline: \"center\",\n        });\n      } else {\n        // Back up to the default focus for old browsers\n        jquery(elem).focus();\n      }\n    }\n    return false;\n  }\n\n  /**\n   * Set the selected line by looking up the line that corresponds to the\n   * selected anchor hash.\n   *\n   * This loops over the commands and lines to reduce the number of operations.\n   * Normally, :attr:`BuildCommandOutput.is_selected` might be a computed\n   * observable, but then updates to the selected line are always O(n), for\n   * every line of output, across all commands. We can reduce this greatly by\n   * iterating over commands, then command lines.\n   *\n   * @param {string} selected_hash - Hash to lookup\n   */\n  set_selected_line_from_hash(selected_hash) {\n    const re_hash = /^#(\\d+)--(\\d+)$/; // (?:$|(\\d+)$)/; // multiple lines!\n\n    if (selected_hash) {\n      let found = selected_hash.match(re_hash);\n\n      if (!found) {\n        return;\n      }\n\n      const selected_command = ko.utils.arrayFirst(\n        this.commands(),\n        (command_search) => {\n          return command_search.id() == found[1];\n        },\n      );\n      if (selected_command) {\n        const selected_line = ko.utils.arrayFirst(\n          selected_command.output_lines(),\n          (output_line) => {\n            return output_line.line_number() == found[2];\n          },\n        );\n\n        if (selected_line) {\n          this.set_selected_line(selected_line);\n        }\n      }\n    }\n  }\n\n  // TODO is this needed? This is likely old view cruft\n  show_legacy_output() {\n    this.legacy_output(true);\n  }\n\n  /** Helper for toggling debug mode on the view. This hides some informational\n   * commands and the configuration file output step */\n  toggle_debug() {\n    const show_debug = this.show_debug();\n    this.show_debug(!show_debug);\n  }\n\n  /** Show the command table */\n  show_output() {\n    this.show_raw(false);\n  }\n\n  /** Show the raw log */\n  show_raw_log() {\n    this.show_raw(true);\n  }\n\n  /** Update all attributes and observables that depend on build state */\n  update_state(state) {\n    // Is build in one of the finished states?\n    if ([\"finished\", \"cancelled\"].includes(state)) {\n      this.is_finished(true);\n      this.can_cancel(false);\n      // TODO there is more logic on whether a build can retry in the\n      // application, but this is not surfaced in the API response.\n      this.can_retry(true);\n\n      if (this.success()) {\n        this.can_view_docs(true);\n      }\n    } else {\n      // We use any other status here to finally update ``can_cancel`` from\n      // it's default of ``false``. The default ensure we don't flash the\n      // button if the API response ends up showing that the build finished.\n      this.can_cancel(true);\n    }\n  }\n}\n\nRegistry.add_view(BuildDetailView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n// Constants, pulled from SUI:\n// https://semantic-ui.com/elements/container.html\nconst breakpoints = {\n  mobile: 0,\n  tablet: 768,\n  computer: 992,\n  large_screen: 1200,\n};\n\n/**\n * :class:`ResponsiveView` is used to create bindings that alter elements on\n * changes to the viewport width. This can be used to add an SUI class when the\n * viewport width changes.\n *\n * Usage in a binding context:\n *\n * .. code:: html\n *\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.mobile()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.tablet()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.computer()}\">\n *   <div class=\"ui menu\" data-bind=\"css: {vertical: device.large_screen()}\">\n */\nexport class ResponsiveView {\n  constructor() {\n    this.viewport_width = ko.observable();\n    this.device = {\n      mobile: ko.observable(true),\n      tablet: ko.observable(false),\n      computer: ko.observable(false),\n      large_screen: ko.observable(false),\n    };\n\n    // Don't send too many events to listeners\n    this.viewport_width.extend({ ratelimit: 500 });\n    this.viewport_width.subscribe((width) => {\n      for (const device_name of Object.keys(this.device)) {\n        const is_device = width >= breakpoints[device_name];\n        this.device[device_name](is_device);\n      }\n    });\n\n    // Update window width. This will trigger changes to this.device\n    const jq_window = jquery(window);\n    const fn_update = () => {\n      this.viewport_width(jq_window.width());\n    };\n    jq_window.on(\"resize\", fn_update);\n    fn_update();\n  }\n}\n\n/**\n * Base class for API listing views. Provides a foundation for waiting to load\n * data from an API, loading data from an API request, and handling the data.\n *\n * ``data`` parameter needs an ``id`` and ``url`` property.\n *\n */\nexport class APIListItemView {\n  constructor(data) {\n    this.id = data.id;\n    this.url = data.url;\n    /** @observable {Boolean} Is the API request started loading? */\n    this.loaded = ko.observable(false);\n    /** @observable {Boolean} Is the API request done loading? */\n    this.loading = ko.observable(false);\n    /** The central promise for the request.\n     * @type {Promise} */\n    this.promise = null;\n    /** @observable {Object} The data returned from the API */\n    this.data = ko.observable();\n  }\n\n  /**\n   * Using the supplied configuration, perform an API request. Sets up\n   * :attr:`promise` so that the child class can manage promise resolve and\n   * reject\n   */\n  fetch() {\n    if (this.promise) {\n      return this.promise;\n    }\n    this.promise = new Promise((resolve, reject) => {\n      if (this.loaded()) {\n        return resolve(this.data());\n      }\n      this.loading(true);\n      jquery.getJSON(this.url).then((data) => {\n        this.data(data);\n        this.loaded(true);\n        this.loading(false);\n        return resolve(data);\n      });\n    });\n  }\n}\n\n// And some partial views for base template components\n\n/**\n * HeaderView\n */\nexport class HeaderView {\n  static view_name = \"HeaderView\";\n\n  constructor() {\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Header configuration, mostly for search */\n    this.config = ko.observable();\n    /** SUI search configuration object, used from templates\n     * @observable {Object} Search configuration */\n    this.search_project_config = ko.observable();\n\n    // Wait for :func:`config` to change before we init search\n    this.config.subscribe((config) => {\n      if (config === undefined) {\n        return;\n      }\n      // The URL from the config object is a relative URL, we'll use the\n      // window URL origin as the full URL\n      const url = new URL(config.api_projects_list_url, window.location.origin);\n      url.search = \"?name={query}\";\n      this.search_project_config({\n        type: \"category\",\n        apiSettings: {\n          url: url.href,\n          onResponse: (resp) => {\n            const projects = resp.results.map((elem, index) => {\n              // TODO description might be better off in the application model\n              let description = elem.slug;\n              if (elem.subproject_of) {\n                // TODO localize this\n                description = \"Subproject of \" + elem.subproject_of.name;\n              } else if (elem.translation_of) {\n                // TODO localize this\n                description =\n                  elem.language.name +\n                  \" translation of \" +\n                  elem.translation_of.name;\n              }\n\n              // Normalize URL for use in non-standard domain names\n              // TODO this is a hack to support alternative domains, like our\n              // beta/staging instance. This can be removed when there is only\n              // one dashboard subdomain.\n              let url_project = new URL(elem.urls.home);\n              let url_window = new URL(window.location.href);\n              if (url_project.hostname != url_window.hostname) {\n                url_project.hostname = url_window.hostname;\n              }\n\n              return {\n                title: elem.name,\n                description: description,\n                url: url_project.toString(),\n              };\n            });\n            const results = {\n              results: {\n                \"category-projects\": {\n                  name: \"Projects\",\n                  results: projects,\n                },\n              },\n            };\n            return results;\n          },\n        },\n        minCharacters: 2,\n      });\n    });\n  }\n}\nRegistry.add_view(HeaderView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\nimport { loadStripe } from \"@stripe/stripe-js/dist/pure.esm.js\";\n\nimport { Registry } from \"../application/registry\";\n\nclass StripeCheckoutView {\n  static view_name = \"StripeCheckoutView\";\n\n  constructor(config) {\n    this.stripeKey = config.stripeKey || \"\";\n    this.checkoutSessionUrl = config.checkoutSessionUrl || \"\";\n    this.csrfToken = config.csrfToken || \"\";\n\n    this.stripe = ko.observable();\n    this.stripeLoading = ko.observable(true);\n\n    this.priceId = ko.observable();\n\n    this.initializeStripe();\n  }\n\n  /**\n   * Load Stripe JS client dynamically\n   *\n   * The package installed through NPM is just a wrapper for the Stripe hosted\n   * JS, which is required for PCI compliance. We treat this similar to a Webpack\n   * dynamic import and wait to load the library until doing anything with it.\n   * The form element will appear disabled while the library is loading.\n   */\n  initializeStripe() {\n    return loadStripe(this.stripeKey).then((stripe) => {\n      this.stripe(stripe);\n      this.stripeLoading(false);\n    });\n  }\n\n  /**\n   * Click event handler for the Gold subscription form\n   *\n   * This posts to an internal URL to generate the Stripe checkout session and\n   * then redirects the user\n   */\n  createCheckoutSession() {\n    this.stripeLoading(true);\n\n    fetch(this.checkoutSessionUrl, {\n      method: \"POST\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"X-CSRFToken\": this.csrfToken,\n      },\n      body: JSON.stringify({\n        priceId: this.priceId(),\n      }),\n    })\n      .then((result) => {\n        this.stripeLoading(false);\n        result.json().then((data) => {\n          this.stripe().redirectToCheckout({ sessionId: data.session_id });\n        });\n      })\n      .catch((err) => {\n        this.stripeLoading(false);\n      });\n  }\n}\n\nRegistry.add_view(StripeCheckoutView);\n","import { LitElement } from \"lit\";\n\n/**\n * LightDOMElement\n *\n * This is a helper class for using a light DOM with LitElement\n * instead of a shadow DOM. Light DOM is what allows FUI styles\n * to be used inside the element.\n *\n * Also adds some debugger helpers.\n **/\nexport class LightDOMElement extends LitElement {\n  // Use light DOM with inherited styles instead of shadow DOM\n  createRenderRoot() {\n    return this;\n  }\n\n  // And some debugging calls\n  connectedCallback() {\n    super.connectedCallback();\n\n    console.debug(\"Setting up web component instance:\", this.constructor.name);\n  }\n\n  disconnectedCallback() {\n    super.disconnectedCallback();\n\n    console.debug(\n      \"Disconnecting web component instance:\",\n      this.constructor.name,\n    );\n  }\n}\n","import { LitElement, css, html, nothing, unsafeCSS } from \"lit\";\nimport pureRand from \"pure-rand\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n// This image lives alongside our CSS sources, and bundling outputs this image\n// to the application static path. From here, Django ``static`` template tag is\n// used to reference the file through storage. So, this import is not directly\n// needed here, and this might be a pattern to redo eventually.\nimport avatarImage from \"../../css/images/avatar-1.png\";\n\nexport class AvatarElement extends LitElement {\n  static properties = {\n    seed: { type: String },\n    url: { type: String },\n  };\n\n  static styles = css`\n    :host {\n      --avatar-x: 0;\n      --avatar-y: 0;\n      --avatar-scale: -10px;\n      --avatar-background-image: none;\n    }\n\n    :host > div {\n      background-image: var(--avatar-background-image);\n      background-repeat: no-repeat;\n      background-size: calc(100 * -1 * var(--avatar-scale))\n        calc(100 * -1 * var(--avatar-scale));\n      background-position-x: calc(var(--avatar-x) * var(--avatar-scale));\n      background-position-y: calc(var(--avatar-y) * var(--avatar-scale));\n      image-rendering: pixelated;\n      width: calc(var(--avatar-scale) * -4);\n      height: calc(var(--avatar-scale) * -4);\n    }\n  `;\n\n  render() {\n    return html`<div></div>`;\n  }\n\n  updated(changed) {\n    // Dynamically update background position through CSS variables. The\n    // ``styles`` attribute does not work with dynamic rules, but we can do the\n    // same after an updated event on the web component.\n    if (changed.has(\"seed\") && this.seed) {\n      const rng = pureRand.xoroshiro128plus(this.seed);\n      const posX = pureRand.unsafeUniformIntDistribution(0, 99, rng);\n      const posY = pureRand.unsafeUniformIntDistribution(0, 99, rng);\n      this.style.setProperty(\"--avatar-x\", posX);\n      this.style.setProperty(\"--avatar-y\", posY);\n    }\n    // Similarly, load the image through the avatar URL attribute, as we want\n    // the fully resolved storage URL from Django staticfiles.\n    if (changed.has(\"url\") && this.url) {\n      this.style.setProperty(\"--avatar-background-image\", `url(\"${this.url}\")`);\n    }\n  }\n}\n\ncustomElements.define(\"readthedocs-avatar\", AvatarElement);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Collapsing header view, for project and organization detail pages\n *\n * @class\n * @constructor\n * @public\n */\nexport class CollapsingHeaderView {\n  static view_name = \"CollapsingHeaderView\";\n\n  constructor(collapsed = true) {\n    /** @observable {Object} Whether the header view is collapsed by default */\n    this.is_collapsed = ko.observable(collapsed);\n\n    /** Computed observable for the dropdown link class, so it swaps\n     *\n     * @computed {Object} CSS class for dropdown link\n     */\n    this.dropdown_class = ko.computed(() => {\n      return this.is_collapsed() ? \"fa-caret-down\" : \"fa-caret-up\";\n    });\n  }\n\n  toggle_collapsed() {\n    const value = this.is_collapsed();\n    this.is_collapsed(!value);\n  }\n}\nRegistry.add_view(CollapsingHeaderView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Base view for configuring a view filter.\n *\n * Filters fields are all individually configured with the ``filter_config``\n * property as the configuration for the FUI dropdown element. This\n * configuration converts an ``onchange`` event into a form submission\n * automatically.\n *\n * This configuration is used directly in the ``includes/filter/form.html``\n * include, once per filter field.\n *\n * @class\n * @constructor\n * @public\n */\nexport class FilterView {\n  static view_name = \"FilterView\";\n\n  constructor() {\n    this.filter_config = {\n      action: \"activate\",\n      onChange: (value, label, $elem) => {\n        // Note: limit use of jQuery selector aid. It's confusing to mix Django\n        // templates, knockout, and random jQuery selections in the page. Most\n        // of the time, you should be able to use a knockout binding, but this\n        // was rather trivial and resulted in no additional observables on the\n        // view.\n        const form = $elem.closest(\"form\");\n        form.submit();\n      },\n    };\n  }\n}\nRegistry.add_view(FilterView);\n","import jquery from \"jquery\";\n\nimport { html } from \"lit\";\nimport { when } from \"lit/directives/when.js\";\nimport { ref, createRef } from \"lit/directives/ref.js\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Field element web component base class\n *\n * This element wraps fields from Crispy/Django. These elements follow a progressive enhancement, rely on direct DOM manipulation instead of\n * rendering the full element from a Lit template. This helps keeps parent web components purely rendered.\n *\n * These elements will be most helpful used from parent web components:\n *\n * .. code:: javascript\n *\n *     render() {\n *       return html`\n *         <readthedocs-input-field\n *             .value=\"${this.value}\"\n *             .disabled=\"${this.disabled}\"\n *             @change=\"${this.handler}\">\n *           <input type=\"text\" name=\"foo\" />\n *         </readthedocs-input-field>\n *       `;\n *\n * @property {String} value - Input field value for the form\n * @property {Boolean} disabled - Is the field in a disabled state? Controls tab index\n * @property {String} selector - CSS selector used to find the input in the light DOM\n * @property {Boolean} hasError - Are there errors in the field\n * @fires change - Event fired on attribute and error state changes\n */\nexport class FieldElement extends LightDOMElement {\n  static properties = {\n    value: { type: String },\n    disabled: { type: Boolean },\n    selector: { type: String },\n    hasError: { type: Boolean },\n  };\n\n  /** @attr {Ref} refInput - Reference to the input element */\n  refInput = createRef();\n  /** @attr {Ref} refErrors - Reference to the errors list element */\n  refErrors = createRef();\n\n  constructor() {\n    super();\n    this.selector = \"input[name]\";\n    this.hasError = false;\n  }\n\n  /**\n   * Manually configure element references, we can't use a render template to\n   * establish element references via ``ref()``.\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.refInput.value = this.querySelector(this.selector);\n    this.refErrors.value = this.querySelector(\".ui.negative.label\");\n    this.hasError = Boolean(this.refErrors.value);\n  }\n\n  /**\n   * Set tab index on field to protect disabled fields from keyboard focus.\n   *\n   * Field types have differing elements that will need to alter tab index, so\n   * this can be overridden for any inherited classes.\n   */\n  set tabIndex(tabIndex) {\n    const elemInput = this.refInput.value;\n    elemInput.setAttribute(\"tabIndex\", tabIndex);\n  }\n\n  /**\n   * Setter for input field value, this can vary by subclass.\n   */\n  set inputValue(value) {\n    const elemInput = this.refInput.value;\n    elemInput.value = this.value;\n  }\n\n  /**\n   * Lit updated properties from Lit property lifecycle.\n   *\n   * This is finally called for any properties , reflect these in the already\n   * rendered child elements.\n   *\n   * @param {Map} changed - properties that have changed on first update\n   */\n  updated(changed) {\n    if (changed.has(\"value\")) {\n      this.inputValue = this.value;\n    }\n    if (changed.has(\"disabled\")) {\n      this.tabIndex = this.disabled ? -1 : 0;\n    }\n    if (changed.has(\"hasError\") && this.hasError) {\n      this.dispatchChangeEvent();\n    }\n  }\n\n  /**\n   * Emit change event from this event\n   *\n   * In a Lit template, subscribe to this event in a render template with:\n   * ``<readthedocs-field @change=\"${this.someEventHandler}\">``.\n   *\n   * @fires change - Change event fired on property changes and error state\n   */\n  dispatchChangeEvent() {\n    this.dispatchEvent(\n      new CustomEvent(\"change\", {\n        bubbles: false,\n        composed: false,\n      }),\n    );\n  }\n\n  /**\n   * Clear error state and Crispy error elements\n   */\n  clearErrors() {\n    if (this.hasError) {\n      const elemErrors = this.refErrors.value;\n      elemErrors.remove();\n      this.hasError = false;\n    }\n  }\n}\n\n/**\n * Field element for InputElement driven form fields\n *\n * Update events on the input element trigger changes here and emit events for\n * changes in the parent element.\n */\nclass InputFieldElement extends FieldElement {\n  connectedCallback() {\n    super.connectedCallback();\n    const elemInput = this.refInput.value;\n    if (elemInput) {\n      this.value = elemInput.value;\n      elemInput.addEventListener(\"change\", (event) => {\n        this.dispatchChangeEvent();\n        event.stopPropagation();\n      });\n    }\n  }\n}\ncustomElements.define(\"readthedocs-input-field\", InputFieldElement);\n\n/**\n * Field element for SUI dropdown driven form fields\n *\n * This relies on the SUI dropdown module and module behaviors to drive all of\n * the element properties and dropdown UI manipulation.\n *\n * @property {String} description - Rich select field choice description data\n * @fires change - On dropdown select and initial element set up, fires event\n */\nexport class RichSelectFieldElement extends FieldElement {\n  static get properties() {\n    const properties = FieldElement.properties;\n    properties.description = { type: String };\n    return properties;\n  }\n\n  constructor() {\n    super();\n    this.selector = \".ui.dropdown\";\n  }\n\n  connectedCallback() {\n    super.connectedCallback();\n    if (this.refInput.value) {\n      this.dropdown({\n        fireOnInit: true,\n        onChange: (value, text, $selected) => {\n          // $selected is a jQuery element\n          const selected = $selected[0];\n          this.value = selected.dataset.value;\n          this.description = selected.dataset.description;\n          this.dispatchChangeEvent();\n        },\n      });\n    }\n  }\n\n  /**\n   * Call SUI dropdown module\n   *\n   * This calls into the SUI jQuery ``dropdown`` module and can be used for\n   * both configuring the module or calling any of the behaviors the module\n   * provides (see https://fomantic-ui.com/modules/dropdown.html#behavior)\n   *\n   * @param {...*} args - All arguments to this functionm pass through\n   */\n  dropdown(...args) {\n    return jquery(this.refInput.value).dropdown(...args);\n  }\n\n  set inputValue(value) {\n    // Call ``set selected`` behavior with ``value`` and ``preventChangeTrigger=true``\n    // to avoid retriggering the ``onChange`` callback.\n    this.dropdown(\"set selected\", value, true);\n  }\n\n  set tabIndex(tabIndex) {\n    // The module behavior ``set tabbable`` does not seem to work like we want,\n    // don't use it here and instead alter the input manually.\n    this.refInput.value\n      .querySelector(\"input.search\")\n      .setAttribute(\"tabIndex\", tabIndex);\n  }\n}\ncustomElements.define(\"readthedocs-richselect-field\", RichSelectFieldElement);\n","import jquery from \"jquery\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { ContextProvider, ContextConsumer, createContext } from \"@lit/context\";\nimport { msg } from \"@lit/localize\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { when } from \"lit/directives/when.js\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * API event wrapper\n *\n * Generic button/link wrapper to POST to a URL on an event like \"click\".\n * Handles error feedback via toast message and redirection on success.\n *\n * @param {string} csrfToken - CSRF token from Django, attribute ``csrf-token``\n * @param {string} url - API URL for request\n *\n * TODO Deprecate this in favor of APIProviderElement\n **/\nexport class APIEventWrapper extends LightDOMElement {\n  static properties = {\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    url: { type: String },\n\n    // For API response\n    data: { state: true },\n  };\n\n  static method = \"POST\";\n  static event = \"click\";\n  static errorMessage = \"There was a problem with your request\";\n\n  // This is just a wrapper, so we rely on the inner HTML for all of the\n  // display and instead just wrap the outer with a clickable element.\n  constructor() {\n    super();\n    this.addEventListener(this.constructor.event, () => {\n      this.onEvent();\n    });\n  }\n\n  getHeaders() {\n    let headers = {\n      Accept: \"application/json\",\n      \"Content-Type\": \"application/json\",\n    };\n    if (this.csrfToken) {\n      headers[\"X-CSRFToken\"] = this.csrfToken;\n    }\n    return headers;\n  }\n\n  getUrl() {\n    return this.url;\n  }\n\n  onEvent() {\n    if (this.request == undefined) {\n      const classes = this.classList;\n      classes.add(\"loading\");\n      this.sendRequest().finally(() => {\n        classes.remove(\"loading\");\n      });\n    }\n  }\n\n  sendRequest() {\n    const options = {\n      method: this.constructor.method,\n      headers: this.getHeaders(),\n    };\n\n    this.request = fetch(this.getUrl(), options)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Request failed\");\n        }\n        return response.json();\n      })\n      .then((data) => {\n        console.debug(\"Received API reponse:\", data);\n        return this.onResponse(data);\n      })\n      .catch((err) => {\n        this.onError(err);\n      });\n\n    return this.request;\n  }\n\n  onResponse(data) {\n    this.data = data;\n    const urlSuccess = this.getSuccessURL();\n    if (urlSuccess) {\n      window.location.href = urlSuccess;\n    }\n  }\n\n  /** Return URL to redirect to on success\n   *\n   * Can use ``this.data`` to get API return from ``_link`` and other fields.\n   *\n   * @returns {string} - URL\n   **/\n  getSuccessURL() {\n    return;\n  }\n\n  /** Display error toast message on request error\n   *\n   * @param {Error} err - Exception raised during request\n   **/\n  onError(err) {\n    jquery.toast({\n      class: \"error\",\n      message: this.constructor.errorMessage,\n    });\n  }\n}\n\n/**\n * Menu item for rebuilding a version\n *\n * Uploaded versions are never rebuilt by Read the Docs. With the ``uploaded``\n * attribute the element renders disabled, ignores clicks, and shows a tooltip\n * explaining why.\n **/\nclass MenuBuildRebuildElement extends APIEventWrapper {\n  static properties = {\n    uploaded: { type: Boolean },\n  };\n\n  // TODO translate this here or use a different pattern\n  static errorMessage =\n    \"There was an error starting a new build for this version\";\n  static uploadedMessage =\n    \"This version is updated by direct upload. Rebuild it from your own pipeline.\";\n\n  firstUpdated() {\n    if (this.uploaded) {\n      this.classList.add(\"disabled\");\n      this.setAttribute(\"aria-disabled\", \"true\");\n      jquery(this).popup({ content: this.constructor.uploadedMessage });\n    }\n  }\n\n  onEvent() {\n    if (this.uploaded) {\n      return;\n    }\n    super.onEvent();\n  }\n\n  getSuccessURL() {\n    return this?.data?.build?.urls?.build;\n  }\n}\n\ncustomElements.define(\n  \"readthedocs-menu-build-rebuild\",\n  MenuBuildRebuildElement,\n);\n\n/** Button for resyncing all versions **/\nclass ButtonSyncAllVersionsElement extends APIEventWrapper {\n  // TODO translate this here or use a different pattern\n  static errorMessage = \"There was an error syncing versions.\";\n\n  getSuccessURL() {\n    console.log(\"Successfully synced versions\");\n  }\n\n  // Override the base class to delay the loading state removal\n  onEvent() {\n    if (this.request == undefined) {\n      const classes = this.classList;\n      classes.add(\"loading\");\n      this.sendRequest().finally(() => {\n        setTimeout(() => {\n          classes.remove(\"loading\");\n        }, 2000);\n      });\n    }\n  }\n}\n\ncustomElements.define(\n  \"readthedocs-button-sync-versions\",\n  ButtonSyncAllVersionsElement,\n);\n\n/**\n * Lit data contexts for elements with API interactions\n *\n * These data contexts are provided by :js:class:`APIProviderElement` and\n * consumed by :js:class:`APIConsumerElement`. This allows a central element to\n * execute an API request (table row, or a group of buttons) and for sub elements\n * at any point in the nested DOM to use this response (a button nested in the\n * table row, a submenu in the group of buttons).\n **/\nconst contextData = createContext(Symbol(\"data\"));\nconst contextState = createContext(Symbol(\"state\"));\n\n/**\n * API response states enum\n *\n * These are used by API response provider/consumer\n **/\nconst States = Object.freeze({\n  WAITING: Symbol(\"waiting\"),\n  LOADING: Symbol(\"loading\"),\n  DONE: Symbol(\"done\"),\n});\n\n/**\n * Context provider element for API response\n *\n * On an event (mouseover by default), this element starts an API request to the\n * URL specified. It eventually stores the response data in a data context for\n * nested consumer elements.\n *\n * Handles error feedback via toast message and redirection on success.\n *\n * @extends APIEventWrapper\n *\n * TODO This can replace the parent APIEventWrapper element above\n **/\nexport class APIProviderElement extends APIEventWrapper {\n  static method = \"GET\";\n  static event = \"mouseover\";\n\n  /** @type {ContextProvider} Reactive data context for API response data **/\n  _providerData = new ContextProvider(this, {\n    context: contextData,\n  });\n\n  set data(value) {\n    this._providerData.setValue(value);\n  }\n\n  /** @type {ContextProvider} Reactive data context for API response state **/\n  _providerState = new ContextProvider(this, {\n    context: contextState,\n  });\n\n  set state(value) {\n    this._providerState.setValue(value);\n  }\n\n  constructor() {\n    super();\n    this.state = States.WAITING;\n  }\n\n  onEvent() {\n    if (this.request == undefined) {\n      this.state = States.LOADING;\n      this.sendRequest().finally(() => {\n        this.state = States.DONE;\n      });\n    }\n  }\n\n  onResponse(data) {\n    this.data = data;\n  }\n}\n\ncustomElements.define(\"readthedocs-api\", APIProviderElement);\n\n/**\n * Context consumer element for API response\n *\n * This element waits for a parent anywhere up the DOM tree to emit a data\n * context element. There are two data contexts: the response state and the\n * response data.\n *\n * @extends LightDOMElement\n *\n * @property {Boolean} disabled - Render the element in a disabled state\n * @property {String} label - Label for the element and ARIA\n **/\nexport class APIConsumerElement extends LightDOMElement {\n  static properties = {\n    disabled: {\n      type: Boolean,\n    },\n    label: {\n      type: String,\n    },\n  };\n\n  /** @type {ContextConsumer} Reactive consumer for API response context data **/\n  _consumerData = new ContextConsumer(this, {\n    context: contextData,\n    subscribe: true,\n  });\n\n  get data() {\n    return this._consumerData.value;\n  }\n\n  /** @type {ContextConsumer} Reactive consumer for API request state context data **/\n  _consumerState = new ContextConsumer(this, {\n    context: contextState,\n    subscribe: true,\n  });\n\n  /** @type {State} Reactive context data for API request state **/\n  get state() {\n    return this._consumerState.value;\n  }\n\n  constructor() {\n    super();\n    this.disabled = false;\n  }\n\n  /**\n   * Queue event for late loading links\n   *\n   * Wait until the request promise resolves and then reemit the event to\n   * finally follow the link. This is useful for links that have a late-loaded\n   * ``href``.\n   *\n   * Use it in templates with ``html`<div @click=\"${this.queueEvent}\">``\n   *\n   * @param event {Event} - Click or other event\n   **/\n  queueEvent(event) {\n    if (this.state !== States.DONE) {\n      console.debug(\"Queueing click event:\", event);\n      event.preventDefault();\n      event.stopPropagation();\n\n      this._consumerState.callback = (value) => {\n        if (value === States.DONE) {\n          console.debug(\"Replaying click event:\", event);\n          // dispatchEvent doesn't seem to work here, so we just create a brand\n          // new event here instead.\n          event.target.click();\n        }\n      };\n    }\n  }\n}\n\n// Menu items\nexport class ItemDocsElement extends APIConsumerElement {\n  render() {\n    let label = this.label || msg(`View documentation`);\n    return html`\n      <a\n        class=\"ui button ${classMap({\n          disabled: this.disabled,\n          loading: !this.disabled && this.state === States.LOADING,\n        })}\"\n        href=${this.data?.urls?.documentation || `#`}\n        @click=${this.queueEvent}\n        data-content=\"${label}\"\n        aria-label=\"${label}\"\n        target=\"_blank\"\n        tabindex=\"${when(\n          !this.disabled,\n          () => html`0`,\n          () => html`-1`,\n        )}\"\n      >\n        <i class=\"fa-duotone fa-book icon\"></i>\n      </a>\n    `;\n  }\n}\ncustomElements.define(\"readthedocs-item-docs\", ItemDocsElement);\n\nexport class ItemDownloadsElement extends APIConsumerElement {\n  render() {\n    let label = this.label || msg(`Offline formats`);\n    return html`\n      <button\n        class=\"ui ${classMap({ disabled: this.disabled })} dropdown button\"\n        data-content=\"${label}\"\n        aria-label=\"${label}\"\n        tabindex=\"${when(\n          this.disabled,\n          () => html`0`,\n          () => html`-1`,\n        )}\"\n      >\n        <i class=\"fa-solid fa-download icon\"></i>\n        <div class=\"menu\">\n          <div class=\"header\">${msg(`Offline formats`)}</div>\n          <a\n            href=\"${this.data?.downloads?.pdf}\"\n            class=\"${classMap({ disabled: !this.data?.downloads?.pdf })} item\"\n          >\n            <i class=\"fa-duotone fa-file icon\"></i>\n            ${msg(`PDF file`)}\n          </a>\n          <a\n            href=\"${this.data?.downloads?.epub}\"\n            class=\"${classMap({ disabled: !this.data?.downloads?.epub })} item\"\n          >\n            <i class=\"fa-duotone fa-file icon\"></i>\n            ${msg(`ePUB file`)}\n          </a>\n          <a\n            href=\"${this.data?.downloads?.htmlzip}\"\n            class=\"${classMap({\n              disabled: !this.data?.downloads?.htmlzip,\n            })} item\"\n          >\n            <i class=\"fa-duotone fa-file-zipper icon\"></i>\n            ${msg(`HTML archive`)}\n          </a>\n        </div>\n      </button>\n    `;\n  }\n}\ncustomElements.define(\"readthedocs-item-downloads\", ItemDownloadsElement);\n\nclass MenuProjectAdminElement extends APIConsumerElement {\n  static get properties() {\n    // TODO `urlSettings` should be part of APIv3 response\n    let _properties = APIConsumerElement.properties;\n    _properties[\"urlSettings\"] = { type: String, attribute: \"url-settings\" };\n    return _properties;\n  }\n\n  render() {\n    const isAdmin = this.data?.permissions?.admin;\n    // This preemptively supports a settings URL, which can be passed in as an\n    // attribute in the meantime. The `urlSettings` property can go away with this.\n    const urlSettings = this.data?.urls?.settings || this.urlSettings;\n    return html`\n      <div class=\"header\">${msg(`Admin`)}</div>\n      <a class=\"${classMap({ disabled: !isAdmin })} item\" href=\"${urlSettings}\">\n        <i class=\"fa-duotone fa-wrench icon\"></i>\n        ${msg(`Configure project`)}\n      </a>\n    `;\n  }\n}\ncustomElements.define(\n  \"readthedocs-menu-project-admin\",\n  MenuProjectAdminElement,\n);\n","/*! @license DOMPurify 3.2.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.2/LICENSE */\n\nconst {\n  entries,\n  setPrototypeOf,\n  isFrozen,\n  getPrototypeOf,\n  getOwnPropertyDescriptor\n} = Object;\nlet {\n  freeze,\n  seal,\n  create\n} = Object; // eslint-disable-line import/no-mutable-exports\nlet {\n  apply,\n  construct\n} = typeof Reflect !== 'undefined' && Reflect;\nif (!freeze) {\n  freeze = function freeze(x) {\n    return x;\n  };\n}\nif (!seal) {\n  seal = function seal(x) {\n    return x;\n  };\n}\nif (!apply) {\n  apply = function apply(fun, thisValue, args) {\n    return fun.apply(thisValue, args);\n  };\n}\nif (!construct) {\n  construct = function construct(Func, args) {\n    return new Func(...args);\n  };\n}\nconst arrayForEach = unapply(Array.prototype.forEach);\nconst arrayPop = unapply(Array.prototype.pop);\nconst arrayPush = unapply(Array.prototype.push);\nconst stringToLowerCase = unapply(String.prototype.toLowerCase);\nconst stringToString = unapply(String.prototype.toString);\nconst stringMatch = unapply(String.prototype.match);\nconst stringReplace = unapply(String.prototype.replace);\nconst stringIndexOf = unapply(String.prototype.indexOf);\nconst stringTrim = unapply(String.prototype.trim);\nconst objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);\nconst regExpTest = unapply(RegExp.prototype.test);\nconst typeErrorCreate = unconstruct(TypeError);\n/**\n * Creates a new function that calls the given function with a specified thisArg and arguments.\n *\n * @param func - The function to be wrapped and called.\n * @returns A new function that calls the given function with a specified thisArg and arguments.\n */\nfunction unapply(func) {\n  return function (thisArg) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    return apply(func, thisArg, args);\n  };\n}\n/**\n * Creates a new function that constructs an instance of the given constructor function with the provided arguments.\n *\n * @param func - The constructor function to be wrapped and called.\n * @returns A new function that constructs an instance of the given constructor function with the provided arguments.\n */\nfunction unconstruct(func) {\n  return function () {\n    for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n      args[_key2] = arguments[_key2];\n    }\n    return construct(func, args);\n  };\n}\n/**\n * Add properties to a lookup table\n *\n * @param set - The set to which elements will be added.\n * @param array - The array containing elements to be added to the set.\n * @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.\n * @returns The modified set with added elements.\n */\nfunction addToSet(set, array) {\n  let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;\n  if (setPrototypeOf) {\n    // Make 'in' and truthy checks like Boolean(set.constructor)\n    // independent of any properties defined on Object.prototype.\n    // Prevent prototype setters from intercepting set as a this value.\n    setPrototypeOf(set, null);\n  }\n  let l = array.length;\n  while (l--) {\n    let element = array[l];\n    if (typeof element === 'string') {\n      const lcElement = transformCaseFunc(element);\n      if (lcElement !== element) {\n        // Config presets (e.g. tags.js, attrs.js) are immutable.\n        if (!isFrozen(array)) {\n          array[l] = lcElement;\n        }\n        element = lcElement;\n      }\n    }\n    set[element] = true;\n  }\n  return set;\n}\n/**\n * Clean up an array to harden against CSPP\n *\n * @param array - The array to be cleaned.\n * @returns The cleaned version of the array\n */\nfunction cleanArray(array) {\n  for (let index = 0; index < array.length; index++) {\n    const isPropertyExist = objectHasOwnProperty(array, index);\n    if (!isPropertyExist) {\n      array[index] = null;\n    }\n  }\n  return array;\n}\n/**\n * Shallow clone an object\n *\n * @param object - The object to be cloned.\n * @returns A new object that copies the original.\n */\nfunction clone(object) {\n  const newObject = create(null);\n  for (const [property, value] of entries(object)) {\n    const isPropertyExist = objectHasOwnProperty(object, property);\n    if (isPropertyExist) {\n      if (Array.isArray(value)) {\n        newObject[property] = cleanArray(value);\n      } else if (value && typeof value === 'object' && value.constructor === Object) {\n        newObject[property] = clone(value);\n      } else {\n        newObject[property] = value;\n      }\n    }\n  }\n  return newObject;\n}\n/**\n * This method automatically checks if the prop is function or getter and behaves accordingly.\n *\n * @param object - The object to look up the getter function in its prototype chain.\n * @param prop - The property name for which to find the getter function.\n * @returns The getter function found in the prototype chain or a fallback function.\n */\nfunction lookupGetter(object, prop) {\n  while (object !== null) {\n    const desc = getOwnPropertyDescriptor(object, prop);\n    if (desc) {\n      if (desc.get) {\n        return unapply(desc.get);\n      }\n      if (typeof desc.value === 'function') {\n        return unapply(desc.value);\n      }\n    }\n    object = getPrototypeOf(object);\n  }\n  function fallbackValue() {\n    return null;\n  }\n  return fallbackValue;\n}\n\nconst html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);\n// SVG\nconst svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);\nconst svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);\n// List of SVG elements that are disallowed by default.\n// We still need to know them so that we can do namespace\n// checks properly in case one wants to add them to\n// allow-list.\nconst svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);\nconst mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);\n// Similarly to SVG, we want to know all MathML elements,\n// even those that we disallow by default.\nconst mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);\nconst text = freeze(['#text']);\n\nconst html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);\nconst svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);\nconst mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);\nconst xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);\n\n// eslint-disable-next-line unicorn/better-regex\nconst MUSTACHE_EXPR = seal(/\\{\\{[\\w\\W]*|[\\w\\W]*\\}\\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode\nconst ERB_EXPR = seal(/<%[\\w\\W]*|[\\w\\W]*%>/gm);\nconst TMPLIT_EXPR = seal(/\\${[\\w\\W]*}/gm);\nconst DATA_ATTR = seal(/^data-[\\-\\w.\\u00B7-\\uFFFF]/); // eslint-disable-line no-useless-escape\nconst ARIA_ATTR = seal(/^aria-[\\-\\w]+$/); // eslint-disable-line no-useless-escape\nconst IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\\-]+(?:[^a-z+.\\-:]|$))/i // eslint-disable-line no-useless-escape\n);\nconst IS_SCRIPT_OR_DATA = seal(/^(?:\\w+script|data):/i);\nconst ATTR_WHITESPACE = seal(/[\\u0000-\\u0020\\u00A0\\u1680\\u180E\\u2000-\\u2029\\u205F\\u3000]/g // eslint-disable-line no-control-regex\n);\nconst DOCTYPE_NAME = seal(/^html$/i);\nconst CUSTOM_ELEMENT = seal(/^[a-z][.\\w]*(-[.\\w]+)+$/i);\n\nvar EXPRESSIONS = /*#__PURE__*/Object.freeze({\n  __proto__: null,\n  ARIA_ATTR: ARIA_ATTR,\n  ATTR_WHITESPACE: ATTR_WHITESPACE,\n  CUSTOM_ELEMENT: CUSTOM_ELEMENT,\n  DATA_ATTR: DATA_ATTR,\n  DOCTYPE_NAME: DOCTYPE_NAME,\n  ERB_EXPR: ERB_EXPR,\n  IS_ALLOWED_URI: IS_ALLOWED_URI,\n  IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,\n  MUSTACHE_EXPR: MUSTACHE_EXPR,\n  TMPLIT_EXPR: TMPLIT_EXPR\n});\n\n/* eslint-disable @typescript-eslint/indent */\n// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType\nconst NODE_TYPE = {\n  element: 1,\n  attribute: 2,\n  text: 3,\n  cdataSection: 4,\n  entityReference: 5,\n  // Deprecated\n  entityNode: 6,\n  // Deprecated\n  progressingInstruction: 7,\n  comment: 8,\n  document: 9,\n  documentType: 10,\n  documentFragment: 11,\n  notation: 12 // Deprecated\n};\nconst getGlobal = function getGlobal() {\n  return typeof window === 'undefined' ? null : window;\n};\n/**\n * Creates a no-op policy for internal use only.\n * Don't export this function outside this module!\n * @param trustedTypes The policy factory.\n * @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).\n * @return The policy created (or null, if Trusted Types\n * are not supported or creating the policy failed).\n */\nconst _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {\n  if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {\n    return null;\n  }\n  // Allow the callers to control the unique policy name\n  // by adding a data-tt-policy-suffix to the script element with the DOMPurify.\n  // Policy creation with duplicate names throws in Trusted Types.\n  let suffix = null;\n  const ATTR_NAME = 'data-tt-policy-suffix';\n  if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {\n    suffix = purifyHostElement.getAttribute(ATTR_NAME);\n  }\n  const policyName = 'dompurify' + (suffix ? '#' + suffix : '');\n  try {\n    return trustedTypes.createPolicy(policyName, {\n      createHTML(html) {\n        return html;\n      },\n      createScriptURL(scriptUrl) {\n        return scriptUrl;\n      }\n    });\n  } catch (_) {\n    // Policy creation failed (most likely another DOMPurify script has\n    // already run). Skip creating the policy, as this will only cause errors\n    // if TT are enforced.\n    console.warn('TrustedTypes policy ' + policyName + ' could not be created.');\n    return null;\n  }\n};\nconst _createHooksMap = function _createHooksMap() {\n  return {\n    afterSanitizeAttributes: [],\n    afterSanitizeElements: [],\n    afterSanitizeShadowDOM: [],\n    beforeSanitizeAttributes: [],\n    beforeSanitizeElements: [],\n    beforeSanitizeShadowDOM: [],\n    uponSanitizeAttribute: [],\n    uponSanitizeElement: [],\n    uponSanitizeShadowNode: []\n  };\n};\nfunction createDOMPurify() {\n  let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();\n  const DOMPurify = root => createDOMPurify(root);\n  DOMPurify.version = '3.2.2';\n  DOMPurify.removed = [];\n  if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document) {\n    // Not running in a browser, provide a factory function\n    // so that you can pass your own Window\n    DOMPurify.isSupported = false;\n    return DOMPurify;\n  }\n  let {\n    document\n  } = window;\n  const originalDocument = document;\n  const currentScript = originalDocument.currentScript;\n  const {\n    DocumentFragment,\n    HTMLTemplateElement,\n    Node,\n    Element,\n    NodeFilter,\n    NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,\n    HTMLFormElement,\n    DOMParser,\n    trustedTypes\n  } = window;\n  const ElementPrototype = Element.prototype;\n  const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');\n  const remove = lookupGetter(ElementPrototype, 'remove');\n  const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');\n  const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');\n  const getParentNode = lookupGetter(ElementPrototype, 'parentNode');\n  // As per issue #47, the web-components registry is inherited by a\n  // new document created via createHTMLDocument. As per the spec\n  // (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)\n  // a new empty registry is used when creating a template contents owner\n  // document, so we use that as our parent document to ensure nothing\n  // is inherited.\n  if (typeof HTMLTemplateElement === 'function') {\n    const template = document.createElement('template');\n    if (template.content && template.content.ownerDocument) {\n      document = template.content.ownerDocument;\n    }\n  }\n  let trustedTypesPolicy;\n  let emptyHTML = '';\n  const {\n    implementation,\n    createNodeIterator,\n    createDocumentFragment,\n    getElementsByTagName\n  } = document;\n  const {\n    importNode\n  } = originalDocument;\n  let hooks = _createHooksMap();\n  /**\n   * Expose whether this browser supports running the full DOMPurify.\n   */\n  DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;\n  const {\n    MUSTACHE_EXPR,\n    ERB_EXPR,\n    TMPLIT_EXPR,\n    DATA_ATTR,\n    ARIA_ATTR,\n    IS_SCRIPT_OR_DATA,\n    ATTR_WHITESPACE,\n    CUSTOM_ELEMENT\n  } = EXPRESSIONS;\n  let {\n    IS_ALLOWED_URI: IS_ALLOWED_URI$1\n  } = EXPRESSIONS;\n  /**\n   * We consider the elements and attributes below to be safe. Ideally\n   * don't add any new ones but feel free to remove unwanted ones.\n   */\n  /* allowed element names */\n  let ALLOWED_TAGS = null;\n  const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...text]);\n  /* Allowed attribute names */\n  let ALLOWED_ATTR = null;\n  const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);\n  /*\n   * Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.\n   * @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)\n   * @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)\n   * @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.\n   */\n  let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {\n    tagNameCheck: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: null\n    },\n    attributeNameCheck: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: null\n    },\n    allowCustomizedBuiltInElements: {\n      writable: true,\n      configurable: false,\n      enumerable: true,\n      value: false\n    }\n  }));\n  /* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */\n  let FORBID_TAGS = null;\n  /* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */\n  let FORBID_ATTR = null;\n  /* Decide if ARIA attributes are okay */\n  let ALLOW_ARIA_ATTR = true;\n  /* Decide if custom data attributes are okay */\n  let ALLOW_DATA_ATTR = true;\n  /* Decide if unknown protocols are okay */\n  let ALLOW_UNKNOWN_PROTOCOLS = false;\n  /* Decide if self-closing tags in attributes are allowed.\n   * Usually removed due to a mXSS issue in jQuery 3.0 */\n  let ALLOW_SELF_CLOSE_IN_ATTR = true;\n  /* Output should be safe for common template engines.\n   * This means, DOMPurify removes data attributes, mustaches and ERB\n   */\n  let SAFE_FOR_TEMPLATES = false;\n  /* Output should be safe even for XML used within HTML and alike.\n   * This means, DOMPurify removes comments when containing risky content.\n   */\n  let SAFE_FOR_XML = true;\n  /* Decide if document with <html>... should be returned */\n  let WHOLE_DOCUMENT = false;\n  /* Track whether config is already set on this instance of DOMPurify. */\n  let SET_CONFIG = false;\n  /* Decide if all elements (e.g. style, script) must be children of\n   * document.body. By default, browsers might move them to document.head */\n  let FORCE_BODY = false;\n  /* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html\n   * string (or a TrustedHTML object if Trusted Types are supported).\n   * If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead\n   */\n  let RETURN_DOM = false;\n  /* Decide if a DOM `DocumentFragment` should be returned, instead of a html\n   * string  (or a TrustedHTML object if Trusted Types are supported) */\n  let RETURN_DOM_FRAGMENT = false;\n  /* Try to return a Trusted Type object instead of a string, return a string in\n   * case Trusted Types are not supported  */\n  let RETURN_TRUSTED_TYPE = false;\n  /* Output should be free from DOM clobbering attacks?\n   * This sanitizes markups named with colliding, clobberable built-in DOM APIs.\n   */\n  let SANITIZE_DOM = true;\n  /* Achieve full DOM Clobbering protection by isolating the namespace of named\n   * properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.\n   *\n   * HTML/DOM spec rules that enable DOM Clobbering:\n   *   - Named Access on Window (§7.3.3)\n   *   - DOM Tree Accessors (§3.1.5)\n   *   - Form Element Parent-Child Relations (§4.10.3)\n   *   - Iframe srcdoc / Nested WindowProxies (§4.8.5)\n   *   - HTMLCollection (§4.2.10.2)\n   *\n   * Namespace isolation is implemented by prefixing `id` and `name` attributes\n   * with a constant string, i.e., `user-content-`\n   */\n  let SANITIZE_NAMED_PROPS = false;\n  const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';\n  /* Keep element content when removing element? */\n  let KEEP_CONTENT = true;\n  /* If a `Node` is passed to sanitize(), then performs sanitization in-place instead\n   * of importing it into a new Document and returning a sanitized copy */\n  let IN_PLACE = false;\n  /* Allow usage of profiles like html, svg and mathMl */\n  let USE_PROFILES = {};\n  /* Tags to ignore content of when KEEP_CONTENT is true */\n  let FORBID_CONTENTS = null;\n  const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);\n  /* Tags that are safe for data: URIs */\n  let DATA_URI_TAGS = null;\n  const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);\n  /* Attributes safe for values like \"javascript:\" */\n  let URI_SAFE_ATTRIBUTES = null;\n  const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);\n  const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';\n  const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';\n  const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';\n  /* Document namespace */\n  let NAMESPACE = HTML_NAMESPACE;\n  let IS_EMPTY_INPUT = false;\n  /* Allowed XHTML+XML namespaces */\n  let ALLOWED_NAMESPACES = null;\n  const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);\n  let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);\n  let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);\n  // Certain elements are allowed in both SVG and HTML\n  // namespace. We need to specify them explicitly\n  // so that they don't get erroneously deleted from\n  // HTML namespace.\n  const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);\n  /* Parsing of strict XHTML documents */\n  let PARSER_MEDIA_TYPE = null;\n  const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];\n  const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';\n  let transformCaseFunc = null;\n  /* Keep a reference to config to pass to hooks */\n  let CONFIG = null;\n  /* Ideally, do not touch anything below this line */\n  /* ______________________________________________ */\n  const formElement = document.createElement('form');\n  const isRegexOrFunction = function isRegexOrFunction(testValue) {\n    return testValue instanceof RegExp || testValue instanceof Function;\n  };\n  /**\n   * _parseConfig\n   *\n   * @param cfg optional config literal\n   */\n  // eslint-disable-next-line complexity\n  const _parseConfig = function _parseConfig() {\n    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    if (CONFIG && CONFIG === cfg) {\n      return;\n    }\n    /* Shield configuration object from tampering */\n    if (!cfg || typeof cfg !== 'object') {\n      cfg = {};\n    }\n    /* Shield configuration object from prototype pollution */\n    cfg = clone(cfg);\n    PARSER_MEDIA_TYPE =\n    // eslint-disable-next-line unicorn/prefer-includes\n    SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;\n    // HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.\n    transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;\n    /* Set configuration parameters */\n    ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;\n    ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;\n    ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;\n    URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;\n    DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;\n    FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;\n    FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : {};\n    FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : {};\n    USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;\n    ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true\n    ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true\n    ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false\n    ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true\n    SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false\n    SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true\n    WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false\n    RETURN_DOM = cfg.RETURN_DOM || false; // Default false\n    RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false\n    RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false\n    FORCE_BODY = cfg.FORCE_BODY || false; // Default false\n    SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true\n    SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false\n    KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true\n    IN_PLACE = cfg.IN_PLACE || false; // Default false\n    IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;\n    NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;\n    MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;\n    HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;\n    CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};\n    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {\n      CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;\n    }\n    if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {\n      CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;\n    }\n    if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {\n      CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;\n    }\n    if (SAFE_FOR_TEMPLATES) {\n      ALLOW_DATA_ATTR = false;\n    }\n    if (RETURN_DOM_FRAGMENT) {\n      RETURN_DOM = true;\n    }\n    /* Parse profile info */\n    if (USE_PROFILES) {\n      ALLOWED_TAGS = addToSet({}, text);\n      ALLOWED_ATTR = [];\n      if (USE_PROFILES.html === true) {\n        addToSet(ALLOWED_TAGS, html$1);\n        addToSet(ALLOWED_ATTR, html);\n      }\n      if (USE_PROFILES.svg === true) {\n        addToSet(ALLOWED_TAGS, svg$1);\n        addToSet(ALLOWED_ATTR, svg);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n      if (USE_PROFILES.svgFilters === true) {\n        addToSet(ALLOWED_TAGS, svgFilters);\n        addToSet(ALLOWED_ATTR, svg);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n      if (USE_PROFILES.mathMl === true) {\n        addToSet(ALLOWED_TAGS, mathMl$1);\n        addToSet(ALLOWED_ATTR, mathMl);\n        addToSet(ALLOWED_ATTR, xml);\n      }\n    }\n    /* Merge configuration parameters */\n    if (cfg.ADD_TAGS) {\n      if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {\n        ALLOWED_TAGS = clone(ALLOWED_TAGS);\n      }\n      addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);\n    }\n    if (cfg.ADD_ATTR) {\n      if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {\n        ALLOWED_ATTR = clone(ALLOWED_ATTR);\n      }\n      addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);\n    }\n    if (cfg.ADD_URI_SAFE_ATTR) {\n      addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);\n    }\n    if (cfg.FORBID_CONTENTS) {\n      if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {\n        FORBID_CONTENTS = clone(FORBID_CONTENTS);\n      }\n      addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);\n    }\n    /* Add #text in case KEEP_CONTENT is set to true */\n    if (KEEP_CONTENT) {\n      ALLOWED_TAGS['#text'] = true;\n    }\n    /* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */\n    if (WHOLE_DOCUMENT) {\n      addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);\n    }\n    /* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */\n    if (ALLOWED_TAGS.table) {\n      addToSet(ALLOWED_TAGS, ['tbody']);\n      delete FORBID_TAGS.tbody;\n    }\n    if (cfg.TRUSTED_TYPES_POLICY) {\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {\n        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createHTML\" hook.');\n      }\n      if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {\n        throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a \"createScriptURL\" hook.');\n      }\n      // Overwrite existing TrustedTypes policy.\n      trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;\n      // Sign local variables required by `sanitize`.\n      emptyHTML = trustedTypesPolicy.createHTML('');\n    } else {\n      // Uninitialized policy, attempt to initialize the internal dompurify policy.\n      if (trustedTypesPolicy === undefined) {\n        trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);\n      }\n      // If creating the internal policy succeeded sign internal variables.\n      if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {\n        emptyHTML = trustedTypesPolicy.createHTML('');\n      }\n    }\n    // Prevent further manipulation of configuration.\n    // Not available in IE8, Safari 5, etc.\n    if (freeze) {\n      freeze(cfg);\n    }\n    CONFIG = cfg;\n  };\n  /* Keep track of all possible SVG and MathML tags\n   * so that we can perform the namespace checks\n   * correctly. */\n  const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);\n  const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);\n  /**\n   * @param element a DOM element whose namespace is being checked\n   * @returns Return false if the element has a\n   *  namespace that a spec-compliant parser would never\n   *  return. Return true otherwise.\n   */\n  const _checkValidNamespace = function _checkValidNamespace(element) {\n    let parent = getParentNode(element);\n    // In JSDOM, if we're inside shadow DOM, then parentNode\n    // can be null. We just simulate parent in this case.\n    if (!parent || !parent.tagName) {\n      parent = {\n        namespaceURI: NAMESPACE,\n        tagName: 'template'\n      };\n    }\n    const tagName = stringToLowerCase(element.tagName);\n    const parentTagName = stringToLowerCase(parent.tagName);\n    if (!ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return false;\n    }\n    if (element.namespaceURI === SVG_NAMESPACE) {\n      // The only way to switch from HTML namespace to SVG\n      // is via <svg>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'svg';\n      }\n      // The only way to switch from MathML to SVG is via`\n      // svg if parent is either <annotation-xml> or MathML\n      // text integration points.\n      if (parent.namespaceURI === MATHML_NAMESPACE) {\n        return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);\n      }\n      // We only allow elements that are defined in SVG\n      // spec. All others are disallowed in SVG namespace.\n      return Boolean(ALL_SVG_TAGS[tagName]);\n    }\n    if (element.namespaceURI === MATHML_NAMESPACE) {\n      // The only way to switch from HTML namespace to MathML\n      // is via <math>. If it happens via any other tag, then\n      // it should be killed.\n      if (parent.namespaceURI === HTML_NAMESPACE) {\n        return tagName === 'math';\n      }\n      // The only way to switch from SVG to MathML is via\n      // <math> and HTML integration points\n      if (parent.namespaceURI === SVG_NAMESPACE) {\n        return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];\n      }\n      // We only allow elements that are defined in MathML\n      // spec. All others are disallowed in MathML namespace.\n      return Boolean(ALL_MATHML_TAGS[tagName]);\n    }\n    if (element.namespaceURI === HTML_NAMESPACE) {\n      // The only way to switch from SVG to HTML is via\n      // HTML integration points, and from MathML to HTML\n      // is via MathML text integration points\n      if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {\n        return false;\n      }\n      if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {\n        return false;\n      }\n      // We disallow tags that are specific for MathML\n      // or SVG and should never appear in HTML namespace\n      return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);\n    }\n    // For XHTML and XML documents that support custom namespaces\n    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {\n      return true;\n    }\n    // The code should never reach this place (this means\n    // that the element somehow got namespace that is not\n    // HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).\n    // Return false just in case.\n    return false;\n  };\n  /**\n   * _forceRemove\n   *\n   * @param node a DOM node\n   */\n  const _forceRemove = function _forceRemove(node) {\n    arrayPush(DOMPurify.removed, {\n      element: node\n    });\n    try {\n      // eslint-disable-next-line unicorn/prefer-dom-node-remove\n      getParentNode(node).removeChild(node);\n    } catch (_) {\n      remove(node);\n    }\n  };\n  /**\n   * _removeAttribute\n   *\n   * @param name an Attribute name\n   * @param element a DOM node\n   */\n  const _removeAttribute = function _removeAttribute(name, element) {\n    try {\n      arrayPush(DOMPurify.removed, {\n        attribute: element.getAttributeNode(name),\n        from: element\n      });\n    } catch (_) {\n      arrayPush(DOMPurify.removed, {\n        attribute: null,\n        from: element\n      });\n    }\n    element.removeAttribute(name);\n    // We void attribute values for unremovable \"is\" attributes\n    if (name === 'is') {\n      if (RETURN_DOM || RETURN_DOM_FRAGMENT) {\n        try {\n          _forceRemove(element);\n        } catch (_) {}\n      } else {\n        try {\n          element.setAttribute(name, '');\n        } catch (_) {}\n      }\n    }\n  };\n  /**\n   * _initDocument\n   *\n   * @param dirty - a string of dirty markup\n   * @return a DOM, filled with the dirty markup\n   */\n  const _initDocument = function _initDocument(dirty) {\n    /* Create a HTML document */\n    let doc = null;\n    let leadingWhitespace = null;\n    if (FORCE_BODY) {\n      dirty = '<remove></remove>' + dirty;\n    } else {\n      /* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */\n      const matches = stringMatch(dirty, /^[\\r\\n\\t ]+/);\n      leadingWhitespace = matches && matches[0];\n    }\n    if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {\n      // Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)\n      dirty = '<html xmlns=\"http://www.w3.org/1999/xhtml\"><head></head><body>' + dirty + '</body></html>';\n    }\n    const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;\n    /*\n     * Use the DOMParser API by default, fallback later if needs be\n     * DOMParser not work for svg when has multiple root element.\n     */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      try {\n        doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);\n      } catch (_) {}\n    }\n    /* Use createHTMLDocument in case DOMParser is not available */\n    if (!doc || !doc.documentElement) {\n      doc = implementation.createDocument(NAMESPACE, 'template', null);\n      try {\n        doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;\n      } catch (_) {\n        // Syntax error if dirtyPayload is invalid xml\n      }\n    }\n    const body = doc.body || doc.documentElement;\n    if (dirty && leadingWhitespace) {\n      body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);\n    }\n    /* Work on whole document or just its body */\n    if (NAMESPACE === HTML_NAMESPACE) {\n      return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];\n    }\n    return WHOLE_DOCUMENT ? doc.documentElement : body;\n  };\n  /**\n   * Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.\n   *\n   * @param root The root element or node to start traversing on.\n   * @return The created NodeIterator\n   */\n  const _createNodeIterator = function _createNodeIterator(root) {\n    return createNodeIterator.call(root.ownerDocument || root, root,\n    // eslint-disable-next-line no-bitwise\n    NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);\n  };\n  /**\n   * _isClobbered\n   *\n   * @param element element to check for clobbering attacks\n   * @return true if clobbered, false if safe\n   */\n  const _isClobbered = function _isClobbered(element) {\n    return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');\n  };\n  /**\n   * Checks whether the given object is a DOM node.\n   *\n   * @param value object to check whether it's a DOM node\n   * @return true is object is a DOM node\n   */\n  const _isNode = function _isNode(value) {\n    return typeof Node === 'function' && value instanceof Node;\n  };\n  function _executeHooks(hooks, currentNode, data) {\n    arrayForEach(hooks, hook => {\n      hook.call(DOMPurify, currentNode, data, CONFIG);\n    });\n  }\n  /**\n   * _sanitizeElements\n   *\n   * @protect nodeName\n   * @protect textContent\n   * @protect removeChild\n   * @param currentNode to check for permission to exist\n   * @return true if node was killed, false if left alive\n   */\n  const _sanitizeElements = function _sanitizeElements(currentNode) {\n    let content = null;\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeElements, currentNode, null);\n    /* Check if element is clobbered or can clobber */\n    if (_isClobbered(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Now let's check the element's type and name */\n    const tagName = transformCaseFunc(currentNode.nodeName);\n    /* Execute a hook if present */\n    _executeHooks(hooks.uponSanitizeElement, currentNode, {\n      tagName,\n      allowedTags: ALLOWED_TAGS\n    });\n    /* Detect mXSS attempts abusing namespace confusion */\n    if (currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\\w]/g, currentNode.innerHTML) && regExpTest(/<[/\\w]/g, currentNode.textContent)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove any occurrence of processing instructions */\n    if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove any kind of possibly harmful comments */\n    if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\\w]/g, currentNode.data)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Remove element if anything forbids its presence */\n    if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n      /* Check if we have a custom element to handle */\n      if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {\n        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {\n          return false;\n        }\n        if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {\n          return false;\n        }\n      }\n      /* Keep content except for bad-listed elements */\n      if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {\n        const parentNode = getParentNode(currentNode) || currentNode.parentNode;\n        const childNodes = getChildNodes(currentNode) || currentNode.childNodes;\n        if (childNodes && parentNode) {\n          const childCount = childNodes.length;\n          for (let i = childCount - 1; i >= 0; --i) {\n            const childClone = cloneNode(childNodes[i], true);\n            childClone.__removalCount = (currentNode.__removalCount || 0) + 1;\n            parentNode.insertBefore(childClone, getNextSibling(currentNode));\n          }\n        }\n      }\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Check whether element has a valid namespace */\n    if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Make sure that older browsers don't get fallback-tag mXSS */\n    if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\\/no(script|embed|frames)/i, currentNode.innerHTML)) {\n      _forceRemove(currentNode);\n      return true;\n    }\n    /* Sanitize element content to be template-safe */\n    if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {\n      /* Get the element's text content */\n      content = currentNode.textContent;\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n        content = stringReplace(content, expr, ' ');\n      });\n      if (currentNode.textContent !== content) {\n        arrayPush(DOMPurify.removed, {\n          element: currentNode.cloneNode()\n        });\n        currentNode.textContent = content;\n      }\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeElements, currentNode, null);\n    return false;\n  };\n  /**\n   * _isValidAttribute\n   *\n   * @param lcTag Lowercase tag name of containing element.\n   * @param lcName Lowercase attribute name.\n   * @param value Attribute value.\n   * @return Returns true if `value` is valid, otherwise false.\n   */\n  // eslint-disable-next-line complexity\n  const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {\n    /* Make sure attribute cannot clobber */\n    if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {\n      return false;\n    }\n    /* Allow valid data-* attributes: At least one character after \"-\"\n        (https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)\n        XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)\n        We don't need to check the value; it's always URI safe. */\n    if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {\n      if (\n      // First condition does a very basic check if a) it's basically a valid custom element tagname AND\n      // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n      // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck\n      _isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||\n      // Alternative, second condition checks if it's an `is`-attribute, AND\n      // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck\n      lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {\n        return false;\n      }\n      /* Check value is safe. First, is attr inert? If so, is safe */\n    } else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {\n      return false;\n    } else ;\n    return true;\n  };\n  /**\n   * _isBasicCustomElement\n   * checks if at least one dash is included in tagName, and it's not the first char\n   * for more sophisticated checking see https://github.com/sindresorhus/validate-element-name\n   *\n   * @param tagName name of the tag of the node to sanitize\n   * @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.\n   */\n  const _isBasicCustomElement = function _isBasicCustomElement(tagName) {\n    return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);\n  };\n  /**\n   * _sanitizeAttributes\n   *\n   * @protect attributes\n   * @protect nodeName\n   * @protect removeAttribute\n   * @protect setAttribute\n   *\n   * @param currentNode to sanitize\n   */\n  const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);\n    const {\n      attributes\n    } = currentNode;\n    /* Check if we have attributes; if not we might have a text node */\n    if (!attributes) {\n      return;\n    }\n    const hookEvent = {\n      attrName: '',\n      attrValue: '',\n      keepAttr: true,\n      allowedAttributes: ALLOWED_ATTR,\n      forceKeepAttr: undefined\n    };\n    let l = attributes.length;\n    /* Go backwards over all attributes; safely remove bad ones */\n    while (l--) {\n      const attr = attributes[l];\n      const {\n        name,\n        namespaceURI,\n        value: attrValue\n      } = attr;\n      const lcName = transformCaseFunc(name);\n      let value = name === 'value' ? attrValue : stringTrim(attrValue);\n      /* Execute a hook if present */\n      hookEvent.attrName = lcName;\n      hookEvent.attrValue = value;\n      hookEvent.keepAttr = true;\n      hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set\n      _executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);\n      value = hookEvent.attrValue;\n      /* Full DOM Clobbering protection via namespace isolation,\n       * Prefix id and name attributes with `user-content-`\n       */\n      if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {\n        // Remove the attribute with this value\n        _removeAttribute(name, currentNode);\n        // Prefix the value and later re-create the attribute with the sanitized value\n        value = SANITIZE_NAMED_PROPS_PREFIX + value;\n      }\n      /* Work around a security issue with comments inside attributes */\n      if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\\/(style|title)/i, value)) {\n        _removeAttribute(name, currentNode);\n        continue;\n      }\n      /* Did the hooks approve of the attribute? */\n      if (hookEvent.forceKeepAttr) {\n        continue;\n      }\n      /* Remove attribute */\n      _removeAttribute(name, currentNode);\n      /* Did the hooks approve of the attribute? */\n      if (!hookEvent.keepAttr) {\n        continue;\n      }\n      /* Work around a security issue in jQuery 3.0 */\n      if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\\/>/i, value)) {\n        _removeAttribute(name, currentNode);\n        continue;\n      }\n      /* Sanitize attribute content to be template-safe */\n      if (SAFE_FOR_TEMPLATES) {\n        arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n          value = stringReplace(value, expr, ' ');\n        });\n      }\n      /* Is `value` valid for this attribute? */\n      const lcTag = transformCaseFunc(currentNode.nodeName);\n      if (!_isValidAttribute(lcTag, lcName, value)) {\n        continue;\n      }\n      /* Handle attributes that require Trusted Types */\n      if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {\n        if (namespaceURI) ; else {\n          switch (trustedTypes.getAttributeType(lcTag, lcName)) {\n            case 'TrustedHTML':\n              {\n                value = trustedTypesPolicy.createHTML(value);\n                break;\n              }\n            case 'TrustedScriptURL':\n              {\n                value = trustedTypesPolicy.createScriptURL(value);\n                break;\n              }\n          }\n        }\n      }\n      /* Handle invalid data-* attribute set by try-catching it */\n      try {\n        if (namespaceURI) {\n          currentNode.setAttributeNS(namespaceURI, name, value);\n        } else {\n          /* Fallback to setAttribute() for browser-unrecognized namespaces e.g. \"x-schema\". */\n          currentNode.setAttribute(name, value);\n        }\n        if (_isClobbered(currentNode)) {\n          _forceRemove(currentNode);\n        } else {\n          arrayPop(DOMPurify.removed);\n        }\n      } catch (_) {}\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeAttributes, currentNode, null);\n  };\n  /**\n   * _sanitizeShadowDOM\n   *\n   * @param fragment to iterate over recursively\n   */\n  const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {\n    let shadowNode = null;\n    const shadowIterator = _createNodeIterator(fragment);\n    /* Execute a hook if present */\n    _executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);\n    while (shadowNode = shadowIterator.nextNode()) {\n      /* Execute a hook if present */\n      _executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(shadowNode)) {\n        continue;\n      }\n      /* Deep shadow DOM detected */\n      if (shadowNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(shadowNode.content);\n      }\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(shadowNode);\n    }\n    /* Execute a hook if present */\n    _executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);\n  };\n  // eslint-disable-next-line complexity\n  DOMPurify.sanitize = function (dirty) {\n    let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    let body = null;\n    let importedNode = null;\n    let currentNode = null;\n    let returnNode = null;\n    /* Make sure we have a string to sanitize.\n      DO NOT return early, as this will return the wrong type if\n      the user has requested a DOM object rather than a string */\n    IS_EMPTY_INPUT = !dirty;\n    if (IS_EMPTY_INPUT) {\n      dirty = '<!-->';\n    }\n    /* Stringify, in case dirty is an object */\n    if (typeof dirty !== 'string' && !_isNode(dirty)) {\n      if (typeof dirty.toString === 'function') {\n        dirty = dirty.toString();\n        if (typeof dirty !== 'string') {\n          throw typeErrorCreate('dirty is not a string, aborting');\n        }\n      } else {\n        throw typeErrorCreate('toString is not a function');\n      }\n    }\n    /* Return dirty HTML if DOMPurify cannot run */\n    if (!DOMPurify.isSupported) {\n      return dirty;\n    }\n    /* Assign config vars */\n    if (!SET_CONFIG) {\n      _parseConfig(cfg);\n    }\n    /* Clean up removed elements */\n    DOMPurify.removed = [];\n    /* Check if dirty is correctly typed for IN_PLACE */\n    if (typeof dirty === 'string') {\n      IN_PLACE = false;\n    }\n    if (IN_PLACE) {\n      /* Do some early pre-sanitization to avoid unsafe root nodes */\n      if (dirty.nodeName) {\n        const tagName = transformCaseFunc(dirty.nodeName);\n        if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {\n          throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');\n        }\n      }\n    } else if (dirty instanceof Node) {\n      /* If dirty is a DOM element, append to an empty document to avoid\n         elements being stripped by the parser */\n      body = _initDocument('<!---->');\n      importedNode = body.ownerDocument.importNode(dirty, true);\n      if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {\n        /* Node is already a body, use as is */\n        body = importedNode;\n      } else if (importedNode.nodeName === 'HTML') {\n        body = importedNode;\n      } else {\n        // eslint-disable-next-line unicorn/prefer-dom-node-append\n        body.appendChild(importedNode);\n      }\n    } else {\n      /* Exit directly if we have nothing to do */\n      if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&\n      // eslint-disable-next-line unicorn/prefer-includes\n      dirty.indexOf('<') === -1) {\n        return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;\n      }\n      /* Initialize the document to work on */\n      body = _initDocument(dirty);\n      /* Check we have a DOM node from the data */\n      if (!body) {\n        return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';\n      }\n    }\n    /* Remove first element node (ours) if FORCE_BODY is set */\n    if (body && FORCE_BODY) {\n      _forceRemove(body.firstChild);\n    }\n    /* Get node iterator */\n    const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);\n    /* Now start iterating over the created document */\n    while (currentNode = nodeIterator.nextNode()) {\n      /* Sanitize tags and elements */\n      if (_sanitizeElements(currentNode)) {\n        continue;\n      }\n      /* Shadow DOM detected, sanitize it */\n      if (currentNode.content instanceof DocumentFragment) {\n        _sanitizeShadowDOM(currentNode.content);\n      }\n      /* Check attributes, sanitize if necessary */\n      _sanitizeAttributes(currentNode);\n    }\n    /* If we sanitized `dirty` in-place, return it. */\n    if (IN_PLACE) {\n      return dirty;\n    }\n    /* Return sanitized string or DOM */\n    if (RETURN_DOM) {\n      if (RETURN_DOM_FRAGMENT) {\n        returnNode = createDocumentFragment.call(body.ownerDocument);\n        while (body.firstChild) {\n          // eslint-disable-next-line unicorn/prefer-dom-node-append\n          returnNode.appendChild(body.firstChild);\n        }\n      } else {\n        returnNode = body;\n      }\n      if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {\n        /*\n          AdoptNode() is not used because internal state is not reset\n          (e.g. the past names map of a HTMLFormElement), this is safe\n          in theory but we would rather not risk another attack vector.\n          The state that is cloned by importNode() is explicitly defined\n          by the specs.\n        */\n        returnNode = importNode.call(originalDocument, returnNode, true);\n      }\n      return returnNode;\n    }\n    let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;\n    /* Serialize doctype if allowed */\n    if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {\n      serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\\n' + serializedHTML;\n    }\n    /* Sanitize final string template-safe */\n    if (SAFE_FOR_TEMPLATES) {\n      arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {\n        serializedHTML = stringReplace(serializedHTML, expr, ' ');\n      });\n    }\n    return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;\n  };\n  DOMPurify.setConfig = function () {\n    let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    _parseConfig(cfg);\n    SET_CONFIG = true;\n  };\n  DOMPurify.clearConfig = function () {\n    CONFIG = null;\n    SET_CONFIG = false;\n  };\n  DOMPurify.isValidAttribute = function (tag, attr, value) {\n    /* Initialize shared config vars if necessary. */\n    if (!CONFIG) {\n      _parseConfig({});\n    }\n    const lcTag = transformCaseFunc(tag);\n    const lcName = transformCaseFunc(attr);\n    return _isValidAttribute(lcTag, lcName, value);\n  };\n  DOMPurify.addHook = function (entryPoint, hookFunction) {\n    if (typeof hookFunction !== 'function') {\n      return;\n    }\n    arrayPush(hooks[entryPoint], hookFunction);\n  };\n  DOMPurify.removeHook = function (entryPoint) {\n    return arrayPop(hooks[entryPoint]);\n  };\n  DOMPurify.removeHooks = function (entryPoint) {\n    hooks[entryPoint] = [];\n  };\n  DOMPurify.removeAllHooks = function () {\n    hooks = _createHooksMap();\n  };\n  return DOMPurify;\n}\nvar purify = createDOMPurify();\n\nexport { purify as default };\n//# sourceMappingURL=purify.es.mjs.map\n","import jquery from \"jquery\";\nimport { LitElement, css, html, nothing } from \"lit\";\nimport { repeat } from \"lit/directives/repeat.js\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { unsafeHTML } from \"lit/directives/unsafe-html.js\";\nimport DOMPurify from \"dompurify\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Notification\n *\n * Used internally and directly to render a notification API response. This\n * element is not rendered using element attributes, but it is possible to\n * pass in a full notification API response item via the ``notification``\n * object attribute.\n *\n * @param {Object} notification - Single item from notification API response\n * @param {string} csrfToken - CSRF token from Django, attribute ``csrf-token``\n * @param {Boolean} inverted - Whether the message is ``inverted`` variant\n **/\nexport class NotificationElement extends LightDOMElement {\n  static properties = {\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    notification: { state: true },\n    inverted: { type: Boolean },\n  };\n\n  render() {\n    if (this.notification === undefined || this.notification.message === null) {\n      return nothing;\n    }\n\n    // classMap can't be mixed with any other template logic inside ``class=``\n    // so we include all conditional logic outside.\n    const classes = {\n      // Explicitly always invert high level messages to make sure these are\n      // more visible than tip/note messages.\n      inverted:\n        this.inverted ||\n        [\"error\", \"warning\", \"info\"].includes(this.notification.message.type),\n    };\n    classes[this.notification.message.type] = true;\n\n    return html`\n      <div class=\"ui ${classMap(classes)} notification message\">\n        ${when(\n          this.notification.dismissable,\n          () => html`\n            <i\n              class=\"fas fa-xmark close inline icon\"\n              @click=${this.dismiss}\n            ></i>\n          `,\n        )}\n        <h5 class=\"header\">\n          <i class=\"fad ${this.notification.message.icon_classes} icon\"></i>\n          ${unsafeHTML(this.notification.message.header)}\n        </h5>\n        <p>${unsafeHTML(this.notification.message.body)}</p>\n      </div>\n    `;\n  }\n\n  dismiss() {\n    console.debug(\"Dismissing notification:\", this.notification.id);\n    const options = {\n      method: \"PATCH\",\n      headers: {\n        \"Content-Type\": \"application/json\",\n        \"X-CSRFToken\": this.csrfToken,\n      },\n      body: JSON.stringify({\n        state: \"dismissed\",\n      }),\n    };\n    fetch(this.notification._links._self, options)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Invalid API request\");\n        }\n        // Use FUI transition module to fade out and remove the notification\n        jquery(this).transition({\n          animation: \"fade\",\n          onComplete: () => {\n            this.parentElement.removeChild(this);\n          },\n        });\n      })\n      .catch((err) => {\n        console.error(\"Error dismissing notification\", err);\n      });\n  }\n}\n\n/**\n * NotificationListElement\n *\n * This is the wrapper to :js:class:`NotificationElement`, and provides the initial\n * API interaction to populate all of the notification element instances with\n * data.\n *\n * @param {string} url - APIv3 notification URL to use\n * @param {string} csrfToken - Django CSRF token\n * @param {string} state - Notification states to filter for\n * @param {Boolean} inverted - Whether inverted variant should be forced\n **/\nexport class NotificationListElement extends LightDOMElement {\n  static properties = {\n    url: { type: String },\n    csrfToken: { type: String, attribute: \"csrf-token\" },\n    state: { type: String },\n    inverted: { type: Boolean },\n\n    notifications: { state: true },\n    request: { state: true },\n  };\n\n  constructor() {\n    super();\n    this.state = \"read,unread\";\n  }\n\n  fetchNotifications() {\n    if (!this.url || this.request !== undefined) {\n      return;\n    }\n    const params = new URLSearchParams({\n      state__in: this.state,\n    });\n    this.request = fetch(`${this.url}?${params}`)\n      .then((response) => {\n        if (!response.ok) {\n          throw new Error(\"Request failed\");\n        }\n        return response.json();\n      })\n      .then((data) => {\n        if (data?.results === undefined) {\n          throw new Error(\"Invalid notification API response\");\n        }\n        return data.results;\n      })\n      .then((notifications) => {\n        if (notifications) {\n          this.notifications = notifications.map((notification) => {\n            notification.message.header = DOMPurify.sanitize(\n              notification.message.header,\n            );\n            notification.message.body = DOMPurify.sanitize(\n              notification.message.body,\n            );\n            return notification;\n          });\n        }\n      })\n      .catch((err) => {\n        console.error(`Error fetching notifications from ${this.url}`, err);\n      });\n  }\n\n  render() {\n    // Trigger async notification fetch\n    this.fetchNotifications();\n\n    if (this.notifications && this.notifications.length > 0) {\n      return repeat(\n        this.notifications,\n        (notification) => notification.id,\n        (notification, index) => {\n          const elem = document.createElement(\"readthedocs-notification\");\n          elem.notification = notification;\n          elem.csrfToken = this.csrfToken;\n          elem.inverted = this.inverted;\n\n          // For FUI .ui.list.item\n          elem.className = \"item\";\n          return elem;\n        },\n      );\n    } else {\n      return nothing;\n    }\n  }\n}\n\ncustomElements.define(\"readthedocs-notification\", NotificationElement);\ncustomElements.define(\"readthedocs-notification-list\", NotificationListElement);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\nexport class PopupcardView {\n  static view_name = \"PopupcardView\";\n\n  constructor(url, url_notifications) {\n    this.url = url;\n    this.url_notifications = url_notifications;\n\n    /** @observable {Boolean} Is the popup showing currently? */\n    this.is_showing = ko.observable(false);\n    this.is_showing.subscribe((is_showing) => {\n      if (is_showing) {\n        this.fetch();\n      }\n    });\n    /** @observable {Boolean} Is the popup loading from the API? */\n    this.is_loading = ko.observable(false);\n    /** @observable {Boolean} Is the popup loading from the API? */\n    this.is_loaded = ko.observable(false);\n\n    /** @computed */\n    this.popup = ko.observable();\n    /** @computed */\n    this.popup_config = ko.computed(() => {\n      const popup = this.popup();\n      if (ko.computedContext.isInitial()) {\n        return {\n          hoverable: true,\n          delay: {\n            show: 200,\n            hide: 200,\n          },\n          onShow: () => {\n            this.is_showing(true);\n          },\n          onHide: () => {\n            this.is_showing(false);\n          },\n        };\n      } else {\n        return popup;\n      }\n    });\n\n    /** @observable {Object} The response object from the API */\n    this.data = ko.observable();\n    /** @observableArray {Object} Notifications from the API, if ``url_notifications`` was given */\n    this.notifications = ko.observableArray();\n\n    this.promise = null;\n    this.promise_notifications = null;\n  }\n\n  fetch() {\n    this.fetch_notifications();\n    if (!this.url) {\n      // This popupcard is for a local only request, there might not be an API\n      // to request from.\n      this.data({});\n      this.is_loaded(true);\n      this.is_loading(false);\n      return;\n    }\n    if (this.promise) {\n      return this.promise;\n    }\n    this.promise = new Promise((resolve, reject) => {\n      if (this.is_loaded()) {\n        return resolve(data);\n      }\n      this.is_loading(true);\n      jquery\n        .getJSON(this.url)\n        .then((data) => {\n          this.data(data);\n          this.is_loaded(true);\n          this.is_loading(false);\n          return resolve(data);\n        })\n        .catch((err) => {\n          reject(err);\n        });\n    }).catch((err) => {\n      console.debug(\"Error fetching from API:\", err.responseJSON);\n      this.is_loading(false);\n      this.is_loaded(false);\n    });\n  }\n\n  /** Fetch non-dismissed notifications, only once and only if a URL was given */\n  fetch_notifications() {\n    if (!this.url_notifications || this.promise_notifications) {\n      return;\n    }\n    this.promise_notifications = jquery\n      .getJSON(this.url_notifications, { state__in: \"read,unread\" })\n      .then((data) => {\n        this.notifications(data.results || []);\n      })\n      .catch((err) => {\n        console.debug(\n          \"Error fetching notifications from API:\",\n          err.responseJSON,\n        );\n      });\n  }\n\n  show() {\n    this.is_showing(true);\n  }\n\n  hide() {\n    this.is_showing(false);\n  }\n}\nRegistry.add_view(PopupcardView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\n\nimport { Registry } from \"../application/registry\";\n\n/**\n * Organization authorization settings\n */\nexport class OrganizationSettingsAuthorizationView {\n  static view_name = \"OrganizationSettingsAuthorizationView\";\n\n  constructor() {\n    this.provider_original = undefined;\n    this.provider = ko.observable();\n\n    this.show_warning = ko.observable(false);\n    this.provider.subscribe(\n      (value) => {\n        if (this.provider_original === undefined) {\n          this.provider_original = value;\n        }\n      },\n      this,\n      \"beforeChange\",\n    );\n    this.provider.subscribe((value) => {\n      if (\n        this.provider_original !== undefined &&\n        value !== this.provider_original\n      ) {\n        this.show_warning(true);\n      } else {\n        this.show_warning(false);\n      }\n    });\n    this.use_domain = ko.computed(() => {\n      return this.provider() === \"email\";\n    });\n  }\n}\nRegistry.add_view(OrganizationSettingsAuthorizationView);\n\n/**\n * Organization creation\n */\nexport class OrganizationCreateView {\n  static view_name = \"OrganizationCreateView\";\n\n  constructor() {\n    this.name = ko.observable();\n    this.slug = ko.observable();\n    this.name.subscribe((name) => {\n      const slugified = this.slugify(name);\n      this.slug(slugified);\n    });\n    this.example = ko.computed(() => {\n      const slug = this.slug() || \"organization\";\n      const example = \"https://\" + slug + \"-project.readthedocs-hosted.com\";\n      return example;\n    });\n  }\n\n  slugify(val) {\n    if (!val) return \"\";\n    return (\n      val\n        .toString()\n        .toLowerCase()\n        .trim()\n        // Replace spaces, non-word chars, underscores and dashes with a single '-'\n        // Copied from Django, which is what we are using under the hood\n        // https://github.com/django/django/blob/1e9db35/django/utils/text.py#L469-L470\n        .replace(/[^\\w\\s-_]+/g, \"-\")\n        .replace(/[-\\s]+/g, \"-\")\n        // And then also replicate our dns_safe slugging from\n        // :py:method:`readthedocs.core.utils.sluggify`\n        .replace(/[\\-\\_]+/g, \"-\")\n        .replace(/^\\-+/, \"\")\n        .replace(/\\-+$/, \"\")\n    );\n  }\n}\nRegistry.add_view(OrganizationCreateView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\nimport { Registry } from \"../application/registry\";\n\nimport { html, nothing, render } from \"lit\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\nimport { ref, createRef } from \"lit/directives/ref.js\";\nimport { map } from \"lit/directives/map.js\";\nimport { msg } from \"@lit/localize\";\n\nimport { LightDOMElement } from \"../application/elements\";\n\n/**\n * Combination field for project repository\n *\n * This element uses progressive enhancement of the existing form fields from\n * Django/Crispy. This web component adds dynamic interaction between the\n * fields and some additional UI elements to help describe what the user is\n * changing about the project.\n *\n * This uses :js:class:`InputFieldElement` and :js:class:`RichSelectFieldElement`\n * to isolate direct DOM manipulation from template driven web component logic.\n *\n * @property {String} label - Combination field label text\n *\n * @property {String} repoValue - Value for the repo field\n * @property {Boolean} repoError - Error state for the repo field\n * @property {String} remoteRepositoryValue - Value for the remote repository field\n * @property {String} remoteRepositoryUrl - URL for the remote repository field\n * @property {Boolean} remoteRepositoryError - Error state for the remote repository field\n *\n * @property {Boolean} useManual - Switch field to use manual repository URL\n * @property {String} previousChoice - Store previous value for remote repository\n *\n * @property {Boolean} dontSync - Don't update the repo field, project is flagged with DONT_SYNC_REMOTE_REPO\n * @property {String} showConnectedServiceWarning - Show a warning about missing connected services?\n * @property {String} showManualUrlWarning - Show a warning about switching to manual URL?\n * @property {String} urlDocsManual - URL for manual warning\n * @property {String} urlConnectedServices - URL for connected services warning\n */\nexport class ProjectRepositoryMultifieldElement extends LightDOMElement {\n  static properties = {\n    label: { type: String },\n\n    repoValue: { type: String },\n    repoError: { state: true },\n    remoteRepositoryValue: { type: String },\n    remoteRepositoryUrl: { type: String },\n    remoteRepositoryError: { state: true },\n\n    useManual: { state: true },\n    previousChoice: { state: true },\n\n    dontSync: {\n      type: Boolean,\n      attribute: \"dont-sync\",\n    },\n    showConnectedServiceWarning: {\n      type: Boolean,\n      attribute: \"show-connected-service-warning\",\n    },\n    showManualUrlWarning: {\n      type: Boolean,\n      attribute: \"show-manual-url-warning\",\n    },\n    urlConnectedServices: {\n      type: String,\n      attribute: \"url-connected-services\",\n    },\n    urlDocsManual: {\n      type: String,\n      attribute: \"url-docs-manual\",\n    },\n  };\n\n  /** @attr {Ref} refRemoteRepository - Reference to the field web component for\n   * remote repository field */\n  refRemoteRepository = createRef();\n  /** @attr {Ref} refRepo - Reference to the field web component for repo field */\n  refRepo = createRef();\n\n  constructor() {\n    super();\n    this.remoteRepositoryValue = \"\";\n    this.useManual = true;\n  }\n\n  /**\n   * Pick up elements for enhancement\n   *\n   * This is like fake slotting, something we can't use because we're not using\n   * shadow DOM. The targeted elements are used in :js:class:`render`, which is\n   * how these elements are moved into this light DOM.\n   *\n   * Children are manipulated slightly, we don't use all the child elements and\n   * work with the output DOM that Crispy gives for now.\n   */\n  connectedCallback() {\n    super.connectedCallback();\n    this.slotRemoteRepository = Array.from(\n      this.querySelector(\"#div_id_remote_repository\").children,\n    );\n    this.slotRepo = Array.from(this.querySelector(\"#div_id_repo\").children);\n\n    // Mimic shadow DOM default slot behavior. All children are moved into a\n    // disconnected element, so after slotted children are placed in the DOM the\n    // leftover element aren't displayed.\n    this.slotDefault = document.createElement(\"div\");\n    this.slotDefault.replaceChildren(...this.children);\n  }\n\n  listenerRemoteRepository(event) {\n    if (\n      event.type == \"change\" &&\n      event.target === this.refRemoteRepository.value\n    ) {\n      this.remoteRepositoryValue = event.target.value;\n      this.remoteRepositoryUrl = event.target.description;\n      this.remoteRepositoryError = event.target.hasError;\n    }\n  }\n\n  listenerRepo(event) {\n    if (event.type == \"change\" && event.target === this.refRepo.value) {\n      this.repoValue = event.target.value;\n      this.repoError = event.target.hasError;\n    }\n  }\n\n  toggleManual(event) {\n    this.useManual = Boolean(event.target.checked);\n    this.showManualUrlWarning = this.useManual;\n  }\n\n  render() {\n    const classesRemoteRepositoryField = {\n      disabled: this.useManual,\n      error: Boolean(this.remoteRepositoryError),\n    };\n    const classesRepoField = {\n      disabled: !this.useManual,\n      error: Boolean(this.repoError),\n    };\n\n    return html`\n      <div class=\"ui required field\">\n        <label> ${this.label} </label>\n\n        <div class=\"ui field segment\">\n          <readthedocs-richselect-field\n            .value=\"${this.remoteRepositoryValue}\"\n            .disabled=\"${this.useManual}\"\n            @change=\"${this.listenerRemoteRepository}\"\n            ${ref(this.refRemoteRepository)}\n          >\n            ${when(\n              this.showConnectedServiceWarning && !this.useManual,\n              () => html`\n                <div class=\"ui message\">\n                  <div class=\"header\">\n                    <i class=\"fas fa-circle-info icon\"></i>\n                    ${msg(\n                      `No connected services are configured for your account`,\n                    )}\n                  </div>\n                  ${msg(\n                    html`You must\n                      <a href=\"${this.urlConnectedServices}\"\n                        >add a connected service</a\n                      >\n                      in order to modify a project's connected repository.`,\n                  )}\n                </div>\n              `,\n            )}\n            <div\n              class=\"ui basic fitted segment ${classMap(\n                classesRemoteRepositoryField,\n              )} field\"\n            >\n              ${this.slotRemoteRepository}\n\n              <div class=\"ui divider\"></div>\n            </div>\n          </readthedocs-richselect-field>\n\n          <div class=\"ui basic fitted segment field\">\n            <div class=\"ui checkbox\">\n              <input\n                type=\"checkbox\"\n                ?checked=\"${this.useManual}\"\n                @change=\"${this.toggleManual}\"\n              />\n              <label> Use manually configured repository URL </label>\n            </div>\n          </div>\n\n          <readthedocs-input-field\n            .value=\"${this.repoValue}\"\n            .disabled=\"${!this.useManual}\"\n            @change=\"${this.listenerRepo}\"\n            ${ref(this.refRepo)}\n          >\n            ${when(\n              this.showManualUrlWarning,\n              () => html`\n                <div class=\"ui message\">\n                  <div class=\"header\">\n                    <i class=\"fas fa-circle-info icon\"></i>\n                    ${msg(`Additional setup steps are required`)}\n                  </div>\n                  ${msg(html`\n                    To learn how to set up a project with a manually configured\n                    repository URL,\n                    <a href=\"${this.urlDocsManual}\" target=\"_blank\">\n                      see our guide on configuring manual Git integrations </a\n                    >.\n                  `)}\n                </div>\n              `,\n            )}\n            <div class=\"ui ${classMap(classesRepoField)} last field\">\n              ${this.slotRepo}\n            </div>\n          </readthedocs-input-field>\n        </div>\n      </div>\n    `;\n  }\n\n  willUpdate(changed) {\n    if (changed.has(\"remoteRepositoryValue\")) {\n      if (this.remoteRepositoryValue !== \"\" && !changed.has(\"useManual\")) {\n        this.useManual = false;\n        // Project is flagged to not sync the repo field, we'll do the same in\n        // our UX in this form for now.\n        if (!this.dontSync) {\n          this.repoValue = this.remoteRepositoryUrl;\n        }\n        // Reset errors on the repo field\n        if (this.repoError) {\n          this.repoError = false;\n          this.refRepo.value.clearErrors();\n        }\n      }\n    } else if (changed.has(\"useManual\")) {\n      // Store default so we can restore it if the user unchecks useManual\n      if (this.useManual) {\n        this.previousChoice = this.remoteRepositoryValue;\n        this.remoteRepositoryValue = \"\";\n      } else {\n        this.remoteRepositoryValue = this.previousChoice;\n      }\n    }\n  }\n}\ncustomElements.define(\n  \"readthedocs-project-repository-multifield\",\n  ProjectRepositoryMultifieldElement,\n);\n\n/**\n * Project automation rule form view\n *\n * @param {Object} automation_rule - Initial instance data, optional\n */\nexport class ProjectAutomationRuleView {\n  static view_name = \"ProjectAutomationRuleView\";\n\n  constructor(automation_rule) {\n    this.version_predefined_match_pattern = ko.observable();\n    this.is_version_match_pattern_visible = ko.computed(() => {\n      const version_predefined_match_pattern =\n        this.version_predefined_match_pattern();\n      return version_predefined_match_pattern === \"custom-match\";\n    });\n    this.is_all_versions = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"all-versions\";\n    });\n    this.is_semver_versions = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"semver-versions\";\n    });\n    this.is_custom = ko.computed(() => {\n      return this.version_predefined_match_pattern() === \"custom-match\";\n    });\n  }\n}\nRegistry.add_view(ProjectAutomationRuleView);\n\n/**\n * Project redirect rule form view\n *\n * @param {Object} redirect - Initial instance data, optional\n */\nexport class ProjectRedirectView {\n  static view_name = \"ProjectRedirectView\";\n\n  constructor(redirect) {\n    this.redirect_type = ko.observable();\n    this.from_url = ko.observable(\"\");\n    this.to_url = ko.observable(\"\");\n\n    this.is_example_disabled = ko.observable(false);\n    this.is_from_url_visible = ko.observable();\n    this.is_to_url_visible = ko.observable();\n\n    // HTML prefix content for from field, don't use user input here\n    this.redirect_from_prefix = ko.computed(() => {\n      const redirect_type = this.redirect_type();\n      const lang_part = `/<span class=\"ui violet text\">$lang</span>`;\n      const version_part = `/<span class=\"ui violet text\">$version</span>`;\n\n      if (redirect_type === \"page\") {\n        return `${lang_part}${version_part}/`;\n      } else if (redirect_type === \"clean_url_to_html\") {\n        return `/**/<span class=\"ui violet text\">$file</span>/`;\n      } else if (redirect_type === \"html_to_clean_url\") {\n        return `/**/<span class=\"ui violet text\">$file</span>.html`;\n      }\n      return \"\";\n    });\n    // User input for from field as text, no HTML allowed\n    this.redirect_from = ko.computed(() => {\n      const from_url = this.from_url();\n      const redirect_type = this.redirect_type();\n      if (redirect_type === \"prefix\") {\n        return from_url + \"faq.html\";\n      } else if (redirect_type === \"page\") {\n        return from_url.replace(/^\\/+/, \"\");\n      } else if (redirect_type === \"exact\") {\n        return from_url;\n      }\n      return \"\";\n    });\n    // HTML prefix content for to field, don't use user input here.\n    this.redirect_to_prefix = ko.computed(() => {\n      const redirect_type = this.redirect_type();\n      const lang_part = `/<span class=\"ui violet text\">$lang</span>`;\n      const version_part = `/<span class=\"ui violet text\">$version</span>`;\n\n      if (redirect_type === \"prefix\") {\n        return `${lang_part}${version_part}/faq.html`;\n      } else if (redirect_type === \"page\") {\n        return `${lang_part}${version_part}/`;\n      } else if (redirect_type === \"clean_url_to_html\") {\n        return `/**/<span class=\"ui violet text\">$file</span>.html`;\n      } else if (redirect_type === \"html_to_clean_url\") {\n        return `/**/<span class=\"ui violet text\">$file</span>/`;\n      }\n      return \"\";\n    });\n    // User input for to field as text, no HTML allowed\n    this.redirect_to = ko.computed(() => {\n      const to_url = this.to_url();\n      const redirect_type = this.redirect_type();\n      if (redirect_type === \"page\") {\n        return to_url.replace(/^\\/+/, \"\");\n      } else if (redirect_type === \"exact\") {\n        return to_url;\n      }\n      return \"\";\n    });\n\n    this.redirect_type.subscribe((redirect_type) => {\n      if ([\"prefix\", \"page\", \"exact\"].includes(redirect_type)) {\n        this.is_example_disabled(false);\n        let is_to_url_visible = true;\n\n        // Update visibility\n        if (redirect_type == \"prefix\") {\n          is_to_url_visible = false;\n        }\n        this.is_from_url_visible(true);\n        this.is_to_url_visible(is_to_url_visible);\n      } else if (\n        [\"clean_url_to_html\", \"html_to_clean_url\"].includes(redirect_type)\n      ) {\n        this.is_example_disabled(false);\n        this.is_from_url_visible(false);\n        this.is_to_url_visible(false);\n      } else {\n        this.is_example_disabled(true);\n        this.is_from_url_visible(false);\n        this.is_to_url_visible(false);\n      }\n    });\n  }\n}\nRegistry.add_view(ProjectRedirectView);\n\n/**\n * Project sharing form view\n *\n * @param {Object} share - Initial instance data, optional\n */\nexport class ProjectTemporaryAccessView {\n  static view_name = \"ProjectTemporaryAccessView\";\n\n  constructor(share) {\n    this.access_type = ko.observable();\n    this.show_password_field = ko.computed(() => {\n      return this.access_type() == \"password\";\n    });\n\n    this.allow_all = ko.observable(share.allow_all);\n    this.show_versions_list = ko.computed(() => {\n      return this.allow_all() === false;\n    });\n  }\n}\nRegistry.add_view(ProjectTemporaryAccessView);\n\n/**\n * Project token form view\n *\n * The expiration date is only used with a custom expiration.\n */\nexport class ProjectTokenView {\n  static view_name = \"ProjectTokenView\";\n\n  constructor() {\n    this.expires_in = ko.observable();\n    this.is_custom_expiration = ko.computed(() => {\n      return this.expires_in() === \"custom\";\n    });\n  }\n}\nRegistry.add_view(ProjectTokenView);\n\n/**\n * Project search analytics view\n *\n * Search analytics chart data and config is loaded from an inline\n * application/json script block, so that data, labels, and localized strings\n * can be handled from the templates.\n *\n * @param {Element} elem - Element that view is attached to\n */\nexport class ProjectSearchAnalyticsView {\n  static view_name = \"ProjectSearchAnalyticsView\";\n\n  constructor() {\n    this.config = ko.observable();\n    this.is_loading = ko.observable(true);\n    this.config.subscribe((config) => {\n      this.is_loading(false);\n    });\n  }\n}\nRegistry.add_view(ProjectSearchAnalyticsView);\n\n/**\n * Project traffic analytics view\n *\n * This is identical to search analytics currently\n */\nexport class ProjectTrafficAnalyticsView extends ProjectSearchAnalyticsView {\n  static view_name = \"ProjectTrafficAnalyticsView\";\n}\nRegistry.add_view(ProjectTrafficAnalyticsView);\n","/* Public task tracking */\n\nimport jquery from \"jquery\";\n\nexport function poll_task(data) {\n  var defer = jquery.Deferred();\n  var tries = 5;\n\n  function poll_task_loop() {\n    jquery\n      .getJSON(data.url)\n      .done(function (task) {\n        if (task.finished) {\n          if (task.success) {\n            defer.resolve();\n          } else {\n            defer.reject({ message: task.error });\n          }\n        } else {\n          setTimeout(poll_task_loop, 2000);\n        }\n      })\n      .fail(function (error) {\n        console.error(\"Error polling task\");\n        tries -= 1;\n        if (tries > 0) {\n          setTimeout(poll_task_loop, 2000);\n        } else {\n          let error_msg = error.statusText;\n          if (error.responseJSON) {\n            error_msg = error.responseJSON.detail;\n          }\n          defer.reject({ message: error_msg });\n        }\n      });\n  }\n\n  setTimeout(poll_task_loop, 2000);\n\n  return defer;\n}\n\nexport function trigger_task(config) {\n  var defer = jquery.Deferred();\n  var url = config.url;\n  var token = config.token;\n  var data = { csrfmiddlewaretoken: token };\n\n  jquery.ajax({\n    method: \"POST\",\n    url: url,\n    data: data,\n    success: function (data) {\n      poll_task(data)\n        .then(function () {\n          defer.resolve();\n        })\n        .fail(function (error) {\n          // The poll_task function defer will only reject with\n          // normalized error objects\n          defer.reject(error);\n        });\n    },\n    error: function (error) {\n      var error_msg = error.responseJSON.detail || error.statusText;\n      defer.reject({ message: error_msg });\n    },\n  });\n\n  return defer;\n}\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\n\nimport * as tasks from \"../tasks\";\nimport * as utils from \"../core/utils\";\nimport { ResponsiveView } from \"../core/views\";\nimport { Registry } from \"../application/registry\";\n\n/**\n * Remote repository instance for remote repository listing.\n *\n * @param {Object} remote_repo - Remote repository API data\n */\nclass RemoteRepository {\n  constructor(remote_repo) {\n    // Just copy attributes over instead of prototyping. KO observables make a\n    // prototype change more awkward. Note, ``projects`` now comes directly from\n    // the API response, there is no need to parse this data from the v2\n    // ``matches`` response.\n    for (const key of Object.keys(remote_repo)) {\n      this[key] = remote_repo[key];\n    }\n\n    /** @observable {Boolean} Is this repository private? */\n    this.is_private = ko.observable(this.private);\n    /** @observable {Booleean} Is this repository active? */\n    this.is_active = ko.observable(this.active);\n    /** @observable {Boolean} Does user have admin privilege on the repo? */\n    this.has_admin = ko.observable(this.admin);\n    /** @computed {Boolean} Can user import this repository? */\n    this.is_locked = ko.computed(() => {\n      // TODO take platform private repo setting into consideration\n      return this.is_private() && !this.has_admin();\n    });\n    /** @observable {Boolean} Was the repository already imported? */\n    this.has_project = ko.computed(() => {\n      return this.projects.length > 0;\n    });\n  }\n}\n\n/**\n * Project creation view, for setting up a new project or linking an existing\n * repository to a new project.\n *\n * @extends {ResposiveView}\n */\nexport class ProjectCreateView extends ResponsiveView {\n  static view_name = \"ProjectCreateView\";\n\n  constructor() {\n    super();\n\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} View configuration */\n    this.config = ko.observable();\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Search configuration */\n    this.search_config = ko.observable();\n    /** @observable {Object} Search popup module configuration */\n    this.search_popup_config = ko.observable();\n    /** @observable {Object} Search modal module configuration */\n    this.search_modal_config = ko.observable(undefined);\n    /** @observable {Object} The selected repository */\n    this.selected = ko.observable();\n    /** @observable {Boolean} Is UI loading from the API currently? */\n    this.is_loading = ko.observable(false);\n    /** @observable {Boolean} Are remote repositories current resyncing? */\n    this.is_syncing = ko.observable(false);\n    /** @observable {Boolean} Are remote repositories done resyncing? */\n    this.is_synced = ko.observable(false);\n    /** @computed {Boolean} Is there a selected repository? */\n    this.is_selected = ko.computed(() => {\n      return this.selected() !== undefined;\n    });\n    /** @observable {Boolean} Can private repositories be imported */\n    this.allow_private_repos = ko.observable(false);\n    /** @observable {string} The error message to show the user */\n    this.error = ko.observable();\n\n    // Wait for config to be loaded to init search\n    this.config.subscribe((config) => {\n      if (config !== undefined) {\n        this.allow_private_repos(config.allow_private_repos);\n        this.init_search();\n      }\n    });\n  }\n\n  /**\n   * Sync remote repository objects using a call to our API. This sets the UI to\n   * a loading state so that user interaction can be limited. Configuration is\n   * loaded using :func:`config` and :func:`application.plugins.jsonInit`.\n   */\n  sync_remote_repos() {\n    const config = this.config();\n\n    const params = {\n      url: config.urls.api_sync_remote_repositories,\n      token: config.csrf_token,\n    };\n\n    this.is_synced(false);\n    this.is_syncing(true);\n    this.is_loading(true);\n\n    let promise = tasks\n      .trigger_task(params)\n      .fail((error) => {\n        console.error(\"Error syncing remote repositories:\", error.message);\n        this.error(error.message);\n      })\n      .always(() => {\n        this.is_syncing(false);\n        this.is_loading(false);\n        this.is_synced(true);\n      });\n\n    return promise;\n  }\n\n  /**\n   * Set up SUI search once :func:`config` is fully loaded.\n   *\n   * This uses a Knockout template to make it easier to display the individual\n   * elements in the list. The template is loaded from the element\n   * ``remote-repo-results``.\n   *\n   * Ultimately, this sets :func:`search_config`, which is the configuration\n   * object that will be eventually be used by SUI search jQuery plugin.\n   *\n   * .. seealso::\n   *     https://knockoutjs.com/documentation/template-binding.html\n   */\n  init_search() {\n    const config = this.config();\n    const url =\n      config.urls.remoterepository_list + \"?full_name={query}&ordering=import\";\n\n    // Configuration for the trigger of the popup element. We manually show the\n    // popup in the case that the user has tried searching multiple times\n    // unsuccessfully, or has a query with no results.\n    let attemptsRemaining = 3;\n    this.search_popup_config({\n      on: \"manual\",\n      position: \"top right\",\n      hoverable: true,\n      closable: true,\n      preserve: true,\n      onHidden: () => {\n        // If the user did something to hide the popup, like click outside the\n        // popup, reset the attempts so that the popup can show again.\n        attemptsRemaining = 3;\n      },\n      // Add a long delay so that hover doesn't accidentally dismiss the popup\n      delay: {\n        hide: 5000,\n      },\n    });\n\n    // Show repair modal immediately on view load if the URL contains `#repair` hash.\n    // Use this for linking users in support directly to this modal.\n    const show_modal = jquery(location).attr(\"hash\") == \"#repair\";\n    this.search_modal_config({\n      autoShow: show_modal,\n      centered: false,\n    });\n\n    this.search_config({\n      // We use a Knockout template here, embedded in the template as a script\n      // element. This avoids string interpolation in JS and keeps HTML in one\n      // place, along with HTML translations.\n      type: \"knockout\",\n      templates: {\n        knockout: (response) => {\n          let node_temp = jquery(\"<div>\");\n\n          ko.applyBindingsToNode(node_temp[0], {\n            template: {\n              name: \"remote-repo-results\",\n              data: {\n                remote_repos: response.results.map((repo) => {\n                  return new RemoteRepository(repo);\n                }),\n              },\n            },\n          });\n\n          const output = node_temp.html();\n          node_temp.remove();\n          return output;\n        },\n      },\n      error: {\n        noResultsHeader: \"No matching repositories found\",\n      },\n      apiSettings: {\n        url: url,\n      },\n      selector: {\n        // Required because the default of ``prompt`` is a rounded input\n        prompt: \".ui.text\",\n        // Required as we use `.title` to style a complex result title. SUI uses\n        // the `text()` of this element to look up the result\n        title: \".title .text\",\n      },\n      fullTextSearch: true,\n      onSelect: (result, response) => {\n        this.selected(new RemoteRepository(result));\n      },\n      // Listen for results and decide to show the resync popup based on what\n      // the user's interaction with search results.\n      onResults: (response, fromCache) => {\n        if ((response && response.count == 0) || attemptsRemaining <= 0) {\n          // Search results are empty or user tried searching multiple times\n          // unsuccessfully so far. Calls with the behavior style call supported by\n          // :js:func:`application.plugins.semanticui`.\n          this.search_popup_config((popup) => popup(\"show\"));\n        }\n        attemptsRemaining--;\n      },\n    });\n  }\n\n  /** {Boolean} Is repository supported, based on permissions? */\n  is_repository_supported(repo) {\n    if (repo.is_private()) {\n      return this.allow_private_repos();\n    }\n    return true;\n  }\n\n  /** Show search modal */\n  show_modal() {\n    this.search_popup_config((popup) => popup(\"hide\"));\n    this.search_modal_config((modal) => modal(\"show\"));\n  }\n}\nRegistry.add_view(ProjectCreateView);\n","import ko from \"knockout\";\nimport jquery from \"jquery\";\nimport { html, render } from \"lit\";\nimport { map } from \"lit/directives/map.js\";\nimport { when } from \"lit/directives/when.js\";\nimport { classMap } from \"lit/directives/class-map.js\";\n\nimport * as admin from \"./admin\";\nimport * as create from \"./create\";\n\nimport { APIListItemView } from \"../core/views\";\nimport { Registry } from \"../application/registry\";\n\nexport { admin, create };\n\n/**\n * Project item view object used for displaying individual projects in the project\n * listing.\n *\n * @param {Object} project - Project API data\n * @extends {APIListItemView}\n */\nexport class ProjectListItemView extends APIListItemView {\n  static view_name = \"ProjectListItemView\";\n\n  constructor(project) {\n    super(project);\n\n    // Add expansion to API URL\n    this.url = this.url + \"?expand=permissions\";\n\n    /** Asynchronously load documentation URL as rendering this URL for each\n     * project slows the dashboard down considerably. Instead, this is only\n     * fetched when it is needed.\n     * @observable {string} Documentation URL for the project */\n    this.url_docs = ko.observable();\n    /* @observable {Boolean} Does the user have admin permissions on this? */\n    this.is_admin = ko.observable(false);\n\n    // Subscribe to the data loaded via :class:`APIListItemView`\n    this.data.subscribe((data) => {\n      this.url_docs(data.urls.documentation);\n      this.is_admin(data.permissions.admin);\n    });\n  }\n}\nRegistry.add_view(ProjectListItemView);\n\n/**\n * View for project version creation and version activation.\n *\n * @class\n * @construtor\n * @public\n */\nexport class ProjectVersionCreateView {\n  static view_name = \"ProjectVersionCreateView\";\n\n  constructor() {\n    /** Configuration passed in via :func:`~application.plugins.jsonInit`\n     * @observable {Object} Search configuration */\n    this.config = ko.observable();\n\n    /** @observable {Boolean} Is search data loading? */\n    this.is_loading = ko.observable(false);\n\n    /** Computed observable for rendering the final search configuration. This\n     * is used to initialize search as soon as the :func:`config` observable is\n     * finalized.\n     * @computed {Object} Search configuration object */\n    this.search_config = ko.computed(() => {\n      const config = this.config();\n      if (config !== undefined) {\n        return this.init_search(config);\n      }\n    });\n  }\n\n  /**\n   * Initialize the SUI search element using the configuration loaded in\n   * :func:`search_config`.\n   *\n   * This sets up various configuration for the search SUI element, but also\n   * sets up functions like `onSelect`, for performing actions on events.\n   *\n   * @param {object} config - configuration for search element\n   */\n  init_search(config) {\n    const maxResults = 100;\n    // String interpolation over URLSearchParams here as FUI uses basic string\n    // replacement for `{query}`, but this is encoded for URLSearchParams.\n    const url = config.api_url + `?limit=${maxResults}&verbose_name={query}`;\n    const errors = config.errors || {};\n    return {\n      apiSettings: {\n        url: url,\n      },\n      error: errors,\n      fullTextSearch: true,\n      maxResults: maxResults,\n      onSelect: (result, response) => {\n        window.location.href = result.urls.dashboard.edit;\n      },\n      selector: {\n        // Required because this uses ``.ui.text`` instead of ``.ui.prompt``\n        // because prompt uses a rounded input style\n        prompt: \".ui.text\",\n        // Required as ``.title`` is a complex element in our use, not a simple\n        // string like normal. The inner ``.title .text`` sets the field result\n        // to just the string value.\n        title: \".title .text\",\n      },\n      // Show results immediately on focus\n      minCharacters: 0,\n      searchOnFocus: true,\n      // Use custom template for rich result display\n      type: \"versions\",\n      templates: {\n        versions: (response) => {\n          // Using Lit here as this will likely very soon just be a web component\n          // anyways. The project create form references a Knockout observable\n          // and a template in HTML. This uses a temporary element to render down\n          // to HTML, then removes the element from ``document`` immediately.\n          const container = document.createElement(\"div\");\n          const results = html`\n            <div class=\"results\">\n              ${map(\n                response.results,\n                (version) => html`\n                  <a class=\"result\">\n                    <div class=\"image\"></div>\n                    <div class=\"content\">\n                      <div class=\"title\">\n                        <span class=\"text\">${version.verbose_name}</span>\n                        <i\n                          class=\"fas ${classMap({\n                            \"fa-code-branch\": version.type === \"branch\",\n                            \"fa-tag\": version.type === \"tag\",\n                          })} small icon\"\n                        ></i>\n                        ${when(\n                          version.active,\n                          () => html`\n                            <span class=\"ui horizontal label\">\n                              <i class=\"fas fa-check icon\"></i>\n                              Active\n                            </span>\n                          `,\n                        )}\n                      </div>\n                      <div class=\"description\">\n                        <code>${version.identifier}</code>\n                      </div>\n                    </div>\n                  </a>\n                `,\n              )}\n            </div>\n          `;\n\n          // Lit renders on an element, but FUI search templates expect HTML return\n          render(results, container);\n          const htmlResults = container.innerHTML;\n          container.remove();\n          return htmlResults;\n        },\n      },\n    };\n  }\n}\nRegistry.add_view(ProjectVersionCreateView);\n\n/** Version list item subview\n *\n * This mutates project version API return data for use in the Knockout view.\n *\n * URLs for documentation output are lazy loaded when they are requested. We\n * don't do an API call until the user interacts with the version object. This\n * way we don't have to render all of the documentation artifact URLs at once\n * through the resolver. This can cause 10s dashboard load times with a lot of\n * versions.\n *\n * @param {Object} version - Version object data from API\n * @extends {APIListItemView}\n */\nexport class VersionListItemView extends APIListItemView {\n  static view_name = \"VersionListItemView\";\n\n  constructor(version) {\n    super(version);\n\n    /** @observable {string} Async loaded URL for version PDF */\n    this.url_pdf = ko.observable();\n    /** @observable {string} Async loaded URL for version EPUB */\n    this.url_epub = ko.observable();\n    /** @observable {string} Async loaded URL for version HTMLzip */\n    this.url_html = ko.observable();\n    /** @observable {string} Async loaded URL for version docs */\n    this.url_docs = ko.observable();\n    /** @observable {Boolean} is version successfully built? */\n    this.is_built = ko.observable(true);\n\n    // On resolving the data from the API, fill out these observables.\n    this.data.subscribe((data) => {\n      this.url_pdf(data.downloads.pdf);\n      this.url_epub(data.downloads.epub);\n      this.url_html(data.downloads.htmlzip);\n      this.url_docs(data.urls.documentation);\n      this.is_built(data.built);\n    });\n  }\n\n  /**\n   * Trigger a build task for a specific version. This replaces the build\n   * dropdown form and instead provides a link on each version admin menu, which\n   * is far more intuitive.\n   *\n   * @param {string} url - URL to post to, this is a project form view, so comes\n   * from the Django template\n   * @param {string} csrf_token - Also from the Django form, the CSRF token\n   * @returns {function} Callback function\n   */\n  trigger_build(url, csrf_token) {\n    return (context, ev) => {\n      jquery\n        .ajax({\n          type: \"POST\",\n          url: url,\n          data: {\n            csrfmiddlewaretoken: csrf_token,\n          },\n        })\n        .then((data) => {\n          if (data.build.urls.build) {\n            window.location.href = data.build.urls.build;\n          } else {\n            console.debug(\"Redirect to new build failed\");\n          }\n        })\n        .catch((err) => {\n          console.error(err);\n        });\n    };\n  }\n}\nRegistry.add_view(VersionListItemView);\n\nexport class ProjectAnnouncementView {\n  static view_name = \"ProjectAnnouncementView\";\n\n  constructor(cache_key) {\n    this.cache_key = cache_key;\n    this.prefix_key = \"announcements\";\n    this.storage_key = `${this.prefix_key}.${this.cache_key}`;\n    this.closed = ko.observable();\n    const cached_value = localStorage.getItem(this.storage_key);\n    if (cached_value) {\n      this.closed(true);\n    } else {\n      this.closed(false);\n    }\n  }\n\n  close_announcement() {\n    this.closed(true);\n    localStorage.setItem(this.storage_key, true);\n  }\n}\nRegistry.add_view(ProjectAnnouncementView);\n","import { Registry } from \"../application/registry\";\n\n/*\n * View for tracking opened links, and reloading the page when they are closed.\n *\n * Useful when we depend on changes done outside of the app,\n * but we don't want to have users manually reload the page,\n * or constantly poll the server.\n */\nexport class MigrateGitHubAppView {\n  static view_name = \"MigrateGitHubAppView\";\n  constructor() {\n    this.openedWindows = [];\n    this.trackClosedWindows();\n  }\n\n  trackClosedWindows() {\n    setInterval(() => {\n      let originalLength = this.openedWindows.length;\n      this.openedWindows = this.openedWindows.filter((win) => !win.closed);\n      if (this.openedWindows.length < originalLength) {\n        // Wait some seconds before reloading the page,\n        // so our app has time to update the status.\n        setTimeout(() => {\n          window.location.reload();\n        }, 500);\n      }\n    }, 250);\n  }\n\n  /*\n   * Click event handler for tracking opened links.\n   */\n  trackLinkClick(data, event) {\n    event.preventDefault();\n    const newWindow = window.open(event.target.href, \"_blank\");\n    if (newWindow) {\n      this.openedWindows.push(newWindow);\n    }\n  }\n}\n\nRegistry.add_view(MigrateGitHubAppView);\n","import jquery from \"jquery\";\nimport ko from \"knockout\";\nimport clipboard from \"clipboard\";\nimport * as Sentry from \"@sentry/browser\";\n\nimport { ApplicationView } from \"./views\";\nimport * as plugins from \"./plugins\";\nimport { Registry } from \"./registry\";\n\n// Application views\nimport * as account_views from \"../account\";\nimport * as build_views from \"../build\";\nimport * as core_views from \"../core\";\nimport * as gold_views from \"../gold\";\nimport * as module_views from \"../modules\";\nimport * as organization_views from \"../organization\";\nimport * as project_views from \"../project\";\nimport * as profile_views from \"../profile\";\n\n/**\n * This is the main entry point for the front end code and is used to set up and\n * instantiate Webpack, Knockout, and SemanticUI. This class is used to set up\n * and instantiate all of the front end functionality. The main entry point is\n * :meth:`Application.run`.\n */\nexport class Application {\n  constructor(config) {\n    this.config = config;\n    this.registry = new Registry();\n  }\n\n  /**\n   * This is the first method to be executed after instantiation. It handles\n   * all of the set up and instantiation.\n   *\n   * - :meth:`Application.load_config` loads the site configuration\n   * - :meth:`Application.configure_plugins` loads plugins\n   * - :meth:`Application.attach_view` does view routing and attaches the view\n   * - :meth:`Application.start_plugins` sets up jQuery plugins on some elements\n   */\n  run() {\n    this.load_config();\n    this.configure_plugins();\n    this.attach_view();\n    this.add_jquery_plugins();\n  }\n\n  /**\n   * Load site configuration from a special ``application/json`` script element.\n   * This configures paths for Webpack async imports, console debugging.\n   *\n   * .. seealso::\n   *     Convention on :ref:`js-json-config`\n   */\n  load_config() {\n    if (this.config === undefined) {\n      console.debug(\"Loading site front end configuration from script tag\");\n      const site_config_src = jquery(\"script#site-config\").text() || \"{}\";\n      this.config = JSON.parse(site_config_src);\n    }\n    if (this.config?.webpack_public_path) {\n      __webpack_public_path__ = this.config.webpack_public_path;\n      globalThis.__webpack_public_path__ = this.config.webpack_public_path;\n    }\n    // Null route debug logging, don't do output anything that was debug\n    if (!this.config?.debug) {\n      console.debug = () => {};\n    }\n    // Load Sentry\n    if (this.config?.sentry?.dsn) {\n      Sentry.init({\n        dsn: this.config.sentry.dsn,\n        environment: this.config.sentry?.environment,\n        integrations: [],\n      });\n    }\n\n    return this.config;\n  }\n\n  /**\n   * Add jQuery and Knockout plugins so that HTML and JS can use these plugins.\n   * This is mainly just the various import logic and configuration, not where\n   * we would run something like ``$('.ui.modal').modal()``.\n   */\n  configure_plugins() {\n    plugins.configure_jquery_plugins();\n    plugins.configure_knockout_plugins();\n  }\n\n  /**\n   * Attach the :class:`ApplicationView` view router, which gives templates\n   * access to all views that we have available. This is how we are able to\n   * reference a view in a Knockout data binding.\n   */\n  attach_view() {\n    const view = new ApplicationView();\n    this.registry.attach(view);\n    view.attach();\n  }\n\n  /**\n   * Set up jQuery and SUI jQuery plugins that were not explicitly set up in\n   * templates. Elements that are configured inside templates use the Knockout\n   * plugin :func:`~application.plugins.semanticui`. This allows for explicit\n   * set up of an element's plugin, and should be the standard way to attach a\n   * jQuery plugin to an element.\n   *\n   * We don't do generic targeting of elements when setting up jQuery plugins as\n   * there are a number of places where an element needs to be initialized with\n   * specific plugin configuration. It's easiest to define in HTML what plugin\n   * and plugin configuration the element needs.\n   *\n   * .. warning::\n   *     Generic targeting use should be avoided and it's use deprecated.\n   */\n  add_jquery_plugins() {\n    // TODO remove instances of these in code and replace with the explicit\n    // semanticui KO plugin.\n    jquery(\".ui.progress:not([data-semanticui-progress])\").progress();\n    jquery(\".ui.accordion:not([data-semanticui-accordion])\").accordion();\n    jquery(\".ui.dropdown:not([data-semanticui-dropdown])\").dropdown({\n      placeholder: \"\",\n    });\n    // Automatically convert ``<select>`` in a nested dropdown element. This is\n    // used with Crispy form fields and other Django form fields mostly.\n    jquery(\".ui.dropdown[data-semanticui-dropdown] > select\").dropdown({\n      placeholder: \"\",\n    });\n\n    // Enable popup functionality with a broad CSS selector here because\n    // `data-content` is very basic usage of a popup. Anything more complicated\n    // should use the semanticui KO plugin.\n    jquery(\"[data-content]:not([data-semanticui-popup])\").popup({\n      position: \"top center\",\n      delay: {\n        show: 500,\n      },\n      variation: \"small\",\n    });\n    jquery(\".ui.menu > .item[data-tab]\").tab();\n\n    /* Initialize clipboard.js using a few selectors that we are using. This\n     * isn't a great fit for Knockout custom data binding or plugin, as the\n     * library uses some builtin/hardcoded selectors. */\n    var clipboard_global = new clipboard(\n      \"[data-clipboard-text], [data-clipboard-target]\",\n    );\n    // Provide the user with some visual feedback using FUI popups\n    jquery(\"[data-clipboard-text], [data-clipboard-target]\").popup({\n      on: \"click\",\n      hoverable: false,\n      content: \"Copied!\",\n    });\n\n    // Plausible. Only logged in users are tracked, the flag is set by the\n    // ``settings_dashboard`` template tag.\n    if (this.config.analytics_enabled) {\n      jquery(\"[data-analytics], [data-analytics-events]\").plausible(\n        this.config.production_domain,\n        this.config.debug,\n      );\n    }\n  }\n}\n","import jquery from \"jquery\";\nimport { Application } from \"./application\";\n\njquery(document).ready(() => {\n  const app = new Application();\n  app.run();\n});\n"],"names":["moment","e","Error","code","module","exports","ApplicationView","_classCallCheck","key","value","selector","arguments","length","undefined","console","debug","ko","this","jquery","modal_id","data","event","modal","_step","_iterator","_createForOfIteratorHelper","document","querySelectorAll","s","n","done","button","dataset","variation","split","pop","join","err","f","form","currentTarget","querySelector","submit","globalThis","jQuery","htmlInit","add_init_handler","element","innerHTML","property","html","textInit","innerText","text","valueInit","jsonInit","JSON","parse","error","getter","setter","init","valueAccessor","allBindingsAccessor","value_accessor","chart","then","_ref","chartjs","config","datasets","map","backgroundColor","borderColor","pointBorderColor","borderWidth","popup","bindings","view","context","Object","assign","hoverable","delay","show","hide","exclusive","onHide","$rawData","hover","webcomponent","update","all_bindings","binding_value","_i","_Object$entries","entries","_Object$entries$_i","_slicedToArray","semanticui","jq_element","_loop","_Object$entries2$_i","_Object$entries2","_i2","behavior","_console","_len","args","Array","_key","apply","concat","detachable","body","prepend","attr","jqueryPlausible","domain","plausibleSettings","trackLocalhost","trackEvent","Plausible","trackPageview","each","index","elem","_data$analyticsEvents","_data$analytics","eventNames","analyticsEvents","analytics","eventProperties","handleAnalyticsEvent","isLink","tagName","toLowerCase","isMiddleClick","type","which","isClick","isLinkClick","target","ctrlKey","metaKey","shiftKey","Promise","all","eventName","resolve","reject","callback","props","setTimeout","href","window","location","preventDefault","keys","forEach","match","_match","addEventListener","jquery_tabmenu","settings","$","find","tab","Registry","_this","name","views","view_name","params","_construct","constructor","view_class","SocialAccountView","options","github_modal_config","_createClass","_defineProperty","LoginView","_SocialAccountView","_inherits","_super","_createSuper","call","last_tab","last_method","popups","method","_this2","position","content","msg","closable","preserve","on","isArray","includes","cookie","isSecureContext","_get","_getPrototypeOf","prototype","add_view","dayjs","RelativeTime","Duration","LocalizedFormat","BuildCommandOutput","build_command_output","command","output","line_number","anchor_id","id","is_selected","BuildCommand","build_command","replace","looks_like_debug","is_debug","exit_code","is_successful","is_cancelled","run_time","start_time","end_time","finished","info_display","is_visible","deferEvaluation","command_class","is_expanded","subscribe","output_lines","line","ansi_up","AnsiUp","use_classes","ansi_to_html","BuildDetailView","_this3","build","url_api_build","url_api_notifications","success","notifications","has_notifications","state","state_display","is_finished","is_loading","can_cancel","can_retry","can_view_docs","is_wrapped","update_state","progress_config","states","isInitial","autoSuccess","indexOf","total","label","is_failed","progress","extend","deferred","date","date_display","date_display_since","length_display","date_readable","format","fromNow","duration","dateNow","dateStart","diff","formatParts","minutes","unshift","hours","builder","commands","commit","commit_short","substring","docs_url","commit_url","legacy_output","selected_hash","selected_line","selected_line_prev","show_debug","show_raw","URLSearchParams","search","get","url","URL","searchParams","set","history","replaceState","is_polling","set_selected_line_from_hash","poll_api_build","poll_api_notifications","_this4","valueHasMutated","add_command","stringify","_this5","getJSON","state__in","results","command_found","arrayFirst","command_search","push","scrollIntoView","block","inline","focus","found","selected_command","output_line","set_selected_line","breakpoints","mobile","tablet","computer","large_screen","ResponsiveView","viewport_width","device","ratelimit","width","_Object$keys","device_name","is_device","jq_window","fn_update","APIListItemView","loaded","loading","promise","HeaderView","search_project_config","api_projects_list_url","origin","apiSettings","onResponse","resp","description","slug","subproject_of","translation_of","language","url_project","urls","home","url_window","hostname","title","toString","minCharacters","StripeCheckoutView","stripeKey","checkoutSessionUrl","csrfToken","stripe","stripeLoading","priceId","initializeStripe","loadStripe","fetch","headers","result","json","redirectToCheckout","sessionId","session_id","LightDOMElement","_LitElement","LitElement","AvatarElement","_templateObject","_taggedTemplateLiteral","changed","has","seed","rng","pureRand","posX","posY","style","setProperty","String","css","_templateObject2","customElements","define","CollapsingHeaderView","collapsed","is_collapsed","dropdown_class","FilterView","filter_config","action","onChange","$elem","closest","FieldElement","_LightDOMElement","_assertThisInitialized","createRef","hasError","refInput","refErrors","Boolean","tabIndex","setAttribute","inputValue","disabled","dispatchChangeEvent","dispatchEvent","CustomEvent","bubbles","composed","remove","InputFieldElement","_FieldElement","_super2","elemInput","stopPropagation","RichSelectFieldElement","_FieldElement2","_super3","dropdown","fireOnInit","$selected","selected","_jquery","properties","APIEventWrapper","onEvent","Accept","request","classes","classList","add","sendRequest","getHeaders","getUrl","response","ok","onError","urlSuccess","getSuccessURL","toast","class","message","errorMessage","attribute","MenuBuildRebuildElement","_APIEventWrapper","uploaded","uploadedMessage","_this$data","ButtonSyncAllVersionsElement","_APIEventWrapper2","log","contextData","createContext","Symbol","contextState","States","freeze","WAITING","LOADING","DONE","APIProviderElement","_APIEventWrapper3","_super4","ContextProvider","_providerData","setValue","_providerState","APIConsumerElement","_LightDOMElement2","_super5","ContextConsumer","_consumerData","_consumerState","click","ItemDocsElement","_APIConsumerElement","_super6","_this$data2","classMap","documentation","queueEvent","when","_templateObject3","ItemDownloadsElement","_APIConsumerElement2","_super7","_this$data3","_this$data4","_this$data5","_this$data6","_this$data7","_this$data8","_templateObject4","_templateObject5","_templateObject6","downloads","pdf","epub","htmlzip","MenuProjectAdminElement","_APIConsumerElement3","_super8","_this$data9","_this$data10","isAdmin","permissions","admin","urlSettings","_templateObject7","_properties","setPrototypeOf","isFrozen","getPrototypeOf","getOwnPropertyDescriptor","seal","create","construct","Reflect","x","fun","thisValue","Func","arrayForEach","unapply","arrayPop","arrayPush","stringToLowerCase","stringToString","stringMatch","stringReplace","stringIndexOf","stringTrim","trim","objectHasOwnProperty","hasOwnProperty","regExpTest","RegExp","test","typeErrorCreate","func","TypeError","_len2","_key2","thisArg","addToSet","array","transformCaseFunc","l","lcElement","cleanArray","clone","object","newObject","lookupGetter","prop","desc","html$1","svg$1","svgFilters","svgDisallowed","mathMl$1","mathMlDisallowed","svg","mathMl","xml","MUSTACHE_EXPR","ERB_EXPR","TMPLIT_EXPR","DATA_ATTR","ARIA_ATTR","IS_ALLOWED_URI","IS_SCRIPT_OR_DATA","ATTR_WHITESPACE","DOCTYPE_NAME","CUSTOM_ELEMENT","EXPRESSIONS","__proto__","NODE_TYPE","getGlobal","purify","createDOMPurify","DOMPurify","root","version","removed","nodeType","isSupported","originalDocument","currentScript","DocumentFragment","HTMLTemplateElement","Node","Element","NodeFilter","NamedNodeMap","MozNamedAttrMap","HTMLFormElement","DOMParser","trustedTypes","ElementPrototype","cloneNode","getNextSibling","getChildNodes","getParentNode","template","createElement","ownerDocument","trustedTypesPolicy","emptyHTML","implementation","createNodeIterator","createDocumentFragment","getElementsByTagName","importNode","hooks","afterSanitizeAttributes","afterSanitizeElements","afterSanitizeShadowDOM","beforeSanitizeAttributes","beforeSanitizeElements","beforeSanitizeShadowDOM","uponSanitizeAttribute","uponSanitizeElement","uponSanitizeShadowNode","createHTMLDocument","IS_ALLOWED_URI$1","ALLOWED_TAGS","DEFAULT_ALLOWED_TAGS","ALLOWED_ATTR","DEFAULT_ALLOWED_ATTR","CUSTOM_ELEMENT_HANDLING","tagNameCheck","writable","configurable","enumerable","attributeNameCheck","allowCustomizedBuiltInElements","FORBID_TAGS","FORBID_ATTR","ALLOW_ARIA_ATTR","ALLOW_DATA_ATTR","ALLOW_UNKNOWN_PROTOCOLS","ALLOW_SELF_CLOSE_IN_ATTR","SAFE_FOR_TEMPLATES","SAFE_FOR_XML","WHOLE_DOCUMENT","SET_CONFIG","FORCE_BODY","RETURN_DOM","RETURN_DOM_FRAGMENT","RETURN_TRUSTED_TYPE","SANITIZE_DOM","SANITIZE_NAMED_PROPS","KEEP_CONTENT","IN_PLACE","USE_PROFILES","FORBID_CONTENTS","DEFAULT_FORBID_CONTENTS","DATA_URI_TAGS","DEFAULT_DATA_URI_TAGS","URI_SAFE_ATTRIBUTES","DEFAULT_URI_SAFE_ATTRIBUTES","MATHML_NAMESPACE","SVG_NAMESPACE","HTML_NAMESPACE","NAMESPACE","IS_EMPTY_INPUT","ALLOWED_NAMESPACES","DEFAULT_ALLOWED_NAMESPACES","MATHML_TEXT_INTEGRATION_POINTS","HTML_INTEGRATION_POINTS","COMMON_SVG_AND_HTML_ELEMENTS","PARSER_MEDIA_TYPE","SUPPORTED_PARSER_MEDIA_TYPES","CONFIG","formElement","isRegexOrFunction","testValue","Function","_parseConfig","cfg","ADD_URI_SAFE_ATTR","ADD_DATA_URI_TAGS","ALLOWED_URI_REGEXP","ADD_TAGS","ADD_ATTR","table","tbody","TRUSTED_TYPES_POLICY","createHTML","createScriptURL","purifyHostElement","createPolicy","suffix","ATTR_NAME","hasAttribute","getAttribute","policyName","scriptUrl","_","warn","_createTrustedTypesPolicy","ALL_SVG_TAGS","ALL_MATHML_TAGS","_forceRemove","node","removeChild","_removeAttribute","getAttributeNode","from","removeAttribute","_initDocument","dirty","doc","leadingWhitespace","matches","dirtyPayload","parseFromString","documentElement","createDocument","insertBefore","createTextNode","childNodes","_createNodeIterator","SHOW_ELEMENT","SHOW_COMMENT","SHOW_TEXT","SHOW_PROCESSING_INSTRUCTION","SHOW_CDATA_SECTION","_isClobbered","nodeName","textContent","attributes","namespaceURI","hasChildNodes","_isNode","_executeHooks","currentNode","hook","_sanitizeElements","allowedTags","firstElementChild","_isBasicCustomElement","parentNode","i","childClone","__removalCount","parent","parentTagName","_checkValidNamespace","expr","_isValidAttribute","lcTag","lcName","_sanitizeAttributes","hookEvent","attrName","attrValue","keepAttr","allowedAttributes","forceKeepAttr","getAttributeType","setAttributeNS","_sanitizeShadowDOM","fragment","shadowNode","shadowIterator","nextNode","sanitize","importedNode","returnNode","appendChild","firstChild","nodeIterator","shadowroot","shadowrootmode","serializedHTML","outerHTML","doctype","setConfig","clearConfig","isValidAttribute","tag","addHook","entryPoint","hookFunction","removeHook","removeHooks","removeAllHooks","NotificationElement","notification","nothing","inverted","dismissable","dismiss","icon_classes","unsafeHTML","header","_links","_self","transition","animation","onComplete","parentElement","NotificationListElement","fetchNotifications","repeat","className","PopupcardView","url_notifications","is_showing","is_loaded","popup_config","onShow","promise_notifications","fetch_notifications","responseJSON","OrganizationSettingsAuthorizationView","provider_original","provider","show_warning","use_domain","OrganizationCreateView","slugified","slugify","example","val","ProjectRepositoryMultifieldElement","remoteRepositoryValue","useManual","_this$slotDefault","slotRemoteRepository","children","slotRepo","slotDefault","replaceChildren","_toConsumableArray","refRemoteRepository","remoteRepositoryUrl","remoteRepositoryError","refRepo","repoValue","repoError","checked","showManualUrlWarning","classesRemoteRepositoryField","classesRepoField","listenerRemoteRepository","ref","showConnectedServiceWarning","urlConnectedServices","toggleManual","listenerRepo","urlDocsManual","dontSync","clearErrors","previousChoice","ProjectAutomationRuleView","automation_rule","version_predefined_match_pattern","is_version_match_pattern_visible","is_all_versions","is_semver_versions","is_custom","ProjectRedirectView","redirect","redirect_type","from_url","to_url","is_example_disabled","is_from_url_visible","is_to_url_visible","redirect_from_prefix","redirect_from","redirect_to_prefix","lang_part","version_part","redirect_to","ProjectTemporaryAccessView","share","access_type","show_password_field","allow_all","show_versions_list","ProjectTokenView","_this6","expires_in","is_custom_expiration","ProjectSearchAnalyticsView","_this7","ProjectTrafficAnalyticsView","_ProjectSearchAnalyti","trigger_task","defer","Deferred","csrfmiddlewaretoken","token","ajax","tries","poll_task_loop","task","fail","error_msg","statusText","detail","poll_task","RemoteRepository","remote_repo","is_private","is_active","active","has_admin","is_locked","has_project","projects","ProjectCreateView","_ResponsiveView","search_config","search_popup_config","search_modal_config","is_syncing","is_synced","allow_private_repos","init_search","api_sync_remote_repositories","csrf_token","tasks","always","remoterepository_list","attemptsRemaining","onHidden","show_modal","autoShow","centered","templates","knockout","node_temp","remote_repos","repo","noResultsHeader","prompt","fullTextSearch","onSelect","onResults","fromCache","count","ProjectListItemView","_APIListItemView","project","url_docs","is_admin","ProjectVersionCreateView","api_url","errors","maxResults","dashboard","edit","searchOnFocus","versions","container","verbose_name","identifier","render","htmlResults","VersionListItemView","_APIListItemView2","url_pdf","url_epub","url_html","is_built","built","ev","ProjectAnnouncementView","cache_key","prefix_key","storage_key","closed","localStorage","getItem","setItem","MigrateGitHubAppView","openedWindows","trackClosedWindows","setInterval","originalLength","filter","win","reload","newWindow","open","Application","registry","load_config","configure_plugins","attach_view","add_jquery_plugins","_this$config","_this$config2","_this$config3","_this$config$sentry","site_config_src","webpack_public_path","__webpack_public_path__","sentry","dsn","Sentry","environment","integrations","fn","site","tabs","tabmenu","plausible","attach","accordion","placeholder","clipboard","analytics_enabled","production_domain","ready","run"],"sourceRoot":""}