diff --git a/Gemfile.lock b/Gemfile.lock
index 62b76df..c5dcddb 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -208,7 +208,7 @@ GEM
psych (5.2.3)
date
stringio
- public_suffix (6.0.1)
+ public_suffix (6.0.2)
puma (6.6.0)
nio4r (~> 2.0)
racc (1.8.1)
diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css
index 797fc2c..55901a6 100644
--- a/app/assets/stylesheets/application.css
+++ b/app/assets/stylesheets/application.css
@@ -226,6 +226,23 @@ main {
justify-content: end;
}
+.background-container {
+ position: fixed;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ z-index: -1;
+ pointer-events: none;
+
+ & img {
+ display: block;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ }
+}
+
@media (min-width: 474px) {
main {
justify-content: center;
@@ -246,7 +263,6 @@ main {
grid-template-rows: auto;
gap: 8px;
-
}
.intro-container,
diff --git a/app/controllers/languages_controller.rb b/app/controllers/languages_controller.rb
index ef1f1cc..f6f5163 100644
--- a/app/controllers/languages_controller.rb
+++ b/app/controllers/languages_controller.rb
@@ -6,11 +6,18 @@ class LanguagesController < ApplicationController
helper_method :accept_language
def index
+ @node = Node.roots.viewable.first
+
+ not_found unless @node
end
def show
@accept_language = params[:locale]
+ @node = Node.roots.viewable.first
+
+ not_found unless @node
+
render :index
end
diff --git a/app/views/languages/_intro.html.erb b/app/views/languages/_intro.html.erb
index 80cb4bb..357de2f 100644
--- a/app/views/languages/_intro.html.erb
+++ b/app/views/languages/_intro.html.erb
@@ -1,4 +1,4 @@
-<% Node.roots.viewable.first.attachments.limit(2).each_with_index do |attachment, i| %>
+<% @node.attachments.limit(2).each_with_index do |attachment, i| %>
<%= tag.div attachment.body.html_safe, class: i == 0 ? "intro-content-header" : "intro-content-body" %>
<% end %>
diff --git a/app/views/languages/index.html.erb b/app/views/languages/index.html.erb
index 0a331c3..f919140 100644
--- a/app/views/languages/index.html.erb
+++ b/app/views/languages/index.html.erb
@@ -1,5 +1,16 @@
<%- content_for :title, t('project_name') %>
+<% Array(@node.assets.select{ |asset| asset.file.image? }.first).each do |asset| %>
+
+ <%= image_tag rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg)),
+ srcset: "#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg))} 800w,
+ #{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [1600,nil], format: :jpg))} 1600w,
+ #{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [2400,nil], format: :jpg))} 2400w",
+ sizes: "100vw"
+ %>
+
+<% end %>
+
+ <%= image_tag rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg)),
+ srcset: "#{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [800,nil], format: :jpg))} 800w,
+ #{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [1600,nil], format: :jpg))} 1600w,
+ #{rails_storage_proxy_path(asset.file.representation(resize_to_limit: [2400,nil], format: :jpg))} 2400w",
+ sizes: "100vw"
+ %>
+
+<% end %>
+
<%= form_with model: @answer, url: url_for(controller: 'answers', action: 'create') do |form| %>
diff --git a/config/importmap.rb b/config/importmap.rb
index 80ead05..ea2c433 100644
--- a/config/importmap.rb
+++ b/config/importmap.rb
@@ -7,10 +7,10 @@ pin_all_from "app/javascript/controllers", under: "controllers"
pin "sortablejs" # @1.15.6
pin "stimulus-use" # @0.52.3
-pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.11
+pin "@rails/request.js", to: "@rails--request.js.js" # @0.0.12
pin "@rails/activestorage", to: "@rails--activestorage.js" # @8.0.200
pin "tom-select", to: "tom-select--dist--js--tom-select.base.min.js.js" # @2.4.3
-pin "trix" # @2.1.13
+pin "trix" # @2.1.14
# site_helper
pin "application", preload: false
diff --git a/vendor/javascript/@rails--request.js.js b/vendor/javascript/@rails--request.js.js
index b85d5c7..4c5dfd1 100644
--- a/vendor/javascript/@rails--request.js.js
+++ b/vendor/javascript/@rails--request.js.js
@@ -1,4 +1,4 @@
-// @rails/request.js@0.0.11 downloaded from https://ga.jspm.io/npm:@rails/request.js@0.0.11/src/index.js
+// @rails/request.js@0.0.12 downloaded from https://ga.jspm.io/npm:@rails/request.js@0.0.12/src/index.js
-class FetchResponse{constructor(t){this.response=t}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){const t=this.response.headers.get("Content-Type")||"";return t.replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(!this.isTurboStream)return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`));window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js")}async activeScript(){if(!this.isScript)return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`));{const t=document.createElement("script");const e=document.querySelector("meta[name=csp-nonce]");const n=e&&e.content;n&&t.setAttribute("nonce",n);t.innerHTML=await this.text;document.body.appendChild(t)}}}class RequestInterceptor{static register(t){this.interceptor=t}static get(){return this.interceptor}static reset(){this.interceptor=void 0}}function getCookie(t){const e=document.cookie?document.cookie.split("; "):[];const n=`${encodeURIComponent(t)}=`;const s=e.find((t=>t.startsWith(n)));if(s){const t=s.split("=").slice(1).join("=");if(t)return decodeURIComponent(t)}}function compact(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=s)}return e}function metaContent(t){const e=document.head.querySelector(`meta[name="${t}"]`);return e&&e.content}function stringEntriesFromFormData(t){return[...t].reduce(((t,[e,n])=>t.concat(typeof n==="string"?[[e,n]]:[])),[])}function mergeEntries(t,e){for(const[n,s]of e)if(!(s instanceof window.File))if(t.has(n)&&!n.includes("[]")){t.delete(n);t.set(n,s)}else t.append(n,s)}class FetchRequest{constructor(t,e,n={}){this.method=t;this.options=n;this.originalUrl=e.toString()}async perform(){try{const t=RequestInterceptor.get();t&&await t(this)}catch(t){console.error(t)}const t=this.responseKind==="turbo-stream"&&window.Turbo?window.Turbo.fetch:window.fetch;const e=new FetchResponse(await t(this.url,this.fetchOptions));if(e.unauthenticated&&e.authenticationURL)return Promise.reject(window.location.href=e.authenticationURL);e.isScript&&await e.activeScript();const n=e.ok||e.unprocessableEntity;n&&e.isTurboStream&&await e.renderTurboStream();return e}addHeader(t,e){const n=this.additionalHeaders;n[t]=e;this.options.headers=n}sameHostname(){if(!this.originalUrl.startsWith("http:"))return true;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch(t){return true}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect}}get headers(){const t={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};this.sameHostname()&&(t["X-CSRF-Token"]=this.csrfToken);return compact(Object.assign(t,this.additionalHeaders))}get csrfToken(){return getCookie(metaContent("csrf-param"))||metaContent("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){const t=(this.originalUrl.split("?")[1]||"").split("#")[0];const e=new URLSearchParams(t);let n=this.options.query;n=n instanceof window.FormData?stringEntriesFromFormData(n):n instanceof window.URLSearchParams?n.entries():Object.entries(n||{});mergeEntries(e,n);const s=e.toString();return s.length>0?`?${s}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){const t=Object.prototype.toString.call(this.body)==="[object String]";const e=this.headers["Content-Type"]==="application/json";return e&&!t?JSON.stringify(this.body):this.body}}async function get(t,e){const n=new FetchRequest("get",t,e);return n.perform()}async function post(t,e){const n=new FetchRequest("post",t,e);return n.perform()}async function put(t,e){const n=new FetchRequest("put",t,e);return n.perform()}async function patch(t,e){const n=new FetchRequest("patch",t,e);return n.perform()}async function destroy(t,e){const n=new FetchRequest("delete",t,e);return n.perform()}export{FetchRequest,FetchResponse,RequestInterceptor,destroy,get,patch,post,put};
+class FetchResponse{constructor(t){this.response=t}get statusCode(){return this.response.status}get redirected(){return this.response.redirected}get ok(){return this.response.ok}get unauthenticated(){return this.statusCode===401}get unprocessableEntity(){return this.statusCode===422}get authenticationURL(){return this.response.headers.get("WWW-Authenticate")}get contentType(){const t=this.response.headers.get("Content-Type")||"";return t.replace(/;.*$/,"")}get headers(){return this.response.headers}get html(){return this.contentType.match(/^(application|text)\/(html|xhtml\+xml)$/)?this.text:Promise.reject(new Error(`Expected an HTML response but got "${this.contentType}" instead`))}get json(){return this.contentType.match(/^application\/.*json$/)?this.responseJson||(this.responseJson=this.response.json()):Promise.reject(new Error(`Expected a JSON response but got "${this.contentType}" instead`))}get text(){return this.responseText||(this.responseText=this.response.text())}get isTurboStream(){return this.contentType.match(/^text\/vnd\.turbo-stream\.html/)}get isScript(){return this.contentType.match(/\b(?:java|ecma)script\b/)}async renderTurboStream(){if(!this.isTurboStream)return Promise.reject(new Error(`Expected a Turbo Stream response but got "${this.contentType}" instead`));window.Turbo?await window.Turbo.renderStreamMessage(await this.text):console.warn("You must set `window.Turbo = Turbo` to automatically process Turbo Stream events with request.js")}async activeScript(){if(!this.isScript)return Promise.reject(new Error(`Expected a Script response but got "${this.contentType}" instead`));{const t=document.createElement("script");const e=document.querySelector("meta[name=csp-nonce]");if(e){const n=e.nonce===""?e.content:e.nonce;n&&t.setAttribute("nonce",n)}t.innerHTML=await this.text;document.body.appendChild(t)}}}class RequestInterceptor{static register(t){this.interceptor=t}static get(){return this.interceptor}static reset(){this.interceptor=void 0}}function t(t){const e=document.cookie?document.cookie.split("; "):[];const n=`${encodeURIComponent(t)}=`;const s=e.find((t=>t.startsWith(n)));if(s){const t=s.split("=").slice(1).join("=");if(t)return decodeURIComponent(t)}}function e(t){const e={};for(const n in t){const s=t[n];s!==void 0&&(e[n]=s)}return e}function n(t){const e=document.head.querySelector(`meta[name="${t}"]`);return e&&e.content}function s(t){return[...t].reduce(((t,[e,n])=>t.concat(typeof n==="string"?[[e,n]]:[])),[])}function r(t,e){for(const[n,s]of e)if(!(s instanceof window.File))if(t.has(n)&&!n.includes("[]")){t.delete(n);t.set(n,s)}else t.append(n,s)}class FetchRequest{constructor(t,e,n={}){this.method=t;this.options=n;this.originalUrl=e.toString()}async perform(){try{const t=RequestInterceptor.get();t&&await t(this)}catch(t){console.error(t)}const t=this.responseKind==="turbo-stream"&&window.Turbo?window.Turbo.fetch:window.fetch;const e=new FetchResponse(await t(this.url,this.fetchOptions));if(e.unauthenticated&&e.authenticationURL)return Promise.reject(window.location.href=e.authenticationURL);e.isScript&&await e.activeScript();const n=e.ok||e.unprocessableEntity;n&&e.isTurboStream&&await e.renderTurboStream();return e}addHeader(t,e){const n=this.additionalHeaders;n[t]=e;this.options.headers=n}sameHostname(){if(!this.originalUrl.startsWith("http:")&&!this.originalUrl.startsWith("https:"))return true;try{return new URL(this.originalUrl).hostname===window.location.hostname}catch(t){return true}}get fetchOptions(){return{method:this.method.toUpperCase(),headers:this.headers,body:this.formattedBody,signal:this.signal,credentials:this.credentials,redirect:this.redirect,keepalive:this.keepalive}}get headers(){const t={"X-Requested-With":"XMLHttpRequest","Content-Type":this.contentType,Accept:this.accept};this.sameHostname()&&(t["X-CSRF-Token"]=this.csrfToken);return e(Object.assign(t,this.additionalHeaders))}get csrfToken(){return t(n("csrf-param"))||n("csrf-token")}get contentType(){return this.options.contentType?this.options.contentType:this.body==null||this.body instanceof window.FormData?void 0:this.body instanceof window.File?this.body.type:"application/json"}get accept(){switch(this.responseKind){case"html":return"text/html, application/xhtml+xml";case"turbo-stream":return"text/vnd.turbo-stream.html, text/html, application/xhtml+xml";case"json":return"application/json, application/vnd.api+json";case"script":return"text/javascript, application/javascript";default:return"*/*"}}get body(){return this.options.body}get query(){const t=(this.originalUrl.split("?")[1]||"").split("#")[0];const e=new URLSearchParams(t);let n=this.options.query;n=n instanceof window.FormData?s(n):n instanceof window.URLSearchParams?n.entries():Object.entries(n||{});r(e,n);const o=e.toString();return o.length>0?`?${o}`:""}get url(){return this.originalUrl.split("?")[0].split("#")[0]+this.query}get responseKind(){return this.options.responseKind||"html"}get signal(){return this.options.signal}get redirect(){return this.options.redirect||"follow"}get credentials(){return this.options.credentials||"same-origin"}get keepalive(){return this.options.keepalive||false}get additionalHeaders(){return this.options.headers||{}}get formattedBody(){const t=Object.prototype.toString.call(this.body)==="[object String]";const e=this.headers["Content-Type"]==="application/json";return e&&!t?JSON.stringify(this.body):this.body}}async function o(t,e){const n=new FetchRequest("get",t,e);return n.perform()}async function i(t,e){const n=new FetchRequest("post",t,e);return n.perform()}async function c(t,e){const n=new FetchRequest("put",t,e);return n.perform()}async function a(t,e){const n=new FetchRequest("patch",t,e);return n.perform()}async function h(t,e){const n=new FetchRequest("delete",t,e);return n.perform()}export{FetchRequest,FetchResponse,RequestInterceptor,h as destroy,o as get,a as patch,i as post,c as put};
diff --git a/vendor/javascript/trix.js b/vendor/javascript/trix.js
index 8499691..b40de45 100644
--- a/vendor/javascript/trix.js
+++ b/vendor/javascript/trix.js
@@ -1,5 +1,5 @@
-// trix@2.1.13 downloaded from https://ga.jspm.io/npm:trix@2.1.13/dist/trix.esm.min.js
+// trix@2.1.14 downloaded from https://ga.jspm.io/npm:trix@2.1.14/dist/trix.esm.min.js
-var o="2.1.13";const s="[data-trix-attachment]",a={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},l={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,htmlAttributes:["language"],text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(o){return r(o.parentNode)===l[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(o){return r(o.parentNode)===l[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},r=o=>{var s;return null==o||null===(s=o.tagName)||void 0===s?void 0:s.toLowerCase()},c=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),h=c&&parseInt(c[1]);var d={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:h&&h>12,samsungAndroid:h&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:"undefined"!=typeof InputEvent&&["data","getTargetRanges","inputType"].every((o=>o in InputEvent.prototype))},g={ADD_ATTR:["language"],SAFE_FOR_XML:!1,RETURN_DOM:!0},p={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption…",code:"Code",heading1:"Heading",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",url:"URL",urlPlaceholder:"Enter a URL…",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"};const f=[p.bytes,p.KB,p.MB,p.GB,p.TB,p.PB];var w={prefix:"IEC",precision:2,formatter(o){switch(o){case 0:return"0 ".concat(p.bytes);case 1:return"1 ".concat(p.byte);default:let s;"SI"===this.prefix?s=1e3:"IEC"===this.prefix&&(s=1024);const a=Math.floor(Math.log(o)/Math.log(s)),l=(o/Math.pow(s,a)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(l," ").concat(f[a])}}};const _="\ufeff",j=" ",m=function(o){for(const s in o){const a=o[s];this[s]=a}return this},W=document.documentElement,U=W.matches,b=function(o){let{onElement:s,matchingSelector:a,withCallback:l,inPhase:c,preventDefault:h,times:d}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const g=s||W,p=a,f="capturing"===c,u=function(o){null!=d&&0==--d&&u.destroy();const s=y(o.target,{matchingSelector:p});null!=s&&(null==l||l.call(s,o,s),h&&o.preventDefault())};return u.destroy=()=>g.removeEventListener(o,u,f),g.addEventListener(o,u,f),u},v=function(o){let{onElement:s,bubbles:a,cancelable:l,attributes:c}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const h=null!=s?s:W;a=!1!==a,l=!1!==l;const d=document.createEvent("Events");return d.initEvent(o,a,l),null!=c&&m.call(d,c),h.dispatchEvent(d)},A=function(o,s){if(1===(null==o?void 0:o.nodeType))return U.call(o,s)},y=function(o){let{matchingSelector:s,untilNode:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};for(;o&&o.nodeType!==Node.ELEMENT_NODE;)o=o.parentNode;if(null!=o){if(null==s)return o;if(o.closest&&null==a)return o.closest(s);for(;o&&o!==a;){if(A(o,s))return o;o=o.parentNode}}},x=o=>document.activeElement!==o&&C(o,document.activeElement),C=function(o,s){if(o&&s)for(;s;){if(s===o)return!0;s=s.parentNode}},E=function(o){var s;if(null===(s=o)||void 0===s||!s.parentNode)return;let a=0;for(o=o.previousSibling;o;)a++,o=o.previousSibling;return a},S=o=>{var s;return null==o||null===(s=o.parentNode)||void 0===s?void 0:s.removeChild(o)},R=function(o){let{onlyNodesOfType:s,usingFilter:a,expandEntityReferences:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const c=(()=>{switch(s){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}})();return document.createTreeWalker(o,c,null!=a?a:null,!0===l)},k=o=>{var s;return null==o||null===(s=o.tagName)||void 0===s?void 0:s.toLowerCase()},T=function(o){let s,a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"object"==typeof o?(l=o,o=l.tagName):l={attributes:l};const c=document.createElement(o);if(null!=l.editable&&(null==l.attributes&&(l.attributes={}),l.attributes.contenteditable=l.editable),l.attributes)for(s in l.attributes)a=l.attributes[s],c.setAttribute(s,a);if(l.style)for(s in l.style)a=l.style[s],c.style[s]=a;if(l.data)for(s in l.data)a=l.data[s],c.dataset[s]=a;return l.className&&l.className.split(" ").forEach((o=>{c.classList.add(o)})),l.textContent&&(c.textContent=l.textContent),l.childNodes&&[].concat(l.childNodes).forEach((o=>{c.appendChild(o)})),c};let V;const L=function(){if(null!=V)return V;V=[];for(const o in l){const s=l[o];s.tagName&&V.push(s.tagName)}return V},D=o=>I(null==o?void 0:o.firstChild),N=function(o){let{strict:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{strict:!0};return s?I(o):I(o)||!I(o.firstChild)&&function(o){return L().includes(k(o))&&!L().includes(k(o.firstChild))}(o)},I=o=>O(o)&&"block"===(null==o?void 0:o.data),O=o=>(null==o?void 0:o.nodeType)===Node.COMMENT_NODE,F=function(o){let{name:s}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(o)return B(o)?o.data===_?!s||o.parentNode.dataset.trixCursorTarget===s:void 0:F(o.firstChild)},P=o=>A(o,s),M=o=>B(o)&&""===(null==o?void 0:o.data),B=o=>(null==o?void 0:o.nodeType)===Node.TEXT_NODE,z={level2Enabled:!0,getLevel(){return this.level2Enabled&&d.supportsInputEvents?2:0},pickFiles(o){const s=T("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});s.addEventListener("change",(()=>{o(s.files),S(s)})),S(document.getElementById(this.fileInputId)),document.body.appendChild(s),s.click()}};var K={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:"\n"},J={bold:{tagName:"strong",inheritable:!0,parser(o){const s=window.getComputedStyle(o);return"bold"===s.fontWeight||s.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:o=>"italic"===window.getComputedStyle(o).fontStyle},href:{groupTagName:"a",parser(o){const a="a:not(".concat(s,")"),l=o.closest(a);if(l)return l.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},G={getDefaultHTML:()=>'
\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n \n\n \n \n \n\n \n\n \n \n \n \n
\n\n
')};const Y={interval:5e3};var $=Object.freeze({__proto__:null,attachments:a,blockAttributes:l,browser:d,css:{attachment:"attachment",attachmentCaption:"attachment__caption",attachmentCaptionEditor:"attachment__caption-editor",attachmentMetadata:"attachment__metadata",attachmentMetadataContainer:"attachment__metadata-container",attachmentName:"attachment__name",attachmentProgress:"attachment__progress",attachmentSize:"attachment__size",attachmentToolbar:"attachment__toolbar",attachmentGallery:"attachment-gallery"},dompurify:g,fileSize:w,input:z,keyNames:{8:"backspace",9:"tab",13:"return",27:"escape",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},lang:p,parser:K,textAttributes:J,toolbar:G,undo:Y});class q{static proxyMethod(o){const{name:s,toMethod:a,toProperty:l,optional:c}=H(o);this.prototype[s]=function(){let o,h;var d,g;a?h=c?null===(d=this[a])||void 0===d?void 0:d.call(this):this[a]():l&&(h=this[l]);return c?(o=null===(g=h)||void 0===g?void 0:g[s],o?Q.call(o,h,arguments):void 0):(o=h[s],Q.call(o,h,arguments))}}}const H=function(o){const s=o.match(Z);if(!s)throw new Error("can't parse @proxyMethod expression: ".concat(o));const a={name:s[4]};return null!=s[2]?a.toMethod=s[1]:a.toProperty=s[1],null!=s[3]&&(a.optional=!0),a},{apply:Q}=Function.prototype,Z=new RegExp("^(.+?)(\\(\\))?(\\?)?\\.(.+?)$");var tt,et,it;class X extends q{static box(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return o instanceof this?o:this.fromUCS2String(null==o?void 0:o.toString())}static fromUCS2String(o){return new this(o,ct(o))}static fromCodepoints(o){return new this(ut(o),o)}constructor(o,s){super(...arguments),this.ucs2String=o,this.codepoints=s,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}offsetToUCS2Offset(o){return ut(this.codepoints.slice(0,Math.max(0,o))).length}offsetFromUCS2Offset(o){return ct(this.ucs2String.slice(0,Math.max(0,o))).length}slice(){return this.constructor.fromCodepoints(this.codepoints.slice(...arguments))}charAt(o){return this.slice(o,o+1)}isEqualTo(o){return this.constructor.box(o).ucs2String===this.ucs2String}toJSON(){return this.ucs2String}getCacheKey(){return this.ucs2String}toString(){return this.ucs2String}}const nt=1===(null===(tt=Array.from)||void 0===tt?void 0:tt.call(Array,"👼").length),at=null!=(null===(et=" ".codePointAt)||void 0===et?void 0:et.call(" ",0)),lt=" 👼"===(null===(it=String.fromCodePoint)||void 0===it?void 0:it.call(String,32,128124));let ct,ut;ct=nt&&at?o=>Array.from(o).map((o=>o.codePointAt(0))):function(o){const s=[];let a=0;const{length:l}=o;for(;a
String.fromCodePoint(...Array.from(o||[])):function(o){return(()=>{const s=[];return Array.from(o).forEach((o=>{let a="";o>65535&&(o-=65536,a+=String.fromCharCode(o>>>10&1023|55296),o=56320|1023&o),s.push(a+String.fromCharCode(o))})),s})().join("")};let ht=0;class rt extends q{static fromJSONString(o){return this.fromJSON(JSON.parse(o))}constructor(){super(...arguments),this.id=++ht}hasSameConstructorAs(o){return this.constructor===(null==o?void 0:o.constructor)}isEqualTo(o){return this===o}inspect(){const o=[],s=this.contentsForInspection()||{};for(const a in s){const l=s[a];o.push("".concat(a,"=").concat(l))}return"#<".concat(this.constructor.name,":").concat(this.id).concat(o.length?" ".concat(o.join(", ")):"",">")}contentsForInspection(){}toJSONString(){return JSON.stringify(this)}toUTF16String(){return X.box(this)}getCacheKey(){return this.id.toString()}}const ot=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(o.length!==s.length)return!1;for(let a=0;a1?a-1:0),c=1;c(St||(St=bt().concat(pt())),St),mt=o=>l[o],pt=()=>(re||(re=Object.keys(l)),re),ft=o=>J[o],bt=()=>(oe||(oe=Object.keys(J)),oe),vt=function(o,s){At(o).textContent=s.replace(/%t/g,o)},At=function(o){const s=document.createElement("style");s.setAttribute("type","text/css"),s.setAttribute("data-tag-name",o.toLowerCase());const a=yt();return a&&s.setAttribute("nonce",a),document.head.insertBefore(s,document.head.firstChild),s},yt=function(){const o=xt("trix-csp-nonce")||xt("csp-nonce");if(o){const{nonce:s,content:a}=o;return""==s?a:s}},xt=o=>document.head.querySelector("meta[name=".concat(o,"]")),ae={"application/x-trix-feature-detection":"test"},Et=function(o){const s=o.getData("text/plain"),a=o.getData("text/html");if(!s||!a)return null==s?void 0:s.length;{const{body:o}=(new DOMParser).parseFromString(a,"text/html");if(o.textContent===s)return!o.querySelector("*")}},le=/Mac|^iP/.test(navigator.platform)?o=>o.metaKey:o=>o.ctrlKey;const Rt=o=>setTimeout(o,1),kt=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const s={};for(const a in o){const l=o[a];s[a]=l}return s},Tt=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Object.keys(o).length!==Object.keys(s).length)return!1;for(const a in o)if(o[a]!==s[a])return!1;return!0},wt=function(o){if(null!=o)return Array.isArray(o)||(o=[o,o]),[Nt(o[0]),Nt(null!=o[1]?o[1]:o[0])]},Lt=function(o){if(null==o)return;const[s,a]=wt(o);return It(s,a)},Dt=function(o,s){if(null==o||null==s)return;const[a,l]=wt(o),[c,h]=wt(s);return It(a,c)&&It(l,h)},Nt=function(o){return"number"==typeof o?o:kt(o)},It=function(o,s){return"number"==typeof o?o===s:Tt(o,s)};class Ot extends q{constructor(){super(...arguments),this.update=this.update.bind(this),this.selectionManagers=[]}start(){this.started||(this.started=!0,document.addEventListener("selectionchange",this.update,!0))}stop(){if(this.started)return this.started=!1,document.removeEventListener("selectionchange",this.update,!0)}registerSelectionManager(o){if(!this.selectionManagers.includes(o))return this.selectionManagers.push(o),this.start()}unregisterSelectionManager(o){if(this.selectionManagers=this.selectionManagers.filter((s=>s!==o)),0===this.selectionManagers.length)return this.stop()}notifySelectionManagersOfSelectionChange(){return this.selectionManagers.map((o=>o.selectionDidChange()))}update(){this.notifySelectionManagersOfSelectionChange()}reset(){this.update()}}const ce=new Ot,Pt=function(){const o=window.getSelection();if(o.rangeCount>0)return o},Mt=function(){var o;const s=null===(o=Pt())||void 0===o?void 0:o.getRangeAt(0);if(s&&!_t(s))return s},Bt=function(o){const s=window.getSelection();return s.removeAllRanges(),s.addRange(o),ce.update()},_t=o=>jt(o.startContainer)||jt(o.endContainer),jt=o=>!Object.getPrototypeOf(o),Wt=o=>o.replace(new RegExp("".concat(_),"g"),"").replace(new RegExp("".concat(j),"g")," "),ue=new RegExp("[^\\S".concat(j,"]")),Vt=o=>o.replace(new RegExp("".concat(ue.source),"g")," ").replace(/\ {2,}/g," "),zt=function(o,s){if(o.isEqualTo(s))return["",""];const a=qt(o,s),{length:l}=a.utf16String;let c;if(l){const{offset:h}=a,d=o.codepoints.slice(0,h).concat(o.codepoints.slice(h+l));c=qt(s,X.fromCodepoints(d))}else c=qt(s,o);return[a.utf16String.toString(),c.utf16String.toString()]},qt=function(o,s){let a=0,l=o.length,c=s.length;for(;aa+1&&o.charAt(l-1).isEqualTo(s.charAt(c-1));)l--,c--;return{utf16String:o.slice(a,l),offset:a}};class Ht extends rt{static fromCommonAttributesOfObjects(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];if(!o.length)return new this;let s=Yt(o[0]),a=s.getKeys();return o.slice(1).forEach((o=>{a=s.getKeysCommonToHash(Yt(o)),s=s.slice(a)})),s}static box(o){return Yt(o)}constructor(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};super(...arguments),this.values=Gt(o)}add(o,s){return this.merge(Jt(o,s))}remove(o){return new Ht(Gt(this.values,o))}get(o){return this.values[o]}has(o){return o in this.values}merge(o){return new Ht(Kt(this.values,$t(o)))}slice(o){const s={};return Array.from(o).forEach((o=>{this.has(o)&&(s[o]=this.values[o])})),new Ht(s)}getKeys(){return Object.keys(this.values)}getKeysCommonToHash(o){return o=Yt(o),this.getKeys().filter((s=>this.values[s]===o.values[s]))}isEqualTo(o){return ot(this.toArray(),Yt(o).toArray())}isEmpty(){return 0===this.getKeys().length}toArray(){if(!this.array){const o=[];for(const s in this.values){const a=this.values[s];o.push(o.push(s,a))}this.array=o.slice(0)}return this.array}toObject(){return Gt(this.values)}toJSON(){return this.toObject()}contentsForInspection(){return{values:JSON.stringify(this.values)}}}const Jt=function(o,s){const a={};return a[o]=s,a},Kt=function(o,s){const a=Gt(o);for(const o in s){const l=s[o];a[o]=l}return a},Gt=function(o,s){const a={};return Object.keys(o).sort().forEach((l=>{l!==s&&(a[l]=o[l])})),a},Yt=function(o){return o instanceof Ht?o:new Ht(o)},$t=function(o){return o instanceof Ht?o.values:o};class Xt{static groupObjects(){let o,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{depth:a,asTree:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};l&&null==a&&(a=0);const c=[];return Array.from(s).forEach((s=>{var h;if(o){var d,g,p;if(null!==(d=s.canBeGrouped)&&void 0!==d&&d.call(s,a)&&null!==(g=(p=o[o.length-1]).canBeGroupedWith)&&void 0!==g&&g.call(p,s,a))return void o.push(s);c.push(new this(o,{depth:a,asTree:l})),o=null}null!==(h=s.canBeGrouped)&&void 0!==h&&h.call(s,a)?o=[s]:c.push(s)})),o&&c.push(new this(o,{depth:a,asTree:l})),c}constructor(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],{depth:s,asTree:a}=arguments.length>1?arguments[1]:void 0;this.objects=o,a&&(this.depth=s,this.objects=this.constructor.groupObjects(this.objects,{asTree:a,depth:this.depth+1}))}getObjects(){return this.objects}getDepth(){return this.depth}getCacheKey(){const o=["objectGroup"];return Array.from(this.getObjects()).forEach((s=>{o.push(s.getCacheKey())})),o.join("/")}}class Zt extends q{constructor(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];super(...arguments),this.objects={},Array.from(o).forEach((o=>{const s=JSON.stringify(o);null==this.objects[s]&&(this.objects[s]=o)}))}find(o){const s=JSON.stringify(o);return this.objects[s]}}class Qt{constructor(o){this.reset(o)}add(o){const s=te(o);this.elements[s]=o}remove(o){const s=te(o),a=this.elements[s];if(a)return delete this.elements[s],a}reset(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return this.elements={},Array.from(o).forEach((o=>{this.add(o)})),o}}const te=o=>o.dataset.trixStoreKey;class ee extends q{isPerforming(){return!0===this.performing}hasPerformed(){return!0===this.performed}hasSucceeded(){return this.performed&&this.succeeded}hasFailed(){return this.performed&&!this.succeeded}getPromise(){return this.promise||(this.promise=new Promise(((o,s)=>(this.performing=!0,this.perform(((a,l)=>{this.succeeded=a,this.performing=!1,this.performed=!0,this.succeeded?o(l):s(l)})))))),this.promise}perform(o){return o(!1)}release(){var o,s;null===(o=this.promise)||void 0===o||null===(s=o.cancel)||void 0===s||s.call(o),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null}}ee.proxyMethod("getPromise().then"),ee.proxyMethod("getPromise().catch");class ie extends q{constructor(o){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(...arguments),this.object=o,this.options=s,this.childViews=[],this.rootView=this}getNodes(){return this.nodes||(this.nodes=this.createNodes()),this.nodes.map((o=>o.cloneNode(!0)))}invalidate(){var o;return this.nodes=null,this.childViews=[],null===(o=this.parentView)||void 0===o?void 0:o.invalidate()}invalidateViewForObject(o){var s;return null===(s=this.findViewForObject(o))||void 0===s?void 0:s.invalidate()}findOrCreateCachedChildView(o,s,a){let l=this.getCachedViewForObject(s);return l?this.recordChildView(l):(l=this.createChildView(...arguments),this.cacheViewForObject(l,s)),l}createChildView(o,s){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};s instanceof Xt&&(a.viewClass=o,o=ne);const l=new o(s,a);return this.recordChildView(l)}recordChildView(o){return o.parentView=this,o.rootView=this.rootView,this.childViews.push(o),o}getAllChildViews(){let o=[];return this.childViews.forEach((s=>{o.push(s),o=o.concat(s.getAllChildViews())})),o}findElement(){return this.findElementForObject(this.object)}findElementForObject(o){const s=null==o?void 0:o.id;if(s)return this.rootView.element.querySelector("[data-trix-id='".concat(s,"']"))}findViewForObject(o){for(const s of this.getAllChildViews())if(s.object===o)return s}getViewCache(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?(this.viewCache||(this.viewCache={}),this.viewCache):void 0}isViewCachingEnabled(){return!1!==this.shouldCacheViews}enableViewCaching(){this.shouldCacheViews=!0}disableViewCaching(){this.shouldCacheViews=!1}getCachedViewForObject(o){var s;return null===(s=this.getViewCache())||void 0===s?void 0:s[o.getCacheKey()]}cacheViewForObject(o,s){const a=this.getViewCache();a&&(a[s.getCacheKey()]=o)}garbageCollectCachedViews(){const o=this.getViewCache();if(o){const s=this.getAllChildViews().concat(this).map((o=>o.object.getCacheKey()));for(const a in o)s.includes(a)||delete o[a]}}}class ne extends ie{constructor(){super(...arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}getChildViews(){return this.childViews.length||Array.from(this.objectGroup.getObjects()).forEach((o=>{this.findOrCreateCachedChildView(this.viewClass,o,this.options)})),this.childViews}createNodes(){const o=this.createContainerElement();return this.getChildViews().forEach((s=>{Array.from(s.getNodes()).forEach((s=>{o.appendChild(s)}))})),[o]}createContainerElement(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.objectGroup.getDepth();return this.getChildViews()[0].createContainerElement(o)}}
-/*! @license DOMPurify 3.2.3 | (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.3/LICENSE */const{entries:he,setPrototypeOf:de,isFrozen:ge,getPrototypeOf:me,getOwnPropertyDescriptor:pe}=Object;let{freeze:fe,seal:be,create:ve}=Object,{apply:Ae,construct:ye}="undefined"!=typeof Reflect&&Reflect;fe||(fe=function(o){return o}),be||(be=function(o){return o}),Ae||(Ae=function(o,s,a){return o.apply(s,a)}),ye||(ye=function(o,s){return new o(...s)});const xe=Te(Array.prototype.forEach),Ce=Te(Array.prototype.pop),Ee=Te(Array.prototype.push),Se=Te(String.prototype.toLowerCase),ke=Te(String.prototype.toString),Re=Te(String.prototype.match),Ie=Te(String.prototype.replace),Oe=Te(String.prototype.indexOf),Pe=Te(String.prototype.trim),Fe=Te(Object.prototype.hasOwnProperty),Me=Te(RegExp.prototype.test),Be=(_e=TypeError,function(){for(var o=arguments.length,s=new Array(o),a=0;a1?a-1:0),c=1;c2&&void 0!==arguments[2]?arguments[2]:Se;de&&de(o,null);let l=s.length;for(;l--;){let c=s[l];if("string"==typeof c){const o=a(c);o!==c&&(ge(s)||(s[l]=o),c=o)}o[c]=!0}return o}function Le(o){for(let s=0;s/gm),Qe=be(/\$\{[\w\W]*}/gm),Ze=be(/^data-[\-\w.\u00B7-\uFFFF]+$/),ti=be(/^aria-[\-\w]+$/),ei=be(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ii=be(/^(?:\w+script|data):/i),ni=be(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),ri=be(/^html$/i),si=be(/^[a-z][.\w]*(-[.\w]+)+$/i);var ai=Object.freeze({__proto__:null,ARIA_ATTR:ti,ATTR_WHITESPACE:ni,CUSTOM_ELEMENT:si,DATA_ATTR:Ze,DOCTYPE_NAME:ri,ERB_EXPR:$e,IS_ALLOWED_URI:ei,IS_SCRIPT_OR_DATA:ii,MUSTACHE_EXPR:Ye,TMPLIT_EXPR:Qe});const li=1,ci=3,di=7,yi=8,Xi=9,oi=function(){return"undefined"==typeof window?null:window};var bn=function t(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:oi();const i=o=>t(o);if(i.version="3.2.3",i.removed=[],!o||!o.document||o.document.nodeType!==Xi)return i.isSupported=!1,i;let{document:s}=o;const a=s,l=a.currentScript,{DocumentFragment:c,HTMLTemplateElement:h,Node:d,Element:g,NodeFilter:p,NamedNodeMap:f=o.NamedNodeMap||o.MozNamedAttrMap,HTMLFormElement:w,DOMParser:_,trustedTypes:j}=o,W=g.prototype,U=Ne(W,"cloneNode"),V=Ne(W,"remove"),z=Ne(W,"nextSibling"),K=Ne(W,"childNodes"),J=Ne(W,"parentNode");if("function"==typeof h){const o=s.createElement("template");o.content&&o.content.ownerDocument&&(s=o.content.ownerDocument)}let G,Y="";const{implementation:$,createNodeIterator:Q,createDocumentFragment:Z,getElementsByTagName:tt}=s,{importNode:et}=a;let it={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};i.isSupported="function"==typeof he&&"function"==typeof J&&$&&void 0!==$.createHTMLDocument;const{MUSTACHE_EXPR:nt,ERB_EXPR:at,TMPLIT_EXPR:lt,DATA_ATTR:ct,ARIA_ATTR:ut,IS_SCRIPT_OR_DATA:ht,ATTR_WHITESPACE:dt,CUSTOM_ELEMENT:Ct}=ai;let{IS_ALLOWED_URI:St}=ai,re=null;const oe=we({},[...je,...We,...Ue,...Ve,...ze]);let se=null;const ae=we({},[...Ke,...Je,...Ge,...Xe]);let le=Object.seal(ve(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),ce=null,ue=null,de=!0,ge=!0,me=!1,pe=!0,be=!1,Ae=!0,ye=!1,_e=!1,Ye=!1,$e=!1,Qe=!1,Ze=!1,ti=!0,ii=!1,ni=!0,si=!1,bn={},vn=null;const An=we({},["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"]);let yn=null;const xn=we({},["audio","video","img","source","image","track"]);let Cn=null;const Ln=we({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),In="http://www.w3.org/1998/Math/MathML",Un="http://www.w3.org/2000/svg",qn="http://www.w3.org/1999/xhtml";let Vn=qn,Hn=!1,zn=null;const Xn=we({},[In,Un,qn],ke);let $n=we({},["mi","mo","mn","ms","mtext"]),Zn=we({},["annotation-xml"]);const rr=we({},["title","style","font","a","script"]);let ar=null;const lr=["application/xhtml+xml","text/html"];let cr=null,ur=null;const gr=s.createElement("form"),Lt=function(o){return o instanceof RegExp||o instanceof Function},Dt=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ur||ur!==o){if(o&&"object"==typeof o||(o={}),o=De(o),ar=-1===lr.indexOf(o.PARSER_MEDIA_TYPE)?"text/html":o.PARSER_MEDIA_TYPE,cr="application/xhtml+xml"===ar?ke:Se,re=Fe(o,"ALLOWED_TAGS")?we({},o.ALLOWED_TAGS,cr):oe,se=Fe(o,"ALLOWED_ATTR")?we({},o.ALLOWED_ATTR,cr):ae,zn=Fe(o,"ALLOWED_NAMESPACES")?we({},o.ALLOWED_NAMESPACES,ke):Xn,Cn=Fe(o,"ADD_URI_SAFE_ATTR")?we(De(Ln),o.ADD_URI_SAFE_ATTR,cr):Ln,yn=Fe(o,"ADD_DATA_URI_TAGS")?we(De(xn),o.ADD_DATA_URI_TAGS,cr):xn,vn=Fe(o,"FORBID_CONTENTS")?we({},o.FORBID_CONTENTS,cr):An,ce=Fe(o,"FORBID_TAGS")?we({},o.FORBID_TAGS,cr):{},ue=Fe(o,"FORBID_ATTR")?we({},o.FORBID_ATTR,cr):{},bn=!!Fe(o,"USE_PROFILES")&&o.USE_PROFILES,de=!1!==o.ALLOW_ARIA_ATTR,ge=!1!==o.ALLOW_DATA_ATTR,me=o.ALLOW_UNKNOWN_PROTOCOLS||!1,pe=!1!==o.ALLOW_SELF_CLOSE_IN_ATTR,be=o.SAFE_FOR_TEMPLATES||!1,Ae=!1!==o.SAFE_FOR_XML,ye=o.WHOLE_DOCUMENT||!1,$e=o.RETURN_DOM||!1,Qe=o.RETURN_DOM_FRAGMENT||!1,Ze=o.RETURN_TRUSTED_TYPE||!1,Ye=o.FORCE_BODY||!1,ti=!1!==o.SANITIZE_DOM,ii=o.SANITIZE_NAMED_PROPS||!1,ni=!1!==o.KEEP_CONTENT,si=o.IN_PLACE||!1,St=o.ALLOWED_URI_REGEXP||ei,Vn=o.NAMESPACE||qn,$n=o.MATHML_TEXT_INTEGRATION_POINTS||$n,Zn=o.HTML_INTEGRATION_POINTS||Zn,le=o.CUSTOM_ELEMENT_HANDLING||{},o.CUSTOM_ELEMENT_HANDLING&&Lt(o.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(le.tagNameCheck=o.CUSTOM_ELEMENT_HANDLING.tagNameCheck),o.CUSTOM_ELEMENT_HANDLING&&Lt(o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(le.attributeNameCheck=o.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),o.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(le.allowCustomizedBuiltInElements=o.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),be&&(ge=!1),Qe&&($e=!0),bn&&(re=we({},ze),se=[],!0===bn.html&&(we(re,je),we(se,Ke)),!0===bn.svg&&(we(re,We),we(se,Je),we(se,Xe)),!0===bn.svgFilters&&(we(re,Ue),we(se,Je),we(se,Xe)),!0===bn.mathMl&&(we(re,Ve),we(se,Ge),we(se,Xe))),o.ADD_TAGS&&(re===oe&&(re=De(re)),we(re,o.ADD_TAGS,cr)),o.ADD_ATTR&&(se===ae&&(se=De(se)),we(se,o.ADD_ATTR,cr)),o.ADD_URI_SAFE_ATTR&&we(Cn,o.ADD_URI_SAFE_ATTR,cr),o.FORBID_CONTENTS&&(vn===An&&(vn=De(vn)),we(vn,o.FORBID_CONTENTS,cr)),ni&&(re["#text"]=!0),ye&&we(re,["html","head","body"]),re.table&&(we(re,["tbody"]),delete ce.tbody),o.TRUSTED_TYPES_POLICY){if("function"!=typeof o.TRUSTED_TYPES_POLICY.createHTML)throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof o.TRUSTED_TYPES_POLICY.createScriptURL)throw Be('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');G=o.TRUSTED_TYPES_POLICY,Y=G.createHTML("")}else void 0===G&&(G=function(o,s){if("object"!=typeof o||"function"!=typeof o.createPolicy)return null;let a=null;const l="data-tt-policy-suffix";s&&s.hasAttribute(l)&&(a=s.getAttribute(l));const c="dompurify"+(a?"#"+a:"");try{return o.createPolicy(c,{createHTML:o=>o,createScriptURL:o=>o})}catch(o){return console.warn("TrustedTypes policy "+c+" could not be created."),null}}(j,l)),null!==G&&"string"==typeof Y&&(Y=G.createHTML(""));fe&&fe(o),ur=o}},wr=we({},[...We,...Ue,...qe]),kr=we({},[...Ve,...He]),Ot=function(o){Ee(i.removed,{element:o});try{J(o).removeChild(o)}catch(s){V(o)}},Ft=function(o,s){try{Ee(i.removed,{attribute:s.getAttributeNode(o),from:s})}catch(o){Ee(i.removed,{attribute:null,from:s})}if(s.removeAttribute(o),"is"===o)if($e||Qe)try{Ot(s)}catch(o){}else try{s.setAttribute(o,"")}catch(o){}},Pt=function(o){let a=null,l=null;if(Ye)o=""+o;else{const s=Re(o,/^[\r\n\t ]+/);l=s&&s[0]}"application/xhtml+xml"===ar&&Vn===qn&&(o=''+o+"");const c=G?G.createHTML(o):o;if(Vn===qn)try{a=(new _).parseFromString(c,ar)}catch(o){}if(!a||!a.documentElement){a=$.createDocument(Vn,"template",null);try{a.documentElement.innerHTML=Hn?Y:c}catch(o){}}const h=a.body||a.documentElement;return o&&l&&h.insertBefore(s.createTextNode(l),h.childNodes[0]||null),Vn===qn?tt.call(a,ye?"html":"body")[0]:ye?a.documentElement:h},Mt=function(o){return Q.call(o.ownerDocument||o,o,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Bt=function(o){return o instanceof w&&("string"!=typeof o.nodeName||"string"!=typeof o.textContent||"function"!=typeof o.removeChild||!(o.attributes instanceof f)||"function"!=typeof o.removeAttribute||"function"!=typeof o.setAttribute||"string"!=typeof o.namespaceURI||"function"!=typeof o.insertBefore||"function"!=typeof o.hasChildNodes)},_t=function(o){return"function"==typeof d&&o instanceof d};function jt(o,s,a){xe(o,(o=>{o.call(i,s,a,ur)}))}const Wt=function(o){let s=null;if(jt(it.beforeSanitizeElements,o,null),Bt(o))return Ot(o),!0;const a=cr(o.nodeName);if(jt(it.uponSanitizeElement,o,{tagName:a,allowedTags:re}),o.hasChildNodes()&&!_t(o.firstElementChild)&&Me(/<[/\w]/g,o.innerHTML)&&Me(/<[/\w]/g,o.textContent))return Ot(o),!0;if(o.nodeType===di)return Ot(o),!0;if(Ae&&o.nodeType===yi&&Me(/<[/\w]/g,o.data))return Ot(o),!0;if(!re[a]||ce[a]){if(!ce[a]&&Vt(a)){if(le.tagNameCheck instanceof RegExp&&Me(le.tagNameCheck,a))return!1;if(le.tagNameCheck instanceof Function&&le.tagNameCheck(a))return!1}if(ni&&!vn[a]){const s=J(o)||o.parentNode,a=K(o)||o.childNodes;if(a&&s)for(let l=a.length-1;l>=0;--l){const c=U(a[l],!0);c.__removalCount=(o.__removalCount||0)+1,s.insertBefore(c,z(o))}}return Ot(o),!0}return o instanceof g&&!function(o){let s=J(o);s&&s.tagName||(s={namespaceURI:Vn,tagName:"template"});const a=Se(o.tagName),l=Se(s.tagName);return!!zn[o.namespaceURI]&&(o.namespaceURI===Un?s.namespaceURI===qn?"svg"===a:s.namespaceURI===In?"svg"===a&&("annotation-xml"===l||$n[l]):Boolean(wr[a]):o.namespaceURI===In?s.namespaceURI===qn?"math"===a:s.namespaceURI===Un?"math"===a&&Zn[l]:Boolean(kr[a]):o.namespaceURI===qn?!(s.namespaceURI===Un&&!Zn[l])&&!(s.namespaceURI===In&&!$n[l])&&!kr[a]&&(rr[a]||!wr[a]):!("application/xhtml+xml"!==ar||!zn[o.namespaceURI]))}(o)?(Ot(o),!0):"noscript"!==a&&"noembed"!==a&&"noframes"!==a||!Me(/<\/no(script|embed|frames)/i,o.innerHTML)?(be&&o.nodeType===ci&&(s=o.textContent,xe([nt,at,lt],(o=>{s=Ie(s,o," ")})),o.textContent!==s&&(Ee(i.removed,{element:o.cloneNode()}),o.textContent=s)),jt(it.afterSanitizeElements,o,null),!1):(Ot(o),!0)},Ut=function(o,a,l){if(ti&&("id"===a||"name"===a)&&(l in s||l in gr))return!1;if(ge&&!ue[a]&&Me(ct,a));else if(de&&Me(ut,a));else if(!se[a]||ue[a]){if(!(Vt(o)&&(le.tagNameCheck instanceof RegExp&&Me(le.tagNameCheck,o)||le.tagNameCheck instanceof Function&&le.tagNameCheck(o))&&(le.attributeNameCheck instanceof RegExp&&Me(le.attributeNameCheck,a)||le.attributeNameCheck instanceof Function&&le.attributeNameCheck(a))||"is"===a&&le.allowCustomizedBuiltInElements&&(le.tagNameCheck instanceof RegExp&&Me(le.tagNameCheck,l)||le.tagNameCheck instanceof Function&&le.tagNameCheck(l))))return!1}else if(Cn[a]);else if(Me(St,Ie(l,dt,"")));else if("src"!==a&&"xlink:href"!==a&&"href"!==a||"script"===o||0!==Oe(l,"data:")||!yn[o])if(me&&!Me(ht,Ie(l,dt,"")));else if(l)return!1;return!0},Vt=function(o){return"annotation-xml"!==o&&Re(o,Ct)},zt=function(o){jt(it.beforeSanitizeAttributes,o,null);const{attributes:s}=o;if(!s||Bt(o))return;const a={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:se,forceKeepAttr:void 0};let l=s.length;for(;l--;){const c=s[l],{name:h,namespaceURI:d,value:g}=c,p=cr(h);let f="value"===h?g:Pe(g);if(a.attrName=p,a.attrValue=f,a.keepAttr=!0,a.forceKeepAttr=void 0,jt(it.uponSanitizeAttribute,o,a),f=a.attrValue,!ii||"id"!==p&&"name"!==p||(Ft(h,o),f="user-content-"+f),Ae&&Me(/((--!?|])>)|<\/(style|title)/i,f)){Ft(h,o);continue}if(a.forceKeepAttr)continue;if(Ft(h,o),!a.keepAttr)continue;if(!pe&&Me(/\/>/i,f)){Ft(h,o);continue}be&&xe([nt,at,lt],(o=>{f=Ie(f,o," ")}));const w=cr(o.nodeName);if(Ut(w,p,f)){if(G&&"object"==typeof j&&"function"==typeof j.getAttributeType)if(d);else switch(j.getAttributeType(w,p)){case"TrustedHTML":f=G.createHTML(f);break;case"TrustedScriptURL":f=G.createScriptURL(f)}try{d?o.setAttributeNS(d,h,f):o.setAttribute(h,f),Bt(o)?Ot(o):Ce(i.removed)}catch(o){}}}jt(it.afterSanitizeAttributes,o,null)},Rr=function t(o){let s=null;const a=Mt(o);for(jt(it.beforeSanitizeShadowDOM,o,null);s=a.nextNode();)jt(it.uponSanitizeShadowNode,s,null),Wt(s),zt(s),s.content instanceof c&&t(s.content);jt(it.afterSanitizeShadowDOM,o,null)};return i.sanitize=function(o){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=null,h=null,g=null,p=null;if(Hn=!o,Hn&&(o="\x3c!--\x3e"),"string"!=typeof o&&!_t(o)){if("function"!=typeof o.toString)throw Be("toString is not a function");if("string"!=typeof(o=o.toString()))throw Be("dirty is not a string, aborting")}if(!i.isSupported)return o;if(_e||Dt(s),i.removed=[],"string"==typeof o&&(si=!1),si){if(o.nodeName){const s=cr(o.nodeName);if(!re[s]||ce[s])throw Be("root node is forbidden and cannot be sanitized in-place")}}else if(o instanceof d)l=Pt("\x3c!----\x3e"),h=l.ownerDocument.importNode(o,!0),h.nodeType===li&&"BODY"===h.nodeName||"HTML"===h.nodeName?l=h:l.appendChild(h);else{if(!$e&&!be&&!ye&&-1===o.indexOf("<"))return G&&Ze?G.createHTML(o):o;if(l=Pt(o),!l)return $e?null:Ze?Y:""}l&&Ye&&Ot(l.firstChild);const f=Mt(si?o:l);for(;g=f.nextNode();)Wt(g),zt(g),g.content instanceof c&&Rr(g.content);if(si)return o;if($e){if(Qe)for(p=Z.call(l.ownerDocument);l.firstChild;)p.appendChild(l.firstChild);else p=l;return(se.shadowroot||se.shadowrootmode)&&(p=et.call(a,p,!0)),p}let w=ye?l.outerHTML:l.innerHTML;return ye&&re["!doctype"]&&l.ownerDocument&&l.ownerDocument.doctype&&l.ownerDocument.doctype.name&&Me(ri,l.ownerDocument.doctype.name)&&(w="\n"+w),be&&xe([nt,at,lt],(o=>{w=Ie(w,o," ")})),G&&Ze?G.createHTML(w):w},i.setConfig=function(){Dt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),_e=!0},i.clearConfig=function(){ur=null,_e=!1},i.isValidAttribute=function(o,s,a){ur||Dt({});const l=cr(o),c=cr(s);return Ut(l,c,a)},i.addHook=function(o,s){"function"==typeof s&&Ee(it[o],s)},i.removeHook=function(o){return Ce(it[o])},i.removeHooks=function(o){it[o]=[]},i.removeAllHooks=function(){it={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},i}();bn.addHook("uponSanitizeAttribute",(function(o,s){/^data-trix-/.test(s.attrName)&&(s.forceKeepAttr=!0)}));const vn="style href src width height language class".split(" "),An="javascript:".split(" "),yn="script iframe form noscript".split(" ");class ui extends q{static setHTML(o,s){const a=new this(s).sanitize(),l=a.getHTML?a.getHTML():a.outerHTML;o.innerHTML=l}static sanitize(o,s){const a=new this(o,s);return a.sanitize(),a}constructor(o){let{allowedAttributes:s,forbiddenProtocols:a,forbiddenElements:l}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(...arguments),this.allowedAttributes=s||vn,this.forbiddenProtocols=a||An,this.forbiddenElements=l||yn,this.body=hi(o)}sanitize(){return this.sanitizeElements(),this.normalizeListElementNesting(),bn.setConfig(g),this.body=bn.sanitize(this.body),this.body}getHTML(){return this.body.innerHTML}getBody(){return this.body}sanitizeElements(){const o=R(this.body),s=[];for(;o.nextNode();){const a=o.currentNode;switch(a.nodeType){case Node.ELEMENT_NODE:this.elementIsRemovable(a)?s.push(a):this.sanitizeElement(a);break;case Node.COMMENT_NODE:s.push(a)}}return s.forEach((o=>S(o))),this.body}sanitizeElement(o){return o.hasAttribute("href")&&this.forbiddenProtocols.includes(o.protocol)&&o.removeAttribute("href"),Array.from(o.attributes).forEach((s=>{let{name:a}=s;this.allowedAttributes.includes(a)||0===a.indexOf("data-trix")||o.removeAttribute(a)})),o}normalizeListElementNesting(){return Array.from(this.body.querySelectorAll("ul,ol")).forEach((o=>{const s=o.previousElementSibling;s&&"li"===k(s)&&s.appendChild(o)})),this.body}elementIsRemovable(o){if((null==o?void 0:o.nodeType)===Node.ELEMENT_NODE)return this.elementIsForbidden(o)||this.elementIsntSerializable(o)}elementIsForbidden(o){return this.forbiddenElements.includes(k(o))}elementIsntSerializable(o){return"false"===o.getAttribute("data-trix-serialize")&&!P(o)}}const hi=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";o=o.replace(/<\/html[^>]*>[^]*$/i,"