avo 3.3.6 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ea0ee99a95c3bccf615bec8959df9d6dcd29e5f704a584661ffe0d49038907c9
4
- data.tar.gz: e7016e82213d73bf21a753f0b63cc8a8a9899bed18dc0754fa4929dcd0b3f8ec
3
+ metadata.gz: e2f2695cfb685f5a34555838e1fe65cc1a8fa85679627d571dae14b90529ec2f
4
+ data.tar.gz: fe17eb8d0a73456319536a25c43108f740319a2fe85de19d71ef94a2170ad4ae
5
5
  SHA512:
6
- metadata.gz: 1a888a339386f6a38ee72589a4928d60821b01d6333e91dd6c8ce024497fe7a80bad05be76a4a92633e8f7aca11a615766c99da53b5522d00c3d7788779c36fa
7
- data.tar.gz: ad157229e63ec12180b164cc43cea0e7e20dd58705d21eced9c83c7f5e544b835bc4423e1c8f499fc65b04f5d7bc81be5e74c651efe47dfa441fc44723619e6b
6
+ metadata.gz: c93d8a94da71b99ed84e2fc0d6c92c23f2e9aa131e7f03dae0e466c4c51e24412de258b4871b3413d62299d162d947b9b6a4082316dd936e709d83168cb5a424
7
+ data.tar.gz: bd267c097f51d204cdd45483660064cdc2ec97d5e536e8f8df45df49595e116c99f6fe6780f81c4fbb06689d3171251bc7385ddf4b22af57d1d49dffb5625fca
data/Gemfile CHANGED
@@ -79,12 +79,10 @@ end
79
79
 
80
80
  group :test do
81
81
  gem "rspec-rails", "~> 6.0", ">= 6.0.3"
82
+ gem "rspec-retry", "~> 0.6.2"
82
83
  gem "rails-controller-testing"
83
- # Adds support for Capybara system testing and selenium driver
84
84
  gem "capybara"
85
- gem "selenium-webdriver"
86
- # Easy installation and use of web drivers to run system tests with browsers
87
- gem "webdrivers", ">= 5.3.0"
85
+ gem "cuprite"
88
86
  gem "fuubar"
89
87
  gem "simplecov", require: false
90
88
  gem "simplecov-cobertura"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- avo (3.3.6)
4
+ avo (3.4.0)
5
5
  actionview (>= 6.1)
6
6
  active_link_to
7
7
  activerecord (>= 6.1)
@@ -175,6 +175,9 @@ GEM
175
175
  crass (1.0.6)
176
176
  cssbundling-rails (1.4.0)
177
177
  railties (>= 6.0.0)
178
+ cuprite (0.15)
179
+ capybara (~> 3.0)
180
+ ferrum (~> 0.14.0)
178
181
  database_cleaner-active_record (2.1.0)
179
182
  activerecord (>= 5.a)
180
183
  database_cleaner-core (~> 2.0.0)
@@ -206,6 +209,11 @@ GEM
206
209
  railties (>= 5.0.0)
207
210
  faker (3.2.3)
208
211
  i18n (>= 1.8.11, < 2)
212
+ ferrum (0.14)
213
+ addressable (~> 2.5)
214
+ concurrent-ruby (~> 1.1)
215
+ webrick (~> 1.7)
216
+ websocket-driver (>= 0.6, < 0.8)
209
217
  ffi (1.16.3)
210
218
  friendly_id (5.5.1)
211
219
  activerecord (>= 4.0.0)
@@ -410,6 +418,8 @@ GEM
410
418
  rspec-expectations (~> 3.12)
411
419
  rspec-mocks (~> 3.12)
412
420
  rspec-support (~> 3.12)
421
+ rspec-retry (0.6.2)
422
+ rspec-core (> 3.3)
413
423
  rspec-support (3.13.0)
414
424
  rubocop (1.59.0)
415
425
  json (~> 2.3)
@@ -433,11 +443,6 @@ GEM
433
443
  ruby-vips (2.2.0)
434
444
  ffi (~> 1.12)
435
445
  ruby2_keywords (0.0.5)
436
- rubyzip (2.3.2)
437
- selenium-webdriver (4.10.0)
438
- rexml (~> 3.2, >= 3.2.5)
439
- rubyzip (>= 1.2.2, < 3.0)
440
- websocket (~> 1.0)
441
446
  simplecov (0.22.0)
442
447
  docile (~> 1.1)
443
448
  simplecov-html (~> 0.11)
@@ -498,7 +503,7 @@ GEM
498
503
  thor (1.3.0)
499
504
  tilt (2.3.0)
500
505
  timeout (0.4.1)
501
- turbo-rails (2.0.0)
506
+ turbo-rails (2.0.1)
502
507
  actionpack (>= 6.0.0)
503
508
  activejob (>= 6.0.0)
504
509
  railties (>= 6.0.0)
@@ -519,16 +524,11 @@ GEM
519
524
  activemodel (>= 6.0.0)
520
525
  bindex (>= 0.4.0)
521
526
  railties (>= 6.0.0)
522
- webdrivers (5.3.1)
523
- nokogiri (~> 1.6)
524
- rubyzip (>= 1.3.0)
525
- selenium-webdriver (~> 4.0, < 4.11)
526
- webmock (3.20.0)
527
+ webmock (3.19.1)
527
528
  addressable (>= 2.8.0)
528
529
  crack (>= 0.3.2)
529
530
  hashdiff (>= 0.4.0, < 2.0.0)
530
531
  webrick (1.8.1)
531
- websocket (1.2.10)
532
532
  websocket-driver (0.7.6)
533
533
  websocket-extensions (>= 0.1.0)
534
534
  websocket-extensions (0.1.5)
@@ -561,6 +561,7 @@ DEPENDENCIES
561
561
  chartkick
562
562
  countries
563
563
  cssbundling-rails
564
+ cuprite
564
565
  database_cleaner-active_record
565
566
  devise
566
567
  dotenv-rails
@@ -594,9 +595,9 @@ DEPENDENCIES
594
595
  redis (~> 5.0)
595
596
  ripper-tags
596
597
  rspec-rails (~> 6.0, >= 6.0.3)
598
+ rspec-retry (~> 0.6.2)
597
599
  rubocop
598
600
  rubocop-shopify
599
- selenium-webdriver
600
601
  simplecov
601
602
  simplecov-cobertura
602
603
  solargraph
@@ -608,7 +609,6 @@ DEPENDENCIES
608
609
  test-prof
609
610
  tzinfo-data
610
611
  web-console (>= 3.3.0)
611
- webdrivers (>= 5.3.0)
612
612
  webmock
613
613
  zeitwerk
614
614
 
@@ -91,14 +91,6 @@ module Avo
91
91
  "—"
92
92
  end
93
93
 
94
- def confirm_alert
95
- Capybara.using_wait_time(1) do
96
- page.driver.browser.switch_to.alert.accept
97
- rescue Selenium::WebDriver::Error::NoSuchAlertError
98
- retry
99
- end
100
- end
101
-
102
94
  # Example usage:
103
95
  # click_resource_search_input # opens the first search box on the given page
104
96
  # opens the search box for the "users" resource
@@ -135,14 +127,20 @@ module Avo
135
127
  # write_in_search("John Doe")
136
128
  # select_first_result_in_search
137
129
  def select_first_result_in_search
138
- find(".aa-Input").send_keys :arrow_down
139
- find(".aa-Input").send_keys :enter
130
+ type :down, :enter
140
131
  wait_for_search_loaded
141
132
  end
142
133
 
143
134
  # Save a record and wait for the page to load
135
+ # For most cases `.click` works
136
+ # Sometimes other element may be overlapping the button so the `.trigger("click")` solves the issue
137
+ # Trigger can't be used by default because it breaks on some feature specs
144
138
  def save
145
- click_on "Save"
139
+ button = find("button.button-component", text: "Save")
140
+ button.click
141
+ rescue Capybara::Cuprite::MouseEventFailed
142
+ button.trigger("click")
143
+ ensure
146
144
  wait_for_loaded
147
145
  end
148
146
 
@@ -150,14 +148,15 @@ module Avo
150
148
  if within_target.present?
151
149
  within within_target do
152
150
  within find('[data-controller="tabs"] [data-tabs-target="tabSwitcher"]') do
153
- find_link(tab_name).click
151
+ find_link(tab_name).trigger("click")
154
152
  end
155
153
  end
156
154
  else
157
155
  within find('[data-controller="tabs"] [data-tabs-target="tabSwitcher"]') do
158
- find_link(tab_name).click
156
+ find_link(tab_name).trigger("click")
159
157
  end
160
158
  end
159
+ wait_for_loaded
161
160
  end
162
161
 
163
162
  def tab_group(index = 0)
@@ -204,7 +203,7 @@ module Avo
204
203
  end
205
204
 
206
205
  def close_picker
207
- find('[data-target="title"]').click
206
+ find('[data-target="title"]').trigger("click")
208
207
  sleep 0.3
209
208
  end
210
209
 
@@ -251,14 +250,11 @@ module Avo
251
250
  # expect(add_tag(field: :tags, tag: "one")).to eq ["one"]
252
251
  # add_tag(field: :tags, tag: "two")
253
252
  def add_tag(field:, tag:)
254
- # Find the input field for the specified field
255
- input = find("[data-field-id='#{field}'] [data-slot='value'] [role='textbox']")
253
+ # Find the input field for the specified field and click it
254
+ find("[data-field-id='#{field}'] [data-slot='value'] [role='textbox']").click
256
255
 
257
256
  # Enter the specified tag into the input field
258
- input.set(tag)
259
- sleep 0.1
260
-
261
- input.send_keys :return
257
+ type tag, :return
262
258
  wait_for_tag_to_appear(tag)
263
259
 
264
260
  # Return an array of the current tags
@@ -312,6 +308,10 @@ module Avo
312
308
  page.all(".tagify__dropdown__item").map { |element| element[:label] }
313
309
  end
314
310
 
311
+ def type(...)
312
+ page.driver.browser.keyboard.type(...)
313
+ end
314
+
315
315
  private
316
316
 
317
317
  # Returns the name of the wrapper element for the given field id and type
data/lib/avo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Avo
2
- VERSION = "3.3.6" unless const_defined?(:VERSION)
2
+ VERSION = "3.4.0" unless const_defined?(:VERSION)
3
3
  end
@@ -1779,7 +1779,7 @@ span.flatpickr-weekday {
1779
1779
  }
1780
1780
  }
1781
1781
 
1782
- /*! @algolia/autocomplete-theme-classic 1.15.1 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1782
+ /*! @algolia/autocomplete-theme-classic 1.16.0 | MIT License | © Algolia, Inc. and contributors | https://github.com/algolia/autocomplete */
1783
1783
 
1784
1784
  /* ----------------*/
1785
1785
 
