@sync-in/server 1.9.1 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (177) hide show
  1. package/CHANGELOG.md +24 -8
  2. package/package.json +12 -12
  3. package/server/applications/files/interfaces/only-office-config.interface.js.map +1 -1
  4. package/server/applications/files/services/files-manager.service.js +2 -2
  5. package/server/applications/files/services/files-manager.service.js.map +1 -1
  6. package/server/applications/files/services/files-methods.service.spec.js +2 -4
  7. package/server/applications/files/services/files-methods.service.spec.js.map +1 -1
  8. package/server/applications/files/services/files-recents.service.js +4 -0
  9. package/server/applications/files/services/files-recents.service.js.map +1 -1
  10. package/server/applications/files/services/files-scheduler.service.js +23 -4
  11. package/server/applications/files/services/files-scheduler.service.js.map +1 -1
  12. package/server/applications/files/services/files-tasks-manager.service.js +1 -1
  13. package/server/applications/files/services/files-tasks-manager.service.js.map +1 -1
  14. package/server/applications/files/utils/send-file.js +18 -9
  15. package/server/applications/files/utils/send-file.js.map +1 -1
  16. package/server/applications/files/utils/url-file.js +6 -6
  17. package/server/applications/files/utils/url-file.js.map +1 -1
  18. package/server/applications/links/services/links-manager.service.js +1 -1
  19. package/server/applications/links/services/links-manager.service.js.map +1 -1
  20. package/server/applications/shares/interfaces/share-props.interface.js.map +1 -1
  21. package/server/applications/shares/services/shares-manager.service.js +6 -4
  22. package/server/applications/shares/services/shares-manager.service.js.map +1 -1
  23. package/server/applications/spaces/services/spaces-manager.service.js +15 -12
  24. package/server/applications/spaces/services/spaces-manager.service.js.map +1 -1
  25. package/server/applications/spaces/services/spaces-scheduler.service.js +9 -1
  26. package/server/applications/spaces/services/spaces-scheduler.service.js.map +1 -1
  27. package/server/applications/users/services/admin-users-manager.service.js +4 -0
  28. package/server/applications/users/services/admin-users-manager.service.js.map +1 -1
  29. package/server/applications/users/users.controller.js +4 -1
  30. package/server/applications/users/users.controller.js.map +1 -1
  31. package/static/assets/pdfjs/build/pdf.mjs +35 -20
  32. package/static/assets/pdfjs/build/pdf.mjs.map +1 -1
  33. package/static/assets/pdfjs/build/pdf.sandbox.mjs +2 -2
  34. package/static/assets/pdfjs/build/pdf.worker.mjs +1488 -52
  35. package/static/assets/pdfjs/build/pdf.worker.mjs.map +1 -1
  36. package/static/assets/pdfjs/version +1 -1
  37. package/static/assets/pdfjs/web/locale/be/viewer.ftl +2 -12
  38. package/static/assets/pdfjs/web/locale/bg/viewer.ftl +4 -0
  39. package/static/assets/pdfjs/web/locale/bs/viewer.ftl +0 -15
  40. package/static/assets/pdfjs/web/locale/ca/viewer.ftl +0 -4
  41. package/static/assets/pdfjs/web/locale/cs/viewer.ftl +4 -14
  42. package/static/assets/pdfjs/web/locale/cy/viewer.ftl +2 -12
  43. package/static/assets/pdfjs/web/locale/da/viewer.ftl +2 -12
  44. package/static/assets/pdfjs/web/locale/de/viewer.ftl +0 -12
  45. package/static/assets/pdfjs/web/locale/dsb/viewer.ftl +0 -12
  46. package/static/assets/pdfjs/web/locale/el/viewer.ftl +2 -12
  47. package/static/assets/pdfjs/web/locale/en-CA/viewer.ftl +0 -12
  48. package/static/assets/pdfjs/web/locale/en-GB/viewer.ftl +0 -12
  49. package/static/assets/pdfjs/web/locale/eo/viewer.ftl +2 -12
  50. package/static/assets/pdfjs/web/locale/es-AR/viewer.ftl +0 -12
  51. package/static/assets/pdfjs/web/locale/es-CL/viewer.ftl +2 -12
  52. package/static/assets/pdfjs/web/locale/es-ES/viewer.ftl +2 -12
  53. package/static/assets/pdfjs/web/locale/es-MX/viewer.ftl +0 -12
  54. package/static/assets/pdfjs/web/locale/eu/viewer.ftl +0 -12
  55. package/static/assets/pdfjs/web/locale/fi/viewer.ftl +0 -12
  56. package/static/assets/pdfjs/web/locale/fr/viewer.ftl +0 -12
  57. package/static/assets/pdfjs/web/locale/fur/viewer.ftl +0 -12
  58. package/static/assets/pdfjs/web/locale/fy-NL/viewer.ftl +0 -12
  59. package/static/assets/pdfjs/web/locale/gn/viewer.ftl +2 -12
  60. package/static/assets/pdfjs/web/locale/he/viewer.ftl +0 -12
  61. package/static/assets/pdfjs/web/locale/hsb/viewer.ftl +0 -12
  62. package/static/assets/pdfjs/web/locale/hu/viewer.ftl +0 -12
  63. package/static/assets/pdfjs/web/locale/hy-AM/viewer.ftl +0 -15
  64. package/static/assets/pdfjs/web/locale/ia/viewer.ftl +0 -12
  65. package/static/assets/pdfjs/web/locale/id/viewer.ftl +0 -15
  66. package/static/assets/pdfjs/web/locale/is/viewer.ftl +0 -15
  67. package/static/assets/pdfjs/web/locale/it/viewer.ftl +2 -14
  68. package/static/assets/pdfjs/web/locale/ja/viewer.ftl +7 -2
  69. package/static/assets/pdfjs/web/locale/ka/viewer.ftl +0 -12
  70. package/static/assets/pdfjs/web/locale/kab/viewer.ftl +0 -12
  71. package/static/assets/pdfjs/web/locale/kk/viewer.ftl +3 -12
  72. package/static/assets/pdfjs/web/locale/ko/viewer.ftl +0 -12
  73. package/static/assets/pdfjs/web/locale/nb-NO/viewer.ftl +2 -12
  74. package/static/assets/pdfjs/web/locale/nl/viewer.ftl +0 -12
  75. package/static/assets/pdfjs/web/locale/nn-NO/viewer.ftl +0 -12
  76. package/static/assets/pdfjs/web/locale/pa-IN/viewer.ftl +4 -12
  77. package/static/assets/pdfjs/web/locale/pl/viewer.ftl +2 -12
  78. package/static/assets/pdfjs/web/locale/pt-BR/viewer.ftl +2 -12
  79. package/static/assets/pdfjs/web/locale/rm/viewer.ftl +0 -12
  80. package/static/assets/pdfjs/web/locale/ro/viewer.ftl +2 -14
  81. package/static/assets/pdfjs/web/locale/ru/viewer.ftl +0 -12
  82. package/static/assets/pdfjs/web/locale/sc/viewer.ftl +0 -1
  83. package/static/assets/pdfjs/web/locale/sk/viewer.ftl +0 -12
  84. package/static/assets/pdfjs/web/locale/sl/viewer.ftl +2 -12
  85. package/static/assets/pdfjs/web/locale/sq/viewer.ftl +2 -12
  86. package/static/assets/pdfjs/web/locale/sv-SE/viewer.ftl +0 -12
  87. package/static/assets/pdfjs/web/locale/tg/viewer.ftl +2 -12
  88. package/static/assets/pdfjs/web/locale/th/viewer.ftl +0 -12
  89. package/static/assets/pdfjs/web/locale/tr/viewer.ftl +2 -12
  90. package/static/assets/pdfjs/web/locale/vi/viewer.ftl +0 -12
  91. package/static/assets/pdfjs/web/locale/zh-CN/viewer.ftl +2 -12
  92. package/static/assets/pdfjs/web/locale/zh-TW/viewer.ftl +0 -12
  93. package/static/assets/pdfjs/web/viewer.css +53 -41
  94. package/static/assets/pdfjs/web/viewer.html +493 -132
  95. package/static/assets/pdfjs/web/viewer.mjs +225 -150
  96. package/static/assets/pdfjs/web/viewer.mjs.map +1 -1
  97. package/static/{chunk-LYZGJZNP.js → chunk-25PWAXTJ.js} +1 -1
  98. package/static/{chunk-YMAN4LIU.js → chunk-2CAAJBRO.js} +1 -1
  99. package/static/{chunk-GRLHFXGB.js → chunk-2F42MZQ5.js} +1 -1
  100. package/static/{chunk-6B3GGAV3.js → chunk-2U5VKTML.js} +1 -1
  101. package/static/{chunk-HKRGIRKB.js → chunk-3AR5VNJE.js} +1 -1
  102. package/static/chunk-3WS72A6C.js +1 -0
  103. package/static/chunk-4GBA6EJ4.js +1 -0
  104. package/static/{chunk-FNOTGWRW.js → chunk-4ZKAVMB4.js} +1 -1
  105. package/static/{chunk-XQGPSNQB.js → chunk-5ATJIR5S.js} +1 -1
  106. package/static/{chunk-HMOB6XC5.js → chunk-5GIWZKNS.js} +1 -1
  107. package/static/{chunk-ZCOWBVOT.js → chunk-5HYSNQR4.js} +1 -1
  108. package/static/{chunk-BHZEPHRI.js → chunk-5KVI243T.js} +1 -1
  109. package/static/{chunk-Q556XB3S.js → chunk-5NFH4E2B.js} +1 -1
  110. package/static/{chunk-XCLK7NJL.js → chunk-7H5O4BLV.js} +1 -1
  111. package/static/{chunk-RDNTK4YH.js → chunk-7HL5Z6PF.js} +1 -1
  112. package/static/{chunk-V6FA5QY4.js → chunk-7QYALK5T.js} +1 -1
  113. package/static/{chunk-GNZPP2VO.js → chunk-ANH4VNOS.js} +1 -1
  114. package/static/{chunk-EIYRBM4J.js → chunk-AYYJZMBE.js} +1 -1
  115. package/static/chunk-B2A4HNDC.js +1 -0
  116. package/static/{chunk-NOPACN4F.js → chunk-B4TDS6AQ.js} +1 -1
  117. package/static/chunk-BJARRIS6.js +562 -0
  118. package/static/{chunk-PXRT4L57.js → chunk-BVKDW5XO.js} +1 -1
  119. package/static/{chunk-7CKHC72R.js → chunk-BX3QZ7IL.js} +1 -1
  120. package/static/{chunk-MIA5YBOI.js → chunk-C5T7RZSD.js} +1 -1
  121. package/static/{chunk-ACUF7IKP.js → chunk-CHMDM2ZW.js} +1 -1
  122. package/static/{chunk-U4RW6XG5.js → chunk-CUC7R6C2.js} +1 -1
  123. package/static/{chunk-XOF4UW3S.js → chunk-D6QWQHWE.js} +1 -1
  124. package/static/{chunk-6NEBGCAZ.js → chunk-DK2LAJEL.js} +1 -1
  125. package/static/{chunk-C3AAEQKW.js → chunk-DQAQUSVW.js} +1 -1
  126. package/static/{chunk-NN4ONTOT.js → chunk-DU4Q4RWJ.js} +1 -1
  127. package/static/{chunk-M4XL3JN5.js → chunk-E5C4QRNQ.js} +2 -2
  128. package/static/{chunk-BU4ZICZR.js → chunk-EPDWJEPD.js} +1 -1
  129. package/static/{chunk-I2S3XPC5.js → chunk-FCR5AEHR.js} +2 -2
  130. package/static/{chunk-4PZPHJ7L.js → chunk-FEQUP26G.js} +1 -1
  131. package/static/{chunk-ZXXHFBGL.js → chunk-FSGT46LM.js} +1 -1
  132. package/static/{chunk-QMHUIHSR.js → chunk-GENTF6JM.js} +1 -1
  133. package/static/{chunk-DQ3GEMPM.js → chunk-GLPKRULI.js} +1 -1
  134. package/static/{chunk-AZ5TF5Y3.js → chunk-GRV44RYI.js} +1 -1
  135. package/static/{chunk-JY2I3HGL.js → chunk-GYYJ4FWN.js} +1 -1
  136. package/static/{chunk-ERDZ7IVF.js → chunk-HB5DC7RJ.js} +1 -1
  137. package/static/{chunk-DJDRX53V.js → chunk-HLKZCMKV.js} +1 -1
  138. package/static/{chunk-HNMGPG72.js → chunk-IBC7CFBQ.js} +1 -1
  139. package/static/{chunk-5E3TYOL3.js → chunk-IIKL33TV.js} +1 -1
  140. package/static/{chunk-TGLJFALR.js → chunk-JYHTSSKW.js} +1 -1
  141. package/static/{chunk-VQJYCYWI.js → chunk-KAAFVHYE.js} +1 -1
  142. package/static/{chunk-VK7XMFVE.js → chunk-KWKZN53T.js} +1 -1
  143. package/static/{chunk-KDEEERWZ.js → chunk-LBXOAKBD.js} +1 -1
  144. package/static/{chunk-Y5RLD72B.js → chunk-LFAQLJZK.js} +1 -1
  145. package/static/chunk-MGMDT4VN.js +1 -0
  146. package/static/chunk-MWUUM2NK.js +13 -0
  147. package/static/{chunk-JMYAD7E2.js → chunk-NHMYAVJK.js} +1 -1
  148. package/static/{chunk-HHWXIK2M.js → chunk-NQCKX2AD.js} +1 -1
  149. package/static/{chunk-HCSWO7BO.js → chunk-O233BXWK.js} +1 -1
  150. package/static/{chunk-2TB2INBF.js → chunk-ODAQRAPO.js} +1 -1
  151. package/static/{chunk-RK2ONYTL.js → chunk-OVUMPMVM.js} +1 -1
  152. package/static/chunk-Q6B4OVER.js +5 -0
  153. package/static/{chunk-3YDYZLF7.js → chunk-QKMN3S4M.js} +1 -1
  154. package/static/{chunk-23UUFZSR.js → chunk-QUUQOBTF.js} +1 -1
  155. package/static/chunk-QV5LQKTS.js +1 -0
  156. package/static/{chunk-NKGKBQBX.js → chunk-S4UTSOPV.js} +1 -1
  157. package/static/{chunk-5S6KPQRA.js → chunk-SF6Q6VRC.js} +1 -1
  158. package/static/{chunk-BODMMLVB.js → chunk-TOCCCZP2.js} +1 -1
  159. package/static/{chunk-3WLBVJ2S.js → chunk-UO7ATVQG.js} +1 -1
  160. package/static/{chunk-AADK5D2H.js → chunk-X5UDV4ZB.js} +1 -1
  161. package/static/{chunk-S2VBGI6Q.js → chunk-XIQXRSZ2.js} +1 -1
  162. package/static/chunk-YYTDPI5S.js +1 -0
  163. package/static/{chunk-EL6QL4TP.js → chunk-Z2KBIZ5D.js} +1 -1
  164. package/static/{chunk-K657XPXA.js → chunk-ZCOEP4O2.js} +1 -1
  165. package/static/index.html +2 -2
  166. package/static/main-ODUA232E.js +11 -0
  167. package/static/{styles-Q4OZOSSK.css → styles-S5HVK4H5.css} +1 -1
  168. package/static/chunk-5XUIPWOH.js +0 -1
  169. package/static/chunk-EDJAISWO.js +0 -13
  170. package/static/chunk-H6WOTGQ5.js +0 -1
  171. package/static/chunk-HC7F57NA.js +0 -1
  172. package/static/chunk-IOIBQGHN.js +0 -562
  173. package/static/chunk-J6YSFHLZ.js +0 -1
  174. package/static/chunk-JWPXQOS3.js +0 -5
  175. package/static/chunk-QVFPHTOH.js +0 -1
  176. package/static/chunk-YCTCESL4.js +0 -1
  177. package/static/main-56PZQ6TJ.js +0 -11