@@ -6517,6 +6517,8 @@ trix-editor .attachment__metadata .attachment__size {
6517
6517
 
6518
6518
  .trix-content {
6519
6519
  line-height: 1.5;
6520
+ overflow-wrap: break-word;
6521
+ word-break: break-word;
6520
6522
  }
6521
6523
 
6522
6524
  .trix-content * {
@@ -683,7 +683,7 @@ Maximum file size is #image_max_size#.`,importError:"Something went wrong when u
683
683
  <div class="double-bounce1"></div>
684
684
  <div class="double-bounce2"></div>
685
685
  </div>`)}attemptSubmit(e){return this.confirmationMessageValue?this.confirmAndApply(e):this.applyLoader(),null}confirmAndApply(e){this.confirmedValue||(e.preventDefault(),window.confirm(this.confirmationMessageValue)&&this.applyLoader())}get button(){return this.context.scope.element}applyLoader(){let{button:e}=this;e.style.width=`${e.getBoundingClientRect().width}px`,e.style.height=`${e.getBoundingClientRect().height}px`,e.innerHTML=this.spinnerMarkup,e.classList.add("justify-center"),setTimeout(()=>{this.markConfirmed(),e.click(),e.setAttribute("disabled","disabled")},1)}markConfirmed(){this.confirmedValue=!0}markUnconfirmed(){this.confirmedValue=!1}};Wr(dk,"values",{confirmationMessage:String,confirmed:Boolean})});var pk,D0e=ze(()=>{bo();pk=class extends nn{constructor(){super(...arguments);Wr(this,"collapsed",!0)}get key(){return this.selfTarget.getAttribute("data-menu-key-param")}get defaultState(){return this.selfTarget.getAttribute("data-menu-default-collapsed-state")}get userState(){return window.localStorage.getItem(this.key)}set userState(e){window.localStorage.setItem(this.key,e)}get initiallyCollapsed(){return this.userState?this.userState==="collapsed":this.defaultState==="collapsed"}connect(){this.initiallyCollapsed?(this.collapsed=!0,this.markCollapsed()):(this.collapsed=!1,this.markExpanded())}triggerCollapse(){this.collapsed=!this.collapsed,this.userState=this.collapsed?"collapsed":"expanded",this.updateDom()}updateDom(){this.collapsed?this.markCollapsed():this.markExpanded()}markCollapsed(){this.svgTarget.classList.add("rotate-90"),this.itemsTarget.classList.add("hidden")}markExpanded(){this.svgTarget.classList.remove("rotate-90"),this.itemsTarget.classList.remove("hidden")}};Wr(pk,"targets",["svg","items","self"])});var mk,O0e=ze(()=>{bo();mk=class extends nn{close(){this.modalTarget.remove(),document.dispatchEvent(new Event("actions-modal:close"))}};Wr(mk,"targets",["modal"])});var gk,I0e=ze(()=>{Z_();gk=class extends Ah{getFilterValue(){let r=Array.from(this.selectorTarget.selectedOptions).map(({value:e})=>e);return r.length===0?null:r}getFilterClass(){let{filterClass:r}=this.selectorTarget.dataset;return r}};Wr(gk,"targets",["selector"])});var vk,M0e=ze(()=>{bo();vk=class extends nn{get turboFrame(){return this.selectorTarget.dataset.turboFrame}reload(){document.querySelector(`[data-per-page-option="${this.selectorTarget.value}"][data-turbo-frame="${this.turboFrame}"]`).click()}};Wr(vk,"targets",["selector"])});var yk,L0e=ze(()=>{bo();KI();yk=class extends nn{connect(){let r=this;H_(r.context.element,{content:"loading...",allowHTML:!0,theme:"light",maxWidth:550,onShow(t){return z0(this,null,function*(){let i=yield(yield fetch(r.urlValue)).text();t.setContent(i)})}})}};Wr(yk,"values",{url:String})});var bk,P0e=ze(()=>{bo();bk=class extends nn{update(r){this.labelTarget.textContent=r.target.value}};Wr(bk,"targets",["label"])});var xk,R0e=ze(()=>{bo();xk=class extends nn{beforeStreamRender(r){let{relationName:e}=r.target.dataset;if(r.target.action!=="update-belongs-to"||this.relationNameValue!==e)return!1;r.detail.render=t=>{this.searchableValue?this.updateSearchable(t):this.updateNonSearchable(t)}}updateSearchable(r){document.querySelector(`input[name="${this.targetNameValue}"][type="hidden"]`).value=r.dataset.targetRecordId,document.querySelector(`input[name="${this.targetNameValue}"][type="text"]`).value=r.dataset.targetResourceLabel}updateNonSearchable(r){let e=this.selectorContext(r).querySelector(`select[name="${this.targetNameValue}"]`),t=document.createElement("option");t.value=r.dataset.targetRecordId,t.text=r.dataset.targetResourceLabel,t.selected=!0,e.appendChild(t)}selectorContext(r){return this.polymorphicValue?document.querySelector(`[data-type="${r.dataset.targetResourceClass}"]`):document}};Wr(xk,"values",{polymorphic:Boolean,searchable:Boolean,targetName:String,relationName:String})});var q0e=de((mVt,F0e)=>{var igt=typeof global=="object"&&global&&global.Object===Object&&global;F0e.exports=igt});var B0e=de((gVt,N0e)=>{var ogt=q0e(),agt=typeof self=="object"&&self&&self.Object===Object&&self,sgt=ogt||agt||Function("return this")();N0e.exports=sgt});var mL=de((vVt,z0e)=>{var lgt=B0e(),ugt=lgt.Symbol;z0e.exports=ugt});var j0e=de((yVt,U0e)=>{function cgt(r,e){for(var t=-1,n=r==null?0:r.length,i=Array(n);++t<n;)i[t]=e(r[t],t,r);return i}U0e.exports=cgt});var W0e=de((bVt,H0e)=>{var fgt=Array.isArray;H0e.exports=fgt});var K0e=de((xVt,G0e)=>{var V0e=mL(),$0e=Object.prototype,hgt=$0e.hasOwnProperty,dgt=$0e.toString,_k=V0e?V0e.toStringTag:void 0;function pgt(r){var e=hgt.call(r,_k),t=r[_k];try{r[_k]=void 0;var n=!0}catch{}var i=dgt.call(r);return n&&(e?r[_k]=t:delete r[_k]),i}G0e.exports=pgt});var Z0e=de((_Vt,Y0e)=>{var mgt=Object.prototype,ggt=mgt.toString;function vgt(r){return ggt.call(r)}Y0e.exports=vgt});var exe=de((wVt,Q0e)=>{var X0e=mL(),ygt=K0e(),bgt=Z0e(),xgt="[object Null]",_gt="[object Undefined]",J0e=X0e?X0e.toStringTag:void 0;function wgt(r){return r==null?r===void 0?_gt:xgt:J0e&&J0e in Object(r)?ygt(r):bgt(r)}Q0e.exports=wgt});var rxe=de((SVt,txe)=>{function Sgt(r){return r!=null&&typeof r=="object"}txe.exports=Sgt});var ixe=de((TVt,nxe)=>{var Tgt=exe(),Egt=rxe(),kgt="[object Symbol]";function Cgt(r){return typeof r=="symbol"||Egt(r)&&Tgt(r)==kgt}nxe.exports=Cgt});var cxe=de((EVt,uxe)=>{var oxe=mL(),Agt=j0e(),Dgt=W0e(),Ogt=ixe(),Igt=1/0,axe=oxe?oxe.prototype:void 0,sxe=axe?axe.toString:void 0;function lxe(r){if(typeof r=="string")return r;if(Dgt(r))return Agt(r,lxe)+"";if(Ogt(r))return sxe?sxe.call(r):"";var e=r+"";return e=="0"&&1/r==-Igt?"-0":e}uxe.exports=lxe});var wk=de((kVt,fxe)=>{var Mgt=cxe();function Lgt(r){return r==null?"":Mgt(r)}fxe.exports=Lgt});var dxe=de((CVt,hxe)=>{function Pgt(r,e,t){var n=-1,i=r.length;e<0&&(e=-e>i?0:i+e),t=t>i?i:t,t<0&&(t+=i),i=e>t?0:t-e>>>0,e>>>=0;for(var a=Array(i);++n<i;)a[n]=r[n+e];return a}hxe.exports=Pgt});var mxe=de((AVt,pxe)=>{var Rgt=dxe();function Fgt(r,e,t){var n=r.length;return t=t===void 0?n:t,!e&&t>=n?r:Rgt(r,e,t)}pxe.exports=Fgt});var Dj=de((DVt,gxe)=>{var qgt="\\ud800-\\udfff",Ngt="\\u0300-\\u036f",Bgt="\\ufe20-\\ufe2f",zgt="\\u20d0-\\u20ff",Ugt=Ngt+Bgt+zgt,jgt="\\ufe0e\\ufe0f",Hgt="\\u200d",Wgt=RegExp("["+Hgt+qgt+Ugt+jgt+"]");function Vgt(r){return Wgt.test(r)}gxe.exports=Vgt});var yxe=de((OVt,vxe)=>{function $gt(r){return r.split("")}vxe.exports=$gt});var kxe=de((IVt,Exe)=>{var bxe="\\ud800-\\udfff",Ggt="\\u0300-\\u036f",Kgt="\\ufe20-\\ufe2f",Ygt="\\u20d0-\\u20ff",Zgt=Ggt+Kgt+Ygt,Xgt="\\ufe0e\\ufe0f",Jgt="["+bxe+"]",Oj="["+Zgt+"]",Ij="\\ud83c[\\udffb-\\udfff]",Qgt="(?:"+Oj+"|"+Ij+")",xxe="[^"+bxe+"]",_xe="(?:\\ud83c[\\udde6-\\uddff]){2}",wxe="[\\ud800-\\udbff][\\udc00-\\udfff]",evt="\\u200d",Sxe=Qgt+"?",Txe="["+Xgt+"]?",tvt="(?:"+evt+"(?:"+[xxe,_xe,wxe].join("|")+")"+Txe+Sxe+")*",rvt=Txe+Sxe+tvt,nvt="(?:"+[xxe+Oj+"?",Oj,_xe,wxe,Jgt].join("|")+")",ivt=RegExp(Ij+"(?="+Ij+")|"+nvt+rvt,"g");function ovt(r){return r.match(ivt)||[]}Exe.exports=ovt});var Axe=de((MVt,Cxe)=>{var avt=yxe(),svt=Dj(),lvt=kxe();function uvt(r){return svt(r)?lvt(r):avt(r)}Cxe.exports=uvt});var Oxe=de((LVt,Dxe)=>{var cvt=mxe(),fvt=Dj(),hvt=Axe(),dvt=wk();function pvt(r){return function(e){e=dvt(e);var t=fvt(e)?hvt(e):void 0,n=t?t[0]:e.charAt(0),i=t?cvt(t,1).join(""):e.slice(1);return n[r]()+i}}Dxe.exports=pvt});var Mxe=de((PVt,Ixe)=>{var mvt=Oxe(),gvt=mvt("toUpperCase");Ixe.exports=gvt});var Pxe=de((RVt,Lxe)=>{var vvt=wk(),yvt=Mxe();function bvt(r){return yvt(vvt(r).toLowerCase())}Lxe.exports=bvt});var Fxe=de((FVt,Rxe)=>{function xvt(r,e,t,n){var i=-1,a=r==null?0:r.length;for(n&&a&&(t=r[++i]);++i<a;)t=e(t,r[i],i,r);return t}Rxe.exports=xvt});var Nxe=de((qVt,qxe)=>{function _vt(r){return function(e){return r?.[e]}}qxe.exports=_vt});var zxe=de((NVt,Bxe)=>{var wvt=Nxe(),Svt={\u00C0:"A",\u00C1:"A",\u00C2:"A",\u00C3:"A",\u00C4:"A",\u00C5:"A",\u00E0:"a",\u00E1:"a",\u00E2:"a",\u00E3:"a",\u00E4:"a",\u00E5:"a",\u00C7:"C",\u00E7:"c",\u00D0:"D",\u00F0:"d",\u00C8:"E",\u00C9:"E",\u00CA:"E",\u00CB:"E",\u00E8:"e",\u00E9:"e",\u00EA:"e",\u00EB:"e",\u00CC:"I",\u00CD:"I",\u00CE:"I",\u00CF:"I",\u00EC:"i",\u00ED:"i",\u00EE:"i",\u00EF:"i",\u00D1:"N",\u00F1:"n",\u00D2:"O",\u00D3:"O",\u00D4:"O",\u00D5:"O",\u00D6:"O",\u00D8:"O",\u00F2:"o",\u00F3:"o",\u00F4:"o",\u00F5:"o",\u00F6:"o",\u00F8:"o",\u00D9:"U",\u00DA:"U",\u00DB:"U",\u00DC:"U",\u00F9:"u",\u00FA:"u",\u00FB:"u",\u00FC:"u",\u00DD:"Y",\u00FD:"y",\u00FF:"y",\u00C6:"Ae",\u00E6:"ae",\u00DE:"Th",\u00FE:"th",\u00DF:"ss",\u0100:"A",\u0102:"A",\u0104:"A",\u0101:"a",\u0103:"a",\u0105:"a",\u0106:"C",\u0108:"C",\u010A:"C",\u010C:"C",\u0107:"c",\u0109:"c",\u010B:"c",\u010D:"c",\u010E:"D",\u0110:"D",\u010F:"d",\u0111:"d",\u0112:"E",\u0114:"E",\u0116:"E",\u0118:"E",\u011A:"E",\u0113:"e",\u0115:"e",\u0117:"e",\u0119:"e",\u011B:"e",\u011C:"G",\u011E:"G",\u0120:"G",\u0122:"G",\u011D:"g",\u011F:"g",\u0121:"g",\u0123:"g",\u0124:"H",\u0126:"H",\u0125:"h",\u0127:"h",\u0128:"I",\u012A:"I",\u012C:"I",\u012E:"I",\u0130:"I",\u0129:"i",\u012B:"i",\u012D:"i",\u012F:"i",\u0131:"i",\u0134:"J",\u0135:"j",\u0136:"K",\u0137:"k",\u0138:"k",\u0139:"L",\u013B:"L",\u013D:"L",\u013F:"L",\u0141:"L",\u013A:"l",\u013C:"l",\u013E:"l",\u0140:"l",\u0142:"l",\u0143:"N",\u0145:"N",\u0147:"N",\u014A:"N",\u0144:"n",\u0146:"n",\u0148:"n",\u014B:"n",\u014C:"O",\u014E:"O",\u0150:"O",\u014D:"o",\u014F:"o",\u0151:"o",\u0154:"R",\u0156:"R",\u0158:"R",\u0155:"r",\u0157:"r",\u0159:"r",\u015A:"S",\u015C:"S",\u015E:"S",\u0160:"S",\u015B:"s",\u015D:"s",\u015F:"s",\u0161:"s",\u0162:"T",\u0164:"T",\u0166:"T",\u0163:"t",\u0165:"t",\u0167:"t",\u0168:"U",\u016A:"U",\u016C:"U",\u016E:"U",\u0170:"U",\u0172:"U",\u0169:"u",\u016B:"u",\u016D:"u",\u016F:"u",\u0171:"u",\u0173:"u",\u0174:"W",\u0175:"w",\u0176:"Y",\u0177:"y",\u0178:"Y",\u0179:"Z",\u017B:"Z",\u017D:"Z",\u017A:"z",\u017C:"z",\u017E:"z",\u0132:"IJ",\u0133:"ij",\u0152:"Oe",\u0153:"oe",\u0149:"'n",\u017F:"s"},Tvt=wvt(Svt);Bxe.exports=Tvt});var jxe=de((BVt,Uxe)=>{var Evt=zxe(),kvt=wk(),Cvt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Avt="\\u0300-\\u036f",Dvt="\\ufe20-\\ufe2f",Ovt="\\u20d0-\\u20ff",Ivt=Avt+Dvt+Ovt,Mvt="["+Ivt+"]",Lvt=RegExp(Mvt,"g");function Pvt(r){return r=kvt(r),r&&r.replace(Cvt,Evt).replace(Lvt,"")}Uxe.exports=Pvt});var Wxe=de((zVt,Hxe)=>{var Rvt=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function Fvt(r){return r.match(Rvt)||[]}Hxe.exports=Fvt});var $xe=de((UVt,Vxe)=>{var qvt=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function Nvt(r){return qvt.test(r)}Vxe.exports=Nvt});var f_e=de((jVt,c_e)=>{var Xxe="\\ud800-\\udfff",Bvt="\\u0300-\\u036f",zvt="\\ufe20-\\ufe2f",Uvt="\\u20d0-\\u20ff",jvt=Bvt+zvt+Uvt,Jxe="\\u2700-\\u27bf",Qxe="a-z\\xdf-\\xf6\\xf8-\\xff",Hvt="\\xac\\xb1\\xd7\\xf7",Wvt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Vvt="\\u2000-\\u206f",$vt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",e_e="A-Z\\xc0-\\xd6\\xd8-\\xde",Gvt="\\ufe0e\\ufe0f",t_e=Hvt+Wvt+Vvt+$vt,r_e="['\u2019]",Gxe="["+t_e+"]",Kvt="["+jvt+"]",n_e="\\d+",Yvt="["+Jxe+"]",i_e="["+Qxe+"]",o_e="[^"+Xxe+t_e+n_e+Jxe+Qxe+e_e+"]",Zvt="\\ud83c[\\udffb-\\udfff]",Xvt="(?:"+Kvt+"|"+Zvt+")",Jvt="[^"+Xxe+"]",a_e="(?:\\ud83c[\\udde6-\\uddff]){2}",s_e="[\\ud800-\\udbff][\\udc00-\\udfff]",_1="["+e_e+"]",Qvt="\\u200d",Kxe="(?:"+i_e+"|"+o_e+")",eyt="(?:"+_1+"|"+o_e+")",Yxe="(?:"+r_e+"(?:d|ll|m|re|s|t|ve))?",Zxe="(?:"+r_e+"(?:D|LL|M|RE|S|T|VE))?",l_e=Xvt+"?",u_e="["+Gvt+"]?",tyt="(?:"+Qvt+"(?:"+[Jvt,a_e,s_e].join("|")+")"+u_e+l_e+")*",ryt="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",nyt="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",iyt=u_e+l_e+tyt,oyt="(?:"+[Yvt,a_e,s_e].join("|")+")"+iyt,ayt=RegExp([_1+"?"+i_e+"+"+Yxe+"(?="+[Gxe,_1,"$"].join("|")+")",eyt+"+"+Zxe+"(?="+[Gxe,_1+Kxe,"$"].join("|")+")",_1+"?"+Kxe+"+"+Yxe,_1+"+"+Zxe,nyt,ryt,n_e,oyt].join("|"),"g");function syt(r){return r.match(ayt)||[]}c_e.exports=syt});var d_e=de((HVt,h_e)=>{var lyt=Wxe(),uyt=$xe(),cyt=wk(),fyt=f_e();function hyt(r,e,t){return r=cyt(r),e=t?void 0:e,e===void 0?uyt(r)?fyt(r):lyt(r):r.match(e)||[]}h_e.exports=hyt});var m_e=de((WVt,p_e)=>{var dyt=Fxe(),pyt=jxe(),myt=d_e(),gyt="['\u2019]",vyt=RegExp(gyt,"g");function yyt(r){return function(e){return dyt(myt(pyt(e).replace(vyt,"")),r,"")}}p_e.exports=yyt});var v_e=de((VVt,g_e)=>{var byt=Pxe(),xyt=m_e(),_yt=xyt(function(r,e,t){return e=e.toLowerCase(),r+(t?byt(e):e)});g_e.exports=_yt});var Mj,w1,y_e=ze(()=>{bo();Mj=la(v_e()),w1=class extends nn{debugOnInput(r){console.log("onInput",r,r.target.value)}toggle({params:r}){let{toggleTarget:e,toggleTargets:t}=r;e&&this.toggleAvoTarget(e),t&&t.length>0&&t.forEach(this.toggleAvoTarget.bind(this))}disable({params:r}){let{disableTarget:e,disableTargets:t}=r;e&&this.disableAvoTarget(e),t&&t.length>0&&t.forEach(this.disableAvoTarget.bind(this))}toggleAvoTarget(r){let e=(0,Mj.default)(r),t=document.querySelector(`[data-resource-edit-target="${e}"]`);t&&t.classList.toggle("hidden")}disableAvoTarget(r){let e=(0,Mj.default)(r);document.querySelectorAll(`[data-resource-edit-target="${e}"]`).forEach(this.toggleItemDisabled),document.querySelectorAll(`[data-resource-edit-target="${e}"] input`).forEach(this.toggleItemDisabled),document.querySelectorAll(`[data-resource-edit-target="${e}"] select`).forEach(this.toggleItemDisabled),document.querySelectorAll(`[data-resource-edit-target="${e}"] [data-slot="value"] button`).forEach(this.toggleItemDisabled)}toggleItemDisabled(r){r.disabled=!r.disabled}};Wr(w1,"targets",[]),Wr(w1,"values",{view:String})});var gL,b_e=ze(()=>{bo();gL=class extends nn{}});var vL,x_e=ze(()=>{bo();vL=class extends nn{}});var __e=ze(()=>{});var w_e=ze(()=>{});var S_e=ze(()=>{});var T_e=ze(()=>{});var E_e=ze(()=>{__e();w_e();S_e();T_e()});function e0(r){return{current:r}}var k_e=ze(()=>{});function S1(r,e){var t=void 0;return function(){for(var n=arguments.length,i=new Array(n),a=0;a<n;a++)i[a]=arguments[a];t&&clearTimeout(t),t=setTimeout(function(){return r.apply(void 0,i)},e)}}var C_e=ze(()=>{});function wyt(r,e){return kyt(r)||Eyt(r,e)||Tyt(r,e)||Syt()}function Syt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
686
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tyt(r,e){if(!!r){if(typeof r=="string")return A_e(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A_e(r,e)}}function A_e(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Eyt(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,l,h=[],g=!0,w=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;g=!1}else for(;!(g=(n=a.call(t)).done)&&(h.push(n.value),h.length!==e);g=!0);}catch(C){w=!0,i=C}finally{try{if(!g&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(w)throw i}}return h}}function kyt(r){if(Array.isArray(r))return r}function T1(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;return r;var t}var D_e=ze(()=>{});function $g(r){return r.reduce(function(e,t){return e.concat(t)},[])}var O_e=ze(()=>{});function yL(){return"autocomplete-".concat(Cyt++)}var Cyt,I_e=ze(()=>{Cyt=0});function E1(r,e){return e.reduce(function(t,n){return t&&t[n]},r)}var M_e=ze(()=>{});function by(r){return r.collections.length===0?0:r.collections.reduce(function(e,t){return e+t.items.length},0)}var L_e=ze(()=>{});var P_e=ze(()=>{});function R_e(r){return r!==Object(r)}function Lj(r,e){if(r===e)return!0;if(R_e(r)||R_e(e)||typeof r=="function"||typeof e=="function")return r===e;if(Object.keys(r).length!==Object.keys(e).length)return!1;for(var t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(!(i in e)||!Lj(r[i],e[i]))return!1}return!0}var F_e=ze(()=>{});var q_e=ze(()=>{});var t0,N_e=ze(()=>{t0=function(){}});function B_e(r){if(typeof window<"u")return r({window})}var z_e=ze(()=>{});var U_e=ze(()=>{});var j_e=ze(()=>{});var bL,Pj=ze(()=>{bL="1.15.1"});var xL,H_e=ze(()=>{Pj();xL=[{segment:"autocomplete-core",version:bL}]});var W_e=ze(()=>{});var V_e=ze(()=>{});var $_e=ze(()=>{});var G_e=ze(()=>{});var K_e=ze(()=>{});var Y_e=ze(()=>{});var Z_e=ze(()=>{});var X_e=ze(()=>{});var J_e=ze(()=>{});var Q_e=ze(()=>{});var e1e=ze(()=>{});var t1e=ze(()=>{});var r1e=ze(()=>{});var Rj=ze(()=>{V_e();$_e();G_e();K_e();Y_e();Z_e();X_e();J_e();Q_e();e1e();t1e();r1e()});var Ef=ze(()=>{k_e();C_e();D_e();O_e();I_e();M_e();L_e();P_e();F_e();q_e();N_e();z_e();U_e();j_e();H_e();Pj();W_e();Rj()});function Fj(r){var e=r.item,t=r.items,n=t===void 0?[]:t;return{index:e.__autocomplete_indexName,items:[e],positions:[1+n.findIndex(function(i){return i.objectID===e.objectID})],queryID:e.__autocomplete_queryID,algoliaSource:["autocomplete"]}}var n1e=ze(()=>{});function Ayt(r,e){return Myt(r)||Iyt(r,e)||Oyt(r,e)||Dyt()}function Dyt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
686
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tyt(r,e){if(!!r){if(typeof r=="string")return A_e(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return A_e(r,e)}}function A_e(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Eyt(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,l,h=[],g=!0,w=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;g=!1}else for(;!(g=(n=a.call(t)).done)&&(h.push(n.value),h.length!==e);g=!0);}catch(C){w=!0,i=C}finally{try{if(!g&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(w)throw i}}return h}}function kyt(r){if(Array.isArray(r))return r}function T1(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new Set;return r;var t}var D_e=ze(()=>{});function $g(r){return r.reduce(function(e,t){return e.concat(t)},[])}var O_e=ze(()=>{});function yL(){return"autocomplete-".concat(Cyt++)}var Cyt,I_e=ze(()=>{Cyt=0});function E1(r,e){return e.reduce(function(t,n){return t&&t[n]},r)}var M_e=ze(()=>{});function by(r){return r.collections.length===0?0:r.collections.reduce(function(e,t){return e+t.items.length},0)}var L_e=ze(()=>{});var P_e=ze(()=>{});function R_e(r){return r!==Object(r)}function Lj(r,e){if(r===e)return!0;if(R_e(r)||R_e(e)||typeof r=="function"||typeof e=="function")return r===e;if(Object.keys(r).length!==Object.keys(e).length)return!1;for(var t=0,n=Object.keys(r);t<n.length;t++){var i=n[t];if(!(i in e)||!Lj(r[i],e[i]))return!1}return!0}var F_e=ze(()=>{});var q_e=ze(()=>{});var t0,N_e=ze(()=>{t0=function(){}});function B_e(r){if(typeof window<"u")return r({window})}var z_e=ze(()=>{});var U_e=ze(()=>{});var j_e=ze(()=>{});var bL,Pj=ze(()=>{bL="1.16.0"});var xL,H_e=ze(()=>{Pj();xL=[{segment:"autocomplete-core",version:bL}]});var W_e=ze(()=>{});var V_e=ze(()=>{});var $_e=ze(()=>{});var G_e=ze(()=>{});var K_e=ze(()=>{});var Y_e=ze(()=>{});var Z_e=ze(()=>{});var X_e=ze(()=>{});var J_e=ze(()=>{});var Q_e=ze(()=>{});var e1e=ze(()=>{});var t1e=ze(()=>{});var r1e=ze(()=>{});var Rj=ze(()=>{V_e();$_e();G_e();K_e();Y_e();Z_e();X_e();J_e();Q_e();e1e();t1e();r1e()});var Ef=ze(()=>{k_e();C_e();D_e();O_e();I_e();M_e();L_e();P_e();F_e();q_e();N_e();z_e();U_e();j_e();H_e();Pj();W_e();Rj()});function Fj(r){var e=r.item,t=r.items,n=t===void 0?[]:t;return{index:e.__autocomplete_indexName,items:[e],positions:[1+n.findIndex(function(i){return i.objectID===e.objectID})],queryID:e.__autocomplete_queryID,algoliaSource:["autocomplete"]}}var n1e=ze(()=>{});function Ayt(r,e){return Myt(r)||Iyt(r,e)||Oyt(r,e)||Dyt()}function Dyt(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
687
687
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Oyt(r,e){if(!!r){if(typeof r=="string")return i1e(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i1e(r,e)}}function i1e(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function Iyt(r,e){var t=r==null?null:typeof Symbol<"u"&&r[Symbol.iterator]||r["@@iterator"];if(t!=null){var n,i,a,l,h=[],g=!0,w=!1;try{if(a=(t=t.call(r)).next,e===0){if(Object(t)!==t)return;g=!1}else for(;!(g=(n=a.call(t)).done)&&(h.push(n.value),h.length!==e);g=!0);}catch(C){w=!0,i=C}finally{try{if(!g&&t.return!=null&&(l=t.return(),Object(l)!==l))return}finally{if(w)throw i}}return h}}function Myt(r){if(Array.isArray(r))return r}function o1e(r){var e=(r.version||"").split(".").map(Number),t=Ayt(e,2),n=t[0],i=t[1],a=n>=3,l=n===2&&i>=4,h=n===1&&i>=10;return a||l||h}var a1e=ze(()=>{});function Sk(r){return Sk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Sk(r)}function _L(r){return Nyt(r)||qyt(r)||Fyt(r)||Ryt()}function Ryt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
688
688
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Fyt(r,e){if(!!r){if(typeof r=="string")return qj(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return qj(r,e)}}function qyt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Nyt(r){if(Array.isArray(r))return qj(r)}function qj(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function l1e(r,e){if(r==null)return{};var t=Byt(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&(!Object.prototype.propertyIsEnumerable.call(r,n)||(t[n]=r[n]))}return t}function Byt(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function s1e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function k1(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?s1e(Object(t),!0).forEach(function(n){zyt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):s1e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function zyt(r,e,t){return e=Uyt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Uyt(r){var e=jyt(r,"string");return Sk(e)==="symbol"?e:String(e)}function jyt(r,e){if(Sk(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Sk(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Hyt(r){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,t=[],n=0;n<r.objectIDs.length;n+=e)t.push(k1(k1({},r),{},{objectIDs:r.objectIDs.slice(n,n+e)}));return t}function wL(r){return r.map(function(e){var t=e.items,n=l1e(e,Lyt);return k1(k1({},n),{},{objectIDs:t?.map(function(i){var a=i.objectID;return a})||n.objectIDs})})}function u1e(r){var e=o1e(r);function t(n,i,a){if(e&&typeof a<"u"){var l=a[0].__autocomplete_algoliaCredentials,h=l.appId,g=l.apiKey,w={"X-Algolia-Application-Id":h,"X-Algolia-API-Key":g};r.apply(void 0,[n].concat(_L(i),[{headers:w}]))}else r.apply(void 0,[n].concat(_L(i)))}return{init:function(i,a){r("init",{appId:i,apiKey:a})},setAuthenticatedUserToken:function(i){r("setAuthenticatedUserToken",i)},setUserToken:function(i){r("setUserToken",i)},clickedObjectIDsAfterSearch:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&t("clickedObjectIDsAfterSearch",wL(a),a[0].items)},clickedObjectIDs:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&t("clickedObjectIDs",wL(a),a[0].items)},clickedFilters:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&r.apply(void 0,["clickedFilters"].concat(a))},convertedObjectIDsAfterSearch:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&t("convertedObjectIDsAfterSearch",wL(a),a[0].items)},convertedObjectIDs:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&t("convertedObjectIDs",wL(a),a[0].items)},convertedFilters:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&r.apply(void 0,["convertedFilters"].concat(a))},viewedObjectIDs:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&a.reduce(function(h,g){var w=g.items,C=l1e(g,Pyt);return[].concat(_L(h),_L(Hyt(k1(k1({},C),{},{objectIDs:w?.map(function(D){var F=D.objectID;return F})||C.objectIDs})).map(function(D){return{items:w,payload:D}})))},[]).forEach(function(h){var g=h.items,w=h.payload;return t("viewedObjectIDs",[w],g)})},viewedFilters:function(){for(var i=arguments.length,a=new Array(i),l=0;l<i;l++)a[l]=arguments[l];a.length>0&&r.apply(void 0,["viewedFilters"].concat(a))}}}var Lyt,Pyt,c1e=ze(()=>{a1e();Lyt=["items"],Pyt=["items"]});function f1e(r){var e=r.items,t=e.reduce(function(n,i){var a;return n[i.__autocomplete_indexName]=((a=n[i.__autocomplete_indexName])!==null&&a!==void 0?a:[]).concat(i),n},{});return Object.keys(t).map(function(n){var i=t[n];return{index:n,items:i,algoliaSource:["autocomplete"]}})}var h1e=ze(()=>{});function C1(r){return r.objectID&&r.__autocomplete_indexName&&r.__autocomplete_queryID}var d1e=ze(()=>{});function Tk(r){return Tk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Tk(r)}function A1(r){return Gyt(r)||$yt(r)||Vyt(r)||Wyt()}function Wyt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
689
689
  In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Vyt(r,e){if(!!r){if(typeof r=="string")return Nj(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);if(t==="Object"&&r.constructor&&(t=r.constructor.name),t==="Map"||t==="Set")return Array.from(r);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return Nj(r,e)}}function $yt(r){if(typeof Symbol<"u"&&r[Symbol.iterator]!=null||r["@@iterator"]!=null)return Array.from(r)}function Gyt(r){if(Array.isArray(r))return Nj(r)}function Nj(r,e){(e==null||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t<e;t++)n[t]=r[t];return n}function p1e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Qp(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?p1e(Object(t),!0).forEach(function(n){Kyt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):p1e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Kyt(r,e,t){return e=Yyt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Yyt(r){var e=Zyt(r,"string");return Tk(e)==="symbol"?e:String(e)}function Zyt(r,e){if(Tk(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Tk(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Bj(r){var e=ebt(r),t=e.insightsClient,n=e.insightsInitParams,i=e.onItemsChange,a=e.onSelect,l=e.onActive,h=e.__autocomplete_clickAnalytics,g=t;if(t||B_e(function(F){var z=F.window,Y=z.AlgoliaAnalyticsObject||"aa";typeof Y=="string"&&(g=z[Y]),g||(z.AlgoliaAnalyticsObject=Y,z[Y]||(z[Y]=function(){z[Y].queue||(z[Y].queue=[]);for(var $=arguments.length,re=new Array($),oe=0;oe<$;oe++)re[oe]=arguments[oe];z[Y].queue.push(re)}),z[Y].version=g1e,g=z[Y],tbt(z))}),!g)return{};n&&g("init",Qp({partial:!0},n));var w=u1e(g),C=e0([]),D=S1(function(F){var z=F.state;if(!!z.isOpen){var Y=z.collections.reduce(function($,re){return[].concat(A1($),A1(re.items))},[]).filter(C1);Lj(C.current.map(function($){return $.objectID}),Y.map(function($){return $.objectID}))||(C.current=Y,Y.length>0&&Qyt({onItemsChange:i,items:Y,insights:w,state:z}))}},0);return{name:"aa.algoliaInsightsPlugin",subscribe:function(z){var Y=z.setContext,$=z.onSelect,re=z.onActive,oe=!1;function ne(he){Y({algoliaInsightsPlugin:{__algoliaSearchParameters:Qp(Qp({},h?{clickAnalytics:!0}:{}),he?{userToken:rbt(he)}:{}),insights:w}})}g("addAlgoliaAgent","insights-plugin"),ne(),g("onUserTokenChange",function(he){oe||ne(he)}),g("getUserToken",null,function(he,_){oe||ne(_)}),g("onAuthenticatedUserTokenChange",function(he){he?(oe=!0,ne(he)):(oe=!1,g("getUserToken",null,function(_,ge){return ne(ge)}))}),g("getAuthenticatedUserToken",null,function(he,_){_&&(oe=!0,ne(_))}),$(function(he){var _=he.item,ge=he.state,fe=he.event,me=he.source;!C1(_)||a({state:ge,event:fe,insights:w,item:_,insightsEvents:[Qp({eventName:"Item Selected"},Fj({item:_,items:me.getItems().filter(C1)}))]})}),re(function(he){var _=he.item,ge=he.source,fe=he.state,me=he.event;!C1(_)||l({state:fe,event:me,insights:w,item:_,insightsEvents:[Qp({eventName:"Item Active"},Fj({item:_,items:ge.getItems().filter(C1)}))]})})},onStateChange:function(z){var Y=z.state;D({state:Y})},__autocomplete_pluginOptions:r}}function m1e(){var r,e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return[].concat(A1(e),["autocomplete-internal"],A1((r=t.algoliaInsightsPlugin)!==null&&r!==void 0&&r.__automaticInsights?["autocomplete-automatic"]:[]))}function ebt(r){return Qp({onItemsChange:function(t){var n=t.insights,i=t.insightsEvents,a=t.state;n.viewedObjectIDs.apply(n,A1(i.map(function(l){return Qp(Qp({},l),{},{algoliaSource:m1e(l.algoliaSource,a.context)})})))},onSelect:function(t){var n=t.insights,i=t.insightsEvents,a=t.state;n.clickedObjectIDsAfterSearch.apply(n,A1(i.map(function(l){return Qp(Qp({},l),{},{algoliaSource:m1e(l.algoliaSource,a.context)})})))},onActive:t0,__autocomplete_clickAnalytics:!0},r)}function tbt(r){var e="[Autocomplete]: Could not load search-insights.js. Please load it manually following https://alg.li/insights-autocomplete";try{var t=r.document.createElement("script");t.async=!0,t.src=Jyt,t.onerror=function(){console.error(e)},document.body.appendChild(t)}catch{console.error(e)}}function rbt(r){return typeof r=="number"?r.toString():r}var Xyt,g1e,Jyt,Qyt,v1e=ze(()=>{Ef();n1e();c1e();h1e();d1e();Xyt=400,g1e="2.13.0",Jyt="https://cdn.jsdelivr.net/npm/search-insights@".concat(g1e,"/dist/search-insights.min.js"),Qyt=S1(function(r){var e=r.onItemsChange,t=r.items,n=r.insights,i=r.state;e({insights:n,insightsEvents:f1e({items:t}).map(function(a){return Qp({eventName:"Items Viewed"},a)}),state:i})},Xyt)});var y1e=ze(()=>{E_e();v1e()});function Ek(r,e){var t=e;return{then:function(i,a){return Ek(r.then(SL(i,t,r),SL(a,t,r)),t)},catch:function(i){return Ek(r.catch(SL(i,t,r)),t)},finally:function(i){return i&&t.onCancelList.push(i),Ek(r.finally(SL(i&&function(){return t.onCancelList=[],i()},t,r)),t)},cancel:function(){t.isCanceled=!0;var i=t.onCancelList;t.onCancelList=[],i.forEach(function(a){a()})},isCanceled:function(){return t.isCanceled===!0}}}function b1e(r){return Ek(new Promise(function(e,t){return r(e,t)}),{isCanceled:!1,onCancelList:[]})}function kk(r){return Ek(r,{isCanceled:!1,onCancelList:[]})}function SL(r,e,t){return r?function(i){return e.isCanceled?i:r(i)}:t}var x1e=ze(()=>{b1e.resolve=function(r){return kk(Promise.resolve(r))};b1e.reject=function(r){return kk(Promise.reject(r))}});function _1e(){var r=[];return{add:function(t){return r.push(t),t.finally(function(){r=r.filter(function(n){return n!==t})})},cancelAll:function(){r.forEach(function(t){return t.cancel()})},isEmpty:function(){return r.length===0}}}var w1e=ze(()=>{});function S1e(){var r=-1,e=-1,t=void 0;return function(i){r++;var a=r;return Promise.resolve(i).then(function(l){return t&&a<e?t:(e=a,t=l,l)})}}var T1e=ze(()=>{});function zj(r,e,t,n){if(!t)return null;if(r<0&&(e===null||n!==null&&e===0))return t+r;var i=(e===null?-1:e)+r;return i<=-1||i>=t?n===null?null:0:i}var E1e=ze(()=>{});function k1e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function C1e(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?k1e(Object(t),!0).forEach(function(n){nbt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):k1e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function nbt(r,e,t){return e=ibt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function ibt(r){var e=obt(r,"string");return D1(e)==="symbol"?e:String(e)}function obt(r,e){if(D1(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(D1(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function D1(r){return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},D1(r)}function A1e(r,e){var t=[];return Promise.resolve(r(e)).then(function(n){return Array.isArray(n),Promise.all(n.filter(function(i){return Boolean(i)}).map(function(i){if(i.sourceId,t.includes(i.sourceId))throw new Error("[Autocomplete] The `sourceId` ".concat(JSON.stringify(i.sourceId)," is not unique."));t.push(i.sourceId);var a={getItemInputValue:function(g){var w=g.state;return w.query},getItemUrl:function(){},onSelect:function(g){var w=g.setIsOpen;w(!1)},onActive:t0,onResolve:t0};Object.keys(a).forEach(function(h){a[h].__default=!0});var l=C1e(C1e({},a),i);return Promise.resolve(l)}))})}var D1e=ze(()=>{Ef()});function abt(r){var e=r.collections.map(function(n){return n.items.length}).reduce(function(n,i,a){var l=n[a-1]||0,h=l+i;return n.push(h),n},[]),t=e.reduce(function(n,i){return i<=r.activeItemId?n+1:n},0);return r.collections[t]}function sbt(r){for(var e=r.state,t=r.collection,n=!1,i=0,a=0;n===!1;){var l=e.collections[i];if(l===t){n=!0;break}a+=l.items.length,i++}return e.activeItemId-a}function em(r){var e=abt(r);if(!e)return null;var t=e.items[sbt({state:r,collection:e})],n=e.source,i=n.getItemInputValue({item:t,state:r}),a=n.getItemUrl({item:t,state:r});return{item:t,itemInputValue:i,itemUrl:a,source:n}}var O1e=ze(()=>{});function Ph(r,e,t){return[r,t?.sourceId,e].filter(Boolean).join("-").replace(/\s/g,"")}var I1e=ze(()=>{});function M1e(r,e){return r===e||r.contains(e)}var L1e=ze(()=>{});function P1e(r){return Boolean(r&&r.match(lbt))}var lbt,R1e=ze(()=>{lbt=/((gt|sm)-|galaxy nexus)|samsung[- ]|samsungbrowser/i});function F1e(r){return{results:r,hits:r.map(function(e){return e.hits}).filter(Boolean),facetHits:r.map(function(e){var t;return(t=e.facetHits)===null||t===void 0?void 0:t.map(function(n){return{label:n.value,count:n.count,_highlightResult:{label:{value:n.highlighted}}}})}).filter(Boolean)}}var q1e=ze(()=>{});function Uj(r){return r.nativeEvent||r}var N1e=ze(()=>{});var Gg=ze(()=>{x1e();w1e();T1e();E1e();D1e();O1e();I1e();L1e();R1e();q1e();N1e()});function Ck(r){return Ck=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ck(r)}function B1e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function ubt(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?B1e(Object(t),!0).forEach(function(n){cbt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):B1e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function cbt(r,e,t){return e=fbt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function fbt(r){var e=hbt(r,"string");return Ck(e)==="symbol"?e:String(e)}function hbt(r,e){if(Ck(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Ck(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function z1e(r,e,t){var n=e.initialState;return{getState:function(){return n},dispatch:function(a,l){var h=ubt({},n);n=r(n,{type:a,props:e,payload:l}),t({state:n,prevState:h})},pendingRequests:_1e()}}var U1e=ze(()=>{Gg()});function Ak(r){return Ak=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ak(r)}function j1e(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function EL(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?j1e(Object(t),!0).forEach(function(n){dbt(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):j1e(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function dbt(r,e,t){return e=pbt(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function pbt(r){var e=mbt(r,"string");return Ak(e)==="symbol"?e:String(e)}function mbt(r,e){if(Ak(r)!=="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(Ak(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function H1e(r){var e=r.store,t=function(w){e.dispatch("setActiveItemId",w)},n=function(w){e.dispatch("setQuery",w)},i=function(w){var C=0,D=w.map(function(F){return EL(EL({},F),{},{items:$g(F.items).map(function(z){return EL(EL({},z),{},{__autocomplete_id:C++})})})});e.dispatch("setCollections",D)},a=function(w){e.dispatch("setIsOpen",w)},l=function(w){e.dispatch("setStatus",w)},h=function(w){e.dispatch("setContext",w)};return{setActiveItemId:t,setQuery:n,setCollections:i,setIsOpen:a,setStatus:l,setContext:h}}var W1e=ze(()=>{Ef()});function Dk(r){return Dk=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dk(r)}function gbt(r){return xbt(r)||bbt(r)||ybt(r)||vbt()}function vbt(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
@@ -797,7 +797,7 @@ function print() { __p += __j.call(arguments, '') }
797
797
  </div>`:""}
798
798
  <span>${r.label}</span>
799
799
  </div>
800
- `}var oEe=ze(()=>{});var l0,aEe,sEe,H1,lEe=ze(()=>{bo();l0=la(tEe()),aEe=la(rEe()),sEe=la(Y_());oEe();g9();H1=class extends nn{constructor(){super(...arguments);Wr(this,"tagify",null);Wr(this,"searchDebounce",500);Wr(this,"debouncedFetch",WL(fetch,this.searchDebounce))}get suggestionsAreObjects(){return(0,l0.isObject)((0,l0.first)(this.whitelistItemsValue))||this.fetchValuesFromValue}get tagifyOptions(){let e={whitelist:this.whitelistItemsValue,blacklist:this.disallowedItemsValue,enforceWhitelist:this.enforceSuggestionsValue||this.fetchValuesFromValue,delimiters:this.delimitersValue.join("|"),dropdown:{maxItems:this.suggestionsMaxItemsValue,enabled:0,searchKeys:[this.labelAttributeValue],closeOnSelect:this.closeOnSelectValue}};return this.modeValue&&(e.mode=this.modeValue),this.suggestionsAreObjects?e=(0,l0.merge)(e,{tagTextProp:"label",dropdown:{searchKeys:["label"],mapValueTo:"value"},templates:{tag:nEe,dropdownItem:iEe},originalInputValueFormat:t=>t.map(n=>n.value)}):e=(0,l0.merge)(e,{originalInputValueFormat:t=>t.map(n=>n.value).join(",")}),e}connect(){this.hasInputTarget&&(this.hideFakeInput(),this.showRealInput(),this.initTagify())}initTagify(){this.tagify=new aEe.default(this.inputTarget,this.tagifyOptions);let e=this;function t(n){let i=n.detail.value,a=new sEe.default(e.fetchValuesFromValue);a.addSearch({q:i}),e.tagify.whitelist=null,e.tagify.loading(!0),e.fetchResults(a.toString()).then(l=>{e.tagify.settings.whitelist=l,e.tagify.loading(!1).dropdown.show(n.detail.value)}).catch(()=>e.tagify.dropdown.hide())}this.fetchValuesFromValue&&this.tagify.on("input",t)}fetchResults(e){return this.debouncedFetch(e).then(t=>t.json())}hideFakeInput(){this.fakeInputTarget.classList.add("hidden")}showRealInput(){this.inputTarget.classList.remove("hidden")}};Wr(H1,"targets",["input","fakeInput"]),Wr(H1,"values",{whitelistItems:{type:Array,default:[]},disallowedItems:{type:Array,default:[]},enforceSuggestions:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!1},delimiters:{type:Array,default:[]},suggestionsMaxItems:{type:Number,default:20},mode:String,fetchValuesFrom:String})});var eC,uEe=ze(()=>{Z_();eC=class extends Ah{getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};Wr(eC,"targets",["text"])});var tC,cEe=ze(()=>{bo();KI();tC=class extends nn{connect(){H_(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"light"})}};Wr(tC,"targets",["source","content"])});function k9(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on".concat(e),function(){t(window.event)})}function mEe(r,e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=r[t[n].toLowerCase()];return t}function gEe(r){typeof r!="string"&&(r=""),r=r.replace(/\s/g,"");for(var e=r.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function Jxt(r,e){for(var t=r.length>=e.length?r:e,n=r.length>=e.length?e:r,i=!0,a=0;a<t.length;a++)n.indexOf(t[a])===-1&&(i=!1);return i}function xEe(r){yEe=r||"all"}function nC(){return yEe||"all"}function Qxt(){return ul.slice(0)}function e_t(r){var e=r.target||r.srcElement,t=e.tagName,n=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(n=!1),n}function t_t(r){return typeof r=="string"&&(r=YL(r)),ul.indexOf(r)!==-1}function r_t(r,e){var t,n;r||(r=nC());for(var i in qc)if(Object.prototype.hasOwnProperty.call(qc,i))for(t=qc[i],n=0;n<t.length;)t[n].scope===r?t.splice(n,1):n++;nC()===r&&xEe(e||"all")}function n_t(r){var e=r.keyCode||r.which||r.charCode,t=ul.indexOf(e);if(t>=0&&ul.splice(t,1),r.key&&r.key.toLowerCase()==="meta"&&ul.splice(0,ul.length),(e===93||e===224)&&(e=91),e in Jc){Jc[e]=!1;for(var n in u0)u0[n]===e&&(Sy[n]=!1)}}function i_t(r){if(!r)Object.keys(qc).forEach(function(l){return delete qc[l]});else if(Array.isArray(r))r.forEach(function(l){l.key&&C9(l)});else if(typeof r=="object")r.key&&C9(r);else if(typeof r=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var i=t[0],a=t[1];typeof i=="function"&&(a=i,i=""),C9({key:r,scope:i,method:a,splitKey:"+"})}}function hEe(r,e,t){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var i in Jc)Object.prototype.hasOwnProperty.call(Jc,i)&&(!Jc[i]&&e.mods.indexOf(+i)>-1||Jc[i]&&e.mods.indexOf(+i)===-1)&&(n=!1);(e.mods.length===0&&!Jc[16]&&!Jc[18]&&!Jc[17]&&!Jc[91]||n||e.shortcut==="*")&&e.method(r,e)===!1&&(r.preventDefault?r.preventDefault():r.returnValue=!1,r.stopPropagation&&r.stopPropagation(),r.cancelBubble&&(r.cancelBubble=!0))}}function dEe(r){var e=qc["*"],t=r.keyCode||r.which||r.charCode;if(!!Sy.filter.call(this,r)){if((t===93||t===224)&&(t=91),ul.indexOf(t)===-1&&t!==229&&ul.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(z){var Y=fEe[z];r[z]&&ul.indexOf(Y)===-1?ul.push(Y):!r[z]&&ul.indexOf(Y)>-1?ul.splice(ul.indexOf(Y),1):z==="metaKey"&&r[z]&&ul.length===3&&(r.ctrlKey||r.shiftKey||r.altKey||(ul=ul.slice(ul.indexOf(Y))))}),t in Jc){Jc[t]=!0;for(var n in u0)u0[n]===t&&(Sy[n]=!0);if(!e)return}for(var i in Jc)Object.prototype.hasOwnProperty.call(Jc,i)&&(Jc[i]=r[fEe[i]]);r.getModifierState&&!(r.altKey&&!r.ctrlKey)&&r.getModifierState("AltGraph")&&(ul.indexOf(17)===-1&&ul.push(17),ul.indexOf(18)===-1&&ul.push(18),Jc[17]=!0,Jc[18]=!0);var a=nC();if(e)for(var l=0;l<e.length;l++)e[l].scope===a&&(r.type==="keydown"&&e[l].keydown||r.type==="keyup"&&e[l].keyup)&&hEe(r,e[l],a);if(t in qc){for(var h=0;h<qc[t].length;h++)if((r.type==="keydown"&&qc[t][h].keydown||r.type==="keyup"&&qc[t][h].keyup)&&qc[t][h].key){for(var g=qc[t][h],w=g.splitKey,C=g.key.split(w),D=[],F=0;F<C.length;F++)D.push(YL(C[F]));D.sort().join("")===ul.sort().join("")&&hEe(r,g,a)}}}}function o_t(r){return bEe.indexOf(r)>-1}function Sy(r,e,t){ul=[];var n=gEe(r),i=[],a="all",l=document,h=0,g=!1,w=!0,C="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(l=e.element),e.keyup&&(g=e.keyup),e.keydown!==void 0&&(w=e.keydown),typeof e.splitKey=="string"&&(C=e.splitKey)),typeof e=="string"&&(a=e);h<n.length;h++)r=n[h].split(C),i=[],r.length>1&&(i=mEe(u0,r)),r=r[r.length-1],r=r==="*"?"*":YL(r),r in qc||(qc[r]=[]),qc[r].push({keyup:g,keydown:w,scope:a,mods:i,shortcut:n[h],method:t,key:n[h],splitKey:C});typeof l<"u"&&!o_t(l)&&window&&(bEe.push(l),k9(l,"keydown",function(D){dEe(D)}),k9(window,"focus",function(){ul=[]}),k9(l,"keyup",function(D){dEe(D),n_t(D)}))}var E9,vEe,u0,fEe,Jc,qc,rC,ul,yEe,bEe,YL,C9,A9,KL,pEe,_Ee=ze(()=>{E9=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;vEe={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":E9?173:189,"=":E9?61:187,";":E9?59:186,"'":222,"[":219,"]":221,"\\":220},u0={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},fEe={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Jc={16:!1,18:!1,17:!1,91:!1},qc={};for(rC=1;rC<20;rC++)vEe["f".concat(rC)]=111+rC;ul=[],yEe="all",bEe=[],YL=function(e){return vEe[e.toLowerCase()]||u0[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};C9=function(e){var t=e.key,n=e.scope,i=e.method,a=e.splitKey,l=a===void 0?"+":a,h=gEe(t);h.forEach(function(g){var w=g.split(l),C=w.length,D=w[C-1],F=D==="*"?"*":YL(D);if(!!qc[F]){n||(n=nC());var z=C>1?mEe(u0,w):[];qc[F]=qc[F].map(function(Y){var $=i?Y.method===i:!0;return $&&Y.scope===n&&Jxt(Y.mods,z)?{}:Y})}})};A9={setScope:xEe,getScope:nC,deleteScope:r_t,getPressedKeyCodes:Qxt,isPressed:t_t,filter:e_t,unbind:i_t};for(KL in A9)Object.prototype.hasOwnProperty.call(A9,KL)&&(Sy[KL]=A9[KL]);typeof window<"u"&&(pEe=window.hotkeys,Sy.noConflict=function(r){return r&&window.hotkeys===Sy&&(window.hotkeys=pEe),Sy},window.hotkeys=Sy)});function l_t(r){let e=r.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,i=e.top<=t&&e.top+e.height>=0,a=e.left<=n&&e.left+e.width>=0;return i&&a}var a_t,s_t,u_t,wEe,D9,O9,SEe=ze(()=>{bo();_Ee();a_t=(r,e,t)=>{let n=r;return t===!0?n=`${e.identifier}:${r}`:typeof t=="string"&&(n=`${t}:${r}`),n},s_t=(r,e,t)=>{let{bubbles:n,cancelable:i,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(t,{originalEvent:e}),new CustomEvent(r,{bubbles:n,cancelable:i,composed:a,detail:t})};u_t={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},wEe=(r,e={})=>{let{onlyVisible:t,dispatchEvent:n,events:i,eventPrefix:a}=Object.assign({},u_t,e),l=C=>{let D=e?.element||r.element;if(!(D.contains(C.target)||!l_t(D)&&t)&&(r.clickOutside&&r.clickOutside(C),n)){let F=a_t("click:outside",r,a),z=s_t(F,C,{controller:r});D.dispatchEvent(z)}},h=()=>{i?.forEach(C=>{window.addEventListener(C,l,!1)})},g=()=>{i?.forEach(C=>{window.removeEventListener(C,l,!1)})},w=r.disconnect.bind(r);return Object.assign(r,{disconnect(){g(),w()}}),h(),[h,g]};D9=class extends nn{};D9.debounces=[];O9=class extends nn{};O9.throttles=[]});var W1,TEe=ze(()=>{bo();_9();SEe();W1=class extends nn{get exemptionContainerTarget(){return document.querySelector(this.exemptionContainerValue)}connect(){wEe(this)}clickOutside(r){this.hasPanelTarget&&(this.hasExemptionContainerValue?this.exemptionContainerTarget.contains(r.target)||B1(this.panelTarget):B1(this.panelTarget))}togglePanel(){this.hasPanelTarget&&$L(this.panelTarget)}outlet({params:r}){let{outlet:e}=r;e&&document.querySelector(e)&&document.querySelector(e).classList.toggle("hidden")}};Wr(W1,"targets",["panel"]),Wr(W1,"values",{exemptionContainer:String})});function XL(r){var e,t;function n(a,l){try{var h=r[a](l),g=h.value,w=g instanceof L_t;Promise.resolve(w?g.v:g).then(function(C){if(w){var D=a==="return"?"return":"next";if(!g.k||C.done)return n(D,C);C=r[D](C).value}i(h.done?"return":"normal",C)},function(C){n("throw",C)})}catch(C){i("throw",C)}}function i(a,l){switch(a){case"return":e.resolve({value:l,done:!0});break;case"throw":e.reject(l);break;default:e.resolve({value:l,done:!1})}(e=e.next)?n(e.key,e.arg):t=null}this._invoke=function(a,l){return new Promise(function(h,g){var w={key:a,arg:l,resolve:h,reject:g,next:null};t?t=t.next=w:(e=t=w,n(a,l))})},typeof r.return!="function"&&(this.return=void 0)}function L_t(r,e){this.v=r,this.k=e}function xd(r,e,t){return(e=P_t(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function P_t(r){var e=function(t,n){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,n||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(r,"string");return typeof e=="symbol"?e:String(e)}var c_t,h0,uH,Nh,EEe,kEe,I9,mC,to,f_t,JEe,SP,Ey,QEe,cH,h_t,Fl,sC,eke,ky,fH,f0,M9,Cy,eP,Fh,Bo,iC,lC,L9,CEe,$1,d_t,G1,d0,tke,uC,hH,JL,g0,rke,Y9,gC,iu,p_t,AEe,m_t,P9,R9,F9,v0,g_t,v_t,y_t,Z9,X9,b_t,Zg,y0,dH,x_t,__t,q9,N9,B9,ZL,J9,Zu,w_t,Q9,S_t,nke,T_t,E_t,DEe,OEe,ike,oke,pH,ake,vC,es,Yg,tP,IEe,eH,rP,b0,ske,cC,lke,k_t,MEe,aC,mH,gH,LEe,z9,Jf,C_t,A_t,QL,oC,D_t,fC,tH,rH,PEe,K1,Xg,nH,Ty,hC,REe,O_t,nP,iP,oP,I_t,FEe,aP,Y1,qEe,M_t,NEe,Jg,sP,Ay,Dy,dC,Z1,R_t,F_t,q_t,bd,rm,N_t,B_t,z_t,U_t,uke,j_t,BEe,zEe,UEe,qh,jEe,H_t,W_t,V_t,lP,$_t,U9,HEe,x0,WEe,G_t,VEe,K_t,Y_t,Z_t,cke,X_t,iH,J_t,Q_t,e1t,t1t,Rl,uP,cP,zm,pC,r1t,j9,fP,fke,n1t,hP,dP,H9,i1t,o1t,hke,pP,Kg,dke,a1t,W9,c0,s1t,V9,mP,gP,vP,pke,l1t,u1t,yP,oH,bP,aH,c1t,f1t,$Ee,X1,$9,h1t,mke,d1t,tm,p1t,m1t,g1t,v1t,Bm,p0,y1t,G9,b1t,x1t,_1t,K9,sH,lH,w1t,TP,S1t,T1t,GEe,KEe,YEe,V1,xP,m0,E1t,k1t,C1t,_P,A1t,D1t,O1t,I1t,M1t,ZEe,wP,XEe,gke=ze(()=>{c_t="2.0.8",h0="[data-trix-attachment]",uH={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Nh={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(r){return EEe(r.parentNode)===Nh[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(r){return EEe(r.parentNode)===Nh[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},EEe=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},kEe=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),I9=kEe&&parseInt(kEe[1]),mC={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:I9&&I9>12,samsungAndroid:I9&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(r=>r in InputEvent.prototype)},to={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",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\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},f_t=[to.bytes,to.KB,to.MB,to.GB,to.TB,to.PB],JEe={prefix:"IEC",precision:2,formatter(r){switch(r){case 0:return"0 ".concat(to.bytes);case 1:return"1 ".concat(to.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);let t=Math.floor(Math.log(r)/Math.log(e)),n=(r/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(f_t[t])}}},SP="\uFEFF",Ey="\xA0",QEe=function(r){for(let e in r){let t=r[e];this[e]=t}return this},cH=document.documentElement,h_t=cH.matches,Fl=function(r){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:i,preventDefault:a,times:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=e||cH,g=t,w=i==="capturing",C=function(D){l!=null&&--l==0&&C.destroy();let F=ky(D.target,{matchingSelector:g});F!=null&&(n?.call(F,D,F),a&&D.preventDefault())};return C.destroy=()=>h.removeEventListener(r,C,w),h.addEventListener(r,C,w),C},sC=function(r){let{onElement:e,bubbles:t,cancelable:n,attributes:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e??cH;t=t!==!1,n=n!==!1;let l=document.createEvent("Events");return l.initEvent(r,t,n),i!=null&&QEe.call(l,i),a.dispatchEvent(l)},eke=function(r,e){if(r?.nodeType===1)return h_t.call(r,e)},ky=function(r){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.parentNode;if(r!=null){if(e==null)return r;if(r.closest&&t==null)return r.closest(e);for(;r&&r!==t;){if(eke(r,e))return r;r=r.parentNode}}},fH=r=>document.activeElement!==r&&f0(r,document.activeElement),f0=function(r,e){if(r&&e)for(;e;){if(e===r)return!0;e=e.parentNode}},M9=function(r){var e;if((e=r)===null||e===void 0||!e.parentNode)return;let t=0;for(r=r.previousSibling;r;)t++,r=r.previousSibling;return t},Cy=r=>{var e;return r==null||(e=r.parentNode)===null||e===void 0?void 0:e.removeChild(r)},eP=function(r){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(()=>{switch(e){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(r,i,t??null,n===!0)},Fh=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},Bo=function(r){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof r=="object"?(n=r,r=n.tagName):n={attributes:n};let i=document.createElement(r);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],i.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],i.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],i.dataset[e]=t;return n.className&&n.className.split(" ").forEach(a=>{i.classList.add(a)}),n.textContent&&(i.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(a=>{i.appendChild(a)}),i},lC=function(){if(iC!=null)return iC;iC=[];for(let r in Nh){let e=Nh[r];e.tagName&&iC.push(e.tagName)}return iC},L9=r=>$1(r?.firstChild),CEe=function(r){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?$1(r):$1(r)||!$1(r.firstChild)&&function(t){return lC().includes(Fh(t))&&!lC().includes(Fh(t.firstChild))}(r)},$1=r=>d_t(r)&&r?.data==="block",d_t=r=>r?.nodeType===Node.COMMENT_NODE,G1=function(r){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r)return uC(r)?r.data===SP?!e||r.parentNode.dataset.trixCursorTarget===e:void 0:G1(r.firstChild)},d0=r=>eke(r,h0),tke=r=>uC(r)&&r?.data==="",uC=r=>r?.nodeType===Node.TEXT_NODE,hH={level2Enabled:!0,getLevel(){return this.level2Enabled&&mC.supportsInputEvents?2:0},pickFiles(r){let e=Bo("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{r(e.files),Cy(e)}),Cy(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}},JL={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:`
800
+ `}var oEe=ze(()=>{});var l0,aEe,sEe,H1,lEe=ze(()=>{bo();l0=la(tEe()),aEe=la(rEe()),sEe=la(Y_());oEe();g9();H1=class extends nn{constructor(){super(...arguments);Wr(this,"tagify",null);Wr(this,"searchDebounce",500);Wr(this,"debouncedFetch",WL(fetch,this.searchDebounce))}get suggestionsAreObjects(){return(0,l0.isObject)((0,l0.first)(this.whitelistItemsValue))||this.fetchValuesFromValue}get tagifyOptions(){let e={whitelist:this.whitelistItemsValue,blacklist:this.disallowedItemsValue,enforceWhitelist:this.enforceSuggestionsValue||this.fetchValuesFromValue,delimiters:this.delimitersValue.join("|"),dropdown:{maxItems:this.suggestionsMaxItemsValue,enabled:0,searchKeys:[this.labelAttributeValue],closeOnSelect:this.closeOnSelectValue}};return this.modeValue&&(e.mode=this.modeValue),this.suggestionsAreObjects?e=(0,l0.merge)(e,{tagTextProp:"label",dropdown:{searchKeys:["label"],mapValueTo:"value"},templates:{tag:nEe,dropdownItem:iEe},originalInputValueFormat:t=>t.map(n=>n.value)}):e=(0,l0.merge)(e,{originalInputValueFormat:t=>t.map(n=>n.value).join(",")}),e}connect(){this.hasInputTarget&&(this.hideFakeInput(),this.showRealInput(),this.initTagify())}initTagify(){this.tagify=new aEe.default(this.inputTarget,this.tagifyOptions);let e=this;function t(n){let i=n.detail.value,a=new sEe.default(e.fetchValuesFromValue);a.addSearch({q:i}),e.tagify.whitelist=null,e.tagify.loading(!0),e.fetchResults(a.toString()).then(l=>{e.tagify.settings.whitelist=l,e.tagify.loading(!1).dropdown.show(n.detail.value)}).catch(()=>e.tagify.dropdown.hide())}this.fetchValuesFromValue&&this.tagify.on("input",t)}fetchResults(e){return this.debouncedFetch(e).then(t=>t.json())}hideFakeInput(){this.fakeInputTarget.classList.add("hidden")}showRealInput(){this.inputTarget.classList.remove("hidden")}};Wr(H1,"targets",["input","fakeInput"]),Wr(H1,"values",{whitelistItems:{type:Array,default:[]},disallowedItems:{type:Array,default:[]},enforceSuggestions:{type:Boolean,default:!1},closeOnSelect:{type:Boolean,default:!1},delimiters:{type:Array,default:[]},suggestionsMaxItems:{type:Number,default:20},mode:String,fetchValuesFrom:String})});var eC,uEe=ze(()=>{Z_();eC=class extends Ah{getFilterValue(){return this.textTarget.value}tryToSubmit(r){if(r.keyCode===13)return this.changeFilter()}getFilterClass(){let{filterClass:r}=this.textTarget.dataset;return r}};Wr(eC,"targets",["text"])});var tC,cEe=ze(()=>{bo();KI();tC=class extends nn{connect(){H_(this.sourceTarget,{content:this.contentTarget.innerHTML,allowHTML:!0,theme:"light"})}};Wr(tC,"targets",["source","content"])});function k9(r,e,t){r.addEventListener?r.addEventListener(e,t,!1):r.attachEvent&&r.attachEvent("on".concat(e),function(){t(window.event)})}function mEe(r,e){for(var t=e.slice(0,e.length-1),n=0;n<t.length;n++)t[n]=r[t[n].toLowerCase()];return t}function gEe(r){typeof r!="string"&&(r=""),r=r.replace(/\s/g,"");for(var e=r.split(","),t=e.lastIndexOf("");t>=0;)e[t-1]+=",",e.splice(t,1),t=e.lastIndexOf("");return e}function Jxt(r,e){for(var t=r.length>=e.length?r:e,n=r.length>=e.length?e:r,i=!0,a=0;a<t.length;a++)n.indexOf(t[a])===-1&&(i=!1);return i}function xEe(r){yEe=r||"all"}function nC(){return yEe||"all"}function Qxt(){return ul.slice(0)}function e_t(r){var e=r.target||r.srcElement,t=e.tagName,n=!0;return(e.isContentEditable||(t==="INPUT"||t==="TEXTAREA"||t==="SELECT")&&!e.readOnly)&&(n=!1),n}function t_t(r){return typeof r=="string"&&(r=YL(r)),ul.indexOf(r)!==-1}function r_t(r,e){var t,n;r||(r=nC());for(var i in qc)if(Object.prototype.hasOwnProperty.call(qc,i))for(t=qc[i],n=0;n<t.length;)t[n].scope===r?t.splice(n,1):n++;nC()===r&&xEe(e||"all")}function n_t(r){var e=r.keyCode||r.which||r.charCode,t=ul.indexOf(e);if(t>=0&&ul.splice(t,1),r.key&&r.key.toLowerCase()==="meta"&&ul.splice(0,ul.length),(e===93||e===224)&&(e=91),e in Jc){Jc[e]=!1;for(var n in u0)u0[n]===e&&(Sy[n]=!1)}}function i_t(r){if(!r)Object.keys(qc).forEach(function(l){return delete qc[l]});else if(Array.isArray(r))r.forEach(function(l){l.key&&C9(l)});else if(typeof r=="object")r.key&&C9(r);else if(typeof r=="string"){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];var i=t[0],a=t[1];typeof i=="function"&&(a=i,i=""),C9({key:r,scope:i,method:a,splitKey:"+"})}}function hEe(r,e,t){var n;if(e.scope===t||e.scope==="all"){n=e.mods.length>0;for(var i in Jc)Object.prototype.hasOwnProperty.call(Jc,i)&&(!Jc[i]&&e.mods.indexOf(+i)>-1||Jc[i]&&e.mods.indexOf(+i)===-1)&&(n=!1);(e.mods.length===0&&!Jc[16]&&!Jc[18]&&!Jc[17]&&!Jc[91]||n||e.shortcut==="*")&&e.method(r,e)===!1&&(r.preventDefault?r.preventDefault():r.returnValue=!1,r.stopPropagation&&r.stopPropagation(),r.cancelBubble&&(r.cancelBubble=!0))}}function dEe(r){var e=qc["*"],t=r.keyCode||r.which||r.charCode;if(!!Sy.filter.call(this,r)){if((t===93||t===224)&&(t=91),ul.indexOf(t)===-1&&t!==229&&ul.push(t),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(z){var Y=fEe[z];r[z]&&ul.indexOf(Y)===-1?ul.push(Y):!r[z]&&ul.indexOf(Y)>-1?ul.splice(ul.indexOf(Y),1):z==="metaKey"&&r[z]&&ul.length===3&&(r.ctrlKey||r.shiftKey||r.altKey||(ul=ul.slice(ul.indexOf(Y))))}),t in Jc){Jc[t]=!0;for(var n in u0)u0[n]===t&&(Sy[n]=!0);if(!e)return}for(var i in Jc)Object.prototype.hasOwnProperty.call(Jc,i)&&(Jc[i]=r[fEe[i]]);r.getModifierState&&!(r.altKey&&!r.ctrlKey)&&r.getModifierState("AltGraph")&&(ul.indexOf(17)===-1&&ul.push(17),ul.indexOf(18)===-1&&ul.push(18),Jc[17]=!0,Jc[18]=!0);var a=nC();if(e)for(var l=0;l<e.length;l++)e[l].scope===a&&(r.type==="keydown"&&e[l].keydown||r.type==="keyup"&&e[l].keyup)&&hEe(r,e[l],a);if(t in qc){for(var h=0;h<qc[t].length;h++)if((r.type==="keydown"&&qc[t][h].keydown||r.type==="keyup"&&qc[t][h].keyup)&&qc[t][h].key){for(var g=qc[t][h],w=g.splitKey,C=g.key.split(w),D=[],F=0;F<C.length;F++)D.push(YL(C[F]));D.sort().join("")===ul.sort().join("")&&hEe(r,g,a)}}}}function o_t(r){return bEe.indexOf(r)>-1}function Sy(r,e,t){ul=[];var n=gEe(r),i=[],a="all",l=document,h=0,g=!1,w=!0,C="+";for(t===void 0&&typeof e=="function"&&(t=e),Object.prototype.toString.call(e)==="[object Object]"&&(e.scope&&(a=e.scope),e.element&&(l=e.element),e.keyup&&(g=e.keyup),e.keydown!==void 0&&(w=e.keydown),typeof e.splitKey=="string"&&(C=e.splitKey)),typeof e=="string"&&(a=e);h<n.length;h++)r=n[h].split(C),i=[],r.length>1&&(i=mEe(u0,r)),r=r[r.length-1],r=r==="*"?"*":YL(r),r in qc||(qc[r]=[]),qc[r].push({keyup:g,keydown:w,scope:a,mods:i,shortcut:n[h],method:t,key:n[h],splitKey:C});typeof l<"u"&&!o_t(l)&&window&&(bEe.push(l),k9(l,"keydown",function(D){dEe(D)}),k9(window,"focus",function(){ul=[]}),k9(l,"keyup",function(D){dEe(D),n_t(D)}))}var E9,vEe,u0,fEe,Jc,qc,rC,ul,yEe,bEe,YL,C9,A9,KL,pEe,_Ee=ze(()=>{E9=typeof navigator<"u"?navigator.userAgent.toLowerCase().indexOf("firefox")>0:!1;vEe={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,num_0:96,num_1:97,num_2:98,num_3:99,num_4:100,num_5:101,num_6:102,num_7:103,num_8:104,num_9:105,num_multiply:106,num_add:107,num_enter:108,num_subtract:109,num_decimal:110,num_divide:111,"\u21EA":20,",":188,".":190,"/":191,"`":192,"-":E9?173:189,"=":E9?61:187,";":E9?59:186,"'":222,"[":219,"]":221,"\\":220},u0={"\u21E7":16,shift:16,"\u2325":18,alt:18,option:18,"\u2303":17,ctrl:17,control:17,"\u2318":91,cmd:91,command:91},fEe={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},Jc={16:!1,18:!1,17:!1,91:!1},qc={};for(rC=1;rC<20;rC++)vEe["f".concat(rC)]=111+rC;ul=[],yEe="all",bEe=[],YL=function(e){return vEe[e.toLowerCase()]||u0[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};C9=function(e){var t=e.key,n=e.scope,i=e.method,a=e.splitKey,l=a===void 0?"+":a,h=gEe(t);h.forEach(function(g){var w=g.split(l),C=w.length,D=w[C-1],F=D==="*"?"*":YL(D);if(!!qc[F]){n||(n=nC());var z=C>1?mEe(u0,w):[];qc[F]=qc[F].map(function(Y){var $=i?Y.method===i:!0;return $&&Y.scope===n&&Jxt(Y.mods,z)?{}:Y})}})};A9={setScope:xEe,getScope:nC,deleteScope:r_t,getPressedKeyCodes:Qxt,isPressed:t_t,filter:e_t,unbind:i_t};for(KL in A9)Object.prototype.hasOwnProperty.call(A9,KL)&&(Sy[KL]=A9[KL]);typeof window<"u"&&(pEe=window.hotkeys,Sy.noConflict=function(r){return r&&window.hotkeys===Sy&&(window.hotkeys=pEe),Sy},window.hotkeys=Sy)});function l_t(r){let e=r.getBoundingClientRect(),t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth,i=e.top<=t&&e.top+e.height>=0,a=e.left<=n&&e.left+e.width>=0;return i&&a}var a_t,s_t,u_t,wEe,D9,O9,SEe=ze(()=>{bo();_Ee();a_t=(r,e,t)=>{let n=r;return t===!0?n=`${e.identifier}:${r}`:typeof t=="string"&&(n=`${t}:${r}`),n},s_t=(r,e,t)=>{let{bubbles:n,cancelable:i,composed:a}=e||{bubbles:!0,cancelable:!0,composed:!0};return e&&Object.assign(t,{originalEvent:e}),new CustomEvent(r,{bubbles:n,cancelable:i,composed:a,detail:t})};u_t={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},wEe=(r,e={})=>{let{onlyVisible:t,dispatchEvent:n,events:i,eventPrefix:a}=Object.assign({},u_t,e),l=C=>{let D=e?.element||r.element;if(!(D.contains(C.target)||!l_t(D)&&t)&&(r.clickOutside&&r.clickOutside(C),n)){let F=a_t("click:outside",r,a),z=s_t(F,C,{controller:r});D.dispatchEvent(z)}},h=()=>{i?.forEach(C=>{window.addEventListener(C,l,!1)})},g=()=>{i?.forEach(C=>{window.removeEventListener(C,l,!1)})},w=r.disconnect.bind(r);return Object.assign(r,{disconnect(){g(),w()}}),h(),[h,g]};D9=class extends nn{};D9.debounces=[];O9=class extends nn{};O9.throttles=[]});var W1,TEe=ze(()=>{bo();_9();SEe();W1=class extends nn{get exemptionContainerTarget(){return document.querySelector(this.exemptionContainerValue)}connect(){wEe(this)}clickOutside(r){this.hasPanelTarget&&(this.hasExemptionContainerValue?this.exemptionContainerTarget.contains(r.target)||B1(this.panelTarget):B1(this.panelTarget))}togglePanel(){this.hasPanelTarget&&$L(this.panelTarget)}outlet({params:r}){let{outlet:e}=r;e&&document.querySelector(e)&&document.querySelector(e).classList.toggle("hidden")}};Wr(W1,"targets",["panel"]),Wr(W1,"values",{exemptionContainer:String})});function XL(r){var e,t;function n(a,l){try{var h=r[a](l),g=h.value,w=g instanceof L_t;Promise.resolve(w?g.v:g).then(function(C){if(w){var D=a==="return"?"return":"next";if(!g.k||C.done)return n(D,C);C=r[D](C).value}i(h.done?"return":"normal",C)},function(C){n("throw",C)})}catch(C){i("throw",C)}}function i(a,l){switch(a){case"return":e.resolve({value:l,done:!0});break;case"throw":e.reject(l);break;default:e.resolve({value:l,done:!1})}(e=e.next)?n(e.key,e.arg):t=null}this._invoke=function(a,l){return new Promise(function(h,g){var w={key:a,arg:l,resolve:h,reject:g,next:null};t?t=t.next=w:(e=t=w,n(a,l))})},typeof r.return!="function"&&(this.return=void 0)}function L_t(r,e){this.v=r,this.k=e}function xd(r,e,t){return(e=P_t(e))in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function P_t(r){var e=function(t,n){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,n||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(n==="string"?String:Number)(t)}(r,"string");return typeof e=="symbol"?e:String(e)}var c_t,h0,uH,Nh,EEe,kEe,I9,mC,to,f_t,JEe,SP,Ey,QEe,cH,h_t,Fl,sC,eke,ky,fH,f0,M9,Cy,eP,Fh,Bo,iC,lC,L9,CEe,$1,d_t,G1,d0,tke,uC,hH,JL,g0,rke,Y9,gC,iu,p_t,AEe,m_t,P9,R9,F9,v0,g_t,v_t,y_t,Z9,X9,b_t,Zg,y0,dH,x_t,__t,q9,N9,B9,ZL,J9,Zu,w_t,Q9,S_t,nke,T_t,E_t,DEe,OEe,ike,oke,pH,ake,vC,es,Yg,tP,IEe,eH,rP,b0,ske,cC,lke,k_t,MEe,aC,mH,gH,LEe,z9,Jf,C_t,A_t,QL,oC,D_t,fC,tH,rH,PEe,K1,Xg,nH,Ty,hC,REe,O_t,nP,iP,oP,I_t,FEe,aP,Y1,qEe,M_t,NEe,Jg,sP,Ay,Dy,dC,Z1,R_t,F_t,q_t,bd,rm,N_t,B_t,z_t,U_t,uke,j_t,BEe,zEe,UEe,qh,jEe,H_t,W_t,V_t,lP,$_t,U9,HEe,x0,WEe,G_t,VEe,K_t,Y_t,Z_t,cke,X_t,iH,J_t,Q_t,e1t,t1t,Rl,uP,cP,zm,pC,r1t,j9,fP,fke,n1t,hP,dP,H9,i1t,o1t,hke,pP,Kg,dke,a1t,W9,c0,s1t,V9,mP,gP,vP,pke,l1t,u1t,yP,oH,bP,aH,c1t,f1t,$Ee,X1,$9,h1t,mke,d1t,tm,p1t,m1t,g1t,v1t,Bm,p0,y1t,G9,b1t,x1t,_1t,K9,sH,lH,w1t,TP,S1t,T1t,GEe,KEe,YEe,V1,xP,m0,E1t,k1t,C1t,_P,A1t,D1t,O1t,I1t,M1t,ZEe,wP,XEe,gke=ze(()=>{c_t="2.0.10",h0="[data-trix-attachment]",uH={preview:{presentation:"gallery",caption:{name:!0,size:!0}},file:{caption:{size:!0}}},Nh={default:{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},heading1:{tagName:"h1",terminal:!0,breakOnReturn:!0,group:!1},code:{tagName:"pre",terminal:!0,text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",group:!1,nestable:!0,test(r){return EEe(r.parentNode)===Nh[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",group:!1,nestable:!0,test(r){return EEe(r.parentNode)===Nh[this.listAttribute].tagName}},attachmentGallery:{tagName:"div",exclusive:!0,terminal:!0,parse:!1,group:!1}},EEe=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},kEe=navigator.userAgent.match(/android\s([0-9]+.*Chrome)/i),I9=kEe&&parseInt(kEe[1]),mC={composesExistingText:/Android.*Chrome/.test(navigator.userAgent),recentAndroid:I9&&I9>12,samsungAndroid:I9&&navigator.userAgent.match(/Android.*SM-/),forcesObjectResizing:/Trident.*rv:11/.test(navigator.userAgent),supportsInputEvents:typeof InputEvent<"u"&&["data","getTargetRanges","inputType"].every(r=>r in InputEvent.prototype)},to={attachFiles:"Attach Files",bold:"Bold",bullets:"Bullets",byte:"Byte",bytes:"Bytes",captionPlaceholder:"Add a caption\u2026",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\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"},f_t=[to.bytes,to.KB,to.MB,to.GB,to.TB,to.PB],JEe={prefix:"IEC",precision:2,formatter(r){switch(r){case 0:return"0 ".concat(to.bytes);case 1:return"1 ".concat(to.byte);default:let e;this.prefix==="SI"?e=1e3:this.prefix==="IEC"&&(e=1024);let t=Math.floor(Math.log(r)/Math.log(e)),n=(r/Math.pow(e,t)).toFixed(this.precision).replace(/0*$/,"").replace(/\.$/,"");return"".concat(n," ").concat(f_t[t])}}},SP="\uFEFF",Ey="\xA0",QEe=function(r){for(let e in r){let t=r[e];this[e]=t}return this},cH=document.documentElement,h_t=cH.matches,Fl=function(r){let{onElement:e,matchingSelector:t,withCallback:n,inPhase:i,preventDefault:a,times:l}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},h=e||cH,g=t,w=i==="capturing",C=function(D){l!=null&&--l==0&&C.destroy();let F=ky(D.target,{matchingSelector:g});F!=null&&(n?.call(F,D,F),a&&D.preventDefault())};return C.destroy=()=>h.removeEventListener(r,C,w),h.addEventListener(r,C,w),C},sC=function(r){let{onElement:e,bubbles:t,cancelable:n,attributes:i}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=e??cH;t=t!==!1,n=n!==!1;let l=document.createEvent("Events");return l.initEvent(r,t,n),i!=null&&QEe.call(l,i),a.dispatchEvent(l)},eke=function(r,e){if(r?.nodeType===1)return h_t.call(r,e)},ky=function(r){let{matchingSelector:e,untilNode:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};for(;r&&r.nodeType!==Node.ELEMENT_NODE;)r=r.parentNode;if(r!=null){if(e==null)return r;if(r.closest&&t==null)return r.closest(e);for(;r&&r!==t;){if(eke(r,e))return r;r=r.parentNode}}},fH=r=>document.activeElement!==r&&f0(r,document.activeElement),f0=function(r,e){if(r&&e)for(;e;){if(e===r)return!0;e=e.parentNode}},M9=function(r){var e;if((e=r)===null||e===void 0||!e.parentNode)return;let t=0;for(r=r.previousSibling;r;)t++,r=r.previousSibling;return t},Cy=r=>{var e;return r==null||(e=r.parentNode)===null||e===void 0?void 0:e.removeChild(r)},eP=function(r){let{onlyNodesOfType:e,usingFilter:t,expandEntityReferences:n}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=(()=>{switch(e){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(r,i,t??null,n===!0)},Fh=r=>{var e;return r==null||(e=r.tagName)===null||e===void 0?void 0:e.toLowerCase()},Bo=function(r){let e,t,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};typeof r=="object"?(n=r,r=n.tagName):n={attributes:n};let i=document.createElement(r);if(n.editable!=null&&(n.attributes==null&&(n.attributes={}),n.attributes.contenteditable=n.editable),n.attributes)for(e in n.attributes)t=n.attributes[e],i.setAttribute(e,t);if(n.style)for(e in n.style)t=n.style[e],i.style[e]=t;if(n.data)for(e in n.data)t=n.data[e],i.dataset[e]=t;return n.className&&n.className.split(" ").forEach(a=>{i.classList.add(a)}),n.textContent&&(i.textContent=n.textContent),n.childNodes&&[].concat(n.childNodes).forEach(a=>{i.appendChild(a)}),i},lC=function(){if(iC!=null)return iC;iC=[];for(let r in Nh){let e=Nh[r];e.tagName&&iC.push(e.tagName)}return iC},L9=r=>$1(r?.firstChild),CEe=function(r){let{strict:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{strict:!0};return e?$1(r):$1(r)||!$1(r.firstChild)&&function(t){return lC().includes(Fh(t))&&!lC().includes(Fh(t.firstChild))}(r)},$1=r=>d_t(r)&&r?.data==="block",d_t=r=>r?.nodeType===Node.COMMENT_NODE,G1=function(r){let{name:e}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(r)return uC(r)?r.data===SP?!e||r.parentNode.dataset.trixCursorTarget===e:void 0:G1(r.firstChild)},d0=r=>eke(r,h0),tke=r=>uC(r)&&r?.data==="",uC=r=>r?.nodeType===Node.TEXT_NODE,hH={level2Enabled:!0,getLevel(){return this.level2Enabled&&mC.supportsInputEvents?2:0},pickFiles(r){let e=Bo("input",{type:"file",multiple:!0,hidden:!0,id:this.fileInputId});e.addEventListener("change",()=>{r(e.files),Cy(e)}),Cy(document.getElementById(this.fileInputId)),document.body.appendChild(e),e.click()}},JL={removeBlankTableCells:!1,tableCellSeparator:" | ",tableRowSeparator:`
801
801
  `},g0={bold:{tagName:"strong",inheritable:!0,parser(r){let e=window.getComputedStyle(r);return e.fontWeight==="bold"||e.fontWeight>=600}},italic:{tagName:"em",inheritable:!0,parser:r=>window.getComputedStyle(r).fontStyle==="italic"},href:{groupTagName:"a",parser(r){let e="a:not(".concat(h0,")"),t=r.closest(e);if(t)return t.getAttribute("href")}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}},rke={getDefaultHTML:()=>`<div class="trix-button-row">
802
802
  <span class="trix-button-group trix-button-group--text-tools" data-trix-button-group="text-tools">
803
803
  <button type="button" class="trix-button trix-button--icon trix-button--icon-bold" data-trix-attribute="bold" data-trix-key="b" title="`.concat(to.bold,'" tabindex="-1">').concat(to.bold,`</button>
@@ -870,7 +870,7 @@ function print() { __p += __j.call(arguments, '') }
870
870
  `&&!a;if(l&&!h||h&&!l){let w=this.getSelectedRange();if(w){var g;let C=l?t.replace(/\n$/,"").length||-1:t?.length||1;if((g=this.responder)!==null&&g!==void 0&&g.positionIsBlockBreak(w[1]+C))return!0}}return i&&a}mutationIsSignificant(e){var t;let n=Object.keys(e).length>0,i=((t=this.compositionInput)===null||t===void 0?void 0:t.getEndData())==="";return n||!i}getCompositionInput(){if(this.isComposing())return this.compositionInput;this.compositionInput=new Bm(this)}isComposing(){return this.compositionInput&&!this.compositionInput.isEnded()}deleteInDirection(e,t){var n;return((n=this.responder)===null||n===void 0?void 0:n.deleteInDirection(e))!==!1?this.setInputSummary({didDelete:!0}):t?(t.preventDefault(),this.requestRender()):void 0}serializeSelectionToDataTransfer(e){var t;if(!function(i){if(i==null||!i.setData)return!1;for(let a in OEe){let l=OEe[a];try{if(i.setData(a,l),!i.getData(a)===l)return!1}catch{return!1}}return!0}(e))return;let n=(t=this.responder)===null||t===void 0?void 0:t.getSelectedDocument().toSerializableDocument();return e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",Y1.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0}canAcceptDataTransfer(e){let t={};return Array.from(e?.types||[]).forEach(n=>{t[n]=!0}),t.Files||t["application/x-trix-document"]||t["text/html"]||t["text/plain"]}getPastedHTMLUsingHiddenElement(e){let t=this.getSelectedRange(),n={position:"absolute",left:"".concat(window.pageXOffset,"px"),top:"".concat(window.pageYOffset,"px"),opacity:0},i=Bo({style:n,tagName:"div",editable:!0});return document.body.appendChild(i),i.focus(),requestAnimationFrame(()=>{let a=i.innerHTML;return Cy(i),this.setSelectedRange(t),e(a)})}};xd(tm,"events",{keydown(r){this.isComposing()||this.resetInputSummary(),this.inputSummary.didInput=!0;let e=mke[r.keyCode];if(e){var t;let i=this.keys;["ctrl","alt","shift","meta"].forEach(a=>{var l;r["".concat(a,"Key")]&&(a==="ctrl"&&(a="control"),i=(l=i)===null||l===void 0?void 0:l[a])}),((t=i)===null||t===void 0?void 0:t[e])!=null&&(this.setInputSummary({keyName:e}),b0.reset(),i[e].call(this,r))}if(oke(r)){let i=String.fromCharCode(r.keyCode).toLowerCase();if(i){var n;let a=["alt","shift"].map(l=>{if(r["".concat(l,"Key")])return l}).filter(l=>l);a.push(i),(n=this.delegate)!==null&&n!==void 0&&n.inputControllerDidReceiveKeyboardCommand(a)&&r.preventDefault()}}},keypress(r){if(this.inputSummary.eventName!=null||r.metaKey||r.ctrlKey&&!r.altKey)return;let e=g1t(r);var t,n;return e?((t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},textInput(r){let{data:e}=r,{textAdded:t}=this.inputSummary;if(t&&t!==e&&t.toUpperCase()===e){var n;let i=this.getSelectedRange();return this.setSelectedRange([i[0],i[1]+t.length]),(n=this.responder)===null||n===void 0||n.insertString(e),this.setInputSummary({textAdded:e}),this.setSelectedRange(i)}},dragenter(r){r.preventDefault()},dragstart(r){var e,t;return this.serializeSelectionToDataTransfer(r.dataTransfer),this.draggedRange=this.getSelectedRange(),(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidStartDrag)===null||t===void 0?void 0:t.call(e)},dragover(r){if(this.draggedRange||this.canAcceptDataTransfer(r.dataTransfer)){r.preventDefault();let n={x:r.clientX,y:r.clientY};var e,t;if(!vC(n,this.draggingPoint))return this.draggingPoint=n,(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidReceiveDragOverPoint)===null||t===void 0?void 0:t.call(e,this.draggingPoint)}},dragend(r){var e,t;(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidCancelDrag)===null||t===void 0||t.call(e),this.draggedRange=null,this.draggingPoint=null},drop(r){var e,t;r.preventDefault();let n=(e=r.dataTransfer)===null||e===void 0?void 0:e.files,i=r.dataTransfer.getData("application/x-trix-document"),a={x:r.clientX,y:r.clientY};if((t=this.responder)===null||t===void 0||t.setLocationRangeFromPointRange(a),n!=null&&n.length)this.attachFiles(n);else if(this.draggedRange){var l,h;(l=this.delegate)===null||l===void 0||l.inputControllerWillMoveText(),(h=this.responder)===null||h===void 0||h.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()}else if(i){var g;let w=qh.fromJSONString(i);(g=this.responder)===null||g===void 0||g.insertDocument(w),this.requestRender()}this.draggedRange=null,this.draggingPoint=null},cut(r){var e,t;if((e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&(this.serializeSelectionToDataTransfer(r.clipboardData)&&r.preventDefault(),(t=this.delegate)===null||t===void 0||t.inputControllerWillCutText(),this.deleteInDirection("backward"),r.defaultPrevented))return this.requestRender()},copy(r){var e;(e=this.responder)!==null&&e!==void 0&&e.selectionIsExpanded()&&this.serializeSelectionToDataTransfer(r.clipboardData)&&r.preventDefault()},paste(r){let e=r.clipboardData||r.testClipboardData,t={clipboard:e};if(!e||v1t(r))return void this.getPastedHTMLUsingHiddenElement(_=>{var ge,fe,me;return t.type="text/html",t.html=_,(ge=this.delegate)===null||ge===void 0||ge.inputControllerWillPaste(t),(fe=this.responder)===null||fe===void 0||fe.insertHTML(t.html),this.requestRender(),(me=this.delegate)===null||me===void 0?void 0:me.inputControllerDidPaste(t)});let n=e.getData("URL"),i=e.getData("text/html"),a=e.getData("public.url-name");if(n){var l,h,g;let _;t.type="text/html",_=a?gH(a).trim():n,t.html=this.createLinkHTML(n,_),(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),this.setInputSummary({textAdded:_,didDelete:this.selectionIsExpanded()}),(h=this.responder)===null||h===void 0||h.insertHTML(t.html),this.requestRender(),(g=this.delegate)===null||g===void 0||g.inputControllerDidPaste(t)}else if(ike(e)){var w,C,D;t.type="text/plain",t.string=e.getData("text/plain"),(w=this.delegate)===null||w===void 0||w.inputControllerWillPaste(t),this.setInputSummary({textAdded:t.string,didDelete:this.selectionIsExpanded()}),(C=this.responder)===null||C===void 0||C.insertString(t.string),this.requestRender(),(D=this.delegate)===null||D===void 0||D.inputControllerDidPaste(t)}else if(i){var F,z,Y;t.type="text/html",t.html=i,(F=this.delegate)===null||F===void 0||F.inputControllerWillPaste(t),(z=this.responder)===null||z===void 0||z.insertHTML(t.html),this.requestRender(),(Y=this.delegate)===null||Y===void 0||Y.inputControllerDidPaste(t)}else if(Array.from(e.types).includes("Files")){var $,re;let _=($=e.items)===null||$===void 0||($=$[0])===null||$===void 0||(re=$.getAsFile)===null||re===void 0?void 0:re.call($);if(_){var oe,ne,he;let ge=p1t(_);!_.name&&ge&&(_.name="pasted-file-".concat(++d1t,".").concat(ge)),t.type="File",t.file=_,(oe=this.delegate)===null||oe===void 0||oe.inputControllerWillAttachFiles(),(ne=this.responder)===null||ne===void 0||ne.insertFile(t.file),this.requestRender(),(he=this.delegate)===null||he===void 0||he.inputControllerDidPaste(t)}}r.preventDefault()},compositionstart(r){return this.getCompositionInput().start(r.data)},compositionupdate(r){return this.getCompositionInput().update(r.data)},compositionend(r){return this.getCompositionInput().end(r.data)},beforeinput(r){this.inputSummary.didInput=!0},input(r){return this.inputSummary.didInput=!0,r.stopPropagation()}}),xd(tm,"keys",{backspace(r){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",r)},delete(r){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",r)},return(r){var e,t;return this.setInputSummary({preferDocument:!0}),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0?void 0:t.insertLineBreak()},tab(r){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canIncreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.increaseNestingLevel(),this.requestRender(),r.preventDefault())},left(r){var e;if(this.selectionIsInCursorTarget())return r.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},right(r){var e;if(this.selectionIsInCursorTarget())return r.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},control:{d(r){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",r)},h(r){var e;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",r)},o(r){var e,t;return r.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(`
871
871
  `,{updatePosition:!1}),this.requestRender()}},shift:{return(r){var e,t;(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.insertString(`
872
872
  `),this.requestRender(),r.preventDefault()},tab(r){var e,t;(e=this.responder)!==null&&e!==void 0&&e.canDecreaseNestingLevel()&&((t=this.responder)===null||t===void 0||t.decreaseNestingLevel(),this.requestRender(),r.preventDefault())},left(r){if(this.selectionIsInCursorTarget())return r.preventDefault(),this.expandSelectionInDirection("backward")},right(r){if(this.selectionIsInCursorTarget())return r.preventDefault(),this.expandSelectionInDirection("forward")}},alt:{backspace(r){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}},meta:{backspace(r){var e;return this.setInputSummary({preferDocument:!1}),(e=this.delegate)===null||e===void 0?void 0:e.inputControllerWillPerformTyping()}}}),tm.proxyMethod("responder?.getSelectedRange"),tm.proxyMethod("responder?.setSelectedRange"),tm.proxyMethod("responder?.expandSelectionInDirection"),tm.proxyMethod("responder?.selectionIsInCursorTarget"),tm.proxyMethod("responder?.selectionIsExpanded");p1t=r=>{var e;return(e=r.type)===null||e===void 0||(e=e.match(/\/(\w+)$/))===null||e===void 0?void 0:e[1]},m1t=!(($9=" ".codePointAt)===null||$9===void 0||!$9.call(" ",0)),g1t=function(r){if(r.key&&m1t&&r.key.codePointAt(0)===r.keyCode)return r.key;{let e;if(r.which===null?e=r.keyCode:r.which!==0&&r.charCode!==0&&(e=r.charCode),e!=null&&mke[e]!=="escape")return v0.fromCodepoints([e]).toString()}},v1t=function(r){let e=r.clipboardData;if(e){if(e.types.includes("text/html")){for(let t of e.types){let n=/^CorePasteboardFlavorType/.test(t),i=/^dyn\./.test(t)&&e.getData(t);if(n||i)return!0}return!1}{let t=e.types.includes("com.apple.webarchive"),n=e.types.includes("com.apple.flat-rtfd");return t||n}}},Bm=class extends iu{constructor(e){super(...arguments),this.inputController=e,this.responder=this.inputController.responder,this.delegate=this.inputController.delegate,this.inputSummary=this.inputController.inputSummary,this.data={}}start(e){if(this.data.start=e,this.isSignificant()){var t,n;this.inputSummary.eventName==="keypress"&&this.inputSummary.textAdded&&((n=this.responder)===null||n===void 0||n.deleteInDirection("left")),this.selectionIsExpanded()||(this.insertPlaceholder(),this.requestRender()),this.range=(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange()}}update(e){if(this.data.update=e,this.isSignificant()){let t=this.selectPlaceholder();t&&(this.forgetPlaceholder(),this.range=t)}}end(e){return this.data.end=e,this.isSignificant()?(this.forgetPlaceholder(),this.canApplyToDocument()?(this.setInputSummary({preferDocument:!0,didInput:!1}),(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformTyping(),(n=this.responder)===null||n===void 0||n.setSelectedRange(this.range),(i=this.responder)===null||i===void 0||i.insertString(this.data.end),(a=this.responder)===null||a===void 0?void 0:a.setSelectedRange(this.range[0]+this.data.end.length)):this.data.start!=null||this.data.update!=null?(this.requestReparse(),this.inputController.reset()):void 0):this.inputController.reset();var t,n,i,a}getEndData(){return this.data.end}isEnded(){return this.getEndData()!=null}isSignificant(){return!h1t.composesExistingText||this.inputSummary.didInput}canApplyToDocument(){var e,t;return((e=this.data.start)===null||e===void 0?void 0:e.length)===0&&((t=this.data.end)===null||t===void 0?void 0:t.length)>0&&this.range}};Bm.proxyMethod("inputController.setInputSummary"),Bm.proxyMethod("inputController.requestRender"),Bm.proxyMethod("inputController.requestReparse"),Bm.proxyMethod("responder?.selectionIsExpanded"),Bm.proxyMethod("responder?.insertPlaceholder"),Bm.proxyMethod("responder?.selectPlaceholder"),Bm.proxyMethod("responder?.forgetPlaceholder");p0=class extends X1{constructor(){super(...arguments),this.render=this.render.bind(this)}elementDidMutate(){return this.scheduledRender?this.composing?(e=this.delegate)===null||e===void 0||(t=e.inputControllerDidAllowUnhandledInput)===null||t===void 0?void 0:t.call(e):void 0:this.reparse();var e,t}scheduleRender(){return this.scheduledRender?this.scheduledRender:this.scheduledRender=requestAnimationFrame(this.render)}render(){var e,t;cancelAnimationFrame(this.scheduledRender),this.scheduledRender=null,this.composing||(t=this.delegate)===null||t===void 0||t.render(),(e=this.afterRender)===null||e===void 0||e.call(this),this.afterRender=null}reparse(){var e;return(e=this.delegate)===null||e===void 0?void 0:e.reparse()}insertString(){var e;let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0;return(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var i;return(i=this.responder)===null||i===void 0?void 0:i.insertString(t,n)})}toggleAttributeIfSupported(e){var t;if(J9().includes(e))return(t=this.delegate)===null||t===void 0||t.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var n;return(n=this.responder)===null||n===void 0?void 0:n.toggleCurrentAttribute(e)})}activateAttributeIfSupported(e,t){var n;if(J9().includes(e))return(n=this.delegate)===null||n===void 0||n.inputControllerWillPerformFormatting(e),this.withTargetDOMRange(function(){var i;return(i=this.responder)===null||i===void 0?void 0:i.setCurrentAttribute(e,t)})}deleteInDirection(e){let{recordUndoEntry:t}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{recordUndoEntry:!0};var n;t&&((n=this.delegate)===null||n===void 0||n.inputControllerWillPerformTyping());let i=()=>{var l;return(l=this.responder)===null||l===void 0?void 0:l.deleteInDirection(e)},a=this.getTargetDOMRange({minLength:2});return a?this.withTargetDOMRange(a,i):i()}withTargetDOMRange(e,t){var n;return typeof e=="function"&&(t=e,e=this.getTargetDOMRange()),e?(n=this.responder)===null||n===void 0?void 0:n.withTargetDOMRange(e,t.bind(this)):(b0.reset(),t.call(this))}getTargetDOMRange(){var e,t;let{minLength:n}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{minLength:0},i=(e=(t=this.event).getTargetRanges)===null||e===void 0?void 0:e.call(t);if(i&&i.length){let a=y1t(i[0]);if(n===0||a.toString().length>=n)return a}}withEvent(e,t){let n;this.event=e;try{n=t.call(this)}finally{this.event=null}return n}};xd(p0,"events",{keydown(r){if(oke(r)){var e;let t=_1t(r);(e=this.delegate)!==null&&e!==void 0&&e.inputControllerDidReceiveKeyboardCommand(t)&&r.preventDefault()}else{let t=r.key;r.altKey&&(t+="+Alt"),r.shiftKey&&(t+="+Shift");let n=this.constructor.keys[t];if(n)return this.withEvent(r,n)}},paste(r){var e;let t,n=(e=r.clipboardData)===null||e===void 0?void 0:e.getData("URL");return b1t(r)?(r.preventDefault(),this.attachFiles(r.clipboardData.files)):x1t(r)?(r.preventDefault(),t={type:"text/plain",string:r.clipboardData.getData("text/plain")},(i=this.delegate)===null||i===void 0||i.inputControllerWillPaste(t),(a=this.responder)===null||a===void 0||a.insertString(t.string),this.render(),(l=this.delegate)===null||l===void 0?void 0:l.inputControllerDidPaste(t)):n?(r.preventDefault(),t={type:"text/html",html:this.createLinkHTML(n)},(h=this.delegate)===null||h===void 0||h.inputControllerWillPaste(t),(g=this.responder)===null||g===void 0||g.insertHTML(t.html),this.render(),(w=this.delegate)===null||w===void 0?void 0:w.inputControllerDidPaste(t)):void 0;var i,a,l,h,g,w},beforeinput(r){let e=this.constructor.inputTypes[r.inputType];e&&(this.withEvent(r,e),this.scheduleRender())},input(r){b0.reset()},dragstart(r){var e,t;(e=this.responder)!==null&&e!==void 0&&e.selectionContainsAttachments()&&(r.dataTransfer.setData("application/x-trix-dragging",!0),this.dragging={range:(t=this.responder)===null||t===void 0?void 0:t.getSelectedRange(),point:K9(r)})},dragenter(r){G9(r)&&r.preventDefault()},dragover(r){if(this.dragging){r.preventDefault();let t=K9(r);var e;if(!vC(t,this.dragging.point))return this.dragging.point=t,(e=this.responder)===null||e===void 0?void 0:e.setLocationRangeFromPointRange(t)}else G9(r)&&r.preventDefault()},drop(r){var e,t;if(this.dragging)return r.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),(t=this.responder)===null||t===void 0||t.moveTextFromRange(this.dragging.range),this.dragging=null,this.scheduleRender();if(G9(r)){var n;r.preventDefault();let i=K9(r);return(n=this.responder)===null||n===void 0||n.setLocationRangeFromPointRange(i),this.attachFiles(r.dataTransfer.files)}},dragend(){var r;this.dragging&&((r=this.responder)===null||r===void 0||r.setSelectedRange(this.dragging.range),this.dragging=null)},compositionend(r){this.composing&&(this.composing=!1,mC.recentAndroid||this.scheduleRender())}}),xd(p0,"keys",{ArrowLeft(){var r,e;if((r=this.responder)!==null&&r!==void 0&&r.shouldManageMovingCursorInDirection("backward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("backward")},ArrowRight(){var r,e;if((r=this.responder)!==null&&r!==void 0&&r.shouldManageMovingCursorInDirection("forward"))return this.event.preventDefault(),(e=this.responder)===null||e===void 0?void 0:e.moveCursorInDirection("forward")},Backspace(){var r,e,t;if((r=this.responder)!==null&&r!==void 0&&r.shouldManageDeletingInDirection("backward"))return this.event.preventDefault(),(e=this.delegate)===null||e===void 0||e.inputControllerWillPerformTyping(),(t=this.responder)===null||t===void 0||t.deleteInDirection("backward"),this.render()},Tab(){var r,e;if((r=this.responder)!==null&&r!==void 0&&r.canIncreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.increaseNestingLevel(),this.render()},"Tab+Shift"(){var r,e;if((r=this.responder)!==null&&r!==void 0&&r.canDecreaseNestingLevel())return this.event.preventDefault(),(e=this.responder)===null||e===void 0||e.decreaseNestingLevel(),this.render()}}),xd(p0,"inputTypes",{deleteByComposition(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteByCut(){return this.deleteInDirection("backward")},deleteByDrag(){return this.event.preventDefault(),this.withTargetDOMRange(function(){var r;this.deleteByDragRange=(r=this.responder)===null||r===void 0?void 0:r.getSelectedRange()})},deleteCompositionText(){return this.deleteInDirection("backward",{recordUndoEntry:!1})},deleteContent(){return this.deleteInDirection("backward")},deleteContentBackward(){return this.deleteInDirection("backward")},deleteContentForward(){return this.deleteInDirection("forward")},deleteEntireSoftLine(){return this.deleteInDirection("forward")},deleteHardLineBackward(){return this.deleteInDirection("backward")},deleteHardLineForward(){return this.deleteInDirection("forward")},deleteSoftLineBackward(){return this.deleteInDirection("backward")},deleteSoftLineForward(){return this.deleteInDirection("forward")},deleteWordBackward(){return this.deleteInDirection("backward")},deleteWordForward(){return this.deleteInDirection("forward")},formatBackColor(){return this.activateAttributeIfSupported("backgroundColor",this.event.data)},formatBold(){return this.toggleAttributeIfSupported("bold")},formatFontColor(){return this.activateAttributeIfSupported("color",this.event.data)},formatFontName(){return this.activateAttributeIfSupported("font",this.event.data)},formatIndent(){var r;if((r=this.responder)!==null&&r!==void 0&&r.canIncreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.increaseNestingLevel()})},formatItalic(){return this.toggleAttributeIfSupported("italic")},formatJustifyCenter(){return this.toggleAttributeIfSupported("justifyCenter")},formatJustifyFull(){return this.toggleAttributeIfSupported("justifyFull")},formatJustifyLeft(){return this.toggleAttributeIfSupported("justifyLeft")},formatJustifyRight(){return this.toggleAttributeIfSupported("justifyRight")},formatOutdent(){var r;if((r=this.responder)!==null&&r!==void 0&&r.canDecreaseNestingLevel())return this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.decreaseNestingLevel()})},formatRemove(){this.withTargetDOMRange(function(){for(let t in(r=this.responder)===null||r===void 0?void 0:r.getCurrentAttributes()){var r,e;(e=this.responder)===null||e===void 0||e.removeCurrentAttribute(t)}})},formatSetBlockTextDirection(){return this.activateAttributeIfSupported("blockDir",this.event.data)},formatSetInlineTextDirection(){return this.activateAttributeIfSupported("textDir",this.event.data)},formatStrikeThrough(){return this.toggleAttributeIfSupported("strike")},formatSubscript(){return this.toggleAttributeIfSupported("sub")},formatSuperscript(){return this.toggleAttributeIfSupported("sup")},formatUnderline(){return this.toggleAttributeIfSupported("underline")},historyRedo(){var r;return(r=this.delegate)===null||r===void 0?void 0:r.inputControllerWillPerformRedo()},historyUndo(){var r;return(r=this.delegate)===null||r===void 0?void 0:r.inputControllerWillPerformUndo()},insertCompositionText(){return this.composing=!0,this.insertString(this.event.data)},insertFromComposition(){return this.composing=!1,this.insertString(this.event.data)},insertFromDrop(){let r=this.deleteByDragRange;var e;if(r)return this.deleteByDragRange=null,(e=this.delegate)===null||e===void 0||e.inputControllerWillMoveText(),this.withTargetDOMRange(function(){var t;return(t=this.responder)===null||t===void 0?void 0:t.moveTextFromRange(r)})},insertFromPaste(){var r;let{dataTransfer:e}=this.event,t={dataTransfer:e},n=e.getData("URL"),i=e.getData("text/html");if(n){var a;let w;this.event.preventDefault(),t.type="text/html";let C=e.getData("public.url-name");w=C?gH(C).trim():n,t.html=this.createLinkHTML(n,w),(a=this.delegate)===null||a===void 0||a.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var D;return(D=this.responder)===null||D===void 0?void 0:D.insertHTML(t.html)}),this.afterRender=()=>{var D;return(D=this.delegate)===null||D===void 0?void 0:D.inputControllerDidPaste(t)}}else if(ike(e)){var l;t.type="text/plain",t.string=e.getData("text/plain"),(l=this.delegate)===null||l===void 0||l.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var w;return(w=this.responder)===null||w===void 0?void 0:w.insertString(t.string)}),this.afterRender=()=>{var w;return(w=this.delegate)===null||w===void 0?void 0:w.inputControllerDidPaste(t)}}else if(i){var h;this.event.preventDefault(),t.type="text/html",t.html=i,(h=this.delegate)===null||h===void 0||h.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var w;return(w=this.responder)===null||w===void 0?void 0:w.insertHTML(t.html)}),this.afterRender=()=>{var w;return(w=this.delegate)===null||w===void 0?void 0:w.inputControllerDidPaste(t)}}else if((r=e.files)!==null&&r!==void 0&&r.length){var g;t.type="File",t.file=e.files[0],(g=this.delegate)===null||g===void 0||g.inputControllerWillPaste(t),this.withTargetDOMRange(function(){var w;return(w=this.responder)===null||w===void 0?void 0:w.insertFile(t.file)}),this.afterRender=()=>{var w;return(w=this.delegate)===null||w===void 0?void 0:w.inputControllerDidPaste(t)}}},insertFromYank(){return this.insertString(this.event.data)},insertLineBreak(){return this.insertString(`
873
- `)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var r;return(r=this.delegate)===null||r===void 0||r.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){return this.insertString(this.event.dataTransfer.getData("text/plain"),{updatePosition:!1})},insertText(){var r;return this.insertString(this.event.data||((r=this.event.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});y1t=function(r){let e=document.createRange();return e.setStart(r.startContainer,r.startOffset),e.setEnd(r.endContainer,r.endOffset),e},G9=r=>{var e;return Array.from(((e=r.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes("Files")},b1t=function(r){let e=r.clipboardData;if(e)return e.types.includes("Files")&&e.types.length===1&&e.files.length>=1},x1t=function(r){let e=r.clipboardData;if(e)return e.types.includes("text/plain")&&e.types.length===1},_1t=function(r){let e=[];return r.altKey&&e.push("alt"),r.shiftKey&&e.push("shift"),e.push(r.key),e},K9=r=>({x:r.clientX,y:r.clientY}),sH="[data-trix-attribute]",lH="[data-trix-action]",w1t="".concat(sH,", ").concat(lH),TP="[data-trix-dialog]",S1t="".concat(TP,"[data-trix-active]"),T1t="".concat(TP," [data-trix-method]"),GEe="".concat(TP," [data-trix-input]"),KEe=(r,e)=>(e||(e=V1(r)),r.querySelector("[data-trix-input][name='".concat(e,"']"))),YEe=r=>r.getAttribute("data-trix-action"),V1=r=>r.getAttribute("data-trix-attribute")||r.getAttribute("data-trix-dialog-attribute"),xP=class extends iu{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Fl("mousedown",{onElement:this.element,matchingSelector:lH,withCallback:this.didClickActionButton}),Fl("mousedown",{onElement:this.element,matchingSelector:sH,withCallback:this.didClickAttributeButton}),Fl("click",{onElement:this.element,matchingSelector:w1t,preventDefault:!0}),Fl("click",{onElement:this.element,matchingSelector:T1t,withCallback:this.didClickDialogButton}),Fl("keydown",{onElement:this.element,matchingSelector:GEe,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();let i=YEe(t);return this.getDialog(i)?this.toggleDialog(i):(a=this.delegate)===null||a===void 0?void 0:a.toolbarDidInvokeAction(i);var a}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();let i=V1(t);var a;return this.getDialog(i)?this.toggleDialog(i):(a=this.delegate)===null||a===void 0||a.toolbarDidToggleAttribute(i),this.refreshAttributeButtons()}didClickDialogButton(e,t){let n=ky(t,{matchingSelector:TP});return this[t.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();let n=t.getAttribute("name"),i=this.getDialog(n);this.setAttribute(i)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.querySelectorAll(lH)).map(t=>e(t,YEe(t)))}updateAttributes(e){return this.attributes=e,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((e,t)=>(e.disabled=this.attributes[t]===!1,this.attributes[t]||this.dialogIsVisible(t)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))))}eachAttributeButton(e){return Array.from(this.element.querySelectorAll(sH)).map(t=>e(t,V1(t)))}applyKeyboardCommand(e){let t=JSON.stringify(e.sort());for(let n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){let i=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(i.sort())===t)return sC("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(e){let t=this.getDialog(e);if(t)return t.hasAttribute("data-trix-active")}toggleDialog(e){return this.dialogIsVisible(e)?this.hideDialog():this.showDialog(e)}showDialog(e){var t,n;this.hideDialog(),(t=this.delegate)===null||t===void 0||t.toolbarWillShowDialog();let i=this.getDialog(e);i.setAttribute("data-trix-active",""),i.classList.add("trix-active"),Array.from(i.querySelectorAll("input[disabled]")).forEach(l=>{l.removeAttribute("disabled")});let a=V1(i);if(a){let l=KEe(i,e);l&&(l.value=this.attributes[a]||"",l.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(e)}setAttribute(e){let t=V1(e),n=KEe(e,t);return n.willValidate&&!n.checkValidity()?(n.setAttribute("data-trix-validate",""),n.classList.add("trix-validate"),n.focus()):((i=this.delegate)===null||i===void 0||i.toolbarDidUpdateAttribute(t,n.value),this.hideDialog());var i}removeAttribute(e){var t;let n=V1(e);return(t=this.delegate)===null||t===void 0||t.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){let e=this.element.querySelector(S1t);var t;if(e)return e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"),this.resetDialogInputs(),(t=this.delegate)===null||t===void 0?void 0:t.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(e))}resetDialogInputs(){Array.from(this.element.querySelectorAll(GEe)).forEach(e=>{e.setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),e.classList.remove("trix-validate")})}getDialog(e){return this.element.querySelector("[data-trix-dialog=".concat(e,"]"))}},m0=class extends vP{constructor(e){let{editorElement:t,document:n,html:i}=e;super(...arguments),this.editorElement=t,this.selectionManager=new Kg(this.editorElement),this.selectionManager.delegate=this,this.composition=new zm,this.composition.delegate=this,this.attachmentManager=new uP(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=hH.getLevel()===2?new p0(this.editorElement):new tm(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new gP(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new xP(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new hP(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(i)}registerSelectionManager(){return b0.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return b0.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(e){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(e){return this.currentAttributes=e,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(e){this.pasting&&(this.pastedRange=e)}compositionShouldAcceptFile(e){return this.notifyEditorElement("file-accept",{file:e})}compositionDidAddAttachment(e){let t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-add",{attachment:t})}compositionDidEditAttachment(e){this.compositionController.rerenderViewForObject(e);let t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-edit",{attachment:t}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(e){return this.compositionController.invalidateViewForObject(e),this.notifyEditorElement("change")}compositionDidRemoveAttachment(e){let t=this.attachmentManager.unmanageAttachment(e);return this.notifyEditorElement("attachment-remove",{attachment:t})}compositionDidStartEditingAttachment(e,t){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(e),this.compositionController.installAttachmentEditorForAttachment(e,t),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(e){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(e){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=e,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(e,t){return this.toolbarController.hideDialog(),this.composition.editAttachment(e,t)}compositionControllerDidRequestDeselectingAttachment(e){let t=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(e);return this.selectionManager.setLocationRange(t[1])}compositionControllerWillUpdateAttachment(e){return this.editor.recordUndoEntry("Edit Attachment",{context:e.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(e){return this.recordFormattingUndoEntry(e)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(e){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:e})}inputControllerDidPaste(e){return e.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:e})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(e){return this.toolbarController.applyKeyboardCommand(e)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(e){return this.selectionManager.setLocationRangeFromPointRange(e)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(e){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!tP(this.attachmentLocationRange,e)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(e){return this.invokeAction(e)}toolbarDidToggleAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.toggleCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(e,t){if(this.recordFormattingUndoEntry(e),this.composition.setCurrentAttribute(e,t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.removeCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(e){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(e){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:e})}toolbarDidHideDialog(e){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:e})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(e){return!!this.actionIsExternal(e)||!((t=this.actions[e])===null||t===void 0||(t=t.test)===null||t===void 0||!t.call(this));var t}invokeAction(e){return this.actionIsExternal(e)?this.notifyEditorElement("action-invoke",{actionName:e}):(t=this.actions[e])===null||t===void 0||(t=t.perform)===null||t===void 0?void 0:t.call(this);var t}actionIsExternal(e){return/^x-./.test(e)}getCurrentActions(){let e={};for(let t in this.actions)e[t]=this.canInvokeAction(t);return e}updateCurrentActions(){let e=this.getCurrentActions();if(!vC(e,this.currentActions))return this.currentActions=e,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let e=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(i=>{let{document:a,selectedRange:l}=e;e=i.call(this.editor,e)||{},e.document||(e.document=a),e.selectedRange||(e.selectedRange=l)}),t=e,n=this.composition.getSnapshot(),!tP(t.selectedRange,n.selectedRange)||!t.document.isEqualTo(n.document))return this.composition.loadSnapshot(e);var t,n}updateInputElement(){let e=function(t,n){let i=e1t[n];if(i)return i(t);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setInputElementValue(e)}notifyEditorElement(e,t){switch(e){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(e,t)}removeAttachment(e){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(e),this.render()}recordFormattingUndoEntry(e){let t=Zu(e),n=this.selectionManager.getLocationRange();if(t||!Yg(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return[this.getLocationContext(),this.getTimeContext(),...Array.from(t)]}getLocationContext(){let e=this.selectionManager.getLocationRange();return Yg(e)?e[0].index:e}getTimeContext(){return Y9.interval>0?Math.floor(new Date().getTime()/Y9.interval):0}isFocused(){var e;return this.editorElement===((e=this.editorElement.ownerDocument)===null||e===void 0?void 0:e.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}};xd(m0,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return hH.pickFiles(this.editor.insertFiles)}}}),m0.proxyMethod("getSelectionManager().setLocationRange"),m0.proxyMethod("getSelectionManager().getLocationRange");E1t=Object.freeze({__proto__:null,AttachmentEditorController:mP,CompositionController:gP,Controller:vP,EditorController:m0,InputController:X1,Level0InputController:tm,Level2InputController:p0,ToolbarController:xP}),k1t=Object.freeze({__proto__:null,MutationObserver:yP,SelectionChangeObserver:rP}),C1t=Object.freeze({__proto__:null,FileVerificationOperation:bP,ImagePreloadOperation:sP});nke("trix-toolbar",`%t {
873
+ `)},insertLink(){return this.activateAttributeIfSupported("href",this.event.data)},insertOrderedList(){return this.toggleAttributeIfSupported("number")},insertParagraph(){var r;return(r=this.delegate)===null||r===void 0||r.inputControllerWillPerformTyping(),this.withTargetDOMRange(function(){var e;return(e=this.responder)===null||e===void 0?void 0:e.insertLineBreak()})},insertReplacementText(){let r=this.event.dataTransfer.getData("text/plain"),e=this.event.getTargetRanges()[0];this.withTargetDOMRange(e,()=>{this.insertString(r,{updatePosition:!1})})},insertText(){var r;return this.insertString(this.event.data||((r=this.event.dataTransfer)===null||r===void 0?void 0:r.getData("text/plain")))},insertTranspose(){return this.insertString(this.event.data)},insertUnorderedList(){return this.toggleAttributeIfSupported("bullet")}});y1t=function(r){let e=document.createRange();return e.setStart(r.startContainer,r.startOffset),e.setEnd(r.endContainer,r.endOffset),e},G9=r=>{var e;return Array.from(((e=r.dataTransfer)===null||e===void 0?void 0:e.types)||[]).includes("Files")},b1t=function(r){let e=r.clipboardData;if(e)return e.types.includes("Files")&&e.types.length===1&&e.files.length>=1},x1t=function(r){let e=r.clipboardData;if(e)return e.types.includes("text/plain")&&e.types.length===1},_1t=function(r){let e=[];return r.altKey&&e.push("alt"),r.shiftKey&&e.push("shift"),e.push(r.key),e},K9=r=>({x:r.clientX,y:r.clientY}),sH="[data-trix-attribute]",lH="[data-trix-action]",w1t="".concat(sH,", ").concat(lH),TP="[data-trix-dialog]",S1t="".concat(TP,"[data-trix-active]"),T1t="".concat(TP," [data-trix-method]"),GEe="".concat(TP," [data-trix-input]"),KEe=(r,e)=>(e||(e=V1(r)),r.querySelector("[data-trix-input][name='".concat(e,"']"))),YEe=r=>r.getAttribute("data-trix-action"),V1=r=>r.getAttribute("data-trix-attribute")||r.getAttribute("data-trix-dialog-attribute"),xP=class extends iu{constructor(e){super(e),this.didClickActionButton=this.didClickActionButton.bind(this),this.didClickAttributeButton=this.didClickAttributeButton.bind(this),this.didClickDialogButton=this.didClickDialogButton.bind(this),this.didKeyDownDialogInput=this.didKeyDownDialogInput.bind(this),this.element=e,this.attributes={},this.actions={},this.resetDialogInputs(),Fl("mousedown",{onElement:this.element,matchingSelector:lH,withCallback:this.didClickActionButton}),Fl("mousedown",{onElement:this.element,matchingSelector:sH,withCallback:this.didClickAttributeButton}),Fl("click",{onElement:this.element,matchingSelector:w1t,preventDefault:!0}),Fl("click",{onElement:this.element,matchingSelector:T1t,withCallback:this.didClickDialogButton}),Fl("keydown",{onElement:this.element,matchingSelector:GEe,withCallback:this.didKeyDownDialogInput})}didClickActionButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();let i=YEe(t);return this.getDialog(i)?this.toggleDialog(i):(a=this.delegate)===null||a===void 0?void 0:a.toolbarDidInvokeAction(i,t);var a}didClickAttributeButton(e,t){var n;(n=this.delegate)===null||n===void 0||n.toolbarDidClickButton(),e.preventDefault();let i=V1(t);var a;return this.getDialog(i)?this.toggleDialog(i):(a=this.delegate)===null||a===void 0||a.toolbarDidToggleAttribute(i),this.refreshAttributeButtons()}didClickDialogButton(e,t){let n=ky(t,{matchingSelector:TP});return this[t.getAttribute("data-trix-method")].call(this,n)}didKeyDownDialogInput(e,t){if(e.keyCode===13){e.preventDefault();let n=t.getAttribute("name"),i=this.getDialog(n);this.setAttribute(i)}if(e.keyCode===27)return e.preventDefault(),this.hideDialog()}updateActions(e){return this.actions=e,this.refreshActionButtons()}refreshActionButtons(){return this.eachActionButton((e,t)=>{e.disabled=this.actions[t]===!1})}eachActionButton(e){return Array.from(this.element.querySelectorAll(lH)).map(t=>e(t,YEe(t)))}updateAttributes(e){return this.attributes=e,this.refreshAttributeButtons()}refreshAttributeButtons(){return this.eachAttributeButton((e,t)=>(e.disabled=this.attributes[t]===!1,this.attributes[t]||this.dialogIsVisible(t)?(e.setAttribute("data-trix-active",""),e.classList.add("trix-active")):(e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"))))}eachAttributeButton(e){return Array.from(this.element.querySelectorAll(sH)).map(t=>e(t,V1(t)))}applyKeyboardCommand(e){let t=JSON.stringify(e.sort());for(let n of Array.from(this.element.querySelectorAll("[data-trix-key]"))){let i=n.getAttribute("data-trix-key").split("+");if(JSON.stringify(i.sort())===t)return sC("mousedown",{onElement:n}),!0}return!1}dialogIsVisible(e){let t=this.getDialog(e);if(t)return t.hasAttribute("data-trix-active")}toggleDialog(e){return this.dialogIsVisible(e)?this.hideDialog():this.showDialog(e)}showDialog(e){var t,n;this.hideDialog(),(t=this.delegate)===null||t===void 0||t.toolbarWillShowDialog();let i=this.getDialog(e);i.setAttribute("data-trix-active",""),i.classList.add("trix-active"),Array.from(i.querySelectorAll("input[disabled]")).forEach(l=>{l.removeAttribute("disabled")});let a=V1(i);if(a){let l=KEe(i,e);l&&(l.value=this.attributes[a]||"",l.select())}return(n=this.delegate)===null||n===void 0?void 0:n.toolbarDidShowDialog(e)}setAttribute(e){let t=V1(e),n=KEe(e,t);return n.willValidate&&!n.checkValidity()?(n.setAttribute("data-trix-validate",""),n.classList.add("trix-validate"),n.focus()):((i=this.delegate)===null||i===void 0||i.toolbarDidUpdateAttribute(t,n.value),this.hideDialog());var i}removeAttribute(e){var t;let n=V1(e);return(t=this.delegate)===null||t===void 0||t.toolbarDidRemoveAttribute(n),this.hideDialog()}hideDialog(){let e=this.element.querySelector(S1t);var t;if(e)return e.removeAttribute("data-trix-active"),e.classList.remove("trix-active"),this.resetDialogInputs(),(t=this.delegate)===null||t===void 0?void 0:t.toolbarDidHideDialog((n=>n.getAttribute("data-trix-dialog"))(e))}resetDialogInputs(){Array.from(this.element.querySelectorAll(GEe)).forEach(e=>{e.setAttribute("disabled","disabled"),e.removeAttribute("data-trix-validate"),e.classList.remove("trix-validate")})}getDialog(e){return this.element.querySelector("[data-trix-dialog=".concat(e,"]"))}},m0=class extends vP{constructor(e){let{editorElement:t,document:n,html:i}=e;super(...arguments),this.editorElement=t,this.selectionManager=new Kg(this.editorElement),this.selectionManager.delegate=this,this.composition=new zm,this.composition.delegate=this,this.attachmentManager=new uP(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=hH.getLevel()===2?new p0(this.editorElement):new tm(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new gP(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new xP(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new hP(this.composition,this.selectionManager,this.editorElement),n?this.editor.loadDocument(n):this.editor.loadHTML(i)}registerSelectionManager(){return b0.registerSelectionManager(this.selectionManager)}unregisterSelectionManager(){return b0.unregisterSelectionManager(this.selectionManager)}render(){return this.compositionController.render()}reparse(){return this.composition.replaceHTML(this.editorElement.innerHTML)}compositionDidChangeDocument(e){if(this.notifyEditorElement("document-change"),!this.handlingInput)return this.render()}compositionDidChangeCurrentAttributes(e){return this.currentAttributes=e,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.notifyEditorElement("attributes-change",{attributes:this.currentAttributes})}compositionDidPerformInsertionAtRange(e){this.pasting&&(this.pastedRange=e)}compositionShouldAcceptFile(e){return this.notifyEditorElement("file-accept",{file:e})}compositionDidAddAttachment(e){let t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-add",{attachment:t})}compositionDidEditAttachment(e){this.compositionController.rerenderViewForObject(e);let t=this.attachmentManager.manageAttachment(e);return this.notifyEditorElement("attachment-edit",{attachment:t}),this.notifyEditorElement("change")}compositionDidChangeAttachmentPreviewURL(e){return this.compositionController.invalidateViewForObject(e),this.notifyEditorElement("change")}compositionDidRemoveAttachment(e){let t=this.attachmentManager.unmanageAttachment(e);return this.notifyEditorElement("attachment-remove",{attachment:t})}compositionDidStartEditingAttachment(e,t){return this.attachmentLocationRange=this.composition.document.getLocationRangeOfAttachment(e),this.compositionController.installAttachmentEditorForAttachment(e,t),this.selectionManager.setLocationRange(this.attachmentLocationRange)}compositionDidStopEditingAttachment(e){this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null}compositionDidRequestChangingSelectionToLocationRange(e){if(!this.loadingSnapshot||this.isFocused())return this.requestedLocationRange=e,this.compositionRevisionWhenLocationRangeRequested=this.composition.revision,this.handlingInput?void 0:this.render()}compositionWillLoadSnapshot(){this.loadingSnapshot=!0}compositionDidLoadSnapshot(){this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1}getSelectionManager(){return this.selectionManager}attachmentManagerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}compositionControllerWillSyncDocumentView(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()}compositionControllerDidSyncDocumentView(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.notifyEditorElement("sync")}compositionControllerDidRender(){this.requestedLocationRange&&(this.compositionRevisionWhenLocationRangeRequested===this.composition.revision&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.requestedLocationRange=null,this.compositionRevisionWhenLocationRangeRequested=null),this.renderedCompositionRevision!==this.composition.revision&&(this.runEditorFilters(),this.composition.updateCurrentAttributes(),this.notifyEditorElement("render")),this.renderedCompositionRevision=this.composition.revision}compositionControllerDidFocus(){return this.isFocusedInvisibly()&&this.setLocationRange({index:0,offset:0}),this.toolbarController.hideDialog(),this.notifyEditorElement("focus")}compositionControllerDidBlur(){return this.notifyEditorElement("blur")}compositionControllerDidSelectAttachment(e,t){return this.toolbarController.hideDialog(),this.composition.editAttachment(e,t)}compositionControllerDidRequestDeselectingAttachment(e){let t=this.attachmentLocationRange||this.composition.document.getLocationRangeOfAttachment(e);return this.selectionManager.setLocationRange(t[1])}compositionControllerWillUpdateAttachment(e){return this.editor.recordUndoEntry("Edit Attachment",{context:e.id,consolidatable:!0})}compositionControllerDidRequestRemovalOfAttachment(e){return this.removeAttachment(e)}inputControllerWillHandleInput(){this.handlingInput=!0,this.requestedRender=!1}inputControllerDidRequestRender(){this.requestedRender=!0}inputControllerDidHandleInput(){if(this.handlingInput=!1,this.requestedRender)return this.requestedRender=!1,this.render()}inputControllerDidAllowUnhandledInput(){return this.notifyEditorElement("change")}inputControllerDidRequestReparse(){return this.reparse()}inputControllerWillPerformTyping(){return this.recordTypingUndoEntry()}inputControllerWillPerformFormatting(e){return this.recordFormattingUndoEntry(e)}inputControllerWillCutText(){return this.editor.recordUndoEntry("Cut")}inputControllerWillPaste(e){return this.editor.recordUndoEntry("Paste"),this.pasting=!0,this.notifyEditorElement("before-paste",{paste:e})}inputControllerDidPaste(e){return e.range=this.pastedRange,this.pastedRange=null,this.pasting=null,this.notifyEditorElement("paste",{paste:e})}inputControllerWillMoveText(){return this.editor.recordUndoEntry("Move")}inputControllerWillAttachFiles(){return this.editor.recordUndoEntry("Drop Files")}inputControllerWillPerformUndo(){return this.editor.undo()}inputControllerWillPerformRedo(){return this.editor.redo()}inputControllerDidReceiveKeyboardCommand(e){return this.toolbarController.applyKeyboardCommand(e)}inputControllerDidStartDrag(){this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()}inputControllerDidReceiveDragOverPoint(e){return this.selectionManager.setLocationRangeFromPointRange(e)}inputControllerDidCancelDrag(){this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null}locationRangeDidChange(e){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!tP(this.attachmentLocationRange,e)&&this.composition.stopEditingAttachment(),this.notifyEditorElement("selection-change")}toolbarDidClickButton(){if(!this.getLocationRange())return this.setLocationRange({index:0,offset:0})}toolbarDidInvokeAction(e,t){return this.invokeAction(e,t)}toolbarDidToggleAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.toggleCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidUpdateAttribute(e,t){if(this.recordFormattingUndoEntry(e),this.composition.setCurrentAttribute(e,t),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarDidRemoveAttribute(e){if(this.recordFormattingUndoEntry(e),this.composition.removeCurrentAttribute(e),this.render(),!this.selectionFrozen)return this.editorElement.focus()}toolbarWillShowDialog(e){return this.composition.expandSelectionForEditing(),this.freezeSelection()}toolbarDidShowDialog(e){return this.notifyEditorElement("toolbar-dialog-show",{dialogName:e})}toolbarDidHideDialog(e){return this.thawSelection(),this.editorElement.focus(),this.notifyEditorElement("toolbar-dialog-hide",{dialogName:e})}freezeSelection(){if(!this.selectionFrozen)return this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render()}thawSelection(){if(this.selectionFrozen)return this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()}canInvokeAction(e){return!!this.actionIsExternal(e)||!((t=this.actions[e])===null||t===void 0||(t=t.test)===null||t===void 0||!t.call(this));var t}invokeAction(e,t){return this.actionIsExternal(e)?this.notifyEditorElement("action-invoke",{actionName:e,invokingElement:t}):(n=this.actions[e])===null||n===void 0||(n=n.perform)===null||n===void 0?void 0:n.call(this);var n}actionIsExternal(e){return/^x-./.test(e)}getCurrentActions(){let e={};for(let t in this.actions)e[t]=this.canInvokeAction(t);return e}updateCurrentActions(){let e=this.getCurrentActions();if(!vC(e,this.currentActions))return this.currentActions=e,this.toolbarController.updateActions(this.currentActions),this.notifyEditorElement("actions-change",{actions:this.currentActions})}runEditorFilters(){let e=this.composition.getSnapshot();if(Array.from(this.editor.filters).forEach(i=>{let{document:a,selectedRange:l}=e;e=i.call(this.editor,e)||{},e.document||(e.document=a),e.selectedRange||(e.selectedRange=l)}),t=e,n=this.composition.getSnapshot(),!tP(t.selectedRange,n.selectedRange)||!t.document.isEqualTo(n.document))return this.composition.loadSnapshot(e);var t,n}updateInputElement(){let e=function(t,n){let i=e1t[n];if(i)return i(t);throw new Error("unknown content type: ".concat(n))}(this.compositionController.getSerializableElement(),"text/html");return this.editorElement.setInputElementValue(e)}notifyEditorElement(e,t){switch(e){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notifyEditorElement("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":this.updateInputElement()}return this.editorElement.notify(e,t)}removeAttachment(e){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(e),this.render()}recordFormattingUndoEntry(e){let t=Zu(e),n=this.selectionManager.getLocationRange();if(t||!Yg(n))return this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})}recordTypingUndoEntry(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})}getUndoContext(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return[this.getLocationContext(),this.getTimeContext(),...Array.from(t)]}getLocationContext(){let e=this.selectionManager.getLocationRange();return Yg(e)?e[0].index:e}getTimeContext(){return Y9.interval>0?Math.floor(new Date().getTime()/Y9.interval):0}isFocused(){var e;return this.editorElement===((e=this.editorElement.ownerDocument)===null||e===void 0?void 0:e.activeElement)}isFocusedInvisibly(){return this.isFocused()&&!this.getLocationRange()}get actions(){return this.constructor.actions}};xd(m0,"actions",{undo:{test(){return this.editor.canUndo()},perform(){return this.editor.undo()}},redo:{test(){return this.editor.canRedo()},perform(){return this.editor.redo()}},link:{test(){return this.editor.canActivateAttribute("href")}},increaseNestingLevel:{test(){return this.editor.canIncreaseNestingLevel()},perform(){return this.editor.increaseNestingLevel()&&this.render()}},decreaseNestingLevel:{test(){return this.editor.canDecreaseNestingLevel()},perform(){return this.editor.decreaseNestingLevel()&&this.render()}},attachFiles:{test:()=>!0,perform(){return hH.pickFiles(this.editor.insertFiles)}}}),m0.proxyMethod("getSelectionManager().setLocationRange"),m0.proxyMethod("getSelectionManager().getLocationRange");E1t=Object.freeze({__proto__:null,AttachmentEditorController:mP,CompositionController:gP,Controller:vP,EditorController:m0,InputController:X1,Level0InputController:tm,Level2InputController:p0,ToolbarController:xP}),k1t=Object.freeze({__proto__:null,MutationObserver:yP,SelectionChangeObserver:rP}),C1t=Object.freeze({__proto__:null,FileVerificationOperation:bP,ImagePreloadOperation:sP});nke("trix-toolbar",`%t {
874
874
  display: block;
875
875
  }
876
876