@@ -1 +0,0 @@
1
- import{A as Ee,B as z,C as De,D as A,E as ie,N as Pe,P as ne,a as we,c as w,d as ee,e as S,f as H,i as v,j as te,ja as $,k as V,l as q,n as Ce,na as Re,o as I,p as Se,q as K,s as Ie,t as Oe,u as Te,y as Ae,z as B}from"./chunk-EDJAISWO.js";import{a as L,b as M}from"./chunk-KAVP6UXH.js";var X=class{constructor(e,t,n,o){this.state=e,this.pos=t,this.explicit=n,this.view=o,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=$(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),s=o.search(je(e,!1));return s<0?null:{from:n+s,to:this.pos,text:o.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function ke(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function Ye(i){let e=Object.create(null),t=Object.create(null);for(let{label:o}of i){e[o[0]]=!0;for(let s=1;s<o.length;s++)t[o[s]]=!0}let n=ke(e)+ke(t)+"*$";return[new RegExp("^"+n),new RegExp(n)]}function Ge(i){let e=i.map(o=>typeof o=="string"?{label:o}:o),[t,n]=e.every(o=>/^\w+$/.test(o.label))?[/\w*$/,/\w+$/]:Ye(e);return o=>{let s=o.matchBefore(n);return s||o.explicit?{from:s?s.from:o.pos,options:e,validFor:t}:null}}function Ut(i,e){return t=>{for(let n=$(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var Y=class{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}};function D(i){return i.selection.main.from}function je(i,e){var t;let{source:n}=i,o=e&&n[0]!="^",s=n[n.length-1]!="$";return!o&&!s?i:new RegExp(`${o?"^":""}(?:${n})${s?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var ge=Ce.define();function Je(i,e,t,n){let{main:o}=i.selection,s=t-o.from,l=n-o.from;return M(L({},i.changeByRange(a=>{if(a!=o&&t!=n&&i.sliceDoc(a.from+s,a.from+l)!=i.sliceDoc(t,n))return{range:a};let r=i.toText(e);return{changes:{from:a.from+s,to:n==o.from?a.to:a.from+l,insert:r},range:v.cursor(a.from+s+r.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}var Le=new WeakMap;function Ze(i){if(!Array.isArray(i))return i;let e=Le.get(i);return e||Le.set(i,e=Ge(i)),e}var G=I.define(),F=I.define(),re=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let n=w(e,t),o=S(n);this.chars.push(n);let s=e.slice(t,t+o),l=s.toUpperCase();this.folded.push(w(l==s?s.toLowerCase():l,0)),t+=o}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:n,any:o,precise:s,byWord:l}=this;if(t.length==1){let d=w(e,0),P=S(d),C=P==e.length?0:-100;if(d!=t[0])if(d==n[0])C+=-200;else return null;return this.ret(C,[0,P])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let r=t.length,h=0;if(a<0){for(let d=0,P=Math.min(e.length,200);d<P&&h<r;){let C=w(e,d);(C==t[h]||C==n[h])&&(o[h++]=d),d+=S(C)}if(h<r)return null}let c=0,f=0,u=!1,p=0,m=-1,y=-1,k=/[a-z]/.test(e),T=!0;for(let d=0,P=Math.min(e.length,200),C=0;d<P&&f<r;){let b=w(e,d);a<0&&(c<r&&b==t[c]&&(s[c++]=d),p<r&&(b==t[p]||b==n[p]?(p==0&&(m=d),y=d+1,p++):p=0));let U,_=b<255?b>=48&&b<=57||b>=97&&b<=122?2:b>=65&&b<=90?1:0:(U=ee(b))!=U.toLowerCase()?1:U!=U.toUpperCase()?2:0;(!d||_==1&&k||C==0&&_!=0)&&(t[f]==b||n[f]==b&&(u=!0)?l[f++]=d:l.length&&(T=!1)),C=_,d+=S(b)}return f==r&&l[0]==0&&T?this.result(-100+(u?-200:0),l,e):p==r&&m==0?this.ret(-200-e.length+(y==e.length?0:-100),[0,y]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):p==r?this.ret(-900-e.length,[m,y]):f==r?this.result(-100+(u?-200:0)+-700+(T?0:-1100),l,e):t.length==2?null:this.result((o[0]?-700:0)+-200+-1100,o,e)}result(e,t,n){let o=[],s=0;for(let l of t){let a=l+(this.astral?S(w(n,l)):1);s&&o[s-1]==l?o[s-1]=a:(o[s++]=l,o[s++]=a)}return this.ret(e-n.length,o)}},ae=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),n=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return n==null?null:(this.matched=[0,t.length],this.score=n+(e.length==this.pattern.length?0:-100),this)}},g=te.define({combine(i){return Ie(i,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:_e,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>Me(e(n),t(n)),optionClass:(e,t)=>n=>Me(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function Me(i,e){return i?e?i+" "+e:i:e}function _e(i,e,t,n,o,s){let l=i.textDirection==Ee.RTL,a=l,r=!1,h="top",c,f,u=e.left-o.left,p=o.right-e.right,m=n.right-n.left,y=n.bottom-n.top;if(a&&u<Math.min(m,p)?a=!1:!a&&p<Math.min(m,u)&&(a=!0),m<=(a?u:p))c=Math.max(o.top,Math.min(t.top,o.bottom-y))-e.top,f=Math.min(400,a?u:p);else{r=!0,f=Math.min(400,(l?e.right:o.right-e.left)-30);let d=o.bottom-e.bottom;d>=y||d>e.top?c=t.bottom-e.top:(h="bottom",c=e.bottom-t.top)}let k=(e.bottom-e.top)/s.offsetHeight,T=(e.right-e.left)/s.offsetWidth;return{style:`${h}: ${c/k}px; max-width: ${f/T}px`,class:"cm-completionInfo-"+(r?l?"left-narrow":"right-narrow":a?"left":"right")}}function et(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(o=>"cm-completionIcon-"+o)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,o,s){let l=document.createElement("span");l.className="cm-completionLabel";let a=t.displayLabel||t.label,r=0;for(let h=0;h<s.length;){let c=s[h++],f=s[h++];c>r&&l.appendChild(document.createTextNode(a.slice(r,c)));let u=l.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(a.slice(c,f))),u.className="cm-completionMatchedText",r=f}return r<a.length&&l.appendChild(document.createTextNode(a.slice(r))),l},position:50},{render(t){if(!t.detail)return null;let n=document.createElement("span");return n.className="cm-completionDetail",n.textContent=t.detail,n},position:80}),e.sort((t,n)=>t.position-n.position).map(t=>t.render)}function oe(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let o=Math.floor(e/t);return{from:o*t,to:(o+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}var ce=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:r=>this.placeInfo(r),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:s,selected:l}=o.open,a=e.state.facet(g);this.optionContent=et(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=oe(s.length,l,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",r=>{let{options:h}=e.state.field(t).open;for(let c=r.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<h.length){this.applyCompletion(e,h[+f[1]]),r.preventDefault();return}}),this.dom.addEventListener("focusout",r=>{let h=e.state.field(this.stateField,!1);h&&h.tooltip&&e.state.facet(g).closeOnBlur&&r.relatedTarget!=e.contentDOM&&e.dispatch({effects:F.of(null)})}),this.showOptions(s,o.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:s,selected:l,disabled:a}=n.open;(!o.open||o.open.options!=s)&&(this.range=oe(s.length,l,e.state.facet(g).maxRenderedOptions),this.showOptions(s,n.id)),this.updateSel(),a!=((t=o.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=oe(t.options.length,t.selected,this.view.state.facet(g).maxRenderedOptions),this.showOptions(t.options,e.id));let n=this.updateSelectedOption(t.selected);if(n){this.destroyInfo();let{completion:o}=t.options[t.selected],{info:s}=o;if(!s)return;let l=typeof s=="string"?document.createTextNode(s):s(o);if(!l)return;"then"in l?l.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,o)}).catch(a=>z(this.view.state,a,"completion info")):(this.addInfoPane(l,o),n.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",n.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:o,destroy:s}=e;n.appendChild(o),this.infoDestroy=s||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)n.nodeName!="LI"||!n.id?o--:o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&(n.removeAttribute("aria-selected"),n.removeAttribute("aria-describedby"));return t&&it(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:l.clientWidth,bottom:l.clientHeight}}return o.top>Math.min(s.bottom,t.bottom)-10||o.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(g).positionInfo(this.view,t,o,n,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,n){let o=document.createElement("ul");o.id=t,o.setAttribute("role","listbox"),o.setAttribute("aria-expanded","true"),o.setAttribute("aria-label",this.view.state.phrase("Completions")),o.addEventListener("mousedown",l=>{l.target==o&&l.preventDefault()});let s=null;for(let l=n.from;l<n.to;l++){let{completion:a,match:r}=e[l],{section:h}=a;if(h){let u=typeof h=="string"?h:h.name;if(u!=s&&(l>n.from||n.from==0))if(s=u,typeof h!="string"&&h.header)o.appendChild(h.header(h));else{let p=o.appendChild(document.createElement("completion-section"));p.textContent=u}}let c=o.appendChild(document.createElement("li"));c.id=t+"-"+l,c.setAttribute("role","option");let f=this.optionClass(a);f&&(c.className=f);for(let u of this.optionContent){let p=u(a,this.view.state,this.view,r);p&&c.appendChild(p)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.to<e.length&&o.classList.add("cm-completionListIncompleteBottom"),o}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}};function tt(i,e){return t=>new ce(t,i,e)}function it(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),o=t.height/i.offsetHeight;n.top<t.top?i.scrollTop-=(t.top-n.top)/o:n.bottom>t.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/o)}function Be(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function nt(i,e){let t=[],n=null,o=null,s=c=>{t.push(c);let{section:f}=c.completion;if(f){n||(n=[]);let u=typeof f=="string"?f:f.name;n.some(p=>p.name==u)||n.push(typeof f=="string"?{name:u}:f)}},l=e.facet(g);for(let c of i)if(c.hasResult()){let f=c.result.getMatch;if(c.result.filter===!1)for(let u of c.result.options)s(new Y(u,c.source,f?f(u):[],1e9-t.length));else{let u=e.sliceDoc(c.from,c.to),p,m=l.filterStrict?new ae(u):new re(u);for(let y of c.result.options)if(p=m.match(y.label)){let k=y.displayLabel?f?f(y,p.matched):[]:p.matched,T=p.score+(y.boost||0);if(s(new Y(y,c.source,k,T)),typeof y.section=="object"&&y.section.rank==="dynamic"){let{name:d}=y.section;o||(o=Object.create(null)),o[d]=Math.max(T,o[d]||-1e9)}}}}if(n){let c=Object.create(null),f=0,u=(p,m)=>(p.rank==="dynamic"&&m.rank==="dynamic"?o[m.name]-o[p.name]:0)||(typeof p.rank=="number"?p.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(p.name<m.name?-1:1);for(let p of n.sort(u))f-=1e5,c[p.name]=f;for(let p of t){let{section:m}=p.completion;m&&(p.score+=c[typeof m=="string"?m:m.name])}}let a=[],r=null,h=l.compareCompletions;for(let c of t.sort((f,u)=>u.score-f.score||h(f.completion,u.completion))){let f=c.completion;!r||r.label!=f.label||r.detail!=f.detail||r.type!=null&&f.type!=null&&r.type!=f.type||r.apply!=f.apply||r.boost!=f.boost?a.push(c):Be(c.completion)>Be(r)&&(a[a.length-1]=c),r=c.completion}return a}var fe=class i{constructor(e,t,n,o,s,l){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,$e(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,s,l){if(o&&!l&&e.some(h=>h.isPending))return o.setDisabled();let a=nt(e,t);if(!a.length)return o&&e.some(h=>h.isPending)?o.setDisabled():null;let r=t.facet(g).selectOnOpen?0:-1;if(o&&o.selected!=r&&o.selected!=-1){let h=o.options[o.selected].completion;for(let c=0;c<a.length;c++)if(a[c].completion==h){r=c;break}}return new i(a,$e(n,r),{pos:e.reduce((h,c)=>c.hasResult()?Math.min(h,c.from):h,1e8),create:ct,above:s.aboveCursor},o?o.timestamp:Date.now(),r,!1)}map(e){return new i(this.options,this.attrs,M(L({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},he=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(rt,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(g),s=(n.override||t.languageDataAt("autocomplete",D(t)).map(Ze)).map(r=>(this.active.find(c=>c.source==r)||new O(r,this.active.some(c=>c.state!=0)?1:0)).update(e,n));s.length==this.active.length&&s.every((r,h)=>r==this.active[h])&&(s=this.active);let l=this.open,a=e.effects.some(r=>r.is(ye));l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(r=>r.hasResult()&&e.changes.touchesRange(r.from,r.to))||!ot(s,this.active)||a?l=fe.build(s,t,this.id,l,n,a):l&&l.disabled&&!s.some(r=>r.isPending)&&(l=null),!l&&s.every(r=>!r.isPending)&&s.some(r=>r.hasResult())&&(s=s.map(r=>r.hasResult()?new O(r.source,0):r));for(let r of e.effects)r.is(He)&&(l=l&&l.setSelected(r.value,this.id));return s==this.active&&l==this.open?this:new i(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?st:lt}};function ot(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t<i.length&&!i[t].hasResult();)t++;for(;n<e.length&&!e[n].hasResult();)n++;let o=t==i.length,s=n==e.length;if(o||s)return o==s;if(i[t++].result!=e[n++].result)return!1}}var st={"aria-autocomplete":"list"},lt={};function $e(i,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":i};return e>-1&&(t["aria-activedescendant"]=i+"-"+e),t}var rt=[];function Ue(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(ge);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var O=class i{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=Ue(e,t),o=this;(n&8||n&16&&this.touches(e))&&(o=new i(o.source,0)),n&4&&o.state==0&&(o=new i(this.source,1)),o=o.updateFor(e,n);for(let s of e.effects)if(s.is(G))o=new i(o.source,1,s.value);else if(s.is(F))o=new i(o.source,0);else if(s.is(ye))for(let l of s.value)l.source==o.source&&(o=l);return o}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(D(e.state))}},J=class i extends O{constructor(e,t,n,o,s,l){super(e,3,t),this.limit=n,this.result=o,this.from=s,this.to=l}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let o=this.result;o.map&&!e.changes.empty&&(o=o.map(o,e.changes));let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),a=D(e.state);if(a>l||!o||t&2&&(D(e.startState)==this.from||a<this.limit))return new O(this.source,t&4?1:0);let r=e.changes.mapPos(this.limit);return at(o.validFor,e.state,s,l)?new i(this.source,this.explicit,r,o,s,l):o.update&&(o=o.update(o,s,l,new X(e.state,a,!1)))?new i(this.source,this.explicit,r,o,o.from,(n=o.to)!==null&&n!==void 0?n:D(e.state)):new O(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new i(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new O(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}};function at(i,e,t,n){if(!i)return!1;let o=e.sliceDoc(t,n);return typeof i=="function"?i(o,t,n,e):je(i,!0).test(o)}var ye=I.define({map(i,e){return i.map(t=>t.map(e))}}),He=I.define(),x=V.define({create(){return he.start()},update(i,e){return i.update(e)},provide:i=>[Pe.from(i,e=>e.tooltip),A.contentAttributes.from(i,e=>e.attrs)]});function be(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(x).active.find(o=>o.source==e.source);return n instanceof J?(typeof t=="string"?i.dispatch(M(L({},Je(i.state,t,n.from,n.to)),{annotations:ge.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}var ct=tt(x,be);function Q(i,e="option"){return t=>{let n=t.state.field(x,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp<t.state.facet(g).interactionDelay)return!1;let o=1,s;e=="page"&&(s=ne(t,n.open.tooltip))&&(o=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:l}=n.open.options,a=n.open.selected>-1?n.open.selected+o*(i?1:-1):i?0:l-1;return a<0?a=e=="page"?0:l-1:a>=l&&(a=e=="page"?l-1:0),t.dispatch({effects:He.of(a)}),!0}}var ft=i=>{let e=i.state.field(x,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<i.state.facet(g).interactionDelay?!1:be(i,e.open.options[e.open.selected])},se=i=>i.state.field(x,!1)?(i.dispatch({effects:G.of(!0)}),!0):!1,ht=i=>{let e=i.state.field(x,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:F.of(null)}),!0)},ue=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},ut=50,pt=1e3,dt=De.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(x).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(x),t=i.state.facet(g);if(!i.selectionSet&&!i.docChanged&&i.startState.field(x)==e)return;let n=i.transactions.some(s=>{let l=Ue(s,t);return l&8||(s.selection||s.docChanged)&&!(l&3)});for(let s=0;s<this.running.length;s++){let l=this.running[s];if(n||l.context.abortOnDocChange&&i.docChanged||l.updates.length+i.transactions.length>ut&&Date.now()-l.time>pt){for(let a of l.context.abortListeners)try{a()}catch(r){z(this.view.state,r)}l.context.abortListeners=null,this.running.splice(s--,1)}else l.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(s=>s.effects.some(l=>l.is(G)))&&(this.pendingStart=!0);let o=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(l=>l.active.source==s.source))?setTimeout(()=>this.startUpdate(),o):-1,this.composing!=0)for(let s of i.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(x);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=D(e),n=new X(e,t,i.explicit,this.view),o=new ue(i,n);this.running.push(o),Promise.resolve(i.source(n)).then(s=>{o.context.aborted||(o.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:F.of(null)}),z(this.view.state,s)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(g).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(g),n=this.view.state.field(x);for(let o=0;o<this.running.length;o++){let s=this.running[o];if(s.done===void 0)continue;if(this.running.splice(o--,1),s.done){let a=D(s.updates.length?s.updates[0].startState:this.view.state),r=Math.min(a,s.done.from+(s.active.explicit?0:1)),h=new J(s.active.source,s.active.explicit,r,s.done,s.done.from,(i=s.done.to)!==null&&i!==void 0?i:a);for(let c of s.updates)h=h.update(c,t);if(h.hasResult()){e.push(h);continue}}let l=n.active.find(a=>a.source==s.active.source);if(l&&l.isPending)if(s.done==null){let a=new O(s.active.source,0);for(let r of s.updates)a=a.update(r,t);a.isPending||e.push(a)}else this.startQuery(l)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:ye.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(x,!1);if(e&&e.tooltip&&this.view.state.facet(g).closeOnBlur){let t=e.open&&ne(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:F.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:G.of(!1)}),20),this.composing=0}}}),mt=typeof navigator=="object"&&/Win/.test(navigator.platform),gt=q.highest(A.domEventHandlers({keydown(i,e){let t=e.state.field(x,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(mt&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],o=t.active.find(l=>l.source==n.source),s=n.completion.commitCharacters||o.result.commitCharacters;return s&&s.indexOf(i.key)>-1&&be(e,n),!1}})),Ve=A.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),pe=class{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}},de=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,H.TrackDel),n=e.mapPos(this.to,1,H.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},me=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let r of this.lines){if(n.length){let h=l,c=/^\t*/.exec(r)[0].length;for(let f=0;f<c;f++)h+=e.facet(Re);o.push(t+h.length-c),r=h+r.slice(c)}n.push(r),t+=r.length+1}let a=this.fieldPositions.map(r=>new de(r.field,o[r.line]+r.from,o[r.line]+r.to));return{text:n,ranges:a}}static parse(e){let t=[],n=[],o=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(l);){let a=s[1]?+s[1]:null,r=s[2]||s[3]||"",h=-1,c=r.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(a!=null?t[f].seq==a:c&&t[f].name==c)&&(h=f);if(h<0){let f=0;for(;f<t.length&&(a==null||t[f].seq!=null&&t[f].seq<a);)f++;t.splice(f,0,{seq:a,name:c}),h=f;for(let u of o)u.field>=h&&u.field++}for(let f of o)if(f.line==n.length&&f.from>s.index){let u=s[2]?3+(s[1]||"").length:2;f.from-=u,f.to-=u}o.push(new pe(h,n.length,s.index,s.index+c.length)),l=l.slice(0,s.index)+r+l.slice(s.index+s[0].length)}l=l.replace(/\\([{}])/g,(a,r,h)=>{for(let c of o)c.line==n.length&&c.from>h&&(c.from--,c.to--);return r}),n.push(l)}return new i(n,o)}},yt=B.widget({widget:new class extends Ae{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),bt=B.mark({class:"cm-snippetField"}),R=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=B.set(e.map(n=>(n.from==n.to?yt:bt).range(n.from,n.to)),!0)}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},j=I.define({map(i,e){return i&&i.map(e)}}),xt=I.define(),W=V.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(j))return t.value;if(t.is(xt)&&i)return new R(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>A.decorations.from(i,e=>e?e.deco:B.none)});function xe(i,e){return v.create(i.filter(t=>t.field==e).map(t=>v.range(t.from,t.to)))}function vt(i){let e=me.parse(i);return(t,n,o,s)=>{let{text:l,ranges:a}=e.instantiate(t.state,o),{main:r}=t.state.selection,h={changes:{from:o,to:s==r.from?r.to:s,insert:we.of(l)},scrollIntoView:!0,annotations:n?[ge.of(n),Se.userEvent.of("input.complete")]:void 0};if(a.length&&(h.selection=xe(a,0)),a.some(c=>c.field>0)){let c=new R(a,0),f=h.effects=[j.of(c)];t.state.field(W,!1)===void 0&&f.push(I.appendConfig.of([W,Ot,Tt,Ve]))}t.dispatch(t.state.update(h))}}function qe(i){return({state:e,dispatch:t})=>{let n=e.field(W,!1);if(!n||i<0&&n.active==0)return!1;let o=n.active+i,s=i>0&&!n.ranges.some(l=>l.field==o+i);return t(e.update({selection:xe(n.ranges,o),effects:j.of(s?null:new R(n.ranges,o)),scrollIntoView:!0})),!0}}var wt=({state:i,dispatch:e})=>i.field(W,!1)?(e(i.update({effects:j.of(null)})),!0):!1,Ct=qe(1),St=qe(-1);var It=[{key:"Tab",run:Ct,shift:St},{key:"Escape",run:wt}],Fe=te.define({combine(i){return i.length?i[0]:It}}),Ot=q.highest(ie.compute([Fe],i=>i.facet(Fe)));function Ht(i,e){return M(L({},e),{apply:vt(i)})}var Tt=A.domEventHandlers({mousedown(i,e){let t=e.state.field(W,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let o=t.ranges.find(s=>s.from<=n&&s.to>=n);return!o||o.field==t.active?!1:(e.dispatch({selection:xe(t.ranges,o.field),effects:j.of(t.ranges.some(s=>s.field>o.field)?new R(t.ranges,o.field):null),scrollIntoView:!0}),!0)}});var N={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},E=I.define({map(i,e){let t=e.mapPos(i,-1,H.TrackAfter);return t??void 0}}),ve=new class extends Oe{};ve.startSide=1;ve.endSide=-1;var Ke=V.define({create(){return Te.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(E)&&(i=i.update({add:[ve.range(t.value,t.value+1)]}));return i}});function Vt(){return[Et,Ke]}var le="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function ze(i){for(let e=0;e<le.length;e+=2)if(le.charCodeAt(e)==i)return le.charAt(e+1);return ee(i<128?i:i+1)}function Qe(i,e){return i.languageDataAt("closeBrackets",e)[0]||N}var At=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Et=A.inputHandler.of((i,e,t,n)=>{if((At?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let o=i.state.selection.main;if(n.length>2||n.length==2&&S(w(n,0))==1||e!=o.from||t!=o.to)return!1;let s=Pt(i.state,n);return s?(i.dispatch(s),!0):!1}),Dt=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=Qe(i,i.selection.main.head).brackets||N.brackets,o=null,s=i.changeByRange(l=>{if(l.empty){let a=Rt(i.doc,l.head);for(let r of n)if(r==a&&Z(i.doc,l.head)==ze(w(r,0)))return{changes:{from:l.head-r.length,to:l.head+r.length},range:v.cursor(l.head-r.length)}}return{range:o=l}});return o||e(i.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!o},qt=[{key:"Backspace",run:Dt}];function Pt(i,e){let t=Qe(i,i.selection.main.head),n=t.brackets||N.brackets;for(let o of n){let s=ze(w(o,0));if(e==o)return s==o?Mt(i,o,n.indexOf(o+o+o)>-1,t):kt(i,o,s,t.before||N.before);if(e==s&&Xe(i,i.selection.main.from))return Lt(i,o,s)}return null}function Xe(i,e){let t=!1;return i.field(Ke).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function Z(i,e){let t=i.sliceString(e,e+2);return t.slice(0,S(w(t,0)))}function Rt(i,e){let t=i.sliceString(e-2,e);return S(w(t,0))==t.length?t:t.slice(1)}function kt(i,e,t,n){let o=null,s=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:E.of(l.to+e.length),range:v.range(l.anchor+e.length,l.head+e.length)};let a=Z(i.doc,l.head);return!a||/\s/.test(a)||n.indexOf(a)>-1?{changes:{insert:e+t,from:l.head},effects:E.of(l.head+e.length),range:v.cursor(l.head+e.length)}:{range:o=l}});return o?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function Lt(i,e,t){let n=null,o=i.changeByRange(s=>s.empty&&Z(i.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:v.cursor(s.head+t.length)}:n={range:s});return n?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function Mt(i,e,t,n){let o=n.stringPrefixes||N.stringPrefixes,s=null,l=i.changeByRange(a=>{if(!a.empty)return{changes:[{insert:e,from:a.from},{insert:e,from:a.to}],effects:E.of(a.to+e.length),range:v.range(a.anchor+e.length,a.head+e.length)};let r=a.head,h=Z(i.doc,r),c;if(h==e){if(We(i,r))return{changes:{insert:e+e,from:r},effects:E.of(r+e.length),range:v.cursor(r+e.length)};if(Xe(i,r)){let u=t&&i.sliceDoc(r,r+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:r,to:r+u.length,insert:u},range:v.cursor(r+u.length)}}}else{if(t&&i.sliceDoc(r-2*e.length,r)==e+e&&(c=Ne(i,r-2*e.length,o))>-1&&We(i,c))return{changes:{insert:e+e+e+e,from:r},effects:E.of(r+e.length),range:v.cursor(r+e.length)};if(i.charCategorizer(r)(h)!=K.Word&&Ne(i,r,o)>-1&&!Bt(i,r,e,o))return{changes:{insert:e+e,from:r},effects:E.of(r+e.length),range:v.cursor(r+e.length)}}return{range:s=a}});return s?null:i.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function We(i,e){let t=$(i).resolveInner(e+1);return t.parent&&t.from==e}function Bt(i,e,t,n){let o=$(i).resolveInner(e,-1),s=n.reduce((l,a)=>Math.max(l,a.length),0);for(let l=0;l<5;l++){let a=i.sliceDoc(o.from,Math.min(o.to,o.from+t.length+s)),r=a.indexOf(t);if(!r||r>-1&&n.indexOf(a.slice(0,r))>-1){let c=o.firstChild;for(;c&&c.from==o.from&&c.to-c.from>t.length+r;){if(i.sliceDoc(c.to-t.length,c.to)==t)return!1;c=c.firstChild}return!0}let h=o.to==e&&o.parent;if(!h)break;o=h}return!1}function Ne(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=K.Word)return e;for(let o of t){let s=e-o.length;if(i.sliceDoc(s,e)==o&&n(i.sliceDoc(s-1,s))!=K.Word)return s}return-1}function Kt(i={}){return[gt,x,g.of(i),dt,Ft,Ve]}var $t=[{key:"Ctrl-Space",run:se},{mac:"Alt-`",run:se},{mac:"Alt-i",run:se},{key:"Escape",run:ht},{key:"ArrowDown",run:Q(!0)},{key:"ArrowUp",run:Q(!1)},{key:"PageDown",run:Q(!0,"page")},{key:"PageUp",run:Q(!1,"page")},{key:"Enter",run:ft}],Ft=q.highest(ie.computeN([g],i=>i.facet(g).defaultKeymap?[$t]:[]));export{X as a,Ge as b,Ut as c,Ht as d,Vt as e,qt as f,Kt as g,$t as h};
@@ -1,5 +0,0 @@
1
- import{e as ao,f as lo,g as co,h as uo}from"./chunk-J6YSFHLZ.js";import{A as Ws,Aa as io,Ba as no,C as ti,Ca as so,D as I,Da as vt,E as gt,Ea as Xi,F as js,Fa as oo,G as Ki,H as Gs,Ha as Xe,I as Yi,Ia as ro,J as zs,K as qs,L as Ks,M as Ys,O as Qs,Q as Je,R as bt,S as Js,T as Xs,U as Zs,V as ii,a as qi,b as Ee,c as Os,d as Vs,da as v,e as Bs,g as Ns,h as Hs,i as k,j as Le,ja as ni,k as Ke,l as Us,la as eo,m as ve,ma as c,n as pt,na as si,o as Y,oa as oi,p as ot,pa as yt,q as te,qa as Qi,r as Ye,ra as Ji,s as Qe,v as Zt,w as ei,wa as to,x as M,y as $s,z as U}from"./chunk-EDJAISWO.js";import{c as Ls}from"./chunk-JXZCNFW7.js";import{a as Rs,h as Jt,m as Xt,o as we}from"./chunk-MYM43ENO.js";import{a as Qt}from"./chunk-ZCOWBVOT.js";import{Aa as Kt,Cb as K,Da as Ss,Db as Ms,Eb as Is,Fb as Fs,Ga as ks,Ha as xs,Ia as ws,Mb as Yt,Nb as ne,Ob as Fe,Ra as Es,Ua as st,Ya as Ds,bb as Ps,cb as _s,ib as zi,lb as As,m as is,s as Gt,t as zt,tb as Ts,vb as Ie,ya as Cs,za as de}from"./chunk-I2S3XPC5.js";import{Aa as Ue,Ac as Gi,B as F,Bb as z,Bc as qe,Be as ds,C as He,Cb as Rt,Cd as jt,E as Hn,Eb as x,Ed as Te,Ef as qt,G as Un,Gb as E,Ha as jn,Hb as Ni,Ia as Pe,Ib as Hi,Ja as Gn,Jb as Kn,Jd as Me,Kd as nt,Lb as Ui,Ma as ke,Mb as $i,Nb as Ot,Oa as f,Ob as Vt,Pb as Yn,Pe as fs,Qa as he,Qb as ee,Qc as Ae,Rb as $e,Se as ms,Tb as D,Ub as X,Vb as Wi,Wb as Qn,Wc as it,Xa as be,Xb as We,Xc as es,Yb as je,Yc as ae,Zb as Ge,aa as tt,ab as R,bb as xe,be as ns,c as Rn,cb as zn,cd as Ut,da as $n,dd as ts,ea as J,ec as Bt,ee as ss,ef as ps,f as ft,fa as Se,fe as os,ge as rs,hc as Jn,ie as as,ja as C,jd as $t,je as ls,k as On,kc as V,lb as N,mb as H,mc as j,me as cs,mf as gs,nb as qn,nc as Xn,ne as us,nf as bs,oa as P,od as Wt,oe as hs,og as ye,pa as _,pb as Vi,q as Vn,qb as Bi,rb as y,rc as Nt,sa as Wn,sb as p,sc as _e,t as Bn,tb as m,tc as ji,u as De,ub as A,v as et,va as ie,vc as Zn,w as Nn,wc as Z,wf as ys,xa as mt,xb as Lt,xc as Ht,yc as ze,zf as vs}from"./chunk-IOIBQGHN.js";import{a as Ft,b as Oi,i as B}from"./chunk-KAVP6UXH.js";var w=(function(e){return e.MAKE="make",e.COPY="copy",e.MOVE="move",e.DELETE="delete",e.COMPRESS="compress",e.DECOMPRESS="decompress",e.DOWNLOAD="download",e.UPLOAD="upload",e.TOUCH="touch",e.THUMBNAIL="thumbnail",e.GET_SIZE="getSize",e.LOCK="lock",e.UNLOCK="unlock",e.UNLOCK_REQUEST="unlockRequest",e})(w||{}),le=(function(e){return e.VIEW="view",e.EDIT="edit",e})(le||{});var G={BASE:Ms.BASE,OPERATION:"operation",TASK_OPERATION:"task/operation",TASKS:"tasks",TASKS_DOWNLOAD:"download",RECENTS:"recents",SEARCH:"search",ONLY_OFFICE:"onlyoffice",ONLY_OFFICE_SETTINGS:"settings",ONLY_OFFICE_DOCUMENT:"document",ONLY_OFFICE_CALLBACK:"callback",ONLY_OFFICE_STATUS:"status"},rt=`${G.BASE}/${G.OPERATION}`,Rc=`${rt}/${w.THUMBNAIL}`,Zi=`${rt}/${w.MAKE}`,en=`${rt}/${w.UPLOAD}`,tn=`${G.BASE}/${G.TASK_OPERATION}`,ho=`${tn}/${w.DOWNLOAD}`,fo=`${tn}/${w.COMPRESS}`,mo=`${tn}/${w.DECOMPRESS}`,Ct=`${G.BASE}/${G.TASKS}`,po=`${G.BASE}/${G.TASKS}/${G.TASKS_DOWNLOAD}`,go=`${G.BASE}/${G.RECENTS}`,bo=`${G.BASE}/${G.SEARCH}`,ri=`${G.BASE}/${G.ONLY_OFFICE}`,yo=`${ri}/${G.ONLY_OFFICE_SETTINGS}`,Oc=`${ri}/${G.ONLY_OFFICE_DOCUMENT}`,Vc=`${ri}/${G.ONLY_OFFICE_CALLBACK}`,vo=`${ri}/${G.ONLY_OFFICE_STATUS}`;var Co=(()=>{let t=class t{constructor(){this.inPersonalSpace=!1,this.http=C(ae),this.layout=C(K),this.breadCrumbFilesRepo=!1,this.inShareRepo=!1,this.inRootSpace=!1}setEnvironment(i,n){this.breadCrumbFilesRepo=Fe.FILES===i,this.inPersonalSpace=n.length&&n[0].path===Fe.PERSONAL,this.inShareRepo=i===Fe.SHARES,this.inRootSpace=this.inShareRepo?n.length===0:n.length===1,this.browseApi=Ps(`${Is}/${i}`,n,!1),this.breadCrumbUrl=`/${Fe.SPACES}/${i}${_s(n)}`,this.breadCrumbIcon=this.inShareRepo?ne.SHARED_WITH_ME:this.breadCrumbFilesRepo?this.inPersonalSpace&&this.breadCrumbFilesRepo?ne.PERSONAL:ne.SPACES:ne.TRASH}loadFiles(){return this.http.get(this.browseApi).pipe(tt(()=>{this.layout.setBreadcrumbIcon(this.breadCrumbIcon),this.layout.setBreadcrumbNav(this.breadcrumbNav())}),Un(i=>Vn(()=>i)))}breadcrumbNav(){return{url:this.inPersonalSpace&&this.inRootSpace?`${this.breadCrumbUrl}/${Yt.SHORT_PERSONAL_FILES}`:this.inShareRepo&&this.inRootSpace?`${this.breadCrumbUrl}/${Yt.SHARED_WITH_ME}`:this.breadCrumbUrl,translating:this.inRootSpace&&(this.inPersonalSpace||this.inShareRepo),sameLink:this.inRootSpace&&(this.inPersonalSpace||this.inShareRepo),firstLink:this.inPersonalSpace&&this.breadCrumbFilesRepo?null:this.breadCrumbFilesRepo?Fe.SPACES:this.inShareRepo?Fe.SPACES_SHARES:Fe.TRASH,mutateLevel:this.inPersonalSpace&&!this.breadCrumbFilesRepo&&!this.inRootSpace?{0:{setTitle:Yt.PERSONAL_FILES,translateTitle:!0}}:null,splicing:this.inPersonalSpace?!this.breadCrumbFilesRepo&&!this.inRootSpace?2:3:2}}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();function Xr(e,t){e&1&&(p(0,"span",6),D(1,"The file is locked by"),m())}function Zr(e,t){e&1&&(p(0,"span",6),D(1,"The file is edited by"),m())}function ea(e,t){e&1&&(p(0,"b",8),D(1,"me"),m())}function ta(e,t){if(e&1&&(p(0,"b"),D(1),m()),e&2){let o=E();f(),X(o.file==null||o.file.lock==null?null:o.file.lock.owner)}}function ia(e,t){e&1&&(p(0,"div",9)(1,"small",8),D(2,"As the file owner, you can unlock the file or request the current lock owner to release it."),m()())}function na(e,t){if(e&1){let o=z();p(0,"button",14),x("click",function(){P(o);let n=E(2);return _(n.onUnlock())}),D(1,"Unlock"),m()}if(e&2){let o=E(2);y("disabled",o.submitted)}}function sa(e,t){if(e&1){let o=z();p(0,"button",15),x("click",function(){P(o);let n=E(2);return _(n.onSendUnLockRequest())}),D(1,"Send an unlock request"),m()}if(e&2){let o=E(2);y("disabled",o.submitted)}}function oa(e,t){if(e&1&&(N(0,na,2,1,"button",12),N(1,sa,2,1,"button",13)),e&2){let o=E();H(o.isLockOwner||o.isFileOwner?0:-1),f(),H(o.isLockOwner?-1:1)}}var So=(()=>{let t=class t{constructor(){this.locale=C(Te),this.layout=C(K),this.icons={faLock:qt,faUnlock:rs},this.submitted=!1,this.store=C(Ie),this.userLogin=this.store.user.getValue().login,this.isFileOwner=!1,this.isLockOwner=!1,this.hasExclusiveLock=!0,this.spacesBrowserService=C(Co),this.filesService=C(at)}ngOnInit(){this.hasExclusiveLock=this.file.lock.isExclusive,this.isFileOwner=this.spacesBrowserService.inPersonalSpace||this.file.root?.owner?.login===this.userLogin,this.isLockOwner=this.file.lock.ownerLogin===this.userLogin,this.userAvatarUrl=Ts(this.file.lock.ownerLogin)}onEnter(){return B(this,null,function*(){this.isLockOwner?yield this.onUnlock():this.onSendUnLockRequest()})}onEsc(){this.layout.closeDialog()}onUnlock(){return B(this,null,function*(){try{this.submitted=!0,yield De(this.filesService.unlock(this.file,!this.isLockOwner)),delete this.file.lock,this.layout.closeDialog()}catch(i){this.submitted=!1,this.layout.sendNotification("warning",this.file.name,i.error.message)}})}onSendUnLockRequest(){this.submitted=!0,this.filesService.unlockRequest(this.file).subscribe({next:()=>this.layout.closeDialog(),error:i=>{this.submitted=!1,this.layout.sendNotification("warning",this.file.name,i.error.message)}})}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-lock-dialog"]],hostBindings:function(n,s){n&1&&x("keyup.enter",function(){return s.onEnter()},ke)("keyup.escape",function(){return s.onEsc()},ke)},inputs:{file:"file"},decls:19,vars:11,consts:[[1,"modal-header"],[1,"modal-title"],[1,"me-1",3,"icon"],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[1,"d-flex","flex-column","align-items-center","avatar","my-2"],["l10nTranslate","",1,"mb-2"],["alt","",1,"avatar-img","mb-2",3,"src"],["l10nTranslate",""],[1,"text-align-center","mt-3","mb-1"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary",3,"click","disabled"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-success",3,"click","disabled"]],template:function(n,s){n&1&&(p(0,"div",0)(1,"h4",1),A(2,"fa-icon",2),p(3,"span"),D(4),m()(),p(5,"button",3),x("click",function(){return s.layout.closeDialog()}),m()(),p(6,"div",4)(7,"div",5),N(8,Xr,2,0,"span",6)(9,Zr,2,0,"span",6),A(10,"img",7),N(11,ea,2,0,"b",8)(12,ta,2,1,"b"),m(),N(13,ia,3,0,"div",9),m(),p(14,"div",10)(15,"button",11),x("click",function(){return s.layout.closeDialog()}),D(16),V(17,"translate"),m(),N(18,oa,2,2),m()),n&2&&(f(2),y("icon",s.hasExclusiveLock?s.icons.faLock:s.icons.faUnlock),f(2),X(s.file.name),f(4),H(s.hasExclusiveLock?8:9),f(2),y("src",s.userAvatarUrl,Pe),f(),H(s.isLockOwner?11:12),f(2),H(!s.isLockOwner&&s.isFileOwner?13:-1),f(3),Wi(" ",s.hasExclusiveLock?"Cancel":j(17,8,"Close",s.locale.language)," "),f(2),H(s.hasExclusiveLock?18:-1))},dependencies:[ye,nt,Me],encapsulation:2});let e=t;return e})();var ra=(e,t)=>({old:e,new:t});function aa(e,t){e&1&&(p(0,"span",3),D(1,"Replace Existing File"),m())}function la(e,t){e&1&&(p(0,"span",3),D(1,"Overwrite Existing File(s)"),m())}function ca(e,t){if(e&1&&(A(0,"div",6),V(1,"translate")),e&2){let o=E();y("innerHTML",Xn(1,1,"RenameFileToExisting",o.locale.language,Jn(5,ra,o.files[0].name,o.renamedTo)),jn)}}function ua(e,t){if(e&1){let o=z();p(0,"div",11)(1,"img",12),x("error",function(){let n=P(o).$implicit;return _(n.fallBackMimeUrl())}),m(),p(2,"div",13)(3,"span"),D(4),m()()()}if(e&2){let o=t.$implicit;f(),y("src",o.mimeUrl,Pe),f(3),X(o.name)}}function ha(e,t){if(e&1&&(p(0,"div",10),D(1,"Do you want to replace the existing file(s)?"),m(),Vi(2,ua,5,2,"div",11,qn)),e&2){let o=E();f(2),Bi(o.files)}}var ko=(()=>{let t=class t{constructor(){this.files=[],this.overwrite=Zn(),this.locale=C(Te),this.layout=C(K),this.icons={faFileShield:ms},this.submitted=!1}onEnter(){this.onAction(!0)}onEsc(){this.onAction(!1)}onAction(i){this.submitted=i,this.overwrite.emit(i),this.layout.closeDialog()}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-overwrite-dialog"]],hostBindings:function(n,s){n&1&&x("keyup.enter",function(){return s.onEnter()},ke)("keyup.escape",function(){return s.onEsc()},ke)},inputs:{files:"files",renamedTo:"renamedTo"},outputs:{overwrite:"overwrite"},decls:14,vars:4,consts:[[1,"modal-header"],["l10nTranslate","",1,"modal-title"],[1,"me-1",3,"icon"],["l10nTranslate",""],["aria-label","Close","type","button",1,"btn-close","btn-close-white",3,"click"],[1,"modal-body"],[3,"innerHTML"],[1,"modal-footer"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger",3,"click","disabled"],["l10nTranslate","",1,"fw-bold","mb-3"],["draggable","true",1,"d-flex","align-items-center","mb-1"],["alt","","height","24","width","24",3,"error","src"],[1,"d-flex","flex-column","text-truncate","ms-1"]],template:function(n,s){n&1&&(p(0,"div",0)(1,"h4",1),A(2,"fa-icon",2),N(3,aa,2,0,"span",3)(4,la,2,0,"span",3),m(),p(5,"button",4),x("click",function(){return s.layout.closeDialog()}),m()(),p(6,"div",5),N(7,ca,2,8,"div",6)(8,ha,4,0),m(),p(9,"div",7)(10,"button",8),x("click",function(){return s.onAction(!1)}),D(11,"Cancel"),m(),p(12,"button",9),x("click",function(){return s.onAction(!0)}),D(13,"Confirm"),m()()),n&2&&(f(2),y("icon",s.icons.faFileShield),f(),H(s.renamedTo?3:4),f(4),H(s.renamedTo?7:8),f(5),y("disabled",s.submitted))},dependencies:[ye,nt,Me],encapsulation:2});let e=t;return e})();var da=(e,t)=>B(null,null,function*(){return new Promise((o,i)=>{try{if(window.DocsAPI)return o(null);let n=document.getElementById(t);if(n){let s=setInterval(()=>{if(!n.getAttribute("loading")){if(clearInterval(s),window.DocsAPI)return o(null);let a=xo(t,e,o,i);n.remove(),document.body.appendChild(a)}},500)}else{let s=xo(t,e,o,i);document.body.appendChild(s)}}catch(n){console.error(n)}})}),xo=(e,t,o,i)=>{let n=document.createElement("script");return n.id=e,n.type="text/javascript",n.src=t,n.async=!0,n.onload=()=>{n.removeAttribute("loading"),o(null)},n.onerror=s=>{n.removeAttribute("loading"),i(s)},n.setAttribute("loading",""),n},wo=da;var Eo=(()=>{let t=class t{constructor(){this.loadError=new he,this.isFirstOnChanges=!0,this.onLoad=()=>{try{if(window.DocsAPI||this.onError(-3),window?.DocEditor?.instances[this.id]){console.log("Skip loading, instance already exists",this.id);return}window?.DocEditor?.instances||(window.DocEditor={instances:{}});let i=JSON.parse(JSON.stringify(this.config));window.DocEditor.instances[this.id]=window.DocsAPI.DocEditor(this.id,i)}catch(i){console.error(i),this.onError(-1)}}}ngOnInit(){let i=this.documentServerUrl;i.endsWith("/")||(i+="/");let n=`${i}web-apps/apps/api/documents/api.js`;wo(n,"onlyoffice-api-script").then(()=>this.onLoad()).catch(()=>{this.onError(-2)})}ngOnChanges(i){if(this.isFirstOnChanges){this.isFirstOnChanges=!1;return}if("config"in i&&window?.DocEditor?.instances[this.id]){window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0,console.warn("Important props have been changed, reloading ..."),this.onLoad();return}}ngOnDestroy(){window?.DocEditor?.instances[this.id]&&(window.DocEditor.instances[this.id].destroyEditor(),window.DocEditor.instances[this.id]=void 0)}onError(i){let n;switch(i){case-2:n="Check the settings";break;case-3:n="DocsAPI is not defined";break;default:n="Unknown error !",i=-1}this.loadError.emit(n)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-onlyoffice-document"]],inputs:{id:"id",documentServerUrl:"documentServerUrl",config:"config"},outputs:{loadError:"loadError"},features:[mt],decls:1,vars:1,consts:[[3,"id"]],template:function(n,s){n&1&&Lt(0,"div",0),n&2&&Rt("id",s.id)},encapsulation:2});let e=t;return e})();function fa(e,t){if(e&1){let o=z();p(0,"div")(1,"app-files-onlyoffice-document",1),x("loadError",function(n){P(o);let s=E();return _(s.loadError(n))}),m()()}if(e&2){let o=E();ee("height",o.currentHeight(),"px"),f(),y("id",o.docId)("documentServerUrl",o.documentConfig.documentServerUrl)("config",o.documentConfig.config)}}var Do=(()=>{let t=class t{constructor(){this.currentHeight=Z(),this.documentConfig=null,this.http=C(ae),this.layout=C(K),this.store=C(Ie)}ngOnInit(){this.docId=`viewer-doc-${this.file.id}`,this.http.get(`${yo}/${this.file.path}`,{params:new it().set("mode",this.mode)}).subscribe({next:i=>{if(!i){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document","Settings are missing");return}this.mode===le.EDIT&&i.config.editorConfig.mode!==le.EDIT?i.config.editorConfig.mode=le.VIEW:i.config.editorConfig.mode=this.mode,this.mode===le.EDIT&&(this.file.lock={owner:`${Ss} - ${this.store.user.getValue().fullName} (${this.store.user.getValue().email})`,ownerLogin:this.store.user.getValue().login,isExclusive:!1}),i.config.editorConfig.lang=this.layout.getCurrentLanguage(),i.config.editorConfig.region=this.layout.getCurrentLanguage(),this.documentConfig=i},error:i=>{this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",i.error.message)}})}ngOnDestroy(){this.file.lock=null}loadError(i){this.layout.closeDialog(),this.layout.sendNotification("error","Unable to open document",i)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-document"]],inputs:{file:"file",mode:"mode",currentHeight:[1,"currentHeight"]},decls:1,vars:1,consts:[[3,"height"],[3,"loadError","id","documentServerUrl","config"]],template:function(n,s){n&1&&N(0,fa,2,5,"div",0),n&2&&H(s.documentConfig?0:-1)},dependencies:[Eo],styles:[".doc-placeholder[_ngcontent-%COMP%]{display:none!important}"]});let e=t;return e})();var ga=["image"];function ba(e,t){if(e&1){let o=z();p(0,"button",5),V(1,"translate"),x("click",function(){P(o);let n=E();return _(n.startSlideshow())}),A(2,"fa-icon",4),m()}if(e&2){let o=E();y("tooltip",j(1,2,"Start Slideshow",o.locale.language)),f(2),y("icon",o.icons.faPlay)}}function ya(e,t){if(e&1){let o=z();p(0,"button",5),V(1,"translate"),x("click",function(){P(o);let n=E();return _(n.stopSlideshow())}),A(2,"fa-icon",4),m()}if(e&2){let o=E();y("tooltip",j(1,2,"Stop slideshow",o.locale.language)),f(2),y("icon",o.icons.faStop)}}var Po=(()=>{let t=class t{constructor(){this.file=ze(),this.directoryImages=Z(),this.currentHeight=Z(),this.currentHeightWithOffset=_e(()=>this.currentHeight()-40),this.isInfoboxOpen=ie(!1),this.isSlideshowActive=ie(!1),this.imageCount=_e(()=>this.directoryImages().length),this.imageIndex=_e(()=>this.directoryImages().indexOf(this.file())),this.imageResolution=ie(""),this.icons={faAngleLeft:hs,faAngleRight:fs,faExpand:cs,faInfo:bs,faPlay:ps,faStop:us},this.locale=C(Te),this.slideDelay=5e3,this.destroyRef=C(Wn),this.imageRef=Ht.required("image")}onImageLoad(){let i=this.imageRef().nativeElement;this.imageResolution.set(`${i.naturalWidth}x${i.naturalHeight}`)}nextImage(){this.file.set(this.directoryImages()[(this.imageIndex()+1)%this.imageCount()])}previousImage(){this.file.set(this.directoryImages()[(this.imageCount()+this.imageIndex()-1)%this.imageCount()])}fullscreen(){this.imageRef().nativeElement.requestFullscreen()}startSlideshow(){this.isSlideshowActive.set(!0),this.slideshowSub=He(this.slideDelay,this.slideDelay).pipe(is(this.destroyRef)).subscribe(()=>this.nextImage())}stopSlideshow(){this.slideshowSub?.unsubscribe(),this.isSlideshowActive.set(!1)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-image"]],viewQuery:function(n,s){n&1&&Ot(s.imageRef,ga,5),n&2&&Vt()},inputs:{file:[1,"file"],directoryImages:[1,"directoryImages"],currentHeight:[1,"currentHeight"]},outputs:{file:"fileChange"},decls:40,vars:47,consts:[["image",""],[1,"app-top-menu","d-flex","justify-content-between"],[1,"d-flex"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"click","tooltip","adaptivePosition"],[3,"icon"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"click","tooltip"],["container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"tooltip"],["btnCheckbox","","container","body","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel","tooltip"],[1,"app-viewer-image"],["alt","",3,"load","src"],[1,"info-box","p-2","m-2","d-flex","flex-column","app-small-card","rounded","opacity-75"],[1,"d-flex","mb-1"],[1,"d-flex","col-sm","fw-bold"]],template:function(n,s){if(n&1){let r=z();p(0,"div",1)(1,"div",2)(2,"button",3),V(3,"translate"),x("click",function(){return P(r),_(s.previousImage())}),A(4,"fa-icon",4),m(),p(5,"button",5),V(6,"translate"),x("click",function(){return P(r),_(s.nextImage())}),A(7,"fa-icon",4),m(),N(8,ba,3,5,"button",6)(9,ya,3,5,"button",6),p(10,"button",5),V(11,"translate"),x("click",function(){return P(r),_(s.fullscreen())}),A(12,"fa-icon",4),m()(),p(13,"div"),D(14),m(),p(15,"button",7),V(16,"translate"),Ge("ngModelChange",function(l){return P(r),je(s.isInfoboxOpen,l)||(s.isInfoboxOpen=l),_(l)}),A(17,"fa-icon",4),m()(),p(18,"div",8)(19,"img",9,0),x("load",function(){return P(r),_(s.onImageLoad())}),m(),p(21,"div",10)(22,"div",11)(23,"div",12),D(24),V(25,"translate"),m(),p(26,"div"),D(27),m()(),p(28,"div",11)(29,"div",12),D(30),V(31,"translate"),m(),p(32,"div"),D(33),m()(),p(34,"div",11)(35,"div",12),D(36),V(37,"translate"),m(),p(38,"div"),D(39),m()()()()}n&2&&(f(2),y("tooltip",j(3,26,"Previous",s.locale.language))("adaptivePosition",!0),f(2),y("icon",s.icons.faAngleLeft),f(),y("tooltip",j(6,29,"Next",s.locale.language)),f(2),y("icon",s.icons.faAngleRight),f(),H(s.isSlideshowActive()?9:8),f(2),y("tooltip",j(11,32,"Fullscreen",s.locale.language)),f(2),y("icon",s.icons.faExpand),f(2),Qn("",s.imageIndex()+1," of ",s.imageCount()),f(),We("ngModel",s.isInfoboxOpen),y("tooltip",j(16,35,"Info",s.locale.language)),f(2),y("icon",s.icons.faInfo),f(),ee("height",s.currentHeightWithOffset(),"px"),f(),ee("max-height",s.currentHeightWithOffset(),"px"),y("src",s.file().dataUrl,Pe),f(2),$e("d-none",!s.isInfoboxOpen()),f(3),X(j(25,38,"Type",s.locale.language)),f(3),X(s.file().mime),f(3),X(j(31,41,"Dimensions",s.locale.language)),f(3),X(s.imageResolution()),f(3),X(j(37,44,"Size",s.locale.language)),f(3),X(s.file().hSize))},dependencies:[jt,$t,Wt,zt,Gt,ye,Qt,Me],encapsulation:2,changeDetection:0});let e=t;return e})();var va=["*"],se=(()=>{let t=class t{};t.VG_ENDED="ended",t.VG_PAUSED="paused",t.VG_PLAYING="playing",t.VG_LOADING="waiting",t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),kt=(()=>{let t=class t{constructor(){this.medias={},this.playerReadyEvent=new he(!0),this.isPlayerReady=!1}onPlayerReady(i){this.fsAPI=i,this.isPlayerReady=!0,this.playerReadyEvent.emit(this)}getDefaultMedia(){for(let i in this.medias)if(this.medias[i])return this.medias[i]}getMasterMedia(){let i;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){i=this.medias[n];break}return i||this.getDefaultMedia()}isMasterDefined(){let i=!1;for(let n in this.medias)if(this.medias[n].vgMaster==="true"||this.medias[n].vgMaster===!0){i=!0;break}return i}getMediaById(i=null){let n=this.medias[i];return(!i||i==="*")&&(n=this),n}play(){for(let i in this.medias)this.medias[i]&&this.medias[i].play()}pause(){for(let i in this.medias)this.medias[i]&&this.medias[i].pause()}get duration(){return this.$$getAllProperties("duration")}set currentTime(i){this.$$setAllProperties("currentTime",i)}get currentTime(){return this.$$getAllProperties("currentTime")}set state(i){this.$$setAllProperties("state",i)}get state(){return this.$$getAllProperties("state")}set volume(i){this.$$setAllProperties("volume",i)}get volume(){return this.$$getAllProperties("volume")}set playbackRate(i){this.$$setAllProperties("playbackRate",i)}get playbackRate(){return this.$$getAllProperties("playbackRate")}get canPlay(){return this.$$getAllProperties("canPlay")}get canPlayThrough(){return this.$$getAllProperties("canPlayThrough")}get isMetadataLoaded(){return this.$$getAllProperties("isMetadataLoaded")}get isWaiting(){return this.$$getAllProperties("isWaiting")}get isCompleted(){return this.$$getAllProperties("isCompleted")}get isLive(){return this.$$getAllProperties("isLive")}get isMaster(){return this.$$getAllProperties("isMaster")}get time(){return this.$$getAllProperties("time")}get buffer(){return this.$$getAllProperties("buffer")}get buffered(){return this.$$getAllProperties("buffered")}get subscriptions(){return this.$$getAllProperties("subscriptions")}get textTracks(){return this.$$getAllProperties("textTracks")}seekTime(i,n=!1){for(let s in this.medias)this.medias[s]&&this.$$seek(this.medias[s],i,n)}$$seek(i,n,s=!1){let r,a=i.duration;s?(this.isMasterDefined()&&(a=this.getMasterMedia().duration),r=n*a/100):r=n,i.currentTime=r}addTextTrack(i,n,s){for(let r in this.medias)this.medias[r]&&this.$$addTextTrack(this.medias[r],i,n,s)}$$addTextTrack(i,n,s,r){i.addTextTrack(n,s,r)}$$getAllProperties(i){let n={},s;for(let a in this.medias)this.medias[a]&&(n[a]=this.medias[a]);switch(Object.keys(n).length){case 0:switch(i){case"state":s=se.VG_PAUSED;break;case"playbackRate":case"volume":s=1;break;case"time":s={current:0,total:0,left:0};break}break;case 1:let a=Object.keys(n)[0];s=n[a][i];break;default:let l=this.getMasterMedia();s=n[l.id][i]}return s}$$setAllProperties(i,n){for(let s in this.medias)this.medias[s]&&(this.medias[s][i]=n)}registerElement(i){this.videogularElement=i}registerMedia(i){this.medias[i.id]=i}unregisterMedia(i){delete this.medias[i.id]}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),nn=(()=>{let t=class t{constructor(){this.isHiddenSubject=new ft,this.isHidden=this.isHiddenSubject.asObservable()}state(i){this.isHiddenSubject.next(i)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),St=(()=>{let t=class t{static getZIndex(){let i=1,n,s=document.getElementsByTagName("*");for(let r=0,a=s.length;r<a;r++)n=parseInt(window.getComputedStyle(s[r])["z-index"],10),n>i&&(i=n+1);return i}static isMobileDevice(){return typeof window.orientation<"u"||navigator.userAgent.indexOf("IEMobile")!==-1}static isiOSDevice(){return(navigator.userAgent.match(/ip(hone|ad|od)/i)||t.isIpadOS())&&!navigator.userAgent.match(/(iemobile)[\/\s]?([\w\.]*)/i)}static isIpadOS(){return navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/MacIntel/.test(navigator.platform)}static isCordova(){return document.URL.indexOf("http://")===-1&&document.URL.indexOf("https://")===-1}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),sn=(()=>{let t=class t{constructor(){this.nativeFullscreen=!0,this.isFullscreen=!1,this.onChangeFullscreen=new he}init(i,n){this.videogularElement=i,this.medias=n;let s={w3:{enabled:"fullscreenEnabled",element:"fullscreenElement",request:"requestFullscreen",exit:"exitFullscreen",onchange:"fullscreenchange",onerror:"fullscreenerror"},newWebkit:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitRequestFullscreen",exit:"webkitExitFullscreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},oldWebkit:{enabled:"webkitIsFullScreen",element:"webkitCurrentFullScreenElement",request:"webkitRequestFullScreen",exit:"webkitCancelFullScreen",onchange:"webkitfullscreenchange",onerror:"webkitfullscreenerror"},moz:{enabled:"mozFullScreen",element:"mozFullScreenElement",request:"mozRequestFullScreen",exit:"mozCancelFullScreen",onchange:"mozfullscreenchange",onerror:"mozfullscreenerror"},ios:{enabled:"webkitFullscreenEnabled",element:"webkitFullscreenElement",request:"webkitEnterFullscreen",exit:"webkitExitFullscreen",onchange:"webkitendfullscreen",onerror:"webkitfullscreenerror"},ms:{enabled:"msFullscreenEnabled",element:"msFullscreenElement",request:"msRequestFullscreen",exit:"msExitFullscreen",onchange:"MSFullscreenChange",onerror:"MSFullscreenError"}};for(let a in s)if(s[a].enabled in document){this.polyfill=s[a];break}if(St.isiOSDevice()&&(this.polyfill=s.ios),this.isAvailable=this.polyfill!=null,this.polyfill==null)return;let r;switch(this.polyfill.onchange){case"mozfullscreenchange":r=document;break;case"webkitendfullscreen":r=this.medias.toArray()[0].elem;break;default:r=i}this.fsChangeSubscription=F(r,this.polyfill.onchange).subscribe(()=>{this.onFullscreenChange()})}onFullscreenChange(){this.isFullscreen=!!document[this.polyfill.element],this.onChangeFullscreen.emit(this.isFullscreen)}toggleFullscreen(i=null){return this.isFullscreen?this.exit():this.request(i)}request(i){return i||(i=this.videogularElement),this.isFullscreen=!0,this.onChangeFullscreen.emit(!0),this.isAvailable&&this.nativeFullscreen?St.isMobileDevice()?((!this.polyfill.enabled&&i===this.videogularElement||St.isiOSDevice())&&(i=this.medias.toArray()[0].elem),this.enterElementInFullScreen(i)):this.enterElementInFullScreen(this.videogularElement):Promise.resolve()}enterElementInFullScreen(i){return i[this.polyfill.request]()}exit(){return this.isFullscreen=!1,this.onChangeFullscreen.emit(!1),this.isAvailable&&this.nativeFullscreen?document[this.polyfill.exit]():Promise.resolve()}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})(),L=(()=>{let t=class t{};t.VG_ABORT="abort",t.VG_CAN_PLAY="canplay",t.VG_CAN_PLAY_THROUGH="canplaythrough",t.VG_DURATION_CHANGE="durationchange",t.VG_EMPTIED="emptied",t.VG_ENCRYPTED="encrypted",t.VG_ENDED="ended",t.VG_ERROR="error",t.VG_LOADED_DATA="loadeddata",t.VG_LOADED_METADATA="loadedmetadata",t.VG_LOAD_START="loadstart",t.VG_PAUSE="pause",t.VG_PLAY="play",t.VG_PLAYING="playing",t.VG_PROGRESS="progress",t.VG_RATE_CHANGE="ratechange",t.VG_SEEK="seek",t.VG_SEEKED="seeked",t.VG_SEEKING="seeking",t.VG_STALLED="stalled",t.VG_SUSPEND="suspend",t.VG_TIME_UPDATE="timeupdate",t.VG_VOLUME_CHANGE="volumechange",t.VG_WAITING="waiting",t.VG_LOAD="load",t.VG_ENTER="enter",t.VG_EXIT="exit",t.VG_START_ADS="startads",t.VG_END_ADS="endads",t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var on=(()=>{let t=class t{constructor(i,n){this.api=i,this.ref=n,this.state=se.VG_PAUSED,this.time={current:0,total:0,left:0},this.buffer={end:0},this.canPlay=!1,this.canPlayThrough=!1,this.isMetadataLoaded=!1,this.isWaiting=!1,this.isCompleted=!1,this.isLive=!1,this.isBufferDetected=!1,this.checkInterval=200,this.currentPlayPos=0,this.lastPlayPos=0,this.playAtferSync=!1,this.bufferDetected=new ft}ngOnInit(){this.vgMedia.nodeName?this.elem=this.vgMedia:this.elem=this.vgMedia.elem,this.api.registerMedia(this),this.subscriptions={abort:F(this.elem,L.VG_ABORT),canPlay:F(this.elem,L.VG_CAN_PLAY),canPlayThrough:F(this.elem,L.VG_CAN_PLAY_THROUGH),durationChange:F(this.elem,L.VG_DURATION_CHANGE),emptied:F(this.elem,L.VG_EMPTIED),encrypted:F(this.elem,L.VG_ENCRYPTED),ended:F(this.elem,L.VG_ENDED),error:F(this.elem,L.VG_ERROR),loadedData:F(this.elem,L.VG_LOADED_DATA),loadedMetadata:F(this.elem,L.VG_LOADED_METADATA),loadStart:F(this.elem,L.VG_LOAD_START),pause:F(this.elem,L.VG_PAUSE),play:F(this.elem,L.VG_PLAY),playing:F(this.elem,L.VG_PLAYING),progress:F(this.elem,L.VG_PROGRESS),rateChange:F(this.elem,L.VG_RATE_CHANGE),seeked:F(this.elem,L.VG_SEEKED),seeking:F(this.elem,L.VG_SEEKING),stalled:F(this.elem,L.VG_STALLED),suspend:F(this.elem,L.VG_SUSPEND),timeUpdate:F(this.elem,L.VG_TIME_UPDATE),volumeChange:F(this.elem,L.VG_VOLUME_CHANGE),waiting:F(this.elem,L.VG_WAITING),startAds:F(window,L.VG_START_ADS),endAds:F(window,L.VG_END_ADS),mutation:new Rn(i=>{let n=new MutationObserver(s=>{i.next(s)});return n.observe(this.elem,{childList:!0,attributes:!0}),()=>{n.disconnect()}}),bufferDetected:this.bufferDetected},this.mutationObs=this.subscriptions.mutation.subscribe(this.onMutation.bind(this)),this.canPlayObs=this.subscriptions.canPlay.subscribe(this.onCanPlay.bind(this)),this.canPlayThroughObs=this.subscriptions.canPlayThrough.subscribe(this.onCanPlayThrough.bind(this)),this.loadedMetadataObs=this.subscriptions.loadedMetadata.subscribe(this.onLoadMetadata.bind(this)),this.waitingObs=this.subscriptions.waiting.subscribe(this.onWait.bind(this)),this.progressObs=this.subscriptions.progress.subscribe(this.onProgress.bind(this)),this.endedObs=this.subscriptions.ended.subscribe(this.onComplete.bind(this)),this.playingObs=this.subscriptions.playing.subscribe(this.onStartPlaying.bind(this)),this.playObs=this.subscriptions.play.subscribe(this.onPlay.bind(this)),this.pauseObs=this.subscriptions.pause.subscribe(this.onPause.bind(this)),this.timeUpdateObs=this.subscriptions.timeUpdate.subscribe(this.onTimeUpdate.bind(this)),this.volumeChangeObs=this.subscriptions.volumeChange.subscribe(this.onVolumeChange.bind(this)),this.errorObs=this.subscriptions.error.subscribe(this.onError.bind(this)),this.vgMaster&&this.api.playerReadyEvent.subscribe(()=>{this.prepareSync()})}prepareSync(){let i=[];for(let n in this.api.medias)this.api.medias[n]&&i.push(this.api.medias[n].subscriptions.canPlay);this.canPlayAllSubscription=Nn(i).pipe(et((...n)=>{let s=a=>a?.target?a.target.readyState===4:!1;n.some(s)&&!this.syncSubscription&&(this.startSync(),this.syncSubscription.unsubscribe())})).subscribe()}startSync(){this.syncSubscription=He(0,1e3).subscribe(()=>{for(let i in this.api.medias)if(this.api.medias[i]!==this){let n=this.api.medias[i].currentTime-this.currentTime;n<-.3||n>.3?(this.playAtferSync=this.state===se.VG_PLAYING,this.pause(),this.api.medias[i].pause(),this.api.medias[i].currentTime=this.currentTime):this.playAtferSync&&(this.play(),this.api.medias[i].play(),this.playAtferSync=!1)}})}onMutation(i){for(let n=0,s=i.length;n<s;n++){let r=i[n];if(r.type==="attributes"&&r.attributeName==="src"){if(r.target.src&&r.target.src.length>0&&r.target.src.indexOf("blob:")<0){this.loadMedia();break}}else if(r.type==="childList"&&r.removedNodes.length&&r.removedNodes[0].nodeName.toLowerCase()==="source"){this.loadMedia();break}}}loadMedia(){this.vgMedia.pause(),this.vgMedia.currentTime=0,this.stopBufferCheck(),this.isBufferDetected=!0,this.bufferDetected.next(this.isBufferDetected),setTimeout(()=>this.vgMedia.load(),10)}play(){if(!(this.playPromise||this.state!==se.VG_PAUSED&&this.state!==se.VG_ENDED))return this.playPromise=this.vgMedia.play(),this.playPromise&&this.playPromise.then&&this.playPromise.catch&&this.playPromise.then(()=>{this.playPromise=null}).catch(()=>{this.playPromise=null}),this.playPromise}pause(){this.playPromise?this.playPromise.then(()=>{this.vgMedia.pause()}):this.vgMedia.pause()}get id(){let i;return this.vgMedia&&(i=this.vgMedia.id),i}get duration(){return this.vgMedia.duration===1/0?this.specifiedDuration:this.vgMedia.duration}set currentTime(i){this.vgMedia.currentTime=i}get currentTime(){return this.vgMedia.currentTime}set volume(i){this.vgMedia.volume=i}get volume(){return this.vgMedia.volume}set playbackRate(i){this.vgMedia.playbackRate=i}get playbackRate(){return this.vgMedia.playbackRate}get buffered(){return this.vgMedia.buffered}get textTracks(){return this.vgMedia.textTracks}onCanPlay(i){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlay=!0,this.ref.detectChanges()}onCanPlayThrough(i){this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected),this.canPlayThrough=!0,this.ref.detectChanges()}onLoadMetadata(i){this.isMetadataLoaded=!0,this.time={current:0,left:0,total:this.duration*1e3},this.state=se.VG_PAUSED;let n=Math.round(this.time.total);this.isLive=n===1/0,this.ref.detectChanges()}onWait(i){this.isWaiting=!0,this.ref.detectChanges()}onComplete(i){this.isCompleted=!0,this.state=se.VG_ENDED,this.ref.detectChanges()}onStartPlaying(i){this.state=se.VG_PLAYING,this.ref.detectChanges()}onPlay(i){this.state=se.VG_PLAYING,this.vgMaster&&(!this.syncSubscription||this.syncSubscription.closed)&&this.startSync(),this.startBufferCheck(),this.ref.detectChanges()}onPause(i){this.state=se.VG_PAUSED,this.vgMaster&&(this.playAtferSync||this.syncSubscription.unsubscribe()),this.stopBufferCheck(),this.ref.detectChanges()}onTimeUpdate(i){let n=this.buffered.length-1;this.time={current:this.currentTime*1e3,total:this.time.total,left:(this.duration-this.currentTime)*1e3},n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onProgress(i){let n=this.buffered.length-1;n>=0&&(this.buffer={end:this.buffered.end(n)*1e3}),this.ref.detectChanges()}onVolumeChange(i){this.ref.detectChanges()}onError(i){this.ref.detectChanges()}bufferCheck(){let i=1/this.checkInterval;this.currentPlayPos=this.currentTime,!this.isBufferDetected&&this.currentPlayPos<this.lastPlayPos+i&&(this.isBufferDetected=!0),this.isBufferDetected&&this.currentPlayPos>this.lastPlayPos+i&&(this.isBufferDetected=!1),this.bufferDetected.closed||this.bufferDetected.next(this.isBufferDetected),this.lastPlayPos=this.currentPlayPos}startBufferCheck(){this.checkBufferSubscription=He(0,this.checkInterval).subscribe(()=>{this.bufferCheck()})}stopBufferCheck(){this.checkBufferSubscription&&this.checkBufferSubscription.unsubscribe(),this.isBufferDetected=!1,this.bufferDetected.next(this.isBufferDetected)}seekTime(i,n=!1){let s,r=this.duration;n?s=i*r/100:s=i,this.currentTime=s}addTextTrack(i,n,s,r){let a=this.vgMedia.addTextTrack(i,n,s);return r&&(a.mode=r),a}ngOnDestroy(){this.vgMedia.src="",this.mutationObs?.unsubscribe(),this.canPlayObs?.unsubscribe(),this.canPlayThroughObs?.unsubscribe(),this.loadedMetadataObs?.unsubscribe(),this.waitingObs?.unsubscribe(),this.progressObs?.unsubscribe(),this.endedObs?.unsubscribe(),this.playingObs?.unsubscribe(),this.playObs?.unsubscribe(),this.pauseObs?.unsubscribe(),this.timeUpdateObs?.unsubscribe(),this.volumeChangeObs?.unsubscribe(),this.errorObs?.unsubscribe(),this.checkBufferSubscription?.unsubscribe(),this.syncSubscription?.unsubscribe(),this.bufferDetected?.complete(),this.bufferDetected?.unsubscribe(),this.api.unregisterMedia(this)}};t.\u0275fac=function(n){return new(n||t)(be(kt),be(Gi))},t.\u0275dir=zn({type:t,selectors:[["","vgMedia",""]],inputs:{vgMedia:"vgMedia",vgMaster:"vgMaster"},standalone:!1});let e=t;return e})(),_o=(()=>{let t=class t{constructor(i,n,s,r){this.api=n,this.fsAPI=s,this.controlsHidden=r,this.isFullscreen=!1,this.isNativeFullscreen=!1,this.areControlsHidden=!1,this.onPlayerReady=new he,this.onMediaReady=new he,this.subscriptions=[],this.elem=i.nativeElement,this.api.registerElement(this.elem)}ngAfterContentInit(){this.medias.toArray().forEach(i=>{this.api.registerMedia(i)}),this.fsAPI.init(this.elem,this.medias),this.subscriptions.push(this.fsAPI.onChangeFullscreen.subscribe(this.onChangeFullscreen.bind(this))),this.subscriptions.push(this.controlsHidden.isHidden.subscribe(this.onHideControls.bind(this))),this.api.onPlayerReady(this.fsAPI),this.onPlayerReady.emit(this.api)}onChangeFullscreen(i){this.fsAPI.nativeFullscreen?this.isNativeFullscreen=i:(this.isFullscreen=i,this.zIndex=i?St.getZIndex().toString():"auto")}onHideControls(i){this.areControlsHidden=i}ngOnDestroy(){this.subscriptions.forEach(i=>i.unsubscribe())}};t.\u0275fac=function(n){return new(n||t)(be(Ue),be(kt),be(sn),be(nn))},t.\u0275cmp=R({type:t,selectors:[["vg-player"]],contentQueries:function(n,s,r){if(n&1&&Kn(r,on,5),n&2){let a;Ui(a=$i())&&(s.medias=a)}},hostVars:8,hostBindings:function(n,s){n&2&&(ee("z-index",s.zIndex),$e("fullscreen",s.isFullscreen)("native-fullscreen",s.isNativeFullscreen)("controls-hidden",s.areControlsHidden))},outputs:{onPlayerReady:"onPlayerReady",onMediaReady:"onMediaReady"},standalone:!1,features:[Bt([kt,sn,nn])],ngContentSelectors:va,decls:1,vars:0,template:function(n,s){n&1&&(Ni(),Hi(0))},styles:[`vg-player{font-family:videogular;position:relative;display:flex;width:100%;height:100%;overflow:hidden;background-color:#000}vg-player.fullscreen{position:fixed;left:0;top:0}vg-player.native-fullscreen.controls-hidden{cursor:none}
2
- `],encapsulation:2});let e=t;return e})(),Ca=[kt,nn,sn,St,L,se];var Re=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=xe({type:t}),t.\u0275inj=Se({providers:[...Ca],imports:[Ae]});let e=t;return e})();var Ao=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=xe({type:t}),t.\u0275inj=Se({imports:[Ae,Re]});let e=t;return e})();var To=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=xe({type:t}),t.\u0275inj=Se({imports:[Ae,Re]});let e=t;return e})();var Mo=(()=>{let t=class t{};t.\u0275fac=function(n){return new(n||t)},t.\u0275mod=xe({type:t}),t.\u0275inj=Se({imports:[Ae,Re]});let e=t;return e})();var Io=(()=>{let t=class t{constructor(){this.fileUrl=Z(),this.currentHeight=Z()}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-media"]],inputs:{fileUrl:[1,"fileUrl"],currentHeight:[1,"currentHeight"]},decls:4,vars:4,consts:[["media",""],["preload","none","controls","",3,"vgMedia"],["type","video/webm",3,"src"]],template:function(n,s){if(n&1&&(p(0,"vg-player")(1,"video",1,0),A(3,"source",2),m()()),n&2){let r=Yn(2);ee("height",s.currentHeight(),"px"),f(),y("vgMedia",r),f(2),y("src",s.fileUrl(),Pe)}},dependencies:[Re,on,_o,To,Mo,Ao],encapsulation:2,changeDetection:0});let e=t;return e})();var Fo=(()=>{let t=class t{constructor(){this.fileUrl=Z(),this.currentHeight=Z(),this.sanitizer=C(Ut),this.pdfjsUrl=`${Rs}/pdfjs/web/viewer.html?file=`,this.url=_e(()=>this.fileUrl()?this.sanitizer.bypassSecurityTrustResourceUrl(`${this.pdfjsUrl}${encodeURIComponent(this.fileUrl())}`):null)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-pdf"]],inputs:{fileUrl:[1,"fileUrl"],currentHeight:[1,"currentHeight"]},decls:1,vars:3,consts:[[1,"app-viewer-iframe",3,"src"]],template:function(n,s){n&1&&Lt(0,"iframe",0),n&2&&(ee("height",s.currentHeight(),"px"),Rt("src",s.url(),Gn))},encapsulation:2,changeDetection:0});let e=t;return e})();var ka=e=>{let{state:t}=e,o=t.doc.lineAt(t.selection.main.from),i=dn(e.state,o.from);return i.line?xa(e):i.block?Ea(e):!1};function hn(e,t){return({state:o,dispatch:i})=>{if(o.readOnly)return!1;let n=e(t,o);return n?(i(o.update(n)),!0):!1}}var xa=hn(_a,0);var wa=hn($o,0);var Ea=hn((e,t)=>$o(e,t,Pa(t)),0);function dn(e,t){let o=e.languageDataAt("commentTokens",t,1);return o.length?o[0]:{}}var xt=50;function Da(e,{open:t,close:o},i,n){let s=e.sliceDoc(i-xt,i),r=e.sliceDoc(n,n+xt),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(r)[0].length,h=s.length-a;if(s.slice(h-t.length,h)==t&&r.slice(l,l+o.length)==o)return{open:{pos:i-a,margin:a&&1},close:{pos:n+l,margin:l&&1}};let d,g;n-i<=2*xt?d=g=e.sliceDoc(i,n):(d=e.sliceDoc(i,i+xt),g=e.sliceDoc(n-xt,n));let b=/^\s*/.exec(d)[0].length,S=/\s*$/.exec(g)[0].length,T=g.length-S-o.length;return d.slice(b,b+t.length)==t&&g.slice(T,T+o.length)==o?{open:{pos:i+b+t.length,margin:/\s/.test(d.charAt(b+t.length))?1:0},close:{pos:n-S-o.length,margin:/\s/.test(g.charAt(T-1))?1:0}}:null}function Pa(e){let t=[];for(let o of e.selection.ranges){let i=e.doc.lineAt(o.from),n=o.to<=i.to?i:e.doc.lineAt(o.to);n.from>i.from&&n.from==o.to&&(n=o.to==i.to+1?i:e.doc.lineAt(o.to-1));let s=t.length-1;s>=0&&t[s].to>i.from?t[s].to=n.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return t}function $o(e,t,o=t.selection.ranges){let i=o.map(s=>dn(t,s.from).block);if(!i.every(s=>s))return null;let n=o.map((s,r)=>Da(t,i[r],s.from,s.to));if(e!=2&&!n.every(s=>s))return{changes:t.changes(o.map((s,r)=>n[r]?[]:[{from:s.from,insert:i[r].open+" "},{from:s.to,insert:" "+i[r].close}]))};if(e!=1&&n.some(s=>s)){let s=[];for(let r=0,a;r<n.length;r++)if(a=n[r]){let l=i[r],{open:h,close:d}=a;s.push({from:h.pos-l.open.length,to:h.pos+h.margin},{from:d.pos-d.margin,to:d.pos+l.close.length})}return{changes:s}}return null}function _a(e,t,o=t.selection.ranges){let i=[],n=-1;for(let{from:s,to:r}of o){let a=i.length,l=1e9,h=dn(t,s).line;if(h){for(let d=s;d<=r;){let g=t.doc.lineAt(d);if(g.from>n&&(s==r||r>g.from)){n=g.from;let b=/^\s*/.exec(g.text)[0].length,S=b==g.length,T=g.text.slice(b,b+h.length)==h?b:-1;b<g.text.length&&b<l&&(l=b),i.push({line:g,comment:T,token:h,indent:b,empty:S,single:!1})}d=g.to+1}if(l<1e9)for(let d=a;d<i.length;d++)i[d].indent<i[d].line.text.length&&(i[d].indent=l);i.length==a+1&&(i[a].single=!0)}}if(e!=2&&i.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:h,empty:d,single:g}of i)(g||!d)&&s.push({from:a.from+h,insert:l+" "});let r=t.changes(s);return{changes:r,selection:t.selection.map(r,1)}}else if(e!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:r,comment:a,token:l}of i)if(a>=0){let h=r.from+a,d=h+l.length;r.text[d-r.from]==" "&&d++,s.push({from:h,to:d})}return{changes:s}}return null}var ln=pt.define(),Aa=pt.define(),Ta=Le.define(),Wo=Le.define({combine(e){return Qe(e,{minDepth:100,newGroupDelay:500,joinToEvent:(t,o)=>o},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,o)=>(i,n)=>t(i,n)||o(i,n)})}}),fn=Ke.define({create(){return an.empty},update(e,t){let o=t.state.facet(Wo),i=t.annotation(ln);if(i){let l=fe.fromTransaction(t,i.selection),h=i.side,d=h==0?e.undone:e.done;return l?d=li(d,d.length,o.minDepth,l):d=Ko(d,t.startState.selection),new an(h==0?i.rest:d,h==0?d:i.rest)}let n=t.annotation(Aa);if((n=="full"||n=="before")&&(e=e.isolate()),t.annotation(ot.addToHistory)===!1)return t.changes.empty?e:e.addMapping(t.changes.desc);let s=fe.fromTransaction(t),r=t.annotation(ot.time),a=t.annotation(ot.userEvent);return s?e=e.addChanges(s,r,a,o,t):t.selection&&(e=e.addSelection(t.startState.selection,r,a,o.newGroupDelay)),(n=="full"||n=="after")&&(e=e.isolate()),e},toJSON(e){return{done:e.done.map(t=>t.toJSON()),undone:e.undone.map(t=>t.toJSON())}},fromJSON(e){return new an(e.done.map(fe.fromJSON),e.undone.map(fe.fromJSON))}});function mn(e={}){return[fn,Wo.of(e),I.domEventHandlers({beforeinput(t,o){let i=t.inputType=="historyUndo"?ui:t.inputType=="historyRedo"?wt:null;return i?(t.preventDefault(),i(o)):!1}})]}function ci(e,t){return function({state:o,dispatch:i}){if(!t&&o.readOnly)return!1;let n=o.field(fn,!1);if(!n)return!1;let s=n.pop(e,o,t);return s?(i(s),!0):!1}}var ui=ci(0,!1),wt=ci(1,!1),Ma=ci(0,!0),Ia=ci(1,!0);function jo(e){return function(t){let o=t.field(fn,!1);if(!o)return 0;let i=e==0?o.done:o.undone;return i.length-(i.length&&!i[0].changes?1:0)}}var Go=jo(0),zo=jo(1),fe=class e{constructor(t,o,i,n,s){this.changes=t,this.effects=o,this.mapped=i,this.startSelection=n,this.selectionsAfter=s}setSelAfter(t){return new e(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,o,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(o=this.mapped)===null||o===void 0?void 0:o.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(t){return new e(t.changes&&Hs.fromJSON(t.changes),[],t.mapped&&Ns.fromJSON(t.mapped),t.startSelection&&k.fromJSON(t.startSelection),t.selectionsAfter.map(k.fromJSON))}static fromTransaction(t,o){let i=ce;for(let n of t.startState.facet(Ta)){let s=n(t);s.length&&(i=i.concat(s))}return!i.length&&t.changes.empty?null:new e(t.changes.invert(t.startState.doc),i,void 0,o||t.startState.selection,ce)}static selection(t){return new e(void 0,ce,void 0,void 0,t)}};function li(e,t,o,i){let n=t+1>o+20?t-o-1:0,s=e.slice(n,t);return s.push(i),s}function Fa(e,t){let o=[],i=!1;return e.iterChangedRanges((n,s)=>o.push(n,s)),t.iterChangedRanges((n,s,r,a)=>{for(let l=0;l<o.length;){let h=o[l++],d=o[l++];a>=h&&r<=d&&(i=!0)}}),i}function La(e,t){return e.ranges.length==t.ranges.length&&e.ranges.filter((o,i)=>o.empty!=t.ranges[i].empty).length===0}function qo(e,t){return e.length?t.length?e.concat(t):e:t}var ce=[],Ra=200;function Ko(e,t){if(e.length){let o=e[e.length-1],i=o.selectionsAfter.slice(Math.max(0,o.selectionsAfter.length-Ra));return i.length&&i[i.length-1].eq(t)?e:(i.push(t),li(e,e.length-1,1e9,o.setSelAfter(i)))}else return[fe.selection([t])]}function Oa(e){let t=e[e.length-1],o=e.slice();return o[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),o}function rn(e,t){if(!e.length)return e;let o=e.length,i=ce;for(;o;){let n=Va(e[o-1],t,i);if(n.changes&&!n.changes.empty||n.effects.length){let s=e.slice(0,o);return s[o-1]=n,s}else t=n.mapped,o--,i=n.selectionsAfter}return i.length?[fe.selection(i)]:ce}function Va(e,t,o){let i=qo(e.selectionsAfter.length?e.selectionsAfter.map(a=>a.map(t)):ce,o);if(!e.changes)return fe.selection(i);let n=e.changes.map(t),s=t.mapDesc(e.changes,!0),r=e.mapped?e.mapped.composeDesc(s):s;return new fe(n,Y.mapEffects(e.effects,t),r,e.startSelection.map(s),i)}var Ba=/^(input\.type|delete)($|\.)/,an=(()=>{class e{constructor(o,i,n=0,s=void 0){this.done=o,this.undone=i,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new e(this.done,this.undone):this}addChanges(o,i,n,s,r){let a=this.done,l=a[a.length-1];return l&&l.changes&&!l.changes.empty&&o.changes&&(!n||Ba.test(n))&&(!l.selectionsAfter.length&&i-this.prevTime<s.newGroupDelay&&s.joinToEvent(r,Fa(l.changes,o.changes))||n=="input.type.compose")?a=li(a,a.length-1,s.minDepth,new fe(o.changes.compose(l.changes),qo(Y.mapEffects(o.effects,l.changes),l.effects),l.mapped,l.startSelection,ce)):a=li(a,a.length,s.minDepth,o),new e(a,ce,i,n)}addSelection(o,i,n,s){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:ce;return r.length>0&&i-this.prevTime<s&&n==this.prevUserEvent&&n&&/^select($|\.)/.test(n)&&La(r[r.length-1],o)?this:new e(Ko(this.done,o),this.undone,i,n)}addMapping(o){return new e(rn(this.done,o),rn(this.undone,o),this.prevTime,this.prevUserEvent)}pop(o,i,n){let s=o==0?this.done:this.undone;if(s.length==0)return null;let r=s[s.length-1],a=r.selectionsAfter[0]||i.selection;if(n&&r.selectionsAfter.length)return i.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:ln.of({side:o,rest:Oa(s),selection:a}),userEvent:o==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=s.length==1?ce:s.slice(0,s.length-1);return r.mapped&&(l=rn(l,r.mapped)),i.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:ln.of({side:o,rest:l,selection:a}),filter:!1,userEvent:o==0?"undo":"redo",scrollIntoView:!0})}else return null}}return e.empty=new e(ce,ce),e})(),pn=[{key:"Mod-z",run:ui,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:wt,preventDefault:!0},{linux:"Ctrl-Shift-z",run:wt,preventDefault:!0},{key:"Mod-u",run:Ma,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Ia,preventDefault:!0}];function lt(e,t){return k.create(e.ranges.map(t),e.mainIndex)}function me(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function pe({state:e,dispatch:t},o){let i=lt(e.selection,o);return i.eq(e.selection,!0)?!1:(t(me(e,i)),!0)}function hi(e,t){return k.cursor(t?e.to:e.from)}function Yo(e,t){return pe(e,o=>o.empty?e.moveByChar(o,t):hi(o,t))}function Q(e){return e.textDirectionAt(e.state.selection.main.head)==Ws.LTR}var Qo=e=>Yo(e,!Q(e)),Jo=e=>Yo(e,Q(e));function Xo(e,t){return pe(e,o=>o.empty?e.moveByGroup(o,t):hi(o,t))}var Na=e=>Xo(e,!Q(e)),Ha=e=>Xo(e,Q(e));var Uh=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function Ua(e,t,o){if(t.type.prop(o))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function di(e,t,o){let i=ni(e).resolveInner(t.head),n=o?ii.closedBy:ii.openedBy;for(let l=t.head;;){let h=o?i.childAfter(l):i.childBefore(l);if(!h)break;Ua(e,h,n)?i=h:l=o?h.to:h.from}let s=i.type.prop(n),r,a;return s&&(r=o?Xe(e,i.from,1):Xe(e,i.to,-1))&&r.matched?a=o?r.end.to:r.end.from:a=o?i.to:i.from,k.cursor(a,o?-1:1)}var $a=e=>pe(e,t=>di(e.state,t,!Q(e))),Wa=e=>pe(e,t=>di(e.state,t,Q(e)));function Zo(e,t){return pe(e,o=>{if(!o.empty)return hi(o,t);let i=e.moveVertically(o,t);return i.head!=o.head?i:e.moveToLineBoundary(o,t)})}var er=e=>Zo(e,!1),tr=e=>Zo(e,!0);function ir(e){let t=e.scrollDOM.clientHeight<e.scrollDOM.scrollHeight-2,o=0,i=0,n;if(t){for(let s of e.state.facet(I.scrollMargins)){let r=s(e);r?.top&&(o=Math.max(r?.top,o)),r?.bottom&&(i=Math.max(r?.bottom,i))}n=e.scrollDOM.clientHeight-o-i}else n=(e.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:o,marginBottom:i,selfScroll:t,height:Math.max(e.defaultLineHeight,n-5)}}function nr(e,t){let o=ir(e),{state:i}=e,n=lt(i.selection,r=>r.empty?e.moveVertically(r,t,o.height):hi(r,t));if(n.eq(i.selection))return!1;let s;if(o.selfScroll){let r=e.coordsAtPos(i.selection.main.head),a=e.scrollDOM.getBoundingClientRect(),l=a.top+o.marginTop,h=a.bottom-o.marginBottom;r&&r.top>l&&r.bottom<h&&(s=I.scrollIntoView(n.main.head,{y:"start",yMargin:r.top-l}))}return e.dispatch(me(i,n),{effects:s}),!0}var Lo=e=>nr(e,!1),cn=e=>nr(e,!0);function Oe(e,t,o){let i=e.lineBlockAt(t.head),n=e.moveToLineBoundary(t,o);if(n.head==t.head&&n.head!=(o?i.to:i.from)&&(n=e.moveToLineBoundary(t,o,!1)),!o&&n.head==i.from&&i.length){let s=/^\s*/.exec(e.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&t.head!=i.from+s&&(n=k.cursor(i.from+s))}return n}var ja=e=>pe(e,t=>Oe(e,t,!0)),Ga=e=>pe(e,t=>Oe(e,t,!1)),za=e=>pe(e,t=>Oe(e,t,!Q(e))),qa=e=>pe(e,t=>Oe(e,t,Q(e))),Ka=e=>pe(e,t=>k.cursor(e.lineBlockAt(t.head).from,1)),Ya=e=>pe(e,t=>k.cursor(e.lineBlockAt(t.head).to,-1));function Qa(e,t,o){let i=!1,n=lt(e.selection,s=>{let r=Xe(e,s.head,-1)||Xe(e,s.head,1)||s.head>0&&Xe(e,s.head-1,1)||s.head<e.doc.length&&Xe(e,s.head+1,-1);if(!r||!r.end)return s;i=!0;let a=r.start.from==s.head?r.end.to:r.end.from;return o?k.range(s.anchor,a):k.cursor(a)});return i?(t(me(e,n)),!0):!1}var Ja=({state:e,dispatch:t})=>Qa(e,t,!1);function ue(e,t){let o=lt(e.state.selection,i=>{let n=t(i);return k.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return o.eq(e.state.selection)?!1:(e.dispatch(me(e.state,o)),!0)}function sr(e,t){return ue(e,o=>e.moveByChar(o,t))}var or=e=>sr(e,!Q(e)),rr=e=>sr(e,Q(e));function ar(e,t){return ue(e,o=>e.moveByGroup(o,t))}var Xa=e=>ar(e,!Q(e)),Za=e=>ar(e,Q(e));var el=e=>ue(e,t=>di(e.state,t,!Q(e))),tl=e=>ue(e,t=>di(e.state,t,Q(e)));function lr(e,t){return ue(e,o=>e.moveVertically(o,t))}var cr=e=>lr(e,!1),ur=e=>lr(e,!0);function hr(e,t){return ue(e,o=>e.moveVertically(o,t,ir(e).height))}var Ro=e=>hr(e,!1),Oo=e=>hr(e,!0),il=e=>ue(e,t=>Oe(e,t,!0)),nl=e=>ue(e,t=>Oe(e,t,!1)),sl=e=>ue(e,t=>Oe(e,t,!Q(e))),ol=e=>ue(e,t=>Oe(e,t,Q(e))),rl=e=>ue(e,t=>k.cursor(e.lineBlockAt(t.head).from)),al=e=>ue(e,t=>k.cursor(e.lineBlockAt(t.head).to)),Vo=({state:e,dispatch:t})=>(t(me(e,{anchor:0})),!0),Bo=({state:e,dispatch:t})=>(t(me(e,{anchor:e.doc.length})),!0),No=({state:e,dispatch:t})=>(t(me(e,{anchor:e.selection.main.anchor,head:0})),!0),Ho=({state:e,dispatch:t})=>(t(me(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0),ll=({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0),cl=({state:e,dispatch:t})=>{let o=fi(e).map(({from:i,to:n})=>k.range(i,Math.min(n+1,e.doc.length)));return t(e.update({selection:k.create(o),userEvent:"select"})),!0},ul=({state:e,dispatch:t})=>{let o=lt(e.selection,i=>{let n=ni(e),s=n.resolveStack(i.from,1);if(i.empty){let r=n.resolveStack(i.from,-1);r.node.from>=s.node.from&&r.node.to<=s.node.to&&(s=r)}for(let r=s;r;r=r.next){let{node:a}=r;if((a.from<i.from&&a.to>=i.to||a.to>i.to&&a.from<=i.from)&&r.next)return k.range(a.to,a.from)}return i});return o.eq(e.selection)?!1:(t(me(e,o)),!0)};function dr(e,t){let{state:o}=e,i=o.selection,n=o.selection.ranges.slice();for(let s of o.selection.ranges){let r=o.doc.lineAt(s.head);if(t?r.to<e.state.doc.length:r.from>0)for(let a=s;;){let l=e.moveVertically(a,t);if(l.head<r.from||l.head>r.to){n.some(h=>h.head==l.head)||n.push(l);break}else{if(l.head==a.head)break;a=l}}}return n.length==i.ranges.length?!1:(e.dispatch(me(o,k.create(n,n.length-1))),!0)}var hl=e=>dr(e,!1),dl=e=>dr(e,!0),fl=({state:e,dispatch:t})=>{let o=e.selection,i=null;return o.ranges.length>1?i=k.create([o.main]):o.main.empty||(i=k.create([k.cursor(o.main.head)])),i?(t(me(e,i)),!0):!1};function Et(e,t){if(e.state.readOnly)return!1;let o="delete.selection",{state:i}=e,n=i.changeByRange(s=>{let{from:r,to:a}=s;if(r==a){let l=t(s);l<r?(o="delete.backward",l=ai(e,l,!1)):l>r&&(o="delete.forward",l=ai(e,l,!0)),r=Math.min(r,l),a=Math.max(a,l)}else r=ai(e,r,!1),a=ai(e,a,!0);return r==a?{range:s}:{changes:{from:r,to:a},range:k.cursor(r,r<s.head?-1:1)}});return n.changes.empty?!1:(e.dispatch(i.update(n,{scrollIntoView:!0,userEvent:o,effects:o=="delete.selection"?I.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function ai(e,t,o){if(e instanceof I)for(let i of e.state.facet(I.atomicRanges).map(n=>n(e)))i.between(t,t,(n,s)=>{n<t&&s>t&&(t=o?s:n)});return t}var fr=(e,t,o)=>Et(e,i=>{let n=i.from,{state:s}=e,r=s.doc.lineAt(n),a,l;if(o&&!t&&n>r.from&&n<r.from+200&&!/[^ \t]/.test(a=r.text.slice(0,n-r.from))){if(a[a.length-1]==" ")return n-1;let h=ei(a,s.tabSize),d=h%oi(s)||oi(s);for(let g=0;g<d&&a[a.length-1-g]==" ";g++)n--;l=n}else l=Ee(r.text,n-r.from,t,t)+r.from,l==n&&r.number!=(t?s.doc.lines:1)?l+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(r.text.slice(l-r.from,n-r.from))&&(l=Ee(r.text,l-r.from,!1,!1)+r.from);return l}),un=e=>fr(e,!1,!0);var mr=e=>fr(e,!0,!1),pr=(e,t)=>Et(e,o=>{let i=o.head,{state:n}=e,s=n.doc.lineAt(i),r=n.charCategorizer(i);for(let a=null;;){if(i==(t?s.to:s.from)){i==o.head&&s.number!=(t?n.doc.lines:1)&&(i+=t?1:-1);break}let l=Ee(s.text,i-s.from,t)+s.from,h=s.text.slice(Math.min(i,l)-s.from,Math.max(i,l)-s.from),d=r(h);if(a!=null&&d!=a)break;(h!=" "||i!=o.head)&&(a=d),i=l}return i}),gr=e=>pr(e,!1),ml=e=>pr(e,!0);var pl=e=>Et(e,t=>{let o=e.lineBlockAt(t.head).to;return t.head<o?o:Math.min(e.state.doc.length,t.head+1)});var gl=e=>Et(e,t=>{let o=e.moveToLineBoundary(t,!1).head;return t.head>o?o:Math.max(0,t.head-1)}),bl=e=>Et(e,t=>{let o=e.moveToLineBoundary(t,!0).head;return t.head<o?o:Math.min(e.state.doc.length,t.head+1)});var yl=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let o=e.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:qi.of(["",""])},range:k.cursor(i.from)}));return t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0},vl=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let o=e.changeByRange(i=>{if(!i.empty||i.from==0||i.from==e.doc.length)return{range:i};let n=i.from,s=e.doc.lineAt(n),r=n==s.from?n-1:Ee(s.text,n-s.from,!1)+s.from,a=n==s.to?n+1:Ee(s.text,n-s.from,!0)+s.from;return{changes:{from:r,to:a,insert:e.doc.slice(n,a).append(e.doc.slice(r,n))},range:k.cursor(a)}});return o.changes.empty?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function fi(e){let t=[],o=-1;for(let i of e.selection.ranges){let n=e.doc.lineAt(i.from),s=e.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=e.doc.lineAt(i.to-1)),o>=n.number){let r=t[t.length-1];r.to=s.to,r.ranges.push(i)}else t.push({from:n.from,to:s.to,ranges:[i]});o=s.number+1}return t}function br(e,t,o){if(e.readOnly)return!1;let i=[],n=[];for(let s of fi(e)){if(o?s.to==e.doc.length:s.from==0)continue;let r=e.doc.lineAt(o?s.to+1:s.from-1),a=r.length+1;if(o){i.push({from:s.to,to:r.to},{from:s.from,insert:r.text+e.lineBreak});for(let l of s.ranges)n.push(k.range(Math.min(e.doc.length,l.anchor+a),Math.min(e.doc.length,l.head+a)))}else{i.push({from:r.from,to:s.from},{from:s.to,insert:e.lineBreak+r.text});for(let l of s.ranges)n.push(k.range(l.anchor-a,l.head-a))}}return i.length?(t(e.update({changes:i,scrollIntoView:!0,selection:k.create(n,e.selection.mainIndex),userEvent:"move.line"})),!0):!1}var Cl=({state:e,dispatch:t})=>br(e,t,!1),Sl=({state:e,dispatch:t})=>br(e,t,!0);function yr(e,t,o){if(e.readOnly)return!1;let i=[];for(let n of fi(e))o?i.push({from:n.from,insert:e.doc.slice(n.from,n.to)+e.lineBreak}):i.push({from:n.to,insert:e.lineBreak+e.doc.slice(n.from,n.to)});return t(e.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var kl=({state:e,dispatch:t})=>yr(e,t,!1),xl=({state:e,dispatch:t})=>yr(e,t,!0),wl=e=>{if(e.state.readOnly)return!1;let{state:t}=e,o=t.changes(fi(t).map(({from:n,to:s})=>(n>0?n--:s<t.doc.length&&s++,{from:n,to:s}))),i=lt(t.selection,n=>{let s;if(e.lineWrapping){let r=e.lineBlockAt(n.head),a=e.coordsAtPos(n.head,n.assoc||1);a&&(s=r.bottom+e.documentTop-a.bottom+e.defaultLineHeight/2)}return e.moveVertically(n,!0,s)}).map(o);return e.dispatch({changes:o,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function El(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let o=ni(e).resolveInner(t),i=o.childBefore(t),n=o.childAfter(t),s;return i&&n&&i.to<=t&&n.from>=t&&(s=i.type.prop(ii.closedBy))&&s.indexOf(n.name)>-1&&e.doc.lineAt(i.to).from==e.doc.lineAt(n.from).from&&!/\S/.test(e.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}var Uo=vr(!1),Dl=vr(!0);function vr(e){return({state:t,dispatch:o})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:s,to:r}=n,a=t.doc.lineAt(s),l=!e&&s==r&&El(t,s);e&&(s=r=(r<=a.to?a:t.doc.lineAt(r)).to);let h=new Ji(t,{simulateBreak:s,simulateDoubleBreak:!!l}),d=Qi(h,s);for(d==null&&(d=ei(/^\s*/.exec(t.doc.lineAt(s).text)[0],t.tabSize));r<a.to&&/\s/.test(a.text[r-a.from]);)r++;l?{from:s,to:r}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let g=["",yt(t,d)];return l&&g.push(yt(t,h.lineIndent(a.from,-1))),{changes:{from:s,to:r,insert:qi.of(g)},range:k.cursor(s+1+g[1].length)}});return o(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function gn(e,t){let o=-1;return e.changeByRange(i=>{let n=[];for(let r=i.from;r<=i.to;){let a=e.doc.lineAt(r);a.number>o&&(i.empty||i.to>a.from)&&(t(a,n,i),o=a.number),r=a.to+1}let s=e.changes(n);return{changes:n,range:k.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}var Pl=({state:e,dispatch:t})=>{if(e.readOnly)return!1;let o=Object.create(null),i=new Ji(e,{overrideIndentation:s=>{let r=o[s];return r??-1}}),n=gn(e,(s,r,a)=>{let l=Qi(i,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let h=/^\s*/.exec(s.text)[0],d=yt(e,l);(h!=d||a.from<s.from+h.length)&&(o[s.from]=l,r.push({from:s.from,to:s.from+h.length,insert:d}))});return n.changes.empty||t(e.update(n,{userEvent:"indent"})),!0},Cr=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gn(e,(o,i)=>{i.push({from:o.from,insert:e.facet(si)})}),{userEvent:"input.indent"})),!0),Sr=({state:e,dispatch:t})=>e.readOnly?!1:(t(e.update(gn(e,(o,i)=>{let n=/^\s*/.exec(o.text)[0];if(!n)return;let s=ei(n,e.tabSize),r=0,a=yt(e,Math.max(0,s-oi(e)));for(;r<n.length&&r<a.length&&n.charCodeAt(r)==a.charCodeAt(r);)r++;i.push({from:o.from+r,to:o.from+n.length,insert:a.slice(r)})}),{userEvent:"delete.dedent"})),!0),_l=e=>(e.setTabFocusMode(),!0);var Al=[{key:"Ctrl-b",run:Qo,shift:or,preventDefault:!0},{key:"Ctrl-f",run:Jo,shift:rr},{key:"Ctrl-p",run:er,shift:cr},{key:"Ctrl-n",run:tr,shift:ur},{key:"Ctrl-a",run:Ka,shift:rl},{key:"Ctrl-e",run:Ya,shift:al},{key:"Ctrl-d",run:mr},{key:"Ctrl-h",run:un},{key:"Ctrl-k",run:pl},{key:"Ctrl-Alt-h",run:gr},{key:"Ctrl-o",run:yl},{key:"Ctrl-t",run:vl},{key:"Ctrl-v",run:cn}],Tl=[{key:"ArrowLeft",run:Qo,shift:or,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:Na,shift:Xa,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:za,shift:sl,preventDefault:!0},{key:"ArrowRight",run:Jo,shift:rr,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:Ha,shift:Za,preventDefault:!0},{mac:"Cmd-ArrowRight",run:qa,shift:ol,preventDefault:!0},{key:"ArrowUp",run:er,shift:cr,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Vo,shift:No},{mac:"Ctrl-ArrowUp",run:Lo,shift:Ro},{key:"ArrowDown",run:tr,shift:ur,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Bo,shift:Ho},{mac:"Ctrl-ArrowDown",run:cn,shift:Oo},{key:"PageUp",run:Lo,shift:Ro},{key:"PageDown",run:cn,shift:Oo},{key:"Home",run:Ga,shift:nl,preventDefault:!0},{key:"Mod-Home",run:Vo,shift:No},{key:"End",run:ja,shift:il,preventDefault:!0},{key:"Mod-End",run:Bo,shift:Ho},{key:"Enter",run:Uo,shift:Uo},{key:"Mod-a",run:ll},{key:"Backspace",run:un,shift:un,preventDefault:!0},{key:"Delete",run:mr,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:gr,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ml,preventDefault:!0},{mac:"Mod-Backspace",run:gl,preventDefault:!0},{mac:"Mod-Delete",run:bl,preventDefault:!0}].concat(Al.map(e=>({mac:e.key,run:e.run,shift:e.shift}))),bn=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:$a,shift:el},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Wa,shift:tl},{key:"Alt-ArrowUp",run:Cl},{key:"Shift-Alt-ArrowUp",run:kl},{key:"Alt-ArrowDown",run:Sl},{key:"Shift-Alt-ArrowDown",run:xl},{key:"Mod-Alt-ArrowUp",run:hl},{key:"Mod-Alt-ArrowDown",run:dl},{key:"Escape",run:fl},{key:"Mod-Enter",run:Dl},{key:"Alt-l",mac:"Ctrl-l",run:cl},{key:"Mod-i",run:ul,preventDefault:!0},{key:"Mod-[",run:Sr},{key:"Mod-]",run:Cr},{key:"Mod-Alt-\\",run:Pl},{key:"Shift-Mod-k",run:wl},{key:"Shift-Mod-\\",run:Ja},{key:"Mod-/",run:ka},{key:"Alt-A",run:wa},{key:"Ctrl-m",mac:"Shift-Alt-m",run:_l}].concat(Tl),kr={key:"Tab",run:Cr,shift:Sr};var Ml="#e5c07b",xr="#e06c75",Il="#56b6c2",Fl="#ffffff",mi="#abb2bf",vn="#7d8799",Ll="#61afef",Rl="#98c379",wr="#d19a66",Ol="#c678dd",Vl="#21252b",Er="#2c313a",Dr="#282c34",yn="#353a42",Bl="#3E4451",Pr="#528bff";var Nl=I.theme({"&":{color:mi,backgroundColor:Dr},".cm-content":{caretColor:Pr},".cm-cursor, .cm-dropCursor":{borderLeftColor:Pr},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Bl},".cm-panels":{backgroundColor:Vl,color:mi},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Dr,color:vn,border:"none"},".cm-activeLineGutter":{backgroundColor:Er},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:yn},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:yn,borderBottomColor:yn},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:Er,color:mi}}},{dark:!0}),Hl=so.define([{tag:v.keyword,color:Ol},{tag:[v.name,v.deleted,v.character,v.propertyName,v.macroName],color:xr},{tag:[v.function(v.variableName),v.labelName],color:Ll},{tag:[v.color,v.constant(v.name),v.standard(v.name)],color:wr},{tag:[v.definition(v.name),v.separator],color:mi},{tag:[v.typeName,v.className,v.number,v.changed,v.annotation,v.modifier,v.self,v.namespace],color:Ml},{tag:[v.operator,v.operatorKeyword,v.url,v.escape,v.regexp,v.link,v.special(v.string)],color:Il},{tag:[v.meta,v.comment],color:vn},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.strikethrough,textDecoration:"line-through"},{tag:v.link,color:vn,textDecoration:"underline"},{tag:v.heading,fontWeight:"bold",color:xr},{tag:[v.atom,v.bool,v.special(v.variableName)],color:wr},{tag:[v.processingInstruction,v.string,v.inserted],color:Rl},{tag:v.invalid,color:Fl}]),_r=[Nl,vt(Hl)];var Ar=typeof String.prototype.normalize=="function"?e=>e.normalize("NFKD"):e=>e,Be=class{constructor(t,o,i=0,n=t.length,s,r){this.test=r,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=s?a=>s(Ar(a)):Ar,this.query=this.normalize(o)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Os(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let o=Vs(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Bs(t);let n=this.normalize(o);if(n.length)for(let s=0,r=i;;s++){let a=n.charCodeAt(s),l=this.match(a,r,this.bufferPos+this.bufferStart);if(s==n.length-1){if(l)return this.value=l,this;break}r==i&&s<o.length&&o.charCodeAt(s)==a&&r++}}}match(t,o,i){let n=null;for(let s=0;s<this.matches.length;s+=2){let r=this.matches[s],a=!1;this.query.charCodeAt(r)==t&&(r==this.query.length-1?n={from:this.matches[s+1],to:i}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?n={from:o,to:i}:this.matches.push(1,o)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}};typeof Symbol<"u"&&(Be.prototype[Symbol.iterator]=function(){return this});var Fr={from:-1,to:-1,match:/.*/.exec("")},Dn="gm"+(/x/.unicode==null?"":"u"),bi=class{constructor(t,o,i,n=0,s=t.length){if(this.text=t,this.to=s,this.curLine="",this.done=!1,this.value=Fr,/\\[sWDnr]|\n|\r|\[\^/.test(o))return new vi(t,o,i,n,s);this.re=new RegExp(o,Dn+(i?.ignoreCase?"i":"")),this.test=i?.test,this.iter=t.iter();let r=t.lineAt(n);this.curLineStart=r.from,this.matchPos=Ci(t,n),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let o=this.matchPos<=this.to&&this.re.exec(this.curLine);if(o){let i=this.curLineStart+o.index,n=i+o[0].length;if(this.matchPos=Ci(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,o)))return this.value={from:i,to:n,match:o},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}},Cn=new WeakMap,yi=class e{constructor(t,o){this.from=t,this.text=o}get to(){return this.from+this.text.length}static get(t,o,i){let n=Cn.get(t);if(!n||n.from>=i||n.to<=o){let a=new e(o,t.sliceString(o,i));return Cn.set(t,a),a}if(n.from==o&&n.to==i)return n;let{text:s,from:r}=n;return r>o&&(s=t.sliceString(o,r)+s,r=o),n.to<i&&(s+=t.sliceString(n.to,i)),Cn.set(t,new e(r,s)),new e(o,s.slice(o-r,i-r))}},vi=class{constructor(t,o,i,n,s){this.text=t,this.to=s,this.done=!1,this.value=Fr,this.matchPos=Ci(t,n),this.re=new RegExp(o,Dn+(i?.ignoreCase?"i":"")),this.test=i?.test,this.flat=yi.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,o=this.re.exec(this.flat.text);if(o&&!o[0]&&o.index==t&&(this.re.lastIndex=t+1,o=this.re.exec(this.flat.text)),o){let i=this.flat.from+o.index,n=i+o[0].length;if((this.flat.to>=this.to||o.index+o[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,o)))return this.value={from:i,to:n,match:o},this.matchPos=Ci(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=yi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(bi.prototype[Symbol.iterator]=vi.prototype[Symbol.iterator]=function(){return this});function Ul(e){try{return new RegExp(e,Dn),!0}catch{return!1}}function Ci(e,t){if(t>=e.length)return t;let o=e.lineAt(t),i;for(;t<o.to&&(i=o.text.charCodeAt(t-o.from))>=56320&&i<57344;)t++;return t}function Sn(e){let t=String(e.state.doc.lineAt(e.state.selection.main.head).number),o=M("input",{class:"cm-textfield",name:"line",value:t}),i=M("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),e.dispatch({effects:Dt.of(!1)}),e.focus()):s.keyCode==13&&(s.preventDefault(),n())},onsubmit:s=>{s.preventDefault(),n()}},M("label",e.state.phrase("Go to line"),": ",o)," ",M("button",{class:"cm-button",type:"submit"},e.state.phrase("go")),M("button",{name:"close",onclick:()=>{e.dispatch({effects:Dt.of(!1)}),e.focus()},"aria-label":e.state.phrase("close"),type:"button"},["\xD7"]));function n(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(o.value);if(!s)return;let{state:r}=e,a=r.doc.lineAt(r.selection.main.head),[,l,h,d,g]=s,b=d?+d.slice(1):0,S=h?+h:a.number;if(h&&g){let W=S/100;l&&(W=W*(l=="-"?-1:1)+a.number/r.doc.lines),S=Math.round(r.doc.lines*W)}else h&&l&&(S=S*(l=="-"?-1:1)+a.number);let T=r.doc.line(Math.max(1,Math.min(r.doc.lines,S))),$=k.cursor(T.from+Math.max(0,Math.min(b,T.length)));e.dispatch({effects:[Dt.of(!1),I.scrollIntoView($.from,{y:"center"})],selection:$}),e.focus()}return{dom:i}}var Dt=Y.define(),Tr=Ke.define({create(){return!0},update(e,t){for(let o of t.effects)o.is(Dt)&&(e=o.value);return e},provide:e=>bt.from(e,t=>t?Sn:null)}),$l=e=>{let t=Je(e,Sn);if(!t){let o=[Dt.of(!0)];e.state.field(Tr,!1)==null&&o.push(Y.appendConfig.of([Tr,Wl])),e.dispatch({effects:o}),t=Je(e,Sn)}return t&&t.dom.querySelector("input").select(),!0},Wl=I.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),jl={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Lr=Le.define({combine(e){return Qe(e,jl,{highlightWordAroundCursor:(t,o)=>t||o,minSelectionLength:Math.min,maxMatches:Math.min})}});function Rr(e){let t=[Yl,Kl];return e&&t.push(Lr.of(e)),t}var Gl=U.mark({class:"cm-selectionMatch"}),zl=U.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Mr(e,t,o,i){return(o==0||e(t.sliceDoc(o-1,o))!=te.Word)&&(i==t.doc.length||e(t.sliceDoc(i,i+1))!=te.Word)}function ql(e,t,o,i){return e(t.sliceDoc(o,o+1))==te.Word&&e(t.sliceDoc(i-1,i))==te.Word}var Kl=ti.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(Lr),{state:o}=e,i=o.selection;if(i.ranges.length>1)return U.none;let n=i.main,s,r=null;if(n.empty){if(!t.highlightWordAroundCursor)return U.none;let l=o.wordAt(n.head);if(!l)return U.none;r=o.charCategorizer(n.head),s=o.sliceDoc(l.from,l.to)}else{let l=n.to-n.from;if(l<t.minSelectionLength||l>200)return U.none;if(t.wholeWords){if(s=o.sliceDoc(n.from,n.to),r=o.charCategorizer(n.head),!(Mr(r,o,n.from,n.to)&&ql(r,o,n.from,n.to)))return U.none}else if(s=o.sliceDoc(n.from,n.to),!s)return U.none}let a=[];for(let l of e.visibleRanges){let h=new Be(o.doc,s,l.from,l.to);for(;!h.next().done;){let{from:d,to:g}=h.value;if((!r||Mr(r,o,d,g))&&(n.empty&&d<=n.from&&g>=n.to?a.push(zl.range(d,g)):(d>=n.to||g<=n.from)&&a.push(Gl.range(d,g)),a.length>t.maxMatches))return U.none}}return U.set(a)}},{decorations:e=>e.decorations}),Yl=I.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),Ql=({state:e,dispatch:t})=>{let{selection:o}=e,i=k.create(o.ranges.map(n=>e.wordAt(n.head)||k.cursor(n.head)),o.mainIndex);return i.eq(o)?!1:(t(e.update({selection:i})),!0)};function Jl(e,t){let{main:o,ranges:i}=e.selection,n=e.wordAt(o.head),s=n&&n.from==o.from&&n.to==o.to;for(let r=!1,a=new Be(e.doc,t,i[i.length-1].to);;)if(a.next(),a.done){if(r)return null;a=new Be(e.doc,t,0,Math.max(0,i[i.length-1].from-1)),r=!0}else{if(r&&i.some(l=>l.from==a.value.from))continue;if(s){let l=e.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}var Xl=({state:e,dispatch:t})=>{let{ranges:o}=e.selection;if(o.some(s=>s.from===s.to))return Ql({state:e,dispatch:t});let i=e.sliceDoc(o[0].from,o[0].to);if(e.selection.ranges.some(s=>e.sliceDoc(s.from,s.to)!=i))return!1;let n=Jl(e,i);return n?(t(e.update({selection:e.selection.addRange(k.range(n.from,n.to),!1),effects:I.scrollIntoView(n.to)})),!0):!1},ht=Le.define({combine(e){return Qe(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new En(t),scrollToMatch:t=>I.scrollIntoView(t)})}});var Si=class{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||Ul(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(o,i)=>i=="n"?`
3
- `:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new xn(this):new kn(this)}getCursor(t,o=0,i){let n=t.doc?t:Ye.create({doc:t});return i==null&&(i=n.doc.length),this.regexp?ut(this,n,o,i):ct(this,n,o,i)}},ki=class{constructor(t){this.spec=t}};function ct(e,t,o,i){return new Be(t.doc,e.unquoted,o,i,e.caseSensitive?void 0:n=>n.toLowerCase(),e.wholeWord?Zl(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function Zl(e,t){return(o,i,n,s)=>((s>o||s+n.length<i)&&(s=Math.max(0,o-2),n=e.sliceString(s,Math.min(e.length,i+2))),(t(xi(n,o-s))!=te.Word||t(wi(n,o-s))!=te.Word)&&(t(wi(n,i-s))!=te.Word||t(xi(n,i-s))!=te.Word))}var kn=class extends ki{constructor(t){super(t)}nextMatch(t,o,i){let n=ct(this.spec,t,i,t.doc.length).nextOverlapping();if(n.done){let s=Math.min(t.doc.length,o+this.spec.unquoted.length);n=ct(this.spec,t,0,s).nextOverlapping()}return n.done||n.value.from==o&&n.value.to==i?null:n.value}prevMatchInRange(t,o,i){for(let n=i;;){let s=Math.max(o,n-1e4-this.spec.unquoted.length),r=ct(this.spec,t,s,n),a=null;for(;!r.nextOverlapping().done;)a=r.value;if(a)return a;if(s==o)return null;n-=1e4}}prevMatch(t,o,i){let n=this.prevMatchInRange(t,0,o);return n||(n=this.prevMatchInRange(t,Math.max(0,i-this.spec.unquoted.length),t.doc.length)),n&&(n.from!=o||n.to!=i)?n:null}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,o){let i=ct(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=o)return null;n.push(i.value)}return n}highlight(t,o,i,n){let s=ct(this.spec,t,Math.max(0,o-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}};function ut(e,t,o,i){return new bi(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?ec(t.charCategorizer(t.selection.main.head)):void 0},o,i)}function xi(e,t){return e.slice(Ee(e,t,!1),t)}function wi(e,t){return e.slice(t,Ee(e,t))}function ec(e){return(t,o,i)=>!i[0].length||(e(xi(i.input,i.index))!=te.Word||e(wi(i.input,i.index))!=te.Word)&&(e(wi(i.input,i.index+i[0].length))!=te.Word||e(xi(i.input,i.index+i[0].length))!=te.Word)}var xn=class extends ki{nextMatch(t,o,i){let n=ut(this.spec,t,i,t.doc.length).next();return n.done&&(n=ut(this.spec,t,0,o).next()),n.done?null:n.value}prevMatchInRange(t,o,i){for(let n=1;;n++){let s=Math.max(o,i-n*1e4),r=ut(this.spec,t,s,i),a=null;for(;!r.next().done;)a=r.value;if(a&&(s==o||a.from>s+10))return a;if(s==o)return null}}prevMatch(t,o,i){return this.prevMatchInRange(t,0,o)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(o,i)=>{if(i=="&")return t.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let s=+i.slice(0,n);if(s>0&&s<t.match.length)return t.match[s]+i.slice(n)}return o})}matchAll(t,o){let i=ut(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=o)return null;n.push(i.value)}return n}highlight(t,o,i,n){let s=ut(this.spec,t,Math.max(0,o-250),Math.min(i+250,t.doc.length));for(;!s.next().done;)n(s.value.from,s.value.to)}},_t=Y.define(),Pn=Y.define(),Ve=Ke.define({create(e){return new Pt(wn(e).create(),null)},update(e,t){for(let o of t.effects)o.is(_t)?e=new Pt(o.value.create(),e.panel):o.is(Pn)&&(e=new Pt(e.query,o.value?_n:null));return e},provide:e=>bt.from(e,t=>t.panel)});var Pt=class{constructor(t,o){this.query=t,this.panel=o}},tc=U.mark({class:"cm-searchMatch"}),ic=U.mark({class:"cm-searchMatch cm-searchMatch-selected"}),nc=ti.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Ve))}update(e){let t=e.state.field(Ve);(t!=e.startState.field(Ve)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return U.none;let{view:o}=this,i=new Zt;for(let n=0,s=o.visibleRanges,r=s.length;n<r;n++){let{from:a,to:l}=s[n];for(;n<r-1&&l>s[n+1].from-500;)l=s[++n].to;e.highlight(o.state,a,l,(h,d)=>{let g=o.state.selection.ranges.some(b=>b.from==h&&b.to==d);i.add(h,d,g?ic:tc)})}return i.finish()}},{decorations:e=>e.decorations});function At(e){return t=>{let o=t.state.field(Ve,!1);return o&&o.query.spec.valid?e(t,o):Pi(t)}}var Ei=At((e,{query:t})=>{let{to:o}=e.state.selection.main,i=t.nextMatch(e.state,o,o);if(!i)return!1;let n=k.single(i.from,i.to),s=e.state.facet(ht);return e.dispatch({selection:n,effects:[An(e,i),s.scrollToMatch(n.main,e)],userEvent:"select.search"}),Vr(e),!0}),Di=At((e,{query:t})=>{let{state:o}=e,{from:i}=o.selection.main,n=t.prevMatch(o,i,i);if(!n)return!1;let s=k.single(n.from,n.to),r=e.state.facet(ht);return e.dispatch({selection:s,effects:[An(e,n),r.scrollToMatch(s.main,e)],userEvent:"select.search"}),Vr(e),!0}),sc=At((e,{query:t})=>{let o=t.matchAll(e.state,1e3);return!o||!o.length?!1:(e.dispatch({selection:k.create(o.map(i=>k.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),oc=({state:e,dispatch:t})=>{let o=e.selection;if(o.ranges.length>1||o.main.empty)return!1;let{from:i,to:n}=o.main,s=[],r=0;for(let a=new Be(e.doc,e.sliceDoc(i,n));!a.next().done;){if(s.length>1e3)return!1;a.value.from==i&&(r=s.length),s.push(k.range(a.value.from,a.value.to))}return t(e.update({selection:k.create(s,r),userEvent:"select.search.matches"})),!0},Ir=At((e,{query:t})=>{let{state:o}=e,{from:i,to:n}=o.selection.main;if(o.readOnly)return!1;let s=t.nextMatch(o,i,i);if(!s)return!1;let r=s,a=[],l,h,d=[];r.from==i&&r.to==n&&(h=o.toText(t.getReplacement(r)),a.push({from:r.from,to:r.to,insert:h}),r=t.nextMatch(o,r.from,r.to),d.push(I.announce.of(o.phrase("replaced match on line $",o.doc.lineAt(i).number)+".")));let g=e.state.changes(a);return r&&(l=k.single(r.from,r.to).map(g),d.push(An(e,r)),d.push(o.facet(ht).scrollToMatch(l.main,e))),e.dispatch({changes:g,selection:l,effects:d,userEvent:"input.replace"}),!0}),rc=At((e,{query:t})=>{if(e.state.readOnly)return!1;let o=t.matchAll(e.state,1e9).map(n=>{let{from:s,to:r}=n;return{from:s,to:r,insert:t.getReplacement(n)}});if(!o.length)return!1;let i=e.state.phrase("replaced $ matches",o.length)+".";return e.dispatch({changes:o,effects:I.announce.of(i),userEvent:"input.replace.all"}),!0});function _n(e){return e.state.facet(ht).createPanel(e)}function wn(e,t){var o,i,n,s,r;let a=e.selection.main,l=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!l)return t;let h=e.facet(ht);return new Si({search:((o=t?.literal)!==null&&o!==void 0?o:h.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(i=t?.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=t?.literal)!==null&&n!==void 0?n:h.literal,regexp:(s=t?.regexp)!==null&&s!==void 0?s:h.regexp,wholeWord:(r=t?.wholeWord)!==null&&r!==void 0?r:h.wholeWord})}function Or(e){let t=Je(e,_n);return t&&t.dom.querySelector("[main-field]")}function Vr(e){let t=Or(e);t&&t==e.root.activeElement&&t.select()}var Pi=e=>{let t=e.state.field(Ve,!1);if(t&&t.panel){let o=Or(e);if(o&&o!=e.root.activeElement){let i=wn(e.state,t.query.spec);i.valid&&e.dispatch({effects:_t.of(i)}),o.focus(),o.select()}}else e.dispatch({effects:[Pn.of(!0),t?_t.of(wn(e.state,t.query.spec)):Y.appendConfig.of(lc)]});return!0},_i=e=>{let t=e.state.field(Ve,!1);if(!t||!t.panel)return!1;let o=Je(e,_n);return o&&o.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Pn.of(!1)}),!0},Br=[{key:"Mod-f",run:Pi,scope:"editor search-panel"},{key:"F3",run:Ei,shift:Di,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Ei,shift:Di,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:_i,scope:"editor search-panel"},{key:"Mod-Shift-l",run:oc},{key:"Mod-Alt-g",run:$l},{key:"Mod-d",run:Xl,preventDefault:!0}],En=class{constructor(t){this.view=t;let o=this.query=t.state.field(Ve).query.spec;this.commit=this.commit.bind(this),this.searchField=M("input",{value:o.search,placeholder:oe(t,"Find"),"aria-label":oe(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=M("input",{value:o.replace,placeholder:oe(t,"Replace"),"aria-label":oe(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=M("input",{type:"checkbox",name:"case",form:"",checked:o.caseSensitive,onchange:this.commit}),this.reField=M("input",{type:"checkbox",name:"re",form:"",checked:o.regexp,onchange:this.commit}),this.wordField=M("input",{type:"checkbox",name:"word",form:"",checked:o.wholeWord,onchange:this.commit});function i(n,s,r){return M("button",{class:"cm-button",name:n,onclick:s,type:"button"},r)}this.dom=M("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Ei(t),[oe(t,"next")]),i("prev",()=>Di(t),[oe(t,"previous")]),i("select",()=>sc(t),[oe(t,"all")]),M("label",null,[this.caseField,oe(t,"match case")]),M("label",null,[this.reField,oe(t,"regexp")]),M("label",null,[this.wordField,oe(t,"by word")]),...t.state.readOnly?[]:[M("br"),this.replaceField,i("replace",()=>Ir(t),[oe(t,"replace")]),i("replaceAll",()=>rc(t),[oe(t,"replace all")])],M("button",{name:"close",onclick:()=>_i(t),"aria-label":oe(t,"close"),type:"button"},["\xD7"])])}commit(){let t=new Si({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:_t.of(t)}))}keydown(t){js(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Di:Ei)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Ir(this.view))}update(t){for(let o of t.transactions)for(let i of o.effects)i.is(_t)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(ht).top}};function oe(e,t){return e.state.phrase(t)}var pi=30,gi=/[\s\.,:;?!]/;function An(e,{from:t,to:o}){let i=e.state.doc.lineAt(t),n=e.state.doc.lineAt(o).to,s=Math.max(i.from,t-pi),r=Math.min(n,o+pi),a=e.state.sliceDoc(s,r);if(s!=i.from){for(let l=0;l<pi;l++)if(!gi.test(a[l+1])&&gi.test(a[l])){a=a.slice(l);break}}if(r!=n){for(let l=a.length-1;l>a.length-pi;l--)if(!gi.test(a[l-1])&&gi.test(a[l])){a=a.slice(0,l);break}}return I.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${i.number}.`)}var ac=I.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),lc=[Ve,Us.low(nc),ac];var Ti=class{constructor(t,o,i){this.from=t,this.to=o,this.diagnostic=i}},Ze=class e{constructor(t,o,i){this.diagnostics=t,this.panel=o,this.selected=i}static init(t,o,i){let n=i.facet(Tt).markerFilter;n&&(t=n(t,i));let s=t.slice().sort((S,T)=>S.from-T.from||S.to-T.to),r=new Zt,a=[],l=0,h=i.doc.iter(),d=0,g=i.doc.length;for(let S=0;;){let T=S==s.length?null:s[S];if(!T&&!a.length)break;let $,W;if(a.length)$=l,W=a.reduce((O,ge)=>Math.min(O,ge.to),T&&T.from>$?T.from:1e8);else{if($=T.from,$>g)break;W=T.to,a.push(T),S++}for(;S<s.length;){let O=s[S];if(O.from==$&&(O.to>O.from||O.to==$))a.push(O),S++,W=Math.min(O.to,W);else{W=Math.min(O.from,W);break}}W=Math.min(W,g);let It=!1;if(a.some(O=>O.from==$&&(O.to==W||W==g))&&(It=$==W,!It&&W-$<10)){let O=$-(d+h.value.length);O>0&&(h.next(O),d=$);for(let ge=$;;){if(ge>=W){It=!0;break}if(!h.lineBreak&&d+h.value.length>ge)break;ge=d+h.value.length,d+=h.value.length,h.next()}}let Fn=vc(a);if(It)r.add($,$,U.widget({widget:new Tn(Fn),diagnostics:a.slice()}));else{let O=a.reduce((ge,Ln)=>Ln.markClass?ge+" "+Ln.markClass:ge,"");r.add($,W,U.mark({class:"cm-lintRange cm-lintRange-"+Fn+O,diagnostics:a.slice(),inclusiveEnd:a.some(ge=>ge.to>W)}))}if(l=W,l==g)break;for(let O=0;O<a.length;O++)a[O].to<=l&&a.splice(O--,1)}let b=r.finish();return new e(b,o,dt(b))}};function dt(e,t=null,o=0){let i=null;return e.between(o,1e9,(n,s,{spec:r})=>{if(!(t&&r.diagnostics.indexOf(t)<0))if(!i)i=new Ti(n,s,t||r.diagnostics[0]);else{if(r.diagnostics.indexOf(i.diagnostic)<0)return!1;i=new Ti(i.from,s,i.diagnostic)}}),i}function cc(e,t){let o=t.pos,i=t.end||o,n=e.state.facet(Tt).hideOn(e,o,i);if(n!=null)return n;let s=e.startState.doc.lineAt(t.pos);return!!(e.effects.some(r=>r.is(Ur))||e.changes.touchesRange(s.from,Math.max(s.to,i)))}function uc(e,t){return e.field(re,!1)?t:t.concat(Y.appendConfig.of(Cc))}var Ur=Y.define(),Mn=Y.define(),$r=Y.define(),re=Ke.define({create(){return new Ze(U.none,null,null)},update(e,t){if(t.docChanged&&e.diagnostics.size){let o=e.diagnostics.map(t.changes),i=null,n=e.panel;if(e.selected){let s=t.changes.mapPos(e.selected.from,1);i=dt(o,e.selected.diagnostic,s)||dt(o,null,s)}!o.size&&n&&t.state.facet(Tt).autoPanel&&(n=null),e=new Ze(o,n,i)}for(let o of t.effects)if(o.is(Ur)){let i=t.state.facet(Tt).autoPanel?o.value.length?Mt.open:null:e.panel;e=Ze.init(o.value,i,t.state)}else o.is(Mn)?e=new Ze(e.diagnostics,o.value?Mt.open:null,e.selected):o.is($r)&&(e=new Ze(e.diagnostics,e.panel,o.value));return e},provide:e=>[bt.from(e,t=>t.panel),I.decorations.from(e,t=>t.diagnostics)]});var hc=U.mark({class:"cm-lintRange cm-lintRange-active"});function dc(e,t,o){let{diagnostics:i}=e.state.field(re),n,s=-1,r=-1;i.between(t-(o<0?1:0),t+(o>0?1:0),(l,h,{spec:d})=>{if(t>=l&&t<=h&&(l==h||(t>l||o>0)&&(t<h||o<0)))return n=d.diagnostics,s=l,r=h,!1});let a=e.state.facet(Tt).tooltipFilter;return n&&a&&(n=a(n,e.state)),n?{pos:s,end:r,above:e.state.doc.lineAt(s).to<r,create(){return{dom:fc(e,n)}}}:null}function fc(e,t){return M("ul",{class:"cm-tooltip-lint"},t.map(o=>Gr(e,o,!1)))}var mc=e=>{let t=e.state.field(re,!1);(!t||!t.panel)&&e.dispatch({effects:uc(e.state,[Mn.of(!0)])});let o=Je(e,Mt.open);return o&&o.dom.querySelector(".cm-panel-lint ul").focus(),!0},Nr=e=>{let t=e.state.field(re,!1);return!t||!t.panel?!1:(e.dispatch({effects:Mn.of(!1)}),!0)},pc=e=>{let t=e.state.field(re,!1);if(!t)return!1;let o=e.state.selection.main,i=t.diagnostics.iter(o.to+1);return!i.value&&(i=t.diagnostics.iter(0),!i.value||i.from==o.from&&i.to==o.to)?!1:(e.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)};var Wr=[{key:"Mod-Shift-m",run:mc,preventDefault:!0},{key:"F8",run:pc}];var Tt=Le.define({combine(e){return Ft({sources:e.map(t=>t.source).filter(t=>t!=null)},Qe(e.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{delay:Math.max,markerFilter:Hr,tooltipFilter:Hr,needsRefresh:(t,o)=>t?o?i=>t(i)||o(i):t:o,hideOn:(t,o)=>t?o?(i,n,s)=>t(i,n,s)||o(i,n,s):t:o,autoPanel:(t,o)=>t||o}))}});function Hr(e,t){return e?t?(o,i)=>t(e(o,i),i):e:t}function jr(e){let t=[];if(e)e:for(let{name:o}of e){for(let i=0;i<o.length;i++){let n=o[i];if(/[a-zA-Z]/.test(n)&&!t.some(s=>s.toLowerCase()==n.toLowerCase())){t.push(n);continue e}}t.push("")}return t}function Gr(e,t,o){var i;let n=o?jr(t.actions):[];return M("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},M("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage(e):t.message),(i=t.actions)===null||i===void 0?void 0:i.map((s,r)=>{let a=!1,l=S=>{if(S.preventDefault(),a)return;a=!0;let T=dt(e.state.field(re).diagnostics,t);T&&s.apply(e,T.from,T.to)},{name:h}=s,d=n[r]?h.indexOf(n[r]):-1,g=d<0?h:[h.slice(0,d),M("u",h.slice(d,d+1)),h.slice(d+1)],b=s.markClass?" "+s.markClass:"";return M("button",{type:"button",class:"cm-diagnosticAction"+b,onclick:l,onmousedown:l,"aria-label":` Action: ${h}${d<0?"":` (access key "${n[r]})"`}.`},g)}),t.source&&M("div",{class:"cm-diagnosticSource"},t.source))}var Tn=class extends $s{constructor(t){super(),this.sev=t}eq(t){return t.sev==this.sev}toDOM(){return M("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},Mi=class{constructor(t,o){this.diagnostic=o,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Gr(t,o,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Mt=class e{constructor(t){this.view=t,this.items=[];let o=n=>{if(n.keyCode==27)Nr(this.view),this.view.focus();else if(n.keyCode==38||n.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(n.keyCode==40||n.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(n.keyCode==36)this.moveSelection(0);else if(n.keyCode==35)this.moveSelection(this.items.length-1);else if(n.keyCode==13)this.view.focus();else if(n.keyCode>=65&&n.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],r=jr(s.actions);for(let a=0;a<r.length;a++)if(r[a].toUpperCase().charCodeAt(0)==n.keyCode){let l=dt(this.view.state.field(re).diagnostics,s);l&&s.actions[a].apply(t,l.from,l.to)}}else return;n.preventDefault()},i=n=>{for(let s=0;s<this.items.length;s++)this.items[s].dom.contains(n.target)&&this.moveSelection(s)};this.list=M("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:o,onclick:i}),this.dom=M("div",{class:"cm-panel-lint"},this.list,M("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Nr(this.view)},"\xD7")),this.update()}get selectedIndex(){let t=this.view.state.field(re).selected;if(!t)return-1;for(let o=0;o<this.items.length;o++)if(this.items[o].diagnostic==t.diagnostic)return o;return-1}update(){let{diagnostics:t,selected:o}=this.view.state.field(re),i=0,n=!1,s=null,r=new Set;for(t.between(0,this.view.state.doc.length,(a,l,{spec:h})=>{for(let d of h.diagnostics){if(r.has(d))continue;r.add(d);let g=-1,b;for(let S=i;S<this.items.length;S++)if(this.items[S].diagnostic==d){g=S;break}g<0?(b=new Mi(this.view,d),this.items.splice(i,0,b),n=!0):(b=this.items[g],g>i&&(this.items.splice(i,g-i),n=!0)),o&&b.diagnostic==o.diagnostic?b.dom.hasAttribute("aria-selected")||(b.dom.setAttribute("aria-selected","true"),s=b):b.dom.hasAttribute("aria-selected")&&b.dom.removeAttribute("aria-selected"),i++}});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)n=!0,this.items.pop();this.items.length==0&&(this.items.push(new Mi(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),s?(this.list.setAttribute("aria-activedescendant",s.id),this.view.requestMeasure({key:this,read:()=>({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:a,panel:l})=>{let h=l.height/this.list.offsetHeight;a.top<l.top?this.list.scrollTop-=(l.top-a.top)/h:a.bottom>l.bottom&&(this.list.scrollTop+=(a.bottom-l.bottom)/h)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let t=this.list.firstChild;function o(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)o();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)o()}moveSelection(t){if(this.selectedIndex<0)return;let o=this.view.state.field(re),i=dt(o.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:$r.of(i)})}static open(t){return new e(t)}};function gc(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(e)}</svg>')`}function Ai(e){return gc(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${e}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}var bc=I.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Ai("#d11")},".cm-lintRange-warning":{backgroundImage:Ai("orange")},".cm-lintRange-info":{backgroundImage:Ai("#999")},".cm-lintRange-hint":{backgroundImage:Ai("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function yc(e){return e=="error"?4:e=="warning"?3:e=="info"?2:1}function vc(e){let t="hint",o=1;for(let i of e){let n=yc(i.severity);n>o&&(o=n,t=i.severity)}return t}var Cc=[re,I.decorations.compute([re],e=>{let{selected:t,panel:o}=e.field(re);return!t||!o||t.from==t.to?U.none:U.set([hc.range(t.from,t.to)])}),Qs(dc,{hideOn:cc}),bc];var zr=[Js(),Xs(),Yi(),mn(),no(),Ki(),Gs(),Ye.allowMultipleSelections.of(!0),to(),vt(Xi,{fallback:!0}),oo(),ao(),co(),Ks(),Ys(),zs(),Rr(),gt.of([...lo,...bn,...Br,...pn,...io,...uo,...Wr])],qr=[Yi(),mn(),Ki(),vt(Xi,{fallback:!0}),gt.of([...bn,...pn])];var Sc=pt.define(),Kr=(()=>{let t=class t{constructor(){this._elementRef=C(Ue),this.autoFocus=!1,this.value="",this.disabled=!1,this.readonly=!1,this.theme="light",this.placeholder="",this.indentWithTab=!1,this.indentUnit="",this.lineWrapping=!1,this.highlightWhitespace=!1,this.languages=[],this.language="",this.setup="basic",this.extensions=[],this.change=new he,this.focus=new he,this.blur=new he,this._onChange=()=>{},this._onTouched=()=>{},this._updateListener=I.updateListener.of(i=>{if(i.docChanged&&!i.transactions.some(n=>n.annotation(Sc))){let n=i.state.doc.toString();this._onChange(n),this.change.emit(n)}}),this._editableConf=new ve,this._readonlyConf=new ve,this._themeConf=new ve,this._placeholderConf=new ve,this._indentWithTabConf=new ve,this._indentUnitConf=new ve,this._lineWrappingConf=new ve,this._highlightWhitespaceConf=new ve,this._languageConf=new ve}_getAllExtensions(){return[this._updateListener,this._editableConf.of([]),this._readonlyConf.of([]),this._themeConf.of([]),this._placeholderConf.of([]),this._indentWithTabConf.of([]),this._indentUnitConf.of([]),this._lineWrappingConf.of([]),this._highlightWhitespaceConf.of([]),this._languageConf.of([]),this.setup==="basic"?zr:this.setup==="minimal"?qr:[],...this.extensions]}ngOnChanges(i){this.view&&(i.value&&this.setValue(this.value),i.disabled&&this.setEditable(!this.disabled),i.readonly&&this.setReadonly(this.readonly),i.theme&&this.setTheme(this.theme),i.placeholder&&this.setPlaceholder(this.placeholder),i.indentWithTab&&this.setIndentWithTab(this.indentWithTab),i.indentUnit&&this.setIndentUnit(this.indentUnit),i.lineWrapping&&this.setLineWrapping(this.lineWrapping),i.highlightWhitespace&&this.setHighlightWhitespace(this.highlightWhitespace),i.language&&this.setLanguage(this.language),(i.setup||i.extensions)&&this.setExtensions(this._getAllExtensions()))}ngOnInit(){this.state=Ye.create({doc:this.value,extensions:this._getAllExtensions()}),this.view=new I({root:this.root,parent:this._elementRef.nativeElement,state:this.state}),this.autoFocus&&this.view.focus(),this.view.contentDOM.addEventListener("focus",()=>{this._onTouched(),this.focus.emit()}),this.view.contentDOM.addEventListener("blur",()=>{this._onTouched(),this.blur.emit()}),this.setEditable(!this.disabled),this.setReadonly(this.readonly),this.setTheme(this.theme),this.setPlaceholder(this.placeholder),this.setIndentWithTab(this.indentWithTab),this.setIndentUnit(this.indentUnit),this.setLineWrapping(this.lineWrapping),this.setHighlightWhitespace(this.highlightWhitespace),this.setLanguage(this.language)}ngOnDestroy(){this.view.destroy()}writeValue(i){this.view&&this.setValue(i)}registerOnChange(i){this._onChange=i}registerOnTouched(i){this._onTouched=i}setDisabledState(i){this.disabled=i,this.setEditable(!i)}setValue(i){this.view.dispatch({changes:{from:0,to:this.view.state.doc.length,insert:i},annotations:ot.addToHistory.of(!1)})}_dispatchEffects(i){return this.view.dispatch({effects:i})}setExtensions(i){this._dispatchEffects(Y.reconfigure.of(i))}setEditable(i){this._dispatchEffects(this._editableConf.reconfigure(I.editable.of(i)))}setReadonly(i){this._dispatchEffects(this._readonlyConf.reconfigure(Ye.readOnly.of(i)))}setTheme(i){this._dispatchEffects(this._themeConf.reconfigure(i==="light"?[]:i==="dark"?_r:i))}setPlaceholder(i){this._dispatchEffects(this._placeholderConf.reconfigure(i?qs(i):[]))}setIndentWithTab(i){this._dispatchEffects(this._indentWithTabConf.reconfigure(i?gt.of([kr]):[]))}setIndentUnit(i){this._dispatchEffects(this._indentUnitConf.reconfigure(i?si.of(i):[]))}setLineWrapping(i){this._dispatchEffects(this._lineWrappingConf.reconfigure(i?I.lineWrapping:[]))}setHighlightWhitespace(i){this._dispatchEffects(this._highlightWhitespaceConf.reconfigure(i?Zs():[]))}setLanguage(i){if(!i||i=="plaintext"){this._dispatchEffects(this._languageConf.reconfigure([]));return}if(this.languages.length===0){this.view&&console.error("No supported languages. Please set the `languages` prop at first.");return}this._findLanguage(i)?.load().then(s=>{this._dispatchEffects(this._languageConf.reconfigure([s]))})}_findLanguage(i){for(let n of this.languages)for(let s of[n.name,...n.alias])if(i.toLowerCase()===s.toLowerCase())return n;return console.error("Language not found:",i),console.info("Supported language names:",this.languages.map(n=>n.name).join(", ")),null}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["code-editor"]],hostAttrs:[1,"code-editor"],inputs:{root:"root",autoFocus:[2,"autoFocus","autoFocus",qe],value:"value",disabled:[2,"disabled","disabled",qe],readonly:[2,"readonly","readonly",qe],theme:"theme",placeholder:"placeholder",indentWithTab:[2,"indentWithTab","indentWithTab",qe],indentUnit:"indentUnit",lineWrapping:[2,"lineWrapping","lineWrapping",qe],highlightWhitespace:[2,"highlightWhitespace","highlightWhitespace",qe],languages:"languages",language:"language",setup:"setup",extensions:"extensions"},outputs:{change:"change",focus:"focus",blur:"blur"},features:[Bt([{provide:ts,useExisting:$n(()=>t),multi:!0}]),mt],decls:0,vars:0,template:function(n,s){},styles:[`.code-editor{display:block}.code-editor .cm-editor{height:100%}
4
- `],encapsulation:2,changeDetection:0});let e=t;return e})();function u(e){return new eo(ro.define(e))}function Ne(e){return import("./chunk-DJDRX53V.js").then(t=>t.sql({dialect:t[e]}))}var In=[c.of({name:"C",extensions:["c","h","ino"],load(){return import("./chunk-YCTCESL4.js").then(e=>e.cpp())}}),c.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return import("./chunk-YCTCESL4.js").then(e=>e.cpp())}}),c.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ne("Cassandra")}}),c.of({name:"CSS",extensions:["css"],load(){return import("./chunk-QVFPHTOH.js").then(e=>e.css())}}),c.of({name:"Go",extensions:["go"],load(){return import("./chunk-HHWXIK2M.js").then(e=>e.go())}}),c.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return import("./chunk-HC7F57NA.js").then(e=>e.html())}}),c.of({name:"Java",extensions:["java"],load(){return import("./chunk-EIYRBM4J.js").then(e=>e.java())}}),c.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return import("./chunk-JMYAD7E2.js").then(e=>e.javascript())}}),c.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return import("./chunk-Q556XB3S.js").then(e=>e.jinja())}}),c.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return import("./chunk-23UUFZSR.js").then(e=>e.json())}}),c.of({name:"JSX",extensions:["jsx"],load(){return import("./chunk-JMYAD7E2.js").then(e=>e.javascript({jsx:!0}))}}),c.of({name:"LESS",extensions:["less"],load(){return import("./chunk-NOPACN4F.js").then(e=>e.less())}}),c.of({name:"Liquid",extensions:["liquid"],load(){return import("./chunk-5XUIPWOH.js").then(e=>e.liquid())}}),c.of({name:"MariaDB SQL",load(){return Ne("MariaSQL")}}),c.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return import("./chunk-M4XL3JN5.js").then(e=>e.markdown())}}),c.of({name:"MS SQL",load(){return Ne("MSSQL")}}),c.of({name:"MySQL",load(){return Ne("MySQL")}}),c.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return import("./chunk-AADK5D2H.js").then(e=>e.php())}}),c.of({name:"PLSQL",extensions:["pls"],load(){return Ne("PLSQL")}}),c.of({name:"PostgreSQL",load(){return Ne("PostgreSQL")}}),c.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return import("./chunk-HKRGIRKB.js").then(e=>e.python())}}),c.of({name:"Rust",extensions:["rs"],load(){return import("./chunk-7CKHC72R.js").then(e=>e.rust())}}),c.of({name:"Sass",extensions:["sass"],load(){return import("./chunk-C3AAEQKW.js").then(e=>e.sass({indented:!0}))}}),c.of({name:"SCSS",extensions:["scss"],load(){return import("./chunk-C3AAEQKW.js").then(e=>e.sass())}}),c.of({name:"SQL",extensions:["sql"],load(){return Ne("StandardSQL")}}),c.of({name:"SQLite",load(){return Ne("SQLite")}}),c.of({name:"TSX",extensions:["tsx"],load(){return import("./chunk-JMYAD7E2.js").then(e=>e.javascript({jsx:!0,typescript:!0}))}}),c.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return import("./chunk-JMYAD7E2.js").then(e=>e.javascript({typescript:!0}))}}),c.of({name:"WebAssembly",extensions:["wat","wast"],load(){return import("./chunk-EL6QL4TP.js").then(e=>e.wast())}}),c.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return import("./chunk-ACUF7IKP.js").then(e=>e.xml())}}),c.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return import("./chunk-XOF4UW3S.js").then(e=>e.yaml())}}),c.of({name:"APL",extensions:["dyalog","apl"],load(){return import("./chunk-4ORP3SBY.js").then(e=>u(e.apl))}}),c.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return import("./chunk-UPGVU5LG.js").then(e=>u(e.asciiArmor))}}),c.of({name:"ASN.1",extensions:["asn","asn1"],load(){return import("./chunk-AGREZPV4.js").then(e=>u(e.asn1({})))}}),c.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return import("./chunk-YTDE6SXT.js").then(e=>u(e.asterisk))}}),c.of({name:"Brainfuck",extensions:["b","bf"],load(){return import("./chunk-NYJPOP4L.js").then(e=>u(e.brainfuck))}}),c.of({name:"Cobol",extensions:["cob","cpy"],load(){return import("./chunk-2FC5EKS5.js").then(e=>u(e.cobol))}}),c.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.csharp))}}),c.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return import("./chunk-JAEJ6IMV.js").then(e=>u(e.clojure))}}),c.of({name:"ClojureScript",extensions:["cljs"],load(){return import("./chunk-JAEJ6IMV.js").then(e=>u(e.clojure))}}),c.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return import("./chunk-OQRWXCLY.js").then(e=>u(e.gss))}}),c.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return import("./chunk-556I6YIW.js").then(e=>u(e.cmake))}}),c.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return import("./chunk-PZGLDZZM.js").then(e=>u(e.coffeeScript))}}),c.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return import("./chunk-VWIRXLNE.js").then(e=>u(e.commonLisp))}}),c.of({name:"Cypher",extensions:["cyp","cypher"],load(){return import("./chunk-BBHYIURC.js").then(e=>u(e.cypher))}}),c.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return import("./chunk-MKUUWY6Y.js").then(e=>u(e.cython))}}),c.of({name:"Crystal",extensions:["cr"],load(){return import("./chunk-VZMVGIVW.js").then(e=>u(e.crystal))}}),c.of({name:"D",extensions:["d"],load(){return import("./chunk-JF6WIV6M.js").then(e=>u(e.d))}}),c.of({name:"Dart",extensions:["dart"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.dart))}}),c.of({name:"diff",extensions:["diff","patch"],load(){return import("./chunk-7DUTYOJG.js").then(e=>u(e.diff))}}),c.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return import("./chunk-7NZJZATZ.js").then(e=>u(e.dockerFile))}}),c.of({name:"DTD",extensions:["dtd"],load(){return import("./chunk-PTLYIUFW.js").then(e=>u(e.dtd))}}),c.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return import("./chunk-5KJXGMKR.js").then(e=>u(e.dylan))}}),c.of({name:"EBNF",load(){return import("./chunk-5SPGSHKL.js").then(e=>u(e.ebnf))}}),c.of({name:"ECL",extensions:["ecl"],load(){return import("./chunk-TJZKTNNS.js").then(e=>u(e.ecl))}}),c.of({name:"edn",extensions:["edn"],load(){return import("./chunk-JAEJ6IMV.js").then(e=>u(e.clojure))}}),c.of({name:"Eiffel",extensions:["e"],load(){return import("./chunk-QM6CQMEX.js").then(e=>u(e.eiffel))}}),c.of({name:"Elm",extensions:["elm"],load(){return import("./chunk-6I5BGQHT.js").then(e=>u(e.elm))}}),c.of({name:"Erlang",extensions:["erl"],load(){return import("./chunk-F6V37MKG.js").then(e=>u(e.erlang))}}),c.of({name:"Esper",load(){return import("./chunk-S7S5M3AZ.js").then(e=>u(e.esper))}}),c.of({name:"Factor",extensions:["factor"],load(){return import("./chunk-GAGHHYLF.js").then(e=>u(e.factor))}}),c.of({name:"FCL",load(){return import("./chunk-F2XG7EWI.js").then(e=>u(e.fcl))}}),c.of({name:"Forth",extensions:["forth","fth","4th"],load(){return import("./chunk-5DPIGJU4.js").then(e=>u(e.forth))}}),c.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return import("./chunk-L6SYG23T.js").then(e=>u(e.fortran))}}),c.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return import("./chunk-DKGXUMLT.js").then(e=>u(e.fSharp))}}),c.of({name:"Gas",extensions:["s"],load(){return import("./chunk-3OHSTP3R.js").then(e=>u(e.gas))}}),c.of({name:"Gherkin",extensions:["feature"],load(){return import("./chunk-Y63UUJGJ.js").then(e=>u(e.gherkin))}}),c.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return import("./chunk-JSE63Q5X.js").then(e=>u(e.groovy))}}),c.of({name:"Haskell",extensions:["hs"],load(){return import("./chunk-R7PNKQU2.js").then(e=>u(e.haskell))}}),c.of({name:"Haxe",extensions:["hx"],load(){return import("./chunk-RCAORRB7.js").then(e=>u(e.haxe))}}),c.of({name:"HXML",extensions:["hxml"],load(){return import("./chunk-RCAORRB7.js").then(e=>u(e.hxml))}}),c.of({name:"HTTP",load(){return import("./chunk-4GCCF6PF.js").then(e=>u(e.http))}}),c.of({name:"IDL",extensions:["pro"],load(){return import("./chunk-7AXEPO3G.js").then(e=>u(e.idl))}}),c.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return import("./chunk-MR3U7TKQ.js").then(e=>u(e.jsonld))}}),c.of({name:"Julia",extensions:["jl"],load(){return import("./chunk-KT3TWCST.js").then(e=>u(e.julia))}}),c.of({name:"Kotlin",extensions:["kt","kts"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.kotlin))}}),c.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return import("./chunk-SBLNYV74.js").then(e=>u(e.liveScript))}}),c.of({name:"Lua",extensions:["lua"],load(){return import("./chunk-4YT6K5KY.js").then(e=>u(e.lua))}}),c.of({name:"mIRC",extensions:["mrc"],load(){return import("./chunk-JGXVTKLG.js").then(e=>u(e.mirc))}}),c.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return import("./chunk-ZHRYYMYE.js").then(e=>u(e.mathematica))}}),c.of({name:"Modelica",extensions:["mo"],load(){return import("./chunk-ATXLZN2B.js").then(e=>u(e.modelica))}}),c.of({name:"MUMPS",extensions:["mps"],load(){return import("./chunk-DFOOSIIA.js").then(e=>u(e.mumps))}}),c.of({name:"Mbox",extensions:["mbox"],load(){return import("./chunk-RO7SAOLK.js").then(e=>u(e.mbox))}}),c.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return import("./chunk-5IL7C45D.js").then(e=>u(e.nginx))}}),c.of({name:"NSIS",extensions:["nsh","nsi"],load(){return import("./chunk-RUN556VW.js").then(e=>u(e.nsis))}}),c.of({name:"NTriples",extensions:["nt","nq"],load(){return import("./chunk-2E7IJZLL.js").then(e=>u(e.ntriples))}}),c.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.objectiveC))}}),c.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.objectiveCpp))}}),c.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return import("./chunk-DKGXUMLT.js").then(e=>u(e.oCaml))}}),c.of({name:"Octave",extensions:["m"],load(){return import("./chunk-RQUUINHV.js").then(e=>u(e.octave))}}),c.of({name:"Oz",extensions:["oz"],load(){return import("./chunk-7HKFYRPF.js").then(e=>u(e.oz))}}),c.of({name:"Pascal",extensions:["p","pas"],load(){return import("./chunk-CFTKW432.js").then(e=>u(e.pascal))}}),c.of({name:"Perl",extensions:["pl","pm"],load(){return import("./chunk-6NOS45DG.js").then(e=>u(e.perl))}}),c.of({name:"Pig",extensions:["pig"],load(){return import("./chunk-XEGHEUP5.js").then(e=>u(e.pig))}}),c.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return import("./chunk-HS4S6BV3.js").then(e=>u(e.powerShell))}}),c.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return import("./chunk-UQ6O3I6W.js").then(e=>u(e.properties))}}),c.of({name:"ProtoBuf",extensions:["proto"],load(){return import("./chunk-Q7U2VPIS.js").then(e=>u(e.protobuf))}}),c.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return import("./chunk-22DWHRCL.js").then(e=>u(e.pug))}}),c.of({name:"Puppet",extensions:["pp"],load(){return import("./chunk-Q4VNZGFI.js").then(e=>u(e.puppet))}}),c.of({name:"Q",extensions:["q"],load(){return import("./chunk-ATBJWFA3.js").then(e=>u(e.q))}}),c.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return import("./chunk-6OKLPRCD.js").then(e=>u(e.r))}}),c.of({name:"RPM Changes",load(){return import("./chunk-PJF5XUTO.js").then(e=>u(e.rpmChanges))}}),c.of({name:"RPM Spec",extensions:["spec"],load(){return import("./chunk-PJF5XUTO.js").then(e=>u(e.rpmSpec))}}),c.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return import("./chunk-4BPSQMI2.js").then(e=>u(e.ruby))}}),c.of({name:"SAS",extensions:["sas"],load(){return import("./chunk-JGB4LLUT.js").then(e=>u(e.sas))}}),c.of({name:"Scala",extensions:["scala"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.scala))}}),c.of({name:"Scheme",extensions:["scm","ss"],load(){return import("./chunk-F672FY5I.js").then(e=>u(e.scheme))}}),c.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return import("./chunk-EVQKKVUZ.js").then(e=>u(e.shell))}}),c.of({name:"Sieve",extensions:["siv","sieve"],load(){return import("./chunk-KMF3ZRAO.js").then(e=>u(e.sieve))}}),c.of({name:"Smalltalk",extensions:["st"],load(){return import("./chunk-62WT7PI3.js").then(e=>u(e.smalltalk))}}),c.of({name:"Solr",load(){return import("./chunk-DWYP6ZGG.js").then(e=>u(e.solr))}}),c.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return import("./chunk-DKGXUMLT.js").then(e=>u(e.sml))}}),c.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return import("./chunk-6VEJCG43.js").then(e=>u(e.sparql))}}),c.of({name:"Spreadsheet",alias:["excel","formula"],load(){return import("./chunk-32L7RG2G.js").then(e=>u(e.spreadsheet))}}),c.of({name:"Squirrel",extensions:["nut"],load(){return import("./chunk-WR3MA3L3.js").then(e=>u(e.squirrel))}}),c.of({name:"Stylus",extensions:["styl"],load(){return import("./chunk-FQHOSSCO.js").then(e=>u(e.stylus))}}),c.of({name:"Swift",extensions:["swift"],load(){return import("./chunk-25QTY2GI.js").then(e=>u(e.swift))}}),c.of({name:"sTeX",load(){return import("./chunk-JVV3ZL6L.js").then(e=>u(e.stex))}}),c.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return import("./chunk-JVV3ZL6L.js").then(e=>u(e.stex))}}),c.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return import("./chunk-R4MI25E2.js").then(e=>u(e.verilog))}}),c.of({name:"Tcl",extensions:["tcl"],load(){return import("./chunk-YZPIUJB3.js").then(e=>u(e.tcl))}}),c.of({name:"Textile",extensions:["textile"],load(){return import("./chunk-JB5R6V33.js").then(e=>u(e.textile))}}),c.of({name:"TiddlyWiki",load(){return import("./chunk-KLOUBIO4.js").then(e=>u(e.tiddlyWiki))}}),c.of({name:"Tiki wiki",load(){return import("./chunk-LRQSPCYZ.js").then(e=>u(e.tiki))}}),c.of({name:"TOML",extensions:["toml"],load(){return import("./chunk-SIZCHHUA.js").then(e=>u(e.toml))}}),c.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return import("./chunk-T3YI3BSS.js").then(e=>u(e.troff))}}),c.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return import("./chunk-RK7XRDNB.js").then(e=>u(e.ttcn))}}),c.of({name:"TTCN_CFG",extensions:["cfg"],load(){return import("./chunk-4AGQL5GV.js").then(e=>u(e.ttcnCfg))}}),c.of({name:"Turtle",extensions:["ttl"],load(){return import("./chunk-YBNAC7QM.js").then(e=>u(e.turtle))}}),c.of({name:"Web IDL",extensions:["webidl"],load(){return import("./chunk-4FDRWZWT.js").then(e=>u(e.webIDL))}}),c.of({name:"VB.NET",extensions:["vb"],load(){return import("./chunk-CNOVT6KU.js").then(e=>u(e.vb))}}),c.of({name:"VBScript",extensions:["vbs"],load(){return import("./chunk-TAL3RTTQ.js").then(e=>u(e.vbScript))}}),c.of({name:"Velocity",extensions:["vtl"],load(){return import("./chunk-D56H3XE2.js").then(e=>u(e.velocity))}}),c.of({name:"Verilog",extensions:["v"],load(){return import("./chunk-R4MI25E2.js").then(e=>u(e.verilog))}}),c.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return import("./chunk-UJTFWZEC.js").then(e=>u(e.vhdl))}}),c.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return import("./chunk-6F6OMQ5H.js").then(e=>u(e.xQuery))}}),c.of({name:"Yacas",extensions:["ys"],load(){return import("./chunk-4QBOHIC3.js").then(e=>u(e.yacas))}}),c.of({name:"Z80",extensions:["z80"],load(){return import("./chunk-NBBDVVUF.js").then(e=>u(e.z80))}}),c.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return import("./chunk-IJ7K7ATQ.js").then(e=>u(e.mscgen))}}),c.of({name:"X\xF9",extensions:["xu"],load(){return import("./chunk-IJ7K7ATQ.js").then(e=>u(e.xu))}}),c.of({name:"MsGenny",extensions:["msgenny"],load(){return import("./chunk-IJ7K7ATQ.js").then(e=>u(e.msgenny))}}),c.of({name:"Vue",extensions:["vue"],load(){return import("./chunk-AZ5TF5Y3.js").then(e=>e.vue())}}),c.of({name:"Angular Template",load(){return import("./chunk-HNMGPG72.js").then(e=>e.angular())}})];var Ce=(function(e){return e[e.PENDING=0]="PENDING",e[e.SUCCESS=1]="SUCCESS",e[e.ERROR=2]="ERROR",e})(Ce||{}),Ii=class{constructor(t,o,i,n){this.props={},this.id=t,this.type=o,this.path=i,this.name=n,(o===w.COPY||o===w.MOVE||o===w.DOWNLOAD)&&(this.props={progress:1},o!==w.DOWNLOAD&&(this.props.src={name:n,path:i}))}};var Fi=(()=>{let t=class t{constructor(){this.http=C(ae),this.layout=C(K),this.store=C(Ie),this.onDone={[w.DELETE]:{fileEvent:{delete:!0},msg:{success:"Deletion done",failed:"Deletion failed"}},[w.MOVE]:{fileEvent:{delete:!0,reloadFocusOnDst:!0},msg:{success:"Move done",failed:"Move failed"}},[w.COPY]:{msg:{success:"Copy done",failed:"Copy failed"},fileEvent:{reload:!0,focus:!0}},[w.DOWNLOAD]:{fileEvent:{reload:!0,focus:!0},msg:{success:"Download done",failed:"Download failed"}},[w.UPLOAD]:{fileEvent:{reload:!0,focus:!0},msg:{success:"Upload done",failed:"Upload failed"}},[w.COMPRESS]:{fileEvent:{reload:!0,focus:!0},msg:{success:"Compression done",failed:"Compression failed"}},[w.DECOMPRESS]:{fileEvent:{reload:!0,focus:!0},msg:{success:"Decompression done",failed:"Decompression failed"}}},this.watcher=null,this.watch=He(1e3,1e3).pipe(tt(()=>this.doWatch())),this.loadAll()}addTask(i){i.status===Ce.PENDING?(this.store.filesActiveTasks.next([i,...this.store.filesActiveTasks.getValue()]),this.startWatch()):this.store.filesEndedTasks.next([i,...this.store.filesEndedTasks.getValue()])}createUploadTask(i,n,s){let r=new Ii(Ds(),w.UPLOAD,i,n);return r.status=Ce.PENDING,r.startedAt=ws(null,!0),r.props={progress:1,size:0,totalSize:s},this.store.filesActiveTasks.next([r,...this.store.filesActiveTasks.getValue()]),this.layout.showRSideBarTab(st.TASKS,!0),r}removeAll(){this.http.delete(Ct).subscribe({next:()=>this.clearEndedTasks(),error:i=>console.error(i)})}remove(i){this.http.delete(`${Ct}/${i.id}`).subscribe({next:()=>this.deleteTask(i.id,!1),error:n=>console.error(n)})}updateTask(i){if(i.status===Ce.PENDING){let n=this.findTask(i.id,!0);Object.assign(n,i)}else this.deleteTask(i.id,!0),this.addTask(i),this.taskDone(i)}loadAll(){this.http.get(Ct).subscribe({next:i=>i.forEach(n=>this.addTask(n)),error:i=>console.error(i)})}doWatch(){this.store.filesActiveTasks.getValue().length?this.fetchActiveTasks():this.stopWatch()}startWatch(){(!this.watcher||this.watcher.closed)&&(this.layout.showRSideBarTab(st.TASKS,!0),this.watcher=this.watch.subscribe())}stopWatch(){(this.watcher||!this.watcher.closed)&&(setTimeout(()=>this.layout.hideRSideBarTab(st.TASKS),3e3),this.watcher.unsubscribe())}fetchActiveTasks(){for(let i of this.store.filesActiveTasks.getValue().filter(n=>n.type!==w.UPLOAD))this.http.get(`${Ct}/${i.id}`).subscribe({next:n=>this.updateTask(n),error:n=>{n.status===404&&(i.result=n.error.message,i.status=Ce.ERROR,this.updateTask(i)),console.warn(n)}})}findTask(i,n){return n?this.store.filesActiveTasks.getValue().find(s=>s.id===i):this.store.filesEndedTasks.getValue().find(s=>s.id===i)}deleteTask(i,n){n?this.store.filesActiveTasks.next(this.store.filesActiveTasks.getValue().filter(s=>s.id!==i)):this.store.filesEndedTasks.next(this.store.filesEndedTasks.getValue().filter(s=>s.id!==i))}taskDone(i){if(i.type in this.onDone){if(this.onDone[i.type].fileEvent){let n=Oi(Ft({},this.onDone[i.type].fileEvent),{status:i.status});i.type===w.COPY||i.type===w.MOVE?(n.filePath=i.props.src.path,n.fileName=i.props.src.name,n.fileDstPath=i.path):(n.filePath=i.path,n.fileName=i.name,i.type===w.COMPRESS&&(n.archiveId=i.props.compressInDirectory===!1?i.id:null)),this.store.filesOnEvent.next(n)}i.status===Ce.SUCCESS?i.type===w.DELETE?this.removeDeletedChildTasks(i):this.layout.sendNotification("info",this.onDone[i.type].msg.success,i.name):this.layout.sendNotification("error",this.onDone[i.type].msg.failed,i.name,{error:{message:i.result}})}}removeDeletedChildTasks(i){if(i.path.startsWith(de.SHARES))this.remove(i);else if(i.path.startsWith(de.TRASH)){for(let n of this.store.filesEndedTasks.getValue().filter(s=>s.id!==i.id&&s.type===w.DELETE&&s.path.startsWith(de.FILES))){let s=i.path.replace(de.TRASH,de.FILES);new RegExp(`^${Ls(`${s}/${i.name}`)}(/|$)`).test(`${n.path}/${n.name}`)&&this.remove(n)}this.remove(i)}}clearEndedTasks(){this.store.filesEndedTasks.next([])}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var Yr=(()=>{let t=class t{constructor(){this.supportUploadDirectory=As(),this.http=C(ae),this.filesService=C(at),this.filesTasksService=C(Fi)}addFiles(i,n){return B(this,null,function*(){let s=`${en}/${this.filesService.currentRoute}`,r=[];for(let[a,l]of Object.entries(this.sortFiles(i))){let h=`${this.filesService.currentRoute}/${a}`.split("/").slice(0,-1).join("/"),d=`${this.filesService.currentRoute}/${a}`.split("/").slice(-1)[0],g=this.filesTasksService.createUploadTask(h,d,l.size);r.unshift([g,this.uploadFiles(`${s}/${a}`,l.form,n).pipe(Hn(b=>b.type===es.UploadProgress),tt(b=>this.updateProgress(g,b)))])}for(let[a,l]of r)try{yield Bn(l),a.props.progress=100,a.status=Ce.SUCCESS}catch(h){a.status=Ce.ERROR,h.status===0?a.result=h.statusText:a.result=h.error.message}finally{this.filesTasksService.updateTask(a)}})}onDropFiles(i,n){i.dataTransfer.items&&i.dataTransfer.items[0]?.webkitGetAsEntry?this.webkitReadDataTransfer(i,n):this.addFiles(i.dataTransfer.files,n).catch(console.error)}uploadOneFile(i,n,s=!1,r=!1){let a=`${en}/${i.path}`,l=(i?.root?.alias||i.name).normalize(),h=new File([new Blob([n])],l,{type:i.mime.replace("-","/")}),d=new FormData;return d.append("file",h),this.http.request(s?"patch":r?"put":"post",a,{body:d})}uploadFiles(i,n,s){return this.http.request(s?"put":"post",i,{body:n,reportProgress:!0,observe:"events"})}updateProgress(i,n){i.props.size=n.loaded,i.props.progress=Math.round(100*n.loaded/n.total)}sortFiles(i){let n={};for(let s of i){let r=s.relativePath||s.webkitRelativePath,a=(r?r.split("/")[0]:s.name).normalize();a in n||(n[a]={nb:0,size:0,form:new FormData}),n[a].form.append("file",s,(r||s.name).normalize()),n[a].nb++,n[a].size+=s.size}return n}webkitReadDataTransfer(i,n){let s=i.dataTransfer.items.length,r=[],a=b=>{b.readEntries(function(S){if(S.length){s+=S.length;for(let T of S)T.isFile?T.file($=>{l(T,$)},h):T.isDirectory&&a(T.createReader());a(b)}else d()},h)},l=(b,S)=>{g(b,S),r.push(S),d()},h=b=>{throw d(),b},d=()=>{--s==0&&this.addFiles(r,n).catch(console.error)},g=(b,S)=>{b.fullPath&&b.fullPath!==`/${S.name}`&&(S.relativePath=b.fullPath.startsWith("/")?b.fullPath.slice(1):b.fullPath)};for(let b of i.dataTransfer.items){let S=b.webkitGetAsEntry();if(!S){d();return}S.isFile?l(S,b.getAsFile()):a(S.createReader())}}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();var kc=["editor"];function xc(e,t){if(e&1&&A(0,"fa-icon",5),e&2){let o=E();y("icon",o.icons.faSpinner)}}function wc(e,t){if(e&1&&A(0,"fa-icon",3),e&2){let o=E();y("icon",o.icons.faFloppyDisk)}}function Ec(e,t){if(e&1){let o=z();p(0,"button",10),x("click",function(){P(o);let n=E();return _(n.save(!0))}),D(1,"Save And Exit "),m(),p(2,"button",11),x("click",function(){P(o);let n=E();return _(n.onClose())}),D(3,"Close Without Saving "),m(),p(4,"button",12),x("click",function(){P(o);let n=E();return _(n.warnOnUnsavedChanges.set(!1))}),D(5,"Cancel "),m()}}var Qr=(()=>{let t=class t{constructor(){this.editor=Ht("editor"),this.currentHeight=Z.required(),this.file=ze.required(),this.isWriteable=Z.required(),this.isReadonly=ze.required(),this.modalClosing=Z.required(),this.isSupported=ie(!1),this.isModified=ie(!1),this.isSaving=ie(!1),this.lineWrapping=ie(!1),this.warnOnUnsavedChanges=ie(!1),this.content=!1,this.currentLanguage=void 0,this.languages=In,this.currentTheme="light",this.icons={faFloppyDisk:os,faLock:qt,faLockOpen:ys,faMagnifyingGlass:ns,faSpinner:gs,faArrowsLeftRightToLine:ls,faReply:ss,faShare:ds},this.isSearchPanelOpen=ie(!1),this.layout=C(K),this.locale=C(Te),this.isContentReady=!1,this.http=C(ae),this.filesServices=C(at),this.filesUpload=C(Yr),this.subscription=this.layout.switchTheme.subscribe(i=>this.currentTheme=i===Es?"dark":"light"),this.maxSize=5242880,ji(()=>{if(!this.modalClosing())return;let i=Nt(()=>this.file().id);Nt(()=>this.isModified())?(this.warnOnUnsavedChanges.set(!0),this.layout.windows.getValue().find(s=>s.id===i)&&this.layout.restoreDialog(i)):this.onClose().catch(console.error)}),ji(()=>{this.isReadonly(),Nt(()=>this.isSearchPanelOpen())&&setTimeout(()=>{this.toggleSearch(),this.toggleSearch()},100)})}onKeyDown(i){if(i.key==="Escape"||i.key==="Esc"){i.preventDefault(),this.isSearchPanelOpen()?(i.stopPropagation(),this.toggleSearch()):this.warnOnUnsavedChanges()?(i.stopPropagation(),this.warnOnUnsavedChanges.set(!1)):this.isModified()?(i.stopPropagation(),this.warnOnUnsavedChanges.set(!0)):(i.stopPropagation(),this.onClose().catch(console.error));return}if(i.ctrlKey||i.metaKey)switch(i.key.toLowerCase()){case"s":i.preventDefault(),this.save();return;case"f":i.preventDefault(),i.stopPropagation(),this.toggleSearch();return}}ngOnInit(){return B(this,null,function*(){let i=c.matchFilename(In,this.file().name);i?.name||this.file().size<=this.maxSize?(this.currentLanguage=i?.name,this.isSupported.set(!0),this.loadContent().catch(console.error)):(this.isReadonly.set(!0),this.isSupported.set(!1),this.content=this.layout.translateString("This file contains binary data that can not be read"))})}toggleReadonly(){return B(this,null,function*(){this.isReadonly()?yield this.lockFile():yield this.unlockFile(),this.isReadonly.update(i=>!i)})}save(i=!1){this.isSaving.set(!0),this.filesUpload.uploadOneFile(this.file(),this.content,!0).subscribe({next:()=>{this.isModified.set(!1),this.isSaving.set(!1),this.warnOnUnsavedChanges.set(!1),i&&this.onClose().catch(console.error)},error:n=>{this.isSaving.set(!1),this.layout.sendNotification("error","Unable to save document",n.error.message)}})}toggleSearch(){this.isSearchPanelOpen.update(i=>!i),this.isSearchPanelOpen()?Pi(this.editor().view):_i(this.editor().view)}contentChange(){this.isContentReady?this.isModified.set(!0):this.isContentReady=!0}onUndo(){ui({state:this.editor().view.state,dispatch:this.editor().view.dispatch})}onRedo(){wt({state:this.editor().view.state,dispatch:this.editor().view.dispatch})}canUndo(){return this.editor()?.view?Go(this.editor().view.state)>0:!1}canRedo(){return this.editor()?.view?zo(this.editor().view.state)>0:!1}onClose(){return B(this,null,function*(){this.isReadonly()||(yield this.unlockFile()),this.layout.closeDialog(null,this.file().id)})}ngOnDestroy(){this.subscription.unsubscribe()}loadContent(){return B(this,null,function*(){this.isReadonly()||(yield this.lockFile()),this.http.get(this.file().dataUrl,{responseType:"text"}).subscribe({next:i=>this.content=i,error:i=>this.layout.sendNotification("error","Unable to open document",this.file().name,i)})})}lockFile(){return B(this,null,function*(){if(!(!this.isSupported||!this.isWriteable()))try{let i=yield De(this.filesServices.lock(this.file()));this.file.update(n=>(n.lock=i,n))}catch(i){this.lockError(i)}})}unlockFile(){return B(this,null,function*(){if(!(!this.isSupported||!this.isWriteable()))try{yield De(this.filesServices.unlock(this.file())),this.file.update(i=>(delete i.lock,i))}catch(i){this.lockError(i)}})}lockError(i){if(this.isReadonly.set(!0),this.isSupported.set(!1),i.error?.owner){let n=i.error;this.file.update(s=>(s.lock=n,s)),this.layout.sendNotification("info","The file is locked",n.owner)}else this.layout.sendNotification("warning",this.file().name,i.error.message)}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-text"]],viewQuery:function(n,s){n&1&&Ot(s.editor,kc,5),n&2&&Vt()},hostBindings:function(n,s){n&1&&x("keydown",function(a){return s.onKeyDown(a)},ke)},inputs:{currentHeight:[1,"currentHeight"],file:[1,"file"],isWriteable:[1,"isWriteable"],isReadonly:[1,"isReadonly"],modalClosing:[1,"modalClosing"]},outputs:{file:"fileChange",isReadonly:"isReadonlyChange"},decls:24,vars:49,consts:[["editor",""],[1,"app-top-menu"],["type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip","adaptivePosition","disabled"],[3,"icon"],["type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-secondary","me-1",3,"click","tooltip","isDisabled","disabled"],["animation","spin",3,"icon"],["type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"click","disabled","tooltip"],["btnCheckbox","","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom","me-1",3,"ngModelChange","ngModel","tooltip"],["btnCheckbox","","type","button",1,"d-none","d-sm-block","btn","btn-sm","btn-custom",3,"ngModelChange","ngModel","tooltip"],[3,"ngModelChange","change","autoFocus","languages","language","ngModel","theme","readonly","disabled","lineWrapping"],["type","button","l10nTranslate","",1,"btn","btn-sm","btn-primary","me-2","ms-auto",3,"click"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-danger","me-2",3,"click"],["data-dismiss","modal","type","button","l10nTranslate","",1,"btn","btn-sm","btn-secondary",3,"click"]],template:function(n,s){if(n&1){let r=z();p(0,"div")(1,"div",1)(2,"button",2),V(3,"translate"),x("click",function(){return P(r),_(s.toggleReadonly())}),A(4,"fa-icon",3),m(),p(5,"button",4),V(6,"translate"),x("click",function(){return P(r),_(s.save())}),N(7,xc,1,1,"fa-icon",5)(8,wc,1,1,"fa-icon",3),m(),p(9,"button",6),V(10,"translate"),x("click",function(){return P(r),_(s.onUndo())}),A(11,"fa-icon",3),m(),p(12,"button",6),V(13,"translate"),x("click",function(){return P(r),_(s.onRedo())}),A(14,"fa-icon",3),m(),p(15,"button",7),V(16,"translate"),x("ngModelChange",function(l){return P(r),_(s.lineWrapping.set(l))}),A(17,"fa-icon",3),m(),p(18,"button",8),V(19,"translate"),x("ngModelChange",function(){return P(r),_(s.toggleSearch())}),A(20,"fa-icon",3),m(),N(21,Ec,6,0),m(),p(22,"code-editor",9,0),Ge("ngModelChange",function(l){return P(r),je(s.content,l)||(s.content=l),_(l)}),x("change",function(){return P(r),_(s.contentChange())}),m()()}n&2&&(ee("height",s.currentHeight(),"px"),f(2),y("tooltip",j(3,31,s.isReadonly()||!s.isWriteable()?"Read-only":"Read-write",s.locale.language))("adaptivePosition",!0)("disabled",!s.isSupported()||!s.isWriteable()),f(2),y("icon",s.isReadonly()?s.icons.faLock:s.icons.faLockOpen),f(),y("tooltip",j(6,34,s.isReadonly()||!s.isWriteable()||!s.isModified()?void 0:"Save",s.locale.language))("isDisabled",s.isReadonly()||!s.isWriteable()||!s.isModified())("disabled",s.isReadonly()||!s.isWriteable()||!s.isModified()),f(2),H(s.isSaving()?7:8),f(2),y("disabled",!s.canUndo())("tooltip",j(10,37,"Undo",s.locale.language)),f(2),y("icon",s.icons.faReply),f(),y("disabled",!s.canRedo())("tooltip",j(13,40,"Redo",s.locale.language)),f(2),y("icon",s.icons.faShare),f(),y("ngModel",s.lineWrapping())("tooltip",j(16,43,"Line Wrap",s.locale.language)),f(2),y("icon",s.icons.faArrowsLeftRightToLine),f(),y("ngModel",s.isSearchPanelOpen())("tooltip",j(19,46,"Search",s.locale.language)),f(2),y("icon",s.icons.faMagnifyingGlass),f(),H(s.warnOnUnsavedChanges()?21:-1),f(),y("autoFocus",!0)("languages",s.languages)("language",s.currentLanguage),We("ngModel",s.content),y("theme",s.currentTheme)("readonly",s.isReadonly())("disabled",s.isReadonly())("lineWrapping",s.lineWrapping()))},dependencies:[Kr,zt,Gt,jt,$t,Wt,ye,Qt,nt,Me],styles:[`.code-editor{height:calc(100% - 40px)}.cm-focused{outline:none!important}.cm-panel.cm-search{display:flex;align-items:center;text-wrap:nowrap}.cm-panel.cm-search label{display:flex;align-items:center}.cm-panel.cm-search button[aria-label=close]{display:none}
5
- `],encapsulation:2});let e=t;return e})();function Dc(e,t){if(e&1){let o=z();p(0,"app-files-viewer-image",11),Ge("fileChange",function(n){P(o);let s=E(2);return je(s.currentFile,n)||(s.currentFile=n),_(n)}),m()}if(e&2){let o=E(2);y("currentHeight",o.currentHeight),We("file",o.currentFile),y("directoryImages",o.directoryImages())}}function Pc(e,t){if(e&1&&A(0,"app-files-viewer-pdf",8),e&2){let o=E(2);y("currentHeight",o.currentHeight)("fileUrl",o.currentFile.dataUrl)}}function _c(e,t){if(e&1&&A(0,"app-files-viewer-media",8),e&2){let o=E(2);y("currentHeight",o.currentHeight)("fileUrl",o.currentFile.dataUrl)}}function Ac(e,t){if(e&1&&A(0,"app-files-viewer-document",9),e&2){let o=E(2);y("currentHeight",o.currentHeight)("file",o.currentFile)("mode",o.mode)}}function Tc(e,t){if(e&1){let o=z();p(0,"app-files-viewer-text",12),Ge("isReadonlyChange",function(n){P(o);let s=E(2);return je(s.isReadonly,n)||(s.isReadonly=n),_(n)}),m()}if(e&2){let o=E(2);y("currentHeight",o.currentHeight)("file",o.currentFile)("isWriteable",o.isWriteable)("modalClosing",o.modalClosing()),We("isReadonly",o.isReadonly)}}function Mc(e,t){if(e&1&&(p(0,"div",6),N(1,Dc,1,3,"app-files-viewer-image",7)(2,Pc,1,2,"app-files-viewer-pdf",8)(3,_c,1,2,"app-files-viewer-media",8)(4,Ac,1,3,"app-files-viewer-document",9)(5,Tc,1,5,"app-files-viewer-text",10),m()),e&2){let o,i=E();f(),H((o=i.hookedShortMime)===i.SHORT_MIME.IMAGE?1:o===i.SHORT_MIME.PDF?2:o===i.SHORT_MIME.MEDIA?3:o===i.SHORT_MIME.DOCUMENT?4:5)}}var Jr=(()=>{let t=class t{constructor(){this.modalClosing=ie(!1),this.isReadonly=ze(!0),this.SHORT_MIME=we,this.icons={faEye:as,faPen:vs},this.directoryImages=_e(()=>this.directoryFiles.filter(i=>i.isImage)),this.layout=C(K),this.subscription=this.layout.resizeEvent.subscribe(()=>this.onResize()),this.offsetTop=42}ngOnInit(){this.isReadonly.set(this.mode===le.VIEW||this.hookedShortMime===we.PDF),this.openedFile={id:this.currentFile.id,name:this.currentFile.name,mimeUrl:this.currentFile.mimeUrl},this.onResize()}ngOnDestroy(){this.subscription.unsubscribe()}onClose(){this.currentFile.isEditable&&this.hookedShortMime===we.TEXT?(this.modalClosing.set(!0),setTimeout(()=>this.modalClosing.set(!1),1e3)):this.layout.closeDialog(null,this.openedFile.id)}onMinimize(){this.layout.minimizeDialog(this.openedFile.id,{name:this.openedFile.name,mimeUrl:this.openedFile.mimeUrl})}onResize(){this.currentHeight=window.innerHeight-this.offsetTop}};t.\u0275fac=function(n){return new(n||t)},t.\u0275cmp=R({type:t,selectors:[["app-files-viewer-dialog"]],inputs:{currentFile:"currentFile",directoryFiles:"directoryFiles",mode:"mode",isWriteable:"isWriteable",hookedShortMime:"hookedShortMime",isReadonly:[1,"isReadonly"]},outputs:{isReadonly:"isReadonlyChange"},decls:8,vars:3,consts:[[1,"modal-header"],[1,"modal-title"],[3,"icon"],[1,"ms-2"],["aria-label","Minimize","type","button",1,"btn-minimize","btn-minimize-white",3,"click"],["aria-label","Close","type","button",1,"btn-close","btn-close-white","ms-3",3,"click"],[1,"modal-body"],[3,"currentHeight","file","directoryImages"],[3,"currentHeight","fileUrl"],[3,"currentHeight","file","mode"],[3,"currentHeight","file","isWriteable","modalClosing","isReadonly"],[3,"fileChange","currentHeight","file","directoryImages"],[3,"isReadonlyChange","currentHeight","file","isWriteable","modalClosing","isReadonly"]],template:function(n,s){n&1&&(p(0,"div",0)(1,"h4",1),A(2,"fa-icon",2),p(3,"span",3),D(4),m()(),p(5,"button",4),x("click",function(){return s.onMinimize()}),m(),p(6,"button",5),x("click",function(){return s.onClose()}),m()(),N(7,Mc,6,1,"div",6)),n&2&&(f(2),y("icon",s.isReadonly()?s.icons.faEye:s.icons.faPen),f(2),X(s.currentFile.name),f(3),H(s.currentFile?7:-1))},dependencies:[Fo,Io,Qr,Do,Po,ye],encapsulation:2});let e=t;return e})();var Li=class{constructor(t){Object.assign(this,t),this.mimeUrl=Jt(this.mime),this.setProperties()}fallBackMimeUrl(){this.mimeUrl=Xt}setProperties(){let t=this.path.split("/")[0],o=this.path.split("/")[1]===Kt.PERSONAL;this.showedPath=this.path.split("/").slice(o?2:1).join("/"),this.iconClass=t===de.SHARES?"purple":"primary",this.icon=t===de.SHARES?ne.SHARES:o?ne.PERSONAL:ne.SPACES}};var Ri=class{constructor(t){this.inTrash=!1,Object.assign(this,t),this.mimeUrl=Jt(this.mime),this.iconClass=this.shareId?"purple":"primary",this.icon=this.shareId?ne.SHARES:this.spaceId?ne.SPACES:ne.PERSONAL,this.showedPath=this.path.split("/").slice(this.path.split("/")[1]===Kt.PERSONAL?2:1).join("/"),this.inTrash=this.path.split("/")[0]===de.TRASH}fallBackMimeUrl(){this.mimeUrl=Xt}};var at=(()=>{let t=class t{constructor(){this.treeNodeSelected=null,this.treeCopyMoveOn=new ft,this.clipboardAction="copyPaste",this.http=C(ae),this.layout=C(K),this.store=C(Ie),this.sanitizer=C(Ut),this.filesTasksService=C(Fi)}getTreeNode(i,n=!1){return De(this.http.get(`${Fs}/${i}`,{params:n?new it().set("showFiles",n):null}))}addToClipboard(i){if(i.length)if(!this.store.filesClipboard.getValue().length)this.layout.showRSideBarTab(st.CLIPBOARD,!0),this.store.filesClipboard.next(i);else{let n=i.filter(s=>this.store.filesClipboard.getValue().indexOf(s)===-1);n.length&&this.store.filesClipboard.next([...n,...this.store.filesClipboard.getValue()])}}removeFromClipboard(i){this.store.filesClipboard.next(this.store.filesClipboard.getValue().filter(n=>n.id!==i.id))}clearClipboard(){this.store.filesClipboard.next([])}onPasteClipboard(i){let n=i||this.clipboardAction;if(this.store.filesClipboard.getValue().length){let s=this.currentRoute;this.copyMove([...this.store.filesClipboard.getValue()],s,n==="copyPaste"?w.COPY:w.MOVE).catch(console.error),this.clearClipboard()}}download(i){zi(i.dataUrl)}copyMove(i,n,s){return B(this,null,function*(){let r=!1,a=yield this.getTreeNode(n,!0),l=i.filter(d=>a.some(g=>g.name.toLowerCase()===d.name.toLowerCase()));if(l.length>0&&(r=yield this.openOverwriteDialog(l),!r))return;let h=s===w.MOVE;for(let d of i){h&&(d.isBeingDeleted=!0);let g={dstDirectory:n,overwrite:r};this.http.request(s,d.taskUrl,{body:g}).subscribe({next:b=>this.filesTasksService.addTask(b),error:b=>{h&&(d.isBeingDeleted=!1),this.layout.sendNotification("error",s==="move"?"Move failed":"Copy failed",d.name,b)}})}})}rename(i,n,s=!1){if(!this.isValidName(n))return On;let a={dstDirectory:i.path.split("/").slice(0,-1).join("/")||".",dstName:n,overwrite:s};return this.http.request(w.MOVE,i.dataUrl,{body:a})}delete(i){for(let n of i)n.isBeingDeleted=!0,this.http.delete(n.taskUrl).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>{n.isBeingDeleted=!1,this.layout.sendNotification("error","Deletion failed",n.name,s)}})}make(i,n,s=null,r=!1){if(!this.isValidName(n))return;s=s||this.currentRoute;let a={type:i};if(r)return this.http.post(`${Zi}/${s}/${n}`,a);this.http.post(`${Zi}/${s}/${n}`,a).subscribe({next:()=>this.store.filesOnEvent.next({filePath:s,fileName:n,focus:!0,reload:!0}),error:l=>this.layout.sendNotification("error","Creation failed",n,l)})}compress(i){let n=this.currentRoute;this.http.post(`${fo}/${n}/${i.name}.${i.extension}`,i).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>this.layout.sendNotification("error","Compression failed",i.name,s)})}decompress(i){let n=this.currentRoute;this.http.post(`${mo}/${n}/${i.name}`,null).subscribe({next:s=>this.filesTasksService.addTask(s),error:s=>this.layout.sendNotification("error","Compression failed",i.name,s)})}downloadFromUrl(i,n){if(!this.isValidName(n))return;let s=this.currentRoute,r={url:i};this.http.post(`${ho}/${s}/${n}`,r).subscribe({next:a=>this.filesTasksService.addTask(a),error:a=>this.layout.sendNotification("error","Download failed",i,a)})}downloadTaskArchive(i){zi(`${po}/${i}`)}loadRecents(i){this.http.get(go,{params:new it().set("limit",i)}).pipe(et(n=>n.map(s=>new Ri(s)))).subscribe({next:n=>{this.store.filesRecents.update(s=>[...n,...s.slice(i)])},error:n=>this.layout.sendNotification("error","Files","Unable to load",n)})}search(i){return this.http.request("search",bo,{body:i}).pipe(et(n=>n.map(s=>(s.content&&(s.content=this.sanitizer.bypassSecurityTrustHtml(s.content)),new Li(s)))))}lock(i){return this.http.request(w.LOCK,i.dataUrl)}unlock(i,n=!1){let s=n?new it().set("forceAsOwner","true"):null;return this.http.request(w.UNLOCK,i.dataUrl,{params:s})}unlockRequest(i){return this.http.request(w.UNLOCK,`${rt}/${w.UNLOCK_REQUEST}/${i.path}`)}getSize(i){return this.http.get(`${rt}/${w.GET_SIZE}/${i.path}`).pipe(et(n=>n.size))}openLockDialog(i){this.layout.openDialog(So,null,{initialState:{file:i}})}openOverwriteDialog(i,n){return B(this,null,function*(){let s=this.layout.openDialog(ko,null,{initialState:{files:i,renamedTo:n}});return new Promise(r=>{s.content.overwrite.subscribe(r)})})}openViewerDialog(i,n,s,r){return B(this,null,function*(){this.http.head(n.dataUrl).subscribe({next:()=>B(this,null,function*(){let a;try{a=yield this.viewerHook(i,n)}catch{this.download(n);return}let l=n?.lock?.isExclusive&&n.lock?.ownerLogin!==this.store.user.getValue().login;l&&this.layout.sendNotification("info","The file is locked",n.lock.owner);let h=!l&&r.indexOf(Cs.MODIFY)>-1;i===le.EDIT&&!h&&(i=le.VIEW),this.layout.openDialog(Jr,"full",{id:n.id,initialState:{currentFile:n,directoryFiles:s,mode:i,isWriteable:h,hookedShortMime:a}})}),error:a=>{this.layout.sendNotification("error","Unable to open document",n?.name,a)}})})}viewerHook(i,n){return B(this,null,function*(){let s=yield this.getOnlyOfficeStatus();if(n.shortMime===we.DOCUMENT&&!s){if(n.mime.startsWith("text-"))return we.TEXT;throw new Error("Feature not enabled")}return n.shortMime===we.PDF&&i===le.EDIT&&s?we.DOCUMENT:n.shortMime})}getOnlyOfficeStatus(){return B(this,null,function*(){if(this.store.filesOnlyOffice().enabled!==null)return this.store.filesOnlyOffice().enabled;try{let i=yield De(this.http.get(vo));return this.store.filesOnlyOffice.set(i),i.enabled}catch{let i={enabled:!1};return this.store.filesOnlyOffice.set(i),i.enabled}})}isValidName(i){try{return xs(i),!0}catch(n){return this.layout.sendNotification("error","Rename",`${this.layout.translateString(n.message)} : ${ks}`),!1}}};t.\u0275fac=function(n){return new(n||t)},t.\u0275prov=J({token:t,factory:t.\u0275fac,providedIn:"root"});let e=t;return e})();export{w as a,le as b,rt as c,Rc as d,tn as e,Co as f,Io as g,Ce as h,Fi as i,Yr as j,at as k};
@@ -1 +0,0 @@
1
- import{a,b,c,d}from"./chunk-NN4ONTOT.js";import"./chunk-H6WOTGQ5.js";import"./chunk-EDJAISWO.js";import"./chunk-KAVP6UXH.js";export{d as css,b as cssCompletionSource,c as cssLanguage,a as defineCSSCompletionSource};